From: jsimomaa Date: Tue, 4 Apr 2017 06:23:12 +0000 (+0300) Subject: Adding integrated tile server X-Git-Tag: v1.31.0~11 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F99%2F399%2F1;p=simantics%2Fdistrict.git Adding integrated tile server refs #6958 Change-Id: I3e65ec92b2c7c60f95b7fd56f64a7805d1b6c5db --- diff --git a/org.simantics.maps.server.feature/.project b/org.simantics.maps.server.feature/.project new file mode 100644 index 00000000..5f6a6cb4 --- /dev/null +++ b/org.simantics.maps.server.feature/.project @@ -0,0 +1,17 @@ + + + org.simantics.maps.server.feature + + + + + + org.eclipse.pde.FeatureBuilder + + + + + + org.eclipse.pde.FeatureNature + + diff --git a/org.simantics.maps.server.feature/build.properties b/org.simantics.maps.server.feature/build.properties new file mode 100644 index 00000000..64f93a9f --- /dev/null +++ b/org.simantics.maps.server.feature/build.properties @@ -0,0 +1 @@ +bin.includes = feature.xml diff --git a/org.simantics.maps.server.feature/feature.xml b/org.simantics.maps.server.feature/feature.xml new file mode 100644 index 00000000..6feb1d77 --- /dev/null +++ b/org.simantics.maps.server.feature/feature.xml @@ -0,0 +1,26 @@ + + + + + [Enter Feature Description here.] + + + + [Enter Copyright Description here.] + + + + [Enter License Description here.] + + + + + diff --git a/org.simantics.maps.server.ui/.classpath b/org.simantics.maps.server.ui/.classpath new file mode 100644 index 00000000..eca7bdba --- /dev/null +++ b/org.simantics.maps.server.ui/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.simantics.maps.server.ui/.project b/org.simantics.maps.server.ui/.project new file mode 100644 index 00000000..3657e182 --- /dev/null +++ b/org.simantics.maps.server.ui/.project @@ -0,0 +1,28 @@ + + + org.simantics.maps.server.ui + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/org.simantics.maps.server.ui/META-INF/MANIFEST.MF b/org.simantics.maps.server.ui/META-INF/MANIFEST.MF new file mode 100644 index 00000000..73e4b27b --- /dev/null +++ b/org.simantics.maps.server.ui/META-INF/MANIFEST.MF @@ -0,0 +1,18 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Simantics Maps Server UI +Bundle-SymbolicName: org.simantics.maps.server.ui;singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-Activator: org.simantics.maps.server.ui.Activator +Require-Bundle: org.eclipse.core.runtime, + org.simantics.maps.server;bundle-version="1.0.0", + org.eclipse.ui.ide, + org.eclipse.jface, + org.eclipse.ui.workbench, + org.simantics.project, + org.eclipse.e4.core.commands, + org.eclipse.e4.core.contexts, + org.simantics.ui, + org.slf4j.api +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Bundle-ActivationPolicy: lazy diff --git a/org.simantics.maps.server.ui/build.properties b/org.simantics.maps.server.ui/build.properties new file mode 100644 index 00000000..e9863e28 --- /dev/null +++ b/org.simantics.maps.server.ui/build.properties @@ -0,0 +1,5 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml diff --git a/org.simantics.maps.server.ui/plugin.xml b/org.simantics.maps.server.ui/plugin.xml new file mode 100644 index 00000000..f7581797 --- /dev/null +++ b/org.simantics.maps.server.ui/plugin.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + diff --git a/org.simantics.maps.server.ui/src/org/simantics/maps/server/ui/Activator.java b/org.simantics.maps.server.ui/src/org/simantics/maps/server/ui/Activator.java new file mode 100644 index 00000000..cd46e1a5 --- /dev/null +++ b/org.simantics.maps.server.ui/src/org/simantics/maps/server/ui/Activator.java @@ -0,0 +1,52 @@ +package org.simantics.maps.server.ui; + +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; +import org.simantics.district.maps.server.TileserverMapnikInstance; +import org.simantics.district.maps.server.prefs.MapsServerPreferences; + +public class Activator implements BundleActivator { + + public static final String PLUGIN_ID = "org.simantics.maps.server.ui"; + + private static BundleContext context; + + static BundleContext getContext() { + return context; + } + + /* + * (non-Javadoc) + * + * @see org.osgi.framework.BundleActivator#start(org.osgi.framework. + * BundleContext) + */ + public void start(BundleContext bundleContext) throws Exception { + Activator.context = bundleContext; + + // Let's see if server should be automatically started + if (MapsServerPreferences.startAutomatically()) { + // execute in a separate thread to not slow down the startup process + new Thread(() -> { + try { + TileserverMapnikInstance.get().start(); + } catch (Exception e) { + e.printStackTrace(); + } + }).start(); + } + } + + /* + * (non-Javadoc) + * + * @see + * org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext bundleContext) throws Exception { + // Stop the server + TileserverMapnikInstance.get().stop(); + Activator.context = null; + } + +} diff --git a/org.simantics.maps.server.ui/src/org/simantics/maps/server/ui/MapsServerProjectFeature.java b/org.simantics.maps.server.ui/src/org/simantics/maps/server/ui/MapsServerProjectFeature.java new file mode 100644 index 00000000..e1c465dd --- /dev/null +++ b/org.simantics.maps.server.ui/src/org/simantics/maps/server/ui/MapsServerProjectFeature.java @@ -0,0 +1,13 @@ +package org.simantics.maps.server.ui; + +import org.simantics.project.features.AbstractProjectFeature; + +/** + * TODO: Maybe a better way to force loading of this plug-in and Activator.start() method to get executed + * + * @author Jani Simomaa + * + */ +public class MapsServerProjectFeature extends AbstractProjectFeature { + +} diff --git a/org.simantics.maps.server.ui/src/org/simantics/maps/server/ui/prefs/MapsServerPreferencePage.java b/org.simantics.maps.server.ui/src/org/simantics/maps/server/ui/prefs/MapsServerPreferencePage.java new file mode 100644 index 00000000..645dbda9 --- /dev/null +++ b/org.simantics.maps.server.ui/src/org/simantics/maps/server/ui/prefs/MapsServerPreferencePage.java @@ -0,0 +1,200 @@ +package org.simantics.maps.server.ui.prefs; + +import java.io.IOException; +import java.net.URISyntaxException; +import java.util.List; + +import org.eclipse.core.runtime.preferences.InstanceScope; +import org.eclipse.jface.layout.GridDataFactory; +import org.eclipse.jface.layout.GridLayoutFactory; +import org.eclipse.jface.preference.BooleanFieldEditor; +import org.eclipse.jface.preference.ComboFieldEditor; +import org.eclipse.jface.preference.FieldEditorPreferencePage; +import org.eclipse.jface.preference.FileFieldEditor; +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.jface.preference.IntegerFieldEditor; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Group; +import org.eclipse.swt.widgets.Label; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.IWorkbenchPreferencePage; +import org.eclipse.ui.preferences.ScopedPreferenceStore; +import org.simantics.district.maps.server.TileserverMapnik; +import org.simantics.district.maps.server.TileserverMapnikInstance; +import org.simantics.district.maps.server.prefs.MapsServerPreferences; +import org.simantics.ui.workbench.e4.E4WorkbenchUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class MapsServerPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage { + + private static final Logger LOGGER = LoggerFactory.getLogger(MapsServerPreferencePage.class); + + private TileserverMapnik server; + + public MapsServerPreferencePage() { + super(GRID); + setDescription("Maps server preferences"); + } + + @Override + public void init(IWorkbench workbench) { + try { + server = TileserverMapnikInstance.get(); + } catch (IOException | URISyntaxException e) { + LOGGER.error("Could not initialize " + getClass(), e); + } + } + + @Override + protected IPreferenceStore doGetPreferenceStore() { + return new ScopedPreferenceStore(InstanceScope.INSTANCE, MapsServerPreferences.P_NODE); + } + + private void createServerStatusField(Composite parent) { + Label label = new Label(parent, SWT.NONE); + String labelText = ""; + String buttonText = ""; + int labelColor = -1; + boolean running = false; + try { + if (server.isRunning()) { + running = true; + buttonText = "Stop"; + labelText = "running"; + labelColor = SWT.COLOR_DARK_GREEN; + } else { + labelText = "stopped"; + buttonText = "Start"; + } + } catch (IOException | InterruptedException e) { + LOGGER.error("Could not create server status field!", e); + labelText = "unknown"; + labelColor = SWT.COLOR_DARK_RED; + } + label.setText("Tileserver is currently " + labelText); + label.setForeground(getShell().getDisplay().getSystemColor(labelColor)); + + Button b = new Button(parent, SWT.NONE); + b.setText(buttonText + " server"); + b.addSelectionListener(new SelectionAdapter() { + + @Override + public void widgetSelected(SelectionEvent e) { + try { + if (server.isRunning()) { + server.stop(); + } else { + server.start(); + } + + } catch (Exception ex) { + LOGGER.error("Could not start/stop server", ex); + } + } + }); + } + + private void createGeneralGroup() { + Group serverGroup = new Group(getFieldEditorParent(), SWT.NONE); + serverGroup.setText("General"); + GridDataFactory.fillDefaults().grab(true, false).span(2, 1).applyTo(serverGroup); + + createServerStatusField(serverGroup); + + IntegerFieldEditor port = new IntegerFieldEditor(MapsServerPreferences.P_DEFAULT_PORT, "Tileserver port", serverGroup); + addField(port); + + BooleanFieldEditor automatically = new BooleanFieldEditor(MapsServerPreferences.P_START_AUTOMATICALLY, "Start tileserver automatically", serverGroup); + addField(automatically); + + Button openInExplorer = new Button(serverGroup, SWT.NONE); + openInExplorer.setText("Open server folder"); + openInExplorer.addSelectionListener(new SelectionAdapter() { + + @Override + public void widgetSelected(SelectionEvent e) { + E4WorkbenchUtils.showInSystemExplorer(""); + } + }); + + GridLayoutFactory.fillDefaults().numColumns(2).equalWidth(false).extendedMargins(12, 12, 12, 12).spacing(5, 4).applyTo(serverGroup); + } + + @Override + protected void createFieldEditors() { + createGeneralGroup(); + + createStylesGroup(); + + createTilesGroup(); + } + + private void createStylesGroup() { + Group stylesGroup = new Group(getFieldEditorParent(), SWT.NONE); + stylesGroup.setText("Styles"); + GridDataFactory.fillDefaults().grab(true, false).span(2, 1).applyTo(stylesGroup); + + createTM2StylesField(stylesGroup); + + GridLayoutFactory.fillDefaults().numColumns(2).equalWidth(false).extendedMargins(12, 12, 12, 12).spacing(5, 4).applyTo(stylesGroup); + } + + private void createTM2StylesField(Composite parent) { + try { + List styles = server.listStyles(); + + String[][] namesAndValues = new String[styles.size()][]; + for (int i = 0; i < styles.size(); i++) { + String style = styles.get(i); + String[] nameAndValue = new String[2]; + nameAndValue[0] = style; + nameAndValue[1] = style; + namesAndValues[i] = nameAndValue; + } + + ComboFieldEditor selector = new ComboFieldEditor("Styles", "Tile Styles", namesAndValues, parent); + } catch (IOException e) { + e.printStackTrace(); + } + } + + private void createTilesGroup() { + Group tilesGroup = new Group(getFieldEditorParent(), SWT.NONE); + tilesGroup.setText("MBTiles"); + GridDataFactory.fillDefaults().grab(true, false).span(2, 1).applyTo(tilesGroup); + + createTilesField(tilesGroup); + + GridLayoutFactory.fillDefaults().numColumns(2).equalWidth(false).extendedMargins(12, 12, 12, 12).spacing(5, 4).applyTo(tilesGroup); + } + + private void createTilesField(Composite parent) { + try { + List tiles = server.availableMBTiles(); + + String[][] namesAndValues = new String[tiles.size()][]; + for (int i = 0; i < tiles.size(); i++) { + String style = tiles.get(i); + String[] nameAndValue = new String[2]; + nameAndValue[0] = style; + nameAndValue[1] = style; + namesAndValues[i] = nameAndValue; + } + + ComboFieldEditor selector = new ComboFieldEditor("MBTiles", "MBTiles", namesAndValues, parent); + + + FileFieldEditor addNew = new FileFieldEditor("add new", "Add new tiles", parent); + + } catch (IOException e) { + LOGGER.error("Could not create tiles field", e); + } + } + + +} diff --git a/org.simantics.maps.server/.classpath b/org.simantics.maps.server/.classpath new file mode 100644 index 00000000..89b43af9 --- /dev/null +++ b/org.simantics.maps.server/.classpath @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/.gitignore b/org.simantics.maps.server/.gitignore new file mode 100644 index 00000000..da22ff25 --- /dev/null +++ b/org.simantics.maps.server/.gitignore @@ -0,0 +1,2 @@ +server/tileserver-mapnik/node_modules +server/pid diff --git a/org.simantics.maps.server/.project b/org.simantics.maps.server/.project new file mode 100644 index 00000000..412ef6ac --- /dev/null +++ b/org.simantics.maps.server/.project @@ -0,0 +1,28 @@ + + + org.simantics.maps.server + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/org.simantics.maps.server/META-INF/MANIFEST.MF b/org.simantics.maps.server/META-INF/MANIFEST.MF new file mode 100644 index 00000000..29555240 --- /dev/null +++ b/org.simantics.maps.server/META-INF/MANIFEST.MF @@ -0,0 +1,25 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Server +Bundle-SymbolicName: org.simantics.maps.server +Bundle-Version: 1.0.0.qualifier +Bundle-Activator: org.simantics.district.maps.server.Activator +Require-Bundle: org.eclipse.core.runtime, + org.apache.commons.lang;bundle-version="2.6.0", + org.slf4j.api;bundle-version="1.7.20", + com.fasterxml.jackson.core.jackson-core;bundle-version="2.8.5", + com.fasterxml.jackson.core.jackson-databind;bundle-version="2.8.5", + com.fasterxml.jackson.core.jackson-annotations;bundle-version="2.8.0" +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Bundle-ActivationPolicy: lazy +Bundle-ClassPath: ., + lib/zt-exec-1.9.jar, + lib/commons-io-2.5.jar, + lib/slf4j-api-1.7.24.jar, + lib/logback-classic-1.2.1.jar, + lib/logback-core-1.2.1.jar, + lib/snakeyaml-1.18.jar, + lib/jna-4.3.0.jar, + lib/zt-process-killer-1.6.jar +Export-Package: org.simantics.district.maps.server, + org.simantics.district.maps.server.prefs diff --git a/org.simantics.maps.server/build.properties b/org.simantics.maps.server/build.properties new file mode 100644 index 00000000..91a69260 --- /dev/null +++ b/org.simantics.maps.server/build.properties @@ -0,0 +1,12 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + lib/zt-exec-1.9.jar,\ + lib/commons-io-2.5.jar,\ + lib/slf4j-api-1.7.24.jar,\ + lib/logback-classic-1.2.1.jar,\ + lib/logback-core-1.2.1.jar,\ + lib/snakeyaml-1.18.jar,\ + lib/jna-4.3.0.jar,\ + lib/zt-process-killer-1.6.jar diff --git a/org.simantics.maps.server/lib/commons-io-2.5.jar b/org.simantics.maps.server/lib/commons-io-2.5.jar new file mode 100644 index 00000000..107b061f Binary files /dev/null and b/org.simantics.maps.server/lib/commons-io-2.5.jar differ diff --git a/org.simantics.maps.server/lib/jna-4.3.0.jar b/org.simantics.maps.server/lib/jna-4.3.0.jar new file mode 100644 index 00000000..713354e5 Binary files /dev/null and b/org.simantics.maps.server/lib/jna-4.3.0.jar differ diff --git a/org.simantics.maps.server/lib/logback-classic-1.2.1.jar b/org.simantics.maps.server/lib/logback-classic-1.2.1.jar new file mode 100644 index 00000000..4b6e8844 Binary files /dev/null and b/org.simantics.maps.server/lib/logback-classic-1.2.1.jar differ diff --git a/org.simantics.maps.server/lib/logback-core-1.2.1.jar b/org.simantics.maps.server/lib/logback-core-1.2.1.jar new file mode 100644 index 00000000..840b0f52 Binary files /dev/null and b/org.simantics.maps.server/lib/logback-core-1.2.1.jar differ diff --git a/org.simantics.maps.server/lib/slf4j-api-1.7.24.jar b/org.simantics.maps.server/lib/slf4j-api-1.7.24.jar new file mode 100644 index 00000000..05941a12 Binary files /dev/null and b/org.simantics.maps.server/lib/slf4j-api-1.7.24.jar differ diff --git a/org.simantics.maps.server/lib/snakeyaml-1.18.jar b/org.simantics.maps.server/lib/snakeyaml-1.18.jar new file mode 100644 index 00000000..e3fac8e7 Binary files /dev/null and b/org.simantics.maps.server/lib/snakeyaml-1.18.jar differ diff --git a/org.simantics.maps.server/lib/zt-exec-1.9.jar b/org.simantics.maps.server/lib/zt-exec-1.9.jar new file mode 100644 index 00000000..9b4b7a37 Binary files /dev/null and b/org.simantics.maps.server/lib/zt-exec-1.9.jar differ diff --git a/org.simantics.maps.server/lib/zt-process-killer-1.6.jar b/org.simantics.maps.server/lib/zt-process-killer-1.6.jar new file mode 100644 index 00000000..ad4eb0e7 Binary files /dev/null and b/org.simantics.maps.server/lib/zt-process-killer-1.6.jar differ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/CHANGELOG.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/CHANGELOG.md new file mode 100644 index 00000000..974cbb51 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/CHANGELOG.md @@ -0,0 +1,9547 @@ +# Node.js ChangeLog + +## 2017-02-21, Version 4.8.0 'Argon' (LTS), @MylesBorins + +This LTS release comes with 118 commits. This includes 73 which are doc +related, 19 which are test related, 6 which are build / tool related, and 5 +commits which are updates to dependencies. + +### Notable Changes + +* **child_process**: add shell option to spawn() (cjihrig) [#4598](https://github.com/nodejs/node/pull/4598) +* **deps**: + * **v8**: expose statistics about heap spaces (Ben Ripkens) [#4463](https://github.com/nodejs/node/pull/4463) +* **crypto**: + * add ALPN Support (Shigeki Ohtsu) [#2564](https://github.com/nodejs/node/pull/2564) + * allow adding extra certs to well-known CAs (Sam Roberts) [#9139](https://github.com/nodejs/node/pull/9139) +* **fs**: add the fs.mkdtemp() function. (Florian MARGAINE) [#5333](https://github.com/nodejs/node/pull/5333) +* **process**: + * add `externalMemory` to `process` (Fedor Indutny) [#9587](https://github.com/nodejs/node/pull/9587) + * add process.cpuUsage() (Patrick Mueller) [#10796](https://github.com/nodejs/node/pull/10796) + +### Commits + +* [[`78010aa0cd`](https://github.com/nodejs/node/commit/78010aa0cd)] - **build**: add /opt/freeware/... to AIX library path (Stewart X Addison) [#10128](https://github.com/nodejs/node/pull/10128) +* [[`0bb77f24fa`](https://github.com/nodejs/node/commit/0bb77f24fa)] - **build**: add (not) cross-compiled configure flags (Jesús Leganés-Combarro 'piranna) [#10287](https://github.com/nodejs/node/pull/10287) +* [[`58245225ef`](https://github.com/nodejs/node/commit/58245225ef)] - **(SEMVER-MINOR)** **child_process**: add shell option to spawn() (cjihrig) [#4598](https://github.com/nodejs/node/pull/4598) +* [[`1595328b44`](https://github.com/nodejs/node/commit/1595328b44)] - **(SEMVER-MINOR)** **crypto**: allow adding extra certs to well-known CAs (Sam Roberts) [#9139](https://github.com/nodejs/node/pull/9139) +* [[`bf882fba35`](https://github.com/nodejs/node/commit/bf882fba35)] - **crypto**: Use reference count to manage cert_store (Adam Majer) [#9409](https://github.com/nodejs/node/pull/9409) +* [[`4cf7dcff99`](https://github.com/nodejs/node/commit/4cf7dcff99)] - **crypto**: remove unnecessary variables of alpn/npn (Shigeki Ohtsu) [#10831](https://github.com/nodejs/node/pull/10831) +* [[`d8b902f787`](https://github.com/nodejs/node/commit/d8b902f787)] - **debugger**: call `this.resume()` after `this.run()` (Lance Ball) [#10099](https://github.com/nodejs/node/pull/10099) +* [[`4e07bd45d6`](https://github.com/nodejs/node/commit/4e07bd45d6)] - **deps**: update patch level in V8 (Myles Borins) [#10668](https://github.com/nodejs/node/pull/10668) +* [[`a234d445c4`](https://github.com/nodejs/node/commit/a234d445c4)] - **deps**: backport a715957 from V8 upstream (Myles Borins) [#10668](https://github.com/nodejs/node/pull/10668) +* [[`ce66c8e424`](https://github.com/nodejs/node/commit/ce66c8e424)] - **deps**: backport 7a88ff3 from V8 upstream (Myles Borins) [#10668](https://github.com/nodejs/node/pull/10668) +* [[`8bd3d83e01`](https://github.com/nodejs/node/commit/8bd3d83e01)] - **deps**: backport d800a65 from V8 upstream (Myles Borins) [#10668](https://github.com/nodejs/node/pull/10668) +* [[`81e9a3bfcb`](https://github.com/nodejs/node/commit/81e9a3bfcb)] - **deps**: V8: fix debug backtrace for symbols (Ali Ijaz Sheikh) [#10732](https://github.com/nodejs/node/pull/10732) +* [[`d8961bdb3b`](https://github.com/nodejs/node/commit/d8961bdb3b)] - **doc**: correct vcbuild options for windows testing (Jonathan Boarman) [#10686](https://github.com/nodejs/node/pull/10686) +* [[`d3c5bc1c63`](https://github.com/nodejs/node/commit/d3c5bc1c63)] - **doc**: update BUILDING.md (rainabba) [#8704](https://github.com/nodejs/node/pull/8704) +* [[`d61c181085`](https://github.com/nodejs/node/commit/d61c181085)] - **doc**: unify dirname and filename description (Sam Roberts) [#10527](https://github.com/nodejs/node/pull/10527) +* [[`8eeccd82d2`](https://github.com/nodejs/node/commit/8eeccd82d2)] - **doc**: killSignal option accepts integer values (Sakthipriyan Vairamani (thefourtheye)) [#10424](https://github.com/nodejs/node/pull/10424) +* [[`7db7e47d7b`](https://github.com/nodejs/node/commit/7db7e47d7b)] - **doc**: change logical to bitwise OR in dns lookup (Sakthipriyan Vairamani (thefourtheye)) [#11037](https://github.com/nodejs/node/pull/11037) +* [[`28b707ba42`](https://github.com/nodejs/node/commit/28b707ba42)] - **doc**: replace newlines in deprecation with space (Sakthipriyan Vairamani (thefourtheye)) [#11074](https://github.com/nodejs/node/pull/11074) +* [[`79d49866f2`](https://github.com/nodejs/node/commit/79d49866f2)] - **doc**: update CONTRIBUTING.MD with link to V8 guide (sarahmeyer) [#10070](https://github.com/nodejs/node/pull/10070) +* [[`acbe4d3516`](https://github.com/nodejs/node/commit/acbe4d3516)] - **doc**: add joyeecheung to collaborators (Joyee Cheung) [#10603](https://github.com/nodejs/node/pull/10603) +* [[`c7378c4d5f`](https://github.com/nodejs/node/commit/c7378c4d5f)] - **doc**: warn about unvalidated input in child_process (Matthew Garrett) [#10466](https://github.com/nodejs/node/pull/10466) +* [[`08e924e45c`](https://github.com/nodejs/node/commit/08e924e45c)] - **doc**: require two-factor authentication (Rich Trott) [#10529](https://github.com/nodejs/node/pull/10529) +* [[`d260fb2e7e`](https://github.com/nodejs/node/commit/d260fb2e7e)] - **doc**: use "Node.js" in V8 guide (Rich Trott) [#10438](https://github.com/nodejs/node/pull/10438) +* [[`4f168a4a31`](https://github.com/nodejs/node/commit/4f168a4a31)] - **doc**: require() tries first core not native modules (Vicente Jimenez Aguilar) [#10324](https://github.com/nodejs/node/pull/10324) +* [[`5777c79c52`](https://github.com/nodejs/node/commit/5777c79c52)] - **doc**: clarify the review and landing process (Joyee Cheung) [#10202](https://github.com/nodejs/node/pull/10202) +* [[`d3a7fb8a9e`](https://github.com/nodejs/node/commit/d3a7fb8a9e)] - **doc**: redirect 'Start a Working Group' to TSC repo (William Kapke) [#9655](https://github.com/nodejs/node/pull/9655) +* [[`0e51cbb827`](https://github.com/nodejs/node/commit/0e51cbb827)] - **doc**: add Working Group dissolution text (William Kapke) [#9656](https://github.com/nodejs/node/pull/9656) +* [[`919e0cb8f2`](https://github.com/nodejs/node/commit/919e0cb8f2)] - **doc**: more efficient example in the console.md (Vse Mozhet Byt) [#10451](https://github.com/nodejs/node/pull/10451) +* [[`70ea38f2ee`](https://github.com/nodejs/node/commit/70ea38f2ee)] - **doc**: var -> const / let in the console.md (Vse Mozhet Byt) [#10451](https://github.com/nodejs/node/pull/10451) +* [[`dda777bf9e`](https://github.com/nodejs/node/commit/dda777bf9e)] - **doc**: consistent 'Returns:' part two (Myles Borins) [#10391](https://github.com/nodejs/node/pull/10391) +* [[`3b252a69a0`](https://github.com/nodejs/node/commit/3b252a69a0)] - **doc**: clarify macosx-firewall suggestion BUILDING (Chase Starr) [#10311](https://github.com/nodejs/node/pull/10311) +* [[`c4df02c815`](https://github.com/nodejs/node/commit/c4df02c815)] - **doc**: add Michaël Zasso to the CTC (Michaël Zasso) +* [[`2269d7db0f`](https://github.com/nodejs/node/commit/2269d7db0f)] - **(SEMVER-MINOR)** **fs**: add the fs.mkdtemp() function. (Florian MARGAINE) [#5333](https://github.com/nodejs/node/pull/5333) +* [[`2eda3c7c75`](https://github.com/nodejs/node/commit/2eda3c7c75)] - **lib,test**: use consistent operator linebreak style (Michaël Zasso) [#10178](https://github.com/nodejs/node/pull/10178) +* [[`7505b86d2f`](https://github.com/nodejs/node/commit/7505b86d2f)] - **os**: fix os.release() for aix and add test (jBarz) [#10245](https://github.com/nodejs/node/pull/10245) +* [[`7a9c8d8f10`](https://github.com/nodejs/node/commit/7a9c8d8f10)] - **(SEMVER-MINOR)** **process**: add process.cpuUsage() - implementation, doc, tests (Patrick Mueller) [#10796](https://github.com/nodejs/node/pull/10796) +* [[`23a573f7cb`](https://github.com/nodejs/node/commit/23a573f7cb)] - **(SEMVER-MINOR)** **process**: add `process.memoryUsage.external` (Fedor Indutny) [#9587](https://github.com/nodejs/node/pull/9587) +* [[`be6203715a`](https://github.com/nodejs/node/commit/be6203715a)] - **src**: describe what NODE_MODULE_VERSION is for (Sam Roberts) [#10414](https://github.com/nodejs/node/pull/10414) +* [[`3f29cbb5bc`](https://github.com/nodejs/node/commit/3f29cbb5bc)] - **src**: fix string format mistake for 32 bit node (Alex Newman) [#10082](https://github.com/nodejs/node/pull/10082) +* [[`271f5783fe`](https://github.com/nodejs/node/commit/271f5783fe)] - **stream, test**: test _readableState.emittedReadable (Joyee Cheung) [#10249](https://github.com/nodejs/node/pull/10249) +* [[`c279cbe6a9`](https://github.com/nodejs/node/commit/c279cbe6a9)] - **test**: fix test.py command line options processing (Julien Gilli) [#11153](https://github.com/nodejs/node/pull/11153) +* [[`0f5d82e583`](https://github.com/nodejs/node/commit/0f5d82e583)] - **test**: add --abort-on-timeout option to test.py (Julien Gilli) [#11086](https://github.com/nodejs/node/pull/11086) +* [[`735119c6fb`](https://github.com/nodejs/node/commit/735119c6fb)] - **test**: cleanup stream tests (Italo A. Casas) [#8668](https://github.com/nodejs/node/pull/8668) +* [[`f9f8e4ee3e`](https://github.com/nodejs/node/commit/f9f8e4ee3e)] - **test**: refactor test-preload (Rich Trott) [#9803](https://github.com/nodejs/node/pull/9803) +* [[`e7c4dfb83b`](https://github.com/nodejs/node/commit/e7c4dfb83b)] - **test**: invalid package.json causes error when require()ing in directory (Sam Shull) [#10044](https://github.com/nodejs/node/pull/10044) +* [[`22226fa900`](https://github.com/nodejs/node/commit/22226fa900)] - **test**: refactoring test-pipe-head (Travis Bretton) [#10036](https://github.com/nodejs/node/pull/10036) +* [[`11115c0d85`](https://github.com/nodejs/node/commit/11115c0d85)] - **test**: add second argument to assert.throws() (Ken Russo) [#9987](https://github.com/nodejs/node/pull/9987) +* [[`96ca40bdd8`](https://github.com/nodejs/node/commit/96ca40bdd8)] - **test**: refactor test-tls-0-dns-altname (Richard Karmazin) [#9948](https://github.com/nodejs/node/pull/9948) +* [[`98496b6d3e`](https://github.com/nodejs/node/commit/98496b6d3e)] - **test**: test: refactor test-sync-fileread (Jason Wohlgemuth) [#9941](https://github.com/nodejs/node/pull/9941) +* [[`324c82b1c9`](https://github.com/nodejs/node/commit/324c82b1c9)] - **test**: use common.fixturesDir almost everywhere (Bryan English) [#6997](https://github.com/nodejs/node/pull/6997) +* [[`ce91bb21ba`](https://github.com/nodejs/node/commit/ce91bb21ba)] - **test**: refactor test-repl-mode.js (Cesar Hernandez) [#10061](https://github.com/nodejs/node/pull/10061) +* [[`61cbc202a1`](https://github.com/nodejs/node/commit/61cbc202a1)] - **test**: refactor test-net-dns-custom-lookup (Kent.Fan) [#10071](https://github.com/nodejs/node/pull/10071) +* [[`812c6361ff`](https://github.com/nodejs/node/commit/812c6361ff)] - **test**: refactor test-tls-server-verify (Hutson Betts) [#10076](https://github.com/nodejs/node/pull/10076) +* [[`19907c27a6`](https://github.com/nodejs/node/commit/19907c27a6)] - **test**: use mustCall() for simple flow tracking (cjihrig) [#7753](https://github.com/nodejs/node/pull/7753) +* [[`42da81e6cc`](https://github.com/nodejs/node/commit/42da81e6cc)] - **test**: set stdin too for pseudo-tty tests (Anna Henningsen) [#10149](https://github.com/nodejs/node/pull/10149) +* [[`53404dbc1f`](https://github.com/nodejs/node/commit/53404dbc1f)] - **test**: add stdin-setrawmode.out file (Jonathan Darling) [#10149](https://github.com/nodejs/node/pull/10149) +* [[`1fac431307`](https://github.com/nodejs/node/commit/1fac431307)] - **test**: add tests for clearBuffer state machine (Safia Abdalla) [#9922](https://github.com/nodejs/node/pull/9922) +* [[`37a362275e`](https://github.com/nodejs/node/commit/37a362275e)] - **test**: update test-cluster-shared-handle-bind-error (cjihrig) [#10547](https://github.com/nodejs/node/pull/10547) +* [[`f5e54f5d5f`](https://github.com/nodejs/node/commit/f5e54f5d5f)] - **test**: avoid assigning this to variables (cjihrig) [#10548](https://github.com/nodejs/node/pull/10548) +* [[`28a5ce10af`](https://github.com/nodejs/node/commit/28a5ce10af)] - **test**: improve test-http-allow-req-after-204-res (Adrian Estrada) [#10503](https://github.com/nodejs/node/pull/10503) +* [[`52edebc8f3`](https://github.com/nodejs/node/commit/52edebc8f3)] - **test**: improve test-fs-empty-readStream.js (Adrian Estrada) [#10479](https://github.com/nodejs/node/pull/10479) +* [[`b74bc517a6`](https://github.com/nodejs/node/commit/b74bc517a6)] - **test**: use strictEqual in test-http-server (Fabrice Tatieze) [#10478](https://github.com/nodejs/node/pull/10478) +* [[`a9cd1d1267`](https://github.com/nodejs/node/commit/a9cd1d1267)] - **test**: refactor test-stream2-unpipe-drain (Chris Story) [#10033](https://github.com/nodejs/node/pull/10033) +* [[`7020e9fd8b`](https://github.com/nodejs/node/commit/7020e9fd8b)] - **test**: add test for SIGWINCH handling by stdio.js (Sarah Meyer) [#10063](https://github.com/nodejs/node/pull/10063) +* [[`56b193a9c2`](https://github.com/nodejs/node/commit/56b193a9c2)] - **test**: improve code in test-vm-preserves-property (Adrian Estrada) [#10428](https://github.com/nodejs/node/pull/10428) +* [[`8a26ba142f`](https://github.com/nodejs/node/commit/8a26ba142f)] - **test**: fix flaky test-https-timeout (Rich Trott) [#10404](https://github.com/nodejs/node/pull/10404) +* [[`eeb2d7885a`](https://github.com/nodejs/node/commit/eeb2d7885a)] - **test**: improve test-cluster-worker-constructor.js (Adrian Estrada) [#10396](https://github.com/nodejs/node/pull/10396) +* [[`fd195b47d6`](https://github.com/nodejs/node/commit/fd195b47d6)] - **test**: stream readable resumeScheduled state (Italo A. Casas) [#10299](https://github.com/nodejs/node/pull/10299) +* [[`135a7c9e19`](https://github.com/nodejs/node/commit/135a7c9e19)] - **test**: stream readable needReadable state (Joyee Cheung) [#10241](https://github.com/nodejs/node/pull/10241) +* [[`f412b1fcfd`](https://github.com/nodejs/node/commit/f412b1fcfd)] - **test**: clean up domain-no-error-handler test (weyj4) [#10291](https://github.com/nodejs/node/pull/10291) +* [[`14c28ebcf1`](https://github.com/nodejs/node/commit/14c28ebcf1)] - **test**: update test-domain-uncaught-exception.js (Andy Chen) [#10193](https://github.com/nodejs/node/pull/10193) +* [[`928291c652`](https://github.com/nodejs/node/commit/928291c652)] - **test**: refactor test-domain.js (Siddhartha Sahai) [#10207](https://github.com/nodejs/node/pull/10207) +* [[`13c6cec433`](https://github.com/nodejs/node/commit/13c6cec433)] - **test**: fail for missing output files (Anna Henningsen) [#10150](https://github.com/nodejs/node/pull/10150) +* [[`544920f77b`](https://github.com/nodejs/node/commit/544920f77b)] - **test**: stream readableState readingMore state (Gregory) [#9868](https://github.com/nodejs/node/pull/9868) +* [[`2f8bc9a7bc`](https://github.com/nodejs/node/commit/2f8bc9a7bc)] - **test**: s/ASSERT/assert/ (cjihrig) [#10544](https://github.com/nodejs/node/pull/10544) +* [[`380a5d5e12`](https://github.com/nodejs/node/commit/380a5d5e12)] - **test**: fix flaky test-http-client-timeout-with-data (Rich Trott) [#10431](https://github.com/nodejs/node/pull/10431) +* [[`14e07c96e1`](https://github.com/nodejs/node/commit/14e07c96e1)] - **test**: refactor test-stdin-from-file (Rob Adelmann) [#10331](https://github.com/nodejs/node/pull/10331) +* [[`424c86139d`](https://github.com/nodejs/node/commit/424c86139d)] - **test**: refactor the code in test-fs-chmod (Adrian Estrada) [#10440](https://github.com/nodejs/node/pull/10440) +* [[`31aa877003`](https://github.com/nodejs/node/commit/31aa877003)] - **test**: improve the code in test-pipe.js (Adrian Estrada) [#10452](https://github.com/nodejs/node/pull/10452) +* [[`4bbd50ee07`](https://github.com/nodejs/node/commit/4bbd50ee07)] - **test**: improve code in test-fs-readfile-error (Adrian Estrada) [#10367](https://github.com/nodejs/node/pull/10367) +* [[`9840f505f0`](https://github.com/nodejs/node/commit/9840f505f0)] - **test**: improve code in test-vm-symbols (Adrian Estrada) [#10429](https://github.com/nodejs/node/pull/10429) +* [[`4efdbafeb3`](https://github.com/nodejs/node/commit/4efdbafeb3)] - **test**: refactor test-child-process-ipc (malen) [#9990](https://github.com/nodejs/node/pull/9990) +* [[`dbfec29663`](https://github.com/nodejs/node/commit/dbfec29663)] - **test**: fix and improve debug-break-on-uncaught (Sakthipriyan Vairamani (thefourtheye)) [#10370](https://github.com/nodejs/node/pull/10370) +* [[`80f4a37023`](https://github.com/nodejs/node/commit/80f4a37023)] - **test**: refactor test-pipe-file-to-http (Josh Mays) [#10054](https://github.com/nodejs/node/pull/10054) +* [[`a983400ac2`](https://github.com/nodejs/node/commit/a983400ac2)] - **test**: refactor test-tls-interleave (Brian Chirgwin) [#10017](https://github.com/nodejs/node/pull/10017) +* [[`6db76da2c8`](https://github.com/nodejs/node/commit/6db76da2c8)] - **test**: refactor test-cluster-send-handle-twice.js (Amar Zavery) [#10049](https://github.com/nodejs/node/pull/10049) +* [[`19b314e40a`](https://github.com/nodejs/node/commit/19b314e40a)] - **test**: update test-tls-check-server-identity.js (Kevin Cox) [#9986](https://github.com/nodejs/node/pull/9986) +* [[`ab3e4c6a9b`](https://github.com/nodejs/node/commit/ab3e4c6a9b)] - **test**: improve test-cluster-net-listen.js (Rico Cai) [#9953](https://github.com/nodejs/node/pull/9953) +* [[`fb9a0ad6c0`](https://github.com/nodejs/node/commit/fb9a0ad6c0)] - **test**: refactor test-child-process-stdin (Segu Riluvan) [#10420](https://github.com/nodejs/node/pull/10420) +* [[`122917df5a`](https://github.com/nodejs/node/commit/122917df5a)] - **test**: change var declarations, add mustCall check (Daniel Sims) [#9962](https://github.com/nodejs/node/pull/9962) +* [[`d5e911c51e`](https://github.com/nodejs/node/commit/d5e911c51e)] - **test**: refactoring test-cluster-worker-constructor (Christopher Rokita) [#9956](https://github.com/nodejs/node/pull/9956) +* [[`7d61bbf647`](https://github.com/nodejs/node/commit/7d61bbf647)] - **test**: refactor test-stdin-script-child (Emanuel Buholzer) [#10321](https://github.com/nodejs/node/pull/10321) +* [[`76bb3cbff9`](https://github.com/nodejs/node/commit/76bb3cbff9)] - **test**: refactor test-stream2-writable (Rich Trott) [#10353](https://github.com/nodejs/node/pull/10353) +* [[`b87ee26b96`](https://github.com/nodejs/node/commit/b87ee26b96)] - **test**: change assert.strict to assert.strictEqual() (Ashita Nagesh) [#9988](https://github.com/nodejs/node/pull/9988) +* [[`4514fd78f4`](https://github.com/nodejs/node/commit/4514fd78f4)] - **test**: refactor the code in test-http-keep-alive (Adrian Estrada) [#10350](https://github.com/nodejs/node/pull/10350) +* [[`f301df405a`](https://github.com/nodejs/node/commit/f301df405a)] - **test**: use strictEqual in test-cwd-enoent-repl.js (Neeraj Sharma) [#9952](https://github.com/nodejs/node/pull/9952) +* [[`3b67001c99`](https://github.com/nodejs/node/commit/3b67001c99)] - **test**: refactor test-net-reconnect-error (Duy Le) [#9903](https://github.com/nodejs/node/pull/9903) +* [[`34861efff6`](https://github.com/nodejs/node/commit/34861efff6)] - **test**: add test-require-invalid-package (Duy Le) [#9903](https://github.com/nodejs/node/pull/9903) +* [[`90a79b3967`](https://github.com/nodejs/node/commit/90a79b3967)] - **test**: refactor test-timers-this (Rich Trott) [#10315](https://github.com/nodejs/node/pull/10315) +* [[`5335b0a0d1`](https://github.com/nodejs/node/commit/5335b0a0d1)] - **test**: refactor test-tls-ecdh-disable (Aaron Williams) [#9989](https://github.com/nodejs/node/pull/9989) +* [[`0f8a323546`](https://github.com/nodejs/node/commit/0f8a323546)] - **test**: cleanup test-stdout-close-catch.js (Travis Bretton) [#10006](https://github.com/nodejs/node/pull/10006) +* [[`fc67a955e2`](https://github.com/nodejs/node/commit/fc67a955e2)] - **test**: use const/let and common.mustCall (Outsider) [#9959](https://github.com/nodejs/node/pull/9959) +* [[`2f44d7f367`](https://github.com/nodejs/node/commit/2f44d7f367)] - **test**: refactor test-crypto-random (Rich Trott) [#10232](https://github.com/nodejs/node/pull/10232) +* [[`730c3b29e8`](https://github.com/nodejs/node/commit/730c3b29e8)] - **test**: refactor test-fs-fsync (Rob Adelmann) [#10176](https://github.com/nodejs/node/pull/10176) +* [[`9c9d422433`](https://github.com/nodejs/node/commit/9c9d422433)] - **test**: refactor test-http-after-connect.js (larissayvette) [#10229](https://github.com/nodejs/node/pull/10229) +* [[`827bbe7985`](https://github.com/nodejs/node/commit/827bbe7985)] - **test**: refactor assert.equal, update syntax to ES6 (Prieto, Marcos) +* [[`121b68a283`](https://github.com/nodejs/node/commit/121b68a283)] - **test**: refactor http pipelined socket test (Rich Trott) [#10189](https://github.com/nodejs/node/pull/10189) +* [[`7ca31e38fb`](https://github.com/nodejs/node/commit/7ca31e38fb)] - **test**: fix alpn tests for openssl1.0.2h (Shigeki Ohtsu) [#6550](https://github.com/nodejs/node/pull/6550) +* [[`278d718a93`](https://github.com/nodejs/node/commit/278d718a93)] - **test**: refactor test-handle-wrap-close-abort (Rich Trott) [#10188](https://github.com/nodejs/node/pull/10188) +* [[`f12bab65b8`](https://github.com/nodejs/node/commit/f12bab65b8)] - **test**: stream readableListening internal state (Italo A. Casas) [#9864](https://github.com/nodejs/node/pull/9864) +* [[`210290dfba`](https://github.com/nodejs/node/commit/210290dfba)] - **test**: check for error on invalid signal (Matt Phillips) [#10026](https://github.com/nodejs/node/pull/10026) +* [[`4f5f0e4975`](https://github.com/nodejs/node/commit/4f5f0e4975)] - **test**: refactor test-net-keepalive.js (Kyle Corsi) [#9995](https://github.com/nodejs/node/pull/9995) +* [[`cfa2b87b5d`](https://github.com/nodejs/node/commit/cfa2b87b5d)] - **test,lib,benchmark**: match function names (Rich Trott) [#9113](https://github.com/nodejs/node/pull/9113) +* [[`a67ada7d32`](https://github.com/nodejs/node/commit/a67ada7d32)] - **tls**: copy the Buffer object before using (Sakthipriyan Vairamani) [#8055](https://github.com/nodejs/node/pull/8055) +* [[`e750f142ce`](https://github.com/nodejs/node/commit/e750f142ce)] - **(SEMVER-MINOR)** **tls, crypto**: add ALPN Support (Shigeki Ohtsu) [#2564](https://github.com/nodejs/node/pull/2564) +* [[`ef547f3325`](https://github.com/nodejs/node/commit/ef547f3325)] - **(SEMVER-MINOR)** **tls,crypto**: move NPN protcol data to hidden value (Shigeki Ohtsu) [#2564](https://github.com/nodejs/node/pull/2564) +* [[`31434a1202`](https://github.com/nodejs/node/commit/31434a1202)] - **tools**: enforce consistent operator linebreak style (Michaël Zasso) [#10178](https://github.com/nodejs/node/pull/10178) +* [[`9f13b5f7d5`](https://github.com/nodejs/node/commit/9f13b5f7d5)] - **tools**: forbid template literals in assert.throws (Michaël Zasso) [#10301](https://github.com/nodejs/node/pull/10301) +* [[`c801de9814`](https://github.com/nodejs/node/commit/c801de9814)] - **tools**: add ESLint rule for assert.throws arguments (Michaël Zasso) [#10089](https://github.com/nodejs/node/pull/10089) +* [[`b5e18f207f`](https://github.com/nodejs/node/commit/b5e18f207f)] - **tools**: add macosx-firwall script to avoid popups (Daniel Bevenius) [#10114](https://github.com/nodejs/node/pull/10114) +* [[`30d60cf81c`](https://github.com/nodejs/node/commit/30d60cf81c)] - **(SEMVER-MINOR)** **v8,src**: expose statistics about heap spaces (Ben Ripkens) [#4463](https://github.com/nodejs/node/pull/4463) +* [[`9556ef3241`](https://github.com/nodejs/node/commit/9556ef3241)] - **vm**: add error message if we abort (Franziska Hinkelmann) [#8634](https://github.com/nodejs/node/pull/8634) +* [[`fa11f4b1fc`](https://github.com/nodejs/node/commit/fa11f4b1fc)] - **win,msi**: add required UIRef for localized strings (Bill Ticehurst) [#8884](https://github.com/nodejs/node/pull/8884) + +## 2017-01-31, Version 4.7.3 'Argon' (LTS), @MylesBorins + +This is a security release of the 'Argon' release line to upgrade OpenSSL to version 1.0.2k + +Although the OpenSSL team have determined a maximum severity rating of "moderate", the Node.js +crypto team (Ben Noordhuis, Shigeki Ohtsu and Fedor Indutny) have determined the impact to Node +users is "low". Details on this determination can be found +[on the Nodejs.org website](https://nodejs.org/en/blog/vulnerability/openssl-january-2017/). + +### Notable Changes + +* **deps**: upgrade openssl sources to 1.0.2k (Shigeki Ohtsu) [#11021](https://github.com/nodejs/node/pull/11021) + +### Commits + +* [[`8029f64135`](https://github.com/nodejs/node/commit/8029f64135)] - **deps**: update openssl asm and asm_obsolete files (Shigeki Ohtsu) [#11021](https://github.com/nodejs/node/pull/11021) +* [[`0081659a41`](https://github.com/nodejs/node/commit/0081659a41)] - **deps**: add -no_rand_screen to openssl s_client (Shigeki Ohtsu) [nodejs/io.js#1836](https://github.com/nodejs/io.js/pull/1836) +* [[`e55c3f4e21`](https://github.com/nodejs/node/commit/e55c3f4e21)] - **deps**: fix asm build error of openssl in x86_win32 (Shigeki Ohtsu) [iojs/io.js#1389](https://github.com/iojs/io.js/pull/1389) +* [[`24640f9278`](https://github.com/nodejs/node/commit/24640f9278)] - **deps**: fix openssl assembly error on ia32 win32 (Fedor Indutny) [iojs/io.js#1389](https://github.com/iojs/io.js/pull/1389) +* [[`6c7bdf58e0`](https://github.com/nodejs/node/commit/6c7bdf58e0)] - **deps**: copy all openssl header files to include dir (Shigeki Ohtsu) [#11021](https://github.com/nodejs/node/pull/11021) +* [[`c80844769c`](https://github.com/nodejs/node/commit/c80844769c)] - **deps**: upgrade openssl sources to 1.0.2k (Shigeki Ohtsu) [#11021](https://github.com/nodejs/node/pull/11021) +* [[`e3915a415b`](https://github.com/nodejs/node/commit/e3915a415b)] - **openssl**: fix keypress requirement in apps on win32 (Shigeki Ohtsu) [iojs/io.js#1389](https://github.com/iojs/io.js/pull/1389) + +## 2017-01-05, Version 4.7.2 'Argon' (LTS), @MylesBorins + +This is a special release that contains 0 commits. While promoting additional +platforms for v4.7.1 after the release, the tarballs on the release server were +overwritten and now have different shasums. In order to remove any ambiguity +around the release we have opted to do a semver patch release with no changes. + +### Notable Changes + +N/A + +### Commits + +N/A + +## 2017-01-03, Version 4.7.1 'Argon' (LTS), @MylesBorins + +This LTS release comes with 180 commits. This includes 117 which are test related, +34 which are doc related, 15 which are build / tool related, and 1 commit which is +an update to dependencies. + +### Notable Changes + +* **build**: shared library support is now working for AIX builds (Stewart Addison) [#9675](https://github.com/nodejs/node/pull/9675) +* **repl**: Passing options to the repl will no longer overwrite defaults (cjihrig) [#7826](https://github.com/nodejs/node/pull/7826) +* **timers**: Re canceling a cancelled timers will no longer throw (Jeremiah Senkpiel) [#9685](https://github.com/nodejs/node/pull/9685) + +### Commits + +* [[`c5f82b8421`](https://github.com/nodejs/node/commit/c5f82b8421)] - **assert**: fix deepEqual/deepStrictEqual on equivalent typed arrays (Feross Aboukhadijeh) [#8002](https://github.com/nodejs/node/pull/8002) +* [[`60883de30f`](https://github.com/nodejs/node/commit/60883de30f)] - **async_wrap**: call destroy() callback in uv_idle_t (Trevor Norris) +* [[`28dbc460c6`](https://github.com/nodejs/node/commit/28dbc460c6)] - **async_wrap**: make Initialize a static class member (Trevor Norris) +* [[`bb05cd13db`](https://github.com/nodejs/node/commit/bb05cd13db)] - **async_wrap**: mode constructor/destructor to .cc (Trevor Norris) +* [[`b1075f6193`](https://github.com/nodejs/node/commit/b1075f6193)] - **benchmark**: split timers benchmark and refactor (Rich Trott) [#9497](https://github.com/nodejs/node/pull/9497) +* [[`7b4268b889`](https://github.com/nodejs/node/commit/7b4268b889)] - **benchmark,lib,test,tools**: remove unneeded . escape (Rich Trott) [#9449](https://github.com/nodejs/node/pull/9449) +* [[`54f2ce8ea0`](https://github.com/nodejs/node/commit/54f2ce8ea0)] - **build**: prioritise --shared-X-Y over pkg-config (Rod Vagg) [#9368](https://github.com/nodejs/node/pull/9368) +* [[`61d377ddcd`](https://github.com/nodejs/node/commit/61d377ddcd)] - **build**: Make configure file parseable on python3 (kalrover) [#9657](https://github.com/nodejs/node/pull/9657) +* [[`38e0f95d24`](https://github.com/nodejs/node/commit/38e0f95d24)] - **build**: add MAKEFLAGS="-j1" to node-gyp (Daniel Bevenius) [#9450](https://github.com/nodejs/node/pull/9450) +* [[`d1b6407395`](https://github.com/nodejs/node/commit/d1b6407395)] - **build**: make node-gyp output silent (Sakthipriyan Vairamani (thefourtheye)) [#8990](https://github.com/nodejs/node/pull/8990) +* [[`ae2eff2997`](https://github.com/nodejs/node/commit/ae2eff2997)] - **build**: start comments at beginning of line (Sakthipriyan Vairamani (thefourtheye)) [#9375](https://github.com/nodejs/node/pull/9375) +* [[`6f1f955b33`](https://github.com/nodejs/node/commit/6f1f955b33)] - **build**: default to ppc64 on AIX (Gibson Fahnestock) [#9645](https://github.com/nodejs/node/pull/9645) +* [[`f8d4577762`](https://github.com/nodejs/node/commit/f8d4577762)] - **build**: Add option to compile for coverage reports (Wayne Andrews) [#9463](https://github.com/nodejs/node/pull/9463) +* [[`f2b00985f0`](https://github.com/nodejs/node/commit/f2b00985f0)] - **build**: add shared library support to AIX build (Stewart Addison) [#9675](https://github.com/nodejs/node/pull/9675) +* [[`e2c5f41ddf`](https://github.com/nodejs/node/commit/e2c5f41ddf)] - **crypto**: use SSL_get_servername. (Adam Langley) [#9347](https://github.com/nodejs/node/pull/9347) +* [[`724910a991`](https://github.com/nodejs/node/commit/724910a991)] - **debugger**: refactor _debugger.js (Rich Trott) [#9860](https://github.com/nodejs/node/pull/9860) +* [[`52f14931a2`](https://github.com/nodejs/node/commit/52f14931a2)] - **deps**: backport GYP fix to fix AIX shared suffix (Stewart Addison) [#9675](https://github.com/nodejs/node/pull/9675) +* [[`c77ba8ce14`](https://github.com/nodejs/node/commit/c77ba8ce14)] - **doc**: consistent 'Returns:' (Roman Reiss) [#9554](https://github.com/nodejs/node/pull/9554) +* [[`aecb2cac37`](https://github.com/nodejs/node/commit/aecb2cac37)] - **doc**: adding missing - in README (Italo A. Casas) [#10170](https://github.com/nodejs/node/pull/10170) +* [[`52c022992e`](https://github.com/nodejs/node/commit/52c022992e)] - **doc**: removing extra space in README (Italo A. Casas) [#10168](https://github.com/nodejs/node/pull/10168) +* [[`e8c57bbe77`](https://github.com/nodejs/node/commit/e8c57bbe77)] - **doc**: add people to cc for async_wrap (Anna Henningsen) [#9471](https://github.com/nodejs/node/pull/9471) +* [[`b5eae4463c`](https://github.com/nodejs/node/commit/b5eae4463c)] - **doc**: add link to `net.Server` in tls.md (Devon Rifkin) [#10109](https://github.com/nodejs/node/pull/10109) +* [[`ad841a29d1`](https://github.com/nodejs/node/commit/ad841a29d1)] - **doc**: clarify fs.createReadStream options (Wes Tyler) [#10078](https://github.com/nodejs/node/pull/10078) +* [[`338014ef24`](https://github.com/nodejs/node/commit/338014ef24)] - **doc**: rename writing_tests.md to writing-tests.md (Safia Abdalla) [#9867](https://github.com/nodejs/node/pull/9867) +* [[`b06b2343bc`](https://github.com/nodejs/node/commit/b06b2343bc)] - **doc**: it’s -> its in api/child_process.md (Devon Rifkin) [#10090](https://github.com/nodejs/node/pull/10090) +* [[`4885573080`](https://github.com/nodejs/node/commit/4885573080)] - **doc**: update Collaborators list in README (Rich Trott) [#9846](https://github.com/nodejs/node/pull/9846) +* [[`3105becb2c`](https://github.com/nodejs/node/commit/3105becb2c)] - **doc**: remove minor contradiction in debugger doc (Rich Trott) [#9832](https://github.com/nodejs/node/pull/9832) +* [[`a858e98921`](https://github.com/nodejs/node/commit/a858e98921)] - **doc**: clarify introductory module material (Rich Trott) [#9816](https://github.com/nodejs/node/pull/9816) +* [[`18c38819fe`](https://github.com/nodejs/node/commit/18c38819fe)] - **doc**: improve description of module `exports` (Sam Roberts) [#9622](https://github.com/nodejs/node/pull/9622) +* [[`9e68b8d329`](https://github.com/nodejs/node/commit/9e68b8d329)] - **doc**: fix crypto Verify cut-n-paste from Sign (子丶言) [#9796](https://github.com/nodejs/node/pull/9796) +* [[`fd1a48c9c9`](https://github.com/nodejs/node/commit/fd1a48c9c9)] - **doc**: minor fixes event-loop-timers-and-nexttick.md (Dan Koster) [#9126](https://github.com/nodejs/node/pull/9126) +* [[`107735a6e1`](https://github.com/nodejs/node/commit/107735a6e1)] - **doc**: changed order of invocations in https.request() example. (atrioom) [#9614](https://github.com/nodejs/node/pull/9614) +* [[`eb5972fe9b`](https://github.com/nodejs/node/commit/eb5972fe9b)] - **doc**: fix crypto "decipher.setAAD()" typo (子丶言) [#9782](https://github.com/nodejs/node/pull/9782) +* [[`dc4c348ea3`](https://github.com/nodejs/node/commit/dc4c348ea3)] - **doc**: fix typo in assert code example (Vse Mozhet Byt) [#9704](https://github.com/nodejs/node/pull/9704) +* [[`16e97ab6c6`](https://github.com/nodejs/node/commit/16e97ab6c6)] - **doc**: fix typo in BUILDING.md (monkick) [#9569](https://github.com/nodejs/node/pull/9569) +* [[`4f2e25441e`](https://github.com/nodejs/node/commit/4f2e25441e)] - **doc**: remove backtick escaping for manpage refs (Anna Henningsen) [#9632](https://github.com/nodejs/node/pull/9632) +* [[`c0d44dfcc7`](https://github.com/nodejs/node/commit/c0d44dfcc7)] - **doc**: remove invalid padding from privateEncrypt (JungMinu) [#9611](https://github.com/nodejs/node/pull/9611) +* [[`0f523583c3`](https://github.com/nodejs/node/commit/0f523583c3)] - **doc**: remove Sam Roberts from release team (Sam Roberts) [#9862](https://github.com/nodejs/node/pull/9862) +* [[`4eeac8eb8c`](https://github.com/nodejs/node/commit/4eeac8eb8c)] - **doc**: add guide for maintaining V8 (Ali Ijaz Sheikh) [#9777](https://github.com/nodejs/node/pull/9777) +* [[`34405ddb83`](https://github.com/nodejs/node/commit/34405ddb83)] - **doc**: move TSC and CTC meeting minutes out of core repo (James M Snell) [#9503](https://github.com/nodejs/node/pull/9503) +* [[`198463a0ff`](https://github.com/nodejs/node/commit/198463a0ff)] - **doc**: fix a typo in the assert.md (Vse Mozhet Byt) [#9598](https://github.com/nodejs/node/pull/9598) +* [[`aca0ede0d3`](https://github.com/nodejs/node/commit/aca0ede0d3)] - **doc**: fix typo e.g., => e.g. (Daijiro Yamada) [#9563](https://github.com/nodejs/node/pull/9563) +* [[`c7997939f2`](https://github.com/nodejs/node/commit/c7997939f2)] - **doc**: fix typo about cluster doc, (eg. -> e.g.) (YutamaKotaro) [#9568](https://github.com/nodejs/node/pull/9568) +* [[`229fa6921f`](https://github.com/nodejs/node/commit/229fa6921f)] - **doc**: fix e.g., to e.g. in doc/http.md (ikasumi_wt) [#9564](https://github.com/nodejs/node/pull/9564) +* [[`3ad7430f12`](https://github.com/nodejs/node/commit/3ad7430f12)] - **doc**: fix the index order in pseudocode of modules (kohta ito) [#9562](https://github.com/nodejs/node/pull/9562) +* [[`06732babd3`](https://github.com/nodejs/node/commit/06732babd3)] - **doc**: remove Roadmap Working Group (William Kapke) [#9545](https://github.com/nodejs/node/pull/9545) +* [[`6775163a94`](https://github.com/nodejs/node/commit/6775163a94)] - **doc**: fix minor style issue in code examples (Daniel Bevenius) [#9482](https://github.com/nodejs/node/pull/9482) +* [[`aa25c74fe6`](https://github.com/nodejs/node/commit/aa25c74fe6)] - **doc**: grammar and structure revisions of wg doc (Ryan Lewis) [#9495](https://github.com/nodejs/node/pull/9495) +* [[`1e06ed7e9d`](https://github.com/nodejs/node/commit/1e06ed7e9d)] - **doc**: clarify the exit code part of writing_tests (Jeremiah Senkpiel) [#9502](https://github.com/nodejs/node/pull/9502) +* [[`3f39a39657`](https://github.com/nodejs/node/commit/3f39a39657)] - **doc**: Fix inaccuracy in https.request docs (Andreas Lind) [#9453](https://github.com/nodejs/node/pull/9453) +* [[`8380154e22`](https://github.com/nodejs/node/commit/8380154e22)] - **doc**: add npm link to README (Oscar Morrison) [#7894](https://github.com/nodejs/node/pull/7894) +* [[`65e134ff12`](https://github.com/nodejs/node/commit/65e134ff12)] - **meta**: whitelist dotfiles in .gitignore (Claudio Rodriguez) [#8016](https://github.com/nodejs/node/pull/8016) +* [[`698bf2e829`](https://github.com/nodejs/node/commit/698bf2e829)] - **repl**: don't override all internal repl defaults (cjihrig) [#7826](https://github.com/nodejs/node/pull/7826) +* [[`3d45b35f73`](https://github.com/nodejs/node/commit/3d45b35f73)] - **repl**: refactor lib/repl.js (Rich Trott) [#9374](https://github.com/nodejs/node/pull/9374) +* [[`f5b952b221`](https://github.com/nodejs/node/commit/f5b952b221)] - **test**: refactor and fix test-dns (Michaël Zasso) [#9811](https://github.com/nodejs/node/pull/9811) +* [[`8b733dca05`](https://github.com/nodejs/node/commit/8b733dca05)] - **test**: refactor test-crypto-binary-default (Michaël Zasso) [#9810](https://github.com/nodejs/node/pull/9810) +* [[`45af7857d7`](https://github.com/nodejs/node/commit/45af7857d7)] - **test**: refactor and fix test-crypto (Michaël Zasso) [#9807](https://github.com/nodejs/node/pull/9807) +* [[`e0c8aafad8`](https://github.com/nodejs/node/commit/e0c8aafad8)] - **test**: fix test-buffer-slow (Michaël Zasso) [#9809](https://github.com/nodejs/node/pull/9809) +* [[`e72dfce2c8`](https://github.com/nodejs/node/commit/e72dfce2c8)] - **test**: added validation regex argument to test (Avery, Frank) [#9918](https://github.com/nodejs/node/pull/9918) +* [[`a779e7ffec`](https://github.com/nodejs/node/commit/a779e7ffec)] - **test**: clean up repl-reset-event file (Kailean Courtney) [#9931](https://github.com/nodejs/node/pull/9931) +* [[`4022579b6e`](https://github.com/nodejs/node/commit/4022579b6e)] - **test**: improve domain-top-level-error-handler-throw (CodeVana) [#9950](https://github.com/nodejs/node/pull/9950) +* [[`d3edaa3dc3`](https://github.com/nodejs/node/commit/d3edaa3dc3)] - **test**: replace var with const in test-require-dot (Amar Zavery) [#9916](https://github.com/nodejs/node/pull/9916) +* [[`8694811ef0`](https://github.com/nodejs/node/commit/8694811ef0)] - **test**: refactor test-net-pingpong (Michaël Zasso) [#9812](https://github.com/nodejs/node/pull/9812) +* [[`e849dd0ff3`](https://github.com/nodejs/node/commit/e849dd0ff3)] - **test**: Use strictEqual in test-tls-writewrap-leak (Aaron Petcoff) [#9666](https://github.com/nodejs/node/pull/9666) +* [[`0662429268`](https://github.com/nodejs/node/commit/0662429268)] - **test**: fix test-tls-connect-address-family (mkamakura) [#9573](https://github.com/nodejs/node/pull/9573) +* [[`420e7f17d9`](https://github.com/nodejs/node/commit/420e7f17d9)] - **test**: fix test-http-status-reason-invalid-chars (Yosuke Saito) [#9572](https://github.com/nodejs/node/pull/9572) +* [[`13cace140f`](https://github.com/nodejs/node/commit/13cace140f)] - **test**: fix helper-debugger-repl.js (Rich Trott) [#9486](https://github.com/nodejs/node/pull/9486) +* [[`aebbc965f9`](https://github.com/nodejs/node/commit/aebbc965f9)] - **test**: refactor large event emitter tests (cjihrig) [#6446](https://github.com/nodejs/node/pull/6446) +* [[`b5012f3de2`](https://github.com/nodejs/node/commit/b5012f3de2)] - **test**: add expectWarning to common (Michaël Zasso) [#8662](https://github.com/nodejs/node/pull/8662) +* [[`b98813d97c`](https://github.com/nodejs/node/commit/b98813d97c)] - **test**: refactor test-fs-non-number-arguments-throw (Michaël Zasso) [#9844](https://github.com/nodejs/node/pull/9844) +* [[`80a752708a`](https://github.com/nodejs/node/commit/80a752708a)] - **test**: refactor test-dgram-exclusive-implicit-bind (Cesar Hernandez) [#10066](https://github.com/nodejs/node/pull/10066) +* [[`9b974b4d54`](https://github.com/nodejs/node/commit/9b974b4d54)] - **test**: use `assert.strictEqual` (anoff) [#9975](https://github.com/nodejs/node/pull/9975) +* [[`bc125bd729`](https://github.com/nodejs/node/commit/bc125bd729)] - **test**: change assert.equal to assert.strictEqual (Aileen) [#9946](https://github.com/nodejs/node/pull/9946) +* [[`5049a10278`](https://github.com/nodejs/node/commit/5049a10278)] - **test**: changed assert.equal to assert.strictEqual (vazina robertson) [#10015](https://github.com/nodejs/node/pull/10015) +* [[`b5c60edeed`](https://github.com/nodejs/node/commit/b5c60edeed)] - **test**: renamed assert.Equal to assert.strictEqual (Jared Young) +* [[`f44e828a36`](https://github.com/nodejs/node/commit/f44e828a36)] - **test**: improves test-tls-client-verify (Paul Graham) [#10051](https://github.com/nodejs/node/pull/10051) +* [[`a1e3967f69`](https://github.com/nodejs/node/commit/a1e3967f69)] - **test**: refactor test-https-agent-session-reuse (Diego Paez) [#10105](https://github.com/nodejs/node/pull/10105) +* [[`9e46af6412`](https://github.com/nodejs/node/commit/9e46af6412)] - **test**: refactor test-beforeexit-event (Rob Adelmann) [#10121](https://github.com/nodejs/node/pull/10121) +* [[`adcd6ea66f`](https://github.com/nodejs/node/commit/adcd6ea66f)] - **test**: refactor test-domain-from-timer (Daniel Sims) [#9889](https://github.com/nodejs/node/pull/9889) +* [[`1377ea87eb`](https://github.com/nodejs/node/commit/1377ea87eb)] - **test**: refactor test-domain-exit-dispose-again (Ethan Arrowood) [#10003](https://github.com/nodejs/node/pull/10003) +* [[`8a9af6843d`](https://github.com/nodejs/node/commit/8a9af6843d)] - **test**: use const and strictEqual in test-os-homedir-no-envvar (CodeVana) [#9899](https://github.com/nodejs/node/pull/9899) +* [[`ee038c0e71`](https://github.com/nodejs/node/commit/ee038c0e71)] - **test**: refactor test-dgram-bind-default-address (Michael-Bryant Choa) [#9947](https://github.com/nodejs/node/pull/9947) +* [[`a090899e93`](https://github.com/nodejs/node/commit/a090899e93)] - **test**: assert.throws() should include a RegExp (Chris Bystrek) [#9976](https://github.com/nodejs/node/pull/997://github.com/nodejs/node/pull/9976) +* [[`542b40f410`](https://github.com/nodejs/node/commit/542b40f410)] - **test**: refactor test-event-emitter-method-names (Rodrigo Palma) [#10027](https://github.com/nodejs/node/pull/10027) +* [[`a2023a9d97`](https://github.com/nodejs/node/commit/a2023a9d97)] - **test**: refactor tls-ticket-cluster (Yojan Shrestha) [#10023](https://github.com/nodejs/node/pull/10023) +* [[`a64f40680f`](https://github.com/nodejs/node/commit/a64f40680f)] - **test**: refactor test-domain-exit-dispose (Chris Henney) [#9938](https://github.com/nodejs/node/pull/9938) +* [[`a896d4ed36`](https://github.com/nodejs/node/commit/a896d4ed36)] - **test**: refactor test-stdin-from-file.js (amrios) [#10012](https://github.com/nodejs/node/pull/10012) +* [[`ce14c1e51f`](https://github.com/nodejs/node/commit/ce14c1e51f)] - **test**: refactor test-require-extensions-main (Daryl Thayil) [#9912](https://github.com/nodejs/node/pull/9912) +* [[`b9c45026f7`](https://github.com/nodejs/node/commit/b9c45026f7)] - **test**: clean up tls junk test (Danny Guo) [#9940](https://github.com/nodejs/node/pull/9940) +* [[`e3712334a3`](https://github.com/nodejs/node/commit/e3712334a3)] - **test**: update test-stdout-to-file (scalkpdev) [#9939](https://github.com/nodejs/node/pull/9939) +* [[`63f571e69c`](https://github.com/nodejs/node/commit/63f571e69c)] - **test**: changed assert.Equal to asset.strictEqual (Paul Chin) [#9973](https://github.com/nodejs/node/pull/9973) +* [[`c3a3480606`](https://github.com/nodejs/node/commit/c3a3480606)] - **test**: refactor test-domain-multi (Wes Tyler) [#9963](https://github.com/nodejs/node/pull/9963) +* [[`ad27555ff8`](https://github.com/nodejs/node/commit/ad27555ff8)] - **test**: use assert.strictEqual in test-cli-eval (Nigel Kibodeaux) [#9919](https://github.com/nodejs/node/pull/9919) +* [[`cffd51e815`](https://github.com/nodejs/node/commit/cffd51e815)] - **test**: refactor test-tls-connect-simple (Russell Sherman) [#9934](https://github.com/nodejs/node/pull/9934) +* [[`1424c25f3e`](https://github.com/nodejs/node/commit/1424c25f3e)] - **test**: refactor test-signal-unregister (mark hughes) [#9920](https://github.com/nodejs/node/pull/9920) +* [[`920737180f`](https://github.com/nodejs/node/commit/920737180f)] - **test**: refactor test-require-resolve (blugavere) [#10120](https://github.com/nodejs/node/pull/10120) +* [[`71ab88cc80`](https://github.com/nodejs/node/commit/71ab88cc80)] - **test**: refactor test-fs-read-stream-resume (Matt Webb) [#9927](https://github.com/nodejs/node/pull/9927) +* [[`6a485da87c`](https://github.com/nodejs/node/commit/6a485da87c)] - **test**: replace equal with strictEqual (Tracy Hinds) [#10011](https://github.com/nodejs/node/pull/10011) +* [[`b5d87569e1`](https://github.com/nodejs/node/commit/b5d87569e1)] - **test**: use strictEqual instead of equal (Uttam Pawar) [#9921](https://github.com/nodejs/node/pull/9921) +* [[`c94c2fde8a`](https://github.com/nodejs/node/commit/c94c2fde8a)] - **test**: using const and strictEqual (Fabrice Tatieze) [#9926](https://github.com/nodejs/node/pull/9926) +* [[`16164b5b44`](https://github.com/nodejs/node/commit/16164b5b44)] - **test**: test-file-write-stream3.js refactor (Richard Karmazin) [#10035](https://github.com/nodejs/node/pull/10035) +* [[`7391983729`](https://github.com/nodejs/node/commit/7391983729)] - **test**: implemented es6 conventions (Erez Weiss) [#9669](https://github.com/nodejs/node/pull/9669) +* [[`50ce3f91d7`](https://github.com/nodejs/node/commit/50ce3f91d7)] - **test**: update assert.equal() to assert.strictEqual() (Peter Diaz) [#10024](https://github.com/nodejs/node/pull/10024) +* [[`3f9d75c481`](https://github.com/nodejs/node/commit/3f9d75c481)] - **test**: use const or let and assert.strictEqual (Christopher Rokita) [#10001](https://github.com/nodejs/node/pull/10001) +* [[`98afba5676`](https://github.com/nodejs/node/commit/98afba5676)] - **test**: use strictEqual() domain-http (cdnadmin) [#9996](https://github.com/nodejs/node/pull/9996) +* [[`07680b65fe`](https://github.com/nodejs/node/commit/07680b65fe)] - **test**: refactor test-cluster-worker-events (fmizzell) [#9994](https://github.com/nodejs/node/pull/9994) +* [[`a3db54416f`](https://github.com/nodejs/node/commit/a3db54416f)] - **test**: update repl tests (makenova) [#9991](https://github.com/nodejs/node/pull/9991) +* [[`db3cdd2449`](https://github.com/nodejs/node/commit/db3cdd2449)] - **test**: adding strictEqual to test-buffer-indexof.js (Eric Gonzalez) [#9955](https://github.com/nodejs/node/pull/9955) +* [[`f670b05603`](https://github.com/nodejs/node/commit/f670b05603)] - **test**: strictEqual in test-beforeexit-event.js (CodeTheInternet) [#10004](https://github.com/nodejs/node/pull/10004) +* [[`70b4d7d3a2`](https://github.com/nodejs/node/commit/70b4d7d3a2)] - **test**: refactor test-child-process-double-pipe (Dan Villa) [#9930](https://github.com/nodejs/node/pull/9930) +* [[`1e53cf4764`](https://github.com/nodejs/node/commit/1e53cf4764)] - **test**: updated test-stream-pipe-unpipe-stream (Raja Panidepu) [#10100](https://github.com/nodejs/node/pull/10100) +* [[`57d48ac3f4`](https://github.com/nodejs/node/commit/57d48ac3f4)] - **test**: refactor test-crypto-ecb (michael6) [#10029](https://github.com/nodejs/node/pull/10029) +* [[`89feb8dc4d`](https://github.com/nodejs/node/commit/89feb8dc4d)] - **test**: refactor test-require-exceptions (Oscar Martinez) [#9882](https://github.com/nodejs/node/pull/9882) +* [[`59f259c487`](https://github.com/nodejs/node/commit/59f259c487)] - **test**: refactor test-crypto-certificate (Josh Mays) [#9911](https://github.com/nodejs/node/pull/9911) +* [[`815715d850`](https://github.com/nodejs/node/commit/815715d850)] - **test**: refactor test-domain (Johnny Reading) [#9890](https://github.com/nodejs/node/pull/9890) +* [[`08cc269338`](https://github.com/nodejs/node/commit/08cc269338)] - **test**: refactor test-cli-syntax (Exlipse7) [#10057](https://github.com/nodejs/node/pull/10057) +* [[`91d27ce4db`](https://github.com/nodejs/node/commit/91d27ce4db)] - **test**: refactor test-child-process-constructor (k3kathy) [#10060](https://github.com/nodejs/node/pull/10060) +* [[`ae9e2a21c1`](https://github.com/nodejs/node/commit/ae9e2a21c1)] - **test**: var to const, assert.equal to assert.strictEqual in net (Sean Villars) [#9907](https://github.com/nodejs/node/pull/9907) +* [[`30c9474286`](https://github.com/nodejs/node/commit/30c9474286)] - **test**: changed vars to const in test-net-better-error-messages-listen-path.js (anoff) [#9905](https://github.com/nodejs/node/pull/9905) +* [[`bcbf50d9ba`](https://github.com/nodejs/node/commit/bcbf50d9ba)] - **test**: refactor test-http-dns-error (Outsider) [#10062](https://github.com/nodejs/node/pull/10062) +* [[`00f08640ce`](https://github.com/nodejs/node/commit/00f08640ce)] - **test**: assert.equal -> assert.strictEqual (davidmarkclements) [#10065](https://github.com/nodejs/node/pull/10065) +* [[`d9cca393e9`](https://github.com/nodejs/node/commit/d9cca393e9)] - **test**: assert.equal -> assert.strictEqual (davidmarkclements) [#10067](https://github.com/nodejs/node/pull/10067) +* [[`6c64f6c445`](https://github.com/nodejs/node/commit/6c64f6c445)] - **test**: improve test for crypto padding (Julian Duque) [#9906](https://github.com/nodejs/node/pull/9906) +* [[`37d734ae36`](https://github.com/nodejs/node/commit/37d734ae36)] - **test**: polish test-net-better-error-messages-listen (Hitesh Kanwathirtha) [#10087](https://github.com/nodejs/node/pull/10087) +* [[`f126b44a3a`](https://github.com/nodejs/node/commit/f126b44a3a)] - **test**: change var to const in test-tls-key-mismatch.js (bjdelro) [#9897](https://github.com/nodejs/node/pull/9897) +* [[`7538dd5c93`](https://github.com/nodejs/node/commit/7538dd5c93)] - **test**: use strictEqual in cwd-enoent (JDHarmon) [#10077](https://github.com/nodejs/node/pull/10077) +* [[`39816a43af`](https://github.com/nodejs/node/commit/39816a43af)] - **test**: refactor test-fs-read-stream-inherit.js (Jonathan Darling) [#9894](https://github.com/nodejs/node/pull/9894) +* [[`7615a0f2cd`](https://github.com/nodejs/node/commit/7615a0f2cd)] - **test**: refactor test-child-process-stdio-inherit (Wes Tyler) [#9893](https://github.com/nodejs/node/pull/9893) +* [[`2a9ab8ea2a`](https://github.com/nodejs/node/commit/2a9ab8ea2a)] - **test**: change var to const for require and strict equality checks (Harish Tejwani) [#9892](https://github.com/nodejs/node/pull/9892) +* [[`5cd7e7aaf1`](https://github.com/nodejs/node/commit/5cd7e7aaf1)] - **test**: Update to const and use regex for assertions (Daniel Flores) [#9891](https://github.com/nodejs/node/pull/9891) +* [[`1a73cc5357`](https://github.com/nodejs/node/commit/1a73cc5357)] - **test**: swap var->const/let and equal->strictEqual (Peter Masucci) [#9888](https://github.com/nodejs/node/pull/9888) +* [[`552169e950`](https://github.com/nodejs/node/commit/552169e950)] - **test**: replace equal with strictEqual in crypto (Julian Duque) [#9886](https://github.com/nodejs/node/pull/9886) +* [[`49900e78b0`](https://github.com/nodejs/node/commit/49900e78b0)] - **test**: replace equal with strictEqual (Julian Duque) [#9879](https://github.com/nodejs/node/pull/9879) +* [[`998db3a003`](https://github.com/nodejs/node/commit/998db3a003)] - **test**: refactor test-tls-timeout-server-2 (Devon Rifkin) [#9876](https://github.com/nodejs/node/pull/9876) +* [[`aaab51047f`](https://github.com/nodejs/node/commit/aaab51047f)] - **test**: Changed assert.equal to assert.strictEqual (Daniel Pittman) [#9902](https://github.com/nodejs/node/pull/9902) +* [[`a4488c3cbd`](https://github.com/nodejs/node/commit/a4488c3cbd)] - **test**: refactor test-vm-syntax-error-stderr.js (Jay Brownlee) [#9900](https://github.com/nodejs/node/pull/9900) +* [[`cff80a5c0e`](https://github.com/nodejs/node/commit/cff80a5c0e)] - **test**: refactor test-tls-destroy-whilst-write (Chris Bystrek) [#10064](https://github.com/nodejs/node/pull/10064) +* [[`8257671bdc`](https://github.com/nodejs/node/commit/8257671bdc)] - **test**: refactor test-https-truncate (davidmarkclements) [#10074](https://github.com/nodejs/node/pull/10074) +* [[`457af874b5`](https://github.com/nodejs/node/commit/457af874b5)] - **test**: use strictEqual in test-cli-eval-event.js (Richard Karmazin) [#9964](https://github.com/nodejs/node/pull/9964) +* [[`2890f0d904`](https://github.com/nodejs/node/commit/2890f0d904)] - **test**: refactor test-tls-friendly-error-message.js (Adrian Estrada) [#9967](https://github.com/nodejs/node/pull/9967) +* [[`c37ae4a1b6`](https://github.com/nodejs/node/commit/c37ae4a1b6)] - **test**: refactor test-vm-static-this.js (David Bradford) [#9887](https://github.com/nodejs/node/pull/9887) +* [[`9473fc6c2f`](https://github.com/nodejs/node/commit/9473fc6c2f)] - **test**: refactor test-crypto-cipheriv-decipheriv (Aileen) [#10018](https://github.com/nodejs/node/pull/10018) +* [[`6ecc4ffb1c`](https://github.com/nodejs/node/commit/6ecc4ffb1c)] - **test**: refactor test for crypto cipher/decipher iv (Julian Duque) [#9943](https://github.com/nodejs/node/pull/9943) +* [[`a486f6bad4`](https://github.com/nodejs/node/commit/a486f6bad4)] - **test**: refactor test-cluster-setup-master-argv (Oscar Martinez) [#9960](https://github.com/nodejs/node/pull/9960) +* [[`384c954698`](https://github.com/nodejs/node/commit/384c954698)] - **test**: refactor test-cluster-setup-master-argv (Christine Hong) [#9993](https://github.com/nodejs/node/pull/9993) +* [[`76645e8781`](https://github.com/nodejs/node/commit/76645e8781)] - **test**: use assert.strictEqual in test-crypto-ecb (Daniel Pittman) [#9980](https://github.com/nodejs/node/pull/9980) +* [[`9103c3d3fe`](https://github.com/nodejs/node/commit/9103c3d3fe)] - **test**: update to const iin cluster test (Greg Valdez) [#10007](https://github.com/nodejs/node/pull/10007) +* [[`27c9171586`](https://github.com/nodejs/node/commit/27c9171586)] - **test**: use assert.strictEqual() cluster test (Bidur Adhikari) [#10042](https://github.com/nodejs/node/pull/10042) +* [[`2453d64aa7`](https://github.com/nodejs/node/commit/2453d64aa7)] - **test**: var -> let/const, .equal -> .strictEqual (shiya) [#9913](https://github.com/nodejs/node/pull/9913) +* [[`1467c964a4`](https://github.com/nodejs/node/commit/1467c964a4)] - **test**: increase coverage for timers (lrlna) [#10068](https://github.com/nodejs/node/pull/10068) +* [[`e47195cf78`](https://github.com/nodejs/node/commit/e47195cf78)] - **test**: change equal to strictEqual (Kevin Zurawel) [#9872](https://github.com/nodejs/node/pull/9872) +* [[`33da22aba1`](https://github.com/nodejs/node/commit/33da22aba1)] - **test**: add toASCII and toUnicode punycode tests (Claudio Rodriguez) [#9741](https://github.com/nodejs/node/pull/9741) +* [[`4c5d24b632`](https://github.com/nodejs/node/commit/4c5d24b632)] - **test**: refine test-http-status-reason-invalid-chars (Rich Trott) [#9802](https://github.com/nodejs/node/pull/9802) +* [[`81d49aaeb2`](https://github.com/nodejs/node/commit/81d49aaeb2)] - **test**: exclude no_interleaved_stdio test for AIX (Michael Dawson) [#9772](https://github.com/nodejs/node/pull/9772) +* [[`b59cf582e4`](https://github.com/nodejs/node/commit/b59cf582e4)] - **test**: refactor test-async-wrap-* (Rich Trott) [#9663](https://github.com/nodejs/node/pull/9663) +* [[`57cc5cb277`](https://github.com/nodejs/node/commit/57cc5cb277)] - **test**: use setImmediate() in test of stream2 (masashi.g) [#9583](https://github.com/nodejs/node/pull/9583) +* [[`8345ffb0a0`](https://github.com/nodejs/node/commit/8345ffb0a0)] - **test**: add test case of PassThrough (Yoshiya Hinosawa) [#9581](https://github.com/nodejs/node/pull/9581) +* [[`beb147a08b`](https://github.com/nodejs/node/commit/beb147a08b)] - **test**: check that `process.execPath` is a realpath (Anna Henningsen) [#9229](https://github.com/nodejs/node/pull/9229) +* [[`cef5b1fa14`](https://github.com/nodejs/node/commit/cef5b1fa14)] - **test**: add test for broken child process stdio (cjihrig) [#9528](https://github.com/nodejs/node/pull/9528) +* [[`29ab76b791`](https://github.com/nodejs/node/commit/29ab76b791)] - **test**: ensure nextTick is not scheduled in exit (Jeremiah Senkpiel) [#9555](https://github.com/nodejs/node/pull/9555) +* [[`b87fe250d2`](https://github.com/nodejs/node/commit/b87fe250d2)] - **test**: change from setTimeout to setImmediate (MURAKAMI Masahiko) [#9578](https://github.com/nodejs/node/pull/9578) +* [[`eca12d4316`](https://github.com/nodejs/node/commit/eca12d4316)] - **test**: improve test-stream2-objects.js (Yoshiya Hinosawa) [#9565](https://github.com/nodejs/node/pull/9565) +* [[`4e36a14c15`](https://github.com/nodejs/node/commit/4e36a14c15)] - **test**: refactor test-next-tick-error-spin (Rich Trott) [#9537](https://github.com/nodejs/node/pull/9537) +* [[`b2b2bc2293`](https://github.com/nodejs/node/commit/b2b2bc2293)] - **test**: move timer-dependent test to sequential (Rich Trott) [#9487](https://github.com/nodejs/node/pull/9487) +* [[`1436fd70f5`](https://github.com/nodejs/node/commit/1436fd70f5)] - **test**: convert assert.equal to assert.strictEqual (Jonathan Darling) [#9925](https://github.com/nodejs/node/pull/9925) +* [[`c9ed49da6e`](https://github.com/nodejs/node/commit/c9ed49da6e)] - **test**: run cpplint on files in test/cctest (Ben Noordhuis) [#9787](https://github.com/nodejs/node/pull/9787) +* [[`10d4f470f8`](https://github.com/nodejs/node/commit/10d4f470f8)] - **test**: enable addons test to pass with debug build (Daniel Bevenius) [#8836](https://github.com/nodejs/node/pull/8836) +* [[`550393dc78`](https://github.com/nodejs/node/commit/550393dc78)] - **test**: add new.target add-on regression test (Ben Noordhuis) [#9689](https://github.com/nodejs/node/pull/9689) +* [[`76245b2156`](https://github.com/nodejs/node/commit/76245b2156)] - **test**: refactor large event emitter tests (cjihrig) [#6446](https://github.com/nodejs/node/pull/6446) +* [[`02e8187751`](https://github.com/nodejs/node/commit/02e8187751)] - **test**: allow globals to be whitelisted (cjihrig) [#7826](https://github.com/nodejs/node/pull/7826) +* [[`c0c5608bfc`](https://github.com/nodejs/node/commit/c0c5608bfc)] - **test,assert**: add deepEqual/deepStrictEqual tests for typed arrays (Feross Aboukhadijeh) [#8002](https://github.com/nodejs/node/pull/8002) +* [[`759e8fdd18`](https://github.com/nodejs/node/commit/759e8fdd18)] - **timers**: bail from intervals if _repeat is bad (Jeremiah Senkpiel) [#10365](https://github.com/nodejs/node/pull/10365) +* [[`553d95da15`](https://github.com/nodejs/node/commit/553d95da15)] - **timers**: use consistent checks for canceled timers (Jeremiah Senkpiel) [#9685](https://github.com/nodejs/node/pull/9685) +* [[`5c6d908dd7`](https://github.com/nodejs/node/commit/5c6d908dd7)] - **tools**: enable final newline in .editorconfig (Roman Reiss) [#9410](https://github.com/nodejs/node/pull/9410) +* [[`06e8120928`](https://github.com/nodejs/node/commit/06e8120928)] - **tools**: remove unneeded escaping in generate.js (Rich Trott) [#9781](https://github.com/nodejs/node/pull/9781) +* [[`fd6b305421`](https://github.com/nodejs/node/commit/fd6b305421)] - **tools**: use better regexp for manpage references (Anna Henningsen) [#9632](https://github.com/nodejs/node/pull/9632) +* [[`9b36469a3c`](https://github.com/nodejs/node/commit/9b36469a3c)] - **tools**: improve docopen target in Makefile (Sakthipriyan Vairamani (thefourtheye)) [#9436](https://github.com/nodejs/node/pull/9436) +* [[`e3dc05d01b`](https://github.com/nodejs/node/commit/e3dc05d01b)] - **tools**: make run-valgrind.py useful (Ben Noordhuis) [#9520](https://github.com/nodejs/node/pull/9520) +* [[`7b1b11a11c`](https://github.com/nodejs/node/commit/7b1b11a11c)] - **tools**: fix run-valgrind.py script (Ben Noordhuis) [#9520](https://github.com/nodejs/node/pull/9520) +* [[`011ee0ba8b`](https://github.com/nodejs/node/commit/011ee0ba8b)] - **tools**: copy run-valgrind.py to tools/ (Ben Noordhuis) [#9520](https://github.com/nodejs/node/pull/9520) + +## 2016-12-06, Version 4.7.0 'Argon' (LTS), @thealphanerd + +This LTS release comes with 108 commits. This includes 30 which are doc +related, 28 which are test related, 16 which are build / tool related, and 4 +commits which are updates to dependencies. + +### Notable Changes + +The SEMVER-MINOR changes include: + +* **build**: export openssl symbols on Windows making it possible to build addons linking against the bundled version of openssl (Alex Hultman) [#7576](https://github.com/nodejs/node/pull/7576) +* **debugger**: make listen address configurable in the debugger server (Ben Noordhuis) [#3316](https://github.com/nodejs/node/pull/3316) +* **dgram**: generalized send queue to handle close fixing a potential throw when dgram socket is closed in the listening event handler. (Matteo Collina) [#7066](https://github.com/nodejs/node/pull/7066) +* **http**: Introduce the 451 status code "Unavailable For Legal Reasons" (Max Barinov) [#4377](https://github.com/nodejs/node/pull/4377) +* **tls**: introduce `secureContext` for `tls.connect` which is useful for caching client certificates, key, and CA certificates. (Fedor Indutny) [#4246](https://github.com/nodejs/node/pull/4246) + +Notable SEMVER-PATCH changes include: + +* **build**: + - introduce the configure --shared option for embedders (sxa555) [#6994](https://github.com/nodejs/node/pull/6994) +* **gtest**: the test reporter now outputs tap comments as yamlish (Johan Bergström) [#9262](https://github.com/nodejs/node/pull/9262) +* **src**: node no longer aborts when c-ares initialization fails (Ben Noordhuis) [#8710](https://github.com/nodejs/node/pull/8710) +* **tls**: fix memory leak when writing data to TLSWrap instance during handshake (Fedor Indutny) [#9586](https://github.com/nodejs/node/pull/9586) + +### Commits + +* [[`ed31f9cc30`](https://github.com/nodejs/node/commit/ed31f9cc30)] - **benchmark**: add microbenchmarks for ES Map (Rod Vagg) [#7581](https://github.com/nodejs/node/pull/7581) +* [[`c5181eda4b`](https://github.com/nodejs/node/commit/c5181eda4b)] - **build**: reduce noise from doc target (Daniel Bevenius) [#9457](https://github.com/nodejs/node/pull/9457) +* [[`59d821debe`](https://github.com/nodejs/node/commit/59d821debe)] - **build**: use wxneeded on openbsd (Aaron Bieber) [#9232](https://github.com/nodejs/node/pull/9232) +* [[`7c73105606`](https://github.com/nodejs/node/commit/7c73105606)] - **build**: run cctests as part of test-ci target (Ben Noordhuis) [#8034](https://github.com/nodejs/node/pull/8034) +* [[`3919edb47e`](https://github.com/nodejs/node/commit/3919edb47e)] - **build**: don't build icu with -fno-rtti (Ben Noordhuis) [#8886](https://github.com/nodejs/node/pull/8886) +* [[`e97723b18c`](https://github.com/nodejs/node/commit/e97723b18c)] - **build**: abstract out shared library suffix (Stewart Addison) [#9385](https://github.com/nodejs/node/pull/9385) +* [[`0138b4db7c`](https://github.com/nodejs/node/commit/0138b4db7c)] - **build**: windows sharedlib support (Stewart Addison) [#9385](https://github.com/nodejs/node/pull/9385) +* [[`f21c2b9d3b`](https://github.com/nodejs/node/commit/f21c2b9d3b)] - **build**: configure --shared (sxa555) [#6994](https://github.com/nodejs/node/pull/6994) +* [[`bb2fdf58f7`](https://github.com/nodejs/node/commit/bb2fdf58f7)] - **build**: cherry pick V8 change for windows DLL support (Stefan Budeanu) [#8084](https://github.com/nodejs/node/pull/8084) +* [[`84849f186f`](https://github.com/nodejs/node/commit/84849f186f)] - **(SEMVER-MINOR)** **build**: export more openssl symbols on Windows (Alex Hultman) [#7576](https://github.com/nodejs/node/pull/7576) +* [[`3cefd65e90`](https://github.com/nodejs/node/commit/3cefd65e90)] - **build**: export openssl symbols on windows (Ben Noordhuis) [#6274](https://github.com/nodejs/node/pull/6274) +* [[`4de7a6e291`](https://github.com/nodejs/node/commit/4de7a6e291)] - **build**: fix config.gypi target (Daniel Bevenius) [#9053](https://github.com/nodejs/node/pull/9053) +* [[`9389572cbc`](https://github.com/nodejs/node/commit/9389572cbc)] - **crypto**: fix faulty logic in iv size check (Ben Noordhuis) [#9032](https://github.com/nodejs/node/pull/9032) +* [[`748e424163`](https://github.com/nodejs/node/commit/748e424163)] - **(SEMVER-MINOR)** **debugger**: make listen address configurable (Ben Noordhuis) [#3316](https://github.com/nodejs/node/pull/3316) +* [[`c1effb1255`](https://github.com/nodejs/node/commit/c1effb1255)] - **deps**: fix build with libc++ 3.8.0 (Johan Bergström) [#9763](https://github.com/nodejs/node/pull/9763) +* [[`eb34f687d5`](https://github.com/nodejs/node/commit/eb34f687d5)] - **deps**: revert default gtest reporter change (Brian White) [#8948](https://github.com/nodejs/node/pull/8948) +* [[`4c47446133`](https://github.com/nodejs/node/commit/4c47446133)] - **deps**: make gtest output tap (Ben Noordhuis) [#8034](https://github.com/nodejs/node/pull/8034) +* [[`91fce10aee`](https://github.com/nodejs/node/commit/91fce10aee)] - **deps**: back port OpenBSD fix in c-ares/c-ares (Aaron Bieber) [#9232](https://github.com/nodejs/node/pull/9232) +* [[`4571c84c67`](https://github.com/nodejs/node/commit/4571c84c67)] - **(SEMVER-MINOR)** **dgram**: generalized send queue to handle close (Matteo Collina) [#7066](https://github.com/nodejs/node/pull/7066) +* [[`d3c25c19ef`](https://github.com/nodejs/node/commit/d3c25c19ef)] - **doc**: update minute-taking procedure for CTC (Rich Trott) [#9425](https://github.com/nodejs/node/pull/9425) +* [[`861b689c01`](https://github.com/nodejs/node/commit/861b689c01)] - **doc**: update GOVERNANCE.md to use "meeting chair" (Rich Trott) [#9432](https://github.com/nodejs/node/pull/9432) +* [[`5e820ae746`](https://github.com/nodejs/node/commit/5e820ae746)] - **doc**: update Diagnostics WG info (Josh Gavant) [#9329](https://github.com/nodejs/node/pull/9329) +* [[`e08173a2f1`](https://github.com/nodejs/node/commit/e08173a2f1)] - **doc**: fix outdate ninja link (Yangyang Liu) [#9278](https://github.com/nodejs/node/pull/9278) +* [[`462c640a51`](https://github.com/nodejs/node/commit/462c640a51)] - **doc**: fix typo in email address in README (Rich Trott) [#8941](https://github.com/nodejs/node/pull/8941) +* [[`fc77cbb5b1`](https://github.com/nodejs/node/commit/fc77cbb5b1)] - **doc**: make node(1) more consistent with tradition (Alex Jordan) [#8902](https://github.com/nodejs/node/pull/8902) +* [[`66e26cd253`](https://github.com/nodejs/node/commit/66e26cd253)] - **doc**: child_process.execSync .stdio default is pipe (Kenneth Skovhus) [#9701](https://github.com/nodejs/node/pull/9701) +* [[`524ebfb5dd`](https://github.com/nodejs/node/commit/524ebfb5dd)] - **doc**: child_process .stdio accepts a String type (Kenneth Skovhus) [#9701](https://github.com/nodejs/node/pull/9701) +* [[`475fe96852`](https://github.com/nodejs/node/commit/475fe96852)] - **doc**: simplify process.memoryUsage() example code (Thomas Watson Steen) [#9560](https://github.com/nodejs/node/pull/9560) +* [[`c48c318806`](https://github.com/nodejs/node/commit/c48c318806)] - **doc**: change ./node to node in debugger.md (AnnaMag) [#8943](https://github.com/nodejs/node/pull/8943) +* [[`00a178257c`](https://github.com/nodejs/node/commit/00a178257c)] - **doc**: update CONTRIBUTING.md to address editing PRs (Gibson Fahnestock) [#9259](https://github.com/nodejs/node/pull/9259) +* [[`2b2dde855a`](https://github.com/nodejs/node/commit/2b2dde855a)] - **doc**: add italoacasas to collaborators (Italo A. Casas) [#9677](https://github.com/nodejs/node/pull/9677) +* [[`0f41058e41`](https://github.com/nodejs/node/commit/0f41058e41)] - **doc**: clarify relation between a file and a module (marzelin) [#9026](https://github.com/nodejs/node/pull/9026) +* [[`d1d207bd75`](https://github.com/nodejs/node/commit/d1d207bd75)] - **doc**: add Sakthipriyan to the CTC (Rod Vagg) [#9427](https://github.com/nodejs/node/pull/9427) +* [[`9dad98bdf1`](https://github.com/nodejs/node/commit/9dad98bdf1)] - **doc**: add 2016-10-26 CTC meeting minutes (Rich Trott) [#9348](https://github.com/nodejs/node/pull/9348) +* [[`824009296a`](https://github.com/nodejs/node/commit/824009296a)] - **doc**: add 2016-10-05 CTC meeting minutes (Josh Gavant) [#9326](https://github.com/nodejs/node/pull/9326) +* [[`1a701f1723`](https://github.com/nodejs/node/commit/1a701f1723)] - **doc**: add 2016-09-28 CTC meeting minutes (Josh Gavant) [#9325](https://github.com/nodejs/node/pull/9325) +* [[`e9c6aff113`](https://github.com/nodejs/node/commit/e9c6aff113)] - **doc**: add 2016-10-19 CTC meeting minutes (Josh Gavant) [#9193](https://github.com/nodejs/node/pull/9193) +* [[`c1e5e663a9`](https://github.com/nodejs/node/commit/c1e5e663a9)] - **doc**: improve header styling for API docs (Jeremiah Senkpiel) [#8811](https://github.com/nodejs/node/pull/8811) +* [[`279e30c3ee`](https://github.com/nodejs/node/commit/279e30c3ee)] - **doc**: add CTC meeting minutes for 2016-10-12 (Michael Dawson) [#9070](https://github.com/nodejs/node/pull/9070) +* [[`3b839d1855`](https://github.com/nodejs/node/commit/3b839d1855)] - **doc**: remove confusing reference in governance doc (Rich Trott) [#9073](https://github.com/nodejs/node/pull/9073) +* [[`e564cb6af4`](https://github.com/nodejs/node/commit/e564cb6af4)] - **doc**: add ctc-review label information (Rich Trott) [#9072](https://github.com/nodejs/node/pull/9072) +* [[`68ccc7a512`](https://github.com/nodejs/node/commit/68ccc7a512)] - **doc**: update reference to list hash algorithms in crypto.md (scott stern) [#9043](https://github.com/nodejs/node/pull/9043) +* [[`132425a058`](https://github.com/nodejs/node/commit/132425a058)] - **doc**: specify that errno is a number, not a string (John Vilk) [#9007](https://github.com/nodejs/node/pull/9007) +* [[`695ee1e77b`](https://github.com/nodejs/node/commit/695ee1e77b)] - **doc**: highlight deprecated API in ToC (Ilya Frolov) [#7189](https://github.com/nodejs/node/pull/7189) +* [[`4f8bf1bcf8`](https://github.com/nodejs/node/commit/4f8bf1bcf8)] - **doc**: explains why Reviewed-By is added in PRs (jessicaquynh) [#9044](https://github.com/nodejs/node/pull/9044) +* [[`af645a0553`](https://github.com/nodejs/node/commit/af645a0553)] - **doc**: explain why GitHub merge button is not used (jessicaquynh) [#9044](https://github.com/nodejs/node/pull/9044) +* [[`f472c09e90`](https://github.com/nodejs/node/commit/f472c09e90)] - **doc**: reference signal(7) for the list of signals (Emanuele DelBono) [#9323](https://github.com/nodejs/node/pull/9323) +* [[`88079817c2`](https://github.com/nodejs/node/commit/88079817c2)] - **doc**: fix typo in http.md (anu0012) [#9144](https://github.com/nodejs/node/pull/9144) +* [[`9f0ef5a4f2`](https://github.com/nodejs/node/commit/9f0ef5a4f2)] - **doc**: fix heading type for v4.6.2 changelog (Myles Borins) [#9515](https://github.com/nodejs/node/pull/9515) +* [[`f6f0b387ea`](https://github.com/nodejs/node/commit/f6f0b387ea)] - **events**: pass the original listener added by once (DavidCai) [#6394](https://github.com/nodejs/node/pull/6394) +* [[`02e6c84de2`](https://github.com/nodejs/node/commit/02e6c84de2)] - **gitignore**: ignore all tap files (Johan Bergström) [#9262](https://github.com/nodejs/node/pull/9262) +* [[`a7ae8876f9`](https://github.com/nodejs/node/commit/a7ae8876f9)] - **governance**: expand use of CTC issue tracker (Rich Trott) [#8945](https://github.com/nodejs/node/pull/8945) +* [[`36abbbe736`](https://github.com/nodejs/node/commit/36abbbe736)] - **gtest**: output tap comments as yamlish (Johan Bergström) [#9262](https://github.com/nodejs/node/pull/9262) +* [[`50a4471aff`](https://github.com/nodejs/node/commit/50a4471aff)] - **http**: fix connection upgrade checks (Brian White) [#8238](https://github.com/nodejs/node/pull/8238) +* [[`c94482b167`](https://github.com/nodejs/node/commit/c94482b167)] - **(SEMVER-MINOR)** **http**: 451 status code "Unavailable For Legal Reasons" (Max Barinov) [#4377](https://github.com/nodejs/node/pull/4377) +* [[`12da2581a8`](https://github.com/nodejs/node/commit/12da2581a8)] - **https**: fix memory leak with https.request() (Ilkka Myller) [#8647](https://github.com/nodejs/node/pull/8647) +* [[`3b448a7f12`](https://github.com/nodejs/node/commit/3b448a7f12)] - **lib**: changed var to const in linkedlist (Adri Van Houdt) [#8609](https://github.com/nodejs/node/pull/8609) +* [[`a3a184d40a`](https://github.com/nodejs/node/commit/a3a184d40a)] - **lib**: fix TypeError in v8-polyfill (Wyatt Preul) [#8863](https://github.com/nodejs/node/pull/8863) +* [[`423846053b`](https://github.com/nodejs/node/commit/423846053b)] - **lib**: remove let from for loops (Myles Borins) [#8873](https://github.com/nodejs/node/pull/8873) +* [[`9a192a9683`](https://github.com/nodejs/node/commit/9a192a9683)] - **net**: fix ambiguity in EOF handling (Fedor Indutny) [#9066](https://github.com/nodejs/node/pull/9066) +* [[`62e83b363e`](https://github.com/nodejs/node/commit/62e83b363e)] - **src**: Malloc/Calloc size 0 returns non-null pointer (Rich Trott) [#8572](https://github.com/nodejs/node/pull/8572) +* [[`51e09d00c4`](https://github.com/nodejs/node/commit/51e09d00c4)] - **src**: normalize malloc, realloc (Michael Dawson) [#7564](https://github.com/nodejs/node/pull/7564) +* [[`3b5cedebd1`](https://github.com/nodejs/node/commit/3b5cedebd1)] - **src**: renaming ares_task struct to node_ares_task (Daniel Bevenius) [#7345](https://github.com/nodejs/node/pull/7345) +* [[`e5d2a95d68`](https://github.com/nodejs/node/commit/e5d2a95d68)] - **src**: remove out-of-date TODO comment (Daniel Bevenius) [#9000](https://github.com/nodejs/node/pull/9000) +* [[`b4353e9017`](https://github.com/nodejs/node/commit/b4353e9017)] - **src**: fix typo in #endif comment (Juan Andres Andrango) [#8989](https://github.com/nodejs/node/pull/8989) +* [[`f0192ec195`](https://github.com/nodejs/node/commit/f0192ec195)] - **src**: don't abort when c-ares initialization fails (Ben Noordhuis) [#8710](https://github.com/nodejs/node/pull/8710) +* [[`f669a08b76`](https://github.com/nodejs/node/commit/f669a08b76)] - **src**: fix typo rval to value (Miguel Angel Asencio Hurtado) [#9023](https://github.com/nodejs/node/pull/9023) +* [[`9b9762ccec`](https://github.com/nodejs/node/commit/9b9762ccec)] - **streams**: fix regression in `unpipe()` (Anna Henningsen) [#9171](https://github.com/nodejs/node/pull/9171) +* [[`cc36a63205`](https://github.com/nodejs/node/commit/cc36a63205)] - **test**: remove watchdog in test-debug-signal-cluster (Rich Trott) [#9476](https://github.com/nodejs/node/pull/9476) +* [[`9144d373ba`](https://github.com/nodejs/node/commit/9144d373ba)] - **test**: cleanup test-dgram-error-message-address (Michael Macherey) [#8938](https://github.com/nodejs/node/pull/8938) +* [[`96bdfae041`](https://github.com/nodejs/node/commit/96bdfae041)] - **test**: improve test-debugger-util-regression (Santiago Gimeno) [#9490](https://github.com/nodejs/node/pull/9490) +* [[`2c758861c0`](https://github.com/nodejs/node/commit/2c758861c0)] - **test**: move timer-dependent test to sequential (Rich Trott) [#9431](https://github.com/nodejs/node/pull/9431) +* [[`d9955fbb17`](https://github.com/nodejs/node/commit/d9955fbb17)] - **test**: add test for HTTP client "aborted" event (Kyle E. Mitchell) [#7376](https://github.com/nodejs/node/pull/7376) +* [[`b0476c5590`](https://github.com/nodejs/node/commit/b0476c5590)] - **test**: fix flaky test-fs-watch-recursive on OS X (Rich Trott) [#9303](https://github.com/nodejs/node/pull/9303) +* [[`bcd156f4ab`](https://github.com/nodejs/node/commit/bcd156f4ab)] - **test**: refactor test-async-wrap-check-providers (Gerges Beshay) [#9297](https://github.com/nodejs/node/pull/9297) +* [[`9d5e7f5c85`](https://github.com/nodejs/node/commit/9d5e7f5c85)] - **test**: use strict assertions in module loader test (Ben Noordhuis) [#9263](https://github.com/nodejs/node/pull/9263) +* [[`6d742b3fdd`](https://github.com/nodejs/node/commit/6d742b3fdd)] - **test**: remove err timer from test-http-set-timeout (BethGriggs) [#9264](https://github.com/nodejs/node/pull/9264) +* [[`51b251d8eb`](https://github.com/nodejs/node/commit/51b251d8eb)] - **test**: add coverage for spawnSync() killSignal (cjihrig) [#8960](https://github.com/nodejs/node/pull/8960) +* [[`fafffd4f99`](https://github.com/nodejs/node/commit/fafffd4f99)] - **test**: fix test-child-process-fork-regr-gh-2847 (Santiago Gimeno) [#8954](https://github.com/nodejs/node/pull/8954) +* [[`a2621a25e5`](https://github.com/nodejs/node/commit/a2621a25e5)] - **test**: remove FIXME pummel/test-tls-securepair-client (Alfred Cepeda) [#8757](https://github.com/nodejs/node/pull/8757) +* [[`747013bc39`](https://github.com/nodejs/node/commit/747013bc39)] - **test**: output tap13 instead of almost-tap (Johan Bergström) [#9262](https://github.com/nodejs/node/pull/9262) +* [[`790406661d`](https://github.com/nodejs/node/commit/790406661d)] - **test**: refactor test-net-server-max-connections (Rich Trott) [#8931](https://github.com/nodejs/node/pull/8931) +* [[`347547a97e`](https://github.com/nodejs/node/commit/347547a97e)] - **test**: expand test coverage for url.js (Junshu Okamoto) [#8859](https://github.com/nodejs/node/pull/8859) +* [[`cec5e36df7`](https://github.com/nodejs/node/commit/cec5e36df7)] - **test**: fix test-cluster-worker-init.js flakyness (Ilkka Myller) [#8703](https://github.com/nodejs/node/pull/8703) +* [[`b3fccc2536`](https://github.com/nodejs/node/commit/b3fccc2536)] - **test**: enable cyrillic punycode test case (Ben Noordhuis) [#8695](https://github.com/nodejs/node/pull/8695) +* [[`03f703177f`](https://github.com/nodejs/node/commit/03f703177f)] - **test**: remove call to `net.Socket.resume()` (Alfred Cepeda) [#8679](https://github.com/nodejs/node/pull/8679) +* [[`527db40932`](https://github.com/nodejs/node/commit/527db40932)] - **test**: add coverage for execFileSync() errors (cjihrig) [#9211](https://github.com/nodejs/node/pull/9211) +* [[`40ef23969d`](https://github.com/nodejs/node/commit/40ef23969d)] - **test**: writable stream needDrain state (Italo A. Casas) [#8799](https://github.com/nodejs/node/pull/8799) +* [[`ba4a3ede56`](https://github.com/nodejs/node/commit/ba4a3ede56)] - **test**: writable stream ending state (Italo A. Casas) [#8707](https://github.com/nodejs/node/pull/8707) +* [[`80a26c7540`](https://github.com/nodejs/node/commit/80a26c7540)] - **test**: writable stream finished state (Italo A. Casas) [#8791](https://github.com/nodejs/node/pull/8791) +* [[`a64af39c83`](https://github.com/nodejs/node/commit/a64af39c83)] - **test**: remove duplicate required module (Rich Trott) [#9169](https://github.com/nodejs/node/pull/9169) +* [[`a038fcc307`](https://github.com/nodejs/node/commit/a038fcc307)] - **test**: add regression test for instanceof (Franziska Hinkelmann) [#9178](https://github.com/nodejs/node/pull/9178) +* [[`bd99b2d4e4`](https://github.com/nodejs/node/commit/bd99b2d4e4)] - **test**: checking if error constructor is assert.AssertionError (larissayvette) [#9119](https://github.com/nodejs/node/pull/9119) +* [[`4a6bd8683f`](https://github.com/nodejs/node/commit/4a6bd8683f)] - **test**: fix flaky test-child-process-fork-dgram (Rich Trott) [#9098](https://github.com/nodejs/node/pull/9098) +* [[`d9c33646e6`](https://github.com/nodejs/node/commit/d9c33646e6)] - **test**: add regression test for `unpipe()` (Niels Nielsen) [#9171](https://github.com/nodejs/node/pull/9171) +* [[`f9b24f42ba`](https://github.com/nodejs/node/commit/f9b24f42ba)] - **test**: use npm sandbox in test-npm-install (João Reis) [#9079](https://github.com/nodejs/node/pull/9079) +* [[`54c38eb22e`](https://github.com/nodejs/node/commit/54c38eb22e)] - **tickprocessor**: apply c++filt manually on mac (Fedor Indutny) [#8480](https://github.com/nodejs/node/pull/8480) +* [[`bf25994308`](https://github.com/nodejs/node/commit/bf25994308)] - **tls**: fix leak of WriteWrap+TLSWrap combination (Fedor Indutny) [#9586](https://github.com/nodejs/node/pull/9586) +* [[`9049c1f6b6`](https://github.com/nodejs/node/commit/9049c1f6b6)] - **(SEMVER-MINOR)** **tls**: introduce `secureContext` for `tls.connect` (Fedor Indutny) [#4246](https://github.com/nodejs/node/pull/4246) +* [[`b1bd1c42c0`](https://github.com/nodejs/node/commit/b1bd1c42c0)] - **tools**: allow test.py to use full paths of tests (Francis Gulotta) [#9694](https://github.com/nodejs/node/pull/9694) +* [[`533ce48b6a`](https://github.com/nodejs/node/commit/533ce48b6a)] - **tools**: make --repeat work with -j in test.py (Rich Trott) [#9249](https://github.com/nodejs/node/pull/9249) +* [[`f9baa1119f`](https://github.com/nodejs/node/commit/f9baa1119f)] - **tools**: remove dangling eslint symlink (Sam Roberts) [#9299](https://github.com/nodejs/node/pull/9299) +* [[`c8dccf29dd`](https://github.com/nodejs/node/commit/c8dccf29dd)] - **tools**: avoid let in for loops (jessicaquynh) [#9049](https://github.com/nodejs/node/pull/9049) +* [[`620cdc5ce8`](https://github.com/nodejs/node/commit/620cdc5ce8)] - **tools**: fix release script on macOS 10.12 (Evan Lucas) [#8824](https://github.com/nodejs/node/pull/8824) +* [[`f18f3b61e3`](https://github.com/nodejs/node/commit/f18f3b61e3)] - **util**: use template strings (Alejandro Oviedo Garcia) [#9120](https://github.com/nodejs/node/pull/9120) +* [[`1dfb5b5a09`](https://github.com/nodejs/node/commit/1dfb5b5a09)] - **v8**: update make-v8.sh to use git (Jaideep Bajwa) [#9393](https://github.com/nodejs/node/pull/9393) +* [[`bdb6cf92c7`](https://github.com/nodejs/node/commit/bdb6cf92c7)] - **win,msi**: mark INSTALLDIR property as secure (João Reis) [#8795](https://github.com/nodejs/node/pull/8795) +* [[`9a02414a29`](https://github.com/nodejs/node/commit/9a02414a29)] - **zlib**: fix raw inflate with custom dictionary (Tarjei Husøy) + +## 2016-11-08, Version 4.6.2 'Argon' (LTS), @thealphanerd + +This LTS release comes with 219 commits. This includes 80 commits that are docs related, 58 commits that are test related, 20 commits that are build / tool related, and 9 commits that are updates to dependencies. + +### Notable Changes + +* **build**: It is now possible to build the documentation from the release tarball (Anna Henningsen) [#8413](https://github.com/nodejs/node/pull/8413) +* **buffer**: Buffer.alloc() will no longer incorrectly return a zero filled buffer when an encoding is passed (Teddy Katz) [#9238](https://github.com/nodejs/node/pull/9238) +* **deps**: upgrade npm in LTS to 2.15.11 (Kat Marchán) [#8928](https://github.com/nodejs/node/pull/8928) +* **repl**: Enable tab completion for global properties (Lance Ball) [#7369](https://github.com/nodejs/node/pull/7369) +* **url**: `url.format()` will now encode all `#` in `search` (Ilkka Myller) [#8072](https://github.com/nodejs/node/pull/8072) + +### Commits + +* [[`06a1c9bf80`](https://github.com/nodejs/node/commit/06a1c9bf80)] - **assert**: remove code that is never reached (Rich Trott) [#8132](https://github.com/nodejs/node/pull/8132) +* [[`861e584d46`](https://github.com/nodejs/node/commit/861e584d46)] - **async_wrap**: add a missing case to test-async-wrap-throw-no-init (yorkie) [#8198](https://github.com/nodejs/node/pull/8198) +* [[`a3d08025fa`](https://github.com/nodejs/node/commit/a3d08025fa)] - **benchmark**: add benches for fs.stat & fs.statSync (Anna Henningsen) [#8338](https://github.com/nodejs/node/pull/8338) +* [[`408a585261`](https://github.com/nodejs/node/commit/408a585261)] - **buffer**: fix `fill` with encoding in Buffer.alloc() (Teddy Katz) [#9238](https://github.com/nodejs/node/pull/9238) +* [[`17c4187949`](https://github.com/nodejs/node/commit/17c4187949)] - **buffer**: optimize hex_decode (Christopher Jeffrey) [#7602](https://github.com/nodejs/node/pull/7602) +* [[`50cfea0081`](https://github.com/nodejs/node/commit/50cfea0081)] - **build**: run `npm install` for doc builds in tarball (Anna Henningsen) [#8413](https://github.com/nodejs/node/pull/8413) +* [[`c4be179064`](https://github.com/nodejs/node/commit/c4be179064)] - **build**: add missing files to zip and 7z packages (Richard Lau) [#8069](https://github.com/nodejs/node/pull/8069) +* [[`41e27f6a6a`](https://github.com/nodejs/node/commit/41e27f6a6a)] - **build**: don't link against liblog on host system (Ben Noordhuis) [#7762](https://github.com/nodejs/node/pull/7762) +* [[`7766997f7e`](https://github.com/nodejs/node/commit/7766997f7e)] - **build**: add conflict marker check during CI lint (Brian White) [#7625](https://github.com/nodejs/node/pull/7625) +* [[`2a66ddbcbb`](https://github.com/nodejs/node/commit/2a66ddbcbb)] - **build**: re-add --ninja option to configure (Ehsan Akhgari) [#6780](https://github.com/nodejs/node/pull/6780) +* [[`950cc1df83`](https://github.com/nodejs/node/commit/950cc1df83)] - **build**: adding config.gypi dep to addons/.buildstamp (Daniel Bevenius) [#7893](https://github.com/nodejs/node/pull/7893) +* [[`e64063c344`](https://github.com/nodejs/node/commit/e64063c344)] - **build**: don't require processing docs for nightlies (Johan Bergström) [#8325](https://github.com/nodejs/node/pull/8325) +* [[`00ea7388cb`](https://github.com/nodejs/node/commit/00ea7388cb)] - **build**: fix dependencies on AIX (Michael Dawson) [#8285](https://github.com/nodejs/node/pull/8285) +* [[`8dfab3ad68`](https://github.com/nodejs/node/commit/8dfab3ad68)] - **build**: fix dependencies on AIX (Michael Dawson) [#8272](https://github.com/nodejs/node/pull/8272) +* [[`1b5f35f1be`](https://github.com/nodejs/node/commit/1b5f35f1be)] - **build**: turn on thin static archives (Ben Noordhuis) [#7957](https://github.com/nodejs/node/pull/7957) +* [[`c41efe4d68`](https://github.com/nodejs/node/commit/c41efe4d68)] - **build**: add node_module_version to config.gypi (Marcin Cieślak) [#8171](https://github.com/nodejs/node/pull/8171) +* [[`f556b43e3e`](https://github.com/nodejs/node/commit/f556b43e3e)] - **build**: add --enable-d8 configure option (Ben Noordhuis) [#7538](https://github.com/nodejs/node/pull/7538) +* [[`612dfeb647`](https://github.com/nodejs/node/commit/612dfeb647)] - **child_process**: Check stderr before accessing it (Robert Chiras) [#6877](https://github.com/nodejs/node/pull/6877) +* [[`5ed5142158`](https://github.com/nodejs/node/commit/5ed5142158)] - **child_process**: workaround fd passing issue on OS X (Santiago Gimeno) [#7572](https://github.com/nodejs/node/pull/7572) +* [[`227db0ab21`](https://github.com/nodejs/node/commit/227db0ab21)] - **cluster**: remove bind() and self (cjihrig) [#7710](https://github.com/nodejs/node/pull/7710) +* [[`3003131e9a`](https://github.com/nodejs/node/commit/3003131e9a)] - **configure**: reword help for --without-npm (BlackYoup) [#7471](https://github.com/nodejs/node/pull/7471) +* [[`2b933339d0`](https://github.com/nodejs/node/commit/2b933339d0)] - **debugger**: use arrow function for lexical `this` (Guy Fraser) [#7415](https://github.com/nodejs/node/pull/7415) +* [[`52cba4147d`](https://github.com/nodejs/node/commit/52cba4147d)] - **deps**: backport 2bcbe2f from V8 upstream (ofrobots) [#7814](https://github.com/nodejs/node/pull/7814) +* [[`2b01bc8e55`](https://github.com/nodejs/node/commit/2b01bc8e55)] - **deps**: backport a76d133 from v8 upstream (Matt Loring) [#7689](https://github.com/nodejs/node/pull/7689) +* [[`e1f12fb358`](https://github.com/nodejs/node/commit/e1f12fb358)] - **deps**: cherry-pick b93c80a from v8 upstream (Matt Loring) [#7689](https://github.com/nodejs/node/pull/7689) +* [[`2d07fd71ee`](https://github.com/nodejs/node/commit/2d07fd71ee)] - **deps**: backport e093a04, 09db540 from upstream V8 (Ali Ijaz Sheikh) [#7689](https://github.com/nodejs/node/pull/7689) +* [[`4369055878`](https://github.com/nodejs/node/commit/4369055878)] - **deps**: cherry-pick 1f53e42 from v8 upstream (Ben Noordhuis) [#7612](https://github.com/nodejs/node/pull/7612) +* [[`05d40d9573`](https://github.com/nodejs/node/commit/05d40d9573)] - **deps**: upgrade npm in LTS to 2.15.11 (Kat Marchán) [#8928](https://github.com/nodejs/node/pull/8928) +* [[`36b3ff0cfc`](https://github.com/nodejs/node/commit/36b3ff0cfc)] - **deps**: float gyp patch for long filenames (Anna Henningsen) [#7963](https://github.com/nodejs/node/pull/7963) +* [[`9ddc615d0e`](https://github.com/nodejs/node/commit/9ddc615d0e)] - **deps**: no /safeseh for ml64.exe (Fedor Indutny) [#7759](https://github.com/nodejs/node/pull/7759) +* [[`ea36c61eda`](https://github.com/nodejs/node/commit/ea36c61eda)] - **deps**: `MASM.UseSafeExceptionHandlers` for OpenSSL (Fedor Indutny) [#7427](https://github.com/nodejs/node/pull/7427) +* [[`0b87b1a095`](https://github.com/nodejs/node/commit/0b87b1a095)] - **dns**: tweak regex for IPv6 addresses (Luigi Pinca) [#8665](https://github.com/nodejs/node/pull/8665) +* [[`0e2aba96bc`](https://github.com/nodejs/node/commit/0e2aba96bc)] - **doc**: make sure links are correctly passed to marked (Timothy Gu) [#8494](https://github.com/nodejs/node/pull/8494) +* [[`3a43b0d981`](https://github.com/nodejs/node/commit/3a43b0d981)] - **doc**: correct metadata of `Buffer.from` (Anna Henningsen) [#9167](https://github.com/nodejs/node/pull/9167) +* [[`880ca99847`](https://github.com/nodejs/node/commit/880ca99847)] - **doc**: fix broken link in dgram doc (Brian White) [#8365](https://github.com/nodejs/node/pull/8365) +* [[`65ca2af471`](https://github.com/nodejs/node/commit/65ca2af471)] - **doc**: add missing semicolon (Ravindra barthwal) [#7915](https://github.com/nodejs/node/pull/7915) +* [[`da3b938be3`](https://github.com/nodejs/node/commit/da3b938be3)] - **doc**: add `added:` information for globals (Luigi Pinca) [#8901](https://github.com/nodejs/node/pull/8901) +* [[`b4ba4af525`](https://github.com/nodejs/node/commit/b4ba4af525)] - **doc**: add CTC meeting minutes 2016-09-07 (Josh Gavant) [#8499](https://github.com/nodejs/node/pull/8499) +* [[`4b49b0e30c`](https://github.com/nodejs/node/commit/4b49b0e30c)] - **doc**: add CTC meeting minutes 2016-09-14 (Josh Gavant) [#8726](https://github.com/nodejs/node/pull/8726) +* [[`88b0067229`](https://github.com/nodejs/node/commit/88b0067229)] - **doc**: add CTC meeting minutes 2016-09-21 (Josh Gavant) [#8727](https://github.com/nodejs/node/pull/8727) +* [[`f7c4e9489f`](https://github.com/nodejs/node/commit/f7c4e9489f)] - **doc**: update npm LICENSE using license-builder.sh (Kat Marchán) [#8928](https://github.com/nodejs/node/pull/8928) +* [[`6effc4aadc`](https://github.com/nodejs/node/commit/6effc4aadc)] - **doc**: add `added:` information for crypto (Luigi Pinca) [#8281](https://github.com/nodejs/node/pull/8281) +* [[`d750fc6336`](https://github.com/nodejs/node/commit/d750fc6336)] - **doc**: add `added:` information for dgram (Luigi Pinca) [#8196](https://github.com/nodejs/node/pull/8196) +* [[`b92e3fc72e`](https://github.com/nodejs/node/commit/b92e3fc72e)] - **doc**: add `added:` information for util (Luigi Pinca) [#8206](https://github.com/nodejs/node/pull/8206) +* [[`578bf511f9`](https://github.com/nodejs/node/commit/578bf511f9)] - **doc**: add `added:` information for events (Luigi Pinca) [#7822](https://github.com/nodejs/node/pull/7822) +* [[`6ef58e7211`](https://github.com/nodejs/node/commit/6ef58e7211)] - **doc**: add gibfahn to collaborators (Gibson Fahnestock) [#8533](https://github.com/nodejs/node/pull/8533) +* [[`5ff1fc7d86`](https://github.com/nodejs/node/commit/5ff1fc7d86)] - **doc**: add imyller to collaborators (Ilkka Myller) [#8530](https://github.com/nodejs/node/pull/8530) +* [[`88bb65dd74`](https://github.com/nodejs/node/commit/88bb65dd74)] - **doc**: add not-an-aardvark to collaborators (not-an-aardvark) [#8525](https://github.com/nodejs/node/pull/8525) +* [[`5bec1eb0d4`](https://github.com/nodejs/node/commit/5bec1eb0d4)] - **doc**: update onboarding PR landing info (Rich Trott) [#8479](https://github.com/nodejs/node/pull/8479) +* [[`ecd2b52982`](https://github.com/nodejs/node/commit/ecd2b52982)] - **doc**: encourage 2FA before onboarding (Rich Trott) [#8776](https://github.com/nodejs/node/pull/8776) +* [[`2adbd53837`](https://github.com/nodejs/node/commit/2adbd53837)] - **doc**: add commit formats for release blog posts (fen) [#8631](https://github.com/nodejs/node/pull/8631) +* [[`764502bb37`](https://github.com/nodejs/node/commit/764502bb37)] - **doc**: add CTC meeting minutes 2016-08-24 (Josh Gavant) [#8423](https://github.com/nodejs/node/pull/8423) +* [[`3037a9da08`](https://github.com/nodejs/node/commit/3037a9da08)] - **doc**: add eugeneo to collaborators (Eugene Ostroukhov) [#8696](https://github.com/nodejs/node/pull/8696) +* [[`0fd1d8dfd7`](https://github.com/nodejs/node/commit/0fd1d8dfd7)] - **doc**: add ak239 to collaborators (Aleksey Kozyatinskiy) [#8676](https://github.com/nodejs/node/pull/8676) +* [[`64c4bb30fe`](https://github.com/nodejs/node/commit/64c4bb30fe)] - **doc**: add link to help repo in README (Rich Trott) [#8570](https://github.com/nodejs/node/pull/8570) +* [[`d123fc1307`](https://github.com/nodejs/node/commit/d123fc1307)] - **doc**: update exercise portion of onboarding doc (Rich Trott) [#8559](https://github.com/nodejs/node/pull/8559) +* [[`c6b622f6b3`](https://github.com/nodejs/node/commit/c6b622f6b3)] - **doc**: add CTC meeting minutes 2016-08-31 (Josh Gavant) [#8424](https://github.com/nodejs/node/pull/8424) +* [[`055d39c724`](https://github.com/nodejs/node/commit/055d39c724)] - **doc**: add CI help/support info to onboarding doc (Rich Trott) [#8407](https://github.com/nodejs/node/pull/8407) +* [[`a7e6fc08d8`](https://github.com/nodejs/node/commit/a7e6fc08d8)] - **doc**: add 2016-08-17 CTC meeting minutes (Josh Gavant) [#8245](https://github.com/nodejs/node/pull/8245) +* [[`ca63c127c7`](https://github.com/nodejs/node/commit/ca63c127c7)] - **doc**: add 2016-08-10 CTC meeting minutes (Josh Gavant) [#8229](https://github.com/nodejs/node/pull/8229) +* [[`3f2e3dfb32`](https://github.com/nodejs/node/commit/3f2e3dfb32)] - **doc**: update CI content in onboarding doc (Rich Trott) [#8374](https://github.com/nodejs/node/pull/8374) +* [[`9e1325c42e`](https://github.com/nodejs/node/commit/9e1325c42e)] - **doc**: update authors list (James M Snell) [#8346](https://github.com/nodejs/node/pull/8346) +* [[`c529bf5521`](https://github.com/nodejs/node/commit/c529bf5521)] - **doc**: add return type of clientRequest.setTimeout (Mike Ralphson) [#8356](https://github.com/nodejs/node/pull/8356) +* [[`c094b2a51c`](https://github.com/nodejs/node/commit/c094b2a51c)] - **doc**: update targos email in readme per request (James M Snell) [#8389](https://github.com/nodejs/node/pull/8389) +* [[`5c417ee25b`](https://github.com/nodejs/node/commit/5c417ee25b)] - **doc**: update landing pr info in onboarding doc (Rich Trott) [#8344](https://github.com/nodejs/node/pull/8344) +* [[`763fa85ccf`](https://github.com/nodejs/node/commit/763fa85ccf)] - **doc**: bad/better examples for fs.access() and fs.exists() (Dan Fabulich) [#7832](https://github.com/nodejs/node/pull/7832) +* [[`0c933e5bab`](https://github.com/nodejs/node/commit/0c933e5bab)] - **doc**: adding danbev to collaborators (Daniel Bevenius) [#8359](https://github.com/nodejs/node/pull/8359) +* [[`e069dc45b0`](https://github.com/nodejs/node/commit/e069dc45b0)] - **doc**: add lpinca to collaborators (Luigi Pinca) [#8331](https://github.com/nodejs/node/pull/8331) +* [[`e5f4367da5`](https://github.com/nodejs/node/commit/e5f4367da5)] - **doc**: readline write() is processed as input (James M Snell) [#8295](https://github.com/nodejs/node/pull/8295) +* [[`b3617fcc7d`](https://github.com/nodejs/node/commit/b3617fcc7d)] - **doc**: add `added:` information for modules (Luigi Pinca) [#8250](https://github.com/nodejs/node/pull/8250) +* [[`0b605636c5`](https://github.com/nodejs/node/commit/0b605636c5)] - **doc**: add Myles Borins to the CTC (Rod Vagg) [#8260](https://github.com/nodejs/node/pull/8260) +* [[`a8a8f0a6f1`](https://github.com/nodejs/node/commit/a8a8f0a6f1)] - **doc**: add `added:` information for cluster (Anna Henningsen) [#7640](https://github.com/nodejs/node/pull/7640) +* [[`2a2971b26e`](https://github.com/nodejs/node/commit/2a2971b26e)] - **doc**: use blockquotes for Stability: markers (Anna Henningsen) [#7757](https://github.com/nodejs/node/pull/7757) +* [[`3a3fde69c7`](https://github.com/nodejs/node/commit/3a3fde69c7)] - **doc**: fix variable scoping bug in server example code (lazlojuly) [#8124](https://github.com/nodejs/node/pull/8124) +* [[`f1e14e4227`](https://github.com/nodejs/node/commit/f1e14e4227)] - **doc**: fix cluster message event docs (Zach Bjornson) [#8017](https://github.com/nodejs/node/pull/8017) +* [[`9b29cfc3a6`](https://github.com/nodejs/node/commit/9b29cfc3a6)] - **doc**: Clean up roff source in manpage (Alhadis) [#7819](https://github.com/nodejs/node/pull/7819) +* [[`364af49e0f`](https://github.com/nodejs/node/commit/364af49e0f)] - **doc**: add CTC meeting minutes 2016-06-22 (Josh Gavant) [#7390](https://github.com/nodejs/node/pull/7390) +* [[`9892a5ddc3`](https://github.com/nodejs/node/commit/9892a5ddc3)] - **doc**: remove extra spaces and concats in examples (Joe Esposito) [#7885](https://github.com/nodejs/node/pull/7885) +* [[`3ad74089f5`](https://github.com/nodejs/node/commit/3ad74089f5)] - **doc**: correct sample output of buf.compare (Hargobind S. Khalsa) [#7777](https://github.com/nodejs/node/pull/7777) +* [[`26e695c46c`](https://github.com/nodejs/node/commit/26e695c46c)] - **doc**: remove "feature branch" jargon (Rich Trott) [#8194](https://github.com/nodejs/node/pull/8194) +* [[`d676467208`](https://github.com/nodejs/node/commit/d676467208)] - **doc**: remove outdated LTS info from ROADMAP.md (Rich Trott) [#8161](https://github.com/nodejs/node/pull/8161) +* [[`b3545e148d`](https://github.com/nodejs/node/commit/b3545e148d)] - **doc**: update release announce instruction to tweet (Tracy Hinds) [#8126](https://github.com/nodejs/node/pull/8126) +* [[`2032bba65f`](https://github.com/nodejs/node/commit/2032bba65f)] - **doc**: add @joshgav to collaborators (Josh Gavant) [#8146](https://github.com/nodejs/node/pull/8146) +* [[`727c24f3a2`](https://github.com/nodejs/node/commit/727c24f3a2)] - **doc**: update Reviewing section of onboarding doc (Rich Trott) +* [[`04515b891a`](https://github.com/nodejs/node/commit/04515b891a)] - **doc**: move orangemocha to collaborators list (Rich Trott) [#8062](https://github.com/nodejs/node/pull/8062) +* [[`d3344aa216`](https://github.com/nodejs/node/commit/d3344aa216)] - **doc**: Add fhinkel to collaborators (Franziska Hinkelmann) [#8052](https://github.com/nodejs/node/pull/8052) +* [[`532bbde4bf`](https://github.com/nodejs/node/commit/532bbde4bf)] - **doc**: add CTC meeting minutes 2016-08-03 (Josh Gavant) [#7980](https://github.com/nodejs/node/pull/7980) +* [[`98fe74fbc8`](https://github.com/nodejs/node/commit/98fe74fbc8)] - **doc**: fix a markdown error in CTC meeting minutes (Сковорода Никита Андреевич) [#7729](https://github.com/nodejs/node/pull/7729) +* [[`e74daadeb6`](https://github.com/nodejs/node/commit/e74daadeb6)] - **doc**: clarify collaborators & ctc members relationships (yorkie) [#7996](https://github.com/nodejs/node/pull/7996) +* [[`6bfdc92860`](https://github.com/nodejs/node/commit/6bfdc92860)] - **doc**: clarify "Reviewed-By" iff "LGTM" (Bryan English) [#7183](https://github.com/nodejs/node/pull/7183) +* [[`94a82cd0a7`](https://github.com/nodejs/node/commit/94a82cd0a7)] - **doc**: add CTC meeting minutes 2016-07-13 (Josh Gavant) [#7968](https://github.com/nodejs/node/pull/7968) +* [[`012ccf010e`](https://github.com/nodejs/node/commit/012ccf010e)] - **doc**: add CTC meeting minutes 2016-07-20 (Josh Gavant) [#7970](https://github.com/nodejs/node/pull/7970) +* [[`08111e84b1`](https://github.com/nodejs/node/commit/08111e84b1)] - **doc**: use consistent markdown in README (Rich Trott) [#7971](https://github.com/nodejs/node/pull/7971) +* [[`009df788de`](https://github.com/nodejs/node/commit/009df788de)] - **doc**: use `git-secure-tag` for release tags (Fedor Indutny) [#7603](https://github.com/nodejs/node/pull/7603) +* [[`abefdca5ae`](https://github.com/nodejs/node/commit/abefdca5ae)] - **doc**: piscisaureus has stepped-down from the CTC (James M Snell) [#7969](https://github.com/nodejs/node/pull/7969) +* [[`9700660d2b`](https://github.com/nodejs/node/commit/9700660d2b)] - **doc**: add @addaleax to the CTC (Anna Henningsen) [#7966](https://github.com/nodejs/node/pull/7966) +* [[`f255180853`](https://github.com/nodejs/node/commit/f255180853)] - **doc**: add CTC meeting minutes 2016-07-06 (Josh Gavant) [#7570](https://github.com/nodejs/node/pull/7570) +* [[`b60473fac7`](https://github.com/nodejs/node/commit/b60473fac7)] - **doc**: add CTC meeting minutes 2016-06-29 (Josh Gavant) [#7571](https://github.com/nodejs/node/pull/7571) +* [[`ac40b2a9b6`](https://github.com/nodejs/node/commit/ac40b2a9b6)] - **doc**: add CTC meeting minutes 2016-07-27 (William Kapke) [#7900](https://github.com/nodejs/node/pull/7900) +* [[`bbbbb19658`](https://github.com/nodejs/node/commit/bbbbb19658)] - **doc**: add information about CTC quorum rules (Rich Trott) [#7813](https://github.com/nodejs/node/pull/7813) +* [[`d759d4e0a6`](https://github.com/nodejs/node/commit/d759d4e0a6)] - **doc**: remove platform assumption from CONTRIBUTING (Bethany N Griggs) [#7783](https://github.com/nodejs/node/pull/7783) +* [[`b01854dd9d`](https://github.com/nodejs/node/commit/b01854dd9d)] - **doc**: add princejwesley to collaborators (Prince J Wesley) [#7877](https://github.com/nodejs/node/pull/7877) +* [[`26f5168c02`](https://github.com/nodejs/node/commit/26f5168c02)] - **doc**: clarify that the node.js irc channel is not under tsc oversight (James M Snell) [#7810](https://github.com/nodejs/node/pull/7810) +* [[`506e367062`](https://github.com/nodejs/node/commit/506e367062)] - **doc**: update readme with andrasq as a collaborator (Andras) [#7801](https://github.com/nodejs/node/pull/7801) +* [[`590c52a309`](https://github.com/nodejs/node/commit/590c52a309)] - **doc**: update CTC governance information (Rich Trott) [#7719](https://github.com/nodejs/node/pull/7719) +* [[`fdff642e0b`](https://github.com/nodejs/node/commit/fdff642e0b)] - **doc**: fix util.deprecate() example (Evan Lucas) [#7674](https://github.com/nodejs/node/pull/7674) +* [[`8fec02ffb8`](https://github.com/nodejs/node/commit/8fec02ffb8)] - **doc**: delete non-existing zlib constants (Franziska Hinkelmann) [#7520](https://github.com/nodejs/node/pull/7520) +* [[`d6c2e383a2`](https://github.com/nodejs/node/commit/d6c2e383a2)] - **doc**: minor updates to onboarding doc (Rich Trott) [#8060](https://github.com/nodejs/node/pull/8060) +* [[`e46d1e026e`](https://github.com/nodejs/node/commit/e46d1e026e)] - **doc**: add POST_STATUS_TO_PR info to onboarding doc (Rich Trott) [#8059](https://github.com/nodejs/node/pull/8059) +* [[`4f3107190d`](https://github.com/nodejs/node/commit/4f3107190d)] - **doc**: add `added:` info for dgram.*Membership() (Rich Trott) [#6753](https://github.com/nodejs/node/pull/6753) +* [[`0e52861629`](https://github.com/nodejs/node/commit/0e52861629)] - **doc**: grammar fixes to event loop guide (Ryan Lewis) [#7479](https://github.com/nodejs/node/pull/7479) +* [[`29139bff65`](https://github.com/nodejs/node/commit/29139bff65)] - **doc**: improve server.listen() random port (Phillip Johnsen) [#8025](https://github.com/nodejs/node/pull/8025) +* [[`b680eb99ad`](https://github.com/nodejs/node/commit/b680eb99ad)] - **doctool**: improve the title of pages in doc (yorkie) +* [[`3d6f107a2f`](https://github.com/nodejs/node/commit/3d6f107a2f)] - **fs**: fix handling of `uv_stat_t` fields (Anna Henningsen) [#8515](https://github.com/nodejs/node/pull/8515) +* [[`2e29b76666`](https://github.com/nodejs/node/commit/2e29b76666)] - **intl**: Don't crash if v8BreakIterator not available (Steven R. Loomis) [#4253](https://github.com/nodejs/node/pull/4253) +* [[`f6e332da2d`](https://github.com/nodejs/node/commit/f6e332da2d)] - **lib**: implement consistent brace style (Rich Trott) [#8348](https://github.com/nodejs/node/pull/8348) +* [[`9d9bcd7c55`](https://github.com/nodejs/node/commit/9d9bcd7c55)] - **meta**: clarify process for breaking changes (Rich Trott) [#7955](https://github.com/nodejs/node/pull/7955) +* [[`6d49f22e35`](https://github.com/nodejs/node/commit/6d49f22e35)] - **meta**: include a minimal CTC removal policy (Rich Trott) [#7720](https://github.com/nodejs/node/pull/7720) +* [[`7faf6dc0da`](https://github.com/nodejs/node/commit/7faf6dc0da)] - **meta**: provide example activities (Rich Trott) [#7744](https://github.com/nodejs/node/pull/7744) +* [[`fe48415c60`](https://github.com/nodejs/node/commit/fe48415c60)] - **net**: add length check when normalizing args (Brian White) [#8112](https://github.com/nodejs/node/pull/8112) +* [[`3906206ecc`](https://github.com/nodejs/node/commit/3906206ecc)] - **net**: remove unnecessary variables (Brian White) [#8112](https://github.com/nodejs/node/pull/8112) +* [[`9f1b790f79`](https://github.com/nodejs/node/commit/9f1b790f79)] - **net**: make holding the buffer in memory more robust (Anna Henningsen) [#8252](https://github.com/nodejs/node/pull/8252) +* [[`b630be2309`](https://github.com/nodejs/node/commit/b630be2309)] - **net**: export isIPv4, isIPv6 directly from cares (Sakthipriyan Vairamani) [#7481](https://github.com/nodejs/node/pull/7481) +* [[`c235708bef`](https://github.com/nodejs/node/commit/c235708bef)] - **readline**: keypress trigger for escape character (Prince J Wesley) [#7382](https://github.com/nodejs/node/pull/7382) +* [[`8198dbc5a4`](https://github.com/nodejs/node/commit/8198dbc5a4)] - **repl**: Enable tab completion for global properties (Lance Ball) [#7369](https://github.com/nodejs/node/pull/7369) +* [[`12300626d7`](https://github.com/nodejs/node/commit/12300626d7)] - **src**: no abort from getter if object isn't wrapped (Trevor Norris) [#6184](https://github.com/nodejs/node/pull/6184) +* [[`166a9b85d9`](https://github.com/nodejs/node/commit/166a9b85d9)] - **src**: always clear wrap before persistent Reset() (Trevor Norris) [#6184](https://github.com/nodejs/node/pull/6184) +* [[`b3149cee8c`](https://github.com/nodejs/node/commit/b3149cee8c)] - **src**: inherit first from AsyncWrap (Trevor Norris) [#6184](https://github.com/nodejs/node/pull/6184) +* [[`8b93fddd1b`](https://github.com/nodejs/node/commit/8b93fddd1b)] - **src**: disable stdio buffering (Ben Noordhuis) [#7610](https://github.com/nodejs/node/pull/7610) +* [[`72be320962`](https://github.com/nodejs/node/commit/72be320962)] - **src**: suppress coverity message (cjihrig) [#7587](https://github.com/nodejs/node/pull/7587) +* [[`6ba3ad5d34`](https://github.com/nodejs/node/commit/6ba3ad5d34)] - **src**: guard against overflow in ParseArrayIndex() (Ben Noordhuis) [#7497](https://github.com/nodejs/node/pull/7497) +* [[`e1f961d050`](https://github.com/nodejs/node/commit/e1f961d050)] - **src**: move ParseArrayIndex() to src/node_buffer.cc (Ben Noordhuis) [#7497](https://github.com/nodejs/node/pull/7497) +* [[`57921ebec5`](https://github.com/nodejs/node/commit/57921ebec5)] - **src**: remove unnecessary HandleScopes (Ben Noordhuis) [#7711](https://github.com/nodejs/node/pull/7711) +* [[`6838ad5f8e`](https://github.com/nodejs/node/commit/6838ad5f8e)] - **src**: fix handle leak in UDPWrap::Instantiate() (Ben Noordhuis) [#7711](https://github.com/nodejs/node/pull/7711) +* [[`dadcf6b263`](https://github.com/nodejs/node/commit/dadcf6b263)] - **src**: fix handle leak in BuildStatsObject() (Ben Noordhuis) [#7711](https://github.com/nodejs/node/pull/7711) +* [[`7aa268922a`](https://github.com/nodejs/node/commit/7aa268922a)] - **src**: fix handle leak in Buffer::New() (Ben Noordhuis) [#7711](https://github.com/nodejs/node/pull/7711) +* [[`606deecd16`](https://github.com/nodejs/node/commit/606deecd16)] - **src**: don't include a null character in the WriteConsoleW call (Nikolai Vavilov) [#7764](https://github.com/nodejs/node/pull/7764) +* [[`a5b6c2cdd7`](https://github.com/nodejs/node/commit/a5b6c2cdd7)] - **src**: use RAII for mutexes and condition variables (Ben Noordhuis) [#7334](https://github.com/nodejs/node/pull/7334) +* [[`19d6f06058`](https://github.com/nodejs/node/commit/19d6f06058)] - **stream_base**: always use Base template class (Trevor Norris) [#6184](https://github.com/nodejs/node/pull/6184) +* [[`d5f03db819`](https://github.com/nodejs/node/commit/d5f03db819)] - **test**: fix test-cluster-dgram-1 flakiness (Santiago Gimeno) +* [[`a83bbaa5a3`](https://github.com/nodejs/node/commit/a83bbaa5a3)] - **test**: refactor test-tick-processor (Rich Trott) [#8180](https://github.com/nodejs/node/pull/8180) +* [[`1c81c078c2`](https://github.com/nodejs/node/commit/1c81c078c2)] - **test**: add assert.notDeepStrictEqual() tests (Rich Trott) [#8177](https://github.com/nodejs/node/pull/8177) +* [[`57c98f18a9`](https://github.com/nodejs/node/commit/57c98f18a9)] - **test**: favor `===` over `==` in crypto tests (Rich Trott) [#8176](https://github.com/nodejs/node/pull/8176) +* [[`11f761ab1a`](https://github.com/nodejs/node/commit/11f761ab1a)] - **test**: refactor pummel/test-dtrace-jsstack (Rich Trott) [#8175](https://github.com/nodejs/node/pull/8175) +* [[`2997b79fcc`](https://github.com/nodejs/node/commit/2997b79fcc)] - **test**: favor strict equality in test-exec (Rich Trott) [#8173](https://github.com/nodejs/node/pull/8173) +* [[`558f7d999c`](https://github.com/nodejs/node/commit/558f7d999c)] - **test**: add assert.notDeepEqual() tests (Rich Trott) [#8156](https://github.com/nodejs/node/pull/8156) +* [[`49c488625d`](https://github.com/nodejs/node/commit/49c488625d)] - **test**: add missing assert.deepEqual() test case (Rich Trott) [#8152](https://github.com/nodejs/node/pull/8152) +* [[`eec078cd66`](https://github.com/nodejs/node/commit/eec078cd66)] - **test**: favor strict equality in http tests (Rich Trott) [#8151](https://github.com/nodejs/node/pull/8151) +* [[`e3669f8c21`](https://github.com/nodejs/node/commit/e3669f8c21)] - **test**: favor strict equality in pummel net tests (Rich Trott) [#8135](https://github.com/nodejs/node/pull/8135) +* [[`ac83d199fb`](https://github.com/nodejs/node/commit/ac83d199fb)] - **test**: confirm that assert truncates long values (Rich Trott) [#8134](https://github.com/nodejs/node/pull/8134) +* [[`9c826beef7`](https://github.com/nodejs/node/commit/9c826beef7)] - **test**: favor `===` over `==` in test-timers.js (Rich Trott) [#8131](https://github.com/nodejs/node/pull/8131) +* [[`af02d2a642`](https://github.com/nodejs/node/commit/af02d2a642)] - **test**: favor strict equality check (Rich Trott) [#8130](https://github.com/nodejs/node/pull/8130) +* [[`30034048b0`](https://github.com/nodejs/node/commit/30034048b0)] - **test**: fix assertion in test-watch-file.js (Rich Trott) [#8129](https://github.com/nodejs/node/pull/8129) +* [[`b063dc90b1`](https://github.com/nodejs/node/commit/b063dc90b1)] - **test**: use strict equality in regression test (Rich Trott) [#8098](https://github.com/nodejs/node/pull/8098) +* [[`dc7bc2e679`](https://github.com/nodejs/node/commit/dc7bc2e679)] - **test**: add test for debug usage message (Rich Trott) [#8061](https://github.com/nodejs/node/pull/8061) +* [[`ce2cfbdc3a`](https://github.com/nodejs/node/commit/ce2cfbdc3a)] - **test**: console constructor missing new keyword (Rich Trott) [#8003](https://github.com/nodejs/node/pull/8003) +* [[`69f4edd368`](https://github.com/nodejs/node/commit/69f4edd368)] - **test**: speed up test-net-reconnect-error (Rich Trott) [#7886](https://github.com/nodejs/node/pull/7886) +* [[`50acf72d80`](https://github.com/nodejs/node/commit/50acf72d80)] - **test**: increase RAM requirement for intensive tests (Rich Trott) [#7772](https://github.com/nodejs/node/pull/7772) +* [[`924ea0a2bd`](https://github.com/nodejs/node/commit/924ea0a2bd)] - **test**: fix flaky test-http-server-consumed-timeout (Rich Trott) [#7717](https://github.com/nodejs/node/pull/7717) +* [[`97a3d89c80`](https://github.com/nodejs/node/commit/97a3d89c80)] - **test**: improve coverage of the util module (Michaël Zasso) [#8633](https://github.com/nodejs/node/pull/8633) +* [[`52bb37734b`](https://github.com/nodejs/node/commit/52bb37734b)] - **test**: mark test-child-process-fork-dgram as flaky (Michael Dawson) [#8274](https://github.com/nodejs/node/pull/8274) +* [[`97c68ddaad`](https://github.com/nodejs/node/commit/97c68ddaad)] - **test**: improve error message in test-tick-processor (Rich Trott) [#7693](https://github.com/nodejs/node/pull/7693) +* [[`cd9e8e0361`](https://github.com/nodejs/node/commit/cd9e8e0361)] - **test**: fix old tty tests (Jeremiah Senkpiel) [#7613](https://github.com/nodejs/node/pull/7613) +* [[`22990d8851`](https://github.com/nodejs/node/commit/22990d8851)] - **test**: move parallel/test-tty-* to pseudo-tty/ (Jeremiah Senkpiel) [#7613](https://github.com/nodejs/node/pull/7613) +* [[`afee32fed5`](https://github.com/nodejs/node/commit/afee32fed5)] - **test**: fix `fs-watch-recursive` flakiness on OS X (Santiago Gimeno) [#4629](https://github.com/nodejs/node/pull/4629) +* [[`c543f4a879`](https://github.com/nodejs/node/commit/c543f4a879)] - **test**: stream writable ended state (Italo A. Casas) [#8778](https://github.com/nodejs/node/pull/8778) +* [[`f46a04cc6d`](https://github.com/nodejs/node/commit/f46a04cc6d)] - **test**: add tests for add/remove header after sent (Niklas Ingholt) [#8682](https://github.com/nodejs/node/pull/8682) +* [[`e79351c3ac`](https://github.com/nodejs/node/commit/e79351c3ac)] - **test**: improve test-https-agent.js (Dan.Williams) [#8517](https://github.com/nodejs/node/pull/8517) +* [[`9ffb2f3c0d`](https://github.com/nodejs/node/commit/9ffb2f3c0d)] - **test**: add coverage for client._addHandle() (Rich Trott) [#8518](https://github.com/nodejs/node/pull/8518) +* [[`8da2dcb70a`](https://github.com/nodejs/node/commit/8da2dcb70a)] - **test**: refector parallel/test-http.js (Junshu Okamoto) [#8471](https://github.com/nodejs/node/pull/8471) +* [[`69404ec473`](https://github.com/nodejs/node/commit/69404ec473)] - **test**: fix flaky test-force-repl (Rich Trott) [#8484](https://github.com/nodejs/node/pull/8484) +* [[`5a07bb62ea`](https://github.com/nodejs/node/commit/5a07bb62ea)] - **test**: swapped == and equal to === and strictEqual (Christopher Dunavan) [#8472](https://github.com/nodejs/node/pull/8472) +* [[`ad1230e731`](https://github.com/nodejs/node/commit/ad1230e731)] - **test**: skip pseudo-tty/no_dropped_stdio test (Michael Dawson) [#8470](https://github.com/nodejs/node/pull/8470) +* [[`6d03170751`](https://github.com/nodejs/node/commit/6d03170751)] - **test**: clean up net server try ports test (Thomas Hunter II) [#8458](https://github.com/nodejs/node/pull/8458) +* [[`775c84ec38`](https://github.com/nodejs/node/commit/775c84ec38)] - **test**: add test-debug-protocol-execute (Rich Trott) [#8454](https://github.com/nodejs/node/pull/8454) +* [[`0d1082426a`](https://github.com/nodejs/node/commit/0d1082426a)] - **test**: mark pseudo-tty/no_dropped_stdio as flaky (Michael Dawson) [#8385](https://github.com/nodejs/node/pull/8385) +* [[`c034c861bb`](https://github.com/nodejs/node/commit/c034c861bb)] - **test**: test non-buffer/string with zlib (Rich Trott) [#8350](https://github.com/nodejs/node/pull/8350) +* [[`bb8690433c`](https://github.com/nodejs/node/commit/bb8690433c)] - **test**: fix ::1 error in test-dns-ipv6 (Gibson Fahnestock) [#8254](https://github.com/nodejs/node/pull/8254) +* [[`2f458ea663`](https://github.com/nodejs/node/commit/2f458ea663)] - **test**: add test for zlib.create*Raw() (Rich Trott) [#8306](https://github.com/nodejs/node/pull/8306) +* [[`a368ea673c`](https://github.com/nodejs/node/commit/a368ea673c)] - **test**: refactor test-debug-signal-cluster (Rich Trott) [#8289](https://github.com/nodejs/node/pull/8289) +* [[`a48469f098`](https://github.com/nodejs/node/commit/a48469f098)] - **test**: add check in test-signal-handler (Rich Trott) [#8248](https://github.com/nodejs/node/pull/8248) +* [[`cadb2612c6`](https://github.com/nodejs/node/commit/cadb2612c6)] - **test**: add test for attempted multiple IPC channels (cjihrig) [#8159](https://github.com/nodejs/node/pull/8159) +* [[`21c1b8467e`](https://github.com/nodejs/node/commit/21c1b8467e)] - **test**: decrease inconsistency in the common.js (Vse Mozhet Byt) [#7758](https://github.com/nodejs/node/pull/7758) +* [[`d40873ddcd`](https://github.com/nodejs/node/commit/d40873ddcd)] - **test**: ensure stream preprocessing order (Vse Mozhet Byt) [#7741](https://github.com/nodejs/node/pull/7741) +* [[`0e1f098b09`](https://github.com/nodejs/node/commit/0e1f098b09)] - **test**: avoid usage of mixed IPV6 addresses (Gireesh Punathil) [#7702](https://github.com/nodejs/node/pull/7702) +* [[`741373cb49`](https://github.com/nodejs/node/commit/741373cb49)] - **test**: clean up test-buffer-badhex (Jeremiah Senkpiel) [#7773](https://github.com/nodejs/node/pull/7773) +* [[`58f3fa17eb`](https://github.com/nodejs/node/commit/58f3fa17eb)] - **test**: s/assert.fail/common.fail as appropriate (cjihrig) [#7735](https://github.com/nodejs/node/pull/7735) +* [[`b0e2f9a37a`](https://github.com/nodejs/node/commit/b0e2f9a37a)] - **test**: add common.rootDir (cjihrig) [#7685](https://github.com/nodejs/node/pull/7685) +* [[`c94f3a5784`](https://github.com/nodejs/node/commit/c94f3a5784)] - **test**: handle IPv6 localhost issues within tests (Rich Trott) [#7766](https://github.com/nodejs/node/pull/7766) +* [[`b64828d8df`](https://github.com/nodejs/node/commit/b64828d8df)] - **test**: accept expected AIX result test-stdio-closed (Rich Trott) [#8755](https://github.com/nodejs/node/pull/8755) +* [[`3dbcc3d2d9`](https://github.com/nodejs/node/commit/3dbcc3d2d9)] - **test**: fix flaky test-*-connect-address-family (Rich Trott) [#7605](https://github.com/nodejs/node/pull/7605) +* [[`733233d3ea`](https://github.com/nodejs/node/commit/733233d3ea)] - **test**: add uncaught exception test for debugger (Rich Trott) [#8087](https://github.com/nodejs/node/pull/8087) +* [[`c9af24d2a7`](https://github.com/nodejs/node/commit/c9af24d2a7)] - **test**: add test for assert.notStrictEqual() (Rich Trott) [#8091](https://github.com/nodejs/node/pull/8091) +* [[`337d2dd381`](https://github.com/nodejs/node/commit/337d2dd381)] - **test**: implement consistent braces (Rich Trott) [#8348](https://github.com/nodejs/node/pull/8348) +* [[`77df523264`](https://github.com/nodejs/node/commit/77df523264)] - **test**: exclude tests for AIX (Michael Dawson) [#8076](https://github.com/nodejs/node/pull/8076) +* [[`50ae37e350`](https://github.com/nodejs/node/commit/50ae37e350)] - **test**: add --repeat option to tools/test.py (Michael Dawson) [#6700](https://github.com/nodejs/node/pull/6700) +* [[`ea72e9f143`](https://github.com/nodejs/node/commit/ea72e9f143)] - **test,doc**: clarify `buf.indexOf(num)` input range (Anna Henningsen) [#7611](https://github.com/nodejs/node/pull/7611) +* [[`c841b5a6b9`](https://github.com/nodejs/node/commit/c841b5a6b9)] - **tls**: copy the Buffer object before using (Sakthipriyan Vairamani) [#8055](https://github.com/nodejs/node/pull/8055) +* [[`6076293d6c`](https://github.com/nodejs/node/commit/6076293d6c)] - **tls_wrap**: do not abort on new TLSWrap() (Trevor Norris) [#6184](https://github.com/nodejs/node/pull/6184) +* [[`6e5906c7f1`](https://github.com/nodejs/node/commit/6e5906c7f1)] - **tools**: use long format for gpg fingerprint (Myles Borins) [#9258](https://github.com/nodejs/node/pull/9258) +* [[`7409c332b8`](https://github.com/nodejs/node/commit/7409c332b8)] - **tools**: check tag is on github before release (Rod Vagg) [#9142](https://github.com/nodejs/node/pull/9142) +* [[`b632badda2`](https://github.com/nodejs/node/commit/b632badda2)] - **tools**: make detached SHASUM .sig file for releases (Rod Vagg) [#9071](https://github.com/nodejs/node/pull/9071) +* [[`5867ffe27e`](https://github.com/nodejs/node/commit/5867ffe27e)] - **tools**: explicitly set digest algo for SHASUM to 256 (Rod Vagg) [#9071](https://github.com/nodejs/node/pull/9071) +* [[`bdfa3b388b`](https://github.com/nodejs/node/commit/bdfa3b388b)] - **tools**: favor === over == in license2rtf.js (Rich Trott) +* [[`d7e3edc744`](https://github.com/nodejs/node/commit/d7e3edc744)] - **tools**: add remark-lint configuration in .remarkrc (Сковорода Никита Андреевич) [#7729](https://github.com/nodejs/node/pull/7729) +* [[`afbfbc04c9`](https://github.com/nodejs/node/commit/afbfbc04c9)] - **tools**: add .vscode folder to .gitignore (Josh Gavant) [#7967](https://github.com/nodejs/node/pull/7967) +* [[`3f4a5fe61e`](https://github.com/nodejs/node/commit/3f4a5fe61e)] - **tools**: increase lint coverage (Rich Trott) [#7647](https://github.com/nodejs/node/pull/7647) +* [[`d1a50b3ed2`](https://github.com/nodejs/node/commit/d1a50b3ed2)] - **tools**: enforce JS brace style with linting (Rich Trott) [#8348](https://github.com/nodejs/node/pull/8348) +* [[`76b8d81f38`](https://github.com/nodejs/node/commit/76b8d81f38)] - **tools,test**: show signal code when test crashes (Santiago Gimeno) [#7859](https://github.com/nodejs/node/pull/7859) +* [[`389a6d2cc2`](https://github.com/nodejs/node/commit/389a6d2cc2)] - **url**: fix off-by-one error in loop handling dots (Luigi Pinca) [#8420](https://github.com/nodejs/node/pull/8420) +* [[`be9d9bd7c3`](https://github.com/nodejs/node/commit/be9d9bd7c3)] - **url**: fix inconsistent port in url.resolveObject (Ilkka Myller) [#8214](https://github.com/nodejs/node/pull/8214) +* [[`96cfa926bd`](https://github.com/nodejs/node/commit/96cfa926bd)] - **url**: `url.format()` encodes all `#` in `search` (Ilkka Myller) [#8072](https://github.com/nodejs/node/pull/8072) +* [[`f7796f23e3`](https://github.com/nodejs/node/commit/f7796f23e3)] - **util**: inspect boxed symbols like other primitives (Anna Henningsen) [#7641](https://github.com/nodejs/node/pull/7641) +* [[`410e083d7c`](https://github.com/nodejs/node/commit/410e083d7c)] - **win,build**: forward release_urlbase to configure (João Reis) [#8430](https://github.com/nodejs/node/pull/8430) +* [[`26e73740e9`](https://github.com/nodejs/node/commit/26e73740e9)] - **win,build**: exit when addons fail to build (João Reis) [#8412](https://github.com/nodejs/node/pull/8412) +* [[`30e751f38b`](https://github.com/nodejs/node/commit/30e751f38b)] - **win,build**: skip finding VS when not needed (João Reis) [#8412](https://github.com/nodejs/node/pull/8412) +* [[`b3090f8e64`](https://github.com/nodejs/node/commit/b3090f8e64)] - **win,build**: fail on invalid option in vcbuild (João Reis) [#8412](https://github.com/nodejs/node/pull/8412) +* [[`1b5213bfc3`](https://github.com/nodejs/node/commit/1b5213bfc3)] - **win,msi**: fix inclusion of translations (João Reis) [#7798](https://github.com/nodejs/node/pull/7798) +* [[`e8be413d0d`](https://github.com/nodejs/node/commit/e8be413d0d)] - **win,msi**: add zh-CN translations for the installer (Minqi Pan) [#2569](https://github.com/nodejs/node/pull/2569) +* [[`99f85b8340`](https://github.com/nodejs/node/commit/99f85b8340)] - **win,msi**: Added Italian translation (Matteo Collina) [#4647](https://github.com/nodejs/node/pull/4647) + +## 2016-10-18, Version 4.6.1 'Argon' (LTS), @rvagg + +This is a security release. All Node.js users should consult the security release summary at https://nodejs.org/en/blog/vulnerability/october-2016-security-releases/ for details on patched vulnerabilities. + +### Notable Changes + +* **c-ares**: fix for single-byte buffer overwrite, CVE-2016-5180, more information at https://c-ares.haxx.se/adv_20160929.html (Daniel Stenberg) + +### Commits + +* [[`f3c63e7ccf`](https://github.com/nodejs/node/commit/f3c63e7ccf)] - **deps**: avoid single-byte buffer overwrite (Daniel Stenberg) [#8849](https://github.com/nodejs/node/pull/8849) +* [[`5a0daa6c2f`](https://github.com/nodejs/node/commit/5a0daa6c2f)] - **win,build**: try multiple timeservers when signing (Rod Vagg) [#9155](https://github.com/nodejs/node/pull/9155) + + +## 2016-09-27, Version 4.6.0 'Argon' (LTS), @rvagg + +This is a security release. All Node.js users should consult the security release summary at https://nodejs.org/en/blog/vulnerability/september-2016-security-releases/ for details on patched vulnerabilities. + +### Notable Changes + +Semver Minor: + +* **openssl**: + - Upgrade to 1.0.2i, fixes a number of defects impacting Node.js: CVE-2016-6304 ("OCSP Status Request extension unbounded memory growth", high severity), CVE-2016-2183, CVE-2016-6303, CVE-2016-2178 and CVE-2016-6306. (Shigeki Ohtsu) [#8714](https://github.com/nodejs/node/pull/8714) + - Upgrade to 1.0.2j, fixes a defect included in 1.0.2i resulting in a crash when using CRLs, CVE-2016-7052. (Shigeki Ohtsu) [#8786](https://github.com/nodejs/node/pull/8786) + - Remove support for loading dynamic third-party engine modules. An attacker may be able to hide malicious code to be inserted into Node.js at runtime by masquerading as one of the dynamic engine modules. Originally reported by Ahmed Zaki (Skype). (Ben Noordhuis) [nodejs/node-private#70](https://github.com/nodejs/node-private/pull/70) +* **http**: CVE-2016-5325 - Properly validate for allowable characters in the `reason` argument in `ServerResponse#writeHead()`. Fixes a possible response splitting attack vector. This introduces a new case where `throw` may occur when configuring HTTP responses, users should already be adopting try/catch here. Originally reported independently by Evan Lucas and Romain Gaucher. (Evan Lucas) [nodejs/node-private#46](https://github.com/nodejs/node-private/pull/46) + +Semver Patch: + +* **buffer**: Zero-fill excess bytes in new `Buffer` objects created with `Buffer.concat()` while providing a `totalLength` parameter that exceeds the total length of the original `Buffer` objects being concatenated. (Сковорода Никита Андреевич) [nodejs/node-private#65](https://github.com/nodejs/node-private/pull/65) +* **tls**: CVE-2016-7099 - Fix invalid wildcard certificate validation check whereby a TLS server may be able to serve an invalid wildcard certificate for its hostname due to improper validation of `*.` in the wildcard string. Originally reported by Alexander Minozhenko and James Bunton (Atlassian). (Ben Noordhuis) [nodejs/node-private#63](https://github.com/nodejs/node-private/pull/63) + +### Commits + +* [[`93b10fbec2`](https://github.com/nodejs/node/commit/93b10fbec2)] - **buffer**: zero-fill uninitialized bytes in .concat() (Сковорода Никита Андреевич) [nodejs/node-private#65](https://github.com/nodejs/node-private/pull/65) +* [[`c214e8847d`](https://github.com/nodejs/node/commit/c214e8847d)] - **crypto**: don't build hardware engines (Ben Noordhuis) [nodejs/node-private#70](https://github.com/nodejs/node-private/pull/70) +* [[`af9dda152c`](https://github.com/nodejs/node/commit/af9dda152c)] - **deps**: add -no_rand_screen to openssl s_client (Shigeki Ohtsu) [nodejs/node#1836](https://github.com/nodejs/node/pull/1836) +* [[`6bb9749c33`](https://github.com/nodejs/node/commit/6bb9749c33)] - **deps**: fix asm build error of openssl in x86_win32 (Shigeki Ohtsu) [nodejs/node#1389](https://github.com/nodejs/node/pull/1389) +* [[`5176a8ad57`](https://github.com/nodejs/node/commit/5176a8ad57)] - **deps**: fix openssl assembly error on ia32 win32 (Fedor Indutny) [nodejs/node#1389](https://github.com/nodejs/node/pull/1389) +* [[`aa9ed60a51`](https://github.com/nodejs/node/commit/aa9ed60a51)] - **deps**: copy all openssl header files to include dir (Shigeki Ohtsu) [#8786](https://github.com/nodejs/node/pull/8786) +* [[`0c74e2ad35`](https://github.com/nodejs/node/commit/0c74e2ad35)] - **deps**: upgrade openssl sources to 1.0.2j (Shigeki Ohtsu) [#8786](https://github.com/nodejs/node/pull/8786) +* [[`8f3d6760cf`](https://github.com/nodejs/node/commit/8f3d6760cf)] - **deps**: update openssl asm and asm_obsolete files (Shigeki Ohtsu) [#8714](https://github.com/nodejs/node/pull/8714) +* [[`e8f29e2ba8`](https://github.com/nodejs/node/commit/e8f29e2ba8)] - **deps**: add -no_rand_screen to openssl s_client (Shigeki Ohtsu) [nodejs/node#1836](https://github.com/nodejs/node/pull/1836) +* [[`01cf5b0ae7`](https://github.com/nodejs/node/commit/01cf5b0ae7)] - **deps**: fix asm build error of openssl in x86_win32 (Shigeki Ohtsu) [nodejs/node#1389](https://github.com/nodejs/node/pull/1389) +* [[`19ae4e8ae1`](https://github.com/nodejs/node/commit/19ae4e8ae1)] - **deps**: fix openssl assembly error on ia32 win32 (Fedor Indutny) [nodejs/node#1389](https://github.com/nodejs/node/pull/1389) +* [[`cbed5e64be`](https://github.com/nodejs/node/commit/cbed5e64be)] - **deps**: copy all openssl header files to include dir (Shigeki Ohtsu) [#8714](https://github.com/nodejs/node/pull/8714) +* [[`e7fdace18f`](https://github.com/nodejs/node/commit/e7fdace18f)] - **deps**: upgrade openssl sources to 1.0.2i (Shigeki Ohtsu) [#8714](https://github.com/nodejs/node/pull/8714) +* [[`b5c57ff772`](https://github.com/nodejs/node/commit/b5c57ff772)] - **http**: check reason chars in writeHead (Evan Lucas) [nodejs/node-private#46](https://github.com/nodejs/node-private/pull/46) +* [[`3ff82deb2c`](https://github.com/nodejs/node/commit/3ff82deb2c)] - **lib**: make tls.checkServerIdentity() more strict (Ben Noordhuis) [nodejs/node-private#63](https://github.com/nodejs/node-private/pull/63) +* [[`7c696e201a`](https://github.com/nodejs/node/commit/7c696e201a)] - **openssl**: fix keypress requirement in apps on win32 (Shigeki Ohtsu) [nodejs/node#1389](https://github.com/nodejs/node/pull/1389) +* [[`44e5776c0f`](https://github.com/nodejs/node/commit/44e5776c0f)] - **openssl**: fix keypress requirement in apps on win32 (Shigeki Ohtsu) [nodejs/node#1389](https://github.com/nodejs/node/pull/1389) +* [[`c7a601c090`](https://github.com/nodejs/node/commit/c7a601c090)] - **test**: remove openssl options of -no_ (Shigeki Ohtsu) [#8714](https://github.com/nodejs/node/pull/8714) + +## 2016-08-15, Version 4.5.0 'Argon' (LTS), @thealphanerd + +### Notable Changes + +Semver Minor: + +* **buffer**: + * backport new buffer constructor APIs to v4.x (Сковорода Никита Андреевич) [#7562](https://github.com/nodejs/node/pull/7562) + * backport --zero-fill-buffers cli option (James M Snell) [#5745](https://github.com/nodejs/node/pull/5745) +* **build**: + * add Intel Vtune profiling support (Chunyang Dai) [#5527](https://github.com/nodejs/node/pull/5527) +* **repl**: + * copying tabs shouldn't trigger completion (Eugene Obrezkov) [#5958](https://github.com/nodejs/node/pull/5958) +* **src**: + * add node::FreeEnvironment public API (Cheng Zhao) [#3098](https://github.com/nodejs/node/pull/3098) +* **test**: + * run v8 tests from node tree (Bryon Leung) [#4704](https://github.com/nodejs/node/pull/4704) +* **V8**: + * Add post mortem data to improve object inspection and function's context variables inspection (Fedor Indutny) [#3779](https://github.com/nodejs/node/pull/3779) + +Semver Patch: + +* **buffer**: + * ignore negative allocation lengths (Anna Henningsen) [#7562](https://github.com/nodejs/node/pull/7562) +* **crypto**: + * update root certificates (Ben Noordhuis) [#7363](https://github.com/nodejs/node/pull/7363) +* **libuv**: + * upgrade libuv to 1.9.1 (Saúl Ibarra Corretgé) [#6796](https://github.com/nodejs/node/pull/6796) + * upgrade libuv to 1.9.0 (Saúl Ibarra Corretgé) [#5994](https://github.com/nodejs/node/pull/5994) +* **npm**: + * upgrade to 2.15.9 (Kat Marchán) [#7692](https://github.com/nodejs/node/pull/7692) + +### Commits + +* [[`a4888926a2`](https://github.com/nodejs/node/commit/a4888926a2)] - **assert**: remove unneeded arguments special handling (Rich Trott) [#7413](https://github.com/nodejs/node/pull/7413) +* [[`39e24742f8`](https://github.com/nodejs/node/commit/39e24742f8)] - **assert**: allow circular references (Rich Trott) [#6432](https://github.com/nodejs/node/pull/6432) +* [[`271927f29e`](https://github.com/nodejs/node/commit/271927f29e)] - **async_wrap**: pass uid to JS as double (Trevor Norris) [#7096](https://github.com/nodejs/node/pull/7096) +* [[`747f107188`](https://github.com/nodejs/node/commit/747f107188)] - **async_wrap**: don't abort on callback exception (Trevor Norris) [#5756](https://github.com/nodejs/node/pull/5756) +* [[`c06e2b07b6`](https://github.com/nodejs/node/commit/c06e2b07b6)] - **async_wrap**: notify post if intercepted exception (Trevor Norris) [#5756](https://github.com/nodejs/node/pull/5756) +* [[`0642a146b3`](https://github.com/nodejs/node/commit/0642a146b3)] - **async_wrap**: setupHooks now accepts object (Trevor Norris) [#5756](https://github.com/nodejs/node/pull/5756) +* [[`75ecf8eb07`](https://github.com/nodejs/node/commit/75ecf8eb07)] - **async_wrap**: add parent uid to init hook (Andreas Madsen) [#4600](https://github.com/nodejs/node/pull/4600) +* [[`e10eebffa5`](https://github.com/nodejs/node/commit/e10eebffa5)] - **async_wrap**: make uid the first argument in init (Andreas Madsen) [#4600](https://github.com/nodejs/node/pull/4600) +* [[`13d465bcf6`](https://github.com/nodejs/node/commit/13d465bcf6)] - **async_wrap**: add uid to all asyncWrap hooks (Andreas Madsen) [#4600](https://github.com/nodejs/node/pull/4600) +* [[`046d651118`](https://github.com/nodejs/node/commit/046d651118)] - **benchmark**: fix child-process-exec-stdout on win (Bartosz Sosnowski) [#7178](https://github.com/nodejs/node/pull/7178) +* [[`4b464ce4bf`](https://github.com/nodejs/node/commit/4b464ce4bf)] - **benchmark**: remove unused variables (Rich Trott) [#7600](https://github.com/nodejs/node/pull/7600) +* [[`b95e5d7948`](https://github.com/nodejs/node/commit/b95e5d7948)] - **benchmark**: add benchmark for url.format() (Rich Trott) [#7250](https://github.com/nodejs/node/pull/7250) +* [[`1bd62c7c34`](https://github.com/nodejs/node/commit/1bd62c7c34)] - **benchmark**: add benchmark for Buffer.concat (Anna Henningsen) [#7054](https://github.com/nodejs/node/pull/7054) +* [[`08cd81b050`](https://github.com/nodejs/node/commit/08cd81b050)] - **benchmark**: add util.format benchmark (Evan Lucas) [#5360](https://github.com/nodejs/node/pull/5360) +* [[`7dbb0d0084`](https://github.com/nodejs/node/commit/7dbb0d0084)] - **buffer**: fix dataview-set benchmark (Ingvar Stepanyan) [#6922](https://github.com/nodejs/node/pull/6922) +* [[`200429e9e1`](https://github.com/nodejs/node/commit/200429e9e1)] - **buffer**: ignore negative allocation lengths (Anna Henningsen) [#7562](https://github.com/nodejs/node/pull/7562) +* [[`709048134c`](https://github.com/nodejs/node/commit/709048134c)] - **(SEMVER-MINOR)** **buffer**: backport new buffer constructor APIs to v4.x (Сковорода Никита Андреевич) [#7562](https://github.com/nodejs/node/pull/7562) +* [[`fb03e57de2`](https://github.com/nodejs/node/commit/fb03e57de2)] - **(SEMVER-MINOR)** **buffer**: backport --zero-fill-buffers cli option (James M Snell) [#5745](https://github.com/nodejs/node/pull/5745) +* [[`236491e698`](https://github.com/nodejs/node/commit/236491e698)] - **build**: update build-addons when node-gyp changes (Lance Ball) [#6787](https://github.com/nodejs/node/pull/6787) +* [[`8a7c5fdbd2`](https://github.com/nodejs/node/commit/8a7c5fdbd2)] - **build**: add REPLACEME tag for version info in docs (Ben Noordhuis) [#6864](https://github.com/nodejs/node/pull/6864) +* [[`da1e13fde7`](https://github.com/nodejs/node/commit/da1e13fde7)] - **build**: add Make `doc-only` target (Jesse McCarthy) [#3888](https://github.com/nodejs/node/pull/3888) +* [[`0db3aa9afa`](https://github.com/nodejs/node/commit/0db3aa9afa)] - **build**: remove unused files from CPPLINT_FILES (Ben Noordhuis) [#7462](https://github.com/nodejs/node/pull/7462) +* [[`5290c9d38c`](https://github.com/nodejs/node/commit/5290c9d38c)] - **build**: use BUILDTYPE when building V8 in Makefile (Michaël Zasso) [#7482](https://github.com/nodejs/node/pull/7482) +* [[`79bd39c202`](https://github.com/nodejs/node/commit/79bd39c202)] - **build**: add v8 requirement to test-v8* in Makefile (Michaël Zasso) [#7482](https://github.com/nodejs/node/pull/7482) +* [[`65b75b51a6`](https://github.com/nodejs/node/commit/65b75b51a6)] - **build**: unbreak configure with python 2.6 (Ben Noordhuis) [#6874](https://github.com/nodejs/node/pull/6874) +* [[`8513232c82`](https://github.com/nodejs/node/commit/8513232c82)] - **build**: split CI rules in Makefile (João Reis) [#7317](https://github.com/nodejs/node/pull/7317) +* [[`13d0e463b0`](https://github.com/nodejs/node/commit/13d0e463b0)] - **build**: enable compilation for linuxOne (Michael Dawson) [#5941](https://github.com/nodejs/node/pull/5941) +* [[`834ea2c5c0`](https://github.com/nodejs/node/commit/834ea2c5c0)] - **(SEMVER-MINOR)** **build,src**: add Intel Vtune profiling support (Chunyang Dai) [#5527](https://github.com/nodejs/node/pull/5527) +* [[`ea20796e9d`](https://github.com/nodejs/node/commit/ea20796e9d)] - **build,test**: fix build-addons dependency chain (Ben Noordhuis) [#6652](https://github.com/nodejs/node/pull/6652) +* [[`6a08535dd1`](https://github.com/nodejs/node/commit/6a08535dd1)] - **child_process**: preserve argument type (Rich Trott) [#7391](https://github.com/nodejs/node/pull/7391) +* [[`fd05b0b289`](https://github.com/nodejs/node/commit/fd05b0b289)] - ***Revert*** "**child_process**: measure buffer length in bytes" (Rich Trott) [#7391](https://github.com/nodejs/node/pull/7391) +* [[`8eb18e4289`](https://github.com/nodejs/node/commit/8eb18e4289)] - **child_process**: measure buffer length in bytes (Rich Trott) [#6764](https://github.com/nodejs/node/pull/6764) +* [[`4ee863d956`](https://github.com/nodejs/node/commit/4ee863d956)] - **child_process**: allow buffer encoding in spawnSync (cjihrig) [#6939](https://github.com/nodejs/node/pull/6939) +* [[`0b8124f205`](https://github.com/nodejs/node/commit/0b8124f205)] - **child_process**: emit IPC messages on next tick (cjihrig) [#6909](https://github.com/nodejs/node/pull/6909) +* [[`20d3378969`](https://github.com/nodejs/node/commit/20d3378969)] - **cluster**: reset handle index on close (Santiago Gimeno) [#6981](https://github.com/nodejs/node/pull/6981) +* [[`09349a8b92`](https://github.com/nodejs/node/commit/09349a8b92)] - **cluster**: don't send messages if no IPC channel (Santiago Gimeno) [#7132](https://github.com/nodejs/node/pull/7132) +* [[`6ece2a0322`](https://github.com/nodejs/node/commit/6ece2a0322)] - **cluster**: rewrite debug ports consistently (cjihrig) [#7050](https://github.com/nodejs/node/pull/7050) +* [[`8cba3b2f72`](https://github.com/nodejs/node/commit/8cba3b2f72)] - **cluster**: guard against undefined message handlers (cjihrig) [#6902](https://github.com/nodejs/node/pull/6902) +* [[`f152adf5b7`](https://github.com/nodejs/node/commit/f152adf5b7)] - **cluster**: close ownerless handles on disconnect() (cjihrig) [#6909](https://github.com/nodejs/node/pull/6909) +* [[`65624440bf`](https://github.com/nodejs/node/commit/65624440bf)] - **crypto**: allow GCM ciphers to have longer IV length (Michael Wain) [#6376](https://github.com/nodejs/node/pull/6376) +* [[`1e0cede3a6`](https://github.com/nodejs/node/commit/1e0cede3a6)] - **crypto**: update root certificates (Ben Noordhuis) [#7363](https://github.com/nodejs/node/pull/7363) +* [[`3be5cdcd43`](https://github.com/nodejs/node/commit/3be5cdcd43)] - **debugger**: remove obsolete setTimeout (Rich Trott) [#7154](https://github.com/nodejs/node/pull/7154) +* [[`74a5e911c0`](https://github.com/nodejs/node/commit/74a5e911c0)] - **debugger**: propagate --debug-port= to debuggee (Ben Noordhuis) [#3470](https://github.com/nodejs/node/pull/3470) +* [[`af4940d63b`](https://github.com/nodejs/node/commit/af4940d63b)] - **deps**: upgrade npm in LTS to 2.15.9 (Kat Marchán) [#7692](https://github.com/nodejs/node/pull/7692) +* [[`da7b74b9bc`](https://github.com/nodejs/node/commit/da7b74b9bc)] - **deps**: upgrade libuv to 1.9.1 (Saúl Ibarra Corretgé) [#6796](https://github.com/nodejs/node/pull/6796) +* [[`94eb980ca5`](https://github.com/nodejs/node/commit/94eb980ca5)] - **deps**: upgrade libuv to 1.9.0 (Saúl Ibarra Corretgé) [#5994](https://github.com/nodejs/node/pull/5994) +* [[`4107b5d200`](https://github.com/nodejs/node/commit/4107b5d200)] - **deps**: backport 22c5e46 from V8 (Julien Gilli) [#7584](https://github.com/nodejs/node/pull/7584) +* [[`e06ab64705`](https://github.com/nodejs/node/commit/e06ab64705)] - **deps**: update to http-parser 2.7.0 (Fedor Indutny) [#6279](https://github.com/nodejs/node/pull/6279) +* [[`1164f542db`](https://github.com/nodejs/node/commit/1164f542db)] - **deps**: fix segfault during gc (Ali Ijaz Sheikh) [#7303](https://github.com/nodejs/node/pull/7303) +* [[`d9e9d9fb11`](https://github.com/nodejs/node/commit/d9e9d9fb11)] - **deps**: backport e7cc609 from upstream V8 (Ali Ijaz Sheikh) [#7303](https://github.com/nodejs/node/pull/7303) +* [[`9809992436`](https://github.com/nodejs/node/commit/9809992436)] - **(SEMVER-MINOR)** **deps**: backport 9c927d0f01 from V8 upstream (Myles Borins) [#7451](https://github.com/nodejs/node/pull/7451) +* [[`da9595fc47`](https://github.com/nodejs/node/commit/da9595fc47)] - **(SEMVER-MINOR)** **deps**: cherry-pick 68e89fb from v8's upstream (Fedor Indutny) [#3779](https://github.com/nodejs/node/pull/3779) +* [[`e9ff0f8fb2`](https://github.com/nodejs/node/commit/e9ff0f8fb2)] - **doc**: make doc-only -> fallback to user binary (Robert Jefe Lindstaedt) [#6906](https://github.com/nodejs/node/pull/6906) +* [[`b869cdb876`](https://github.com/nodejs/node/commit/b869cdb876)] - **doc**: fix deprecation warnings in addon examples (Ben Noordhuis) [#6652](https://github.com/nodejs/node/pull/6652) +* [[`ec25f38120`](https://github.com/nodejs/node/commit/ec25f38120)] - **doc**: add `added:` information for buffer (Anna Henningsen) [#6495](https://github.com/nodejs/node/pull/6495) +* [[`1e86d16812`](https://github.com/nodejs/node/commit/1e86d16812)] - **doc**: buffers are not sent over IPC with a socket (Tim Kuijsten) [#6951](https://github.com/nodejs/node/pull/6951) +* [[`5c1d8e1f0f`](https://github.com/nodejs/node/commit/5c1d8e1f0f)] - **doc**: add `added:` information for http (Anna Henningsen) [#7392](https://github.com/nodejs/node/pull/7392) +* [[`60c054bc11`](https://github.com/nodejs/node/commit/60c054bc11)] - **doc**: add information for IncomingMessage.destroy() (Rich Trott) [#7237](https://github.com/nodejs/node/pull/7237) +* [[`1a5c025f32`](https://github.com/nodejs/node/commit/1a5c025f32)] - **doc**: remove superfluos backticks in process.md (Anna Henningsen) [#7681](https://github.com/nodejs/node/pull/7681) +* [[`fcb4e410e4`](https://github.com/nodejs/node/commit/fcb4e410e4)] - **doc**: add `added:` information for process (Bryan English) [#6589](https://github.com/nodejs/node/pull/6589) +* [[`9b8565c42a`](https://github.com/nodejs/node/commit/9b8565c42a)] - **doc**: add `added:` information for tls (Italo A. Casas) [#7018](https://github.com/nodejs/node/pull/7018) +* [[`fd4aa6c16a`](https://github.com/nodejs/node/commit/fd4aa6c16a)] - **doc**: correct `added:` information for fs.access (Richard Lau) [#7299](https://github.com/nodejs/node/pull/7299) +* [[`1e9d27cbcc`](https://github.com/nodejs/node/commit/1e9d27cbcc)] - **doc**: add `added:` information for fs (Anna Henningsen) [#6717](https://github.com/nodejs/node/pull/6717) +* [[`2244a3c250`](https://github.com/nodejs/node/commit/2244a3c250)] - **doc**: adds 'close' events to fs.ReadStream and fs.WriteStream (Jenna Vuong) [#6499](https://github.com/nodejs/node/pull/6499) +* [[`88f46b886a`](https://github.com/nodejs/node/commit/88f46b886a)] - **doc**: add `added:` information for timers (Anna Henningsen) [#7493](https://github.com/nodejs/node/pull/7493) +* [[`a53253a232`](https://github.com/nodejs/node/commit/a53253a232)] - **doc**: add `added:` information for zlib (Anna Henningsen) [#6840](https://github.com/nodejs/node/pull/6840) +* [[`7abfb6e8dc`](https://github.com/nodejs/node/commit/7abfb6e8dc)] - **doc**: add `added:` information for vm (Anna Henningsen) [#7011](https://github.com/nodejs/node/pull/7011) +* [[`3e3471fb5f`](https://github.com/nodejs/node/commit/3e3471fb5f)] - **doc**: add `added:` information for v8 (Rich Trott) [#6684](https://github.com/nodejs/node/pull/6684) +* [[`1758f02ec1`](https://github.com/nodejs/node/commit/1758f02ec1)] - **doc**: add `added:` information for url (Bryan English) [#6593](https://github.com/nodejs/node/pull/6593) +* [[`3c8f19fcdf`](https://github.com/nodejs/node/commit/3c8f19fcdf)] - **doc**: add `added:` in for `tty` (Rich Trott) [#6783](https://github.com/nodejs/node/pull/6783) +* [[`5b50b1c255`](https://github.com/nodejs/node/commit/5b50b1c255)] - **doc**: add `added:` info for `string_decoder` (Rich Trott) [#6741](https://github.com/nodejs/node/pull/6741) +* [[`4474e83b78`](https://github.com/nodejs/node/commit/4474e83b78)] - **doc**: add `added:` information for repl (Anna Henningsen) [#7256](https://github.com/nodejs/node/pull/7256) +* [[`e6d7bfcbe7`](https://github.com/nodejs/node/commit/e6d7bfcbe7)] - **doc**: add `added:` information for readline (Julian Duque) [#6996](https://github.com/nodejs/node/pull/6996) +* [[`eec0c635ee`](https://github.com/nodejs/node/commit/eec0c635ee)] - **doc**: add `added:` information for querystring (Bryan English) [#6593](https://github.com/nodejs/node/pull/6593) +* [[`a870cdcd1f`](https://github.com/nodejs/node/commit/a870cdcd1f)] - **doc**: add `added:` information for punycode (Daniel Wang) [#6805](https://github.com/nodejs/node/pull/6805) +* [[`f1a37ad749`](https://github.com/nodejs/node/commit/f1a37ad749)] - **doc**: add `added:` information for path (Julian Duque) [#6985](https://github.com/nodejs/node/pull/6985) +* [[`8b53f4b27c`](https://github.com/nodejs/node/commit/8b53f4b27c)] - **doc**: add `added:` information for os (Bryan English) [#6609](https://github.com/nodejs/node/pull/6609) +* [[`78d361b22b`](https://github.com/nodejs/node/commit/78d361b22b)] - **doc**: add `added` information for net (Italo A. Casas) [#7038](https://github.com/nodejs/node/pull/7038) +* [[`b08ff33c01`](https://github.com/nodejs/node/commit/b08ff33c01)] - **doc**: add `added:` information for https (Anna Henningsen) [#7392](https://github.com/nodejs/node/pull/7392) +* [[`1d99059bb1`](https://github.com/nodejs/node/commit/1d99059bb1)] - **doc**: add `added:` information for dns (Julian Duque) [#7021](https://github.com/nodejs/node/pull/7021) +* [[`a0ca24b798`](https://github.com/nodejs/node/commit/a0ca24b798)] - **doc**: add `added:` information for console (Adrian Estrada) [#6995](https://github.com/nodejs/node/pull/6995) +* [[`eb08c17a20`](https://github.com/nodejs/node/commit/eb08c17a20)] - **doc**: add `added: ` data for cli.md (Rich Trott) [#6960](https://github.com/nodejs/node/pull/6960) +* [[`ec9038478f`](https://github.com/nodejs/node/commit/ec9038478f)] - **doc**: add `added:` information for child_process (Anna Henningsen) [#6927](https://github.com/nodejs/node/pull/6927) +* [[`e52b2b07d7`](https://github.com/nodejs/node/commit/e52b2b07d7)] - **doc**: add `added:` information for assert (Rich Trott) [#6688](https://github.com/nodejs/node/pull/6688) +* [[`75e4f74c54`](https://github.com/nodejs/node/commit/75e4f74c54)] - **doc**: fix cluster worker 'message' event (cjihrig) [#7309](https://github.com/nodejs/node/pull/7309) +* [[`de5e2357fc`](https://github.com/nodejs/node/commit/de5e2357fc)] - **doc**: dns.resolve fix callback argument description (Quentin Headen) [#7532](https://github.com/nodejs/node/pull/7532) +* [[`0f903bb722`](https://github.com/nodejs/node/commit/0f903bb722)] - **doc**: add benchmark who-to-CC info (Rich Trott) [#7604](https://github.com/nodejs/node/pull/7604) +* [[`700c6d9be8`](https://github.com/nodejs/node/commit/700c6d9be8)] - **doc**: added information on how to run the linter. (Diosney Sarmiento) [#7534](https://github.com/nodejs/node/pull/7534) +* [[`537f33351e`](https://github.com/nodejs/node/commit/537f33351e)] - **doc**: fix minor style issues in http.md (Rich Trott) [#7528](https://github.com/nodejs/node/pull/7528) +* [[`33a08b0414`](https://github.com/nodejs/node/commit/33a08b0414)] - **doc**: add bartosz sosnowski to colaborators (Bartosz Sosnowski) [#7567](https://github.com/nodejs/node/pull/7567) +* [[`186af29298`](https://github.com/nodejs/node/commit/186af29298)] - **doc**: fix detached child stdio example (cjihrig) [#7540](https://github.com/nodejs/node/pull/7540) +* [[`066cefb6de`](https://github.com/nodejs/node/commit/066cefb6de)] - **doc**: improve usage of `zero`/`0` (Rich Trott) [#7466](https://github.com/nodejs/node/pull/7466) +* [[`6c94c67b73`](https://github.com/nodejs/node/commit/6c94c67b73)] - **doc**: fix "sign.verify" typo in crypto doc. (Ruslan Iusupov) [#7411](https://github.com/nodejs/node/pull/7411) +* [[`35ee35cba2`](https://github.com/nodejs/node/commit/35ee35cba2)] - **doc**: clarify child_process stdout/stderr types (sartrey) [#7361](https://github.com/nodejs/node/pull/7361) +* [[`71ef71cff8`](https://github.com/nodejs/node/commit/71ef71cff8)] - **doc**: add CTC meeting minutes 2016-06-15 (Josh Gavant) [#7320](https://github.com/nodejs/node/pull/7320) +* [[`13d60cab7c`](https://github.com/nodejs/node/commit/13d60cab7c)] - **doc**: add lance to collaborators (Lance Ball) [#7407](https://github.com/nodejs/node/pull/7407) +* [[`9122b3b665`](https://github.com/nodejs/node/commit/9122b3b665)] - **doc**: update "who to cc in issues" chart (Jeremiah Senkpiel) [#6694](https://github.com/nodejs/node/pull/6694) +* [[`ccb278d330`](https://github.com/nodejs/node/commit/ccb278d330)] - **doc**: mention http request "aborted" events (Kyle E. Mitchell) [#7270](https://github.com/nodejs/node/pull/7270) +* [[`868af29f2b`](https://github.com/nodejs/node/commit/868af29f2b)] - **doc**: add RReverser to collaborators (Ingvar Stepanyan) [#7370](https://github.com/nodejs/node/pull/7370) +* [[`f8fe474825`](https://github.com/nodejs/node/commit/f8fe474825)] - **doc**: fixing minor typo in AtExit hooks section (Daniel Bevenius) [#7485](https://github.com/nodejs/node/pull/7485) +* [[`4a7e333287`](https://github.com/nodejs/node/commit/4a7e333287)] - **doc**: use `Buffer.byteLength` for Content-Length (kimown) [#7274](https://github.com/nodejs/node/pull/7274) +* [[`85f70b36e4`](https://github.com/nodejs/node/commit/85f70b36e4)] - **doc**: clarify use of `0` port value (Rich Trott) [#7206](https://github.com/nodejs/node/pull/7206) +* [[`57ba51ec46`](https://github.com/nodejs/node/commit/57ba51ec46)] - **doc**: fix IRC link (Ilkka Myller) [#7210](https://github.com/nodejs/node/pull/7210) +* [[`ef37a2e80f`](https://github.com/nodejs/node/commit/ef37a2e80f)] - **doc**: add internal link in GOVERNANCE.md (Rich Trott) [#7279](https://github.com/nodejs/node/pull/7279) +* [[`c9ef04a1b2`](https://github.com/nodejs/node/commit/c9ef04a1b2)] - **doc**: fix events typo (Greyson Parrelli) [#7329](https://github.com/nodejs/node/pull/7329) +* [[`0013af61de`](https://github.com/nodejs/node/commit/0013af61de)] - **doc**: fix header depth of util.isSymbol (James M Snell) [#7138](https://github.com/nodejs/node/pull/7138) +* [[`96de3f8820`](https://github.com/nodejs/node/commit/96de3f8820)] - **doc**: Add CII Best Practices badge to README.md (David A. Wheeler) [#6819](https://github.com/nodejs/node/pull/6819) +* [[`146cba1f60`](https://github.com/nodejs/node/commit/146cba1f60)] - **doc**: improve debugger doc prose (Rich Trott) [#7007](https://github.com/nodejs/node/pull/7007) +* [[`694e34458b`](https://github.com/nodejs/node/commit/694e34458b)] - **doc**: fix typos in WORKING_GROUPS.md (Joao Andrade) [#7032](https://github.com/nodejs/node/pull/7032) +* [[`fbdc16a8a4`](https://github.com/nodejs/node/commit/fbdc16a8a4)] - **doc**: update labels and CI info in onboarding doc (Rich Trott) [#7006](https://github.com/nodejs/node/pull/7006) +* [[`1c65f1e3f6`](https://github.com/nodejs/node/commit/1c65f1e3f6)] - **doc**: add info on what's used for fswatch on AIX (Michael Dawson) [#6837](https://github.com/nodejs/node/pull/6837) +* [[`72e8ee570a`](https://github.com/nodejs/node/commit/72e8ee570a)] - **doc**: improve server.listen() documentation prose (Rich Trott) [#7000](https://github.com/nodejs/node/pull/7000) +* [[`649d201d63`](https://github.com/nodejs/node/commit/649d201d63)] - **doc**: improve `server.address()` doc text (Rich Trott) [#7001](https://github.com/nodejs/node/pull/7001) +* [[`e2e85ced1d`](https://github.com/nodejs/node/commit/e2e85ced1d)] - **doc**: clarified use of sexual language in the CoC (Bryan Hughes) [#6973](https://github.com/nodejs/node/pull/6973) +* [[`f395f6f5b2`](https://github.com/nodejs/node/commit/f395f6f5b2)] - **doc**: add yorkie to collaborators (Yazhong Liu) [#7004](https://github.com/nodejs/node/pull/7004) +* [[`c5051ef643`](https://github.com/nodejs/node/commit/c5051ef643)] - **doc**: add firedfox to collaborators (Daniel Wang) [#6961](https://github.com/nodejs/node/pull/6961) +* [[`2ef08323c6`](https://github.com/nodejs/node/commit/2ef08323c6)] - **doc**: add bmeck to collaborators (Bradley Meck) [#6962](https://github.com/nodejs/node/pull/6962) +* [[`d1a0a146b3`](https://github.com/nodejs/node/commit/d1a0a146b3)] - **doc**: Add CTC meeting minutes for 2016-05-04 (Michael Dawson) [#6579](https://github.com/nodejs/node/pull/6579) +* [[`0a85987899`](https://github.com/nodejs/node/commit/0a85987899)] - **doc**: update build instructions for Windows (João Reis) [#7285](https://github.com/nodejs/node/pull/7285) +* [[`629a76f9fb`](https://github.com/nodejs/node/commit/629a76f9fb)] - **doc**: remove cluster.setupMaster() myth (cjihrig) [#7179](https://github.com/nodejs/node/pull/7179) +* [[`5b807ac791`](https://github.com/nodejs/node/commit/5b807ac791)] - **doc**: specify how to link issues in commit log (Luigi Pinca) [#7161](https://github.com/nodejs/node/pull/7161) +* [[`350f4cf292`](https://github.com/nodejs/node/commit/350f4cf292)] - **doc**: server.listen truncates socket path on unix (Jean Regisser) [#6659](https://github.com/nodejs/node/pull/6659) +* [[`7813af7f16`](https://github.com/nodejs/node/commit/7813af7f16)] - **doc**: Add resolveNaptr and naptr rrtype docs (Doug Wade) [#6586](https://github.com/nodejs/node/pull/6586) +* [[`5380743208`](https://github.com/nodejs/node/commit/5380743208)] - **doc**: document socket.destroyed (Tushar Mathur) [#6128](https://github.com/nodejs/node/pull/6128) +* [[`f0edf87df1`](https://github.com/nodejs/node/commit/f0edf87df1)] - **doc**: add vm example, be able to require modules (Robert Jefe Lindstaedt) [#5323](https://github.com/nodejs/node/pull/5323) +* [[`9121e94e62`](https://github.com/nodejs/node/commit/9121e94e62)] - **doc**: note that process.config can and will be changed (James M Snell) [#6266](https://github.com/nodejs/node/pull/6266) +* [[`c237ac3d68`](https://github.com/nodejs/node/commit/c237ac3d68)] - **doc**: git mv to .md (Robert Jefe Lindstaedt) [#4747](https://github.com/nodejs/node/pull/4747) +* [[`6324723cc1`](https://github.com/nodejs/node/commit/6324723cc1)] - **doc,dgram**: fix addMembership documentation (Santiago Gimeno) [#7244](https://github.com/nodejs/node/pull/7244) +* [[`15bb0beab2`](https://github.com/nodejs/node/commit/15bb0beab2)] - **doc,test**: add `How to write a Node.js test` guide (Santiago Gimeno) [#6984](https://github.com/nodejs/node/pull/6984) +* [[`9d13337183`](https://github.com/nodejs/node/commit/9d13337183)] - **http**: wait for both prefinish/end to keepalive (Fedor Indutny) [#7149](https://github.com/nodejs/node/pull/7149) +* [[`ece428ea63`](https://github.com/nodejs/node/commit/ece428ea63)] - **http**: fix no dumping after `maybeReadMore` (Fedor Indutny) [#7211](https://github.com/nodejs/node/pull/7211) +* [[`07fd52e5aa`](https://github.com/nodejs/node/commit/07fd52e5aa)] - **http**: skip body and next message of CONNECT res (Fedor Indutny) [#6279](https://github.com/nodejs/node/pull/6279) +* [[`6f312b3a91`](https://github.com/nodejs/node/commit/6f312b3a91)] - **http_parser**: use `MakeCallback` (Trevor Norris) [#5419](https://github.com/nodejs/node/pull/5419) +* [[`373ffc5bad`](https://github.com/nodejs/node/commit/373ffc5bad)] - **installer**: don't install node_internals.h (Ben Noordhuis) [#6913](https://github.com/nodejs/node/pull/6913) +* [[`5782ec2427`](https://github.com/nodejs/node/commit/5782ec2427)] - **module**: don't cache uninitialized builtins (Anna Henningsen) [#6907](https://github.com/nodejs/node/pull/6907) +* [[`c8e9adb135`](https://github.com/nodejs/node/commit/c8e9adb135)] - **repl**: fix tab completion for defined commands (Prince J Wesley) [#7364](https://github.com/nodejs/node/pull/7364) +* [[`a3fa5db5ca`](https://github.com/nodejs/node/commit/a3fa5db5ca)] - **(SEMVER-MINOR)** **repl**: copying tabs shouldn't trigger completion (Eugene Obrezkov) [#5958](https://github.com/nodejs/node/pull/5958) +* [[`d86332799c`](https://github.com/nodejs/node/commit/d86332799c)] - **src**: clean up string_search (Brian White) [#7174](https://github.com/nodejs/node/pull/7174) +* [[`3eea55167d`](https://github.com/nodejs/node/commit/3eea55167d)] - **src**: fix memory leak in WriteBuffers() error path (Ben Noordhuis) [#7374](https://github.com/nodejs/node/pull/7374) +* [[`23797eb037`](https://github.com/nodejs/node/commit/23797eb037)] - **src**: remove obsolete NOLINT comments (Ben Noordhuis) [#7462](https://github.com/nodejs/node/pull/7462) +* [[`5aff60e832`](https://github.com/nodejs/node/commit/5aff60e832)] - **src**: lint v8abbr.h (Ben Noordhuis) [#7462](https://github.com/nodejs/node/pull/7462) +* [[`42e7c9d266`](https://github.com/nodejs/node/commit/42e7c9d266)] - **src**: lint node_lttng_tp.h (Ben Noordhuis) [#7462](https://github.com/nodejs/node/pull/7462) +* [[`27c2d25be6`](https://github.com/nodejs/node/commit/27c2d25be6)] - **src**: lint node_win32_perfctr_provider.cc (Ben Noordhuis) [#7462](https://github.com/nodejs/node/pull/7462) +* [[`4f4d3e77ef`](https://github.com/nodejs/node/commit/4f4d3e77ef)] - **src**: fix whitespace/indent cpplint warnings (Ben Noordhuis) [#7462](https://github.com/nodejs/node/pull/7462) +* [[`066064d65f`](https://github.com/nodejs/node/commit/066064d65f)] - **src**: fix whitespace/blank_line cpplint warnings (Ben Noordhuis) [#7462](https://github.com/nodejs/node/pull/7462) +* [[`44cbe0356d`](https://github.com/nodejs/node/commit/44cbe0356d)] - **src**: fix runtime/references cpplint warnings (Ben Noordhuis) [#7462](https://github.com/nodejs/node/pull/7462) +* [[`f530a36c65`](https://github.com/nodejs/node/commit/f530a36c65)] - **src**: fix runtime/int cpplint warnings (Ben Noordhuis) [#7462](https://github.com/nodejs/node/pull/7462) +* [[`d6595adcdb`](https://github.com/nodejs/node/commit/d6595adcdb)] - **src**: fix runtime/indentation_namespace warnings (Ben Noordhuis) [#7462](https://github.com/nodejs/node/pull/7462) +* [[`68db091aba`](https://github.com/nodejs/node/commit/68db091aba)] - **src**: fix readability/nolint cpplint warnings (Ben Noordhuis) [#7462](https://github.com/nodejs/node/pull/7462) +* [[`4748bed736`](https://github.com/nodejs/node/commit/4748bed736)] - **src**: fix readability/namespace cpplint warnings (Ben Noordhuis) [#7462](https://github.com/nodejs/node/pull/7462) +* [[`785211702a`](https://github.com/nodejs/node/commit/785211702a)] - **src**: fix readability/inheritance cpplint warnings (Ben Noordhuis) [#7462](https://github.com/nodejs/node/pull/7462) +* [[`c90ae7fb72`](https://github.com/nodejs/node/commit/c90ae7fb72)] - **src**: fix readability/constructors cpplint warnings (Ben Noordhuis) [#7462](https://github.com/nodejs/node/pull/7462) +* [[`16f2497994`](https://github.com/nodejs/node/commit/16f2497994)] - **src**: fix readability/braces cpplint warnings (Ben Noordhuis) [#7462](https://github.com/nodejs/node/pull/7462) +* [[`c8f78a2682`](https://github.com/nodejs/node/commit/c8f78a2682)] - **src**: fix build/header_guard cpplint warnings (Ben Noordhuis) [#7462](https://github.com/nodejs/node/pull/7462) +* [[`ccc701e1d5`](https://github.com/nodejs/node/commit/ccc701e1d5)] - **src**: fix build/c++tr1 cpplint warnings (Ben Noordhuis) [#7462](https://github.com/nodejs/node/pull/7462) +* [[`dda81b44b0`](https://github.com/nodejs/node/commit/dda81b44b0)] - **src**: unify implementations of Utf8Value etc. (Anna Henningsen) [#6357](https://github.com/nodejs/node/pull/6357) +* [[`db2b23f06f`](https://github.com/nodejs/node/commit/db2b23f06f)] - **src**: fix sporadic deadlock in SIGUSR1 handler (Ben Noordhuis) [#5904](https://github.com/nodejs/node/pull/5904) +* [[`53a67ed6d7`](https://github.com/nodejs/node/commit/53a67ed6d7)] - **src**: fix bad logic in uid/gid checks (Ben Noordhuis) [#7374](https://github.com/nodejs/node/pull/7374) +* [[`e6a27a70d8`](https://github.com/nodejs/node/commit/e6a27a70d8)] - **src**: fix use-after-return in zlib bindings (Ben Noordhuis) [#7374](https://github.com/nodejs/node/pull/7374) +* [[`61de6e9b47`](https://github.com/nodejs/node/commit/61de6e9b47)] - **src**: remove deprecated HMAC_Init, use HMAC_Init_ex (Ben Noordhuis) [#7374](https://github.com/nodejs/node/pull/7374) +* [[`7305e7b9d2`](https://github.com/nodejs/node/commit/7305e7b9d2)] - **src**: remove duplicate HMAC_Init calls (Ben Noordhuis) [#7374](https://github.com/nodejs/node/pull/7374) +* [[`38baf6a0b7`](https://github.com/nodejs/node/commit/38baf6a0b7)] - **src**: remove unused md_ data members (Ben Noordhuis) [#7374](https://github.com/nodejs/node/pull/7374) +* [[`e103044b68`](https://github.com/nodejs/node/commit/e103044b68)] - **src**: remove unused data member write_queue_size_ (Ben Noordhuis) [#7374](https://github.com/nodejs/node/pull/7374) +* [[`67937bca0a`](https://github.com/nodejs/node/commit/67937bca0a)] - **src**: guard against starting fs watcher twice (Ben Noordhuis) [#7374](https://github.com/nodejs/node/pull/7374) +* [[`c03bd57ac6`](https://github.com/nodejs/node/commit/c03bd57ac6)] - **src**: check uv_async_init() return value (Ben Noordhuis) [#7374](https://github.com/nodejs/node/pull/7374) +* [[`2b0dce5a5b`](https://github.com/nodejs/node/commit/2b0dce5a5b)] - **src**: don't use locale-sensitive strcasecmp() (Ben Noordhuis) [#6582](https://github.com/nodejs/node/pull/6582) +* [[`9c31c738fc`](https://github.com/nodejs/node/commit/9c31c738fc)] - **src**: remove unused #include statement (Ben Noordhuis) [#6582](https://github.com/nodejs/node/pull/6582) +* [[`426aa0a5e8`](https://github.com/nodejs/node/commit/426aa0a5e8)] - **src**: fix Windows segfault with `--eval` (Bryce Simonds) [#6938](https://github.com/nodejs/node/pull/6938) +* [[`b21d145c2a`](https://github.com/nodejs/node/commit/b21d145c2a)] - **(SEMVER-MINOR)** **src**: add node::FreeEnvironment public API (Cheng Zhao) [#3098](https://github.com/nodejs/node/pull/3098) +* [[`b9136c0c03`](https://github.com/nodejs/node/commit/b9136c0c03)] - **src**: add process.binding('config') (James M Snell) [#6266](https://github.com/nodejs/node/pull/6266) +* [[`c3d87eee49`](https://github.com/nodejs/node/commit/c3d87eee49)] - **src**: reword command and add ternary (Trevor Norris) [#5756](https://github.com/nodejs/node/pull/5756) +* [[`68f391bf3b`](https://github.com/nodejs/node/commit/68f391bf3b)] - **src**: remove unnecessary check (Brian White) [#5233](https://github.com/nodejs/node/pull/5233) +* [[`981bbcd925`](https://github.com/nodejs/node/commit/981bbcd925)] - **src**: remove TryCatch in MakeCallback (Trevor Norris) [#4507](https://github.com/nodejs/node/pull/4507) +* [[`48b7b71352`](https://github.com/nodejs/node/commit/48b7b71352)] - **src**: remove unused TickInfo::in_tick() (Trevor Norris) [#4507](https://github.com/nodejs/node/pull/4507) +* [[`d77b28c6b3`](https://github.com/nodejs/node/commit/d77b28c6b3)] - **src**: remove unused of TickInfo::last_threw() (Trevor Norris) [#4507](https://github.com/nodejs/node/pull/4507) +* [[`cb291d5c7f`](https://github.com/nodejs/node/commit/cb291d5c7f)] - **src**: add AsyncCallbackScope (Trevor Norris) [#4507](https://github.com/nodejs/node/pull/4507) +* [[`2eb097f212`](https://github.com/nodejs/node/commit/2eb097f212)] - **src**: fix MakeCallback error handling (Trevor Norris) [#4507](https://github.com/nodejs/node/pull/4507) +* [[`63356df39c`](https://github.com/nodejs/node/commit/63356df39c)] - **src,http**: fix uncaughtException miss in http (Trevor Norris) [#5591](https://github.com/nodejs/node/pull/5591) +* [[`ee7040568d`](https://github.com/nodejs/node/commit/ee7040568d)] - **src,http_parser**: remove KickNextTick call (Trevor Norris) [#5756](https://github.com/nodejs/node/pull/5756) +* [[`9a8acad6ff`](https://github.com/nodejs/node/commit/9a8acad6ff)] - **test**: use random ports where possible (Brian White) [#7045](https://github.com/nodejs/node/pull/7045) +* [[`223c0e2010`](https://github.com/nodejs/node/commit/223c0e2010)] - **test**: skip doctool tests when js-yaml is missing (Anna Henningsen) [#7218](https://github.com/nodejs/node/pull/7218) +* [[`3681b9b868`](https://github.com/nodejs/node/commit/3681b9b868)] - **test**: refactor doctool tests (Rich Trott) [#6719](https://github.com/nodejs/node/pull/6719) +* [[`686d7b329c`](https://github.com/nodejs/node/commit/686d7b329c)] - **test**: build addons with V8_DEPRECATION_WARNINGS=1 (Ben Noordhuis) [#6652](https://github.com/nodejs/node/pull/6652) +* [[`8404e34665`](https://github.com/nodejs/node/commit/8404e34665)] - ***Revert*** "**test**: mark test-vm-timeout flaky on windows" (Anna Henningsen) [#7373](https://github.com/nodejs/node/pull/7373) +* [[`eab9ced2ee`](https://github.com/nodejs/node/commit/eab9ced2ee)] - **test**: fix flaky test-vm-timeout (Anna Henningsen) [#7373](https://github.com/nodejs/node/pull/7373) +* [[`a31d3161f5`](https://github.com/nodejs/node/commit/a31d3161f5)] - **test**: add test for exec() known issue (Rich Trott) [#7375](https://github.com/nodejs/node/pull/7375) +* [[`1baa145a16`](https://github.com/nodejs/node/commit/1baa145a16)] - **test**: remove internet/test-tls-connnect-cnnic (Ben Noordhuis) [#7363](https://github.com/nodejs/node/pull/7363) +* [[`e3097b7cdf`](https://github.com/nodejs/node/commit/e3097b7cdf)] - **test**: test isFullWidthCodePoint with invalid input (Rich Trott) [#7422](https://github.com/nodejs/node/pull/7422) +* [[`f0b0fc49f9`](https://github.com/nodejs/node/commit/f0b0fc49f9)] - **test**: update weak module for gc tests (Rich Trott) [#7014](https://github.com/nodejs/node/pull/7014) +* [[`1d100f6853`](https://github.com/nodejs/node/commit/1d100f6853)] - **test**: remove unused vars from http/https tests (Rich Trott) [#7598](https://github.com/nodejs/node/pull/7598) +* [[`3241536d95`](https://github.com/nodejs/node/commit/3241536d95)] - **test**: remove unused var in net-server-try-ports (Rich Trott) [#7597](https://github.com/nodejs/node/pull/7597) +* [[`7bd7c235fa`](https://github.com/nodejs/node/commit/7bd7c235fa)] - **test**: remove unused var from stream2 test (Rich Trott) [#7596](https://github.com/nodejs/node/pull/7596) +* [[`4d36a67738`](https://github.com/nodejs/node/commit/4d36a67738)] - **test**: remove unused var from child-process-fork (Rich Trott) [#7599](https://github.com/nodejs/node/pull/7599) +* [[`b5e516a42c`](https://github.com/nodejs/node/commit/b5e516a42c)] - **test**: remove unused var in test-tls-server-verify (Rich Trott) [#7595](https://github.com/nodejs/node/pull/7595) +* [[`db35efa6c1`](https://github.com/nodejs/node/commit/db35efa6c1)] - **test**: fix flaky test-net-write-slow (Rich Trott) [#7555](https://github.com/nodejs/node/pull/7555) +* [[`8273824ca3`](https://github.com/nodejs/node/commit/8273824ca3)] - **test**: remove common.PORT from http tests (Rich Trott) [#7467](https://github.com/nodejs/node/pull/7467) +* [[`5129f3f2cd`](https://github.com/nodejs/node/commit/5129f3f2cd)] - **test**: mark test-vm-timeout flaky on windows (Rich Trott) [#7359](https://github.com/nodejs/node/pull/7359) +* [[`79b45886c1`](https://github.com/nodejs/node/commit/79b45886c1)] - **test**: add tests for some stream.Readable uses (Anna Henningsen) [#7260](https://github.com/nodejs/node/pull/7260) +* [[`65b5cccee9`](https://github.com/nodejs/node/commit/65b5cccee9)] - **test**: fix spawn on windows (Brian White) [#7049](https://github.com/nodejs/node/pull/7049) +* [[`96ed883d2f`](https://github.com/nodejs/node/commit/96ed883d2f)] - **test**: enable test-debug-brk-no-arg (Rich Trott) [#7143](https://github.com/nodejs/node/pull/7143) +* [[`8724c442f3`](https://github.com/nodejs/node/commit/8724c442f3)] - **test**: add test for uid/gid setting in spawn (Rich Trott) [#7084](https://github.com/nodejs/node/pull/7084) +* [[`042e858dfb`](https://github.com/nodejs/node/commit/042e858dfb)] - **test**: make test-child-process-fork-net more robust (Rich Trott) [#7033](https://github.com/nodejs/node/pull/7033) +* [[`2a59e4e73d`](https://github.com/nodejs/node/commit/2a59e4e73d)] - **test**: improve debug-break-on-uncaught reliability (Rich Trott) [#6793](https://github.com/nodejs/node/pull/6793) +* [[`77325d585e`](https://github.com/nodejs/node/commit/77325d585e)] - **test**: remove disabled eio race test (Rich Trott) [#7083](https://github.com/nodejs/node/pull/7083) +* [[`5b1f54678b`](https://github.com/nodejs/node/commit/5b1f54678b)] - **test**: remove non-incremental common.PORT changes (Rich Trott) [#7055](https://github.com/nodejs/node/pull/7055) +* [[`44228dfdef`](https://github.com/nodejs/node/commit/44228dfdef)] - **test**: remove `common.PORT` from gc tests (Rich Trott) [#7013](https://github.com/nodejs/node/pull/7013) +* [[`644bfe14a6`](https://github.com/nodejs/node/commit/644bfe14a6)] - **test**: fix test-debug-port-numbers on OS X (Santiago Gimeno) [#7046](https://github.com/nodejs/node/pull/7046) +* [[`cde3014f78`](https://github.com/nodejs/node/commit/cde3014f78)] - **test**: remove modifcation to common.PORT (Rich Trott) [#6990](https://github.com/nodejs/node/pull/6990) +* [[`8c412af7ac`](https://github.com/nodejs/node/commit/8c412af7ac)] - **test**: verify cluster worker exit (cjihrig) [#6993](https://github.com/nodejs/node/pull/6993) +* [[`7d6acefbcc`](https://github.com/nodejs/node/commit/7d6acefbcc)] - **test**: listen on and connect to 127.0.0.1 (Ben Noordhuis) [#7524](https://github.com/nodejs/node/pull/7524) +* [[`ecf5c1cb25`](https://github.com/nodejs/node/commit/ecf5c1cb25)] - **test**: refactor spawnSync() cwd test (cjihrig) [#6939](https://github.com/nodejs/node/pull/6939) +* [[`9cccaa3c80`](https://github.com/nodejs/node/commit/9cccaa3c80)] - **test**: fix component printing on windows (Ben Noordhuis) [#6915](https://github.com/nodejs/node/pull/6915) +* [[`af4b56d6be`](https://github.com/nodejs/node/commit/af4b56d6be)] - **test**: pass python path to node-gyp (hefangshi) [#6646](https://github.com/nodejs/node/pull/6646) +* [[`7c55f59214`](https://github.com/nodejs/node/commit/7c55f59214)] - **test**: make stdout buffer test more robust (Rich Trott) [#6633](https://github.com/nodejs/node/pull/6633) +* [[`3aef9b813f`](https://github.com/nodejs/node/commit/3aef9b813f)] - **test**: unmark test-http-regr-gh-2928 as flaky (Rich Trott) [#6540](https://github.com/nodejs/node/pull/6540) +* [[`2259e5db69`](https://github.com/nodejs/node/commit/2259e5db69)] - **test**: avoid test-cluster-master-* flakiness (Stefan Budeanu) [#6531](https://github.com/nodejs/node/pull/6531) +* [[`5f444ed6a3`](https://github.com/nodejs/node/commit/5f444ed6a3)] - **test**: add tests for stream3 buffering using cork (Alex J Burke) [#6493](https://github.com/nodejs/node/pull/6493) +* [[`01b314d165`](https://github.com/nodejs/node/commit/01b314d165)] - **test**: test TTY problems by fakeing a TTY using openpty (Jeremiah Senkpiel) [#6895](https://github.com/nodejs/node/pull/6895) +* [[`55f8689711`](https://github.com/nodejs/node/commit/55f8689711)] - **test**: add test for responses to HTTP CONNECT req (Josh Leder) [#6279](https://github.com/nodejs/node/pull/6279) +* [[`9aec1ddb4f`](https://github.com/nodejs/node/commit/9aec1ddb4f)] - **test**: test cluster worker disconnection on error (Santiago Gimeno) [#6909](https://github.com/nodejs/node/pull/6909) +* [[`c0a42bc040`](https://github.com/nodejs/node/commit/c0a42bc040)] - **test**: verify IPC messages are emitted on next tick (Santiago Gimeno) [#6909](https://github.com/nodejs/node/pull/6909) +* [[`9606f768ea`](https://github.com/nodejs/node/commit/9606f768ea)] - **(SEMVER-MINOR)** **test**: run v8 tests from node tree (Bryon Leung) [#4704](https://github.com/nodejs/node/pull/4704) +* [[`efdeb69c9a`](https://github.com/nodejs/node/commit/efdeb69c9a)] - **test**: work around debugger not killing inferior (Ben Noordhuis) [#7037](https://github.com/nodejs/node/pull/7037) +* [[`e3f9bc893f`](https://github.com/nodejs/node/commit/e3f9bc893f)] - **test**: use strictEqual consistently in agent test (Ben Noordhuis) [#6654](https://github.com/nodejs/node/pull/6654) +* [[`1186b7a401`](https://github.com/nodejs/node/commit/1186b7a401)] - **test**: add addons test for MakeCallback (Trevor Norris) [#4507](https://github.com/nodejs/node/pull/4507) +* [[`8f76d7db03`](https://github.com/nodejs/node/commit/8f76d7db03)] - **test,tools**: test yaml parsing of doctool (Anna Henningsen) [#6495](https://github.com/nodejs/node/pull/6495) +* [[`e544b1c40c`](https://github.com/nodejs/node/commit/e544b1c40c)] - **test,win**: skip addons/load-long-path on WOW64 (Alexis Campailla) [#6675](https://github.com/nodejs/node/pull/6675) +* [[`b956635e41`](https://github.com/nodejs/node/commit/b956635e41)] - **tls**: catch `certCbDone` exceptions (Fedor Indutny) [#6887](https://github.com/nodejs/node/pull/6887) +* [[`06327e5eed`](https://github.com/nodejs/node/commit/06327e5eed)] - **tls**: use process.binding('config') to detect fips mode (James M Snell) [#7551](https://github.com/nodejs/node/pull/7551) +* [[`c807287e80`](https://github.com/nodejs/node/commit/c807287e80)] - **tls,https**: respect address family when connecting (Ben Noordhuis) [#6654](https://github.com/nodejs/node/pull/6654) +* [[`9ef6e23088`](https://github.com/nodejs/node/commit/9ef6e23088)] - **tools**: make sure doctool anchors respect includes (Anna Henningsen) [#6943](https://github.com/nodejs/node/pull/6943) +* [[`f9f85a006f`](https://github.com/nodejs/node/commit/f9f85a006f)] - **tools**: restore change of signatures to opts hashes (Jesse McCarthy) [#6690](https://github.com/nodejs/node/pull/6690) +* [[`607173bbac`](https://github.com/nodejs/node/commit/607173bbac)] - **tools**: fix regression in doctool (Myles Borins) [#6680](https://github.com/nodejs/node/pull/6680) +* [[`ed193ad8ae`](https://github.com/nodejs/node/commit/ed193ad8ae)] - **tools**: fix tools/doc/addon-verify.js regression (Anna Henningsen) [#6652](https://github.com/nodejs/node/pull/6652) +* [[`8b88c384f0`](https://github.com/nodejs/node/commit/8b88c384f0)] - **tools**: lint for object literal spacing (Rich Trott) [#6592](https://github.com/nodejs/node/pull/6592) +* [[`96b5aa8710`](https://github.com/nodejs/node/commit/96b5aa8710)] - **tools**: update marked dependency (Daniel Wang) [#6396](https://github.com/nodejs/node/pull/6396) +* [[`ea137637b7`](https://github.com/nodejs/node/commit/ea137637b7)] - **tools**: allow multiple added: version entries (Anna Henningsen) [#6495](https://github.com/nodejs/node/pull/6495) +* [[`2832a60426`](https://github.com/nodejs/node/commit/2832a60426)] - **tools**: parse documentation metadata (Tristian Flanagan) [#6495](https://github.com/nodejs/node/pull/6495) +* [[`0149cb0577`](https://github.com/nodejs/node/commit/0149cb0577)] - **tools**: add mock-y js-yaml dependency to doctool (Anna Henningsen) [#6495](https://github.com/nodejs/node/pull/6495) +* [[`68e9fd47c6`](https://github.com/nodejs/node/commit/68e9fd47c6)] - **tools**: fix -Wunused-variable warning (Ben Noordhuis) [#7462](https://github.com/nodejs/node/pull/7462) +* [[`4a2bd2d515`](https://github.com/nodejs/node/commit/4a2bd2d515)] - **tools**: allow cpplint to run outside git repo (Ben Noordhuis) [#7462](https://github.com/nodejs/node/pull/7462) +* [[`09e98a4457`](https://github.com/nodejs/node/commit/09e98a4457)] - **tools**: add back --mode=tap to cpplint (Ben Noordhuis) [#7462](https://github.com/nodejs/node/pull/7462) +* [[`e74f199fe2`](https://github.com/nodejs/node/commit/e74f199fe2)] - **tools**: disable unwanted cpplint rules again (Ben Noordhuis) [#7462](https://github.com/nodejs/node/pull/7462) +* [[`391fc80487`](https://github.com/nodejs/node/commit/391fc80487)] - **tools**: update cpplint to r456 (Ben Noordhuis) [#7462](https://github.com/nodejs/node/pull/7462) +* [[`efadf7639f`](https://github.com/nodejs/node/commit/efadf7639f)] - **tools**: update certdata.txt (Ben Noordhuis) [#7363](https://github.com/nodejs/node/pull/7363) +* [[`d7ce99214d`](https://github.com/nodejs/node/commit/d7ce99214d)] - **tools**: update ESLint, fix unused vars bug (Rich Trott) [#7601](https://github.com/nodejs/node/pull/7601) +* [[`242d6c7323`](https://github.com/nodejs/node/commit/242d6c7323)] - **tools**: remove unused variable (Rich Trott) [#7594](https://github.com/nodejs/node/pull/7594) +* [[`7182f5f876`](https://github.com/nodejs/node/commit/7182f5f876)] - **tools**: fix license builder to work with icu-small (Myles Borins) [#7119](https://github.com/nodejs/node/pull/7119) +* [[`140b84dd7d`](https://github.com/nodejs/node/commit/140b84dd7d)] - **tools**: print stderr on bad test.py `vmArch` check (Jeremiah Senkpiel) [#6786](https://github.com/nodejs/node/pull/6786) +* [[`4c423e649c`](https://github.com/nodejs/node/commit/4c423e649c)] - **tools**: explicit path for V8 test tap output (Myles Borins) [#7460](https://github.com/nodejs/node/pull/7460) +* [[`d50f16969d`](https://github.com/nodejs/node/commit/d50f16969d)] - **tools,doc**: add example usage for REPLACEME tag (Anna Henningsen) [#6864](https://github.com/nodejs/node/pull/6864) +* [[`b07c3a6ea6`](https://github.com/nodejs/node/commit/b07c3a6ea6)] - **tty**: use blocking mode on OS X (Jeremiah Senkpiel) [#6895](https://github.com/nodejs/node/pull/6895) +* [[`a1719a94e9`](https://github.com/nodejs/node/commit/a1719a94e9)] - **udp**: use libuv API to get file descriptor (Saúl Ibarra Corretgé) [#6908](https://github.com/nodejs/node/pull/6908) +* [[`7779639a11`](https://github.com/nodejs/node/commit/7779639a11)] - **unix,stream**: fix getting the correct fd for a handle (Saúl Ibarra Corretgé) [#6753](https://github.com/nodejs/node/pull/6753) +* [[`d0bf09d3ad`](https://github.com/nodejs/node/commit/d0bf09d3ad)] - **util**: improve format() performance further (Brian White) [#5360](https://github.com/nodejs/node/pull/5360) +* [[`72fb281961`](https://github.com/nodejs/node/commit/72fb281961)] - **util**: improve util.format performance (Evan Lucas) [#5360](https://github.com/nodejs/node/pull/5360) +* [[`855759757a`](https://github.com/nodejs/node/commit/855759757a)] - **vm**: don't print out arrow message for custom error (Anna Henningsen) [#7398](https://github.com/nodejs/node/pull/7398) +* [[`b9dfdfe1d3`](https://github.com/nodejs/node/commit/b9dfdfe1d3)] - **vm**: don't abort process when stack space runs out (Anna Henningsen) [#6907](https://github.com/nodejs/node/pull/6907) +* [[`0bfedd13a9`](https://github.com/nodejs/node/commit/0bfedd13a9)] - **win,build**: add creation of zip and 7z package (Bartosz Sosnowski) [#5995](https://github.com/nodejs/node/pull/5995) +* [[`7d66752f1f`](https://github.com/nodejs/node/commit/7d66752f1f)] - **zlib**: release callback and buffer after processing (Matt Lavin) [#6955](https://github.com/nodejs/node/pull/6955) + +## 2016-06-28, Version 4.4.7 'Argon' (LTS), @thealphanerd + +This LTS release comes with 89 commits. This includes 46 commits that are docs related, 11 commits that are test related, 8 commits that are build related, and 4 commits that are benchmark related. + +### Notable Changes + +- **debugger**: + - All properties of an array (aside from length) can now be printed in the repl (cjihrig) [#6448](https://github.com/nodejs/node/pull/6448) +- **npm**: + - Upgrade npm to 2.15.8 (Rebecca Turner) [#7412](https://github.com/nodejs/node/pull/7412) +- **stream**: + - Fix for a bug that became more prevalent with the stream changes that landed in v4.4.5. (Anna Henningsen) [#7160](https://github.com/nodejs/node/pull/7160) +- **V8**: + - Fix for a bug in crankshaft that was causing crashes on arm64 (Myles Borins) [#7442](https://github.com/nodejs/node/pull/7442) + - Add missing classes to postmortem info such as JSMap and JSSet (evan.lucas) [#3792](https://github.com/nodejs/node/pull/3792) + +### Commits + +* [[`87cdb83a96`](https://github.com/nodejs/node/commit/87cdb83a96)] - **benchmark**: merge url.js with url-resolve.js (Andreas Madsen) [#5177](https://github.com/nodejs/node/pull/5177) +* [[`921e8568d5`](https://github.com/nodejs/node/commit/921e8568d5)] - **benchmark**: move misc to categorized directories (Andreas Madsen) [#5177](https://github.com/nodejs/node/pull/5177) +* [[`c189eec14e`](https://github.com/nodejs/node/commit/c189eec14e)] - **benchmark**: fix configuation parameters (Andreas Madsen) [#5177](https://github.com/nodejs/node/pull/5177) +* [[`58ad451f0b`](https://github.com/nodejs/node/commit/58ad451f0b)] - **benchmark**: move string-decoder to its own category (Andreas Madsen) [#5177](https://github.com/nodejs/node/pull/5177) +* [[`a01caa3166`](https://github.com/nodejs/node/commit/a01caa3166)] - **build**: don't compile with -B, redux (Ben Noordhuis) [#6650](https://github.com/nodejs/node/pull/6650) +* [[`37606caeaf`](https://github.com/nodejs/node/commit/37606caeaf)] - **build**: don't compile with -B (Ben Noordhuis) [#6393](https://github.com/nodejs/node/pull/6393) +* [[`64fb7a1929`](https://github.com/nodejs/node/commit/64fb7a1929)] - **build**: update android-configure script for npm (Robert Chiras) [#6349](https://github.com/nodejs/node/pull/6349) +* [[`43ce6fc8d2`](https://github.com/nodejs/node/commit/43ce6fc8d2)] - **build**: fix DESTCPU detection for binary target (Richard Lau) [#6310](https://github.com/nodejs/node/pull/6310) +* [[`6dfe7aeed5`](https://github.com/nodejs/node/commit/6dfe7aeed5)] - **cares**: Support malloc(0) scenarios for AIX (Gireesh Punathil) [#6305](https://github.com/nodejs/node/pull/6305) +* [[`2389006720`](https://github.com/nodejs/node/commit/2389006720)] - **debugger**: display array contents in repl (cjihrig) [#6448](https://github.com/nodejs/node/pull/6448) +* [[`1c6809ce75`](https://github.com/nodejs/node/commit/1c6809ce75)] - **debugger**: introduce exec method for debugger (Jackson Tian) +* [[`200b3ca9ed`](https://github.com/nodejs/node/commit/200b3ca9ed)] - **deps**: upgrade npm in LTS to 2.15.8 (Rebecca Turner) [#7412](https://github.com/nodejs/node/pull/7412) +* [[`49921e8819`](https://github.com/nodejs/node/commit/49921e8819)] - **deps**: backport 102e3e87e7 from V8 upstream (Myles Borins) [#7442](https://github.com/nodejs/node/pull/7442) +* [[`de00f91041`](https://github.com/nodejs/node/commit/de00f91041)] - **deps**: backport bc2e393 from v8 upstream (evan.lucas) [#3792](https://github.com/nodejs/node/pull/3792) +* [[`1549899531`](https://github.com/nodejs/node/commit/1549899531)] - **dgram,test**: add addMembership/dropMembership tests (Rich Trott) [#6753](https://github.com/nodejs/node/pull/6753) +* [[`0ba3c2ca66`](https://github.com/nodejs/node/commit/0ba3c2ca66)] - **doc**: fix layout problem in v4 changelog (Myles Borins) [#7394](https://github.com/nodejs/node/pull/7394) +* [[`98469ad84d`](https://github.com/nodejs/node/commit/98469ad84d)] - **doc**: correct args for cluster message event (Colin Ihrig) [#7297](https://github.com/nodejs/node/pull/7297) +* [[`67863f110b`](https://github.com/nodejs/node/commit/67863f110b)] - **doc**: update licenses (Myles Borins) [#7127](https://github.com/nodejs/node/pull/7127) +* [[`c31eaad42d`](https://github.com/nodejs/node/commit/c31eaad42d)] - **doc**: clarify buffer class (Steve Mao) [#6914](https://github.com/nodejs/node/pull/6914) +* [[`e0dd476fe5`](https://github.com/nodejs/node/commit/e0dd476fe5)] - **doc**: fix typos in timers topic to aid readability (Kevin Donahue) [#6916](https://github.com/nodejs/node/pull/6916) +* [[`a8391bc9fc`](https://github.com/nodejs/node/commit/a8391bc9fc)] - **doc**: add jhamhader to collaborators (Yuval Brik) [#6946](https://github.com/nodejs/node/pull/6946) +* [[`22ca7b877b`](https://github.com/nodejs/node/commit/22ca7b877b)] - **doc**: add @othiym23 to list of collaborators (Forrest L Norvell) [#6945](https://github.com/nodejs/node/pull/6945) +* [[`2c3c4e5819`](https://github.com/nodejs/node/commit/2c3c4e5819)] - **doc**: reference list of language-specific globals (Anna Henningsen) [#6900](https://github.com/nodejs/node/pull/6900) +* [[`5a1a0b5ed1`](https://github.com/nodejs/node/commit/5a1a0b5ed1)] - **doc**: make the api doc print-friendly (Marian) [#6748](https://github.com/nodejs/node/pull/6748) +* [[`03db88e012`](https://github.com/nodejs/node/commit/03db88e012)] - **doc**: add bengl to collaborators (Bryan English) [#6921](https://github.com/nodejs/node/pull/6921) +* [[`fbf95dde94`](https://github.com/nodejs/node/commit/fbf95dde94)] - **doc**: Update DCO to v1.1 (William Kapke) [#6353](https://github.com/nodejs/node/pull/6353) +* [[`f23a9c39c0`](https://github.com/nodejs/node/commit/f23a9c39c0)] - **doc**: fix typo in Error.captureStackTrace (Mohsen) [#6811](https://github.com/nodejs/node/pull/6811) +* [[`30ab6a890c`](https://github.com/nodejs/node/commit/30ab6a890c)] - **doc**: fix name to match git log (Robert Jefe Lindstaedt) [#6880](https://github.com/nodejs/node/pull/6880) +* [[`2b0f40ca16`](https://github.com/nodejs/node/commit/2b0f40ca16)] - **doc**: add note for fs.watch virtualized env (Robert Jefe Lindstaedt) [#6809](https://github.com/nodejs/node/pull/6809) +* [[`3b461870be`](https://github.com/nodejs/node/commit/3b461870be)] - **doc**: Backport ee.once doc clarifications to 4.x. (Lance Ball) [#7103](https://github.com/nodejs/node/pull/7103) +* [[`eadb7e5b20`](https://github.com/nodejs/node/commit/eadb7e5b20)] - **doc**: subdivide TOC, add auxiliary links (Jeremiah Senkpiel) [#6167](https://github.com/nodejs/node/pull/6167) +* [[`107839c5dd`](https://github.com/nodejs/node/commit/107839c5dd)] - **doc**: no Node.js(1) (Jeremiah Senkpiel) [#6167](https://github.com/nodejs/node/pull/6167) +* [[`401325f9e2`](https://github.com/nodejs/node/commit/401325f9e2)] - **doc**: better example & synopsis (Jeremiah Senkpiel) [#6167](https://github.com/nodejs/node/pull/6167) +* [[`c654184f28`](https://github.com/nodejs/node/commit/c654184f28)] - **doc**: remove link to Sign in crypto.md (Kirill Fomichev) [#6812](https://github.com/nodejs/node/pull/6812) +* [[`3e9288e466`](https://github.com/nodejs/node/commit/3e9288e466)] - **doc**: fix exec example in child_process (Evan Lucas) [#6660](https://github.com/nodejs/node/pull/6660) +* [[`3d820e45b4`](https://github.com/nodejs/node/commit/3d820e45b4)] - **doc**: "a" -> "an" in api/documentation.md (Anchika Agarwal) [#6689](https://github.com/nodejs/node/pull/6689) +* [[`352496daa2`](https://github.com/nodejs/node/commit/352496daa2)] - **doc**: move the readme newcomers section (Jeremiah Senkpiel) [#6681](https://github.com/nodejs/node/pull/6681) +* [[`ac6b921ce5`](https://github.com/nodejs/node/commit/ac6b921ce5)] - **doc**: mention existence/purpose of module wrapper (Matt Harrison) [#6433](https://github.com/nodejs/node/pull/6433) +* [[`97d1fc0fc6`](https://github.com/nodejs/node/commit/97d1fc0fc6)] - **doc**: improve onboarding-extras.md formatting (Jeremiah Senkpiel) [#6548](https://github.com/nodejs/node/pull/6548) +* [[`c9b144ddd4`](https://github.com/nodejs/node/commit/c9b144ddd4)] - **doc**: linkify remaining references to fs.Stats object (Kevin Donahue) [#6485](https://github.com/nodejs/node/pull/6485) +* [[`d909c25a33`](https://github.com/nodejs/node/commit/d909c25a33)] - **doc**: fix the lint of an example in cluster.md (yorkie) [#6516](https://github.com/nodejs/node/pull/6516) +* [[`21d02f460f`](https://github.com/nodejs/node/commit/21d02f460f)] - **doc**: add missing underscore for markdown italics (Kevin Donahue) [#6529](https://github.com/nodejs/node/pull/6529) +* [[`18ecc779bb`](https://github.com/nodejs/node/commit/18ecc779bb)] - **doc**: ensure consistent grammar in node.1 file (justshiv) [#6426](https://github.com/nodejs/node/pull/6426) +* [[`52d9e7b61d`](https://github.com/nodejs/node/commit/52d9e7b61d)] - **doc**: fix a typo in __dirname section (William Luo) [#6473](https://github.com/nodejs/node/pull/6473) +* [[`de20235235`](https://github.com/nodejs/node/commit/de20235235)] - **doc**: remove all scrollbar styling (Claudio Rodriguez) [#6479](https://github.com/nodejs/node/pull/6479) +* [[`a6f45b4eda`](https://github.com/nodejs/node/commit/a6f45b4eda)] - **doc**: Remove extra space in REPL example (Juan) [#6447](https://github.com/nodejs/node/pull/6447) +* [[`feda15b2b8`](https://github.com/nodejs/node/commit/feda15b2b8)] - **doc**: update build instructions for OS X (Rich Trott) [#6309](https://github.com/nodejs/node/pull/6309) +* [[`3d1a3e4a30`](https://github.com/nodejs/node/commit/3d1a3e4a30)] - **doc**: change references to Stable to Current (Myles Borins) [#6318](https://github.com/nodejs/node/pull/6318) +* [[`e28598b1ef`](https://github.com/nodejs/node/commit/e28598b1ef)] - **doc**: update authors (James M Snell) [#6373](https://github.com/nodejs/node/pull/6373) +* [[`0f3a94acbd`](https://github.com/nodejs/node/commit/0f3a94acbd)] - **doc**: add JacksonTian to collaborators (Jackson Tian) [#6388](https://github.com/nodejs/node/pull/6388) +* [[`d7d54c8fd2`](https://github.com/nodejs/node/commit/d7d54c8fd2)] - **doc**: add Minqi Pan to collaborators (Minqi Pan) [#6387](https://github.com/nodejs/node/pull/6387) +* [[`83721c6fd2`](https://github.com/nodejs/node/commit/83721c6fd2)] - **doc**: add eljefedelrodeodeljefe to collaborators (Robert Jefe Lindstaedt) [#6389](https://github.com/nodejs/node/pull/6389) +* [[`b112fd1b4e`](https://github.com/nodejs/node/commit/b112fd1b4e)] - **doc**: add ronkorving to collaborators (ronkorving) [#6385](https://github.com/nodejs/node/pull/6385) +* [[`ac60d9cc86`](https://github.com/nodejs/node/commit/ac60d9cc86)] - **doc**: add estliberitas to collaborators (Alexander Makarenko) [#6386](https://github.com/nodejs/node/pull/6386) +* [[`435cd56de5`](https://github.com/nodejs/node/commit/435cd56de5)] - **doc**: DCO anchor that doesn't change (William Kapke) [#6257](https://github.com/nodejs/node/pull/6257) +* [[`7d8141dd1b`](https://github.com/nodejs/node/commit/7d8141dd1b)] - **doc**: add stefanmb to collaborators (Stefan Budeanu) [#6227](https://github.com/nodejs/node/pull/6227) +* [[`6dfc96326d`](https://github.com/nodejs/node/commit/6dfc96326d)] - **doc**: add iWuzHere to collaborators (Imran Iqbal) [#6226](https://github.com/nodejs/node/pull/6226) +* [[`3dbcc73159`](https://github.com/nodejs/node/commit/3dbcc73159)] - **doc**: add santigimeno to collaborators (Santiago Gimeno) [#6225](https://github.com/nodejs/node/pull/6225) +* [[`ae3eb24a3d`](https://github.com/nodejs/node/commit/ae3eb24a3d)] - **doc**: add addaleax to collaborators (Anna Henningsen) [#6224](https://github.com/nodejs/node/pull/6224) +* [[`46ee7bb4ba`](https://github.com/nodejs/node/commit/46ee7bb4ba)] - **doc**: fix incorrect references in buffer docs (Amery) [#6194](https://github.com/nodejs/node/pull/6194) +* [[`e3f78eb7c1`](https://github.com/nodejs/node/commit/e3f78eb7c1)] - **doc**: improve rendering of v4.4.5 changelog entry (Myles Borins) [#6958](https://github.com/nodejs/node/pull/6958) +* [[`bac87d01d9`](https://github.com/nodejs/node/commit/bac87d01d9)] - **gitignore**: adding .vs/ directory to .gitignore (Mike Kaufman) [#6070](https://github.com/nodejs/node/pull/6070) +* [[`93f2314dc2`](https://github.com/nodejs/node/commit/93f2314dc2)] - **gitignore**: ignore VS 2015 *.VC.opendb files (Mike Kaufman) [#6070](https://github.com/nodejs/node/pull/6070) +* [[`c98aaf59bf`](https://github.com/nodejs/node/commit/c98aaf59bf)] - **http**: speed up checkIsHttpToken (Jackson Tian) [#4790](https://github.com/nodejs/node/pull/4790) +* [[`552e25cb6b`](https://github.com/nodejs/node/commit/552e25cb6b)] - **lib,test**: update in preparation for linter update (Rich Trott) [#6498](https://github.com/nodejs/node/pull/6498) +* [[`aaeeec4765`](https://github.com/nodejs/node/commit/aaeeec4765)] - **lib,test,tools**: alignment on variable assignments (Rich Trott) [#6869](https://github.com/nodejs/node/pull/6869) +* [[`b3acbc5648`](https://github.com/nodejs/node/commit/b3acbc5648)] - **net**: replace __defineGetter__ with defineProperty (Fedor Indutny) [#6284](https://github.com/nodejs/node/pull/6284) +* [[`4c1eb5bf03`](https://github.com/nodejs/node/commit/4c1eb5bf03)] - **repl**: create history file with mode 0600 (Carl Lei) [#3394](https://github.com/nodejs/node/pull/3394) +* [[`90306bb81d`](https://github.com/nodejs/node/commit/90306bb81d)] - **src**: use size_t for http parser array size fields (Ben Noordhuis) [#5969](https://github.com/nodejs/node/pull/5969) +* [[`af41a63d0f`](https://github.com/nodejs/node/commit/af41a63d0f)] - **src**: replace ARRAY_SIZE with typesafe arraysize (Ben Noordhuis) [#5969](https://github.com/nodejs/node/pull/5969) +* [[`037291e31f`](https://github.com/nodejs/node/commit/037291e31f)] - **src**: make sure Utf8Value always zero-terminates (Anna Henningsen) [#7101](https://github.com/nodejs/node/pull/7101) +* [[`a08a0179e9`](https://github.com/nodejs/node/commit/a08a0179e9)] - **stream**: ensure awaitDrain is increased once (David Halls) [#7292](https://github.com/nodejs/node/pull/7292) +* [[`b73ec46dcb`](https://github.com/nodejs/node/commit/b73ec46dcb)] - **stream**: reset awaitDrain after manual .resume() (Anna Henningsen) [#7160](https://github.com/nodejs/node/pull/7160) +* [[`55319fe798`](https://github.com/nodejs/node/commit/55319fe798)] - **stream_base**: expose `bytesRead` getter (Fedor Indutny) [#6284](https://github.com/nodejs/node/pull/6284) +* [[`0414d882ce`](https://github.com/nodejs/node/commit/0414d882ce)] - **test**: fix test-net-* error code check for getaddrinfo(3) (Natanael Copa) [#5099](https://github.com/nodejs/node/pull/5099) +* [[`be0bb5f5fc`](https://github.com/nodejs/node/commit/be0bb5f5fc)] - **test**: fix unreliable known_issues test (Rich Trott) [#6555](https://github.com/nodejs/node/pull/6555) +* [[`ab50e82f42`](https://github.com/nodejs/node/commit/ab50e82f42)] - **test**: fix test-process-exec-argv flakiness (Santiago Gimeno) [#7128](https://github.com/nodejs/node/pull/7128) +* [[`4e38655d5f`](https://github.com/nodejs/node/commit/4e38655d5f)] - **test**: refactor test-tls-reuse-host-from-socket (Rich Trott) [#6756](https://github.com/nodejs/node/pull/6756) +* [[`1c4549a31e`](https://github.com/nodejs/node/commit/1c4549a31e)] - **test**: fix flaky test-stdout-close-catch (Santiago Gimeno) [#6808](https://github.com/nodejs/node/pull/6808) +* [[`3b94e31245`](https://github.com/nodejs/node/commit/3b94e31245)] - **test**: robust handling of env for npm-test-install (Myles Borins) [#6797](https://github.com/nodejs/node/pull/6797) +* [[`4067cde7ee`](https://github.com/nodejs/node/commit/4067cde7ee)] - **test**: abstract skip functionality to common (Jeremiah Senkpiel) [#7114](https://github.com/nodejs/node/pull/7114) +* [[`8b396e3d71`](https://github.com/nodejs/node/commit/8b396e3d71)] - **test**: fix test-debugger-repl-break-in-module (Rich Trott) [#6686](https://github.com/nodejs/node/pull/6686) +* [[`847b29c050`](https://github.com/nodejs/node/commit/847b29c050)] - **test**: fix test-debugger-repl-term (Rich Trott) [#6682](https://github.com/nodejs/node/pull/6682) +* [[`1d68bdbe3f`](https://github.com/nodejs/node/commit/1d68bdbe3f)] - **test**: fix error message checks in test-module-loading (James M Snell) [#5986](https://github.com/nodejs/node/pull/5986) +* [[`7e739ae159`](https://github.com/nodejs/node/commit/7e739ae159)] - **test,tools**: adjust function argument alignment (Rich Trott) [#7100](https://github.com/nodejs/node/pull/7100) +* [[`216486c2b6`](https://github.com/nodejs/node/commit/216486c2b6)] - **tools**: lint for function argument alignment (Rich Trott) [#7100](https://github.com/nodejs/node/pull/7100) +* [[`6a76485ad7`](https://github.com/nodejs/node/commit/6a76485ad7)] - **tools**: update ESLint to 2.9.0 (Rich Trott) [#6498](https://github.com/nodejs/node/pull/6498) +* [[`a31153c02c`](https://github.com/nodejs/node/commit/a31153c02c)] - **tools**: remove the minifying logic (Sakthipriyan Vairamani) [#6636](https://github.com/nodejs/node/pull/6636) +* [[`10bd1a73fd`](https://github.com/nodejs/node/commit/10bd1a73fd)] - **tools**: fix license-builder.sh again for ICU (Steven R. Loomis) [#6068](https://github.com/nodejs/node/pull/6068) +* [[`0f6146c6c0`](https://github.com/nodejs/node/commit/0f6146c6c0)] - **tools**: add tests for the doctool (Ian Kronquist) [#6031](https://github.com/nodejs/node/pull/6031) +* [[`cc3645cff3`](https://github.com/nodejs/node/commit/cc3645cff3)] - **tools**: lint for alignment of variable assignments (Rich Trott) [#6869](https://github.com/nodejs/node/pull/6869) + +## 2016-06-22, Version 4.4.6 'Argon' (LTS), @thealphanerd + +### Notable Changes + +This is an important security release. All Node.js users should consult the security release summary at nodejs.org for details on patched vulnerabilities. + +This release is specifically related to a Buffer overflow vulnerability discovered in v8, more details can be found [in the CVE](https://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-1669) + +### Commits + +* [[`134c3b3977`](https://github.com/nodejs/node/commit/134c3b3977)] - **deps**: backport 3a9bfec from v8 upstream (Ben Noordhuis) [nodejs/node-private#38](https://github.com/nodejs/node-private/pull/38) + +## 2016-05-24, Version 4.4.5 'Argon' (LTS), @thealphanerd + +### Notable Changes + +- **buffer**: + - Buffer.indexOf now returns correct values for all UTF-16 input (Anna Henningsen) [#6511](https://github.com/nodejs/node/pull/6511) +- **contextify**: + - Context objects are now properly garbage collected, this solves a problem some individuals were experiencing with extreme memory growth (Ali Ijaz Sheikh) [#6871](https://github.com/nodejs/node/pull/6871) +- **deps**: + - update npm to 2.15.5 (Rebecca Turner) [#6663](https://github.com/nodejs/node/pull/6663) +- **http**: + - Invalid status codes can no longer be sent. Limited to 3 digit numbers between 100 - 999 (Brian White) [#6291](https://github.com/nodejs/node/pull/6291) + +### Commits + +* [[`59a977dd22`](https://github.com/nodejs/node/commit/59a977dd22)] - **assert**: respect assert.doesNotThrow message. (Ilya Shaisultanov) [#2407](https://github.com/nodejs/node/pull/2407) +* [[`8b077faa82`](https://github.com/nodejs/node/commit/8b077faa82)] - **buffer**: fix UCS2 indexOf for odd buffer length (Anna Henningsen) [#6511](https://github.com/nodejs/node/pull/6511) +* [[`12a9699fcf`](https://github.com/nodejs/node/commit/12a9699fcf)] - **buffer**: fix needle length misestimation for UCS2 (Anna Henningsen) [#6511](https://github.com/nodejs/node/pull/6511) +* [[`292b1b733e`](https://github.com/nodejs/node/commit/292b1b733e)] - **build**: fix make tar-headers for Linux (Gibson Fahnestock) [#5978](https://github.com/nodejs/node/pull/5978) +* [[`918d33ad4b`](https://github.com/nodejs/node/commit/918d33ad4b)] - **build**: add script to create Android .mk files (Robert Chiras) [#5544](https://github.com/nodejs/node/pull/5544) +* [[`4ad71847bc`](https://github.com/nodejs/node/commit/4ad71847bc)] - **build**: add suport for x86 architecture (Robert Chiras) [#5544](https://github.com/nodejs/node/pull/5544) +* [[`6ad85914b1`](https://github.com/nodejs/node/commit/6ad85914b1)] - **child_process**: add nullptr checks after allocs (Anna Henningsen) [#6256](https://github.com/nodejs/node/pull/6256) +* [[`823f726f66`](https://github.com/nodejs/node/commit/823f726f66)] - **contextify**: tie lifetimes of context & sandbox (Ali Ijaz Sheikh) [#5800](https://github.com/nodejs/node/pull/5800) +* [[`9ddb44ba61`](https://github.com/nodejs/node/commit/9ddb44ba61)] - **contextify**: cache sandbox and context in locals (Ali Ijaz Sheikh) [#5392](https://github.com/nodejs/node/pull/5392) +* [[`8ebdcd65b0`](https://github.com/nodejs/node/commit/8ebdcd65b0)] - **contextify**: replace deprecated SetWeak usage (Ali Ijaz Sheikh) [#5392](https://github.com/nodejs/node/pull/5392) +* [[`9e6d8170f7`](https://github.com/nodejs/node/commit/9e6d8170f7)] - **contextify**: cleanup weak ref for sandbox (Ali Ijaz Sheikh) [#5392](https://github.com/nodejs/node/pull/5392) +* [[`b6fc15347d`](https://github.com/nodejs/node/commit/b6fc15347d)] - **contextify**: cleanup weak ref for global proxy (Ali Ijaz Sheikh) [#5392](https://github.com/nodejs/node/pull/5392) +* [[`0dc875e2c7`](https://github.com/nodejs/node/commit/0dc875e2c7)] - **deps**: upgrade npm in LTS to 2.15.5 (Rebecca Turner) +* [[`3c50350f41`](https://github.com/nodejs/node/commit/3c50350f41)] - **deps**: fix null pointer checks in v8 (Michaël Zasso) [#6669](https://github.com/nodejs/node/pull/6669) +* [[`a40730b4b4`](https://github.com/nodejs/node/commit/a40730b4b4)] - **deps**: backport IsValid changes from 4e8736d in V8 (Michaël Zasso) [#6669](https://github.com/nodejs/node/pull/6669) +* [[`855604c53a`](https://github.com/nodejs/node/commit/855604c53a)] - **deps**: upgrade npm in LTS to 2.15.4 (Rebecca Turner) [#6663](https://github.com/nodejs/node/pull/6663) +* [[`433fb9a968`](https://github.com/nodejs/node/commit/433fb9a968)] - **deps**: cherry-pick 1383d00 from v8 upstream (Fedor Indutny) [#6179](https://github.com/nodejs/node/pull/6179) +* [[`d1fca27ef8`](https://github.com/nodejs/node/commit/d1fca27ef8)] - **deps**: backport 125ac66 from v8 upstream (Myles Borins) [#6086](https://github.com/nodejs/node/pull/6086) +* [[`df299019a0`](https://github.com/nodejs/node/commit/df299019a0)] - **deps**: upgrade npm in LTS to 2.15.2 (Kat Marchán) +* [[`50f02bd8d6`](https://github.com/nodejs/node/commit/50f02bd8d6)] - **doc**: update vm.runInDebugContext() example (Ben Noordhuis) [#6757](https://github.com/nodejs/node/pull/6757) +* [[`b872feade3`](https://github.com/nodejs/node/commit/b872feade3)] - **doc**: replace functions with arrow functions (abouthiroppy) [#6203](https://github.com/nodejs/node/pull/6203) +* [[`7160229be4`](https://github.com/nodejs/node/commit/7160229be4)] - **doc**: note that zlib.flush acts after pending writes (Anna Henningsen) [#6172](https://github.com/nodejs/node/pull/6172) +* [[`d069f2de8c`](https://github.com/nodejs/node/commit/d069f2de8c)] - **doc**: add full example for zlib.flush() (Anna Henningsen) [#6172](https://github.com/nodejs/node/pull/6172) +* [[`59814acfef`](https://github.com/nodejs/node/commit/59814acfef)] - **doc**: describe child.kill() pitfalls on linux (Robert Jefe Lindstaedt) [#2098](https://github.com/nodejs/node/issues/2098) +* [[`840c09492d`](https://github.com/nodejs/node/commit/840c09492d)] - **doc**: update openssl.org hash links (silverwind) [#6817](https://github.com/nodejs/node/pull/6817) +* [[`126fdc3171`](https://github.com/nodejs/node/commit/126fdc3171)] - **doc**: fix issues related to page scrolling (Roman Reiss) +* [[`29e25d8489`](https://github.com/nodejs/node/commit/29e25d8489)] - **doc**: add steps for running addons + npm tests (Myles Borins) [#6231](https://github.com/nodejs/node/pull/6231) +* [[`fcc6a347f7`](https://github.com/nodejs/node/commit/fcc6a347f7)] - **doc**: get rid of sneaky hard tabs in CHANGELOG (Myles Borins) [#6608](https://github.com/nodejs/node/pull/6608) +* [[`369569018e`](https://github.com/nodejs/node/commit/369569018e)] - **doc**: revert backported commits (Myles Borins) [#6530](https://github.com/nodejs/node/pull/6530) +* [[`4ec9ae8a1c`](https://github.com/nodejs/node/commit/4ec9ae8a1c)] - **doc**: explain differences in console.assert between node and browsers (James M Snell) [#6169](https://github.com/nodejs/node/pull/6169) +* [[`df5ce6fad4`](https://github.com/nodejs/node/commit/df5ce6fad4)] - **doc**: native module reloading is not supported (Bryan English) [#6168](https://github.com/nodejs/node/pull/6168) +* [[`30f354f72b`](https://github.com/nodejs/node/commit/30f354f72b)] - **doc**: clarify fs.watch() and inodes on linux, os x (Joran Dirk Greef) [#6099](https://github.com/nodejs/node/pull/6099) +* [[`29f821b73d`](https://github.com/nodejs/node/commit/29f821b73d)] - **doc**: clarifies http.serverResponse implementation (Allen Hernandez) [#6072](https://github.com/nodejs/node/pull/6072) +* [[`6d560094f4`](https://github.com/nodejs/node/commit/6d560094f4)] - **doc**: minor argument formatting in stream.markdown (James M Snell) [#6016](https://github.com/nodejs/node/pull/6016) +* [[`6a197ec617`](https://github.com/nodejs/node/commit/6a197ec617)] - **doc**: fix http response event, Agent#getName (Matthew Douglass) [#5993](https://github.com/nodejs/node/pull/5993) +* [[`620a261240`](https://github.com/nodejs/node/commit/620a261240)] - **http**: disallow sending obviously invalid status codes (Brian White) [#6291](https://github.com/nodejs/node/pull/6291) +* [[`9a8b53124d`](https://github.com/nodejs/node/commit/9a8b53124d)] - **http**: unref socket timer on parser execute (Fedor Indutny) [#6286](https://github.com/nodejs/node/pull/6286) +* [[`b28e44deb2`](https://github.com/nodejs/node/commit/b28e44deb2)] - **http**: Corrects IPv6 address in Host header (Mihai Potra) [#5314](https://github.com/nodejs/node/pull/5314) +* [[`2fac15ba94`](https://github.com/nodejs/node/commit/2fac15ba94)] - **src**: fix FindFirstCharacter argument alignment (Anna Henningsen) [#6511](https://github.com/nodejs/node/pull/6511) +* [[`2942cff069`](https://github.com/nodejs/node/commit/2942cff069)] - **src**: add missing 'inline' keywords (Ben Noordhuis) [#6056](https://github.com/nodejs/node/pull/6056) +* [[`e0eebf412e`](https://github.com/nodejs/node/commit/e0eebf412e)] - **src,tools**: remove null sentinel from source array (Ben Noordhuis) [#5418](https://github.com/nodejs/node/pull/5418) +* [[`8f18414cd5`](https://github.com/nodejs/node/commit/8f18414cd5)] - **src,tools**: drop nul byte from built-in source code (Ben Noordhuis) [#5418](https://github.com/nodejs/node/pull/5418) +* [[`d7a3ea457b`](https://github.com/nodejs/node/commit/d7a3ea457b)] - **src,tools**: allow utf-8 in built-in js source code (Ben Noordhuis) [#5418](https://github.com/nodejs/node/pull/5418) +* [[`51c0808b55`](https://github.com/nodejs/node/commit/51c0808b55)] - **stream**: Fix readableState.awaitDrain mechanism (Anna Henningsen) [#6023](https://github.com/nodejs/node/pull/6023) +* [[`49a5941d30`](https://github.com/nodejs/node/commit/49a5941d30)] - **test**: fix test-debug-port-cluster flakiness (Rich Trott) [#6769](https://github.com/nodejs/node/pull/6769) +* [[`f8144e4c4a`](https://github.com/nodejs/node/commit/f8144e4c4a)] - **test**: add logging for test-debug-port-cluster (Rich Trott) [#6769](https://github.com/nodejs/node/pull/6769) +* [[`773ea20d0e`](https://github.com/nodejs/node/commit/773ea20d0e)] - **test**: include component in tap output (Ben Noordhuis) [#6653](https://github.com/nodejs/node/pull/6653) +* [[`333369e1ff`](https://github.com/nodejs/node/commit/333369e1ff)] - **test**: increase the platform timeout for AIX (Michael Dawson) [#6342](https://github.com/nodejs/node/pull/6342) +* [[`06e5fafe84`](https://github.com/nodejs/node/commit/06e5fafe84)] - **test**: add tests for console.assert (Evan Lucas) [#6302](https://github.com/nodejs/node/pull/6302) +* [[`f60ba54811`](https://github.com/nodejs/node/commit/f60ba54811)] - **test**: add zlib close-after-error regression test (Anna Henningsen) [#6270](https://github.com/nodejs/node/pull/6270) +* [[`24ac16f4be`](https://github.com/nodejs/node/commit/24ac16f4be)] - **test**: fix flaky test-http-set-timeout-server (Santiago Gimeno) [#6248](https://github.com/nodejs/node/pull/6248) +* [[`5002a71357`](https://github.com/nodejs/node/commit/5002a71357)] - **test**: assert - fixed error messages to match the tests (surya panikkal) [#6241](https://github.com/nodejs/node/pull/6241) +* [[`0f9405dd33`](https://github.com/nodejs/node/commit/0f9405dd33)] - **test**: move more tests from sequential to parallel (Santiago Gimeno) [#6187](https://github.com/nodejs/node/pull/6187) +* [[`37cc249218`](https://github.com/nodejs/node/commit/37cc249218)] - **test**: fix test-net-settimeout flakiness (Santiago Gimeno) [#6166](https://github.com/nodejs/node/pull/6166) +* [[`69dcbb642f`](https://github.com/nodejs/node/commit/69dcbb642f)] - **test**: fix flaky test-child-process-fork-net (Rich Trott) [#6138](https://github.com/nodejs/node/pull/6138) +* [[`a97a6a9d69`](https://github.com/nodejs/node/commit/a97a6a9d69)] - **test**: fix issues for ESLint 2.7.0 (silverwind) [#6132](https://github.com/nodejs/node/pull/6132) +* [[`a865975909`](https://github.com/nodejs/node/commit/a865975909)] - **test**: fix flaky test-http-client-abort (Rich Trott) [#6124](https://github.com/nodejs/node/pull/6124) +* [[`25d4b5b1e9`](https://github.com/nodejs/node/commit/25d4b5b1e9)] - **test**: move some test from sequential to parallel (Santiago Gimeno) [#6087](https://github.com/nodejs/node/pull/6087) +* [[`28040ccf49`](https://github.com/nodejs/node/commit/28040ccf49)] - **test**: refactor test-file-write-stream3 (Rich Trott) [#6050](https://github.com/nodejs/node/pull/6050) +* [[`3a67a05ed4`](https://github.com/nodejs/node/commit/3a67a05ed4)] - **test**: enforce strict mode for test-domain-crypto (Rich Trott) [#6047](https://github.com/nodejs/node/pull/6047) +* [[`0b376cb3f9`](https://github.com/nodejs/node/commit/0b376cb3f9)] - **test**: fix pummel test failures (Rich Trott) [#6012](https://github.com/nodejs/node/pull/6012) +* [[`7b60b8f8e9`](https://github.com/nodejs/node/commit/7b60b8f8e9)] - **test**: fix flakiness of stringbytes-external (Ali Ijaz Sheikh) [#6705](https://github.com/nodejs/node/pull/6705) +* [[`cc4c5187ed`](https://github.com/nodejs/node/commit/cc4c5187ed)] - **test**: ensure test-npm-install uses correct node (Myles Borins) [#6658](https://github.com/nodejs/node/pull/6658) +* [[`3d4d5777bc`](https://github.com/nodejs/node/commit/3d4d5777bc)] - **test**: refactor http-end-throw-socket-handling (Santiago Gimeno) [#5676](https://github.com/nodejs/node/pull/5676) +* [[`c76f214b90`](https://github.com/nodejs/node/commit/c76f214b90)] - **test,tools**: enable linting for undefined vars (Rich Trott) [#6255](https://github.com/nodejs/node/pull/6255) +* [[`9222689215`](https://github.com/nodejs/node/commit/9222689215)] - **test,vm**: enable strict mode for vm tests (Rich Trott) [#6209](https://github.com/nodejs/node/pull/6209) +* [[`b8c9d6b64e`](https://github.com/nodejs/node/commit/b8c9d6b64e)] - **tools**: enable linting for v8_prof_processor.js (Rich Trott) [#6262](https://github.com/nodejs/node/pull/6262) +* [[`8fa202947d`](https://github.com/nodejs/node/commit/8fa202947d)] - **tools**: lint rule for assert.fail() (Rich Trott) [#6261](https://github.com/nodejs/node/pull/6261) +* [[`1aa6c5b7a9`](https://github.com/nodejs/node/commit/1aa6c5b7a9)] - **tools**: update ESLint to 2.7.0 (silverwind) [#6132](https://github.com/nodejs/node/pull/6132) +* [[`68c7de4372`](https://github.com/nodejs/node/commit/68c7de4372)] - **tools**: remove simplejson dependency (Sakthipriyan Vairamani) [#6101](https://github.com/nodejs/node/pull/6101) +* [[`4fb4ba98a8`](https://github.com/nodejs/node/commit/4fb4ba98a8)] - **tools**: remove disabling of already-disabled rule (Rich Trott) [#6013](https://github.com/nodejs/node/pull/6013) +* [[`4e6ea7f01a`](https://github.com/nodejs/node/commit/4e6ea7f01a)] - **tools**: remove obsolete npm test-legacy command (Kat Marchán) +* [[`4c73ab4302`](https://github.com/nodejs/node/commit/4c73ab4302)] - **tools,doc**: fix json for grouped optional params (firedfox) [#5977](https://github.com/nodejs/node/pull/5977) +* [[`c893cd33d1`](https://github.com/nodejs/node/commit/c893cd33d1)] - **tools,doc**: parse types in braces everywhere (Alexander Makarenko) [#5329](https://github.com/nodejs/node/pull/5329) +* [[`48684af55f`](https://github.com/nodejs/node/commit/48684af55f)] - **zlib**: fix use after null when calling .close (James Lal) [#5982](https://github.com/nodejs/node/pull/5982) + +## 2016-05-05, Version 4.4.4 'Argon' (LTS), @thealphanerd + +### Notable changes + +* **deps**: + * update openssl to 1.0.2h. (Shigeki Ohtsu) [#6551](https://github.com/nodejs/node/pull/6551) + - Please see our [blog post](https://nodejs.org/en/blog/vulnerability/openssl-may-2016/) for more info on the security contents of this release. + +### Commits + +* [[`f46952e727`](https://github.com/nodejs/node/commit/f46952e727)] - **buffer**: safeguard against accidental kNoZeroFill (Сковорода Никита Андреевич) [nodejs/node-private#30](https://github.com/nodejs/node-private/pull/30) +* [[`4f1c82f995`](https://github.com/nodejs/node/commit/4f1c82f995)] - **streams**: support unlimited synchronous cork/uncork cycles (Matteo Collina) [#6164](https://github.com/nodejs/node/pull/6164) +* [[`1efd96c767`](https://github.com/nodejs/node/commit/1efd96c767)] - **deps**: update openssl asm and asm_obsolete files (Shigeki Ohtsu) [#6551](https://github.com/nodejs/node/pull/6551) +* [[`c450f4a293`](https://github.com/nodejs/node/commit/c450f4a293)] - **deps**: add -no_rand_screen to openssl s_client (Shigeki Ohtsu) [nodejs/io.js#1836](https://github.com/nodejs/io.js/pull/1836) +* [[`baedfbae6a`](https://github.com/nodejs/node/commit/baedfbae6a)] - **openssl**: fix keypress requirement in apps on win32 (Shigeki Ohtsu) [iojs/io.js#1389](https://github.com/iojs/io.js/pull/1389) +* [[`ff3045e40b`](https://github.com/nodejs/node/commit/ff3045e40b)] - **deps**: fix asm build error of openssl in x86_win32 (Shigeki Ohtsu) [iojs/io.js#1389](https://github.com/iojs/io.js/pull/1389) +* [[`dc8dc97db3`](https://github.com/nodejs/node/commit/dc8dc97db3)] - **deps**: fix openssl assembly error on ia32 win32 (Fedor Indutny) [iojs/io.js#1389](https://github.com/iojs/io.js/pull/1389) +* [[`2dfeb01213`](https://github.com/nodejs/node/commit/2dfeb01213)] - **deps**: copy all openssl header files to include dir (Shigeki Ohtsu) [#6551](https://github.com/nodejs/node/pull/6551) +* [[`72f9952516`](https://github.com/nodejs/node/commit/72f9952516)] - **deps**: upgrade openssl sources to 1.0.2h (Shigeki Ohtsu) [#6551](https://github.com/nodejs/node/pull/6551) + +## 2016-04-12, Version 4.4.3 'Argon' (LTS), @thealphanerd + +### Notable Changes + +* **deps**: + - Fix `--gdbjit` for embedders. Backported from v8 upstream. (Ben Noordhuis) [#5577](https://github.com/nodejs/node/pull/5577) +* **etw**: + - Correctly display descriptors for ETW events 9 and 23 on the windows platform. (João Reis) [#5742](https://github.com/nodejs/node/pull/5742) +* **querystring**: + - Restore throw when attempting to stringify bad surrogate pair. (Brian White) [#5858](https://github.com/nodejs/node/pull/5858) + +### Commits + +* [[`f949c273cd`](https://github.com/nodejs/node/commit/f949c273cd)] - **assert**: Check typed array view type in deepEqual (Anna Henningsen) [#5910](https://github.com/nodejs/node/pull/5910) +* [[`132acea0d4`](https://github.com/nodejs/node/commit/132acea0d4)] - **build**: introduce ci targets for lint/benchmark (Johan Bergström) [#5921](https://github.com/nodejs/node/pull/5921) +* [[`9a8f922dee`](https://github.com/nodejs/node/commit/9a8f922dee)] - **build**: add missing `openssl_fips%` to common.gypi (Fedor Indutny) [#5919](https://github.com/nodejs/node/pull/5919) +* [[`d275cdf202`](https://github.com/nodejs/node/commit/d275cdf202)] - **child_process**: refactor self=this in socket_list (Benjamin Gruenbaum) [#5860](https://github.com/nodejs/node/pull/5860) +* [[`aadf356aa2`](https://github.com/nodejs/node/commit/aadf356aa2)] - **deps**: backport 8d00c2c from v8 upstream (Ben Noordhuis) [#5577](https://github.com/nodejs/node/pull/5577) +* [[`200f763c43`](https://github.com/nodejs/node/commit/200f763c43)] - **deps**: completely upgrade npm in LTS to 2.15.1 (Forrest L Norvell) [#5989](https://github.com/nodejs/node/pull/5989) +* [[`86e3903626`](https://github.com/nodejs/node/commit/86e3903626)] - **dns**: Use object without protoype for map (Benjamin Gruenbaum) [#5843](https://github.com/nodejs/node/pull/5843) +* [[`9a33f43f73`](https://github.com/nodejs/node/commit/9a33f43f73)] - **doc**: update openssl LICENSE using license-builder.sh (Steven R. Loomis) [#6065](https://github.com/nodejs/node/pull/6065) +* [[`9679e2dc70`](https://github.com/nodejs/node/commit/9679e2dc70)] - **doc**: clarify that __dirname is module local (James M Snell) [#6018](https://github.com/nodejs/node/pull/6018) +* [[`86d2af58d6`](https://github.com/nodejs/node/commit/86d2af58d6)] - **doc**: simple doc typo fix (Brendon Pierson) [#6041](https://github.com/nodejs/node/pull/6041) +* [[`f16802f3ca`](https://github.com/nodejs/node/commit/f16802f3ca)] - **doc**: note about Android support (Rich Trott) [#6040](https://github.com/nodejs/node/pull/6040) +* [[`8c2befe176`](https://github.com/nodejs/node/commit/8c2befe176)] - **doc**: note assert.throws() pitfall (Rich Trott) [#6029](https://github.com/nodejs/node/pull/6029) +* [[`0870ac65f2`](https://github.com/nodejs/node/commit/0870ac65f2)] - **doc**: use HTTPS for links where possible (Rich Trott) [#6019](https://github.com/nodejs/node/pull/6019) +* [[`56755de96e`](https://github.com/nodejs/node/commit/56755de96e)] - **doc**: clarify stdout/stderr arguments to callback (James M Snell) [#6015](https://github.com/nodejs/node/pull/6015) +* [[`bb603b89a2`](https://github.com/nodejs/node/commit/bb603b89a2)] - **doc**: add 'Command Line Options' to 'View on single page' (firedfox) [#6011](https://github.com/nodejs/node/pull/6011) +* [[`c91f3d897a`](https://github.com/nodejs/node/commit/c91f3d897a)] - **doc**: add copy about how to curl SHA256.txt (Myles Borins) [#6120](https://github.com/nodejs/node/pull/6120) +* [[`f9cf232284`](https://github.com/nodejs/node/commit/f9cf232284)] - **doc**: add example using algorithms not directly exposed (Brad Hill) [#6108](https://github.com/nodejs/node/pull/6108) +* [[`f60ce1078d`](https://github.com/nodejs/node/commit/f60ce1078d)] - **doc**: document unspecified behavior for buf.write* methods (James M Snell) [#5925](https://github.com/nodejs/node/pull/5925) +* [[`02401a6cbd`](https://github.com/nodejs/node/commit/02401a6cbd)] - **doc**: fix scrolling on iOS devices (Luigi Pinca) [#5878](https://github.com/nodejs/node/pull/5878) +* [[`aed22d0855`](https://github.com/nodejs/node/commit/aed22d0855)] - **doc**: path.format provide more examples (John Eversole) [#5838](https://github.com/nodejs/node/pull/5838) +* [[`6e2bfbe1fd`](https://github.com/nodejs/node/commit/6e2bfbe1fd)] - **doc**: fix doc for Buffer.readInt32LE() (ghaiklor) [#5890](https://github.com/nodejs/node/pull/5890) +* [[`940d204401`](https://github.com/nodejs/node/commit/940d204401)] - **doc**: consolidate timers docs in timers.markdown (Bryan English) [#5837](https://github.com/nodejs/node/pull/5837) +* [[`505faf6360`](https://github.com/nodejs/node/commit/505faf6360)] - **doc**: refine child_process detach behaviour (Robert Jefe Lindstaedt) [#5330](https://github.com/nodejs/node/pull/5330) +* [[`feedca7879`](https://github.com/nodejs/node/commit/feedca7879)] - **doc**: add topic - event loop, timers, `nextTick()` (Jeff Harris) [#4936](https://github.com/nodejs/node/pull/4936) +* [[`6d3822c12b`](https://github.com/nodejs/node/commit/6d3822c12b)] - **etw**: fix descriptors of events 9 and 23 (João Reis) [#5742](https://github.com/nodejs/node/pull/5742) +* [[`56dda6f336`](https://github.com/nodejs/node/commit/56dda6f336)] - **fs**: Remove unused branches (Benjamin Gruenbaum) [#5289](https://github.com/nodejs/node/pull/5289) +* [[`dfe9e157c1`](https://github.com/nodejs/node/commit/dfe9e157c1)] - **governance**: remove target size for CTC (Rich Trott) [#5879](https://github.com/nodejs/node/pull/5879) +* [[`c4103b154f`](https://github.com/nodejs/node/commit/c4103b154f)] - **lib**: refactor code with startsWith/endsWith (Jackson Tian) [#5753](https://github.com/nodejs/node/pull/5753) +* [[`16216a81de`](https://github.com/nodejs/node/commit/16216a81de)] - **meta**: add "joining a wg" section to WORKING_GROUPS.md (Matteo Collina) [#5488](https://github.com/nodejs/node/pull/5488) +* [[`65fc4e36ce`](https://github.com/nodejs/node/commit/65fc4e36ce)] - **querystring**: don't stringify bad surrogate pair (Brian White) [#5858](https://github.com/nodejs/node/pull/5858) +* [[`4f683ab912`](https://github.com/nodejs/node/commit/4f683ab912)] - **src,tools**: use template literals (Rich Trott) [#5778](https://github.com/nodejs/node/pull/5778) +* [[`ac40a4510d`](https://github.com/nodejs/node/commit/ac40a4510d)] - **test**: explicitly set global in test-repl (Rich Trott) [#6026](https://github.com/nodejs/node/pull/6026) +* [[`a7b3a7533a`](https://github.com/nodejs/node/commit/a7b3a7533a)] - **test**: be explicit about polluting of `global` (Rich Trott) [#6017](https://github.com/nodejs/node/pull/6017) +* [[`73e3b7b9a8`](https://github.com/nodejs/node/commit/73e3b7b9a8)] - **test**: make use of globals explicit (Rich Trott) [#6014](https://github.com/nodejs/node/pull/6014) +* [[`e7877e61b6`](https://github.com/nodejs/node/commit/e7877e61b6)] - **test**: fix flaky test-net-socket-timeout-unref (Rich Trott) [#6003](https://github.com/nodejs/node/pull/6003) +* [[`a39051f5b3`](https://github.com/nodejs/node/commit/a39051f5b3)] - **test**: make arch available in status files (Santiago Gimeno) [#5997](https://github.com/nodejs/node/pull/5997) +* [[`ccf90b651a`](https://github.com/nodejs/node/commit/ccf90b651a)] - **test**: fix test-dns.js flakiness (Rich Trott) [#5996](https://github.com/nodejs/node/pull/5996) +* [[`1994ac0912`](https://github.com/nodejs/node/commit/1994ac0912)] - **test**: add test for piping large input from stdin (Anna Henningsen) [#5949](https://github.com/nodejs/node/pull/5949) +* [[`cc1aab9f6a`](https://github.com/nodejs/node/commit/cc1aab9f6a)] - **test**: mitigate flaky test-https-agent (Rich Trott) [#5939](https://github.com/nodejs/node/pull/5939) +* [[`10fe79b809`](https://github.com/nodejs/node/commit/10fe79b809)] - **test**: fix offending max-len linter error (Sakthipriyan Vairamani) [#5980](https://github.com/nodejs/node/pull/5980) +* [[`63d82960fd`](https://github.com/nodejs/node/commit/63d82960fd)] - **test**: stdin is not always a net.Socket (Jeremiah Senkpiel) [#5935](https://github.com/nodejs/node/pull/5935) +* [[`fe0233b923`](https://github.com/nodejs/node/commit/fe0233b923)] - **test**: add known_issues test for GH-2148 (Rich Trott) [#5920](https://github.com/nodejs/node/pull/5920) +* [[`d59be4d248`](https://github.com/nodejs/node/commit/d59be4d248)] - **test**: ensure _handle property existence (Rich Trott) [#5916](https://github.com/nodejs/node/pull/5916) +* [[`9702153107`](https://github.com/nodejs/node/commit/9702153107)] - **test**: fix flaky test-repl (Brian White) [#5914](https://github.com/nodejs/node/pull/5914) +* [[`a0a2e69097`](https://github.com/nodejs/node/commit/a0a2e69097)] - **test**: move dns test to test/internet (Ben Noordhuis) [#5905](https://github.com/nodejs/node/pull/5905) +* [[`8462d8f465`](https://github.com/nodejs/node/commit/8462d8f465)] - **test**: fix flaky test-net-socket-timeout (Brian White) [#5902](https://github.com/nodejs/node/pull/5902) +* [[`e0b283af73`](https://github.com/nodejs/node/commit/e0b283af73)] - **test**: fix flaky test-http-set-timeout (Rich Trott) [#5856](https://github.com/nodejs/node/pull/5856) +* [[`5853fec36f`](https://github.com/nodejs/node/commit/5853fec36f)] - **test**: fix test-debugger-client.js (Rich Trott) [#5851](https://github.com/nodejs/node/pull/5851) +* [[`ea83c382f9`](https://github.com/nodejs/node/commit/ea83c382f9)] - **test**: ensure win32.isAbsolute() is consistent (Brian White) [#6043](https://github.com/nodejs/node/pull/6043) +* [[`c33a23fd1e`](https://github.com/nodejs/node/commit/c33a23fd1e)] - **tools**: fix json doc generation (firedfox) [#5943](https://github.com/nodejs/node/pull/5943) +* [[`6f0bd64122`](https://github.com/nodejs/node/commit/6f0bd64122)] - **tools,doc**: fix incomplete json produced by doctool (firedfox) [#5966](https://github.com/nodejs/node/pull/5966) +* [[`f7eb48302c`](https://github.com/nodejs/node/commit/f7eb48302c)] - **win,build**: build and test add-ons on test-ci (Bogdan Lobor) [#5886](https://github.com/nodejs/node/pull/5886) + +## 2016-03-31, Version 4.4.2 'Argon' (LTS), @thealphanerd + +### Notable Changes + +* **https**: + - Under certain conditions ssl sockets may have been causing a memory leak when keepalive is enabled. This is no longer the case. (Alexander Penev) [#5713](https://github.com/nodejs/node/pull/5713) +* **lib**: + - The way that we were internally passing arguments was causing a potential leak. By copying the arguments into an array we can avoid this. (Nathan Woltman) [#4361](https://github.com/nodejs/node/pull/4361) +* **npm**: + - Upgrade to v2.15.1. Fixes a security flaw in the use of authentication tokens in HTTP requests that would allow an attacker to set up a server that could collect tokens from users of the command-line interface. Authentication tokens have previously been sent with every request made by the CLI for logged-in users, regardless of the destination of the request. This update fixes this by only including those tokens for requests made against the registry or registries used for the current install. (Forrest L Norvell) +* **repl**: + - Previously if you were using the repl in strict mode the column number would be wrong in a stack trace. This is no longer an issue. (Prince J Wesley) [#5416](https://github.com/nodejs/node/pull/5416) + +### Commits + +* [[`96e163a79f`](https://github.com/nodejs/node/commit/96e163a79f)] - **buffer**: changing let in for loops back to var (Gareth Ellis) [#5819](https://github.com/nodejs/node/pull/5819) +* [[`0c6f6742f2`](https://github.com/nodejs/node/commit/0c6f6742f2)] - **console**: check that stderr is writable (Rich Trott) [#5635](https://github.com/nodejs/node/pull/5635) +* [[`55c3f804c4`](https://github.com/nodejs/node/commit/55c3f804c4)] - **deps**: upgrade npm in LTS to 2.15.1 (Forrest L Norvell) +* [[`1d0e4a987d`](https://github.com/nodejs/node/commit/1d0e4a987d)] - **deps**: remove unused openssl files (Ben Noordhuis) [#5619](https://github.com/nodejs/node/pull/5619) +* [[`d55599f4d8`](https://github.com/nodejs/node/commit/d55599f4d8)] - **dns**: use template literals (Benjamin Gruenbaum) [#5809](https://github.com/nodejs/node/pull/5809) +* [[`42bbdc9dd1`](https://github.com/nodejs/node/commit/42bbdc9dd1)] - **doc** Add @mhdawson back to the CTC (James M Snell) [#5633](https://github.com/nodejs/node/pull/5633) +* [[`8d86d232e7`](https://github.com/nodejs/node/commit/8d86d232e7)] - **doc**: typo: interal->internal. (Corey Kosak) [#5849](https://github.com/nodejs/node/pull/5849) +* [[`60ddab841e`](https://github.com/nodejs/node/commit/60ddab841e)] - **doc**: add instructions to only sign a release (Jeremiah Senkpiel) [#5876](https://github.com/nodejs/node/pull/5876) +* [[`040263e0f3`](https://github.com/nodejs/node/commit/040263e0f3)] - **doc**: grammar, clarity and links in timers doc (Bryan English) [#5792](https://github.com/nodejs/node/pull/5792) +* [[`8c24bd25a6`](https://github.com/nodejs/node/commit/8c24bd25a6)] - **doc**: fix order of end tags of list after heading (firedfox) [#5874](https://github.com/nodejs/node/pull/5874) +* [[`7c837028da`](https://github.com/nodejs/node/commit/7c837028da)] - **doc**: use consistent event name parameter (Benjamin Gruenbaum) [#5850](https://github.com/nodejs/node/pull/5850) +* [[`20faf9097d`](https://github.com/nodejs/node/commit/20faf9097d)] - **doc**: explain error message on missing main file (Wolfgang Steiner) [#5812](https://github.com/nodejs/node/pull/5812) +* [[`79d26ae196`](https://github.com/nodejs/node/commit/79d26ae196)] - **doc**: explain path.format expected properties (John Eversole) [#5801](https://github.com/nodejs/node/pull/5801) +* [[`e43e8e3a31`](https://github.com/nodejs/node/commit/e43e8e3a31)] - **doc**: add a cli options doc page (Jeremiah Senkpiel) [#5787](https://github.com/nodejs/node/pull/5787) +* [[`c0a24e4a1d`](https://github.com/nodejs/node/commit/c0a24e4a1d)] - **doc**: fix multiline return comments in querystring (Claudio Rodriguez) [#5705](https://github.com/nodejs/node/pull/5705) +* [[`bf1fe4693c`](https://github.com/nodejs/node/commit/bf1fe4693c)] - **doc**: Add windows example for Path.format (Mithun Patel) [#5700](https://github.com/nodejs/node/pull/5700) +* [[`3b8fc4fddc`](https://github.com/nodejs/node/commit/3b8fc4fddc)] - **doc**: update crypto docs to use good defaults (Bill Automata) [#5505](https://github.com/nodejs/node/pull/5505) +* [[`a6ec8a6cb7`](https://github.com/nodejs/node/commit/a6ec8a6cb7)] - **doc**: fix crypto update() signatures (Brian White) [#5500](https://github.com/nodejs/node/pull/5500) +* [[`eb0ed46665`](https://github.com/nodejs/node/commit/eb0ed46665)] - **doc**: reformat & improve node.1 manual page (Jeremiah Senkpiel) [#5497](https://github.com/nodejs/node/pull/5497) +* [[`b70ca4a4b4`](https://github.com/nodejs/node/commit/b70ca4a4b4)] - **doc**: updated fs #5862 removed irrelevant data in fs.markdown (topal) [#5877](https://github.com/nodejs/node/pull/5877) +* [[`81876612f7`](https://github.com/nodejs/node/commit/81876612f7)] - **https**: fix ssl socket leak when keepalive is used (Alexander Penev) [#5713](https://github.com/nodejs/node/pull/5713) +* [[`6daebdbd9b`](https://github.com/nodejs/node/commit/6daebdbd9b)] - **lib**: simplify code with String.prototype.repeat() (Jackson Tian) [#5359](https://github.com/nodejs/node/pull/5359) +* [[`108fc90dd7`](https://github.com/nodejs/node/commit/108fc90dd7)] - **lib**: reduce usage of `self = this` (Jackson Tian) [#5231](https://github.com/nodejs/node/pull/5231) +* [[`3c8e59c396`](https://github.com/nodejs/node/commit/3c8e59c396)] - **lib**: copy arguments object instead of leaking it (Nathan Woltman) [#4361](https://github.com/nodejs/node/pull/4361) +* [[`8648420586`](https://github.com/nodejs/node/commit/8648420586)] - **net**: make `isIPv4` and `isIPv6` more efficient (Vladimir Kurchatkin) [#5478](https://github.com/nodejs/node/pull/5478) +* [[`07b7172d76`](https://github.com/nodejs/node/commit/07b7172d76)] - **net**: remove unused `var self = this` from old code (Benjamin Gruenbaum) [#5224](https://github.com/nodejs/node/pull/5224) +* [[`acbce4b72b`](https://github.com/nodejs/node/commit/acbce4b72b)] - **repl**: fix stack trace column number in strict mode (Prince J Wesley) [#5416](https://github.com/nodejs/node/pull/5416) +* [[`0a1eb168e0`](https://github.com/nodejs/node/commit/0a1eb168e0)] - **test**: fix `test-cluster-worker-kill` (Santiago Gimeno) [#5814](https://github.com/nodejs/node/pull/5814) +* [[`86b876fe7b`](https://github.com/nodejs/node/commit/86b876fe7b)] - **test**: smaller chunk size for smaller person.jpg (Jérémy Lal) [#5813](https://github.com/nodejs/node/pull/5813) +* [[`1135ee97e7`](https://github.com/nodejs/node/commit/1135ee97e7)] - **test**: strip non-free icc profile from person.jpg (Jérémy Lal) [#5813](https://github.com/nodejs/node/pull/5813) +* [[`0836d7e2fb`](https://github.com/nodejs/node/commit/0836d7e2fb)] - **test**: fix flaky test-cluster-shared-leak (Claudio Rodriguez) [#5802](https://github.com/nodejs/node/pull/5802) +* [[`e57355c2f4`](https://github.com/nodejs/node/commit/e57355c2f4)] - **test**: make test-net-connect-options-ipv6.js better (Michael Dawson) [#5791](https://github.com/nodejs/node/pull/5791) +* [[`1b266fc15c`](https://github.com/nodejs/node/commit/1b266fc15c)] - **test**: remove the use of curl in the test suite (Santiago Gimeno) [#5750](https://github.com/nodejs/node/pull/5750) +* [[`7e45d4f076`](https://github.com/nodejs/node/commit/7e45d4f076)] - **test**: minimize test-http-get-pipeline-problem (Rich Trott) [#5728](https://github.com/nodejs/node/pull/5728) +* [[`78effc3484`](https://github.com/nodejs/node/commit/78effc3484)] - **test**: add batch of known issue tests (cjihrig) [#5653](https://github.com/nodejs/node/pull/5653) +* [[`d506eea4b7`](https://github.com/nodejs/node/commit/d506eea4b7)] - **test**: improve test-npm-install (Santiago Gimeno) [#5613](https://github.com/nodejs/node/pull/5613) +* [[`7520100e8b`](https://github.com/nodejs/node/commit/7520100e8b)] - **test**: add test-npm-install to parallel tests suite (Myles Borins) [#5166](https://github.com/nodejs/node/pull/5166) +* [[`b258dddb8c`](https://github.com/nodejs/node/commit/b258dddb8c)] - **test**: repl tab completion test (Santiago Gimeno) [#5534](https://github.com/nodejs/node/pull/5534) +* [[`f209effe8b`](https://github.com/nodejs/node/commit/f209effe8b)] - **test**: remove timer from test-http-1.0 (Santiago Gimeno) [#5129](https://github.com/nodejs/node/pull/5129) +* [[`3a901b0e3e`](https://github.com/nodejs/node/commit/3a901b0e3e)] - **tools**: remove unused imports (Sakthipriyan Vairamani) [#5765](https://github.com/nodejs/node/pull/5765) + +## 2016-03-22, Version 4.4.1 'Argon' (LTS), @thealphanerd + +This LTS release comes with 113 commits, 56 of which are doc related, +18 of which are build / tooling related, 16 of which are test related +and 7 which are benchmark related. + +### Notable Changes +* **build**: + - Updated Logos for the OSX + Windows installers + - (Rod Vagg) [#5401](https://github.com/nodejs/node/pull/5401) + - (Robert Jefe Lindstaedt) [#5531](https://github.com/nodejs/node/pull/5531) + - New option to select your VS Version in the Windows installer + - (julien.waechter) [#4645](https://github.com/nodejs/node/pull/4645) + - Support Visual C++ Build Tools 2015 + - (João Reis) [#5627](https://github.com/nodejs/node/pull/5627) +* **tools**: + - Gyp now works on OSX without XCode + - (Shigeki Ohtsu) [nodejs/node#1325](https://github.com/nodejs/node/pull/1325) + +### Commits + +* [[`df283f8a03`](https://github.com/nodejs/node/commit/df283f8a03)] - **benchmark**: fix linting issues (Rich Trott) [#5773](https://github.com/nodejs/node/pull/5773) +* [[`c901741c60`](https://github.com/nodejs/node/commit/c901741c60)] - **benchmark**: use strict mode (Rich Trott) [#5773](https://github.com/nodejs/node/pull/5773) +* [[`4be2065dbc`](https://github.com/nodejs/node/commit/4be2065dbc)] - **benchmark**: refactor to eliminate redeclared vars (Rich Trott) [#5773](https://github.com/nodejs/node/pull/5773) +* [[`ddac368533`](https://github.com/nodejs/node/commit/ddac368533)] - **benchmark**: fix lint errors (Rich Trott) [#5773](https://github.com/nodejs/node/pull/5773) +* [[`03b20a73b9`](https://github.com/nodejs/node/commit/03b20a73b9)] - **benchmark**: add benchmark for buf.compare() (Rich Trott) [#5441](https://github.com/nodejs/node/pull/5441) +* [[`b816044845`](https://github.com/nodejs/node/commit/b816044845)] - **buffer**: remove duplicated code in fromObject (HUANG Wei) [#4948](https://github.com/nodejs/node/pull/4948) +* [[`067ce9b905`](https://github.com/nodejs/node/commit/067ce9b905)] - **build**: don't install github templates (Johan Bergström) [#5612](https://github.com/nodejs/node/pull/5612) +* [[`a1772dc515`](https://github.com/nodejs/node/commit/a1772dc515)] - **build**: update Node.js logo on OSX installer (Rod Vagg) [#5401](https://github.com/nodejs/node/pull/5401) +* [[`9058fc0383`](https://github.com/nodejs/node/commit/9058fc0383)] - **build**: correctly detect clang version (Stefan Budeanu) [#5553](https://github.com/nodejs/node/pull/5553) +* [[`1165ecc6f7`](https://github.com/nodejs/node/commit/1165ecc6f7)] - **build**: update Node.js logo on Win installer (Robert Jefe Lindstaedt) [#5531](https://github.com/nodejs/node/pull/5531) +* [[`4990ddad72`](https://github.com/nodejs/node/commit/4990ddad72)] - **build**: remove --quiet from eslint invocation (firedfox) [#5519](https://github.com/nodejs/node/pull/5519) +* [[`46a5d519dd`](https://github.com/nodejs/node/commit/46a5d519dd)] - **build**: skip msi build if WiX is not found (Tsarevich Dmitry) [#5220](https://github.com/nodejs/node/pull/5220) +* [[`dac4e64491`](https://github.com/nodejs/node/commit/dac4e64491)] - **build**: add option to select VS version (julien.waechter) [#4645](https://github.com/nodejs/node/pull/4645) +* [[`7a10fd3a56`](https://github.com/nodejs/node/commit/7a10fd3a56)] - **collaborator_guide**: clarify commit message rules (Wyatt Preul) [#5661](https://github.com/nodejs/node/pull/5661) +* [[`97e95d04c2`](https://github.com/nodejs/node/commit/97e95d04c2)] - **crypto**: PBKDF2 works with `int` not `ssize_t` (Fedor Indutny) [#5397](https://github.com/nodejs/node/pull/5397) +* [[`57b02e6a3e`](https://github.com/nodejs/node/commit/57b02e6a3e)] - **debugger**: remove unneeded callback check (Rich Trott) [#5319](https://github.com/nodejs/node/pull/5319) +* [[`19ae308867`](https://github.com/nodejs/node/commit/19ae308867)] - **deps**: update openssl config (Shigeki Ohtsu) [#5630](https://github.com/nodejs/node/pull/5630) +* [[`d7b81b5bc7`](https://github.com/nodejs/node/commit/d7b81b5bc7)] - **deps**: cherry-pick 2e4da65 from v8's 4.8 upstream (Michael Dawson) [#5293](https://github.com/nodejs/node/pull/5293) +* [[`1e05f371d6`](https://github.com/nodejs/node/commit/1e05f371d6)] - **doc**: fix typo in synchronous randomBytes example (Andrea Giammarchi) [#5781](https://github.com/nodejs/node/pull/5781) +* [[`5f54bd2088`](https://github.com/nodejs/node/commit/5f54bd2088)] - **doc**: topic blocking vs non-blocking (Jarrett Widman) [#5326](https://github.com/nodejs/node/pull/5326) +* [[`0943001563`](https://github.com/nodejs/node/commit/0943001563)] - **doc**: fix invalid path doc comments (Rich Trott) [#5797](https://github.com/nodejs/node/pull/5797) +* [[`bb423bb1e6`](https://github.com/nodejs/node/commit/bb423bb1e6)] - **doc**: update release tweet template (Jeremiah Senkpiel) [#5628](https://github.com/nodejs/node/pull/5628) +* [[`1e877f10aa`](https://github.com/nodejs/node/commit/1e877f10aa)] - **doc**: fix typo in child_process docs (Benjamin Gruenbaum) [#5681](https://github.com/nodejs/node/pull/5681) +* [[`d53dcc599b`](https://github.com/nodejs/node/commit/d53dcc599b)] - **doc**: update fansworld-claudio username on README (Claudio Rodriguez) [#5680](https://github.com/nodejs/node/pull/5680) +* [[`4332f8011e`](https://github.com/nodejs/node/commit/4332f8011e)] - **doc**: fix return value of write methods (Felix Böhm) [#5736](https://github.com/nodejs/node/pull/5736) +* [[`e572542de5`](https://github.com/nodejs/node/commit/e572542de5)] - **doc**: Add note about use of JSON.stringify() (Mithun Patel) [#5723](https://github.com/nodejs/node/pull/5723) +* [[`daf3ef66ef`](https://github.com/nodejs/node/commit/daf3ef66ef)] - **doc**: explain path.format() algorithm (Rich Trott) [#5688](https://github.com/nodejs/node/pull/5688) +* [[`f6d4982aa0`](https://github.com/nodejs/node/commit/f6d4982aa0)] - **doc**: clarify type of first argument in zlib (Kirill Fomichev) [#5685](https://github.com/nodejs/node/pull/5685) +* [[`07e71b2d44`](https://github.com/nodejs/node/commit/07e71b2d44)] - **doc**: fix typo in api/addons (Daijiro Wachi) [#5678](https://github.com/nodejs/node/pull/5678) +* [[`c6dc56175b`](https://github.com/nodejs/node/commit/c6dc56175b)] - **doc**: remove non-standard use of hyphens (Stefano Vozza) +* [[`4c92316972`](https://github.com/nodejs/node/commit/4c92316972)] - **doc**: add fansworld-claudio to collaborators (Claudio Rodriguez) [#5668](https://github.com/nodejs/node/pull/5668) +* [[`0a6e883f85`](https://github.com/nodejs/node/commit/0a6e883f85)] - **doc**: add thekemkid to collaborators (Glen Keane) [#5667](https://github.com/nodejs/node/pull/5667) +* [[`39c7d8a972`](https://github.com/nodejs/node/commit/39c7d8a972)] - **doc**: add AndreasMadsen to collaborators (Andreas Madsen) [#5666](https://github.com/nodejs/node/pull/5666) +* [[`eec3008970`](https://github.com/nodejs/node/commit/eec3008970)] - **doc**: add whitlockjc to collaborators (Jeremy Whitlock) [#5665](https://github.com/nodejs/node/pull/5665) +* [[`e5f254d83c`](https://github.com/nodejs/node/commit/e5f254d83c)] - **doc**: add benjamingr to collaborator list (Benjamin Gruenbaum) [#5664](https://github.com/nodejs/node/pull/5664) +* [[`3f718643c9`](https://github.com/nodejs/node/commit/3f718643c9)] - **doc**: add phillipj to collaborators (Phillip Johnsen) [#5663](https://github.com/nodejs/node/pull/5663) +* [[`2d5527fe69`](https://github.com/nodejs/node/commit/2d5527fe69)] - **doc**: add mattloring to collaborators (Matt Loring) [#5662](https://github.com/nodejs/node/pull/5662) +* [[`51763462bc`](https://github.com/nodejs/node/commit/51763462bc)] - **doc**: include typo in 'unhandledRejection' example (Robert C Jensen) [#5654](https://github.com/nodejs/node/pull/5654) +* [[`cae5da2f0a`](https://github.com/nodejs/node/commit/cae5da2f0a)] - **doc**: fix markdown links (Steve Mao) [#5641](https://github.com/nodejs/node/pull/5641) +* [[`b1b17efcb7`](https://github.com/nodejs/node/commit/b1b17efcb7)] - **doc**: move build instructions to a new document (Johan Bergström) [#5634](https://github.com/nodejs/node/pull/5634) +* [[`13a8bde1fa`](https://github.com/nodejs/node/commit/13a8bde1fa)] - **doc**: fix dns.resolveCname description typo (axvm) [#5622](https://github.com/nodejs/node/pull/5622) +* [[`1faea43c40`](https://github.com/nodejs/node/commit/1faea43c40)] - **doc**: fix typo in fs.symlink (Michaël Zasso) [#5560](https://github.com/nodejs/node/pull/5560) +* [[`98a1bb6989`](https://github.com/nodejs/node/commit/98a1bb6989)] - **doc**: document directories in test directory (Michael Barrett) [#5557](https://github.com/nodejs/node/pull/5557) +* [[`04d3f8a741`](https://github.com/nodejs/node/commit/04d3f8a741)] - **doc**: update link green to match homepage (silverwind) [#5548](https://github.com/nodejs/node/pull/5548) +* [[`1afab6ac9c`](https://github.com/nodejs/node/commit/1afab6ac9c)] - **doc**: add clarification on birthtime in fs stat (Kári Tristan Helgason) [#5479](https://github.com/nodejs/node/pull/5479) +* [[`d871ae2349`](https://github.com/nodejs/node/commit/d871ae2349)] - **doc**: fix typo in child_process documentation (Evan Lucas) [#5474](https://github.com/nodejs/node/pull/5474) +* [[`97a18bdbad`](https://github.com/nodejs/node/commit/97a18bdbad)] - **doc**: update NAN urls in ROADMAP.md and doc/releases.md (ronkorving) [#5472](https://github.com/nodejs/node/pull/5472) +* [[`d4a1fc7acd`](https://github.com/nodejs/node/commit/d4a1fc7acd)] - **doc**: add Testing WG (Rich Trott) [#5461](https://github.com/nodejs/node/pull/5461) +* [[`1642078580`](https://github.com/nodejs/node/commit/1642078580)] - **doc**: fix crypto function indentation level (Brian White) [#5460](https://github.com/nodejs/node/pull/5460) +* [[`2b0c7ad985`](https://github.com/nodejs/node/commit/2b0c7ad985)] - **doc**: fix links in tls, cluster docs (Alexander Makarenko) [#5364](https://github.com/nodejs/node/pull/5364) +* [[`901dbabea6`](https://github.com/nodejs/node/commit/901dbabea6)] - **doc**: fix relative links in net docs (Evan Lucas) [#5358](https://github.com/nodejs/node/pull/5358) +* [[`38d429172d`](https://github.com/nodejs/node/commit/38d429172d)] - **doc**: fix typo in pbkdf2Sync code sample (Marc Cuva) [#5306](https://github.com/nodejs/node/pull/5306) +* [[`d4cfc6f97c`](https://github.com/nodejs/node/commit/d4cfc6f97c)] - **doc**: add missing property in cluster example (Rafael Cepeda) [#5305](https://github.com/nodejs/node/pull/5305) +* [[`b66d6b1458`](https://github.com/nodejs/node/commit/b66d6b1458)] - **doc**: improve httpVersionMajor / httpVersionMajor (Jackson Tian) [#5296](https://github.com/nodejs/node/pull/5296) +* [[`70c872c9c4`](https://github.com/nodejs/node/commit/70c872c9c4)] - **doc**: improve unhandledException doc copy (James M Snell) [#5287](https://github.com/nodejs/node/pull/5287) +* [[`ba5e0b6110`](https://github.com/nodejs/node/commit/ba5e0b6110)] - **doc**: fix buf.readInt16LE output (Chinedu Francis Nwafili) [#5282](https://github.com/nodejs/node/pull/5282) +* [[`1624d5b049`](https://github.com/nodejs/node/commit/1624d5b049)] - **doc**: document base64url encoding support (Tristan Slominski) [#5243](https://github.com/nodejs/node/pull/5243) +* [[`b1d580c9d2`](https://github.com/nodejs/node/commit/b1d580c9d2)] - **doc**: update removeListener behaviour (Vaibhav) [#5201](https://github.com/nodejs/node/pull/5201) +* [[`ca17f91ba8`](https://github.com/nodejs/node/commit/ca17f91ba8)] - **doc**: add note for binary safe string reading (Anton Andesen) [#5155](https://github.com/nodejs/node/pull/5155) +* [[`0830bb4950`](https://github.com/nodejs/node/commit/0830bb4950)] - **doc**: clarify when writable.write callback is called (Kevin Locke) [#4810](https://github.com/nodejs/node/pull/4810) +* [[`17a74305c8`](https://github.com/nodejs/node/commit/17a74305c8)] - **doc**: add info to docs on how to submit docs patch (Sequoia McDowell) [#4591](https://github.com/nodejs/node/pull/4591) +* [[`470a9ca909`](https://github.com/nodejs/node/commit/470a9ca909)] - **doc**: add onboarding resources (Jeremiah Senkpiel) [#3726](https://github.com/nodejs/node/pull/3726) +* [[`3168e6b486`](https://github.com/nodejs/node/commit/3168e6b486)] - **doc**: update V8 URL (Craig Akimoto) [#5530](https://github.com/nodejs/node/pull/5530) +* [[`04d16eb7e8`](https://github.com/nodejs/node/commit/04d16eb7e8)] - **doc**: document fs.datasync(Sync) (Ron Korving) [#5402](https://github.com/nodejs/node/pull/5402) +* [[`29646200f8`](https://github.com/nodejs/node/commit/29646200f8)] - **doc**: add Evan Lucas to the CTC (Rod Vagg) +* [[`a2a32b7810`](https://github.com/nodejs/node/commit/a2a32b7810)] - **doc**: add Rich Trott to the CTC (Rod Vagg) [#5276](https://github.com/nodejs/node/pull/5276) +* [[`4e469d5e47`](https://github.com/nodejs/node/commit/4e469d5e47)] - **doc**: add Ali Ijaz Sheikh to the CTC (Rod Vagg) [#5277](https://github.com/nodejs/node/pull/5277) +* [[`d09b44f59b`](https://github.com/nodejs/node/commit/d09b44f59b)] - **doc**: add Сковорода Никита Андреевич to the CTC (Rod Vagg) [#5278](https://github.com/nodejs/node/pull/5278) +* [[`ebbc64bc97`](https://github.com/nodejs/node/commit/ebbc64bc97)] - **doc**: add "building node with ninja" guide (Jeremiah Senkpiel) [#4767](https://github.com/nodejs/node/pull/4767) +* [[`67245fa0e3`](https://github.com/nodejs/node/commit/67245fa0e3)] - **doc**: clarify code of conduct reporting (Julie Pagano) [#5107](https://github.com/nodejs/node/pull/5107) +* [[`cd78ff9706`](https://github.com/nodejs/node/commit/cd78ff9706)] - **doc**: fix links in Addons docs (Alexander Makarenko) [#5072](https://github.com/nodejs/node/pull/5072) +* [[`20539954ff`](https://github.com/nodejs/node/commit/20539954ff)] - **docs**: fix man pages link if tok type is code (Mithun Patel) [#5721](https://github.com/nodejs/node/pull/5721) +* [[`38d7b0b6ea`](https://github.com/nodejs/node/commit/38d7b0b6ea)] - **docs**: update link to iojs+release ci job (Myles Borins) [#5632](https://github.com/nodejs/node/pull/5632) +* [[`f982632f90`](https://github.com/nodejs/node/commit/f982632f90)] - **http**: remove old, confusing comment (Brian White) [#5233](https://github.com/nodejs/node/pull/5233) +* [[`ca5d7a8bb6`](https://github.com/nodejs/node/commit/ca5d7a8bb6)] - **http**: remove unnecessary check (Brian White) [#5233](https://github.com/nodejs/node/pull/5233) +* [[`2ce83bd8f9`](https://github.com/nodejs/node/commit/2ce83bd8f9)] - **http,util**: fix typos in comments (Alexander Makarenko) [#5279](https://github.com/nodejs/node/pull/5279) +* [[`b690916e5a`](https://github.com/nodejs/node/commit/b690916e5a)] - **lib**: freelist: use .pop() for allocation (Anton Khlynovskiy) [#2174](https://github.com/nodejs/node/pull/2174) +* [[`e7f45f0a17`](https://github.com/nodejs/node/commit/e7f45f0a17)] - **repl**: handle quotes within regexp literal (Prince J Wesley) [#5117](https://github.com/nodejs/node/pull/5117) +* [[`7c3b844f78`](https://github.com/nodejs/node/commit/7c3b844f78)] - **src**: return UV_EAI_NODATA on empty lookup (cjihrig) [#4715](https://github.com/nodejs/node/pull/4715) +* [[`242a65e930`](https://github.com/nodejs/node/commit/242a65e930)] - **stream**: prevent object map change in TransformState (Evan Lucas) [#5032](https://github.com/nodejs/node/pull/5032) +* [[`fb5ba6b928`](https://github.com/nodejs/node/commit/fb5ba6b928)] - **stream**: prevent object map change in ReadableState (Evan Lucas) [#4761](https://github.com/nodejs/node/pull/4761) +* [[`04db9efd78`](https://github.com/nodejs/node/commit/04db9efd78)] - **stream**: fix no data on partial decode (Brian White) [#5226](https://github.com/nodejs/node/pull/5226) +* [[`cc0e36ff98`](https://github.com/nodejs/node/commit/cc0e36ff98)] - **string_decoder**: fix performance regression (Brian White) [#5134](https://github.com/nodejs/node/pull/5134) +* [[`666d3690d8`](https://github.com/nodejs/node/commit/666d3690d8)] - **test**: eval a strict function (Kári Tristan Helgason) [#5250](https://github.com/nodejs/node/pull/5250) +* [[`9952bcf203`](https://github.com/nodejs/node/commit/9952bcf203)] - **test**: bug repro for vm function redefinition (cjihrig) [#5528](https://github.com/nodejs/node/pull/5528) +* [[`063f22f1f0`](https://github.com/nodejs/node/commit/063f22f1f0)] - **test**: check memoryUsage properties The properties on memoryUsage were not checked before, this commit checks them. (Wyatt Preul) [#5546](https://github.com/nodejs/node/pull/5546) +* [[`7a0fcfc127`](https://github.com/nodejs/node/commit/7a0fcfc127)] - **test**: remove broken debugger scenarios (Rich Trott) [#5532](https://github.com/nodejs/node/pull/5532) +* [[`ba9ad2662c`](https://github.com/nodejs/node/commit/ba9ad2662c)] - **test**: apply Linux workaround to Linux only (Rich Trott) [#5471](https://github.com/nodejs/node/pull/5471) +* [[`4aa2c03d31`](https://github.com/nodejs/node/commit/4aa2c03d31)] - **test**: increase timeout for test-tls-fast-writing (Rich Trott) [#5466](https://github.com/nodejs/node/pull/5466) +* [[`b4ef644ce4`](https://github.com/nodejs/node/commit/b4ef644ce4)] - **test**: retry on known SmartOS bug (Rich Trott) [#5454](https://github.com/nodejs/node/pull/5454) +* [[`d681bf24b5`](https://github.com/nodejs/node/commit/d681bf24b5)] - **test**: fix flaky child-process-fork-regr-gh-2847 (Santiago Gimeno) [#5422](https://github.com/nodejs/node/pull/5422) +* [[`b4fbe04514`](https://github.com/nodejs/node/commit/b4fbe04514)] - **test**: fix test-timers.reliability on OS X (Rich Trott) [#5379](https://github.com/nodejs/node/pull/5379) +* [[`99269ffdbf`](https://github.com/nodejs/node/commit/99269ffdbf)] - **test**: increase timeouts on some unref timers tests (Jeremiah Senkpiel) [#5352](https://github.com/nodejs/node/pull/5352) +* [[`85f927a774`](https://github.com/nodejs/node/commit/85f927a774)] - **test**: prevent flakey test on pi2 (Trevor Norris) [#5537](https://github.com/nodejs/node/pull/5537) +* [[`c86902d800`](https://github.com/nodejs/node/commit/c86902d800)] - **test**: mitigate flaky test-http-agent (Rich Trott) [#5346](https://github.com/nodejs/node/pull/5346) +* [[`f242e62817`](https://github.com/nodejs/node/commit/f242e62817)] - **test**: remove flaky designation from fixed tests (Rich Trott) [#5459](https://github.com/nodejs/node/pull/5459) +* [[`a39aacf035`](https://github.com/nodejs/node/commit/a39aacf035)] - **test**: refactor test-dgram-udp4 (Santiago Gimeno) [#5339](https://github.com/nodejs/node/pull/5339) +* [[`6386f62221`](https://github.com/nodejs/node/commit/6386f62221)] - **test**: remove unneeded bind() and related comments (Aayush Naik) [#5023](https://github.com/nodejs/node/pull/5023) +* [[`068b0cbd12`](https://github.com/nodejs/node/commit/068b0cbd12)] - **test**: move cluster tests to parallel (Rich Trott) [#4774](https://github.com/nodejs/node/pull/4774) +* [[`a673c9ae2d`](https://github.com/nodejs/node/commit/a673c9ae2d)] - **tls**: fix assert in context._external accessor (Ben Noordhuis) [#5521](https://github.com/nodejs/node/pull/5521) +* [[`8ffef48fee`](https://github.com/nodejs/node/commit/8ffef48fee)] - **tools**: fix gyp to work on MacOSX without XCode (Shigeki Ohtsu) [nodejs/node#1325](https://github.com/nodejs/node/pull/1325) +* [[`4b6a8f4321`](https://github.com/nodejs/node/commit/4b6a8f4321)] - **tools**: update gyp to b3cef02 (Imran Iqbal) [#3487](https://github.com/nodejs/node/pull/3487) +* [[`7501ddc878`](https://github.com/nodejs/node/commit/7501ddc878)] - **tools**: support testing known issues (cjihrig) [#5528](https://github.com/nodejs/node/pull/5528) +* [[`10ec1d2a6b`](https://github.com/nodejs/node/commit/10ec1d2a6b)] - **tools**: enable linting for benchmarks (Rich Trott) [#5773](https://github.com/nodejs/node/pull/5773) +* [[`deec8bc5f5`](https://github.com/nodejs/node/commit/deec8bc5f5)] - **tools**: reduce verbosity of cpplint (Sakthipriyan Vairamani) [#5578](https://github.com/nodejs/node/pull/5578) +* [[`64d5752711`](https://github.com/nodejs/node/commit/64d5752711)] - **tools**: enable no-self-assign ESLint rule (Rich Trott) [#5552](https://github.com/nodejs/node/pull/5552) +* [[`131ed494e2`](https://github.com/nodejs/node/commit/131ed494e2)] - **tools**: enable no-extra-parens in ESLint (Rich Trott) [#5512](https://github.com/nodejs/node/pull/5512) +* [[`d4b9f02fdc`](https://github.com/nodejs/node/commit/d4b9f02fdc)] - **tools**: apply custom buffer lint rule to /lib only (Rich Trott) [#5371](https://github.com/nodejs/node/pull/5371) +* [[`6867bed4c4`](https://github.com/nodejs/node/commit/6867bed4c4)] - **tools**: enable additional lint rules (Rich Trott) [#5357](https://github.com/nodejs/node/pull/5357) +* [[`5e6b7605ee`](https://github.com/nodejs/node/commit/5e6b7605ee)] - **tools**: add Node.js-specific ESLint rules (Rich Trott) [#5320](https://github.com/nodejs/node/pull/5320) +* [[`6dc49ae203`](https://github.com/nodejs/node/commit/6dc49ae203)] - **tools,benchmark**: increase lint compliance (Rich Trott) [#5773](https://github.com/nodejs/node/pull/5773) +* [[`dff7091fce`](https://github.com/nodejs/node/commit/dff7091fce)] - **url**: group slashed protocols by protocol name (nettofarah) [#5380](https://github.com/nodejs/node/pull/5380) +* [[`0e97a3ea51`](https://github.com/nodejs/node/commit/0e97a3ea51)] - **win,build**: support Visual C++ Build Tools 2015 (João Reis) [#5627](https://github.com/nodejs/node/pull/5627) + +## 2016-03-08, Version 4.4.0 'Argon' (LTS), @thealphanerd + +In December we announced that we would be doing a minor release in order to +get a number of voted on SEMVER-MINOR changes into LTS. Our ability to release this +was delayed due to the unforeseen security release v4.3. We are quickly bumping to +v4.4 in order to bring you the features that we had committed to releasing. + +This release also includes over 70 fixes to our docs and over 50 fixes to tests. + +### Notable changes + +The SEMVER-MINOR changes include: + * **deps**: + - An update to v8 that introduces a new flag --perf_basic_prof_only_functions (Ali Ijaz Sheikh) [#3609](https://github.com/nodejs/node/pull/3609) + * **http**: + - A new feature in http(s) agent that catches errors on *keep alived* connections (José F. Romaniello) [#4482](https://github.com/nodejs/node/pull/4482) + * **src**: + - Better support for Big-Endian systems (Bryon Leung) [#3410](https://github.com/nodejs/node/pull/3410) + * **tls**: + - A new feature that allows you to pass common SSL options to `tls.createSecurePair` (Коренберг Марк) [#2441](https://github.com/nodejs/node/pull/2441) + * **tools**: + - a new flag `--prof-process` which will execute the tick processor on the provided isolate files (Matt Loring) [#4021](https://github.com/nodejs/node/pull/4021) + +Notable semver patch changes include: + + * **buld**: + - Support python path that includes spaces. This should be of particular interest to our Windows users who may have python living in `c:/Program Files` (Felix Becker) [#4841](https://github.com/nodejs/node/pull/4841) + * **https**: + - A potential fix for [#3692](https://github.com/nodejs/node/issues/3692) HTTP/HTTPS client requests throwing EPROTO (Fedor Indutny) [#4982](https://github.com/nodejs/node/pull/4982) + * **installer**: + - More readable profiling information from isolate tick logs (Matt Loring) [#3032](https://github.com/nodejs/node/pull/3032) + * **npm**: + - upgrade to npm 2.14.20 (Kat Marchán) [#5510](https://github.com/nodejs/node/pull/5510) + * **process**: + - Add support for symbols in event emitters. Symbols didn't exist when it was written ¯\_(ツ)_/¯ (cjihrig) [#4798](https://github.com/nodejs/node/pull/4798) + * **querystring**: + - querystring.parse() is now 13-22% faster! (Brian White) [#4675](https://github.com/nodejs/node/pull/4675) + * **streams**: + - performance improvements for moving small buffers that shows a 5% throughput gain. IoT projects have been seen to be as much as 10% faster with this change! (Matteo Collina) [#4354](https://github.com/nodejs/node/pull/4354) + * **tools**: + - eslint has been updated to version 2.1.0 (Rich Trott) [#5214](https://github.com/nodejs/node/pull/5214) + +### Commits + +* [[`360e04fd5a`](https://github.com/nodejs/node/commit/360e04fd5a)] - internal/child_process: call postSend on error (Fedor Indutny) [#4752](https://github.com/nodejs/node/pull/4752) +* [[`a29f501aa2`](https://github.com/nodejs/node/commit/a29f501aa2)] - **benchmark**: add a constant declaration for `net` (Minwoo Jung) [#3950](https://github.com/nodejs/node/pull/3950) +* [[`85e06a2e34`](https://github.com/nodejs/node/commit/85e06a2e34)] - **(SEMVER-MINOR)** **buffer**: allow encoding param to collapse (Trevor Norris) [#4803](https://github.com/nodejs/node/pull/4803) +* [[`fe893a8ebc`](https://github.com/nodejs/node/commit/fe893a8ebc)] - **(SEMVER-MINOR)** **buffer**: properly retrieve binary length of needle (Trevor Norris) [#4803](https://github.com/nodejs/node/pull/4803) +* [[`fae7c9db3f`](https://github.com/nodejs/node/commit/fae7c9db3f)] - **buffer**: refactor redeclared variables (Rich Trott) [#4886](https://github.com/nodejs/node/pull/4886) +* [[`4a6e2b26f7`](https://github.com/nodejs/node/commit/4a6e2b26f7)] - **build**: treat aarch64 as arm64 (Johan Bergström) [#5191](https://github.com/nodejs/node/pull/5191) +* [[`bc2536dfc6`](https://github.com/nodejs/node/commit/bc2536dfc6)] - **build**: add a help message and removed a TODO. (Ojas Shirekar) [#5080](https://github.com/nodejs/node/pull/5080) +* [[`f6416be5d2`](https://github.com/nodejs/node/commit/f6416be5d2)] - **build**: remove redundant TODO in configure (Ojas Shirekar) [#5080](https://github.com/nodejs/node/pull/5080) +* [[`6deb7a6eb8`](https://github.com/nodejs/node/commit/6deb7a6eb8)] - **build**: remove Makefile.build (Ojas Shirekar) [#5080](https://github.com/nodejs/node/pull/5080) +* [[`66d1115555`](https://github.com/nodejs/node/commit/66d1115555)] - **build**: fix build when python path contains spaces (Felix Becker) [#4841](https://github.com/nodejs/node/pull/4841) +* [[`29951cf36a`](https://github.com/nodejs/node/commit/29951cf36a)] - **child_process**: fix data loss with readable event (Brian White) [#5036](https://github.com/nodejs/node/pull/5036) +* [[`81d4127279`](https://github.com/nodejs/node/commit/81d4127279)] - **cluster**: dont rely on `this` in `fork` (Igor Klopov) [#5216](https://github.com/nodejs/node/pull/5216) +* [[`de4c07b29e`](https://github.com/nodejs/node/commit/de4c07b29e)] - **console**: apply null as `this` for util.format (Jackson Tian) [#5222](https://github.com/nodejs/node/pull/5222) +* [[`4e0755cab3`](https://github.com/nodejs/node/commit/4e0755cab3)] - **crypto**: have fixed NodeBIOs return EOF (Adam Langley) [#5105](https://github.com/nodejs/node/pull/5105) +* [[`a7955d5071`](https://github.com/nodejs/node/commit/a7955d5071)] - **crypto**: fix memory leak in LoadPKCS12 (Fedor Indutny) [#5109](https://github.com/nodejs/node/pull/5109) +* [[`5d9c1cf001`](https://github.com/nodejs/node/commit/5d9c1cf001)] - **crypto**: add `pfx` certs as CA certs too (Fedor Indutny) [#5109](https://github.com/nodejs/node/pull/5109) +* [[`ab5cb0539b`](https://github.com/nodejs/node/commit/ab5cb0539b)] - **crypto**: use SSL_CTX_clear_extra_chain_certs. (Adam Langley) [#4919](https://github.com/nodejs/node/pull/4919) +* [[`198928eb9f`](https://github.com/nodejs/node/commit/198928eb9f)] - **crypto**: fix build when OCSP-stapling not provided (Adam Langley) [#4914](https://github.com/nodejs/node/pull/4914) +* [[`b8e1089df0`](https://github.com/nodejs/node/commit/b8e1089df0)] - **crypto**: use a const SSL_CIPHER (Adam Langley) [#4913](https://github.com/nodejs/node/pull/4913) +* [[`139d6d9284`](https://github.com/nodejs/node/commit/139d6d9284)] - **debugger**: assert test before accessing this.binding (Prince J Wesley) [#5145](https://github.com/nodejs/node/pull/5145) +* [[`9c8f2ab546`](https://github.com/nodejs/node/commit/9c8f2ab546)] - **deps**: upgrade to npm 2.14.20 (Kat Marchán) [#5510](https://github.com/nodejs/node/pull/5510) +* [[`e591a0927f`](https://github.com/nodejs/node/commit/e591a0927f)] - **deps**: upgrade to npm 2.14.19 (Kat Marchán) [#5335](https://github.com/nodejs/node/pull/5335) +* [[`a5ce67a0aa`](https://github.com/nodejs/node/commit/a5ce67a0aa)] - **deps**: upgrade to npm 2.14.18 (Kat Marchán) [#5245](https://github.com/nodejs/node/pull/5245) +* [[`469db021f7`](https://github.com/nodejs/node/commit/469db021f7)] - **(SEMVER-MINOR)** **deps**: backport 9da3ab6 from V8 upstream (Ali Ijaz Sheikh) [#3609](https://github.com/nodejs/node/pull/3609) +* [[`3ca04a5de9`](https://github.com/nodejs/node/commit/3ca04a5de9)] - **deps**: backport 8d00c2c from v8 upstream (Gibson Fahnestock) [#5024](https://github.com/nodejs/node/pull/5024) +* [[`60e0bd4be9`](https://github.com/nodejs/node/commit/60e0bd4be9)] - **deps**: upgrade to npm 2.14.17 (Kat Marchán) [#5110](https://github.com/nodejs/node/pull/5110) +* [[`976b9a9ab3`](https://github.com/nodejs/node/commit/976b9a9ab3)] - **deps**: upgrade to npm 2.14.16 (Kat Marchán) [#4960](https://github.com/nodejs/node/pull/4960) +* [[`38b370abea`](https://github.com/nodejs/node/commit/38b370abea)] - **deps**: upgrade to npm 2.14.15 (Kat Marchán) [#4872](https://github.com/nodejs/node/pull/4872) +* [[`82f549ef81`](https://github.com/nodejs/node/commit/82f549ef81)] - **dgram**: scope redeclared variables (Rich Trott) [#4940](https://github.com/nodejs/node/pull/4940) +* [[`063e14b568`](https://github.com/nodejs/node/commit/063e14b568)] - **dns**: throw a TypeError in lookupService with invalid port (Evan Lucas) [#4839](https://github.com/nodejs/node/pull/4839) +* [[`a2613aefae`](https://github.com/nodejs/node/commit/a2613aefae)] - **doc**: remove out-of-date matter from internal docs (Rich Trott) [#5421](https://github.com/nodejs/node/pull/5421) +* [[`394743f4b3`](https://github.com/nodejs/node/commit/394743f4b3)] - **doc**: explicit about VS 2015 support in readme (Phillip Johnsen) [#5406](https://github.com/nodejs/node/pull/5406) +* [[`da6b26fbfb`](https://github.com/nodejs/node/commit/da6b26fbfb)] - **doc**: copyedit util doc (Rich Trott) [#5399](https://github.com/nodejs/node/pull/5399) +* [[`7070ad0cc0`](https://github.com/nodejs/node/commit/7070ad0cc0)] - **doc**: mention prototype check in deepStrictEqual() (cjihrig) [#5367](https://github.com/nodejs/node/pull/5367) +* [[`d4789fc5fd`](https://github.com/nodejs/node/commit/d4789fc5fd)] - **doc**: s/http/https in Myles Borins' GitHub link (Rod Vagg) [#5356](https://github.com/nodejs/node/pull/5356) +* [[`b86540d1eb`](https://github.com/nodejs/node/commit/b86540d1eb)] - **doc**: clarify error handling in net.createServer (Dirceu Pereira Tiegs) [#5353](https://github.com/nodejs/node/pull/5353) +* [[`3106297037`](https://github.com/nodejs/node/commit/3106297037)] - **doc**: `require` behavior on case-insensitive systems (Hugo Wood) +* [[`e0b45e4315`](https://github.com/nodejs/node/commit/e0b45e4315)] - **doc**: update repo docs to use 'CTC' (Alexis Campailla) [#5304](https://github.com/nodejs/node/pull/5304) +* [[`e355f13989`](https://github.com/nodejs/node/commit/e355f13989)] - **doc**: improvements to crypto.markdown copy (Alexander Makarenko) [#5230](https://github.com/nodejs/node/pull/5230) +* [[`a9035b5e1d`](https://github.com/nodejs/node/commit/a9035b5e1d)] - **doc**: link to man pages (dcposch@dcpos.ch) [#5073](https://github.com/nodejs/node/pull/5073) +* [[`2043e6a63c`](https://github.com/nodejs/node/commit/2043e6a63c)] - **doc**: clarify child_process.execFile{,Sync} file arg (Kevin Locke) [#5310](https://github.com/nodejs/node/pull/5310) +* [[`8c732ad1e1`](https://github.com/nodejs/node/commit/8c732ad1e1)] - **doc**: fix buf.length slice example (Chinedu Francis Nwafili) [#5259](https://github.com/nodejs/node/pull/5259) +* [[`6c27c78b8b`](https://github.com/nodejs/node/commit/6c27c78b8b)] - **doc**: fix buffer\[index\] example (Chinedu Francis Nwafili) [#5253](https://github.com/nodejs/node/pull/5253) +* [[`7765f99683`](https://github.com/nodejs/node/commit/7765f99683)] - **doc**: fix template string (Rafael Cepeda) [#5240](https://github.com/nodejs/node/pull/5240) +* [[`d15ef20162`](https://github.com/nodejs/node/commit/d15ef20162)] - **doc**: improvements to console.markdown copy (Alexander Makarenko) [#5225](https://github.com/nodejs/node/pull/5225) +* [[`593206a752`](https://github.com/nodejs/node/commit/593206a752)] - **doc**: fix net.createConnection() example (Brian White) [#5219](https://github.com/nodejs/node/pull/5219) +* [[`464636b5c5`](https://github.com/nodejs/node/commit/464636b5c5)] - **doc**: improve scrolling, various CSS tweaks (Roman Reiss) [#5198](https://github.com/nodejs/node/pull/5198) +* [[`f615cd5b0b`](https://github.com/nodejs/node/commit/f615cd5b0b)] - **doc**: console is asynchronous unless it's a file (Ben Noordhuis) [#5133](https://github.com/nodejs/node/pull/5133) +* [[`fbed0d11f1`](https://github.com/nodejs/node/commit/fbed0d11f1)] - **doc**: merging behavior of writeHead vs setHeader (Alejandro Oviedo) [#5081](https://github.com/nodejs/node/pull/5081) +* [[`b0bb42bd7d`](https://github.com/nodejs/node/commit/b0bb42bd7d)] - **doc**: fix reference to API `hash.final` (Minwoo Jung) [#5050](https://github.com/nodejs/node/pull/5050) +* [[`dee5045221`](https://github.com/nodejs/node/commit/dee5045221)] - **doc**: uppercase 'RSA-SHA256' in crypto.markdown (Rainer Oviir) [#5044](https://github.com/nodejs/node/pull/5044) +* [[`498052a017`](https://github.com/nodejs/node/commit/498052a017)] - **doc**: consistent styling for functions in TLS docs (Alexander Makarenko) [#5000](https://github.com/nodejs/node/pull/5000) +* [[`031277e6f8`](https://github.com/nodejs/node/commit/031277e6f8)] - **doc**: apply consistent styling for functions (Rich Trott) [#4974](https://github.com/nodejs/node/pull/4974) +* [[`808fe0ea48`](https://github.com/nodejs/node/commit/808fe0ea48)] - **doc**: fix `notDeepEqual` API (Minwoo Jung) [#4971](https://github.com/nodejs/node/pull/4971) +* [[`5b9025689f`](https://github.com/nodejs/node/commit/5b9025689f)] - **doc**: show links consistently in deprecations (Sakthipriyan Vairamani) [#4907](https://github.com/nodejs/node/pull/4907) +* [[`3a1865db5e`](https://github.com/nodejs/node/commit/3a1865db5e)] - **doc**: don't use "interface" as a variable name (ChALkeR) [#4900](https://github.com/nodejs/node/pull/4900) +* [[`90715c3d68`](https://github.com/nodejs/node/commit/90715c3d68)] - **doc**: keep the names in sorted order (Sakthipriyan Vairamani) [#4876](https://github.com/nodejs/node/pull/4876) +* [[`d8b3b25c9c`](https://github.com/nodejs/node/commit/d8b3b25c9c)] - **doc**: fix JSON generation for aliased methods (Timothy Gu) [#4871](https://github.com/nodejs/node/pull/4871) +* [[`7b763c8d25`](https://github.com/nodejs/node/commit/7b763c8d25)] - **doc**: fix code type of markdowns (Jackson Tian) [#4858](https://github.com/nodejs/node/pull/4858) +* [[`37d4e7afc2`](https://github.com/nodejs/node/commit/37d4e7afc2)] - **doc**: check for errors in 'listen' event (Benjamin Gruenbaum) [#4834](https://github.com/nodejs/node/pull/4834) +* [[`3f876b104c`](https://github.com/nodejs/node/commit/3f876b104c)] - **doc**: Examples work when data exceeds buffer size (Glen Arrowsmith) [#4811](https://github.com/nodejs/node/pull/4811) +* [[`e3e20422a7`](https://github.com/nodejs/node/commit/e3e20422a7)] - **doc**: harmonize $ node command line notation (Robert Jefe Lindstaedt) [#4806](https://github.com/nodejs/node/pull/4806) +* [[`73e0195cef`](https://github.com/nodejs/node/commit/73e0195cef)] - **doc**: fix type references for link gen, link css (Claudio Rodriguez) [#4741](https://github.com/nodejs/node/pull/4741) +* [[`0bdac429e1`](https://github.com/nodejs/node/commit/0bdac429e1)] - **doc**: multiple improvements in Stream docs (Alexander Makarenko) [#5009](https://github.com/nodejs/node/pull/5009) +* [[`693c16fb6b`](https://github.com/nodejs/node/commit/693c16fb6b)] - **doc**: fix anchor links from stream to http and events (piepmatz) [#5007](https://github.com/nodejs/node/pull/5007) +* [[`5fb533522c`](https://github.com/nodejs/node/commit/5fb533522c)] - **doc**: replace function expressions with arrows (Benjamin Gruenbaum) [#4832](https://github.com/nodejs/node/pull/4832) +* [[`e3572fb809`](https://github.com/nodejs/node/commit/e3572fb809)] - **doc**: fix links order in Buffer doc (Alexander Makarenko) [#5076](https://github.com/nodejs/node/pull/5076) +* [[`5c936ab765`](https://github.com/nodejs/node/commit/5c936ab765)] - **doc**: clarify optional arguments of Buffer methods (Michaël Zasso) [#5008](https://github.com/nodejs/node/pull/5008) +* [[`6df350c2b3`](https://github.com/nodejs/node/commit/6df350c2b3)] - **doc**: improve styling consistency in Buffer docs (Alexander Makarenko) [#5001](https://github.com/nodejs/node/pull/5001) +* [[`047f4a157f`](https://github.com/nodejs/node/commit/047f4a157f)] - **doc**: make buffer methods styles consistent (Timothy Gu) [#4873](https://github.com/nodejs/node/pull/4873) +* [[`4cfc017b90`](https://github.com/nodejs/node/commit/4cfc017b90)] - **doc**: fix nonsensical grammar in Buffer::write (Jimb Esser) [#4863](https://github.com/nodejs/node/pull/4863) +* [[`9087f6daca`](https://github.com/nodejs/node/commit/9087f6daca)] - **doc**: fix named anchors in addons.markdown and http.markdown (Michael Theriot) [#4708](https://github.com/nodejs/node/pull/4708) +* [[`4c8713ce58`](https://github.com/nodejs/node/commit/4c8713ce58)] - **doc**: add buf.indexOf encoding param with example (Karl Skomski) [#3373](https://github.com/nodejs/node/pull/3373) +* [[`1819d74491`](https://github.com/nodejs/node/commit/1819d74491)] - **doc**: fenced all code blocks, typo fixes (Robert Jefe Lindstaedt) [#4733](https://github.com/nodejs/node/pull/4733) +* [[`961735e645`](https://github.com/nodejs/node/commit/961735e645)] - **doc**: make references clickable (Roman Klauke) [#4654](https://github.com/nodejs/node/pull/4654) +* [[`7e80442483`](https://github.com/nodejs/node/commit/7e80442483)] - **doc**: improve child_process.execFile() code example (Ryan Sobol) [#4504](https://github.com/nodejs/node/pull/4504) +* [[`de9ad5b39d`](https://github.com/nodejs/node/commit/de9ad5b39d)] - **doc**: remove "above" and "below" references (Richard Sun) [#4499](https://github.com/nodejs/node/pull/4499) +* [[`c549ca3b69`](https://github.com/nodejs/node/commit/c549ca3b69)] - **doc**: fix heading level error in Buffer doc (Shigeki Ohtsu) [#4537](https://github.com/nodejs/node/pull/4537) +* [[`a613bae14c`](https://github.com/nodejs/node/commit/a613bae14c)] - **doc**: improvements to crypto.markdown copy (James M Snell) [#4435](https://github.com/nodejs/node/pull/4435) +* [[`18f580d0c1`](https://github.com/nodejs/node/commit/18f580d0c1)] - **doc**: improve child_process.markdown copy (James M Snell) [#4383](https://github.com/nodejs/node/pull/4383) +* [[`a929837311`](https://github.com/nodejs/node/commit/a929837311)] - **doc**: improvements to buffer.markdown copy (James M Snell) [#4370](https://github.com/nodejs/node/pull/4370) +* [[`a22f688407`](https://github.com/nodejs/node/commit/a22f688407)] - **doc**: improve addons.markdown copy (James M Snell) [#4320](https://github.com/nodejs/node/pull/4320) +* [[`94c2de47b1`](https://github.com/nodejs/node/commit/94c2de47b1)] - **doc**: update process.send() signature (cjihrig) [#5284](https://github.com/nodejs/node/pull/5284) +* [[`4e1926cb08`](https://github.com/nodejs/node/commit/4e1926cb08)] - **doc**: replace node-forward link in CONTRIBUTING.md (Ben Noordhuis) [#5227](https://github.com/nodejs/node/pull/5227) +* [[`e1713e81e5`](https://github.com/nodejs/node/commit/e1713e81e5)] - **doc**: fix minor inconsistencies in repl doc (Rich Trott) [#5193](https://github.com/nodejs/node/pull/5193) +* [[`b2e72c0d92`](https://github.com/nodejs/node/commit/b2e72c0d92)] - **doc**: clarify exceptions during uncaughtException (Noah Rose) [#5180](https://github.com/nodejs/node/pull/5180) +* [[`c3c549836a`](https://github.com/nodejs/node/commit/c3c549836a)] - **doc**: update DCO to v1.1 (Mikeal Rogers) [#5170](https://github.com/nodejs/node/pull/5170) +* [[`9dd35ad594`](https://github.com/nodejs/node/commit/9dd35ad594)] - **doc**: fix dgram doc indentation (Rich Trott) [#5118](https://github.com/nodejs/node/pull/5118) +* [[`eed830702c`](https://github.com/nodejs/node/commit/eed830702c)] - **doc**: fix typo in dgram doc (Rich Trott) [#5114](https://github.com/nodejs/node/pull/5114) +* [[`abfb2f5864`](https://github.com/nodejs/node/commit/abfb2f5864)] - **doc**: fix link in cluster documentation (Timothy Gu) [#5068](https://github.com/nodejs/node/pull/5068) +* [[`8b040b5bb2`](https://github.com/nodejs/node/commit/8b040b5bb2)] - **doc**: fix minor typo in process doc (Prayag Verma) [#5018](https://github.com/nodejs/node/pull/5018) +* [[`47eebe1d80`](https://github.com/nodejs/node/commit/47eebe1d80)] - **doc**: fix typo in Readme.md (Prayag Verma) [#5017](https://github.com/nodejs/node/pull/5017) +* [[`2b97ff89a6`](https://github.com/nodejs/node/commit/2b97ff89a6)] - **doc**: minor improvement in OS docs (Alexander Makarenko) [#5006](https://github.com/nodejs/node/pull/5006) +* [[`9a5d58b89e`](https://github.com/nodejs/node/commit/9a5d58b89e)] - **doc**: improve styling consistency in VM docs (Alexander Makarenko) [#5005](https://github.com/nodejs/node/pull/5005) +* [[`960e1bab98`](https://github.com/nodejs/node/commit/960e1bab98)] - **doc**: minor improvement to HTTPS doc (Alexander Makarenko) [#5002](https://github.com/nodejs/node/pull/5002) +* [[`6048b011e8`](https://github.com/nodejs/node/commit/6048b011e8)] - **doc**: spell writable consistently (Peter Lyons) [#4954](https://github.com/nodejs/node/pull/4954) +* [[`7b8f904167`](https://github.com/nodejs/node/commit/7b8f904167)] - **doc**: update eol handling in readline (Kári Tristan Helgason) [#4927](https://github.com/nodejs/node/pull/4927) +* [[`83efd0d4d1`](https://github.com/nodejs/node/commit/83efd0d4d1)] - **doc**: add more details to process.env (Evan Lucas) [#4924](https://github.com/nodejs/node/pull/4924) +* [[`b2d2c0b588`](https://github.com/nodejs/node/commit/b2d2c0b588)] - **doc**: undo move http.IncomingMessage.statusMessage (Jeff Harris) [#4822](https://github.com/nodejs/node/pull/4822) +* [[`b091c41b53`](https://github.com/nodejs/node/commit/b091c41b53)] - **doc**: proper markdown escaping -> \_\_, \*, \_ (Robert Jefe Lindstaedt) [#4805](https://github.com/nodejs/node/pull/4805) +* [[`0887208290`](https://github.com/nodejs/node/commit/0887208290)] - **doc**: remove unnecessary bind(this) (Dmitriy Lazarev) [#4797](https://github.com/nodejs/node/pull/4797) +* [[`f3e3c70bca`](https://github.com/nodejs/node/commit/f3e3c70bca)] - **doc**: Update small error in LICENSE for npm (Kat Marchán) [#4872](https://github.com/nodejs/node/pull/4872) +* [[`e703b180b3`](https://github.com/nodejs/node/commit/e703b180b3)] - **doc,tools,test**: lint doc-based addon tests (Rich Trott) [#5427](https://github.com/nodejs/node/pull/5427) +* [[`0f3b8ca192`](https://github.com/nodejs/node/commit/0f3b8ca192)] - **fs**: refactor redeclared variables (Rich Trott) [#4959](https://github.com/nodejs/node/pull/4959) +* [[`152c6b6b8d`](https://github.com/nodejs/node/commit/152c6b6b8d)] - **http**: remove reference to onParserExecute (Tom Atkinson) [#4773](https://github.com/nodejs/node/pull/4773) +* [[`6a0571cd72`](https://github.com/nodejs/node/commit/6a0571cd72)] - **http**: do not emit `upgrade` on advertisement (Fedor Indutny) [#4337](https://github.com/nodejs/node/pull/4337) +* [[`567ced9ef0`](https://github.com/nodejs/node/commit/567ced9ef0)] - **(SEMVER-MINOR)** **http**: handle errors on idle sockets (José F. Romaniello) [#4482](https://github.com/nodejs/node/pull/4482) +* [[`de5177ccb8`](https://github.com/nodejs/node/commit/de5177ccb8)] - **https**: evict cached sessions on error (Fedor Indutny) [#4982](https://github.com/nodejs/node/pull/4982) +* [[`77a6036264`](https://github.com/nodejs/node/commit/77a6036264)] - **installer**: install the tick processor (Matt Loring) [#3032](https://github.com/nodejs/node/pull/3032) +* [[`ea16d8d7c5`](https://github.com/nodejs/node/commit/ea16d8d7c5)] - **lib**: remove string_decoder.js var redeclarations (Rich Trott) [#4978](https://github.com/nodejs/node/pull/4978) +* [[`1389660ab3`](https://github.com/nodejs/node/commit/1389660ab3)] - **lib**: scope loop variables (Rich Trott) [#4965](https://github.com/nodejs/node/pull/4965) +* [[`59255d7218`](https://github.com/nodejs/node/commit/59255d7218)] - **lib**: use arrow functions instead of bind (Minwoo Jung) [#3622](https://github.com/nodejs/node/pull/3622) +* [[`fd26960aab`](https://github.com/nodejs/node/commit/fd26960aab)] - **lib,test**: remove extra semicolons (Michaël Zasso) [#2205](https://github.com/nodejs/node/pull/2205) +* [[`9646d26ffd`](https://github.com/nodejs/node/commit/9646d26ffd)] - **module**: refactor redeclared variable (Rich Trott) [#4962](https://github.com/nodejs/node/pull/4962) +* [[`09311128e8`](https://github.com/nodejs/node/commit/09311128e8)] - **net**: use `_server` for internal book-keeping (Fedor Indutny) [#5262](https://github.com/nodejs/node/pull/5262) +* [[`824c402174`](https://github.com/nodejs/node/commit/824c402174)] - **net**: refactor redeclared variables (Rich Trott) [#4963](https://github.com/nodejs/node/pull/4963) +* [[`96f306f3cf`](https://github.com/nodejs/node/commit/96f306f3cf)] - **net**: move isLegalPort to internal/net (Evan Lucas) [#4882](https://github.com/nodejs/node/pull/4882) +* [[`78d64889bd`](https://github.com/nodejs/node/commit/78d64889bd)] - **node**: set process._eventsCount to 0 on startup (Evan Lucas) [#5208](https://github.com/nodejs/node/pull/5208) +* [[`7a2e8f4356`](https://github.com/nodejs/node/commit/7a2e8f4356)] - **process**: support symbol events (cjihrig) [#4798](https://github.com/nodejs/node/pull/4798) +* [[`c9e2dce247`](https://github.com/nodejs/node/commit/c9e2dce247)] - **querystring**: improve parse() performance (Brian White) [#4675](https://github.com/nodejs/node/pull/4675) +* [[`18542c41fe`](https://github.com/nodejs/node/commit/18542c41fe)] - **repl**: remove variable redeclaration (Rich Trott) [#4977](https://github.com/nodejs/node/pull/4977) +* [[`10be8dc360`](https://github.com/nodejs/node/commit/10be8dc360)] - **src**: force line buffering for stderr (Rich Trott) [#3701](https://github.com/nodejs/node/pull/3701) +* [[`7958664e85`](https://github.com/nodejs/node/commit/7958664e85)] - **src**: clean up usage of __proto__ (Jackson Tian) [#5069](https://github.com/nodejs/node/pull/5069) +* [[`4e0a0d51b3`](https://github.com/nodejs/node/commit/4e0a0d51b3)] - **src**: remove no longer relevant comments (Chris911) [#4843](https://github.com/nodejs/node/pull/4843) +* [[`51c8bc8abc`](https://github.com/nodejs/node/commit/51c8bc8abc)] - **src**: remove __builtin_bswap16 call (Ben Noordhuis) [#4290](https://github.com/nodejs/node/pull/4290) +* [[`5e1976e37c`](https://github.com/nodejs/node/commit/5e1976e37c)] - **src**: remove unused BITS_PER_LONG macro (Ben Noordhuis) [#4290](https://github.com/nodejs/node/pull/4290) +* [[`c18ef54d88`](https://github.com/nodejs/node/commit/c18ef54d88)] - **(SEMVER-MINOR)** **src**: add BE support to StringBytes::Encode() (Bryon Leung) [#3410](https://github.com/nodejs/node/pull/3410) +* [[`be9e7610b5`](https://github.com/nodejs/node/commit/be9e7610b5)] - **src,test,tools**: modify for more stringent linting (Rich Trott) [#5214](https://github.com/nodejs/node/pull/5214) +* [[`538c4756a7`](https://github.com/nodejs/node/commit/538c4756a7)] - **stream**: refactor redeclared variables (Rich Trott) [#4816](https://github.com/nodejs/node/pull/4816) +* [[`4fa22e4126`](https://github.com/nodejs/node/commit/4fa22e4126)] - **streams**: 5% throughput gain when sending small chunks (Matteo Collina) [#4354](https://github.com/nodejs/node/pull/4354) +* [[`b6bd87495f`](https://github.com/nodejs/node/commit/b6bd87495f)] - **test**: remove flaky mark for test-debug-no-context (Rich Trott) [#5317](https://github.com/nodejs/node/pull/5317) +* [[`7705360e35`](https://github.com/nodejs/node/commit/7705360e35)] - **test**: add test for https server close event (Braydon Fuller) [#5106](https://github.com/nodejs/node/pull/5106) +* [[`9d6623e1d1`](https://github.com/nodejs/node/commit/9d6623e1d1)] - **test**: use String.prototype.repeat() for clarity (Rich Trott) [#5311](https://github.com/nodejs/node/pull/5311) +* [[`18e3987e2e`](https://github.com/nodejs/node/commit/18e3987e2e)] - **test**: mitigate flaky test-debug-no-context (Rich Trott) [#5269](https://github.com/nodejs/node/pull/5269) +* [[`058db07ce8`](https://github.com/nodejs/node/commit/058db07ce8)] - **test**: refactor test-dgram-send-callback-recursive (Santiago Gimeno) [#5079](https://github.com/nodejs/node/pull/5079) +* [[`1647113d7a`](https://github.com/nodejs/node/commit/1647113d7a)] - **test**: refactor test-http-destroyed-socket-write2 (Santiago Gimeno) [#4970](https://github.com/nodejs/node/pull/4970) +* [[`07dc2b50e2`](https://github.com/nodejs/node/commit/07dc2b50e2)] - **test**: shorten path for bogus socket (Rich Trott) [#4478](https://github.com/nodejs/node/pull/4478) +* [[`47e7c8c359`](https://github.com/nodejs/node/commit/47e7c8c359)] - **test**: mark test-http-regr-gh-2928 flaky (Rich Trott) [#5280](https://github.com/nodejs/node/pull/5280) +* [[`9dbd66f7ef`](https://github.com/nodejs/node/commit/9dbd66f7ef)] - **test**: mark test-http-agent flaky (Rich Trott) [#5209](https://github.com/nodejs/node/pull/5209) +* [[`98049876b5`](https://github.com/nodejs/node/commit/98049876b5)] - **test**: minimal repl eval option test (Rich Trott) [#5192](https://github.com/nodejs/node/pull/5192) +* [[`ae3185b8ac`](https://github.com/nodejs/node/commit/ae3185b8ac)] - **test**: disable fs watch tests for AIX (Michael Dawson) [#5187](https://github.com/nodejs/node/pull/5187) +* [[`b639c3345b`](https://github.com/nodejs/node/commit/b639c3345b)] - **test**: fix child-process-fork-regr-gh-2847 again (Santiago Gimeno) [#5179](https://github.com/nodejs/node/pull/5179) +* [[`8be3afc474`](https://github.com/nodejs/node/commit/8be3afc474)] - **test**: fix flaky test-http-regr-gh-2928 (Rich Trott) [#5154](https://github.com/nodejs/node/pull/5154) +* [[`46dc12bdcc`](https://github.com/nodejs/node/commit/46dc12bdcc)] - **test**: enable to work pkcs12 test in FIPS mode (Shigeki Ohtsu) [#5150](https://github.com/nodejs/node/pull/5150) +* [[`e19b8ea692`](https://github.com/nodejs/node/commit/e19b8ea692)] - **test**: remove unneeded common.indirectInstanceOf() (Rich Trott) [#5149](https://github.com/nodejs/node/pull/5149) +* [[`6072d2e15e`](https://github.com/nodejs/node/commit/6072d2e15e)] - **test**: disable gh-5100 test when in FIPS mode (Fedor Indutny) [#5144](https://github.com/nodejs/node/pull/5144) +* [[`a8417a2787`](https://github.com/nodejs/node/commit/a8417a2787)] - **test**: fix flaky test-dgram-pingpong (Rich Trott) [#5125](https://github.com/nodejs/node/pull/5125) +* [[`9db67a6a44`](https://github.com/nodejs/node/commit/9db67a6a44)] - **test**: fix child-process-fork-regr-gh-2847 (Santiago Gimeno) [#5121](https://github.com/nodejs/node/pull/5121) +* [[`69150caedc`](https://github.com/nodejs/node/commit/69150caedc)] - **test**: don't run test-tick-processor.js on Aix (Michael Dawson) [#5093](https://github.com/nodejs/node/pull/5093) +* [[`4a492b96b1`](https://github.com/nodejs/node/commit/4a492b96b1)] - **test**: mark flaky tests on Raspberry Pi (Rich Trott) [#5082](https://github.com/nodejs/node/pull/5082) +* [[`4301f2cdc2`](https://github.com/nodejs/node/commit/4301f2cdc2)] - **test**: fix inconsistent styling in test-url (Brian White) [#5014](https://github.com/nodejs/node/pull/5014) +* [[`865baaed60`](https://github.com/nodejs/node/commit/865baaed60)] - **test**: fix redeclared vars in sequential tests (Rich Trott) [#4999](https://github.com/nodejs/node/pull/4999) +* [[`663e852c1b`](https://github.com/nodejs/node/commit/663e852c1b)] - **test**: pummel test fixes (Rich Trott) [#4998](https://github.com/nodejs/node/pull/4998) +* [[`72d38a4a38`](https://github.com/nodejs/node/commit/72d38a4a38)] - **test**: fix redeclared vars in test-vm-* (Rich Trott) [#4997](https://github.com/nodejs/node/pull/4997) +* [[`97ddfa2b6e`](https://github.com/nodejs/node/commit/97ddfa2b6e)] - **test**: fix redeclared vars in test-url (Rich Trott) [#4993](https://github.com/nodejs/node/pull/4993) +* [[`43d4db4314`](https://github.com/nodejs/node/commit/43d4db4314)] - **test**: fix redeclared test-util-* vars (Rich Trott) [#4994](https://github.com/nodejs/node/pull/4994) +* [[`88fae38d0c`](https://github.com/nodejs/node/commit/88fae38d0c)] - **test**: fix variable redeclarations (Rich Trott) [#4992](https://github.com/nodejs/node/pull/4992) +* [[`58595f146a`](https://github.com/nodejs/node/commit/58595f146a)] - **test**: fix redeclared test-path vars (Rich Trott) [#4991](https://github.com/nodejs/node/pull/4991) +* [[`2b711d51fa`](https://github.com/nodejs/node/commit/2b711d51fa)] - **test**: fix var redeclarations in test-os (Rich Trott) [#4990](https://github.com/nodejs/node/pull/4990) +* [[`bd9e2c31d6`](https://github.com/nodejs/node/commit/bd9e2c31d6)] - **test**: fix test-net-* variable redeclarations (Rich Trott) [#4989](https://github.com/nodejs/node/pull/4989) +* [[`d67ab81882`](https://github.com/nodejs/node/commit/d67ab81882)] - **test**: fix redeclared test-intl var (Rich Trott) [#4988](https://github.com/nodejs/node/pull/4988) +* [[`d6dbb2fae7`](https://github.com/nodejs/node/commit/d6dbb2fae7)] - **test**: fix redeclared test-http-* vars (Rich Trott) [#4987](https://github.com/nodejs/node/pull/4987) +* [[`ecaa89a8cb`](https://github.com/nodejs/node/commit/ecaa89a8cb)] - **test**: fix redeclared test-event-emitter-* vars (Rich Trott) [#4985](https://github.com/nodejs/node/pull/4985) +* [[`299c729371`](https://github.com/nodejs/node/commit/299c729371)] - **test**: remove redeclared var in test-domain (Rich Trott) [#4984](https://github.com/nodejs/node/pull/4984) +* [[`35a4a203bf`](https://github.com/nodejs/node/commit/35a4a203bf)] - **test**: remove var redeclarations in test-crypto-* (Rich Trott) [#4981](https://github.com/nodejs/node/pull/4981) +* [[`1d56b74af0`](https://github.com/nodejs/node/commit/1d56b74af0)] - **test**: remove test-cluster-* var redeclarations (Rich Trott) [#4980](https://github.com/nodejs/node/pull/4980) +* [[`0ce12cc1ec`](https://github.com/nodejs/node/commit/0ce12cc1ec)] - **test**: fix test-http-extra-response flakiness (Santiago Gimeno) [#4979](https://github.com/nodejs/node/pull/4979) +* [[`c6b4bf138c`](https://github.com/nodejs/node/commit/c6b4bf138c)] - **test**: scope redeclared vars in test-child-process* (Rich Trott) [#4944](https://github.com/nodejs/node/pull/4944) +* [[`7654c171c7`](https://github.com/nodejs/node/commit/7654c171c7)] - **test**: refactor switch (Rich Trott) [#4870](https://github.com/nodejs/node/pull/4870) +* [[`226dfef690`](https://github.com/nodejs/node/commit/226dfef690)] - **test**: add common.platformTimeout() to dgram test (Rich Trott) [#4938](https://github.com/nodejs/node/pull/4938) +* [[`fb14bac662`](https://github.com/nodejs/node/commit/fb14bac662)] - **test**: fix flaky cluster test on Windows 10 (Rich Trott) [#4934](https://github.com/nodejs/node/pull/4934) +* [[`f5d29d7ac4`](https://github.com/nodejs/node/commit/f5d29d7ac4)] - **test**: Add assertion for TLS peer certificate fingerprint (Alan Cohen) [#4923](https://github.com/nodejs/node/pull/4923) +* [[`618427cea6`](https://github.com/nodejs/node/commit/618427cea6)] - **test**: fix test-tls-zero-clear-in flakiness (Santiago Gimeno) [#4888](https://github.com/nodejs/node/pull/4888) +* [[`8700c39c70`](https://github.com/nodejs/node/commit/8700c39c70)] - **test**: fix irregular whitespace issue (Roman Reiss) [#4864](https://github.com/nodejs/node/pull/4864) +* [[`2b026c9d5a`](https://github.com/nodejs/node/commit/2b026c9d5a)] - **test**: fs.link() test runs on same device (Drew Folta) [#4861](https://github.com/nodejs/node/pull/4861) +* [[`80a637ac4d`](https://github.com/nodejs/node/commit/80a637ac4d)] - **test**: scope redeclared variable (Rich Trott) [#4854](https://github.com/nodejs/node/pull/4854) +* [[`8c4903d4ef`](https://github.com/nodejs/node/commit/8c4903d4ef)] - **test**: update arrow function style (cjihrig) [#4813](https://github.com/nodejs/node/pull/4813) +* [[`0a44e6a447`](https://github.com/nodejs/node/commit/0a44e6a447)] - **test**: mark test-tick-processor flaky (Rich Trott) [#4809](https://github.com/nodejs/node/pull/4809) +* [[`363460616c`](https://github.com/nodejs/node/commit/363460616c)] - **test**: refactor test-net-settimeout (Rich Trott) [#4799](https://github.com/nodejs/node/pull/4799) +* [[`6841d82c22`](https://github.com/nodejs/node/commit/6841d82c22)] - **test**: remove race condition in http flood test (Rich Trott) [#4793](https://github.com/nodejs/node/pull/4793) +* [[`b5bae32847`](https://github.com/nodejs/node/commit/b5bae32847)] - **test**: remove test-http-exit-delay (Rich Trott) [#4786](https://github.com/nodejs/node/pull/4786) +* [[`60514f9521`](https://github.com/nodejs/node/commit/60514f9521)] - **test**: refactor test-fs-watch (Rich Trott) [#4776](https://github.com/nodejs/node/pull/4776) +* [[`2a3a431119`](https://github.com/nodejs/node/commit/2a3a431119)] - **test**: fix `net-socket-timeout-unref` flakiness (Santiago Gimeno) [#4772](https://github.com/nodejs/node/pull/4772) +* [[`9e6f3632a1`](https://github.com/nodejs/node/commit/9e6f3632a1)] - **test**: remove Object.observe from tests (Vladimir Kurchatkin) [#4769](https://github.com/nodejs/node/pull/4769) +* [[`f78daa67b8`](https://github.com/nodejs/node/commit/f78daa67b8)] - **test**: make npm tests work on prerelease node versions (Kat Marchán) [#4960](https://github.com/nodejs/node/pull/4960) +* [[`1c03191b6a`](https://github.com/nodejs/node/commit/1c03191b6a)] - **test**: make npm tests work on prerelease node versions (Kat Marchán) [#4872](https://github.com/nodejs/node/pull/4872) +* [[`d9c22cc896`](https://github.com/nodejs/node/commit/d9c22cc896)] - **test,buffer**: refactor redeclarations (Rich Trott) [#4893](https://github.com/nodejs/node/pull/4893) +* [[`5c4960468a`](https://github.com/nodejs/node/commit/5c4960468a)] - **tls**: nullify `.ssl` on handle close (Fedor Indutny) [#5168](https://github.com/nodejs/node/pull/5168) +* [[`c0f5f01c9c`](https://github.com/nodejs/node/commit/c0f5f01c9c)] - **tls**: scope loop vars with let (Rich Trott) [#4853](https://github.com/nodejs/node/pull/4853) +* [[`c86627e0d1`](https://github.com/nodejs/node/commit/c86627e0d1)] - **(SEMVER-MINOR)** **tls**: add `options` argument to createSecurePair (Коренберг Марк) [#2441](https://github.com/nodejs/node/pull/2441) +* [[`c908ff36f4`](https://github.com/nodejs/node/commit/c908ff36f4)] - **tls_wrap**: reach error reporting for UV_EPROTO (Fedor Indutny) [#4885](https://github.com/nodejs/node/pull/4885) +* [[`cebe3b95e3`](https://github.com/nodejs/node/commit/cebe3b95e3)] - **tools**: run tick processor without forking (Matt Loring) [#4224](https://github.com/nodejs/node/pull/4224) +* [[`70d8827714`](https://github.com/nodejs/node/commit/70d8827714)] - **(SEMVER-MINOR)** **tools**: add --prof-process flag to node binary (Matt Loring) [#4021](https://github.com/nodejs/node/pull/4021) +* [[`a43b9291c7`](https://github.com/nodejs/node/commit/a43b9291c7)] - **tools**: replace obsolete ESLint rules (Rich Trott) [#5214](https://github.com/nodejs/node/pull/5214) +* [[`a89c6f58f1`](https://github.com/nodejs/node/commit/a89c6f58f1)] - **tools**: update ESLint to version 2.1.0 (Rich Trott) [#5214](https://github.com/nodejs/node/pull/5214) +* [[`789f62196a`](https://github.com/nodejs/node/commit/789f62196a)] - **tools**: remove obsolete lint rules (Rich Trott) [#5214](https://github.com/nodejs/node/pull/5214) +* [[`154772cfa8`](https://github.com/nodejs/node/commit/154772cfa8)] - **tools**: parse types into links in doc html gen (Claudio Rodriguez) [#4741](https://github.com/nodejs/node/pull/4741) +* [[`9237b6e38a`](https://github.com/nodejs/node/commit/9237b6e38a)] - **tools**: fix warning in doc parsing (Shigeki Ohtsu) [#4537](https://github.com/nodejs/node/pull/4537) +* [[`c653cc0c03`](https://github.com/nodejs/node/commit/c653cc0c03)] - **tools**: add recommended ES6 lint rules (Rich Trott) [#5210](https://github.com/nodejs/node/pull/5210) +* [[`993d9b7df0`](https://github.com/nodejs/node/commit/993d9b7df0)] - **tools**: add recommended linting rules (Rich Trott) [#5188](https://github.com/nodejs/node/pull/5188) +* [[`8423125223`](https://github.com/nodejs/node/commit/8423125223)] - **tools**: remove excessive comments from .eslintrc (Rich Trott) [#5151](https://github.com/nodejs/node/pull/5151) +* [[`4c687c98e4`](https://github.com/nodejs/node/commit/4c687c98e4)] - **tools**: enable no-proto rule for linter (Jackson Tian) [#5140](https://github.com/nodejs/node/pull/5140) +* [[`28e4e6f312`](https://github.com/nodejs/node/commit/28e4e6f312)] - **tools**: disallow mixed spaces and tabs for indents (Rich Trott) [#5135](https://github.com/nodejs/node/pull/5135) +* [[`50c6fe8604`](https://github.com/nodejs/node/commit/50c6fe8604)] - **tools**: alphabetize eslint stylistic issues section (Rich Trott) +* [[`ee594f1ed7`](https://github.com/nodejs/node/commit/ee594f1ed7)] - **tools**: lint for empty character classes in regex (Rich Trott) [#5115](https://github.com/nodejs/node/pull/5115) +* [[`bf0e239e99`](https://github.com/nodejs/node/commit/bf0e239e99)] - **tools**: lint for spacing around unary operators (Rich Trott) [#5063](https://github.com/nodejs/node/pull/5063) +* [[`6345acb792`](https://github.com/nodejs/node/commit/6345acb792)] - **tools**: enable no-redeclare rule for linter (Rich Trott) [#5047](https://github.com/nodejs/node/pull/5047) +* [[`1dae175b62`](https://github.com/nodejs/node/commit/1dae175b62)] - **tools**: fix redeclared vars in doc/json.js (Rich Trott) [#5047](https://github.com/nodejs/node/pull/5047) +* [[`d1d220a1cf`](https://github.com/nodejs/node/commit/d1d220a1cf)] - **tools**: apply linting to doc tools (Rich Trott) [#4973](https://github.com/nodejs/node/pull/4973) +* [[`eddde1f60c`](https://github.com/nodejs/node/commit/eddde1f60c)] - **tools**: fix detecting constructor for JSON doc (Timothy Gu) [#4966](https://github.com/nodejs/node/pull/4966) +* [[`bcb327c8dd`](https://github.com/nodejs/node/commit/bcb327c8dd)] - **tools**: add property types in JSON documentation (Timothy Gu) [#4884](https://github.com/nodejs/node/pull/4884) +* [[`9a06a4c116`](https://github.com/nodejs/node/commit/9a06a4c116)] - **tools**: enable assorted ESLint error rules (Roman Reiss) [#4864](https://github.com/nodejs/node/pull/4864) +* [[`38474cfd49`](https://github.com/nodejs/node/commit/38474cfd49)] - **tools**: add arrow function rules to eslint (cjihrig) [#4813](https://github.com/nodejs/node/pull/4813) +* [[`f898abaa4f`](https://github.com/nodejs/node/commit/f898abaa4f)] - **tools**: fix setting path containing an ampersand (Brian White) [#4804](https://github.com/nodejs/node/pull/4804) +* [[`d10bee8e79`](https://github.com/nodejs/node/commit/d10bee8e79)] - **tools**: enable no-extra-semi rule in eslint (Michaël Zasso) [#2205](https://github.com/nodejs/node/pull/2205) +* [[`01006392cf`](https://github.com/nodejs/node/commit/01006392cf)] - **tools,doc**: fix linting errors (Rich Trott) [#5161](https://github.com/nodejs/node/pull/5161) +* [[`57a5f8731a`](https://github.com/nodejs/node/commit/57a5f8731a)] - **url**: change scoping of variables with let (Kári Tristan Helgason) [#4867](https://github.com/nodejs/node/pull/4867) + +## 2016-03-02, Version 4.3.2 'Argon' (LTS), @thealphanerd + +This is a security release with only a single commit, an update to openssl due to a recent security advisory. You can read more about the security advisory on [the Node.js website](https://nodejs.org/en/blog/vulnerability/openssl-march-2016/) + +### Notable changes + +* **openssl**: Upgrade from 1.0.2f to 1.0.2g (Ben Noordhuis) [#5507](https://github.com/nodejs/node/pull/5507) + - Fix a double-free defect in parsing malformed DSA keys that may potentially be used for DoS or memory corruption attacks. It is likely to be very difficult to use this defect for a practical attack and is therefore considered low severity for Node.js users. More info is available at [CVE-2016-0705](https://www.openssl.org/news/vulnerabilities.html#2016-0705). + - Fix a defect that can cause memory corruption in certain very rare cases relating to the internal `BN_hex2bn()` and `BN_dec2bn()` functions. It is believed that Node.js is not invoking the code paths that use these functions so practical attacks via Node.js using this defect are _unlikely_ to be possible. More info is available at [CVE-2016-0797](https://www.openssl.org/news/vulnerabilities.html#2016-0797). + - Fix a defect that makes the _[CacheBleed Attack](https://ssrg.nicta.com.au/projects/TS/cachebleed/)_ possible. This defect enables attackers to execute side-channel attacks leading to the potential recovery of entire RSA private keys. It only affects the Intel Sandy Bridge (and possibly older) microarchitecture when using hyper-threading. Newer microarchitectures, including Haswell, are unaffected. More info is available at [CVE-2016-0702](https://www.openssl.org/news/vulnerabilities.html#2016-0702). + +## Commits + +* [[`c133797d09`](https://github.com/nodejs/node/commit/c133797d09)] - **deps**: upgrade openssl to 1.0.2g (Ben Noordhuis) [#5507](https://github.com/nodejs/node/pull/5507) + +## 2016-02-16, Version 4.3.1 'Argon' (LTS), @thealphanerd + +### Notable changes + +* **buffer** + * make byteLength work with Buffer correctly (Jackson Tian) + - [#4738](https://github.com/nodejs/node/pull/4738) +* **debugger** + * guard against call from non-node context (Ben Noordhuis) + - [#4328](https://github.com/nodejs/node/pull/4328) + - fixes segfaults in debugger + * do not incept debug context (Myles Borins) + - [#4819](https://github.com/nodejs/node/pull/4819) + - fixes crash in debugger when using util methods +* **deps** + * update to http-parser 2.5.2 (James Snell) + - [#5238](https://github.com/nodejs/node/pull/5238) + +### Commits + +* [[`748d2b4de1`](https://github.com/nodejs/node/commit/748d2b4de1)] - **buffer**: make byteLength work with Buffer correctly (Jackson Tian) [#4738](https://github.com/nodejs/node/pull/4738) +* [[`fb615bdaf4`](https://github.com/nodejs/node/commit/fb615bdaf4)] - **buffer**: remove unnecessary TODO comments (Peter Geiss) [#4719](https://github.com/nodejs/node/pull/4719) +* [[`b8213ba7e1`](https://github.com/nodejs/node/commit/b8213ba7e1)] - **cluster**: ignore queryServer msgs on disconnection (Santiago Gimeno) [#4465](https://github.com/nodejs/node/pull/4465) +* [[`f8a676ed59`](https://github.com/nodejs/node/commit/f8a676ed59)] - **cluster**: fix race condition setting suicide prop (Santiago Gimeno) [#4349](https://github.com/nodejs/node/pull/4349) +* [[`9d4a226dad`](https://github.com/nodejs/node/commit/9d4a226dad)] - **crypto**: clear error stack in ECDH::Initialize (Fedor Indutny) [#4689](https://github.com/nodejs/node/pull/4689) +* [[`583f3347d8`](https://github.com/nodejs/node/commit/583f3347d8)] - **debugger**: remove variable redeclarations (Rich Trott) [#4633](https://github.com/nodejs/node/pull/4633) +* [[`667f7a7ab3`](https://github.com/nodejs/node/commit/667f7a7ab3)] - **debugger**: guard against call from non-node context (Ben Noordhuis) [#4328](https://github.com/nodejs/node/pull/4328) +* [[`188cff3c31`](https://github.com/nodejs/node/commit/188cff3c31)] - **deps**: update to http-parser 2.5.2 (James Snell) [#5238](https://github.com/nodejs/node/pull/5238) +* [[`6e829b44e3`](https://github.com/nodejs/node/commit/6e829b44e3)] - **dgram**: prevent disabled optimization of bind() (Brian White) [#4613](https://github.com/nodejs/node/pull/4613) +* [[`c3956d05b1`](https://github.com/nodejs/node/commit/c3956d05b1)] - **doc**: update list of personal traits in CoC (Kat Marchán) [#4801](https://github.com/nodejs/node/pull/4801) +* [[`39cb69ca21`](https://github.com/nodejs/node/commit/39cb69ca21)] - **doc**: style fixes for the TOC (Roman Reiss) [#4748](https://github.com/nodejs/node/pull/4748) +* [[`cb5986da81`](https://github.com/nodejs/node/commit/cb5986da81)] - **doc**: add `servername` parameter docs (Alexander Makarenko) [#4729](https://github.com/nodejs/node/pull/4729) +* [[`91066b5f34`](https://github.com/nodejs/node/commit/91066b5f34)] - **doc**: update branch-diff arguments in release doc (Rod Vagg) [#4691](https://github.com/nodejs/node/pull/4691) +* [[`9ca24de41d`](https://github.com/nodejs/node/commit/9ca24de41d)] - **doc**: add docs for more stream options (zoubin) [#4639](https://github.com/nodejs/node/pull/4639) +* [[`437d0e336d`](https://github.com/nodejs/node/commit/437d0e336d)] - **doc**: mention that http.Server inherits from net.Server (Ryan Sobol) [#4455](https://github.com/nodejs/node/pull/4455) +* [[`393e569160`](https://github.com/nodejs/node/commit/393e569160)] - **doc**: copyedit setTimeout() documentation (Rich Trott) [#4434](https://github.com/nodejs/node/pull/4434) +* [[`e2a682ecc3`](https://github.com/nodejs/node/commit/e2a682ecc3)] - **doc**: fix formatting in process.markdown (Rich Trott) [#4433](https://github.com/nodejs/node/pull/4433) +* [[`75b0ea85bd`](https://github.com/nodejs/node/commit/75b0ea85bd)] - **doc**: add path property to Write/ReadStream in fs.markdown (Claudio Rodriguez) [#4368](https://github.com/nodejs/node/pull/4368) +* [[`48c2783421`](https://github.com/nodejs/node/commit/48c2783421)] - **doc**: add docs working group (Bryan English) [#4244](https://github.com/nodejs/node/pull/4244) +* [[`c0432e9f56`](https://github.com/nodejs/node/commit/c0432e9f56)] - **doc**: restore ICU third-party software licenses (Richard Lau) [#4762](https://github.com/nodejs/node/pull/4762) +* [[`36a4159dab`](https://github.com/nodejs/node/commit/36a4159dab)] - **doc**: rebuild LICENSE using tools/license-builder.sh (Rod Vagg) [#4194](https://github.com/nodejs/node/pull/4194) +* [[`a2998a1bce`](https://github.com/nodejs/node/commit/a2998a1bce)] - **gitignore**: never ignore debug module (Michaël Zasso) [#2286](https://github.com/nodejs/node/pull/2286) +* [[`661b2557d9`](https://github.com/nodejs/node/commit/661b2557d9)] - **http**: remove variable redeclaration (Rich Trott) [#4612](https://github.com/nodejs/node/pull/4612) +* [[`1bb2967d48`](https://github.com/nodejs/node/commit/1bb2967d48)] - **http**: fix non-string header value concatenation (Brian White) [#4460](https://github.com/nodejs/node/pull/4460) +* [[`15ed64e34c`](https://github.com/nodejs/node/commit/15ed64e34c)] - **lib**: fix style issues after eslint update (Michaël Zasso) [nodejs/io.js#2286](https://github.com/nodejs/io.js/pull/2286) +* [[`2e92a1a6b4`](https://github.com/nodejs/node/commit/2e92a1a6b4)] - **module**: move unnecessary work for early return (Andres Suarez) [#3579](https://github.com/nodejs/node/pull/3579) +* [[`40c8e6d75d`](https://github.com/nodejs/node/commit/40c8e6d75d)] - **net**: remove hot path comment from connect (Evan Lucas) [#4648](https://github.com/nodejs/node/pull/4648) +* [[`8ed0c1c22c`](https://github.com/nodejs/node/commit/8ed0c1c22c)] - **net**: fix dns lookup for android (Josh Dague) [#4580](https://github.com/nodejs/node/pull/4580) +* [[`15fa555204`](https://github.com/nodejs/node/commit/15fa555204)] - **net, doc**: fix line wrapping lint in net.js (James M Snell) [#4588](https://github.com/nodejs/node/pull/4588) +* [[`1b070e48e0`](https://github.com/nodejs/node/commit/1b070e48e0)] - **node_contextify**: do not incept debug context (Myles Borins) [#4815](https://github.com/nodejs/node/issues/4815) +* [[`4fbcb47fe9`](https://github.com/nodejs/node/commit/4fbcb47fe9)] - **readline**: Remove XXX and output debuglog (Kohei TAKATA) [#4690](https://github.com/nodejs/node/pull/4690) +* [[`26f02405d0`](https://github.com/nodejs/node/commit/26f02405d0)] - **repl**: make sure historyPath is trimmed (Evan Lucas) [#4539](https://github.com/nodejs/node/pull/4539) +* [[`5990ba2a0a`](https://github.com/nodejs/node/commit/5990ba2a0a)] - **src**: remove redeclarations of variables (Rich Trott) [#4605](https://github.com/nodejs/node/pull/4605) +* [[`c41ed59dbc`](https://github.com/nodejs/node/commit/c41ed59dbc)] - **src**: don't check failure with ERR_peek_error() (Ben Noordhuis) [#4731](https://github.com/nodejs/node/pull/4731) +* [[`d71f9992f9`](https://github.com/nodejs/node/commit/d71f9992f9)] - **stream**: remove useless if test in transform (zoubin) [#4617](https://github.com/nodejs/node/pull/4617) +* [[`f205e9920e`](https://github.com/nodejs/node/commit/f205e9920e)] - **test**: fix tls-no-rsa-key flakiness (Santiago Gimeno) [#4043](https://github.com/nodejs/node/pull/4043) +* [[`447347cd62`](https://github.com/nodejs/node/commit/447347cd62)] - **test**: fix issues for space-in-parens ESLint rule (Roman Reiss) [#4753](https://github.com/nodejs/node/pull/4753) +* [[`be8274508c`](https://github.com/nodejs/node/commit/be8274508c)] - **test**: improve test-cluster-disconnect-suicide-race (Rich Trott) [#4739](https://github.com/nodejs/node/pull/4739) +* [[`0178001163`](https://github.com/nodejs/node/commit/0178001163)] - **test**: make test-cluster-disconnect-leak reliable (Rich Trott) [#4736](https://github.com/nodejs/node/pull/4736) +* [[`d615757da2`](https://github.com/nodejs/node/commit/d615757da2)] - **test**: fix flaky test-net-socket-local-address (cjihrig) [#4650](https://github.com/nodejs/node/pull/4650) +* [[`baa0a3dff5`](https://github.com/nodejs/node/commit/baa0a3dff5)] - **test**: fix race in test-net-server-pause-on-connect (Rich Trott) [#4637](https://github.com/nodejs/node/pull/4637) +* [[`909b5167cb`](https://github.com/nodejs/node/commit/909b5167cb)] - **test**: remove 1 second delay from test (Rich Trott) [#4616](https://github.com/nodejs/node/pull/4616) +* [[`8ea76608ed`](https://github.com/nodejs/node/commit/8ea76608ed)] - **test**: move resource intensive tests to sequential (Rich Trott) [#4615](https://github.com/nodejs/node/pull/4615) +* [[`7afcdd358e`](https://github.com/nodejs/node/commit/7afcdd358e)] - **test**: require common module only once (Rich Trott) [#4611](https://github.com/nodejs/node/pull/4611) +* [[`0e02eb0bbe`](https://github.com/nodejs/node/commit/0e02eb0bbe)] - **test**: only include http module once (Rich Trott) [#4606](https://github.com/nodejs/node/pull/4606) +* [[`34d9e48bb6`](https://github.com/nodejs/node/commit/34d9e48bb6)] - **test**: fix `http-upgrade-client` flakiness (Santiago Gimeno) [#4602](https://github.com/nodejs/node/pull/4602) +* [[`556703d531`](https://github.com/nodejs/node/commit/556703d531)] - **test**: fix flaky unrefed timers test (Rich Trott) [#4599](https://github.com/nodejs/node/pull/4599) +* [[`3d5bc69796`](https://github.com/nodejs/node/commit/3d5bc69796)] - **test**: fix `http-upgrade-agent` flakiness (Santiago Gimeno) [#4520](https://github.com/nodejs/node/pull/4520) +* [[`ec24d3767b`](https://github.com/nodejs/node/commit/ec24d3767b)] - **test**: fix flaky test-cluster-shared-leak (Rich Trott) [#4510](https://github.com/nodejs/node/pull/4510) +* [[`a256790327`](https://github.com/nodejs/node/commit/a256790327)] - **test**: fix flaky cluster-net-send (Brian White) [#4444](https://github.com/nodejs/node/pull/4444) +* [[`6809c2be1a`](https://github.com/nodejs/node/commit/6809c2be1a)] - **test**: fix flaky child-process-fork-regr-gh-2847 (Brian White) [#4442](https://github.com/nodejs/node/pull/4442) +* [[`e6448aa36b`](https://github.com/nodejs/node/commit/e6448aa36b)] - **test**: use addon.md block headings as test dir names (Rod Vagg) [#4412](https://github.com/nodejs/node/pull/4412) +* [[`305d340fca`](https://github.com/nodejs/node/commit/305d340fca)] - **test**: test each block in addon.md contains js & cc (Rod Vagg) [#4411](https://github.com/nodejs/node/pull/4411) +* [[`f213406575`](https://github.com/nodejs/node/commit/f213406575)] - **test**: fix tls-multi-key race condition (Santiago Gimeno) [#3966](https://github.com/nodejs/node/pull/3966) +* [[`607f545568`](https://github.com/nodejs/node/commit/607f545568)] - **test**: fix style issues after eslint update (Michaël Zasso) [nodejs/io.js#2286](https://github.com/nodejs/io.js/pull/2286) +* [[`aefb20a94f`](https://github.com/nodejs/node/commit/aefb20a94f)] - **tls**: copy client CAs and cert store on CertCb (Fedor Indutny) [#3537](https://github.com/nodejs/node/pull/3537) +* [[`7821b3e305`](https://github.com/nodejs/node/commit/7821b3e305)] - **tls_legacy**: do not read on OpenSSL's stack (Fedor Indutny) [#4624](https://github.com/nodejs/node/pull/4624) +* [[`b66db49f94`](https://github.com/nodejs/node/commit/b66db49f94)] - **tools**: add support for subkeys in release tools (Myles Borins) [#4807](https://github.com/nodejs/node/pull/4807) +* [[`837ebd1985`](https://github.com/nodejs/node/commit/837ebd1985)] - **tools**: enable space-in-parens ESLint rule (Roman Reiss) [#4753](https://github.com/nodejs/node/pull/4753) +* [[`066d5e7da2`](https://github.com/nodejs/node/commit/066d5e7da2)] - **tools**: fix style issue after eslint update (Michaël Zasso) [nodejs/io.js#2286](https://github.com/nodejs/io.js/pull/2286) +* [[`b20ea69f46`](https://github.com/nodejs/node/commit/b20ea69f46)] - **tools**: update eslint config (Michaël Zasso) [nodejs/io.js#2286](https://github.com/nodejs/io.js/pull/2286) +* [[`2e0352d50c`](https://github.com/nodejs/node/commit/2e0352d50c)] - **tools**: update eslint to v1.10.3 (Michaël Zasso) [nodejs/io.js#2286](https://github.com/nodejs/io.js/pull/2286) +* [[`c96800a432`](https://github.com/nodejs/node/commit/c96800a432)] - **tools**: fix license-builder.sh for ICU (Richard Lau) [#4762](https://github.com/nodejs/node/pull/4762) +* [[`720b03dca7`](https://github.com/nodejs/node/commit/720b03dca7)] - **tools**: add license-builder.sh to construct LICENSE (Rod Vagg) [#4194](https://github.com/nodejs/node/pull/4194) + +## 2016-02-09, Version 4.3.0 'Argon' (LTS), @jasnell + +This is an important security release. All Node.js users should consult the security release summary at nodejs.org for details on patched vulnerabilities. + +Note that this release includes a non-backward compatible change to address a security issue. This change increases the version of the LTS v4.x line to v4.3.0. There will be *no further updates* to v4.2.x. + +### Notable changes + +* **http**: fix defects in HTTP header parsing for requests and responses that can allow request smuggling (CVE-2016-2086) or response splitting (CVE-2016-2216). HTTP header parsing now aligns more closely with the HTTP spec including restricting the acceptable characters. +* **http-parser**: upgrade from 2.5.0 to 2.5.1 +* **openssl**: upgrade from 1.0.2e to 1.0.2f. To mitigate against the Logjam attack, TLS clients now reject Diffie-Hellman handshakes with parameters shorter than 1024-bits, up from the previous limit of 768-bits. +* **src**: + - introduce new `--security-revert={cvenum}` command line flag for selective reversion of specific CVE fixes + - allow the fix for CVE-2016-2216 to be selectively reverted using `--security-revert=CVE-2016-2216` + +### Commits + +* [[`d94f864abd`](https://github.com/nodejs/node/commit/d94f864abd0933c125afeb84b6f72ec709c63b43)] - **deps**: add -no_rand_screen to openssl s_client (Shigeki Ohtsu) [#1836](https://github.com/nodejs/node/pull/1836) +* [[`136295e202`](https://github.com/nodejs/node/commit/136295e202)] - **deps**: upgrade openssl sources to 1.0.2f (Myles Borins) [#4961](https://github.com/nodejs/node/pull/4961) +* [[`0eae95eae3`](https://github.com/nodejs/node/commit/0eae95eae3)] - **(SEMVER-MINOR)** **deps**: update http-parser to version 2.5.1 (James M Snell) +* [[`cf2b714b02`](https://github.com/nodejs/node/commit/cf2b714b02)] - **(SEMVER-MINOR)** **http**: strictly forbid invalid characters from headers (James M Snell) +* [[`49ae2e0334`](https://github.com/nodejs/node/commit/49ae2e0334)] - **src**: avoid compiler warning in node_revert.cc (James M Snell) +* [[`da3750f981`](https://github.com/nodejs/node/commit/da3750f981)] - **(SEMVER-MAJOR)** **src**: add --security-revert command line flag (James M Snell) + +## 2016-01-21, Version 4.2.6 'Argon' (LTS), @TheAlphaNerd + +### Notable changes + +* Fix regression in debugger and profiler functionality + +### Known issues + +* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/node/issues/1264). +* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/node/issues/690) +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/node/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). + +### Commits + +* [[`1408f7abb1`](https://github.com/nodejs/node/commit/1408f7abb1)] - **module,src**: do not wrap modules with -1 lineOffset (cjihrig) [#4298](https://github.com/nodejs/node/pull/4298) +* [[`1f8e1472cc`](https://github.com/nodejs/node/commit/1f8e1472cc)] - **test**: add test for debugging one line files (cjihrig) [#4298](https://github.com/nodejs/node/pull/4298) + + +## 2016-01-20, Version 4.2.5 'Argon' (LTS), @TheAlphaNerd + +Maintenance update. + +### Notable changes + +* **assert** + * accommodate ES6 classes that extend Error (Rich Trott) [#4166](https://github.com/nodejs/node/pull/4166) +* **build** + * add "--partly-static" build options (Super Zheng) [#4152](https://github.com/nodejs/node/pull/4152) +* **deps** + * backport 066747e from upstream V8 (Ali Ijaz Sheikh) [#4655](https://github.com/nodejs/node/pull/4655) + * backport 200315c from V8 upstream (Vladimir Kurchatkin) [#4128](https://github.com/nodejs/node/pull/4128) + * upgrade libuv to 1.8.0 (Saúl Ibarra Corretgé) +* **docs** + * various updates landed in 70 different commits! +* **repl** + * attach location info to syntax errors (cjihrig) [#4013](https://github.com/nodejs/node/pull/4013) + * display error message when loading directory (Prince J Wesley) [#4170](https://github.com/nodejs/node/pull/4170) +* **tests** + * various updates landed in over 50 commits +* **tools** + * add tap output to cpplint (Johan Bergström) [#3448](https://github.com/nodejs/node/pull/3448) +* **util** + * allow lookup of hidden values (cjihrig) [#3988](https://github.com/nodejs/node/pull/3988) + +### Known issues + +* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/node/issues/1264). +* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/node/issues/690) +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/node/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). + +### Commits + + +* [[`87181cd74c`](https://github.com/nodejs/node/commit/87181cd74c)] - **assert**: accommodate ES6 classes that extend Error (Rich Trott) [#4166](https://github.com/nodejs/node/pull/4166) +* [[`901172a783`](https://github.com/nodejs/node/commit/901172a783)] - **assert**: typed array deepequal performance fix (Claudio Rodriguez) [#4330](https://github.com/nodejs/node/pull/4330) +* [[`55336810ee`](https://github.com/nodejs/node/commit/55336810ee)] - **async_wrap**: call callback in destructor (Trevor Norris) [#3461](https://github.com/nodejs/node/pull/3461) +* [[`a8b45e9e96`](https://github.com/nodejs/node/commit/a8b45e9e96)] - **async_wrap**: new instances get uid (Trevor Norris) [#3461](https://github.com/nodejs/node/pull/3461) +* [[`49f16d77c4`](https://github.com/nodejs/node/commit/49f16d77c4)] - **async_wrap**: allow some hooks to be optional (Trevor Norris) [#3461](https://github.com/nodejs/node/pull/3461) +* [[`44ee33f945`](https://github.com/nodejs/node/commit/44ee33f945)] - **buffer**: refactor create buffer (Jackson Tian) [#4340](https://github.com/nodejs/node/pull/4340) +* [[`138d004ac0`](https://github.com/nodejs/node/commit/138d004ac0)] - **buffer**: faster case for create Buffer from new Buffer(0) (Jackson Tian) [#4326](https://github.com/nodejs/node/pull/4326) +* [[`c6dc2a1609`](https://github.com/nodejs/node/commit/c6dc2a1609)] - **buffer**: Prevent Buffer constructor deopt (Bryce Baril) [#4158](https://github.com/nodejs/node/pull/4158) +* [[`a320045e68`](https://github.com/nodejs/node/commit/a320045e68)] - **buffer**: default to UTF8 in byteLength() (Tom Gallacher) [#4010](https://github.com/nodejs/node/pull/4010) +* [[`c5f71ac771`](https://github.com/nodejs/node/commit/c5f71ac771)] - **build**: add "--partly-static" build options (Super Zheng) [#4152](https://github.com/nodejs/node/pull/4152) +* [[`e6c25335ea`](https://github.com/nodejs/node/commit/e6c25335ea)] - **build**: omit -gline-tables-only for --enable-asan (Ben Noordhuis) [#3680](https://github.com/nodejs/node/pull/3680) +* [[`80b4ba286c`](https://github.com/nodejs/node/commit/80b4ba286c)] - **build**: Updates for AIX npm support - part 1 (Michael Dawson) [#3114](https://github.com/nodejs/node/pull/3114) +* [[`35e32985ca`](https://github.com/nodejs/node/commit/35e32985ca)] - **child_process**: guard against race condition (Rich Trott) [#4418](https://github.com/nodejs/node/pull/4418) +* [[`48564204f0`](https://github.com/nodejs/node/commit/48564204f0)] - **child_process**: flush consuming streams (Dave) [#4071](https://github.com/nodejs/node/pull/4071) +* [[`481d59a74c`](https://github.com/nodejs/node/commit/481d59a74c)] - **configure**: fix arm vfpv2 (Jörg Krause) [#4203](https://github.com/nodejs/node/pull/4203) +* [[`d19da6638d`](https://github.com/nodejs/node/commit/d19da6638d)] - **crypto**: load PFX chain the same way as regular one (Fedor Indutny) [#4165](https://github.com/nodejs/node/pull/4165) +* [[`b8e75de1f3`](https://github.com/nodejs/node/commit/b8e75de1f3)] - **crypto**: fix native module compilation with FIPS (Stefan Budeanu) [#4023](https://github.com/nodejs/node/pull/4023) +* [[`b7c3fb7f75`](https://github.com/nodejs/node/commit/b7c3fb7f75)] - **crypto**: disable crypto.createCipher in FIPS mode (Stefan Budeanu) [#3754](https://github.com/nodejs/node/pull/3754) +* [[`31b4091a1e`](https://github.com/nodejs/node/commit/31b4091a1e)] - **debugger**: also exit when the repl emits 'exit' (Felix Böhm) [#2369](https://github.com/nodejs/node/pull/2369) +* [[`9baa5618f5`](https://github.com/nodejs/node/commit/9baa5618f5)] - **deps**: backport 066747e from upstream V8 (Ali Ijaz Sheikh) [#4655](https://github.com/nodejs/node/pull/4655) +* [[`c3a9d8a62e`](https://github.com/nodejs/node/commit/c3a9d8a62e)] - **deps**: backport 200315c from V8 upstream (Vladimir Kurchatkin) [#4128](https://github.com/nodejs/node/pull/4128) +* [[`1ebb0c0fdf`](https://github.com/nodejs/node/commit/1ebb0c0fdf)] - **deps**: upgrade libuv to 1.8.0 (Saúl Ibarra Corretgé) [#4276](https://github.com/nodejs/node/pull/4276) +* [[`253fe3e7c8`](https://github.com/nodejs/node/commit/253fe3e7c8)] - **dns**: remove nonexistant exports.ADNAME (Roman Reiss) [#3051](https://github.com/nodejs/node/pull/3051) +* [[`8c2b65ad82`](https://github.com/nodejs/node/commit/8c2b65ad82)] - **doc**: clarify protocol default in http.request() (cjihrig) [#4714](https://github.com/nodejs/node/pull/4714) +* [[`33e72e135f`](https://github.com/nodejs/node/commit/33e72e135f)] - **doc**: update links to use https where possible (jpersson) [#4054](https://github.com/nodejs/node/pull/4054) +* [[`5f4aa79410`](https://github.com/nodejs/node/commit/5f4aa79410)] - **doc**: clarify explanation of first stream section (Vitor Cortez) [#4234](https://github.com/nodejs/node/pull/4234) +* [[`295ca5bfb2`](https://github.com/nodejs/node/commit/295ca5bfb2)] - **doc**: add branch-diff example to releases.md (Myles Borins) [#4636](https://github.com/nodejs/node/pull/4636) +* [[`18f5cd8710`](https://github.com/nodejs/node/commit/18f5cd8710)] - **doc**: update stylesheet to match frontpage (Roman Reiss) [#4621](https://github.com/nodejs/node/pull/4621) +* [[`2f40715f08`](https://github.com/nodejs/node/commit/2f40715f08)] - **doc**: adds usage of readline line-by-line parsing (Robert Jefe Lindstaedt) [#4609](https://github.com/nodejs/node/pull/4609) +* [[`5b45a464ee`](https://github.com/nodejs/node/commit/5b45a464ee)] - **doc**: document http's server.listen return value (Sequoia McDowell) [#4590](https://github.com/nodejs/node/pull/4590) +* [[`bd31740339`](https://github.com/nodejs/node/commit/bd31740339)] - **doc**: label http.IncomingMessage as a Class (Sequoia McDowell) [#4589](https://github.com/nodejs/node/pull/4589) +* [[`bcd2cbbb93`](https://github.com/nodejs/node/commit/bcd2cbbb93)] - **doc**: fix description about the latest-codename (Minwoo Jung) [#4583](https://github.com/nodejs/node/pull/4583) +* [[`0b12bcb35d`](https://github.com/nodejs/node/commit/0b12bcb35d)] - **doc**: add Evan Lucas to Release Team (Evan Lucas) [#4579](https://github.com/nodejs/node/pull/4579) +* [[`e20b1f6f10`](https://github.com/nodejs/node/commit/e20b1f6f10)] - **doc**: add Myles Borins to Release Team (Myles Borins) [#4578](https://github.com/nodejs/node/pull/4578) +* [[`54977e63eb`](https://github.com/nodejs/node/commit/54977e63eb)] - **doc**: add missing backtick for readline (Brian White) [#4549](https://github.com/nodejs/node/pull/4549) +* [[`5d6bed895c`](https://github.com/nodejs/node/commit/5d6bed895c)] - **doc**: bring releases.md up to date (cjihrig) [#4540](https://github.com/nodejs/node/pull/4540) +* [[`0cd2252e85`](https://github.com/nodejs/node/commit/0cd2252e85)] - **doc**: fix numbering in stream.markdown (Richard Sun) [#4538](https://github.com/nodejs/node/pull/4538) +* [[`8574d91f27`](https://github.com/nodejs/node/commit/8574d91f27)] - **doc**: stronger suggestion for userland assert (Wyatt Preul) [#4535](https://github.com/nodejs/node/pull/4535) +* [[`a7bcf8b84d`](https://github.com/nodejs/node/commit/a7bcf8b84d)] - **doc**: close backtick in process.title description (Dave) [#4534](https://github.com/nodejs/node/pull/4534) +* [[`0ceb3148b0`](https://github.com/nodejs/node/commit/0ceb3148b0)] - **doc**: improvements to events.markdown copy (James M Snell) [#4468](https://github.com/nodejs/node/pull/4468) +* [[`bf56d509b9`](https://github.com/nodejs/node/commit/bf56d509b9)] - **doc**: explain ClientRequest#setTimeout time unit (Ben Ripkens) [#4458](https://github.com/nodejs/node/pull/4458) +* [[`d927c51be3`](https://github.com/nodejs/node/commit/d927c51be3)] - **doc**: improvements to errors.markdown copy (James M Snell) [#4454](https://github.com/nodejs/node/pull/4454) +* [[`ceea6df581`](https://github.com/nodejs/node/commit/ceea6df581)] - **doc**: improvements to dns.markdown copy (James M Snell) [#4449](https://github.com/nodejs/node/pull/4449) +* [[`506f2f8ed1`](https://github.com/nodejs/node/commit/506f2f8ed1)] - **doc**: add anchors for _transform _flush _writev in stream.markdown (iamchenxin) [#4448](https://github.com/nodejs/node/pull/4448) +* [[`74bcad0b78`](https://github.com/nodejs/node/commit/74bcad0b78)] - **doc**: improvements to dgram.markdown copy (James M Snell) [#4437](https://github.com/nodejs/node/pull/4437) +* [[`e244d560c9`](https://github.com/nodejs/node/commit/e244d560c9)] - **doc**: improvements to debugger.markdown copy (James M Snell) [#4436](https://github.com/nodejs/node/pull/4436) +* [[`df7e1281a5`](https://github.com/nodejs/node/commit/df7e1281a5)] - **doc**: improvements to console.markdown copy (James M Snell) [#4428](https://github.com/nodejs/node/pull/4428) +* [[`abb17cc6c1`](https://github.com/nodejs/node/commit/abb17cc6c1)] - **doc**: fix spelling error in lib/url.js comment (Nik Nyby) [#4390](https://github.com/nodejs/node/pull/4390) +* [[`823269db2d`](https://github.com/nodejs/node/commit/823269db2d)] - **doc**: improve assert.markdown copy (James M Snell) [#4360](https://github.com/nodejs/node/pull/4360) +* [[`2b1804f6cb`](https://github.com/nodejs/node/commit/2b1804f6cb)] - **doc**: copyedit releases.md (Rich Trott) [#4384](https://github.com/nodejs/node/pull/4384) +* [[`2b142fd876`](https://github.com/nodejs/node/commit/2b142fd876)] - **doc**: catch the WORKING_GROUPS.md bootstrap docs up to date (James M Snell) [#4367](https://github.com/nodejs/node/pull/4367) +* [[`ed87873de3`](https://github.com/nodejs/node/commit/ed87873de3)] - **doc**: fix link in addons.markdown (Nicholas Young) [#4331](https://github.com/nodejs/node/pull/4331) +* [[`fe693b7a4f`](https://github.com/nodejs/node/commit/fe693b7a4f)] - **doc**: Typo in buffer.markdown referencing buf.write() (chrisjohn404) [#4324](https://github.com/nodejs/node/pull/4324) +* [[`764df2166e`](https://github.com/nodejs/node/commit/764df2166e)] - **doc**: document the cache parameter for fs.realpathSync (Jackson Tian) [#4285](https://github.com/nodejs/node/pull/4285) +* [[`61f91b2f29`](https://github.com/nodejs/node/commit/61f91b2f29)] - **doc**: fix, modernize examples in docs (James M Snell) [#4282](https://github.com/nodejs/node/pull/4282) +* [[`d87ad302ce`](https://github.com/nodejs/node/commit/d87ad302ce)] - **doc**: clarify error events in HTTP module documentation (Lenny Markus) [#4275](https://github.com/nodejs/node/pull/4275) +* [[`7983577e41`](https://github.com/nodejs/node/commit/7983577e41)] - **doc**: fix improper http.get sample code (Hideki Yamamura) [#4263](https://github.com/nodejs/node/pull/4263) +* [[`6c30d087e5`](https://github.com/nodejs/node/commit/6c30d087e5)] - **doc**: Fixing broken links to the v8 wiki (Tom Gallacher) [#4241](https://github.com/nodejs/node/pull/4241) +* [[`cf214e56e4`](https://github.com/nodejs/node/commit/cf214e56e4)] - **doc**: move description of 'equals' method to right place (janriemer) [#4227](https://github.com/nodejs/node/pull/4227) +* [[`fb8e8dbb92`](https://github.com/nodejs/node/commit/fb8e8dbb92)] - **doc**: copyedit console doc (Rich Trott) [#4225](https://github.com/nodejs/node/pull/4225) +* [[`4ccf04c229`](https://github.com/nodejs/node/commit/4ccf04c229)] - **doc**: add mcollina to collaborators (Matteo Collina) [#4220](https://github.com/nodejs/node/pull/4220) +* [[`59654c21d4`](https://github.com/nodejs/node/commit/59654c21d4)] - **doc**: add rmg to collaborators (Ryan Graham) [#4219](https://github.com/nodejs/node/pull/4219) +* [[`bfe1a6bd2b`](https://github.com/nodejs/node/commit/bfe1a6bd2b)] - **doc**: add calvinmetcalf to collaborators (Calvin Metcalf) [#4218](https://github.com/nodejs/node/pull/4218) +* [[`5140c404ae`](https://github.com/nodejs/node/commit/5140c404ae)] - **doc**: harmonize description of `ca` argument (Ben Noordhuis) [#4213](https://github.com/nodejs/node/pull/4213) +* [[`2e642051cf`](https://github.com/nodejs/node/commit/2e642051cf)] - **doc**: copyedit child_process doc (Rich Trott) [#4188](https://github.com/nodejs/node/pull/4188) +* [[`7920f8dbde`](https://github.com/nodejs/node/commit/7920f8dbde)] - **doc**: copyedit buffer doc (Rich Trott) [#4187](https://github.com/nodejs/node/pull/4187) +* [[`c35a409cbe`](https://github.com/nodejs/node/commit/c35a409cbe)] - **doc**: clarify assert.fail doc (Rich Trott) [#4186](https://github.com/nodejs/node/pull/4186) +* [[`6235fdf72e`](https://github.com/nodejs/node/commit/6235fdf72e)] - **doc**: copyedit addons doc (Rich Trott) [#4185](https://github.com/nodejs/node/pull/4185) +* [[`990e7ff93e`](https://github.com/nodejs/node/commit/990e7ff93e)] - **doc**: update AUTHORS list (Rod Vagg) [#4183](https://github.com/nodejs/node/pull/4183) +* [[`8d676ef55e`](https://github.com/nodejs/node/commit/8d676ef55e)] - **doc**: change references from node to Node.js (Roman Klauke) [#4177](https://github.com/nodejs/node/pull/4177) +* [[`1c34b139a2`](https://github.com/nodejs/node/commit/1c34b139a2)] - **doc**: add brief Node.js overview to README (wurde) [#4174](https://github.com/nodejs/node/pull/4174) +* [[`27b9b72ab0`](https://github.com/nodejs/node/commit/27b9b72ab0)] - **doc**: add iarna to collaborators (Rebecca Turner) [#4144](https://github.com/nodejs/node/pull/4144) +* [[`683d8dd564`](https://github.com/nodejs/node/commit/683d8dd564)] - **doc**: add JungMinu to collaborators (Minwoo Jung) [#4143](https://github.com/nodejs/node/pull/4143) +* [[`17b06dfa94`](https://github.com/nodejs/node/commit/17b06dfa94)] - **doc**: add zkat to collaborators (Kat Marchán) [#4142](https://github.com/nodejs/node/pull/4142) +* [[`39364c4c72`](https://github.com/nodejs/node/commit/39364c4c72)] - **doc**: improve child_process.markdown wording (yorkie) [#4138](https://github.com/nodejs/node/pull/4138) +* [[`abe452835f`](https://github.com/nodejs/node/commit/abe452835f)] - **doc**: url.format - true slash postfix behaviour (fansworld-claudio) [#4119](https://github.com/nodejs/node/pull/4119) +* [[`6dd375cfe2`](https://github.com/nodejs/node/commit/6dd375cfe2)] - **doc**: document backlog for server.listen() variants (Jan Schär) [#4025](https://github.com/nodejs/node/pull/4025) +* [[`b71a3b363a`](https://github.com/nodejs/node/commit/b71a3b363a)] - **doc**: fixup socket.remoteAddress (Arthur Gautier) [#4198](https://github.com/nodejs/node/pull/4198) +* [[`e2fe214857`](https://github.com/nodejs/node/commit/e2fe214857)] - **doc**: add links and backticks around names (jpersson) [#4054](https://github.com/nodejs/node/pull/4054) +* [[`bb158f8aed`](https://github.com/nodejs/node/commit/bb158f8aed)] - **doc**: s/node.js/Node.js in readme (Rod Vagg) [#3998](https://github.com/nodejs/node/pull/3998) +* [[`f55491ad47`](https://github.com/nodejs/node/commit/f55491ad47)] - **doc**: move fs.existsSync() deprecation message (Martin Forsberg) [#3942](https://github.com/nodejs/node/pull/3942) +* [[`8c5b847f5b`](https://github.com/nodejs/node/commit/8c5b847f5b)] - **doc**: Describe FIPSDIR environment variable (Stefan Budeanu) [#3752](https://github.com/nodejs/node/pull/3752) +* [[`70c95ea0e5`](https://github.com/nodejs/node/commit/70c95ea0e5)] - **doc**: add warning about Windows process groups (Roman Klauke) [#3681](https://github.com/nodejs/node/pull/3681) +* [[`46c59b7256`](https://github.com/nodejs/node/commit/46c59b7256)] - **doc**: add CTC meeting minutes 2015-10-28 (Rod Vagg) [#3661](https://github.com/nodejs/node/pull/3661) +* [[`7ffd299a1d`](https://github.com/nodejs/node/commit/7ffd299a1d)] - **doc**: add final full stop in CONTRIBUTING.md (Emily Aviva Kapor-Mater) [#3576](https://github.com/nodejs/node/pull/3576) +* [[`1f78bff7ce`](https://github.com/nodejs/node/commit/1f78bff7ce)] - **doc**: add TSC meeting minutes 2015-10-21 (Rod Vagg) [#3480](https://github.com/nodejs/node/pull/3480) +* [[`2e623ff024`](https://github.com/nodejs/node/commit/2e623ff024)] - **doc**: add TSC meeting minutes 2015-10-14 (Rod Vagg) [#3463](https://github.com/nodejs/node/pull/3463) +* [[`b9c69964bb`](https://github.com/nodejs/node/commit/b9c69964bb)] - **doc**: add TSC meeting minutes 2015-10-07 (Rod Vagg) [#3364](https://github.com/nodejs/node/pull/3364) +* [[`f31d23c724`](https://github.com/nodejs/node/commit/f31d23c724)] - **doc**: add TSC meeting minutes 2015-09-30 (Rod Vagg) [#3235](https://github.com/nodejs/node/pull/3235) +* [[`ae8e3af178`](https://github.com/nodejs/node/commit/ae8e3af178)] - **doc**: update irc channels: #node.js and #node-dev (Nelson Pecora) [#2743](https://github.com/nodejs/node/pull/2743) +* [[`830caeb1bd`](https://github.com/nodejs/node/commit/830caeb1bd)] - **doc, test**: symbols as event names (Bryan English) [#4151](https://github.com/nodejs/node/pull/4151) +* [[`82cbfcdcbe`](https://github.com/nodejs/node/commit/82cbfcdcbe)] - **docs**: update gpg key for Myles Borins (Myles Borins) [#4657](https://github.com/nodejs/node/pull/4657) +* [[`50b72aa5a3`](https://github.com/nodejs/node/commit/50b72aa5a3)] - **docs**: fix npm command in releases.md (Myles Borins) [#4656](https://github.com/nodejs/node/pull/4656) +* [[`5bf56882e1`](https://github.com/nodejs/node/commit/5bf56882e1)] - **fs,doc**: use `target` instead of `destination` (yorkie) [#3912](https://github.com/nodejs/node/pull/3912) +* [[`41fcda840c`](https://github.com/nodejs/node/commit/41fcda840c)] - **http**: use `self.keepAlive` instead of `self.options.keepAlive` (Damian Schenkelman) [#4407](https://github.com/nodejs/node/pull/4407) +* [[`3ff237333d`](https://github.com/nodejs/node/commit/3ff237333d)] - **http**: Remove an unnecessary assignment (Bo Borgerson) [#4323](https://github.com/nodejs/node/pull/4323) +* [[`39dc054572`](https://github.com/nodejs/node/commit/39dc054572)] - **http**: remove excess calls to removeSocket (Dave) [#4172](https://github.com/nodejs/node/pull/4172) +* [[`751fbd84dd`](https://github.com/nodejs/node/commit/751fbd84dd)] - **https**: use `servername` in agent key (Fedor Indutny) [#4389](https://github.com/nodejs/node/pull/4389) +* [[`7a1a0a0055`](https://github.com/nodejs/node/commit/7a1a0a0055)] - **lib**: remove unused modules (Rich Trott) [#4683](https://github.com/nodejs/node/pull/4683) +* [[`3d81ea99bb`](https://github.com/nodejs/node/commit/3d81ea99bb)] - **lib,test**: update let to const where applicable (Sakthipriyan Vairamani) [#3152](https://github.com/nodejs/node/pull/3152) +* [[`8a9869eeab`](https://github.com/nodejs/node/commit/8a9869eeab)] - **module**: fix column offsets in errors (Tristian Flanagan) [#2867](https://github.com/nodejs/node/pull/2867) +* [[`0ae90ecd3d`](https://github.com/nodejs/node/commit/0ae90ecd3d)] - **module,repl**: remove repl require() hack (Ben Noordhuis) [#4026](https://github.com/nodejs/node/pull/4026) +* [[`a7367fdc1e`](https://github.com/nodejs/node/commit/a7367fdc1e)] - **net**: small code cleanup (Jan Schär) [#3943](https://github.com/nodejs/node/pull/3943) +* [[`03e9495cc2`](https://github.com/nodejs/node/commit/03e9495cc2)] - **node**: remove unused variables in AppendExceptionLine (Yazhong Liu) [#4264](https://github.com/nodejs/node/pull/4264) +* [[`06113b8711`](https://github.com/nodejs/node/commit/06113b8711)] - **node**: s/doNTCallbackX/nextTickCallbackWithXArgs/ (Rod Vagg) [#4167](https://github.com/nodejs/node/pull/4167) +* [[`8ce6843fe4`](https://github.com/nodejs/node/commit/8ce6843fe4)] - **os**: fix crash in GetInterfaceAddresses (Martin Bark) [#4272](https://github.com/nodejs/node/pull/4272) +* [[`53dcbb6aa4`](https://github.com/nodejs/node/commit/53dcbb6aa4)] - **repl**: remove unused function (Rich Trott) +* [[`db0e906fc1`](https://github.com/nodejs/node/commit/db0e906fc1)] - **repl**: Fixed node repl history edge case. (Mudit Ameta) [#4108](https://github.com/nodejs/node/pull/4108) +* [[`9855fab05f`](https://github.com/nodejs/node/commit/9855fab05f)] - **repl**: use String#repeat instead of Array#join (Evan Lucas) [#3900](https://github.com/nodejs/node/pull/3900) +* [[`41882e4077`](https://github.com/nodejs/node/commit/41882e4077)] - **repl**: fix require('3rdparty') regression (Ben Noordhuis) [#4215](https://github.com/nodejs/node/pull/4215) +* [[`93afc39d4a`](https://github.com/nodejs/node/commit/93afc39d4a)] - **repl**: attach location info to syntax errors (cjihrig) [#4013](https://github.com/nodejs/node/pull/4013) +* [[`d4806675a6`](https://github.com/nodejs/node/commit/d4806675a6)] - **repl**: display error message when loading directory (Prince J Wesley) [#4170](https://github.com/nodejs/node/pull/4170) +* [[`3080bdc7d7`](https://github.com/nodejs/node/commit/3080bdc7d7)] - **src**: define Is* util functions with macros (cjihrig) [#4118](https://github.com/nodejs/node/pull/4118) +* [[`2b8a32a13b`](https://github.com/nodejs/node/commit/2b8a32a13b)] - **src**: refactor vcbuild configure args creation (Rod Vagg) [#3399](https://github.com/nodejs/node/pull/3399) +* [[`d47f6ba768`](https://github.com/nodejs/node/commit/d47f6ba768)] - **src**: fix deprecation message for ErrnoException (Martin von Gagern) [#4269](https://github.com/nodejs/node/pull/4269) +* [[`5ba08fbf76`](https://github.com/nodejs/node/commit/5ba08fbf76)] - **src**: fix line numbers on core errors (cjihrig) [#4254](https://github.com/nodejs/node/pull/4254) +* [[`70974e9362`](https://github.com/nodejs/node/commit/70974e9362)] - **src**: use GetCurrentProcessId() for process.pid (Ben Noordhuis) [#4163](https://github.com/nodejs/node/pull/4163) +* [[`c96eca164f`](https://github.com/nodejs/node/commit/c96eca164f)] - **src**: don't print garbage errors (cjihrig) [#4112](https://github.com/nodejs/node/pull/4112) +* [[`f61412c753`](https://github.com/nodejs/node/commit/f61412c753)] - **test**: mark test-debug-no-context is flaky (Rich Trott) [#4421](https://github.com/nodejs/node/pull/4421) +* [[`46d8c93ed2`](https://github.com/nodejs/node/commit/46d8c93ed2)] - **test**: don't use cwd for relative path (Johan Bergström) [#4477](https://github.com/nodejs/node/pull/4477) +* [[`b6124ea39c`](https://github.com/nodejs/node/commit/b6124ea39c)] - **test**: write to tmp dir rather than fixture dir (Rich Trott) [#4489](https://github.com/nodejs/node/pull/4489) +* [[`350fa664bb`](https://github.com/nodejs/node/commit/350fa664bb)] - **test**: don't assume a certain folder structure (Johan Bergström) [#3325](https://github.com/nodejs/node/pull/3325) +* [[`6b2ef0efac`](https://github.com/nodejs/node/commit/6b2ef0efac)] - **test**: make temp path customizable (Johan Bergström) [#3325](https://github.com/nodejs/node/pull/3325) +* [[`f1837703a9`](https://github.com/nodejs/node/commit/f1837703a9)] - **test**: remove unused vars from parallel tests (Rich Trott) [#4511](https://github.com/nodejs/node/pull/4511) +* [[`b4964b099a`](https://github.com/nodejs/node/commit/b4964b099a)] - **test**: remove unused variables form http tests (Rich Trott) [#4422](https://github.com/nodejs/node/pull/4422) +* [[`0d5a508dfb`](https://github.com/nodejs/node/commit/0d5a508dfb)] - **test**: extend timeout in Debug mode (Rich Trott) [#4431](https://github.com/nodejs/node/pull/4431) +* [[`6e4598d5da`](https://github.com/nodejs/node/commit/6e4598d5da)] - **test**: remove unused variables from TLS tests (Rich Trott) [#4424](https://github.com/nodejs/node/pull/4424) +* [[`7b1aa045a0`](https://github.com/nodejs/node/commit/7b1aa045a0)] - **test**: remove unused variables from HTTPS tests (Rich Trott) [#4426](https://github.com/nodejs/node/pull/4426) +* [[`da9e5c1b01`](https://github.com/nodejs/node/commit/da9e5c1b01)] - **test**: remove unused variables from net tests (Rich Trott) [#4430](https://github.com/nodejs/node/pull/4430) +* [[`13241bd24b`](https://github.com/nodejs/node/commit/13241bd24b)] - **test**: remove unused vars in ChildProcess tests (Rich Trott) [#4425](https://github.com/nodejs/node/pull/4425) +* [[`2f4538ddda`](https://github.com/nodejs/node/commit/2f4538ddda)] - **test**: remove unused vars (Rich Trott) [#4536](https://github.com/nodejs/node/pull/4536) +* [[`dffe83ccd6`](https://github.com/nodejs/node/commit/dffe83ccd6)] - **test**: remove unused modules (Rich Trott) [#4684](https://github.com/nodejs/node/pull/4684) +* [[`c4eeb88ba1`](https://github.com/nodejs/node/commit/c4eeb88ba1)] - **test**: fix flaky cluster-disconnect-race (Brian White) [#4457](https://github.com/nodejs/node/pull/4457) +* [[`7caf87bf6c`](https://github.com/nodejs/node/commit/7caf87bf6c)] - **test**: fix flaky test-http-agent-keepalive (Rich Trott) [#4524](https://github.com/nodejs/node/pull/4524) +* [[`25c41d084d`](https://github.com/nodejs/node/commit/25c41d084d)] - **test**: remove flaky designations for tests (Rich Trott) [#4519](https://github.com/nodejs/node/pull/4519) +* [[`b8f097ece2`](https://github.com/nodejs/node/commit/b8f097ece2)] - **test**: fix flaky streams test (Rich Trott) [#4516](https://github.com/nodejs/node/pull/4516) +* [[`c24fa1437c`](https://github.com/nodejs/node/commit/c24fa1437c)] - **test**: inherit JOBS from environment (Johan Bergström) [#4495](https://github.com/nodejs/node/pull/4495) +* [[`7dc90e9e7f`](https://github.com/nodejs/node/commit/7dc90e9e7f)] - **test**: remove time check (Rich Trott) [#4494](https://github.com/nodejs/node/pull/4494) +* [[`7ca3c6c388`](https://github.com/nodejs/node/commit/7ca3c6c388)] - **test**: refactor test-fs-empty-readStream (Rich Trott) [#4490](https://github.com/nodejs/node/pull/4490) +* [[`610727dea7`](https://github.com/nodejs/node/commit/610727dea7)] - **test**: clarify role of domains in test (Rich Trott) [#4474](https://github.com/nodejs/node/pull/4474) +* [[`1ae0e355b9`](https://github.com/nodejs/node/commit/1ae0e355b9)] - **test**: improve assert message (Rich Trott) [#4461](https://github.com/nodejs/node/pull/4461) +* [[`e70c88df56`](https://github.com/nodejs/node/commit/e70c88df56)] - **test**: remove unused assert module imports (Rich Trott) [#4438](https://github.com/nodejs/node/pull/4438) +* [[`c77fc71f9b`](https://github.com/nodejs/node/commit/c77fc71f9b)] - **test**: remove unused var from test-assert.js (Rich Trott) [#4405](https://github.com/nodejs/node/pull/4405) +* [[`f613b3033f`](https://github.com/nodejs/node/commit/f613b3033f)] - **test**: add test-domain-exit-dispose-again back (Julien Gilli) [#4256](https://github.com/nodejs/node/pull/4256) +* [[`f5bfacd858`](https://github.com/nodejs/node/commit/f5bfacd858)] - **test**: remove unused `util` imports (Rich Trott) [#4562](https://github.com/nodejs/node/pull/4562) +* [[`d795301025`](https://github.com/nodejs/node/commit/d795301025)] - **test**: remove unnecessary assignments (Rich Trott) [#4563](https://github.com/nodejs/node/pull/4563) +* [[`acc3d66934`](https://github.com/nodejs/node/commit/acc3d66934)] - **test**: move ArrayStream to common (cjihrig) [#4027](https://github.com/nodejs/node/pull/4027) +* [[`6c0021361c`](https://github.com/nodejs/node/commit/6c0021361c)] - **test**: refactor test-net-connect-options-ipv6 (Rich Trott) [#4395](https://github.com/nodejs/node/pull/4395) +* [[`29804e00ad`](https://github.com/nodejs/node/commit/29804e00ad)] - **test**: use platformTimeout() in more places (Brian White) [#4387](https://github.com/nodejs/node/pull/4387) +* [[`761af37d0e`](https://github.com/nodejs/node/commit/761af37d0e)] - **test**: fix race condition in test-http-client-onerror (Devin Nakamura) [#4346](https://github.com/nodejs/node/pull/4346) +* [[`980852165f`](https://github.com/nodejs/node/commit/980852165f)] - **test**: fix flaky test-net-error-twice (Brian White) [#4342](https://github.com/nodejs/node/pull/4342) +* [[`1bc44e79d3`](https://github.com/nodejs/node/commit/1bc44e79d3)] - **test**: try other ipv6 localhost alternatives (Brian White) [#4325](https://github.com/nodejs/node/pull/4325) +* [[`44dbe15640`](https://github.com/nodejs/node/commit/44dbe15640)] - **test**: fix debug-port-cluster flakiness (Ben Noordhuis) [#4310](https://github.com/nodejs/node/pull/4310) +* [[`73e781172b`](https://github.com/nodejs/node/commit/73e781172b)] - **test**: add test for tls.parseCertString (Evan Lucas) [#4283](https://github.com/nodejs/node/pull/4283) +* [[`15c295a21b`](https://github.com/nodejs/node/commit/15c295a21b)] - **test**: use regular timeout times for ARMv8 (Jeremiah Senkpiel) [#4248](https://github.com/nodejs/node/pull/4248) +* [[`fd250b8fab`](https://github.com/nodejs/node/commit/fd250b8fab)] - **test**: parallelize test-repl-persistent-history (Jeremiah Senkpiel) [#4247](https://github.com/nodejs/node/pull/4247) +* [[`9a0f156e5a`](https://github.com/nodejs/node/commit/9a0f156e5a)] - **test**: fix domain-top-level-error-handler-throw (Santiago Gimeno) [#4364](https://github.com/nodejs/node/pull/4364) +* [[`6bc1b1c259`](https://github.com/nodejs/node/commit/6bc1b1c259)] - **test**: don't assume openssl s_client supports -ssl3 (Ben Noordhuis) [#4204](https://github.com/nodejs/node/pull/4204) +* [[`d00b9fc66f`](https://github.com/nodejs/node/commit/d00b9fc66f)] - **test**: fix tls-inception flakiness (Santiago Gimeno) [#4195](https://github.com/nodejs/node/pull/4195) +* [[`c41b280a2b`](https://github.com/nodejs/node/commit/c41b280a2b)] - **test**: fix tls-inception (Santiago Gimeno) [#4195](https://github.com/nodejs/node/pull/4195) +* [[`6f4ab1d1ab`](https://github.com/nodejs/node/commit/6f4ab1d1ab)] - **test**: mark test-cluster-shared-leak flaky (Rich Trott) [#4162](https://github.com/nodejs/node/pull/4162) +* [[`90498e2a68`](https://github.com/nodejs/node/commit/90498e2a68)] - **test**: skip long path tests on non-Windows (Rafał Pocztarski) [#4116](https://github.com/nodejs/node/pull/4116) +* [[`c9100d78f3`](https://github.com/nodejs/node/commit/c9100d78f3)] - **test**: fix flaky test-net-socket-local-address (Rich Trott) [#4109](https://github.com/nodejs/node/pull/4109) +* [[`ac939d51d9`](https://github.com/nodejs/node/commit/ac939d51d9)] - **test**: improve cluster-disconnect-handles test (Brian White) [#4084](https://github.com/nodejs/node/pull/4084) +* [[`22ba1b4115`](https://github.com/nodejs/node/commit/22ba1b4115)] - **test**: eliminate multicast test FreeBSD flakiness (Rich Trott) [#4042](https://github.com/nodejs/node/pull/4042) +* [[`2ee7853bb7`](https://github.com/nodejs/node/commit/2ee7853bb7)] - **test**: fix http-many-ended-pipelines flakiness (Santiago Gimeno) [#4041](https://github.com/nodejs/node/pull/4041) +* [[`a77dcfec06`](https://github.com/nodejs/node/commit/a77dcfec06)] - **test**: use platform-based timeout for reliability (Rich Trott) [#4015](https://github.com/nodejs/node/pull/4015) +* [[`3f0ff879cf`](https://github.com/nodejs/node/commit/3f0ff879cf)] - **test**: fix time resolution constraint (Gireesh Punathil) [#3981](https://github.com/nodejs/node/pull/3981) +* [[`22b88e1c48`](https://github.com/nodejs/node/commit/22b88e1c48)] - **test**: add TAP diagnostic message for retried tests (Rich Trott) [#3960](https://github.com/nodejs/node/pull/3960) +* [[`22d2887b1c`](https://github.com/nodejs/node/commit/22d2887b1c)] - **test**: add OS X to module loading error test (Evan Lucas) [#3901](https://github.com/nodejs/node/pull/3901) +* [[`e2141cb75e`](https://github.com/nodejs/node/commit/e2141cb75e)] - **test**: skip instead of fail when mem constrained (Michael Cornacchia) [#3697](https://github.com/nodejs/node/pull/3697) +* [[`166523d0ed`](https://github.com/nodejs/node/commit/166523d0ed)] - **test**: fix race condition in unrefd interval test (Michael Cornacchia) [#3550](https://github.com/nodejs/node/pull/3550) +* [[`86b47e8dc0`](https://github.com/nodejs/node/commit/86b47e8dc0)] - **timers**: optimize callback call: bind -> arrow (Andrei Sedoi) [#4038](https://github.com/nodejs/node/pull/4038) +* [[`4d37472ea7`](https://github.com/nodejs/node/commit/4d37472ea7)] - **tls_wrap**: clear errors on return (Fedor Indutny) [#4709](https://github.com/nodejs/node/pull/4709) +* [[`5b695d0343`](https://github.com/nodejs/node/commit/5b695d0343)] - **tls_wrap**: inherit from the `AsyncWrap` first (Fedor Indutny) [#4268](https://github.com/nodejs/node/pull/4268) +* [[`0efc35e6d8`](https://github.com/nodejs/node/commit/0efc35e6d8)] - **tls_wrap**: slice buffer properly in `ClearOut` (Fedor Indutny) [#4184](https://github.com/nodejs/node/pull/4184) +* [[`628cb8657c`](https://github.com/nodejs/node/commit/628cb8657c)] - **tools**: add .editorconfig (ronkorving) [#2993](https://github.com/nodejs/node/pull/2993) +* [[`69fef19624`](https://github.com/nodejs/node/commit/69fef19624)] - **tools**: implement no-unused-vars for eslint (Rich Trott) [#4536](https://github.com/nodejs/node/pull/4536) +* [[`3ee16706f2`](https://github.com/nodejs/node/commit/3ee16706f2)] - **tools**: enforce `throw new Error()` with lint rule (Rich Trott) [#3714](https://github.com/nodejs/node/pull/3714) +* [[`32801de4ef`](https://github.com/nodejs/node/commit/32801de4ef)] - **tools**: Use `throw new Error()` consistently (Rich Trott) [#3714](https://github.com/nodejs/node/pull/3714) +* [[`f413fae0cd`](https://github.com/nodejs/node/commit/f413fae0cd)] - **tools**: add tap output to cpplint (Johan Bergström) [#3448](https://github.com/nodejs/node/pull/3448) +* [[`efa30dd2f0`](https://github.com/nodejs/node/commit/efa30dd2f0)] - **tools**: enable prefer-const eslint rule (Sakthipriyan Vairamani) [#3152](https://github.com/nodejs/node/pull/3152) +* [[`dd0c925896`](https://github.com/nodejs/node/commit/dd0c925896)] - **udp**: remove a needless instanceof Buffer check (ronkorving) [#4301](https://github.com/nodejs/node/pull/4301) +* [[`f4414102ed`](https://github.com/nodejs/node/commit/f4414102ed)] - **util**: faster arrayToHash (Jackson Tian) +* [[`b421119984`](https://github.com/nodejs/node/commit/b421119984)] - **util**: determine object types in C++ (cjihrig) [#4100](https://github.com/nodejs/node/pull/4100) +* [[`6a7c9d9293`](https://github.com/nodejs/node/commit/6a7c9d9293)] - **util**: move .decorateErrorStack to internal/util (Ben Noordhuis) [#4026](https://github.com/nodejs/node/pull/4026) +* [[`422a865d46`](https://github.com/nodejs/node/commit/422a865d46)] - **util**: add decorateErrorStack() (cjihrig) [#4013](https://github.com/nodejs/node/pull/4013) +* [[`2d5380ea25`](https://github.com/nodejs/node/commit/2d5380ea25)] - **util**: fix constructor/instanceof checks (Brian White) [#3385](https://github.com/nodejs/node/pull/3385) +* [[`1bf84b9d41`](https://github.com/nodejs/node/commit/1bf84b9d41)] - **util,src**: allow lookup of hidden values (cjihrig) [#3988](https://github.com/nodejs/node/pull/3988) + +## 2015-12-23, Version 4.2.4 'Argon' (LTS), @jasnell + +Maintenance update. + +### Notable changes + +* Roughly 78% of the commits are documentation and test improvements +* **domains**: +** Fix handling of uncaught exceptions (Julien Gilli) [#3884](https://github.com/nodejs/node/pull/3884) +* **deps**: +** Upgrade to npm 2.14.12 (Kat Marchán) [#4110](https://github.com/nodejs/node/pull/4110) +** Backport 819b40a from V8 upstream (Michaël Zasso) [#3938](https://github.com/nodejs/node/pull/3938) +** Updated node LICENSE file with new npm license (Kat Marchán) [#4110](https://github.com/nodejs/node/pull/4110) + +### Known issues + +* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/node/issues/1264). +* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/node/issues/690) +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/node/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). + +### Commits + +* [[`907a13a07f`](https://github.com/nodejs/node/commit/907a13a07f)] - Add missing va_end before return (Ömer Fadıl Usta) [#3565](https://github.com/nodejs/node/pull/3565) +* [[`7ffc01756f`](https://github.com/nodejs/node/commit/7ffc01756f)] - **buffer**: fix writeInt{B,L}E for some neg values (Peter A. Bigot) [#3994](https://github.com/nodejs/node/pull/3994) +* [[`db0186e435`](https://github.com/nodejs/node/commit/db0186e435)] - **buffer**: let WriteFloatGeneric silently drop values (P.S.V.R) +* [[`5c6740865a`](https://github.com/nodejs/node/commit/5c6740865a)] - **build**: update signtool description, add url (Rod Vagg) [#4011](https://github.com/nodejs/node/pull/4011) +* [[`60dda70f89`](https://github.com/nodejs/node/commit/60dda70f89)] - **build**: fix --with-intl=system-icu for x-compile (Steven R. Loomis) [#3808](https://github.com/nodejs/node/pull/3808) +* [[`22208b067c`](https://github.com/nodejs/node/commit/22208b067c)] - **build**: fix configuring with prebuilt libraries (Markus Tzoe) [#3135](https://github.com/nodejs/node/pull/3135) +* [[`914caf9c69`](https://github.com/nodejs/node/commit/914caf9c69)] - **child_process**: add safety checks on stdio access (cjihrig) [#3799](https://github.com/nodejs/node/pull/3799) +* [[`236ad90a84`](https://github.com/nodejs/node/commit/236ad90a84)] - **child_process**: don't fork bomb ourselves from -e (Ben Noordhuis) [#3575](https://github.com/nodejs/node/pull/3575) +* [[`f28f69dac4`](https://github.com/nodejs/node/commit/f28f69dac4)] - **cluster**: remove handles when disconnecting worker (Ben Noordhuis) [#3677](https://github.com/nodejs/node/pull/3677) +* [[`f5c5e8bf91`](https://github.com/nodejs/node/commit/f5c5e8bf91)] - **cluster**: send suicide message on disconnect (cjihrig) [#3720](https://github.com/nodejs/node/pull/3720) +* [[`629d5d18d7`](https://github.com/nodejs/node/commit/629d5d18d7)] - **configure**: `v8_use_snapshot` should be `true` (Fedor Indutny) [#3962](https://github.com/nodejs/node/pull/3962) +* [[`3094464871`](https://github.com/nodejs/node/commit/3094464871)] - **configure**: use __ARM_ARCH to determine arm version (João Reis) [#4123](https://github.com/nodejs/node/pull/4123) +* [[`1e1173fc5c`](https://github.com/nodejs/node/commit/1e1173fc5c)] - **configure**: respect CC_host in host arch detection (João Reis) [#4117](https://github.com/nodejs/node/pull/4117) +* [[`2e9b886fbf`](https://github.com/nodejs/node/commit/2e9b886fbf)] - **crypto**: DSA parameter validation in FIPS mode (Stefan Budeanu) [#3756](https://github.com/nodejs/node/pull/3756) +* [[`00b77d9e84`](https://github.com/nodejs/node/commit/00b77d9e84)] - **crypto**: Improve error checking and reporting (Stefan Budeanu) [#3753](https://github.com/nodejs/node/pull/3753) +* [[`3dd90ddc73`](https://github.com/nodejs/node/commit/3dd90ddc73)] - **deps**: upgrade to npm 2.14.12 (Kat Marchán) [#4110](https://github.com/nodejs/node/pull/4110) +* [[`51ae8d10b3`](https://github.com/nodejs/node/commit/51ae8d10b3)] - **deps**: Updated node LICENSE file with new npm license (Kat Marchán) [#4110](https://github.com/nodejs/node/pull/4110) +* [[`9e1edead22`](https://github.com/nodejs/node/commit/9e1edead22)] - **deps**: backport 819b40a from V8 upstream (Michaël Zasso) [#3938](https://github.com/nodejs/node/pull/3938) +* [[`a2ce3843cc`](https://github.com/nodejs/node/commit/a2ce3843cc)] - **deps**: upgrade npm to 2.14.9 (Forrest L Norvell) [#3686](https://github.com/nodejs/node/pull/3686) +* [[`b140cb29f4`](https://github.com/nodejs/node/commit/b140cb29f4)] - **dns**: prevent undefined values in results (Junliang Yan) [#3696](https://github.com/nodejs/node/pull/3696) +* [[`8aafa2ecc0`](https://github.com/nodejs/node/commit/8aafa2ecc0)] - **doc**: standardize references to node.js in docs (Scott Buchanan) [#4136](https://github.com/nodejs/node/pull/4136) +* [[`72f43a263a`](https://github.com/nodejs/node/commit/72f43a263a)] - **doc**: fix internal link to child.send() (Luigi Pinca) [#4089](https://github.com/nodejs/node/pull/4089) +* [[`dcfdbac457`](https://github.com/nodejs/node/commit/dcfdbac457)] - **doc**: reword https.Agent example text (Jan Krems) [#4075](https://github.com/nodejs/node/pull/4075) +* [[`f93d268dec`](https://github.com/nodejs/node/commit/f93d268dec)] - **doc**: add HTTP working group (James M Snell) [#3919](https://github.com/nodejs/node/pull/3919) +* [[`beee0553ca`](https://github.com/nodejs/node/commit/beee0553ca)] - **doc**: update WORKING_GROUPS.md - add missing groups (Michael Dawson) [#3450](https://github.com/nodejs/node/pull/3450) +* [[`3327415fc4`](https://github.com/nodejs/node/commit/3327415fc4)] - **doc**: fix the exception description (yorkie) [#3658](https://github.com/nodejs/node/pull/3658) +* [[`da8d012c88`](https://github.com/nodejs/node/commit/da8d012c88)] - **doc**: clarify v4.2.3 notable items (Rod Vagg) [#4155](https://github.com/nodejs/node/pull/4155) +* [[`44a2d8ca24`](https://github.com/nodejs/node/commit/44a2d8ca24)] - **doc**: fix color of linked code blocks (jpersson) [#4068](https://github.com/nodejs/node/pull/4068) +* [[`bebde48ebc`](https://github.com/nodejs/node/commit/bebde48ebc)] - **doc**: fix typo in README (Rich Trott) [#4000](https://github.com/nodejs/node/pull/4000) +* [[`b48d5ec301`](https://github.com/nodejs/node/commit/b48d5ec301)] - **doc**: message.header duplication correction (Bryan English) [#3997](https://github.com/nodejs/node/pull/3997) +* [[`6ef3625456`](https://github.com/nodejs/node/commit/6ef3625456)] - **doc**: replace sane with reasonable (Lewis Cowper) [#3980](https://github.com/nodejs/node/pull/3980) +* [[`c5be3c63f0`](https://github.com/nodejs/node/commit/c5be3c63f0)] - **doc**: fix rare case of misaligned columns (Roman Reiss) [#3948](https://github.com/nodejs/node/pull/3948) +* [[`bd82fb06ff`](https://github.com/nodejs/node/commit/bd82fb06ff)] - **doc**: fix broken references (Alexander Gromnitsky) [#3944](https://github.com/nodejs/node/pull/3944) +* [[`8eb28c3d50`](https://github.com/nodejs/node/commit/8eb28c3d50)] - **doc**: add reference for buffer.inspect() (cjihrig) [#3921](https://github.com/nodejs/node/pull/3921) +* [[`4bc71e0078`](https://github.com/nodejs/node/commit/4bc71e0078)] - **doc**: clarify module loading behavior (cjihrig) [#3920](https://github.com/nodejs/node/pull/3920) +* [[`4c382e7aaa`](https://github.com/nodejs/node/commit/4c382e7aaa)] - **doc**: numeric flags to fs.open (Carl Lei) [#3641](https://github.com/nodejs/node/pull/3641) +* [[`5207099dc9`](https://github.com/nodejs/node/commit/5207099dc9)] - **doc**: clarify that fs streams expect blocking fd (Carl Lei) [#3641](https://github.com/nodejs/node/pull/3641) +* [[`753c5071ea`](https://github.com/nodejs/node/commit/753c5071ea)] - **doc**: Adding best practises for crypto.pbkdf2 (Tom Gallacher) [#3290](https://github.com/nodejs/node/pull/3290) +* [[`8f0291beba`](https://github.com/nodejs/node/commit/8f0291beba)] - **doc**: update WORKING_GROUPS.md to include Intl (Steven R. Loomis) [#3251](https://github.com/nodejs/node/pull/3251) +* [[`c31d472487`](https://github.com/nodejs/node/commit/c31d472487)] - **doc**: sort repl alphabetically (Tristian Flanagan) [#3859](https://github.com/nodejs/node/pull/3859) +* [[`6b172d9fe8`](https://github.com/nodejs/node/commit/6b172d9fe8)] - **doc**: consistent reference-style links (Bryan English) [#3845](https://github.com/nodejs/node/pull/3845) +* [[`ffd3335e29`](https://github.com/nodejs/node/commit/ffd3335e29)] - **doc**: address use of profanity in code of conduct (James M Snell) [#3827](https://github.com/nodejs/node/pull/3827) +* [[`a36a5b63cf`](https://github.com/nodejs/node/commit/a36a5b63cf)] - **doc**: reword message.headers to indicate they are not read-only (Tristian Flanagan) [#3814](https://github.com/nodejs/node/pull/3814) +* [[`6de77cd320`](https://github.com/nodejs/node/commit/6de77cd320)] - **doc**: clarify duplicate header handling (Bryan English) [#3810](https://github.com/nodejs/node/pull/3810) +* [[`b22973af81`](https://github.com/nodejs/node/commit/b22973af81)] - **doc**: replace head of readme with updated text (Rod Vagg) [#3482](https://github.com/nodejs/node/pull/3482) +* [[`eab0d56ea9`](https://github.com/nodejs/node/commit/eab0d56ea9)] - **doc**: repl: add defineComand and displayPrompt (Bryan English) [#3765](https://github.com/nodejs/node/pull/3765) +* [[`15fb02985f`](https://github.com/nodejs/node/commit/15fb02985f)] - **doc**: document release types in readme (Rod Vagg) [#3482](https://github.com/nodejs/node/pull/3482) +* [[`29f26b882f`](https://github.com/nodejs/node/commit/29f26b882f)] - **doc**: add link to \[customizing util.inspect colors\]. (Jesse McCarthy) [#3749](https://github.com/nodejs/node/pull/3749) +* [[`90fdb4f7b3`](https://github.com/nodejs/node/commit/90fdb4f7b3)] - **doc**: sort tls alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`39fa9fa85c`](https://github.com/nodejs/node/commit/39fa9fa85c)] - **doc**: sort stream alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`e98e8afb2b`](https://github.com/nodejs/node/commit/e98e8afb2b)] - **doc**: sort net alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`6de887483d`](https://github.com/nodejs/node/commit/6de887483d)] - **doc**: sort process alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`37033dcb71`](https://github.com/nodejs/node/commit/37033dcb71)] - **doc**: sort zlib alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`9878034567`](https://github.com/nodejs/node/commit/9878034567)] - **doc**: sort util alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`48fc765eb6`](https://github.com/nodejs/node/commit/48fc765eb6)] - **doc**: sort https alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`3546eb4f40`](https://github.com/nodejs/node/commit/3546eb4f40)] - **doc**: sort http alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`dedfb1156a`](https://github.com/nodejs/node/commit/dedfb1156a)] - **doc**: sort modules alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`71722fe1a1`](https://github.com/nodejs/node/commit/71722fe1a1)] - **doc**: sort readline alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`660062bf9e`](https://github.com/nodejs/node/commit/660062bf9e)] - **doc**: sort repl alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`34b8d28725`](https://github.com/nodejs/node/commit/34b8d28725)] - **doc**: sort string_decoder alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`3f3b9ed7d7`](https://github.com/nodejs/node/commit/3f3b9ed7d7)] - **doc**: sort timers alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`af876ddc64`](https://github.com/nodejs/node/commit/af876ddc64)] - **doc**: sort tty alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`3c2068704a`](https://github.com/nodejs/node/commit/3c2068704a)] - **doc**: sort url alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`363692fd0c`](https://github.com/nodejs/node/commit/363692fd0c)] - **doc**: sort vm alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`ca41b55166`](https://github.com/nodejs/node/commit/ca41b55166)] - **doc**: sort querystring alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`f37ff22b9f`](https://github.com/nodejs/node/commit/f37ff22b9f)] - **doc**: sort punycode alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`4d569607af`](https://github.com/nodejs/node/commit/4d569607af)] - **doc**: sort path alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`daa62447d1`](https://github.com/nodejs/node/commit/daa62447d1)] - **doc**: sort os alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`0906f9a8bb`](https://github.com/nodejs/node/commit/0906f9a8bb)] - **doc**: sort globals alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`6cd06c1319`](https://github.com/nodejs/node/commit/6cd06c1319)] - **doc**: sort fs alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`5b310f8d9e`](https://github.com/nodejs/node/commit/5b310f8d9e)] - **doc**: sort events alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`782cb7d15b`](https://github.com/nodejs/node/commit/782cb7d15b)] - **doc**: sort errors alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`c39eabbec4`](https://github.com/nodejs/node/commit/c39eabbec4)] - **doc**: sort dgram alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`261e0f3a21`](https://github.com/nodejs/node/commit/261e0f3a21)] - **doc**: sort crypto alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`0e6121d04d`](https://github.com/nodejs/node/commit/0e6121d04d)] - **doc**: sort dns alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`435ffb79f7`](https://github.com/nodejs/node/commit/435ffb79f7)] - **doc**: sort console alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`28935a10d6`](https://github.com/nodejs/node/commit/28935a10d6)] - **doc**: sort cluster alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`5e79dc4406`](https://github.com/nodejs/node/commit/5e79dc4406)] - **doc**: sort child_process alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`af0bf1a72c`](https://github.com/nodejs/node/commit/af0bf1a72c)] - **doc**: sort buffer alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`f43a0330aa`](https://github.com/nodejs/node/commit/f43a0330aa)] - **doc**: sort assert alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`1bbc3b3ff8`](https://github.com/nodejs/node/commit/1bbc3b3ff8)] - **doc**: add note on tls connection meta data methods (Tyler Henkel) [#3746](https://github.com/nodejs/node/pull/3746) +* [[`3c415bbb12`](https://github.com/nodejs/node/commit/3c415bbb12)] - **doc**: add note to util.isBuffer (Evan Lucas) [#3790](https://github.com/nodejs/node/pull/3790) +* [[`7b5e4574fd`](https://github.com/nodejs/node/commit/7b5e4574fd)] - **doc**: add romankl to collaborators (Roman Klauke) [#3725](https://github.com/nodejs/node/pull/3725) +* [[`4f7c638a7a`](https://github.com/nodejs/node/commit/4f7c638a7a)] - **doc**: add saghul as a collaborator (Saúl Ibarra Corretgé) +* [[`523251270a`](https://github.com/nodejs/node/commit/523251270a)] - **doc**: add thealphanerd to collaborators (Myles Borins) [#3723](https://github.com/nodejs/node/pull/3723) +* [[`488e74f27d`](https://github.com/nodejs/node/commit/488e74f27d)] - **doc**: update lts description in the collaborator guide (James M Snell) [#3668](https://github.com/nodejs/node/pull/3668) +* [[`fe3ae3cea4`](https://github.com/nodejs/node/commit/fe3ae3cea4)] - **doc**: add LTS info to COLLABORATOR_GUIDE.md (Myles Borins) [#3442](https://github.com/nodejs/node/pull/3442) +* [[`daa10a345e`](https://github.com/nodejs/node/commit/daa10a345e)] - **doc**: typo fix in readme.md (Sam P Gallagher-Bishop) [#3649](https://github.com/nodejs/node/pull/3649) +* [[`eca5720761`](https://github.com/nodejs/node/commit/eca5720761)] - **doc**: fix wrong date and known issue in changelog.md (James M Snell) [#3650](https://github.com/nodejs/node/pull/3650) +* [[`83494f8f3e`](https://github.com/nodejs/node/commit/83494f8f3e)] - **doc**: rename iojs-* groups to nodejs-* (Steven R. Loomis) [#3634](https://github.com/nodejs/node/pull/3634) +* [[`347fb65aee`](https://github.com/nodejs/node/commit/347fb65aee)] - **doc**: fix crypto spkac function descriptions (Jason Gerfen) [#3614](https://github.com/nodejs/node/pull/3614) +* [[`11d2050d63`](https://github.com/nodejs/node/commit/11d2050d63)] - **doc**: Updated streams simplified constructor API (Tom Gallacher) [#3602](https://github.com/nodejs/node/pull/3602) +* [[`6db4392bfb`](https://github.com/nodejs/node/commit/6db4392bfb)] - **doc**: made code spans more visible in the API docs (phijohns) [#3573](https://github.com/nodejs/node/pull/3573) +* [[`8a7dd73af1`](https://github.com/nodejs/node/commit/8a7dd73af1)] - **doc**: added what buf.copy returns (Manuel B) [#3555](https://github.com/nodejs/node/pull/3555) +* [[`cf4b65c2d6`](https://github.com/nodejs/node/commit/cf4b65c2d6)] - **doc**: fix function param order in assert doc (David Woods) [#3533](https://github.com/nodejs/node/pull/3533) +* [[`a2efe4c72b`](https://github.com/nodejs/node/commit/a2efe4c72b)] - **doc**: add note about timeout delay > TIMEOUT_MAX (Guilherme Souza) [#3512](https://github.com/nodejs/node/pull/3512) +* [[`d1b5833476`](https://github.com/nodejs/node/commit/d1b5833476)] - **doc**: add caveats of algs and key size in crypto (Shigeki Ohtsu) [#3479](https://github.com/nodejs/node/pull/3479) +* [[`12cdf6fcf3`](https://github.com/nodejs/node/commit/12cdf6fcf3)] - **doc**: add method links in events.markdown (Alejandro Oviedo) [#3187](https://github.com/nodejs/node/pull/3187) +* [[`f50f19e384`](https://github.com/nodejs/node/commit/f50f19e384)] - **doc**: stdout/stderr can block when directed to file (Ben Noordhuis) [#3170](https://github.com/nodejs/node/pull/3170) +* [[`b2cc1302e0`](https://github.com/nodejs/node/commit/b2cc1302e0)] - **docs**: improve discoverability of Code of Conduct (Ashley Williams) [#3774](https://github.com/nodejs/node/pull/3774) +* [[`fa1ab497f1`](https://github.com/nodejs/node/commit/fa1ab497f1)] - **docs**: fs - change links to buffer encoding to Buffer class anchor (fansworld-claudio) [#2796](https://github.com/nodejs/node/pull/2796) +* [[`34e64e5390`](https://github.com/nodejs/node/commit/34e64e5390)] - **domains**: fix handling of uncaught exceptions (Julien Gilli) [#3884](https://github.com/nodejs/node/pull/3884) +* [[`0311836e7a`](https://github.com/nodejs/node/commit/0311836e7a)] - **meta**: remove use of profanity in source (Myles Borins) [#4122](https://github.com/nodejs/node/pull/4122) +* [[`971762ada9`](https://github.com/nodejs/node/commit/971762ada9)] - **module**: cache regular expressions (Evan Lucas) [#3869](https://github.com/nodejs/node/pull/3869) +* [[`d80fa2c77c`](https://github.com/nodejs/node/commit/d80fa2c77c)] - **module**: remove unnecessary JSON.stringify (Andres Suarez) [#3578](https://github.com/nodejs/node/pull/3578) +* [[`aa85d62f09`](https://github.com/nodejs/node/commit/aa85d62f09)] - **net**: add local address/port for better errors (Jan Schär) [#3946](https://github.com/nodejs/node/pull/3946) +* [[`803a56de52`](https://github.com/nodejs/node/commit/803a56de52)] - **querystring**: Parse multiple separator characters (Yosuke Furukawa) [#3807](https://github.com/nodejs/node/pull/3807) +* [[`ff02b295fc`](https://github.com/nodejs/node/commit/ff02b295fc)] - **repl**: don't crash if cannot open history file (Evan Lucas) [#3630](https://github.com/nodejs/node/pull/3630) +* [[`329e88e545`](https://github.com/nodejs/node/commit/329e88e545)] - **repl**: To exit, press ^C again or type .exit. (Hemanth.HM) [#3368](https://github.com/nodejs/node/pull/3368) +* [[`9b05905361`](https://github.com/nodejs/node/commit/9b05905361)] - **src**: Revert "nix stdin _readableState.reading" (Roman Reiss) [#3490](https://github.com/nodejs/node/pull/3490) +* [[`957c1f2543`](https://github.com/nodejs/node/commit/957c1f2543)] - **stream_wrap**: error if stream has StringDecoder (Fedor Indutny) [#4031](https://github.com/nodejs/node/pull/4031) +* [[`43e3b69dae`](https://github.com/nodejs/node/commit/43e3b69dae)] - **test**: refactor test-http-exit-delay (Rich Trott) [#4055](https://github.com/nodejs/node/pull/4055) +* [[`541d0d21be`](https://github.com/nodejs/node/commit/541d0d21be)] - **test**: fix cluster-disconnect-handles flakiness (Santiago Gimeno) [#4009](https://github.com/nodejs/node/pull/4009) +* [[`5f66d66e84`](https://github.com/nodejs/node/commit/5f66d66e84)] - **test**: don't check the # of chunks in test-http-1.0 (Santiago Gimeno) [#3961](https://github.com/nodejs/node/pull/3961) +* [[`355edf585b`](https://github.com/nodejs/node/commit/355edf585b)] - **test**: fix cluster-worker-isdead (Santiago Gimeno) [#3954](https://github.com/nodejs/node/pull/3954) +* [[`4e46e04002`](https://github.com/nodejs/node/commit/4e46e04002)] - **test**: add test for repl.defineCommand() (Bryan English) [#3908](https://github.com/nodejs/node/pull/3908) +* [[`4ea1a69c53`](https://github.com/nodejs/node/commit/4ea1a69c53)] - **test**: mark test flaky on FreeBSD (Rich Trott) [#4016](https://github.com/nodejs/node/pull/4016) +* [[`05b64c11f5`](https://github.com/nodejs/node/commit/05b64c11f5)] - **test**: mark cluster-net-send test flaky on windows (Rich Trott) [#4006](https://github.com/nodejs/node/pull/4006) +* [[`695015579b`](https://github.com/nodejs/node/commit/695015579b)] - **test**: remove flaky designation from ls-no-sslv3 (Rich Trott) [#3620](https://github.com/nodejs/node/pull/3620) +* [[`abbd87b273`](https://github.com/nodejs/node/commit/abbd87b273)] - **test**: mark fork regression test flaky on windows (Rich Trott) [#4005](https://github.com/nodejs/node/pull/4005) +* [[`38ba152a7a`](https://github.com/nodejs/node/commit/38ba152a7a)] - **test**: skip test if in FreeBSD jail (Rich Trott) [#3995](https://github.com/nodejs/node/pull/3995) +* [[`cc24f0ea58`](https://github.com/nodejs/node/commit/cc24f0ea58)] - **test**: fix test-domain-exit-dispose-again (Julien Gilli) [#3990](https://github.com/nodejs/node/pull/3990) +* [[`b2f1014d26`](https://github.com/nodejs/node/commit/b2f1014d26)] - **test**: remove flaky status for cluster test (Rich Trott) [#3975](https://github.com/nodejs/node/pull/3975) +* [[`e66794fd30`](https://github.com/nodejs/node/commit/e66794fd30)] - **test**: address flaky test-http-client-timeout-event (Rich Trott) [#3968](https://github.com/nodejs/node/pull/3968) +* [[`5a2727421a`](https://github.com/nodejs/node/commit/5a2727421a)] - **test**: retry on smartos if ECONNREFUSED (Rich Trott) [#3941](https://github.com/nodejs/node/pull/3941) +* [[`dbc85a275c`](https://github.com/nodejs/node/commit/dbc85a275c)] - **test**: avoid test timeouts on rpi (Stefan Budeanu) [#3902](https://github.com/nodejs/node/pull/3902) +* [[`b9d7378d20`](https://github.com/nodejs/node/commit/b9d7378d20)] - **test**: fix flaky test-child-process-spawnsync-input (Rich Trott) [#3889](https://github.com/nodejs/node/pull/3889) +* [[`cca216a034`](https://github.com/nodejs/node/commit/cca216a034)] - **test**: move test-specific function out of common (Rich Trott) [#3871](https://github.com/nodejs/node/pull/3871) +* [[`fb8df8d6c2`](https://github.com/nodejs/node/commit/fb8df8d6c2)] - **test**: module loading error fix solaris #3798 (fansworld-claudio) [#3855](https://github.com/nodejs/node/pull/3855) +* [[`9ea6bc1e0f`](https://github.com/nodejs/node/commit/9ea6bc1e0f)] - **test**: skip test if FreeBSD jail will break it (Rich Trott) [#3839](https://github.com/nodejs/node/pull/3839) +* [[`150f126618`](https://github.com/nodejs/node/commit/150f126618)] - **test**: fix flaky SmartOS test (Rich Trott) [#3830](https://github.com/nodejs/node/pull/3830) +* [[`603a6f5405`](https://github.com/nodejs/node/commit/603a6f5405)] - **test**: run pipeline flood test in parallel (Rich Trott) [#3811](https://github.com/nodejs/node/pull/3811) +* [[`4a26f74ee3`](https://github.com/nodejs/node/commit/4a26f74ee3)] - **test**: skip/replace weak crypto tests in FIPS mode (Stefan Budeanu) [#3757](https://github.com/nodejs/node/pull/3757) +* [[`3f9562b6bd`](https://github.com/nodejs/node/commit/3f9562b6bd)] - **test**: stronger crypto in test fixtures (Stefan Budeanu) [#3759](https://github.com/nodejs/node/pull/3759) +* [[`1f83eebec5`](https://github.com/nodejs/node/commit/1f83eebec5)] - **test**: increase crypto strength for FIPS standard (Stefan Budeanu) [#3758](https://github.com/nodejs/node/pull/3758) +* [[`7c5fbf7850`](https://github.com/nodejs/node/commit/7c5fbf7850)] - **test**: add hasFipsCrypto to test/common.js (Stefan Budeanu) [#3756](https://github.com/nodejs/node/pull/3756) +* [[`f30214f135`](https://github.com/nodejs/node/commit/f30214f135)] - **test**: add test for invalid DSA key size (Stefan Budeanu) [#3756](https://github.com/nodejs/node/pull/3756) +* [[`9a6c9faafb`](https://github.com/nodejs/node/commit/9a6c9faafb)] - **test**: numeric flags to fs.open (Carl Lei) [#3641](https://github.com/nodejs/node/pull/3641) +* [[`93d1d3cfcd`](https://github.com/nodejs/node/commit/93d1d3cfcd)] - **test**: refactor test-http-pipeline-flood (Rich Trott) [#3636](https://github.com/nodejs/node/pull/3636) +* [[`6c23f67504`](https://github.com/nodejs/node/commit/6c23f67504)] - **test**: fix flaky test test-http-pipeline-flood (Devin Nakamura) [#3636](https://github.com/nodejs/node/pull/3636) +* [[`4e5cae4360`](https://github.com/nodejs/node/commit/4e5cae4360)] - **test**: use really invalid hostname (Sakthipriyan Vairamani) [#3711](https://github.com/nodejs/node/pull/3711) +* [[`da189f793b`](https://github.com/nodejs/node/commit/da189f793b)] - **test**: Fix test-cluster-worker-exit.js for AIX (Imran Iqbal) [#3666](https://github.com/nodejs/node/pull/3666) +* [[`7b4194a863`](https://github.com/nodejs/node/commit/7b4194a863)] - **test**: fix test-module-loading-error for musl (Hugues Malphettes) [#3657](https://github.com/nodejs/node/pull/3657) +* [[`3dc52e99df`](https://github.com/nodejs/node/commit/3dc52e99df)] - **test**: fix test-net-persistent-keepalive for AIX (Imran Iqbal) [#3646](https://github.com/nodejs/node/pull/3646) +* [[`0e8eb66a78`](https://github.com/nodejs/node/commit/0e8eb66a78)] - **test**: fix path to module for repl test on Windows (Michael Cornacchia) [#3608](https://github.com/nodejs/node/pull/3608) +* [[`3aecbc86d2`](https://github.com/nodejs/node/commit/3aecbc86d2)] - **test**: add test-zlib-flush-drain (Myles Borins) [#3534](https://github.com/nodejs/node/pull/3534) +* [[`542d05cbe1`](https://github.com/nodejs/node/commit/542d05cbe1)] - **test**: enhance fs-watch-recursive test (Sakthipriyan Vairamani) [#2599](https://github.com/nodejs/node/pull/2599) +* [[`0eb0119d64`](https://github.com/nodejs/node/commit/0eb0119d64)] - **tls**: Use SHA1 for sessionIdContext in FIPS mode (Stefan Budeanu) [#3755](https://github.com/nodejs/node/pull/3755) +* [[`c10c08604c`](https://github.com/nodejs/node/commit/c10c08604c)] - **tls**: remove util and calls to util.format (Myles Borins) [#3456](https://github.com/nodejs/node/pull/3456) +* [[`a558a570c0`](https://github.com/nodejs/node/commit/a558a570c0)] - **util**: use regexp instead of str.replace().join() (qinjia) [#3689](https://github.com/nodejs/node/pull/3689) +* [[`47bb94a0c3`](https://github.com/nodejs/node/commit/47bb94a0c3)] - **zlib**: only apply drain listener if given callback (Craig Cavalier) [#3534](https://github.com/nodejs/node/pull/3534) +* [[`4733a60158`](https://github.com/nodejs/node/commit/4733a60158)] - **zlib**: pass kind to recursive calls to flush (Myles Borins) [#3534](https://github.com/nodejs/node/pull/3534) + +## 2015-12-04, Version 4.2.3 'Argon' (LTS), @rvagg + +Security Update + +### Notable changes + +* **http**: Fix CVE-2015-8027, a bug whereby an HTTP socket may no longer have a parser associated with it but a pipelined request attempts to trigger a pause or resume on the non-existent parser, a potential denial-of-service vulnerability. (Fedor Indutny) +* **openssl**: Upgrade to 1.0.2e, containing fixes for: + - CVE-2015-3193 "BN_mod_exp may produce incorrect results on x86_64", an attack may be possible against a Node.js TLS server using DHE key exchange. Details are available at . + - CVE-2015-3194 "Certificate verify crash with missing PSS parameter", a potential denial-of-service vector for Node.js TLS servers using client certificate authentication; TLS clients are also impacted. Details are available at . + (Shigeki Ohtsu) [#4134](https://github.com/nodejs/node/pull/4134) +* **v8**: Backport fix for CVE-2015-6764, a bug in `JSON.stringify()` that can result in out-of-bounds reads for arrays. (Ben Noordhuis) + +### Known issues + +* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/node/issues/1264). +* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/node/issues/690) +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/node/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). + +### Commits + +* [[`49bbd563be`](https://github.com/nodejs/node/commit/49bbd563be)] - **deps**: upgrade openssl sources to 1.0.2e (Shigeki Ohtsu) [#4134](https://github.com/nodejs/node/pull/4134) +* [[`9a063fd492`](https://github.com/nodejs/node/commit/9a063fd492)] - **deps**: backport a7e50a5 from upstream v8 (Ben Noordhuis) +* [[`07233206e9`](https://github.com/nodejs/node/commit/07233206e9)] - **deps**: backport 6df9a1d from upstream v8 (Ben Noordhuis) +* [[`1c8e6de78e`](https://github.com/nodejs/node/commit/1c8e6de78e)] - **http**: fix pipeline regression (Fedor Indutny) + +## 2015-11-03, Version 4.2.2 'Argon' (LTS), @jasnell + +### Notable changes + +This is an LTS maintenance release that addresses a number of issues: + +* [[`1d0f2cbf87`](https://github.com/nodejs/node/commit/1d0f2cbf87)] - **buffer**: fix value check for writeUInt{B,L}E (Trevor Norris) [#3500](https://github.com/nodejs/node/pull/3500) +* [[`2a45b72b4a`](https://github.com/nodejs/node/commit/2a45b72b4a)] - **buffer**: don't CHECK on zero-sized realloc (Ben Noordhuis) [#3499](https://github.com/nodejs/node/pull/3499) +* [[`a6469e901a`](https://github.com/nodejs/node/commit/a6469e901a)] - **deps**: backport 010897c from V8 upstream (Ali Ijaz Sheikh) [#3520](https://github.com/nodejs/node/pull/3520) +* [[`cadee67c25`](https://github.com/nodejs/node/commit/cadee67c25)] - **deps**: backport 8d6a228 from the v8's upstream (Fedor Indutny) [#3549](https://github.com/nodejs/node/pull/3549) +* [[`46c8c94055`](https://github.com/nodejs/node/commit/46c8c94055)] - **fs**: reduced duplicate code in fs.write() (ronkorving) [#2947](https://github.com/nodejs/node/pull/2947) +* [[`0427cdf094`](https://github.com/nodejs/node/commit/0427cdf094)] - **http**: fix stalled pipeline bug (Fedor Indutny) [#3342](https://github.com/nodejs/node/pull/3342) +* [[`2109708186`](https://github.com/nodejs/node/commit/2109708186)] - **lib**: fix cluster handle leak (Rich Trott) [#3510](https://github.com/nodejs/node/pull/3510) +* [[`f49c7c6955`](https://github.com/nodejs/node/commit/f49c7c6955)] - **lib**: avoid REPL exit on completion error (Rich Trott) [#3358](https://github.com/nodejs/node/pull/3358) +* [[`8a2c4aeeaa`](https://github.com/nodejs/node/commit/8a2c4aeeaa)] - **repl**: handle comments properly (Sakthipriyan Vairamani) [#3515](https://github.com/nodejs/node/pull/3515) +* [[`a04408acce`](https://github.com/nodejs/node/commit/a04408acce)] - **repl**: limit persistent history correctly on load (Jeremiah Senkpiel) [#2356](https://github.com/nodejs/node/pull/2356) +* [[`3bafe1a59b`](https://github.com/nodejs/node/commit/3bafe1a59b)] - **src**: fix race condition in debug signal on exit (Ben Noordhuis) [#3528](https://github.com/nodejs/node/pull/3528) +* [[`fe01d0df7a`](https://github.com/nodejs/node/commit/fe01d0df7a)] - **src**: fix exception message encoding on Windows (Brian White) [#3288](https://github.com/nodejs/node/pull/3288) +* [[`4bac5d9ddf`](https://github.com/nodejs/node/commit/4bac5d9ddf)] - **stream**: avoid unnecessary concat of a single buffer. (Calvin Metcalf) [#3300](https://github.com/nodejs/node/pull/3300) +* [[`8d78d687d5`](https://github.com/nodejs/node/commit/8d78d687d5)] - **timers**: reuse timer in `setTimeout().unref()` (Fedor Indutny) [#3407](https://github.com/nodejs/node/pull/3407) +* [[`e69c869399`](https://github.com/nodejs/node/commit/e69c869399)] - **tls**: TLSSocket options default isServer false (Yuval Brik) [#2614](https://github.com/nodejs/node/pull/2614) + +### Known issues + +* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/node/issues/690) +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/node/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). + +### Commits + +* [[`1d0f2cbf87`](https://github.com/nodejs/node/commit/1d0f2cbf87)] - **buffer**: fix value check for writeUInt{B,L}E (Trevor Norris) [#3500](https://github.com/nodejs/node/pull/3500) +* [[`2a45b72b4a`](https://github.com/nodejs/node/commit/2a45b72b4a)] - **buffer**: don't CHECK on zero-sized realloc (Ben Noordhuis) [#3499](https://github.com/nodejs/node/pull/3499) +* [[`dc655e1dd2`](https://github.com/nodejs/node/commit/dc655e1dd2)] - **build**: rectify --link-module help text (P.S.V.R) [#3379](https://github.com/nodejs/node/pull/3379) +* [[`a6469e901a`](https://github.com/nodejs/node/commit/a6469e901a)] - **deps**: backport 010897c from V8 upstream (Ali Ijaz Sheikh) [#3520](https://github.com/nodejs/node/pull/3520) +* [[`cadee67c25`](https://github.com/nodejs/node/commit/cadee67c25)] - **deps**: backport 8d6a228 from the v8's upstream (Fedor Indutny) [#3549](https://github.com/nodejs/node/pull/3549) +* [[`1ebd35550b`](https://github.com/nodejs/node/commit/1ebd35550b)] - **doc**: fix typos in changelog (reggi) [#3291](https://github.com/nodejs/node/pull/3291) +* [[`fbd93d4c1c`](https://github.com/nodejs/node/commit/fbd93d4c1c)] - **doc**: more use-cases for promise events (Domenic Denicola) [#3438](https://github.com/nodejs/node/pull/3438) +* [[`6ceb9af407`](https://github.com/nodejs/node/commit/6ceb9af407)] - **doc**: remove old note, 'cluster' is marked stable (Balázs Galambosi) [#3314](https://github.com/nodejs/node/pull/3314) +* [[`a5f0d64ddc`](https://github.com/nodejs/node/commit/a5f0d64ddc)] - **doc**: createServer's key option can be an array (Sakthipriyan Vairamani) [#3123](https://github.com/nodejs/node/pull/3123) +* [[`317e0ec6b3`](https://github.com/nodejs/node/commit/317e0ec6b3)] - **doc**: binary encoding is not deprecated (Trevor Norris) [#3441](https://github.com/nodejs/node/pull/3441) +* [[`b422f6ee1a`](https://github.com/nodejs/node/commit/b422f6ee1a)] - **doc**: mention the behaviour if URL is invalid (Sakthipriyan Vairamani) [#2966](https://github.com/nodejs/node/pull/2966) +* [[`bc29aad22b`](https://github.com/nodejs/node/commit/bc29aad22b)] - **doc**: fix indent in tls resumption example (Roman Reiss) [#3372](https://github.com/nodejs/node/pull/3372) +* [[`313877bd8f`](https://github.com/nodejs/node/commit/313877bd8f)] - **doc**: fix typo in changelog (Timothy Gu) [#3353](https://github.com/nodejs/node/pull/3353) +* [[`4be432862a`](https://github.com/nodejs/node/commit/4be432862a)] - **doc**: show keylen in pbkdf2 as a byte length (calebboyd) [#3334](https://github.com/nodejs/node/pull/3334) +* [[`23a1140ddb`](https://github.com/nodejs/node/commit/23a1140ddb)] - **doc**: add information about Assert behavior and maintenance (Rich Trott) [#3330](https://github.com/nodejs/node/pull/3330) +* [[`e04cb1e1fc`](https://github.com/nodejs/node/commit/e04cb1e1fc)] - **doc**: clarify API buffer.concat (Martii) [#3255](https://github.com/nodejs/node/pull/3255) +* [[`eae714c370`](https://github.com/nodejs/node/commit/eae714c370)] - **doc**: clarify the use of `option.detached` (Kyle Smith) [#3250](https://github.com/nodejs/node/pull/3250) +* [[`b884899e67`](https://github.com/nodejs/node/commit/b884899e67)] - **doc**: label v4.2.1 as LTS in changelog heading (Phillip Johnsen) [#3360](https://github.com/nodejs/node/pull/3360) +* [[`9120a04981`](https://github.com/nodejs/node/commit/9120a04981)] - **docs**: add missing shell option to execSync (fansworld-claudio) [#3440](https://github.com/nodejs/node/pull/3440) +* [[`46c8c94055`](https://github.com/nodejs/node/commit/46c8c94055)] - **fs**: reduced duplicate code in fs.write() (ronkorving) [#2947](https://github.com/nodejs/node/pull/2947) +* [[`0427cdf094`](https://github.com/nodejs/node/commit/0427cdf094)] - **http**: fix stalled pipeline bug (Fedor Indutny) [#3342](https://github.com/nodejs/node/pull/3342) +* [[`2109708186`](https://github.com/nodejs/node/commit/2109708186)] - **lib**: fix cluster handle leak (Rich Trott) [#3510](https://github.com/nodejs/node/pull/3510) +* [[`f49c7c6955`](https://github.com/nodejs/node/commit/f49c7c6955)] - **lib**: avoid REPL exit on completion error (Rich Trott) [#3358](https://github.com/nodejs/node/pull/3358) +* [[`8a2c4aeeaa`](https://github.com/nodejs/node/commit/8a2c4aeeaa)] - **repl**: handle comments properly (Sakthipriyan Vairamani) [#3515](https://github.com/nodejs/node/pull/3515) +* [[`a04408acce`](https://github.com/nodejs/node/commit/a04408acce)] - **repl**: limit persistent history correctly on load (Jeremiah Senkpiel) [#2356](https://github.com/nodejs/node/pull/2356) +* [[`5d1f1c5fa8`](https://github.com/nodejs/node/commit/5d1f1c5fa8)] - **src**: wrap source before doing syntax check (Evan Lucas) [#3587](https://github.com/nodejs/node/pull/3587) +* [[`3bafe1a59b`](https://github.com/nodejs/node/commit/3bafe1a59b)] - **src**: fix race condition in debug signal on exit (Ben Noordhuis) [#3528](https://github.com/nodejs/node/pull/3528) +* [[`fe01d0df7a`](https://github.com/nodejs/node/commit/fe01d0df7a)] - **src**: fix exception message encoding on Windows (Brian White) [#3288](https://github.com/nodejs/node/pull/3288) +* [[`4bac5d9ddf`](https://github.com/nodejs/node/commit/4bac5d9ddf)] - **stream**: avoid unnecessary concat of a single buffer. (Calvin Metcalf) [#3300](https://github.com/nodejs/node/pull/3300) +* [[`117fb47a16`](https://github.com/nodejs/node/commit/117fb47a16)] - **stream**: fix signature of _write() in a comment (Fábio Santos) [#3248](https://github.com/nodejs/node/pull/3248) +* [[`c563a34427`](https://github.com/nodejs/node/commit/c563a34427)] - **test**: split independent tests into separate files (Rich Trott) [#3548](https://github.com/nodejs/node/pull/3548) +* [[`3f62952d42`](https://github.com/nodejs/node/commit/3f62952d42)] - **test**: add node::MakeCallback() test coverage (Ben Noordhuis) [#3478](https://github.com/nodejs/node/pull/3478) +* [[`6b75f10d8a`](https://github.com/nodejs/node/commit/6b75f10d8a)] - **test**: use port number from env in tls socket test (Stefan Budeanu) [#3557](https://github.com/nodejs/node/pull/3557) +* [[`39ff44e94f`](https://github.com/nodejs/node/commit/39ff44e94f)] - **test**: fix heap-profiler link error LNK1194 on win (Junliang Yan) [#3572](https://github.com/nodejs/node/pull/3572) +* [[`a2786dd408`](https://github.com/nodejs/node/commit/a2786dd408)] - **test**: fix missing unistd.h on windows (Junliang Yan) [#3532](https://github.com/nodejs/node/pull/3532) +* [[`5e6f7c9a23`](https://github.com/nodejs/node/commit/5e6f7c9a23)] - **test**: add regression test for --debug-brk -e 0 (Ben Noordhuis) [#3585](https://github.com/nodejs/node/pull/3585) +* [[`7cad182cb6`](https://github.com/nodejs/node/commit/7cad182cb6)] - **test**: port domains regression test from v0.10 (Jonas Dohse) [#3356](https://github.com/nodejs/node/pull/3356) +* [[`78d854c6ce`](https://github.com/nodejs/node/commit/78d854c6ce)] - **test**: remove util from common (Rich Trott) [#3324](https://github.com/nodejs/node/pull/3324) +* [[`c566c8b8c0`](https://github.com/nodejs/node/commit/c566c8b8c0)] - **test**: remove util properties from common (Rich Trott) [#3304](https://github.com/nodejs/node/pull/3304) +* [[`eb7c3fb2f4`](https://github.com/nodejs/node/commit/eb7c3fb2f4)] - **test**: split up buffer tests for reliability (Rich Trott) [#3323](https://github.com/nodejs/node/pull/3323) +* [[`b398a85e19`](https://github.com/nodejs/node/commit/b398a85e19)] - **test**: parallelize long-running test (Rich Trott) [#3287](https://github.com/nodejs/node/pull/3287) +* [[`b5f3b4956b`](https://github.com/nodejs/node/commit/b5f3b4956b)] - **test**: change call to deprecated util.isError() (Rich Trott) [#3084](https://github.com/nodejs/node/pull/3084) +* [[`32149cacb5`](https://github.com/nodejs/node/commit/32149cacb5)] - **test**: improve tests for util.inherits (Michaël Zasso) [#3507](https://github.com/nodejs/node/pull/3507) +* [[`5be686fab8`](https://github.com/nodejs/node/commit/5be686fab8)] - **test**: print helpful err msg on test-dns-ipv6.js (Junliang Yan) [#3501](https://github.com/nodejs/node/pull/3501) +* [[`0429131e32`](https://github.com/nodejs/node/commit/0429131e32)] - **test**: fix domain with abort-on-uncaught on PPC (Julien Gilli) [#3354](https://github.com/nodejs/node/pull/3354) +* [[`788106eee9`](https://github.com/nodejs/node/commit/788106eee9)] - **test**: cleanup, improve repl-persistent-history (Jeremiah Senkpiel) [#2356](https://github.com/nodejs/node/pull/2356) +* [[`ea58fa0bac`](https://github.com/nodejs/node/commit/ea58fa0bac)] - **test**: add Symbol test for assert.deepEqual() (Rich Trott) [#3327](https://github.com/nodejs/node/pull/3327) +* [[`d409ac473b`](https://github.com/nodejs/node/commit/d409ac473b)] - **test**: disable test-tick-processor - aix and be ppc (Michael Dawson) [#3491](https://github.com/nodejs/node/pull/3491) +* [[`c1623039dd`](https://github.com/nodejs/node/commit/c1623039dd)] - **test**: harden test-child-process-fork-regr-gh-2847 (Michael Dawson) [#3459](https://github.com/nodejs/node/pull/3459) +* [[`3bb4437abb`](https://github.com/nodejs/node/commit/3bb4437abb)] - **test**: fix test-net-keepalive for AIX (Imran Iqbal) [#3458](https://github.com/nodejs/node/pull/3458) +* [[`af55641a69`](https://github.com/nodejs/node/commit/af55641a69)] - **test**: wrap assert.fail when passed to callback (Myles Borins) [#3453](https://github.com/nodejs/node/pull/3453) +* [[`7c7ef01e65`](https://github.com/nodejs/node/commit/7c7ef01e65)] - **test**: skip test-dns-ipv6.js if ipv6 is unavailable (Junliang Yan) [#3444](https://github.com/nodejs/node/pull/3444) +* [[`a4d1510ba4`](https://github.com/nodejs/node/commit/a4d1510ba4)] - **test**: repl-persistent-history is no longer flaky (Jeremiah Senkpiel) [#3437](https://github.com/nodejs/node/pull/3437) +* [[`a5d968b8a2`](https://github.com/nodejs/node/commit/a5d968b8a2)] - **test**: fix flaky test-child-process-emfile (Rich Trott) [#3430](https://github.com/nodejs/node/pull/3430) +* [[`eac2acca76`](https://github.com/nodejs/node/commit/eac2acca76)] - **test**: remove flaky status from eval_messages test (Rich Trott) [#3420](https://github.com/nodejs/node/pull/3420) +* [[`155c778584`](https://github.com/nodejs/node/commit/155c778584)] - **test**: fix flaky test for symlinks (Rich Trott) [#3418](https://github.com/nodejs/node/pull/3418) +* [[`74eb632483`](https://github.com/nodejs/node/commit/74eb632483)] - **test**: apply correct assert.fail() arguments (Rich Trott) [#3378](https://github.com/nodejs/node/pull/3378) +* [[`0a4323dd82`](https://github.com/nodejs/node/commit/0a4323dd82)] - **test**: replace util with backtick strings (Myles Borins) [#3359](https://github.com/nodejs/node/pull/3359) +* [[`93847694ec`](https://github.com/nodejs/node/commit/93847694ec)] - **test**: add test-child-process-emfile fail message (Rich Trott) [#3335](https://github.com/nodejs/node/pull/3335) +* [[`8d78d687d5`](https://github.com/nodejs/node/commit/8d78d687d5)] - **timers**: reuse timer in `setTimeout().unref()` (Fedor Indutny) [#3407](https://github.com/nodejs/node/pull/3407) +* [[`e69c869399`](https://github.com/nodejs/node/commit/e69c869399)] - **tls**: TLSSocket options default isServer false (Yuval Brik) [#2614](https://github.com/nodejs/node/pull/2614) +* [[`0b32bbbf69`](https://github.com/nodejs/node/commit/0b32bbbf69)] - **v8**: pull fix for builtin code size on PPC (Michael Dawson) [#3474](https://github.com/nodejs/node/pull/3474) + + +## 2015-10-13, Version 4.2.1 'Argon' (LTS), @jasnell + +### Notable changes + +* Includes fixes for two regressions + - Assertion error in WeakCallback - see [#3329](https://github.com/nodejs/node/pull/3329) + - Undefined timeout regression - see [#3331](https://github.com/nodejs/node/pull/3331) + +### Known issues + +* When a server queues a large amount of data to send to a client over a pipelined HTTP connection, the underlying socket may be destroyed. See [#3332](https://github.com/nodejs/node/issues/3332) and [#3342](https://github.com/nodejs/node/pull/3342). +* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/node/issues/1264). +* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/node/issues/690) +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/node/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). + +### Commits + +* [[`b3cbd13340`](https://github.com/nodejs/node/commit/b3cbd13340)] - **buffer**: fix assertion error in WeakCallback (Fedor Indutny) [#3329](https://github.com/nodejs/node/pull/3329) +* [[`102cb7288c`](https://github.com/nodejs/node/commit/102cb7288c)] - **doc**: label v4.2.0 as LTS in changelog heading (Rod Vagg) [#3343](https://github.com/nodejs/node/pull/3343) +* [[`c245a199a7`](https://github.com/nodejs/node/commit/c245a199a7)] - **lib**: fix undefined timeout regression (Ryan Graham) [#3331](https://github.com/nodejs/node/pull/3331) + +## 2015-10-07, Version 4.2.0 'Argon' (LTS), @jasnell + +### Notable changes + +The first Node.js LTS release! See https://github.com/nodejs/LTS/ for details of the LTS process. + +* **icu**: Updated to version 56 with significant performance improvements (Steven R. Loomis) [#3281](https://github.com/nodejs/node/pull/3281) +* **node**: + - Added new `-c` (or `--check`) command line argument for checking script syntax without executing the code (Dave Eddy) [#2411](https://github.com/nodejs/node/pull/2411) + - Added `process.versions.icu` to hold the current ICU library version (Evan Lucas) [#3102](https://github.com/nodejs/node/pull/3102) + - Added `process.release.lts` to hold the current LTS codename when the binary is from an active LTS release line (Rod Vagg) [#3212](https://github.com/nodejs/node/pull/3212) +* **npm**: Upgraded to npm 2.14.7 from 2.14.4, see [release notes](https://github.com/npm/npm/releases/tag/v2.14.7) for full details (Kat Marchán) [#3299](https://github.com/nodejs/node/pull/3299) + +### Known issues + +See https://github.com/nodejs/node/labels/confirmed-bug for complete and current list of known issues. + +* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/node/issues/1264). +* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/node/issues/690) +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/node/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). + +### Commits + + +* [[`8383c4fe00`](https://github.com/nodejs/node/commit/8383c4fe00)] - **assert**: support arrow functions in .throws() (Ben Noordhuis) [#3276](https://github.com/nodejs/node/pull/3276) +* [[`3eaa593a32`](https://github.com/nodejs/node/commit/3eaa593a32)] - **async_wrap**: correctly pass parent to init callback (Trevor Norris) [#3216](https://github.com/nodejs/node/pull/3216) +* [[`54795620f6`](https://github.com/nodejs/node/commit/54795620f6)] - **buffer**: don't abort on prototype getters (Trevor Norris) [#3302](https://github.com/nodejs/node/pull/3302) +* [[`660f7591c8`](https://github.com/nodejs/node/commit/660f7591c8)] - **buffer**: FreeCallback should be tied to ArrayBuffer (Fedor Indutny) [#3198](https://github.com/nodejs/node/pull/3198) +* [[`651a5b51eb`](https://github.com/nodejs/node/commit/651a5b51eb)] - **buffer**: only check if instance is Uint8Array (Trevor Norris) [#3080](https://github.com/nodejs/node/pull/3080) +* [[`d5a1b1ad7c`](https://github.com/nodejs/node/commit/d5a1b1ad7c)] - **buffer**: clean up usage of __proto__ (Trevor Norris) [#3080](https://github.com/nodejs/node/pull/3080) +* [[`af24376e18`](https://github.com/nodejs/node/commit/af24376e18)] - **build**: Intl: deps: bump ICU to 56.1 (GA) (Steven R. Loomis) [#3281](https://github.com/nodejs/node/pull/3281) +* [[`9136359d57`](https://github.com/nodejs/node/commit/9136359d57)] - **build**: make icu download path customizable (Johan Bergström) [#3200](https://github.com/nodejs/node/pull/3200) +* [[`b3c5ad10a8`](https://github.com/nodejs/node/commit/b3c5ad10a8)] - **build**: add --with-arm-fpu option (Jérémy Lal) [#3228](https://github.com/nodejs/node/pull/3228) +* [[`f00f3268e4`](https://github.com/nodejs/node/commit/f00f3268e4)] - **build**: intl: avoid 'duplicate main()' on ICU 56 (Steven R. Loomis) [#3066](https://github.com/nodejs/node/pull/3066) +* [[`071c72a6a3`](https://github.com/nodejs/node/commit/071c72a6a3)] - **deps**: upgrade to npm 2.14.7 (Kat Marchán) [#3299](https://github.com/nodejs/node/pull/3299) +* [[`8b50e95f06`](https://github.com/nodejs/node/commit/8b50e95f06)] - **(SEMVER-MINOR)** **deps**: backport 1ee712a from V8 upstream (Julien Gilli) [#3036](https://github.com/nodejs/node/pull/3036) +* [[`747271372f`](https://github.com/nodejs/node/commit/747271372f)] - **doc**: update the assert module summary (David Boivin) [#2799](https://github.com/nodejs/node/pull/2799) +* [[`0d506556b0`](https://github.com/nodejs/node/commit/0d506556b0)] - **doc**: replace node-gyp link with nodejs/node-gyp (Roman Klauke) [#3320](https://github.com/nodejs/node/pull/3320) +* [[`40a159e4f4`](https://github.com/nodejs/node/commit/40a159e4f4)] - **doc**: Amend capitalization of word JavaScript (Dave Hodder) [#3285](https://github.com/nodejs/node/pull/3285) +* [[`6dd34761fd`](https://github.com/nodejs/node/commit/6dd34761fd)] - **doc**: add method links in dns.markdown (Alejandro Oviedo) [#3196](https://github.com/nodejs/node/pull/3196) +* [[`333e8336be`](https://github.com/nodejs/node/commit/333e8336be)] - **doc**: add method links in child_process.markdown (Alejandro Oviedo) [#3186](https://github.com/nodejs/node/pull/3186) +* [[`0cfc6d39ca`](https://github.com/nodejs/node/commit/0cfc6d39ca)] - **doc**: recommend Infinity on emitter.setMaxListeners (Jason Karns) [#2559](https://github.com/nodejs/node/pull/2559) +* [[`d4fc6d93ef`](https://github.com/nodejs/node/commit/d4fc6d93ef)] - **doc**: add help repo link to CONTRIBUTING.md (Doug Shamoo) [#3233](https://github.com/nodejs/node/pull/3233) +* [[`28aac7f19d`](https://github.com/nodejs/node/commit/28aac7f19d)] - **doc**: add TLS session resumption example (Roman Reiss) [#3147](https://github.com/nodejs/node/pull/3147) +* [[`365cf22cce`](https://github.com/nodejs/node/commit/365cf22cce)] - **doc**: update AUTHORS list (Rod Vagg) [#3211](https://github.com/nodejs/node/pull/3211) +* [[`d4399613b7`](https://github.com/nodejs/node/commit/d4399613b7)] - **doc**: standardize references to userland (Martial) [#3192](https://github.com/nodejs/node/pull/3192) +* [[`75de258376`](https://github.com/nodejs/node/commit/75de258376)] - **doc**: fix spelling in Buffer documentation (Rod Machen) [#3226](https://github.com/nodejs/node/pull/3226) +* [[`725c7276dd`](https://github.com/nodejs/node/commit/725c7276dd)] - **doc**: fix README.md link to joyent/node intl wiki (Steven R. Loomis) [#3067](https://github.com/nodejs/node/pull/3067) +* [[`4a35ba4966`](https://github.com/nodejs/node/commit/4a35ba4966)] - **(SEMVER-MINOR)** **fs**: include filename in watch errors (charlierudolph) [#2748](https://github.com/nodejs/node/pull/2748) +* [[`2ddbbfd164`](https://github.com/nodejs/node/commit/2ddbbfd164)] - **http**: cork/uncork before flushing pipelined res (Fedor Indutny) [#3172](https://github.com/nodejs/node/pull/3172) +* [[`f638402e2f`](https://github.com/nodejs/node/commit/f638402e2f)] - **http**: add comment about `outputSize` in res/server (Fedor Indutny) [#3128](https://github.com/nodejs/node/pull/3128) +* [[`1850879b0e`](https://github.com/nodejs/node/commit/1850879b0e)] - **js_stream**: prevent abort if isalive doesn't exist (Trevor Norris) [#3282](https://github.com/nodejs/node/pull/3282) +* [[`63644dd1cd`](https://github.com/nodejs/node/commit/63644dd1cd)] - **lib**: remove redundant code, add tests in timers.js (Rich Trott) [#3143](https://github.com/nodejs/node/pull/3143) +* [[`74f443583c`](https://github.com/nodejs/node/commit/74f443583c)] - **module**: use UNC paths when loading native addons (Justin Chase) [#2965](https://github.com/nodejs/node/pull/2965) +* [[`01cb3fc36b`](https://github.com/nodejs/node/commit/01cb3fc36b)] - **net**: don't throw on bytesWritten access (Trevor Norris) [#3305](https://github.com/nodejs/node/pull/3305) +* [[`9d65528b01`](https://github.com/nodejs/node/commit/9d65528b01)] - **(SEMVER-MINOR)** **node**: add -c|--check CLI arg to syntax check script (Dave Eddy) [#2411](https://github.com/nodejs/node/pull/2411) +* [[`42b936e78d`](https://github.com/nodejs/node/commit/42b936e78d)] - **(SEMVER-MINOR)** **src**: add process.release.lts property (Rod Vagg) [#3212](https://github.com/nodejs/node/pull/3212) +* [[`589287b2e3`](https://github.com/nodejs/node/commit/589287b2e3)] - **src**: convert BE-utf16-string to LE before search (Karl Skomski) [#3295](https://github.com/nodejs/node/pull/3295) +* [[`2314378f06`](https://github.com/nodejs/node/commit/2314378f06)] - **src**: fix u-a-free if uv returns err in ASYNC_CALL (Karl Skomski) [#3049](https://github.com/nodejs/node/pull/3049) +* [[`d99336a391`](https://github.com/nodejs/node/commit/d99336a391)] - **(SEMVER-MINOR)** **src**: replace naive search in Buffer::IndexOf (Karl Skomski) [#2539](https://github.com/nodejs/node/pull/2539) +* [[`546e8333ba`](https://github.com/nodejs/node/commit/546e8333ba)] - **(SEMVER-MINOR)** **src**: fix --abort-on-uncaught-exception (Jeremy Whitlock) [#3036](https://github.com/nodejs/node/pull/3036) +* [[`7271cb047c`](https://github.com/nodejs/node/commit/7271cb047c)] - **(SEMVER-MINOR)** **src**: add process.versions.icu (Evan Lucas) [#3102](https://github.com/nodejs/node/pull/3102) +* [[`7b9f78acb2`](https://github.com/nodejs/node/commit/7b9f78acb2)] - **stream**: avoid pause with unpipe in buffered write (Brian White) [#2325](https://github.com/nodejs/node/pull/2325) +* [[`f0f8afd879`](https://github.com/nodejs/node/commit/f0f8afd879)] - **test**: remove common.inspect() (Rich Trott) [#3257](https://github.com/nodejs/node/pull/3257) +* [[`5ca4f6f8bd`](https://github.com/nodejs/node/commit/5ca4f6f8bd)] - **test**: test `util` rather than `common` (Rich Trott) [#3256](https://github.com/nodejs/node/pull/3256) +* [[`7a5ae34345`](https://github.com/nodejs/node/commit/7a5ae34345)] - **test**: refresh temp directory when using pipe (Rich Trott) [#3231](https://github.com/nodejs/node/pull/3231) +* [[`7c85557ef0`](https://github.com/nodejs/node/commit/7c85557ef0)] - **test**: Fix test-fs-read-stream-fd-leak race cond (Junliang Yan) [#3218](https://github.com/nodejs/node/pull/3218) +* [[`26a7ec6960`](https://github.com/nodejs/node/commit/26a7ec6960)] - **test**: fix losing original env vars issue (Junliang Yan) [#3190](https://github.com/nodejs/node/pull/3190) +* [[`e922716192`](https://github.com/nodejs/node/commit/e922716192)] - **test**: remove deprecated error logging (Rich Trott) [#3079](https://github.com/nodejs/node/pull/3079) +* [[`8f29d95a8c`](https://github.com/nodejs/node/commit/8f29d95a8c)] - **test**: report timeout in TapReporter (Karl Skomski) [#2647](https://github.com/nodejs/node/pull/2647) +* [[`2d0fe4c657`](https://github.com/nodejs/node/commit/2d0fe4c657)] - **test**: linting for buffer-free-callback test (Rich Trott) [#3230](https://github.com/nodejs/node/pull/3230) +* [[`70c9e4337e`](https://github.com/nodejs/node/commit/70c9e4337e)] - **test**: make common.js mandatory via linting rule (Rich Trott) [#3157](https://github.com/nodejs/node/pull/3157) +* [[`b7179562aa`](https://github.com/nodejs/node/commit/b7179562aa)] - **test**: load common.js in all tests (Rich Trott) [#3157](https://github.com/nodejs/node/pull/3157) +* [[`bab555a1c1`](https://github.com/nodejs/node/commit/bab555a1c1)] - **test**: speed up stringbytes-external test (Evan Lucas) [#3005](https://github.com/nodejs/node/pull/3005) +* [[`ddf258376d`](https://github.com/nodejs/node/commit/ddf258376d)] - **test**: use normalize() for unicode paths (Roman Reiss) [#3007](https://github.com/nodejs/node/pull/3007) +* [[`46876d519c`](https://github.com/nodejs/node/commit/46876d519c)] - **test**: remove arguments.callee usage (Roman Reiss) [#3167](https://github.com/nodejs/node/pull/3167) +* [[`af10df6108`](https://github.com/nodejs/node/commit/af10df6108)] - **tls**: use parent handle's close callback (Fedor Indutny) [#2991](https://github.com/nodejs/node/pull/2991) +* [[`9c2748bad1`](https://github.com/nodejs/node/commit/9c2748bad1)] - **tools**: remove leftover license boilerplate (Nathan Rajlich) [#3225](https://github.com/nodejs/node/pull/3225) +* [[`5d9f83ff2a`](https://github.com/nodejs/node/commit/5d9f83ff2a)] - **tools**: apply linting to custom rules code (Rich Trott) [#3195](https://github.com/nodejs/node/pull/3195) +* [[`18a8b2ec73`](https://github.com/nodejs/node/commit/18a8b2ec73)] - **tools**: remove unused gflags module (Ben Noordhuis) [#3220](https://github.com/nodejs/node/pull/3220) +* [[`e0fffca836`](https://github.com/nodejs/node/commit/e0fffca836)] - **util**: fix for inspecting promises (Evan Lucas) [#3221](https://github.com/nodejs/node/pull/3221) +* [[`8dfdee3733`](https://github.com/nodejs/node/commit/8dfdee3733)] - **util**: correctly inspect Map/Set Iterators (Evan Lucas) [#3119](https://github.com/nodejs/node/pull/3119) +* [[`b5c51fdba0`](https://github.com/nodejs/node/commit/b5c51fdba0)] - **util**: fix check for Array constructor (Evan Lucas) [#3119](https://github.com/nodejs/node/pull/3119) + +## 2015-10-05, Version 4.1.2 (Stable), @rvagg + +### Notable changes + +* **http**: + - Fix out-of-order 'finish' event bug in pipelining that can abort execution, fixes DoS vulnerability [CVE-2015-7384](https://github.com/nodejs/node/issues/3138) (Fedor Indutny) [#3128](https://github.com/nodejs/node/pull/3128) + - Account for pending response data instead of just the data on the current request to decide whether pause the socket or not (Fedor Indutny) [#3128](https://github.com/nodejs/node/pull/3128) +* **libuv**: Upgraded from v1.7.4 to v1.7.5, see [release notes](https://github.com/libuv/libuv/releases/tag/v1.7.5) for details (Saúl Ibarra Corretgé) [#3010](https://github.com/nodejs/node/pull/3010) + - A better rwlock implementation for all Windows versions + - Improved AIX support +* **v8**: + - Upgraded from v4.5.103.33 to v4.5.103.35 (Ali Ijaz Sheikh) [#3117](https://github.com/nodejs/node/pull/3117) + - Backported [f782159](https://codereview.chromium.org/1367123003) from v8's upstream to help speed up Promise introspection (Ben Noordhuis) [#3130](https://github.com/nodejs/node/pull/3130) + - Backported [c281c15](https://codereview.chromium.org/1363683002) from v8's upstream to add JSTypedArray length in post-mortem metadata (Julien Gilli) [#3031](https://github.com/nodejs/node/pull/3031) + +### Known issues + +See https://github.com/nodejs/node/labels/confirmed-bug for complete and current list of known issues. + +* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/node/issues/1264). +* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/node/issues/690) +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/node/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). + +### Commits + +* [[`39b8730e8b`](https://github.com/nodejs/node/commit/39b8730e8b)] - **async_wrap**: ensure all objects have internal field (Trevor Norris) [#3139](https://github.com/nodejs/node/pull/3139) +* [[`99e66074d7`](https://github.com/nodejs/node/commit/99e66074d7)] - **async_wrap**: update providers and add test (Trevor Norris) [#3139](https://github.com/nodejs/node/pull/3139) +* [[`7a58157d4e`](https://github.com/nodejs/node/commit/7a58157d4e)] - **benchmark**: update comment in common.js (Minwoo Jung) [#2399](https://github.com/nodejs/node/pull/2399) +* [[`9e9bfa4dc0`](https://github.com/nodejs/node/commit/9e9bfa4dc0)] - **build**: iojs -> nodejs of release-urlbase (P.S.V.R) [#3015](https://github.com/nodejs/node/pull/3015) +* [[`8335ec7191`](https://github.com/nodejs/node/commit/8335ec7191)] - **build**: fix some typos inside the configure script (P.S.V.R) [#3016](https://github.com/nodejs/node/pull/3016) +* [[`d6ac547d5d`](https://github.com/nodejs/node/commit/d6ac547d5d)] - **build,win**: fix node.exe resource version (João Reis) [#3053](https://github.com/nodejs/node/pull/3053) +* [[`798dad24f4`](https://github.com/nodejs/node/commit/798dad24f4)] - **child_process**: `null` channel handle on close (Fedor Indutny) [#3041](https://github.com/nodejs/node/pull/3041) +* [[`e5615854ea`](https://github.com/nodejs/node/commit/e5615854ea)] - **contextify**: use CHECK instead of `if` (Oguz Bastemur) [#3125](https://github.com/nodejs/node/pull/3125) +* [[`f055a66a38`](https://github.com/nodejs/node/commit/f055a66a38)] - **crypto**: enable FIPS only when configured with it (Fedor Indutny) [#3153](https://github.com/nodejs/node/pull/3153) +* [[`4c8d96bc30`](https://github.com/nodejs/node/commit/4c8d96bc30)] - **crypto**: add more keylen sanity checks in pbkdf2 (Johann) [#3029](https://github.com/nodejs/node/pull/3029) +* [[`4c5940776c`](https://github.com/nodejs/node/commit/4c5940776c)] - **deps**: upgrade libuv to 1.7.5 (Saúl Ibarra Corretgé) [#3010](https://github.com/nodejs/node/pull/3010) +* [[`5a9e795577`](https://github.com/nodejs/node/commit/5a9e795577)] - **deps**: upgrade V8 to 4.5.103.35 (Ali Ijaz Sheikh) [#3117](https://github.com/nodejs/node/pull/3117) +* [[`925b29f959`](https://github.com/nodejs/node/commit/925b29f959)] - **deps**: backport f782159 from v8's upstream (Ben Noordhuis) [#3130](https://github.com/nodejs/node/pull/3130) +* [[`039f73fa83`](https://github.com/nodejs/node/commit/039f73fa83)] - **deps**: remove and gitignore .bin directory (Ben Noordhuis) [#3004](https://github.com/nodejs/node/pull/3004) +* [[`5fbb24812d`](https://github.com/nodejs/node/commit/5fbb24812d)] - **deps**: backport c281c15 from V8's upstream (Julien Gilli) [#3031](https://github.com/nodejs/node/pull/3031) +* [[`6ee5d0f69f`](https://github.com/nodejs/node/commit/6ee5d0f69f)] - **dns**: add missing exports.BADNAME (Roman Reiss) [#3051](https://github.com/nodejs/node/pull/3051) +* [[`f92aee7170`](https://github.com/nodejs/node/commit/f92aee7170)] - **doc**: fix outdated 'try/catch' statement in sync (Minwoo Jung) [#3087](https://github.com/nodejs/node/pull/3087) +* [[`c7161f39e8`](https://github.com/nodejs/node/commit/c7161f39e8)] - **doc**: add TSC meeting minutes 2015-09-16 (Rod Vagg) [#3023](https://github.com/nodejs/node/pull/3023) +* [[`928166c4a8`](https://github.com/nodejs/node/commit/928166c4a8)] - **doc**: copyedit fs.watch() information (Rich Trott) [#3097](https://github.com/nodejs/node/pull/3097) +* [[`75d5dcea76`](https://github.com/nodejs/node/commit/75d5dcea76)] - **doc**: jenkins-iojs.nodesource.com -> ci.nodejs.org (Michał Gołębiowski) [#2886](https://github.com/nodejs/node/pull/2886) +* [[`5c3f50b21d`](https://github.com/nodejs/node/commit/5c3f50b21d)] - **doc**: rearrange execSync and execFileSync (Laurent Fortin) [#2940](https://github.com/nodejs/node/pull/2940) +* [[`4fc33ac11a`](https://github.com/nodejs/node/commit/4fc33ac11a)] - **doc**: make execFileSync in line with execFile (Laurent Fortin) [#2940](https://github.com/nodejs/node/pull/2940) +* [[`a366e84b17`](https://github.com/nodejs/node/commit/a366e84b17)] - **doc**: fix typos in cluster & errors (reggi) [#3011](https://github.com/nodejs/node/pull/3011) +* [[`52031e1bf1`](https://github.com/nodejs/node/commit/52031e1bf1)] - **doc**: switch LICENSE from closure-linter to eslint (P.S.V.R) [#3018](https://github.com/nodejs/node/pull/3018) +* [[`b28f6a53bc`](https://github.com/nodejs/node/commit/b28f6a53bc)] - **docs**: Clarify assert.doesNotThrow behavior (Fabio Oliveira) [#2807](https://github.com/nodejs/node/pull/2807) +* [[`99943e189d`](https://github.com/nodejs/node/commit/99943e189d)] - **http**: fix out-of-order 'finish' bug in pipelining (Fedor Indutny) [#3128](https://github.com/nodejs/node/pull/3128) +* [[`fb7a491d1c`](https://github.com/nodejs/node/commit/fb7a491d1c)] - **http_server**: pause socket properly (Fedor Indutny) [#3128](https://github.com/nodejs/node/pull/3128) +* [[`a0b35bfcf3`](https://github.com/nodejs/node/commit/a0b35bfcf3)] - **i18n**: add caller to removal list for bidi in ICU55 (Michael Dawson) [#3115](https://github.com/nodejs/node/pull/3115) +* [[`ac2bce0b0c`](https://github.com/nodejs/node/commit/ac2bce0b0c)] - **path**: improve posixSplitPath performance (Evan Lucas) [#3034](https://github.com/nodejs/node/pull/3034) +* [[`37cdeafa2f`](https://github.com/nodejs/node/commit/37cdeafa2f)] - **smalloc**: remove module (Brendan Ashworth) [#3099](https://github.com/nodejs/node/pull/3099) +* [[`5ec5d0aa8b`](https://github.com/nodejs/node/commit/5ec5d0aa8b)] - **src**: internalize binding function property names (Ben Noordhuis) [#3060](https://github.com/nodejs/node/pull/3060) +* [[`c8175fc2af`](https://github.com/nodejs/node/commit/c8175fc2af)] - **src**: internalize per-isolate string properties (Ben Noordhuis) [#3060](https://github.com/nodejs/node/pull/3060) +* [[`9a593abc47`](https://github.com/nodejs/node/commit/9a593abc47)] - **src**: include signal.h in util.h (Cheng Zhao) [#3058](https://github.com/nodejs/node/pull/3058) +* [[`fde0c6f321`](https://github.com/nodejs/node/commit/fde0c6f321)] - **src**: fix function and variable names in comments (Sakthipriyan Vairamani) [#3039](https://github.com/nodejs/node/pull/3039) +* [[`1cc7b41ba4`](https://github.com/nodejs/node/commit/1cc7b41ba4)] - **stream_wrap**: support empty `TryWrite`s (Fedor Indutny) [#3128](https://github.com/nodejs/node/pull/3128) +* [[`9faf4c6fcf`](https://github.com/nodejs/node/commit/9faf4c6fcf)] - **test**: load common.js to test for global leaks (Rich Trott) [#3095](https://github.com/nodejs/node/pull/3095) +* [[`0858c86374`](https://github.com/nodejs/node/commit/0858c86374)] - **test**: fix invalid variable name (Sakthipriyan Vairamani) [#3150](https://github.com/nodejs/node/pull/3150) +* [[`1167171004`](https://github.com/nodejs/node/commit/1167171004)] - **test**: change calls to deprecated util.print() (Rich Trott) [#3083](https://github.com/nodejs/node/pull/3083) +* [[`5ada45bf28`](https://github.com/nodejs/node/commit/5ada45bf28)] - **test**: replace deprecated util.debug() calls (Rich Trott) [#3082](https://github.com/nodejs/node/pull/3082) +* [[`d8ab4e185d`](https://github.com/nodejs/node/commit/d8ab4e185d)] - **util**: optimize promise introspection (Ben Noordhuis) [#3130](https://github.com/nodejs/node/pull/3130) + +## 2015-09-22, Version 4.1.1 (Stable), @rvagg + +### Notable changes + +* **buffer**: Fixed a bug introduced in v4.1.0 where allocating a new zero-length buffer can result in the _next_ allocation of a TypedArray in JavaScript not being zero-filled. In certain circumstances this could result in data leakage via reuse of memory space in TypedArrays, breaking the normally safe assumption that TypedArrays should be always zero-filled. (Trevor Norris) [#2931](https://github.com/nodejs/node/pull/2931). +* **http**: Guard against response-splitting of HTTP trailing headers added via [`response.addTrailers()`](https://nodejs.org/api/http.html#http_response_addtrailers_headers) by removing new-line (`[\r\n]`) characters from values. Note that standard header values are already stripped of new-line characters. The expected security impact is low because trailing headers are rarely used. (Ben Noordhuis) [#2945](https://github.com/nodejs/node/pull/2945). +* **npm**: Upgrade to npm 2.14.4 from 2.14.3, see [release notes](https://github.com/npm/npm/releases/tag/v2.14.4) for full details (Kat Marchán) [#2958](https://github.com/nodejs/node/pull/2958) + - Upgrades `graceful-fs` on multiple dependencies to no longer rely on monkey-patching `fs` + - Fix `npm link` for pre-release / RC builds of Node +* **v8**: Update post-mortem metadata to allow post-mortem debugging tools to find and inspect: + - JavaScript objects that use dictionary properties (Julien Gilli) [#2959](https://github.com/nodejs/node/pull/2959) + - ScopeInfo and thus closures (Julien Gilli) [#2974](https://github.com/nodejs/node/pull/2974) + +### Known issues + +See https://github.com/nodejs/node/labels/confirmed-bug for complete and current list of known issues. + +* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/node/issues/1264). +* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/node/issues/690) +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/node/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). + +### Commits + +* [[`d63e02e08d`](https://github.com/nodejs/node/commit/d63e02e08d)] - **buffer**: don't set zero fill for zero-length buffer (Trevor Norris) [#2931](https://github.com/nodejs/node/pull/2931) +* [[`5905b14bff`](https://github.com/nodejs/node/commit/5905b14bff)] - **build**: fix icutrim when building small-icu on BE (Stewart Addison) [#2602](https://github.com/nodejs/node/pull/2602) +* [[`f010cb5d96`](https://github.com/nodejs/node/commit/f010cb5d96)] - **configure**: detect mipsel host (Jérémy Lal) [#2971](https://github.com/nodejs/node/pull/2971) +* [[`b93ad5abbd`](https://github.com/nodejs/node/commit/b93ad5abbd)] - **deps**: backport 357e6b9 from V8's upstream (Julien Gilli) [#2974](https://github.com/nodejs/node/pull/2974) +* [[`8da3da4d41`](https://github.com/nodejs/node/commit/8da3da4d41)] - **deps**: backport ff7d70b from V8's upstream (Julien Gilli) [#2959](https://github.com/nodejs/node/pull/2959) +* [[`2600fb8ae6`](https://github.com/nodejs/node/commit/2600fb8ae6)] - **deps**: upgraded to node-gyp@3.0.3 in npm (Kat Marchán) [#2958](https://github.com/nodejs/node/pull/2958) +* [[`793aad2d7a`](https://github.com/nodejs/node/commit/793aad2d7a)] - **deps**: upgrade to npm 2.14.4 (Kat Marchán) [#2958](https://github.com/nodejs/node/pull/2958) +* [[`43e2b7f836`](https://github.com/nodejs/node/commit/43e2b7f836)] - **doc**: remove usage of events.EventEmitter (Sakthipriyan Vairamani) [#2921](https://github.com/nodejs/node/pull/2921) +* [[`9c59d2f16a`](https://github.com/nodejs/node/commit/9c59d2f16a)] - **doc**: remove extra using v8::HandleScope statement (Christopher J. Brody) [#2983](https://github.com/nodejs/node/pull/2983) +* [[`f7edbab367`](https://github.com/nodejs/node/commit/f7edbab367)] - **doc**: clarify description of assert.ifError() (Rich Trott) [#2941](https://github.com/nodejs/node/pull/2941) +* [[`b2ddf0f9a2`](https://github.com/nodejs/node/commit/b2ddf0f9a2)] - **doc**: refine process.kill() and exit explanations (Rich Trott) [#2918](https://github.com/nodejs/node/pull/2918) +* [[`f68fed2e6f`](https://github.com/nodejs/node/commit/f68fed2e6f)] - **http**: remove redundant code in _deferToConnect (Malcolm Ahoy) [#2769](https://github.com/nodejs/node/pull/2769) +* [[`f542e74c93`](https://github.com/nodejs/node/commit/f542e74c93)] - **http**: guard against response splitting in trailers (Ben Noordhuis) [#2945](https://github.com/nodejs/node/pull/2945) +* [[`bc9f629387`](https://github.com/nodejs/node/commit/bc9f629387)] - **http_parser**: do not dealloc during kOnExecute (Fedor Indutny) [#2956](https://github.com/nodejs/node/pull/2956) +* [[`1860e0cebd`](https://github.com/nodejs/node/commit/1860e0cebd)] - **lib,src**: remove usage of events.EventEmitter (Sakthipriyan Vairamani) [#2921](https://github.com/nodejs/node/pull/2921) +* [[`d4cd5ac407`](https://github.com/nodejs/node/commit/d4cd5ac407)] - **readline**: fix tab completion bug (Matt Harrison) [#2816](https://github.com/nodejs/node/pull/2816) +* [[`9760e04839`](https://github.com/nodejs/node/commit/9760e04839)] - **repl**: don't use tty control codes when $TERM is set to "dumb" (Salman Aljammaz) [#2712](https://github.com/nodejs/node/pull/2712) +* [[`cb971cc97d`](https://github.com/nodejs/node/commit/cb971cc97d)] - **repl**: backslash bug fix (Sakthipriyan Vairamani) [#2968](https://github.com/nodejs/node/pull/2968) +* [[`2034f68668`](https://github.com/nodejs/node/commit/2034f68668)] - **src**: honor --abort_on_uncaught_exception flag (Evan Lucas) [#2776](https://github.com/nodejs/node/pull/2776) +* [[`0b1ca4a9ef`](https://github.com/nodejs/node/commit/0b1ca4a9ef)] - **src**: Add ABORT macro (Evan Lucas) [#2776](https://github.com/nodejs/node/pull/2776) +* [[`4519dd00f9`](https://github.com/nodejs/node/commit/4519dd00f9)] - **test**: test sync version of mkdir & rmdir (Sakthipriyan Vairamani) [#2588](https://github.com/nodejs/node/pull/2588) +* [[`816f609c8b`](https://github.com/nodejs/node/commit/816f609c8b)] - **test**: use tmpDir instead of fixtures in readdir (Sakthipriyan Vairamani) [#2587](https://github.com/nodejs/node/pull/2587) +* [[`2084f52585`](https://github.com/nodejs/node/commit/2084f52585)] - **test**: test more http response splitting scenarios (Ben Noordhuis) [#2945](https://github.com/nodejs/node/pull/2945) +* [[`fa08d1d8a1`](https://github.com/nodejs/node/commit/fa08d1d8a1)] - **test**: add test-spawn-cmd-named-pipe (Alexis Campailla) [#2770](https://github.com/nodejs/node/pull/2770) +* [[`71b5d80682`](https://github.com/nodejs/node/commit/71b5d80682)] - **test**: make cluster tests more time tolerant (Michael Dawson) [#2891](https://github.com/nodejs/node/pull/2891) +* [[`3e09dcfc32`](https://github.com/nodejs/node/commit/3e09dcfc32)] - **test**: update cwd-enoent tests for AIX (Imran Iqbal) [#2909](https://github.com/nodejs/node/pull/2909) +* [[`6ea8ec1c59`](https://github.com/nodejs/node/commit/6ea8ec1c59)] - **tools**: single, cross-platform tick processor (Matt Loring) [#2868](https://github.com/nodejs/node/pull/2868) + +## 2015-09-17, Version 4.1.0 (Stable), @Fishrock123 + +### Notable changes + +* **buffer**: + - Buffers are now created in JavaScript, rather than C++. This increases the speed of buffer creation (Trevor Norris) [#2866](https://github.com/nodejs/node/pull/2866). + - `Buffer#slice()` now uses `Uint8Array#subarray()` internally, increasing `slice()` performance (Karl Skomski) [#2777](https://github.com/nodejs/node/pull/2777). +* **fs**: + - `fs.utimes()` now properly converts numeric strings, `NaN`, and `Infinity` (Yazhong Liu) [#2387](https://github.com/nodejs/node/pull/2387). + - `fs.WriteStream` now implements `_writev`, allowing for super-fast bulk writes (Ron Korving) [#2167](https://github.com/nodejs/node/pull/2167). +* **http**: Fixed an issue with certain `write()` sizes causing errors when using `http.request()` (Fedor Indutny) [#2824](https://github.com/nodejs/node/pull/2824). +* **npm**: Upgrade to version 2.14.3, see https://github.com/npm/npm/releases/tag/v2.14.3 for more details (Kat Marchán) [#2822](https://github.com/nodejs/node/pull/2822). +* **src**: V8 cpu profiling no longer erroneously shows idle time (Oleksandr Chekhovskyi) [#2324](https://github.com/nodejs/node/pull/2324). +* **timers**: `#ref()` and `#unref()` now return the timer they belong to (Sam Roberts) [#2905](https://github.com/nodejs/node/pull/2905). +* **v8**: Lateral upgrade to 4.5.103.33 from 4.5.103.30, contains minor fixes (Ali Ijaz Sheikh) [#2870](https://github.com/nodejs/node/pull/2870). + - This fixes a previously known bug where some computed object shorthand properties did not work correctly ([#2507](https://github.com/nodejs/node/issues/2507)). + +### Known issues + +See https://github.com/nodejs/node/labels/confirmed-bug for complete and current list of known issues. + +* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/node/issues/1264). +* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/node/issues/690) +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/node/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). + +### Commits + +* [[`b1abe812cd`](https://github.com/nodejs/node/commit/b1abe812cd)] - Working on 4.0.1 (Rod Vagg) +* [[`f9f8378853`](https://github.com/nodejs/node/commit/f9f8378853)] - 2015-09-08, Version 4.0.0 (Stable) Release (Rod Vagg) +* [[`9683e5df51`](https://github.com/nodejs/node/commit/9683e5df51)] - **bindings**: close after reading module struct (Fedor Indutny) [#2792](https://github.com/nodejs/node/pull/2792) +* [[`4b4cfa2d44`](https://github.com/nodejs/node/commit/4b4cfa2d44)] - **buffer**: always allocate typed arrays outside heap (Trevor Norris) [#2893](https://github.com/nodejs/node/pull/2893) +* [[`7df018a29b`](https://github.com/nodejs/node/commit/7df018a29b)] - **buffer**: construct Uint8Array in JS (Trevor Norris) [#2866](https://github.com/nodejs/node/pull/2866) +* [[`43397b204e`](https://github.com/nodejs/node/commit/43397b204e)] - **(SEMVER-MINOR)** **build**: Updates to enable AIX support (Michael Dawson) [#2364](https://github.com/nodejs/node/pull/2364) +* [[`e35b1fd610`](https://github.com/nodejs/node/commit/e35b1fd610)] - **build**: clean up the generated tap file (Sakthipriyan Vairamani) [#2837](https://github.com/nodejs/node/pull/2837) +* [[`96670ebe37`](https://github.com/nodejs/node/commit/96670ebe37)] - **deps**: backport 6d32be2 from v8's upstream (Michaël Zasso) [#2916](https://github.com/nodejs/node/pull/2916) +* [[`94972d5b13`](https://github.com/nodejs/node/commit/94972d5b13)] - **deps**: backport 0d01728 from v8's upstream (Fedor Indutny) [#2912](https://github.com/nodejs/node/pull/2912) +* [[`7ebd881c29`](https://github.com/nodejs/node/commit/7ebd881c29)] - **deps**: upgrade V8 to 4.5.103.33 (Ali Ijaz Sheikh) [#2870](https://github.com/nodejs/node/pull/2870) +* [[`ed47ab6e44`](https://github.com/nodejs/node/commit/ed47ab6e44)] - **deps**: upgraded to node-gyp@3.0.3 in npm (Kat Marchán) [#2822](https://github.com/nodejs/node/pull/2822) +* [[`f4641ae875`](https://github.com/nodejs/node/commit/f4641ae875)] - **deps**: upgrade to npm 2.14.3 (Kat Marchán) [#2822](https://github.com/nodejs/node/pull/2822) +* [[`8119693a3d`](https://github.com/nodejs/node/commit/8119693a3d)] - **deps**: update libuv to version 1.7.4 (Saúl Ibarra Corretgé) [#2817](https://github.com/nodejs/node/pull/2817) +* [[`6098504685`](https://github.com/nodejs/node/commit/6098504685)] - **deps**: cherry-pick 6da51b4 from v8's upstream (Fedor Indutny) [#2801](https://github.com/nodejs/node/pull/2801) +* [[`bf42cc8dba`](https://github.com/nodejs/node/commit/bf42cc8dba)] - **doc**: process exit event is not guaranteed to fire (Rich Trott) [#2861](https://github.com/nodejs/node/pull/2861) +* [[`bb0f869f67`](https://github.com/nodejs/node/commit/bb0f869f67)] - **doc**: remove incorrect reference to TCP in net docs (Sam Roberts) [#2903](https://github.com/nodejs/node/pull/2903) +* [[`302d59dce8`](https://github.com/nodejs/node/commit/302d59dce8)] - **doc**: correct buffer.slice arg syntax (Sam Roberts) [#2903](https://github.com/nodejs/node/pull/2903) +* [[`74db9637b7`](https://github.com/nodejs/node/commit/74db9637b7)] - **doc**: describe spawn option.detached (Sam Roberts) [#2903](https://github.com/nodejs/node/pull/2903) +* [[`a7bd897273`](https://github.com/nodejs/node/commit/a7bd897273)] - **doc**: rename from iojs(1) to node(1) in benchmarks (Dmitry Vasilyev) [#2884](https://github.com/nodejs/node/pull/2884) +* [[`cd643d7c37`](https://github.com/nodejs/node/commit/cd643d7c37)] - **doc**: add missing backtick in buffer.markdown (Sven Slootweg) [#2881](https://github.com/nodejs/node/pull/2881) +* [[`e8a206e802`](https://github.com/nodejs/node/commit/e8a206e802)] - **doc**: fix broken link in repl.markdown (Danny Nemer) [#2827](https://github.com/nodejs/node/pull/2827) +* [[`7ee36d61f7`](https://github.com/nodejs/node/commit/7ee36d61f7)] - **doc**: fix typos in README (Ionică Bizău) [#2852](https://github.com/nodejs/node/pull/2852) +* [[`4d1ae26196`](https://github.com/nodejs/node/commit/4d1ae26196)] - **doc**: add tunniclm as a collaborator (Mike Tunnicliffe) [#2826](https://github.com/nodejs/node/pull/2826) +* [[`2d77d03643`](https://github.com/nodejs/node/commit/2d77d03643)] - **doc**: fix two doc errors in stream and process (Jeremiah Senkpiel) [#2549](https://github.com/nodejs/node/pull/2549) +* [[`55ac24f721`](https://github.com/nodejs/node/commit/55ac24f721)] - **doc**: fixed io.js references in process.markdown (Tristian Flanagan) [#2846](https://github.com/nodejs/node/pull/2846) +* [[`cd1297fb57`](https://github.com/nodejs/node/commit/cd1297fb57)] - **doc**: use "Calls" over "Executes" for consistency (Minwoo Jung) [#2800](https://github.com/nodejs/node/pull/2800) +* [[`d664b95581`](https://github.com/nodejs/node/commit/d664b95581)] - **doc**: use US English for consistency (Anne-Gaelle Colom) [#2784](https://github.com/nodejs/node/pull/2784) +* [[`82ba1839fb`](https://github.com/nodejs/node/commit/82ba1839fb)] - **doc**: use 3rd person singular for consistency (Anne-Gaelle Colom) [#2765](https://github.com/nodejs/node/pull/2765) +* [[`432cce6e95`](https://github.com/nodejs/node/commit/432cce6e95)] - **doc**: describe process API for IPC (Sam Roberts) [#1978](https://github.com/nodejs/node/pull/1978) +* [[`1d75012b9d`](https://github.com/nodejs/node/commit/1d75012b9d)] - **doc**: fix comma splice in Assertion Testing doc (Rich Trott) [#2728](https://github.com/nodejs/node/pull/2728) +* [[`6108ea9bb4`](https://github.com/nodejs/node/commit/6108ea9bb4)] - **fs**: consider NaN/Infinity in toUnixTimestamp (Yazhong Liu) [#2387](https://github.com/nodejs/node/pull/2387) +* [[`2b6aa9415f`](https://github.com/nodejs/node/commit/2b6aa9415f)] - **(SEMVER-MINOR)** **fs**: implemented WriteStream#writev (Ron Korving) [#2167](https://github.com/nodejs/node/pull/2167) +* [[`431bf74c55`](https://github.com/nodejs/node/commit/431bf74c55)] - **http**: default Agent.getName to 'localhost' (Malcolm Ahoy) [#2825](https://github.com/nodejs/node/pull/2825) +* [[`ea15d71c16`](https://github.com/nodejs/node/commit/ea15d71c16)] - **http_server**: fix resume after socket close (Fedor Indutny) [#2824](https://github.com/nodejs/node/pull/2824) +* [[`8e5843405b`](https://github.com/nodejs/node/commit/8e5843405b)] - **src**: null env_ field from constructor (Trevor Norris) [#2913](https://github.com/nodejs/node/pull/2913) +* [[`0a5f80a11f`](https://github.com/nodejs/node/commit/0a5f80a11f)] - **src**: use subarray() in Buffer#slice() for speedup (Karl Skomski) [#2777](https://github.com/nodejs/node/pull/2777) +* [[`57707e2490`](https://github.com/nodejs/node/commit/57707e2490)] - **src**: use ZCtxt as a source for v8::Isolates (Roman Klauke) [#2547](https://github.com/nodejs/node/pull/2547) +* [[`b0df2273ab`](https://github.com/nodejs/node/commit/b0df2273ab)] - **src**: fix v8::CpuProfiler idle sampling (Oleksandr Chekhovskyi) [#2324](https://github.com/nodejs/node/pull/2324) +* [[`eaa8e60b91`](https://github.com/nodejs/node/commit/eaa8e60b91)] - **streams**: refactor LazyTransform to internal/ (Brendan Ashworth) [#2566](https://github.com/nodejs/node/pull/2566) +* [[`648c003e14`](https://github.com/nodejs/node/commit/648c003e14)] - **test**: use tmp directory in chdir test (Sakthipriyan Vairamani) [#2589](https://github.com/nodejs/node/pull/2589) +* [[`079a2173d4`](https://github.com/nodejs/node/commit/079a2173d4)] - **test**: fix Buffer OOM error message (Trevor Norris) [#2915](https://github.com/nodejs/node/pull/2915) +* [[`52019a1b21`](https://github.com/nodejs/node/commit/52019a1b21)] - **test**: fix default value for additional param (Sakthipriyan Vairamani) [#2553](https://github.com/nodejs/node/pull/2553) +* [[`5df5d0423a`](https://github.com/nodejs/node/commit/5df5d0423a)] - **test**: remove disabled test (Rich Trott) [#2841](https://github.com/nodejs/node/pull/2841) +* [[`9e5f0995bd`](https://github.com/nodejs/node/commit/9e5f0995bd)] - **test**: split up internet dns tests (Rich Trott) [#2802](https://github.com/nodejs/node/pull/2802) +* [[`41f2dde51a`](https://github.com/nodejs/node/commit/41f2dde51a)] - **test**: increase dgram timeout for armv6 (Rich Trott) [#2808](https://github.com/nodejs/node/pull/2808) +* [[`6e2fe1c21a`](https://github.com/nodejs/node/commit/6e2fe1c21a)] - **test**: remove valid hostname check in test-dns.js (Rich Trott) [#2785](https://github.com/nodejs/node/pull/2785) +* [[`779e14f1a7`](https://github.com/nodejs/node/commit/779e14f1a7)] - **test**: expect error for test_lookup_ipv6_hint on FreeBSD (Rich Trott) [#2724](https://github.com/nodejs/node/pull/2724) +* [[`f931b9dd95`](https://github.com/nodejs/node/commit/f931b9dd95)] - **(SEMVER-MINOR)** **timer**: ref/unref return self (Sam Roberts) [#2905](https://github.com/nodejs/node/pull/2905) +* [[`59d03738cc`](https://github.com/nodejs/node/commit/59d03738cc)] - **tools**: enable arrow functions in .eslintrc (Sakthipriyan Vairamani) [#2840](https://github.com/nodejs/node/pull/2840) +* [[`69e7b875a2`](https://github.com/nodejs/node/commit/69e7b875a2)] - **tools**: open `test.tap` file in write-binary mode (Sakthipriyan Vairamani) [#2837](https://github.com/nodejs/node/pull/2837) +* [[`ff6d30d784`](https://github.com/nodejs/node/commit/ff6d30d784)] - **tools**: add missing tick processor polyfill (Matt Loring) [#2694](https://github.com/nodejs/node/pull/2694) +* [[`519caba021`](https://github.com/nodejs/node/commit/519caba021)] - **tools**: fix flakiness in test-tick-processor (Matt Loring) [#2694](https://github.com/nodejs/node/pull/2694) +* [[`ac004b8555`](https://github.com/nodejs/node/commit/ac004b8555)] - **tools**: remove hyphen in TAP result (Sakthipriyan Vairamani) [#2718](https://github.com/nodejs/node/pull/2718) +* [[`ba47511976`](https://github.com/nodejs/node/commit/ba47511976)] - **tsc**: adjust TSC membership for IBM+StrongLoop (James M Snell) [#2858](https://github.com/nodejs/node/pull/2858) +* [[`e035266805`](https://github.com/nodejs/node/commit/e035266805)] - **win,msi**: fix documentation shortcut url (Brian White) [#2781](https://github.com/nodejs/node/pull/2781) + +## 2015-09-08, Version 4.0.0 (Stable), @rvagg + +### Notable changes + +This list of changes is relative to the last io.js v3.x branch release, v3.3.0. Please see the list of notable changes in the v3.x, v2.x and v1.x releases for a more complete list of changes from 0.12.x. Note, that some changes in the v3.x series as well as major breaking changes in this release constitute changes required for full convergence of the Node.js and io.js projects. + +* **child_process**: `ChildProcess.prototype.send()` and `process.send()` operate asynchronously across all platforms so an optional callback parameter has been introduced that will be invoked once the message has been sent, i.e. `.send(message[, sendHandle][, callback])` (Ben Noordhuis) [#2620](https://github.com/nodejs/node/pull/2620). +* **node**: Rename "io.js" code to "Node.js" (cjihrig) [#2367](https://github.com/nodejs/node/pull/2367). +* **node-gyp**: This release bundles an updated version of node-gyp that works with all versions of Node.js and io.js including nightly and release candidate builds. From io.js v3 and Node.js v4 onward, it will only download a headers tarball when building addons rather than the entire source. (Rod Vagg) [#2700](https://github.com/nodejs/node/pull/2700) +* **npm**: Upgrade to version 2.14.2 from 2.13.3, includes a security update, see https://github.com/npm/npm/releases/tag/v2.14.2 for more details, (Kat Marchán) [#2696](https://github.com/nodejs/node/pull/2696). +* **timers**: Improved timer performance from porting the 0.12 implementation, plus minor fixes (Jeremiah Senkpiel) [#2540](https://github.com/nodejs/node/pull/2540), (Julien Gilli) [nodejs/node-v0.x-archive#8751](https://github.com/nodejs/node-v0.x-archive/pull/8751) [nodejs/node-v0.x-archive#8905](https://github.com/nodejs/node-v0.x-archive/pull/8905) +* **util**: The `util.is*()` functions have been deprecated, beginning with deprecation warnings in the documentation for this release, users are encouraged to seek more robust alternatives in the npm registry, (Sakthipriyan Vairamani) [#2447](https://github.com/nodejs/node/pull/2447). +* **v8**: Upgrade to version 4.5.103.30 from 4.4.63.30 (Ali Ijaz Sheikh) [#2632](https://github.com/nodejs/node/pull/2632). + - Implement new `TypedArray` prototype methods: `copyWithin()`, `every()`, `fill()`, `filter()`, `find()`, `findIndex()`, `forEach()`, `indexOf()`, `join()`, `lastIndexOf()`, `map()`, `reduce()`, `reduceRight()`, `reverse()`, `slice()`, `some()`, `sort()`. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray for further information. + - Implement new `TypedArray.from()` and `TypedArray.of()` functions. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray for further information. + - Implement arrow functions, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions for further information. + - Full ChangeLog available at https://github.com/v8/v8-git-mirror/blob/4.5.103/ChangeLog + +### Known issues + +See https://github.com/nodejs/node/labels/confirmed-bug for complete and current list of known issues. + +* Some uses of computed object shorthand properties are not handled correctly by the current version of V8. e.g. `[{ [prop]: val }]` evaluates to `[{}]`. [#2507](https://github.com/nodejs/node/issues/2507) +* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/node/issues/1264). +* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/node/issues/690) +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/node/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). + +### Commits + +* [[`4f50d3fb90`](https://github.com/nodejs/node/commit/4f50d3fb90)] - **(SEMVER-MAJOR)** This commit sets the value of process.release.name to "node". (cjihrig) [#2367](https://github.com/nodejs/node/pull/2367) +* [[`d3178d8b1b`](https://github.com/nodejs/node/commit/d3178d8b1b)] - **buffer**: SlowBuffer only accept valid numeric values (Michaël Zasso) [#2635](https://github.com/nodejs/node/pull/2635) +* [[`0cb0f4a6e4`](https://github.com/nodejs/node/commit/0cb0f4a6e4)] - **build**: fix v8_enable_handle_zapping override (Karl Skomski) [#2731](https://github.com/nodejs/node/pull/2731) +* [[`a7596d7efc`](https://github.com/nodejs/node/commit/a7596d7efc)] - **build**: remote commands on staging in single session (Rod Vagg) [#2717](https://github.com/nodejs/node/pull/2717) +* [[`be427e9efa`](https://github.com/nodejs/node/commit/be427e9efa)] - **build**: make .msi install to "nodejs", not "node" (Rod Vagg) [#2701](https://github.com/nodejs/node/pull/2701) +* [[`5652ce0dbc`](https://github.com/nodejs/node/commit/5652ce0dbc)] - **build**: fix .pkg creation tooling (Rod Vagg) [#2687](https://github.com/nodejs/node/pull/2687) +* [[`101db80111`](https://github.com/nodejs/node/commit/101db80111)] - **build**: add --enable-asan with builtin leakcheck (Karl Skomski) [#2376](https://github.com/nodejs/node/pull/2376) +* [[`2c3939c9c0`](https://github.com/nodejs/node/commit/2c3939c9c0)] - **child_process**: use stdio.fd even if it is 0 (Evan Lucas) [#2727](https://github.com/nodejs/node/pull/2727) +* [[`609db5a1dd`](https://github.com/nodejs/node/commit/609db5a1dd)] - **child_process**: check execFile and fork args (James M Snell) [#2667](https://github.com/nodejs/node/pull/2667) +* [[`d010568c23`](https://github.com/nodejs/node/commit/d010568c23)] - **(SEMVER-MAJOR)** **child_process**: add callback parameter to .send() (Ben Noordhuis) [#2620](https://github.com/nodejs/node/pull/2620) +* [[`c60857a81a`](https://github.com/nodejs/node/commit/c60857a81a)] - **cluster**: allow shared reused dgram sockets (Fedor Indutny) [#2548](https://github.com/nodejs/node/pull/2548) +* [[`b2ecbb6191`](https://github.com/nodejs/node/commit/b2ecbb6191)] - **contextify**: ignore getters during initialization (Fedor Indutny) [#2091](https://github.com/nodejs/node/pull/2091) +* [[`3711934095`](https://github.com/nodejs/node/commit/3711934095)] - **cpplint**: make it possible to run outside git repo (Ben Noordhuis) [#2710](https://github.com/nodejs/node/pull/2710) +* [[`03f900ab25`](https://github.com/nodejs/node/commit/03f900ab25)] - **crypto**: replace rwlocks with simple mutexes (Ben Noordhuis) [#2723](https://github.com/nodejs/node/pull/2723) +* [[`847459c29b`](https://github.com/nodejs/node/commit/847459c29b)] - **(SEMVER-MAJOR)** **crypto**: show exponent in decimal and hex (Chad Johnston) [#2320](https://github.com/nodejs/node/pull/2320) +* [[`e1c976184d`](https://github.com/nodejs/node/commit/e1c976184d)] - **deps**: improve ArrayBuffer performance in v8 (Fedor Indutny) [#2732](https://github.com/nodejs/node/pull/2732) +* [[`cc0ab17a23`](https://github.com/nodejs/node/commit/cc0ab17a23)] - **deps**: float node-gyp v3.0.0 (Rod Vagg) [#2700](https://github.com/nodejs/node/pull/2700) +* [[`b2c3c6d727`](https://github.com/nodejs/node/commit/b2c3c6d727)] - **deps**: create .npmrc during npm tests (Kat Marchán) [#2696](https://github.com/nodejs/node/pull/2696) +* [[`babdbfdbd5`](https://github.com/nodejs/node/commit/babdbfdbd5)] - **deps**: upgrade to npm 2.14.2 (Kat Marchán) [#2696](https://github.com/nodejs/node/pull/2696) +* [[`155783d876`](https://github.com/nodejs/node/commit/155783d876)] - **deps**: backport 75e43a6 from v8 upstream (again) (saper) [#2692](https://github.com/nodejs/node/pull/2692) +* [[`5424d6fcf0`](https://github.com/nodejs/node/commit/5424d6fcf0)] - **deps**: upgrade V8 to 4.5.103.30 (Ali Ijaz Sheikh) [#2632](https://github.com/nodejs/node/pull/2632) +* [[`c43172578e`](https://github.com/nodejs/node/commit/c43172578e)] - **(SEMVER-MAJOR)** **deps**: upgrade V8 to 4.5.103.24 (Ali Ijaz Sheikh) [#2509](https://github.com/nodejs/node/pull/2509) +* [[`714e96e8b9`](https://github.com/nodejs/node/commit/714e96e8b9)] - **deps**: backport 75e43a6 from v8 upstream (saper) [#2636](https://github.com/nodejs/node/pull/2636) +* [[`8637755cbf`](https://github.com/nodejs/node/commit/8637755cbf)] - **doc**: add TSC meeting minutes 2015-09-02 (Rod Vagg) [#2674](https://github.com/nodejs/node/pull/2674) +* [[`d3d5b93214`](https://github.com/nodejs/node/commit/d3d5b93214)] - **doc**: update environment vars in manpage and --help (Roman Reiss) [#2690](https://github.com/nodejs/node/pull/2690) +* [[`29f586ac0a`](https://github.com/nodejs/node/commit/29f586ac0a)] - **doc**: update url doc to account for escaping (Jeremiah Senkpiel) [#2605](https://github.com/nodejs/node/pull/2605) +* [[`ba50cfebef`](https://github.com/nodejs/node/commit/ba50cfebef)] - **doc**: reorder collaborators by their usernames (Johan Bergström) [#2322](https://github.com/nodejs/node/pull/2322) +* [[`8a9a3bf798`](https://github.com/nodejs/node/commit/8a9a3bf798)] - **doc**: update changelog for io.js v3.3.0 (Rod Vagg) [#2653](https://github.com/nodejs/node/pull/2653) +* [[`6cd0e2664b`](https://github.com/nodejs/node/commit/6cd0e2664b)] - **doc**: update io.js reference (Ben Noordhuis) [#2580](https://github.com/nodejs/node/pull/2580) +* [[`f9539c19e8`](https://github.com/nodejs/node/commit/f9539c19e8)] - **doc**: update changelog for io.js v3.2.0 (Rod Vagg) [#2512](https://github.com/nodejs/node/pull/2512) +* [[`cded6e7993`](https://github.com/nodejs/node/commit/cded6e7993)] - **doc**: fix CHANGELOG.md on master (Roman Reiss) [#2513](https://github.com/nodejs/node/pull/2513) +* [[`93e2830686`](https://github.com/nodejs/node/commit/93e2830686)] - **(SEMVER-MINOR)** **doc**: document deprecation of util.is* functions (Sakthipriyan Vairamani) [#2447](https://github.com/nodejs/node/pull/2447) +* [[`7038388558`](https://github.com/nodejs/node/commit/7038388558)] - **doc,test**: enable recursive file watching in Windows (Sakthipriyan Vairamani) [#2649](https://github.com/nodejs/node/pull/2649) +* [[`f3696f64a1`](https://github.com/nodejs/node/commit/f3696f64a1)] - **events,lib**: don't require EE#listenerCount() (Jeremiah Senkpiel) [#2661](https://github.com/nodejs/node/pull/2661) +* [[`45a2046f5d`](https://github.com/nodejs/node/commit/45a2046f5d)] - **(SEMVER-MAJOR)** **installer**: fix installers for node.js rename (Frederic Hemberger) [#2367](https://github.com/nodejs/node/pull/2367) +* [[`7a999a1376`](https://github.com/nodejs/node/commit/7a999a1376)] - **(SEMVER-MAJOR)** **lib**: add net.Socket#localFamily property (Ben Noordhuis) [#956](https://github.com/nodejs/node/pull/956) +* [[`de88255b0f`](https://github.com/nodejs/node/commit/de88255b0f)] - ***Revert*** "**lib,src**: add unix socket getsockname/getpeername" (Ben Noordhuis) [#2584](https://github.com/nodejs/node/pull/2584) +* [[`f337595441`](https://github.com/nodejs/node/commit/f337595441)] - **(SEMVER-MAJOR)** **lib,src**: add unix socket getsockname/getpeername (Ben Noordhuis) [#956](https://github.com/nodejs/node/pull/956) +* [[`3b602527d1`](https://github.com/nodejs/node/commit/3b602527d1)] - **(SEMVER-MAJOR)** **node**: additional cleanup for node rename (cjihrig) [#2367](https://github.com/nodejs/node/pull/2367) +* [[`a69ab27ab4`](https://github.com/nodejs/node/commit/a69ab27ab4)] - **(SEMVER-MAJOR)** **node**: rename from io.js to node (cjihrig) [#2367](https://github.com/nodejs/node/pull/2367) +* [[`9358eee9dd`](https://github.com/nodejs/node/commit/9358eee9dd)] - **node-gyp**: float 3.0.1, minor fix for download url (Rod Vagg) [#2737](https://github.com/nodejs/node/pull/2737) +* [[`d2d981252b`](https://github.com/nodejs/node/commit/d2d981252b)] - **src**: s/ia32/x86 for process.release.libUrl for win (Rod Vagg) [#2699](https://github.com/nodejs/node/pull/2699) +* [[`eba3d3dccd`](https://github.com/nodejs/node/commit/eba3d3dccd)] - **src**: use standard conform snprintf on windows (Karl Skomski) [#2404](https://github.com/nodejs/node/pull/2404) +* [[`cddbec231f`](https://github.com/nodejs/node/commit/cddbec231f)] - **src**: fix buffer overflow for long exception lines (Karl Skomski) [#2404](https://github.com/nodejs/node/pull/2404) +* [[`dd3f3417c7`](https://github.com/nodejs/node/commit/dd3f3417c7)] - **src**: re-enable fast math on arm (Michaël Zasso) [#2592](https://github.com/nodejs/node/pull/2592) +* [[`e137c1177c`](https://github.com/nodejs/node/commit/e137c1177c)] - **(SEMVER-MAJOR)** **src**: enable vector ics on arm again (Ali Ijaz Sheikh) [#2509](https://github.com/nodejs/node/pull/2509) +* [[`7ce749d722`](https://github.com/nodejs/node/commit/7ce749d722)] - **src**: replace usage of v8::Handle with v8::Local (Michaël Zasso) [#2202](https://github.com/nodejs/node/pull/2202) +* [[`b1a2d9509f`](https://github.com/nodejs/node/commit/b1a2d9509f)] - **src**: enable v8 deprecation warnings and fix them (Ben Noordhuis) [#2091](https://github.com/nodejs/node/pull/2091) +* [[`808de0da03`](https://github.com/nodejs/node/commit/808de0da03)] - **(SEMVER-MAJOR)** **src**: apply debug force load fixups from 41e63fb (Ali Ijaz Sheikh) [#2509](https://github.com/nodejs/node/pull/2509) +* [[`5201cb0ff1`](https://github.com/nodejs/node/commit/5201cb0ff1)] - **src**: fix memory leak in ExternString (Karl Skomski) [#2402](https://github.com/nodejs/node/pull/2402) +* [[`2308a27c0a`](https://github.com/nodejs/node/commit/2308a27c0a)] - **src**: only set v8 flags if argc > 1 (Evan Lucas) [#2646](https://github.com/nodejs/node/pull/2646) +* [[`384effed20`](https://github.com/nodejs/node/commit/384effed20)] - **test**: fix use of `common` before required (Rod Vagg) [#2685](https://github.com/nodejs/node/pull/2685) +* [[`f146f686b7`](https://github.com/nodejs/node/commit/f146f686b7)] - **(SEMVER-MAJOR)** **test**: fix test-repl-tab-complete.js for V8 4.5 (Ali Ijaz Sheikh) [#2509](https://github.com/nodejs/node/pull/2509) +* [[`fe4b309fd3`](https://github.com/nodejs/node/commit/fe4b309fd3)] - **test**: refactor to eliminate flaky test (Rich Trott) [#2609](https://github.com/nodejs/node/pull/2609) +* [[`619721e6b8`](https://github.com/nodejs/node/commit/619721e6b8)] - **test**: mark eval_messages as flaky (Alexis Campailla) [#2648](https://github.com/nodejs/node/pull/2648) +* [[`93ba585b66`](https://github.com/nodejs/node/commit/93ba585b66)] - **test**: mark test-vm-syntax-error-stderr as flaky (João Reis) [#2662](https://github.com/nodejs/node/pull/2662) +* [[`367140bca0`](https://github.com/nodejs/node/commit/367140bca0)] - **test**: mark test-repl-persistent-history as flaky (João Reis) [#2659](https://github.com/nodejs/node/pull/2659) +* [[`f6b093343d`](https://github.com/nodejs/node/commit/f6b093343d)] - **timers**: minor `_unrefActive` fixes and improvements (Jeremiah Senkpiel) [#2540](https://github.com/nodejs/node/pull/2540) +* [[`403d7ee7d1`](https://github.com/nodejs/node/commit/403d7ee7d1)] - **timers**: don't mutate unref list while iterating it (Julien Gilli) [#2540](https://github.com/nodejs/node/pull/2540) +* [[`7a8c3e08c3`](https://github.com/nodejs/node/commit/7a8c3e08c3)] - **timers**: Avoid linear scan in `_unrefActive`. (Julien Gilli) [#2540](https://github.com/nodejs/node/pull/2540) +* [[`b630ebaf43`](https://github.com/nodejs/node/commit/b630ebaf43)] - **win,msi**: Upgrade from old upgrade code (João Reis) [#2439](https://github.com/nodejs/node/pull/2439) + +## 2015-09-02, Version 3.3.0, @rvagg + +### Notable changes + +* **build**: Add a `--link-module` option to `configure` that can be used to bundle additional JavaScript modules into a built binary (Bradley Meck) [#2497](https://github.com/nodejs/node/pull/2497) +* **docs**: Merge outstanding doc updates from joyent/node (James M Snell) [#2378](https://github.com/nodejs/node/pull/2378) +* **http_parser**: Significant performance improvement by having `http.Server` consume all initial data from its `net.Socket` and parsing directly without having to enter JavaScript. Any `'data'` listeners on the `net.Socket` will result in the data being "unconsumed" into JavaScript, thereby undoing any performance gains. (Fedor Indutny) [#2355](https://github.com/nodejs/node/pull/2355) +* **libuv**: Upgrade to 1.7.3 (from 1.6.1), see [ChangeLog](https://github.com/libuv/libuv/blob/v1.x/ChangeLog) for details (Saúl Ibarra Corretgé) [#2310](https://github.com/nodejs/node/pull/2310) +* **V8**: Upgrade to 4.4.63.30 (from 4.4.63.26) (Michaël Zasso) [#2482](https://github.com/nodejs/node/pull/2482) + +### Known issues + +See https://github.com/nodejs/io.js/labels/confirmed-bug for complete and current list of known issues. + +* Some uses of computed object shorthand properties are not handled correctly by the current version of V8. e.g. `[{ [prop]: val }]` evaluates to `[{}]`. [#2507](https://github.com/nodejs/node/issues/2507) +* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/io.js/issues/1264). +* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/io.js/issues/690) +* `process.send()` is not synchronous as the docs suggest, a regression introduced in 1.0.2, see [#760](https://github.com/nodejs/io.js/issues/760). +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/io.js/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/io.js/issues/1435). + +### Commits + +* [[`1a531b4e44`](https://github.com/nodejs/node/commit/1a531b4e44)] - **(SEMVER-MINOR)** Introduce --link-module to ./configure (Bradley Meck) [#2497](https://github.com/nodejs/node/pull/2497) +* [[`d2f314c190`](https://github.com/nodejs/node/commit/d2f314c190)] - **build**: fix borked chmod call for release uploads (Rod Vagg) [#2645](https://github.com/nodejs/node/pull/2645) +* [[`3172e9c541`](https://github.com/nodejs/node/commit/3172e9c541)] - **build**: set file permissions before uploading (Rod Vagg) [#2623](https://github.com/nodejs/node/pull/2623) +* [[`a860d7fae1`](https://github.com/nodejs/node/commit/a860d7fae1)] - **build**: change staging directory on new server (Rod Vagg) [#2623](https://github.com/nodejs/node/pull/2623) +* [[`50c0baa8d7`](https://github.com/nodejs/node/commit/50c0baa8d7)] - **build**: rename 'doc' directory to 'docs' for upload (Rod Vagg) [#2623](https://github.com/nodejs/node/pull/2623) +* [[`0a0577cf5f`](https://github.com/nodejs/node/commit/0a0577cf5f)] - **build**: fix bad cherry-pick for vcbuild.bat build-release (Rod Vagg) [#2625](https://github.com/nodejs/node/pull/2625) +* [[`34de90194b`](https://github.com/nodejs/node/commit/34de90194b)] - **build**: only define NODE_V8_OPTIONS if not empty (Evan Lucas) [#2532](https://github.com/nodejs/node/pull/2532) +* [[`944174b189`](https://github.com/nodejs/node/commit/944174b189)] - **build**: make ci test addons in test/addons (Ben Noordhuis) [#2428](https://github.com/nodejs/node/pull/2428) +* [[`e955f9a1b0`](https://github.com/nodejs/node/commit/e955f9a1b0)] - **crypto**: Use OPENSSL_cleanse to shred the data. (Сковорода Никита Андреевич) [#2575](https://github.com/nodejs/node/pull/2575) +* [[`395d736b9d`](https://github.com/nodejs/node/commit/395d736b9d)] - **debugger**: use strict equality comparison (Minwoo Jung) [#2558](https://github.com/nodejs/node/pull/2558) +* [[`1d0e5210a8`](https://github.com/nodejs/node/commit/1d0e5210a8)] - **deps**: upgrade libuv to 1.7.3 (Saúl Ibarra Corretgé) [#2310](https://github.com/nodejs/node/pull/2310) +* [[`34ef53364f`](https://github.com/nodejs/node/commit/34ef53364f)] - **deps**: update V8 to 4.4.63.30 (Michaël Zasso) [#2482](https://github.com/nodejs/node/pull/2482) +* [[`23579a5f4a`](https://github.com/nodejs/node/commit/23579a5f4a)] - **doc**: add TSC meeting minutes 2015-08-12 (Rod Vagg) [#2438](https://github.com/nodejs/node/pull/2438) +* [[`0cc59299a4`](https://github.com/nodejs/node/commit/0cc59299a4)] - **doc**: add TSC meeting minutes 2015-08-26 (Rod Vagg) [#2591](https://github.com/nodejs/node/pull/2591) +* [[`6efa96e33a`](https://github.com/nodejs/node/commit/6efa96e33a)] - **doc**: merge CHANGELOG.md with joyent/node ChangeLog (P.S.V.R) [#2536](https://github.com/nodejs/node/pull/2536) +* [[`f75d54607b`](https://github.com/nodejs/node/commit/f75d54607b)] - **doc**: clarify cluster behaviour with no workers (Jeremiah Senkpiel) [#2606](https://github.com/nodejs/node/pull/2606) +* [[`8936302121`](https://github.com/nodejs/node/commit/8936302121)] - **doc**: minor clarification in buffer.markdown (Сковорода Никита Андреевич) [#2574](https://github.com/nodejs/node/pull/2574) +* [[`0db0e53753`](https://github.com/nodejs/node/commit/0db0e53753)] - **doc**: add @jasnell and @sam-github to release team (Rod Vagg) [#2455](https://github.com/nodejs/node/pull/2455) +* [[`c16e100593`](https://github.com/nodejs/node/commit/c16e100593)] - **doc**: reorg release team to separate section (Rod Vagg) [#2455](https://github.com/nodejs/node/pull/2455) +* [[`e3e00143fd`](https://github.com/nodejs/node/commit/e3e00143fd)] - **doc**: fix bad merge on modules.markdown (James M Snell) +* [[`2f62455880`](https://github.com/nodejs/node/commit/2f62455880)] - **doc**: minor additional corrections and improvements (James M Snell) [#2378](https://github.com/nodejs/node/pull/2378) +* [[`3bd08aac4b`](https://github.com/nodejs/node/commit/3bd08aac4b)] - **doc**: minor grammatical update in crypto.markdown (James M Snell) [#2378](https://github.com/nodejs/node/pull/2378) +* [[`f707189370`](https://github.com/nodejs/node/commit/f707189370)] - **doc**: minor grammatical update (James M Snell) [#2378](https://github.com/nodejs/node/pull/2378) +* [[`6c98cf0266`](https://github.com/nodejs/node/commit/6c98cf0266)] - **doc**: remove repeated statement in globals.markdown (James M Snell) [#2378](https://github.com/nodejs/node/pull/2378) +* [[`48e6ccf8c2`](https://github.com/nodejs/node/commit/48e6ccf8c2)] - **doc**: remove 'dudes' from documentation (James M Snell) [#2378](https://github.com/nodejs/node/pull/2378) +* [[`b5d68f8076`](https://github.com/nodejs/node/commit/b5d68f8076)] - **doc**: update tense in child_process.markdown (James M Snell) [#2378](https://github.com/nodejs/node/pull/2378) +* [[`242e3fe3ba`](https://github.com/nodejs/node/commit/242e3fe3ba)] - **doc**: fixed worker.id type (James M Snell) [#2378](https://github.com/nodejs/node/pull/2378) +* [[`ea9ee15c21`](https://github.com/nodejs/node/commit/ea9ee15c21)] - **doc**: port is optional for socket.bind() (James M Snell) [#2378](https://github.com/nodejs/node/pull/2378) +* [[`0ff6657a50`](https://github.com/nodejs/node/commit/0ff6657a50)] - **doc**: fix minor types and grammar in fs docs (James M Snell) [#2378](https://github.com/nodejs/node/pull/2378) +* [[`94d83c04f2`](https://github.com/nodejs/node/commit/94d83c04f2)] - **doc**: update parameter name in net.markdown (James M Snell) [#2378](https://github.com/nodejs/node/pull/2378) +* [[`04111ce40f`](https://github.com/nodejs/node/commit/04111ce40f)] - **doc**: small typo in domain.markdown (James M Snell) [#2378](https://github.com/nodejs/node/pull/2378) +* [[`c9fdd1bbbf`](https://github.com/nodejs/node/commit/c9fdd1bbbf)] - **doc**: fixed typo in net.markdown (missing comma) (James M Snell) [#2378](https://github.com/nodejs/node/pull/2378) +* [[`27c07b3f8e`](https://github.com/nodejs/node/commit/27c07b3f8e)] - **doc**: update description of fs.exists in fs.markdown (James M Snell) [#2378](https://github.com/nodejs/node/pull/2378) +* [[`52018e73d9`](https://github.com/nodejs/node/commit/52018e73d9)] - **doc**: clarification on the 'close' event (James M Snell) [#2378](https://github.com/nodejs/node/pull/2378) +* [[`f6d3b87a25`](https://github.com/nodejs/node/commit/f6d3b87a25)] - **doc**: improve working in stream.markdown (James M Snell) [#2378](https://github.com/nodejs/node/pull/2378) +* [[`b5da89431a`](https://github.com/nodejs/node/commit/b5da89431a)] - **doc**: update path.extname documentation (James M Snell) [#2378](https://github.com/nodejs/node/pull/2378) +* [[`1d4ea609db`](https://github.com/nodejs/node/commit/1d4ea609db)] - **doc**: small clarifications to modules.markdown (James M Snell) [#2378](https://github.com/nodejs/node/pull/2378) +* [[`c888985591`](https://github.com/nodejs/node/commit/c888985591)] - **doc**: code style cleanups in repl.markdown (James M Snell) [#2378](https://github.com/nodejs/node/pull/2378) +* [[`105b493595`](https://github.com/nodejs/node/commit/105b493595)] - **doc**: correct grammar in cluster.markdown (James M Snell) [#2378](https://github.com/nodejs/node/pull/2378) +* [[`51b86ccac7`](https://github.com/nodejs/node/commit/51b86ccac7)] - **doc**: Clarify the module.parent is set once (James M Snell) [#2378](https://github.com/nodejs/node/pull/2378) +* [[`d2ffecba2d`](https://github.com/nodejs/node/commit/d2ffecba2d)] - **doc**: add internal modules notice (Jeremiah Senkpiel) [#2523](https://github.com/nodejs/node/pull/2523) +* [[`b36debd5cb`](https://github.com/nodejs/node/commit/b36debd5cb)] - **env**: introduce `KickNextTick` (Fedor Indutny) [#2355](https://github.com/nodejs/node/pull/2355) +* [[`1bc446863f`](https://github.com/nodejs/node/commit/1bc446863f)] - **http_parser**: consume StreamBase instance (Fedor Indutny) [#2355](https://github.com/nodejs/node/pull/2355) +* [[`ce04b735cc`](https://github.com/nodejs/node/commit/ce04b735cc)] - **src**: only memcmp if length > 0 in Buffer::Compare (Karl Skomski) [#2544](https://github.com/nodejs/node/pull/2544) +* [[`31823e37c7`](https://github.com/nodejs/node/commit/31823e37c7)] - **src**: DRY getsockname/getpeername code (Ben Noordhuis) [#956](https://github.com/nodejs/node/pull/956) +* [[`13fd96dda3`](https://github.com/nodejs/node/commit/13fd96dda3)] - **src**: missing Exception::Error in node_http_parser (Jeremiah Senkpiel) [#2550](https://github.com/nodejs/node/pull/2550) +* [[`42e075ae02`](https://github.com/nodejs/node/commit/42e075ae02)] - **test**: improve performance of stringbytes test (Trevor Norris) [#2544](https://github.com/nodejs/node/pull/2544) +* [[`fc726399fd`](https://github.com/nodejs/node/commit/fc726399fd)] - **test**: unmark test-process-argv-0.js as flaky (Rich Trott) [#2613](https://github.com/nodejs/node/pull/2613) +* [[`7727ba1394`](https://github.com/nodejs/node/commit/7727ba1394)] - **test**: lint and refactor to avoid autocrlf issue (Roman Reiss) [#2494](https://github.com/nodejs/node/pull/2494) +* [[`c56aa829f0`](https://github.com/nodejs/node/commit/c56aa829f0)] - **test**: use tmpDir instead of fixturesDir (Sakthipriyan Vairamani) [#2583](https://github.com/nodejs/node/pull/2583) +* [[`5e65181ea4`](https://github.com/nodejs/node/commit/5e65181ea4)] - **test**: handling failure cases properly (Sakthipriyan Vairamani) [#2206](https://github.com/nodejs/node/pull/2206) +* [[`c48b95e847`](https://github.com/nodejs/node/commit/c48b95e847)] - **test**: initial list of flaky tests (Alexis Campailla) [#2424](https://github.com/nodejs/node/pull/2424) +* [[`94e88498ba`](https://github.com/nodejs/node/commit/94e88498ba)] - **test**: pass args to test-ci via env variable (Alexis Campailla) [#2424](https://github.com/nodejs/node/pull/2424) +* [[`09987c7a1c`](https://github.com/nodejs/node/commit/09987c7a1c)] - **test**: support flaky tests in test-ci (Alexis Campailla) [#2424](https://github.com/nodejs/node/pull/2424) +* [[`08b83c8b45`](https://github.com/nodejs/node/commit/08b83c8b45)] - **test**: add test configuration templates (Alexis Campailla) [#2424](https://github.com/nodejs/node/pull/2424) +* [[`8f8ab6fa57`](https://github.com/nodejs/node/commit/8f8ab6fa57)] - **test**: runner should return 0 on flaky tests (Alexis Campailla) [#2424](https://github.com/nodejs/node/pull/2424) +* [[`0cfd3be9c6`](https://github.com/nodejs/node/commit/0cfd3be9c6)] - **test**: runner support for flaky tests (Alexis Campailla) [#2424](https://github.com/nodejs/node/pull/2424) +* [[`3492d2d4c6`](https://github.com/nodejs/node/commit/3492d2d4c6)] - **test**: make test-process-argv-0 robust (Rich Trott) [#2541](https://github.com/nodejs/node/pull/2541) +* [[`a96cc31710`](https://github.com/nodejs/node/commit/a96cc31710)] - **test**: speed up test-child-process-spawnsync.js (Rich Trott) [#2542](https://github.com/nodejs/node/pull/2542) +* [[`856baf4c67`](https://github.com/nodejs/node/commit/856baf4c67)] - **test**: make spawnSync() test robust (Rich Trott) [#2535](https://github.com/nodejs/node/pull/2535) +* [[`3aa6bbb648`](https://github.com/nodejs/node/commit/3aa6bbb648)] - **tools**: update release.sh to work with new website (Rod Vagg) [#2623](https://github.com/nodejs/node/pull/2623) +* [[`f2f0fe45ff`](https://github.com/nodejs/node/commit/f2f0fe45ff)] - **tools**: make add-on scraper print filenames (Ben Noordhuis) [#2428](https://github.com/nodejs/node/pull/2428) +* [[`bb24c4a418`](https://github.com/nodejs/node/commit/bb24c4a418)] - **win,msi**: correct installation path registry keys (João Reis) [#2565](https://github.com/nodejs/node/pull/2565) +* [[`752977b888`](https://github.com/nodejs/node/commit/752977b888)] - **win,msi**: change InstallScope to perMachine (João Reis) [#2565](https://github.com/nodejs/node/pull/2565) + +## 2015-08-25, Version 3.2.0, @rvagg + +### Notable changes + +* **events**: Added `EventEmitter#listenerCount(event)` as a replacement for `EventEmitter.listenerCount(emitter, event)`, which has now been marked as deprecated in the docs. (Sakthipriyan Vairamani) [#2349](https://github.com/nodejs/node/pull/2349) +* **module**: Fixed an error with preloaded modules when the current working directory doesn't exist. (Bradley Meck) [#2353](https://github.com/nodejs/node/pull/2353) +* **node**: Startup time is now about 5% faster when not passing V8 flags. (Evan Lucas) [#2483](https://github.com/nodejs/node/pull/2483) +* **repl**: Tab-completion now works better with arrays. (James M Snell) [#2409](https://github.com/nodejs/node/pull/2409) +* **string_bytes**: Fixed an unaligned write in the handling of UCS2 encoding. (Fedor Indutny) [#2480](https://github.com/nodejs/node/pull/2480) +* **tls**: Added a new `--tls-cipher-list` flag that can be used to override the built-in default cipher list. (James M Snell) [#2412](https://github.com/nodejs/node/pull/2412) _Note: it is suggested you use the built-in cipher list as it has been carefully selected to reflect current security best practices and risk mitigation._ + +### Known issues + +See https://github.com/nodejs/io.js/labels/confirmed-bug for complete and current list of known issues. + +* Some uses of computed object shorthand properties are not handled correctly by the current version of V8. e.g. `[{ [prop]: val }]` evaluates to `[{}]`. [#2507](https://github.com/nodejs/node/issues/2507) +* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/io.js/issues/1264). +* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/io.js/issues/690) +* `process.send()` is not synchronous as the docs suggest, a regression introduced in 1.0.2, see [#760](https://github.com/nodejs/io.js/issues/760). +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/io.js/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/io.js/issues/1435). + +### Commits + +* [[`1cd794f129`](https://github.com/nodejs/node/commit/1cd794f129)] - **buffer**: reapply 07c0667 (Fedor Indutny) [#2487](https://github.com/nodejs/node/pull/2487) +* [[`156781dedd`](https://github.com/nodejs/node/commit/156781dedd)] - **build**: use required platform in android-configure (Evan Lucas) [#2501](https://github.com/nodejs/node/pull/2501) +* [[`77075ec906`](https://github.com/nodejs/node/commit/77075ec906)] - **crypto**: fix mem {de}allocation in ExportChallenge (Karl Skomski) [#2359](https://github.com/nodejs/node/pull/2359) +* [[`cb30414d9e`](https://github.com/nodejs/node/commit/cb30414d9e)] - **doc**: sync CHANGELOG.md from master (Roman Reiss) [#2524](https://github.com/nodejs/node/pull/2524) +* [[`9330f5ef45`](https://github.com/nodejs/node/commit/9330f5ef45)] - **doc**: make the deprecations consistent (Sakthipriyan Vairamani) [#2450](https://github.com/nodejs/node/pull/2450) +* [[`09437e0146`](https://github.com/nodejs/node/commit/09437e0146)] - **doc**: fix comments in tls_wrap.cc and _http_client.js (Minwoo Jung) [#2489](https://github.com/nodejs/node/pull/2489) +* [[`c9867fed29`](https://github.com/nodejs/node/commit/c9867fed29)] - **doc**: document response.finished in http.markdown (hackerjs) [#2414](https://github.com/nodejs/node/pull/2414) +* [[`7f23a83c42`](https://github.com/nodejs/node/commit/7f23a83c42)] - **doc**: update AUTHORS list (Rod Vagg) [#2505](https://github.com/nodejs/node/pull/2505) +* [[`cd0c362f67`](https://github.com/nodejs/node/commit/cd0c362f67)] - **doc**: update AUTHORS list (Rod Vagg) [#2318](https://github.com/nodejs/node/pull/2318) +* [[`2c7b9257ea`](https://github.com/nodejs/node/commit/2c7b9257ea)] - **doc**: add TSC meeting minutes 2015-07-29 (Rod Vagg) [#2437](https://github.com/nodejs/node/pull/2437) +* [[`aaefde793e`](https://github.com/nodejs/node/commit/aaefde793e)] - **doc**: add TSC meeting minutes 2015-08-19 (Rod Vagg) [#2460](https://github.com/nodejs/node/pull/2460) +* [[`51ef9106f5`](https://github.com/nodejs/node/commit/51ef9106f5)] - **doc**: add TSC meeting minutes 2015-06-03 (Rod Vagg) [#2453](https://github.com/nodejs/node/pull/2453) +* [[`7130b4cf1d`](https://github.com/nodejs/node/commit/7130b4cf1d)] - **doc**: fix links to original converged repo (Rod Vagg) [#2454](https://github.com/nodejs/node/pull/2454) +* [[`14f2aee1df`](https://github.com/nodejs/node/commit/14f2aee1df)] - **doc**: fix links to original gh issues for TSC meetings (Rod Vagg) [#2454](https://github.com/nodejs/node/pull/2454) +* [[`87a9ef0a40`](https://github.com/nodejs/node/commit/87a9ef0a40)] - **doc**: add audio recording links to TSC meeting minutes (Rod Vagg) [#2454](https://github.com/nodejs/node/pull/2454) +* [[`f5cf24afbc`](https://github.com/nodejs/node/commit/f5cf24afbc)] - **doc**: add TSC meeting minutes 2015-07-22 (Rod Vagg) [#2436](https://github.com/nodejs/node/pull/2436) +* [[`3f821b96eb`](https://github.com/nodejs/node/commit/3f821b96eb)] - **doc**: fix spelling mistake in node.js comment (Jacob Edelman) [#2391](https://github.com/nodejs/node/pull/2391) +* [[`3e6a6fcdd6`](https://github.com/nodejs/node/commit/3e6a6fcdd6)] - **(SEMVER-MINOR)** **events**: deprecate static listenerCount function (Sakthipriyan Vairamani) [#2349](https://github.com/nodejs/node/pull/2349) +* [[`023386c852`](https://github.com/nodejs/node/commit/023386c852)] - **fs**: replace bad_args macro with concrete error msg (Roman Klauke) [#2495](https://github.com/nodejs/node/pull/2495) +* [[`d1c27b2e29`](https://github.com/nodejs/node/commit/d1c27b2e29)] - **module**: fix module preloading when cwd is ENOENT (Bradley Meck) [#2353](https://github.com/nodejs/node/pull/2353) +* [[`5d7486941b`](https://github.com/nodejs/node/commit/5d7486941b)] - **repl**: filter integer keys from repl tab complete list (James M Snell) [#2409](https://github.com/nodejs/node/pull/2409) +* [[`7f02443a9a`](https://github.com/nodejs/node/commit/7f02443a9a)] - **repl**: dont throw ENOENT on NODE_REPL_HISTORY_FILE (Todd Kennedy) [#2451](https://github.com/nodejs/node/pull/2451) +* [[`56a2ae9cef`](https://github.com/nodejs/node/commit/56a2ae9cef)] - **src**: improve startup time (Evan Lucas) [#2483](https://github.com/nodejs/node/pull/2483) +* [[`14653c7429`](https://github.com/nodejs/node/commit/14653c7429)] - **stream**: rename poorly named function (Ben Noordhuis) [#2479](https://github.com/nodejs/node/pull/2479) +* [[`1c6e014bfa`](https://github.com/nodejs/node/commit/1c6e014bfa)] - **stream**: micro-optimize high water mark calculation (Ben Noordhuis) [#2479](https://github.com/nodejs/node/pull/2479) +* [[`f1f4b4c46d`](https://github.com/nodejs/node/commit/f1f4b4c46d)] - **stream**: fix off-by-factor-16 error in comment (Ben Noordhuis) [#2479](https://github.com/nodejs/node/pull/2479) +* [[`2d3f09bd76`](https://github.com/nodejs/node/commit/2d3f09bd76)] - **stream_base**: various improvements (Fedor Indutny) [#2351](https://github.com/nodejs/node/pull/2351) +* [[`c1ce423b35`](https://github.com/nodejs/node/commit/c1ce423b35)] - **string_bytes**: fix unaligned write in UCS2 (Fedor Indutny) [#2480](https://github.com/nodejs/node/pull/2480) +* [[`e4d0e86165`](https://github.com/nodejs/node/commit/e4d0e86165)] - **test**: refactor test-https-simple.js (Rich Trott) [#2433](https://github.com/nodejs/node/pull/2433) +* [[`0ea5c8d737`](https://github.com/nodejs/node/commit/0ea5c8d737)] - **test**: remove test-timers-first-fire (João Reis) [#2458](https://github.com/nodejs/node/pull/2458) +* [[`536c3d0537`](https://github.com/nodejs/node/commit/536c3d0537)] - **test**: use reserved IP in test-net-connect-timeout (Rich Trott) [#2257](https://github.com/nodejs/node/pull/2257) +* [[`5df06fd8df`](https://github.com/nodejs/node/commit/5df06fd8df)] - **test**: add spaces after keywords (Brendan Ashworth) +* [[`e714b5620e`](https://github.com/nodejs/node/commit/e714b5620e)] - **test**: remove unreachable code (Michaël Zasso) [#2289](https://github.com/nodejs/node/pull/2289) +* [[`3579f3a2a4`](https://github.com/nodejs/node/commit/3579f3a2a4)] - **test**: disallow unreachable code (Michaël Zasso) [#2289](https://github.com/nodejs/node/pull/2289) +* [[`3545e236fc`](https://github.com/nodejs/node/commit/3545e236fc)] - **test**: reduce timeouts in test-net-keepalive (Brendan Ashworth) [#2429](https://github.com/nodejs/node/pull/2429) +* [[`b60e690023`](https://github.com/nodejs/node/commit/b60e690023)] - **test**: improve test-net-server-pause-on-connect (Brendan Ashworth) [#2429](https://github.com/nodejs/node/pull/2429) +* [[`11d1b8fcaf`](https://github.com/nodejs/node/commit/11d1b8fcaf)] - **test**: improve test-net-pingpong (Brendan Ashworth) [#2429](https://github.com/nodejs/node/pull/2429) +* [[`5fef5c6562`](https://github.com/nodejs/node/commit/5fef5c6562)] - **(SEMVER-MINOR)** **tls**: add --tls-cipher-list command line switch (James M Snell) [#2412](https://github.com/nodejs/node/pull/2412) +* [[`d9b70f9cbf`](https://github.com/nodejs/node/commit/d9b70f9cbf)] - **tls**: handle empty cert in checkServerIndentity (Mike Atkins) [#2343](https://github.com/nodejs/node/pull/2343) +* [[`4f8e34c202`](https://github.com/nodejs/node/commit/4f8e34c202)] - **tools**: add license boilerplate to check-imports.sh (James M Snell) [#2386](https://github.com/nodejs/node/pull/2386) +* [[`b76b9197f9`](https://github.com/nodejs/node/commit/b76b9197f9)] - **tools**: enable space-after-keywords in eslint (Brendan Ashworth) +* [[`64a8f30a70`](https://github.com/nodejs/node/commit/64a8f30a70)] - **tools**: fix anchors in generated documents (Sakthipriyan Vairamani) [#2491](https://github.com/nodejs/node/pull/2491) +* [[`22e344ea10`](https://github.com/nodejs/node/commit/22e344ea10)] - **win**: fix custom actions for WiX older than 3.9 (João Reis) [#2365](https://github.com/nodejs/node/pull/2365) +* [[`b5bd3ebfc8`](https://github.com/nodejs/node/commit/b5bd3ebfc8)] - **win**: fix custom actions on Visual Studio != 2013 (Julien Gilli) [#2365](https://github.com/nodejs/node/pull/2365) + +## 2015-08-18, Version 3.1.0, @Fishrock123 + +### Notable changes + +* **buffer**: Fixed a couple large memory leaks (Ben Noordhuis) [#2352](https://github.com/nodejs/node/pull/2352). +* **crypto**: + - Fixed a couple of minor memory leaks (Karl Skomski) [#2375](https://github.com/nodejs/node/pull/2375). + - Signing now checks for OpenSSL errors (P.S.V.R) [#2342](https://github.com/nodejs/node/pull/2342). **Note that this may expose previously hidden errors in user code.** +* **intl**: Intl support using small-icu is now enabled by default in builds (Steven R. Loomis) [#2264](https://github.com/nodejs/node/pull/2264). + - [`String#normalize()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize) can now be used for unicode normalization. + - The [`Intl`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Intl) object and various `String` and `Number` methods are present, but only support the English locale. + - For support of all locales, node must be built with [full-icu](https://github.com/nodejs/node#build-with-full-icu-support-all-locales-supported-by-icu). +* **tls**: Fixed tls throughput being much lower after an incorrect merge (Fedor Indutny) [#2381](https://github.com/nodejs/node/pull/2381). +* **tools**: The v8 tick processor now comes bundled with node (Matt Loring) [#2090](https://github.com/nodejs/node/pull/2090). + - This can be used by producing performance profiling output by running node with `--perf`, then running your appropriate platform's script on the output as found in [tools/v8-prof](https://github.com/nodejs/node/tree/master/tools/v8-prof). +* **util**: `util.inspect(obj)` now prints the constructor name of the object if there is one (Christopher Monsanto) [#1935](https://github.com/nodejs/io.js/pull/1935). + +### Known issues + +See https://github.com/nodejs/io.js/labels/confirmed-bug for complete and current list of known issues. + +* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/io.js/issues/1264). +* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/io.js/issues/690) +* `process.send()` is not synchronous as the docs suggest, a regression introduced in 1.0.2, see [#760](https://github.com/nodejs/io.js/issues/760). +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/io.js/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/io.js/issues/1435). + +### Commits + +* [[`3645dc62ed`](https://github.com/nodejs/node/commit/3645dc62ed)] - **build**: work around VS2015 issue in ICU <56 (Steven R. Loomis) [#2283](https://github.com/nodejs/node/pull/2283) +* [[`1f12e03266`](https://github.com/nodejs/node/commit/1f12e03266)] - **(SEMVER-MINOR)** **build**: intl: converge from joyent/node (Steven R. Loomis) [#2264](https://github.com/nodejs/node/pull/2264) +* [[`071640abdd`](https://github.com/nodejs/node/commit/071640abdd)] - **build**: Intl: bump ICU4C from 54 to 55 (Steven R. Loomis) [#2293](https://github.com/nodejs/node/pull/2293) +* [[`07a88b0c8b`](https://github.com/nodejs/node/commit/07a88b0c8b)] - **build**: update manifest to include Windows 10 (Lucien Greathouse) [#2332](https://github.com/nodejs/io.js/pull/2332) +* [[`0bb099f444`](https://github.com/nodejs/node/commit/0bb099f444)] - **build**: expand ~ in install prefix early (Ben Noordhuis) [#2307](https://github.com/nodejs/io.js/pull/2307) +* [[`7fe6dd8f5d`](https://github.com/nodejs/node/commit/7fe6dd8f5d)] - **crypto**: check for OpenSSL errors when signing (P.S.V.R) [#2342](https://github.com/nodejs/node/pull/2342) +* [[`605f6ee904`](https://github.com/nodejs/node/commit/605f6ee904)] - **crypto**: fix memory leak in PBKDF2Request (Karl Skomski) [#2375](https://github.com/nodejs/node/pull/2375) +* [[`ba6eb8af12`](https://github.com/nodejs/node/commit/ba6eb8af12)] - **crypto**: fix memory leak in ECDH::SetPrivateKey (Karl Skomski) [#2375](https://github.com/nodejs/node/pull/2375) +* [[`6a16368611`](https://github.com/nodejs/node/commit/6a16368611)] - **crypto**: fix memory leak in PublicKeyCipher::Cipher (Karl Skomski) [#2375](https://github.com/nodejs/node/pull/2375) +* [[`a760a87803`](https://github.com/nodejs/node/commit/a760a87803)] - **crypto**: fix memory leak in SafeX509ExtPrint (Karl Skomski) [#2375](https://github.com/nodejs/node/pull/2375) +* [[`f45487cd6e`](https://github.com/nodejs/node/commit/f45487cd6e)] - **crypto**: fix memory leak in SetDHParam (Karl Skomski) [#2375](https://github.com/nodejs/node/pull/2375) +* [[`2ff183dd86`](https://github.com/nodejs/node/commit/2ff183dd86)] - **doc**: Update FIPS instructions in README.md (Michael Dawson) [#2278](https://github.com/nodejs/node/pull/2278) +* [[`6483bc2e8f`](https://github.com/nodejs/node/commit/6483bc2e8f)] - **doc**: clarify options for fs.watchFile() (Rich Trott) [#2425](https://github.com/nodejs/node/pull/2425) +* [[`e76822f454`](https://github.com/nodejs/node/commit/e76822f454)] - **doc**: multiple documentation updates cherry picked from v0.12 (James M Snell) [#2302](https://github.com/nodejs/io.js/pull/2302) +* [[`1738c9680b`](https://github.com/nodejs/node/commit/1738c9680b)] - **net**: ensure Socket reported address is current (Ryan Graham) [#2095](https://github.com/nodejs/io.js/pull/2095) +* [[`844d3f0e3e`](https://github.com/nodejs/node/commit/844d3f0e3e)] - **path**: use '===' instead of '==' for comparison (Sam Stites) [#2388](https://github.com/nodejs/node/pull/2388) +* [[`7118b8a882`](https://github.com/nodejs/node/commit/7118b8a882)] - **path**: remove dead code in favor of unit tests (Nathan Woltman) [#2282](https://github.com/nodejs/io.js/pull/2282) +* [[`34f2cfa806`](https://github.com/nodejs/node/commit/34f2cfa806)] - **src**: better error message on failed Buffer malloc (Karl Skomski) [#2422](https://github.com/nodejs/node/pull/2422) +* [[`b196c1da3c`](https://github.com/nodejs/node/commit/b196c1da3c)] - **src**: fix memory leak in DLOpen (Karl Skomski) [#2375](https://github.com/nodejs/node/pull/2375) +* [[`d1307b2995`](https://github.com/nodejs/node/commit/d1307b2995)] - **src**: don't use fopen() in require() fast path (Ben Noordhuis) [#2377](https://github.com/nodejs/node/pull/2377) +* [[`455ec570d1`](https://github.com/nodejs/node/commit/455ec570d1)] - **src**: rename Buffer::Use() to Buffer::New() (Ben Noordhuis) [#2352](https://github.com/nodejs/node/pull/2352) +* [[`fd63e1ce2b`](https://github.com/nodejs/node/commit/fd63e1ce2b)] - **src**: introduce internal Buffer::Copy() function (Ben Noordhuis) [#2352](https://github.com/nodejs/node/pull/2352) +* [[`5586ceca13`](https://github.com/nodejs/node/commit/5586ceca13)] - **src**: move internal functions out of node_buffer.h (Ben Noordhuis) [#2352](https://github.com/nodejs/node/pull/2352) +* [[`bff9bcddb6`](https://github.com/nodejs/node/commit/bff9bcddb6)] - **src**: plug memory leaks (Ben Noordhuis) [#2352](https://github.com/nodejs/node/pull/2352) +* [[`ccf12df4f3`](https://github.com/nodejs/node/commit/ccf12df4f3)] - **(SEMVER-MINOR)** **src**: add total_available_size to v8 statistics (Roman Klauke) [#2348](https://github.com/nodejs/io.js/pull/2348) +* [[`194eeb841b`](https://github.com/nodejs/node/commit/194eeb841b)] - **test**: drop Isolate::GetCurrent() from addon tests (Ben Noordhuis) [#2427](https://github.com/nodejs/node/pull/2427) +* [[`46cdb2f6e2`](https://github.com/nodejs/node/commit/46cdb2f6e2)] - **test**: lint addon tests (Ben Noordhuis) [#2427](https://github.com/nodejs/node/pull/2427) +* [[`850c794882`](https://github.com/nodejs/node/commit/850c794882)] - **test**: refactor test-fs-watchfile.js (Rich Trott) [#2393](https://github.com/nodejs/node/pull/2393) +* [[`a3160c0a33`](https://github.com/nodejs/node/commit/a3160c0a33)] - **test**: correct spelling of 'childProcess' (muddletoes) [#2389](https://github.com/nodejs/node/pull/2389) +* [[`e51f90d747`](https://github.com/nodejs/node/commit/e51f90d747)] - **test**: option to run a subset of tests (João Reis) [#2260](https://github.com/nodejs/io.js/pull/2260) +* [[`cc46d3bca3`](https://github.com/nodejs/node/commit/cc46d3bca3)] - **test**: clarify dropMembership() call (Rich Trott) [#2062](https://github.com/nodejs/io.js/pull/2062) +* [[`0ee4df9c7a`](https://github.com/nodejs/node/commit/0ee4df9c7a)] - **test**: make listen-fd-cluster/server more robust (Sam Roberts) [#1944](https://github.com/nodejs/io.js/pull/1944) +* [[`cf9ba81398`](https://github.com/nodejs/node/commit/cf9ba81398)] - **test**: address timing issues in simple http tests (Gireesh Punathil) [#2294](https://github.com/nodejs/io.js/pull/2294) +* [[`cbb75c4f86`](https://github.com/nodejs/node/commit/cbb75c4f86)] - **tls**: fix throughput issues after incorrect merge (Fedor Indutny) [#2381](https://github.com/nodejs/node/pull/2381) +* [[`94b765f409`](https://github.com/nodejs/node/commit/94b765f409)] - **tls**: fix check for reused session (Fedor Indutny) [#2312](https://github.com/nodejs/io.js/pull/2312) +* [[`e83a41ad65`](https://github.com/nodejs/node/commit/e83a41ad65)] - **tls**: introduce internal `onticketkeycallback` (Fedor Indutny) [#2312](https://github.com/nodejs/io.js/pull/2312) +* [[`fb0f5d733f`](https://github.com/nodejs/node/commit/fb0f5d733f)] - **(SEMVER-MINOR)** **tools**: run the tick processor without building v8 (Matt Loring) [#2090](https://github.com/nodejs/node/pull/2090) +* [[`7606bdb897`](https://github.com/nodejs/node/commit/7606bdb897)] - **(SEMVER-MINOR)** **util**: display constructor when inspecting objects (Christopher Monsanto) [#1935](https://github.com/nodejs/io.js/pull/1935) + +## 2015-08-04, Version 3.0.0, @rvagg + +### Notable changes + +* **buffer**: + - Due to changes in V8, it has been necessary to reimplement `Buffer` on top of V8's `Uint8Array`. Every effort has been made to minimize the performance impact, however `Buffer` instantiation is measurably slower. Access operations may be faster in some circumstances but the exact performance profile and difference over previous versions will depend on how `Buffer` is used within applications. (Trevor Norris) [#1825](https://github.com/nodejs/node/pull/1825). + - `Buffer` can now take `ArrayBuffer`s as a constructor argument (Trevor Norris) [#2002](https://github.com/nodejs/node/pull/2002). + - When a single buffer is passed to `Buffer.concat()`, a new, copied `Buffer` object will be returned; previous behavior was to return the original `Buffer` object (Sakthipriyan Vairamani) [#1937](https://github.com/nodejs/node/pull/1937). +* **build**: PPC support has been added to core to allow compiling on pLinux BE and LE (AIX support coming soon) (Michael Dawson) [#2124](https://github.com/nodejs/node/pull/2124). +* **dgram**: If an error occurs within `socket.send()` and a callback has been provided, the error is only passed as the first argument to the callback and not emitted on the `socket` object; previous behavior was to do both (Matteo Collina & Chris Dickinson) [#1796](https://github.com/nodejs/node/pull/1796) +* **freelist**: Deprecate the undocumented `freelist` core module (Sakthipriyan Vairamani) [#2176](https://github.com/nodejs/node/pull/2176). +* **http**: + - Status codes now all use the official [IANA names](http://www.iana.org/assignments/http-status-codes) as per [RFC7231](https://tools.ietf.org/html/rfc7231), e.g. `http.STATUS_CODES[414]` now returns `'URI Too Long'` rather than `'Request-URI Too Large'` (jomo) [#1470](https://github.com/nodejs/node/pull/1470). + - Calling .getName() on an HTTP agent no longer returns a trailing colon, HTTPS agents will no longer return an extra colon near the middle of the string (Brendan Ashworth) [#1617](https://github.com/nodejs/node/pull/1617). +* **node**: + - `NODE_MODULE_VERSION` has been bumped to `45` to reflect the break in ABI (Rod Vagg) [#2096](https://github.com/nodejs/node/pull/2096). + - Introduce a new `process.release` object that contains a `name` property set to `'io.js'` and `sourceUrl`, `headersUrl` and `libUrl` (Windows only) properties containing URLs for the relevant resources; this is intended to be used by node-gyp (Rod Vagg) [#2154](https://github.com/nodejs/node/pull/2154). + - The version of node-gyp bundled with io.js now downloads and uses a tarball of header files from iojs.org rather than the full source for compiling native add-ons; it is hoped this is a temporary floating patch and the change will be upstreamed to node-gyp soon (Rod Vagg) [#2066](https://github.com/nodejs/node/pull/2066). +* **repl**: Persistent history is now enabled by default. The history file is located at ~/.node_repl_history, which can be overridden by the new environment variable `NODE_REPL_HISTORY`. This deprecates the previous `NODE_REPL_HISTORY_FILE` variable. Additionally, the format of the file has been changed to plain text to better handle file corruption. (Jeremiah Senkpiel) [#2224](https://github.com/nodejs/node/pull/2224). +* **smalloc**: The `smalloc` module has been removed as it is no longer possible to provide the API due to changes in V8 (Ben Noordhuis) [#2022](https://github.com/nodejs/node/pull/2022). +* **tls**: Add `server.getTicketKeys()` and `server.setTicketKeys()` methods for [TLS session key](https://www.ietf.org/rfc/rfc5077.txt) rotation (Fedor Indutny) [#2227](https://github.com/nodejs/node/pull/2227). +* **v8**: Upgraded to 4.4.63.26 + - ES6: Enabled [computed property names](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer#Computed_property_names) + - ES6: `Array` can now be subclassed in strict mode + - ES6: Implement [rest parameters](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Functions/rest_parameters) in staging, use the `--harmony-rest-parameters` command line flag + - ES6: Implement the [spread operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator) in staging, use the `--harmony-spreadcalls` command line flag + - Removed `SetIndexedPropertiesToExternalArrayData` and related APIs, forcing a shift to `Buffer` to be reimplemented based on `Uint8Array` + - Introduction of `Maybe` and `MaybeLocal` C++ API for objects which _may_ or _may not_ have a value. + - Added support for PPC + +See also https://github.com/nodejs/node/wiki/Breaking-Changes#300-from-2x for a summary of the breaking changes (SEMVER-MAJOR). + +### Known issues + +See https://github.com/nodejs/node/labels/confirmed-bug for complete and current list of known issues. + +* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/node/issues/1264). +* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/node/issues/690) +* `process.send()` is not synchronous as the docs suggest, a regression introduced in 1.0.2, see [#760](https://github.com/nodejs/node/issues/760). +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/node/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). + +### Commits + +* [[`60a974d200`](https://github.com/nodejs/node/commit/60a974d200)] - **buffer**: fix missing null/undefined check (Trevor Norris) [#2195](https://github.com/nodejs/node/pull/2195) +* [[`e6ab2d92bc`](https://github.com/nodejs/node/commit/e6ab2d92bc)] - **buffer**: fix not return on error (Trevor Norris) [#2225](https://github.com/nodejs/node/pull/2225) +* [[`1057d1186b`](https://github.com/nodejs/node/commit/1057d1186b)] - **buffer**: rename internal/buffer_new.js to buffer.js (Ben Noordhuis) [#2022](https://github.com/nodejs/node/pull/2022) +* [[`4643b8b667`](https://github.com/nodejs/node/commit/4643b8b667)] - **(SEMVER-MINOR)** **buffer**: allow ArrayBuffer as Buffer argument (Trevor Norris) [#2002](https://github.com/nodejs/node/pull/2002) +* [[`e5ada116cd`](https://github.com/nodejs/node/commit/e5ada116cd)] - **buffer**: minor cleanup from rebase (Trevor Norris) [#2003](https://github.com/nodejs/node/pull/2003) +* [[`b625ab4242`](https://github.com/nodejs/node/commit/b625ab4242)] - **buffer**: fix usage of kMaxLength (Trevor Norris) [#2003](https://github.com/nodejs/node/pull/2003) +* [[`eea66e2a7b`](https://github.com/nodejs/node/commit/eea66e2a7b)] - **(SEMVER-MAJOR)** **buffer**: fix case of one buffer passed to concat (Sakthipriyan Vairamani) [#1937](https://github.com/nodejs/node/pull/1937) +* [[`8664084166`](https://github.com/nodejs/node/commit/8664084166)] - **buffer**: make additional changes to native API (Trevor Norris) [#1825](https://github.com/nodejs/node/pull/1825) +* [[`36f78f4c1c`](https://github.com/nodejs/node/commit/36f78f4c1c)] - **buffer**: switch API to return MaybeLocal (Trevor Norris) [#1825](https://github.com/nodejs/node/pull/1825) +* [[`571ec13841`](https://github.com/nodejs/node/commit/571ec13841)] - **buffer**: switch to using Maybe API (Trevor Norris) [#1825](https://github.com/nodejs/node/pull/1825) +* [[`d75f5c8d0e`](https://github.com/nodejs/node/commit/d75f5c8d0e)] - **buffer**: finish implementing FreeCallback (Trevor Norris) [#1825](https://github.com/nodejs/node/pull/1825) +* [[`63da0dfd3a`](https://github.com/nodejs/node/commit/63da0dfd3a)] - **buffer**: implement Uint8Array backed Buffer (Trevor Norris) [#1825](https://github.com/nodejs/node/pull/1825) +* [[`23be6ca189`](https://github.com/nodejs/node/commit/23be6ca189)] - **buffer**: allow ARGS_THIS to accept a name (Trevor Norris) [#1825](https://github.com/nodejs/node/pull/1825) +* [[`971de5e417`](https://github.com/nodejs/node/commit/971de5e417)] - **build**: prepare Windows installer for i18n support (Frederic Hemberger) [#2247](https://github.com/nodejs/node/pull/2247) +* [[`2ba8b23661`](https://github.com/nodejs/node/commit/2ba8b23661)] - **build**: add 'x86' option back in to configure (Rod Vagg) [#2233](https://github.com/nodejs/node/pull/2233) +* [[`b4226e797a`](https://github.com/nodejs/node/commit/b4226e797a)] - **build**: first set of updates to enable PPC support (Michael Dawson) [#2124](https://github.com/nodejs/node/pull/2124) +* [[`24dd016deb`](https://github.com/nodejs/node/commit/24dd016deb)] - **build**: produce symbol map files on windows (Ali Ijaz Sheikh) [#2243](https://github.com/nodejs/node/pull/2243) +* [[`423d8944ce`](https://github.com/nodejs/node/commit/423d8944ce)] - **cluster**: do not unconditionally set --debug-port (cjihrig) [#1949](https://github.com/nodejs/node/pull/1949) +* [[`fa98b97171`](https://github.com/nodejs/node/commit/fa98b97171)] - **cluster**: add handle ref/unref stubs in rr mode (Ben Noordhuis) [#2274](https://github.com/nodejs/node/pull/2274) +* [[`944f68046c`](https://github.com/nodejs/node/commit/944f68046c)] - **crypto**: remove kMaxLength on randomBytes() (Trevor Norris) [#1825](https://github.com/nodejs/node/pull/1825) +* [[`3d3c687012`](https://github.com/nodejs/node/commit/3d3c687012)] - **deps**: update V8 to 4.4.63.26 (Michaël Zasso) [#2220](https://github.com/nodejs/node/pull/2220) +* [[`3aad4fa89a`](https://github.com/nodejs/node/commit/3aad4fa89a)] - **deps**: upgrade v8 to 4.4.63.12 (Ben Noordhuis) [#2092](https://github.com/nodejs/node/pull/2092) +* [[`70d1f32f56`](https://github.com/nodejs/node/commit/70d1f32f56)] - **(SEMVER-MAJOR)** **deps**: update v8 to 4.4.63.9 (Ben Noordhuis) [#2022](https://github.com/nodejs/node/pull/2022) +* [[`deb7ee93a7`](https://github.com/nodejs/node/commit/deb7ee93a7)] - **deps**: backport 7b24219346 from v8 upstream (Rod Vagg) [#1805](https://github.com/nodejs/node/pull/1805) +* [[`d58e780504`](https://github.com/nodejs/node/commit/d58e780504)] - **(SEMVER-MAJOR)** **deps**: update v8 to 4.3.61.21 (Chris Dickinson) [iojs/io.js#1632](https://github.com/iojs/io.js/pull/1632) +* [[`2a63cf612b`](https://github.com/nodejs/node/commit/2a63cf612b)] - **deps**: make node-gyp work with io.js (cjihrig) [iojs/io.js#990](https://github.com/iojs/io.js/pull/990) +* [[`bf63266460`](https://github.com/nodejs/node/commit/bf63266460)] - **deps**: upgrade to npm 2.13.3 (Kat Marchán) [#2284](https://github.com/nodejs/node/pull/2284) +* [[`ef2c8cd4ec`](https://github.com/nodejs/node/commit/ef2c8cd4ec)] - **(SEMVER-MAJOR)** **dgram**: make send cb act as "error" event handler (Matteo Collina) [#1796](https://github.com/nodejs/node/pull/1796) +* [[`3da057fef6`](https://github.com/nodejs/node/commit/3da057fef6)] - **(SEMVER-MAJOR)** **dgram**: make send cb act as "error" event handler (Chris Dickinson) [#1796](https://github.com/nodejs/node/pull/1796) +* [[`df1994fe53`](https://github.com/nodejs/node/commit/df1994fe53)] - ***Revert*** "**dns**: remove AI_V4MAPPED hint flag on FreeBSD" (cjihrig) [iojs/io.js#1555](https://github.com/iojs/io.js/pull/1555) +* [[`1721968b22`](https://github.com/nodejs/node/commit/1721968b22)] - **doc**: document repl persistent history changes (Jeremiah Senkpiel) [#2224](https://github.com/nodejs/node/pull/2224) +* [[`d12df7f159`](https://github.com/nodejs/node/commit/d12df7f159)] - **doc**: update v8 flags in man page (Michaël Zasso) [iojs/io.js#1701](https://github.com/iojs/io.js/pull/1701) +* [[`d168d01b04`](https://github.com/nodejs/node/commit/d168d01b04)] - **doc**: properly inheriting from EventEmitter (Sakthipriyan Vairamani) [#2168](https://github.com/nodejs/node/pull/2168) +* [[`500f2538cc`](https://github.com/nodejs/node/commit/500f2538cc)] - **doc**: a listener, not "an" listener (Sam Roberts) [#1025](https://github.com/nodejs/node/pull/1025) +* [[`54627a919d`](https://github.com/nodejs/node/commit/54627a919d)] - **doc**: server close event does not have an argument (Sam Roberts) [#1025](https://github.com/nodejs/node/pull/1025) +* [[`ed85c95a9c`](https://github.com/nodejs/node/commit/ed85c95a9c)] - **doc,test**: documents behaviour of non-existent file (Sakthipriyan Vairamani) [#2169](https://github.com/nodejs/node/pull/2169) +* [[`2965442308`](https://github.com/nodejs/node/commit/2965442308)] - **(SEMVER-MAJOR)** **http**: fix agent.getName() and add tests (Brendan Ashworth) [#1617](https://github.com/nodejs/node/pull/1617) +* [[`2d9456e3e6`](https://github.com/nodejs/node/commit/2d9456e3e6)] - **(SEMVER-MAJOR)** **http**: use official IANA Status Codes (jomo) [#1470](https://github.com/nodejs/node/pull/1470) +* [[`11e4249227`](https://github.com/nodejs/node/commit/11e4249227)] - **(SEMVER-MAJOR)** **http_server**: `prefinish` vs `finish` (Fedor Indutny) [#1411](https://github.com/nodejs/node/pull/1411) +* [[`9bc2e26720`](https://github.com/nodejs/node/commit/9bc2e26720)] - **net**: do not set V4MAPPED on FreeBSD (Julien Gilli) [iojs/io.js#1555](https://github.com/iojs/io.js/pull/1555) +* [[`ba9ccf227e`](https://github.com/nodejs/node/commit/ba9ccf227e)] - **node**: remove redundant --use-old-buffer (Rod Vagg) [#2275](https://github.com/nodejs/node/pull/2275) +* [[`ef65321083`](https://github.com/nodejs/node/commit/ef65321083)] - **(SEMVER-MAJOR)** **node**: do not override `message`/`stack` of error (Fedor Indutny) [#2108](https://github.com/nodejs/node/pull/2108) +* [[`9f727f5e03`](https://github.com/nodejs/node/commit/9f727f5e03)] - **node-gyp**: detect RC build with x.y.z-rc.n format (Rod Vagg) [#2171](https://github.com/nodejs/node/pull/2171) +* [[`e52f963632`](https://github.com/nodejs/node/commit/e52f963632)] - **node-gyp**: download header tarball for compile (Rod Vagg) [#2066](https://github.com/nodejs/node/pull/2066) +* [[`902c9ca51d`](https://github.com/nodejs/node/commit/902c9ca51d)] - **node-gyp**: make aware of nightly, next-nightly & rc (Rod Vagg) [#2066](https://github.com/nodejs/node/pull/2066) +* [[`4cffaa3f55`](https://github.com/nodejs/node/commit/4cffaa3f55)] - **(SEMVER-MINOR)** **readline**: allow tabs in input (Rich Trott) [#1761](https://github.com/nodejs/node/pull/1761) +* [[`ed6c249104`](https://github.com/nodejs/node/commit/ed6c249104)] - **(SEMVER-MAJOR)** **repl**: persist history in plain text (Jeremiah Senkpiel) [#2224](https://github.com/nodejs/node/pull/2224) +* [[`f7d5e4c618`](https://github.com/nodejs/node/commit/f7d5e4c618)] - **(SEMVER-MINOR)** **repl**: default persistence to ~/.node_repl_history (Jeremiah Senkpiel) [#2224](https://github.com/nodejs/node/pull/2224) +* [[`ea05e760cd`](https://github.com/nodejs/node/commit/ea05e760cd)] - **repl**: don't clobber RegExp.$ properties (Sakthipriyan Vairamani) [#2137](https://github.com/nodejs/node/pull/2137) +* [[`d20093246b`](https://github.com/nodejs/node/commit/d20093246b)] - **src**: disable vector ICs on arm (Michaël Zasso) [#2220](https://github.com/nodejs/node/pull/2220) +* [[`04fd4fad46`](https://github.com/nodejs/node/commit/04fd4fad46)] - **(SEMVER-MINOR)** **src**: introduce process.release object (Rod Vagg) [#2154](https://github.com/nodejs/node/pull/2154) +* [[`9d34bd1147`](https://github.com/nodejs/node/commit/9d34bd1147)] - **src**: increment NODE_MODULE_VERSION to 45 (Rod Vagg) [#2096](https://github.com/nodejs/node/pull/2096) +* [[`ceee8d2807`](https://github.com/nodejs/node/commit/ceee8d2807)] - **test**: add tests for persistent repl history (Jeremiah Senkpiel) [#2224](https://github.com/nodejs/node/pull/2224) +* [[`8e1a8ffe24`](https://github.com/nodejs/node/commit/8e1a8ffe24)] - **test**: remove two obsolete pummel tests (Ben Noordhuis) [#2022](https://github.com/nodejs/node/pull/2022) +* [[`ae731ec0fa`](https://github.com/nodejs/node/commit/ae731ec0fa)] - **test**: don't use arguments.callee (Ben Noordhuis) [#2022](https://github.com/nodejs/node/pull/2022) +* [[`21d31c08e7`](https://github.com/nodejs/node/commit/21d31c08e7)] - **test**: remove obsolete harmony flags (Chris Dickinson) +* [[`64cf71195c`](https://github.com/nodejs/node/commit/64cf71195c)] - **test**: change the hostname to an invalid name (Sakthipriyan Vairamani) [#2287](https://github.com/nodejs/node/pull/2287) +* [[`80a1cf7425`](https://github.com/nodejs/node/commit/80a1cf7425)] - **test**: fix messages and use return to skip tests (Sakthipriyan Vairamani) [#2290](https://github.com/nodejs/node/pull/2290) +* [[`d5ab92bcc1`](https://github.com/nodejs/node/commit/d5ab92bcc1)] - **test**: use common.isWindows consistently (Sakthipriyan Vairamani) [#2269](https://github.com/nodejs/node/pull/2269) +* [[`bc733f7065`](https://github.com/nodejs/node/commit/bc733f7065)] - **test**: fix fs.readFile('/dev/stdin') tests (Ben Noordhuis) [#2265](https://github.com/nodejs/node/pull/2265) +* [[`3cbb5870e5`](https://github.com/nodejs/node/commit/3cbb5870e5)] - **tools**: expose skip output to test runner (Johan Bergström) [#2130](https://github.com/nodejs/node/pull/2130) +* [[`3b021efe11`](https://github.com/nodejs/node/commit/3b021efe11)] - **vm**: fix symbol access (Domenic Denicola) [#1773](https://github.com/nodejs/node/pull/1773) +* [[`7b81e4ba36`](https://github.com/nodejs/node/commit/7b81e4ba36)] - **vm**: remove unnecessary access checks (Domenic Denicola) [#1773](https://github.com/nodejs/node/pull/1773) +* [[`659dadd410`](https://github.com/nodejs/node/commit/659dadd410)] - **vm**: fix property descriptors of sandbox properties (Domenic Denicola) [#1773](https://github.com/nodejs/node/pull/1773) +* [[`9bac1dbae9`](https://github.com/nodejs/node/commit/9bac1dbae9)] - **win,node-gyp**: enable delay-load hook by default (Bert Belder) [iojs/io.js#1433](https://github.com/iojs/io.js/pull/1433) + +## 2015-07-28, Version 2.5.0, @cjihrig + +### Notable changes + +* **https**: TLS sessions in Agent are reused (Fedor Indutny) [#2228](https://github.com/nodejs/node/pull/2228) +* **src**: base64 decoding is now 50% faster (Ben Noordhuis) [#2193](https://github.com/nodejs/node/pull/2193) +* **npm**: Upgraded to v2.13.2, release notes can be found in (Kat Marchán) [#2241](https://github.com/nodejs/node/pull/2241). + +### Known issues + +See https://github.com/nodejs/node/labels/confirmed-bug for complete and current list of known issues. + +* Using multiple REPL instances in parallel may cause some REPL history corruption or loss. [#1634](https://github.com/nodejs/node/issues/1634) +* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/node/issues/1264). +* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/node/issues/690) +* `process.send()` is not synchronous as the docs suggest, a regression introduced in 1.0.2, see [#760](https://github.com/nodejs/node/issues/760). +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/node/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). + +### Commits + +* [[`bf2cd225a8`](https://github.com/nodejs/node/commit/bf2cd225a8)] - **process**: resize stderr on SIGWINCH (Jeremiah Senkpiel) [#2231](https://github.com/nodejs/node/pull/2231) +* [[`99d9d7e716`](https://github.com/nodejs/node/commit/99d9d7e716)] - **benchmark**: add remaining path benchmarks & optimize (Nathan Woltman) [#2103](https://github.com/nodejs/node/pull/2103) +* [[`66fc8ca22b`](https://github.com/nodejs/node/commit/66fc8ca22b)] - **(SEMVER-MINOR)** **cluster**: emit 'message' event on cluster master (Sam Roberts) [#861](https://github.com/nodejs/node/pull/861) +* [[`eb35968de7`](https://github.com/nodejs/node/commit/eb35968de7)] - **crypto**: fix legacy SNICallback (Fedor Indutny) [#1720](https://github.com/nodejs/node/pull/1720) +* [[`fef190cea6`](https://github.com/nodejs/node/commit/fef190cea6)] - **deps**: make node-gyp work with io.js (cjihrig) [iojs/io.js#990](https://github.com/iojs/io.js/pull/990) +* [[`b73a7465c5`](https://github.com/nodejs/node/commit/b73a7465c5)] - **deps**: upgrade to npm 2.13.2 (Kat Marchán) [#2241](https://github.com/nodejs/node/pull/2241) +* [[`0a7bf81d2f`](https://github.com/nodejs/node/commit/0a7bf81d2f)] - **deps**: update V8 to 4.2.77.21 (Ali Ijaz Sheikh) [#2238](https://github.com/nodejs/node/issues/2238) +* [[`73cdcdd581`](https://github.com/nodejs/node/commit/73cdcdd581)] - **deps**: make node-gyp work with io.js (cjihrig) [iojs/io.js#990](https://github.com/iojs/io.js/pull/990) +* [[`04893a736d`](https://github.com/nodejs/node/commit/04893a736d)] - **deps**: upgrade to npm 2.13.1 (Kat Marchán) [#2210](https://github.com/nodejs/node/pull/2210) +* [[`a3c1b9720e`](https://github.com/nodejs/node/commit/a3c1b9720e)] - **doc**: add GPG fingerprint for cjihrig (cjihrig) [#2217](https://github.com/nodejs/node/pull/2217) +* [[`d9f857df3b`](https://github.com/nodejs/node/commit/d9f857df3b)] - **doc**: note about custom inspect functions (Sakthipriyan Vairamani) [#2142](https://github.com/nodejs/node/pull/2142) +* [[`4ef2b5fbfb`](https://github.com/nodejs/node/commit/4ef2b5fbfb)] - **doc**: Replace util.debug with console.error (Yosuke Furukawa) [#2214](https://github.com/nodejs/node/pull/2214) +* [[`b612f085ec`](https://github.com/nodejs/node/commit/b612f085ec)] - **doc**: add joaocgreis as a collaborator (João Reis) [#2208](https://github.com/nodejs/node/pull/2208) +* [[`6b85d5a4b3`](https://github.com/nodejs/node/commit/6b85d5a4b3)] - **doc**: add TSC meeting minutes 2015-07-15 (Rod Vagg) [#2191](https://github.com/nodejs/node/pull/2191) +* [[`c7d8b09162`](https://github.com/nodejs/node/commit/c7d8b09162)] - **doc**: recompile before testing core module changes (Phillip Johnsen) [#2051](https://github.com/nodejs/node/pull/2051) +* [[`9afee6785e`](https://github.com/nodejs/node/commit/9afee6785e)] - **http**: Check this.connection before using it (Sakthipriyan Vairamani) [#2172](https://github.com/nodejs/node/pull/2172) +* [[`2ca5a3db47`](https://github.com/nodejs/node/commit/2ca5a3db47)] - **https**: reuse TLS sessions in Agent (Fedor Indutny) [#2228](https://github.com/nodejs/node/pull/2228) +* [[`fef87fee1d`](https://github.com/nodejs/node/commit/fef87fee1d)] - **(SEMVER-MINOR)** **lib,test**: add freelist deprecation and test (Sakthipriyan Vairamani) [#2176](https://github.com/nodejs/node/pull/2176) +* [[`503b089dd8`](https://github.com/nodejs/node/commit/503b089dd8)] - **net**: don't throw on immediately destroyed socket (Evan Lucas) [#2251](https://github.com/nodejs/node/pull/2251) +* [[`93660c8b8e`](https://github.com/nodejs/node/commit/93660c8b8e)] - **node**: remove bad fn call and check (Trevor Norris) [#2157](https://github.com/nodejs/node/pull/2157) +* [[`afd7e37ee0`](https://github.com/nodejs/node/commit/afd7e37ee0)] - **repl**: better empty line handling (Sakthipriyan Vairamani) [#2163](https://github.com/nodejs/node/pull/2163) +* [[`81ea52aa01`](https://github.com/nodejs/node/commit/81ea52aa01)] - **repl**: improving line continuation handling (Sakthipriyan Vairamani) [#2163](https://github.com/nodejs/node/pull/2163) +* [[`30edb5aee9`](https://github.com/nodejs/node/commit/30edb5aee9)] - **repl**: preventing REPL crash with inherited properties (Sakthipriyan Vairamani) [#2163](https://github.com/nodejs/node/pull/2163) +* [[`77fa385e5d`](https://github.com/nodejs/node/commit/77fa385e5d)] - **repl**: fixing `undefined` in invalid REPL keyword error (Sakthipriyan Vairamani) [#2163](https://github.com/nodejs/node/pull/2163) +* [[`8fd3ce100e`](https://github.com/nodejs/node/commit/8fd3ce100e)] - **src**: make base64 decoding 50% faster (Ben Noordhuis) [#2193](https://github.com/nodejs/node/pull/2193) +* [[`c786d6341d`](https://github.com/nodejs/node/commit/c786d6341d)] - **test**: do not use public IPs for timeout testing (Rich Trott) [#2057](https://github.com/nodejs/node/pull/2057) +* [[`4e78cd71c0`](https://github.com/nodejs/node/commit/4e78cd71c0)] - **test**: skip IPv6 part before testing it (Sakthipriyan Vairamani) [#2226](https://github.com/nodejs/node/pull/2226) +* [[`ac70bc8240`](https://github.com/nodejs/node/commit/ac70bc8240)] - **test**: fix valgrind uninitialized memory warning (Ben Noordhuis) [#2193](https://github.com/nodejs/node/pull/2193) +* [[`ac7d3fa0d9`](https://github.com/nodejs/node/commit/ac7d3fa0d9)] - **test**: add -no_rand_screen to s_client opts on Win (Shigeki Ohtsu) [#2209](https://github.com/nodejs/node/pull/2209) +* [[`79c865a53f`](https://github.com/nodejs/node/commit/79c865a53f)] - **test**: changing process.exit to return while skipping tests (Sakthipriyan Vairamani) [#2109](https://github.com/nodejs/node/pull/2109) +* [[`69298d36cf`](https://github.com/nodejs/node/commit/69298d36cf)] - **test**: formatting skip messages for TAP parsing (Sakthipriyan Vairamani) [#2109](https://github.com/nodejs/node/pull/2109) +* [[`543dabb609`](https://github.com/nodejs/node/commit/543dabb609)] - **timers**: improve Timer.now() performance (Ben Noordhuis) [#2256](https://github.com/nodejs/node/pull/2256) +* [[`3663b124e6`](https://github.com/nodejs/node/commit/3663b124e6)] - **timers**: remove unused Timer.again() (Ben Noordhuis) [#2256](https://github.com/nodejs/node/pull/2256) +* [[`bcce5cf9bb`](https://github.com/nodejs/node/commit/bcce5cf9bb)] - **timers**: remove unused Timer.getRepeat() (Ben Noordhuis) [#2256](https://github.com/nodejs/node/pull/2256) +* [[`f2c83bd202`](https://github.com/nodejs/node/commit/f2c83bd202)] - **timers**: remove unused Timer.setRepeat() (Ben Noordhuis) [#2256](https://github.com/nodejs/node/pull/2256) +* [[`e11fc67225`](https://github.com/nodejs/node/commit/e11fc67225)] - **(SEMVER-MINOR)** **tls**: add `getTicketKeys()`/`setTicketKeys()` (Fedor Indutny) [#2227](https://github.com/nodejs/node/pull/2227) +* [[`68b06e94e3`](https://github.com/nodejs/node/commit/68b06e94e3)] - **tools**: use local or specified $NODE for test-npm (Jeremiah Senkpiel) [#1984](https://github.com/nodejs/node/pull/1984) +* [[`ab479659c7`](https://github.com/nodejs/node/commit/ab479659c7)] - **util**: delay creation of debug context (Ali Ijaz Sheikh) [#2248](https://github.com/nodejs/node/pull/2248) +* [[`6391f4d2fd`](https://github.com/nodejs/node/commit/6391f4d2fd)] - **util**: removing redundant checks in is* functions (Sakthipriyan Vairamani) [#2179](https://github.com/nodejs/node/pull/2179) +* [[`b148c0dff3`](https://github.com/nodejs/node/commit/b148c0dff3)] - **win,node-gyp**: enable delay-load hook by default (Bert Belder) [iojs/io.js#1433](https://github.com/iojs/io.js/pull/1433) +* [[`f90f1e75bb`](https://github.com/nodejs/node/commit/f90f1e75bb)] - **win,node-gyp**: enable delay-load hook by default (Bert Belder) [iojs/io.js#1433](https://github.com/iojs/io.js/pull/1433) + +## 2015-07-17, Version 2.4.0, @Fishrock123 + +### Notable changes + +* **src**: Added a new `--track-heap-objects` flag to track heap object allocations for heap snapshots (Bradley Meck) [#2135](https://github.com/nodejs/node/pull/2135). +* **readline**: Fixed a freeze that affected the repl if the keypress event handler threw (Alex Kocharin) [#2107](https://github.com/nodejs/node/pull/2107). +* **npm**: Upgraded to v2.13.0, release notes can be found in (Forrest L Norvell) [#2152](https://github.com/nodejs/node/pull/2152). + +### Known issues + +See https://github.com/nodejs/node/labels/confirmed-bug for complete and current list of known issues. + +* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/node/issues/1264). +* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/node/issues/690) +* `process.send()` is not synchronous as the docs suggest, a regression introduced in 1.0.2, see [#760](https://github.com/nodejs/node/issues/760). +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/node/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). + +### Commits + +* [[`f95f9ef6ea`](https://github.com/nodejs/node/commit/f95f9ef6ea)] - **build**: always use prefix=/ for tar-headers (Rod Vagg) [#2082](https://github.com/nodejs/node/pull/2082) +* [[`12bc397207`](https://github.com/nodejs/node/commit/12bc397207)] - **build**: run-ci makefile rule (Alexis Campailla) [#2134](https://github.com/nodejs/node/pull/2134) +* [[`84012c99e0`](https://github.com/nodejs/node/commit/84012c99e0)] - **build**: fix vcbuild merge issues (Alexis Campailla) [#2131](https://github.com/nodejs/node/pull/2131) +* [[`47e2c5c828`](https://github.com/nodejs/node/commit/47e2c5c828)] - **build**: bail early if clean is invoked (Johan Bergström) [#2127](https://github.com/nodejs/node/pull/2127) +* [[`5acad6b163`](https://github.com/nodejs/node/commit/5acad6b163)] - **child_process**: fix arguments comments (Roman Reiss) [#2161](https://github.com/nodejs/node/pull/2161) +* [[`3c4121c418`](https://github.com/nodejs/node/commit/3c4121c418)] - **deps**: make node-gyp work with io.js (cjihrig) [iojs/io.js#990](https://github.com/iojs/io.js/pull/990) +* [[`938cc757bb`](https://github.com/nodejs/node/commit/938cc757bb)] - **deps**: upgrade to npm 2.13.0 (Forrest L Norvell) [#2152](https://github.com/nodejs/node/pull/2152) +* [[`6f306e0ed2`](https://github.com/nodejs/node/commit/6f306e0ed2)] - **doc**: add targos as a collaborator (Michaël Zasso) [#2200](https://github.com/nodejs/node/pull/2200) +* [[`c019d9a239`](https://github.com/nodejs/node/commit/c019d9a239)] - **doc**: add thefourtheye as a collaborator (Sakthipriyan Vairamani) [#2199](https://github.com/nodejs/node/pull/2199) +* [[`4e92dbc26b`](https://github.com/nodejs/node/commit/4e92dbc26b)] - **doc**: add TSC members from the combined project (Jeremiah Senkpiel) [#2085](https://github.com/nodejs/node/pull/2085) +* [[`6c3aabf455`](https://github.com/nodejs/node/commit/6c3aabf455)] - **doc**: add TSC meeting minutes 2015-07-08 (Rod Vagg) [#2184](https://github.com/nodejs/node/pull/2184) +* [[`30a0d47d51`](https://github.com/nodejs/node/commit/30a0d47d51)] - **doc**: add TSC meeting minutes 2015-07-01 (Rod Vagg) [#2132](https://github.com/nodejs/node/pull/2132) +* [[`23efb05cc3`](https://github.com/nodejs/node/commit/23efb05cc3)] - **doc**: document fs.watchFile behaviour on ENOENT (Brendan Ashworth) [#2093](https://github.com/nodejs/node/pull/2093) +* [[`65963ec26f`](https://github.com/nodejs/node/commit/65963ec26f)] - **doc,test**: empty strings in path module (Sakthipriyan Vairamani) [#2106](https://github.com/nodejs/node/pull/2106) +* [[`0ab81e6f58`](https://github.com/nodejs/node/commit/0ab81e6f58)] - **docs**: link to more up-to-date v8 docs (Jeremiah Senkpiel) [#2196](https://github.com/nodejs/node/pull/2196) +* [[`1afc0c9e86`](https://github.com/nodejs/node/commit/1afc0c9e86)] - **fs**: fix error on bad listener type (Brendan Ashworth) [#2093](https://github.com/nodejs/node/pull/2093) +* [[`2ba84606a6`](https://github.com/nodejs/node/commit/2ba84606a6)] - **path**: assert path.join() arguments equally (Phillip Johnsen) [#2159](https://github.com/nodejs/node/pull/2159) +* [[`bd01603201`](https://github.com/nodejs/node/commit/bd01603201)] - **readline**: fix freeze if `keypress` event throws (Alex Kocharin) [#2107](https://github.com/nodejs/node/pull/2107) +* [[`59f6b5da2a`](https://github.com/nodejs/node/commit/59f6b5da2a)] - **repl**: Prevent crash when tab-completed with Proxy (Sakthipriyan Vairamani) [#2120](https://github.com/nodejs/node/pull/2120) +* [[`cf14a2427c`](https://github.com/nodejs/node/commit/cf14a2427c)] - **(SEMVER-MINOR)** **src**: add --track-heap-objects (Bradley Meck) [#2135](https://github.com/nodejs/node/pull/2135) +* [[`2b4b600660`](https://github.com/nodejs/node/commit/2b4b600660)] - **test**: fix test-debug-port-from-cmdline (João Reis) [#2186](https://github.com/nodejs/node/pull/2186) +* [[`d4ceb16da2`](https://github.com/nodejs/node/commit/d4ceb16da2)] - **test**: properly clean up temp directory (Roman Reiss) [#2164](https://github.com/nodejs/node/pull/2164) +* [[`842eb5b853`](https://github.com/nodejs/node/commit/842eb5b853)] - **test**: add test for dgram.setTTL (Evan Lucas) [#2121](https://github.com/nodejs/node/pull/2121) +* [[`cff7300a57`](https://github.com/nodejs/node/commit/cff7300a57)] - **win,node-gyp**: enable delay-load hook by default (Bert Belder) [iojs/io.js#1433](https://github.com/iojs/io.js/pull/1433) + +## 2015-07-09, Version 2.3.4, @Fishrock123 + +### Notable changes + +* **openssl**: Upgrade to 1.0.2d, fixes CVE-2015-1793 (Alternate Chains Certificate Forgery) (Shigeki Ohtsu) [#2141](https://github.com/nodejs/node/pull/2141). +* **npm**: Upgraded to v2.12.1, release notes can be found in and (Kat Marchán) [#2112](https://github.com/nodejs/node/pull/2112). + +### Known issues + +See https://github.com/nodejs/node/labels/confirmed-bug for complete and current list of known issues. + +* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/node/issues/1264). +* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/node/issues/690) +* `process.send()` is not synchronous as the docs suggest, a regression introduced in 1.0.2, see [#760](https://github.com/nodejs/node/issues/760). +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/node/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). + +### Commits + +* [[`0d15161c24`](https://github.com/nodejs/node/commit/0d15161c24)] - **benchmark**: Add some path benchmarks for #1778 (Nathan Woltman) [#1778](https://github.com/nodejs/node/pull/1778) +* [[`c70e68fa32`](https://github.com/nodejs/node/commit/c70e68fa32)] - **deps**: update deps/openssl/conf/arch/*/opensslconf.h (Shigeki Ohtsu) [#2141](https://github.com/nodejs/node/pull/2141) +* [[`ca93f7f2e6`](https://github.com/nodejs/node/commit/ca93f7f2e6)] - **deps**: upgrade openssl sources to 1.0.2d (Shigeki Ohtsu) [#2141](https://github.com/nodejs/node/pull/2141) +* [[`b18c841ec1`](https://github.com/nodejs/node/commit/b18c841ec1)] - **deps**: make node-gyp work with io.js (cjihrig) [iojs/io.js#990](https://github.com/iojs/io.js/pull/990) +* [[`863cdbdd08`](https://github.com/nodejs/node/commit/863cdbdd08)] - **deps**: upgrade to npm 2.12.1 (Kat Marchán) [#2112](https://github.com/nodejs/node/pull/2112) +* [[`84b3915764`](https://github.com/nodejs/node/commit/84b3915764)] - **doc**: document current release procedure (Rod Vagg) [#2099](https://github.com/nodejs/node/pull/2099) +* [[`46140334cd`](https://github.com/nodejs/node/commit/46140334cd)] - **doc**: update AUTHORS list (Rod Vagg) [#2100](https://github.com/nodejs/node/pull/2100) +* [[`bca53dce76`](https://github.com/nodejs/node/commit/bca53dce76)] - **path**: refactor for performance and consistency (Nathan Woltman) [#1778](https://github.com/nodejs/node/pull/1778) +* [[`6bef15afe7`](https://github.com/nodejs/node/commit/6bef15afe7)] - **src**: remove traceSyncIO property from process (Bradley Meck) [#2143](https://github.com/nodejs/node/pull/2143) +* [[`2ba1740ba1`](https://github.com/nodejs/node/commit/2ba1740ba1)] - **test**: add missing crypto checks (Johan Bergström) [#2129](https://github.com/nodejs/node/pull/2129) +* [[`180fd392ca`](https://github.com/nodejs/node/commit/180fd392ca)] - **test**: refactor test-repl-tab-complete (Sakthipriyan Vairamani) [#2122](https://github.com/nodejs/node/pull/2122) +* [[`fb05c8e27d`](https://github.com/nodejs/node/commit/fb05c8e27d)] - ***Revert*** "**test**: add test for missing `close`/`finish` event" (Fedor Indutny) +* [[`9436a860cb`](https://github.com/nodejs/node/commit/9436a860cb)] - **test**: add test for missing `close`/`finish` event (Mark Plomer) [iojs/io.js#1373](https://github.com/iojs/io.js/pull/1373) +* [[`ee3ce2ed88`](https://github.com/nodejs/node/commit/ee3ce2ed88)] - **tools**: install gdbinit from v8 to $PREFIX/share (Ali Ijaz Sheikh) [#2123](https://github.com/nodejs/node/pull/2123) +* [[`dd523c75da`](https://github.com/nodejs/node/commit/dd523c75da)] - **win,node-gyp**: enable delay-load hook by default (Bert Belder) [iojs/io.js#1433](https://github.com/iojs/io.js/pull/1433) + +## 2015-07-09, Version 0.12.7 (Stable) + +### Commits + +* [[`0cf9f27703`](https://github.com/nodejs/node/commit/0cf9f27703)] - **deps**: upgrade openssl sources to 1.0.1p [#25654](https://github.com/joyent/node/pull/25654) +* [[`8917e430b8`](https://github.com/nodejs/node/commit/8917e430b8)] - **deps**: upgrade to npm 2.11.3 [#25545](https://github.com/joyent/node/pull/25545) +* [[`88a27a9621`](https://github.com/nodejs/node/commit/88a27a9621)] - **V8**: cherry-pick JitCodeEvent patch from upstream (Ben Noordhuis) [#25589](https://github.com/joyent/node/pull/25589) +* [[`18d413d299`](https://github.com/nodejs/node/commit/18d413d299)] - **win,msi**: create npm folder in AppData directory (Steven Rockarts) [#8838](https://github.com/joyent/node/pull/8838) + +## 2015-07-09, Version 0.10.40 (Maintenance) + +### Commits + +* [[`0cf9f27703`](https://github.com/nodejs/node/commit/0cf9f27703)] - **openssl**: upgrade to 1.0.1p [#25654](https://github.com/joyent/node/pull/25654) +* [[`5a60e0d904`](https://github.com/nodejs/node/commit/5a60e0d904)] - **V8**: back-port JitCodeEvent patch from upstream (Ben Noordhuis) [#25588](https://github.com/joyent/node/pull/25588) +* [[`18d413d299`](https://github.com/nodejs/node/commit/18d413d299)] - **win,msi**: create npm folder in AppData directory (Steven Rockarts) [#8838](https://github.com/joyent/node/pull/8838) + +## 2015-07-04, Version 2.3.3, @Fishrock123 + +### Notable changes + +* **deps**: Fixed an out-of-band write in utf8 decoder. **This is an important security update** as it can be used to cause a denial of service attack. + +### Known issues + +See https://github.com/nodejs/node/labels/confirmed-bug for complete and current list of known issues. + +* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/node/issues/1264). +* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/node/issues/690) +* `process.send()` is not synchronous as the docs suggest, a regression introduced in 1.0.2, see [#760](https://github.com/nodejs/node/issues/760). +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/node/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). + +## Commits + +* [[`030f8045c7`](https://github.com/nodejs/node/commit/030f8045c7)] - **deps**: fix out-of-band write in utf8 decoder (Fedor Indutny) +* [[`0f09b8db28`](https://github.com/nodejs/node/commit/0f09b8db28)] - **doc**: don't recommend domains for error handling (Benjamin Gruenbaum) [#2056](https://github.com/nodejs/node/pull/2056) +* [[`9cd44bb2b6`](https://github.com/nodejs/node/commit/9cd44bb2b6)] - **util**: prepend '(node) ' to deprecation messages (Sakthipriyan Vairamani) [#1892](https://github.com/nodejs/node/pull/1892) + +## 2015-07-03, Version 0.12.6 (Stable) + +### Notable changes + +* **deps**: Fixed an out-of-band write in utf8 decoder. **This is an important security update** as it can be used to cause a denial of service attack. + +### Commits + +* [[`78b0e30954`](https://github.com/nodejs/node/commit/78b0e30954)] - **deps**: fix out-of-band write in utf8 decoder (Fedor Indutny) + +## 2015-07-01, Version 2.3.2, @rvagg + +### Notable changes + +* **build**: + - Added support for compiling with Microsoft Visual C++ 2015 + - Started building and distributing headers-only tarballs along with binaries + +### Known issues + +See https://github.com/nodejs/node/labels/confirmed-bug for complete and current list of known issues. + +* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/node/issues/1264). +* Surrogate pair in REPL can freeze terminal [#690](https://github.com/nodejs/node/issues/690) +* `process.send()` is not synchronous as the docs suggest, a regression introduced in 1.0.2, see [#760](https://github.com/nodejs/node/issues/760) and fix in [#774](https://github.com/nodejs/node/issues/774) +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion [#894](https://github.com/nodejs/node/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). + +## Commits + +* [[`9180140231`](https://github.com/nodejs/node/commit/9180140231)] - **_stream_wrap**: prevent use after free in TLS (Fedor Indutny) [#1910](https://github.com/nodejs/node/pull/1910) +* [[`05a73c0f25`](https://github.com/nodejs/node/commit/05a73c0f25)] - **benchmark**: make concurrent requests configurable (Rich Trott) [#2068](https://github.com/nodejs/node/pull/2068) +* [[`f52d73352e`](https://github.com/nodejs/node/commit/f52d73352e)] - **benchmark**: fix typo in README (Rich Trott) [#2067](https://github.com/nodejs/node/pull/2067) +* [[`1cd9eeb556`](https://github.com/nodejs/node/commit/1cd9eeb556)] - **buffer**: prevent abort on bad proto (Trevor Norris) [#2012](https://github.com/nodejs/node/pull/2012) +* [[`8350f3a3a2`](https://github.com/nodejs/node/commit/8350f3a3a2)] - **buffer**: optimize Buffer#toString() (Ben Noordhuis) [#2027](https://github.com/nodejs/node/pull/2027) +* [[`628a3ab093`](https://github.com/nodejs/node/commit/628a3ab093)] - **build**: add tar-headers target for headers-only tar (Rod Vagg) [#1975](https://github.com/nodejs/node/pull/1975) +* [[`dcbb9e1da6`](https://github.com/nodejs/node/commit/dcbb9e1da6)] - **build**: update build targets for io.js (Rod Vagg) [#1938](https://github.com/nodejs/node/pull/1938) +* [[`c87c34c242`](https://github.com/nodejs/node/commit/c87c34c242)] - **build**: fix cherry-pick ooops, fix comment wording (Rod Vagg) [#2036](https://github.com/nodejs/node/pull/2036) +* [[`4208dc4fef`](https://github.com/nodejs/node/commit/4208dc4fef)] - **build**: add MSVS 2015 support (Rod Vagg) [#2036](https://github.com/nodejs/node/pull/2036) +* [[`834a365113`](https://github.com/nodejs/node/commit/834a365113)] - **build**: DTrace is enabled by default on darwin (Evan Lucas) [#2019](https://github.com/nodejs/node/pull/2019) +* [[`c0c0d73269`](https://github.com/nodejs/node/commit/c0c0d73269)] - **build,win**: set env before generating projects (Alexis Campailla) [joyent/node#20109](https://github.com/joyent/node/pull/20109) +* [[`9e890fe8b4`](https://github.com/nodejs/node/commit/9e890fe8b4)] - **crypto**: fix VerifyCallback in case of verify error (Shigeki Ohtsu) [#2064](https://github.com/nodejs/node/pull/2064) +* [[`1f371e3988`](https://github.com/nodejs/node/commit/1f371e3988)] - **deps**: copy all openssl header files to include dir (Shigeki Ohtsu) [#2016](https://github.com/nodejs/node/pull/2016) +* [[`c370bd3aea`](https://github.com/nodejs/node/commit/c370bd3aea)] - **doc**: make the abbreviation 1MM clear (Ivan Yan) [#2053](https://github.com/nodejs/node/pull/2053) +* [[`54d5437566`](https://github.com/nodejs/node/commit/54d5437566)] - **doc**: Added sample command to test iojs build (Jimmy Hsu) [#850](https://github.com/nodejs/node/pull/850) +* [[`f1f1b7e597`](https://github.com/nodejs/node/commit/f1f1b7e597)] - **doc**: add TSC meeting minutes 2015-06-17 (Rod Vagg) [#2048](https://github.com/nodejs/node/pull/2048) +* [[`dbd5dc932d`](https://github.com/nodejs/node/commit/dbd5dc932d)] - **doc**: clarify prerequisites in benchmark/README.md (Jeremiah Senkpiel) [#2034](https://github.com/nodejs/node/pull/2034) +* [[`50dbc8e143`](https://github.com/nodejs/node/commit/50dbc8e143)] - **doc**: add TSC meeting minutes 2015-05-27 (Rod Vagg) [#2037](https://github.com/nodejs/node/pull/2037) +* [[`941ad362a7`](https://github.com/nodejs/node/commit/941ad362a7)] - **doc**: archive io.js TC minutes (Rod Vagg) +* [[`644b2eaa89`](https://github.com/nodejs/node/commit/644b2eaa89)] - **doc**: rename tc-meetings to tsc-meetings (Rod Vagg) +* [[`1330ee3b27`](https://github.com/nodejs/node/commit/1330ee3b27)] - **doc**: add TC meeting 2015-05-13 minutes (Rod Vagg) [#1700](https://github.com/nodejs/node/pull/1700) +* [[`392e8fd64e`](https://github.com/nodejs/node/commit/392e8fd64e)] - **doc**: add @shigeki and @mscdex to TC (Rod Vagg) [#2008](https://github.com/nodejs/node/pull/2008) +* [[`af249fa8a1`](https://github.com/nodejs/node/commit/af249fa8a1)] - **net**: wrap connect in nextTick (Evan Lucas) [#2054](https://github.com/nodejs/node/pull/2054) +* [[`7f63449fde`](https://github.com/nodejs/node/commit/7f63449fde)] - **net**: fix debug for dnsopts (Evan Lucas) [#2059](https://github.com/nodejs/node/pull/2059) +* [[`eabed2f518`](https://github.com/nodejs/node/commit/eabed2f518)] - **repl**: remove obsolete TODO (Rich Trott) [#2081](https://github.com/nodejs/node/pull/2081) +* [[`a198c68b56`](https://github.com/nodejs/node/commit/a198c68b56)] - **repl**: make 'Unexpected token' errors recoverable (Julien Gilli) [#2052](https://github.com/nodejs/node/pull/2052) +* [[`d735b2c6ef`](https://github.com/nodejs/node/commit/d735b2c6ef)] - **repl**: fix tab completion for a non-global context (Sangmin Yoon) [#2052](https://github.com/nodejs/node/pull/2052) +* [[`8cee8f54fc`](https://github.com/nodejs/node/commit/8cee8f54fc)] - **src**: nix stdin _readableState.reading manipulation (Chris Dickinson) [#454](https://github.com/nodejs/node/pull/454) +* [[`856c11f8c8`](https://github.com/nodejs/node/commit/856c11f8c8)] - **test**: purge stale disabled tests (Rich Trott) [#2045](https://github.com/nodejs/node/pull/2045) +* [[`4d5089e181`](https://github.com/nodejs/node/commit/4d5089e181)] - **test**: do not swallow OpenSSL support error (Rich Trott) [#2042](https://github.com/nodejs/node/pull/2042) +* [[`06721fe005`](https://github.com/nodejs/node/commit/06721fe005)] - **test**: fix test-repl-tab-complete.js (cjihrig) [#2052](https://github.com/nodejs/node/pull/2052) +* [[`8e9089ac35`](https://github.com/nodejs/node/commit/8e9089ac35)] - **test**: check for error on Windows (Rich Trott) [#2035](https://github.com/nodejs/node/pull/2035) +* [[`776a65ebcd`](https://github.com/nodejs/node/commit/776a65ebcd)] - **test**: remove obsolete TODO comments (Rich Trott) [#2033](https://github.com/nodejs/node/pull/2033) +* [[`bdfeb798ad`](https://github.com/nodejs/node/commit/bdfeb798ad)] - **test**: remove obsolete TODO comments (Rich Trott) [#2032](https://github.com/nodejs/node/pull/2032) +* [[`58e914f9bc`](https://github.com/nodejs/node/commit/58e914f9bc)] - **tools**: fix gyp to work on MacOSX without XCode (Shigeki Ohtsu) [iojs/io.js#1325](https://github.com/iojs/io.js/pull/1325) +* [[`99cbbc0a13`](https://github.com/nodejs/node/commit/99cbbc0a13)] - **tools**: update gyp to 25ed9ac (Ben Noordhuis) [#2074](https://github.com/nodejs/node/pull/2074) +* [[`e3f9335c40`](https://github.com/nodejs/node/commit/e3f9335c40)] - **tools**: re-enable comma-spacing linter rule (Roman Reiss) [#2072](https://github.com/nodejs/node/pull/2072) +* [[`d91e10b3bd`](https://github.com/nodejs/node/commit/d91e10b3bd)] - **tools**: update eslint to 0.24.0 (Roman Reiss) [#2072](https://github.com/nodejs/node/pull/2072) +* [[`6c61ca5325`](https://github.com/nodejs/node/commit/6c61ca5325)] - **url**: fix typo in comment (Rich Trott) [#2071](https://github.com/nodejs/node/pull/2071) +* [[`1a51f0058c`](https://github.com/nodejs/node/commit/1a51f0058c)] - **v8**: cherry-pick JitCodeEvent patch from upstream (Ben Noordhuis) [#2075](https://github.com/nodejs/node/pull/2075) + +## 2015-06-23, Version 2.3.1, @rvagg + +### Notable changes + +* **module**: The number of syscalls made during a `require()` have been significantly reduced again (see [#1801](https://github.com/nodejs/node/pull/1801) from v2.2.0 for previous work), which should lead to a performance improvement (Pierre Inglebert) [#1920](https://github.com/nodejs/node/pull/1920). +* **npm**: + * Upgrade to [v2.11.2](https://github.com/npm/npm/releases/tag/v2.11.2) (Rebecca Turner) [#1956](https://github.com/nodejs/node/pull/1956). + * Upgrade to [v2.11.3](https://github.com/npm/npm/releases/tag/v2.11.3) (Forrest L Norvell) [#2018](https://github.com/nodejs/node/pull/2018). +* **zlib**: A bug was discovered where the process would abort if the final part of a zlib decompression results in a buffer that would exceed the maximum length of `0x3fffffff` bytes (~1GiB). This was likely to only occur during buffered decompression (rather than streaming). This is now fixed and will instead result in a thrown `RangeError` (Michaël Zasso) [#1811](https://github.com/nodejs/node/pull/1811). + +### Known issues + +See https://github.com/nodejs/node/labels/confirmed-bug for complete and current list of known issues. + +* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/node/issues/1264). +* Surrogate pair in REPL can freeze terminal [#690](https://github.com/nodejs/node/issues/690) +* `process.send()` is not synchronous as the docs suggest, a regression introduced in 1.0.2, see [#760](https://github.com/nodejs/node/issues/760) and fix in [#774](https://github.com/nodejs/node/issues/774) +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion [#894](https://github.com/nodejs/node/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). + +## Commits + +* [[`e56758a5e0`](https://github.com/nodejs/node/commit/e56758a5e0)] - **async-wrap**: add provider id and object info cb (Trevor Norris) [#1896](https://github.com/nodejs/node/pull/1896) +* [[`d5637e67c9`](https://github.com/nodejs/node/commit/d5637e67c9)] - **buffer**: fix cyclic dependency with util (Brendan Ashworth) [#1988](https://github.com/nodejs/node/pull/1988) +* [[`c5353d7c62`](https://github.com/nodejs/node/commit/c5353d7c62)] - **build**: remove lint from test-ci on windows (Johan Bergström) [#2004](https://github.com/nodejs/node/pull/2004) +* [[`c207e8d223`](https://github.com/nodejs/node/commit/c207e8d223)] - **build**: fix pkg-config output parsing in configure (Ben Noordhuis) [#1986](https://github.com/nodejs/node/pull/1986) +* [[`8d8a26e8f7`](https://github.com/nodejs/node/commit/8d8a26e8f7)] - **build**: don't run lint from test-ci (Johan Bergström) [#1965](https://github.com/nodejs/node/pull/1965) +* [[`1ec53c044d`](https://github.com/nodejs/node/commit/1ec53c044d)] - **build**: simplify execution of built binary (Johan Bergström) [#1955](https://github.com/nodejs/node/pull/1955) +* [[`3beb880716`](https://github.com/nodejs/node/commit/3beb880716)] - **crypto**: add cert check to CNNIC Whitelist (Shigeki Ohtsu) [#1895](https://github.com/nodejs/node/pull/1895) +* [[`48c0fb8b1a`](https://github.com/nodejs/node/commit/48c0fb8b1a)] - **deps**: make node-gyp work with io.js (cjihrig) [iojs/io.js#990](https://github.com/iojs/io.js/pull/990) +* [[`6a359b1ce9`](https://github.com/nodejs/node/commit/6a359b1ce9)] - **deps**: upgrade to npm 2.11.3 (Forrest L Norvell) [#2018](https://github.com/nodejs/node/pull/2018) +* [[`6aab2f3b9a`](https://github.com/nodejs/node/commit/6aab2f3b9a)] - **deps**: make node-gyp work with io.js (cjihrig) [iojs/io.js#990](https://github.com/iojs/io.js/pull/990) +* [[`3e12561b55`](https://github.com/nodejs/node/commit/3e12561b55)] - **deps**: upgrade to npm 2.11.2 (Rebecca Turner) [#1956](https://github.com/nodejs/node/pull/1956) +* [[`8ac50819b6`](https://github.com/nodejs/node/commit/8ac50819b6)] - **doc**: add security section to README.md (Rod Vagg) [#1948](https://github.com/nodejs/node/pull/1948) +* [[`1f93b63b11`](https://github.com/nodejs/node/commit/1f93b63b11)] - **doc**: change the info to the same as in gitconfig (Christian Tellnes) [#2000](https://github.com/nodejs/node/pull/2000) +* [[`0cf94e6856`](https://github.com/nodejs/node/commit/0cf94e6856)] - **doc**: mention CI in Collaborator Guide (Rich Trott) [#1995](https://github.com/nodejs/node/pull/1995) +* [[`7a3006efe4`](https://github.com/nodejs/node/commit/7a3006efe4)] - **doc**: add TOC links to Collaborator Guide (Rich Trott) [#1994](https://github.com/nodejs/node/pull/1994) +* [[`30638b150f`](https://github.com/nodejs/node/commit/30638b150f)] - **doc**: add TSC meeting notes 2015-06-10 (Bert Belder) [#1943](https://github.com/nodejs/node/pull/1943) +* [[`c4ec04136b`](https://github.com/nodejs/node/commit/c4ec04136b)] - **doc**: reformat authors section (Johan Bergström) [#1966](https://github.com/nodejs/node/pull/1966) +* [[`96165f9be2`](https://github.com/nodejs/node/commit/96165f9be2)] - **doc**: minor clarification in the modules API doc. (Сковорода Никита Андреевич) [#1983](https://github.com/nodejs/node/pull/1983) +* [[`5c2707c1b2`](https://github.com/nodejs/node/commit/5c2707c1b2)] - **doc**: benchmark/README.md copyedit (Rich Trott) [#1970](https://github.com/nodejs/node/pull/1970) +* [[`74fdf732d0`](https://github.com/nodejs/node/commit/74fdf732d0)] - **doc**: copyedit COLLABORATOR_GUIDE.md (Rich Trott) [#1964](https://github.com/nodejs/node/pull/1964) +* [[`5fe6e83640`](https://github.com/nodejs/node/commit/5fe6e83640)] - **doc**: copyedit GOVERNANCE.md (Rich Trott) [#1963](https://github.com/nodejs/node/pull/1963) +* [[`428526544c`](https://github.com/nodejs/node/commit/428526544c)] - **doc**: add ChALkeR as collaborator (Сковорода Никита Андреевич) [#1927](https://github.com/nodejs/node/pull/1927) +* [[`5dfe0d5d61`](https://github.com/nodejs/node/commit/5dfe0d5d61)] - **doc**: remove irrelevant SEMVER-MINOR & MAJOR (Rod Vagg) +* [[`fb8811d95e`](https://github.com/nodejs/node/commit/fb8811d95e)] - **lib,test**: fix whitespace issues (Roman Reiss) [#1971](https://github.com/nodejs/node/pull/1971) +* [[`a4f4909f3d`](https://github.com/nodejs/node/commit/a4f4909f3d)] - **module**: fix stat with long paths on Windows (Michaël Zasso) [#2013](https://github.com/nodejs/node/pull/2013) +* [[`a71ee93afe`](https://github.com/nodejs/node/commit/a71ee93afe)] - **module**: reduce syscalls during require search (Pierre Inglebert) [#1920](https://github.com/nodejs/node/pull/1920) +* [[`671e64ac73`](https://github.com/nodejs/node/commit/671e64ac73)] - **module**: allow long paths for require on Windows (Michaël Zasso) +* [[`061342a500`](https://github.com/nodejs/node/commit/061342a500)] - **net**: Defer reading until listeners could be added (James Hartig) [#1496](https://github.com/nodejs/node/pull/1496) +* [[`5d2b846d11`](https://github.com/nodejs/node/commit/5d2b846d11)] - **test**: assert tmp and fixture dirs different (Rich Trott) [#2015](https://github.com/nodejs/node/pull/2015) +* [[`b0990ef45d`](https://github.com/nodejs/node/commit/b0990ef45d)] - **test**: confirm symlink (Rich Trott) [#2014](https://github.com/nodejs/node/pull/2014) +* [[`3ba4f71fc4`](https://github.com/nodejs/node/commit/3ba4f71fc4)] - **test**: check result as early as possible (Rich Trott) [#2007](https://github.com/nodejs/node/pull/2007) +* [[`0abcf44d6b`](https://github.com/nodejs/node/commit/0abcf44d6b)] - **test**: add Buffer slice UTF-8 test (Rich Trott) [#1989](https://github.com/nodejs/node/pull/1989) +* [[`88c1831ff4`](https://github.com/nodejs/node/commit/88c1831ff4)] - **test**: tmpdir creation failures should fail tests (Rich Trott) [#1976](https://github.com/nodejs/node/pull/1976) +* [[`52a822d944`](https://github.com/nodejs/node/commit/52a822d944)] - **test**: fix test-cluster-worker-disconnect (Santiago Gimeno) [#1919](https://github.com/nodejs/node/pull/1919) +* [[`7c79490bfb`](https://github.com/nodejs/node/commit/7c79490bfb)] - **test**: only refresh tmpDir for tests that need it (Rich Trott) [#1954](https://github.com/nodejs/node/pull/1954) +* [[`88d7904c0b`](https://github.com/nodejs/node/commit/88d7904c0b)] - **test**: remove test repetition (Rich Trott) [#1874](https://github.com/nodejs/node/pull/1874) +* [[`91dfb5e094`](https://github.com/nodejs/node/commit/91dfb5e094)] - **tools**: make test-npm work without global npm (Jeremiah Senkpiel) [#1926](https://github.com/nodejs/node/pull/1926) +* [[`3777f41562`](https://github.com/nodejs/node/commit/3777f41562)] - **tools**: enable whitespace related rules in eslint (Roman Reiss) [#1971](https://github.com/nodejs/node/pull/1971) +* [[`626432d843`](https://github.com/nodejs/node/commit/626432d843)] - **util**: dont repeat isBuffer (Brendan Ashworth) [#1988](https://github.com/nodejs/node/pull/1988) +* [[`1d79f572f1`](https://github.com/nodejs/node/commit/1d79f572f1)] - **util**: move deprecate() to internal module (Brendan Ashworth) [#1988](https://github.com/nodejs/node/pull/1988) +* [[`4b4b1760b5`](https://github.com/nodejs/node/commit/4b4b1760b5)] - **v8**: cherry-pick uclibc build patch from upstream (Ben Noordhuis) [#1974](https://github.com/nodejs/node/pull/1974) +* [[`5d0cee46bb`](https://github.com/nodejs/node/commit/5d0cee46bb)] - **vm**: remove unnecessary HandleScopes (Ben Noordhuis) [#2001](https://github.com/nodejs/node/pull/2001) +* [[`0ecf9457b5`](https://github.com/nodejs/node/commit/0ecf9457b5)] - **win,node-gyp**: enable delay-load hook by default (Bert Belder) [iojs/io.js#1433](https://github.com/iojs/io.js/pull/1433) +* [[`953b3e75e8`](https://github.com/nodejs/node/commit/953b3e75e8)] - **win,node-gyp**: enable delay-load hook by default (Bert Belder) [iojs/io.js#1433](https://github.com/iojs/io.js/pull/1433) +* [[`3806d875d3`](https://github.com/nodejs/node/commit/3806d875d3)] - **zlib**: prevent uncaught exception in zlibBuffer (Michaël Zasso) [#1811](https://github.com/nodejs/node/pull/1811) + +## 2015-06-22, Version 0.12.5 (Stable) + +### Commits + +* [[`456c22f63f`](https://github.com/nodejs/node/commit/456c22f63f)] - **openssl**: upgrade to 1.0.1o (Addressing multiple CVEs) [#25523](https://github.com/joyent/node/pull/25523) +* [[`20d8db1a42`](https://github.com/nodejs/node/commit/20d8db1a42)] - **npm**: upgrade to 2.11.2 [#25517](https://github.com/joyent/node/pull/25517) +* [[`50f961596d`](https://github.com/nodejs/node/commit/50f961596d)] - **uv**: upgrade to 1.6.1 [#25475](https://github.com/joyent/node/pull/25475) +* [[`b81a643f9a`](https://github.com/nodejs/node/commit/b81a643f9a)] - **V8**: avoid deadlock when profiling is active (Dmitri Melikyan) [#25309](https://github.com/joyent/node/pull/25309) +* [[`9d19dfbfdb`](https://github.com/nodejs/node/commit/9d19dfbfdb)] - **install**: fix source path for openssl headers (Oguz Bastemur) [#14089](https://github.com/joyent/node/pull/14089) +* [[`4028669531`](https://github.com/nodejs/node/commit/4028669531)] - **install**: make sure opensslconf.h is overwritten (Oguz Bastemur) [#14089](https://github.com/joyent/node/pull/14089) +* [[`d38e865fce`](https://github.com/nodejs/node/commit/d38e865fce)] - **timers**: fix timeout when added in timer's callback (Julien Gilli) [#17203](https://github.com/joyent/node/pull/17203) +* [[`e7c84f82c7`](https://github.com/nodejs/node/commit/e7c84f82c7)] - **windows**: broadcast WM_SETTINGCHANGE after install (Mathias Küsel) [#25100](https://github.com/joyent/node/pull/25100) + +## 2015-06-18, Version 0.10.39 (Maintenance) + +### Commits + +* [[`456c22f63f`](https://github.com/nodejs/node/commit/456c22f63f)] - **openssl**: upgrade to 1.0.1o (Addressing multiple CVEs) [#25523](https://github.com/joyent/node/pull/25523) +* [[`9d19dfbfdb`](https://github.com/nodejs/node/commit/9d19dfbfdb)] - **install**: fix source path for openssl headers (Oguz Bastemur) [#14089](https://github.com/joyent/node/pull/14089) +* [[`4028669531`](https://github.com/nodejs/node/commit/4028669531)] - **install**: make sure opensslconf.h is overwritten (Oguz Bastemur) [#14089](https://github.com/joyent/node/pull/14089) +* [[`d38e865fce`](https://github.com/nodejs/node/commit/d38e865fce)] - **timers**: fix timeout when added in timer's callback (Julien Gilli) [#17203](https://github.com/joyent/node/pull/17203) +* [[`e7c84f82c7`](https://github.com/nodejs/node/commit/e7c84f82c7)] - **windows**: broadcast WM_SETTINGCHANGE after install (Mathias Küsel) [#25100](https://github.com/joyent/node/pull/25100) + +## 2015-06-13, Version 2.3.0, @rvagg + +### Notable changes + +* **libuv**: Upgraded to 1.6.0 and 1.6.1, see [full ChangeLog](https://github.com/libuv/libuv/blob/60e515d9e6f3d86c0eedad583805201f32ea3aed/ChangeLog#L1-L36) for details. (Saúl Ibarra Corretgé) [#1905](https://github.com/nodejs/node/pull/1905) [#1889](https://github.com/nodejs/node/pull/1889). Highlights include: + - Fix TTY becoming blocked on OS X + - Fix UDP send callbacks to not to be synchronous + - Add `uv_os_homedir()` (exposed as `os.homedir()`, see below) +* **npm**: See full [release notes](https://github.com/npm/npm/releases/tag/v2.11.1) for details. (Kat Marchán) [#1899](https://github.com/nodejs/node/pull/1899). Highlight: + - Use GIT_SSH_COMMAND (available as of Git 2.3) +* **openssl**: + - Upgrade to 1.0.2b and 1.0.2c, introduces DHE man-in-the-middle protection (Logjam) and fixes malformed ECParameters causing infinite loop (CVE-2015-1788). See the [security advisory](https://www.openssl.org/news/secadv_20150611.txt) for full details. (Shigeki Ohtsu) [#1950](https://github.com/nodejs/node/pull/1950) [#1958](https://github.com/nodejs/node/pull/1958) + - Support [FIPS](https://en.wikipedia.org/wiki/Federal_Information_Processing_Standards) mode of OpenSSL, see [README](https://github.com/nodejs/node#building-iojs-with-fips-compliant-openssl) for instructions. (Fedor Indutny) [#1890](https://github.com/nodejs/node/pull/1890) +* **os**: Add `os.homedir()` method. (Colin Ihrig) [#1791](https://github.com/nodejs/node/pull/1791) +* **smalloc**: Deprecate whole module. (Vladimir Kurchatkin) [#1822](https://github.com/nodejs/node/pull/1822) +* Add new collaborators: + - Alex Kocharin ([@rlidwka](https://github.com/rlidwka)) + - Christopher Monsanto ([@monsanto](https://github.com/monsanto)) + - Ali Ijaz Sheikh ([@ofrobots](https://github.com/ofrobots)) + - Oleg Elifantiev ([@Olegas](https://github.com/Olegas)) + - Domenic Denicola ([@domenic](https://github.com/domenic)) + - Rich Trott ([@Trott](https://github.com/Trott)) + +### Known issues + +See https://github.com/nodejs/node/labels/confirmed-bug for complete and current list of known issues. + +* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/node/issues/1264). +* Surrogate pair in REPL can freeze terminal [#690](https://github.com/nodejs/node/issues/690) +* `process.send()` is not synchronous as the docs suggest, a regression introduced in 1.0.2, see [#760](https://github.com/nodejs/node/issues/760) and fix in [#774](https://github.com/nodejs/node/issues/774) +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion [#894](https://github.com/nodejs/node/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). + +## Commits + +* [[`9c0a1b8cfc`](https://github.com/nodejs/node/commit/9c0a1b8cfc)] - **cluster**: wait on servers closing before disconnect (Oleg Elifantiev) [#1400](https://github.com/nodejs/node/pull/1400) +* [[`0f68377f69`](https://github.com/nodejs/node/commit/0f68377f69)] - **crypto**: support FIPS mode of OpenSSL (Fedor Indutny) [#1890](https://github.com/nodejs/node/pull/1890) +* [[`38d1afc24d`](https://github.com/nodejs/node/commit/38d1afc24d)] - **(SEMVER-MINOR)** **crypto**: add getCurves() to get supported ECs (Brian White) [#1914](https://github.com/nodejs/node/pull/1914) +* [[`a4dbf45b59`](https://github.com/nodejs/node/commit/a4dbf45b59)] - **crypto**: update root certificates (Ben Noordhuis) [#1833](https://github.com/nodejs/node/pull/1833) +* [[`81029c639a`](https://github.com/nodejs/node/commit/81029c639a)] - **debugger**: improve ESRCH error message (Jackson Tian) [#1863](https://github.com/nodejs/node/pull/1863) +* [[`2a7fd0ad32`](https://github.com/nodejs/node/commit/2a7fd0ad32)] - **deps**: update UPGRADING.md doc to openssl-1.0.2c (Shigeki Ohtsu) [#1958](https://github.com/nodejs/node/pull/1958) +* [[`6b3df929e0`](https://github.com/nodejs/node/commit/6b3df929e0)] - **deps**: replace all headers in openssl (Shigeki Ohtsu) [#1958](https://github.com/nodejs/node/pull/1958) +* [[`664a659696`](https://github.com/nodejs/node/commit/664a659696)] - **deps**: add -no_rand_screen to openssl s_client (Shigeki Ohtsu) [#1836](https://github.com/nodejs/node/pull/1836) +* [[`42a8de2ac6`](https://github.com/nodejs/node/commit/42a8de2ac6)] - **deps**: fix asm build error of openssl in x86_win32 (Shigeki Ohtsu) [iojs/io.js#1389](https://github.com/iojs/io.js/pull/1389) +* [[`c66c3d9fa3`](https://github.com/nodejs/node/commit/c66c3d9fa3)] - **deps**: fix openssl assembly error on ia32 win32 (Fedor Indutny) [iojs/io.js#1389](https://github.com/iojs/io.js/pull/1389) +* [[`86737cf0a0`](https://github.com/nodejs/node/commit/86737cf0a0)] - **deps**: upgrade openssl sources to 1.0.2c (Shigeki Ohtsu) [#1958](https://github.com/nodejs/node/pull/1958) +* [[`94804969b7`](https://github.com/nodejs/node/commit/94804969b7)] - **deps**: update asm files for openssl-1.0.2b (Shigeki Ohtsu) [#1950](https://github.com/nodejs/node/pull/1950) +* [[`38444915e0`](https://github.com/nodejs/node/commit/38444915e0)] - **deps**: replace all headers in openssl (Shigeki Ohtsu) [#1950](https://github.com/nodejs/node/pull/1950) +* [[`f62b613252`](https://github.com/nodejs/node/commit/f62b613252)] - **deps**: add -no_rand_screen to openssl s_client (Shigeki Ohtsu) [#1836](https://github.com/nodejs/node/pull/1836) +* [[`f624d0122c`](https://github.com/nodejs/node/commit/f624d0122c)] - **deps**: fix asm build error of openssl in x86_win32 (Shigeki Ohtsu) [iojs/io.js#1389](https://github.com/iojs/io.js/pull/1389) +* [[`dcd67cc8d7`](https://github.com/nodejs/node/commit/dcd67cc8d7)] - **deps**: fix openssl assembly error on ia32 win32 (Fedor Indutny) [iojs/io.js#1389](https://github.com/iojs/io.js/pull/1389) +* [[`c21b24decf`](https://github.com/nodejs/node/commit/c21b24decf)] - **deps**: upgrade openssl sources to 1.0.2b (Shigeki Ohtsu) [#1950](https://github.com/nodejs/node/pull/1950) +* [[`2dc819b09a`](https://github.com/nodejs/node/commit/2dc819b09a)] - **deps**: make node-gyp work with io.js (cjihrig) [iojs/io.js#990](https://github.com/iojs/io.js/pull/990) +* [[`f41b7f12b5`](https://github.com/nodejs/node/commit/f41b7f12b5)] - **deps**: upgrade to npm 2.11.1 (Kat Marchán) [#1899](https://github.com/nodejs/node/pull/1899) +* [[`a5bd466440`](https://github.com/nodejs/node/commit/a5bd466440)] - **deps**: update libuv to version 1.6.1 (Saúl Ibarra Corretgé) [#1905](https://github.com/nodejs/node/pull/1905) +* [[`aa33db3238`](https://github.com/nodejs/node/commit/aa33db3238)] - **deps**: update libuv to version 1.6.0 (Saúl Ibarra Corretgé) [#1889](https://github.com/nodejs/node/pull/1889) +* [[`0ee497f0b4`](https://github.com/nodejs/node/commit/0ee497f0b4)] - **deps**: add -no_rand_screen to openssl s_client (Shigeki Ohtsu) [#1836](https://github.com/nodejs/node/pull/1836) +* [[`b5cd2f0986`](https://github.com/nodejs/node/commit/b5cd2f0986)] - **dgram**: partially revert 18d457b (Saúl Ibarra Corretgé) [#1889](https://github.com/nodejs/node/pull/1889) +* [[`a3cc43d0a4`](https://github.com/nodejs/node/commit/a3cc43d0a4)] - **doc**: add Trott as collaborator (Rich Trott) [#1962](https://github.com/nodejs/node/pull/1962) +* [[`cf5020fc02`](https://github.com/nodejs/node/commit/cf5020fc02)] - **doc**: add domenic as collaborator (Domenic Denicola) [#1942](https://github.com/nodejs/node/pull/1942) +* [[`11ed5f31ab`](https://github.com/nodejs/node/commit/11ed5f31ab)] - **doc**: add Olegas as collaborator (Oleg Elifantiev) [#1930](https://github.com/nodejs/node/pull/1930) +* [[`f500e1833b`](https://github.com/nodejs/node/commit/f500e1833b)] - **doc**: add ofrobots as collaborator (Ali Ijaz Sheikh) +* [[`717724611a`](https://github.com/nodejs/node/commit/717724611a)] - **doc**: add monsanto as collaborator (Christopher Monsanto) [#1932](https://github.com/nodejs/node/pull/1932) +* [[`7192b6688c`](https://github.com/nodejs/node/commit/7192b6688c)] - **doc**: add rlidwka as collaborator (Alex Kocharin) [#1929](https://github.com/nodejs/node/pull/1929) +* [[`9f3a03f0d4`](https://github.com/nodejs/node/commit/9f3a03f0d4)] - **doc**: add references to crypto.getCurves() (Roman Reiss) [#1918](https://github.com/nodejs/node/pull/1918) +* [[`ff39ecb914`](https://github.com/nodejs/node/commit/ff39ecb914)] - **doc**: remove comma splice (Rich Trott) [#1900](https://github.com/nodejs/node/pull/1900) +* [[`deb8b87dc9`](https://github.com/nodejs/node/commit/deb8b87dc9)] - **doc**: add note about available ECC curves (Ryan Petschek) [#1913](https://github.com/nodejs/node/pull/1913) +* [[`89a5b9040e`](https://github.com/nodejs/node/commit/89a5b9040e)] - **doc**: fix http.IncomingMessage.socket documentation (Сковорода Никита Андреевич) [#1867](https://github.com/nodejs/node/pull/1867) +* [[`d29034b34b`](https://github.com/nodejs/node/commit/d29034b34b)] - **doc**: adjust changelog to clarify `client` revert (Rod Vagg) [#1859](https://github.com/nodejs/node/pull/1859) +* [[`a79dece8ad`](https://github.com/nodejs/node/commit/a79dece8ad)] - **docs**: add return value for sync fs functions (Tyler Anton) [#1770](https://github.com/nodejs/node/pull/1770) +* [[`1cb72c14c4`](https://github.com/nodejs/node/commit/1cb72c14c4)] - **docs**: delete unused/duplicate css files (Robert Kowalski) [#1770](https://github.com/nodejs/node/pull/1770) +* [[`53a4eb3198`](https://github.com/nodejs/node/commit/53a4eb3198)] - **fs**: make SyncWriteStream non-enumerable (Sakthipriyan Vairamani) [#1870](https://github.com/nodejs/node/pull/1870) +* [[`a011c3243f`](https://github.com/nodejs/node/commit/a011c3243f)] - **fs**: minor refactoring (Sakthipriyan Vairamani) [#1870](https://github.com/nodejs/node/pull/1870) +* [[`8841132f30`](https://github.com/nodejs/node/commit/8841132f30)] - **fs**: remove inStatWatchers and use Map for lookup (Sakthipriyan Vairamani) [#1870](https://github.com/nodejs/node/pull/1870) +* [[`67a11b9bcc`](https://github.com/nodejs/node/commit/67a11b9bcc)] - **fs**: removing unnecessary nullCheckCallNT (Sakthipriyan Vairamani) [#1870](https://github.com/nodejs/node/pull/1870) +* [[`09f2a67bd8`](https://github.com/nodejs/node/commit/09f2a67bd8)] - **fs**: improve error message descriptions (Sakthipriyan Vairamani) [#1870](https://github.com/nodejs/node/pull/1870) +* [[`2dcef83b5f`](https://github.com/nodejs/node/commit/2dcef83b5f)] - **fs**: use `kMaxLength` from binding (Vladimir Kurchatkin) [#1903](https://github.com/nodejs/node/pull/1903) +* [[`353e26e3c7`](https://github.com/nodejs/node/commit/353e26e3c7)] - **(SEMVER-MINOR)** **fs**: Add string encoding option for Stream method (Yosuke Furukawa) [#1845](https://github.com/nodejs/node/pull/1845) +* [[`8357c5084b`](https://github.com/nodejs/node/commit/8357c5084b)] - **fs**: set encoding on fs.createWriteStream (Yosuke Furukawa) [#1844](https://github.com/nodejs/node/pull/1844) +* [[`02c345020a`](https://github.com/nodejs/node/commit/02c345020a)] - **gitignore**: don't ignore the debug npm module (Kat Marchán) [#1908](https://github.com/nodejs/node/pull/1908) +* [[`b5b8ff117c`](https://github.com/nodejs/node/commit/b5b8ff117c)] - **lib**: don't use global Buffer (Roman Reiss) [#1794](https://github.com/nodejs/node/pull/1794) +* [[`a251657058`](https://github.com/nodejs/node/commit/a251657058)] - **node**: mark promises as handled as soon as possible (Vladimir Kurchatkin) [#1952](https://github.com/nodejs/node/pull/1952) +* [[`2eb170874a`](https://github.com/nodejs/node/commit/2eb170874a)] - **openssl**: fix keypress requirement in apps on win32 (Shigeki Ohtsu) [iojs/io.js#1389](https://github.com/iojs/io.js/pull/1389) +* [[`a130132c8f`](https://github.com/nodejs/node/commit/a130132c8f)] - **openssl**: fix keypress requirement in apps on win32 (Shigeki Ohtsu) [iojs/io.js#1389](https://github.com/iojs/io.js/pull/1389) +* [[`6e78e5feaa`](https://github.com/nodejs/node/commit/6e78e5feaa)] - **(SEMVER-MINOR)** **os**: add homedir() (cjihrig) [#1791](https://github.com/nodejs/node/pull/1791) +* [[`d9e250295b`](https://github.com/nodejs/node/commit/d9e250295b)] - ***Revert*** "**readline**: allow tabs in input" (Jeremiah Senkpiel) [#1961](https://github.com/nodejs/node/pull/1961) +* [[`4b3d493c4b`](https://github.com/nodejs/node/commit/4b3d493c4b)] - **readline**: allow tabs in input (Rich Trott) [#1761](https://github.com/nodejs/node/pull/1761) +* [[`6d95f4ff92`](https://github.com/nodejs/node/commit/6d95f4ff92)] - **(SEMVER-MINOR)** **smalloc**: deprecate whole module (Vladimir Kurchatkin) [#1822](https://github.com/nodejs/node/pull/1822) +* [[`8c71a9241d`](https://github.com/nodejs/node/commit/8c71a9241d)] - **src**: hide InitializeICUDirectory symbol (Ben Noordhuis) [#1815](https://github.com/nodejs/node/pull/1815) +* [[`5b6f575c1f`](https://github.com/nodejs/node/commit/5b6f575c1f)] - ***Revert*** "**src**: add getopt option parser" (Evan Lucas) [#1862](https://github.com/nodejs/node/pull/1862) +* [[`c0e7bf2d8c`](https://github.com/nodejs/node/commit/c0e7bf2d8c)] - **src**: add getopt option parser (Evan Lucas) [#1804](https://github.com/nodejs/node/pull/1804) +* [[`8ea6844d26`](https://github.com/nodejs/node/commit/8ea6844d26)] - **test**: add test for failed save in REPL (Rich Trott) [#1818](https://github.com/nodejs/node/pull/1818) +* [[`03ce84dfa1`](https://github.com/nodejs/node/commit/03ce84dfa1)] - **test**: fix cluster-worker-wait-server-close races (Sam Roberts) [#1953](https://github.com/nodejs/node/pull/1953) +* [[`a6b8ee19b8`](https://github.com/nodejs/node/commit/a6b8ee19b8)] - **test**: create temp dir in common.js (Rich Trott) [#1877](https://github.com/nodejs/node/pull/1877) +* [[`ff8202c6f4`](https://github.com/nodejs/node/commit/ff8202c6f4)] - **test**: fix undeclared variable access (Roman Reiss) [#1794](https://github.com/nodejs/node/pull/1794) +* [[`d9ddd7d345`](https://github.com/nodejs/node/commit/d9ddd7d345)] - **test**: remove TODO comment (Rich Trott) [#1820](https://github.com/nodejs/node/pull/1820) +* [[`6537fd4b55`](https://github.com/nodejs/node/commit/6537fd4b55)] - **test**: remove TODO (Rich Trott) [#1875](https://github.com/nodejs/node/pull/1875) +* [[`a804026c9b`](https://github.com/nodejs/node/commit/a804026c9b)] - **test**: fix broken FreeBSD test (Santiago Gimeno) [#1881](https://github.com/nodejs/node/pull/1881) +* [[`43a82f8a71`](https://github.com/nodejs/node/commit/43a82f8a71)] - **test**: fix test-sync-io-option (Evan Lucas) [#1840](https://github.com/nodejs/node/pull/1840) +* [[`4ed25f664d`](https://github.com/nodejs/node/commit/4ed25f664d)] - **test**: add -no_rand_screen for tls-server-verify (Shigeki Ohtsu) [#1836](https://github.com/nodejs/node/pull/1836) +* [[`4cf323d23d`](https://github.com/nodejs/node/commit/4cf323d23d)] - **test**: kill child in tls-server-verify for speed up (Shigeki Ohtsu) [#1836](https://github.com/nodejs/node/pull/1836) +* [[`e6ccdcc1fe`](https://github.com/nodejs/node/commit/e6ccdcc1fe)] - **test**: improve console output of tls-server-verify (João Reis) [#1836](https://github.com/nodejs/node/pull/1836) +* [[`975e5956f0`](https://github.com/nodejs/node/commit/975e5956f0)] - **test**: run tls-server-verify servers in parallel (João Reis) [#1836](https://github.com/nodejs/node/pull/1836) +* [[`b18604ba2c`](https://github.com/nodejs/node/commit/b18604ba2c)] - **test**: running tls-server-verify clients in parallel (João Reis) [#1836](https://github.com/nodejs/node/pull/1836) +* [[`f78c722df5`](https://github.com/nodejs/node/commit/f78c722df5)] - **test**: remove hardwired references to 'iojs' (Rod Vagg) [#1882](https://github.com/nodejs/node/pull/1882) +* [[`bd99e8de8e`](https://github.com/nodejs/node/commit/bd99e8de8e)] - **test**: more test coverage for maxConnections (Rich Trott) [#1855](https://github.com/nodejs/node/pull/1855) +* [[`b9267189a5`](https://github.com/nodejs/node/commit/b9267189a5)] - **test**: fix test-child-process-stdout-flush-exit (Santiago Gimeno) [#1868](https://github.com/nodejs/node/pull/1868) +* [[`d20f018dcf`](https://github.com/nodejs/node/commit/d20f018dcf)] - **test**: loosen condition to detect infinite loop (Yosuke Furukawa) [#1857](https://github.com/nodejs/node/pull/1857) +* [[`e0e96acc6f`](https://github.com/nodejs/node/commit/e0e96acc6f)] - **test**: remove smalloc add-on test (Ben Noordhuis) [#1835](https://github.com/nodejs/node/pull/1835) +* [[`8704c58fc4`](https://github.com/nodejs/node/commit/8704c58fc4)] - **test**: remove unneeded comment task (Rich Trott) [#1858](https://github.com/nodejs/node/pull/1858) +* [[`8732977536`](https://github.com/nodejs/node/commit/8732977536)] - **tls**: fix references to undefined `cb` (Fedor Indutny) [#1951](https://github.com/nodejs/node/pull/1951) +* [[`75930bb38c`](https://github.com/nodejs/node/commit/75930bb38c)] - **tls**: prevent use-after-free (Fedor Indutny) [#1702](https://github.com/nodejs/node/pull/1702) +* [[`5795e835a1`](https://github.com/nodejs/node/commit/5795e835a1)] - **tls**: emit errors on close whilst async action (Fedor Indutny) [#1702](https://github.com/nodejs/node/pull/1702) +* [[`59d9734e21`](https://github.com/nodejs/node/commit/59d9734e21)] - **tls_wrap**: invoke queued callbacks in DestroySSL (Fedor Indutny) [#1702](https://github.com/nodejs/node/pull/1702) +* [[`6e4d30286d`](https://github.com/nodejs/node/commit/6e4d30286d)] - **tools**: enable/add additional eslint rules (Roman Reiss) [#1794](https://github.com/nodejs/node/pull/1794) +* [[`098354a9f8`](https://github.com/nodejs/node/commit/098354a9f8)] - **tools**: update certdata.txt (Ben Noordhuis) [#1833](https://github.com/nodejs/node/pull/1833) +* [[`a2d921d6a0`](https://github.com/nodejs/node/commit/a2d921d6a0)] - **tools**: customize mk-ca-bundle.pl (Ben Noordhuis) [#1833](https://github.com/nodejs/node/pull/1833) +* [[`5be9efca40`](https://github.com/nodejs/node/commit/5be9efca40)] - **tools**: update mk-ca-bundle.pl to HEAD of upstream (Ben Noordhuis) [#1833](https://github.com/nodejs/node/pull/1833) +* [[`1baba0580d`](https://github.com/nodejs/node/commit/1baba0580d)] - **tools**: Fix copying contents of deps/npm (thefourtheye) [#1853](https://github.com/nodejs/node/pull/1853) +* [[`628845b816`](https://github.com/nodejs/node/commit/628845b816)] - **(SEMVER-MINOR)** **util**: introduce `printDeprecationMessage` function (Vladimir Kurchatkin) [#1822](https://github.com/nodejs/node/pull/1822) +* [[`91d0a8b19c`](https://github.com/nodejs/node/commit/91d0a8b19c)] - **win,node-gyp**: enable delay-load hook by default (Bert Belder) [iojs/io.js#1433](https://github.com/iojs/io.js/pull/1433) + +## 2015-06-01, Version 2.2.1, @rvagg + +### Notable changes + +* **http**: Reverts the move of the `client` property of `IncomingMessage` to its prototype. Although undocumented, this property was used and assumed to be an "own property" in the wild, most notably by [request](https://github.com/request/request) which is used by npm. (Michaël Zasso) [#1852](https://github.com/nodejs/node/pull/1852). + +### Known issues + +See https://github.com/nodejs/node/labels/confirmed-bug for complete and current list of known issues. + +* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/node/issues/1264). +* Surrogate pair in REPL can freeze terminal [#690](https://github.com/nodejs/node/issues/690) +* `process.send()` is not synchronous as the docs suggest, a regression introduced in 1.0.2, see [#760](https://github.com/nodejs/node/issues/760) and fix in [#774](https://github.com/nodejs/node/issues/774) +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion [#894](https://github.com/nodejs/node/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). + +### Commits + +* [[`c5a1009903`](https://github.com/nodejs/node/commit/c5a1009903)] - **build**: avoid passing empty strings to build flags (Johan Bergström) [#1789](https://github.com/nodejs/node/pull/1789) +* [[`5d83401086`](https://github.com/nodejs/node/commit/5d83401086)] - **doc**: put SEMVER-MINOR on pre-load module fix 2.2.0 (Rod Vagg) +* [[`4d6b768e5d`](https://github.com/nodejs/node/commit/4d6b768e5d)] - **http**: revert deprecation of client property (Michaël Zasso) [#1852](https://github.com/nodejs/node/pull/1852) + +## 2015-05-31, Version 2.2.0, @rvagg + +### Notable changes + +* **node**: Speed-up `require()` by replacing usage of `fs.statSync()` and `fs.readFileSync()` with internal variants that are faster for this use-case and do not create as many objects for the garbage collector to clean up. The primary two benefits are: significant increase in application start-up time on typical applications and better start-up time for the debugger by eliminating almost all of the thousands of exception events. (Ben Noordhuis) [#1801](https://github.com/nodejs/node/pull/1801). +* **node**: Resolution of pre-load modules (`-r` or `--require`) now follows the standard `require()` rules rather than just resolving paths, so you can now pre-load modules in node_modules. (Ali Ijaz Sheikh) [#1812](https://github.com/nodejs/node/pull/1812). +* **npm**: Upgraded npm to v2.11.0. New hooks for `preversion`, `version`, and `postversion` lifecycle events, some SPDX-related license changes and license file inclusions. See the [release notes](https://github.com/npm/npm/releases/tag/v2.11.0) for full details. + +### Known issues + +See https://github.com/nodejs/node/labels/confirmed-bug for complete and current list of known issues. + +* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/node/issues/1264). +* Surrogate pair in REPL can freeze terminal [#690](https://github.com/nodejs/node/issues/690) +* `process.send()` is not synchronous as the docs suggest, a regression introduced in 1.0.2, see [#760](https://github.com/nodejs/node/issues/760) and fix in [#774](https://github.com/nodejs/node/issues/774) +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion [#894](https://github.com/nodejs/node/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). + +### Commits + +* [[`a77c330c32`](https://github.com/nodejs/node/commit/a77c330c32)] - **(SEMVER-MINOR)** **child_process**: expose ChildProcess constructor (Evan Lucas) [#1760](https://github.com/nodejs/node/pull/1760) +* [[`3a1bc067d4`](https://github.com/nodejs/node/commit/3a1bc067d4)] - ***Revert*** "**core**: set PROVIDER type as Persistent class id" (Ben Noordhuis) [#1827](https://github.com/nodejs/node/pull/1827) +* [[`f9fd554500`](https://github.com/nodejs/node/commit/f9fd554500)] - **deps**: make node-gyp work with io.js (cjihrig) [iojs/io.js#990](https://github.com/iojs/io.js/pull/990) +* [[`c1afa53648`](https://github.com/nodejs/node/commit/c1afa53648)] - **deps**: upgrade npm to 2.11.0 (Forrest L Norvell) [iojs/io.js#1829](https://github.com/iojs/io.js/pull/1829) +* [[`ff794498e7`](https://github.com/nodejs/node/commit/ff794498e7)] - **doc**: `fs.*File()` also accept encoding strings (Rich Trott) [#1806](https://github.com/nodejs/node/pull/1806) +* [[`98649fd31a`](https://github.com/nodejs/node/commit/98649fd31a)] - **doc**: add documentation for AtExit hook (Steve Sharp) [#1014](https://github.com/nodejs/node/pull/1014) +* [[`eb1856dfd1`](https://github.com/nodejs/node/commit/eb1856dfd1)] - **doc**: clarify stability of fs.watch and relatives (Rich Trott) [#1775](https://github.com/nodejs/node/pull/1775) +* [[`a74c2c9458`](https://github.com/nodejs/node/commit/a74c2c9458)] - **doc**: state url decoding behavior (Josh Gummersall) [#1731](https://github.com/nodejs/node/pull/1731) +* [[`ba76a9d872`](https://github.com/nodejs/node/commit/ba76a9d872)] - **doc**: remove bad semver-major entry from CHANGELOG (Rod Vagg) [#1782](https://github.com/nodejs/node/pull/1782) +* [[`a6a3f8c78d`](https://github.com/nodejs/node/commit/a6a3f8c78d)] - **doc**: fix changelog s/2.0.3/2.1.0 (Rod Vagg) +* [[`2c686fd3ce`](https://github.com/nodejs/node/commit/2c686fd3ce)] - **http**: flush stored header (Vladimir Kurchatkin) [#1695](https://github.com/nodejs/node/pull/1695) +* [[`1eec5f091a`](https://github.com/nodejs/node/commit/1eec5f091a)] - **http**: simplify code and remove unused properties (Brian White) [#1572](https://github.com/nodejs/node/pull/1572) +* [[`1bbf8d0720`](https://github.com/nodejs/node/commit/1bbf8d0720)] - **lib**: speed up require(), phase 2 (Ben Noordhuis) [#1801](https://github.com/nodejs/node/pull/1801) +* [[`b14fd1a720`](https://github.com/nodejs/node/commit/b14fd1a720)] - **lib**: speed up require(), phase 1 (Ben Noordhuis) [#1801](https://github.com/nodejs/node/pull/1801) +* [[`5abd4ac079`](https://github.com/nodejs/node/commit/5abd4ac079)] - **lib**: simplify nextTick() usage (Brian White) [#1612](https://github.com/nodejs/node/pull/1612) +* [[`5759722cfa`](https://github.com/nodejs/node/commit/5759722cfa)] - **(SEMVER-MINOR)** **src**: fix module search path for preload modules (Ali Ijaz Sheikh) [#1812](https://github.com/nodejs/node/pull/1812) +* [[`a65762cab6`](https://github.com/nodejs/node/commit/a65762cab6)] - **src**: remove old code (Brendan Ashworth) [#1819](https://github.com/nodejs/node/pull/1819) +* [[`93a44d5228`](https://github.com/nodejs/node/commit/93a44d5228)] - **src**: fix deferred events not working with -e (Ben Noordhuis) [#1793](https://github.com/nodejs/node/pull/1793) +* [[`8059393934`](https://github.com/nodejs/node/commit/8059393934)] - **test**: check error type from net.Server.listen() (Rich Trott) [#1821](https://github.com/nodejs/node/pull/1821) +* [[`4e90c82cdb`](https://github.com/nodejs/node/commit/4e90c82cdb)] - **test**: add heap profiler add-on regression test (Ben Noordhuis) [#1828](https://github.com/nodejs/node/pull/1828) +* [[`6dfca71af0`](https://github.com/nodejs/node/commit/6dfca71af0)] - **test**: don't lint autogenerated test/addons/doc-*/ (Ben Noordhuis) [#1793](https://github.com/nodejs/node/pull/1793) +* [[`c2b8b30836`](https://github.com/nodejs/node/commit/c2b8b30836)] - **test**: remove stray copyright notices (Ben Noordhuis) [#1793](https://github.com/nodejs/node/pull/1793) +* [[`280fb01daf`](https://github.com/nodejs/node/commit/280fb01daf)] - **test**: fix deprecation warning in addons test (Ben Noordhuis) [#1793](https://github.com/nodejs/node/pull/1793) +* [[`8606793999`](https://github.com/nodejs/node/commit/8606793999)] - **tools**: pass constant to logger instead of string (Johan Bergström) [#1842](https://github.com/nodejs/node/pull/1842) +* [[`fbd2b59716`](https://github.com/nodejs/node/commit/fbd2b59716)] - **tools**: add objectLiteralShorthandProperties to .eslintrc (Evan Lucas) [#1760](https://github.com/nodejs/node/pull/1760) +* [[`53e98cc1b4`](https://github.com/nodejs/node/commit/53e98cc1b4)] - **win,node-gyp**: enable delay-load hook by default (Bert Belder) [#1763](https://github.com/nodejs/node/pull/1763) + +## 2015-05-24, Version 2.1.0, @rvagg + +### Notable changes + +* **crypto**: Diffie-Hellman key exchange (DHE) parameters (`'dhparams'`) must now be 1024 bits or longer or an error will be thrown. A warning will also be printed to the console if you supply less than 2048 bits. See https://weakdh.org/ for further context on this security concern. (Shigeki Ohtsu) [#1739](https://github.com/nodejs/node/pull/1739). +* **node**: A new `--trace-sync-io` command line flag will print a warning and a stack trace whenever a synchronous API is used. This can be used to track down synchronous calls that may be slowing down an application. (Trevor Norris) [#1707](https://github.com/nodejs/node/pull/1707). +* **node**: To allow for chaining of methods, the `setTimeout()`, `setKeepAlive()`, `setNoDelay()`, `ref()` and `unref()` methods used in `'net'`, `'dgram'`, `'http'`, `'https'` and `'tls'` now return the current instance instead of `undefined` (Roman Reiss & Evan Lucas) [#1699](https://github.com/nodejs/node/pull/1699) [#1768](https://github.com/nodejs/node/pull/1768) [#1779](https://github.com/nodejs/node/pull/1779). +* **npm**: Upgraded to v2.10.1, release notes can be found in and . +* **util**: A significant speed-up (in the order of 35%) for the common-case of a single string argument to `util.format()`, used by `console.log()` (Сковорода Никита Андреевич) [#1749](https://github.com/nodejs/node/pull/1749). + +### Known issues + +See https://github.com/nodejs/node/labels/confirmed-bug for complete and current list of known issues. + +* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/node/issues/1264). +* Surrogate pair in REPL can freeze terminal [#690](https://github.com/nodejs/node/issues/690) +* `process.send()` is not synchronous as the docs suggest, a regression introduced in 1.0.2, see [#760](https://github.com/nodejs/node/issues/760) and fix in [#774](https://github.com/nodejs/node/issues/774) +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion [#894](https://github.com/nodejs/node/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). + +### Commits + +* [[`9da168b71f`](https://github.com/nodejs/node/commit/9da168b71f)] - **buffer**: optimize Buffer.byteLength (Brendan Ashworth) [#1713](https://github.com/nodejs/node/pull/1713) +* [[`2b1c01c2cc`](https://github.com/nodejs/node/commit/2b1c01c2cc)] - **build**: refactor pkg-config for shared libraries (Johan Bergström) [#1603](https://github.com/nodejs/node/pull/1603) +* [[`3c44100558`](https://github.com/nodejs/node/commit/3c44100558)] - **core**: set PROVIDER type as Persistent class id (Trevor Norris) [#1730](https://github.com/nodejs/node/pull/1730) +* [[`c1de6d249e`](https://github.com/nodejs/node/commit/c1de6d249e)] - **(SEMVER-MINOR)** **core**: implement runtime flag to trace sync io (Trevor Norris) [#1707](https://github.com/nodejs/node/pull/1707) +* [[`9e7099fa4e`](https://github.com/nodejs/node/commit/9e7099fa4e)] - **deps**: make node-gyp work with io.js (cjihrig) [iojs/io.js#990](https://github.com/iojs/io.js/pull/990) +* [[`c54d057598`](https://github.com/nodejs/node/commit/c54d057598)] - **deps**: upgrade to npm 2.10.1 (Rebecca Turner) [#1763](https://github.com/nodejs/node/pull/1763) +* [[`367ffd167d`](https://github.com/nodejs/node/commit/367ffd167d)] - **doc**: update AUTHORS list (Rod Vagg) [#1776](https://github.com/nodejs/node/pull/1776) +* [[`2bb2f06b3e`](https://github.com/nodejs/node/commit/2bb2f06b3e)] - **doc**: fix typo in CONTRIBUTING.md (Rich Trott) [#1755](https://github.com/nodejs/node/pull/1755) +* [[`515afc6367`](https://github.com/nodejs/node/commit/515afc6367)] - **doc**: path is ignored in url.format (Maurice Butler) [#1753](https://github.com/nodejs/node/pull/1753) +* [[`f0a8bc3f84`](https://github.com/nodejs/node/commit/f0a8bc3f84)] - **doc**: fix spelling in CHANGELOG (Felipe Batista) +* [[`86dd244d9b`](https://github.com/nodejs/node/commit/86dd244d9b)] - **doc**: add notes to child_process.fork() and .exec() (Rich Trott) [#1718](https://github.com/nodejs/node/pull/1718) +* [[`066274794c`](https://github.com/nodejs/node/commit/066274794c)] - **doc**: update links from iojs/io.js to nodejs/io.js (Frederic Hemberger) [#1715](https://github.com/nodejs/node/pull/1715) +* [[`cb381fe3e0`](https://github.com/nodejs/node/commit/cb381fe3e0)] - **(SEMVER-MINOR)** **net**: return this from setNoDelay and setKeepAlive (Roman Reiss) [#1779](https://github.com/nodejs/node/pull/1779) +* [[`85d9983009`](https://github.com/nodejs/node/commit/85d9983009)] - **net**: persist net.Socket options before connect (Evan Lucas) [#1518](https://github.com/nodejs/node/pull/1518) +* [[`39dde3222e`](https://github.com/nodejs/node/commit/39dde3222e)] - **(SEMVER-MINOR)** **net,dgram**: return this from ref and unref methods (Roman Reiss) [#1768](https://github.com/nodejs/node/pull/1768) +* [[`5773438913`](https://github.com/nodejs/node/commit/5773438913)] - **test**: fix jslint error (Michaël Zasso) [#1743](https://github.com/nodejs/node/pull/1743) +* [[`867631986f`](https://github.com/nodejs/node/commit/867631986f)] - **test**: fix test-sync-io-option (Santiago Gimeno) [#1734](https://github.com/nodejs/node/pull/1734) +* [[`f29762f4dd`](https://github.com/nodejs/node/commit/f29762f4dd)] - **test**: enable linting for tests (Roman Reiss) [#1721](https://github.com/nodejs/node/pull/1721) +* [[`2a71f02988`](https://github.com/nodejs/node/commit/2a71f02988)] - **tls**: emit errors happening before handshake finish (Malte-Thorben Bruns) [#1769](https://github.com/nodejs/node/pull/1769) +* [[`80342f649d`](https://github.com/nodejs/node/commit/80342f649d)] - **tls**: use `.destroy(err)` instead of destroy+emit (Fedor Indutny) [#1711](https://github.com/nodejs/node/pull/1711) +* [[`9b35be5810`](https://github.com/nodejs/node/commit/9b35be5810)] - **tls**: make server not use DHE in less than 1024bits (Shigeki Ohtsu) [#1739](https://github.com/nodejs/node/pull/1739) +* [[`214d02040e`](https://github.com/nodejs/node/commit/214d02040e)] - **util**: speed up common case of formatting string (Сковорода Никита Андреевич) [#1749](https://github.com/nodejs/node/pull/1749) +* [[`d144e96fbf`](https://github.com/nodejs/node/commit/d144e96fbf)] - **win,node-gyp**: enable delay-load hook by default (Bert Belder) [#1763](https://github.com/nodejs/node/pull/1763) +* [[`0d6d3dda95`](https://github.com/nodejs/node/commit/0d6d3dda95)] - **win,node-gyp**: make delay-load hook C89 compliant (Sharat M R) [TooTallNate/node-gyp#616](https://github.com/TooTallNate/node-gyp/pull/616) + +## 2015-05-22, Version 0.12.4 (Stable) + +### Commits + +* [[`202c18bbc3`](https://github.com/nodejs/node/commit/202c18bbc3)] - **npm**: upgrade to 2.10.1 [#25364](https://github.com/joyent/node/pull/25364) +* [[`6157697bd5`](https://github.com/nodejs/node/commit/6157697bd5)] - **V8**: revert v8 Array.prototype.values() removal (cjihrig) [#25328](https://github.com/joyent/node/pull/25328) +* [[`3122052890`](https://github.com/nodejs/node/commit/3122052890)] - **win**: bring back xp/2k3 support (Bert Belder) [#25367](https://github.com/joyent/node/pull/25367) + +## 2015-05-15, Version 2.0.2, @Fishrock123 + +### Notable changes + +* **win,node-gyp**: the delay-load hook for windows addons has now been correctly enabled by default, it had wrongly defaulted to off in the release version of 2.0.0 (Bert Belder) [#1433](https://github.com/nodejs/node/pull/1433) +* **os**: `tmpdir()`'s trailing slash stripping has been refined to fix an issue when the temp directory is at '/'. Also considers which slash is used by the operating system. (cjihrig) [#1673](https://github.com/nodejs/node/pull/1673) +* **tls**: default ciphers have been updated to use gcm and aes128 (Mike MacCana) [#1660](https://github.com/nodejs/node/pull/1660) +* **build**: v8 snapshots have been re-enabled by default as suggested by the v8 team, since prior security issues have been resolved. This should give some perf improvements to both startup and vm context creation. (Trevor Norris) [#1663](https://github.com/nodejs/node/pull/1663) +* **src**: fixed preload modules not working when other flags were used before `--require` (Yosuke Furukawa) [#1694](https://github.com/nodejs/node/pull/1694) +* **dgram**: fixed `send()`'s callback not being asynchronous (Yosuke Furukawa) [#1313](https://github.com/nodejs/node/pull/1313) +* **readline**: emitKeys now keeps buffering data until it has enough to parse. This fixes an issue with parsing split escapes. (Alex Kocharin) [#1601](https://github.com/nodejs/node/pull/1601) +* **cluster**: works now properly emit 'disconnect' to `cluser.worker` (Oleg Elifantiev) [#1386](https://github.com/nodejs/node/pull/1386) +* **events**: uncaught errors now provide some context (Evan Lucas) [#1654](https://github.com/nodejs/node/pull/1654) + +### Known issues + +See https://github.com/nodejs/node/labels/confirmed-bug for complete and current list of known issues. + +* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/node/issues/1264). +* Surrogate pair in REPL can freeze terminal [#690](https://github.com/nodejs/node/issues/690) +* `process.send()` is not synchronous as the docs suggest, a regression introduced in 1.0.2, see [#760](https://github.com/nodejs/node/issues/760) and fix in [#774](https://github.com/nodejs/node/issues/774) +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion [#894](https://github.com/nodejs/node/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). + +### Commits + +* [[`8a0e5295b4`](https://github.com/nodejs/node/commit/8a0e5295b4)] - **build**: use backslashes for paths on windows (Johan Bergström) [#1698](https://github.com/nodejs/node/pull/1698) +* [[`20c9a52227`](https://github.com/nodejs/node/commit/20c9a52227)] - **build**: move --with-intl to intl optgroup (Johan Bergström) [#1680](https://github.com/nodejs/node/pull/1680) +* [[`36cdc7c8ac`](https://github.com/nodejs/node/commit/36cdc7c8ac)] - **build**: re-enable V8 snapshots (Trevor Norris) [#1663](https://github.com/nodejs/node/pull/1663) +* [[`5883a59b21`](https://github.com/nodejs/node/commit/5883a59b21)] - **cluster**: disconnect event not emitted correctly (Oleg Elifantiev) [#1386](https://github.com/nodejs/node/pull/1386) +* [[`0f850f7ae7`](https://github.com/nodejs/node/commit/0f850f7ae7)] - **deps**: provide TXT chunk info in c-ares (Fedor Indutny) +* [[`7e1c0e75ed`](https://github.com/nodejs/node/commit/7e1c0e75ed)] - **deps**: sync with upstream bagder/c-ares@bba4dc5 (Ben Noordhuis) [#1678](https://github.com/nodejs/node/pull/1678) +* [[`18d457bd34`](https://github.com/nodejs/node/commit/18d457bd34)] - **dgram**: call send callback asynchronously (Yosuke Furukawa) [#1313](https://github.com/nodejs/node/pull/1313) +* [[`8b9a1537ad`](https://github.com/nodejs/node/commit/8b9a1537ad)] - **events**: provide better error message for unhandled error (Evan Lucas) [#1654](https://github.com/nodejs/node/pull/1654) +* [[`19ffb5cf1c`](https://github.com/nodejs/node/commit/19ffb5cf1c)] - **lib**: fix eslint styles (Yosuke Furukawa) [#1539](https://github.com/nodejs/node/pull/1539) +* [[`76937051f8`](https://github.com/nodejs/node/commit/76937051f8)] - **os**: refine tmpdir() trailing slash stripping (cjihrig) [#1673](https://github.com/nodejs/node/pull/1673) +* [[`aed6bce906`](https://github.com/nodejs/node/commit/aed6bce906)] - **readline**: turn emitKeys into a streaming parser (Alex Kocharin) [#1601](https://github.com/nodejs/node/pull/1601) +* [[`0a461e5360`](https://github.com/nodejs/node/commit/0a461e5360)] - **src**: fix preload when used with prior flags (Yosuke Furukawa) [#1694](https://github.com/nodejs/node/pull/1694) +* [[`931a0d4634`](https://github.com/nodejs/node/commit/931a0d4634)] - **src**: add type check to v8.setFlagsFromString() (Roman Klauke) [#1652](https://github.com/nodejs/node/pull/1652) +* [[`08d08668c9`](https://github.com/nodejs/node/commit/08d08668c9)] - **src,deps**: replace LoadLibrary by LoadLibraryW (Cheng Zhao) [#226](https://github.com/nodejs/node/pull/226) +* [[`4e2f999a62`](https://github.com/nodejs/node/commit/4e2f999a62)] - **test**: fix infinite loop detection (Yosuke Furukawa) [#1681](https://github.com/nodejs/node/pull/1681) +* [[`5755fc099f`](https://github.com/nodejs/node/commit/5755fc099f)] - **tls**: update default ciphers to use gcm and aes128 (Mike MacCana) [#1660](https://github.com/nodejs/node/pull/1660) +* [[`966acb9916`](https://github.com/nodejs/node/commit/966acb9916)] - **tools**: remove closure_linter to eslint on windows (Yosuke Furukawa) [#1685](https://github.com/nodejs/node/pull/1685) +* [[`c58264e58b`](https://github.com/nodejs/node/commit/c58264e58b)] - **tools**: make eslint work on subdirectories (Roman Reiss) [#1686](https://github.com/nodejs/node/pull/1686) +* [[`0b21ab13b7`](https://github.com/nodejs/node/commit/0b21ab13b7)] - **tools**: refactor `make test-npm` into test-npm.sh (Jeremiah Senkpiel) [#1662](https://github.com/nodejs/node/pull/1662) +* [[`f07b3b600b`](https://github.com/nodejs/node/commit/f07b3b600b)] - **tools**: set eslint comma-spacing to 'warn' (Roman Reiss) [#1672](https://github.com/nodejs/node/pull/1672) +* [[`f9dd34d301`](https://github.com/nodejs/node/commit/f9dd34d301)] - **tools**: replace closure-linter with eslint (Yosuke Furukawa) [#1539](https://github.com/nodejs/node/pull/1539) +* [[`64d3210c98`](https://github.com/nodejs/node/commit/64d3210c98)] - **win,node-gyp**: enable delay-load hook by default (Bert Belder) [#1667](https://github.com/nodejs/node/issues/1667) + +## 2015-05-13, Version 0.12.3 (Stable) + +### Commits + +* [[`32166a90cf`](https://github.com/nodejs/node/commit/32166a90cf)] - **V8**: update to 3.28.71.19 [#18206](https://github.com/joyent/node/pull/18206) +* [[`84f1ab6114`](https://github.com/nodejs/node/commit/84f1ab6114)] - **uv**: upgrade to 1.5.0 [#25141](https://github.com/joyent/node/pull/25141) +* [[`03cfbd65fb`](https://github.com/nodejs/node/commit/03cfbd65fb)] - **npm**: upgrade to 2.9.1 [#25289](https://github.com/joyent/node/pull/25289) +* [[`80cdae855f`](https://github.com/nodejs/node/commit/80cdae855f)] - **V8**: don't busy loop in v8 cpu profiler thread (Mike Tunnicliffe) [#25268](https://github.com/joyent/node/pull/25268) +* [[`2a5f4bd7ce`](https://github.com/nodejs/node/commit/2a5f4bd7ce)] - **V8**: fix issue with let bindings in for loops (adamk) [#23948](https://github.com/joyent/node/pull/23948) +* [[`f0ef597e09`](https://github.com/nodejs/node/commit/f0ef597e09)] - **debugger**: don't spawn child process in remote mode (Jackson Tian) [#14172](https://github.com/joyent/node/pull/14172) +* [[`0e392f3b68`](https://github.com/nodejs/node/commit/0e392f3b68)] - **net**: do not set V4MAPPED on FreeBSD (Julien Gilli) [#18204](https://github.com/joyent/node/pull/18204) +* [[`101e103e3b`](https://github.com/nodejs/node/commit/101e103e3b)] - **repl**: make 'Unexpected token' errors recoverable (Julien Gilli) [#8875](https://github.com/joyent/node/pull/8875) +* [[`d5b32246fb`](https://github.com/nodejs/node/commit/d5b32246fb)] - **src**: backport ignore ENOTCONN on shutdown race (Ben Noordhuis) [#14480](https://github.com/joyent/node/pull/14480) +* [[`f99eaefe75`](https://github.com/nodejs/node/commit/f99eaefe75)] - **src**: fix backport of SIGINT crash fix on FreeBSD (Julien Gilli) [#14819](https://github.com/joyent/node/pull/14819) + +## 2015-05-07, Version 2.0.1, @rvagg + +### Notable changes + +* **async_wrap**: (Trevor Norris) [#1614](https://github.com/nodejs/node/pull/1614) + - it is now possible to filter by providers + - bit flags have been removed and replaced with method calls on the binding object + - _note that this is an unstable API so feature additions and breaking changes won't change io.js semver_ +* **libuv**: resolves numerous io.js issues: + - [#862](https://github.com/nodejs/node/issues/862) prevent spawning child processes with invalid stdio file descriptors + - [#1397](https://github.com/nodejs/node/issues/1397) fix EPERM error with fs.access(W_OK) on Windows + - [#1621](https://github.com/nodejs/node/issues/1621) build errors associated with the bundled libuv + - [#1512](https://github.com/nodejs/node/issues/1512) should properly fix Windows termination errors +* **addons**: the `NODE_DEPRECATED` macro was causing problems when compiling addons with older compilers, this should now be resolved (Ben Noordhuis) [#1626](https://github.com/nodejs/node/pull/1626) +* **V8**: upgrade V8 from 4.2.77.18 to 4.2.77.20 with minor fixes, including a bug preventing builds on FreeBSD + +### Known issues + +See https://github.com/nodejs/node/labels/confirmed-bug for complete and current list of known issues. + +* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/node/issues/1264). +* Surrogate pair in REPL can freeze terminal [#690](https://github.com/nodejs/node/issues/690) +* `process.send()` is not synchronous as the docs suggest, a regression introduced in 1.0.2, see [#760](https://github.com/nodejs/node/issues/760) and fix in [#774](https://github.com/nodejs/node/issues/774) +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion [#894](https://github.com/nodejs/node/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). +* readline: split escapes are processed incorrectly, see [#1403](https://github.com/nodejs/node/issues/1403) + +### Commits + +* [[`7dde95a8bd`](https://github.com/nodejs/node/commit/7dde95a8bd)] - **async-wrap**: remove before/after calls in init (Trevor Norris) [#1614](https://github.com/nodejs/node/pull/1614) +* [[`bd42ba056a`](https://github.com/nodejs/node/commit/bd42ba056a)] - **async-wrap**: set flags using functions (Trevor Norris) [#1614](https://github.com/nodejs/node/pull/1614) +* [[`4b2c786449`](https://github.com/nodejs/node/commit/4b2c786449)] - **async-wrap**: pass PROVIDER as first arg to init (Trevor Norris) [#1614](https://github.com/nodejs/node/pull/1614) +* [[`84bf609fd2`](https://github.com/nodejs/node/commit/84bf609fd2)] - **async-wrap**: don't call init callback unnecessarily (Trevor Norris) [#1614](https://github.com/nodejs/node/pull/1614) +* [[`04cc03b029`](https://github.com/nodejs/node/commit/04cc03b029)] - **deps**: update libuv to 1.5.0 (Saúl Ibarra Corretgé) [#1646](https://github.com/nodejs/node/pull/1646) +* [[`b16d9c28e8`](https://github.com/nodejs/node/commit/b16d9c28e8)] - **deps**: upgrade v8 to 4.2.77.20 (Ben Noordhuis) [#1639](https://github.com/nodejs/node/pull/1639) +* [[`9ec3109272`](https://github.com/nodejs/node/commit/9ec3109272)] - **doc**: add TC meeting 2015-04-29 minutes (Rod Vagg) [#1585](https://github.com/nodejs/node/pull/1585) +* [[`2c7206254c`](https://github.com/nodejs/node/commit/2c7206254c)] - **doc**: fix typo in readme.md (AQNOUCH Mohammed) [#1643](https://github.com/nodejs/node/pull/1643) +* [[`71dc7152ee`](https://github.com/nodejs/node/commit/71dc7152ee)] - **doc**: fix PR link in CHANGELOG (Brian White) [#1624](https://github.com/nodejs/node/pull/1624) +* [[`b97b96d05a`](https://github.com/nodejs/node/commit/b97b96d05a)] - **install**: fix NameError (thefourtheye) [#1628](https://github.com/nodejs/node/pull/1628) +* [[`6ccbe75384`](https://github.com/nodejs/node/commit/6ccbe75384)] - **js_stream**: fix buffer index in DoWrite (Shigeki Ohtsu) [#1635](https://github.com/nodejs/node/pull/1635) +* [[`c43855c49c`](https://github.com/nodejs/node/commit/c43855c49c)] - **src**: export the ParseEncoding function on Windows (Ivan Kozik) [#1596](https://github.com/nodejs/node/pull/1596) +* [[`8315b22390`](https://github.com/nodejs/node/commit/8315b22390)] - **src**: fix pedantic cpplint whitespace warnings (Ben Noordhuis) [#1640](https://github.com/nodejs/node/pull/1640) +* [[`b712af79a7`](https://github.com/nodejs/node/commit/b712af79a7)] - **src**: fix NODE_DEPRECATED macro with old compilers (Ben Noordhuis) [#1626](https://github.com/nodejs/node/pull/1626) +* [[`2ed10f1349`](https://github.com/nodejs/node/commit/2ed10f1349)] - **src**: fix minor inefficiency in Buffer::New() call (Ben Noordhuis) [#1577](https://github.com/nodejs/node/pull/1577) +* [[`f696c9efab`](https://github.com/nodejs/node/commit/f696c9efab)] - **src**: fix deprecated use of Buffer::New() (Ben Noordhuis) [#1577](https://github.com/nodejs/node/pull/1577) +* [[`0c8f13df8f`](https://github.com/nodejs/node/commit/0c8f13df8f)] - **tools**: remove unused GuessWordSize function (thefourtheye) [#1638](https://github.com/nodejs/node/pull/1638) + +## 2015-05-04, Version 2.0.0, @rvagg + +### Breaking changes + +Full details at https://github.com/nodejs/node/wiki/Breaking-Changes#200-from-1x + +* V8 upgrade to 4.2, minor changes to C++ API +* `os.tmpdir()` is now cross-platform consistent and no longer returns a path with a trailing slash on any platform +* While not a *breaking change* the 'smalloc' module has been deprecated in anticipation of it becoming unsupportable with a future upgrade to V8 4.4. See [#1451](https://github.com/nodejs/node/issues/1451) for further information. + +_Note: a new version of the 'url' module was reverted prior to release as it was decided the potential for breakage across the npm ecosystem was too great and that more compatibility work needed to be done before releasing it. See [#1602](https://github.com/nodejs/node/pull/1602) for further information._ + +### Notable changes + +* **crypto**: significantly reduced memory usage for TLS (Fedor Indutny & Сковорода Никита Андреевич) [#1529](https://github.com/nodejs/node/pull/1529) +* **net**: `socket.connect()` now accepts a `'lookup'` option for a custom DNS resolution mechanism, defaults to `dns.lookup()` (Evan Lucas) [#1505](https://github.com/nodejs/node/pull/1505) +* **npm**: Upgrade npm to 2.9.0. See the [v2.8.4](https://github.com/npm/npm/releases/tag/v2.8.4) and [v2.9.0](https://github.com/npm/npm/releases/tag/v2.9.0) release notes for details. Notable items: + - Add support for default author field to make `npm init -y` work without user-input (@othiym23) [npm/npm/d8eee6cf9d](https://github.com/npm/npm/commit/d8eee6cf9d2ff7aca68dfaed2de76824a3e0d9af) + - Include local modules in `npm outdated` and `npm update` (@ArnaudRinquin) [npm/npm#7426](https://github.com/npm/npm/issues/7426) + - The prefix used before the version number on `npm version` is now configurable via `tag-version-prefix` (@kkragenbrink) [npm/npm#8014](https://github.com/npm/npm/issues/8014) +* **os**: `os.tmpdir()` is now cross-platform consistent and will no longer returns a path with a trailing slash on any platform (Christian Tellnes) [#747](https://github.com/nodejs/node/pull/747) +* **process**: + - `process.nextTick()` performance has been improved by between 2-42% across the benchmark suite, notable because this is heavily used across core (Brian White) [#1571](https://github.com/nodejs/node/pull/1571) + - New `process.geteuid()`, `process.seteuid(id)`, `process.getegid()` and `process.setegid(id)` methods allow you to get and set effective UID and GID of the process (Evan Lucas) [#1536](https://github.com/nodejs/node/pull/1536) +* **repl**: + - REPL history can be persisted across sessions if the `NODE_REPL_HISTORY_FILE` environment variable is set to a user accessible file, `NODE_REPL_HISTORY_SIZE` can set the maximum history size and defaults to `1000` (Chris Dickinson) [#1513](https://github.com/nodejs/node/pull/1513) + - The REPL can be placed in to one of three modes using the `NODE_REPL_MODE` environment variable: `sloppy`, `strict` or `magic` (default); the new `magic` mode will automatically run "strict mode only" statements in strict mode (Chris Dickinson) [#1513](https://github.com/nodejs/node/pull/1513) +* **smalloc**: the 'smalloc' module has been deprecated due to changes coming in V8 4.4 that will render it unusable +* **util**: add Promise, Map and Set inspection support (Christopher Monsanto) [#1471](https://github.com/nodejs/node/pull/1471) +* **V8**: upgrade to 4.2.77.18, see the [ChangeLog](https://chromium.googlesource.com/v8/v8/+/refs/heads/4.2.77/ChangeLog) for full details. Notable items: + - Classes have moved out of staging; the `class` keyword is now usable in strict mode without flags + - Object literal enhancements have moved out of staging; shorthand method and property syntax is now usable (`{ method() { }, property }`) + - Rest parameters (`function(...args) {}`) are implemented in staging behind the `--harmony-rest-parameters` flag + - Computed property names (`{['foo'+'bar']:'bam'}`) are implemented in staging behind the `--harmony-computed-property-names` flag + - Unicode escapes (`'\u{xxxx}'`) are implemented in staging behind the `--harmony_unicode` flag and the `--harmony_unicode_regexps` flag for use in regular expressions +* **Windows**: + - Random process termination on Windows fixed (Fedor Indutny) [#1512](https://github.com/nodejs/node/issues/1512) / [#1563](https://github.com/nodejs/node/pull/1563) + - The delay-load hook introduced to fix issues with process naming (iojs.exe / node.exe) has been made opt-out for native add-ons. Native add-ons should include `'win_delay_load_hook': 'false'` in their binding.gyp to disable this feature if they experience problems . (Bert Belder) [#1433](https://github.com/nodejs/node/pull/1433) +* **Governance**: + - Rod Vagg (@rvagg) was added to the Technical Committee (TC) + - Jeremiah Senkpiel (@Fishrock123) was added to the Technical Committee (TC) + +### Known issues + +See https://github.com/nodejs/node/labels/confirmed-bug for complete and current list of known issues. + +* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/node/issues/1264). +* Surrogate pair in REPL can freeze terminal [#690](https://github.com/nodejs/node/issues/690) +* `process.send()` is not synchronous as the docs suggest, a regression introduced in 1.0.2, see [#760](https://github.com/nodejs/node/issues/760) and fix in [#774](https://github.com/nodejs/node/issues/774) +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion [#894](https://github.com/nodejs/node/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). +* readline: split escapes are processed incorrectly, see [#1403](https://github.com/nodejs/node/issues/1403) + +### Commits + +* [[`5404cbc745`](https://github.com/nodejs/node/commit/5404cbc745)] - **buffer**: fix copy() segfault with zero arguments (Trevor Norris) [#1520](https://github.com/nodejs/node/pull/1520) +* [[`3d3083b91f`](https://github.com/nodejs/node/commit/3d3083b91f)] - **buffer**: little improve for Buffer.concat method (Jackson Tian) [#1437](https://github.com/nodejs/node/pull/1437) +* [[`e67542ae17`](https://github.com/nodejs/node/commit/e67542ae17)] - **build**: disable -Og when building with clang (Ben Noordhuis) [#1609](https://github.com/nodejs/node/pull/1609) +* [[`78f4b038f8`](https://github.com/nodejs/node/commit/78f4b038f8)] - **build**: turn on debug-safe optimizations with -Og (Ben Noordhuis) [#1569](https://github.com/nodejs/node/pull/1569) +* [[`a5dcff827a`](https://github.com/nodejs/node/commit/a5dcff827a)] - **build**: Use option groups in configure output (Johan Bergström) [#1533](https://github.com/nodejs/node/pull/1533) +* [[`2a3c8c187e`](https://github.com/nodejs/node/commit/2a3c8c187e)] - **build**: remove -J from test-ci (Rod Vagg) [#1544](https://github.com/nodejs/node/pull/1544) +* [[`e6874dd0f9`](https://github.com/nodejs/node/commit/e6874dd0f9)] - **crypto**: track external memory for SSL structures (Fedor Indutny) [#1529](https://github.com/nodejs/node/pull/1529) +* [[`935c9d3fa7`](https://github.com/nodejs/node/commit/935c9d3fa7)] - **deps**: make node-gyp work with io.js (cjihrig) [#990](https://github.com/nodejs/node/pull/990) +* [[`56e4255382`](https://github.com/nodejs/node/commit/56e4255382)] - **deps**: upgrade npm to 2.9.0 (Forrest L Norvell) [#1573](https://github.com/nodejs/node/pull/1573) +* [[`509b59ea7c`](https://github.com/nodejs/node/commit/509b59ea7c)] - **deps**: enable v8 postmortem debugging again (Ben Noordhuis) [#1232](https://github.com/nodejs/node/pull/1232) +* [[`01652c7709`](https://github.com/nodejs/node/commit/01652c7709)] - **deps**: upgrade v8 to 4.2.77.18 (Chris Dickinson) [#1506](https://github.com/nodejs/node/pull/1506) +* [[`01e6632d70`](https://github.com/nodejs/node/commit/01e6632d70)] - **deps**: upgrade v8 to 4.2.77.15 (Ben Noordhuis) [#1399](https://github.com/nodejs/node/pull/1399) +* [[`db4ded5903`](https://github.com/nodejs/node/commit/db4ded5903)] - **deps**: enable v8 postmortem debugging again (Ben Noordhuis) [#1232](https://github.com/nodejs/node/pull/1232) +* [[`36cd5fb9d2`](https://github.com/nodejs/node/commit/36cd5fb9d2)] - **(SEMVER-MAJOR)** **deps**: upgrade v8 to 4.2.77.13 (Ben Noordhuis) [#1232](https://github.com/nodejs/node/pull/1232) +* [[`b3a7da1091`](https://github.com/nodejs/node/commit/b3a7da1091)] - **deps**: update http_parser to 2.5.0 (Fedor Indutny) [#1517](https://github.com/nodejs/node/pull/1517) +* [[`ac1fb39ce8`](https://github.com/nodejs/node/commit/ac1fb39ce8)] - **doc**: add rvagg to the TC (Rod Vagg) [#1613](https://github.com/nodejs/node/pull/1613) +* [[`dacc1fa35c`](https://github.com/nodejs/node/commit/dacc1fa35c)] - **doc**: update AUTHORS list (Rod Vagg) [#1586](https://github.com/nodejs/node/pull/1586) +* [[`2a3a1909ab`](https://github.com/nodejs/node/commit/2a3a1909ab)] - **doc**: add require() lines to child.stdio example (Nick Raienko) [#1504](https://github.com/nodejs/node/pull/1504) +* [[`02388dbf40`](https://github.com/nodejs/node/commit/02388dbf40)] - **doc**: fix some cross-references (Alexander Gromnitsky) [#1584](https://github.com/nodejs/node/pull/1584) +* [[`57c4cc26e2`](https://github.com/nodejs/node/commit/57c4cc26e2)] - **doc**: add TC meeting 2015-04-22 minutes (Rod Vagg) [#1556](https://github.com/nodejs/node/pull/1556) +* [[`b4ad5d7050`](https://github.com/nodejs/node/commit/b4ad5d7050)] - **doc**: improve http.request and https.request opts (Roman Reiss) [#1551](https://github.com/nodejs/node/pull/1551) +* [[`7dc8eec0a6`](https://github.com/nodejs/node/commit/7dc8eec0a6)] - **doc**: deprecate smalloc module (Ben Noordhuis) [#1566](https://github.com/nodejs/node/pull/1566) +* [[`1bcdf46ca7`](https://github.com/nodejs/node/commit/1bcdf46ca7)] - **doc**: add TC meeting 2015-04-15 minutes (Rod Vagg) [#1498](https://github.com/nodejs/node/pull/1498) +* [[`391cae3595`](https://github.com/nodejs/node/commit/391cae3595)] - **doc**: Add Known issues to v1.7.0/1.7.1 CHANGELOG (Yosuke Furukawa) [#1473](https://github.com/nodejs/node/pull/1473) +* [[`e55fdc47a7`](https://github.com/nodejs/node/commit/e55fdc47a7)] - **doc**: fix util.deprecate example (Nick Raienko) [#1535](https://github.com/nodejs/node/pull/1535) +* [[`5178f93bc0`](https://github.com/nodejs/node/commit/5178f93bc0)] - **doc**: Add Addon API (NAN) to working group list (Julian Duque) [#1523](https://github.com/nodejs/node/pull/1523) +* [[`f3cc50f811`](https://github.com/nodejs/node/commit/f3cc50f811)] - **doc**: add TC meeting 2015-04-08 minutes (Rod Vagg) [#1497](https://github.com/nodejs/node/pull/1497) +* [[`bb254b533b`](https://github.com/nodejs/node/commit/bb254b533b)] - **doc**: update branch to master (Roman Reiss) [#1511](https://github.com/nodejs/node/pull/1511) +* [[`22aafa5597`](https://github.com/nodejs/node/commit/22aafa5597)] - **doc**: add Fishrock123 to the TC (Jeremiah Senkpiel) [#1507](https://github.com/nodejs/node/pull/1507) +* [[`b16a328ede`](https://github.com/nodejs/node/commit/b16a328ede)] - **doc**: add spaces to child.kill example (Nick Raienko) [#1503](https://github.com/nodejs/node/pull/1503) +* [[`26327757f8`](https://github.com/nodejs/node/commit/26327757f8)] - **doc**: update AUTHORS list (Rod Vagg) [#1476](https://github.com/nodejs/node/pull/1476) +* [[`f9c681cf62`](https://github.com/nodejs/node/commit/f9c681cf62)] - **fs**: validate fd on fs.write (Julian Duque) [#1553](https://github.com/nodejs/node/pull/1553) +* [[`801b47acc5`](https://github.com/nodejs/node/commit/801b47acc5)] - **gitignore**: ignore xcode workspaces and projects (Roman Klauke) [#1562](https://github.com/nodejs/node/pull/1562) +* [[`d5ce47e433`](https://github.com/nodejs/node/commit/d5ce47e433)] - **(SEMVER-MINOR)** **lib**: deprecate the smalloc module (Ben Noordhuis) [#1564](https://github.com/nodejs/node/pull/1564) +* [[`7384ca83f9`](https://github.com/nodejs/node/commit/7384ca83f9)] - **module**: remove '' from Module.globalPaths (Chris Yip) [#1488](https://github.com/nodejs/node/pull/1488) +* [[`b4f5898395`](https://github.com/nodejs/node/commit/b4f5898395)] - **net**: ensure Write/ShutdownWrap references handle (Fedor Indutny) [#1590](https://github.com/nodejs/node/pull/1590) +* [[`4abe2fa1cf`](https://github.com/nodejs/node/commit/4abe2fa1cf)] - **(SEMVER-MINOR)** **net**: add lookup option to Socket.prototype.connect (Evan Lucas) [#1505](https://github.com/nodejs/node/pull/1505) +* [[`1bef717476`](https://github.com/nodejs/node/commit/1bef717476)] - **(SEMVER-MINOR)** **net**: cleanup connect logic (Evan Lucas) [#1505](https://github.com/nodejs/node/pull/1505) +* [[`c7782c0af8`](https://github.com/nodejs/node/commit/c7782c0af8)] - **node**: improve nextTick performance (Brian White) [#1571](https://github.com/nodejs/node/pull/1571) +* [[`b57cc51d8d`](https://github.com/nodejs/node/commit/b57cc51d8d)] - **(SEMVER-MAJOR)** **os**: remove trailing slash from os.tmpdir() (Christian Tellnes) [#747](https://github.com/nodejs/node/pull/747) +* [[`ca219b00d1`](https://github.com/nodejs/node/commit/ca219b00d1)] - **repl**: fix for a+ fd clearing the file on read (Chris Dickinson) [#1605](https://github.com/nodejs/node/pull/1605) +* [[`051d482b15`](https://github.com/nodejs/node/commit/051d482b15)] - **repl**: fix \_debugger by properly proxying repl (Chris Dickinson) [#1605](https://github.com/nodejs/node/pull/1605) +* [[`2e2fce0502`](https://github.com/nodejs/node/commit/2e2fce0502)] - **repl**: fix persistent history and env variable name (Roman Reiss) [#1593](https://github.com/nodejs/node/pull/1593) +* [[`ea5195ccaf`](https://github.com/nodejs/node/commit/ea5195ccaf)] - **repl**: do not save history for non-terminal repl (Fedor Indutny) [#1575](https://github.com/nodejs/node/pull/1575) +* [[`0450ce7db2`](https://github.com/nodejs/node/commit/0450ce7db2)] - **repl**: add mode detection, cli persistent history (Chris Dickinson) [#1513](https://github.com/nodejs/node/pull/1513) +* [[`af9fe3bbc7`](https://github.com/nodejs/node/commit/af9fe3bbc7)] - **(SEMVER-MAJOR)** **src**: bump NODE_MODULE_VERSION due to V8 API (Rod Vagg) [#1532](https://github.com/nodejs/node/pull/1532) +* [[`279f6116aa`](https://github.com/nodejs/node/commit/279f6116aa)] - **src**: fix -Wmissing-field-initializers warning (Ben Noordhuis) [#1606](https://github.com/nodejs/node/pull/1606) +* [[`73062521a4`](https://github.com/nodejs/node/commit/73062521a4)] - **src**: deprecate smalloc public functions (Ben Noordhuis) [#1565](https://github.com/nodejs/node/pull/1565) +* [[`ccb199af17`](https://github.com/nodejs/node/commit/ccb199af17)] - **src**: fix deprecation warnings (Ben Noordhuis) [#1565](https://github.com/nodejs/node/pull/1565) +* [[`609fa0de03`](https://github.com/nodejs/node/commit/609fa0de03)] - **src**: fix NODE_DEPRECATED macro (Ben Noordhuis) [#1565](https://github.com/nodejs/node/pull/1565) +* [[`3c92ca2b5c`](https://github.com/nodejs/node/commit/3c92ca2b5c)] - **(SEMVER-MINOR)** **src**: add ability to get/set effective uid/gid (Evan Lucas) [#1536](https://github.com/nodejs/node/pull/1536) +* [[`30b7349176`](https://github.com/nodejs/node/commit/30b7349176)] - **stream_base**: dispatch reqs in the stream impl (Fedor Indutny) [#1563](https://github.com/nodejs/node/pull/1563) +* [[`0fa6c4a6fc`](https://github.com/nodejs/node/commit/0fa6c4a6fc)] - **string_decoder**: don't cache Buffer.isEncoding (Brian White) [#1548](https://github.com/nodejs/node/pull/1548) +* [[`f9b226c1c1`](https://github.com/nodejs/node/commit/f9b226c1c1)] - **test**: extend timeouts for ARMv6 (Rod Vagg) [#1554](https://github.com/nodejs/node/pull/1554) +* [[`bfae8236b1`](https://github.com/nodejs/node/commit/bfae8236b1)] - **test**: fix test-net-dns-custom-lookup test assertion (Evan Lucas) [#1531](https://github.com/nodejs/node/pull/1531) +* [[`547213913b`](https://github.com/nodejs/node/commit/547213913b)] - **test**: adjust Makefile/test-ci, add to vcbuild.bat (Rod Vagg) [#1530](https://github.com/nodejs/node/pull/1530) +* [[`550c2638c0`](https://github.com/nodejs/node/commit/550c2638c0)] - **tls**: use `SSL_set_cert_cb` for async SNI/OCSP (Fedor Indutny) [#1464](https://github.com/nodejs/node/pull/1464) +* [[`1787416376`](https://github.com/nodejs/node/commit/1787416376)] - **tls**: destroy singleUse context immediately (Fedor Indutny) [#1529](https://github.com/nodejs/node/pull/1529) +* [[`2684c902c4`](https://github.com/nodejs/node/commit/2684c902c4)] - **tls**: zero SSL_CTX freelist for a singleUse socket (Fedor Indutny) [#1529](https://github.com/nodejs/node/pull/1529) +* [[`2d241b3b82`](https://github.com/nodejs/node/commit/2d241b3b82)] - **tls**: destroy SSL once it is out of use (Fedor Indutny) [#1529](https://github.com/nodejs/node/pull/1529) +* [[`f7620fb96d`](https://github.com/nodejs/node/commit/f7620fb96d)] - **tls_wrap**: Unlink TLSWrap and SecureContext objects (Сковорода Никита Андреевич) [#1580](https://github.com/nodejs/node/pull/1580) +* [[`a7d74633f2`](https://github.com/nodejs/node/commit/a7d74633f2)] - **tls_wrap**: use localhost if options.host is empty (Guilherme Souza) [#1493](https://github.com/nodejs/node/pull/1493) +* [[`702997c1f0`](https://github.com/nodejs/node/commit/702997c1f0)] - ***Revert*** "**url**: significantly improve the performance of the url module" (Rod Vagg) [#1602](https://github.com/nodejs/node/pull/1602) +* [[`0daed24883`](https://github.com/nodejs/node/commit/0daed24883)] - ***Revert*** "**url**: delete href cache on all setter code paths" (Rod Vagg) [#1602](https://github.com/nodejs/node/pull/1602) +* [[`0f39ef4ca1`](https://github.com/nodejs/node/commit/0f39ef4ca1)] - ***Revert*** "**url**: fix treatment of some values as non-empty" (Rod Vagg) [#1602](https://github.com/nodejs/node/pull/1602) +* [[`66877216bd`](https://github.com/nodejs/node/commit/66877216bd)] - **url**: fix treatment of some values as non-empty (Petka Antonov) [#1589](https://github.com/nodejs/node/pull/1589) +* [[`dbdd81a91b`](https://github.com/nodejs/node/commit/dbdd81a91b)] - **url**: delete href cache on all setter code paths (Petka Antonov) [#1589](https://github.com/nodejs/node/pull/1589) +* [[`3fd7fc429c`](https://github.com/nodejs/node/commit/3fd7fc429c)] - **url**: significantly improve the performance of the url module (Petka Antonov) [#1561](https://github.com/nodejs/node/pull/1561) +* [[`bf7ac08dd0`](https://github.com/nodejs/node/commit/bf7ac08dd0)] - **util**: add Map and Set inspection support (Christopher Monsanto) [#1471](https://github.com/nodejs/node/pull/1471) +* [[`30e83d2e84`](https://github.com/nodejs/node/commit/30e83d2e84)] - **win,node-gyp**: optionally allow node.exe/iojs.exe to be renamed (Bert Belder) [#1266](https://github.com/nodejs/node/pull/1266) +* [[`3bda6cbfa4`](https://github.com/nodejs/node/commit/3bda6cbfa4)] - **(SEMVER-MAJOR)** **win,node-gyp**: enable delay-load hook by default (Bert Belder) [#1433](https://github.com/nodejs/node/pull/1433) + +## 2015-04-20, Version 1.8.1, @chrisdickinson + +### Notable changes + +* **NOTICE**: Skipped v1.8.0 due to problems with release tooling. + See [#1436](https://github.com/nodejs/node/issues/1436) for details. +* **build**: Support for building io.js as a static library (Marat Abdullin) [#1341](https://github.com/nodejs/node/pull/1341) +* **deps**: Upgrade openssl to 1.0.2a (Shigeki Ohtsu) [#1389](https://github.com/nodejs/node/pull/1389) + * Users should see performance improvements when using the crypto API. + See [here](https://github.com/nodejs/node/wiki/Crypto-Performance-Notes-for-OpenSSL-1.0.2a-on-iojs-v1.8.0) + for details. +* **npm**: Upgrade npm to 2.8.3. See the [release notes](https://github.com/npm/npm/releases/tag/v2.8.3) for details. Includes improved git support. Summary: + * [`387f889`](https://github.com/npm/npm/commit/387f889c0e8fb617d9cc9a42ed0a3ec49424ab5d) + [#7961](https://github.com/npm/npm/issues/7961) Ensure that hosted git SSH + URLs always have a valid protocol when stored in `resolved` fields in + `npm-shrinkwrap.json`. ([@othiym23](https://github.com/othiym23)) + * [`394c2f5`](https://github.com/npm/npm/commit/394c2f5a1227232c0baf42fbba1402aafe0d6ffb) + Switch the order in which hosted Git providers are checked to `git:`, + `git+https:`, then `git+ssh:` (from `git:`, `git+ssh:`, then `git+https:`) in + an effort to go from most to least likely to succeed, to make for less + confusing error message. ([@othiym23](https://github.com/othiym23)) + * [`431c3bf`](https://github.com/npm/npm/commit/431c3bf6cdec50f9f0c735f478cb2f3f337d3313) + [#7699](https://github.com/npm/npm/issues/7699) `npm-registry-client@6.3.2`: + Don't send body with HTTP GET requests when logging in. + ([@smikes](https://github.com/smikes)) + * [`15efe12`](https://github.com/npm/npm/commit/15efe124753257728a0ddc64074fa5a4b9c2eb30) + [#7872](https://github.com/npm/npm/issues/7872) Use the new version of + `hosted-git-info` to pass along credentials embedded in git URLs. Test it. + Test it a lot. ([@othiym23](https://github.com/othiym23)) + * [`b027319`](https://github.com/npm/npm/commit/b0273190c71eba14395ddfdd1d9f7ba625297523) + [#7920](https://github.com/npm/npm/issues/7920) Scoped packages with + `peerDependencies` were installing the `peerDependencies` into the wrong + directory. ([@ewie](https://github.com/ewie)) + * [`6b0f588`](https://github.com/npm/npm/commit/6b0f58877f37df9904490ffbaaad33862bd36dce) + [#7867](https://github.com/npm/npm/issues/7867) Use git shorthand and git + URLs as presented by user. Support new `hosted-git-info` shortcut syntax. + Save shorthand in `package.json`. Try cloning via `git:`, `git+ssh:`, and + `git+https:`, in that order, when supported by the underlying hosting + provider. ([@othiym23](https://github.com/othiym23)) +* **src**: Allow multiple arguments to be passed to process.nextTick (Trevor Norris) [#1077](https://github.com/nodejs/node/pull/1077) +* **module**: The interaction of `require('.')` with `NODE_PATH` has been restored and deprecated. This functionality +will be removed at a later point. (Roman Reiss) [#1363](https://github.com/nodejs/node/pull/1363) + +### Known issues + +* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/node/issues/1264). +* Surrogate pair in REPL can freeze terminal [#690](https://github.com/nodejs/node/issues/690) +* `process.send()` is not synchronous as the docs suggest, a regression introduced in 1.0.2, see [#760](https://github.com/nodejs/node/issues/760) and fix in [#774](https://github.com/nodejs/node/issues/774) +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion [#894](https://github.com/nodejs/node/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). +* readline: split escapes are processed incorrectly, see [#1403](https://github.com/nodejs/node/issues/1403) + +### Commits + +* [[`53ed89d927`](https://github.com/nodejs/node/commit/53ed89d927)] - ***Revert*** "**build**: use %PYTHON% instead of python" (Rod Vagg) [#1475](https://github.com/nodejs/node/pull/1475) +* [[`2b744b0ab7`](https://github.com/nodejs/node/commit/2b744b0ab7)] - **src**: revert NODE_MODULE_VERSION to 43 (Chris Dickinson) [#1460](https://github.com/nodejs/node/pull/1460) +* [[`431673ebd1`](https://github.com/nodejs/node/commit/431673ebd1)] - **buffer**: fast-case for empty string in byteLength (Jackson Tian) [#1441](https://github.com/nodejs/node/pull/1441) +* [[`1b22bad35f`](https://github.com/nodejs/node/commit/1b22bad35f)] - **build**: fix logic for shared library flags (Jeremiah Senkpiel) [#1454](https://github.com/nodejs/node/pull/1454) +* [[`91943a99d5`](https://github.com/nodejs/node/commit/91943a99d5)] - **build**: use %PYTHON% instead of python (Rod Vagg) [#1444](https://github.com/nodejs/node/pull/1444) +* [[`c7769d417b`](https://github.com/nodejs/node/commit/c7769d417b)] - **build**: Expose xz compression level (Johan Bergström) [#1428](https://github.com/nodejs/node/pull/1428) +* [[`a530b2baf1`](https://github.com/nodejs/node/commit/a530b2baf1)] - **build**: fix error message in configure (Shigeki Ohtsu) [#1389](https://github.com/nodejs/node/pull/1389) +* [[`92dfb794f9`](https://github.com/nodejs/node/commit/92dfb794f9)] - **build**: enable ssl support on arm64 (Shigeki Ohtsu) [#1389](https://github.com/nodejs/node/pull/1389) +* [[`7de0dcde83`](https://github.com/nodejs/node/commit/7de0dcde83)] - **deps**: make node-gyp work with io.js (cjihrig) [#990](https://github.com/nodejs/node/pull/990) +* [[`4870213f9e`](https://github.com/nodejs/node/commit/4870213f9e)] - **deps**: upgrade npm to 2.8.3 (Forrest L Norvell) +* [[`49bb7ded2c`](https://github.com/nodejs/node/commit/49bb7ded2c)] - **deps**: fix git case sensitivity issue in npm (Chris Dickinson) [#1456](https://github.com/nodejs/node/pull/1456) +* [[`4830b4bce8`](https://github.com/nodejs/node/commit/4830b4bce8)] - **deps**: add docs to upgrade openssl (Shigeki Ohtsu) [#1389](https://github.com/nodejs/node/pull/1389) +* [[`11bec72c87`](https://github.com/nodejs/node/commit/11bec72c87)] - **deps**: update asm files for openssl-1.0.2a (Shigeki Ohtsu) [#1389](https://github.com/nodejs/node/pull/1389) +* [[`53924d8ebe`](https://github.com/nodejs/node/commit/53924d8ebe)] - **deps**: update asm Makefile for openssl-1.0.2a (Shigeki Ohtsu) [#1389](https://github.com/nodejs/node/pull/1389) +* [[`418e839456`](https://github.com/nodejs/node/commit/418e839456)] - **deps**: update openssl.gyp/gypi for openssl-1.0.2a (Shigeki Ohtsu) [#1389](https://github.com/nodejs/node/pull/1389) +* [[`02f12ab666`](https://github.com/nodejs/node/commit/02f12ab666)] - **deps**: update opensslconf.h for 1.0.2a (Shigeki Ohtsu) [#1389](https://github.com/nodejs/node/pull/1389) +* [[`eb7a23595f`](https://github.com/nodejs/node/commit/eb7a23595f)] - **deps**: add x32 and arm64 support for opensslconf.h (Shigeki Ohtsu) [#1389](https://github.com/nodejs/node/pull/1389) +* [[`033a663127`](https://github.com/nodejs/node/commit/033a663127)] - **deps**: replace all headers in openssl (Shigeki Ohtsu) [#1389](https://github.com/nodejs/node/pull/1389) +* [[`ae8831f240`](https://github.com/nodejs/node/commit/ae8831f240)] - **deps**: backport openssl patch of alt cert chains 1 (Shigeki Ohtsu) [#1389](https://github.com/nodejs/node/pull/1389) +* [[`71316c46d9`](https://github.com/nodejs/node/commit/71316c46d9)] - **deps**: fix asm build error of openssl in x86_win32 (Shigeki Ohtsu) [#1389](https://github.com/nodejs/node/pull/1389) +* [[`d293a4f096`](https://github.com/nodejs/node/commit/d293a4f096)] - **deps**: fix openssl assembly error on ia32 win32 (Fedor Indutny) [#1389](https://github.com/nodejs/node/pull/1389) +* [[`e4872d7405`](https://github.com/nodejs/node/commit/e4872d7405)] - **deps**: upgrade openssl to 1.0.2a (Shigeki Ohtsu) [#1389](https://github.com/nodejs/node/pull/1389) +* [[`a1c9ef3142`](https://github.com/nodejs/node/commit/a1c9ef3142)] - **deps, build**: add support older assembler (Shigeki Ohtsu) [#1389](https://github.com/nodejs/node/pull/1389) +* [[`76f219c128`](https://github.com/nodejs/node/commit/76f219c128)] - **doc**: Document forced pushing with git (Johan Bergström) [#1420](https://github.com/nodejs/node/pull/1420) +* [[`12e51d56c1`](https://github.com/nodejs/node/commit/12e51d56c1)] - **doc**: add Addon API WG (Rod Vagg) [#1226](https://github.com/nodejs/node/pull/1226) +* [[`7956a13dad`](https://github.com/nodejs/node/commit/7956a13dad)] - **http**: logically respect maxSockets (fengmk2) [#1242](https://github.com/nodejs/node/pull/1242) +* [[`5b844e140b`](https://github.com/nodejs/node/commit/5b844e140b)] - **module**: fix style (Roman Reiss) [#1453](https://github.com/nodejs/node/pull/1453) +* [[`3ad82c335d`](https://github.com/nodejs/node/commit/3ad82c335d)] - **(SEMVER-MINOR)** **module**: handle NODE_PATH in require('.') (Roman Reiss) [#1363](https://github.com/nodejs/node/pull/1363) +* [[`cd60ff0328`](https://github.com/nodejs/node/commit/cd60ff0328)] - **net**: add fd into listen2 debug info (Jackson Tian) [#1442](https://github.com/nodejs/node/pull/1442) +* [[`10e31ba56c`](https://github.com/nodejs/node/commit/10e31ba56c)] - **(SEMVER-MINOR)** **node**: allow multiple arguments passed to nextTick (Trevor Norris) [#1077](https://github.com/nodejs/node/pull/1077) +* [[`116c54692a`](https://github.com/nodejs/node/commit/116c54692a)] - **openssl**: fix keypress requirement in apps on win32 (Shigeki Ohtsu) [#1389](https://github.com/nodejs/node/pull/1389) +* [[`62f5f4cec9`](https://github.com/nodejs/node/commit/62f5f4cec9)] - **src**: remove duplicate byteLength from Buffer (Jackson Tian) [#1438](https://github.com/nodejs/node/pull/1438) +* [[`51d0808c90`](https://github.com/nodejs/node/commit/51d0808c90)] - **stream**: remove duplicated expression (Yazhong Liu) [#1444](https://github.com/nodejs/node/pull/1444) +* [[`deb9d23d7b`](https://github.com/nodejs/node/commit/deb9d23d7b)] - **test**: fix error message check for openssl-1.0.2a (Shigeki Ohtsu) [#1389](https://github.com/nodejs/node/pull/1389) +* [[`ca8c9ec2c8`](https://github.com/nodejs/node/commit/ca8c9ec2c8)] - **win,node-gyp**: optionally allow node.exe/iojs.exe to be renamed (Bert Belder) [#1266](https://github.com/nodejs/node/pull/1266) + +## 2015-04-14, Version 1.7.1, @rvagg + +### Notable changes + +* **build**: A syntax error in the Makefile for release builds caused 1.7.0 to be DOA and unreleased. (Rod Vagg) [#1421](https://github.com/nodejs/node/pull/1421). + +### Known issues + +* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/node/issues/1264). +* Surrogate pair in REPL can freeze terminal [#690](https://github.com/nodejs/node/issues/690) +* `process.send()` is not synchronous as the docs suggest, a regression introduced in 1.0.2, see [#760](https://github.com/nodejs/node/issues/760) and fix in [#774](https://github.com/nodejs/node/issues/774) +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion [#894](https://github.com/nodejs/node/issues/894) +* readline: split escapes are processed incorrectly, see [#1403](https://github.com/nodejs/node/issues/1403) + +### Commits + +* [[`aee86a21f2`](https://github.com/nodejs/node/commit/aee86a21f2)] - **build**: fix RELEASE check (Rod Vagg) [#1421](https://github.com/nodejs/node/pull/1421) + +## 2015-04-14, Version 1.7.0, @rvagg + +### Notable changes + +* **C++ API**: Fedor Indutny contributed a feature to V8 which has been backported to the V8 bundled in io.js. `SealHandleScope` allows a C++ add-on author to _seal_ a `HandleScope` to prevent further, unintended allocations within it. Currently only enabled for debug builds of io.js. This feature helped detect the leak in [#1075](https://github.com/nodejs/node/issues/1075) and is now activated on the root `HandleScope` in io.js. (Fedor Indutny) [#1395](https://github.com/nodejs/node/pull/1395). +* **ARM**: This release includes significant work to improve the state of ARM support for builds and tests. The io.js CI cluster's ARMv6, ARMv7 and ARMv8 build servers are now all (mostly) reporting passing builds and tests. + * ARMv8 64-bit (AARCH64) is now properly supported, including a backported fix in libuv that was mistakenly detecting the existence of `epoll_wait()`. (Ben Noordhuis) [#1365](https://github.com/nodejs/node/pull/1365). + * ARMv6: [#1376](https://github.com/nodejs/node/issues/1376) reported a problem with `Math.exp()` on ARMv6 (incl Raspberry Pi). The culprit is erroneous codegen for ARMv6 when using the "fast math" feature of V8. `--nofast_math` has been turned on for all ARMv6 variants by default to avoid this, fast math can be turned back on with `--fast_math`. (Ben Noordhuis) [#1398](https://github.com/nodejs/node/pull/1398). + * Tests: timeouts have been tuned specifically for slower platforms, detected as ARMv6 and ARMv7. (Roman Reiss) [#1366](https://github.com/nodejs/node/pull/1366). +* **npm**: Upgrade npm to 2.7.6. See the [release notes](https://github.com/npm/npm/releases/tag/v2.7.6) for details. Summary: + * [`b747593`](https://github.com/npm/npm/commit/b7475936f473f029e6a027ba1b16277523747d0b)[#7630](https://github.com/npm/npm/issues/7630) Don't automatically log all git failures as errors. `maybeGithub` needs to be able to fail without logging to support its fallback logic. ([@othiym23](https://github.com/othiym23)) + * [`78005eb`](https://github.com/npm/npm/commit/78005ebb6f4103c20f077669c3929b7ea46a4c0d)[#7743](https://github.com/npm/npm/issues/7743) Always quote arguments passed to `npm run-script`. This allows build systems and the like to safely escape glob patterns passed as arguments to `run-scripts` with `npm run-script + + +
+ +

npm

a JavaScript package manager

+

Build Status

+

SYNOPSIS

+

This is just enough info to get you up and running.

+

Much more info available via npm help once it's installed.

+

IMPORTANT

+

You need node v0.10 or higher to run this program.

+

To install an old and unsupported version of npm that works on node 0.3 +and prior, clone the git repo and dig through the old tags and branches.

+

npm is configured to use npm, Inc.'s public package registry at +https://registry.npmjs.org by default.

+

You can configure npm to use any compatible registry you +like, and even run your own registry. Check out the doc on +registries.

+

Use of someone else's registry may be governed by terms of use. The +terms of use for the default public registry are available at +https://www.npmjs.com.

+

Super Easy Install

+

npm is bundled with node.

+

Windows Computers

+

Get the MSI. npm is in it.

+

Apple Macintosh Computers

+

Get the pkg. npm is in it.

+

Other Sorts of Unices

+

Run make install. npm will be installed with node.

+

If you want a more fancy pants install (a different version, customized +paths, etc.) then read on.

+

Fancy Install (Unix)

+

There's a pretty robust install script at +https://www.npmjs.com/install.sh. You can download that and run it.

+

Here's an example using curl:

+
curl -L https://www.npmjs.com/install.sh | sh
+
+

Slightly Fancier

+

You can set any npm configuration params with that script:

+
npm_config_prefix=/some/path sh install.sh
+
+

Or, you can run it in uber-debuggery mode:

+
npm_debug=1 sh install.sh
+
+

Even Fancier

+

Get the code with git. Use make to build the docs and do other stuff. +If you plan on hacking on npm, make link is your friend.

+

If you've got the npm source code, you can also semi-permanently set +arbitrary config keys using the ./configure --key=val ..., and then +run npm commands by doing node cli.js <cmd> <args>. (This is helpful +for testing, or running stuff without actually installing npm itself.)

+

Windows Install or Upgrade

+

You can download a zip file from https://github.com/npm/npm/releases, and +unpack it in the node_modules\npm\ folder inside node's installation folder.

+

To upgrade to npm 2, follow the Windows upgrade instructions in +the npm Troubleshooting Guide:

+

https://github.com/npm/npm/wiki/Troubleshooting#upgrading-on-windows

+

If that's not fancy enough for you, then you can fetch the code with +git, and mess with it directly.

+

Installing on Cygwin

+

No.

+

Uninstalling

+

So sad to see you go.

+
sudo npm uninstall npm -g
+
+

Or, if that fails,

+
sudo make uninstall
+
+

More Severe Uninstalling

+

Usually, the above instructions are sufficient. That will remove +npm, but leave behind anything you've installed.

+

If you would like to remove all the packages that you have installed, +then you can use the npm ls command to find them, and then npm rm to +remove them.

+

To remove cruft left behind by npm 0.x, you can use the included +clean-old.sh script file. You can run it conveniently like this:

+
npm explore npm -g -- sh scripts/clean-old.sh
+
+

npm uses two configuration files, one for per-user configs, and another +for global (every-user) configs. You can view them by doing:

+
npm config get userconfig   # defaults to ~/.npmrc
+npm config get globalconfig # defaults to /usr/local/etc/npmrc
+
+

Uninstalling npm does not remove configuration files by default. You +must remove them yourself manually if you want them gone. Note that +this means that future npm installs will not remember the settings that +you have chosen.

+

More Docs

+

Check out the docs, +especially the faq.

+

You can use the npm help command to read any of them.

+

If you're a developer, and you want to use npm to publish your program, +you should read this

+

BUGS

+

When you find issues, please report them:

+ +

Be sure to include all of the output from the npm command that didn't work +as expected. The npm-debug.log file is also helpful to provide.

+

You can also look for isaacs in #node.js on irc://irc.freenode.net. He +will no doubt tell you to put the output in a gist or email.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-bin.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-bin.html new file mode 100644 index 00000000..1d14cf80 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-bin.html @@ -0,0 +1,32 @@ + + + npm-bin + + + + + + +
+ +

npm-bin

Display npm bin folder

+

SYNOPSIS

+
npm.commands.bin(args, cb)
+

DESCRIPTION

+

Print the folder where npm will install executables.

+

This function should not be used programmatically. Instead, just refer +to the npm.bin property.

+ +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-bugs.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-bugs.html new file mode 100644 index 00000000..4e0bcd7a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-bugs.html @@ -0,0 +1,37 @@ + + + npm-bugs + + + + + + +
+ +

npm-bugs

Bugs for a package in a web browser maybe

+

SYNOPSIS

+
npm.commands.bugs(package, callback)
+

DESCRIPTION

+

This command tries to guess at the likely location of a package's +bug tracker URL, and then tries to open it using the --browser +config param.

+

Like other commands, the first parameter is an array. This command only +uses the first element, which is expected to be a package name with an +optional version number.

+

This command will launch a browser, so this command may not be the most +friendly for programmatic use.

+ +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-cache.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-cache.html new file mode 100644 index 00000000..bee4834f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-cache.html @@ -0,0 +1,46 @@ + + + npm-cache + + + + + + +
+ +

npm-cache

manage the npm cache programmatically

+

SYNOPSIS

+
npm.commands.cache([args], callback)
+
+// helpers
+npm.commands.cache.clean([args], callback)
+npm.commands.cache.add([args], callback)
+npm.commands.cache.read(name, version, forceBypass, callback)
+

DESCRIPTION

+

This acts much the same ways as the npm-cache(1) command line +functionality.

+

The callback is called with the package.json data of the thing that is +eventually added to or read from the cache.

+

The top level npm.commands.cache(...) functionality is a public +interface, and like all commands on the npm.commands object, it will +match the command line behavior exactly.

+

However, the cache folder structure and the cache helper functions are +considered internal API surface, and as such, may change in future +releases of npm, potentially without warning or significant version +incrementation.

+

Use at your own risk.

+ +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-commands.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-commands.html new file mode 100644 index 00000000..7fd7f6f9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-commands.html @@ -0,0 +1,40 @@ + + + npm-commands + + + + + + +
+ +

npm-commands

npm commands

+

SYNOPSIS

+
npm.commands[<command>](args, callback)
+

DESCRIPTION

+

npm comes with a full set of commands, and each of the commands takes a +similar set of arguments.

+

In general, all commands on the command object take an array of positional +argument strings. The last argument to any function is a callback. Some +commands are special and take other optional arguments.

+

All commands have their own man page. See man npm-<command> for command-line +usage, or man 3 npm-<command> for programmatic usage.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-config.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-config.html new file mode 100644 index 00000000..e6503c6e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-config.html @@ -0,0 +1,61 @@ + + + npm-config + + + + + + +
+ +

npm-config

Manage the npm configuration files

+

SYNOPSIS

+
npm.commands.config(args, callback)
+var val = npm.config.get(key)
+npm.config.set(key, val)
+

DESCRIPTION

+

This function acts much the same way as the command-line version. The first +element in the array tells config what to do. Possible values are:

+
    +
  • set

    +

    Sets a config parameter. The second element in args is interpreted as the + key, and the third element is interpreted as the value.

    +
  • +
  • get

    +

    Gets the value of a config parameter. The second element in args is the + key to get the value of.

    +
  • +
  • delete (rm or del)

    +

    Deletes a parameter from the config. The second element in args is the + key to delete.

    +
  • +
  • list (ls)

    +

    Show all configs that aren't secret. No parameters necessary.

    +
  • +
  • edit:

    +

    Opens the config file in the default editor. This command isn't very useful + programmatically, but it is made available.

    +
  • +
+

To programmatically access npm configuration settings, or set them for +the duration of a program, use the npm.config.set and npm.config.get +functions instead.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-deprecate.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-deprecate.html new file mode 100644 index 00000000..d637471d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-deprecate.html @@ -0,0 +1,51 @@ + + + npm-deprecate + + + + + + +
+ +

npm-deprecate

Deprecate a version of a package

+

SYNOPSIS

+
npm.commands.deprecate(args, callback)
+

DESCRIPTION

+

This command will update the npm registry entry for a package, providing +a deprecation warning to all who attempt to install it.

+

The 'args' parameter must have exactly two elements:

+
    +
  • package[@version]

    +

    The version portion is optional, and may be either a range, or a + specific version, or a tag.

    +
  • +
  • message

    +

    The warning message that will be printed whenever a user attempts to + install the package.

    +
  • +
+

Note that you must be the package owner to deprecate something. See the +owner and adduser help topics.

+

To un-deprecate a package, specify an empty string ("") for the message argument.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-docs.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-docs.html new file mode 100644 index 00000000..feea848f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-docs.html @@ -0,0 +1,37 @@ + + + npm-docs + + + + + + +
+ +

npm-docs

Docs for a package in a web browser maybe

+

SYNOPSIS

+
npm.commands.docs(package, callback)
+

DESCRIPTION

+

This command tries to guess at the likely location of a package's +documentation URL, and then tries to open it using the --browser +config param.

+

Like other commands, the first parameter is an array. This command only +uses the first element, which is expected to be a package name with an +optional version number.

+

This command will launch a browser, so this command may not be the most +friendly for programmatic use.

+ +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-edit.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-edit.html new file mode 100644 index 00000000..be2072a5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-edit.html @@ -0,0 +1,40 @@ + + + npm-edit + + + + + + +
+ +

npm-edit

Edit an installed package

+

SYNOPSIS

+
npm.commands.edit(package, callback)
+

DESCRIPTION

+

Opens the package folder in the default editor (or whatever you've +configured as the npm editor config -- see npm help config.)

+

After it has been edited, the package is rebuilt so as to pick up any +changes in compiled packages.

+

For instance, you can do npm install connect to install connect +into your package, and then npm.commands.edit(["connect"], callback) +to make a few changes to your locally installed copy.

+

The first parameter is a string array with a single element, the package +to open. The package can optionally have a version number attached.

+

Since this command opens an editor in a new process, be careful about where +and how this is used.

+ +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-explore.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-explore.html new file mode 100644 index 00000000..33a2e0a2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-explore.html @@ -0,0 +1,35 @@ + + + npm-explore + + + + + + +
+ +

npm-explore

Browse an installed package

+

SYNOPSIS

+
npm.commands.explore(args, callback)
+

DESCRIPTION

+

Spawn a subshell in the directory of the installed package specified.

+

If a command is specified, then it is run in the subshell, which then +immediately terminates.

+

Note that the package is not automatically rebuilt afterwards, so be +sure to use npm rebuild <pkg> if you make any changes.

+

The first element in the 'args' parameter must be a package name. After that is the optional command, which can be any number of strings. All of the strings will be combined into one, space-delimited command.

+ +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-help-search.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-help-search.html new file mode 100644 index 00000000..150775cb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-help-search.html @@ -0,0 +1,48 @@ + + + npm-help-search + + + + + + +
+ +

npm-help-search

Search the help pages

+

SYNOPSIS

+
npm.commands.helpSearch(args, [silent,] callback)
+

DESCRIPTION

+

This command is rarely useful, but it exists in the rare case that it is.

+

This command takes an array of search terms and returns the help pages that +match in order of best match.

+

If there is only one match, then npm displays that help section. If there +are multiple results, the results are printed to the screen formatted and the +array of results is returned. Each result is an object with these properties:

+
    +
  • hits: +A map of args to number of hits on that arg. For example, {"npm": 3}
  • +
  • found: +Total number of unique args that matched.
  • +
  • totalHits: +Total number of hits.
  • +
  • lines: +An array of all matching lines (and some adjacent lines).
  • +
  • file: +Name of the file that matched
  • +
+

The silent parameter is not necessary not used, but it may in the future.

+ +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-init.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-init.html new file mode 100644 index 00000000..8df7483f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-init.html @@ -0,0 +1,43 @@ + + + npm-init + + + + + + +
+ +

npm init

Interactively create a package.json file

+

SYNOPSIS

+
npm.commands.init(args, callback)
+

DESCRIPTION

+

This will ask you a bunch of questions, and then write a package.json for you.

+

It attempts to make reasonable guesses about what you want things to be set to, +and then writes a package.json file with the options you've selected.

+

If you already have a package.json file, it'll read that first, and default to +the options in there.

+

It is strictly additive, so it does not delete options from your package.json +without a really good reason to do so.

+

Since this function expects to be run on the command-line, it doesn't work very +well as a programmatically. The best option is to roll your own, and since +JavaScript makes it stupid simple to output formatted JSON, that is the +preferred method. If you're sure you want to handle command-line prompting, +then go ahead and use this programmatically.

+

SEE ALSO

+

package.json(5)

+ +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-install.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-install.html new file mode 100644 index 00000000..0f06ab65 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-install.html @@ -0,0 +1,36 @@ + + + npm-install + + + + + + +
+ +

npm-install

install a package programmatically

+

SYNOPSIS

+
npm.commands.install([where,] packages, callback)
+

DESCRIPTION

+

This acts much the same ways as installing on the command-line.

+

The 'where' parameter is optional and only used internally, and it specifies +where the packages should be installed to.

+

The 'packages' parameter is an array of strings. Each element in the array is +the name of a package to be installed.

+

Finally, 'callback' is a function that will be called when all packages have been +installed or when an error has been encountered.

+ +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-link.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-link.html new file mode 100644 index 00000000..f46140f2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-link.html @@ -0,0 +1,46 @@ + + + npm-link + + + + + + +
+ +

npm-link

Symlink a package folder

+

SYNOPSIS

+
npm.commands.link(callback)
+npm.commands.link(packages, callback)
+

DESCRIPTION

+

Package linking is a two-step process.

+

Without parameters, link will create a globally-installed +symbolic link from prefix/package-name to the current folder.

+

With a parameters, link will create a symlink from the local node_modules +folder to the global symlink.

+

When creating tarballs for npm publish, the linked packages are +"snapshotted" to their current state by resolving the symbolic links.

+

This is +handy for installing your own stuff, so that you can work on it and test it +iteratively without having to continually rebuild.

+

For example:

+
npm.commands.link(cb)           # creates global link from the cwd
+                                # (say redis package)
+npm.commands.link('redis', cb)  # link-install the package
+

Now, any changes to the redis package will be reflected in +the package in the current working directory

+ +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-load.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-load.html new file mode 100644 index 00000000..4df8bcbb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-load.html @@ -0,0 +1,41 @@ + + + npm-load + + + + + + +
+ +

npm-load

Load config settings

+

SYNOPSIS

+
npm.load(conf, cb)
+

DESCRIPTION

+

npm.load() must be called before any other function call. Both parameters are +optional, but the second is recommended.

+

The first parameter is an object containing command-line config params, and the +second parameter is a callback that will be called when npm is loaded and ready +to serve.

+

The first parameter should follow a similar structure as the package.json +config object.

+

For example, to emulate the --dev flag, pass an object that looks like this:

+
{
+  "dev": true
+}
+

For a list of all the available command-line configs, see npm help config

+ +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-ls.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-ls.html new file mode 100644 index 00000000..631321a2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-ls.html @@ -0,0 +1,67 @@ + + + npm-ls + + + + + + +
+ +

npm-ls

List installed packages

+

SYNOPSIS

+
npm.commands.ls(args, [silent,] callback)
+

DESCRIPTION

+

This command will print to stdout all the versions of packages that are +installed, as well as their dependencies, in a tree-structure. It will also +return that data using the callback.

+

This command does not take any arguments, but args must be defined. +Beyond that, if any arguments are passed in, npm will politely warn that it +does not take positional arguments, though you may set config flags +like with any other command, such as global to list global packages.

+

It will print out extraneous, missing, and invalid packages.

+

If the silent parameter is set to true, nothing will be output to the screen, +but the data will still be returned.

+

Callback is provided an error if one occurred, the full data about which +packages are installed and which dependencies they will receive, and a +"lite" data object which just shows which versions are installed where. +Note that the full data object is a circular structure, so care must be +taken if it is serialized to JSON.

+

CONFIGURATION

+

long

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Show extended information.

+

parseable

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Show parseable output instead of tree view.

+

global

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

List packages in the global install prefix instead of in the current +project.

+

Note, if parseable is set or long isn't set, then duplicates will be trimmed. +This means that if a submodule has the same dependency as a parent module, then the +dependency will only be output once.

+ +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-outdated.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-outdated.html new file mode 100644 index 00000000..27482726 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-outdated.html @@ -0,0 +1,32 @@ + + + npm-outdated + + + + + + +
+ +

npm-outdated

Check for outdated packages

+

SYNOPSIS

+
npm.commands.outdated([packages,] callback)
+

DESCRIPTION

+

This command will check the registry to see if the specified packages are +currently outdated.

+

If the 'packages' parameter is left out, npm will check all packages.

+ +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-owner.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-owner.html new file mode 100644 index 00000000..ad72f051 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-owner.html @@ -0,0 +1,51 @@ + + + npm-owner + + + + + + +
+ +

npm-owner

Manage package owners

+

SYNOPSIS

+
npm.commands.owner(args, callback)
+

DESCRIPTION

+

The first element of the 'args' parameter defines what to do, and the subsequent +elements depend on the action. Possible values for the action are (order of +parameters are given in parenthesis):

+
    +
  • ls (package): +List all the users who have access to modify a package and push new versions. +Handy when you need to know who to bug for help.
  • +
  • add (user, package): +Add a new user as a maintainer of a package. This user is enabled to modify +metadata, publish new versions, and add other owners.
  • +
  • rm (user, package): +Remove a user from the package owner list. This immediately revokes their +privileges.
  • +
+

Note that there is only one level of access. Either you can modify a package, +or you can't. Future versions may contain more fine-grained access levels, but +that is not implemented at this time.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-pack.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-pack.html new file mode 100644 index 00000000..a4bed4a1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-pack.html @@ -0,0 +1,37 @@ + + + npm-pack + + + + + + +
+ +

npm-pack

Create a tarball from a package

+

SYNOPSIS

+
npm.commands.pack([packages,] callback)
+

DESCRIPTION

+

For anything that's installable (that is, a package folder, tarball, +tarball url, name@tag, name@version, or name), this command will fetch +it to the cache, and then copy the tarball to the current working +directory as <name>-<version>.tgz, and then write the filenames out to +stdout.

+

If the same package is specified multiple times, then the file will be +overwritten the second time.

+

If no arguments are supplied, then npm packs the current package folder.

+ +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-ping.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-ping.html new file mode 100644 index 00000000..9244fb92 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-ping.html @@ -0,0 +1,32 @@ + + + npm-ping + + + + + + +
+ +

npm-ping

Ping npm registry

+

SYNOPSIS

+
npm.registry.ping(registry, options, function (er, pong))
+

DESCRIPTION

+

Attempts to connect to the given registry, returning a pong +object with various metadata if it succeeds.

+

This function is primarily useful for debugging connection issues +to npm registries.

+ +
+ + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-prefix.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-prefix.html new file mode 100644 index 00000000..d01ab2ae --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-prefix.html @@ -0,0 +1,33 @@ + + + npm-prefix + + + + + + +
+ +

npm-prefix

Display prefix

+

SYNOPSIS

+
npm.commands.prefix(args, callback)
+

DESCRIPTION

+

Print the prefix to standard out.

+

'args' is never used and callback is never called with data. +'args' must be present or things will break.

+

This function is not useful programmatically

+ +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-prune.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-prune.html new file mode 100644 index 00000000..3cace3e7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-prune.html @@ -0,0 +1,34 @@ + + + npm-prune + + + + + + +
+ +

npm-prune

Remove extraneous packages

+

SYNOPSIS

+
npm.commands.prune([packages,] callback)
+

DESCRIPTION

+

This command removes "extraneous" packages.

+

The first parameter is optional, and it specifies packages to be removed.

+

No packages are specified, then all packages will be checked.

+

Extraneous packages are packages that are not listed on the parent +package's dependencies list.

+ +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-publish.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-publish.html new file mode 100644 index 00000000..3a8c2b29 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-publish.html @@ -0,0 +1,50 @@ + + + npm-publish + + + + + + +
+ +

npm-publish

Publish a package

+

SYNOPSIS

+
npm.commands.publish([packages,] callback)
+

DESCRIPTION

+

Publishes a package to the registry so that it can be installed by name. +Possible values in the 'packages' array are:

+
    +
  • <folder>: +A folder containing a package.json file

    +
  • +
  • <tarball>: +A url or file path to a gzipped tar archive containing a single folder +with a package.json file inside.

    +
  • +
+

If the package array is empty, npm will try to publish something in the +current working directory.

+

This command could fails if one of the packages specified already exists in +the registry. Overwrites when the "force" environment variable is set.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-rebuild.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-rebuild.html new file mode 100644 index 00000000..a7edebfc --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-rebuild.html @@ -0,0 +1,34 @@ + + + npm-rebuild + + + + + + +
+ +

npm-rebuild

Rebuild a package

+

SYNOPSIS

+
npm.commands.rebuild([packages,] callback)
+

DESCRIPTION

+

This command runs the npm build command on each of the matched packages. This is useful +when you install a new version of node, and must recompile all your C++ addons with +the new binary. If no 'packages' parameter is specify, every package will be rebuilt.

+

CONFIGURATION

+

See npm help build

+ +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-repo.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-repo.html new file mode 100644 index 00000000..367518ce --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-repo.html @@ -0,0 +1,37 @@ + + + npm-repo + + + + + + +
+ +

npm-repo

Open package repository page in the browser

+

SYNOPSIS

+
npm.commands.repo(package, callback)
+

DESCRIPTION

+

This command tries to guess at the likely location of a package's +repository URL, and then tries to open it using the --browser +config param.

+

Like other commands, the first parameter is an array. This command only +uses the first element, which is expected to be a package name with an +optional version number.

+

This command will launch a browser, so this command may not be the most +friendly for programmatic use.

+ +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-restart.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-restart.html new file mode 100644 index 00000000..401335bf --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-restart.html @@ -0,0 +1,56 @@ + + + npm-restart + + + + + + +
+ +

npm-restart

Restart a package

+

SYNOPSIS

+
npm.commands.restart(packages, callback)
+

DESCRIPTION

+

This restarts a package (or multiple packages).

+

This runs a package's "stop", "restart", and "start" scripts, and associated +pre- and post- scripts, in the order given below:

+
    +
  1. prerestart
  2. +
  3. prestop
  4. +
  5. stop
  6. +
  7. poststop
  8. +
  9. restart
  10. +
  11. prestart
  12. +
  13. start
  14. +
  15. poststart
  16. +
  17. postrestart
  18. +
+

If no version is specified, then it restarts the "active" version.

+

npm can restart multiple packages. Just specify multiple packages in +the packages parameter.

+

NOTE

+

Note that the "restart" script is run in addition to the "stop" +and "start" scripts, not instead of them.

+

This is the behavior as of npm major version 2. A change in this +behavior will be accompanied by an increase in major version number

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-root.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-root.html new file mode 100644 index 00000000..c78cd7fc --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-root.html @@ -0,0 +1,33 @@ + + + npm-root + + + + + + +
+ +

npm-root

Display npm root

+

SYNOPSIS

+
npm.commands.root(args, callback)
+

DESCRIPTION

+

Print the effective node_modules folder to standard out.

+

'args' is never used and callback is never called with data. +'args' must be present or things will break.

+

This function is not useful programmatically.

+ +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-run-script.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-run-script.html new file mode 100644 index 00000000..ceb77f93 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-run-script.html @@ -0,0 +1,45 @@ + + + npm-run-script + + + + + + +
+ +

npm-run-script

Run arbitrary package scripts

+

SYNOPSIS

+
npm.commands.run-script(args, callback)
+

DESCRIPTION

+

This runs an arbitrary command from a package's "scripts" object.

+

It is used by the test, start, restart, and stop commands, but can be +called directly, as well.

+

The 'args' parameter is an array of strings. Behavior depends on the number +of elements. If there is only one element, npm assumes that the element +represents a command to be run on the local repository. If there is more than +one element, then the first is assumed to be the package and the second is +assumed to be the command to run. All other elements are ignored.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-search.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-search.html new file mode 100644 index 00000000..794a089b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-search.html @@ -0,0 +1,57 @@ + + + npm-search + + + + + + +
+ +

npm-search

Search for packages

+

SYNOPSIS

+
npm.commands.search(searchTerms, [silent,] [staleness,] callback)
+

DESCRIPTION

+

Search the registry for packages matching the search terms. The available parameters are:

+
    +
  • searchTerms: +Array of search terms. These terms are case-insensitive.
  • +
  • silent: +If true, npm will not log anything to the console.
  • +
  • staleness: +This is the threshold for stale packages. "Fresh" packages are not refreshed +from the registry. This value is measured in seconds.
  • +
  • callback: +Returns an object where each key is the name of a package, and the value +is information about that package along with a 'words' property, which is +a space-delimited string of all of the interesting words in that package. +The only properties included are those that are searched, which generally include:

    +
      +
    • name
    • +
    • description
    • +
    • maintainers
    • +
    • url
    • +
    • keywords
    • +
    +
  • +
+

A search on the registry excludes any result that does not match all of the +search terms. It also removes any items from the results that contain an +excluded term (the "searchexclude" config). The search is case insensitive +and doesn't try to read your mind (it doesn't do any verb tense matching or the +like).

+ +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-shrinkwrap.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-shrinkwrap.html new file mode 100644 index 00000000..861dd876 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-shrinkwrap.html @@ -0,0 +1,37 @@ + + + npm-shrinkwrap + + + + + + +
+ +

npm-shrinkwrap

programmatically generate package shrinkwrap file

+

SYNOPSIS

+
npm.commands.shrinkwrap(args, [silent,] callback)
+

DESCRIPTION

+

This acts much the same ways as shrinkwrapping on the command-line.

+

This command does not take any arguments, but 'args' must be defined. +Beyond that, if any arguments are passed in, npm will politely warn that it +does not take positional arguments.

+

If the 'silent' parameter is set to true, nothing will be output to the screen, +but the shrinkwrap file will still be written.

+

Finally, 'callback' is a function that will be called when the shrinkwrap has +been saved.

+ +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-start.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-start.html new file mode 100644 index 00000000..fcb3bc5d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-start.html @@ -0,0 +1,32 @@ + + + npm-start + + + + + + +
+ +

npm-start

Start a package

+

SYNOPSIS

+
npm.commands.start(packages, callback)
+

DESCRIPTION

+

This runs a package's "start" script, if one was provided.

+

npm can start multiple packages. Just specify multiple packages in the +packages parameter.

+ +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-stop.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-stop.html new file mode 100644 index 00000000..b533b0f8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-stop.html @@ -0,0 +1,32 @@ + + + npm-stop + + + + + + +
+ +

npm-stop

Stop a package

+

SYNOPSIS

+
npm.commands.stop(packages, callback)
+

DESCRIPTION

+

This runs a package's "stop" script, if one was provided.

+

npm can run stop on multiple packages. Just specify multiple packages +in the packages parameter.

+ +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-tag.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-tag.html new file mode 100644 index 00000000..88b52279 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-tag.html @@ -0,0 +1,40 @@ + + + npm-tag + + + + + + +
+ +

npm-tag

Tag a published version

+

SYNOPSIS

+
npm.commands.tag(package@version, tag, callback)
+

DESCRIPTION

+

Tags the specified version of the package with the specified tag, or the +--tag config if not specified.

+

The 'package@version' is an array of strings, but only the first two elements are +currently used.

+

The first element must be in the form package@version, where package +is the package name and version is the version number (much like installing a +specific version).

+

The second element is the name of the tag to tag this version with. If this +parameter is missing or falsey (empty), the default from the config will be +used. For more information about how to set this config, check +man 3 npm-config for programmatic usage or man npm-config for cli usage.

+ +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-test.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-test.html new file mode 100644 index 00000000..58f99382 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-test.html @@ -0,0 +1,34 @@ + + + npm-test + + + + + + +
+ +

npm-test

Test a package

+

SYNOPSIS

+
  npm.commands.test(packages, callback)
+

DESCRIPTION

+

This runs a package's "test" script, if one was provided.

+

To run tests as a condition of installation, set the npat config to +true.

+

npm can run tests on multiple packages. Just specify multiple packages +in the packages parameter.

+ +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-uninstall.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-uninstall.html new file mode 100644 index 00000000..2e9b6712 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-uninstall.html @@ -0,0 +1,34 @@ + + + npm-uninstall + + + + + + +
+ +

npm-uninstall

uninstall a package programmatically

+

SYNOPSIS

+
npm.commands.uninstall(packages, callback)
+

DESCRIPTION

+

This acts much the same ways as uninstalling on the command-line.

+

The 'packages' parameter is an array of strings. Each element in the array is +the name of a package to be uninstalled.

+

Finally, 'callback' is a function that will be called when all packages have been +uninstalled or when an error has been encountered.

+ +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-unpublish.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-unpublish.html new file mode 100644 index 00000000..f1365e9a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-unpublish.html @@ -0,0 +1,37 @@ + + + npm-unpublish + + + + + + +
+ +

npm-unpublish

Remove a package from the registry

+

SYNOPSIS

+
npm.commands.unpublish(package, callback)
+

DESCRIPTION

+

This removes a package version from the registry, deleting its +entry and removing the tarball.

+

The package parameter must be defined.

+

Only the first element in the package parameter is used. If there is no first +element, then npm assumes that the package at the current working directory +is what is meant.

+

If no version is specified, or if all versions are removed then +the root package entry is removed from the registry entirely.

+ +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-update.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-update.html new file mode 100644 index 00000000..ebae0f91 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-update.html @@ -0,0 +1,37 @@ + + + npm-update + + + + + + +
+ +

npm-update

Update a package

+

SYNOPSIS

+
npm.commands.update(packages, callback)
+

DESCRIPTION

+

Updates a package, upgrading it to the latest version. It also installs any +missing packages.

+

The packages argument is an array of packages to update. The callback +parameter will be called when done or when an error occurs.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-version.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-version.html new file mode 100644 index 00000000..50b2a15f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-version.html @@ -0,0 +1,36 @@ + + + npm-version + + + + + + +
+ +

npm-version

Bump a package version

+

SYNOPSIS

+
npm.commands.version(newversion, callback)
+

DESCRIPTION

+

Run this in a package directory to bump the version and write the new +data back to the package.json file.

+

If run in a git repo, it will also create a version commit and tag, and +fail if the repo is not clean.

+

Like all other commands, this function takes a string array as its first +parameter. The difference, however, is this function will fail if it does +not have exactly one element. The only element should be a version number.

+ +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-view.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-view.html new file mode 100644 index 00000000..a34dad39 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-view.html @@ -0,0 +1,85 @@ + + + npm-view + + + + + + +
+ +

npm-view

View registry info

+

SYNOPSIS

+
npm.commands.view(args, [silent,] callback)
+

DESCRIPTION

+

This command shows data about a package and prints it to the stream +referenced by the outfd config, which defaults to stdout.

+

The "args" parameter is an ordered list that closely resembles the command-line +usage. The elements should be ordered such that the first element is +the package and version (package@version). The version is optional. After that, +the rest of the parameters are fields with optional subfields ("field.subfield") +which can be used to get only the information desired from the registry.

+

The callback will be passed all of the data returned by the query.

+

For example, to get the package registry entry for the connect package, +you can do this:

+
npm.commands.view(["connect"], callback)
+

If no version is specified, "latest" is assumed.

+

Field names can be specified after the package descriptor. +For example, to show the dependencies of the ronn package at version +0.3.5, you could do the following:

+
npm.commands.view(["ronn@0.3.5", "dependencies"], callback)
+

You can view child field by separating them with a period. +To view the git repository URL for the latest version of npm, you could +do this:

+
npm.commands.view(["npm", "repository.url"], callback)
+

For fields that are arrays, requesting a non-numeric field will return +all of the values from the objects in the list. For example, to get all +the contributor names for the "express" project, you can do this:

+
npm.commands.view(["express", "contributors.email"], callback)
+

You may also use numeric indices in square braces to specifically select +an item in an array field. To just get the email address of the first +contributor in the list, you can do this:

+
npm.commands.view(["express", "contributors[0].email"], callback)
+

Multiple fields may be specified, and will be printed one after another. +For exampls, to get all the contributor names and email addresses, you +can do this:

+
npm.commands.view(["express", "contributors.name", "contributors.email"], callback)
+

"Person" fields are shown as a string if they would be shown as an +object. So, for example, this will show the list of npm contributors in +the shortened string format. (See npm help json for more on this.)

+
npm.commands.view(["npm", "contributors"], callback)
+

If a version range is provided, then data will be printed for every +matching version of the package. This will show which version of jsdom +was required by each matching version of yui3:

+
npm.commands.view(["yui3@>0.5.4", "dependencies.jsdom"], callback)
+

OUTPUT

+

If only a single string field for a single version is output, then it +will not be colorized or quoted, so as to enable piping the output to +another command.

+

If the version range matches multiple versions, than each printed value +will be prefixed with the version it applies to.

+

If multiple fields are requested, than each of them are prefixed with +the field name.

+

Console output can be disabled by setting the 'silent' parameter to true.

+

RETURN VALUE

+

The data returned will be an object in this formation:

+
{ <version>:
+  { <field>: <value>
+  , ... }
+, ... }
+

corresponding to the list of fields selected.

+ +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-whoami.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-whoami.html new file mode 100644 index 00000000..dc9d7e6a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm-whoami.html @@ -0,0 +1,33 @@ + + + npm-whoami + + + + + + +
+ +

npm-whoami

Display npm username

+

SYNOPSIS

+
npm.commands.whoami(args, callback)
+

DESCRIPTION

+

Print the username config to standard output.

+

'args' is never used and callback is never called with data. +'args' must be present or things will break.

+

This function is not useful programmatically

+ +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm.html new file mode 100644 index 00000000..f4307be3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/api/npm.html @@ -0,0 +1,113 @@ + + + npm + + + + + + +
+ +

npm

javascript package manager

+

SYNOPSIS

+
var npm = require("npm")
+npm.load([configObject, ]function (er, npm) {
+  // use the npm object, now that it's loaded.
+
+  npm.config.set(key, val)
+  val = npm.config.get(key)
+
+  console.log("prefix = %s", npm.prefix)
+
+  npm.commands.install(["package"], cb)
+})
+

VERSION

+

2.15.11

+

DESCRIPTION

+

This is the API documentation for npm. +To find documentation of the command line +client, see npm(1).

+

Prior to using npm's commands, npm.load() must be called. If you provide +configObject as an object map of top-level configs, they override the values +stored in the various config locations. In the npm command line client, this +set of configs is parsed from the command line options. Additional +configuration params are loaded from two configuration files. See +npm-config(1), npm-config(7), and npmrc(5) for more information.

+

After that, each of the functions are accessible in the +commands object: npm.commands.<cmd>. See npm-index(7) for a list of +all possible commands.

+

All commands on the command object take an array of positional argument +strings. The last argument to any function is a callback. Some +commands take other optional arguments.

+

Configs cannot currently be set on a per function basis, as each call to +npm.config.set will change the value for all npm commands in that process.

+

To find API documentation for a specific command, run the npm apihelp +command.

+

METHODS AND PROPERTIES

+
    +
  • npm.load(configs, cb)

    +

    Load the configuration params, and call the cb function once the + globalconfig and userconfig files have been loaded as well, or on + nextTick if they've already been loaded.

    +
  • +
  • npm.config

    +

    An object for accessing npm configuration parameters.

    +
      +
    • npm.config.get(key)
    • +
    • npm.config.set(key, val)
    • +
    • npm.config.del(key)
    • +
    +
  • +
  • npm.dir or npm.root

    +

    The node_modules directory where npm will operate.

    +
  • +
  • npm.prefix

    +

    The prefix where npm is operating. (Most often the current working + directory.)

    +
  • +
  • npm.cache

    +

    The place where npm keeps JSON and tarballs it fetches from the + registry (or uploads to the registry).

    +
  • +
  • npm.tmp

    +

    npm's temporary working directory.

    +
  • +
  • npm.deref

    +

    Get the "real" name for a command that has either an alias or + abbreviation.

    +
  • +
+

MAGIC

+

For each of the methods in the npm.commands object, a method is added to the +npm object, which takes a set of positional string arguments rather than an +array and a callback.

+

If the last argument is a callback, then it will use the supplied +callback. However, if no callback is provided, then it will print out +the error or results.

+

For example, this would work in a node repl:

+
> npm = require("npm")
+> npm.load()  // wait a sec...
+> npm.install("dnode", "express")
+

Note that that won't work in a node program, since the install +method will get called before the configuration load is completed.

+

ABBREVS

+

In order to support npm ins foo instead of npm install foo, the +npm.commands object has a set of abbreviations as well as the full +method names. Use the npm.deref method to find the real name.

+

For example:

+
var cmd = npm.deref("unp") // cmd === "unpublish"
+
+
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-access.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-access.html new file mode 100644 index 00000000..e702859b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-access.html @@ -0,0 +1,88 @@ + + + npm-access + + + + + + +
+ +

npm-access

Set access level on published packages

+

SYNOPSIS

+
npm access public [<package>]
+npm access restricted [<package>]
+
+npm access grant <read-only|read-write> <scope:team> [<package>]
+npm access revoke <scope:team> [<package>]
+
+npm access ls-packages [<user>|<scope>|<scope:team>]
+npm access ls-collaborators [<package> [<user>]]
+npm access edit [<package>]
+

DESCRIPTION

+

Used to set access controls on private packages.

+

For all of the subcommands, npm access will perform actions on the packages +in the current working directory if no package name is passed to the +subcommand.

+
    +
  • public / restricted: +Set a package to be either publicly accessible or restricted.

    +
  • +
  • grant / revoke: +Add or remove the ability of users and teams to have read-only or read-write +access to a package.

    +
  • +
  • ls-packages:

    +

    Show all of the packages a user or a team is able to access, along with the +access level, except for read-only public packages (it won't print the whole +registry listing)

    +
  • +
  • ls-collaborators: +Show all of the access privileges for a package. Will only show permissions +for packages to which you have at least read access. If <user> is passed in, +the list is filtered only to teams that user happens to belong to.

    +
  • +
  • edit: +Set the access privileges for a package at once using $EDITOR.

    +
  • +
+

DETAILS

+

npm access always operates directly on the current registry, configurable +from the command line using --registry=<registry url>.

+

Unscoped packages are always public.

+

Scoped packages default to restricted, but you can either publish them as +public using npm publish --access=public, or set their access as public using +npm access public after the initial publish.

+

You must have privileges to set the access of a package:

+
    +
  • You are an owner of an unscoped or scoped package.
  • +
  • You are a member of the team that owns a scope.
  • +
  • You have been given read-write privileges for a package, either as a member +of a team or directly as an owner.
  • +
+

If your account is not paid, then attempts to publish scoped packages will fail +with an HTTP 402 status code (logically enough), unless you use +--access=public.

+

Management of teams and team memberships is done with the npm team command.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-adduser.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-adduser.html new file mode 100644 index 00000000..6ef0d86f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-adduser.html @@ -0,0 +1,76 @@ + + + npm-adduser + + + + + + +
+ +

npm-adduser

Add a registry user account

+

SYNOPSIS

+
npm adduser [--registry=url] [--scope=@orgname] [--always-auth]
+
+aliases: login, add-user
+

DESCRIPTION

+

Create or verify a user named <username> in the specified registry, and +save the credentials to the .npmrc file. If no registry is specified, +the default registry will be used (see npm-config(7)).

+

The username, password, and email are read in from prompts.

+

To reset your password, go to https://www.npmjs.com/forgot

+

To change your email address, go to https://www.npmjs.com/email-edit

+

You may use this command multiple times with the same user account to +authorize on a new machine. When authenticating on a new machine, +the username, password and email address must all match with +your existing record.

+

npm login is an alias to adduser and behaves exactly the same way.

+

CONFIGURATION

+

registry

+

Default: https://registry.npmjs.org/

+

The base URL of the npm package registry. If scope is also specified, +this registry will only be used for packages with that scope. See npm-scope(7).

+

scope

+

Default: none

+

If specified, the user and login credentials given will be associated +with the specified scope. See npm-scope(7). You can use both at the same time, +e.g.

+
npm adduser --registry=http://myregistry.example.com --scope=@myco
+

This will set a registry for the given scope and login or create a user for +that registry at the same time.

+

always-auth

+

Default: false

+

If specified, save configuration indicating that all requests to the given +registry should include authorization information. Useful for private +registries. Can be used with --registry and / or --scope, e.g.

+
npm adduser --registry=http://private-registry.example.com --always-auth
+

This will ensure that all requests to that registry (including for tarballs) +include an authorization header. This setting may be necessary for use with +private registries where metadata and package tarballs are stored on hosts with +different hostnames. See always-auth in npm-config(7) for more details on +always-auth. Registry-specific configuration of always-auth takes precedence +over any global configuration.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-bin.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-bin.html new file mode 100644 index 00000000..ba9f48ab --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-bin.html @@ -0,0 +1,39 @@ + + + npm-bin + + + + + + +
+ +

npm-bin

Display npm bin folder

+

SYNOPSIS

+
npm bin
+

DESCRIPTION

+

Print the folder where npm will install executables.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-bugs.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-bugs.html new file mode 100644 index 00000000..9641719d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-bugs.html @@ -0,0 +1,60 @@ + + + npm-bugs + + + + + + +
+ +

npm-bugs

Bugs for a package in a web browser maybe

+

SYNOPSIS

+
npm bugs <pkgname>
+npm bugs (with no args in a package dir)
+
+aliases: issues
+

DESCRIPTION

+

This command tries to guess at the likely location of a package's +bug tracker URL, and then tries to open it using the --browser +config param. If no package name is provided, it will search for +a package.json in the current folder and use the name property.

+

CONFIGURATION

+

browser

+
    +
  • Default: OS X: "open", Windows: "start", Others: "xdg-open"
  • +
  • Type: String
  • +
+

The browser that is called by the npm bugs command to open websites.

+

registry

+ +

The base URL of the npm package registry.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-build.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-build.html new file mode 100644 index 00000000..1952dff0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-build.html @@ -0,0 +1,44 @@ + + + npm-build + + + + + + +
+ +

npm-build

Build a package

+

SYNOPSIS

+
npm build <package-folder>
+
    +
  • <package-folder>: +A folder containing a package.json file in its root.
  • +
+

DESCRIPTION

+

This is the plumbing command called by npm link and npm install.

+

It should generally be called during installation, but if you need to run it +directly, run:

+
npm run-script build
+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-bundle.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-bundle.html new file mode 100644 index 00000000..9f60d308 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-bundle.html @@ -0,0 +1,35 @@ + + + npm-bundle + + + + + + +
+ +

npm-bundle

REMOVED

+

DESCRIPTION

+

The npm bundle command has been removed in 1.0, for the simple reason +that it is no longer necessary, as the default behavior is now to +install packages into the local space.

+

Just use npm install now to do what npm bundle used to do.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-cache.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-cache.html new file mode 100644 index 00000000..71ce4b2a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-cache.html @@ -0,0 +1,85 @@ + + + npm-cache + + + + + + +
+ +

npm-cache

Manipulates packages cache

+

SYNOPSIS

+
npm cache add <tarball file>
+npm cache add <folder>
+npm cache add <tarball url>
+npm cache add <name>@<version>
+
+npm cache ls [<path>]
+
+npm cache clean [<path>]
+

DESCRIPTION

+

Used to add, list, or clear the npm cache folder.

+
    +
  • add: +Add the specified package to the local cache. This command is primarily +intended to be used internally by npm, but it can provide a way to +add data to the local installation cache explicitly.

    +
  • +
  • ls: +Show the data in the cache. Argument is a path to show in the cache +folder. Works a bit like the find program, but limited by the +depth config.

    +
  • +
  • clean: +Delete data out of the cache folder. If an argument is provided, then +it specifies a subpath to delete. If no argument is provided, then +the entire cache is cleared.

    +
  • +
+

DETAILS

+

npm stores cache data in the directory specified in npm config get cache. +For each package that is added to the cache, three pieces of information are +stored in {cache}/{name}/{version}:

+
    +
  • .../package/package.json: +The package.json file, as npm sees it.
  • +
  • .../package.tgz: +The tarball for that version.
  • +
+

Additionally, whenever a registry request is made, a .cache.json file +is placed at the corresponding URI, to store the ETag and the requested +data. This is stored in {cache}/{hostname}/{path}/.cache.json.

+

Commands that make non-essential registry requests (such as search and +view, or the completion scripts) generally specify a minimum timeout. +If the .cache.json file is younger than the specified timeout, then +they do not make an HTTP request to the registry.

+

CONFIGURATION

+

cache

+

Default: ~/.npm on Posix, or %AppData%/npm-cache on Windows.

+

The root cache folder.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-completion.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-completion.html new file mode 100644 index 00000000..7bc38fd7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-completion.html @@ -0,0 +1,46 @@ + + + npm-completion + + + + + + +
+ +

npm-completion

Tab Completion for npm

+

SYNOPSIS

+
. <(npm completion)
+

DESCRIPTION

+

Enables tab-completion in all npm commands.

+

The synopsis above +loads the completions into your current shell. Adding it to +your ~/.bashrc or ~/.zshrc will make the completions available +everywhere.

+

You may of course also pipe the output of npm completion to a file +such as /usr/local/etc/bash_completion.d/npm if you have a system +that will read that file for you.

+

When COMP_CWORD, COMP_LINE, and COMP_POINT are defined in the +environment, npm completion acts in "plumbing mode", and outputs +completions based on the arguments.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-config.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-config.html new file mode 100644 index 00000000..5ebcbc80 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-config.html @@ -0,0 +1,72 @@ + + + npm-config + + + + + + +
+ +

npm-config

Manage the npm configuration files

+

SYNOPSIS

+
npm config set <key> <value> [--global]
+npm config get <key>
+npm config delete <key>
+npm config list
+npm config edit
+npm c [set|get|delete|list]
+npm get <key>
+npm set <key> <value> [--global]
+
+aliases: c
+

DESCRIPTION

+

npm gets its config settings from the command line, environment +variables, npmrc files, and in some cases, the package.json file.

+

See npmrc(5) for more information about the npmrc files.

+

See npm-config(7) for a more thorough discussion of the mechanisms +involved.

+

The npm config command can be used to update and edit the contents +of the user and global npmrc files.

+

Sub-commands

+

Config supports the following sub-commands:

+

set

+
npm config set key value
+

Sets the config key to the value.

+

If value is omitted, then it sets it to "true".

+

get

+
npm config get key
+

Echo the config value to stdout.

+

list

+
npm config list
+

Show all the config settings.

+

delete

+
npm config delete key
+

Deletes the key from all configuration files.

+

edit

+
npm config edit
+

Opens the config file in an editor. Use the --global flag to edit the +global config.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-dedupe.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-dedupe.html new file mode 100644 index 00000000..15e2884e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-dedupe.html @@ -0,0 +1,69 @@ + + + npm-dedupe + + + + + + +
+ +

npm-dedupe

Reduce duplication

+

SYNOPSIS

+
npm dedupe [package names...]
+npm ddp [package names...]
+
+aliases: find-dupes, ddp
+

DESCRIPTION

+

Searches the local package tree and attempts to simplify the overall +structure by moving dependencies further up the tree, where they can +be more effectively shared by multiple dependent packages.

+

For example, consider this dependency graph:

+
a
++-- b <-- depends on c@1.0.x
+|   `-- c@1.0.3
+`-- d <-- depends on c@~1.0.9
+    `-- c@1.0.10
+

In this case, npm-dedupe(1) will transform the tree to:

+
a
++-- b
++-- d
+`-- c@1.0.10
+

Because of the hierarchical nature of node's module lookup, b and d +will both get their dependency met by the single c package at the root +level of the tree.

+

If a suitable version exists at the target location in the tree +already, then it will be left untouched, but the other duplicates will +be deleted.

+

If no suitable version can be found, then a warning is printed, and +nothing is done.

+

If any arguments are supplied, then they are filters, and only the +named packages will be touched.

+

Note that this operation transforms the dependency tree, and may +result in packages getting updated versions, perhaps from the npm +registry.

+

This feature is experimental, and may change in future versions.

+

The --tag argument will apply to all of the affected dependencies. If a +tag with the given name exists, the tagged version is preferred over newer +versions.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-deprecate.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-deprecate.html new file mode 100644 index 00000000..92daebf5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-deprecate.html @@ -0,0 +1,42 @@ + + + npm-deprecate + + + + + + +
+ +

npm-deprecate

Deprecate a version of a package

+

SYNOPSIS

+
npm deprecate <name>[@<version>] <message>
+

DESCRIPTION

+

This command will update the npm registry entry for a package, providing +a deprecation warning to all who attempt to install it.

+

It works on version ranges as well as specific versions, so you can do +something like this:

+
npm deprecate my-thing@"< 0.2.3" "critical bug fixed in v0.2.3"
+

Note that you must be the package owner to deprecate something. See the +owner and adduser help topics.

+

To un-deprecate a package, specify an empty string ("") for the message argument.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-dist-tag.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-dist-tag.html new file mode 100644 index 00000000..9821bda5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-dist-tag.html @@ -0,0 +1,91 @@ + + + npm-dist-tag + + + + + + +
+ +

npm-dist-tag

Modify package distribution tags

+

SYNOPSIS

+
npm dist-tag add <pkg>@<version> [<tag>]
+npm dist-tag rm <pkg> <tag>
+npm dist-tag ls [<pkg>]
+
+aliases: dist-tags
+

DESCRIPTION

+

Add, remove, and enumerate distribution tags on a package:

+
    +
  • add: +Tags the specified version of the package with the specified tag, or the +--tag config if not specified.

    +
  • +
  • rm: +Clear a tag that is no longer in use from the package.

    +
  • +
  • ls: +Show all of the dist-tags for a package, defaulting to the package in +the current prefix.

    +
  • +
+

A tag can be used when installing packages as a reference to a version instead +of using a specific version number:

+
npm install <name>@<tag>
+

When installing dependencies, a preferred tagged version may be specified:

+
npm install --tag <tag>
+

This also applies to npm dedupe.

+

Publishing a package sets the latest tag to the published version unless the +--tag option is used. For example, npm publish --tag=beta.

+

By default, npm install <pkg> (without any @<version> or @<tag> +specifier) installs the latest tag.

+

PURPOSE

+

Tags can be used to provide an alias instead of version numbers.

+

For example, a project might choose to have multiple streams of development +and use a different tag for each stream, +e.g., stable, beta, dev, canary.

+

By default, the latest tag is used by npm to identify the current version of +a package, and npm install <pkg> (without any @<version> or @<tag> +specifier) installs the latest tag. Typically, projects only use the latest +tag for stable release versions, and use other tags for unstable versions such +as prereleases.

+

The next tag is used by some projects to identify the upcoming version.

+

By default, other than latest, no tag has any special significance to npm +itself.

+

CAVEATS

+

This command used to be known as npm tag, which only created new tags, and so +had a different syntax.

+

Tags must share a namespace with version numbers, because they are specified in +the same slot: npm install <pkg>@<version> vs npm install <pkg>@<tag>.

+

Tags that can be interpreted as valid semver ranges will be rejected. For +example, v1.4 cannot be used as a tag, because it is interpreted by semver as +>=1.4.0 <1.5.0. See https://github.com/npm/npm/issues/6082.

+

The simplest way to avoid semver problems with tags is to use tags that do not +begin with a number or the letter v.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-docs.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-docs.html new file mode 100644 index 00000000..75e7b0db --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-docs.html @@ -0,0 +1,60 @@ + + + npm-docs + + + + + + +
+ +

npm-docs

Docs for a package in a web browser maybe

+

SYNOPSIS

+
npm docs [<pkgname> [<pkgname> ...]]
+npm docs (with no args in a package dir)
+npm home [<pkgname> [<pkgname> ...]]
+npm home (with no args in a package dir)
+

DESCRIPTION

+

This command tries to guess at the likely location of a package's +documentation URL, and then tries to open it using the --browser +config param. You can pass multiple package names at once. If no +package name is provided, it will search for a package.json in +the current folder and use the name property.

+

CONFIGURATION

+

browser

+
    +
  • Default: OS X: "open", Windows: "start", Others: "xdg-open"
  • +
  • Type: String
  • +
+

The browser that is called by the npm docs command to open websites.

+

registry

+ +

The base URL of the npm package registry.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-edit.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-edit.html new file mode 100644 index 00000000..a8748879 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-edit.html @@ -0,0 +1,53 @@ + + + npm-edit + + + + + + +
+ +

npm-edit

Edit an installed package

+

SYNOPSIS

+
npm edit <name>[@<version>]
+

DESCRIPTION

+

Opens the package folder in the default editor (or whatever you've +configured as the npm editor config -- see npm-config(7).)

+

After it has been edited, the package is rebuilt so as to pick up any +changes in compiled packages.

+

For instance, you can do npm install connect to install connect +into your package, and then npm edit connect to make a few +changes to your locally installed copy.

+

CONFIGURATION

+

editor

+
    +
  • Default: EDITOR environment variable if set, or "vi" on Posix, +or "notepad" on Windows.
  • +
  • Type: path
  • +
+

The command to run for npm edit or npm config edit.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-explore.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-explore.html new file mode 100644 index 00000000..b4aa0941 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-explore.html @@ -0,0 +1,53 @@ + + + npm-explore + + + + + + +
+ +

npm-explore

Browse an installed package

+

SYNOPSIS

+
npm explore <name> [ -- <cmd>]
+

DESCRIPTION

+

Spawn a subshell in the directory of the installed package specified.

+

If a command is specified, then it is run in the subshell, which then +immediately terminates.

+

This is particularly handy in the case of git submodules in the +node_modules folder:

+
npm explore some-dependency -- git pull origin master
+

Note that the package is not automatically rebuilt afterwards, so be +sure to use npm rebuild <pkg> if you make any changes.

+

CONFIGURATION

+

shell

+
    +
  • Default: SHELL environment variable, or "bash" on Posix, or "cmd" on +Windows
  • +
  • Type: path
  • +
+

The shell to run for the npm explore command.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-help-search.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-help-search.html new file mode 100644 index 00000000..80325ed1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-help-search.html @@ -0,0 +1,50 @@ + + + npm-help-search + + + + + + +
+ +

npm-help-search

Search npm help documentation

+

SYNOPSIS

+
npm help-search some search terms
+

DESCRIPTION

+

This command will search the npm markdown documentation files for the +terms provided, and then list the results, sorted by relevance.

+

If only one result is found, then it will show that help topic.

+

If the argument to npm help is not a known help topic, then it will +call help-search. It is rarely if ever necessary to call this +command directly.

+

CONFIGURATION

+

long

+
    +
  • Type: Boolean
  • +
  • Default: false
  • +
+

If true, the "long" flag will cause help-search to output context around +where the terms were found in the documentation.

+

If false, then help-search will just list out the help topics found.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-help.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-help.html new file mode 100644 index 00000000..e03c2fa6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-help.html @@ -0,0 +1,56 @@ + + + npm-help + + + + + + +
+ +

npm-help

Get help on npm

+

SYNOPSIS

+
npm help <topic>
+npm help some search terms
+

DESCRIPTION

+

If supplied a topic, then show the appropriate documentation page.

+

If the topic does not exist, or if multiple terms are provided, then run +the help-search command to find a match. Note that, if help-search +finds a single subject, then it will run help on that topic, so unique +matches are equivalent to specifying a topic name.

+

CONFIGURATION

+

viewer

+
    +
  • Default: "man" on Posix, "browser" on Windows
  • +
  • Type: path
  • +
+

The program to use to view help content.

+

Set to "browser" to view html help content in the default web browser.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-init.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-init.html new file mode 100644 index 00000000..0c2a2cac --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-init.html @@ -0,0 +1,52 @@ + + + npm-init + + + + + + +
+ +

npm-init

Interactively create a package.json file

+

SYNOPSIS

+
npm init [-f|--force|-y|--yes]
+

DESCRIPTION

+

This will ask you a bunch of questions, and then write a package.json for you.

+

It attempts to make reasonable guesses about what you want things to be set to, +and then writes a package.json file with the options you've selected.

+

If you already have a package.json file, it'll read that first, and default to +the options in there.

+

It is strictly additive, so it does not delete options from your package.json +without a really good reason to do so.

+

If you invoke it with -f, --force, -y, or --yes, it will use only +defaults and not prompt you for any options.

+

CONFIGURATION

+

scope

+
    +
  • Default: none
  • +
  • Type: String
  • +
+

The scope under which the new module should be created.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-install.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-install.html new file mode 100644 index 00000000..622a5b3e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-install.html @@ -0,0 +1,286 @@ + + + npm-install + + + + + + +
+ +

npm-install

Install a package

+

SYNOPSIS

+
npm install (with no args in a package dir)
+npm install <tarball file>
+npm install <tarball url>
+npm install <folder>
+npm install [@<scope>/]<name> [--save|--save-dev|--save-optional] [--save-exact] [--save-bundle]
+npm install [@<scope>/]<name>@<tag>
+npm install [@<scope>/]<name>@<version>
+npm install [@<scope>/]<name>@<version range>
+npm i (with any of the previous argument usage)
+

DESCRIPTION

+

This command installs a package, and any packages that it depends on. If the +package has a shrinkwrap file, the installation of dependencies will be driven +by that. See npm-shrinkwrap(1).

+

A package is:

+
    +
  • a) a folder containing a program described by a package.json(5) file
  • +
  • b) a gzipped tarball containing (a)
  • +
  • c) a url that resolves to (b)
  • +
  • d) a <name>@<version> that is published on the registry (see npm-registry(7)) with (c)
  • +
  • e) a <name>@<tag> (see npm-dist-tag(1)) that points to (d)
  • +
  • f) a <name> that has a "latest" tag satisfying (e)
  • +
  • g) a <git remote url> that resolves to (b)
  • +
+

Even if you never publish your package, you can still get a lot of +benefits of using npm if you just want to write a node program (a), and +perhaps if you also want to be able to easily install it elsewhere +after packing it up into a tarball (b).

+
    +
  • npm install (in package directory, no arguments):

    +

    Install the dependencies in the local node_modules folder.

    +

    In global mode (ie, with -g or --global appended to the command), + it installs the current package context (ie, the current working + directory) as a global package.

    +

    By default, npm install will install all modules listed as dependencies + in package.json(5).

    +

    With the --production flag (or when the NODE_ENV environment variable + is set to production), npm will not install modules listed in + devDependencies.

    +
  • +
  • npm install <folder>:

    +

    Install a package that is sitting in a folder on the filesystem.

    +
  • +
  • npm install <tarball file>:

    +

    Install a package that is sitting on the filesystem. Note: if you just want + to link a dev directory into your npm root, you can do this more easily by + using npm link.

    +

    Example:

    +
        npm install ./package.tgz
    +
  • +
  • npm install <tarball url>:

    +

    Fetch the tarball url, and then install it. In order to distinguish between + this and other options, the argument must start with "http://" or "https://"

    +

    Example:

    +
        npm install https://github.com/indexzero/forever/tarball/v0.5.6
    +
  • +
  • npm install [@<scope>/]<name> [--save|--save-dev|--save-optional]:

    +

    Do a <name>@<tag> install, where <tag> is the "tag" config. (See + npm-config(7). The config's default value is latest.)

    +

    In most cases, this will install the latest version + of the module published on npm.

    +

    Example:

    +
        npm install sax
    +

    npm install takes 3 exclusive, optional flags which save or update + the package version in your main package.json:

    +
      +
    • --save: Package will appear in your dependencies.

      +
    • +
    • --save-dev: Package will appear in your devDependencies.

      +
    • +
    • --save-optional: Package will appear in your optionalDependencies.

      +

      When using any of the above options to save dependencies to your +package.json, there are two additional, optional flags:

      +
    • +
    • --save-exact: Saved dependencies will be configured with an +exact version rather than using npm's default semver range +operator.

      +
    • +
    • -B, --save-bundle: Saved dependencies will also be added to your bundleDependencies list.

      +

      Note: if you do not include the @-symbol on your scope name, npm will +interpret this as a GitHub repository instead, see below. Scopes names +must also be followed by a slash.

      +

      Examples:

      +
      npm install sax --save
      +npm install githubname/reponame
      +npm install @myorg/privatepackage
      +npm install node-tap --save-dev
      +npm install dtrace-provider --save-optional
      +npm install readable-stream --save --save-exact
      +npm install ansi-regex --save --save-bundle
      +
    • +
    +
  • +
+
**Note**: If there is a file or folder named `<name>` in the current
+working directory, then it will try to install that, and only try to
+fetch the package by name if it is not valid.
+
    +
  • npm install [@<scope>/]<name>@<tag>:

    +

    Install the version of the package that is referenced by the specified tag. + If the tag does not exist in the registry data for that package, then this + will fail.

    +

    Example:

    +
        npm install sax@latest
    +    npm install @myorg/mypackage@latest
    +
  • +
  • npm install [@<scope>/]<name>@<version>:

    +

    Install the specified version of the package. This will fail if the + version has not been published to the registry.

    +

    Example:

    +
        npm install sax@0.1.1
    +    npm install @myorg/privatepackage@1.5.0
    +
  • +
  • npm install [@<scope>/]<name>@<version range>:

    +

    Install a version of the package matching the specified version range. This + will follow the same rules for resolving dependencies described in package.json(5).

    +

    Note that most version ranges must be put in quotes so that your shell will + treat it as a single argument.

    +

    Example:

    +
        npm install sax@">=0.1.0 <0.2.0"
    +    npm install @myorg/privatepackage@">=0.1.0 <0.2.0"
    +
  • +
  • npm install <git remote url>:

    +

    Install a package by cloning a git remote url. The format of the git + url is:

    +
        <protocol>://[<user>[:<password>]@]<hostname>[:<port>][:/]<path>[#<commit-ish>]
    +

    <protocol> is one of git, git+ssh, git+http, or + git+https. If no <commit-ish> is specified, then master is + used.

    +

    The following git environment variables are recognized by npm and will be added + to the environment when running git:

    +
      +
    • GIT_ASKPASS
    • +
    • GIT_EXEC_PATH
    • +
    • GIT_PROXY_COMMAND
    • +
    • GIT_SSH
    • +
    • GIT_SSH_COMMAND
    • +
    • GIT_SSL_CAINFO
    • +
    • GIT_SSL_NO_VERIFY

      +

      See the git man page for details.

      +

      Examples:

      +
      npm install git+ssh://git@github.com:npm/npm.git#v1.0.27
      +npm install git+https://isaacs@github.com/npm/npm.git
      +npm install git://github.com/npm/npm.git#v1.0.27
      +GIT_SSH_COMMAND='ssh -i ~/.ssh/custom_ident' npm install git+ssh://git@github.com:npm/npm.git
      +
    • +
    +
  • +
  • npm install <githubname>/<githubrepo>[#<commit-ish>]:

    +
  • +
  • npm install github:<githubname>/<githubrepo>[#<commit-ish>]:

    +

    Install the package at https://github.com/githubname/githubrepo by + attempting to clone it using git.

    +

    If you don't specify a commit-ish then master will be used.

    +

    Examples:

    +
        npm install mygithubuser/myproject
    +    npm install github:mygithubuser/myproject
    +
  • +
  • npm install gist:[<githubname>/]<gistID>[#<commit-ish>]:

    +

    Install the package at https://gist.github.com/gistID by attempting to + clone it using git. The GitHub username associated with the gist is + optional and will not be saved in package.json if --save is used.

    +

    If you don't specify a commit-ish then master will be used.

    +

    Example:

    +
        npm install gist:101a11beef
    +
  • +
  • npm install bitbucket:<bitbucketname>/<bitbucketrepo>[#<commit-ish>]:

    +

    Install the package at https://bitbucket.org/bitbucketname/bitbucketrepo + by attempting to clone it using git.

    +

    If you don't specify a commit-ish then master will be used.

    +

    Example:

    +
        npm install bitbucket:mybitbucketuser/myproject
    +
  • +
  • npm install gitlab:<gitlabname>/<gitlabrepo>[#<commit-ish>]:

    +

    Install the package at https://gitlab.com/gitlabname/gitlabrepo + by attempting to clone it using git.

    +

    If you don't specify a commit-ish then master will be used.

    +

    Example:

    +
        npm install gitlab:mygitlabuser/myproject
    +
  • +
+

You may combine multiple arguments, and even multiple types of arguments. +For example:

+
npm install sax@">=0.1.0 <0.2.0" bench supervisor
+

The --tag argument will apply to all of the specified install targets. If a +tag with the given name exists, the tagged version is preferred over newer +versions.

+

The --force argument will force npm to fetch remote resources even if a +local copy exists on disk.

+
npm install sax --force
+

The --global argument will cause npm to install the package globally +rather than locally. See npm-folders(5).

+

The --ignore-scripts argument will cause npm to not execute any +scripts defined in the package.json. See npm-scripts(7).

+

The --link argument will cause npm to link global installs into the +local space in some cases.

+

The --no-bin-links argument will prevent npm from creating symlinks for +any binaries the package might contain.

+

The --no-optional argument will prevent optional dependencies from +being installed.

+

The --no-shrinkwrap argument, which will ignore an available +shrinkwrap file and use the package.json instead.

+

The --nodedir=/path/to/node/source argument will allow npm to find the +node source code so that npm can compile native modules.

+

See npm-config(7). Many of the configuration params have some +effect on installation, since that's most of what npm does.

+

ALGORITHM

+

To install a package, npm uses the following algorithm:

+
install(where, what, family, ancestors)
+fetch what, unpack to <where>/node_modules/<what>
+for each dep in what.dependencies
+  resolve dep to precise version
+for each dep@version in what.dependencies
+    not in <where>/node_modules/<what>/node_modules/*
+    and not in <family>
+  add precise version deps to <family>
+  install(<where>/node_modules/<what>, dep, family)
+

For this package{dep} structure: A{B,C}, B{C}, C{D}, +this algorithm produces:

+
A
++-- B
+`-- C
+    `-- D
+

That is, the dependency from B to C is satisfied by the fact that A +already caused C to be installed at a higher level.

+

See npm-folders(5) for a more detailed description of the specific +folder structures that npm creates.

+

Limitations of npm's Install Algorithm

+

There are some very rare and pathological edge-cases where a cycle can +cause npm to try to install a never-ending tree of packages. Here is +the simplest case:

+
A -> B -> A' -> B' -> A -> B -> A' -> B' -> A -> ...
+

where A is some version of a package, and A' is a different version +of the same package. Because B depends on a different version of A +than the one that is already in the tree, it must install a separate +copy. The same is true of A', which must install B'. Because B' +depends on the original version of A, which has been overridden, the +cycle falls into infinite regress.

+

To avoid this situation, npm flat-out refuses to install any +name@version that is already present anywhere in the tree of package +folder ancestors. A more correct, but more complex, solution would be +to symlink the existing version into the new location. If this ever +affects a real use-case, it will be investigated.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-link.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-link.html new file mode 100644 index 00000000..9572f9b6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-link.html @@ -0,0 +1,78 @@ + + + npm-link + + + + + + +
+ +

npm-link

Symlink a package folder

+

SYNOPSIS

+
npm link (in package folder)
+npm link [@<scope>/]<pkgname>
+npm ln (with any of the previous argument usage)
+

DESCRIPTION

+

Package linking is a two-step process.

+

First, npm link in a package folder will create a symlink in the global folder +{prefix}/lib/node_modules/<package> that links to the package where the npm +link command was executed. (see npm-config(7) for the value of prefix). It +will also link any bins in the package to {prefix}/bin/{name}.

+

Next, in some other location, npm link package-name will create a +symbolic link from globally-installed package-name to node_modules/ +of the current folder.

+

Note that package-name is taken from package.json, +not from directory name.

+

The package name can be optionally prefixed with a scope. See npm-scope(7). +The scope must be preceded by an @-symbol and followed by a slash.

+

When creating tarballs for npm publish, the linked packages are +"snapshotted" to their current state by resolving the symbolic links.

+

This is handy for installing your own stuff, so that you can work on it and +test it iteratively without having to continually rebuild.

+

For example:

+
cd ~/projects/node-redis    # go into the package directory
+npm link                    # creates global link
+cd ~/projects/node-bloggy   # go into some other package directory.
+npm link redis              # link-install the package
+

Now, any changes to ~/projects/node-redis will be reflected in +~/projects/node-bloggy/node_modules/node-redis/. Note that the link should +be to the package name, not the directory name for that package.

+

You may also shortcut the two steps in one. For example, to do the +above use-case in a shorter way:

+
cd ~/projects/node-bloggy  # go into the dir of your main project
+npm link ../node-redis     # link the dir of your dependency
+

The second line is the equivalent of doing:

+
(cd ../node-redis; npm link)
+npm link node-redis
+

That is, it first creates a global link, and then links the global +installation target into your project's node_modules folder.

+

If your linked package is scoped (see npm-scope(7)) your link command must +include that scope, e.g.

+
npm link @myorg/privatepackage
+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-logout.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-logout.html new file mode 100644 index 00000000..8ae31161 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-logout.html @@ -0,0 +1,55 @@ + + + npm-logout + + + + + + +
+ +

npm-logout

Log out of the registry

+

SYNOPSIS

+
npm logout [--registry=url] [--scope=@orgname]
+

DESCRIPTION

+

When logged into a registry that supports token-based authentication, tell the +server to end this token's session. This will invalidate the token everywhere +you're using it, not just for the current environment.

+

When logged into a legacy registry that uses username and password authentication, this will +clear the credentials in your user configuration. In this case, it will only affect +the current environment.

+

If --scope is provided, this will find the credentials for the registry +connected to that scope, if set.

+

CONFIGURATION

+

registry

+

Default: https://registry.npmjs.org/

+

The base URL of the npm package registry. If scope is also specified, +it takes precedence.

+

scope

+

Default: none

+

If specified, you will be logged out of the specified scope. See npm-scope(7).

+
npm logout --scope=@myco
+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-ls.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-ls.html new file mode 100644 index 00000000..d00347d1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-ls.html @@ -0,0 +1,101 @@ + + + npm-ls + + + + + + +
+ +

npm-ls

List installed packages

+

SYNOPSIS

+
npm list [[@<scope>/]<pkg> ...]
+npm ls [[@<scope>/]<pkg> ...]
+npm la [[@<scope>/]<pkg> ...]
+npm ll [[@<scope>/]<pkg> ...]
+

DESCRIPTION

+

This command will print to stdout all the versions of packages that are +installed, as well as their dependencies, in a tree-structure.

+

Positional arguments are name@version-range identifiers, which will +limit the results to only the paths to the packages named. Note that +nested packages will also show the paths to the specified packages. +For example, running npm ls promzard in npm's source tree will show:

+
npm@2.15.11 /path/to/npm
+└─┬ init-package-json@0.0.4
+  └── promzard@0.1.5
+

It will print out extraneous, missing, and invalid packages.

+

If a project specifies git urls for dependencies these are shown +in parentheses after the name@version to make it easier for users to +recognize potential forks of a project.

+

When run as ll or la, it shows extended information by default.

+

CONFIGURATION

+

json

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Show information in JSON format.

+

long

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Show extended information.

+

parseable

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Show parseable output instead of tree view.

+

global

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

List packages in the global install prefix instead of in the current +project.

+

depth

+
    +
  • Type: Int
  • +
+

Max display depth of the dependency tree.

+

prod / production

+
    +
  • Type: Boolean
  • +
  • Default: false
  • +
+

Display only the dependency tree for packages in dependencies.

+

dev

+
    +
  • Type: Boolean
  • +
  • Default: false
  • +
+

Display only the dependency tree for packages in devDependencies.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-outdated.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-outdated.html new file mode 100644 index 00000000..0bb84774 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-outdated.html @@ -0,0 +1,120 @@ + + + npm-outdated + + + + + + +
+ +

npm-outdated

Check for outdated packages

+

SYNOPSIS

+
npm outdated [<name> [<name> ...]]
+

DESCRIPTION

+

This command will check the registry to see if any (or, specific) installed +packages are currently outdated.

+

In the output:

+
    +
  • wanted is the maximum version of the package that satisfies the semver +range specified in package.json. If there's no available semver range (i.e. +you're running npm outdated --global, or the package isn't included in +package.json), then wanted shows the currently-installed version.
  • +
  • latest is the version of the package tagged as latest in the registry. +Running npm publish with no special configuration will publish the package +with a dist-tag of latest. This may or may not be the maximum version of +the package, or the most-recently published version of the package, depending +on how the package's developer manages the latest dist-tag(1).
  • +
  • location is where in the dependency tree the package is located. Note that +npm outdated defaults to a depth of 0, so unless you override that, you'll +always be seeing only top-level dependencies that are outdated.
  • +
  • package type (when using --long / -l) tells you whether this package is +a dependency or a devDependency. Packages not included in package.json +are always marked dependencies.
  • +
+

An example

+
$ npm outdated
+Package      Current   Wanted   Latest  Location
+glob          5.0.15   5.0.15    6.0.1  test-outdated-output
+nothingness    0.0.3      git      git  test-outdated-output
+npm            3.5.1    3.5.2    3.5.1  test-outdated-output
+local-dev      0.0.3   linked   linked  test-outdated-output
+once           1.3.2    1.3.3    1.3.3  test-outdated-output
+

With these dependencies:

+
{
+  "glob": "^5.0.15",
+  "nothingness": "github:othiym23/nothingness#master",
+  "npm": "^3.5.1",
+  "once": "^1.3.1"
+}
+
+

A few things to note:

+
    +
  • glob requires ^5, which prevents npm from installing glob@6, which is +outside the semver range.
  • +
  • Git dependencies will always be reinstalled, because of how they're specified. +The installed committish might satisfy the dependency specifier (if it's +something immutable, like a commit SHA), or it might not, so npm outdated and +npm update have to fetch Git repos to check. This is why currently doing a +reinstall of a Git dependency always forces a new clone and install.
  • +
  • npm@3.5.2 is marked as "wanted", but "latest" is npm@3.5.1 because npm +uses dist-tags to manage its latest and next release channels. npm update +will install the newest version, but npm install npm (with no semver range) +will install whatever's tagged as latest.
  • +
  • once is just plain out of date. Reinstalling node_modules from scratch or +running npm update will bring it up to spec.
  • +
+

CONFIGURATION

+

json

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Show information in JSON format.

+

long

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Show extended information.

+

parseable

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Show parseable output instead of tree view.

+

global

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Check packages in the global install prefix instead of in the current +project.

+

depth

+
    +
  • Default: 0
  • +
  • Type: Int
  • +
+

Max depth for checking dependency tree.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-owner.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-owner.html new file mode 100644 index 00000000..1d240e40 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-owner.html @@ -0,0 +1,55 @@ + + + npm-owner + + + + + + +
+ +

npm-owner

Manage package owners

+

SYNOPSIS

+
npm owner ls <package name>
+npm owner add <user> <package name>
+npm owner rm <user> <package name>
+
+aliases: author
+

DESCRIPTION

+

Manage ownership of published packages.

+
    +
  • ls: +List all the users who have access to modify a package and push new versions. +Handy when you need to know who to bug for help.
  • +
  • add: +Add a new user as a maintainer of a package. This user is enabled to modify +metadata, publish new versions, and add other owners.
  • +
  • rm: +Remove a user from the package owner list. This immediately revokes their +privileges.
  • +
+

Note that there is only one level of access. Either you can modify a package, +or you can't. Future versions may contain more fine-grained access levels, but +that is not implemented at this time.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-pack.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-pack.html new file mode 100644 index 00000000..aee55311 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-pack.html @@ -0,0 +1,45 @@ + + + npm-pack + + + + + + +
+ +

npm-pack

Create a tarball from a package

+

SYNOPSIS

+
npm pack [<pkg> [<pkg> ...]]
+

DESCRIPTION

+

For anything that's installable (that is, a package folder, tarball, +tarball url, name@tag, name@version, or name), this command will fetch +it to the cache, and then copy the tarball to the current working +directory as <name>-<version>.tgz, and then write the filenames out to +stdout.

+

If the same package is specified multiple times, then the file will be +overwritten the second time.

+

If no arguments are supplied, then npm packs the current package folder.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-ping.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-ping.html new file mode 100644 index 00000000..a178b5a1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-ping.html @@ -0,0 +1,35 @@ + + + npm-ping + + + + + + +
+ +

npm-ping

Ping npm registry

+

SYNOPSIS

+
npm ping [--registry <registry>]
+

DESCRIPTION

+

Ping the configured or given npm registry and verify authentication.

+

SEE ALSO

+ + +
+ + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-prefix.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-prefix.html new file mode 100644 index 00000000..6b0d4b1b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-prefix.html @@ -0,0 +1,42 @@ + + + npm-prefix + + + + + + +
+ +

npm-prefix

Display prefix

+

SYNOPSIS

+
npm prefix [-g]
+

DESCRIPTION

+

Print the local prefix to standard out. This is the closest parent directory +to contain a package.json file unless -g is also specified.

+

If -g is specified, this will be the value of the global prefix. See +npm-config(7) for more detail.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-prune.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-prune.html new file mode 100644 index 00000000..30001bfb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-prune.html @@ -0,0 +1,45 @@ + + + npm-prune + + + + + + +
+ +

npm-prune

Remove extraneous packages

+

SYNOPSIS

+
npm prune [<name> [<name ...]]
+npm prune [<name> [<name ...]] [--production]
+

DESCRIPTION

+

This command removes "extraneous" packages. If a package name is +provided, then only packages matching one of the supplied names are +removed.

+

Extraneous packages are packages that are not listed on the parent +package's dependencies list.

+

If the --production flag is specified or the NODE_ENV environment +variable is set to production, this command will remove the packages +specified in your devDependencies. Setting --production=false will +negate NODE_ENV being set to production.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-publish.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-publish.html new file mode 100644 index 00000000..69afb261 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-publish.html @@ -0,0 +1,73 @@ + + + npm-publish + + + + + + +
+ +

npm-publish

Publish a package

+

SYNOPSIS

+
npm publish <tarball> [--tag <tag>] [--access <public|restricted>]
+npm publish <folder> [--tag <tag>] [--access <public|restricted>]
+

DESCRIPTION

+

Publishes a package to the registry so that it can be installed by name. All +files in the package directory are included if no local .gitignore or +.npmignore file is present. See npm-developers(7) for full details on +what's included in the published package, as well as details on how the package +is built.

+

By default npm will publish to the public registry. This can be overridden by +specifying a different default registry or using a npm-scope(7) in the name +(see package.json(5)).

+
    +
  • <folder>: +A folder containing a package.json file

    +
  • +
  • <tarball>: +A url or file path to a gzipped tar archive containing a single folder +with a package.json file inside.

    +
  • +
  • [--tag <tag>] +Registers the published package with the given tag, such that npm install +<name>@<tag> will install this version. By default, npm publish updates +and npm install installs the latest tag. See npm-dist-tag(1) for +details about tags.

    +
  • +
  • [--access <public|restricted>] +Tells the registry whether this package should be published as public or +restricted. Only applies to scoped packages, which default to restricted. +If you don't have a paid account, you must publish with --access public +to publish scoped packages.

    +
  • +
+

Fails if the package name and version combination already exists in +the specified registry.

+

Once a package is published with a given name and version, that +specific name and version combination can never be used again, even if +it is removed with npm-unpublish(1).

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-rebuild.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-rebuild.html new file mode 100644 index 00000000..d96e0b5f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-rebuild.html @@ -0,0 +1,42 @@ + + + npm-rebuild + + + + + + +
+ +

npm-rebuild

Rebuild a package

+

SYNOPSIS

+
npm rebuild [<name> [<name> ...]]
+npm rb [<name> [<name> ...]]
+
    +
  • <name>: +The package to rebuild
  • +
+

DESCRIPTION

+

This command runs the npm build command on the matched folders. This is useful +when you install a new version of node, and must recompile all your C++ addons with +the new binary.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-repo.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-repo.html new file mode 100644 index 00000000..b8ba0dea --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-repo.html @@ -0,0 +1,46 @@ + + + npm-repo + + + + + + +
+ +

npm-repo

Open package repository page in the browser

+

SYNOPSIS

+
npm repo <pkgname>
+npm repo (with no args in a package dir)
+

DESCRIPTION

+

This command tries to guess at the likely location of a package's +repository URL, and then tries to open it using the --browser +config param. If no package name is provided, it will search for +a package.json in the current folder and use the name property.

+

CONFIGURATION

+

browser

+
    +
  • Default: OS X: "open", Windows: "start", Others: "xdg-open"
  • +
  • Type: String
  • +
+

The browser that is called by the npm repo command to open websites.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-restart.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-restart.html new file mode 100644 index 00000000..c638f8a9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-restart.html @@ -0,0 +1,57 @@ + + + npm-restart + + + + + + +
+ +

npm-restart

Restart a package

+

SYNOPSIS

+
npm restart [-- <args>]
+

DESCRIPTION

+

This restarts a package.

+

This runs a package's "stop", "restart", and "start" scripts, and associated +pre- and post- scripts, in the order given below:

+
    +
  1. prerestart
  2. +
  3. prestop
  4. +
  5. stop
  6. +
  7. poststop
  8. +
  9. restart
  10. +
  11. prestart
  12. +
  13. start
  14. +
  15. poststart
  16. +
  17. postrestart
  18. +
+

NOTE

+

Note that the "restart" script is run in addition to the "stop" +and "start" scripts, not instead of them.

+

This is the behavior as of npm major version 2. A change in this +behavior will be accompanied by an increase in major version number

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-rm.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-rm.html new file mode 100644 index 00000000..3093834b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-rm.html @@ -0,0 +1,43 @@ + + + npm-rm + + + + + + +
+ +

npm-rm

Remove a package

+

SYNOPSIS

+
npm rm <name>
+npm r <name>
+npm uninstall <name>
+npm un <name>
+

DESCRIPTION

+

This uninstalls a package, completely removing everything npm installed +on its behalf.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-root.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-root.html new file mode 100644 index 00000000..85475818 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-root.html @@ -0,0 +1,39 @@ + + + npm-root + + + + + + +
+ +

npm-root

Display npm root

+

SYNOPSIS

+
npm root
+

DESCRIPTION

+

Print the effective node_modules folder to standard out.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-run-script.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-run-script.html new file mode 100644 index 00000000..5a5d481e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-run-script.html @@ -0,0 +1,61 @@ + + + npm-run-script + + + + + + +
+ +

npm-run-script

Run arbitrary package scripts

+

SYNOPSIS

+
npm run-script [command] [-- <args>]
+npm run [command] [-- <args>]
+

DESCRIPTION

+

This runs an arbitrary command from a package's "scripts" object. If no +"command" is provided, it will list the available scripts. run[-script] is +used by the test, start, restart, and stop commands, but can be called +directly, as well. When the scripts in the package are printed out, they're +separated into lifecycle (test, start, restart) and directly-run scripts.

+

As of npm@2.0.0, you can +use custom arguments when executing scripts. The special option -- is used by +getopt to delimit the end of the options. npm will pass +all the arguments after the -- directly to your script:

+
npm run test -- --grep="pattern"
+

The arguments will only be passed to the script specified after npm run +and not to any pre or post script.

+

The env script is a special built-in command that can be used to list +environment variables that will be available to the script at runtime. If an +"env" command is defined in your package it will take precedence over the +built-in.

+

In addition to the shell's pre-existing PATH, npm run adds +node_modules/.bin to the PATH provided to scripts. Any binaries provided by +locally-installed dependencies can be used without the node_modules/.bin +prefix. For example, if there is a devDependency on tap in your package, +you should write:

+
"scripts": {"test": "tap test/\*.js"}
+

instead of "scripts": {"test": "node_modules/.bin/tap test/\*.js"} to run your tests.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-search.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-search.html new file mode 100644 index 00000000..b8fa93ec --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-search.html @@ -0,0 +1,61 @@ + + + npm-search + + + + + + +
+ +

npm-search

Search for packages

+

SYNOPSIS

+
npm search [-l|--long] [search terms ...]
+
+aliases: s, se, find
+

DESCRIPTION

+

Search the registry for packages matching the search terms.

+

If a term starts with /, then it's interpreted as a regular expression. +A trailing / will be ignored in this case. (Note that many regular +expression characters must be escaped or quoted in most shells.)

+

CONFIGURATION

+

long

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Display full package descriptions and other long text across multiple +lines. When disabled (default) search results are truncated to fit +neatly on a single line. Modules with extremely long names will +fall on multiple lines.

+

registry

+ +

Search the specified registry for modules. If you have configured npm to point to a different default registry, +such as your internal private module repository, npm search will default to that registry when searching. +Pass a different registry url such as the default above in order to override this setting.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-shrinkwrap.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-shrinkwrap.html new file mode 100644 index 00000000..2986737e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-shrinkwrap.html @@ -0,0 +1,172 @@ + + + npm-shrinkwrap + + + + + + +
+ +

npm-shrinkwrap

Lock down dependency versions

+

SYNOPSIS

+
npm shrinkwrap
+

DESCRIPTION

+

This command locks down the versions of a package's dependencies so +that you can control exactly which versions of each dependency will be +used when your package is installed. The package.json file is still +required if you want to use npm install.

+

By default, npm install recursively installs the target's +dependencies (as specified in package.json), choosing the latest +available version that satisfies the dependency's semver pattern. In +some situations, particularly when shipping software where each change +is tightly managed, it's desirable to fully specify each version of +each dependency recursively so that subsequent builds and deploys do +not inadvertently pick up newer versions of a dependency that satisfy +the semver pattern. Specifying specific semver patterns in each +dependency's package.json would facilitate this, but that's not always +possible or desirable, as when another author owns the npm package. +It's also possible to check dependencies directly into source control, +but that may be undesirable for other reasons.

+

As an example, consider package A:

+
{
+  "name": "A",
+  "version": "0.1.0",
+  "dependencies": {
+    "B": "<0.1.0"
+  }
+}
+

package B:

+
{
+  "name": "B",
+  "version": "0.0.1",
+  "dependencies": {
+    "C": "<0.1.0"
+  }
+}
+

and package C:

+
{
+  "name": "C",
+  "version": "0.0.1"
+}
+

If these are the only versions of A, B, and C available in the +registry, then a normal npm install A will install:

+
A@0.1.0
+`-- B@0.0.1
+    `-- C@0.0.1
+

However, if B@0.0.2 is published, then a fresh npm install A will +install:

+
A@0.1.0
+`-- B@0.0.2
+    `-- C@0.0.1
+

assuming the new version did not modify B's dependencies. Of course, +the new version of B could include a new version of C and any number +of new dependencies. If such changes are undesirable, the author of A +could specify a dependency on B@0.0.1. However, if A's author and B's +author are not the same person, there's no way for A's author to say +that he or she does not want to pull in newly published versions of C +when B hasn't changed at all.

+

In this case, A's author can run

+
npm shrinkwrap
+

This generates npm-shrinkwrap.json, which will look something like this:

+
{
+  "name": "A",
+  "version": "0.1.0",
+  "dependencies": {
+    "B": {
+      "version": "0.0.1",
+      "from": "B@^0.0.1",
+      "resolved": "https://registry.npmjs.org/B/-/B-0.0.1.tgz",
+      "dependencies": {
+        "C": {
+          "version": "0.0.1",
+          "from": "org/C#v0.0.1",
+          "resolved": "git://github.com/org/C.git#5c380ae319fc4efe9e7f2d9c78b0faa588fd99b4"
+        }
+      }
+    }
+  }
+}
+

The shrinkwrap command has locked down the dependencies based on +what's currently installed in node_modules. When npm install +installs a package with an npm-shrinkwrap.json in the package +root, the shrinkwrap file (rather than package.json files) completely +drives the installation of that package and all of its dependencies +(recursively). So now the author publishes A@0.1.0, and subsequent +installs of this package will use B@0.0.1 and C@0.0.1, regardless the +dependencies and versions listed in A's, B's, and C's package.json +files.

+

Using shrinkwrapped packages

+

Using a shrinkwrapped package is no different than using any other +package: you can npm install it by hand, or add a dependency to your +package.json file and npm install it.

+

Building shrinkwrapped packages

+

To shrinkwrap an existing package:

+
    +
  1. Run npm install in the package root to install the current +versions of all dependencies.
  2. +
  3. Validate that the package works as expected with these versions.
  4. +
  5. Run npm shrinkwrap, add npm-shrinkwrap.json to git, and publish +your package.
  6. +
+

To add or update a dependency in a shrinkwrapped package:

+
    +
  1. Run npm install in the package root to install the current +versions of all dependencies.
  2. +
  3. Add or update dependencies. npm install each new or updated +package individually and then update package.json. Note that they +must be explicitly named in order to be installed: running npm +install with no arguments will merely reproduce the existing +shrinkwrap.
  4. +
  5. Validate that the package works as expected with the new +dependencies.
  6. +
  7. Run npm shrinkwrap, commit the new npm-shrinkwrap.json, and +publish your package.
  8. +
+

You can use npm-outdated(1) to view dependencies with newer versions +available.

+

Other Notes

+

A shrinkwrap file must be consistent with the package's package.json +file. npm shrinkwrap will fail if required dependencies are not +already installed, since that would result in a shrinkwrap that +wouldn't actually work. Similarly, the command will fail if there are +extraneous packages (not referenced by package.json), since that would +indicate that package.json is not correct.

+

Since npm shrinkwrap is intended to lock down your dependencies for +production use, devDependencies will not be included unless you +explicitly set the --dev flag when you run npm shrinkwrap. If +installed devDependencies are excluded, then npm will print a +warning. If you want them to be installed with your module by +default, please consider adding them to dependencies instead.

+

If shrinkwrapped package A depends on shrinkwrapped package B, B's +shrinkwrap will not be used as part of the installation of A. However, +because A's shrinkwrap is constructed from a valid installation of B +and recursively specifies all dependencies, the contents of B's +shrinkwrap will implicitly be included in A's shrinkwrap.

+

Caveats

+

If you wish to lock down the specific bytes included in a package, for +example to have 100% confidence in being able to reproduce a +deployment or build, then you ought to check your dependencies into +source control, or pursue some other mechanism that can verify +contents rather than versions.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-star.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-star.html new file mode 100644 index 00000000..dfed3c97 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-star.html @@ -0,0 +1,40 @@ + + + npm-star + + + + + + +
+ +

npm-star

Mark your favorite packages

+

SYNOPSIS

+
npm star <pkgname> [<pkg>, ...]
+npm unstar <pkgname> [<pkg>, ...]
+

DESCRIPTION

+

"Starring" a package means that you have some interest in it. It's +a vaguely positive way to show that you care.

+

"Unstarring" is the same thing, but in reverse.

+

It's a boolean thing. Starring repeatedly has no additional effect.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-stars.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-stars.html new file mode 100644 index 00000000..d2d4088d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-stars.html @@ -0,0 +1,41 @@ + + + npm-stars + + + + + + +
+ +

npm-stars

View packages marked as favorites

+

SYNOPSIS

+
npm stars
+npm stars [username]
+

DESCRIPTION

+

If you have starred a lot of neat things and want to find them again +quickly this command lets you do just that.

+

You may also want to see your friend's favorite packages, in this case +you will most certainly enjoy this command.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-start.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-start.html new file mode 100644 index 00000000..ac79e10e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-start.html @@ -0,0 +1,43 @@ + + + npm-start + + + + + + +
+ +

npm-start

Start a package

+

SYNOPSIS

+
npm start [-- <args>]
+

DESCRIPTION

+

This runs an arbitrary command specified in the package's "start" property of +its "scripts" object. If no "start" property is specified on the +"scripts" object, it will run node server.js.

+

As of npm@2.0.0, you can +use custom arguments when executing scripts. Refer to npm-run-script(1) for +more details.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-stop.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-stop.html new file mode 100644 index 00000000..b1250c58 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-stop.html @@ -0,0 +1,38 @@ + + + npm-stop + + + + + + +
+ +

npm-stop

Stop a package

+

SYNOPSIS

+
npm stop [-- <args>]
+

DESCRIPTION

+

This runs a package's "stop" script, if one was provided.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-tag.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-tag.html new file mode 100644 index 00000000..e8ec4ecc --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-tag.html @@ -0,0 +1,66 @@ + + + npm-tag + + + + + + +
+ +

npm-tag

Tag a published version

+

SYNOPSIS

+
npm tag <name>@<version> [<tag>]
+

DESCRIPTION

+

THIS COMMAND IS DEPRECATED. See npm-dist-tag(1) for details.

+

Tags the specified version of the package with the specified tag, or the +--tag config if not specified.

+

A tag can be used when installing packages as a reference to a version instead +of using a specific version number:

+
npm install <name>@<tag>
+

When installing dependencies, a preferred tagged version may be specified:

+
npm install --tag <tag>
+

This also applies to npm dedupe.

+

Publishing a package always sets the "latest" tag to the published version.

+

PURPOSE

+

Tags can be used to provide an alias instead of version numbers. For +example, npm currently uses the tag "next" to identify the upcoming +version, and the tag "latest" to identify the current version.

+

A project might choose to have multiple streams of development, e.g., +"stable", "canary".

+

CAVEATS

+

Tags must share a namespace with version numbers, because they are +specified in the same slot: npm install <pkg>@<version> vs npm +install <pkg>@<tag>.

+

Tags that can be interpreted as valid semver ranges will be +rejected. For example, v1.4 cannot be used as a tag, because it is +interpreted by semver as >=1.4.0 <1.5.0. See +https://github.com/npm/npm/issues/6082.

+

The simplest way to avoid semver problems with tags is to use tags +that do not begin with a number or the letter v.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-team.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-team.html new file mode 100644 index 00000000..6aebb079 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-team.html @@ -0,0 +1,70 @@ + + + npm-team + + + + + + +
+ +

npm-team

Manage organization teams and team memberships

+

SYNOPSIS

+
npm team create <scope:team>
+npm team destroy <scope:team>
+
+npm team add <scope:team> <user>
+npm team rm <scope:team> <user>
+
+npm team ls <scope>|<scope:team>
+
+npm team edit <scope:team>
+

DESCRIPTION

+

Used to manage teams in organizations, and change team memberships. Does not +handle permissions for packages.

+

Teams must always be fully qualified with the organization/scope they belond to +when operating on them, separated by a colon (:). That is, if you have a +developers team on a foo organization, you must always refer to that team as +foo:developers in these commands.

+
    +
  • create / destroy: +Create a new team, or destroy an existing one.

    +
  • +
  • add / rm: +Add a user to an existing team, or remove a user from a team they belong to.

    +
  • +
  • ls: +If performed on an organization name, will return a list of existing teams +under that organization. If performed on a team, it will instead return a list +of all users belonging to that particular team.

    +
  • +
+

DETAILS

+

npm team always operates directly on the current registry, configurable from +the command line using --registry=<registry url>.

+

In order to create teams and manage team membership, you must be a team admin +under the given organization. Listing teams and team memberships may be done by +any member of the organizations.

+

Organization creation and management of team admins and organization members +is done through the website, not the npm CLI.

+

To use teams to manage permissions on packages belonging to your organization, +use the npm access command to grant or revoke the appropriate permissions.

+

SEE ALSO

+ + +
+ + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-test.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-test.html new file mode 100644 index 00000000..6a5ff404 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-test.html @@ -0,0 +1,42 @@ + + + npm-test + + + + + + +
+ +

npm-test

Test a package

+

SYNOPSIS

+
  npm test [-- <args>]
+
+  aliases: t, tst
+

DESCRIPTION

+

This runs a package's "test" script, if one was provided.

+

To run tests as a condition of installation, set the npat config to +true.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-uninstall.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-uninstall.html new file mode 100644 index 00000000..6b7245af --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-uninstall.html @@ -0,0 +1,61 @@ + + + npm-uninstall + + + + + + +
+ +

npm-uninstall

Remove a package

+

SYNOPSIS

+
npm uninstall [@<scope>/]<package> [--save|--save-dev|--save-optional]
+npm rm (with any of the previous argument usage)
+

DESCRIPTION

+

This uninstalls a package, completely removing everything npm installed +on its behalf.

+

Example:

+
npm uninstall sax
+

In global mode (ie, with -g or --global appended to the command), +it uninstalls the current package context as a global package.

+

npm uninstall takes 3 exclusive, optional flags which save or update +the package version in your main package.json:

+
    +
  • --save: Package will be removed from your dependencies.

    +
  • +
  • --save-dev: Package will be removed from your devDependencies.

    +
  • +
  • --save-optional: Package will be removed from your optionalDependencies.

    +
  • +
+

Scope is optional and follows the usual rules for npm-scope(7).

+

Examples:

+
npm uninstall sax --save
+npm uninstall @myorg/privatepackage --save
+npm uninstall node-tap --save-dev
+npm uninstall dtrace-provider --save-optional
+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-unpublish.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-unpublish.html new file mode 100644 index 00000000..d4e6ee14 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-unpublish.html @@ -0,0 +1,51 @@ + + + npm-unpublish + + + + + + +
+ +

npm-unpublish

Remove a package from the registry

+

SYNOPSIS

+
npm unpublish [@<scope>/]<name>[@<version>]
+

WARNING

+

It is generally considered bad behavior to remove versions of a library +that others are depending on!

+

Consider using the deprecate command +instead, if your intent is to encourage users to upgrade.

+

There is plenty of room on the registry.

+

DESCRIPTION

+

This removes a package version from the registry, deleting its +entry and removing the tarball.

+

If no version is specified, or if all versions are removed then +the root package entry is removed from the registry entirely.

+

Even if a package version is unpublished, that specific name and +version combination can never be reused. In order to publish the +package again, a new version number must be used.

+

The scope is optional and follows the usual rules for npm-scope(7).

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-update.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-update.html new file mode 100644 index 00000000..e0e5bf51 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-update.html @@ -0,0 +1,121 @@ + + + npm-update + + + + + + +
+ +

npm-update

Update a package

+

SYNOPSIS

+
npm update [-g] [<name> [<name> ...]]
+
+aliases: up, upgrade
+

DESCRIPTION

+

This command will update all the packages listed to the latest version +(specified by the tag config), respecting semver.

+

It will also install missing packages. As with all commands that install +packages, the --dev flag will cause devDependencies to be processed +as well.

+

If the -g flag is specified, this command will update globally installed +packages.

+

If no package name is specified, all packages in the specified location (global +or local) will be updated.

+

As of npm@2.6.1, the npm update will only inspect top-level packages. +Prior versions of npm would also recursively inspect all dependencies. +To get the old behavior, use npm --depth 9999 update.

+

EXAMPLES

+

IMPORTANT VERSION NOTE: these examples assume npm@2.6.1 or later. For +older versions of npm, you must specify --depth 0 to get the behavior +described below.

+

For the examples below, assume that the current package is app and it depends +on dependencies, dep1 (dep2, .. etc.). The published versions of dep1 are:

+
{
+  "dist-tags": { "latest": "1.2.2" },
+  "versions": [
+    "1.2.2",
+    "1.2.1",
+    "1.2.0",
+    "1.1.2",
+    "1.1.1",
+    "1.0.0",
+    "0.4.1",
+    "0.4.0",
+    "0.2.0"
+  ]
+}
+

Caret Dependencies

+

If app's package.json contains:

+
"dependencies": {
+  "dep1": "^1.1.1"
+}
+

Then npm update will install dep1@1.2.2, because 1.2.2 is latest and +1.2.2 satisfies ^1.1.1.

+

Tilde Dependencies

+

However, if app's package.json contains:

+
"dependencies": {
+  "dep1": "~1.1.1"
+}
+

In this case, running npm update will install dep1@1.1.2. Even though the latest +tag points to 1.2.2, this version does not satisfy ~1.1.1, which is equivalent +to >=1.1.1 <1.2.0. So the highest-sorting version that satisfies ~1.1.1 is used, +which is 1.1.2.

+

Caret Dependencies below 1.0.0

+

Suppose app has a caret dependency on a version below 1.0.0, for example:

+
"dependencies": {
+  "dep1": "^0.2.0"
+}
+

npm update will install dep1@0.2.0, because there are no other +versions which satisfy ^0.2.0.

+

If the dependence were on ^0.4.0:

+
"dependencies": {
+  "dep1": "^0.4.0"
+}
+

Then npm update will install dep1@0.4.1, because that is the highest-sorting +version that satisfies ^0.4.0 (>= 0.4.0 <0.5.0)

+

Recording Updates with --save

+

When you want to update a package and save the new version as +the minimum required dependency in package.json, you can use +npm update --save. For example if package.json contains

+
"dependencies": {
+  "dep1": "^1.1.1"
+}
+

Then npm update --save will install dep1@1.2.2 (i.e., latest), +and package.json will be modified:

+
"dependencies": {
+  "dep1": "^1.2.2"
+}
+

Note that npm will only write an updated version to package.json +if it installs a new package.

+

Updating Globally-Installed Packages

+

npm update -g will apply the update action to each globally installed +package that is outdated -- that is, has a version that is different from +latest.

+

NOTE: If a package has been upgraded to a version newer than latest, it will +be downgraded.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-version.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-version.html new file mode 100644 index 00000000..115965f7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-version.html @@ -0,0 +1,99 @@ + + + npm-version + + + + + + +
+ +

npm-version

Bump a package version

+

SYNOPSIS

+
npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease]
+

DESCRIPTION

+

Run this in a package directory to bump the version and write the new +data back to package.json and, if present, npm-shrinkwrap.json.

+

The newversion argument should be a valid semver string, or a +valid second argument to semver.inc (one of patch, minor, major, +prepatch, preminor, premajor, prerelease). In the second case, +the existing version will be incremented by 1 in the specified field.

+

If run in a git repo, it will also create a version commit and tag. +This behavior is controlled by git-tag-version (see below), and can +be disabled on the command line by running npm --no-git-tag-version version. +It will fail if the working directory is not clean, unless the --force +flag is set.

+

If supplied with --message (shorthand: -m) config option, npm will +use it as a commit message when creating a version commit. If the +message config contains %s then that will be replaced with the +resulting version number. For example:

+
npm version patch -m "Upgrade to %s for reasons"
+

If the sign-git-tag config is set, then the tag will be signed using +the -s flag to git. Note that you must have a default GPG key set up +in your git config for this to work properly. For example:

+
$ npm config set sign-git-tag true
+$ npm version patch
+
+You need a passphrase to unlock the secret key for
+user: "isaacs (http://blog.izs.me/) <i@izs.me>"
+2048-bit RSA key, ID 6C481CF6, created 2010-08-31
+
+Enter passphrase:
+

If preversion, version, or postversion are in the scripts property of +the package.json, they will be executed as part of running npm version.

+

The exact order of execution is as follows:

+
    +
  1. Check to make sure the git working directory is clean before we get started. +Your scripts may add files to the commit in future steps. +This step is skipped if the --force flag is set.
  2. +
  3. Run the preversion script. These scripts have access to the old version in package.json. +A typical use would be running your full test suite before deploying. +Any files you want added to the commit should be explicitly added using git add.
  4. +
  5. Bump version in package.json as requested (patch, minor, major, etc).
  6. +
  7. Run the version script. These scripts have access to the new version in package.json +(so they can incorporate it into file headers in generated files for example). +Again, scripts should explicitly add generated files to the commit using git add.
  8. +
  9. Commit and tag.
  10. +
  11. Run the postversion script. Use it to clean up the file system or automatically push +the commit and/or tag.
  12. +
+

Take the following example:

+
"scripts": {
+  "preversion": "npm test",
+  "version": "npm run build && git add -A dist",
+  "postversion": "git push && git push --tags && rm -rf build/temp"
+}
+

This runs all your tests, and proceeds only if they pass. Then runs your build script, and +adds everything in the dist directory to the commit. After the commit, it pushes the new commit +and tag up to the server, and deletes the build/temp directory.

+

CONFIGURATION

+

git-tag-version

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

Commit and tag the version change.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-view.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-view.html new file mode 100644 index 00000000..8806b7ca --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-view.html @@ -0,0 +1,89 @@ + + + npm-view + + + + + + +
+ +

npm-view

View registry info

+

SYNOPSIS

+
npm view [@<scope>/]<name>[@<version>] [<field>[.<subfield>]...]
+npm v [@<scope>/]<name>[@<version>] [<field>[.<subfield>]...]
+

DESCRIPTION

+

This command shows data about a package and prints it to the stream +referenced by the outfd config, which defaults to stdout.

+

To show the package registry entry for the connect package, you can do +this:

+
npm view connect
+

The default version is "latest" if unspecified.

+

Field names can be specified after the package descriptor. +For example, to show the dependencies of the ronn package at version +0.3.5, you could do the following:

+
npm view ronn@0.3.5 dependencies
+

You can view child fields by separating them with a period. +To view the git repository URL for the latest version of npm, you could +do this:

+
npm view npm repository.url
+

This makes it easy to view information about a dependency with a bit of +shell scripting. For example, to view all the data about the version of +opts that ronn depends on, you can do this:

+
npm view opts@$(npm view ronn dependencies.opts)
+

For fields that are arrays, requesting a non-numeric field will return +all of the values from the objects in the list. For example, to get all +the contributor names for the "express" project, you can do this:

+
npm view express contributors.email
+

You may also use numeric indices in square braces to specifically select +an item in an array field. To just get the email address of the first +contributor in the list, you can do this:

+
npm view express contributors[0].email
+

Multiple fields may be specified, and will be printed one after another. +For exampls, to get all the contributor names and email addresses, you +can do this:

+
npm view express contributors.name contributors.email
+

"Person" fields are shown as a string if they would be shown as an +object. So, for example, this will show the list of npm contributors in +the shortened string format. (See package.json(5) for more on this.)

+
npm view npm contributors
+

If a version range is provided, then data will be printed for every +matching version of the package. This will show which version of jsdom +was required by each matching version of yui3:

+
npm view yui3@'>0.5.4' dependencies.jsdom
+

To show the connect package version history, you can do +this:

+
npm view connect versions
+

OUTPUT

+

If only a single string field for a single version is output, then it +will not be colorized or quoted, so as to enable piping the output to +another command. If the field is an object, it will be output as a JavaScript object literal.

+

If the --json flag is given, the outputted fields will be JSON.

+

If the version range matches multiple versions, than each printed value +will be prefixed with the version it applies to.

+

If multiple fields are requested, than each of them are prefixed with +the field name.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-whoami.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-whoami.html new file mode 100644 index 00000000..8a9ecc98 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm-whoami.html @@ -0,0 +1,37 @@ + + + npm-whoami + + + + + + +
+ +

npm-whoami

Display npm username

+

SYNOPSIS

+
npm whoami
+

DESCRIPTION

+

Print the username config to standard output.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm.html new file mode 100644 index 00000000..41bb04b6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/cli/npm.html @@ -0,0 +1,156 @@ + + + npm + + + + + + +
+ +

npm

javascript package manager

+

SYNOPSIS

+
npm <command> [args]
+

VERSION

+

2.15.11

+

DESCRIPTION

+

npm is the package manager for the Node JavaScript platform. It puts +modules in place so that node can find them, and manages dependency +conflicts intelligently.

+

It is extremely configurable to support a wide variety of use cases. +Most commonly, it is used to publish, discover, install, and develop node +programs.

+

Run npm help to get a list of available commands.

+

INTRODUCTION

+

You probably got npm because you want to install stuff.

+

Use npm install blerg to install the latest version of "blerg". Check out +npm-install(1) for more info. It can do a lot of stuff.

+

Use the npm search command to show everything that's available. +Use npm ls to show everything you've installed.

+

DEPENDENCIES

+

If a package references to another package with a git URL, npm depends +on a preinstalled git.

+

If one of the packages npm tries to install is a native node module and +requires compiling of C++ Code, npm will use +node-gyp for that task. +For a Unix system, node-gyp +needs Python, make and a buildchain like GCC. On Windows, +Python and Microsoft Visual Studio C++ are needed. Python 3 is +not supported by node-gyp. +For more information visit +the node-gyp repository and +the node-gyp Wiki.

+

DIRECTORIES

+

See npm-folders(5) to learn about where npm puts stuff.

+

In particular, npm has two modes of operation:

+
    +
  • global mode:
    npm installs packages into the install prefix at +prefix/lib/node_modules and bins are installed in prefix/bin.
  • +
  • local mode:
    npm installs packages into the current project directory, which +defaults to the current working directory. Packages are installed to +./node_modules, and bins are installed to ./node_modules/.bin.
  • +
+

Local mode is the default. Use --global or -g on any command to +operate in global mode instead.

+

DEVELOPER USAGE

+

If you're using npm to develop and publish your code, check out the +following help topics:

+
    +
  • json: +Make a package.json file. See package.json(5).
  • +
  • link: +For linking your current working code into Node's path, so that you +don't have to reinstall every time you make a change. Use +npm link to do this.
  • +
  • install: +It's a good idea to install things if you don't need the symbolic link. +Especially, installing other peoples code from the registry is done via +npm install
  • +
  • adduser: +Create an account or log in. Credentials are stored in the +user config file.
  • +
  • publish: +Use the npm publish command to upload your code to the registry.
  • +
+

CONFIGURATION

+

npm is extremely configurable. It reads its configuration options from +5 places.

+
    +
  • Command line switches:
    Set a config with --key val. All keys take a value, even if they +are booleans (the config parser doesn't know what the options are at +the time of parsing.) If no value is provided, then the option is set +to boolean true.
  • +
  • Environment Variables:
    Set any config by prefixing the name in an environment variable with +npm_config_. For example, export npm_config_key=val.
  • +
  • User Configs:
    The file at $HOME/.npmrc is an ini-formatted list of configs. If +present, it is parsed. If the userconfig option is set in the cli +or env, then that will be used instead.
  • +
  • Global Configs:
    The file found at ../etc/npmrc (from the node executable, by default +this resolves to /usr/local/etc/npmrc) will be parsed if it is found. +If the globalconfig option is set in the cli, env, or user config, +then that file is parsed instead.
  • +
  • Defaults:
    npm's default configuration options are defined in +lib/utils/config-defs.js. These must not be changed.
  • +
+

See npm-config(7) for much much more information.

+

CONTRIBUTIONS

+

Patches welcome!

+
    +
  • code: +Read through npm-coding-style(7) if you plan to submit code. +You don't have to agree with it, but you do have to follow it.
  • +
  • docs: +If you find an error in the documentation, edit the appropriate markdown +file in the "doc" folder. (Don't worry about generating the man page.)
  • +
+

Contributors are listed in npm's package.json file. You can view them +easily by doing npm view npm contributors.

+

If you would like to contribute, but don't know what to work on, read +the contributing guidelines and check the issues list.

+ +

BUGS

+

When you find issues, please report them:

+ +

Be sure to include all of the output from the npm command that didn't work +as expected. The npm-debug.log file is also helpful to provide.

+

You can also look for isaacs in #node.js on irc://irc.freenode.net. He +will no doubt tell you to put the output in a gist or email.

+

AUTHOR

+

Isaac Z. Schlueter :: +isaacs :: +@izs :: +i@izs.me

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/files/npm-folders.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/files/npm-folders.html new file mode 100644 index 00000000..ff8d0238 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/files/npm-folders.html @@ -0,0 +1,187 @@ + + + npm-folders + + + + + + +
+ +

npm-folders

Folder Structures Used by npm

+

DESCRIPTION

+

npm puts various things on your computer. That's its job.

+

This document will tell you what it puts where.

+

tl;dr

+
    +
  • Local install (default): puts stuff in ./node_modules of the current +package root.
  • +
  • Global install (with -g): puts stuff in /usr/local or wherever node +is installed.
  • +
  • Install it locally if you're going to require() it.
  • +
  • Install it globally if you're going to run it on the command line.
  • +
  • If you need both, then install it in both places, or use npm link.
  • +
+

prefix Configuration

+

The prefix config defaults to the location where node is installed. +On most systems, this is /usr/local. On windows, this is the exact +location of the node.exe binary. On Unix systems, it's one level up, +since node is typically installed at {prefix}/bin/node rather than +{prefix}/node.exe.

+

When the global flag is set, npm installs things into this prefix. +When it is not set, it uses the root of the current package, or the +current working directory if not in a package already.

+

Node Modules

+

Packages are dropped into the node_modules folder under the prefix. +When installing locally, this means that you can +require("packagename") to load its main module, or +require("packagename/lib/path/to/sub/module") to load other modules.

+

Global installs on Unix systems go to {prefix}/lib/node_modules. +Global installs on Windows go to {prefix}/node_modules (that is, no +lib folder.)

+

Scoped packages are installed the same way, except they are grouped together +in a sub-folder of the relevant node_modules folder with the name of that +scope prefix by the @ symbol, e.g. npm install @myorg/package would place +the package in {prefix}/node_modules/@myorg/package. See scope(7) for +more details.

+

If you wish to require() a package, then install it locally.

+

Executables

+

When in global mode, executables are linked into {prefix}/bin on Unix, +or directly into {prefix} on Windows.

+

When in local mode, executables are linked into +./node_modules/.bin so that they can be made available to scripts run +through npm. (For example, so that a test runner will be in the path +when you run npm test.)

+

Man Pages

+

When in global mode, man pages are linked into {prefix}/share/man.

+

When in local mode, man pages are not installed.

+

Man pages are not installed on Windows systems.

+

Cache

+

See npm-cache(1). Cache files are stored in ~/.npm on Posix, or +~/npm-cache on Windows.

+

This is controlled by the cache configuration param.

+

Temp Files

+

Temporary files are stored by default in the folder specified by the +tmp config, which defaults to the TMPDIR, TMP, or TEMP environment +variables, or /tmp on Unix and c:\windows\temp on Windows.

+

Temp files are given a unique folder under this root for each run of the +program, and are deleted upon successful exit.

+

More Information

+

When installing locally, npm first tries to find an appropriate +prefix folder. This is so that npm install foo@1.2.3 will install +to the sensible root of your package, even if you happen to have cded +into some other folder.

+

Starting at the $PWD, npm will walk up the folder tree checking for a +folder that contains either a package.json file, or a node_modules +folder. If such a thing is found, then that is treated as the effective +"current directory" for the purpose of running npm commands. (This +behavior is inspired by and similar to git's .git-folder seeking +logic when running git commands in a working dir.)

+

If no package root is found, then the current folder is used.

+

When you run npm install foo@1.2.3, then the package is loaded into +the cache, and then unpacked into ./node_modules/foo. Then, any of +foo's dependencies are similarly unpacked into +./node_modules/foo/node_modules/....

+

Any bin files are symlinked to ./node_modules/.bin/, so that they may +be found by npm scripts when necessary.

+

Global Installation

+

If the global configuration is set to true, then npm will +install packages "globally".

+

For global installation, packages are installed roughly the same way, +but using the folders described above.

+

Cycles, Conflicts, and Folder Parsimony

+

Cycles are handled using the property of node's module system that it +walks up the directories looking for node_modules folders. So, at every +stage, if a package is already installed in an ancestor node_modules +folder, then it is not installed at the current location.

+

Consider the case above, where foo -> bar -> baz. Imagine if, in +addition to that, baz depended on bar, so you'd have: +foo -> bar -> baz -> bar -> baz .... However, since the folder +structure is: foo/node_modules/bar/node_modules/baz, there's no need to +put another copy of bar into .../baz/node_modules, since when it calls +require("bar"), it will get the copy that is installed in +foo/node_modules/bar.

+

This shortcut is only used if the exact same +version would be installed in multiple nested node_modules folders. It +is still possible to have a/node_modules/b/node_modules/a if the two +"a" packages are different versions. However, without repeating the +exact same package multiple times, an infinite regress will always be +prevented.

+

Another optimization can be made by installing dependencies at the +highest level possible, below the localized "target" folder.

+

Example

+

Consider this dependency graph:

+
foo
++-- blerg@1.2.5
++-- bar@1.2.3
+|   +-- blerg@1.x (latest=1.3.7)
+|   +-- baz@2.x
+|   |   `-- quux@3.x
+|   |       `-- bar@1.2.3 (cycle)
+|   `-- asdf@*
+`-- baz@1.2.3
+    `-- quux@3.x
+        `-- bar
+

In this case, we might expect a folder structure like this:

+
foo
++-- node_modules
+    +-- blerg (1.2.5) <---[A]
+    +-- bar (1.2.3) <---[B]
+    |   `-- node_modules
+    |       +-- baz (2.0.2) <---[C]
+    |       |   `-- node_modules
+    |       |       `-- quux (3.2.0)
+    |       `-- asdf (2.3.4)
+    `-- baz (1.2.3) <---[D]
+        `-- node_modules
+            `-- quux (3.2.0) <---[E]
+

Since foo depends directly on bar@1.2.3 and baz@1.2.3, those are +installed in foo's node_modules folder.

+

Even though the latest copy of blerg is 1.3.7, foo has a specific +dependency on version 1.2.5. So, that gets installed at [A]. Since the +parent installation of blerg satisfies bar's dependency on blerg@1.x, +it does not install another copy under [B].

+

Bar [B] also has dependencies on baz and asdf, so those are installed in +bar's node_modules folder. Because it depends on baz@2.x, it cannot +re-use the baz@1.2.3 installed in the parent node_modules folder [D], +and must install its own copy [C].

+

Underneath bar, the baz -> quux -> bar dependency creates a cycle. +However, because bar is already in quux's ancestry [B], it does not +unpack another copy of bar into that folder.

+

Underneath foo -> baz [D], quux's [E] folder tree is empty, because its +dependency on bar is satisfied by the parent folder copy installed at [B].

+

For a graphical breakdown of what is installed where, use npm ls.

+

Publishing

+

Upon publishing, npm will look in the node_modules folder. If any of +the items there are not in the bundledDependencies array, then they will +not be included in the package tarball.

+

This allows a package maintainer to install all of their dependencies +(and dev dependencies) locally, but only re-publish those items that +cannot be found elsewhere. See package.json(5) for more information.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/files/npm-global.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/files/npm-global.html new file mode 100644 index 00000000..ff8d0238 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/files/npm-global.html @@ -0,0 +1,187 @@ + + + npm-folders + + + + + + +
+ +

npm-folders

Folder Structures Used by npm

+

DESCRIPTION

+

npm puts various things on your computer. That's its job.

+

This document will tell you what it puts where.

+

tl;dr

+
    +
  • Local install (default): puts stuff in ./node_modules of the current +package root.
  • +
  • Global install (with -g): puts stuff in /usr/local or wherever node +is installed.
  • +
  • Install it locally if you're going to require() it.
  • +
  • Install it globally if you're going to run it on the command line.
  • +
  • If you need both, then install it in both places, or use npm link.
  • +
+

prefix Configuration

+

The prefix config defaults to the location where node is installed. +On most systems, this is /usr/local. On windows, this is the exact +location of the node.exe binary. On Unix systems, it's one level up, +since node is typically installed at {prefix}/bin/node rather than +{prefix}/node.exe.

+

When the global flag is set, npm installs things into this prefix. +When it is not set, it uses the root of the current package, or the +current working directory if not in a package already.

+

Node Modules

+

Packages are dropped into the node_modules folder under the prefix. +When installing locally, this means that you can +require("packagename") to load its main module, or +require("packagename/lib/path/to/sub/module") to load other modules.

+

Global installs on Unix systems go to {prefix}/lib/node_modules. +Global installs on Windows go to {prefix}/node_modules (that is, no +lib folder.)

+

Scoped packages are installed the same way, except they are grouped together +in a sub-folder of the relevant node_modules folder with the name of that +scope prefix by the @ symbol, e.g. npm install @myorg/package would place +the package in {prefix}/node_modules/@myorg/package. See scope(7) for +more details.

+

If you wish to require() a package, then install it locally.

+

Executables

+

When in global mode, executables are linked into {prefix}/bin on Unix, +or directly into {prefix} on Windows.

+

When in local mode, executables are linked into +./node_modules/.bin so that they can be made available to scripts run +through npm. (For example, so that a test runner will be in the path +when you run npm test.)

+

Man Pages

+

When in global mode, man pages are linked into {prefix}/share/man.

+

When in local mode, man pages are not installed.

+

Man pages are not installed on Windows systems.

+

Cache

+

See npm-cache(1). Cache files are stored in ~/.npm on Posix, or +~/npm-cache on Windows.

+

This is controlled by the cache configuration param.

+

Temp Files

+

Temporary files are stored by default in the folder specified by the +tmp config, which defaults to the TMPDIR, TMP, or TEMP environment +variables, or /tmp on Unix and c:\windows\temp on Windows.

+

Temp files are given a unique folder under this root for each run of the +program, and are deleted upon successful exit.

+

More Information

+

When installing locally, npm first tries to find an appropriate +prefix folder. This is so that npm install foo@1.2.3 will install +to the sensible root of your package, even if you happen to have cded +into some other folder.

+

Starting at the $PWD, npm will walk up the folder tree checking for a +folder that contains either a package.json file, or a node_modules +folder. If such a thing is found, then that is treated as the effective +"current directory" for the purpose of running npm commands. (This +behavior is inspired by and similar to git's .git-folder seeking +logic when running git commands in a working dir.)

+

If no package root is found, then the current folder is used.

+

When you run npm install foo@1.2.3, then the package is loaded into +the cache, and then unpacked into ./node_modules/foo. Then, any of +foo's dependencies are similarly unpacked into +./node_modules/foo/node_modules/....

+

Any bin files are symlinked to ./node_modules/.bin/, so that they may +be found by npm scripts when necessary.

+

Global Installation

+

If the global configuration is set to true, then npm will +install packages "globally".

+

For global installation, packages are installed roughly the same way, +but using the folders described above.

+

Cycles, Conflicts, and Folder Parsimony

+

Cycles are handled using the property of node's module system that it +walks up the directories looking for node_modules folders. So, at every +stage, if a package is already installed in an ancestor node_modules +folder, then it is not installed at the current location.

+

Consider the case above, where foo -> bar -> baz. Imagine if, in +addition to that, baz depended on bar, so you'd have: +foo -> bar -> baz -> bar -> baz .... However, since the folder +structure is: foo/node_modules/bar/node_modules/baz, there's no need to +put another copy of bar into .../baz/node_modules, since when it calls +require("bar"), it will get the copy that is installed in +foo/node_modules/bar.

+

This shortcut is only used if the exact same +version would be installed in multiple nested node_modules folders. It +is still possible to have a/node_modules/b/node_modules/a if the two +"a" packages are different versions. However, without repeating the +exact same package multiple times, an infinite regress will always be +prevented.

+

Another optimization can be made by installing dependencies at the +highest level possible, below the localized "target" folder.

+

Example

+

Consider this dependency graph:

+
foo
++-- blerg@1.2.5
++-- bar@1.2.3
+|   +-- blerg@1.x (latest=1.3.7)
+|   +-- baz@2.x
+|   |   `-- quux@3.x
+|   |       `-- bar@1.2.3 (cycle)
+|   `-- asdf@*
+`-- baz@1.2.3
+    `-- quux@3.x
+        `-- bar
+

In this case, we might expect a folder structure like this:

+
foo
++-- node_modules
+    +-- blerg (1.2.5) <---[A]
+    +-- bar (1.2.3) <---[B]
+    |   `-- node_modules
+    |       +-- baz (2.0.2) <---[C]
+    |       |   `-- node_modules
+    |       |       `-- quux (3.2.0)
+    |       `-- asdf (2.3.4)
+    `-- baz (1.2.3) <---[D]
+        `-- node_modules
+            `-- quux (3.2.0) <---[E]
+

Since foo depends directly on bar@1.2.3 and baz@1.2.3, those are +installed in foo's node_modules folder.

+

Even though the latest copy of blerg is 1.3.7, foo has a specific +dependency on version 1.2.5. So, that gets installed at [A]. Since the +parent installation of blerg satisfies bar's dependency on blerg@1.x, +it does not install another copy under [B].

+

Bar [B] also has dependencies on baz and asdf, so those are installed in +bar's node_modules folder. Because it depends on baz@2.x, it cannot +re-use the baz@1.2.3 installed in the parent node_modules folder [D], +and must install its own copy [C].

+

Underneath bar, the baz -> quux -> bar dependency creates a cycle. +However, because bar is already in quux's ancestry [B], it does not +unpack another copy of bar into that folder.

+

Underneath foo -> baz [D], quux's [E] folder tree is empty, because its +dependency on bar is satisfied by the parent folder copy installed at [B].

+

For a graphical breakdown of what is installed where, use npm ls.

+

Publishing

+

Upon publishing, npm will look in the node_modules folder. If any of +the items there are not in the bundledDependencies array, then they will +not be included in the package tarball.

+

This allows a package maintainer to install all of their dependencies +(and dev dependencies) locally, but only re-publish those items that +cannot be found elsewhere. See package.json(5) for more information.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/files/npm-json.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/files/npm-json.html new file mode 100644 index 00000000..8d6cf977 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/files/npm-json.html @@ -0,0 +1,589 @@ + + + package.json + + + + + + +
+ +

package.json

Specifics of npm's package.json handling

+

DESCRIPTION

+

This document is all you need to know about what's required in your package.json +file. It must be actual JSON, not just a JavaScript object literal.

+

A lot of the behavior described in this document is affected by the config +settings described in npm-config(7).

+

name

+

The most important things in your package.json are the name and version fields. +Those are actually required, and your package won't install without +them. The name and version together form an identifier that is assumed +to be completely unique. Changes to the package should come along with +changes to the version.

+

The name is what your thing is called.

+

Some rules:

+
    +
  • The name must be less than or equal to 214 characters. This includes the scope for +scoped packages.
  • +
  • The name can't start with a dot or an underscore.
  • +
  • New packages must not have uppercase letters in the name.
  • +
  • The name ends up being part of a URL, an argument on the command line, and a +folder name. Therefore, the name can't contain any non-URL-safe characters.
  • +
+

Some tips:

+
    +
  • Don't use the same name as a core Node module.
  • +
  • Don't put "js" or "node" in the name. It's assumed that it's js, since you're +writing a package.json file, and you can specify the engine using the "engines" +field. (See below.)
  • +
  • The name will probably be passed as an argument to require(), so it should +be something short, but also reasonably descriptive.
  • +
  • You may want to check the npm registry to see if there's something by that name +already, before you get too attached to it. https://www.npmjs.com/
  • +
+

A name can be optionally prefixed by a scope, e.g. @myorg/mypackage. See +npm-scope(7) for more detail.

+

version

+

The most important things in your package.json are the name and version fields. +Those are actually required, and your package won't install without +them. The name and version together form an identifier that is assumed +to be completely unique. Changes to the package should come along with +changes to the version.

+

Version must be parseable by +node-semver, which is bundled +with npm as a dependency. (npm install semver to use it yourself.)

+

More on version numbers and ranges at semver(7).

+

description

+

Put a description in it. It's a string. This helps people discover your +package, as it's listed in npm search.

+

keywords

+

Put keywords in it. It's an array of strings. This helps people +discover your package as it's listed in npm search.

+

homepage

+

The url to the project homepage.

+

NOTE: This is not the same as "url". If you put a "url" field, +then the registry will think it's a redirection to your package that has +been published somewhere else, and spit at you.

+

Literally. Spit. I'm so not kidding.

+

bugs

+

The url to your project's issue tracker and / or the email address to which +issues should be reported. These are helpful for people who encounter issues +with your package.

+

It should look like this:

+
{ "url" : "https://github.com/owner/project/issues"
+, "email" : "project@hostname.com"
+}
+

You can specify either one or both values. If you want to provide only a url, +you can specify the value for "bugs" as a simple string instead of an object.

+

If a url is provided, it will be used by the npm bugs command.

+

license

+

You should specify a license for your package so that people know how they are +permitted to use it, and any restrictions you're placing on it.

+

If you're using a common license such as BSD-2-Clause or MIT, add a +current SPDX license identifier for the license you're using, like this:

+
{ "license" : "BSD-3-Clause" }
+

You can check the full list of SPDX license IDs. +Ideally you should pick one that is +OSI approved.

+

If your package is licensed under multiple common licenses, use an SPDX license +expression syntax version 2.0 string, like this:

+
{ "license" : "(ISC OR GPL-3.0)" }
+

If you are using a license that hasn't been assigned an SPDX identifier, or if +you are using a custom license, use a string value like this one:

+
{ "license" : "SEE LICENSE IN <filename>" }
+

Then include a file named <filename> at the top level of the package.

+

Some old packages used license objects or a "licenses" property containing an +array of license objects:

+
// Not valid metadata
+{ "license" :
+  { "type" : "ISC"
+  , "url" : "http://opensource.org/licenses/ISC"
+  }
+}
+
+// Not valid metadata
+{ "licenses" :
+  [
+    { "type": "MIT"
+    , "url": "http://www.opensource.org/licenses/mit-license.php"
+    }
+  , { "type": "Apache-2.0"
+    , "url": "http://opensource.org/licenses/apache2.0.php"
+    }
+  ]
+}
+

Those styles are now deprecated. Instead, use SPDX expressions, like this:

+
{ "license": "ISC" }
+
+{ "license": "(MIT OR Apache-2.0)" }
+

Finally, if you do not wish to grant others the right to use a private or +unpublished package under any terms:

+
{ "license": "UNLICENSED"}
+

Consider also setting "private": true to prevent accidental publication.

+

people fields: author, contributors

+

The "author" is one person. "contributors" is an array of people. A "person" +is an object with a "name" field and optionally "url" and "email", like this:

+
{ "name" : "Barney Rubble"
+, "email" : "b@rubble.com"
+, "url" : "http://barnyrubble.tumblr.com/"
+}
+

Or you can shorten that all into a single string, and npm will parse it for you:

+
"Barney Rubble <b@rubble.com> (http://barnyrubble.tumblr.com/)"
+

Both email and url are optional either way.

+

npm also sets a top-level "maintainers" field with your npm user info.

+

files

+

The "files" field is an array of files to include in your project. If +you name a folder in the array, then it will also include the files +inside that folder. (Unless they would be ignored by another rule.)

+

You can also provide a ".npmignore" file in the root of your package or +in subdirectories, which will keep files from being included, even +if they would be picked up by the files array. The .npmignore file +works just like a .gitignore.

+

Certain files are always included, regardless of settings:

+
    +
  • package.json
  • +
  • README
  • +
  • CHANGES / CHANGELOG / HISTORY (any casing and file extension)
  • +
  • LICENSE / LICENCE
  • +
  • The file in the "main" field
  • +
+

Conversely, some files are always ignored:

+
    +
  • .git
  • +
  • CVS
  • +
  • .svn
  • +
  • .hg
  • +
  • .lock-wscript
  • +
  • .wafpickle-N
  • +
  • .*.swp
  • +
  • .DS_Store
  • +
  • ._*
  • +
  • npm-debug.log
  • +
  • .npmrc
  • +
  • node_modules
  • +
+

main

+

The main field is a module ID that is the primary entry point to your program. +That is, if your package is named foo, and a user installs it, and then does +require("foo"), then your main module's exports object will be returned.

+

This should be a module ID relative to the root of your package folder.

+

For most modules, it makes the most sense to have a main script and often not +much else.

+

bin

+

A lot of packages have one or more executable files that they'd like to +install into the PATH. npm makes this pretty easy (in fact, it uses this +feature to install the "npm" executable.)

+

To use this, supply a bin field in your package.json which is a map of +command name to local file name. On install, npm will symlink that file into +prefix/bin for global installs, or ./node_modules/.bin/ for local +installs.

+

For example, myapp could have this:

+
{ "bin" : { "myapp" : "./cli.js" } }
+

So, when you install myapp, it'll create a symlink from the cli.js script to +/usr/local/bin/myapp.

+

If you have a single executable, and its name should be the name +of the package, then you can just supply it as a string. For example:

+
{ "name": "my-program"
+, "version": "1.2.5"
+, "bin": "./path/to/program" }
+

would be the same as this:

+
{ "name": "my-program"
+, "version": "1.2.5"
+, "bin" : { "my-program" : "./path/to/program" } }
+

Please make sure that your file(s) referenced in bin starts with +#!/usr/bin/env node, otherwise the scripts are started without the node +executable!

+

man

+

Specify either a single file or an array of filenames to put in place for the +man program to find.

+

If only a single file is provided, then it's installed such that it is the +result from man <pkgname>, regardless of its actual filename. For example:

+
{ "name" : "foo"
+, "version" : "1.2.3"
+, "description" : "A packaged foo fooer for fooing foos"
+, "main" : "foo.js"
+, "man" : "./man/doc.1"
+}
+

would link the ./man/doc.1 file in such that it is the target for man foo

+

If the filename doesn't start with the package name, then it's prefixed. +So, this:

+
{ "name" : "foo"
+, "version" : "1.2.3"
+, "description" : "A packaged foo fooer for fooing foos"
+, "main" : "foo.js"
+, "man" : [ "./man/foo.1", "./man/bar.1" ]
+}
+

will create files to do man foo and man foo-bar.

+

Man files must end with a number, and optionally a .gz suffix if they are +compressed. The number dictates which man section the file is installed into.

+
{ "name" : "foo"
+, "version" : "1.2.3"
+, "description" : "A packaged foo fooer for fooing foos"
+, "main" : "foo.js"
+, "man" : [ "./man/foo.1", "./man/foo.2" ]
+}
+

will create entries for man foo and man 2 foo

+

directories

+

The CommonJS Packages spec details a +few ways that you can indicate the structure of your package using a directories +object. If you look at npm's package.json, +you'll see that it has directories for doc, lib, and man.

+

In the future, this information may be used in other creative ways.

+

directories.lib

+

Tell people where the bulk of your library is. Nothing special is done +with the lib folder in any way, but it's useful meta info.

+

directories.bin

+

If you specify a bin directory in directories.bin, all the files in +that folder will be added.

+

Because of the way the bin directive works, specifying both a +bin path and setting directories.bin is an error. If you want to +specify individual files, use bin, and for all the files in an +existing bin directory, use directories.bin.

+

directories.man

+

A folder that is full of man pages. Sugar to generate a "man" array by +walking the folder.

+

directories.doc

+

Put markdown files in here. Eventually, these will be displayed nicely, +maybe, someday.

+

directories.example

+

Put example scripts in here. Someday, it might be exposed in some clever way.

+

directories.test

+

Put your tests in here. It is currently not exposed, but it might be in the +future.

+

repository

+

Specify the place where your code lives. This is helpful for people who +want to contribute. If the git repo is on GitHub, then the npm docs +command will be able to find you.

+

Do it like this:

+
"repository" :
+  { "type" : "git"
+  , "url" : "https://github.com/npm/npm.git"
+  }
+
+"repository" :
+  { "type" : "svn"
+  , "url" : "https://v8.googlecode.com/svn/trunk/"
+  }
+

The URL should be a publicly available (perhaps read-only) url that can be handed +directly to a VCS program without any modification. It should not be a url to an +html project page that you put in your browser. It's for computers.

+

For GitHub, GitHub gist, Bitbucket, or GitLab repositories you can use the same +shortcut syntax you use for npm install:

+
"repository": "npm/npm"
+
+"repository": "gist:11081aaa281"
+
+"repository": "bitbucket:example/repo"
+
+"repository": "gitlab:another/repo"
+

scripts

+

The "scripts" property is a dictionary containing script commands that are run +at various times in the lifecycle of your package. The key is the lifecycle +event, and the value is the command to run at that point.

+

See npm-scripts(7) to find out more about writing package scripts.

+

config

+

A "config" object can be used to set configuration parameters used in package +scripts that persist across upgrades. For instance, if a package had the +following:

+
{ "name" : "foo"
+, "config" : { "port" : "8080" } }
+

and then had a "start" command that then referenced the +npm_package_config_port environment variable, then the user could +override that by doing npm config set foo:port 8001.

+

See npm-config(7) and npm-scripts(7) for more on package +configs.

+

dependencies

+

Dependencies are specified in a simple object that maps a package name to a +version range. The version range is a string which has one or more +space-separated descriptors. Dependencies can also be identified with a +tarball or git URL.

+

Please do not put test harnesses or transpilers in your +dependencies object. See devDependencies, below.

+

See semver(7) for more details about specifying version ranges.

+
    +
  • version Must match version exactly
  • +
  • >version Must be greater than version
  • +
  • >=version etc
  • +
  • <version
  • +
  • <=version
  • +
  • ~version "Approximately equivalent to version" See semver(7)
  • +
  • ^version "Compatible with version" See semver(7)
  • +
  • 1.2.x 1.2.0, 1.2.1, etc., but not 1.3.0
  • +
  • http://... See 'URLs as Dependencies' below
  • +
  • * Matches any version
  • +
  • "" (just an empty string) Same as *
  • +
  • version1 - version2 Same as >=version1 <=version2.
  • +
  • range1 || range2 Passes if either range1 or range2 are satisfied.
  • +
  • git... See 'Git URLs as Dependencies' below
  • +
  • user/repo See 'GitHub URLs' below
  • +
  • tag A specific version tagged and published as tag See npm-tag(1)
  • +
  • path/path/path See Local Paths below
  • +
+

For example, these are all valid:

+
{ "dependencies" :
+  { "foo" : "1.0.0 - 2.9999.9999"
+  , "bar" : ">=1.0.2 <2.1.2"
+  , "baz" : ">1.0.2 <=2.3.4"
+  , "boo" : "2.0.1"
+  , "qux" : "<1.0.0 || >=2.3.1 <2.4.5 || >=2.5.2 <3.0.0"
+  , "asd" : "http://asdf.com/asdf.tar.gz"
+  , "til" : "~1.2"
+  , "elf" : "~1.2.3"
+  , "two" : "2.x"
+  , "thr" : "3.3.x"
+  , "lat" : "latest"
+  , "dyl" : "file:../dyl"
+  }
+}
+

URLs as Dependencies

+

You may specify a tarball URL in place of a version range.

+

This tarball will be downloaded and installed locally to your package at +install time.

+

Git URLs as Dependencies

+

Git urls can be of the form:

+
git://github.com/user/project.git#commit-ish
+git+ssh://user@hostname:project.git#commit-ish
+git+ssh://user@hostname/project.git#commit-ish
+git+http://user@hostname/project/blah.git#commit-ish
+git+https://user@hostname/project/blah.git#commit-ish
+

The commit-ish can be any tag, sha, or branch which can be supplied as +an argument to git checkout. The default is master.

+

GitHub URLs

+

As of version 1.1.65, you can refer to GitHub urls as just "foo": +"user/foo-project". Just as with git URLs, a commit-ish suffix can be +included. For example:

+
{
+  "name": "foo",
+  "version": "0.0.0",
+  "dependencies": {
+    "express": "visionmedia/express",
+    "mocha": "visionmedia/mocha#4727d357ea"
+  }
+}
+

Local Paths

+

As of version 2.0.0 you can provide a path to a local directory that contains a +package. Local paths can be saved using npm install --save, using any of +these forms:

+
../foo/bar
+~/foo/bar
+./foo/bar
+/foo/bar
+

in which case they will be normalized to a relative path and added to your +package.json. For example:

+
{
+  "name": "baz",
+  "dependencies": {
+    "bar": "file:../foo/bar"
+  }
+}
+

This feature is helpful for local offline development and creating +tests that require npm installing where you don't want to hit an +external server, but should not be used when publishing packages +to the public registry.

+

devDependencies

+

If someone is planning on downloading and using your module in their +program, then they probably don't want or need to download and build +the external test or documentation framework that you use.

+

In this case, it's best to map these additional items in a devDependencies +object.

+

These things will be installed when doing npm link or npm install +from the root of a package, and can be managed like any other npm +configuration param. See npm-config(7) for more on the topic.

+

For build steps that are not platform-specific, such as compiling +CoffeeScript or other languages to JavaScript, use the prepublish +script to do this, and make the required package a devDependency.

+

For example:

+
{ "name": "ethopia-waza",
+  "description": "a delightfully fruity coffee varietal",
+  "version": "1.2.3",
+  "devDependencies": {
+    "coffee-script": "~1.6.3"
+  },
+  "scripts": {
+    "prepublish": "coffee -o lib/ -c src/waza.coffee"
+  },
+  "main": "lib/waza.js"
+}
+

The prepublish script will be run before publishing, so that users +can consume the functionality without requiring them to compile it +themselves. In dev mode (ie, locally running npm install), it'll +run this script as well, so that you can test it easily.

+

peerDependencies

+

In some cases, you want to express the compatibility of your package with a +host tool or library, while not necessarily doing a require of this host. +This is usually referred to as a plugin. Notably, your module may be exposing +a specific interface, expected and specified by the host documentation.

+

For example:

+
{
+  "name": "tea-latte",
+  "version": "1.3.5",
+  "peerDependencies": {
+    "tea": "2.x"
+  }
+}
+

This ensures your package tea-latte can be installed along with the second +major version of the host package tea only. npm install tea-latte could +possibly yield the following dependency graph:

+
├── tea-latte@1.3.5
+└── tea@2.2.0
+

NOTE: npm versions 1 and 2 will automatically install peerDependencies if +they are not explicitly depended upon higher in the dependency tree. In the +next major version of npm (npm@3), this will no longer be the case. You will +receive a warning that the peerDependency is not installed instead. The +behavior in npms 1 & 2 was frequently confusing and could easily put you into +dependency hell, a situation that npm is designed to avoid as much as possible.

+

Trying to install another plugin with a conflicting requirement will cause an +error. For this reason, make sure your plugin requirement is as broad as +possible, and not to lock it down to specific patch versions.

+

Assuming the host complies with semver, only changes in +the host package's major version will break your plugin. Thus, if you've worked +with every 1.x version of the host package, use "^1.0" or "1.x" to express +this. If you depend on features introduced in 1.5.2, use ">= 1.5.2 < 2".

+

bundledDependencies

+

This defines an array of package names that will be bundled when publishing the package.

+

In cases where you need to preserve npm packages locally or have them available through a single file download, you can bundle the packages in a tarball file by specifying the package names in the bundledDependencies array and executing npm pack.

+

For example: +If we define a package.json like this:

+
{
+  "name": "awesome-web-framework",
+  "version": "1.0.0",
+  "bundledDependencies": [
+    'renderized', 'super-streams'
+  ]
+}
+

we can obtain awesome-web-framework-1.0.0.tgz file by running npm pack. This file contains the dependencies renderized and super-streams which can be installed in a new project by executing npm install awesome-web-framework-1.0.0.tgz.

+

If this is spelled "bundleDependencies", then that is also honored.

+

optionalDependencies

+

If a dependency can be used, but you would like npm to proceed if it cannot be +found or fails to install, then you may put it in the optionalDependencies +object. This is a map of package name to version or url, just like the +dependencies object. The difference is that build failures do not cause +installation to fail.

+

It is still your program's responsibility to handle the lack of the +dependency. For example, something like this:

+
try {
+  var foo = require('foo')
+  var fooVersion = require('foo/package.json').version
+} catch (er) {
+  foo = null
+}
+if ( notGoodFooVersion(fooVersion) ) {
+  foo = null
+}
+
+// .. then later in your program ..
+
+if (foo) {
+  foo.doFooThings()
+}
+

Entries in optionalDependencies will override entries of the same name in +dependencies, so it's usually best to only put in one place.

+

engines

+

You can specify the version of node that your stuff works on:

+
{ "engines" : { "node" : ">=0.10.3 <0.12" } }
+

And, like with dependencies, if you don't specify the version (or if you +specify "*" as the version), then any version of node will do.

+

If you specify an "engines" field, then npm will require that "node" be +somewhere on that list. If "engines" is omitted, then npm will just assume +that it works on node.

+

You can also use the "engines" field to specify which versions of npm +are capable of properly installing your program. For example:

+
{ "engines" : { "npm" : "~1.0.20" } }
+

Unless the user has set the engine-strict config flag, this +field is advisory only will produce warnings when your package is installed as a dependency.

+

engineStrict

+

NOTE: This feature is deprecated and will be removed in npm 3.0.0.

+

If you are sure that your module will definitely not run properly on +versions of Node/npm other than those specified in the engines object, +then you can set "engineStrict": true in your package.json file. +This will override the user's engine-strict config setting.

+

Please do not do this unless you are really very very sure. If your +engines object is something overly restrictive, you can quite easily and +inadvertently lock yourself into obscurity and prevent your users from +updating to new versions of Node. Consider this choice carefully.

+

os

+

You can specify which operating systems your +module will run on:

+
"os" : [ "darwin", "linux" ]
+

You can also blacklist instead of whitelist operating systems, +just prepend the blacklisted os with a '!':

+
"os" : [ "!win32" ]
+

The host operating system is determined by process.platform

+

It is allowed to both blacklist, and whitelist, although there isn't any +good reason to do this.

+

cpu

+

If your code only runs on certain cpu architectures, +you can specify which ones.

+
"cpu" : [ "x64", "ia32" ]
+

Like the os option, you can also blacklist architectures:

+
"cpu" : [ "!arm", "!mips" ]
+

The host architecture is determined by process.arch

+

preferGlobal

+

If your package is primarily a command-line application that should be +installed globally, then set this value to true to provide a warning +if it is installed locally.

+

It doesn't actually prevent users from installing it locally, but it +does help prevent some confusion if it doesn't work as expected.

+

private

+

If you set "private": true in your package.json, then npm will refuse +to publish it.

+

This is a way to prevent accidental publication of private repositories. If +you would like to ensure that a given package is only ever published to a +specific registry (for example, an internal registry), then use the +publishConfig dictionary described below to override the registry config +param at publish-time.

+

publishConfig

+

This is a set of config values that will be used at publish-time. It's +especially handy if you want to set the tag, registry or access, so that +you can ensure that a given package is not tagged with "latest", published +to the global public registry or that a scoped module is private by default.

+

Any config values can be overridden, but of course only "tag", "registry" and +"access" probably matter for the purposes of publishing.

+

See npm-config(7) to see the list of config options that can be +overridden.

+

DEFAULT VALUES

+

npm will default some values based on package contents.

+
    +
  • "scripts": {"start": "node server.js"}

    +

    If there is a server.js file in the root of your package, then npm +will default the start command to node server.js.

    +
  • +
  • "scripts":{"install": "node-gyp rebuild"}

    +

    If there is a binding.gyp file in the root of your package and you have not defined an install or preinstall script, npm will +default the install command to compile using node-gyp.

    +
  • +
  • "contributors": [...]

    +

    If there is an AUTHORS file in the root of your package, npm will +treat each line as a Name <email> (url) format, where email and url +are optional. Lines which start with a # or are blank, will be +ignored.

    +
  • +
+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/files/npmrc.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/files/npmrc.html new file mode 100644 index 00000000..84479a35 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/files/npmrc.html @@ -0,0 +1,93 @@ + + + npmrc + + + + + + +
+ +

npmrc

The npm config files

+

DESCRIPTION

+

npm gets its config settings from the command line, environment +variables, and npmrc files.

+

The npm config command can be used to update and edit the contents +of the user and global npmrc files.

+

For a list of available configuration options, see npm-config(7).

+

FILES

+

The four relevant files are:

+
    +
  • per-project config file (/path/to/my/project/.npmrc)
  • +
  • per-user config file (~/.npmrc)
  • +
  • global config file ($PREFIX/etc/npmrc)
  • +
  • npm builtin config file (/path/to/npm/npmrc)
  • +
+

All npm config files are an ini-formatted list of key = value +parameters. Environment variables can be replaced using +${VARIABLE_NAME}. For example:

+
prefix = ${HOME}/.npm-packages
+

Each of these files is loaded, and config options are resolved in +priority order. For example, a setting in the userconfig file would +override the setting in the globalconfig file.

+

Array values are specified by adding "[]" after the key name. For +example:

+
key[] = "first value"
+key[] = "second value"
+

NOTE: Because local (per-project or per-user) .npmrc files can contain +sensitive credentials, they must be readable and writable only by your user +account (i.e. must have a mode of 0600), otherwise they will be ignored by +npm!

+

Comments

+

Lines in .npmrc files are interpreted as comments when they begin with a ; or # character. .npmrc files are parsed by npm/ini, which specifies this comment syntax.

+

For example:

+
# last modified: 01 Jan 2016
+; Set a new registry for a scoped package
+@myscope:registry=https://mycustomregistry.example.org
+

Per-project config file

+

When working locally in a project, a .npmrc file in the root of the +project (ie, a sibling of node_modules and package.json) will set +config values specific to this project.

+

Note that this only applies to the root of the project that you're +running npm in. It has no effect when your module is published. For +example, you can't publish a module that forces itself to install +globally, or in a different location.

+

Additionally, this file is not read in global mode, such as when running +npm install -g.

+

Per-user config file

+

$HOME/.npmrc (or the userconfig param, if set in the environment +or on the command line)

+

Global config file

+

$PREFIX/etc/npmrc (or the globalconfig param, if set above): +This file is an ini-file formatted list of key = value parameters. +Environment variables can be replaced as above.

+

Built-in config file

+

path/to/npm/itself/npmrc

+

This is an unchangeable "builtin" configuration file that npm keeps +consistent across updates. Set fields in here using the ./configure +script that comes with npm. This is primarily for distribution +maintainers to override default configs in a standard and consistent +manner.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/files/package.json.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/files/package.json.html new file mode 100644 index 00000000..8d6cf977 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/files/package.json.html @@ -0,0 +1,589 @@ + + + package.json + + + + + + +
+ +

package.json

Specifics of npm's package.json handling

+

DESCRIPTION

+

This document is all you need to know about what's required in your package.json +file. It must be actual JSON, not just a JavaScript object literal.

+

A lot of the behavior described in this document is affected by the config +settings described in npm-config(7).

+

name

+

The most important things in your package.json are the name and version fields. +Those are actually required, and your package won't install without +them. The name and version together form an identifier that is assumed +to be completely unique. Changes to the package should come along with +changes to the version.

+

The name is what your thing is called.

+

Some rules:

+
    +
  • The name must be less than or equal to 214 characters. This includes the scope for +scoped packages.
  • +
  • The name can't start with a dot or an underscore.
  • +
  • New packages must not have uppercase letters in the name.
  • +
  • The name ends up being part of a URL, an argument on the command line, and a +folder name. Therefore, the name can't contain any non-URL-safe characters.
  • +
+

Some tips:

+
    +
  • Don't use the same name as a core Node module.
  • +
  • Don't put "js" or "node" in the name. It's assumed that it's js, since you're +writing a package.json file, and you can specify the engine using the "engines" +field. (See below.)
  • +
  • The name will probably be passed as an argument to require(), so it should +be something short, but also reasonably descriptive.
  • +
  • You may want to check the npm registry to see if there's something by that name +already, before you get too attached to it. https://www.npmjs.com/
  • +
+

A name can be optionally prefixed by a scope, e.g. @myorg/mypackage. See +npm-scope(7) for more detail.

+

version

+

The most important things in your package.json are the name and version fields. +Those are actually required, and your package won't install without +them. The name and version together form an identifier that is assumed +to be completely unique. Changes to the package should come along with +changes to the version.

+

Version must be parseable by +node-semver, which is bundled +with npm as a dependency. (npm install semver to use it yourself.)

+

More on version numbers and ranges at semver(7).

+

description

+

Put a description in it. It's a string. This helps people discover your +package, as it's listed in npm search.

+

keywords

+

Put keywords in it. It's an array of strings. This helps people +discover your package as it's listed in npm search.

+

homepage

+

The url to the project homepage.

+

NOTE: This is not the same as "url". If you put a "url" field, +then the registry will think it's a redirection to your package that has +been published somewhere else, and spit at you.

+

Literally. Spit. I'm so not kidding.

+

bugs

+

The url to your project's issue tracker and / or the email address to which +issues should be reported. These are helpful for people who encounter issues +with your package.

+

It should look like this:

+
{ "url" : "https://github.com/owner/project/issues"
+, "email" : "project@hostname.com"
+}
+

You can specify either one or both values. If you want to provide only a url, +you can specify the value for "bugs" as a simple string instead of an object.

+

If a url is provided, it will be used by the npm bugs command.

+

license

+

You should specify a license for your package so that people know how they are +permitted to use it, and any restrictions you're placing on it.

+

If you're using a common license such as BSD-2-Clause or MIT, add a +current SPDX license identifier for the license you're using, like this:

+
{ "license" : "BSD-3-Clause" }
+

You can check the full list of SPDX license IDs. +Ideally you should pick one that is +OSI approved.

+

If your package is licensed under multiple common licenses, use an SPDX license +expression syntax version 2.0 string, like this:

+
{ "license" : "(ISC OR GPL-3.0)" }
+

If you are using a license that hasn't been assigned an SPDX identifier, or if +you are using a custom license, use a string value like this one:

+
{ "license" : "SEE LICENSE IN <filename>" }
+

Then include a file named <filename> at the top level of the package.

+

Some old packages used license objects or a "licenses" property containing an +array of license objects:

+
// Not valid metadata
+{ "license" :
+  { "type" : "ISC"
+  , "url" : "http://opensource.org/licenses/ISC"
+  }
+}
+
+// Not valid metadata
+{ "licenses" :
+  [
+    { "type": "MIT"
+    , "url": "http://www.opensource.org/licenses/mit-license.php"
+    }
+  , { "type": "Apache-2.0"
+    , "url": "http://opensource.org/licenses/apache2.0.php"
+    }
+  ]
+}
+

Those styles are now deprecated. Instead, use SPDX expressions, like this:

+
{ "license": "ISC" }
+
+{ "license": "(MIT OR Apache-2.0)" }
+

Finally, if you do not wish to grant others the right to use a private or +unpublished package under any terms:

+
{ "license": "UNLICENSED"}
+

Consider also setting "private": true to prevent accidental publication.

+

people fields: author, contributors

+

The "author" is one person. "contributors" is an array of people. A "person" +is an object with a "name" field and optionally "url" and "email", like this:

+
{ "name" : "Barney Rubble"
+, "email" : "b@rubble.com"
+, "url" : "http://barnyrubble.tumblr.com/"
+}
+

Or you can shorten that all into a single string, and npm will parse it for you:

+
"Barney Rubble <b@rubble.com> (http://barnyrubble.tumblr.com/)"
+

Both email and url are optional either way.

+

npm also sets a top-level "maintainers" field with your npm user info.

+

files

+

The "files" field is an array of files to include in your project. If +you name a folder in the array, then it will also include the files +inside that folder. (Unless they would be ignored by another rule.)

+

You can also provide a ".npmignore" file in the root of your package or +in subdirectories, which will keep files from being included, even +if they would be picked up by the files array. The .npmignore file +works just like a .gitignore.

+

Certain files are always included, regardless of settings:

+
    +
  • package.json
  • +
  • README
  • +
  • CHANGES / CHANGELOG / HISTORY (any casing and file extension)
  • +
  • LICENSE / LICENCE
  • +
  • The file in the "main" field
  • +
+

Conversely, some files are always ignored:

+
    +
  • .git
  • +
  • CVS
  • +
  • .svn
  • +
  • .hg
  • +
  • .lock-wscript
  • +
  • .wafpickle-N
  • +
  • .*.swp
  • +
  • .DS_Store
  • +
  • ._*
  • +
  • npm-debug.log
  • +
  • .npmrc
  • +
  • node_modules
  • +
+

main

+

The main field is a module ID that is the primary entry point to your program. +That is, if your package is named foo, and a user installs it, and then does +require("foo"), then your main module's exports object will be returned.

+

This should be a module ID relative to the root of your package folder.

+

For most modules, it makes the most sense to have a main script and often not +much else.

+

bin

+

A lot of packages have one or more executable files that they'd like to +install into the PATH. npm makes this pretty easy (in fact, it uses this +feature to install the "npm" executable.)

+

To use this, supply a bin field in your package.json which is a map of +command name to local file name. On install, npm will symlink that file into +prefix/bin for global installs, or ./node_modules/.bin/ for local +installs.

+

For example, myapp could have this:

+
{ "bin" : { "myapp" : "./cli.js" } }
+

So, when you install myapp, it'll create a symlink from the cli.js script to +/usr/local/bin/myapp.

+

If you have a single executable, and its name should be the name +of the package, then you can just supply it as a string. For example:

+
{ "name": "my-program"
+, "version": "1.2.5"
+, "bin": "./path/to/program" }
+

would be the same as this:

+
{ "name": "my-program"
+, "version": "1.2.5"
+, "bin" : { "my-program" : "./path/to/program" } }
+

Please make sure that your file(s) referenced in bin starts with +#!/usr/bin/env node, otherwise the scripts are started without the node +executable!

+

man

+

Specify either a single file or an array of filenames to put in place for the +man program to find.

+

If only a single file is provided, then it's installed such that it is the +result from man <pkgname>, regardless of its actual filename. For example:

+
{ "name" : "foo"
+, "version" : "1.2.3"
+, "description" : "A packaged foo fooer for fooing foos"
+, "main" : "foo.js"
+, "man" : "./man/doc.1"
+}
+

would link the ./man/doc.1 file in such that it is the target for man foo

+

If the filename doesn't start with the package name, then it's prefixed. +So, this:

+
{ "name" : "foo"
+, "version" : "1.2.3"
+, "description" : "A packaged foo fooer for fooing foos"
+, "main" : "foo.js"
+, "man" : [ "./man/foo.1", "./man/bar.1" ]
+}
+

will create files to do man foo and man foo-bar.

+

Man files must end with a number, and optionally a .gz suffix if they are +compressed. The number dictates which man section the file is installed into.

+
{ "name" : "foo"
+, "version" : "1.2.3"
+, "description" : "A packaged foo fooer for fooing foos"
+, "main" : "foo.js"
+, "man" : [ "./man/foo.1", "./man/foo.2" ]
+}
+

will create entries for man foo and man 2 foo

+

directories

+

The CommonJS Packages spec details a +few ways that you can indicate the structure of your package using a directories +object. If you look at npm's package.json, +you'll see that it has directories for doc, lib, and man.

+

In the future, this information may be used in other creative ways.

+

directories.lib

+

Tell people where the bulk of your library is. Nothing special is done +with the lib folder in any way, but it's useful meta info.

+

directories.bin

+

If you specify a bin directory in directories.bin, all the files in +that folder will be added.

+

Because of the way the bin directive works, specifying both a +bin path and setting directories.bin is an error. If you want to +specify individual files, use bin, and for all the files in an +existing bin directory, use directories.bin.

+

directories.man

+

A folder that is full of man pages. Sugar to generate a "man" array by +walking the folder.

+

directories.doc

+

Put markdown files in here. Eventually, these will be displayed nicely, +maybe, someday.

+

directories.example

+

Put example scripts in here. Someday, it might be exposed in some clever way.

+

directories.test

+

Put your tests in here. It is currently not exposed, but it might be in the +future.

+

repository

+

Specify the place where your code lives. This is helpful for people who +want to contribute. If the git repo is on GitHub, then the npm docs +command will be able to find you.

+

Do it like this:

+
"repository" :
+  { "type" : "git"
+  , "url" : "https://github.com/npm/npm.git"
+  }
+
+"repository" :
+  { "type" : "svn"
+  , "url" : "https://v8.googlecode.com/svn/trunk/"
+  }
+

The URL should be a publicly available (perhaps read-only) url that can be handed +directly to a VCS program without any modification. It should not be a url to an +html project page that you put in your browser. It's for computers.

+

For GitHub, GitHub gist, Bitbucket, or GitLab repositories you can use the same +shortcut syntax you use for npm install:

+
"repository": "npm/npm"
+
+"repository": "gist:11081aaa281"
+
+"repository": "bitbucket:example/repo"
+
+"repository": "gitlab:another/repo"
+

scripts

+

The "scripts" property is a dictionary containing script commands that are run +at various times in the lifecycle of your package. The key is the lifecycle +event, and the value is the command to run at that point.

+

See npm-scripts(7) to find out more about writing package scripts.

+

config

+

A "config" object can be used to set configuration parameters used in package +scripts that persist across upgrades. For instance, if a package had the +following:

+
{ "name" : "foo"
+, "config" : { "port" : "8080" } }
+

and then had a "start" command that then referenced the +npm_package_config_port environment variable, then the user could +override that by doing npm config set foo:port 8001.

+

See npm-config(7) and npm-scripts(7) for more on package +configs.

+

dependencies

+

Dependencies are specified in a simple object that maps a package name to a +version range. The version range is a string which has one or more +space-separated descriptors. Dependencies can also be identified with a +tarball or git URL.

+

Please do not put test harnesses or transpilers in your +dependencies object. See devDependencies, below.

+

See semver(7) for more details about specifying version ranges.

+
    +
  • version Must match version exactly
  • +
  • >version Must be greater than version
  • +
  • >=version etc
  • +
  • <version
  • +
  • <=version
  • +
  • ~version "Approximately equivalent to version" See semver(7)
  • +
  • ^version "Compatible with version" See semver(7)
  • +
  • 1.2.x 1.2.0, 1.2.1, etc., but not 1.3.0
  • +
  • http://... See 'URLs as Dependencies' below
  • +
  • * Matches any version
  • +
  • "" (just an empty string) Same as *
  • +
  • version1 - version2 Same as >=version1 <=version2.
  • +
  • range1 || range2 Passes if either range1 or range2 are satisfied.
  • +
  • git... See 'Git URLs as Dependencies' below
  • +
  • user/repo See 'GitHub URLs' below
  • +
  • tag A specific version tagged and published as tag See npm-tag(1)
  • +
  • path/path/path See Local Paths below
  • +
+

For example, these are all valid:

+
{ "dependencies" :
+  { "foo" : "1.0.0 - 2.9999.9999"
+  , "bar" : ">=1.0.2 <2.1.2"
+  , "baz" : ">1.0.2 <=2.3.4"
+  , "boo" : "2.0.1"
+  , "qux" : "<1.0.0 || >=2.3.1 <2.4.5 || >=2.5.2 <3.0.0"
+  , "asd" : "http://asdf.com/asdf.tar.gz"
+  , "til" : "~1.2"
+  , "elf" : "~1.2.3"
+  , "two" : "2.x"
+  , "thr" : "3.3.x"
+  , "lat" : "latest"
+  , "dyl" : "file:../dyl"
+  }
+}
+

URLs as Dependencies

+

You may specify a tarball URL in place of a version range.

+

This tarball will be downloaded and installed locally to your package at +install time.

+

Git URLs as Dependencies

+

Git urls can be of the form:

+
git://github.com/user/project.git#commit-ish
+git+ssh://user@hostname:project.git#commit-ish
+git+ssh://user@hostname/project.git#commit-ish
+git+http://user@hostname/project/blah.git#commit-ish
+git+https://user@hostname/project/blah.git#commit-ish
+

The commit-ish can be any tag, sha, or branch which can be supplied as +an argument to git checkout. The default is master.

+

GitHub URLs

+

As of version 1.1.65, you can refer to GitHub urls as just "foo": +"user/foo-project". Just as with git URLs, a commit-ish suffix can be +included. For example:

+
{
+  "name": "foo",
+  "version": "0.0.0",
+  "dependencies": {
+    "express": "visionmedia/express",
+    "mocha": "visionmedia/mocha#4727d357ea"
+  }
+}
+

Local Paths

+

As of version 2.0.0 you can provide a path to a local directory that contains a +package. Local paths can be saved using npm install --save, using any of +these forms:

+
../foo/bar
+~/foo/bar
+./foo/bar
+/foo/bar
+

in which case they will be normalized to a relative path and added to your +package.json. For example:

+
{
+  "name": "baz",
+  "dependencies": {
+    "bar": "file:../foo/bar"
+  }
+}
+

This feature is helpful for local offline development and creating +tests that require npm installing where you don't want to hit an +external server, but should not be used when publishing packages +to the public registry.

+

devDependencies

+

If someone is planning on downloading and using your module in their +program, then they probably don't want or need to download and build +the external test or documentation framework that you use.

+

In this case, it's best to map these additional items in a devDependencies +object.

+

These things will be installed when doing npm link or npm install +from the root of a package, and can be managed like any other npm +configuration param. See npm-config(7) for more on the topic.

+

For build steps that are not platform-specific, such as compiling +CoffeeScript or other languages to JavaScript, use the prepublish +script to do this, and make the required package a devDependency.

+

For example:

+
{ "name": "ethopia-waza",
+  "description": "a delightfully fruity coffee varietal",
+  "version": "1.2.3",
+  "devDependencies": {
+    "coffee-script": "~1.6.3"
+  },
+  "scripts": {
+    "prepublish": "coffee -o lib/ -c src/waza.coffee"
+  },
+  "main": "lib/waza.js"
+}
+

The prepublish script will be run before publishing, so that users +can consume the functionality without requiring them to compile it +themselves. In dev mode (ie, locally running npm install), it'll +run this script as well, so that you can test it easily.

+

peerDependencies

+

In some cases, you want to express the compatibility of your package with a +host tool or library, while not necessarily doing a require of this host. +This is usually referred to as a plugin. Notably, your module may be exposing +a specific interface, expected and specified by the host documentation.

+

For example:

+
{
+  "name": "tea-latte",
+  "version": "1.3.5",
+  "peerDependencies": {
+    "tea": "2.x"
+  }
+}
+

This ensures your package tea-latte can be installed along with the second +major version of the host package tea only. npm install tea-latte could +possibly yield the following dependency graph:

+
├── tea-latte@1.3.5
+└── tea@2.2.0
+

NOTE: npm versions 1 and 2 will automatically install peerDependencies if +they are not explicitly depended upon higher in the dependency tree. In the +next major version of npm (npm@3), this will no longer be the case. You will +receive a warning that the peerDependency is not installed instead. The +behavior in npms 1 & 2 was frequently confusing and could easily put you into +dependency hell, a situation that npm is designed to avoid as much as possible.

+

Trying to install another plugin with a conflicting requirement will cause an +error. For this reason, make sure your plugin requirement is as broad as +possible, and not to lock it down to specific patch versions.

+

Assuming the host complies with semver, only changes in +the host package's major version will break your plugin. Thus, if you've worked +with every 1.x version of the host package, use "^1.0" or "1.x" to express +this. If you depend on features introduced in 1.5.2, use ">= 1.5.2 < 2".

+

bundledDependencies

+

This defines an array of package names that will be bundled when publishing the package.

+

In cases where you need to preserve npm packages locally or have them available through a single file download, you can bundle the packages in a tarball file by specifying the package names in the bundledDependencies array and executing npm pack.

+

For example: +If we define a package.json like this:

+
{
+  "name": "awesome-web-framework",
+  "version": "1.0.0",
+  "bundledDependencies": [
+    'renderized', 'super-streams'
+  ]
+}
+

we can obtain awesome-web-framework-1.0.0.tgz file by running npm pack. This file contains the dependencies renderized and super-streams which can be installed in a new project by executing npm install awesome-web-framework-1.0.0.tgz.

+

If this is spelled "bundleDependencies", then that is also honored.

+

optionalDependencies

+

If a dependency can be used, but you would like npm to proceed if it cannot be +found or fails to install, then you may put it in the optionalDependencies +object. This is a map of package name to version or url, just like the +dependencies object. The difference is that build failures do not cause +installation to fail.

+

It is still your program's responsibility to handle the lack of the +dependency. For example, something like this:

+
try {
+  var foo = require('foo')
+  var fooVersion = require('foo/package.json').version
+} catch (er) {
+  foo = null
+}
+if ( notGoodFooVersion(fooVersion) ) {
+  foo = null
+}
+
+// .. then later in your program ..
+
+if (foo) {
+  foo.doFooThings()
+}
+

Entries in optionalDependencies will override entries of the same name in +dependencies, so it's usually best to only put in one place.

+

engines

+

You can specify the version of node that your stuff works on:

+
{ "engines" : { "node" : ">=0.10.3 <0.12" } }
+

And, like with dependencies, if you don't specify the version (or if you +specify "*" as the version), then any version of node will do.

+

If you specify an "engines" field, then npm will require that "node" be +somewhere on that list. If "engines" is omitted, then npm will just assume +that it works on node.

+

You can also use the "engines" field to specify which versions of npm +are capable of properly installing your program. For example:

+
{ "engines" : { "npm" : "~1.0.20" } }
+

Unless the user has set the engine-strict config flag, this +field is advisory only will produce warnings when your package is installed as a dependency.

+

engineStrict

+

NOTE: This feature is deprecated and will be removed in npm 3.0.0.

+

If you are sure that your module will definitely not run properly on +versions of Node/npm other than those specified in the engines object, +then you can set "engineStrict": true in your package.json file. +This will override the user's engine-strict config setting.

+

Please do not do this unless you are really very very sure. If your +engines object is something overly restrictive, you can quite easily and +inadvertently lock yourself into obscurity and prevent your users from +updating to new versions of Node. Consider this choice carefully.

+

os

+

You can specify which operating systems your +module will run on:

+
"os" : [ "darwin", "linux" ]
+

You can also blacklist instead of whitelist operating systems, +just prepend the blacklisted os with a '!':

+
"os" : [ "!win32" ]
+

The host operating system is determined by process.platform

+

It is allowed to both blacklist, and whitelist, although there isn't any +good reason to do this.

+

cpu

+

If your code only runs on certain cpu architectures, +you can specify which ones.

+
"cpu" : [ "x64", "ia32" ]
+

Like the os option, you can also blacklist architectures:

+
"cpu" : [ "!arm", "!mips" ]
+

The host architecture is determined by process.arch

+

preferGlobal

+

If your package is primarily a command-line application that should be +installed globally, then set this value to true to provide a warning +if it is installed locally.

+

It doesn't actually prevent users from installing it locally, but it +does help prevent some confusion if it doesn't work as expected.

+

private

+

If you set "private": true in your package.json, then npm will refuse +to publish it.

+

This is a way to prevent accidental publication of private repositories. If +you would like to ensure that a given package is only ever published to a +specific registry (for example, an internal registry), then use the +publishConfig dictionary described below to override the registry config +param at publish-time.

+

publishConfig

+

This is a set of config values that will be used at publish-time. It's +especially handy if you want to set the tag, registry or access, so that +you can ensure that a given package is not tagged with "latest", published +to the global public registry or that a scoped module is private by default.

+

Any config values can be overridden, but of course only "tag", "registry" and +"access" probably matter for the purposes of publishing.

+

See npm-config(7) to see the list of config options that can be +overridden.

+

DEFAULT VALUES

+

npm will default some values based on package contents.

+
    +
  • "scripts": {"start": "node server.js"}

    +

    If there is a server.js file in the root of your package, then npm +will default the start command to node server.js.

    +
  • +
  • "scripts":{"install": "node-gyp rebuild"}

    +

    If there is a binding.gyp file in the root of your package and you have not defined an install or preinstall script, npm will +default the install command to compile using node-gyp.

    +
  • +
  • "contributors": [...]

    +

    If there is an AUTHORS file in the root of your package, npm will +treat each line as a Name <email> (url) format, where email and url +are optional. Lines which start with a # or are blank, will be +ignored.

    +
  • +
+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/index.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/index.html new file mode 100644 index 00000000..be083009 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/index.html @@ -0,0 +1,246 @@ + + + npm-index + + + + + + +
+ +

npm-index

Index of all npm documentation

+

README

+

a JavaScript package manager

+

Command Line Documentation

+

Using npm on the command line

+

npm(1)

+

javascript package manager

+

npm-access(1)

+

Set access level on published packages

+

npm-adduser(1)

+

Add a registry user account

+

npm-bin(1)

+

Display npm bin folder

+

npm-bugs(1)

+

Bugs for a package in a web browser maybe

+

npm-build(1)

+

Build a package

+

npm-bundle(1)

+

REMOVED

+

npm-cache(1)

+

Manipulates packages cache

+

npm-completion(1)

+

Tab Completion for npm

+

npm-config(1)

+

Manage the npm configuration files

+

npm-dedupe(1)

+

Reduce duplication

+

npm-deprecate(1)

+

Deprecate a version of a package

+

npm-dist-tag(1)

+

Modify package distribution tags

+

npm-docs(1)

+

Docs for a package in a web browser maybe

+

npm-edit(1)

+

Edit an installed package

+

npm-explore(1)

+

Browse an installed package

+

npm-help-search(1)

+

Search npm help documentation

+

npm-help(1)

+

Get help on npm

+

npm-init(1)

+

Interactively create a package.json file

+

npm-install(1)

+

Install a package

+ +

Symlink a package folder

+

npm-logout(1)

+

Log out of the registry

+

npm-ls(1)

+

List installed packages

+

npm-outdated(1)

+

Check for outdated packages

+

npm-owner(1)

+

Manage package owners

+

npm-pack(1)

+

Create a tarball from a package

+

npm-ping(1)

+

Ping npm registry

+

npm-prefix(1)

+

Display prefix

+

npm-prune(1)

+

Remove extraneous packages

+

npm-publish(1)

+

Publish a package

+

npm-rebuild(1)

+

Rebuild a package

+

npm-repo(1)

+

Open package repository page in the browser

+

npm-restart(1)

+

Restart a package

+

npm-rm(1)

+

Remove a package

+

npm-root(1)

+

Display npm root

+

npm-run-script(1)

+

Run arbitrary package scripts

+

npm-search(1)

+

Search for packages

+

npm-shrinkwrap(1)

+

Lock down dependency versions

+

npm-star(1)

+

Mark your favorite packages

+

npm-stars(1)

+

View packages marked as favorites

+

npm-start(1)

+

Start a package

+

npm-stop(1)

+

Stop a package

+

npm-tag(1)

+

Tag a published version

+

npm-team(1)

+

Manage organization teams and team memberships

+

npm-test(1)

+

Test a package

+

npm-uninstall(1)

+

Remove a package

+

npm-unpublish(1)

+

Remove a package from the registry

+

npm-update(1)

+

Update a package

+

npm-version(1)

+

Bump a package version

+

npm-view(1)

+

View registry info

+

npm-whoami(1)

+

Display npm username

+

API Documentation

+

Using npm in your Node programs

+

npm(3)

+

javascript package manager

+

npm-bin(3)

+

Display npm bin folder

+

npm-bugs(3)

+

Bugs for a package in a web browser maybe

+

npm-cache(3)

+

manage the npm cache programmatically

+

npm-commands(3)

+

npm commands

+

npm-config(3)

+

Manage the npm configuration files

+

npm-deprecate(3)

+

Deprecate a version of a package

+

npm-docs(3)

+

Docs for a package in a web browser maybe

+

npm-edit(3)

+

Edit an installed package

+

npm-explore(3)

+

Browse an installed package

+

npm-help-search(3)

+

Search the help pages

+

npm-init(3)

+

Interactively create a package.json file

+

npm-install(3)

+

install a package programmatically

+ +

Symlink a package folder

+

npm-load(3)

+

Load config settings

+

npm-ls(3)

+

List installed packages

+

npm-outdated(3)

+

Check for outdated packages

+

npm-owner(3)

+

Manage package owners

+

npm-pack(3)

+

Create a tarball from a package

+

npm-ping(3)

+

Ping npm registry

+

npm-prefix(3)

+

Display prefix

+

npm-prune(3)

+

Remove extraneous packages

+

npm-publish(3)

+

Publish a package

+

npm-rebuild(3)

+

Rebuild a package

+

npm-repo(3)

+

Open package repository page in the browser

+

npm-restart(3)

+

Restart a package

+

npm-root(3)

+

Display npm root

+

npm-run-script(3)

+

Run arbitrary package scripts

+

npm-search(3)

+

Search for packages

+

npm-shrinkwrap(3)

+

programmatically generate package shrinkwrap file

+

npm-start(3)

+

Start a package

+

npm-stop(3)

+

Stop a package

+

npm-tag(3)

+

Tag a published version

+

npm-test(3)

+

Test a package

+

npm-uninstall(3)

+

uninstall a package programmatically

+

npm-unpublish(3)

+

Remove a package from the registry

+

npm-update(3)

+

Update a package

+

npm-version(3)

+

Bump a package version

+

npm-view(3)

+

View registry info

+

npm-whoami(3)

+

Display npm username

+

Files

+

File system structures npm uses

+

npm-folders(5)

+

Folder Structures Used by npm

+

npmrc(5)

+

The npm config files

+

package.json(5)

+

Specifics of npm's package.json handling

+

Misc

+

Various other bits and bobs

+

npm-coding-style(7)

+

npm's "funny" coding style

+

npm-config(7)

+

More than you probably want to know about npm configuration

+

npm-developers(7)

+

Developer Guide

+

npm-disputes(7)

+

Handling Module Name Disputes

+

npm-index(7)

+

Index of all npm documentation

+

npm-orgs(7)

+

Working with Teams & Orgs

+

npm-registry(7)

+

The JavaScript Package Registry

+

npm-scope(7)

+

Scoped packages

+

npm-scripts(7)

+

How npm handles the "scripts" field

+

removing-npm(7)

+

Cleaning the Slate

+

semver(7)

+

The semantic versioner for npm

+ +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/misc/npm-coding-style.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/misc/npm-coding-style.html new file mode 100644 index 00000000..f9c8489a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/misc/npm-coding-style.html @@ -0,0 +1,151 @@ + + + npm-coding-style + + + + + + +
+ +

npm-coding-style

npm's "funny" coding style

+

DESCRIPTION

+

npm's coding style is a bit unconventional. It is not different for +difference's sake, but rather a carefully crafted style that is +designed to reduce visual clutter and make bugs more apparent.

+

If you want to contribute to npm (which is very encouraged), you should +make your code conform to npm's style.

+

Note: this concerns npm's code not the specific packages that you can download from the npm registry.

+

Line Length

+

Keep lines shorter than 80 characters. It's better for lines to be +too short than to be too long. Break up long lists, objects, and other +statements onto multiple lines.

+

Indentation

+

Two-spaces. Tabs are better, but they look like hell in web browsers +(and on GitHub), and node uses 2 spaces, so that's that.

+

Configure your editor appropriately.

+

Curly braces

+

Curly braces belong on the same line as the thing that necessitates them.

+

Bad:

+
function ()
+{
+

Good:

+
function () {
+

If a block needs to wrap to the next line, use a curly brace. Don't +use it if it doesn't.

+

Bad:

+
if (foo) { bar() }
+while (foo)
+  bar()
+

Good:

+
if (foo) bar()
+while (foo) {
+  bar()
+}
+

Semicolons

+

Don't use them except in four situations:

+
    +
  • for (;;) loops. They're actually required.
  • +
  • null loops like: while (something) ; (But you'd better have a good +reason for doing that.)
  • +
  • case "foo": doSomething(); break
  • +
  • In front of a leading ( or [ at the start of the line. +This prevents the expression from being interpreted +as a function call or property access, respectively.
  • +
+

Some examples of good semicolon usage:

+
;(x || y).doSomething()
+;[a, b, c].forEach(doSomething)
+for (var i = 0; i < 10; i ++) {
+  switch (state) {
+    case "begin": start(); continue
+    case "end": finish(); break
+    default: throw new Error("unknown state")
+  }
+  end()
+}
+

Note that starting lines with - and + also should be prefixed +with a semicolon, but this is much less common.

+

Comma First

+

If there is a list of things separated by commas, and it wraps +across multiple lines, put the comma at the start of the next +line, directly below the token that starts the list. Put the +final token in the list on a line by itself. For example:

+
var magicWords = [ "abracadabra"
+                 , "gesundheit"
+                 , "ventrilo"
+                 ]
+  , spells = { "fireball" : function () { setOnFire() }
+             , "water" : function () { putOut() }
+             }
+  , a = 1
+  , b = "abc"
+  , etc
+  , somethingElse
+

Whitespace

+

Put a single space in front of ( for anything other than a function call. +Also use a single space wherever it makes things more readable.

+

Don't leave trailing whitespace at the end of lines. Don't indent empty +lines. Don't use more spaces than are helpful.

+

Functions

+

Use named functions. They make stack traces a lot easier to read.

+

Callbacks, Sync/async Style

+

Use the asynchronous/non-blocking versions of things as much as possible. +It might make more sense for npm to use the synchronous fs APIs, but this +way, the fs and http and child process stuff all uses the same callback-passing +methodology.

+

The callback should always be the last argument in the list. Its first +argument is the Error or null.

+

Be very careful never to ever ever throw anything. It's worse than useless. +Just send the error message back as the first argument to the callback.

+

Errors

+

Always create a new Error object with your message. Don't just return a +string message to the callback. Stack traces are handy.

+

Logging

+

Logging is done using the npmlog +utility.

+

Please clean up logs when they are no longer helpful. In particular, +logging the same object over and over again is not helpful. Logs should +report what's happening so that it's easier to track down where a fault +occurs.

+

Use appropriate log levels. See npm-config(7) and search for +"loglevel".

+

Case, naming, etc.

+

Use lowerCamelCase for multiword identifiers when they refer to objects, +functions, methods, properties, or anything not specified in this section.

+

Use UpperCamelCase for class names (things that you'd pass to "new").

+

Use all-lower-hyphen-css-case for multiword filenames and config keys.

+

Use named functions. They make stack traces easier to follow.

+

Use CAPS_SNAKE_CASE for constants, things that should never change +and are rarely used.

+

Use a single uppercase letter for function names where the function +would normally be anonymous, but needs to call itself recursively. It +makes it clear that it's a "throwaway" function.

+

null, undefined, false, 0

+

Boolean variables and functions should always be either true or +false. Don't set it to 0 unless it's supposed to be a number.

+

When something is intentionally missing or removed, set it to null.

+

Don't set things to undefined. Reserve that value to mean "not yet +set to anything."

+

Boolean objects are verboten.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/misc/npm-config.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/misc/npm-config.html new file mode 100644 index 00000000..2c3818bf --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/misc/npm-config.html @@ -0,0 +1,818 @@ + + + npm-config + + + + + + +
+ +

npm-config

More than you probably want to know about npm configuration

+

DESCRIPTION

+

npm gets its configuration values from the following sources, sorted by priority:

+

Command Line Flags

+

Putting --foo bar on the command line sets the foo configuration +parameter to "bar". A -- argument tells the cli parser to stop +reading flags. A --flag parameter that is at the end of the +command will be given the value of true.

+

Environment Variables

+

Any environment variables that start with npm_config_ will be +interpreted as a configuration parameter. For example, putting +npm_config_foo=bar in your environment will set the foo +configuration parameter to bar. Any environment configurations that +are not given a value will be given the value of true. Config +values are case-insensitive, so NPM_CONFIG_FOO=bar will work the +same.

+

npmrc Files

+

The four relevant files are:

+
    +
  • per-project configuration file (/path/to/my/project/.npmrc)
  • +
  • per-user configuration file (defaults to $HOME/.npmrc; configurable via CLI +option --userconfig or environment variable $NPM_CONF_USERCONFIG)
  • +
  • global configuration file (defaults to $PREFIX/etc/npmrc; configurable via +CLI option --globalconfig or environment variable $NPM_CONF_GLOBALCONFIG)
  • +
  • npm's built-in configuration file (/path/to/npm/npmrc)
  • +
+

See npmrc(5) for more details.

+

Default Configs

+

A set of configuration parameters that are internal to npm, and are +defaults if nothing else is specified.

+

Shorthands and Other CLI Niceties

+

The following shorthands are parsed on the command-line:

+
    +
  • -v: --version
  • +
  • -h, -?, --help, -H: --usage
  • +
  • -s, --silent: --loglevel silent
  • +
  • -q, --quiet: --loglevel warn
  • +
  • -d: --loglevel info
  • +
  • -dd, --verbose: --loglevel verbose
  • +
  • -ddd: --loglevel silly
  • +
  • -g: --global
  • +
  • -C: --prefix
  • +
  • -l: --long
  • +
  • -m: --message
  • +
  • -p, --porcelain: --parseable
  • +
  • -reg: --registry
  • +
  • -f: --force
  • +
  • -desc: --description
  • +
  • -S: --save
  • +
  • -D: --save-dev
  • +
  • -O: --save-optional
  • +
  • -B: --save-bundle
  • +
  • -E: --save-exact
  • +
  • -y: --yes
  • +
  • -n: --yes false
  • +
  • ll and la commands: ls --long
  • +
+

If the specified configuration param resolves unambiguously to a known +configuration parameter, then it is expanded to that configuration +parameter. For example:

+
npm ls --par
+# same as:
+npm ls --parseable
+

If multiple single-character shorthands are strung together, and the +resulting combination is unambiguously not some other configuration +param, then it is expanded to its various component pieces. For +example:

+
npm ls -gpld
+# same as:
+npm ls --global --parseable --long --loglevel info
+

Per-Package Config Settings

+

When running scripts (see npm-scripts(7)) the package.json "config" +keys are overwritten in the environment if there is a config param of +<name>[@<version>]:<key>. For example, if the package.json has +this:

+
{ "name" : "foo"
+, "config" : { "port" : "8080" }
+, "scripts" : { "start" : "node server.js" } }
+

and the server.js is this:

+
http.createServer(...).listen(process.env.npm_package_config_port)
+

then the user could change the behavior by doing:

+
npm config set foo:port 80
+

See package.json(5) for more information.

+

Config Settings

+

access

+
    +
  • Default: restricted
  • +
  • Type: Access
  • +
+

When publishing scoped packages, the access level defaults to restricted. If +you want your scoped package to be publicly viewable (and installable) set +--access=public. The only valid values for access are public and +restricted. Unscoped packages always have an access level of public.

+

always-auth

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Force npm to always require authentication when accessing the registry, +even for GET requests.

+ +
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

Tells npm to create symlinks (or .cmd shims on Windows) for package +executables.

+

Set to false to have it not do this. This can be used to work around +the fact that some file systems don't support symlinks, even on +ostensibly Unix systems.

+

browser

+
    +
  • Default: OS X: "open", Windows: "start", Others: "xdg-open"
  • +
  • Type: String
  • +
+

The browser that is called by the npm docs command to open websites.

+

ca

+
    +
  • Default: The npm CA certificate
  • +
  • Type: String, Array or null
  • +
+

The Certificate Authority signing certificate that is trusted for SSL +connections to the registry. Values should be in PEM format with newlines +replaced by the string "\n". For example:

+
ca="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----"
+

Set to null to only allow "known" registrars, or to a specific CA cert +to trust only that specific signing authority.

+

Multiple CAs can be trusted by specifying an array of certificates:

+
ca[]="..."
+ca[]="..."
+

See also the strict-ssl config.

+

cafile

+
    +
  • Default: null
  • +
  • Type: path
  • +
+

A path to a file containing one or multiple Certificate Authority signing +certificates. Similar to the ca setting, but allows for multiple CA's, as +well as for the CA information to be stored in a file on disk.

+

cache

+
    +
  • Default: Windows: %AppData%\npm-cache, Posix: ~/.npm
  • +
  • Type: path
  • +
+

The location of npm's cache directory. See npm-cache(1)

+

cache-lock-stale

+
    +
  • Default: 60000 (1 minute)
  • +
  • Type: Number
  • +
+

The number of ms before cache folder lockfiles are considered stale.

+

cache-lock-retries

+
    +
  • Default: 10
  • +
  • Type: Number
  • +
+

Number of times to retry to acquire a lock on cache folder lockfiles.

+

cache-lock-wait

+
    +
  • Default: 10000 (10 seconds)
  • +
  • Type: Number
  • +
+

Number of ms to wait for cache lock files to expire.

+

cache-max

+
    +
  • Default: Infinity
  • +
  • Type: Number
  • +
+

The maximum time (in seconds) to keep items in the registry cache before +re-checking against the registry.

+

Note that no purging is done unless the npm cache clean command is +explicitly used, and that only GET requests use the cache.

+

cache-min

+
    +
  • Default: 10
  • +
  • Type: Number
  • +
+

The minimum time (in seconds) to keep items in the registry cache before +re-checking against the registry.

+

Note that no purging is done unless the npm cache clean command is +explicitly used, and that only GET requests use the cache.

+

cert

+
    +
  • Default: null
  • +
  • Type: String
  • +
+

A client certificate to pass when accessing the registry. Values should be in +PEM format with newlines replaced by the string "\n". For example:

+
cert="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----"
+

It is not the path to a certificate file (and there is no "certfile" option).

+

color

+
    +
  • Default: true
  • +
  • Type: Boolean or "always"
  • +
+

If false, never shows colors. If "always" then always shows colors. +If true, then only prints color codes for tty file descriptors.

+

depth

+
    +
  • Default: Infinity
  • +
  • Type: Number
  • +
+

The depth to go when recursing directories for npm ls, +npm cache ls, and npm outdated.

+

For npm outdated, a setting of Infinity will be treated as 0 +since that gives more useful information. To show the outdated status +of all packages and dependents, use a large integer value, +e.g., npm outdated --depth 9999

+

description

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

Show the description in npm search

+

dev

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Install dev-dependencies along with packages.

+

Note that dev-dependencies are also installed if the npat flag is +set.

+

editor

+
    +
  • Default: EDITOR environment variable if set, or "vi" on Posix, +or "notepad" on Windows.
  • +
  • Type: path
  • +
+

The command to run for npm edit or npm config edit.

+

engine-strict

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If set to true, then npm will stubbornly refuse to install (or even +consider installing) any package that claims to not be compatible with +the current Node.js version.

+

force

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Makes various commands more forceful.

+
    +
  • lifecycle script failure does not block progress.
  • +
  • publishing clobbers previously published versions.
  • +
  • skips cache when requesting from the registry.
  • +
  • prevents checks against clobbering non-npm files.
  • +
+

fetch-retries

+
    +
  • Default: 2
  • +
  • Type: Number
  • +
+

The "retries" config for the retry module to use when fetching +packages from the registry.

+

fetch-retry-factor

+
    +
  • Default: 10
  • +
  • Type: Number
  • +
+

The "factor" config for the retry module to use when fetching +packages.

+

fetch-retry-mintimeout

+
    +
  • Default: 10000 (10 seconds)
  • +
  • Type: Number
  • +
+

The "minTimeout" config for the retry module to use when fetching +packages.

+

fetch-retry-maxtimeout

+
    +
  • Default: 60000 (1 minute)
  • +
  • Type: Number
  • +
+

The "maxTimeout" config for the retry module to use when fetching +packages.

+

git

+
    +
  • Default: "git"
  • +
  • Type: String
  • +
+

The command to use for git commands. If git is installed on the +computer, but is not in the PATH, then set this to the full path to +the git binary.

+

git-tag-version

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

Tag the commit when using the npm version command.

+

global

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Operates in "global" mode, so that packages are installed into the +prefix folder instead of the current working directory. See +npm-folders(5) for more on the differences in behavior.

+
    +
  • packages are installed into the {prefix}/lib/node_modules folder, instead of the +current working directory.
  • +
  • bin files are linked to {prefix}/bin
  • +
  • man pages are linked to {prefix}/share/man
  • +
+

globalconfig

+
    +
  • Default: {prefix}/etc/npmrc
  • +
  • Type: path
  • +
+

The config file to read for global config options.

+

group

+
    +
  • Default: GID of the current process
  • +
  • Type: String or Number
  • +
+

The group to use when running package scripts in global mode as the root +user.

+

heading

+
    +
  • Default: "npm"
  • +
  • Type: String
  • +
+

The string that starts all the debugging log output.

+

https-proxy

+
    +
  • Default: null
  • +
  • Type: url
  • +
+

A proxy to use for outgoing https requests. If the HTTPS_PROXY or +https_proxy or HTTP_PROXY or http_proxy environment variables are set, +proxy settings will be honored by the underlying request library.

+

if-present

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If true, npm will not exit with an error code when run-script is invoked for +a script that isn't defined in the scripts section of package.json. This +option can be used when it's desirable to optionally run a script when it's +present and fail if the script fails. This is useful, for example, when running +scripts that may only apply for some builds in an otherwise generic CI setup.

+

ignore-scripts

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If true, npm does not run scripts specified in package.json files.

+

init-module

+
    +
  • Default: ~/.npm-init.js
  • +
  • Type: path
  • +
+

A module that will be loaded by the npm init command. See the +documentation for the +init-package-json module +for more information, or npm-init(1).

+

init-author-name

+
    +
  • Default: ""
  • +
  • Type: String
  • +
+

The value npm init should use by default for the package author's name.

+

init-author-email

+
    +
  • Default: ""
  • +
  • Type: String
  • +
+

The value npm init should use by default for the package author's email.

+

init-author-url

+
    +
  • Default: ""
  • +
  • Type: String
  • +
+

The value npm init should use by default for the package author's homepage.

+

init-license

+
    +
  • Default: "ISC"
  • +
  • Type: String
  • +
+

The value npm init should use by default for the package license.

+

init-version

+
    +
  • Default: "1.0.0"
  • +
  • Type: semver
  • +
+

The value that npm init should use by default for the package +version number, if not already set in package.json.

+

json

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Whether or not to output JSON data, rather than the normal output.

+

This feature is currently experimental, and the output data structures +for many commands is either not implemented in JSON yet, or subject to +change. Only the output from npm ls --json is currently valid.

+

key

+
    +
  • Default: null
  • +
  • Type: String
  • +
+

A client key to pass when accessing the registry. Values should be in PEM +format with newlines replaced by the string "\n". For example:

+
key="-----BEGIN PRIVATE KEY-----\nXXXX\nXXXX\n-----END PRIVATE KEY-----"
+

It is not the path to a key file (and there is no "keyfile" option).

+ +
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If true, then local installs will link if there is a suitable globally +installed package.

+

Note that this means that local installs can cause things to be +installed into the global space at the same time. The link is only done +if one of the two conditions are met:

+
    +
  • The package is not already installed globally, or
  • +
  • the globally installed version is identical to the version that is +being installed locally.
  • +
+

local-address

+
    +
  • Default: undefined
  • +
  • Type: IP Address
  • +
+

The IP address of the local interface to use when making connections +to the npm registry. Must be IPv4 in versions of Node prior to 0.12.

+

loglevel

+
    +
  • Default: "warn"
  • +
  • Type: String
  • +
  • Values: "silent", "error", "warn", "http", "info", "verbose", "silly"
  • +
+

What level of logs to report. On failure, all logs are written to +npm-debug.log in the current working directory.

+

Any logs of a higher level than the setting are shown. +The default is "warn", which shows warn and error output.

+

logstream

+
    +
  • Default: process.stderr
  • +
  • Type: Stream
  • +
+

This is the stream that is passed to the +npmlog module at run time.

+

It cannot be set from the command line, but if you are using npm +programmatically, you may wish to send logs to somewhere other than +stderr.

+

If the color config is set to true, then this stream will receive +colored output if it is a TTY.

+

long

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Show extended information in npm ls and npm search.

+

maxsockets

+
    +
  • Default: 50
  • +
  • Type: Number
  • +
+

The maximum number of connections to use per origin (protocol/host/port +combination). Passed to the http Agent used to make the request.

+

message

+
    +
  • Default: "%s"
  • +
  • Type: String
  • +
+

Commit message which is used by npm version when creating version commit.

+

Any "%s" in the message will be replaced with the version number.

+

node-version

+
    +
  • Default: process.version
  • +
  • Type: semver or false
  • +
+

The node version to use when checking a package's engines map.

+

npat

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Run tests on installation.

+

onload-script

+
    +
  • Default: false
  • +
  • Type: path
  • +
+

A node module to require() when npm loads. Useful for programmatic +usage.

+

optional

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

Attempt to install packages in the optionalDependencies object. Note +that if these packages fail to install, the overall installation +process is not aborted.

+

parseable

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Output parseable results from commands that write to +standard output.

+

prefix

+ +

The location to install global items. If set on the command line, then +it forces non-global commands to run in the specified folder.

+

production

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Set to true to run in "production" mode.

+
    +
  1. devDependencies are not installed at the topmost level when running +local npm install without any arguments.
  2. +
  3. Set the NODE_ENV="production" for lifecycle scripts.
  4. +
+

proprietary-attribs

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

Whether or not to include proprietary extended attributes in the +tarballs created by npm.

+

Unless you are expecting to unpack package tarballs with something other +than npm -- particularly a very outdated tar implementation -- leave +this as true.

+

proxy

+
    +
  • Default: null
  • +
  • Type: url
  • +
+

A proxy to use for outgoing http requests. If the HTTP_PROXY or +http_proxy environment variables are set, proxy settings will be +honored by the underlying request library.

+

rebuild-bundle

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

Rebuild bundled dependencies after installation.

+

registry

+ +

The base URL of the npm package registry.

+

rollback

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

Remove failed installs.

+

save

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Save installed packages to a package.json file as dependencies.

+

When used with the npm rm command, it removes it from the dependencies +object.

+

Only works if there is already a package.json file present.

+

save-bundle

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If a package would be saved at install time by the use of --save, +--save-dev, or --save-optional, then also put it in the +bundleDependencies list.

+

When used with the npm rm command, it removes it from the +bundledDependencies list.

+

save-dev

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Save installed packages to a package.json file as devDependencies.

+

When used with the npm rm command, it removes it from the +devDependencies object.

+

Only works if there is already a package.json file present.

+

save-exact

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Dependencies saved to package.json using --save, --save-dev or +--save-optional will be configured with an exact version rather than +using npm's default semver range operator.

+

save-optional

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Save installed packages to a package.json file as +optionalDependencies.

+

When used with the npm rm command, it removes it from the +devDependencies object.

+

Only works if there is already a package.json file present.

+

save-prefix

+
    +
  • Default: '^'
  • +
  • Type: String
  • +
+

Configure how versions of packages installed to a package.json file via +--save or --save-dev get prefixed.

+

For example if a package has version 1.2.3, by default its version is +set to ^1.2.3 which allows minor upgrades for that package, but after +npm config set save-prefix='~' it would be set to ~1.2.3 which only allows +patch upgrades.

+

scope

+
    +
  • Default: ""
  • +
  • Type: String
  • +
+

Associate an operation with a scope for a scoped registry. Useful when logging +in to a private registry for the first time: +npm login --scope=@organization --registry=registry.organization.com, which +will cause @organization to be mapped to the registry for future installation +of packages specified according to the pattern @organization/package.

+

searchopts

+
    +
  • Default: ""
  • +
  • Type: String
  • +
+

Space-separated options that are always passed to search.

+

searchexclude

+
    +
  • Default: ""
  • +
  • Type: String
  • +
+

Space-separated options that limit the results from search.

+

searchsort

+
    +
  • Default: "name"
  • +
  • Type: String
  • +
  • Values: "name", "-name", "date", "-date", "description", +"-description", "keywords", "-keywords"
  • +
+

Indication of which field to sort search results by. Prefix with a - +character to indicate reverse sort.

+

shell

+
    +
  • Default: SHELL environment variable, or "bash" on Posix, or "cmd" on +Windows
  • +
  • Type: path
  • +
+

The shell to run for the npm explore command.

+

shrinkwrap

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

If set to false, then ignore npm-shrinkwrap.json files when +installing.

+

sign-git-tag

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

If set to true, then the npm version command will tag the version +using -s to add a signature.

+

Note that git requires you to have set up GPG keys in your git configs +for this to work properly.

+

spin

+
    +
  • Default: true
  • +
  • Type: Boolean or "always"
  • +
+

When set to true, npm will display an ascii spinner while it is doing +things, if process.stderr is a TTY.

+

Set to false to suppress the spinner, or set to always to output +the spinner even for non-TTY outputs.

+

strict-ssl

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

Whether or not to do SSL key validation when making requests to the +registry via https.

+

See also the ca config.

+

tag

+
    +
  • Default: latest
  • +
  • Type: String
  • +
+

If you ask npm to install a package and don't tell it a specific version, then +it will install the specified tag.

+

Also the tag that is added to the package@version specified by the npm +tag command, if no explicit tag is given.

+

tag-version-prefix

+
    +
  • Default: "v"
  • +
  • Type: String
  • +
+

If set, alters the prefix used when tagging a new version when performing a +version increment using npm-version. To remove the prefix altogether, set it +to the empty string: "".

+

Because other tools may rely on the convention that npm version tags look like +v1.0.0, only use this property if it is absolutely necessary. In +particular, use care when overriding this setting for public packages.

+

tmp

+
    +
  • Default: TMPDIR environment variable, or "/tmp"
  • +
  • Type: path
  • +
+

Where to store temporary files and folders. All temp files are deleted +on success, but left behind on failure for forensic purposes.

+

unicode

+
    +
  • Default: true
  • +
  • Type: Boolean
  • +
+

When set to true, npm uses unicode characters in the tree output. When +false, it uses ascii characters to draw trees.

+

unsafe-perm

+
    +
  • Default: false if running as root, true otherwise
  • +
  • Type: Boolean
  • +
+

Set to true to suppress the UID/GID switching when running package +scripts. If set explicitly to false, then installing as a non-root user +will fail.

+

usage

+
    +
  • Default: false
  • +
  • Type: Boolean
  • +
+

Set to show short usage output (like the -H output) +instead of complete help when doing npm-help(1).

+

user

+
    +
  • Default: "nobody"
  • +
  • Type: String or Number
  • +
+

The UID to set to when running package scripts as root.

+

userconfig

+
    +
  • Default: ~/.npmrc
  • +
  • Type: path
  • +
+

The location of user-level configuration settings.

+

umask

+
    +
  • Default: 022
  • +
  • Type: Octal numeric string in range 0000..0777 (0..511)
  • +
+

The "umask" value to use when setting the file creation mode on files +and folders.

+

Folders and executables are given a mode which is 0777 masked against +this value. Other files are given a mode which is 0666 masked against +this value. Thus, the defaults are 0755 and 0644 respectively.

+

user-agent

+
    +
  • Default: node/{process.version} {process.platform} {process.arch}
  • +
  • Type: String
  • +
+

Sets a User-Agent to the request header

+

version

+
    +
  • Default: false
  • +
  • Type: boolean
  • +
+

If true, output the npm version and exit successfully.

+

Only relevant when specified explicitly on the command line.

+

versions

+
    +
  • Default: false
  • +
  • Type: boolean
  • +
+

If true, output the npm version as well as node's process.versions map, and +exit successfully.

+

Only relevant when specified explicitly on the command line.

+

viewer

+
    +
  • Default: "man" on Posix, "browser" on Windows
  • +
  • Type: path
  • +
+

The program to use to view help content.

+

Set to "browser" to view html help content in the default web browser.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/misc/npm-developers.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/misc/npm-developers.html new file mode 100644 index 00000000..d14e2883 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/misc/npm-developers.html @@ -0,0 +1,199 @@ + + + npm-developers + + + + + + +
+ +

npm-developers

Developer Guide

+

DESCRIPTION

+

So, you've decided to use npm to develop (and maybe publish/deploy) +your project.

+

Fantastic!

+

There are a few things that you need to do above the simple steps +that your users will do to install your program.

+

About These Documents

+

These are man pages. If you install npm, you should be able to +then do man npm-thing to get the documentation on a particular +topic, or npm help thing to see the same information.

+

What is a package

+

A package is:

+
    +
  • a) a folder containing a program described by a package.json file
  • +
  • b) a gzipped tarball containing (a)
  • +
  • c) a url that resolves to (b)
  • +
  • d) a <name>@<version> that is published on the registry with (c)
  • +
  • e) a <name>@<tag> that points to (d)
  • +
  • f) a <name> that has a "latest" tag satisfying (e)
  • +
  • g) a git url that, when cloned, results in (a).
  • +
+

Even if you never publish your package, you can still get a lot of +benefits of using npm if you just want to write a node program (a), and +perhaps if you also want to be able to easily install it elsewhere +after packing it up into a tarball (b).

+

Git urls can be of the form:

+
git://github.com/user/project.git#commit-ish
+git+ssh://user@hostname:project.git#commit-ish
+git+http://user@hostname/project/blah.git#commit-ish
+git+https://user@hostname/project/blah.git#commit-ish
+

The commit-ish can be any tag, sha, or branch which can be supplied as +an argument to git checkout. The default is master.

+

The package.json File

+

You need to have a package.json file in the root of your project to do +much of anything with npm. That is basically the whole interface.

+

See package.json(5) for details about what goes in that file. At the very +least, you need:

+
    +
  • name: +This should be a string that identifies your project. Please do not +use the name to specify that it runs on node, or is in JavaScript. +You can use the "engines" field to explicitly state the versions of +node (or whatever else) that your program requires, and it's pretty +well assumed that it's javascript.

    +

    It does not necessarily need to match your github repository name.

    +

    So, node-foo and bar-js are bad names. foo or bar are better.

    +
  • +
  • version: +A semver-compatible version.

    +
  • +
  • engines: +Specify the versions of node (or whatever else) that your program +runs on. The node API changes a lot, and there may be bugs or new +functionality that you depend on. Be explicit.

    +
  • +
  • author: +Take some credit.

    +
  • +
  • scripts: +If you have a special compilation or installation script, then you +should put it in the scripts object. You should definitely have at +least a basic smoke-test command as the "scripts.test" field. +See npm-scripts(7).

    +
  • +
  • main: +If you have a single module that serves as the entry point to your +program (like what the "foo" package gives you at require("foo")), +then you need to specify that in the "main" field.

    +
  • +
  • directories: +This is an object mapping names to folders. The best ones to include are +"lib" and "doc", but if you use "man" to specify a folder full of man pages, +they'll get installed just like these ones.

    +
  • +
+

You can use npm init in the root of your package in order to get you +started with a pretty basic package.json file. See npm-init(1) for +more info.

+

Keeping files out of your package

+

Use a .npmignore file to keep stuff out of your package. If there's +no .npmignore file, but there is a .gitignore file, then npm will +ignore the stuff matched by the .gitignore file. If you want to +include something that is excluded by your .gitignore file, you can +create an empty .npmignore file to override it. Like git, npm looks +for .npmignore and .gitignore files in all subdirectories of your +package, not only the root directory.

+

.npmignore files follow the same pattern rules +as .gitignore files:

+
    +
  • Blank lines or lines starting with # are ignored.
  • +
  • Standard glob patterns work.
  • +
  • You can end patterns with a forward slash / to specify a directory.
  • +
  • You can negate a pattern by starting it with an exclamation point !.
  • +
+

By default, the following paths and files are ignored, so there's no +need to add them to .npmignore explicitly:

+
    +
  • .*.swp
  • +
  • ._*
  • +
  • .DS_Store
  • +
  • .git
  • +
  • .hg
  • +
  • .npmrc
  • +
  • .lock-wscript
  • +
  • .svn
  • +
  • .wafpickle-*
  • +
  • config.gypi
  • +
  • CVS
  • +
  • npm-debug.log
  • +
+

Additionally, everything in node_modules is ignored, except for +bundled dependencies. npm automatically handles this for you, so don't +bother adding node_modules to .npmignore.

+

The following paths and files are never ignored, so adding them to +.npmignore is pointless:

+
    +
  • package.json
  • +
  • README (and its variants)
  • +
  • CHANGELOG (and its variants)
  • +
  • LICENSE / LICENCE
  • +
+ +

npm link is designed to install a development package and see the +changes in real time without having to keep re-installing it. (You do +need to either re-link or npm rebuild -g to update compiled packages, +of course.)

+

More info at npm-link(1).

+

Before Publishing: Make Sure Your Package Installs and Works

+

This is important.

+

If you can not install it locally, you'll have +problems trying to publish it. Or, worse yet, you'll be able to +publish it, but you'll be publishing a broken or pointless package. +So don't do that.

+

In the root of your package, do this:

+
npm install . -g
+

That'll show you that it's working. If you'd rather just create a symlink +package that points to your working directory, then do this:

+
npm link
+

Use npm ls -g to see if it's there.

+

To test a local install, go into some other folder, and then do:

+
cd ../some-other-folder
+npm install ../my-package
+

to install it locally into the node_modules folder in that other place.

+

Then go into the node-repl, and try using require("my-thing") to +bring in your module's main module.

+

Create a User Account

+

Create a user with the adduser command. It works like this:

+
npm adduser
+

and then follow the prompts.

+

This is documented better in npm-adduser(1).

+

Publish your package

+

This part's easy. In the root of your folder, do this:

+
npm publish
+

You can give publish a url to a tarball, or a filename of a tarball, +or a path to a folder.

+

Note that pretty much everything in that folder will be exposed +by default. So, if you have secret stuff in there, use a +.npmignore file to list out the globs to ignore, or publish +from a fresh checkout.

+

Brag about it

+

Send emails, write blogs, blab in IRC.

+

Tell the world how easy it is to install your program!

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/misc/npm-disputes.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/misc/npm-disputes.html new file mode 100644 index 00000000..bb65cb00 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/misc/npm-disputes.html @@ -0,0 +1,116 @@ + + + npm-disputes + + + + + + +
+ +

npm-disputes

Handling Module Name Disputes

+

SYNOPSIS

+
    +
  1. Get the author email with npm owner ls <pkgname>
  2. +
  3. Email the author, CC support@npmjs.com
  4. +
  5. After a few weeks, if there's no resolution, we'll sort it out.
  6. +
+

Don't squat on package names. Publish code or move out of the way.

+

DESCRIPTION

+

There sometimes arise cases where a user publishes a module, and then +later, some other user wants to use that name. Here are some common +ways that happens (each of these is based on actual events.)

+
    +
  1. Joe writes a JavaScript module foo, which is not node-specific. +Joe doesn't use node at all. Bob wants to use foo in node, so he +wraps it in an npm module. Some time later, Joe starts using node, +and wants to take over management of his program.
  2. +
  3. Bob writes an npm module foo, and publishes it. Perhaps much +later, Joe finds a bug in foo, and fixes it. He sends a pull +request to Bob, but Bob doesn't have the time to deal with it, +because he has a new job and a new baby and is focused on his new +erlang project, and kind of not involved with node any more. Joe +would like to publish a new foo, but can't, because the name is +taken.
  4. +
  5. Bob writes a 10-line flow-control library, and calls it foo, and +publishes it to the npm registry. Being a simple little thing, it +never really has to be updated. Joe works for Foo Inc, the makers +of the critically acclaimed and widely-marketed foo JavaScript +toolkit framework. They publish it to npm as foojs, but people are +routinely confused when npm install foo is some different thing.
  6. +
  7. Bob writes a parser for the widely-known foo file format, because +he needs it for work. Then, he gets a new job, and never updates the +prototype. Later on, Joe writes a much more complete foo parser, +but can't publish, because Bob's foo is in the way.
  8. +
+

The validity of Joe's claim in each situation can be debated. However, +Joe's appropriate course of action in each case is the same.

+
    +
  1. npm owner ls foo. This will tell Joe the email address of the +owner (Bob).
  2. +
  3. Joe emails Bob, explaining the situation as respectfully as +possible, and what he would like to do with the module name. He +adds the npm support staff support@npmjs.com to the CC list of +the email. Mention in the email that Bob can run npm owner add +joe foo to add Joe as an owner of the foo package.
  4. +
  5. After a reasonable amount of time, if Bob has not responded, or if +Bob and Joe can't come to any sort of resolution, email support +support@npmjs.com and we'll sort it out. ("Reasonable" is +usually at least 4 weeks, but extra time is allowed around common +holidays.)
  6. +
+

REASONING

+

In almost every case so far, the parties involved have been able to reach +an amicable resolution without any major intervention. Most people +really do want to be reasonable, and are probably not even aware that +they're in your way.

+

Module ecosystems are most vibrant and powerful when they are as +self-directed as possible. If an admin one day deletes something you +had worked on, then that is going to make most people quite upset, +regardless of the justification. When humans solve their problems by +talking to other humans with respect, everyone has the chance to end up +feeling good about the interaction.

+

EXCEPTIONS

+

Some things are not allowed, and will be removed without discussion if +they are brought to the attention of the npm registry admins, including +but not limited to:

+
    +
  1. Malware (that is, a package designed to exploit or harm the machine on +which it is installed).
  2. +
  3. Violations of copyright or licenses (for example, cloning an +MIT-licensed program, and then removing or changing the copyright and +license statement).
  4. +
  5. Illegal content.
  6. +
  7. "Squatting" on a package name that you plan to use, but aren't +actually using. Sorry, I don't care how great the name is, or how +perfect a fit it is for the thing that someday might happen. If +someone wants to use it today, and you're just taking up space with +an empty tarball, you're going to be evicted.
  8. +
  9. Putting empty packages in the registry. Packages must have SOME +functionality. It can be silly, but it can't be nothing. (See +also: squatting.)
  10. +
  11. Doing weird things with the registry, like using it as your own +personal application database or otherwise putting non-packagey +things into it.
  12. +
+

If you see bad behavior like this, please report it right away.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/misc/npm-index.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/misc/npm-index.html new file mode 100644 index 00000000..cbc0c905 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/misc/npm-index.html @@ -0,0 +1,245 @@ + + + npm-index + + + + + + +
+ +

npm-index

Index of all npm documentation

+

README

+

a JavaScript package manager

+

Command Line Documentation

+

Using npm on the command line

+

npm(1)

+

javascript package manager

+

npm-access(1)

+

Set access level on published packages

+

npm-adduser(1)

+

Add a registry user account

+

npm-bin(1)

+

Display npm bin folder

+

npm-bugs(1)

+

Bugs for a package in a web browser maybe

+

npm-build(1)

+

Build a package

+

npm-bundle(1)

+

REMOVED

+

npm-cache(1)

+

Manipulates packages cache

+

npm-completion(1)

+

Tab Completion for npm

+

npm-config(1)

+

Manage the npm configuration files

+

npm-dedupe(1)

+

Reduce duplication

+

npm-deprecate(1)

+

Deprecate a version of a package

+

npm-dist-tag(1)

+

Modify package distribution tags

+

npm-docs(1)

+

Docs for a package in a web browser maybe

+

npm-edit(1)

+

Edit an installed package

+

npm-explore(1)

+

Browse an installed package

+

npm-help-search(1)

+

Search npm help documentation

+

npm-help(1)

+

Get help on npm

+

npm-init(1)

+

Interactively create a package.json file

+

npm-install(1)

+

Install a package

+ +

Symlink a package folder

+

npm-logout(1)

+

Log out of the registry

+

npm-ls(1)

+

List installed packages

+

npm-outdated(1)

+

Check for outdated packages

+

npm-owner(1)

+

Manage package owners

+

npm-pack(1)

+

Create a tarball from a package

+

npm-ping(1)

+

Ping npm registry

+

npm-prefix(1)

+

Display prefix

+

npm-prune(1)

+

Remove extraneous packages

+

npm-publish(1)

+

Publish a package

+

npm-rebuild(1)

+

Rebuild a package

+

npm-repo(1)

+

Open package repository page in the browser

+

npm-restart(1)

+

Restart a package

+

npm-rm(1)

+

Remove a package

+

npm-root(1)

+

Display npm root

+

npm-run-script(1)

+

Run arbitrary package scripts

+

npm-search(1)

+

Search for packages

+

npm-shrinkwrap(1)

+

Lock down dependency versions

+

npm-star(1)

+

Mark your favorite packages

+

npm-stars(1)

+

View packages marked as favorites

+

npm-start(1)

+

Start a package

+

npm-stop(1)

+

Stop a package

+

npm-tag(1)

+

Tag a published version

+

npm-team(1)

+

Manage organization teams and team memberships

+

npm-test(1)

+

Test a package

+

npm-uninstall(1)

+

Remove a package

+

npm-unpublish(1)

+

Remove a package from the registry

+

npm-update(1)

+

Update a package

+

npm-version(1)

+

Bump a package version

+

npm-view(1)

+

View registry info

+

npm-whoami(1)

+

Display npm username

+

API Documentation

+

Using npm in your Node programs

+

npm(3)

+

javascript package manager

+

npm-bin(3)

+

Display npm bin folder

+

npm-bugs(3)

+

Bugs for a package in a web browser maybe

+

npm-cache(3)

+

manage the npm cache programmatically

+

npm-commands(3)

+

npm commands

+

npm-config(3)

+

Manage the npm configuration files

+

npm-deprecate(3)

+

Deprecate a version of a package

+

npm-docs(3)

+

Docs for a package in a web browser maybe

+

npm-edit(3)

+

Edit an installed package

+

npm-explore(3)

+

Browse an installed package

+

npm-help-search(3)

+

Search the help pages

+

npm-init(3)

+

Interactively create a package.json file

+

npm-install(3)

+

install a package programmatically

+ +

Symlink a package folder

+

npm-load(3)

+

Load config settings

+

npm-ls(3)

+

List installed packages

+

npm-outdated(3)

+

Check for outdated packages

+

npm-owner(3)

+

Manage package owners

+

npm-pack(3)

+

Create a tarball from a package

+

npm-ping(3)

+

Ping npm registry

+

npm-prefix(3)

+

Display prefix

+

npm-prune(3)

+

Remove extraneous packages

+

npm-publish(3)

+

Publish a package

+

npm-rebuild(3)

+

Rebuild a package

+

npm-repo(3)

+

Open package repository page in the browser

+

npm-restart(3)

+

Restart a package

+

npm-root(3)

+

Display npm root

+

npm-run-script(3)

+

Run arbitrary package scripts

+

npm-search(3)

+

Search for packages

+

npm-shrinkwrap(3)

+

programmatically generate package shrinkwrap file

+

npm-start(3)

+

Start a package

+

npm-stop(3)

+

Stop a package

+

npm-tag(3)

+

Tag a published version

+

npm-test(3)

+

Test a package

+

npm-uninstall(3)

+

uninstall a package programmatically

+

npm-unpublish(3)

+

Remove a package from the registry

+

npm-update(3)

+

Update a package

+

npm-version(3)

+

Bump a package version

+

npm-view(3)

+

View registry info

+

npm-whoami(3)

+

Display npm username

+

Files

+

File system structures npm uses

+

npm-folders(5)

+

Folder Structures Used by npm

+

npmrc(5)

+

The npm config files

+

package.json(5)

+

Specifics of npm's package.json handling

+

Misc

+

Various other bits and bobs

+

npm-coding-style(7)

+

npm's "funny" coding style

+

npm-config(7)

+

More than you probably want to know about npm configuration

+

npm-developers(7)

+

Developer Guide

+

npm-disputes(7)

+

Handling Module Name Disputes

+

npm-index(7)

+

Index of all npm documentation

+

npm-orgs(7)

+

Working with Teams & Orgs

+

npm-registry(7)

+

The JavaScript Package Registry

+

npm-scope(7)

+

Scoped packages

+

npm-scripts(7)

+

How npm handles the "scripts" field

+

removing-npm(7)

+

Cleaning the Slate

+

semver(7)

+

The semantic versioner for npm

+ +
+ + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/misc/npm-orgs.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/misc/npm-orgs.html new file mode 100644 index 00000000..94d47f9b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/misc/npm-orgs.html @@ -0,0 +1,89 @@ + + + npm-orgs + + + + + + +
+ +

npm-orgs

Working with Teams & Orgs

+

DESCRIPTION

+

There are three levels of org users:

+
    +
  1. Super admin, controls billing & adding people to the org.
  2. +
  3. Team admin, manages team membership & package access.
  4. +
  5. Developer, works on packages they are given access to.
  6. +
+

The super admin is the only person who can add users to the org because it impacts the monthly bill. The super admin will use the website to manage membership. Every org has a developers team that all users are automatically added to.

+

The team admin is the person who manages team creation, team membership, and package access for teams. The team admin grants package access to teams, not individuals.

+

The developer will be able to access packages based on the teams they are on. Access is either read-write or read-only.

+

There are two main commands:

+
    +
  1. npm team see npm-team(1) for more details
  2. +
  3. npm access see npm-access(1) for more details
  4. +
+

Team Admins create teams

+
    +
  • Check who you’ve added to your org:
  • +
+
npm team ls <org>:developers
+
    +
  • Each org is automatically given a developers team, so you can see the whole list of team members in your org. This team automatically gets read-write access to all packages, but you can change that with the access command.

    +
  • +
  • Create a new team:

    +
  • +
+
npm team create <org:team>
+
    +
  • Add members to that team:
  • +
+
npm team add <org:team> <user>
+

Publish a package and adjust package access

+
    +
  • In package directory, run
  • +
+
npm init --scope=<org>
+

to scope it for your org & publish as usual

+
    +
  • Grant access:
  • +
+
npm access grant <read-only|read-write> <org:team> [<package>]
+
    +
  • Revoke access:
  • +
+
npm access revoke <org:team> [<package>]
+

Monitor your package access

+
    +
  • See what org packages a team member can access:
  • +
+
npm access ls-packages <org> <user>
+
    +
  • See packages available to a specific team:
  • +
+
npm access ls-packages <org:team>
+
    +
  • Check which teams are collaborating on a package:
  • +
+
npm access ls-collaborators <pkg>
+

SEE ALSO

+ + +
+ + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/misc/npm-registry.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/misc/npm-registry.html new file mode 100644 index 00000000..bec50cac --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/misc/npm-registry.html @@ -0,0 +1,74 @@ + + + npm-registry + + + + + + +
+ +

npm-registry

The JavaScript Package Registry

+

DESCRIPTION

+

To resolve packages by name and version, npm talks to a registry website +that implements the CommonJS Package Registry specification for reading +package info.

+

Additionally, npm's package registry implementation supports several +write APIs as well, to allow for publishing packages and managing user +account information.

+

The official public npm registry is at https://registry.npmjs.org/. It +is powered by a CouchDB database, of which there is a public mirror at +https://skimdb.npmjs.com/registry. The code for the couchapp is +available at https://github.com/npm/npm-registry-couchapp.

+

The registry URL used is determined by the scope of the package (see +npm-scope(7)). If no scope is specified, the default registry is used, which is +supplied by the registry config parameter. See npm-config(1), +npmrc(5), and npm-config(7) for more on managing npm's configuration.

+

Can I run my own private registry?

+

Yes!

+

The easiest way is to replicate the couch database, and use the same (or +similar) design doc to implement the APIs.

+

If you set up continuous replication from the official CouchDB, and then +set your internal CouchDB as the registry config, then you'll be able +to read any published packages, in addition to your private ones, and by +default will only publish internally.

+

If you then want to publish a package for the whole world to see, you can +simply override the --registry option for that publish command.

+

I don't want my package published in the official registry. It's private.

+

Set "private": true in your package.json to prevent it from being +published at all, or +"publishConfig":{"registry":"http://my-internal-registry.local"} +to force it to be published only to your internal registry.

+

See package.json(5) for more info on what goes in the package.json file.

+

Will you replicate from my registry into the public one?

+

No. If you want things to be public, then publish them into the public +registry using npm. What little security there is would be for nought +otherwise.

+

Do I have to use couchdb to build a registry that npm can talk to?

+

No, but it's way easier. Basically, yes, you do, or you have to +effectively implement the entire CouchDB API anyway.

+

Is there a website or something to see package docs and such?

+

Yes, head over to https://npmjs.com/

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/misc/npm-scope.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/misc/npm-scope.html new file mode 100644 index 00000000..3cc9de78 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/misc/npm-scope.html @@ -0,0 +1,98 @@ + + + npm-scope + + + + + + +
+ +

npm-scope

Scoped packages

+

DESCRIPTION

+

All npm packages have a name. Some package names also have a scope. A scope +follows the usual rules for package names (url-safe characters, no leading dots +or underscores). When used in package names, preceded by an @-symbol and +followed by a slash, e.g.

+
@somescope/somepackagename
+

Scopes are a way of grouping related packages together, and also affect a few +things about the way npm treats the package.

+

Scoped packages can be published and installed as of npm@2 and are supported +by the primary npm registry. The npm client is backwards-compatible with +un-scoped registries, so it can be used to work with scoped and un-scoped +registries at the same time.

+

Installing scoped packages

+

Scoped packages are installed to a sub-folder of the regular installation +folder, e.g. if your other packages are installed in node_modules/packagename, +scoped modules will be in node_modules/@myorg/packagename. The scope folder +(@myorg) is simply the name of the scope preceded by an @-symbol, and can +contain any number of scoped packages.

+

A scoped package is installed by referencing it by name, preceded by an +@-symbol, in npm install:

+
npm install @myorg/mypackage
+

Or in package.json:

+
"dependencies": {
+  "@myorg/mypackage": "^1.3.0"
+}
+

Note that if the @-symbol is omitted in either case npm will instead attempt to +install from GitHub; see npm-install(1).

+

Requiring scoped packages

+

Because scoped packages are installed into a scope folder, you have to +include the name of the scope when requiring them in your code, e.g.

+
require('@myorg/mypackage')
+

There is nothing special about the way Node treats scope folders, this is +just specifying to require the module mypackage in the folder called @myorg.

+

Publishing scoped packages

+

Scoped packages can be published from the CLI as of npm@2 and can be +published to any registry that supports them, including the primary npm +registry.

+

(As of 2015-04-19, and with npm 2.0 or newer, the primary npm registry does +support scoped packages)

+

If you wish, you may associate a scope with a registry; see below.

+

Publishing public scoped packages to the primary npm registry

+

To publish a public scoped package, you must specify --access public with +the initial publication. This will publish the package and set access +to public as if you had run npm access public after publishing.

+

Publishing private scoped packages to the npm registry

+

To publish a private scoped package to the npm registry, you must have +an npm Private Modules +account.

+

You can then publish the module with npm publish or npm publish +--access restricted, and it will be present in the npm registry, with +restricted access. You can then change the access permissions, if +desired, with npm access or on the npmjs.com website.

+

Associating a scope with a registry

+

Scopes can be associated with a separate registry. This allows you to +seamlessly use a mix of packages from the primary npm registry and one or more +private registries, such as npm Enterprise.

+

You can associate a scope with a registry at login, e.g.

+
npm login --registry=http://reg.example.com --scope=@myco
+

Scopes have a many-to-one relationship with registries: one registry can +host multiple scopes, but a scope only ever points to one registry.

+

You can also associate a scope with a registry using npm config:

+
npm config set @myco:registry http://reg.example.com
+

Once a scope is associated with a registry, any npm install for a package +with that scope will request packages from that registry instead. Any +npm publish for a package name that contains the scope will be published to +that registry instead.

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/misc/npm-scripts.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/misc/npm-scripts.html new file mode 100644 index 00000000..9b44bbde --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/misc/npm-scripts.html @@ -0,0 +1,213 @@ + + + npm-scripts + + + + + + +
+ +

npm-scripts

How npm handles the "scripts" field

+

DESCRIPTION

+

npm supports the "scripts" property of the package.json script, for the +following scripts:

+
    +
  • prepublish: +Run BEFORE the package is published. (Also run on local npm +install without any arguments.)
  • +
  • publish, postpublish: +Run AFTER the package is published.
  • +
  • preinstall: +Run BEFORE the package is installed
  • +
  • install, postinstall: +Run AFTER the package is installed.
  • +
  • preuninstall, uninstall: +Run BEFORE the package is uninstalled.
  • +
  • postuninstall: +Run AFTER the package is uninstalled.
  • +
  • preversion, version: +Run BEFORE bumping the package version.
  • +
  • postversion: +Run AFTER bumping the package version.
  • +
  • pretest, test, posttest: +Run by the npm test command.
  • +
  • prestop, stop, poststop: +Run by the npm stop command.
  • +
  • prestart, start, poststart: +Run by the npm start command.
  • +
  • prerestart, restart, postrestart: +Run by the npm restart command. Note: npm restart will run the +stop and start scripts if no restart script is provided.
  • +
+

Additionally, arbitrary scripts can be executed by running npm +run-script <stage>. Pre and post commands with matching +names will be run for those as well (e.g. premyscript, myscript, +postmyscript). Scripts from dependencies can be run with `npm explore

+

-- npm run `.

+

COMMON USES

+

If you need to perform operations on your package before it is used, in a way +that is not dependent on the operating system or architecture of the +target system, use a prepublish script. This includes +tasks such as:

+
    +
  • Compiling CoffeeScript source code into JavaScript.
  • +
  • Creating minified versions of JavaScript source code.
  • +
  • Fetching remote resources that your package will use.
  • +
+

The advantage of doing these things at prepublish time is that they can be done once, in a +single place, thus reducing complexity and variability. +Additionally, this means that:

+
    +
  • You can depend on coffee-script as a devDependency, and thus +your users don't need to have it installed.
  • +
  • You don't need to include minifiers in your package, reducing +the size for your users.
  • +
  • You don't need to rely on your users having curl or wget or +other system tools on the target machines.
  • +
+

DEFAULT VALUES

+

npm will default some script values based on package contents.

+
    +
  • "start": "node server.js":

    +

    If there is a server.js file in the root of your package, then npm +will default the start command to node server.js.

    +
  • +
  • "install": "node-gyp rebuild":

    +

    If there is a binding.gyp file in the root of your package and you +haven't defined your own install or preinstall scripts, npm will +default the install command to compile using node-gyp.

    +
  • +
+

USER

+

If npm was invoked with root privileges, then it will change the uid +to the user account or uid specified by the user config, which +defaults to nobody. Set the unsafe-perm flag to run scripts with +root privileges.

+

ENVIRONMENT

+

Package scripts run in an environment where many pieces of information +are made available regarding the setup of npm and the current state of +the process.

+

path

+

If you depend on modules that define executable scripts, like test +suites, then those executables will be added to the PATH for +executing the scripts. So, if your package.json has this:

+
{ "name" : "foo"
+, "dependencies" : { "bar" : "0.1.x" }
+, "scripts": { "start" : "bar ./test" } }
+

then you could run npm start to execute the bar script, which is +exported into the node_modules/.bin directory on npm install.

+

package.json vars

+

The package.json fields are tacked onto the npm_package_ prefix. So, +for instance, if you had {"name":"foo", "version":"1.2.5"} in your +package.json file, then your package scripts would have the +npm_package_name environment variable set to "foo", and the +npm_package_version set to "1.2.5"

+

configuration

+

Configuration parameters are put in the environment with the +npm_config_ prefix. For instance, you can view the effective root +config by checking the npm_config_root environment variable.

+

Special: package.json "config" object

+

The package.json "config" keys are overwritten in the environment if +there is a config param of <name>[@<version>]:<key>. For example, +if the package.json has this:

+
{ "name" : "foo"
+, "config" : { "port" : "8080" }
+, "scripts" : { "start" : "node server.js" } }
+

and the server.js is this:

+
http.createServer(...).listen(process.env.npm_package_config_port)
+

then the user could change the behavior by doing:

+
npm config set foo:port 80
+

current lifecycle event

+

Lastly, the npm_lifecycle_event environment variable is set to +whichever stage of the cycle is being executed. So, you could have a +single script used for different parts of the process which switches +based on what's currently happening.

+

Objects are flattened following this format, so if you had +{"scripts":{"install":"foo.js"}} in your package.json, then you'd +see this in the script:

+
process.env.npm_package_scripts_install === "foo.js"
+

EXAMPLES

+

For example, if your package.json contains this:

+
{ "scripts" :
+  { "install" : "scripts/install.js"
+  , "postinstall" : "scripts/install.js"
+  , "uninstall" : "scripts/uninstall.js"
+  }
+}
+

then scripts/install.js will be called for the install +and post-install stages of the lifecycle, and scripts/uninstall.js +will be called when the package is uninstalled. Since +scripts/install.js is running for two different phases, it would +be wise in this case to look at the npm_lifecycle_event environment +variable.

+

If you want to run a make command, you can do so. This works just +fine:

+
{ "scripts" :
+  { "preinstall" : "./configure"
+  , "install" : "make && make install"
+  , "test" : "make test"
+  }
+}
+

EXITING

+

Scripts are run by passing the line as a script argument to sh.

+

If the script exits with a code other than 0, then this will abort the +process.

+

Note that these script files don't have to be nodejs or even +javascript programs. They just have to be some kind of executable +file.

+

HOOK SCRIPTS

+

If you want to run a specific script at a specific lifecycle event for +ALL packages, then you can use a hook script.

+

Place an executable file at node_modules/.hooks/{eventname}, and +it'll get run for all packages when they are going through that point +in the package lifecycle for any packages installed in that root.

+

Hook scripts are run exactly the same way as package.json scripts. +That is, they are in a separate child process, with the env described +above.

+

BEST PRACTICES

+
    +
  • Don't exit with a non-zero error code unless you really mean it. +Except for uninstall scripts, this will cause the npm action to +fail, and potentially be rolled back. If the failure is minor or +only will prevent some optional features, then it's better to just +print a warning and exit successfully.
  • +
  • Try not to use scripts to do what npm can do for you. Read through +package.json(5) to see all the things that you can specify and enable +by simply describing your package appropriately. In general, this +will lead to a more robust and consistent state.
  • +
  • Inspect the env to determine where to put things. For instance, if +the npm_config_binroot environment variable is set to /home/user/bin, then +don't try to install executables into /usr/local/bin. The user +probably set it up that way for a reason.
  • +
  • Don't prefix your script commands with "sudo". If root permissions +are required for some reason, then it'll fail with that error, and +the user will sudo the npm command in question.
  • +
  • Don't use install. Use a .gyp file for compilation, and prepublish +for anything else. You should almost never have to explicitly set a +preinstall or install script. If you are doing this, please consider if +there is another option. The only valid use of install or preinstall +scripts is for compilation which must be done on the target architecture.
  • +
+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/misc/removing-npm.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/misc/removing-npm.html new file mode 100644 index 00000000..6cce9975 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/misc/removing-npm.html @@ -0,0 +1,61 @@ + + + removing-npm + + + + + + +
+ +

npm-removal

Cleaning the Slate

+

SYNOPSIS

+

So sad to see you go.

+
sudo npm uninstall npm -g
+

Or, if that fails, get the npm source code, and do:

+
sudo make uninstall
+

More Severe Uninstalling

+

Usually, the above instructions are sufficient. That will remove +npm, but leave behind anything you've installed.

+

If that doesn't work, or if you require more drastic measures, +continue reading.

+

Note that this is only necessary for globally-installed packages. Local +installs are completely contained within a project's node_modules +folder. Delete that folder, and everything is gone (unless a package's +install script is particularly ill-behaved).

+

This assumes that you installed node and npm in the default place. If +you configured node with a different --prefix, or installed npm with a +different prefix setting, then adjust the paths accordingly, replacing +/usr/local with your install prefix.

+

To remove everything npm-related manually:

+
rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/npm*
+

If you installed things with npm, then your best bet is to uninstall +them with npm first, and then install them again once you have a +proper install. This can help find any symlinks that are lying +around:

+
ls -laF /usr/local/{lib/node{,/.npm},bin,share/man} | grep npm
+

Prior to version 0.3, npm used shim files for executables and node +modules. To track those down, you can do the following:

+
find /usr/local/{lib/node,bin} -exec grep -l npm \{\} \; ;
+

(This is also in the README file.)

+

SEE ALSO

+ + +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/misc/semver.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/misc/semver.html new file mode 100644 index 00000000..c854e7ee --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/doc/misc/semver.html @@ -0,0 +1,306 @@ + + + semver + + + + + + +
+ +

semver

The semantic versioner for npm

+

Usage

+
$ npm install semver
+
+semver.valid('1.2.3') // '1.2.3'
+semver.valid('a.b.c') // null
+semver.clean('  =v1.2.3   ') // '1.2.3'
+semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true
+semver.gt('1.2.3', '9.8.7') // false
+semver.lt('1.2.3', '9.8.7') // true
+

As a command-line utility:

+
$ semver -h
+
+Usage: semver <version> [<version> [...]] [-r <range> | -i <inc> | --preid <identifier> | -l | -rv]
+Test if version(s) satisfy the supplied range(s), and sort them.
+
+Multiple versions or ranges may be supplied, unless increment
+option is specified.  In that case, only a single version may
+be used, and it is incremented by the specified level
+
+Program exits successfully if any valid version satisfies
+all supplied ranges, and prints all satisfying versions.
+
+If no versions are valid, or ranges are not satisfied,
+then exits failure.
+
+Versions are printed in ascending order, so supplying
+multiple versions to the utility will just sort them.
+

Versions

+

A "version" is described by the v2.0.0 specification found at +http://semver.org/.

+

A leading "=" or "v" character is stripped off and ignored.

+

Ranges

+

A version range is a set of comparators which specify versions +that satisfy the range.

+

A comparator is composed of an operator and a version. The set +of primitive operators is:

+
    +
  • < Less than
  • +
  • <= Less than or equal to
  • +
  • > Greater than
  • +
  • >= Greater than or equal to
  • +
  • = Equal. If no operator is specified, then equality is assumed, +so this operator is optional, but MAY be included.
  • +
+

For example, the comparator >=1.2.7 would match the versions +1.2.7, 1.2.8, 2.5.3, and 1.3.9, but not the versions 1.2.6 +or 1.1.0.

+

Comparators can be joined by whitespace to form a comparator set, +which is satisfied by the intersection of all of the comparators +it includes.

+

A range is composed of one or more comparator sets, joined by ||. A +version matches a range if and only if every comparator in at least +one of the ||-separated comparator sets is satisfied by the version.

+

For example, the range >=1.2.7 <1.3.0 would match the versions +1.2.7, 1.2.8, and 1.2.99, but not the versions 1.2.6, 1.3.0, +or 1.1.0.

+

The range 1.2.7 || >=1.2.9 <2.0.0 would match the versions 1.2.7, +1.2.9, and 1.4.6, but not the versions 1.2.8 or 2.0.0.

+

Prerelease Tags

+

If a version has a prerelease tag (for example, 1.2.3-alpha.3) then +it will only be allowed to satisfy comparator sets if at least one +comparator with the same [major, minor, patch] tuple also has a +prerelease tag.

+

For example, the range >1.2.3-alpha.3 would be allowed to match the +version 1.2.3-alpha.7, but it would not be satisfied by +3.4.5-alpha.9, even though 3.4.5-alpha.9 is technically "greater +than" 1.2.3-alpha.3 according to the SemVer sort rules. The version +range only accepts prerelease tags on the 1.2.3 version. The +version 3.4.5 would satisfy the range, because it does not have a +prerelease flag, and 3.4.5 is greater than 1.2.3-alpha.7.

+

The purpose for this behavior is twofold. First, prerelease versions +frequently are updated very quickly, and contain many breaking changes +that are (by the author's design) not yet fit for public consumption. +Therefore, by default, they are excluded from range matching +semantics.

+

Second, a user who has opted into using a prerelease version has +clearly indicated the intent to use that specific set of +alpha/beta/rc versions. By including a prerelease tag in the range, +the user is indicating that they are aware of the risk. However, it +is still not appropriate to assume that they have opted into taking a +similar risk on the next set of prerelease versions.

+

Prerelease Identifiers

+

The method .inc takes an additional identifier string argument that +will append the value of the string as a prerelease identifier:

+
> semver.inc('1.2.3', 'prerelease', 'beta')
+'1.2.4-beta.0'
+
+

command-line example:

+
$ semver 1.2.3 -i prerelease --preid beta
+1.2.4-beta.0
+
+

Which then can be used to increment further:

+
$ semver 1.2.4-beta.0 -i prerelease
+1.2.4-beta.1
+
+

Advanced Range Syntax

+

Advanced range syntax desugars to primitive comparators in +deterministic ways.

+

Advanced ranges may be combined in the same way as primitive +comparators using white space or ||.

+

Hyphen Ranges X.Y.Z - A.B.C

+

Specifies an inclusive set.

+
    +
  • 1.2.3 - 2.3.4 := >=1.2.3 <=2.3.4
  • +
+

If a partial version is provided as the first version in the inclusive +range, then the missing pieces are replaced with zeroes.

+
    +
  • 1.2 - 2.3.4 := >=1.2.0 <=2.3.4
  • +
+

If a partial version is provided as the second version in the +inclusive range, then all versions that start with the supplied parts +of the tuple are accepted, but nothing that would be greater than the +provided tuple parts.

+
    +
  • 1.2.3 - 2.3 := >=1.2.3 <2.4.0
  • +
  • 1.2.3 - 2 := >=1.2.3 <3.0.0
  • +
+

X-Ranges 1.2.x 1.X 1.2.* *

+

Any of X, x, or * may be used to "stand in" for one of the +numeric values in the [major, minor, patch] tuple.

+
    +
  • * := >=0.0.0 (Any version satisfies)
  • +
  • 1.x := >=1.0.0 <2.0.0 (Matching major version)
  • +
  • 1.2.x := >=1.2.0 <1.3.0 (Matching major and minor versions)
  • +
+

A partial version range is treated as an X-Range, so the special +character is in fact optional.

+
    +
  • "" (empty string) := * := >=0.0.0
  • +
  • 1 := 1.x.x := >=1.0.0 <2.0.0
  • +
  • 1.2 := 1.2.x := >=1.2.0 <1.3.0
  • +
+

Tilde Ranges ~1.2.3 ~1.2 ~1

+

Allows patch-level changes if a minor version is specified on the +comparator. Allows minor-level changes if not.

+
    +
  • ~1.2.3 := >=1.2.3 <1.(2+1).0 := >=1.2.3 <1.3.0
  • +
  • ~1.2 := >=1.2.0 <1.(2+1).0 := >=1.2.0 <1.3.0 (Same as 1.2.x)
  • +
  • ~1 := >=1.0.0 <(1+1).0.0 := >=1.0.0 <2.0.0 (Same as 1.x)
  • +
  • ~0.2.3 := >=0.2.3 <0.(2+1).0 := >=0.2.3 <0.3.0
  • +
  • ~0.2 := >=0.2.0 <0.(2+1).0 := >=0.2.0 <0.3.0 (Same as 0.2.x)
  • +
  • ~0 := >=0.0.0 <(0+1).0.0 := >=0.0.0 <1.0.0 (Same as 0.x)
  • +
  • ~1.2.3-beta.2 := >=1.2.3-beta.2 <1.3.0 Note that prereleases in +the 1.2.3 version will be allowed, if they are greater than or +equal to beta.2. So, 1.2.3-beta.4 would be allowed, but +1.2.4-beta.2 would not, because it is a prerelease of a +different [major, minor, patch] tuple.
  • +
+

Caret Ranges ^1.2.3 ^0.2.5 ^0.0.4

+

Allows changes that do not modify the left-most non-zero digit in the +[major, minor, patch] tuple. In other words, this allows patch and +minor updates for versions 1.0.0 and above, patch updates for +versions 0.X >=0.1.0, and no updates for versions 0.0.X.

+

Many authors treat a 0.x version as if the x were the major +"breaking-change" indicator.

+

Caret ranges are ideal when an author may make breaking changes +between 0.2.4 and 0.3.0 releases, which is a common practice. +However, it presumes that there will not be breaking changes between +0.2.4 and 0.2.5. It allows for changes that are presumed to be +additive (but non-breaking), according to commonly observed practices.

+
    +
  • ^1.2.3 := >=1.2.3 <2.0.0
  • +
  • ^0.2.3 := >=0.2.3 <0.3.0
  • +
  • ^0.0.3 := >=0.0.3 <0.0.4
  • +
  • ^1.2.3-beta.2 := >=1.2.3-beta.2 <2.0.0 Note that prereleases in +the 1.2.3 version will be allowed, if they are greater than or +equal to beta.2. So, 1.2.3-beta.4 would be allowed, but +1.2.4-beta.2 would not, because it is a prerelease of a +different [major, minor, patch] tuple.
  • +
  • ^0.0.3-beta := >=0.0.3-beta <0.0.4 Note that prereleases in the +0.0.3 version only will be allowed, if they are greater than or +equal to beta. So, 0.0.3-pr.2 would be allowed.
  • +
+

When parsing caret ranges, a missing patch value desugars to the +number 0, but will allow flexibility within that value, even if the +major and minor versions are both 0.

+
    +
  • ^1.2.x := >=1.2.0 <2.0.0
  • +
  • ^0.0.x := >=0.0.0 <0.1.0
  • +
  • ^0.0 := >=0.0.0 <0.1.0
  • +
+

A missing minor and patch values will desugar to zero, but also +allow flexibility within those values, even if the major version is +zero.

+
    +
  • ^1.x := >=1.0.0 <2.0.0
  • +
  • ^0.x := >=0.0.0 <1.0.0
  • +
+

Range Grammar

+

Putting all this together, here is a Backus-Naur grammar for ranges, +for the benefit of parser authors:

+
range-set  ::= range ( logical-or range ) *
+logical-or ::= ( ' ' ) * '||' ( ' ' ) *
+range      ::= hyphen | simple ( ' ' simple ) * | ''
+hyphen     ::= partial ' - ' partial
+simple     ::= primitive | partial | tilde | caret
+primitive  ::= ( '<' | '>' | '>=' | '<=' | '=' | ) partial
+partial    ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
+xr         ::= 'x' | 'X' | '*' | nr
+nr         ::= '0' | ['1'-'9']['0'-'9']+
+tilde      ::= '~' partial
+caret      ::= '^' partial
+qualifier  ::= ( '-' pre )? ( '+' build )?
+pre        ::= parts
+build      ::= parts
+parts      ::= part ( '.' part ) *
+part       ::= nr | [-0-9A-Za-z]+
+
+

Functions

+

All methods and classes take a final loose boolean argument that, if +true, will be more forgiving about not-quite-valid semver strings. +The resulting output will always be 100% strict, of course.

+

Strict-mode Comparators and Ranges will be strict about the SemVer +strings that they parse.

+
    +
  • valid(v): Return the parsed version, or null if it's not valid.
  • +
  • inc(v, release): Return the version incremented by the release +type (major, premajor, minor, preminor, patch, +prepatch, or prerelease), or null if it's not valid
      +
    • premajor in one call will bump the version up to the next major +version and down to a prerelease of that major version. +preminor, and prepatch work the same way.
    • +
    • If called from a non-prerelease version, the prerelease will work the +same as prepatch. It increments the patch version, then makes a +prerelease. If the input version is already a prerelease it simply +increments it.
    • +
    +
  • +
  • major(v): Return the major version number.
  • +
  • minor(v): Return the minor version number.
  • +
  • patch(v): Return the patch version number.
  • +
+

Comparison

+
    +
  • gt(v1, v2): v1 > v2
  • +
  • gte(v1, v2): v1 >= v2
  • +
  • lt(v1, v2): v1 < v2
  • +
  • lte(v1, v2): v1 <= v2
  • +
  • eq(v1, v2): v1 == v2 This is true if they're logically equivalent, +even if they're not the exact same string. You already know how to +compare strings.
  • +
  • neq(v1, v2): v1 != v2 The opposite of eq.
  • +
  • cmp(v1, comparator, v2): Pass in a comparison string, and it'll call +the corresponding function above. "===" and "!==" do simple +string comparison, but are included for completeness. Throws if an +invalid comparison string is provided.
  • +
  • compare(v1, v2): Return 0 if v1 == v2, or 1 if v1 is greater, or -1 if +v2 is greater. Sorts in ascending order if passed to Array.sort().
  • +
  • rcompare(v1, v2): The reverse of compare. Sorts an array of versions +in descending order when passed to Array.sort().
  • +
  • diff(v1, v2): Returns difference between two versions by the release type +(major, premajor, minor, preminor, patch, prepatch, or prerelease), +or null if the versions are the same.
  • +
+

Ranges

+
    +
  • validRange(range): Return the valid range or null if it's not valid
  • +
  • satisfies(version, range): Return true if the version satisfies the +range.
  • +
  • maxSatisfying(versions, range): Return the highest version in the list +that satisfies the range, or null if none of them do.
  • +
  • gtr(version, range): Return true if version is greater than all the +versions possible in the range.
  • +
  • ltr(version, range): Return true if version is less than all the +versions possible in the range.
  • +
  • outside(version, range, hilo): Return true if the version is outside +the bounds of the range in either the high or low direction. The +hilo argument must be either the string '>' or '<'. (This is +the function called by gtr and ltr.)
  • +
+

Note that, since ranges may be non-contiguous, a version might not be +greater than a range, less than a range, or satisfy a range! For +example, the range 1.2 <1.2.9 || >2.0.0 would have a hole from 1.2.9 +until 2.0.0, so the version 1.2.10 would not be greater than the +range (because 2.0.1 satisfies, which is higher), nor less than the +range (since 1.2.8 satisfies, which is lower), and it also does not +satisfy the range.

+

If you want to know if a version satisfies or does not satisfy a +range, use the satisfies(version, range) function.

+ +
+ + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/docfoot.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/docfoot.html new file mode 100644 index 00000000..11a67943 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/docfoot.html @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/dochead.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/dochead.html new file mode 100644 index 00000000..26602b2b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/dochead.html @@ -0,0 +1,11 @@ + + + @NAME@ + + + + + + +
+ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/favicon.ico b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/favicon.ico new file mode 100644 index 00000000..9e0d4eef Binary files /dev/null and b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/favicon.ico differ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/index.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/index.html new file mode 100644 index 00000000..bb8681c8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/index.html @@ -0,0 +1,93 @@ + + + + + + npm - JavaScript Package Manager + +

npm

+ +

npm is a package manager for node. You can use it to install + and publish your node programs. It manages dependencies and does other cool stuff.

+ +

Easy Zero Line Install

+ +

Install Node.js
+(npm comes with it.)

+ +

Because a one-line install is one too many.

+ +

Fancy Install

+ +
    +
  1. Get the code. +
  2. Do what the README + says to do. +
+ +

There's a pretty thorough install script at +https://npmjs.org/install.sh

+ +

For maximum security, make sure to thoroughly inspect every +program that you run on your computer!

+ +

Other Cool Stuff

+ + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/static/style.css b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/static/style.css new file mode 100644 index 00000000..7a7f6ea5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/static/style.css @@ -0,0 +1,336 @@ +/* reset */ +* { + margin:0; + padding:0; + border:none; + font-family:inherit; + font-size:inherit; + font-weight:inherit; +} +:target::before { + content:" >>> "; + position:absolute; + display:block; + opacity:0.5; + color:#f00; + margin:0 0 0 -2em; +} +abbr, acronym { + border-bottom:1px dotted #aaa; +} +kbd, code, pre { + font-family:monospace; + margin:0; + font-size:18px; + line-height:24px; + background:#eee; + outline:1px solid #ccc; +} +kbd code, kbd pre, kbd kbd, +pre code, pre pre, pre kbd, +code code, code pre, code kbd { outline: none } +.dollar::before { + content:"$ "; + display:inline; +} +p, ul, ol, dl, pre { + margin:30px 0; + line-height:30px; +} +hr { + margin:30px auto 29px; + width:66%; + height:1px; + background:#aaa; +} +pre { + display:block; +} +dd :first-child { + margin-top:0; +} + +body { + quotes:"“" "”" "‘" "’"; + width:666px; + margin:30px auto 120px; + font-family:Times New Roman, serif; + font-size:20px; + background:#fff; + line-height:30px; + color:#111; +} + +blockquote { + position:relative; + font-size:16px; + line-height:30px; + font-weight:bold; + width:85%; + margin:0 auto; +} +blockquote::before { + font-size:90px; + display:block; + position:absolute; + top:20px; + right:100%; + content:"“"; + padding-right:10px; + color:#ccc; +} +.source cite::before { + content:"— "; +} +.source { + padding-left:20%; + margin-top:30px; +} +.source cite span { + font-style:normal; +} +blockquote p { + margin-bottom:0; +} +.quote blockquote { + font-weight:normal; +} + +h1, h2, h3, h4, h5, h6, dt, #header { + font-family:serif; + font-size:20px; + font-weight:bold; +} +h2 { + background:#eee; +} +h1, h2 { + line-height:40px; +} + +i, em, cite { + font-style:italic; +} +b, strong { + font-weight:bold; +} +i, em, cite, b, strong, small { + line-height:28px; +} +small, .small, .small *, aside { + font-style:italic; + color:#669; + font-size:18px; +} +small a, .small a { + text-decoration:underline; +} +del { + text-decoration:line-through; +} +ins { + text-decoration:underline; +} +.alignright { display:block; float:right; margin-left:1em; } +.alignleft { display:block; float:left; margin-right:1em; } + +q:before, q q q:before, q q q q q:before, q q q q q q q:before { content:"“"; } +q q:before, q q q q:before, q q q q q q:before, q q q q q q q q:before { content:"‘"; } +q:after, q q q:after, q q q q q:after, q q q q q q q:after { content:"”"; } +q q:after, q q q q:after, q q q q q q:after, q q q q q q q q:after { content:"’"; } + +a { color:#00f; text-decoration:none; } +a:visited { color:#636; } +a:hover, a:active { color:#c00!important; text-decoration:underline; } + +h1 { + font-weight:bold; + background:#fff; +} +h1 a, h1 a:visited { + font-family:monospace; + font-size:60px; + color:#c00; + display:block; +} +h1 a:focus, h1 a:hover, h1 a:active { + color:#f00!important; + text-decoration:none; +} + +.navigation { + display:table; + width:100%; + margin:0 0 30px 0; + position:relative; +} +#nav-above { + margin-bottom:0; +} +.navigation .nav-previous { + display:table-cell; + text-align:left; + width:50%; +} +/* hang the » and « off into the margins */ +.navigation .nav-previous a:before, .navigation .nav-next a:after { + content: "«"; + display:block; + height:30px; + margin-bottom:-30px; + text-decoration:none; + margin-left:-15px; +} +.navigation .nav-next a:after { + content: "»"; + text-align:right; + margin-left:0; + margin-top:-30px; + margin-right:-15px; +} + + +.navigation .nav-next { + display:table-cell; + text-align:right; + width:50%; +} +.navigation a { + display:block; + width:100%; + height:100%; +} + +input, button, textarea { + border:0; + line-height:30px; +} +textarea { + height:300px; +} +input { + height:30px; + line-height:30px; +} +input.submit, input#submit, input.button, button, input[type=submit] { + cursor:hand; cursor:pointer; + outline:1px solid #ccc; +} + +#wrapper { + margin-bottom:90px; + position:relative; + z-index:1; + *zoom:1; + background:#fff; +} +#wrapper:after { + display:block; + content:"."; + visibility:hidden; + width:0; + height:0; + clear:both; +} + +.sidebar .xoxo > li { + float:left; + width:50%; +} +.sidebar li { + list-style:none; +} +.sidebar #elsewhere { + margin-left:-10%; + margin-right:-10%; +} +.sidebar #rss-links, .sidebar #twitter-feeds { + float:right; + clear:right; + width:20%; +} +.sidebar #comment { + clear:both; + float:none; + width:100%; +} +.sidebar #search { + clear:both; + float:none; + width:100%; +} +.sidebar #search h2 { + margin-left:40%; +} +.sidebar #search #s { + width:90%; + float:left; +} +.sidebar #search #searchsubmit { + width:10%; + float:right; +} +.sidebar * { + font-size:15px; + line-height:30px; +} + +#footer, #footer * { + text-align:center; + font-size:16px; + color:#ccc; + font-style:italic; + word-spacing:1em; + margin-top:0; +} + +#toc { + position:absolute; + top:0; + right:0; + padding:40px 0 40px 20px; + margin:0; + width:200px; + opacity:0.2; + z-index:-1; +} +#toc:hover { + opacity:1; + background:#fff; + z-index:999; +} +#toc ul { + padding:0; + margin:0; +} +#toc, #toc li { + list-style-type:none; + font-size:15px; + line-height:15px; +} +#toc li { + padding:0 0 0 10px; +} +#toc li a { + position:relative; + display:block; +} + +table#npmlogo { + line-height:10px; + width:180px; + margin:0 auto; +} + +@media print { + a[href] { + color:inherit; + } + a[href]:after { + white-space:nowrap; + content:" " attr(href); + } + a[href^=\#], .navigation { + display:none; + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/static/toc.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/static/toc.js new file mode 100644 index 00000000..2cfebd0a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/html/static/toc.js @@ -0,0 +1,29 @@ +;(function () { +var wrapper = document.getElementById("wrapper") +var els = Array.prototype.slice.call(wrapper.getElementsByTagName("*"), 0) + .filter(function (el) { + return el.parentNode === wrapper + && el.tagName.match(/H[1-6]/) + && el.id + }) +var l = 2 + , toc = document.createElement("ul") +toc.innerHTML = els.map(function (el) { + var i = el.tagName.charAt(1) + , out = "" + while (i > l) { + out += "
    " + l ++ + } + while (i < l) { + out += "
" + l -- + } + out += "
  • " + + ( el.innerText || el.text || el.innerHTML) + + "" + return out +}).join("\n") +toc.id = "toc" +document.body.appendChild(toc) +})(); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/access.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/access.js new file mode 100644 index 00000000..158ce505 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/access.js @@ -0,0 +1,127 @@ +'use strict' + +var resolve = require('path').resolve + +var readPackageJson = require('read-package-json') +var mapToRegistry = require('./utils/map-to-registry.js') +var npm = require('./npm.js') + +var whoami = require('./whoami') + +module.exports = access + +access.usage = + 'npm access public []\n' + + 'npm access restricted []\n' + + 'npm access grant []\n' + + 'npm access revoke []\n' + + 'npm access ls-packages [||]\n' + + 'npm access ls-collaborators [ []]\n' + + 'npm access edit []' + +access.subcommands = ['public', 'restricted', 'grant', 'revoke', + 'ls-packages', 'ls-collaborators', 'edit'] + +access.completion = function (opts, cb) { + var argv = opts.conf.argv.remain + if (argv.length === 2) { + return cb(null, access.subcommands) + } + + switch (argv[2]) { + case 'grant': + if (argv.length === 3) { + return cb(null, ['read-only', 'read-write']) + } else { + return cb(null, []) + } + break + case 'public': + case 'restricted': + case 'ls-packages': + case 'ls-collaborators': + case 'edit': + return cb(null, []) + case 'revoke': + return cb(null, []) + default: + return cb(new Error(argv[2] + ' not recognized')) + } +} + +function access (args, cb) { + var cmd = args.shift() + var params + return parseParams(cmd, args, function (err, p) { + if (err) { return cb(err) } + params = p + return mapToRegistry(params.package, npm.config, invokeCmd) + }) + + function invokeCmd (err, uri, auth, base) { + if (err) { return cb(err) } + params.auth = auth + try { + return npm.registry.access(cmd, uri, params, function (err, data) { + !err && data && console.log(JSON.stringify(data, undefined, 2)) + cb(err, data) + }) + } catch (e) { + cb(e.message + '\n\nUsage:\n' + access.usage) + } + } +} + +function parseParams (cmd, args, cb) { + // mapToRegistry will complain if package is undefined, + // but it's not needed for ls-packages + var params = { 'package': '' } + if (cmd === 'grant') { + params.permissions = args.shift() + } + if (['grant', 'revoke', 'ls-packages'].indexOf(cmd) !== -1) { + var entity = (args.shift() || '').split(':') + params.scope = entity[0] + params.team = entity[1] + } + + if (cmd === 'ls-packages') { + if (!params.scope) { + whoami([], true, function (err, scope) { + params.scope = scope + cb(err, params) + }) + } else { + cb(null, params) + } + } else { + getPackage(args.shift(), function (err, pkg) { + if (err) return cb(err) + params.package = pkg + + if (cmd === 'ls-collaborators') params.user = args.shift() + cb(null, params) + }) + } +} + +function getPackage (name, cb) { + if (name && name.trim()) { + cb(null, name.trim()) + } else { + readPackageJson( + resolve(npm.prefix, 'package.json'), + function (err, data) { + if (err) { + if (err.code === 'ENOENT') { + cb(new Error('no package name passed to command and no package.json found')) + } else { + cb(err) + } + } else { + cb(null, data.name) + } + } + ) + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/adduser.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/adduser.js new file mode 100644 index 00000000..1bf54936 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/adduser.js @@ -0,0 +1,177 @@ +module.exports = adduser + +var log = require("npmlog") + , npm = require("./npm.js") + , read = require("read") + , userValidate = require("npm-user-validate") + , crypto + +try { + crypto = require("crypto") +} catch (ex) {} + +adduser.usage = 'npm adduser [--registry=url] [--scope=@orgname] [--always-auth]' + + '\n\naliases: login' + +function adduser (args, cb) { + npm.spinner.stop() + if (!crypto) return cb(new Error( + "You must compile node with ssl support to use the adduser feature")) + + var creds = npm.config.getCredentialsByURI(npm.config.get("registry")) + var c = { u : creds.username || "" + , p : creds.password || "" + , e : creds.email || "" + } + , u = {} + , fns = [readUsername, readPassword, readEmail, save] + + loop() + function loop (er) { + if (er) return cb(er) + var fn = fns.shift() + if (fn) return fn(c, u, loop) + cb() + } +} + +function readUsername (c, u, cb) { + var v = userValidate.username + read({prompt: "Username: ", default: c.u || ""}, function (er, un) { + if (er) { + return cb(er.message === "cancelled" ? er.message : er) + } + + // make sure it's valid. we have to do this here, because + // couchdb will only ever say "bad password" with a 401 when + // you try to PUT a _users record that the validate_doc_update + // rejects for *any* reason. + + if (!un) { + return readUsername(c, u, cb) + } + + var error = v(un) + if (error) { + log.warn(error.message) + return readUsername(c, u, cb) + } + + c.changed = c.u !== un + u.u = un + cb(er) + }) +} + +function readPassword (c, u, cb) { + var v = userValidate.pw + + var prompt + if (c.p && !c.changed) { + prompt = "Password: (or leave unchanged) " + } else { + prompt = "Password: " + } + + read({prompt: prompt, silent: true}, function (er, pw) { + if (er) { + return cb(er.message === "cancelled" ? er.message : er) + } + + if (!c.changed && pw === "") { + // when the username was not changed, + // empty response means "use the old value" + pw = c.p + } + + if (!pw) { + return readPassword(c, u, cb) + } + + var error = v(pw) + if (error) { + log.warn(error.message) + return readPassword(c, u, cb) + } + + c.changed = c.changed || c.p !== pw + u.p = pw + cb(er) + }) +} + +function readEmail (c, u, cb) { + var v = userValidate.email + var r = { prompt: "Email: (this IS public) ", default: c.e || "" } + read(r, function (er, em) { + if (er) { + return cb(er.message === "cancelled" ? er.message : er) + } + + if (!em) { + return readEmail(c, u, cb) + } + + var error = v(em) + if (error) { + log.warn(error.message) + return readEmail(c, u, cb) + } + + u.e = em + cb(er) + }) +} + +function save (c, u, cb) { + npm.spinner.start() + + // save existing configs, but yank off for this PUT + var uri = npm.config.get("registry") + var scope = npm.config.get("scope") + + // there may be a saved scope and no --registry (for login) + if (scope) { + if (scope.charAt(0) !== "@") scope = "@" + scope + + var scopedRegistry = npm.config.get(scope + ":registry") + var cliRegistry = npm.config.get("registry", "cli") + if (scopedRegistry && !cliRegistry) uri = scopedRegistry + } + + var params = { + auth : { + username : u.u, + password : u.p, + email : u.e + } + } + npm.registry.adduser(uri, params, function (er, doc) { + npm.spinner.stop() + if (er) return cb(er) + + // don't want this polluting the configuration + npm.config.del("_token", "user") + + if (scope) npm.config.set(scope + ":registry", uri, "user") + + if (doc && doc.token) { + npm.config.setCredentialsByURI(uri, { + token : doc.token + }) + } + else { + npm.config.setCredentialsByURI(uri, { + username : u.u, + password : u.p, + email : u.e, + alwaysAuth : npm.config.get("always-auth") + }) + } + + log.info('adduser', 'Authorized user %s', u.u) + var scopeMessage = scope ? ' to scope ' + scope : '' + console.log('Logged in as %s%s on %s.', u.u, scopeMessage, uri) + npm.config.save('user', cb) + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/bin.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/bin.js new file mode 100644 index 00000000..5465112d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/bin.js @@ -0,0 +1,19 @@ +module.exports = bin + +var npm = require("./npm.js") +var osenv = require("osenv") + +bin.usage = "npm bin\nnpm bin -g\n(just prints the bin folder)" + +function bin (args, silent, cb) { + if (typeof cb !== "function") cb = silent, silent = false + var b = npm.bin + , PATH = osenv.path() + + if (!silent) console.log(b) + process.nextTick(cb.bind(this, null, b)) + + if (npm.config.get("global") && PATH.indexOf(b) === -1) { + npm.config.get("logstream").write("(not in PATH env variable)\n") + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/bugs.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/bugs.js new file mode 100644 index 00000000..306d9bb4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/bugs.js @@ -0,0 +1,69 @@ + +module.exports = bugs + +bugs.usage = "npm bugs " + +var npm = require("./npm.js") + , log = require("npmlog") + , opener = require("opener") + , path = require("path") + , readJson = require("read-package-json") + , npa = require("npm-package-arg") + , fs = require("fs") + , mapToRegistry = require("./utils/map-to-registry.js") + +bugs.completion = function (opts, cb) { + // FIXME: there used to be registry completion here, but it stopped making + // sense somewhere around 50,000 packages on the registry + cb() +} + +function bugs (args, cb) { + var n = args.length && npa(args[0]).name || "." + fs.stat(n, function (er, s) { + if (er) { + if (er.code === "ENOENT") return callRegistry(n, cb) + return cb(er) + } + if (!s.isDirectory()) return callRegistry(n, cb) + readJson(path.resolve(n, "package.json"), function(er, d) { + if (er) return cb(er) + getUrlAndOpen(d, cb) + }) + }) +} + +function getUrlAndOpen (d, cb) { + var repo = d.repository || d.repositories + , url + if (d.bugs) { + url = (typeof d.bugs === "string") ? d.bugs : d.bugs.url + } + else if (repo) { + if (Array.isArray(repo)) repo = repo.shift() + if (repo.hasOwnProperty("url")) repo = repo.url + log.verbose("bugs", "repository", repo) + if (repo && repo.match(/^(https?:\/\/|git(:\/\/|@))github.com/)) { + url = repo.replace(/^git(@|:\/\/)/, "https://") + .replace(/^https?:\/\/github.com:/, "https://github.com/") + .replace(/\.git$/, "")+"/issues" + } + } + if (!url) { + url = "https://www.npmjs.org/package/" + d.name + } + log.silly("bugs", "url", url) + opener(url, { command: npm.config.get("browser") }, cb) +} + +function callRegistry (name, cb) { + mapToRegistry(name, npm.config, function (er, uri, auth) { + if (er) return cb(er) + + npm.registry.get(uri + "/latest", { auth : auth }, function (er, d) { + if (er) return cb(er) + + getUrlAndOpen(d, cb) + }) + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/build.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/build.js new file mode 100644 index 00000000..1f2d2efc --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/build.js @@ -0,0 +1,253 @@ +// npm build command + +// everything about the installation after the creation of +// the .npm/{name}/{version}/package folder. +// linking the modules into the npm.root, +// resolving dependencies, etc. + +// This runs AFTER install or link are completed. + +var npm = require("./npm.js") + , log = require("npmlog") + , chain = require("slide").chain + , fs = require("graceful-fs") + , path = require("path") + , lifecycle = require("./utils/lifecycle.js") + , readJson = require("read-package-json") + , link = require("./utils/link.js") + , linkIfExists = link.ifExists + , cmdShim = require("cmd-shim") + , cmdShimIfExists = cmdShim.ifExists + , asyncMap = require("slide").asyncMap + , ini = require("ini") + , writeFile = require("write-file-atomic") + +module.exports = build +build.usage = "npm build \n(this is plumbing)" + +build._didBuild = {} +build._noLC = {} +function build (args, global, didPre, didRB, cb) { + if (typeof cb !== "function") cb = didRB, didRB = false + if (typeof cb !== "function") cb = didPre, didPre = false + if (typeof cb !== "function") { + cb = global, global = npm.config.get("global") + } + // it'd be nice to asyncMap these, but actually, doing them + // in parallel generally munges up the output from node-waf + var builder = build_(global, didPre, didRB) + chain(args.map(function (arg) { return function (cb) { + builder(arg, cb) + }}), cb) +} + +function build_ (global, didPre, didRB) { return function (folder, cb) { + folder = path.resolve(folder) + if (build._didBuild[folder]) log.info("build", "already built", folder) + build._didBuild[folder] = true + log.info("build", folder) + readJson(path.resolve(folder, "package.json"), function (er, pkg) { + if (er) return cb(er) + chain + ( [ !didPre && [lifecycle, pkg, "preinstall", folder] + , [linkStuff, pkg, folder, global, didRB] + , [writeBuiltinConf, pkg, folder] + , didPre !== build._noLC && [lifecycle, pkg, "install", folder] + , didPre !== build._noLC && [lifecycle, pkg, "postinstall", folder] + , didPre !== build._noLC + && npm.config.get("npat") + && [lifecycle, pkg, "test", folder] ] + , cb ) + }) +}} + +function writeBuiltinConf (pkg, folder, cb) { + // the builtin config is "sticky". Any time npm installs + // itself globally, it puts its builtin config file there + var parent = path.dirname(folder) + var dir = npm.globalDir + + if (pkg.name !== "npm" || + !npm.config.get("global") || + !npm.config.usingBuiltin || + dir !== parent) { + return cb() + } + + var data = ini.stringify(npm.config.sources.builtin.data) + writeFile(path.resolve(folder, "npmrc"), data, cb) +} + +function linkStuff (pkg, folder, global, didRB, cb) { + // allow to opt out of linking binaries. + if (npm.config.get("bin-links") === false) return cb() + + // if it's global, and folder is in {prefix}/node_modules, + // then bins are in {prefix}/bin + // otherwise, then bins are in folder/../.bin + var parent = pkg.name[0] === '@' ? path.dirname(path.dirname(folder)) : path.dirname(folder) + var gnm = global && npm.globalDir + var gtop = parent === gnm + + log.info('linkStuff', pkg._id) + log.silly('linkStuff', pkg._id, 'has', parent, 'as its parent node_modules') + if (global) log.silly('linkStuff', pkg._id, 'is part of a global install') + if (gnm) log.silly('linkStuff', pkg._id, 'is installed into a global node_modules') + if (gtop) log.silly('linkStuff', pkg._id, 'is installed into the top-level global node_modules') + + shouldWarn(pkg, folder, global, function () { + asyncMap( + [linkBins, linkMans, !didRB && rebuildBundles], + function (fn, cb) { + if (!fn) return cb() + log.verbose(fn.name, pkg._id) + fn(pkg, folder, parent, gtop, cb) + }, + cb + ) + }) +} + +function shouldWarn(pkg, folder, global, cb) { + var parent = path.dirname(folder) + , top = parent === npm.dir + , cwd = npm.localPrefix + + readJson(path.resolve(cwd, "package.json"), function(er, topPkg) { + if (er) return cb(er) + + var linkedPkg = path.basename(cwd) + , currentPkg = path.basename(folder) + + // current searched package is the linked package on first call + if (linkedPkg !== currentPkg) { + + // don't generate a warning if it's listed in dependencies + if (Object.keys(topPkg.dependencies || {}) + .concat(Object.keys(topPkg.devDependencies || {})) + .indexOf(currentPkg) === -1) { + + if (top && pkg.preferGlobal && !global) { + log.warn("prefer global", pkg._id + " should be installed with -g") + } + } + } + + cb() + }) +} + +function rebuildBundles (pkg, folder, parent, gtop, cb) { + if (!npm.config.get("rebuild-bundle")) return cb() + + var deps = Object.keys(pkg.dependencies || {}) + .concat(Object.keys(pkg.devDependencies || {})) + , bundles = pkg.bundleDependencies || pkg.bundledDependencies || [] + + fs.readdir(path.resolve(folder, "node_modules"), function (er, files) { + // error means no bundles + if (er) return cb() + + log.verbose("rebuildBundles", files) + // don't asyncMap these, because otherwise build script output + // gets interleaved and is impossible to read + chain(files.filter(function (file) { + // rebuild if: + // not a .folder, like .bin or .hooks + return !file.match(/^[\._-]/) + // not some old 0.x style bundle + && file.indexOf("@") === -1 + // either not a dep, or explicitly bundled + && (deps.indexOf(file) === -1 || bundles.indexOf(file) !== -1) + }).map(function (file) { + file = path.resolve(folder, "node_modules", file) + return function (cb) { + if (build._didBuild[file]) return cb() + log.verbose("rebuild bundle", file) + // if file is not a package dir, then don't do it. + fs.lstat(path.resolve(file, "package.json"), function (er) { + if (er) return cb() + build_(false)(file, cb) + }) + }}), cb) + }) +} + +function linkBins (pkg, folder, parent, gtop, cb) { + if (!pkg.bin || !gtop && path.basename(parent) !== "node_modules") { + return cb() + } + var binRoot = gtop ? npm.globalBin + : path.resolve(parent, ".bin") + log.verbose("link bins", [pkg.bin, binRoot, gtop]) + + asyncMap(Object.keys(pkg.bin), function (b, cb) { + linkBin( path.resolve(folder, pkg.bin[b]) + , path.resolve(binRoot, b) + , gtop && folder + , function (er) { + if (er) return cb(er) + // bins should always be executable. + // XXX skip chmod on windows? + var src = path.resolve(folder, pkg.bin[b]) + fs.chmod(src, npm.modes.exec, function (er) { + if (er && er.code === "ENOENT" && npm.config.get("ignore-scripts")) { + return cb() + } + if (er || !gtop) return cb(er) + var dest = path.resolve(binRoot, b) + , out = npm.config.get("parseable") + ? dest + "::" + src + ":BINFILE" + : dest + " -> " + src + console.log(out) + cb() + }) + }) + }, cb) +} + +function linkBin (from, to, gently, cb) { + if (process.platform !== "win32") { + return linkIfExists(from, to, gently, cb) + } else { + return cmdShimIfExists(from, to, cb) + } +} + +function linkMans (pkg, folder, parent, gtop, cb) { + if (!pkg.man || !gtop || process.platform === "win32") return cb() + + var manRoot = path.resolve(npm.config.get("prefix"), "share", "man") + log.verbose("linkMans", "man files are", pkg.man, "in", manRoot) + + // make sure that the mans are unique. + // otherwise, if there are dupes, it'll fail with EEXIST + var set = pkg.man.reduce(function (acc, man) { + acc[path.basename(man)] = man + return acc + }, {}) + pkg.man = pkg.man.filter(function (man) { + return set[path.basename(man)] === man + }) + + asyncMap(pkg.man, function (man, cb) { + if (typeof man !== "string") return cb() + log.silly("linkMans", "preparing to link", man) + var parseMan = man.match(/(.*\.([0-9]+)(\.gz)?)$/) + if (!parseMan) { + return cb(new Error( + man+" is not a valid name for a man file. " + + "Man files must end with a number, " + + "and optionally a .gz suffix if they are compressed." + )) + } + + var stem = parseMan[1] + var sxn = parseMan[2] + var bn = path.basename(stem) + var manSrc = path.resolve(folder, man) + var manDest = path.join(manRoot, "man" + sxn, bn) + + linkIfExists(manSrc, manDest, gtop && folder, cb) + }, cb) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/cache.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/cache.js new file mode 100644 index 00000000..3a1249b0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/cache.js @@ -0,0 +1,354 @@ +// XXX lib/utils/tar.js and this file need to be rewritten. + +// URL-to-cache folder mapping: +// : -> ! +// @ -> _ +// http://registry.npmjs.org/foo/version -> cache/http!/... +// + +/* +fetching a URL: +1. Check for URL in inflight URLs. If present, add cb, and return. +2. Acquire lock at {cache}/{sha(url)}.lock + retries = {cache-lock-retries, def=10} + stale = {cache-lock-stale, def=60000} + wait = {cache-lock-wait, def=10000} +3. if lock can't be acquired, then fail +4. fetch url, clear lock, call cbs + +cache folders: +1. urls: http!/server.com/path/to/thing +2. c:\path\to\thing: file!/c!/path/to/thing +3. /path/to/thing: file!/path/to/thing +4. git@ private: git_github.com!npm/npm +5. git://public: git!/github.com/npm/npm +6. git+blah:// git-blah!/server.com/foo/bar + +adding a folder: +1. tar into tmp/random/package.tgz +2. untar into tmp/random/contents/package, stripping one dir piece +3. tar tmp/random/contents/package to cache/n/v/package.tgz +4. untar cache/n/v/package.tgz into cache/n/v/package +5. rm tmp/random + +Adding a url: +1. fetch to tmp/random/package.tgz +2. goto folder(2) + +adding a name@version: +1. registry.get(name/version) +2. if response isn't 304, add url(dist.tarball) + +adding a name@range: +1. registry.get(name) +2. Find a version that satisfies +3. add name@version + +adding a local tarball: +1. untar to tmp/random/{blah} +2. goto folder(2) + +adding a namespaced package: +1. lookup registry for @namespace +2. namespace_registry.get('name') +3. add url(namespace/latest.tarball) +*/ + +exports = module.exports = cache + +cache.unpack = unpack +cache.clean = clean +cache.read = read + +var npm = require("./npm.js") + , fs = require("graceful-fs") + , writeFileAtomic = require("write-file-atomic") + , assert = require("assert") + , rm = require("./utils/gently-rm.js") + , readJson = require("read-package-json") + , log = require("npmlog") + , path = require("path") + , asyncMap = require("slide").asyncMap + , tar = require("./utils/tar.js") + , fileCompletion = require("./utils/completion/file-completion.js") + , deprCheck = require("./utils/depr-check.js") + , addNamed = require("./cache/add-named.js") + , addLocal = require("./cache/add-local.js") + , addRemoteTarball = require("./cache/add-remote-tarball.js") + , addRemoteGit = require("./cache/add-remote-git.js") + , inflight = require("inflight") + , realizePackageSpecifier = require("realize-package-specifier") + , npa = require("npm-package-arg") + , getStat = require("./cache/get-stat.js") + , cachedPackageRoot = require("./cache/cached-package-root.js") + , mapToRegistry = require("./utils/map-to-registry.js") + +cache.usage = "npm cache add " + + "\nnpm cache add " + + "\nnpm cache add " + + "\nnpm cache add " + + "\nnpm cache add @" + + "\nnpm cache ls []" + + "\nnpm cache clean [[@]]" + +cache.completion = function (opts, cb) { + + var argv = opts.conf.argv.remain + if (argv.length === 2) { + return cb(null, ["add", "ls", "clean"]) + } + + switch (argv[2]) { + case "clean": + case "ls": + // cache and ls are easy, because the completion is + // what ls_ returns anyway. + // just get the partial words, minus the last path part + var p = path.dirname(opts.partialWords.slice(3).join("/")) + if (p === ".") p = "" + return ls_(p, 2, cb) + case "add": + // Same semantics as install and publish. + return npm.commands.install.completion(opts, cb) + } +} + +function cache (args, cb) { + var cmd = args.shift() + switch (cmd) { + case "rm": case "clear": case "clean": return clean(args, cb) + case "list": case "sl": case "ls": return ls(args, cb) + case "add": return add(args, npm.prefix, cb) + default: return cb("Usage: "+cache.usage) + } +} + +// if the pkg and ver are in the cache, then +// just do a readJson and return. +// if they're not, then fetch them from the registry. +function read (name, ver, forceBypass, cb) { + assert(typeof name === "string", "must include name of module to install") + assert(typeof cb === "function", "must include callback") + + if (forceBypass === undefined || forceBypass === null) forceBypass = true + + var root = cachedPackageRoot({name : name, version : ver}) + function c (er, data) { + if (er) log.verbose("cache", "addNamed error for", name+"@"+ver, er) + if (data) deprCheck(data) + + return cb(er, data) + } + + if (forceBypass && npm.config.get("force")) { + log.verbose("using force", "skipping cache") + return addNamed(name, ver, null, c) + } + + readJson(path.join(root, "package", "package.json"), function (er, data) { + if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) + + if (data) { + if (!data.name) return cb(new Error("No name provided")) + if (!data.version) return cb(new Error("No version provided")) + } + + if (er) return addNamed(name, ver, null, c) + else c(er, data) + }) +} + +function normalize (args) { + var normalized = "" + if (args.length > 0) { + var a = npa(args[0]) + if (a.name) normalized = a.name + if (a.rawSpec) normalized = [normalized, a.rawSpec].join("/") + if (args.length > 1) normalized = [normalized].concat(args.slice(1)).join("/") + } + + if (normalized.substr(-1) === "/") { + normalized = normalized.substr(0, normalized.length - 1) + } + normalized = path.normalize(normalized) + log.silly("ls", "normalized", normalized) + + return normalized +} + +// npm cache ls [] +function ls (args, cb) { + var prefix = npm.config.get("cache") + if (prefix.indexOf(process.env.HOME) === 0) { + prefix = "~" + prefix.substr(process.env.HOME.length) + } + ls_(normalize(args), npm.config.get("depth"), function (er, files) { + console.log(files.map(function (f) { + return path.join(prefix, f) + }).join("\n").trim()) + cb(er, files) + }) +} + +// Calls cb with list of cached pkgs matching show. +function ls_ (req, depth, cb) { + return fileCompletion(npm.cache, req, depth, cb) +} + +// npm cache clean [] +function clean (args, cb) { + assert(typeof cb === "function", "must include callback") + + if (!args) args = [] + + var f = path.join(npm.cache, normalize(args)) + if (f === npm.cache) { + fs.readdir(npm.cache, function (er, files) { + if (er) return cb() + asyncMap( files.filter(function (f) { + return npm.config.get("force") || f !== "-" + }).map(function (f) { + return path.join(npm.cache, f) + }) + , rm, cb ) + }) + } + else { + rm(f, cb) + } +} + +// npm cache add +// npm cache add +// npm cache add +// npm cache add +cache.add = function (pkg, ver, where, scrub, cb) { + assert(typeof pkg === "string", "must include name of package to install") + assert(typeof cb === "function", "must include callback") + + if (scrub) { + return clean([], function (er) { + if (er) return cb(er) + add([pkg, ver], where, cb) + }) + } + return add([pkg, ver], where, cb) +} + + +var adding = 0 +function add (args, where, cb) { + // this is hot code. almost everything passes through here. + // the args can be any of: + // ["url"] + // ["pkg", "version"] + // ["pkg@version"] + // ["pkg", "url"] + // This is tricky, because urls can contain @ + // Also, in some cases we get [name, null] rather + // that just a single argument. + + var usage = "Usage:\n" + + " npm cache add \n" + + " npm cache add @\n" + + " npm cache add \n" + + " npm cache add \n" + , spec + + log.silly("cache add", "args", args) + + if (args[1] === undefined) args[1] = null + + // at this point the args length must ==2 + if (args[1] !== null) { + spec = args[0]+"@"+args[1] + } else if (args.length === 2) { + spec = args[0] + } + + log.verbose("cache add", "spec", spec) + + if (!spec) return cb(usage) + + if (adding <= 0) { + npm.spinner.start() + } + adding++ + cb = afterAdd(cb) + + realizePackageSpecifier(spec, where, function (err, p) { + if (err) return cb(err) + + log.silly("cache add", "parsed spec", p) + + switch (p.type) { + case "local": + case "directory": + addLocal(p, null, cb) + break + case "remote": + // get auth, if possible + mapToRegistry(p.raw, npm.config, function (err, uri, auth) { + if (err) return cb(err) + + addRemoteTarball(p.spec, {name : p.name}, null, auth, cb) + }) + break + case "git": + case "hosted": + addRemoteGit(p.rawSpec, cb) + break + default: + if (p.name) return addNamed(p.name, p.spec, null, cb) + + cb(new Error("couldn't figure out how to install " + spec)) + } + }) +} + +function unpack (pkg, ver, unpackTarget, dMode, fMode, uid, gid, cb) { + if (typeof cb !== "function") cb = gid, gid = null + if (typeof cb !== "function") cb = uid, uid = null + if (typeof cb !== "function") cb = fMode, fMode = null + if (typeof cb !== "function") cb = dMode, dMode = null + + read(pkg, ver, false, function (er) { + if (er) { + log.error("unpack", "Could not read data for %s", pkg + "@" + ver) + return cb(er) + } + npm.commands.unbuild([unpackTarget], true, function (er) { + if (er) return cb(er) + tar.unpack( path.join(cachedPackageRoot({name : pkg, version : ver}), "package.tgz") + , unpackTarget + , dMode, fMode + , uid, gid + , cb ) + }) + }) +} + +function afterAdd (cb) { return function (er, data) { + adding-- + if (adding <= 0) npm.spinner.stop() + + if (er || !data || !data.name || !data.version) return cb(er, data) + log.silly("cache", "afterAdd", data.name+"@"+data.version) + + // Save the resolved, shasum, etc. into the data so that the next + // time we load from this cached data, we have all the same info. + // Ignore if it fails. + var pj = path.join(cachedPackageRoot(data), "package", "package.json") + + var done = inflight(pj, cb) + if (!done) return log.verbose("afterAdd", pj, "already in flight; not writing") + log.verbose("afterAdd", pj, "not in flight; writing") + + getStat(function (er, cs) { + if (er) return done(er) + writeFileAtomic(pj, JSON.stringify(data), {chown : cs}, function (er) { + if (!er) log.verbose("afterAdd", pj, "written") + return done(null, data) + }) + }) +}} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/cache/add-local-tarball.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/cache/add-local-tarball.js new file mode 100644 index 00000000..f078039e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/cache/add-local-tarball.js @@ -0,0 +1,180 @@ +var mkdir = require("mkdirp") + , assert = require("assert") + , fs = require("graceful-fs") + , writeFileAtomic = require("write-file-atomic") + , path = require("path") + , sha = require("sha") + , npm = require("../npm.js") + , log = require("npmlog") + , tar = require("../utils/tar.js") + , pathIsInside = require("path-is-inside") + , getCacheStat = require("./get-stat.js") + , cachedPackageRoot = require("./cached-package-root.js") + , chownr = require("chownr") + , inflight = require("inflight") + , once = require("once") + , writeStreamAtomic = require("fs-write-stream-atomic") + , randomBytes = require("crypto").pseudoRandomBytes // only need uniqueness + +module.exports = addLocalTarball + +function addLocalTarball (p, pkgData, shasum, cb) { + assert(typeof p === "string", "must have path") + assert(typeof cb === "function", "must have callback") + + if (!pkgData) pkgData = {} + + // If we don't have a shasum yet, compute it. + if (!shasum) { + return sha.get(p, function (er, shasum) { + if (er) return cb(er) + log.silly("addLocalTarball", "shasum (computed)", shasum) + addLocalTarball(p, pkgData, shasum, cb) + }) + } + + if (pathIsInside(p, npm.cache)) { + if (path.basename(p) !== "package.tgz") { + return cb(new Error("Not a valid cache tarball name: "+p)) + } + log.verbose("addLocalTarball", "adding from inside cache", p) + return addPlacedTarball(p, pkgData, shasum, cb) + } + + addTmpTarball(p, pkgData, shasum, function (er, data) { + if (data) { + data._resolved = p + data._shasum = data._shasum || shasum + } + return cb(er, data) + }) +} + +function addPlacedTarball (p, pkgData, shasum, cb) { + assert(pkgData, "should have package data by now") + assert(typeof cb === "function", "cb function required") + + getCacheStat(function (er, cs) { + if (er) return cb(er) + return addPlacedTarball_(p, pkgData, cs.uid, cs.gid, shasum, cb) + }) +} + +function addPlacedTarball_ (p, pkgData, uid, gid, resolvedSum, cb) { + var folder = path.join(cachedPackageRoot(pkgData), "package") + + // First, make sure we have the shasum, if we don't already. + if (!resolvedSum) { + sha.get(p, function (er, shasum) { + if (er) return cb(er) + addPlacedTarball_(p, pkgData, uid, gid, shasum, cb) + }) + return + } + + mkdir(folder, function (er) { + if (er) return cb(er) + var pj = path.join(folder, "package.json") + var json = JSON.stringify(pkgData, null, 2) + writeFileAtomic(pj, json, function (er) { + cb(er, pkgData) + }) + }) +} + +function addTmpTarball (tgz, pkgData, shasum, cb) { + assert(typeof cb === "function", "must have callback function") + assert(shasum, "must have shasum by now") + + cb = inflight("addTmpTarball:" + tgz, cb) + if (!cb) return log.verbose("addTmpTarball", tgz, "already in flight; not adding") + log.verbose("addTmpTarball", tgz, "not in flight; adding") + + // we already have the package info, so just move into place + if (pkgData && pkgData.name && pkgData.version) { + log.verbose( + "addTmpTarball", + "already have metadata; skipping unpack for", + pkgData.name + "@" + pkgData.version + ) + return addTmpTarball_(tgz, pkgData, shasum, cb) + } + + // This is a tarball we probably downloaded from the internet. The shasum's + // already been checked, but we haven't ever had a peek inside, so we unpack + // it here just to make sure it is what it says it is. + // + // NOTE: we might not have any clue what we think it is, for example if the + // user just did `npm install ./foo.tgz` + + // generate a unique filename + randomBytes(6, function (er, random) { + if (er) return cb(er) + + var target = path.join(npm.tmp, "unpack-" + random.toString("hex")) + getCacheStat(function (er, cs) { + if (er) return cb(er) + + log.verbose("addTmpTarball", "validating metadata from", tgz) + tar.unpack(tgz, target, null, null, cs.uid, cs.gid, function (er, data) { + if (er) return cb(er) + + // check that this is what we expected. + if (!data.name) { + return cb(new Error("No name provided")) + } + else if (pkgData.name && data.name !== pkgData.name) { + return cb(new Error("Invalid Package: expected " + pkgData.name + + " but found " + data.name)) + } + + if (!data.version) { + return cb(new Error("No version provided")) + } + else if (pkgData.version && data.version !== pkgData.version) { + return cb(new Error("Invalid Package: expected " + + pkgData.name + "@" + pkgData.version + + " but found " + data.name + "@" + data.version)) + } + + addTmpTarball_(tgz, data, shasum, cb) + }) + }) + }) +} + +function addTmpTarball_ (tgz, data, shasum, cb) { + assert(typeof cb === "function", "must have callback function") + cb = once(cb) + + assert(data.name, "should have package name by now") + assert(data.version, "should have package version by now") + + var root = cachedPackageRoot(data) + var pkg = path.resolve(root, "package") + var target = path.resolve(root, "package.tgz") + getCacheStat(function (er, cs) { + if (er) return cb(er) + mkdir(pkg, function (er, created) { + + // chown starting from the first dir created by mkdirp, + // or the root dir, if none had to be created, so that + // we know that we get all the children. + function chown () { + chownr(created || root, cs.uid, cs.gid, done) + } + + if (er) return cb(er) + var read = fs.createReadStream(tgz) + var write = writeStreamAtomic(target, { mode: npm.modes.file }) + var fin = cs.uid && cs.gid ? chown : done + read.on("error", cb).pipe(write).on("error", cb).on("close", fin) + }) + + }) + + function done() { + data._shasum = data._shasum || shasum + cb(null, data) + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/cache/add-local.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/cache/add-local.js new file mode 100644 index 00000000..40586769 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/cache/add-local.js @@ -0,0 +1,126 @@ +var assert = require("assert") + , path = require("path") + , mkdir = require("mkdirp") + , chownr = require("chownr") + , pathIsInside = require("path-is-inside") + , readJson = require("read-package-json") + , log = require("npmlog") + , npm = require("../npm.js") + , tar = require("../utils/tar.js") + , deprCheck = require("../utils/depr-check.js") + , getCacheStat = require("./get-stat.js") + , cachedPackageRoot = require("./cached-package-root.js") + , addLocalTarball = require("./add-local-tarball.js") + , sha = require("sha") + , inflight = require("inflight") + +module.exports = addLocal + +function addLocal (p, pkgData, cb_) { + assert(typeof p === "object", "must have spec info") + assert(typeof cb_ === "function", "must have callback") + + pkgData = pkgData || {} + + function cb (er, data) { + if (er) { + log.error("addLocal", "Could not install %s", p.spec) + return cb_(er) + } + if (data && !data._fromGithub) { + data._from = path.relative(npm.prefix, p.spec) || "." + var resolved = path.relative(npm.prefix, p.spec) + if (resolved) data._resolved = "file:"+resolved + } + return cb_(er, data) + } + + if (p.type === "directory") { + addLocalDirectory(p.spec, pkgData, null, cb) + } + else { + addLocalTarball(p.spec, pkgData, null, cb) + } +} + +// At this point, if shasum is set, it's something that we've already +// read and checked. Just stashing it in the data at this point. +function addLocalDirectory (p, pkgData, shasum, cb) { + assert(pkgData, "must pass package data") + assert(typeof cb === "function", "must have callback") + + // if it's a folder, then read the package.json, + // tar it to the proper place, and add the cache tar + if (pathIsInside(p, npm.cache)) return cb(new Error( + "Adding a cache directory to the cache will make the world implode.")) + + readJson(path.join(p, "package.json"), false, function (er, data) { + if (er) return cb(er) + + if (!data.name) { + return cb(new Error("No name provided in package.json")) + } + else if (pkgData.name && pkgData.name !== data.name) { + return cb(new Error( + "Invalid package: expected " + pkgData.name + " but found " + data.name + )) + } + + if (!data.version) { + return cb(new Error("No version provided in package.json")) + } + else if (pkgData.version && pkgData.version !== data.version) { + return cb(new Error( + "Invalid package: expected " + pkgData.name + "@" + pkgData.version + + " but found " + data.name + "@" + data.version + )) + } + + deprCheck(data) + + // pack to {cache}/name/ver/package.tgz + var root = cachedPackageRoot(data) + var tgz = path.resolve(root, "package.tgz") + var pj = path.resolve(root, "package/package.json") + + var wrapped = inflight(tgz, next) + if (!wrapped) return log.verbose("addLocalDirectory", tgz, "already in flight; waiting") + log.verbose("addLocalDirectory", tgz, "not in flight; packing") + + getCacheStat(function (er, cs) { + mkdir(path.dirname(pj), function (er, made) { + if (er) return wrapped(er) + var fancy = !pathIsInside(p, npm.tmp) + tar.pack(tgz, p, data, fancy, function (er) { + if (er) { + log.error("addLocalDirectory", "Could not pack", p, "to", tgz) + return wrapped(er) + } + + if (!cs || isNaN(cs.uid) || isNaN(cs.gid)) return wrapped() + + chownr(made || tgz, cs.uid, cs.gid, function (er) { + if (er && er.code === 'ENOENT') return wrapped() + wrapped(er) + }) + }) + }) + }) + + function next (er) { + if (er) return cb(er) + // if we have the shasum already, just add it + if (shasum) { + return addLocalTarball(tgz, data, shasum, cb) + } else { + sha.get(tgz, function (er, shasum) { + if (er) { + return cb(er) + } + data._shasum = shasum + return addLocalTarball(tgz, data, shasum, cb) + }) + } + } + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/cache/add-named.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/cache/add-named.js new file mode 100644 index 00000000..acc67bf9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/cache/add-named.js @@ -0,0 +1,299 @@ +var path = require("path") + , assert = require("assert") + , fs = require("graceful-fs") + , http = require("http") + , log = require("npmlog") + , semver = require("semver") + , readJson = require("read-package-json") + , url = require("url") + , npm = require("../npm.js") + , deprCheck = require("../utils/depr-check.js") + , inflight = require("inflight") + , addRemoteTarball = require("./add-remote-tarball.js") + , cachedPackageRoot = require("./cached-package-root.js") + , mapToRegistry = require("../utils/map-to-registry.js") + + +module.exports = addNamed + +function getOnceFromRegistry (name, from, next, done) { + function fixName(err, data, json, resp) { + // this is only necessary until npm/npm-registry-client#80 is fixed + if (err && err.pkgid && err.pkgid !== name) { + err.message = err.message.replace( + new RegExp(': ' + err.pkgid.replace(/(\W)/g, '\\$1') + '$'), + ': ' + name + ) + err.pkgid = name + } + next(err, data, json, resp) + } + + mapToRegistry(name, npm.config, function (er, uri, auth) { + if (er) return done(er) + + var key = "registry:" + uri + next = inflight(key, next) + if (!next) return log.verbose(from, key, "already in flight; waiting") + else log.verbose(from, key, "not in flight; fetching") + + npm.registry.get(uri, { auth : auth }, fixName) + }) +} + +function addNamed (name, version, data, cb_) { + assert(typeof name === "string", "must have module name") + assert(typeof cb_ === "function", "must have callback") + + var key = name + "@" + version + log.silly("addNamed", key) + + function cb (er, data) { + if (data && !data._fromGithub) data._from = key + cb_(er, data) + } + + if (semver.valid(version, true)) { + log.verbose('addNamed', JSON.stringify(version), 'is a plain semver version for', name) + addNameVersion(name, version, data, cb) + } else if (semver.validRange(version, true)) { + log.verbose('addNamed', JSON.stringify(version), 'is a valid semver range for', name) + addNameRange(name, version, data, cb) + } else { + log.verbose('addNamed', JSON.stringify(version), 'is being treated as a dist-tag for', name) + addNameTag(name, version, data, cb) + } +} + +function addNameTag (name, tag, data, cb) { + log.info("addNameTag", [name, tag]) + var explicit = true + if (!tag) { + explicit = false + tag = npm.config.get("tag") + } + + getOnceFromRegistry(name, "addNameTag", next, cb) + + function next (er, data, json, resp) { + if (!er) er = errorResponse(name, resp) + if (er) return cb(er) + + log.silly("addNameTag", "next cb for", name, "with tag", tag) + + engineFilter(data) + if (data["dist-tags"] && data["dist-tags"][tag] + && data.versions[data["dist-tags"][tag]]) { + var ver = data["dist-tags"][tag] + return addNamed(name, ver, data.versions[ver], cb) + } + if (!explicit && Object.keys(data.versions).length) { + return addNamed(name, "*", data, cb) + } + + er = installTargetsError(tag, data) + return cb(er) + } +} + +function engineFilter (data) { + var npmv = npm.version + , nodev = npm.config.get("node-version") + , strict = npm.config.get("engine-strict") + + if (!nodev || npm.config.get("force")) return data + + Object.keys(data.versions || {}).forEach(function (v) { + var eng = data.versions[v].engines + if (!eng) return + if (!strict && !data.versions[v].engineStrict) return + if (eng.node && !semver.satisfies(nodev, eng.node, true) + || eng.npm && !semver.satisfies(npmv, eng.npm, true)) { + delete data.versions[v] + } + }) +} + +function addNameVersion (name, v, data, cb) { + var ver = semver.valid(v, true) + if (!ver) return cb(new Error("Invalid version: "+v)) + + var response + + if (data) { + response = null + return next() + } + + getOnceFromRegistry(name, "addNameVersion", setData, cb) + + function setData (er, d, json, resp) { + if (!er) { + er = errorResponse(name, resp) + } + if (er) return cb(er) + data = d && d.versions[ver] + if (!data) { + er = new Error("version not found: "+name+"@"+ver) + er.package = name + er.statusCode = 404 + return cb(er) + } + response = resp + next() + } + + function next () { + deprCheck(data) + var dist = data.dist + + if (!dist) return cb(new Error("No dist in "+data._id+" package")) + + if (!dist.tarball) return cb(new Error( + "No dist.tarball in " + data._id + " package")) + + if ((response && response.statusCode !== 304) || npm.config.get("force")) { + return fetchit() + } + + // we got cached data, so let's see if we have a tarball. + var pkgroot = cachedPackageRoot({name : name, version : ver}) + var pkgtgz = path.join(pkgroot, "package.tgz") + var pkgjson = path.join(pkgroot, "package", "package.json") + fs.stat(pkgtgz, function (er) { + if (!er) { + readJson(pkgjson, function (er, data) { + if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) + + if (data) { + if (!data.name) return cb(new Error("No name provided")) + if (!data.version) return cb(new Error("No version provided")) + + // check the SHA of the package we have, to ensure it wasn't installed + // from somewhere other than the registry (eg, a fork) + if (data._shasum && dist.shasum && data._shasum !== dist.shasum) { + return fetchit() + } + } + + if (er) return fetchit() + else return cb(null, data) + }) + } else return fetchit() + }) + + function fetchit () { + mapToRegistry(name, npm.config, function (er, _, auth, ruri) { + if (er) return cb(er) + + // Use the same protocol as the registry. https registry --> https + // tarballs, but only if they're the same hostname, or else detached + // tarballs may not work. + var tb = url.parse(dist.tarball) + var rp = url.parse(ruri) + if (tb.hostname === rp.hostname && tb.protocol !== rp.protocol) { + tb.protocol = rp.protocol + // If a different port is associated with the other protocol + // we need to update that as well + if (rp.port !== tb.port) { + tb.port = rp.port + delete tb.host + } + delete tb.href + } + tb = url.format(tb) + + // Only add non-shasum'ed packages if --forced. Only ancient things + // would lack this for good reasons nowadays. + if (!dist.shasum && !npm.config.get("force")) { + return cb(new Error("package lacks shasum: " + data._id)) + } + + addRemoteTarball(tb, data, dist.shasum, auth, cb) + }) + } + } +} + +function addNameRange (name, range, data, cb) { + range = semver.validRange(range, true) + if (range === null) return cb(new Error( + "Invalid version range: " + range + )) + + log.silly("addNameRange", {name:name, range:range, hasData:!!data}) + + if (data) return next() + + getOnceFromRegistry(name, "addNameRange", setData, cb) + + function setData (er, d, json, resp) { + if (!er) { + er = errorResponse(name, resp) + } + if (er) return cb(er) + data = d + next() + } + + function next () { + log.silly( "addNameRange", "number 2" + , {name:name, range:range, hasData:!!data}) + engineFilter(data) + + log.silly("addNameRange", "versions" + , [data.name, Object.keys(data.versions || {})]) + + // if the tagged version satisfies, then use that. + var tagged = data["dist-tags"][npm.config.get("tag")] + if (tagged + && data.versions[tagged] + && semver.satisfies(tagged, range, true)) { + return addNamed(name, tagged, data.versions[tagged], cb) + } + + // find the max satisfying version. + var versions = Object.keys(data.versions || {}) + var ms = semver.maxSatisfying(versions, range, true) + if (!ms) { + if (range === "*" && versions.length) { + return addNameTag(name, "latest", data, cb) + } else { + return cb(installTargetsError(range, data)) + } + } + + // if we don't have a registry connection, try to see if + // there's a cached copy that will be ok. + addNamed(name, ms, data.versions[ms], cb) + } +} + +function installTargetsError (requested, data) { + var targets = Object.keys(data["dist-tags"]).filter(function (f) { + return (data.versions || {}).hasOwnProperty(f) + }).concat(Object.keys(data.versions || {})) + + requested = data.name + (requested ? "@'" + requested + "'" : "") + + targets = targets.length + ? "Valid install targets:\n" + JSON.stringify(targets) + "\n" + : "No valid targets found.\n" + + "Perhaps not compatible with your version of node?" + + var er = new Error( "No compatible version found: " + + requested + "\n" + targets) + er.code = "ETARGET" + return er +} + +function errorResponse (name, response) { + var er + if (response.statusCode >= 400) { + er = new Error(http.STATUS_CODES[response.statusCode]) + er.statusCode = response.statusCode + er.code = "E" + er.statusCode + er.pkgid = name + } + return er +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/cache/add-remote-git.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/cache/add-remote-git.js new file mode 100644 index 00000000..112e8419 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/cache/add-remote-git.js @@ -0,0 +1,481 @@ +var assert = require('assert') +var crypto = require('crypto') +var fs = require('graceful-fs') +var path = require('path') +var url = require('url') + +var chownr = require('chownr') +var dezalgo = require('dezalgo') +var hostedFromURL = require('hosted-git-info').fromUrl +var inflight = require('inflight') +var log = require('npmlog') +var mkdir = require('mkdirp') +var normalizeGitUrl = require('normalize-git-url') +var npa = require('npm-package-arg') +var realizePackageSpecifier = require('realize-package-specifier') + +var addLocal = require('./add-local.js') +var correctMkdir = require('../utils/correct-mkdir.js') +var git = require('../utils/git.js') +var npm = require('../npm.js') +var rm = require('../utils/gently-rm.js') + +var remotes = path.resolve(npm.config.get('cache'), '_git-remotes') +var templates = path.join(remotes, '_templates') + +var VALID_VARIABLES = [ + 'GIT_ASKPASS', + 'GIT_EXEC_PATH', + 'GIT_PROXY_COMMAND', + 'GIT_SSH', + 'GIT_SSH_COMMAND', + 'GIT_SSL_CAINFO', + 'GIT_SSL_NO_VERIFY' +] + +module.exports = addRemoteGit +function addRemoteGit (uri, _cb) { + assert(typeof uri === 'string', 'must have git URL') + assert(typeof _cb === 'function', 'must have callback') + var cb = dezalgo(_cb) + + log.verbose('addRemoteGit', 'caching', uri) + + // the URL comes in exactly as it was passed on the command line, or as + // normalized by normalize-package-data / read-package-json / read-installed, + // so figure out what to do with it using hosted-git-info + var parsed = hostedFromURL(uri) + if (parsed) { + // normalize GitHub syntax to org/repo (for now) + var from + if (parsed.type === 'github' && parsed.default === 'shortcut') { + from = parsed.path() + } else { + from = parsed.toString() + } + + log.verbose('addRemoteGit', from, 'is a repository hosted by', parsed.type) + + // prefer explicit URLs to pushing everything through shortcuts + if (parsed.default !== 'shortcut') { + return tryClone(from, parsed.toString(), false, cb) + } + + // try git:, then git+ssh:, then git+https: before failing + tryGitProto(from, parsed, cb) + } else { + // verify that this is a Git URL before continuing + parsed = npa(uri) + if (parsed.type !== 'git') { + return cb(new Error(uri + 'is not a Git or GitHub URL')) + } + + tryClone(parsed.rawSpec, uri, false, cb) + } +} + +function tryGitProto (from, hostedInfo, cb) { + var gitURL = hostedInfo.git() + if (!gitURL) return trySSH(from, hostedInfo, cb) + + log.silly('tryGitProto', 'attempting to clone', gitURL) + tryClone(from, gitURL, true, function (er) { + if (er) return tryHTTPS(from, hostedInfo, cb) + + cb.apply(this, arguments) + }) +} + +function tryHTTPS (from, hostedInfo, cb) { + var httpsURL = hostedInfo.https() + if (!httpsURL) { + return cb(new Error(from + ' can not be cloned via Git, SSH, or HTTPS')) + } + + log.silly('tryHTTPS', 'attempting to clone', httpsURL) + tryClone(from, httpsURL, true, function (er) { + if (er) return trySSH(from, hostedInfo, cb) + + cb.apply(this, arguments) + }) +} + +function trySSH (from, hostedInfo, cb) { + var sshURL = hostedInfo.ssh() + if (!sshURL) return tryHTTPS(from, hostedInfo, cb) + + log.silly('trySSH', 'attempting to clone', sshURL) + tryClone(from, sshURL, false, cb) +} + +function tryClone (from, combinedURL, silent, cb) { + log.silly('tryClone', 'cloning', from, 'via', combinedURL) + + var normalized = normalizeGitUrl(combinedURL) + var cloneURL = normalized.url + var treeish = normalized.branch + + // ensure that similarly-named remotes don't collide + var repoID = cloneURL.replace(/[^a-zA-Z0-9]+/g, '-') + '-' + + crypto.createHash('sha1').update(combinedURL).digest('hex').slice(0, 8) + var cachedRemote = path.join(remotes, repoID) + + cb = inflight(repoID, cb) + if (!cb) { + return log.verbose('tryClone', repoID, 'already in flight; waiting') + } + log.verbose('tryClone', repoID, 'not in flight; caching') + + // initialize the remotes cache with the correct perms + getGitDir(function (er) { + if (er) return cb(er) + fs.stat(cachedRemote, function (er, s) { + if (er) return mirrorRemote(from, cloneURL, treeish, cachedRemote, silent, finish) + if (!s.isDirectory()) return resetRemote(from, cloneURL, treeish, cachedRemote, finish) + + validateExistingRemote(from, cloneURL, treeish, cachedRemote, finish) + }) + + // always set permissions on the cached remote + function finish (er, data) { + if (er) return cb(er, data) + addModeRecursive(cachedRemote, npm.modes.file, function (er) { + return cb(er, data) + }) + } + }) +} + +// don't try too hard to hold on to a remote +function resetRemote (from, cloneURL, treeish, cachedRemote, cb) { + log.info('resetRemote', 'resetting', cachedRemote, 'for', from) + rm(cachedRemote, function (er) { + if (er) return cb(er) + mirrorRemote(from, cloneURL, treeish, cachedRemote, false, cb) + }) +} + +// reuse a cached remote when possible, but nuke it if it's in an +// inconsistent state +function validateExistingRemote (from, cloneURL, treeish, cachedRemote, cb) { + git.whichAndExec( + ['config', '--get', 'remote.origin.url'], + { cwd: cachedRemote, env: gitEnv() }, + function (er, stdout, stderr) { + var originURL + if (stdout) { + originURL = stdout.trim() + log.silly('validateExistingRemote', from, 'remote.origin.url:', originURL) + } + + if (stderr) stderr = stderr.trim() + if (stderr || er) { + log.warn('addRemoteGit', from, 'resetting remote', cachedRemote, 'because of error:', stderr || er) + return resetRemote(from, cloneURL, treeish, cachedRemote, cb) + } else if (cloneURL !== originURL) { + log.warn( + 'addRemoteGit', + from, + 'pre-existing cached repo', cachedRemote, 'points to', originURL, 'and not', cloneURL + ) + return resetRemote(from, cloneURL, treeish, cachedRemote, cb) + } + + log.verbose('validateExistingRemote', from, 'is updating existing cached remote', cachedRemote) + updateRemote(from, cloneURL, treeish, cachedRemote, cb) + } + ) +} + +// make a complete bare mirror of the remote repo +// NOTE: npm uses a blank template directory to prevent weird inconsistencies +// https://github.com/npm/npm/issues/5867 +function mirrorRemote (from, cloneURL, treeish, cachedRemote, silent, cb) { + mkdir(cachedRemote, function (er) { + if (er) return cb(er) + + var args = [ + 'clone', + '--template=' + templates, + '--mirror', + cloneURL, cachedRemote + ] + git.whichAndExec( + ['clone', '--template=' + templates, '--mirror', cloneURL, cachedRemote], + { cwd: cachedRemote, env: gitEnv() }, + function (er, stdout, stderr) { + if (er) { + var combined = (stdout + '\n' + stderr).trim() + var command = 'git ' + args.join(' ') + ':' + if (silent) { + log.verbose(command, combined) + } else { + log.error(command, combined) + } + return cb(er) + } + log.verbose('mirrorRemote', from, 'git clone ' + cloneURL, stdout.trim()) + setPermissions(from, cloneURL, treeish, cachedRemote, cb) + } + ) + }) +} + +function setPermissions (from, cloneURL, treeish, cachedRemote, cb) { + if (process.platform === 'win32') { + log.verbose('setPermissions', from, 'skipping chownr on Windows') + resolveHead(from, cloneURL, treeish, cachedRemote, cb) + } else { + getGitDir(function (er, cs) { + if (er) { + log.error('setPermissions', from, 'could not get cache stat') + return cb(er) + } + + chownr(cachedRemote, cs.uid, cs.gid, function (er) { + if (er) { + log.error( + 'setPermissions', + 'Failed to change git repository ownership under npm cache for', + cachedRemote + ) + return cb(er) + } + + log.verbose('setPermissions', from, 'set permissions on', cachedRemote) + resolveHead(from, cloneURL, treeish, cachedRemote, cb) + }) + }) + } +} + +// always fetch the origin, even right after mirroring, because this way +// permissions will get set correctly +function updateRemote (from, cloneURL, treeish, cachedRemote, cb) { + git.whichAndExec( + ['fetch', '-a', 'origin'], + { cwd: cachedRemote, env: gitEnv() }, + function (er, stdout, stderr) { + if (er) { + var combined = (stdout + '\n' + stderr).trim() + log.error('git fetch -a origin (' + cloneURL + ')', combined) + return cb(er) + } + log.verbose('updateRemote', 'git fetch -a origin (' + cloneURL + ')', stdout.trim()) + + setPermissions(from, cloneURL, treeish, cachedRemote, cb) + } + ) +} + +// branches and tags are both symbolic labels that can be attached to different +// commits, so resolve the commit-ish to the current actual treeish the label +// corresponds to +// +// important for shrinkwrap +function resolveHead (from, cloneURL, treeish, cachedRemote, cb) { + log.verbose('resolveHead', from, 'original treeish:', treeish) + var args = ['rev-list', '-n1', treeish] + git.whichAndExec( + args, + { cwd: cachedRemote, env: gitEnv() }, + function (er, stdout, stderr) { + if (er) { + log.error('git ' + args.join(' ') + ':', stderr) + return cb(er) + } + + var resolvedTreeish = stdout.trim() + log.silly('resolveHead', from, 'resolved treeish:', resolvedTreeish) + + var resolvedURL = getResolved(cloneURL, resolvedTreeish) + if (!resolvedURL) { + return cb(new Error( + 'unable to clone ' + from + ' because git clone string ' + + cloneURL + ' is in a form npm can\'t handle' + )) + } + log.verbose('resolveHead', from, 'resolved Git URL:', resolvedURL) + + // generate a unique filename + var tmpdir = path.join( + npm.tmp, + 'git-cache-' + crypto.pseudoRandomBytes(6).toString('hex'), + resolvedTreeish + ) + log.silly('resolveHead', 'Git working directory:', tmpdir) + + mkdir(tmpdir, function (er) { + if (er) return cb(er) + + cloneResolved(from, resolvedURL, resolvedTreeish, cachedRemote, tmpdir, cb) + }) + } + ) +} + +// make a clone from the mirrored cache so we have a temporary directory in +// which we can check out the resolved treeish +function cloneResolved (from, resolvedURL, resolvedTreeish, cachedRemote, tmpdir, cb) { + var args = ['clone', cachedRemote, tmpdir] + git.whichAndExec( + args, + { cwd: cachedRemote, env: gitEnv() }, + function (er, stdout, stderr) { + stdout = (stdout + '\n' + stderr).trim() + if (er) { + log.error('git ' + args.join(' ') + ':', stderr) + return cb(er) + } + log.verbose('cloneResolved', from, 'clone', stdout) + + checkoutTreeish(from, resolvedURL, resolvedTreeish, tmpdir, cb) + } + ) +} + +// there is no safe way to do a one-step clone to a treeish that isn't +// guaranteed to be a branch, so explicitly check out the treeish once it's +// cloned +function checkoutTreeish (from, resolvedURL, resolvedTreeish, tmpdir, cb) { + var args = ['checkout', resolvedTreeish] + git.whichAndExec( + args, + { cwd: tmpdir, env: gitEnv() }, + function (er, stdout, stderr) { + stdout = (stdout + '\n' + stderr).trim() + if (er) { + log.error('git ' + args.join(' ') + ':', stderr) + return cb(er) + } + log.verbose('checkoutTreeish', from, 'checkout', stdout) + + // convince addLocal that the checkout is a local dependency + realizePackageSpecifier(tmpdir, function (er, spec) { + if (er) { + log.error('addRemoteGit', 'Failed to map', tmpdir, 'to a package specifier') + return cb(er) + } + + // ensure pack logic is applied + // https://github.com/npm/npm/issues/6400 + addLocal(spec, null, function (er, data) { + if (data) { + if (npm.config.get('save-exact')) { + log.verbose('addRemoteGit', 'data._from:', resolvedURL, '(save-exact)') + data._from = resolvedURL + } else { + log.verbose('addRemoteGit', 'data._from:', from) + data._from = from + } + + log.verbose('addRemoteGit', 'data._resolved:', resolvedURL) + data._resolved = resolvedURL + } + + cb(er, data) + }) + }) + } + ) +} + +function getGitDir (cb) { + correctMkdir(remotes, function (er, stats) { + if (er) return cb(er) + + // We don't need global templates when cloning. Use an empty directory for + // the templates, creating it (and setting its permissions) if necessary. + mkdir(templates, function (er) { + if (er) return cb(er) + + // Ensure that both the template and remotes directories have the correct + // permissions. + fs.chown(templates, stats.uid, stats.gid, function (er) { + cb(er, stats) + }) + }) + }) +} + +var gitEnv_ +function gitEnv () { + // git responds to env vars in some weird ways in post-receive hooks + // so don't carry those along. + if (gitEnv_) return gitEnv_ + + // allow users to override npm's insistence on not prompting for + // passphrases, but default to just failing when credentials + // aren't available + gitEnv_ = { GIT_ASKPASS: 'echo' } + + for (var k in process.env) { + if (!~VALID_VARIABLES.indexOf(k) && k.match(/^GIT/)) continue + gitEnv_[k] = process.env[k] + } + return gitEnv_ +} + +addRemoteGit.getResolved = getResolved +function getResolved (uri, treeish) { + // normalize hosted-git-info clone URLs back into regular URLs + // this will only work on URLs that hosted-git-info recognizes + // https://github.com/npm/npm/issues/7961 + var rehydrated = hostedFromURL(uri) + if (rehydrated) uri = rehydrated.toString() + + var parsed = url.parse(uri) + + // Checks for known protocols: + // http:, https:, ssh:, and git:, with optional git+ prefix. + if (!parsed.protocol || + !parsed.protocol.match(/^(((git\+)?(https?|ssh))|git|file):$/)) { + uri = 'git+ssh://' + uri + } + + if (!/^git[+:]/.test(uri)) { + uri = 'git+' + uri + } + + // Not all URIs are actually URIs, so use regex for the treeish. + return uri.replace(/(?:#.*)?$/, '#' + treeish) +} + +// similar to chmodr except it add permissions rather than overwriting them +// adapted from https://github.com/isaacs/chmodr/blob/master/chmodr.js +function addModeRecursive (cachedRemote, mode, cb) { + fs.readdir(cachedRemote, function (er, children) { + // Any error other than ENOTDIR means it's not readable, or doesn't exist. + // Give up. + if (er && er.code !== 'ENOTDIR') return cb(er) + if (er || !children.length) return addMode(cachedRemote, mode, cb) + + var len = children.length + var errState = null + children.forEach(function (child) { + addModeRecursive(path.resolve(cachedRemote, child), mode, then) + }) + + function then (er) { + if (errState) return undefined + if (er) return cb(errState = er) + if (--len === 0) return addMode(cachedRemote, dirMode(mode), cb) + } + }) +} + +function addMode (cachedRemote, mode, cb) { + fs.stat(cachedRemote, function (er, stats) { + if (er) return cb(er) + mode = stats.mode | mode + fs.chmod(cachedRemote, mode, cb) + }) +} + +// taken from https://github.com/isaacs/chmodr/blob/master/chmodr.js +function dirMode (mode) { + if (mode & parseInt('0400', 8)) mode |= parseInt('0100', 8) + if (mode & parseInt('040', 8)) mode |= parseInt('010', 8) + if (mode & parseInt('04', 8)) mode |= parseInt('01', 8) + return mode +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/cache/add-remote-tarball.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/cache/add-remote-tarball.js new file mode 100644 index 00000000..d04e9da5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/cache/add-remote-tarball.js @@ -0,0 +1,120 @@ +var mkdir = require("mkdirp") + , assert = require("assert") + , log = require("npmlog") + , path = require("path") + , sha = require("sha") + , retry = require("retry") + , writeStreamAtomic = require("fs-write-stream-atomic") + , PassThrough = require('readable-stream').PassThrough + , npm = require("../npm.js") + , inflight = require("inflight") + , addLocalTarball = require("./add-local-tarball.js") + , cacheFile = require("npm-cache-filename") + +module.exports = addRemoteTarball + +function addRemoteTarball (u, pkgData, shasum, auth, cb_) { + assert(typeof u === "string", "must have module URL") + assert(typeof cb_ === "function", "must have callback") + + function cb (er, data) { + if (data) { + data._from = u + data._resolved = u + data._shasum = data._shasum || shasum + } + cb_(er, data) + } + + cb_ = inflight(u, cb_) + if (!cb_) return log.verbose("addRemoteTarball", u, "already in flight; waiting") + log.verbose("addRemoteTarball", u, "not in flight; adding") + + // XXX Fetch direct to cache location, store tarballs under + // ${cache}/registry.npmjs.org/pkg/-/pkg-1.2.3.tgz + var tmp = cacheFile(npm.tmp, u) + + function next (er, resp, shasum) { + if (er) return cb(er) + addLocalTarball(tmp, pkgData, shasum, cb) + } + + log.verbose("addRemoteTarball", [u, shasum]) + mkdir(path.dirname(tmp), function (er) { + if (er) return cb(er) + addRemoteTarball_(u, tmp, shasum, auth, next) + }) +} + +function addRemoteTarball_ (u, tmp, shasum, auth, cb) { + // Tuned to spread 3 attempts over about a minute. + // See formula at . + var operation = retry.operation({ + retries: npm.config.get("fetch-retries") + , factor: npm.config.get("fetch-retry-factor") + , minTimeout: npm.config.get("fetch-retry-mintimeout") + , maxTimeout: npm.config.get("fetch-retry-maxtimeout") + }) + + operation.attempt(function (currentAttempt) { + log.info("retry", "fetch attempt " + currentAttempt + + " at " + (new Date()).toLocaleTimeString()) + fetchAndShaCheck(u, tmp, shasum, auth, function (er, response, shasum) { + // Only retry on 408, 5xx or no `response`. + var sc = response && response.statusCode + var statusRetry = !sc || (sc === 408 || sc >= 500) + if (er && statusRetry && operation.retry(er)) { + log.warn("retry", "will retry, error on last attempt: " + er) + return + } + cb(er, response, shasum) + }) + }) +} + +function fetchAndShaCheck (u, tmp, shasum, auth, cb) { + npm.registry.fetch(u, { auth : auth }, function (er, response) { + if (er) { + log.error("fetch failed", u) + return cb(er, response) + } + + var tarball = writeStreamAtomic(tmp, { mode: npm.modes.file }) + tarball.on('error', function (er) { + cb(er) + tarball.destroy() + }) + + tarball.on("finish", function () { + if (!shasum) { + // Well, we weren't given a shasum, so at least sha what we have + // in case we want to compare it to something else later + return sha.get(tmp, function (er, shasum) { + log.silly("fetchAndShaCheck", "shasum", shasum) + cb(er, response, shasum) + }) + } + + // validate that the url we just downloaded matches the expected shasum. + log.silly("fetchAndShaCheck", "shasum", shasum) + sha.check(tmp, shasum, function (er) { + if (er && er.message) { + // add original filename for better debuggability + er.message = er.message + "\n" + "From: " + u + } + return cb(er, response, shasum) + }) + }) + + // 0.8 http streams have a bug, where if they're paused with data in + // their buffers when the socket closes, they call `end` before emptying + // those buffers, which results in the entire pipeline ending and thus + // the point that applied backpressure never being able to trigger a + // `resume`. + // We work around this by piping into a pass through stream that has + // unlimited buffering. The pass through stream is from readable-stream + // and is thus a current streams3 implementation that is free of these + // bugs even on 0.8. + response.pipe(PassThrough({highWaterMark: Infinity})).pipe(tarball) + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/cache/cached-package-root.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/cache/cached-package-root.js new file mode 100644 index 00000000..7163314a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/cache/cached-package-root.js @@ -0,0 +1,14 @@ +var assert = require("assert") +var resolve = require("path").resolve + +var npm = require("../npm.js") + +module.exports = getCacheRoot + +function getCacheRoot (data) { + assert(data, "must pass package metadata") + assert(data.name, "package metadata must include name") + assert(data.version, "package metadata must include version") + + return resolve(npm.cache, data.name, data.version) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/cache/caching-client.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/cache/caching-client.js new file mode 100644 index 00000000..a2c7c5f6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/cache/caching-client.js @@ -0,0 +1,218 @@ +module.exports = CachingRegistryClient + +var path = require("path") + , fs = require("graceful-fs") + , url = require("url") + , assert = require("assert") + , inherits = require("util").inherits + +var RegistryClient = require("npm-registry-client") + , npm = require("../npm.js") + , log = require("npmlog") + , getCacheStat = require("./get-stat.js") + , cacheFile = require("npm-cache-filename") + , mkdirp = require("mkdirp") + , rimraf = require("rimraf") + , chownr = require("chownr") + , writeFile = require("write-file-atomic") + +function CachingRegistryClient (config) { + RegistryClient.call(this, adaptConfig(config)) + + this._mapToCache = cacheFile(config.get("cache")) + + // swizzle in our custom cache invalidation logic + this._request = this.request + this.request = this._invalidatingRequest + this.get = get +} +inherits(CachingRegistryClient, RegistryClient) + +CachingRegistryClient.prototype._invalidatingRequest = function (uri, params, cb) { + var client = this + this._request.call(this, uri, params, function () { + var args = arguments + + var method = params.method + if (method !== "HEAD" && method !== "GET") { + var invalidated = client._mapToCache(uri) + // invalidate cache + // + // This is irrelevant for commands that do etag / last-modified caching, + // but ls and view also have a timed cache, so this keeps the user from + // thinking that it didn't work when it did. + // Note that failure is an acceptable option here, since the only + // result will be a stale cache for some helper commands. + log.verbose("request", "invalidating", invalidated, "on", method) + return rimraf(invalidated, function () { + cb.apply(undefined, args) + }) + } + + cb.apply(undefined, args) + }) +} + +function get (uri, params, cb) { + assert(typeof uri === "string", "must pass registry URI to get") + assert(params && typeof params === "object", "must pass params to get") + assert(typeof cb === "function", "must pass callback to get") + + var parsed = url.parse(uri) + assert( + parsed.protocol === "http:" || parsed.protocol === "https:", + "must have a URL that starts with http: or https:" + ) + + var cacheBase = cacheFile(npm.config.get("cache"))(uri) + var cachePath = path.join(cacheBase, ".cache.json") + + // If the GET is part of a write operation (PUT or DELETE), then + // skip past the cache entirely, but still save the results. + if (uri.match(/\?write=true$/)) { + log.verbose("get", "GET as part of write; not caching result") + return get_.call(this, uri, cachePath, params, cb) + } + + var client = this + fs.stat(cachePath, function (er, stat) { + if (!er) { + fs.readFile(cachePath, function (er, data) { + try { + data = JSON.parse(data) + } + catch (ex) { + data = null + } + + params.stat = stat + params.data = data + + get_.call(client, uri, cachePath, params, cb) + }) + } + else { + get_.call(client, uri, cachePath, params, cb) + } + }) +} + +function get_ (uri, cachePath, params, cb) { + var staleOk = params.staleOk === undefined ? false : params.staleOk + , timeout = params.timeout === undefined ? -1 : params.timeout + , data = params.data + , stat = params.stat + , etag + , lastModified + + timeout = Math.min(timeout, npm.config.get("cache-max") || 0) + timeout = Math.max(timeout, npm.config.get("cache-min") || -Infinity) + if (process.env.COMP_CWORD !== undefined && + process.env.COMP_LINE !== undefined && + process.env.COMP_POINT !== undefined) { + timeout = Math.max(timeout, 60000) + } + + if (data) { + if (data._etag) etag = data._etag + if (data._lastModified) lastModified = data._lastModified + + if (stat && timeout && timeout > 0) { + if ((Date.now() - stat.mtime.getTime())/1000 < timeout) { + log.verbose("get", uri, "not expired, no request") + delete data._etag + delete data._lastModified + return cb(null, data, JSON.stringify(data), { statusCode : 304 }) + } + + if (staleOk) { + log.verbose("get", uri, "staleOk, background update") + delete data._etag + delete data._lastModified + process.nextTick( + cb.bind(null, null, data, JSON.stringify(data), { statusCode : 304 } ) + ) + cb = function () {} + } + } + } + + var options = { + etag : etag, + lastModified : lastModified, + follow : params.follow, + auth : params.auth + } + this.request(uri, options, function (er, remoteData, raw, response) { + // if we get an error talking to the registry, but we have it + // from the cache, then just pretend we got it. + if (er && cachePath && data && !data.error) { + er = null + response = { statusCode: 304 } + } + + if (response) { + log.silly("get", "cb", [response.statusCode, response.headers]) + if (response.statusCode === 304 && (etag || lastModified)) { + remoteData = data + log.verbose(etag ? "etag" : "lastModified", uri+" from cache") + } + } + + data = remoteData + if (!data) er = er || new Error("failed to fetch from registry: " + uri) + + if (er) return cb(er, data, raw, response) + + saveToCache(cachePath, data, saved) + + // just give the write the old college try. if it fails, whatever. + function saved () { + delete data._etag + delete data._lastModified + cb(er, data, raw, response) + } + + function saveToCache (cachePath, data, saved) { + log.verbose("get", "saving", data.name, "to", cachePath) + getCacheStat(function (er, st) { + mkdirp(path.dirname(cachePath), function (er, made) { + if (er) return saved() + + writeFile(cachePath, JSON.stringify(data), function (er) { + if (er) return saved() + + chownr(made || cachePath, st.uid, st.gid, saved) + }) + }) + }) + } + }) +} + +function adaptConfig (config) { + return { + proxy : { + http : config.get("proxy"), + https : config.get("https-proxy"), + localAddress : config.get("local-address") + }, + ssl : { + certificate : config.get("cert"), + key : config.get("key"), + ca : config.get("ca"), + strict : config.get("strict-ssl") + }, + retry : { + retries : config.get("fetch-retries"), + factor : config.get("fetch-retry-factor"), + minTimeout : config.get("fetch-retry-mintimeout"), + maxTimeout : config.get("fetch-retry-maxtimeout") + }, + userAgent : config.get("user-agent"), + log : log, + defaultTag : config.get("tag"), + couchToken : config.get("_token"), + maxSockets : config.get('maxsockets') + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/cache/get-stat.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/cache/get-stat.js new file mode 100644 index 00000000..6ea797a4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/cache/get-stat.js @@ -0,0 +1,6 @@ +var npm = require('../npm.js') +var correctMkdir = require('../utils/correct-mkdir.js') + +module.exports = function getCacheStat (cb) { + correctMkdir(npm.cache, cb) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/cache/update-index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/cache/update-index.js new file mode 100644 index 00000000..ab1ede12 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/cache/update-index.js @@ -0,0 +1,104 @@ +module.exports = updateIndex + +var fs = require('graceful-fs') +var assert = require('assert') +var path = require('path') +var mkdir = require('mkdirp') +var chownr = require('chownr') +var npm = require('../npm.js') +var log = require('npmlog') +var cacheFile = require('npm-cache-filename') +var getCacheStat = require('./get-stat.js') +var mapToRegistry = require('../utils/map-to-registry.js') + +/* /-/all is special. + * It uses timestamp-based caching and partial updates, + * because it is a monster. + */ +function updateIndex (staleness, cb) { + assert(typeof cb === 'function', 'must pass callback to updateIndex') + + mapToRegistry('-/all', npm.config, function (er, uri, auth) { + if (er) return cb(er) + + var params = { + timeout: staleness, + follow: true, + staleOk: true, + auth: auth + } + var cacheBase = cacheFile(npm.config.get('cache'))(uri) + var cachePath = path.join(cacheBase, '.cache.json') + log.info('updateIndex', cachePath) + + getCacheStat(function (er, st) { + if (er) return cb(er) + + mkdir(cacheBase, function (er, made) { + if (er) return cb(er) + + fs.readFile(cachePath, function (er, data) { + if (er) { + log.warn('', 'Building the local index for the first time, please be patient') + return updateIndex_(uri, params, {}, cachePath, cb) + } + + chownr(made || cachePath, st.uid, st.gid, function (er) { + if (er) return cb(er) + + try { + data = JSON.parse(data) + } catch (ex) { + fs.writeFile(cachePath, '{}', function (er) { + if (er) return cb(new Error('Broken cache.')) + + log.warn('', 'Building the local index for the first time, please be patient') + return updateIndex_(uri, params, {}, cachePath, cb) + }) + } + + var t = +data._updated || 0 + // use the cache and update in the background if it's not too old + if (Date.now() - t < 60000) { + cb(null, data) + cb = function () {} + } + + if (t === 0) { + log.warn('', 'Building the local index for the first time, please be patient') + } else { + log.verbose('updateIndex', 'Cached search data present with timestamp', t) + uri += '/since?stale=update_after&startkey=' + t + } + updateIndex_(uri, params, data, cachePath, cb) + }) + }) + }) + }) + }) +} + +function updateIndex_ (all, params, data, cachePath, cb) { + log.silly('update-index', 'fetching', all) + npm.registry.request(all, params, function (er, updates, _, res) { + if (er) return cb(er, data) + + var headers = res.headers + var updated = updates._updated || Date.parse(headers.date) + + Object.keys(updates).forEach(function (p) { data[p] = updates[p] }) + + data._updated = updated + getCacheStat(function (er, st) { + if (er) return cb(er) + + fs.writeFile(cachePath, JSON.stringify(data), function (er) { + delete data._updated + if (er) return cb(er) + chownr(cachePath, st.uid, st.gid, function (er) { + cb(er, data) + }) + }) + }) + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/completion.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/completion.js new file mode 100644 index 00000000..d218679b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/completion.js @@ -0,0 +1,248 @@ + +module.exports = completion + +completion.usage = "npm completion >> ~/.bashrc\n" + + "npm completion >> ~/.zshrc\n" + + "source <(npm completion)" + +var npm = require("./npm.js") + , npmconf = require("./config/core.js") + , configDefs = npmconf.defs + , configTypes = configDefs.types + , shorthands = configDefs.shorthands + , nopt = require("nopt") + , configNames = Object.keys(configTypes).filter(function (e) { + return e.charAt(0) !== "_" + }) + , shorthandNames = Object.keys(shorthands) + , allConfs = configNames.concat(shorthandNames) + , once = require("once") + + +completion.completion = function (opts, cb) { + if (opts.w > 3) return cb() + + var fs = require("graceful-fs") + , path = require("path") + , bashExists = null + , zshExists = null + fs.stat(path.resolve(process.env.HOME, ".bashrc"), function (er) { + bashExists = !er + next() + }) + fs.stat(path.resolve(process.env.HOME, ".zshrc"), function (er) { + zshExists = !er + next() + }) + function next () { + if (zshExists === null || bashExists === null) return + var out = [] + if (zshExists) out.push("~/.zshrc") + if (bashExists) out.push("~/.bashrc") + if (opts.w === 2) out = out.map(function (m) { + return [">>", m] + }) + cb(null, out) + } +} + +function completion (args, cb) { + if (process.platform === 'win32' && !(/^MINGW(32|64)$/.test(process.env.MSYSTEM))) { + var e = new Error('npm completion supported only in MINGW / Git bash on Windows') + e.code = 'ENOTSUP' + e.errno = require('constants').ENOTSUP + return cb(e) + } + + // if the COMP_* isn't in the env, then just dump the script. + if (process.env.COMP_CWORD === undefined + ||process.env.COMP_LINE === undefined + ||process.env.COMP_POINT === undefined + ) return dumpScript(cb) + + console.error(process.env.COMP_CWORD) + console.error(process.env.COMP_LINE) + console.error(process.env.COMP_POINT) + + //console.log("abracadabrasauce\nabracad cat monger") + //if (Math.random() * 3 < 1) console.log("man\\ bear\\ pig") + //else if (Math.random() * 3 < 1) + // console.log("porkchop\\ sandwiches\nporkman") + //else console.log("encephylophagy") + + // get the partial line and partial word, + // if the point isn't at the end. + // ie, tabbing at: npm foo b|ar + var w = +process.env.COMP_CWORD + , words = args.map(unescape) + , word = words[w] + , line = process.env.COMP_LINE + , point = +process.env.COMP_POINT + , partialLine = line.substr(0, point) + , partialWords = words.slice(0, w) + + // figure out where in that last word the point is. + var partialWord = args[w] + , i = partialWord.length + while (partialWord.substr(0, i) !== partialLine.substr(-1*i) && i > 0) { + i -- + } + partialWord = unescape(partialWord.substr(0, i)) + partialWords.push(partialWord) + + var opts = { words : words + , w : w + , word : word + , line : line + , lineLength : line.length + , point : point + , partialLine : partialLine + , partialWords : partialWords + , partialWord : partialWord + , raw: args + } + + cb = wrapCb(cb, opts) + + console.error(opts) + + if (partialWords.slice(0, -1).indexOf("--") === -1) { + if (word.charAt(0) === "-") return configCompl(opts, cb) + if (words[w - 1] + && words[w - 1].charAt(0) === "-" + && !isFlag(words[w - 1])) { + // awaiting a value for a non-bool config. + // don't even try to do this for now + console.error("configValueCompl") + return configValueCompl(opts, cb) + } + } + + // try to find the npm command. + // it's the first thing after all the configs. + // take a little shortcut and use npm's arg parsing logic. + // don't have to worry about the last arg being implicitly + // boolean'ed, since the last block will catch that. + var parsed = opts.conf = + nopt(configTypes, shorthands, partialWords.slice(0, -1), 0) + // check if there's a command already. + console.error(parsed) + var cmd = parsed.argv.remain[1] + if (!cmd) return cmdCompl(opts, cb) + + Object.keys(parsed).forEach(function (k) { + npm.config.set(k, parsed[k]) + }) + + // at this point, if words[1] is some kind of npm command, + // then complete on it. + // otherwise, do nothing + cmd = npm.commands[cmd] + if (cmd && cmd.completion) return cmd.completion(opts, cb) + + // nothing to do. + cb() +} + +function dumpScript (cb) { + var fs = require("graceful-fs") + , path = require("path") + , p = path.resolve(__dirname, "utils/completion.sh") + + // The Darwin patch below results in callbacks first for the write and then + // for the error handler, so make sure we only call our callback once. + cb = once(cb) + + fs.readFile(p, "utf8", function (er, d) { + if (er) return cb(er) + d = d.replace(/^\#\!.*?\n/, "") + + process.stdout.write(d, function () { cb() }) + process.stdout.on("error", function (er) { + // Darwin is a pain sometimes. + // + // This is necessary because the "source" or "." program in + // bash on OS X closes its file argument before reading + // from it, meaning that you get exactly 1 write, which will + // work most of the time, and will always raise an EPIPE. + // + // Really, one should not be tossing away EPIPE errors, or any + // errors, so casually. But, without this, `. <(npm completion)` + // can never ever work on OS X. + if (er.errno === "EPIPE") er = null + cb(er) + }) + + }) +} + +function unescape (w) { + if (w.charAt(0) === "\"") return w.replace(/^"|"$/g, "") + else return w.replace(/\\ /g, " ") +} + +function escape (w) { + if (!w.match(/\s+/)) return w + return "\"" + w + "\"" +} + +// The command should respond with an array. Loop over that, +// wrapping quotes around any that have spaces, and writing +// them to stdout. Use console.log, not the outfd config. +// If any of the items are arrays, then join them with a space. +// Ie, returning ["a", "b c", ["d", "e"]] would allow it to expand +// to: "a", "b c", or "d" "e" +function wrapCb (cb, opts) { return function (er, compls) { + if (!Array.isArray(compls)) compls = compls ? [compls] : [] + compls = compls.map(function (c) { + if (Array.isArray(c)) c = c.map(escape).join(" ") + else c = escape(c) + return c + }) + if (opts.partialWord) compls = compls.filter(function (c) { + return c.indexOf(opts.partialWord) === 0 + }) + console.error([er && er.stack, compls, opts.partialWord]) + if (er || compls.length === 0) return cb(er) + + console.log(compls.join("\n")) + cb() +}} + +// the current word has a dash. Return the config names, +// with the same number of dashes as the current word has. +function configCompl (opts, cb) { + var word = opts.word + , split = word.match(/^(-+)((?:no-)*)(.*)$/) + , dashes = split[1] + , no = split[2] + , flags = configNames.filter(isFlag) + console.error(flags) + + return cb(null, allConfs.map(function (c) { + return dashes + c + }).concat(flags.map(function (f) { + return dashes + (no || "no-") + f + }))) +} + +// expand with the valid values of various config values. +// not yet implemented. +function configValueCompl (opts, cb) { + console.error("configValue", opts) + return cb(null, []) +} + +// check if the thing is a flag or not. +function isFlag (word) { + // shorthands never take args. + var split = word.match(/^(-*)((?:no-)+)?(.*)$/) + , no = split[2] + , conf = split[3] + return no || configTypes[conf] === Boolean || shorthands[conf] +} + +// complete against the npm commands +function cmdCompl (opts, cb) { + return cb(null, npm.fullList) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/config.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/config.js new file mode 100644 index 00000000..c79cdc5b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/config.js @@ -0,0 +1,285 @@ + +module.exports = config + +config.usage = "npm config set " + + "\nnpm config get []" + + "\nnpm config delete " + + "\nnpm config list" + + "\nnpm config edit" + + "\nnpm set " + + "\nnpm get []" + +var log = require("npmlog") + , npm = require("./npm.js") + , npmconf = require("./config/core.js") + , fs = require("graceful-fs") + , writeFileAtomic = require("write-file-atomic") + , types = npmconf.defs.types + , ini = require("ini") + , editor = require("editor") + , os = require("os") + , umask = require("./utils/umask") + +config.completion = function (opts, cb) { + var argv = opts.conf.argv.remain + if (argv[1] !== "config") argv.unshift("config") + if (argv.length === 2) { + var cmds = ["get", "set", "delete", "ls", "rm", "edit"] + if (opts.partialWord !== "l") cmds.push("list") + return cb(null, cmds) + } + + var action = argv[2] + switch (action) { + case "set": + // todo: complete with valid values, if possible. + if (argv.length > 3) return cb(null, []) + // fallthrough + case "get": + case "delete": + case "rm": + return cb(null, Object.keys(types)) + case "edit": + case "list": case "ls": + return cb(null, []) + default: return cb(null, []) + } +} + +// npm config set key value +// npm config get key +// npm config list +function config (args, cb) { + var action = args.shift() + switch (action) { + case "set": return set(args[0], args[1], cb) + case "get": return get(args[0], cb) + case "delete": case "rm": case "del": return del(args[0], cb) + case "list": case "ls": return list(cb) + case "edit": return edit(cb) + default: return unknown(action, cb) + } +} + +function edit (cb) { + var e = npm.config.get("editor") + , which = npm.config.get("global") ? "global" : "user" + , f = npm.config.get(which + "config") + if (!e) return cb(new Error("No EDITOR config or environ set.")) + npm.config.save(which, function (er) { + if (er) return cb(er) + fs.readFile(f, "utf8", function (er, data) { + if (er) data = "" + data = [ ";;;;" + , "; npm "+(npm.config.get("global") ? + "globalconfig" : "userconfig")+" file" + , "; this is a simple ini-formatted file" + , "; lines that start with semi-colons are comments." + , "; read `npm help config` for help on the various options" + , ";;;;" + , "" + , data + ].concat( [ ";;;;" + , "; all options with default values" + , ";;;;" + ] + ) + .concat(Object.keys(npmconf.defaults).reduce(function (arr, key) { + var obj = {} + obj[key] = npmconf.defaults[key] + if (key === "logstream") return arr + return arr.concat( + ini.stringify(obj) + .replace(/\n$/m, "") + .replace(/^/g, "; ") + .replace(/\n/g, "\n; ") + .split("\n")) + }, [])) + .concat([""]) + .join(os.EOL) + writeFileAtomic + ( f + , data + , function (er) { + if (er) return cb(er) + editor(f, { editor: e }, cb) + } + ) + }) + }) +} + +function del (key, cb) { + if (!key) return cb(new Error("no key provided")) + var where = npm.config.get("global") ? "global" : "user" + npm.config.del(key, where) + npm.config.save(where, cb) +} + +function set (key, val, cb) { + if (key === undefined) { + return unknown("", cb) + } + if (val === undefined) { + if (key.indexOf("=") !== -1) { + var k = key.split("=") + key = k.shift() + val = k.join("=") + } else { + val = "" + } + } + key = key.trim() + val = val.trim() + log.info("config", "set %j %j", key, val) + var where = npm.config.get("global") ? "global" : "user" + if (key.match(/umask/)) val = umask.fromString(val) + npm.config.set(key, val, where) + npm.config.save(where, cb) +} + +function get (key, cb) { + if (!key) return list(cb) + if (!public(key)) { + return cb(new Error("---sekretz---")) + } + var val = npm.config.get(key) + if (key.match(/umask/)) val = umask.toString(val) + console.log(val) + cb() +} + +function sort (a, b) { + return a > b ? 1 : -1 +} + +function public (k) { + return !(k.charAt(0) === "_" || + k.indexOf(":_") !== -1 || + types[k] !== types[k]) +} + +function getKeys (data) { + return Object.keys(data).filter(public).sort(sort) +} + +function list (cb) { + var msg = "" + , long = npm.config.get("long") + + var cli = npm.config.sources.cli.data + , cliKeys = getKeys(cli) + if (cliKeys.length) { + msg += "; cli configs\n" + cliKeys.forEach(function (k) { + if (cli[k] && typeof cli[k] === "object") return + if (k === "argv") return + msg += k + " = " + JSON.stringify(cli[k]) + "\n" + }) + msg += "\n" + } + + // env configs + var env = npm.config.sources.env.data + , envKeys = getKeys(env) + if (envKeys.length) { + msg += "; environment configs\n" + envKeys.forEach(function (k) { + if (env[k] !== npm.config.get(k)) { + if (!long) return + msg += "; " + k + " = " + JSON.stringify(env[k]) + + " (overridden)\n" + } else msg += k + " = " + JSON.stringify(env[k]) + "\n" + }) + msg += "\n" + } + + // user config file + var uconf = npm.config.sources.user.data + , uconfKeys = getKeys(uconf) + if (uconfKeys.length) { + msg += "; userconfig " + npm.config.get("userconfig") + "\n" + uconfKeys.forEach(function (k) { + var val = (k.charAt(0) === "_") + ? "---sekretz---" + : JSON.stringify(uconf[k]) + if (uconf[k] !== npm.config.get(k)) { + if (!long) return + msg += "; " + k + " = " + val + + " (overridden)\n" + } else msg += k + " = " + val + "\n" + }) + msg += "\n" + } + + // global config file + var gconf = npm.config.sources.global.data + , gconfKeys = getKeys(gconf) + if (gconfKeys.length) { + msg += "; globalconfig " + npm.config.get("globalconfig") + "\n" + gconfKeys.forEach(function (k) { + var val = (k.charAt(0) === "_") + ? "---sekretz---" + : JSON.stringify(gconf[k]) + if (gconf[k] !== npm.config.get(k)) { + if (!long) return + msg += "; " + k + " = " + val + + " (overridden)\n" + } else msg += k + " = " + val + "\n" + }) + msg += "\n" + } + + // builtin config file + var builtin = npm.config.sources.builtin || {} + if (builtin && builtin.data) { + var bconf = builtin.data + , bpath = builtin.path + , bconfKeys = getKeys(bconf) + if (bconfKeys.length) { + msg += "; builtin config " + bpath + "\n" + bconfKeys.forEach(function (k) { + var val = (k.charAt(0) === "_") + ? "---sekretz---" + : JSON.stringify(bconf[k]) + if (bconf[k] !== npm.config.get(k)) { + if (!long) return + msg += "; " + k + " = " + val + + " (overridden)\n" + } else msg += k + " = " + val + "\n" + }) + msg += "\n" + } + } + + // only show defaults if --long + if (!long) { + msg += "; node bin location = " + process.execPath + "\n" + + "; cwd = " + process.cwd() + "\n" + + "; HOME = " + process.env.HOME + "\n" + + "; 'npm config ls -l' to show all defaults.\n" + + console.log(msg) + return cb() + } + + var defaults = npmconf.defaults + , defKeys = getKeys(defaults) + msg += "; default values\n" + defKeys.forEach(function (k) { + if (defaults[k] && typeof defaults[k] === "object") return + var val = JSON.stringify(defaults[k]) + if (defaults[k] !== npm.config.get(k)) { + msg += "; " + k + " = " + val + + " (overridden)\n" + } else msg += k + " = " + val + "\n" + }) + msg += "\n" + + console.log(msg) + return cb() +} + +function unknown (action, cb) { + cb("Usage:\n" + config.usage) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/config/clear-credentials-by-uri.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/config/clear-credentials-by-uri.js new file mode 100644 index 00000000..88131f7a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/config/clear-credentials-by-uri.js @@ -0,0 +1,16 @@ +var assert = require("assert") + +var toNerfDart = require("./nerf-dart.js") + +module.exports = clearCredentialsByURI + +function clearCredentialsByURI (uri) { + assert(uri && typeof uri === "string", "registry URL is required") + + var nerfed = toNerfDart(uri) + + this.del(nerfed + ":_authToken", "user") + this.del(nerfed + ":_password", "user") + this.del(nerfed + ":username", "user") + this.del(nerfed + ":email", "user") +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/config/core.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/config/core.js new file mode 100644 index 00000000..f11a98df --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/config/core.js @@ -0,0 +1,441 @@ + +var CC = require("config-chain").ConfigChain +var inherits = require("inherits") +var configDefs = require("./defaults.js") +var types = configDefs.types +var once = require("once") +var fs = require("fs") +var path = require("path") +var nopt = require("nopt") +var ini = require("ini") +var Umask = configDefs.Umask +var mkdirp = require("mkdirp") +var umask = require("../utils/umask") + +exports.load = load +exports.Conf = Conf +exports.loaded = false +exports.rootConf = null +exports.usingBuiltin = false +exports.defs = configDefs + +Object.defineProperty(exports, "defaults", { get: function () { + return configDefs.defaults +}, enumerable: true }) + +Object.defineProperty(exports, "types", { get: function () { + return configDefs.types +}, enumerable: true }) + +exports.validate = validate + +var myUid = process.env.SUDO_UID !== undefined + ? process.env.SUDO_UID : (process.getuid && process.getuid()) +var myGid = process.env.SUDO_GID !== undefined + ? process.env.SUDO_GID : (process.getgid && process.getgid()) + + +var loading = false +var loadCbs = [] +function load () { + var cli, builtin, cb + for (var i = 0; i < arguments.length; i++) + switch (typeof arguments[i]) { + case "string": builtin = arguments[i]; break + case "object": cli = arguments[i]; break + case "function": cb = arguments[i]; break + } + + if (!cb) + cb = function () {} + + if (exports.loaded) { + var ret = exports.loaded + if (cli) { + ret = new Conf(ret) + ret.unshift(cli) + } + return process.nextTick(cb.bind(null, null, ret)) + } + + // either a fresh object, or a clone of the passed in obj + if (!cli) + cli = {} + else + cli = Object.keys(cli).reduce(function (c, k) { + c[k] = cli[k] + return c + }, {}) + + loadCbs.push(cb) + if (loading) + return + + loading = true + + cb = once(function (er, conf) { + if (!er) { + exports.loaded = conf + loading = false + } + loadCbs.forEach(function (fn) { + fn(er, conf) + }) + loadCbs.length = 0 + }) + + // check for a builtin if provided. + exports.usingBuiltin = !!builtin + var rc = exports.rootConf = new Conf() + if (builtin) + rc.addFile(builtin, "builtin") + else + rc.add({}, "builtin") + + rc.on("load", function () { + load_(builtin, rc, cli, cb) + }) + rc.on("error", cb) +} + +function load_(builtin, rc, cli, cb) { + var defaults = configDefs.defaults + var conf = new Conf(rc) + + conf.usingBuiltin = !!builtin + conf.add(cli, "cli") + conf.addEnv() + + conf.loadPrefix(function(er) { + if (er) + return cb(er) + + // If you're doing `npm --userconfig=~/foo.npmrc` then you'd expect + // that ~/.npmrc won't override the stuff in ~/foo.npmrc (or, indeed + // be used at all). + // + // However, if the cwd is ~, then ~/.npmrc is the home for the project + // config, and will override the userconfig. + // + // If you're not setting the userconfig explicitly, then it will be loaded + // twice, which is harmless but excessive. If you *are* setting the + // userconfig explicitly then it will override your explicit intent, and + // that IS harmful and unexpected. + // + // Solution: Do not load project config file that is the same as either + // the default or resolved userconfig value. npm will log a "verbose" + // message about this when it happens, but it is a rare enough edge case + // that we don't have to be super concerned about it. + var projectConf = path.resolve(conf.localPrefix, ".npmrc") + var defaultUserConfig = rc.get("userconfig") + var resolvedUserConfig = conf.get("userconfig") + if (!conf.get("global") && + projectConf !== defaultUserConfig && + projectConf !== resolvedUserConfig) { + conf.addFile(projectConf, "project") + conf.once("load", afterPrefix) + } else { + conf.add({}, "project") + afterPrefix() + } + }) + + function afterPrefix() { + conf.addFile(conf.get("userconfig"), "user") + conf.once("error", cb) + conf.once("load", afterUser) + } + + function afterUser () { + // globalconfig and globalignorefile defaults + // need to respond to the 'prefix' setting up to this point. + // Eg, `npm config get globalconfig --prefix ~/local` should + // return `~/local/etc/npmrc` + // annoying humans and their expectations! + if (conf.get("prefix")) { + var etc = path.resolve(conf.get("prefix"), "etc") + mkdirp(etc, function (err) { + defaults.globalconfig = path.resolve(etc, "npmrc") + defaults.globalignorefile = path.resolve(etc, "npmignore") + afterUserContinuation() + }) + } else { + afterUserContinuation() + } + } + + function afterUserContinuation() { + conf.addFile(conf.get("globalconfig"), "global") + + // move the builtin into the conf stack now. + conf.root = defaults + conf.add(rc.shift(), "builtin") + conf.once("load", function () { + conf.loadExtras(afterExtras) + }) + } + + function afterExtras(er) { + if (er) + return cb(er) + + // warn about invalid bits. + validate(conf) + + var cafile = conf.get("cafile") + + if (cafile) { + return conf.loadCAFile(cafile, finalize) + } + + finalize() + } + + function finalize(er) { + if (er) { + return cb(er) + } + + exports.loaded = conf + cb(er, conf) + } +} + +// Basically the same as CC, but: +// 1. Always ini +// 2. Parses environment variable names in field values +// 3. Field values that start with ~/ are replaced with process.env.HOME +// 4. Can inherit from another Conf object, using it as the base. +inherits(Conf, CC) +function Conf (base) { + if (!(this instanceof Conf)) + return new Conf(base) + + CC.apply(this) + + if (base) + if (base instanceof Conf) + this.root = base.list[0] || base.root + else + this.root = base + else + this.root = configDefs.defaults +} + +Conf.prototype.loadPrefix = require("./load-prefix.js") +Conf.prototype.loadCAFile = require("./load-cafile.js") +Conf.prototype.loadUid = require("./load-uid.js") +Conf.prototype.setUser = require("./set-user.js") +Conf.prototype.findPrefix = require("./find-prefix.js") +Conf.prototype.getCredentialsByURI = require("./get-credentials-by-uri.js") +Conf.prototype.setCredentialsByURI = require("./set-credentials-by-uri.js") +Conf.prototype.clearCredentialsByURI = require("./clear-credentials-by-uri.js") + +Conf.prototype.loadExtras = function(cb) { + this.setUser(function(er) { + if (er) + return cb(er) + this.loadUid(function(er) { + if (er) + return cb(er) + // Without prefix, nothing will ever work + mkdirp(this.prefix, cb) + }.bind(this)) + }.bind(this)) +} + +Conf.prototype.save = function (where, cb) { + var target = this.sources[where] + if (!target || !(target.path || target.source) || !target.data) { + if (where !== "builtin") + var er = new Error("bad save target: " + where) + if (cb) { + process.nextTick(cb.bind(null, er)) + return this + } + return this.emit("error", er) + } + + if (target.source) { + var pref = target.prefix || "" + Object.keys(target.data).forEach(function (k) { + target.source[pref + k] = target.data[k] + }) + if (cb) process.nextTick(cb) + return this + } + + var data = ini.stringify(target.data) + + then = then.bind(this) + done = done.bind(this) + this._saving ++ + + var mode = where === "user" ? "0600" : "0666" + if (!data.trim()) { + fs.unlink(target.path, function () { + // ignore the possible error (e.g. the file doesn't exist) + done(null) + }) + } else { + mkdirp(path.dirname(target.path), function (er) { + if (er) + return then(er) + fs.writeFile(target.path, data, "utf8", function (er) { + if (er) + return then(er) + if (where === "user" && myUid && myGid) + fs.chown(target.path, +myUid, +myGid, then) + else + then() + }) + }) + } + + function then (er) { + if (er) + return done(er) + fs.chmod(target.path, mode, done) + } + + function done (er) { + if (er) { + if (cb) return cb(er) + else return this.emit("error", er) + } + this._saving -- + if (this._saving === 0) { + if (cb) cb() + this.emit("save") + } + } + + return this +} + +Conf.prototype.addFile = function (file, name) { + name = name || file + var marker = {__source__:name} + this.sources[name] = { path: file, type: "ini" } + this.push(marker) + this._await() + fs.readFile(file, "utf8", function (er, data) { + if (er) // just ignore missing files. + return this.add({}, marker) + this.addString(data, file, "ini", marker) + }.bind(this)) + return this +} + +// always ini files. +Conf.prototype.parse = function (content, file) { + return CC.prototype.parse.call(this, content, file, "ini") +} + +Conf.prototype.add = function (data, marker) { + try { + Object.keys(data).forEach(function (k) { + data[k] = parseField(data[k], k) + }) + } + catch (e) { + this.emit("error", e) + return this + } + return CC.prototype.add.call(this, data, marker) +} + +Conf.prototype.addEnv = function (env) { + env = env || process.env + var conf = {} + Object.keys(env) + .filter(function (k) { return k.match(/^npm_config_/i) }) + .forEach(function (k) { + if (!env[k]) + return + + // leave first char untouched, even if + // it is a "_" - convert all other to "-" + var p = k.toLowerCase() + .replace(/^npm_config_/, "") + .replace(/(?!^)_/g, "-") + conf[p] = env[k] + }) + return CC.prototype.addEnv.call(this, "", conf, "env") +} + +function parseField (f, k) { + if (typeof f !== "string" && !(f instanceof String)) + return f + + // type can be an array or single thing. + var typeList = [].concat(types[k]) + var isPath = -1 !== typeList.indexOf(path) + var isBool = -1 !== typeList.indexOf(Boolean) + var isString = -1 !== typeList.indexOf(String) + var isUmask = -1 !== typeList.indexOf(Umask) + var isNumber = -1 !== typeList.indexOf(Number) + + f = (""+f).trim() + + if (f.match(/^".*"$/)) { + try { + f = JSON.parse(f) + } + catch (e) { + throw new Error("Failed parsing JSON config key " + k + ": " + f) + } + } + + if (isBool && !isString && f === "") + return true + + switch (f) { + case "true": return true + case "false": return false + case "null": return null + case "undefined": return undefined + } + + f = envReplace(f) + + if (isPath) { + var homePattern = process.platform === "win32" ? /^~(\/|\\)/ : /^~\// + if (f.match(homePattern) && process.env.HOME) { + f = path.resolve(process.env.HOME, f.substr(2)) + } + f = path.resolve(f) + } + + if (isUmask) + f = umask.fromString(f) + + if (isNumber && !isNaN(f)) + f = +f + + return f +} + +function envReplace (f) { + if (typeof f !== "string" || !f) return f + + // replace any ${ENV} values with the appropriate environ. + var envExpr = /(\\*)\$\{([^}]+)\}/g + return f.replace(envExpr, function (orig, esc, name) { + esc = esc.length && esc.length % 2 + if (esc) + return orig + if (undefined === process.env[name]) + throw new Error("Failed to replace env in config: "+orig) + return process.env[name] + }) +} + +function validate (cl) { + // warn about invalid configs at every level. + cl.list.forEach(function (conf) { + nopt.clean(conf, configDefs.types) + }) + + nopt.clean(cl.root, configDefs.types) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/config/defaults.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/config/defaults.js new file mode 100644 index 00000000..3abc81ed --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/config/defaults.js @@ -0,0 +1,380 @@ +// defaults, types, and shorthands. + + +var path = require("path") + , url = require("url") + , Stream = require("stream").Stream + , semver = require("semver") + , stableFamily = semver.parse(process.version) + , nopt = require("nopt") + , os = require("os") + , osenv = require("osenv") + , umask = require("../utils/umask") + +var log +try { + log = require("npmlog") +} catch (er) { + var util = require("util") + log = { warn: function (m) { + console.warn(m + " " + util.format.apply(util, [].slice.call(arguments, 1))) + } } +} + +exports.Umask = Umask +function Umask () {} +function validateUmask (data, k, val) { + return umask.validate(data, k, val) +} + +function validateSemver (data, k, val) { + if (!semver.valid(val)) return false + data[k] = semver.valid(val) +} + +function validateStream (data, k, val) { + if (!(val instanceof Stream)) return false + data[k] = val +} + +nopt.typeDefs.semver = { type: semver, validate: validateSemver } +nopt.typeDefs.Stream = { type: Stream, validate: validateStream } +nopt.typeDefs.Umask = { type: Umask, validate: validateUmask } + +nopt.invalidHandler = function (k, val, type) { + log.warn("invalid config", k + "=" + JSON.stringify(val)) + + if (Array.isArray(type)) { + if (type.indexOf(url) !== -1) type = url + else if (type.indexOf(path) !== -1) type = path + } + + switch (type) { + case Umask: + log.warn("invalid config", "Must be umask, octal number in range 0000..0777") + break + case url: + log.warn("invalid config", "Must be a full url with 'http://'") + break + case path: + log.warn("invalid config", "Must be a valid filesystem path") + break + case Number: + log.warn("invalid config", "Must be a numeric value") + break + case Stream: + log.warn("invalid config", "Must be an instance of the Stream class") + break + } +} + +if (!stableFamily || (+stableFamily.minor % 2)) stableFamily = null +else stableFamily = stableFamily.major + "." + stableFamily.minor + +var defaults + +var temp = osenv.tmpdir() +var home = osenv.home() + +var uidOrPid = process.getuid ? process.getuid() : process.pid + +if (home) process.env.HOME = home +else home = path.resolve(temp, "npm-" + uidOrPid) + +var cacheExtra = process.platform === "win32" ? "npm-cache" : ".npm" +var cacheRoot = process.platform === "win32" && process.env.APPDATA || home +var cache = path.resolve(cacheRoot, cacheExtra) + + +var globalPrefix +Object.defineProperty(exports, "defaults", {get: function () { + if (defaults) return defaults + + if (process.env.PREFIX) { + globalPrefix = process.env.PREFIX + } else if (process.platform === "win32") { + // c:\node\node.exe --> prefix=c:\node\ + globalPrefix = path.dirname(process.execPath) + } else { + // /usr/local/bin/node --> prefix=/usr/local + globalPrefix = path.dirname(path.dirname(process.execPath)) + + // destdir only is respected on Unix + if (process.env.DESTDIR) { + globalPrefix = path.join(process.env.DESTDIR, globalPrefix) + } + } + + defaults = { + access : null + , "always-auth" : false + + , "bin-links" : true + , browser : null + + , ca: null + , cafile: null + + , cache : cache + + , "cache-lock-stale": 60000 + , "cache-lock-retries": 10 + , "cache-lock-wait": 10000 + + , "cache-max": Infinity + , "cache-min": 10 + + , cert: null + + , color : true + , depth: Infinity + , description : true + , dev : false + , editor : osenv.editor() + , "engine-strict": false + , force : false + + , "fetch-retries": 2 + , "fetch-retry-factor": 10 + , "fetch-retry-mintimeout": 10000 + , "fetch-retry-maxtimeout": 60000 + + , git: "git" + , "git-tag-version": true + + , global : false + , globalconfig : path.resolve(globalPrefix, "etc", "npmrc") + , group : process.platform === "win32" ? 0 + : process.env.SUDO_GID || (process.getgid && process.getgid()) + , heading: "npm" + , "if-present": false + , "ignore-scripts": false + , "init-module": path.resolve(home, ".npm-init.js") + , "init-author-name" : "" + , "init-author-email" : "" + , "init-author-url" : "" + , "init-version": "1.0.0" + , "init-license": "ISC" + , json: false + , key: null + , link: false + , "local-address" : undefined + , loglevel : "warn" + , logstream : process.stderr + , long : false + , maxsockets : 50 + , message : "%s" + , "node-version" : process.version + , npat : false + , "onload-script" : false + , optional: true + , parseable : false + , prefix : globalPrefix + , production: process.env.NODE_ENV === "production" + , "proprietary-attribs": true + , proxy : null + , "https-proxy" : null + , "user-agent" : "npm/{npm-version} " + + "node/{node-version} " + + "{platform} " + + "{arch}" + , "rebuild-bundle" : true + , registry : "https://registry.npmjs.org/" + , rollback : true + , save : false + , "save-bundle": false + , "save-dev" : false + , "save-exact" : false + , "save-optional" : false + , "save-prefix": "^" + , scope : "" + , searchopts: "" + , searchexclude: null + , searchsort: "name" + , shell : osenv.shell() + , shrinkwrap: true + , "sign-git-tag": false + , spin: true + , "strict-ssl": true + , tag : "latest" + , "tag-version-prefix" : "v" + , tmp : temp + , unicode : true + , "unsafe-perm" : process.platform === "win32" + || process.platform === "cygwin" + || !( process.getuid && process.setuid + && process.getgid && process.setgid ) + || process.getuid() !== 0 + , usage : false + , user : process.platform === "win32" ? 0 : "nobody" + , userconfig : path.resolve(home, ".npmrc") + , umask: process.umask ? process.umask() : umask.fromString("022") + , version : false + , versions : false + , viewer: process.platform === "win32" ? "browser" : "man" + + , _exit : true + } + + return defaults +}}) + +exports.types = + { access : [null, "restricted", "public"] + , "always-auth" : Boolean + , "bin-links": Boolean + , browser : [null, String] + , ca: [null, String, Array] + , cafile : path + , cache : path + , "cache-lock-stale": Number + , "cache-lock-retries": Number + , "cache-lock-wait": Number + , "cache-max": Number + , "cache-min": Number + , cert: [null, String] + , color : ["always", Boolean] + , depth : Number + , description : Boolean + , dev : Boolean + , editor : String + , "engine-strict": Boolean + , force : Boolean + , "fetch-retries": Number + , "fetch-retry-factor": Number + , "fetch-retry-mintimeout": Number + , "fetch-retry-maxtimeout": Number + , git: String + , "git-tag-version": Boolean + , global : Boolean + , globalconfig : path + , group : [Number, String] + , "https-proxy" : [null, url] + , "user-agent" : String + , "heading": String + , "if-present": Boolean + , "ignore-scripts": Boolean + , "init-module": path + , "init-author-name" : String + , "init-author-email" : String + , "init-author-url" : ["", url] + , "init-license": String + , "init-version": semver + , json: Boolean + , key: [null, String] + , link: Boolean + // local-address must be listed as an IP for a local network interface + // must be IPv4 due to node bug + , "local-address" : getLocalAddresses() + , loglevel : ["silent", "error", "warn", "http", "info", "verbose", "silly"] + , logstream : Stream + , long : Boolean + , maxsockets : Number + , message: String + , "node-version" : [null, semver] + , npat : Boolean + , "onload-script" : [null, String] + , optional: Boolean + , parseable : Boolean + , prefix: path + , production: Boolean + , "proprietary-attribs": Boolean + , proxy : [null, false, url] // allow proxy to be disabled explicitly + , "rebuild-bundle" : Boolean + , registry : [null, url] + , rollback : Boolean + , save : Boolean + , "save-bundle": Boolean + , "save-dev" : Boolean + , "save-exact" : Boolean + , "save-optional" : Boolean + , "save-prefix": String + , scope : String + , searchopts : String + , searchexclude: [null, String] + , searchsort: [ "name", "-name" + , "description", "-description" + , "author", "-author" + , "date", "-date" + , "keywords", "-keywords" ] + , shell : String + , shrinkwrap: Boolean + , "sign-git-tag": Boolean + , spin: ["always", Boolean] + , "strict-ssl": Boolean + , tag : String + , tmp : path + , unicode : Boolean + , "unsafe-perm" : Boolean + , usage : Boolean + , user : [Number, String] + , userconfig : path + , umask: Umask + , version : Boolean + , "tag-version-prefix" : String + , versions : Boolean + , viewer: String + , _exit : Boolean + } + +function getLocalAddresses () { + var interfaces + // #8094: some environments require elevated permissions to enumerate + // interfaces, and synchronously throw EPERM when run without + // elevated privileges + try { + interfaces = os.networkInterfaces() + } catch (e) { + interfaces = {} + } + + return Object.keys(interfaces).map(function (nic) { + return interfaces[nic].filter(function (addr) { + return addr.family === 'IPv4' + }) + .map(function (addr) { + return addr.address + }) + }).reduce(function (curr, next) { + return curr.concat(next) + }, []).concat(undefined) +} + +exports.shorthands = + { s : ["--loglevel", "silent"] + , d : ["--loglevel", "info"] + , dd : ["--loglevel", "verbose"] + , ddd : ["--loglevel", "silly"] + , noreg : ["--no-registry"] + , N : ["--no-registry"] + , reg : ["--registry"] + , "no-reg" : ["--no-registry"] + , silent : ["--loglevel", "silent"] + , verbose : ["--loglevel", "verbose"] + , quiet: ["--loglevel", "warn"] + , q: ["--loglevel", "warn"] + , h : ["--usage"] + , H : ["--usage"] + , "?" : ["--usage"] + , help : ["--usage"] + , v : ["--version"] + , f : ["--force"] + , gangster : ["--force"] + , gangsta : ["--force"] + , desc : ["--description"] + , "no-desc" : ["--no-description"] + , "local" : ["--no-global"] + , l : ["--long"] + , m : ["--message"] + , p : ["--parseable"] + , porcelain : ["--parseable"] + , g : ["--global"] + , S : ["--save"] + , D : ["--save-dev"] + , E : ["--save-exact"] + , O : ["--save-optional"] + , y : ["--yes"] + , n : ["--no-yes"] + , B : ["--save-bundle"] + , C : ["--prefix"] + } diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/config/find-prefix.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/config/find-prefix.js new file mode 100644 index 00000000..bb00cd6b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/config/find-prefix.js @@ -0,0 +1,56 @@ +// try to find the most reasonable prefix to use + +module.exports = findPrefix + +var fs = require("fs") +var path = require("path") + +function findPrefix (p, cb_) { + function cb (er, p) { + process.nextTick(function () { + cb_(er, p) + }) + } + + p = path.resolve(p) + // if there's no node_modules folder, then + // walk up until we hopefully find one. + // if none anywhere, then use cwd. + var walkedUp = false + while (path.basename(p) === "node_modules") { + p = path.dirname(p) + walkedUp = true + } + if (walkedUp) return cb(null, p) + + findPrefix_(p, p, cb) +} + +function findPrefix_ (p, original, cb) { + if (p === "/" + || (process.platform === "win32" && p.match(/^[a-zA-Z]:(\\|\/)?$/))) { + return cb(null, original) + } + fs.readdir(p, function (er, files) { + // an error right away is a bad sign. + // unless the prefix was simply a non + // existent directory. + if (er && p === original) { + if (er.code === "ENOENT") return cb(null, original); + return cb(er) + } + + // walked up too high or something. + if (er) return cb(null, original) + + if (files.indexOf("node_modules") !== -1 + || files.indexOf("package.json") !== -1) { + return cb(null, p) + } + + var d = path.dirname(p) + if (d === p) return cb(null, original) + + return findPrefix_(d, original, cb) + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/config/get-credentials-by-uri.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/config/get-credentials-by-uri.js new file mode 100644 index 00000000..4122f4ce --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/config/get-credentials-by-uri.js @@ -0,0 +1,74 @@ +var assert = require("assert") + +var toNerfDart = require("./nerf-dart.js") + +module.exports = getCredentialsByURI + +function getCredentialsByURI (uri) { + assert(uri && typeof uri === "string", "registry URL is required") + var nerfed = toNerfDart(uri) + var defnerf = toNerfDart(this.get("registry")) + + // hidden class micro-optimization + var c = { + scope : nerfed, + token : undefined, + password : undefined, + username : undefined, + email : undefined, + auth : undefined, + alwaysAuth : undefined + } + + // used to override scope matching for tokens as well as legacy auth + if (this.get(nerfed + ':always-auth') !== undefined) { + var val = this.get(nerfed + ':always-auth') + c.alwaysAuth = val === 'false' ? false : !!val + } else if (this.get('always-auth') !== undefined) { + c.alwaysAuth = this.get('always-auth') + } + + if (this.get(nerfed + ':_authToken')) { + c.token = this.get(nerfed + ':_authToken') + // the bearer token is enough, don't confuse things + return c + } + + // Handle the old-style _auth= style for the default + // registry, if set. + // + // XXX(isaacs): Remove when npm 1.4 is no longer relevant + var authDef = this.get("_auth") + var userDef = this.get("username") + var passDef = this.get("_password") + if (authDef && !(userDef && passDef)) { + authDef = new Buffer(authDef, "base64").toString() + authDef = authDef.split(":") + userDef = authDef.shift() + passDef = authDef.join(":") + } + + if (this.get(nerfed + ":_password")) { + c.password = new Buffer(this.get(nerfed + ":_password"), "base64").toString("utf8") + } else if (nerfed === defnerf && passDef) { + c.password = passDef + } + + if (this.get(nerfed + ":username")) { + c.username = this.get(nerfed + ":username") + } else if (nerfed === defnerf && userDef) { + c.username = userDef + } + + if (this.get(nerfed + ":email")) { + c.email = this.get(nerfed + ":email") + } else if (this.get("email")) { + c.email = this.get("email") + } + + if (c.username && c.password) { + c.auth = new Buffer(c.username + ":" + c.password).toString("base64") + } + + return c +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/config/load-cafile.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/config/load-cafile.js new file mode 100644 index 00000000..cc63615f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/config/load-cafile.js @@ -0,0 +1,34 @@ +module.exports = loadCAFile + +var fs = require("fs") + +function loadCAFile(cafilePath, cb) { + if (!cafilePath) + return process.nextTick(cb) + + fs.readFile(cafilePath, "utf8", afterCARead.bind(this)) + + function afterCARead(er, cadata) { + + if (er) { + // previous cafile no longer exists, so just continue on gracefully + if (er.code === 'ENOENT') return cb() + return cb(er) + } + + var delim = "-----END CERTIFICATE-----" + var output + + output = cadata + .split(delim) + .filter(function(xs) { + return !!xs.trim() + }) + .map(function(xs) { + return xs.trimLeft() + delim + }) + + this.set("ca", output) + cb(null) + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/config/load-prefix.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/config/load-prefix.js new file mode 100644 index 00000000..39d076fb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/config/load-prefix.js @@ -0,0 +1,49 @@ +module.exports = loadPrefix + +var findPrefix = require("./find-prefix.js") +var path = require("path") + +function loadPrefix (cb) { + var cli = this.list[0] + + Object.defineProperty(this, "prefix", + { set : function (prefix) { + var g = this.get("global") + this[g ? "globalPrefix" : "localPrefix"] = prefix + }.bind(this) + , get : function () { + var g = this.get("global") + return g ? this.globalPrefix : this.localPrefix + }.bind(this) + , enumerable : true + }) + + Object.defineProperty(this, "globalPrefix", + { set : function (prefix) { + this.set("prefix", prefix) + }.bind(this) + , get : function () { + return path.resolve(this.get("prefix")) + }.bind(this) + , enumerable : true + }) + + var p + Object.defineProperty(this, "localPrefix", + { set : function (prefix) { p = prefix }, + get : function () { return p } + , enumerable: true }) + + // try to guess at a good node_modules location. + // If we are *explicitly* given a prefix on the cli, then + // always use that. otherwise, infer local prefix from cwd. + if (Object.prototype.hasOwnProperty.call(cli, "prefix")) { + p = path.resolve(cli.prefix) + process.nextTick(cb) + } else { + findPrefix(process.cwd(), function (er, found) { + p = found + cb(er) + }) + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/config/load-uid.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/config/load-uid.js new file mode 100644 index 00000000..3ca79877 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/config/load-uid.js @@ -0,0 +1,15 @@ +module.exports = loadUid + +var getUid = require("uid-number") + +// Call in the context of a npmconf object + +function loadUid (cb) { + // if we're not in unsafe-perm mode, then figure out who + // to run stuff as. Do this first, to support `npm update npm -g` + if (!this.get("unsafe-perm")) { + getUid(this.get("user"), this.get("group"), cb) + } else { + process.nextTick(cb) + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/config/nerf-dart.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/config/nerf-dart.js new file mode 100644 index 00000000..07c81750 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/config/nerf-dart.js @@ -0,0 +1,23 @@ +var url = require("url") + +module.exports = toNerfDart + +/** + * Maps a URL to an identifier. + * + * Name courtesy schiffertronix media LLC, a New Jersey corporation + * + * @param {String} uri The URL to be nerfed. + * + * @returns {String} A nerfed URL. + */ +function toNerfDart(uri) { + var parsed = url.parse(uri) + delete parsed.protocol + delete parsed.auth + delete parsed.query + delete parsed.search + delete parsed.hash + + return url.resolve(url.format(parsed), ".") +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/config/set-credentials-by-uri.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/config/set-credentials-by-uri.js new file mode 100644 index 00000000..31eab447 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/config/set-credentials-by-uri.js @@ -0,0 +1,42 @@ +var assert = require("assert") + +var toNerfDart = require("./nerf-dart.js") + +module.exports = setCredentialsByURI + +function setCredentialsByURI (uri, c) { + assert(uri && typeof uri === "string", "registry URL is required") + assert(c && typeof c === "object", "credentials are required") + + var nerfed = toNerfDart(uri) + + if (c.token) { + this.set(nerfed + ":_authToken", c.token, "user") + this.del(nerfed + ":_password", "user") + this.del(nerfed + ":username", "user") + this.del(nerfed + ":email", "user") + this.del(nerfed + ":always-auth", "user") + } + else if (c.username || c.password || c.email) { + assert(c.username, "must include username") + assert(c.password, "must include password") + assert(c.email, "must include email address") + + this.del(nerfed + ":_authToken", "user") + + var encoded = new Buffer(c.password, "utf8").toString("base64") + this.set(nerfed + ":_password", encoded, "user") + this.set(nerfed + ":username", c.username, "user") + this.set(nerfed + ":email", c.email, "user") + + if (c.alwaysAuth !== undefined) { + this.set(nerfed + ":always-auth", c.alwaysAuth, "user") + } + else { + this.del(nerfed + ":always-auth", "user") + } + } + else { + throw new Error("No credentials to set.") + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/config/set-user.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/config/set-user.js new file mode 100644 index 00000000..4c207a67 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/config/set-user.js @@ -0,0 +1,29 @@ +module.exports = setUser + +var assert = require("assert") +var path = require("path") +var fs = require("fs") +var mkdirp = require("mkdirp") + +function setUser (cb) { + var defaultConf = this.root + assert(defaultConf !== Object.prototype) + + // If global, leave it as-is. + // If not global, then set the user to the owner of the prefix folder. + // Just set the default, so it can be overridden. + if (this.get("global")) return cb() + if (process.env.SUDO_UID) { + defaultConf.user = +(process.env.SUDO_UID) + return cb() + } + + var prefix = path.resolve(this.get("prefix")) + mkdirp(prefix, function (er) { + if (er) return cb(er) + fs.stat(prefix, function (er, st) { + defaultConf.user = st && st.uid + return cb(er) + }) + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/dedupe.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/dedupe.js new file mode 100644 index 00000000..c63705e1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/dedupe.js @@ -0,0 +1,375 @@ +// traverse the node_modules/package.json tree +// looking for duplicates. If any duplicates are found, +// then move them up to the highest level necessary +// in order to make them no longer duplicated. +// +// This is kind of ugly, and really highlights the need for +// much better "put pkg X at folder Y" abstraction. Oh well, +// whatever. Perfect enemy of the good, and all that. + +var fs = require("fs") +var asyncMap = require("slide").asyncMap +var path = require("path") +var readJson = require("read-package-json") +var semver = require("semver") +var rm = require("./utils/gently-rm.js") +var log = require("npmlog") +var npm = require("./npm.js") +var mapToRegistry = require("./utils/map-to-registry.js") + +module.exports = dedupe + +dedupe.usage = "npm dedupe [pkg pkg...]" + +function dedupe (args, silent, cb) { + if (typeof silent === "function") cb = silent, silent = false + var dryrun = false + if (npm.command.match(/^find/)) dryrun = true + return dedupe_(npm.prefix, args, {}, dryrun, silent, cb) +} + +function dedupe_ (dir, filter, unavoidable, dryrun, silent, cb) { + readInstalled(path.resolve(dir), {}, null, function (er, data, counter) { + if (er) { + return cb(er) + } + + if (!data) { + return cb() + } + + // find out which things are dupes + var dupes = Object.keys(counter || {}).filter(function (k) { + if (filter.length && -1 === filter.indexOf(k)) return false + return counter[k] > 1 && !unavoidable[k] + }).reduce(function (s, k) { + s[k] = [] + return s + }, {}) + + // any that are unavoidable need to remain as they are. don't even + // try to touch them or figure it out. Maybe some day, we can do + // something a bit more clever here, but for now, just skip over it, + // and all its children. + ;(function U (obj) { + if (unavoidable[obj.name]) { + obj.unavoidable = true + } + if (obj.parent && obj.parent.unavoidable) { + obj.unavoidable = true + } + Object.keys(obj.children).forEach(function (k) { + U(obj.children[k]) + }) + })(data) + + // then collect them up and figure out who needs them + ;(function C (obj) { + if (dupes[obj.name] && !obj.unavoidable) { + dupes[obj.name].push(obj) + obj.duplicate = true + } + obj.dependents = whoDepends(obj) + Object.keys(obj.children).forEach(function (k) { + C(obj.children[k]) + }) + })(data) + + if (dryrun) { + var k = Object.keys(dupes) + if (!k.length) return cb() + return npm.commands.ls(k, silent, cb) + } + + var summary = Object.keys(dupes).map(function (n) { + return [n, dupes[n].filter(function (d) { + return d && d.parent && !d.parent.duplicate && !d.unavoidable + }).map(function M (d) { + return [d.path, d.version, d.dependents.map(function (k) { + return [k.path, k.version, k.dependencies[d.name] || ""] + })] + })] + }).map(function (item) { + var set = item[1] + + var ranges = set.map(function (i) { + return i[2].map(function (d) { + return d[2] + }) + }).reduce(function (l, r) { + return l.concat(r) + }, []).map(function (v, i, set) { + if (set.indexOf(v) !== i) return false + return v + }).filter(function (v) { + return v !== false + }) + + var locs = set.map(function (i) { + return i[0] + }) + + var versions = set.map(function (i) { + return i[1] + }).filter(function (v, i, set) { + return set.indexOf(v) === i + }) + + var has = set.map(function (i) { + return [i[0], i[1]] + }).reduce(function (set, kv) { + set[kv[0]] = kv[1] + return set + }, {}) + + var loc = locs.length ? locs.reduce(function (a, b) { + // a=/path/to/node_modules/foo/node_modules/bar + // b=/path/to/node_modules/elk/node_modules/bar + // ==/path/to/node_modules/bar + var nmReg = new RegExp("\\" + path.sep + "node_modules\\" + path.sep) + a = a.split(nmReg) + b = b.split(nmReg) + var name = a.pop() + b.pop() + // find the longest chain that both A and B share. + // then push the name back on it, and join by /node_modules/ + for (var i = 0, al = a.length, bl = b.length; i < al && i < bl && a[i] === b[i]; i++); + return a.slice(0, i).concat(name).join(path.sep + "node_modules" + path.sep) + }) : undefined + + return [item[0], { item: item + , ranges: ranges + , locs: locs + , loc: loc + , has: has + , versions: versions + }] + }).filter(function (i) { + return i[1].loc + }) + + findVersions(npm, summary, function (er, set) { + if (er) return cb(er) + if (!set.length) return cb() + installAndRetest(set, filter, dir, unavoidable, silent, cb) + }) + }) +} + +function installAndRetest (set, filter, dir, unavoidable, silent, cb) { + //return cb(null, set) + var remove = [] + + asyncMap(set, function (item, cb) { + // [name, has, loc, locMatch, regMatch, others] + var name = item[0] + var has = item[1] + var where = item[2] + var locMatch = item[3] + var regMatch = item[4] + var others = item[5] + + // nothing to be done here. oh well. just a conflict. + if (!locMatch && !regMatch) { + log.warn("unavoidable conflict", item[0], item[1]) + log.warn("unavoidable conflict", "Not de-duplicating") + unavoidable[item[0]] = true + return cb() + } + + // nothing to do except to clean up the extraneous deps + if (locMatch && has[where] === locMatch) { + remove.push.apply(remove, others) + return cb() + } + + if (regMatch) { + var what = name + "@" + regMatch + // where is /path/to/node_modules/foo/node_modules/bar + // for package "bar", but we need it to be just + // /path/to/node_modules/foo + var nmReg = new RegExp("\\" + path.sep + "node_modules\\" + path.sep) + where = where.split(nmReg) + where.pop() + where = where.join(path.sep + "node_modules" + path.sep) + remove.push.apply(remove, others) + + return npm.commands.install(where, what, cb) + } + + // hrm? + return cb(new Error("danger zone\n" + name + " " + + regMatch + " " + locMatch)) + + }, function (er) { + if (er) return cb(er) + asyncMap(remove, rm, function (er) { + if (er) return cb(er) + remove.forEach(function (r) { + log.info("rm", r) + }) + dedupe_(dir, filter, unavoidable, false, silent, cb) + }) + }) +} + +function findVersions (npm, summary, cb) { + // now, for each item in the summary, try to find the maximum version + // that will satisfy all the ranges. next step is to install it at + // the specified location. + asyncMap(summary, function (item, cb) { + var name = item[0] + var data = item[1] + var loc = data.loc + var locs = data.locs.filter(function (l) { + return l !== loc + }) + + // not actually a dupe, or perhaps all the other copies were + // children of a dupe, so this'll maybe be picked up later. + if (locs.length === 0) { + return cb(null, []) + } + + // { : } + var has = data.has + + // the versions that we already have. + // if one of these is ok, then prefer to use that. + // otherwise, try fetching from the registry. + var versions = data.versions + + var ranges = data.ranges + mapToRegistry(name, npm.config, function (er, uri, auth) { + if (er) return cb(er) + + npm.registry.get(uri, { auth : auth }, next) + }) + + function next (er, data) { + var regVersions = er ? [] : Object.keys(data.versions) + var locMatch = bestMatch(versions, ranges) + var tag = npm.config.get("tag") + var distTag = data["dist-tags"] && data["dist-tags"][tag] + + var regMatch + if (distTag && data.versions[distTag] && matches(distTag, ranges)) { + regMatch = distTag + } else { + regMatch = bestMatch(regVersions, ranges) + } + + cb(null, [[name, has, loc, locMatch, regMatch, locs]]) + } + }, cb) +} + +function matches (version, ranges) { + return !ranges.some(function (r) { + return !semver.satisfies(version, r, true) + }) +} + +function bestMatch (versions, ranges) { + return versions.filter(function (v) { + return matches(v, ranges) + }).sort(semver.compareLoose).pop() +} + + +function readInstalled (dir, counter, parent, cb) { + var pkg, children, realpath + + fs.realpath(dir, function (er, rp) { + realpath = rp + next() + }) + + readJson(path.resolve(dir, "package.json"), function (er, data) { + if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) + if (er) return cb() // not a package, probably. + counter[data.name] = counter[data.name] || 0 + counter[data.name]++ + pkg = + { _id: data._id + , name: data.name + , version: data.version + , dependencies: data.dependencies || {} + , optionalDependencies: data.optionalDependencies || {} + , devDependencies: data.devDependencies || {} + , bundledDependencies: data.bundledDependencies || [] + , path: dir + , realPath: dir + , children: {} + , parent: parent + , family: Object.create(parent ? parent.family : null) + , unavoidable: false + , duplicate: false + } + if (parent) { + parent.children[data.name] = pkg + parent.family[data.name] = pkg + } + next() + }) + + fs.readdir(path.resolve(dir, "node_modules"), function (er, c) { + children = children || [] // error is ok, just means no children. + // check if there are scoped packages. + asyncMap(c || [], function (child, cb) { + if (child.indexOf('@') === 0) { + fs.readdir(path.resolve(dir, "node_modules", child), function (er, scopedChildren) { + // error is ok, just means no children. + (scopedChildren || []).forEach(function (sc) { + children.push(path.join(child, sc)) + }) + cb() + }) + } else { + children.push(child) + cb() + } + }, function (er) { + if (er) return cb(er) + children = children.filter(function (p) { + return !p.match(/^[\._-]/) + }) + next(); + }); + }) + + function next () { + if (!children || !pkg || !realpath) return + + // ignore devDependencies. Just leave them where they are. + children = children.filter(function (c) { + return !pkg.devDependencies.hasOwnProperty(c) + }) + + pkg.realPath = realpath + if (pkg.realPath !== pkg.path) children = [] + var d = path.resolve(dir, "node_modules") + asyncMap(children, function (child, cb) { + readInstalled(path.resolve(d, child), counter, pkg, cb) + }, function (er) { + cb(er, pkg, counter) + }) + } +} + +function whoDepends (pkg) { + var start = pkg.parent || pkg + return whoDepends_(pkg, [], start) +} + +function whoDepends_ (pkg, who, test) { + if (test !== pkg && + test.dependencies[pkg.name] && + test.family[pkg.name] === pkg) { + who.push(test) + } + Object.keys(test.children).forEach(function (n) { + whoDepends_(pkg, who, test.children[n]) + }) + return who +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/deprecate.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/deprecate.js new file mode 100644 index 00000000..e6d0dc87 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/deprecate.js @@ -0,0 +1,54 @@ +var npm = require("./npm.js") + , mapToRegistry = require("./utils/map-to-registry.js") + , npa = require("npm-package-arg") + +module.exports = deprecate + +deprecate.usage = "npm deprecate [@] " + +deprecate.completion = function (opts, cb) { + // first, get a list of remote packages this user owns. + // once we have a user account, then don't complete anything. + if (opts.conf.argv.remain.length > 2) return cb() + // get the list of packages by user + var path = "/-/by-user/" + mapToRegistry(path, npm.config, function (er, uri, c) { + if (er) return cb(er) + + if (!(c && c.username)) return cb() + + var params = { + timeout : 60000, + auth : c + } + npm.registry.get(uri + c.username, params, function (er, list) { + if (er) return cb() + console.error(list) + return cb(null, list[c.username]) + }) + }) +} + +function deprecate (args, cb) { + var pkg = args[0] + , msg = args[1] + if (msg === undefined) return cb("Usage: " + deprecate.usage) + + // fetch the data and make sure it exists. + var p = npa(pkg) + + // npa makes the default spec "latest", but for deprecation + // "*" is the appropriate default. + if (p.rawSpec === '') p.spec = '*' + + mapToRegistry(p.name, npm.config, function (er, uri, auth) { + if (er) return cb(er) + + var params = { + version : p.spec, + message : msg, + auth : auth + } + npm.registry.deprecate(uri, params, cb) + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/dist-tag.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/dist-tag.js new file mode 100644 index 00000000..48b40202 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/dist-tag.js @@ -0,0 +1,151 @@ +module.exports = distTag + +var log = require("npmlog") +var npa = require("npm-package-arg") +var semver = require("semver") + +var npm = require("./npm.js") +var mapToRegistry = require("./utils/map-to-registry.js") +var readLocalPkg = require("./utils/read-local-package.js") + +distTag.usage = "npm dist-tag add @ []" + + "\nnpm dist-tag rm " + + "\nnpm dist-tag ls []" + +distTag.completion = function (opts, cb) { + var argv = opts.conf.argv.remain + if (argv.length === 2) { + return cb(null, ["add", "rm", "ls"]) + } + + switch (argv[2]) { + default: + return cb() + } +} + +function distTag (args, cb) { + var cmd = args.shift() + switch (cmd) { + case "add": case "a": case "set": case "s": + return add(args[0], args[1], cb) + case "rm": case "r": case "del": case "d": case "remove": + return remove(args[1], args[0], cb) + case "ls": case "l": case "sl": case "list": + return list(args[0], cb) + default: + return cb("Usage:\n"+distTag.usage) + } +} + +function add (spec, tag, cb) { + var thing = npa(spec || "") + var pkg = thing.name + var version = thing.rawSpec + var t = (tag || npm.config.get("tag")).trim() + + log.verbose("dist-tag add", t, "to", pkg+"@"+version) + + if (!pkg || !version || !t) return cb("Usage:\n"+distTag.usage) + + if (semver.validRange(t)) { + var er = new Error("Tag name must not be a valid SemVer range: " + t) + return cb(er) + } + + fetchTags(pkg, function (er, tags) { + if (er) return cb(er) + + if (tags[t] === version) { + log.warn("dist-tag add", t, "is already set to version", version) + return cb() + } + tags[t] = version + + mapToRegistry(pkg, npm.config, function (er, uri, auth, base) { + var params = { + package : pkg, + distTag : t, + version : version, + auth : auth + } + + npm.registry.distTags.add(base, params, function (er) { + if (er) return cb(er) + + console.log("+"+t+": "+pkg+"@"+version) + cb() + }) + }) + }) +} + +function remove (tag, pkg, cb) { + log.verbose("dist-tag del", tag, "from", pkg) + + fetchTags(pkg, function (er, tags) { + if (er) return cb(er) + + if (!tags[tag]) { + log.info("dist-tag del", tag, "is not a dist-tag on", pkg) + return cb(new Error(tag+" is not a dist-tag on "+pkg)) + } + + var version = tags[tag] + delete tags[tag] + + mapToRegistry(pkg, npm.config, function (er, uri, auth, base) { + var params = { + package : pkg, + distTag : tag, + auth : auth + } + + npm.registry.distTags.rm(base, params, function (er) { + if (er) return cb(er) + + console.log("-"+tag+": "+pkg+"@"+version) + cb() + }) + }) + }) +} + +function list (pkg, cb) { + if (!pkg) return readLocalPkg(function (er, pkg) { + if (er) return cb(er) + if (!pkg) return cb(distTag.usage) + list(pkg, cb) + }) + + fetchTags(pkg, function (er, tags) { + if (er) { + log.error("dist-tag ls", "Couldn't get dist-tag data for", pkg) + return cb(er) + } + var msg = Object.keys(tags).map(function (k) { + return k+": "+tags[k] + }).sort().join("\n") + console.log(msg) + cb(er, tags) + }) +} + +function fetchTags (pkg, cb) { + mapToRegistry(pkg, npm.config, function (er, uri, auth, base) { + if (er) return cb(er) + + var params = { + package : pkg, + auth : auth + } + npm.registry.distTags.fetch(base, params, function (er, tags) { + if (er) return cb(er) + if (!tags || !Object.keys(tags).length) { + return cb(new Error("No dist-tags found for " + pkg)) + } + + cb(null, tags) + }) + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/docs.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/docs.js new file mode 100644 index 00000000..0de2349d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/docs.js @@ -0,0 +1,71 @@ +module.exports = docs + +docs.usage = "npm docs " +docs.usage += "\n" +docs.usage += "npm docs ." + +var npm = require("./npm.js") + , opener = require("opener") + , path = require("path") + , log = require("npmlog") + , mapToRegistry = require("./utils/map-to-registry.js") + +docs.completion = function (opts, cb) { + // FIXME: there used to be registry completion here, but it stopped making + // sense somewhere around 50,000 packages on the registry + cb() +} + +function url (json) { + return json.homepage ? json.homepage : "https://npmjs.org/package/" + json.name +} + +function docs (args, cb) { + args = args || [] + var pending = args.length + if (!pending) return getDoc(".", cb) + args.forEach(function(proj) { + getDoc(proj, function(err) { + if (err) { + return cb(err) + } + --pending || cb() + }) + }) +} + +function getDoc (project, cb) { + project = project || "." + var package = path.resolve(npm.localPrefix, "package.json") + + if (project === "." || project === "./") { + var json + try { + json = require(package) + if (!json.name) throw new Error('package.json does not have a valid "name" property') + project = json.name + } catch (e) { + log.error(e.message) + return cb(docs.usage) + } + + return opener(url(json), { command: npm.config.get("browser") }, cb) + } + + mapToRegistry(project, npm.config, function (er, uri, auth) { + if (er) return cb(er) + + npm.registry.get(uri + "/latest", { timeout : 3600, auth : auth }, next) + }) + + function next (er, json) { + var github = "https://github.com/" + project + "#readme" + + if (er) { + if (project.split("/").length !== 2) return cb(er) + return opener(github, { command: npm.config.get("browser") }, cb) + } + + return opener(url(json), { command: npm.config.get("browser") }, cb) + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/edit.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/edit.js new file mode 100644 index 00000000..ddf501d5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/edit.js @@ -0,0 +1,31 @@ +// npm edit [@] +// open the package folder in the $EDITOR + +module.exports = edit +edit.usage = "npm edit " + +edit.completion = require("./utils/completion/installed-shallow.js") + +var npm = require("./npm.js") + , path = require("path") + , fs = require("graceful-fs") + , editor = require("editor") + +function edit (args, cb) { + var p = args[0] + if (args.length !== 1 || !p) return cb(edit.usage) + var e = npm.config.get("editor") + if (!e) return cb(new Error( + "No editor set. Set the 'editor' config, or $EDITOR environ.")) + p = p.split("/") + .join("/node_modules/") + .replace(/(\/node_modules)+/, "/node_modules") + var f = path.resolve(npm.dir, p) + fs.lstat(f, function (er) { + if (er) return cb(er) + editor(f, { editor: e }, function (er) { + if (er) return cb(er) + npm.commands.rebuild(args, cb) + }) + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/explore.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/explore.js new file mode 100644 index 00000000..96475a06 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/explore.js @@ -0,0 +1,37 @@ +// npm explore [@] +// open a subshell to the package folder. + +module.exports = explore +explore.usage = "npm explore [ -- ]" +explore.completion = require("./utils/completion/installed-shallow.js") + +var npm = require("./npm.js") + , spawn = require("./utils/spawn") + , path = require("path") + , fs = require("graceful-fs") + +function explore (args, cb) { + if (args.length < 1 || !args[0]) return cb(explore.usage) + var p = args.shift() + args = args.join(" ").trim() + if (args) args = ["-c", args] + else args = [] + + var cwd = path.resolve(npm.dir, p) + var sh = npm.config.get("shell") + fs.stat(cwd, function (er, s) { + if (er || !s.isDirectory()) return cb(new Error( + "It doesn't look like "+p+" is installed.")) + if (!args.length) console.log( + "\nExploring "+cwd+"\n"+ + "Type 'exit' or ^D when finished\n") + + npm.spinner.stop() + var shell = spawn(sh, args, { cwd: cwd, stdio: "inherit" }) + shell.on("close", function (er) { + // only fail if non-interactive. + if (!args.length) return cb() + cb(er) + }) + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/faq.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/faq.js new file mode 100644 index 00000000..912db007 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/faq.js @@ -0,0 +1,8 @@ + +module.exports = faq + +faq.usage = "npm faq" + +var npm = require("./npm.js") + +function faq (args, cb) { npm.commands.help(["faq"], cb) } diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/get.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/get.js new file mode 100644 index 00000000..aa058002 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/get.js @@ -0,0 +1,12 @@ + +module.exports = get + +get.usage = "npm get (See `npm config`)" + +var npm = require("./npm.js") + +get.completion = npm.commands.config.completion + +function get (args, cb) { + npm.commands.config(["get"].concat(args), cb) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/help-search.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/help-search.js new file mode 100644 index 00000000..d8553453 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/help-search.js @@ -0,0 +1,210 @@ + +module.exports = helpSearch + +var fs = require("graceful-fs") + , path = require("path") + , asyncMap = require("slide").asyncMap + , npm = require("./npm.js") + , glob = require("glob") + , color = require("ansicolors") + +helpSearch.usage = "npm help-search " + +function helpSearch (args, silent, cb) { + if (typeof cb !== "function") cb = silent, silent = false + if (!args.length) return cb(helpSearch.usage) + + var docPath = path.resolve(__dirname, "..", "doc") + return glob(docPath + "/*/*.md", function (er, files) { + if (er) + return cb(er) + readFiles(files, function (er, data) { + if (er) + return cb(er) + searchFiles(args, data, function (er, results) { + if (er) + return cb(er) + formatResults(args, results, cb) + }) + }) + }) +} + +function readFiles (files, cb) { + var res = {} + asyncMap(files, function (file, cb) { + fs.readFile(file, 'utf8', function (er, data) { + res[file] = data + return cb(er) + }) + }, function (er) { + return cb(er, res) + }) +} + +function searchFiles (args, files, cb) { + var results = [] + Object.keys(files).forEach(function (file) { + var data = files[file] + + // skip if no matches at all + var match + for (var a = 0, l = args.length; a < l && !match; a++) { + match = data.toLowerCase().indexOf(args[a].toLowerCase()) !== -1 + } + if (!match) + return + + var lines = data.split(/\n+/) + + // if a line has a search term, then skip it and the next line. + // if the next line has a search term, then skip all 3 + // otherwise, set the line to null. then remove the nulls. + l = lines.length + for (var i = 0; i < l; i ++) { + var line = lines[i] + , nextLine = lines[i + 1] + , ll + + match = false + if (nextLine) { + for (a = 0, ll = args.length; a < ll && !match; a ++) { + match = nextLine.toLowerCase() + .indexOf(args[a].toLowerCase()) !== -1 + } + if (match) { + // skip over the next line, and the line after it. + i += 2 + continue + } + } + + match = false + for (a = 0, ll = args.length; a < ll && !match; a ++) { + match = line.toLowerCase().indexOf(args[a].toLowerCase()) !== -1 + } + if (match) { + // skip over the next line + i ++ + continue + } + + lines[i] = null + } + + // now squish any string of nulls into a single null + lines = lines.reduce(function (l, r) { + if (!(r === null && l[l.length-1] === null)) l.push(r) + return l + }, []) + + if (lines[lines.length - 1] === null) lines.pop() + if (lines[0] === null) lines.shift() + + // now see how many args were found at all. + var found = {} + , totalHits = 0 + lines.forEach(function (line) { + args.forEach(function (arg) { + var hit = (line || "").toLowerCase() + .split(arg.toLowerCase()).length - 1 + if (hit > 0) { + found[arg] = (found[arg] || 0) + hit + totalHits += hit + } + }) + }) + + var cmd = "npm help " + if (path.basename(path.dirname(file)) === "api") { + cmd = "npm apihelp " + } + cmd += path.basename(file, ".md").replace(/^npm-/, "") + results.push({ file: file + , cmd: cmd + , lines: lines + , found: Object.keys(found) + , hits: found + , totalHits: totalHits + }) + }) + + // if only one result, then just show that help section. + if (results.length === 1) { + return npm.commands.help([results[0].file.replace(/\.md$/, "")], cb) + } + + if (results.length === 0) { + console.log("No results for " + args.map(JSON.stringify).join(" ")) + return cb() + } + + // sort results by number of results found, then by number of hits + // then by number of matching lines + results = results.sort(function (a, b) { + return a.found.length > b.found.length ? -1 + : a.found.length < b.found.length ? 1 + : a.totalHits > b.totalHits ? -1 + : a.totalHits < b.totalHits ? 1 + : a.lines.length > b.lines.length ? -1 + : a.lines.length < b.lines.length ? 1 + : 0 + }) + + cb(null, results) +} + +function formatResults (args, results, cb) { + if (!results) return cb(null) + + var cols = Math.min(process.stdout.columns || Infinity, 80) + 1 + + var out = results.map(function (res) { + var out = res.cmd + , r = Object.keys(res.hits).map(function (k) { + return k + ":" + res.hits[k] + }).sort(function (a, b) { + return a > b ? 1 : -1 + }).join(" ") + + out += ((new Array(Math.max(1, cols - out.length - r.length))) + .join(" ")) + r + + if (!npm.config.get("long")) return out + + out = "\n\n" + out + + "\n" + (new Array(cols)).join("—") + "\n" + + res.lines.map(function (line, i) { + if (line === null || i > 3) return "" + for (var out = line, a = 0, l = args.length; a < l; a ++) { + var finder = out.toLowerCase().split(args[a].toLowerCase()) + , newOut = "" + , p = 0 + + finder.forEach(function (f) { + newOut += out.substr(p, f.length) + + var hilit = out.substr(p + f.length, args[a].length) + if (npm.color) hilit = color.bgBlack(color.red(hilit)) + newOut += hilit + + p += f.length + args[a].length + }) + } + + return newOut + }).join("\n").trim() + return out + }).join("\n") + + if (results.length && !npm.config.get("long")) { + out = "Top hits for "+(args.map(JSON.stringify).join(" ")) + + "\n" + (new Array(cols)).join("—") + "\n" + + out + + "\n" + (new Array(cols)).join("—") + "\n" + + "(run with -l or --long to see more context)" + } + + console.log(out.trim()) + cb(null, results) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/help.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/help.js new file mode 100644 index 00000000..942d27b4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/help.js @@ -0,0 +1,240 @@ + +module.exports = help + +help.completion = function (opts, cb) { + if (opts.conf.argv.remain.length > 2) return cb(null, []) + getSections(cb) +} + +var path = require("path") + , spawn = require("./utils/spawn") + , npm = require("./npm.js") + , log = require("npmlog") + , opener = require("opener") + , glob = require("glob") + +function help (args, cb) { + npm.spinner.stop() + var argv = npm.config.get("argv").cooked + + var argnum = 0 + if (args.length === 2 && ~~args[0]) { + argnum = ~~args.shift() + } + + // npm help foo bar baz: search topics + if (args.length > 1 && args[0]) { + return npm.commands["help-search"](args, argnum, cb) + } + + var section = npm.deref(args[0]) || args[0] + + // npm help : show basic usage + if (!section) { + var valid = argv[0] === "help" ? 0 : 1 + return npmUsage(valid, cb) + } + + + // npm -h: show command usage + if ( npm.config.get("usage") + && npm.commands[section] + && npm.commands[section].usage + ) { + npm.config.set("loglevel", "silent") + log.level = "silent" + console.log(npm.commands[section].usage) + return cb() + } + + // npm apihelp
    : Prefer section 3 over section 1 + var apihelp = argv.length && -1 !== argv[0].indexOf("api") + var pref = apihelp ? [3, 1, 5, 7] : [1, 3, 5, 7] + if (argnum) + pref = [ argnum ].concat(pref.filter(function (n) { + return n !== argnum + })) + + // npm help
    : Try to find the path + var manroot = path.resolve(__dirname, "..", "man") + + // legacy + if (section === "global") section = "folders" + else if (section === "json") section = "package.json" + + // find either /section.n or /npm-section.n + // The glob is used in the glob. The regexp is used much + // further down. Globs and regexps are different + var compextglob = ".+(gz|bz2|lzma|[FYzZ]|xz)" + var compextre = "\\.(gz|bz2|lzma|[FYzZ]|xz)$" + var f = "+(npm-" + section + "|" + section + ").[0-9]?(" + compextglob + ")" + return glob(manroot + "/*/" + f, function (er, mans) { + if (er) return cb(er) + + if (!mans.length) return npm.commands["help-search"](args, cb) + + mans = mans.map(function (man) { + var ext = path.extname(man) + if (man.match(new RegExp(compextre))) man = path.basename(man, ext) + + return man + }) + + viewMan(pickMan(mans, pref), cb) + }) +} + +function pickMan (mans, pref_) { + var nre = /([0-9]+)$/ + var pref = {} + pref_.forEach(function (sect, i) { + pref[sect] = i + }) + mans = mans.sort(function (a, b) { + var an = a.match(nre)[1] + var bn = b.match(nre)[1] + return an === bn ? (a > b ? -1 : 1) + : pref[an] < pref[bn] ? -1 + : 1 + }) + return mans[0] +} + +function viewMan (man, cb) { + var nre = /([0-9]+)$/ + var num = man.match(nre)[1] + var section = path.basename(man, "." + num) + + // at this point, we know that the specified man page exists + var manpath = path.join(__dirname, "..", "man") + , env = {} + Object.keys(process.env).forEach(function (i) { + env[i] = process.env[i] + }) + env.MANPATH = manpath + var viewer = npm.config.get("viewer") + + var conf + switch (viewer) { + case "woman": + var a = ["-e", "(woman-find-file \"" + man + "\")"] + conf = { env: env, stdio: "inherit" } + var woman = spawn("emacsclient", a, conf) + woman.on("close", cb) + break + + case "browser": + opener(htmlMan(man), { command: npm.config.get("browser") }, cb) + break + + default: + conf = { env: env, stdio: "inherit" } + var manProcess = spawn("man", [num, section], conf) + manProcess.on("close", cb) + break + } +} + +function htmlMan (man) { + var sect = +man.match(/([0-9]+)$/)[1] + var f = path.basename(man).replace(/([0-9]+)$/, "html") + switch (sect) { + case 1: + sect = "cli" + break + case 3: + sect = "api" + break + case 5: + sect = "files" + break + case 7: + sect = "misc" + break + default: + throw new Error("invalid man section: " + sect) + } + return path.resolve(__dirname, "..", "html", "doc", sect, f) +} + +function npmUsage (valid, cb) { + npm.config.set("loglevel", "silent") + log.level = "silent" + console.log( + [ "\nUsage: npm " + , "" + , "where is one of:" + , npm.config.get("long") ? usages() + : " " + wrap(Object.keys(npm.commands)) + , "" + , "npm -h quick help on " + , "npm -l display full usage info" + , "npm faq commonly asked questions" + , "npm help search for help on " + , "npm help npm involved overview" + , "" + , "Specify configs in the ini-formatted file:" + , " " + npm.config.get("userconfig") + , "or on the command line via: npm --key value" + , "Config info can be viewed via: npm help config" + , "" + , "npm@" + npm.version + " " + path.dirname(__dirname) + ].join("\n")) + cb(valid) +} + +function usages () { + // return a string of : + var maxLen = 0 + return Object.keys(npm.commands).filter(function (c) { + return c === npm.deref(c) + }).reduce(function (set, c) { + set.push([c, npm.commands[c].usage || ""]) + maxLen = Math.max(maxLen, c.length) + return set + }, []).map(function (item) { + var c = item[0] + , usage = item[1] + return "\n " + c + (new Array(maxLen - c.length + 2).join(" ")) + + (usage.split("\n") + .join("\n" + (new Array(maxLen + 6).join(" ")))) + }).join("\n") +} + + +function wrap (arr) { + var out = [""] + , l = 0 + , line + + line = process.stdout.columns + if (!line) + line = 60 + else + line = Math.min(60, Math.max(line - 16, 24)) + + arr.sort(function (a,b) { return a --save` afterwards to install a package and" + ,"save it as a dependency in the package.json file." + ,"" + ,"Press ^C at any time to quit." + ].join("\n")) + } + initJson(dir, initFile, npm.config, function (er, data) { + log.resume() + log.silly("package data", data) + if (er && er.message === "canceled") { + log.warn("init", "canceled") + return cb(null, data) + } + log.info("init", "written successfully") + cb(er, data) + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/install.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/install.js new file mode 100644 index 00000000..72575d14 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/install.js @@ -0,0 +1,1196 @@ +// npm install +// +// See doc/cli/npm-install.md for more description +// +// Managing contexts... +// there's a lot of state associated with an "install" operation, including +// packages that are already installed, parent packages, current shrinkwrap, and +// so on. We maintain this state in a "context" object that gets passed around. +// every time we dive into a deeper node_modules folder, the "family" list that +// gets passed along uses the previous "family" list as its __proto__. Any +// "resolved precise dependency" things that aren't already on this object get +// added, and then that's passed to the next generation of installation. + +module.exports = install + +install.usage = "npm install" + + "\nnpm install " + + "\nnpm install @" + + "\nnpm install @" + + "\nnpm install @" + + "\nnpm install " + + "\nnpm install " + + "\nnpm install " + + "\nnpm install " + + "\nnpm install /" + + "\n\nCan specify one or more: npm install ./foo.tgz bar@stable /some/folder" + + "\nIf no argument is supplied and ./npm-shrinkwrap.json is " + + "\npresent, installs dependencies specified in the shrinkwrap." + + "\nOtherwise, installs dependencies from ./package.json." + +install.completion = function (opts, cb) { + // install can complete to a folder with a package.json, or any package. + // if it has a slash, then it's gotta be a folder + // if it starts with https?://, then just give up, because it's a url + if (/^https?:\/\//.test(opts.partialWord)) { + // do not complete to URLs + return cb(null, []) + } + + if (/\//.test(opts.partialWord)) { + // Complete fully to folder if there is exactly one match and it + // is a folder containing a package.json file. If that is not the + // case we return 0 matches, which will trigger the default bash + // complete. + var lastSlashIdx = opts.partialWord.lastIndexOf("/") + var partialName = opts.partialWord.slice(lastSlashIdx + 1) + var partialPath = opts.partialWord.slice(0, lastSlashIdx) + if (partialPath === "") partialPath = "/" + + function annotatePackageDirMatch (sibling, cb) { + var fullPath = path.join(partialPath, sibling) + if (sibling.slice(0, partialName.length) !== partialName) { + return cb(null, null) // not name match + } + fs.readdir(fullPath, function (err, contents) { + if (err) return cb(null, { isPackage: false }) + + cb( + null, + { + fullPath: fullPath, + isPackage: contents.indexOf("package.json") !== -1 + } + ) + }) + } + + return fs.readdir(partialPath, function (err, siblings) { + if (err) return cb(null, []) // invalid dir: no matching + + asyncMap(siblings, annotatePackageDirMatch, function (err, matches) { + if (err) return cb(err) + + var cleaned = matches.filter(function (x) { return x !== null }) + if (cleaned.length !== 1) return cb(null, []) + if (!cleaned[0].isPackage) return cb(null, []) + + // Success - only one match and it is a package dir + return cb(null, [cleaned[0].fullPath]) + }) + }) + } + + // FIXME: there used to be registry completion here, but it stopped making + // sense somewhere around 50,000 packages on the registry + cb() +} + +var npm = require("./npm.js") + , semver = require("semver") + , readJson = require("read-package-json") + , readInstalled = require("read-installed") + , log = require("npmlog") + , path = require("path") + , fs = require("graceful-fs") + , writeFileAtomic = require("write-file-atomic") + , cache = require("./cache.js") + , asyncMap = require("slide").asyncMap + , chain = require("slide").chain + , url = require("url") + , mkdir = require("mkdirp") + , lifecycle = require("./utils/lifecycle.js") + , archy = require("archy") + , npmInstallChecks = require("npm-install-checks") + , sortedObject = require("sorted-object") + , mapToRegistry = require("./utils/map-to-registry.js") + , npa = require("npm-package-arg") + , inflight = require("inflight") + , locker = require("./utils/locker.js") + , lock = locker.lock + , unlock = locker.unlock + , warnStrict = require("./utils/warn-deprecated.js")("engineStrict") + , warnPeers = require("./utils/warn-deprecated.js")("peerDependencies") + +function install (args, cb_) { + var hasArguments = !!args.length + + function cb (er, installed) { + if (er) return cb_(er) + + validateInstall(where, function (er, problem) { + if (er) return cb_(er) + + if (problem) { + var peerInvalidError = new Error("The package " + problem._id + + " does not satisfy its siblings' peerDependencies requirements!") + peerInvalidError.code = "EPEERINVALID" + peerInvalidError.packageName = problem.name + peerInvalidError.packageVersion = problem.version + peerInvalidError.peersDepending = problem.peersDepending + return cb(peerInvalidError) + } + + var tree = treeify(installed || []) + , pretty = prettify(tree, installed).trim() + + if (pretty) console.log(pretty) + save(where, installed, tree, pretty, hasArguments, cb_) + }) + } + + // the /path/to/node_modules/.. + var where = path.resolve(npm.dir, "..") + + // internal api: install(where, what, cb) + if (arguments.length === 3) { + where = args + args = [].concat(cb_) // pass in [] to do default dep-install + cb_ = arguments[2] + log.verbose("install", "where, what", [where, args]) + } + + if (!npm.config.get("global")) { + args = args.filter(function (a) { + return path.resolve(a) !== where + }) + } + + mkdir(where, function (er) { + if (er) return cb(er) + // install dependencies locally by default, + // or install current folder globally + if (!args.length) { + var opt = { dev: npm.config.get("dev") || !npm.config.get("production") } + + if (npm.config.get("global")) args = ["."] + else return readDependencies(null, where, opt, function (er, data) { + if (er) { + log.error("install", "Couldn't read dependencies") + return cb(er) + } + var deps = Object.keys(data.dependencies || {}) + log.verbose("install", "where, deps", [where, deps]) + + // FIXME: Install peerDependencies as direct dependencies, but only at + // the top level. Should only last until peerDependencies are nerfed to + // no longer implicitly install themselves. + var peers = [] + Object.keys(data.peerDependencies || {}).forEach(function (dep) { + if (!data.dependencies[dep]) { + log.verbose( + "install", + "peerDependency", dep, "wasn't going to be installed; adding" + ) + warnPeers([ + "The peer dependency "+dep+" included from "+data.name+" will no", + "longer be automatically installed to fulfill the peerDependency ", + "in npm 3+. Your application will need to depend on it explicitly." + ], dep+","+data.name) + peers.push(dep) + } + }) + log.verbose("install", "where, peers", [where, peers]) + + var context = { family: {} + , ancestors: {} + , explicit: false + , parent: data + , root: true + , wrap: null } + + if (data.name === path.basename(where) && + path.basename(path.dirname(where)) === "node_modules") { + // Only include in ancestry if it can actually be required. + // Otherwise, it does not count. + context.family[data.name] = + context.ancestors[data.name] = data.version + } + + installManyTop(deps.map(function (dep) { + var target = data.dependencies[dep] + return dep + "@" + target + }).concat(peers.map(function (dep) { + var target = data.peerDependencies[dep] + return dep + "@" + target + })), where, context, function(er, results) { + if (er || npm.config.get("production")) return cb(er, results) + lifecycle(data, "prepublish", where, function(er) { + return cb(er, results) + }) + }) + }) + } + + // initial "family" is the name:version of the root, if it's got + // a package.json file. + var jsonPath = path.resolve(where, "package.json") + log.verbose('install', 'initial load of', jsonPath) + readJson(jsonPath, log.warn, function (er, data) { + if (er + && er.code !== "ENOENT" + && er.code !== "ENOTDIR") return cb(er) + if (er) data = null + var context = { family: {} + , ancestors: {} + , explicit: true + , parent: data + , root: true + , wrap: null } + if (data && data.name === path.basename(where) && + path.basename(path.dirname(where)) === "node_modules") { + context.family[data.name] = context.ancestors[data.name] = data.version + } + var fn = npm.config.get("global") ? installMany : installManyTop + fn(args, where, context, cb) + }) + }) +} + +function validateInstall (where, cb) { + var jsonPath = path.resolve(where, 'package.json') + log.verbose('validateInstall', 'loading', jsonPath, 'for validation') + readJson(jsonPath, log.warn, function (er, data) { + if (er + && er.code !== 'ENOENT' + && er.code !== 'ENOTDIR') return cb(er) + + if (data && data.engineStrict) { + warnStrict([ + "Per-package engineStrict (found in this package's package.json) ", + "won't be used in npm 3+. Use the config setting `engine-strict` instead." + ], data.name) + } + + readInstalled(where, { log: log.warn, dev: true }, function (er, data) { + if (er) return cb(er) + + cb(null, findPeerInvalid_(data.dependencies, [])) + }) + }) +} + +function findPeerInvalid_ (packageMap, fpiList) { + if (fpiList.indexOf(packageMap) !== -1) + return undefined + + fpiList.push(packageMap) + + for (var packageName in packageMap) { + var pkg = packageMap[packageName] + + if (pkg.peerInvalid) { + var peersDepending = {} + for (var peerName in packageMap) { + var peer = packageMap[peerName] + if (peer.peerDependencies && peer.peerDependencies[packageName]) { + peersDepending[peer.name + "@" + peer.version] = + peer.peerDependencies[packageName] + } + } + return { name: pkg.name, peersDepending: peersDepending, version: pkg.version, _id: pkg._id } + } + + if (pkg.dependencies) { + var invalid = findPeerInvalid_(pkg.dependencies, fpiList) + if (invalid) + return invalid + } + } + + return null +} + +// reads dependencies for the package at "where". There are several cases, +// depending on our current state and the package's configuration: +// +// 1. If "context" is specified, then we examine the context to see if there's a +// shrinkwrap there. In that case, dependencies are read from the shrinkwrap. +// 2. Otherwise, if an npm-shrinkwrap.json file is present, dependencies are +// read from there. +// 3. Otherwise, dependencies come from package.json. +// +// Regardless of which case we fall into, "cb" is invoked with a first argument +// describing the full package (as though readJson had been used) but with +// "dependencies" read as described above. The second argument to "cb" is the +// shrinkwrap to use in processing this package's dependencies, which may be +// "wrap" (in case 1) or a new shrinkwrap (in case 2). +function readDependencies (context, where, opts, cb) { + var wrap = context ? context.wrap : null + + var jsonPath = path.resolve(where, 'package.json') + log.verbose('readDependencies', 'loading dependencies from', jsonPath) + readJson(jsonPath, log.warn, function (er, data) { + if (er && er.code === "ENOENT") er.code = "ENOPACKAGEJSON" + if (er) return cb(er) + + if (opts && opts.dev) { + if (!data.dependencies) data.dependencies = {} + Object.keys(data.devDependencies || {}).forEach(function (k) { + if (data.dependencies[k]) { + log.warn("package.json", "Dependency '%s' exists in both dependencies " + + "and devDependencies, using '%s@%s' from dependencies", + k, k, data.dependencies[k]) + } else { + data.dependencies[k] = data.devDependencies[k] + } + }) + } + + if (!npm.config.get("optional") && data.optionalDependencies) { + Object.keys(data.optionalDependencies).forEach(function (d) { + delete data.dependencies[d] + }) + } + + // User has opted out of shrinkwraps entirely + if (npm.config.get("shrinkwrap") === false) + return cb(null, data, null) + + if (wrap) { + log.verbose("readDependencies: using existing wrap", [where, wrap]) + var rv = {} + Object.keys(data).forEach(function (key) { + rv[key] = data[key] + }) + rv.dependencies = {} + Object.keys(wrap).forEach(function (key) { + log.verbose("from wrap", [key, wrap[key]]) + rv.dependencies[key] = readWrap(wrap[key]) + }) + log.verbose("readDependencies returned deps", rv.dependencies) + return cb(null, rv, wrap) + } + + var wrapfile = path.resolve(where, "npm-shrinkwrap.json") + + fs.readFile(wrapfile, "utf8", function (er, wrapjson) { + if (er) return cb(null, data, null) + + log.verbose("readDependencies", "npm-shrinkwrap.json is overriding dependencies") + var newwrap + try { + newwrap = JSON.parse(wrapjson) + } catch (ex) { + return cb(ex) + } + + log.info("shrinkwrap", "file %j", wrapfile) + var rv = {} + Object.keys(data).forEach(function (key) { + rv[key] = data[key] + }) + rv.dependencies = {} + Object.keys(newwrap.dependencies || {}).forEach(function (key) { + rv.dependencies[key] = readWrap(newwrap.dependencies[key]) + }) + + // fold in devDependencies if not already present, at top level + if (opts && opts.dev) { + Object.keys(data.devDependencies || {}).forEach(function (k) { + rv.dependencies[k] = rv.dependencies[k] || data.devDependencies[k] + }) + } + + log.verbose("readDependencies returned deps", rv.dependencies) + return cb(null, rv, newwrap.dependencies) + }) + }) +} + +function readWrap (w) { + return (w.resolved) ? w.resolved + : (w.from && url.parse(w.from).protocol) ? w.from + : w.version +} + +// if the -S|--save option is specified, then write installed packages +// as dependencies to a package.json file. +function save (where, installed, tree, pretty, hasArguments, cb) { + if (!hasArguments || + !npm.config.get("save") && + !npm.config.get("save-dev") && + !npm.config.get("save-optional") || + npm.config.get("global")) { + return cb(null, installed, tree, pretty) + } + + var saveBundle = npm.config.get("save-bundle") + var savePrefix = npm.config.get("save-prefix") + + // each item in the tree is a top-level thing that should be saved + // to the package.json file. + // The relevant tree shape is { : {what:} } + var saveTarget = path.resolve(where, "package.json") + + asyncMap(Object.keys(tree), function (k, cb) { + // if "from" is remote, git, or hosted, then save that instead. + var t = tree[k] + , f = npa(t.from) + , a = npa(t.what) + , w = [a.name, a.spec] + + + fs.stat(t.from, function (er){ + if (!er) { + w[1] = "file:" + t.from + } else if (['hosted', 'git', 'remote'].indexOf(f.type) !== -1) { + w[1] = t.from + } + cb(null, [w]) + }) + } + , function (er, arr) { + var things = arr.reduce(function (set, k) { + var rangeDescriptor = semver.valid(k[1], true) && + semver.gte(k[1], "0.1.0", true) && + !npm.config.get("save-exact") + ? savePrefix : "" + set[k[0]] = rangeDescriptor + k[1] + return set + }, {}) + + + // don't use readJson, because we don't want to do all the other + // tricky npm-specific stuff that's in there. + fs.readFile(saveTarget, function (er, data) { + // ignore errors here, just don't save it. + try { + data = JSON.parse(data.toString("utf8")) + } catch (ex) { + er = ex + } + + if (er) { + return cb(null, installed, tree, pretty) + } + + var deps = npm.config.get("save-optional") ? "optionalDependencies" + : npm.config.get("save-dev") ? "devDependencies" + : "dependencies" + + if (saveBundle) { + var bundle = data.bundleDependencies || data.bundledDependencies + delete data.bundledDependencies + if (!Array.isArray(bundle)) bundle = [] + data.bundleDependencies = bundle.sort() + } + + log.verbose("save", "saving", things) + data[deps] = data[deps] || {} + Object.keys(things).forEach(function (t) { + data[deps][t] = things[t] + if (saveBundle) { + var i = bundle.indexOf(t) + if (i === -1) bundle.push(t) + data.bundleDependencies = bundle.sort() + } + }) + + data[deps] = sortedObject(data[deps]) + + log.silly("save", "writing", saveTarget) + data = JSON.stringify(data, null, 2) + "\n" + writeFileAtomic(saveTarget, data, function (er) { + cb(er, installed, tree, pretty) + }) + }) + }) +} + + +// Outputting *all* the installed modules is a bit confusing, +// because the length of the path does not make it clear +// that the submodules are not immediately require()able. +// TODO: Show the complete tree, ls-style, but only if --long is provided +function prettify (tree, installed) { + function red (set, kv) { + set[kv[0]] = kv[1] + return set + } + + if (npm.config.get("json")) { + tree = Object.keys(tree).map(function (p) { + if (!tree[p]) return null + var what = npa(tree[p].what) + , name = what.name + , version = what.spec + , o = { name: name, version: version, from: tree[p].from } + o.dependencies = tree[p].children.map(function P (dep) { + var what = npa(dep.what) + , name = what.name + , version = what.spec + , o = { version: version, from: dep.from } + o.dependencies = dep.children.map(P).reduce(red, {}) + return [name, o] + }).reduce(red, {}) + return o + }) + + return JSON.stringify(tree, null, 2) + } + if (npm.config.get("parseable")) return parseable(installed) + + return Object.keys(tree).map(function (p) { + return archy({ label: tree[p].what + " " + p + , nodes: (tree[p].children || []).map(function P (c) { + if (npm.config.get("long")) { + return { label: c.what, nodes: c.children.map(P) } + } + var g = c.children.map(function (g) { + return g.what + }).join(", ") + if (g) g = " (" + g + ")" + return c.what + g + }) + }, "", { unicode: npm.config.get("unicode") }) + }).join("\n") +} + +function parseable (installed) { + var long = npm.config.get("long") + , cwd = process.cwd() + return installed.map(function (item) { + return path.resolve(cwd, item[1]) + + ( long ? ":" + item[0] : "" ) + }).join("\n") +} + +function treeify (installed) { + // each item is [what, where, parent, parentDir] + // If no parent, then report it. + // otherwise, tack it into the parent's children list. + // If the parent isn't a top-level then ignore it. + var whatWhere = installed.reduce(function (l, r) { + var parentDir = r[3] + , parent = r[2] + , where = r[1] + , what = r[0] + , from = r[4] + l[where] = { parentDir: parentDir + , parent: parent + , children: [] + , where: where + , what: what + , from: from } + return l + }, {}) + + // log.warn("install", whatWhere, "whatWhere") + return Object.keys(whatWhere).reduce(function (l, r) { + var ww = whatWhere[r] + //log.warn("r, ww", [r, ww]) + if (!ww.parent) { + l[r] = ww + } else { + var p = whatWhere[ww.parentDir] + if (p) p.children.push(ww) + else l[r] = ww + } + return l + }, {}) +} + + +// just like installMany, but also add the existing packages in +// where/node_modules to the family object. +function installManyTop (what, where, context, cb_) { + function cb (er, d) { + if (context.explicit || er) return cb_(er, d) + // since this wasn't an explicit install, let's build the top + // folder, so that `npm install` also runs the lifecycle scripts. + npm.commands.build([where], false, true, function (er) { + return cb_(er, d) + }) + } + + if (context.explicit) return next() + + var jsonPath = path.join(where, 'package.json') + log.verbose('installManyTop', 'reading for lifecycle', jsonPath) + readJson(jsonPath, log.warn, function (er, data) { + if (er) return next(er) + lifecycle(data, "preinstall", where, next) + }) + + function next (er) { + if (er) return cb(er) + installManyTop_(what, where, context, cb) + } +} + +function installManyTop_ (what, where, context, cb) { + var nm = path.resolve(where, "node_modules") + + fs.readdir(nm, function (er, pkgs) { + if (er) return installMany(what, where, context, cb) + + var scopes = [], unscoped = [] + pkgs.filter(function (p) { + return !p.match(/^[\._-]/) + }).forEach(function (p) { + // @names deserve deeper investigation + if (p[0] === "@") { + scopes.push(p) + } + else { + unscoped.push(p) + } + }) + + maybeScoped(scopes, nm, function (er, scoped) { + if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) + // recombine unscoped with @scope/package packages + asyncMap(unscoped.concat(scoped).map(function (p) { + return path.resolve(nm, p, "package.json") + }), function (jsonPath, cb) { + log.verbose('installManyTop', 'reading scoped package data from', jsonPath) + readJson(jsonPath, log.info, function (er, data) { + if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) + if (er) return cb(null, []) + cb(null, [[data.name, data.version]]) + }) + }, function (er, packages) { + // if there's nothing in node_modules, then don't freak out. + if (er) packages = [] + // add all the existing packages to the family list. + // however, do not add to the ancestors list. + packages.forEach(function (p) { + context.family[p[0]] = p[1] + }) + installMany(what, where, context, cb) + }) + }) + }) +} + +function maybeScoped (scopes, where, cb) { + // find packages in scopes + asyncMap(scopes, function (scope, cb) { + fs.readdir(path.resolve(where, scope), function (er, scoped) { + if (er) return cb(er) + var paths = scoped.map(function (p) { + return path.join(scope, p) + }) + cb(null, paths) + }) + }, cb) +} + +function installMany (what, where, context, cb) { + // readDependencies takes care of figuring out whether the list of + // dependencies we'll iterate below comes from an existing shrinkwrap from a + // parent level, a new shrinkwrap at this level, or package.json at this + // level, as well as which shrinkwrap (if any) our dependencies should use. + var opt = { dev: npm.config.get("dev") } + readDependencies(context, where, opt, function (er, data, wrap) { + if (er) data = {} + + var parent = data + + // if we're explicitly installing "what" into "where", then the shrinkwrap + // for "where" doesn't apply. This would be the case if someone were adding + // a new package to a shrinkwrapped package. (data.dependencies will not be + // used here except to indicate what packages are already present, so + // there's no harm in using that.) + if (context.explicit) wrap = null + + var deps = data.dependencies || {} + var devDeps = data.devDependencies || {} + + // what is a list of things. + // resolve each one. + asyncMap( what + , targetResolver(where, context, deps, devDeps) + , function (er, targets) { + + if (er) return cb(er) + + var bundled = data.bundleDependencies || data.bundledDependencies || [] + // only take the hit for readInstalled if there are probably bundled + // dependencies to read + if (bundled.length) { + readInstalled(where, { dev: true }, andBuildResolvedTree) + } else { + andBuildResolvedTree() + } + + function andBuildResolvedTree (er, current) { + if (er) return cb(er) + + // each target will be a data object corresponding + // to a package, folder, or whatever that is in the cache now. + var newPrev = Object.create(context.family) + , newAnc = Object.create(context.ancestors) + + if (!context.root) { + newAnc[data.name] = data.version + } + bundled.forEach(function (bundle) { + var bundleData = current.dependencies[bundle] + if ((!bundleData || !bundleData.version) && current.devDependencies) { + log.verbose( + 'installMany', bundle, 'was bundled with', + data.name + '@' + data.version + + ", but wasn't found in dependencies. Trying devDependencies" + ) + bundleData = current.devDependencies[bundle] + } + + if (!bundleData || !bundleData.version) { + log.warn( + 'installMany', bundle, 'was bundled with', + data.name + '@' + data.version + + ", but bundled package wasn't found in unpacked tree" + ) + } else { + log.verbose( + 'installMany', bundle + '@' + bundleData.version, + 'was bundled with', data.name + '@' + data.version + ) + newPrev[bundle] = bundleData.version + } + }) + targets.forEach(function (t) { + newPrev[t.name] = t.version + }) + log.silly("install resolved", targets) + targets.filter(function (t) { return t }).forEach(function (t) { + log.info("install", "%s into %s", t._id, where) + }) + asyncMap(targets, function (target, cb) { + log.info("installOne", target._id) + var wrapData = wrap ? wrap[target.name] : null + var newWrap = wrapData && wrapData.dependencies + ? wrap[target.name].dependencies || {} + : null + var newContext = { family: newPrev + , ancestors: newAnc + , parent: parent + , explicit: false + , wrap: newWrap } + installOne(target, where, newContext, cb) + }, cb) + } + }) + }) +} + +function targetResolver (where, context, deps, devDeps) { + var alreadyInstalledManually = [] + , resolveLeft = 0 + , nm = path.resolve(where, "node_modules") + , parent = context.parent + , wrap = context.wrap + + if (!context.explicit) readdir(nm) + + function readdir(name) { + resolveLeft++ + fs.readdir(name, function (er, inst) { + if (er) return resolveLeft-- + + // don't even mess with non-package looking things + inst = inst.filter(function (p) { + if (!p.match(/^[@\._-]/)) return true + // scoped packages + readdir(path.join(name, p)) + }) + + asyncMap(inst, function (pkg, cb) { + var jsonPath = path.resolve(name, pkg, 'package.json') + log.verbose('targetResolver', 'reading package data from', jsonPath) + readJson(jsonPath, log.info, function (er, d) { + if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) + // error means it's not a package, most likely. + if (er) return cb(null, []) + + // if it's a bundled dep, then assume that anything there is valid. + // otherwise, make sure that it's a semver match with what we want. + var bd = parent.bundleDependencies + var isBundled = bd && bd.indexOf(d.name) !== -1 + var expectedVersion = deps[d.name] || (devDeps && devDeps[d.name]) || "*" + var currentIsSatisfactory = semver.satisfies(d.version, expectedVersion, true) + if (isBundled || currentIsSatisfactory || deps[d.name] === d._resolved) { + return cb(null, d.name) + } + + // see if the package had been previously linked + fs.lstat(path.resolve(nm, pkg), function(err, s) { + if (err) return cb(null, []) + if (s.isSymbolicLink()) { + return cb(null, d.name) + } + + // something is there, but it's not satisfactory. Clobber it. + return cb(null, []) + }) + }) + }, function (er, inst) { + // this is the list of things that are valid and should be ignored. + alreadyInstalledManually = alreadyInstalledManually.concat(inst) + resolveLeft-- + }) + }) + } + + var to = 0 + return function resolver (what, cb) { + if (resolveLeft) return setTimeout(function () { + resolver(what, cb) + }, to++) + + // now we know what's been installed here manually, + // or tampered with in some way that npm doesn't want to overwrite. + if (alreadyInstalledManually.indexOf(npa(what).name) !== -1) { + log.verbose("already installed", "skipping %s %s", what, where) + return cb(null, []) + } + + // check for a version installed higher in the tree. + // If installing from a shrinkwrap, it must match exactly. + if (context.family[what]) { + log.verbose('install', what, 'is installed as', context.family[what]) + if (wrap && wrap[what].version === context.family[what]) { + log.verbose("shrinkwrap", "use existing", what) + return cb(null, []) + } + } + + // if it's identical to its parent, then it's probably someone + // doing `npm install foo` inside of the foo project. Print + // a warning, and skip it. + if (parent && parent.name === what && !npm.config.get("force")) { + log.warn("install", "Refusing to install %s as a dependency of itself" + , what) + return cb(null, []) + } + + if (wrap) { + var name = npa(what).name + if (wrap[name]) { + var wrapTarget = readWrap(wrap[name]) + what = name + "@" + wrapTarget + } else { + log.verbose("shrinkwrap", "skipping %s (not in shrinkwrap)", what) + } + } else if (deps[what]) { + what = what + "@" + deps[what] + } + + // This is where we actually fetch the package, if it's not already + // in the cache. + // If it's a git repo, then we want to install it, even if the parent + // already has a matching copy. + // If it's not a git repo, and the parent already has that pkg, then + // we can skip installing it again. + var pkgroot = path.resolve(npm.prefix, (parent && parent._from) || "") + cache.add(what, null, pkgroot, false, function (er, data) { + if (er && parent && parent.optionalDependencies && + parent.optionalDependencies.hasOwnProperty(npa(what).name)) { + log.warn("optional dep failed, continuing", what) + log.verbose("optional dep failed, continuing", [what, er]) + return cb(null, []) + } + + var type = npa(what).type + var isGit = type === "git" || type === "hosted" + + if (!er && + data && + !context.explicit && + context.family[data.name] === data.version && + !npm.config.get("force") && + !isGit) { + log.info("already installed", data.name + "@" + data.version) + return cb(null, []) + } + + + if (data && !data._from) data._from = what + if (er && parent && parent.name) er.parent = parent.name + return cb(er, data || []) + }) + } +} + +// we've already decided to install this. if anything's in the way, +// then uninstall it first. +function installOne (target, where, context, cb) { + // the --link flag makes this a "link" command if it's at the + // the top level. + var isGit = false + var type = npa(target._from).type + if (target && target._from) isGit = type === 'git' || type === 'hosted' + + if (where === npm.prefix && npm.config.get("link") + && !npm.config.get("global") && !isGit) { + return localLink(target, where, context, cb) + } + installOne_(target, where, context, function (er, installedWhat) { + + // check if this one is optional to its parent. + if (er && context.parent && context.parent.optionalDependencies && + context.parent.optionalDependencies.hasOwnProperty(target.name)) { + log.warn("optional dep failed, continuing", target._id) + log.verbose("optional dep failed, continuing", [target._id, er]) + er = null + } + + cb(er, installedWhat) + }) + +} + +function localLink (target, where, context, cb) { + log.verbose("localLink", target._id) + var jsonPath = path.resolve(npm.globalDir, target.name , 'package.json') + var parent = context.parent + + log.verbose('localLink', 'reading data to link', target.name, 'from', jsonPath) + readJson(jsonPath, log.warn, function (er, data) { + function thenLink () { + npm.commands.link([target.name], function (er, d) { + log.silly("localLink", "back from link", [er, d]) + cb(er, [resultList(target, where, parent && parent._id)]) + }) + } + + if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) + if (er || data._id === target._id) { + if (er) { + install( path.resolve(npm.globalDir, "..") + , target._id + , function (er) { + if (er) return cb(er, []) + thenLink() + }) + } else thenLink() + } else { + log.verbose("localLink", "install locally (no link)", target._id) + installOne_(target, where, context, cb) + } + }) +} + +function resultList (target, where, parentId) { + var nm = path.resolve(where, "node_modules") + , targetFolder = path.resolve(nm, target.name) + , prettyWhere = where + + if (!npm.config.get("global")) { + prettyWhere = path.relative(process.cwd(), where) + } + + if (prettyWhere === ".") prettyWhere = null + + if (!npm.config.get("global")) { + // print out the folder relative to where we are right now. + targetFolder = path.relative(process.cwd(), targetFolder) + } + + return [ target._id + , targetFolder + , prettyWhere && parentId + , parentId && prettyWhere + , target._from ] +} + +var installed = Object.create(null) + +function installOne_ (target, where, context, cb_) { + var nm = path.resolve(where, "node_modules") + , targetFolder = path.resolve(nm, target.name) + , prettyWhere = path.relative(process.cwd(), where) + , parent = context.parent + + if (prettyWhere === ".") prettyWhere = null + + cb_ = inflight(target.name + ":" + where, cb_) + if (!cb_) { + return log.verbose("installOne", "of", target.name, "to", where, "already in flight; waiting") + } + else { + log.verbose("installOne", "of", target.name, "to", where, "not in flight; installing") + } + + function cb(er, data) { + unlock(nm, target.name, function () { cb_(er, data) }) + } + + lock(nm, target.name, function (er) { + if (er) return cb(er) + + if (targetFolder in installed) { + log.error("install", "trying to install", target.version, "to", targetFolder) + log.error("install", "but already installed versions", installed[targetFolder]) + installed[targetFolder].push(target.version) + } + else { + installed[targetFolder] = [target.version] + } + + var force = npm.config.get("force") + , nodeVersion = npm.config.get("node-version") + , strict = npm.config.get("engine-strict") + , c = npmInstallChecks + + chain( + [ [c.checkEngine, target, npm.version, nodeVersion, force, strict] + , [c.checkPlatform, target, force] + , [c.checkCycle, target, context.ancestors] + , [c.checkGit, targetFolder] + , [write, target, targetFolder, context] ] + , function (er, d) { + if (er) return cb(er) + + d.push(resultList(target, where, parent && parent._id)) + cb(er, d) + } + ) + }) +} + +function write (target, targetFolder, context, cb_) { + var up = npm.config.get("unsafe-perm") + , user = up ? null : npm.config.get("user") + , group = up ? null : npm.config.get("group") + , family = context.family + + function cb (er, data) { + // cache.unpack returns the data object, and all we care about + // is the list of installed packages from that last thing. + if (!er) return cb_(er, data) + + if (npm.config.get("rollback") === false) return cb_(er) + npm.rollbacks.push(targetFolder) + cb_(er, data) + } + + var bundled = [] + + log.silly("install write", "writing", target.name, target.version, "to", targetFolder) + chain( + [ [ cache.unpack, target.name, target.version, targetFolder, null, null, user, group ], + function writePackageJSON (cb) { + var jsonPath = path.resolve(targetFolder, 'package.json') + log.verbose('write', 'writing to', jsonPath) + writeFileAtomic(jsonPath, JSON.stringify(target, null, 2) + '\n', cb) + }, + [ lifecycle, target, "preinstall", targetFolder ], + function collectBundled (cb) { + if (!target.bundleDependencies) return cb() + + var bd = path.resolve(targetFolder, "node_modules") + fs.readdir(bd, function (er, b) { + // nothing bundled, maybe + if (er) return cb() + bundled = b || [] + cb() + }) + } ] + + // nest the chain so that we can throw away the results returned + // up until this point, since we really don't care about it. + , function X (er) { + if (er) return cb(er) + + // before continuing to installing dependencies, check for a shrinkwrap. + var opt = { dev: npm.config.get("dev") } + readDependencies(context, targetFolder, opt, function (er, data, wrap) { + if (er) return cb(er); + var deps = prepareForInstallMany(data, "dependencies", bundled, wrap, + family) + var depsTargetFolder = targetFolder + var depsContext = { family: family + , ancestors: context.ancestors + , parent: target + , explicit: false + , wrap: wrap } + + var actions = + [ [ installManyAndBuild, deps, depsTargetFolder, depsContext ] ] + + // FIXME: This is an accident waiting to happen! + // + // 1. If multiple children at the same level of the tree share a + // peerDependency that's not in the parent's dependencies, because + // the peerDeps don't get added to the family, they will keep + // getting reinstalled (worked around by inflighting installOne). + // 2. The installer can't safely build at the parent level because + // that's already being done by the parent's installAndBuild. This + // runs the risk of the peerDependency never getting built. + // + // The fix: Don't install peerDependencies; require them to be + // included as explicit dependencies / devDependencies, and warn + // or error when they're missing. See #5080 for more arguments in + // favor of killing implicit peerDependency installs with fire. + var peerDeps = prepareForInstallMany(data, "peerDependencies", bundled, + wrap, family) + peerDeps.forEach(function (pd) { + warnPeers([ + "The peer dependency "+pd+" included from "+data.name+" will no", + "longer be automatically installed to fulfill the peerDependency ", + "in npm 3+. Your application will need to depend on it explicitly." + ], pd+","+data.name) + }) + + // Package scopes cause an addditional tree level which needs to be + // considered when resolving a peerDependency's target folder. + var pdTargetFolder + if (npa(target.name).scope) { + pdTargetFolder = path.resolve(targetFolder, '../../..') + } else { + pdTargetFolder = path.resolve(targetFolder, '../..') + } + + var pdContext = context + if (peerDeps.length > 0) { + actions.push( + [ installMany, peerDeps, pdTargetFolder, pdContext ] + ) + } + + chain(actions, cb) + }) + }) +} + +function installManyAndBuild (deps, targetFolder, context, cb) { + installMany(deps, targetFolder, context, function (er, d) { + log.verbose("about to build", targetFolder) + if (er) return cb(er) + npm.commands.build( [targetFolder] + , npm.config.get("global") + , true + , function (er) { return cb(er, d) }) + }) +} + +function prepareForInstallMany (packageData, depsKey, bundled, wrap, family) { + var deps = Object.keys(packageData[depsKey] || {}) + + // don't install bundleDependencies, unless they're missing. + if (packageData.bundleDependencies) { + deps = deps.filter(function (d) { + return packageData.bundleDependencies.indexOf(d) === -1 || + bundled.indexOf(d) === -1 + }) + } + + return deps.filter(function (d) { + // prefer to not install things that are satisfied by + // something in the "family" list, unless we're installing + // from a shrinkwrap. + if (depsKey !== "peerDependencies" && wrap) return true + if (semver.validRange(family[d], true)) { + return !semver.satisfies(family[d], packageData[depsKey][d], true) + } + return true + }).map(function (d) { + var v = packageData[depsKey][d] + var t = d + "@" + v + log.silly("prepareForInstallMany", "adding", t, "from", packageData.name, depsKey) + return t + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/link.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/link.js new file mode 100644 index 00000000..19c5dd06 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/link.js @@ -0,0 +1,170 @@ +// link with no args: symlink the folder to the global location +// link with package arg: symlink the global to the local + +var npm = require("./npm.js") + , symlink = require("./utils/link.js") + , fs = require("graceful-fs") + , log = require("npmlog") + , asyncMap = require("slide").asyncMap + , chain = require("slide").chain + , path = require("path") + , build = require("./build.js") + , npa = require("npm-package-arg") + +module.exports = link + +link.usage = "npm link (in package dir)" + + "\nnpm link (link global into local)" + +link.completion = function (opts, cb) { + var dir = npm.globalDir + fs.readdir(dir, function (er, files) { + cb(er, files.filter(function (f) { + return !f.match(/^[\._-]/) + })) + }) +} + +function link (args, cb) { + if (process.platform === 'win32') { + var semver = require('semver') + if (!semver.gte(process.version, '0.7.9')) { + var msg = 'npm link not supported on windows prior to node 0.7.9' + var e = new Error(msg) + e.code = 'ENOTSUP' + e.errno = require('constants').ENOTSUP + return cb(e) + } + } + + if (npm.config.get("global")) { + return cb(new Error("link should never be --global.\n" + +"Please re-run this command with --local")) + } + + if (args.length === 1 && args[0] === ".") args = [] + if (args.length) return linkInstall(args, cb) + linkPkg(npm.prefix, cb) +} + +function linkInstall (pkgs, cb) { + asyncMap(pkgs, function (pkg, cb) { + var t = path.resolve(npm.globalDir, "..") + , pp = path.resolve(npm.globalDir, pkg) + , rp = null + , target = path.resolve(npm.dir, pkg) + + function n (er, data) { + if (er) return cb(er, data) + // install returns [ [folder, pkgId], ... ] + // but we definitely installed just one thing. + var d = data.filter(function (d) { return !d[3] }) + var what = npa(d[0][0]) + pp = d[0][1] + pkg = what.name + target = path.resolve(npm.dir, pkg) + next() + } + + // if it's a folder, a random not-installed thing, or not a scoped package, + // then link or install it first + if (pkg[0] !== "@" && (pkg.indexOf("/") !== -1 || pkg.indexOf("\\") !== -1)) { + return fs.lstat(path.resolve(pkg), function (er, st) { + if (er || !st.isDirectory()) { + npm.commands.install(t, pkg, n) + } else { + rp = path.resolve(pkg) + linkPkg(rp, n) + } + }) + } + + fs.lstat(pp, function (er, st) { + if (er) { + rp = pp + return npm.commands.install(t, pkg, n) + } else if (!st.isSymbolicLink()) { + rp = pp + next() + } else { + return fs.realpath(pp, function (er, real) { + if (er) log.warn("invalid symbolic link", pkg) + else rp = real + next() + }) + } + }) + + function next () { + chain + ( [ [function (cb) { + log.verbose("link", "symlinking %s to %s", pp, target) + cb() + }] + , [symlink, pp, target] + // do not run any scripts + , rp && [build, [target], npm.config.get("global"), build._noLC, true] + , [ resultPrinter, pkg, pp, target, rp ] ] + , cb ) + } + }, cb) +} + +function linkPkg (folder, cb_) { + var me = folder || npm.prefix + , readJson = require("read-package-json") + + log.verbose("linkPkg", folder) + + readJson(path.resolve(me, "package.json"), function (er, d) { + function cb (er) { + return cb_(er, [[d && d._id, target, null, null]]) + } + if (er) return cb(er) + if (!d.name) { + er = new Error("Package must have a name field to be linked") + return cb(er) + } + var target = path.resolve(npm.globalDir, d.name) + symlink(me, target, false, true, function (er) { + if (er) return cb(er) + log.verbose("link", "build target", target) + // also install missing dependencies. + npm.commands.install(me, [], function (er) { + if (er) return cb(er) + // build the global stuff. Don't run *any* scripts, because + // install command already will have done that. + build([target], true, build._noLC, true, function (er) { + if (er) return cb(er) + resultPrinter(path.basename(me), me, target, cb) + }) + }) + }) + }) +} + +function resultPrinter (pkg, src, dest, rp, cb) { + if (typeof cb !== "function") cb = rp, rp = null + var where = dest + rp = (rp || "").trim() + src = (src || "").trim() + // XXX If --json is set, then look up the data from the package.json + if (npm.config.get("parseable")) { + return parseableOutput(dest, rp || src, cb) + } + if (rp === src) rp = null + console.log(where + " -> " + src + (rp ? " -> " + rp: "")) + cb() +} + +function parseableOutput (dest, rp, cb) { + // XXX this should match ls --parseable and install --parseable + // look up the data from package.json, format it the same way. + // + // link is always effectively "long", since it doesn't help much to + // *just* print the target folder. + // However, we don't actually ever read the version number, so + // the second field is always blank. + console.log(dest + "::" + rp) + cb() +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/logout.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/logout.js new file mode 100644 index 00000000..64635be4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/logout.js @@ -0,0 +1,40 @@ +module.exports = logout + +var dezalgo = require("dezalgo") +var log = require("npmlog") + +var npm = require("./npm.js") +var mapToRegistry = require("./utils/map-to-registry.js") + +logout.usage = "npm logout [--registry] [--scope]" + +function logout (args, cb) { + npm.spinner.start() + cb = dezalgo(cb) + + mapToRegistry("/", npm.config, function (err, uri, auth, normalized) { + if (err) return cb(err) + + if (auth.token) { + log.verbose("logout", "clearing session token for", normalized) + npm.registry.logout(normalized, { auth: auth }, function (err) { + if (err) return cb(err) + + npm.config.clearCredentialsByURI(normalized) + npm.spinner.stop() + npm.config.save("user", cb) + }) + } + else if (auth.username || auth.password) { + log.verbose("logout", "clearing user credentials for", normalized) + npm.config.clearCredentialsByURI(normalized) + npm.spinner.stop() + npm.config.save("user", cb) + } + else { + cb(new Error( + "Not logged in to", normalized + ",", "so can't log out." + )) + } + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/ls.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/ls.js new file mode 100644 index 00000000..caba4900 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/ls.js @@ -0,0 +1,404 @@ + +// show the installed versions of packages +// +// --parseable creates output like this: +// ::: +// Flags are a :-separated list of zero or more indicators + +module.exports = exports = ls + +var npm = require("./npm.js") + , readInstalled = require("read-installed") + , log = require("npmlog") + , path = require("path") + , archy = require("archy") + , semver = require("semver") + , url = require("url") + , color = require("ansicolors") + , npa = require("npm-package-arg") + +ls.usage = "npm ls" + +ls.completion = require("./utils/completion/installed-deep.js") + +function ls (args, silent, cb) { + if (typeof cb !== "function") cb = silent, silent = false + + var dir = path.resolve(npm.dir, "..") + + // npm ls 'foo@~1.3' bar 'baz@<2' + if (!args) args = [] + else args = args.map(function (a) { + var p = npa(a) + , name = p.name + , ver = semver.validRange(p.rawSpec) || "" + + return [ name, ver ] + }) + + var depth = npm.config.get("depth") + var opt = { depth: depth, log: log.warn, dev: true } + readInstalled(dir, opt, function (er, data) { + pruneNestedExtraneous(data) + filterByEnv(data) + var bfs = bfsify(data, args) + , lite = getLite(bfs) + + if (er || silent) return cb(er, data, lite) + + var long = npm.config.get("long") + , json = npm.config.get("json") + , out + if (json) { + var seen = [] + var d = long ? bfs : lite + // the raw data can be circular + out = JSON.stringify(d, function (k, o) { + if (typeof o === "object") { + if (-1 !== seen.indexOf(o)) return "[Circular]" + seen.push(o) + } + return o + }, 2) + } else if (npm.config.get("parseable")) { + out = makeParseable(bfs, long, dir) + } else if (data) { + out = makeArchy(bfs, long, dir) + } + console.log(out) + + if (args.length && !data._found) process.exitCode = 1 + + // if any errors were found, then complain and exit status 1 + if (lite.problems && lite.problems.length) { + er = lite.problems.join("\n") + } + cb(er, data, lite) + }) +} + +function pruneNestedExtraneous (data, visited) { + visited = visited || [] + visited.push(data) + for (var i in data.dependencies) { + if (data.dependencies[i].extraneous) { + data.dependencies[i].dependencies = {} + } else if (visited.indexOf(data.dependencies[i]) === -1) { + pruneNestedExtraneous(data.dependencies[i], visited) + } + } +} + +function filterByEnv (data) { + var dev = npm.config.get("dev") + var production = npm.config.get("production") + if (dev === production) return + var dependencies = {} + var devDependencies = data.devDependencies || [] + Object.keys(data.dependencies).forEach(function (name) { + var keys = Object.keys(devDependencies) + if (production && keys.indexOf(name) !== -1) return + if (dev && keys.indexOf(name) === -1) return + dependencies[name] = data.dependencies[name] + }) + data.dependencies = dependencies +} + +function alphasort (a, b) { + a = a.toLowerCase() + b = b.toLowerCase() + return a > b ? 1 + : a < b ? -1 : 0 +} + +function isCruft (data) { + return data.extraneous && data.error && data.error.code === 'ENOTDIR' +} + +function getLite (data, noname, depth) { + var lite = {} + , maxDepth = npm.config.get("depth") + + if (typeof depth === 'undefined') depth = 0 + if (!noname && data.name) lite.name = data.name + if (data.version) lite.version = data.version + if (data.extraneous) { + lite.extraneous = true + lite.problems = lite.problems || [] + lite.problems.push( "extraneous: " + + data.name + "@" + data.version + + " " + (data.path || "") ) + } + + if (data._from) + lite.from = data._from + + if (data._resolved) + lite.resolved = data._resolved + + if (data.invalid) { + lite.invalid = true + lite.problems = lite.problems || [] + lite.problems.push( "invalid: " + + data.name + "@" + data.version + + " " + (data.path || "") ) + } + + if (data.peerInvalid) { + lite.peerInvalid = true + lite.problems = lite.problems || [] + lite.problems.push( "peer invalid: " + + data.name + "@" + data.version + + " " + (data.path || "") ) + } + + if (data.dependencies) { + var deps = Object.keys(data.dependencies) + if (deps.length) lite.dependencies = deps.map(function (d) { + var dep = data.dependencies[d] + if (typeof dep === "string") { + lite.problems = lite.problems || [] + var p + if (data.depth > maxDepth) { + p = "max depth reached: " + } else { + p = "missing: " + } + p += d + "@" + dep + + ", required by " + + data.name + "@" + data.version + lite.problems.push(p) + return [d, { required: dep.requiredBy, missing: true }] + } else if (dep.peerMissing) { + lite.problems = lite.problems || [] + dep.peerMissing.forEach(function (missing) { + var pdm = 'peer dep missing: ' + + missing.requires + + ', required by ' + + missing.requiredBy + lite.problems.push(pdm) + }) + return [d, { required: dep, peerMissing: true }] + } else if (npm.config.get('json')) { + if (depth === maxDepth) delete dep.dependencies + return [d, getLite(dep, true, depth + 1)] + } + return [d, getLite(dep, true)] + }).reduce(function (deps, d) { + if (d[1].problems) { + lite.problems = lite.problems || [] + lite.problems.push.apply(lite.problems, d[1].problems) + } + deps[d[0]] = d[1] + return deps + }, {}) + } + return lite +} + +function bfsify (root, args, current, queue, seen) { + // walk over the data, and turn it from this: + // +-- a + // | `-- b + // | `-- a (truncated) + // `--b (truncated) + // into this: + // +-- a + // `-- b + // which looks nicer + args = args || [] + current = current || root + queue = queue || [] + seen = seen || [root] + var deps = current.dependencies = current.dependencies || {} + Object.keys(deps).forEach(function (d) { + var dep = deps[d] + if (typeof dep !== "object") return + if (seen.indexOf(dep) !== -1) { + if (npm.config.get("parseable") || !npm.config.get("long")) { + delete deps[d] + return + } else { + dep = deps[d] = Object.create(dep) + dep.dependencies = {} + } + } + queue.push(dep) + seen.push(dep) + }) + + if (!queue.length) { + // if there were args, then only show the paths to found nodes. + return filterFound(root, args) + } + return bfsify(root, args, queue.shift(), queue, seen) +} + +function filterFound (root, args) { + if (!args.length) return root + var deps = root.dependencies + if (deps) Object.keys(deps).forEach(function (d) { + var dep = filterFound(deps[d], args) + + // see if this one itself matches + var found = false + for (var i = 0; !found && i < args.length; i ++) { + if (d === args[i][0]) { + found = semver.satisfies(dep.version, args[i][1], true) + } + } + // included explicitly + if (found) dep._found = true + // included because a child was included + if (dep._found && !root._found) root._found = 1 + // not included + if (!dep._found) delete deps[d] + }) + if (!root._found) root._found = false + return root +} + +function makeArchy (data, long, dir) { + var out = makeArchy_(data, long, dir, 0) + return archy(out, "", { unicode: npm.config.get("unicode") }) +} + +function makeArchy_ (data, long, dir, depth, parent, d) { + if (typeof data === "string") { + if (depth -1 <= npm.config.get("depth")) { + // just missing + var unmet = "UNMET DEPENDENCY" + if (npm.color) { + unmet = color.bgBlack(color.red(unmet)) + } + data = unmet + " " + d + "@" + data + } else { + data = d+"@"+ data + } + return data + } + + var out = {} + // the top level is a bit special. + out.label = data._id || "" + if (data._found === true && data._id) { + if (npm.color) { + out.label = color.bgBlack(color.yellow(out.label.trim())) + " " + } else { + out.label = out.label.trim() + " " + } + } + if (data.link) out.label += " -> " + data.link + + if (data.invalid) { + if (data.realName !== data.name) out.label += " ("+data.realName+")" + var invalid = "invalid" + if (npm.color) invalid = color.bgBlack(color.red(invalid)) + out.label += " " + invalid + } + + if (data.peerInvalid) { + var peerInvalid = "peer invalid" + if (npm.color) peerInvalid = color.bgBlack(color.red(peerInvalid)) + out.label += " " + peerInvalid + } + + if (data.extraneous && data.path !== dir) { + var extraneous = "extraneous" + if (npm.color) extraneous = color.bgBlack(color.green(extraneous)) + out.label += " " + extraneous + } + + // add giturl to name@version + if (data._resolved) { + var type = npa(data._resolved).type + var isGit = type === 'git' || type === 'hosted' + if (isGit) { + out.label += ' (' + data._resolved + ')' + } + } + + if (long) { + if (dir === data.path) out.label += "\n" + dir + out.label += "\n" + getExtras(data, dir) + } else if (dir === data.path) { + if (out.label) out.label += " " + out.label += dir + } + + // now all the children. + out.nodes = [] + if (depth <= npm.config.get("depth")) { + out.nodes = Object.keys(data.dependencies || {}) + .sort(alphasort).map(function (d) { + return makeArchy_(data.dependencies[d], long, dir, depth + 1, data, d) + }) + } + + if (out.nodes.length === 0 && data.path === dir) { + out.nodes = ["(empty)"] + } + + return out +} + +function getExtras (data) { + var extras = [] + + if (data.description) extras.push(data.description) + if (data.repository) extras.push(data.repository.url) + if (data.homepage) extras.push(data.homepage) + if (data._from) { + var from = data._from + if (from.indexOf(data.name + "@") === 0) { + from = from.substr(data.name.length + 1) + } + var u = url.parse(from) + if (u.protocol) extras.push(from) + } + return extras.join("\n") +} + + +function makeParseable (data, long, dir, depth, parent, d) { + depth = depth || 0 + + return [ makeParseable_(data, long, dir, depth, parent, d) ] + .concat(Object.keys(data.dependencies || {}) + .sort(alphasort).map(function (d) { + return makeParseable(data.dependencies[d], long, dir, depth + 1, data, d) + })) + .filter(function (x) { return x }) + .join("\n") +} + +function makeParseable_ (data, long, dir, depth, parent, d) { + if (data.hasOwnProperty("_found") && data._found !== true) return "" + + if (typeof data === "string") { + if (data.depth < npm.config.get("depth")) { + data = npm.config.get("long") + ? path.resolve(parent.path, "node_modules", d) + + ":"+d+"@"+JSON.stringify(data)+":INVALID:MISSING" + : "" + } else { + data = path.resolve(data.path || "", "node_modules", d || "") + + (npm.config.get("long") + ? ":" + d + "@" + JSON.stringify(data) + + ":" // no realpath resolved + + ":MAXDEPTH" + : "") + } + + return data + } + + if (!npm.config.get("long")) return data.path + + return data.path + + ":" + (data._id || "") + + ":" + (data.realPath !== data.path ? data.realPath : "") + + (data.extraneous ? ":EXTRANEOUS" : "") + + (data.invalid ? ":INVALID" : "") + + (data.peerInvalid ? ":PEERINVALID" : "") +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/npm.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/npm.js new file mode 100644 index 00000000..d349303a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/npm.js @@ -0,0 +1,475 @@ +;(function(){ +// windows: running "npm blah" in this folder will invoke WSH, not node. +if (typeof WScript !== "undefined") { + WScript.echo("npm does not work when run\n" + +"with the Windows Scripting Host\n\n" + +"'cd' to a different directory,\n" + +"or type 'npm.cmd ',\n" + +"or type 'node npm '.") + WScript.quit(1) + return +} + + +var EventEmitter = require("events").EventEmitter + , npm = module.exports = new EventEmitter() + , npmconf = require("./config/core.js") + , log = require("npmlog") + , gfs = require('graceful-fs') + , fs = gfs.gracefulify(require('fs')) + , path = require("path") + , abbrev = require("abbrev") + , which = require("which") + , CachingRegClient = require("./cache/caching-client.js") + , charSpin = require("char-spinner") + +npm.config = { + loaded: false, + get: function() { + throw new Error('npm.load() required') + }, + set: function() { + throw new Error('npm.load() required') + } +} + +npm.commands = {} + +npm.rollbacks = [] + +try { + // startup, ok to do this synchronously + var j = JSON.parse(fs.readFileSync( + path.join(__dirname, "../package.json"))+"") + npm.version = j.version +} catch (ex) { + try { + log.info("error reading version", ex) + } catch (er) {} + npm.version = ex +} + +var commandCache = {} + // short names for common things + , aliases = { "rm" : "uninstall" + , "r" : "uninstall" + , "un" : "uninstall" + , "unlink" : "uninstall" + , "remove" : "uninstall" + , "rb" : "rebuild" + , "list" : "ls" + , "la" : "ls" + , "ll" : "ls" + , "ln" : "link" + , "i" : "install" + , "isntall" : "install" + , "up" : "update" + , "upgrade" : "update" + , "c" : "config" + , "dist-tags" : "dist-tag" + , "info" : "view" + , "show" : "view" + , "find" : "search" + , "s" : "search" + , "se" : "search" + , "author" : "owner" + , "home" : "docs" + , "issues": "bugs" + , "unstar": "star" // same function + , "apihelp" : "help" + , "login": "adduser" + , "add-user": "adduser" + , "tst": "test" + , "t": "test" + , "find-dupes": "dedupe" + , "ddp": "dedupe" + , "v": "view" + , "verison": "version" + } + + , aliasNames = Object.keys(aliases) + // these are filenames in . + , cmdList = [ "install" + , "uninstall" + , "cache" + , "config" + , "set" + , "get" + , "update" + , "outdated" + , "prune" + , "pack" + , "dedupe" + + , "rebuild" + , "link" + + , "publish" + , "star" + , "stars" + , "tag" + , "adduser" + , "logout" + , "unpublish" + , "owner" + , "access" + , "team" + , "deprecate" + , "shrinkwrap" + + , "help" + , "help-search" + , "ls" + , "search" + , "view" + , "init" + , "version" + , "edit" + , "explore" + , "docs" + , "repo" + , "bugs" + , "faq" + , "root" + , "prefix" + , "bin" + , "whoami" + , "dist-tag" + , "ping" + + , "test" + , "stop" + , "start" + , "restart" + , "run-script" + , "completion" + ] + , plumbing = [ "build" + , "unbuild" + , "xmas" + , "substack" + , "visnup" + ] + , littleGuys = [ "isntall", "verison" ] + , fullList = cmdList.concat(aliasNames).filter(function (c) { + return plumbing.indexOf(c) === -1 + }) + , abbrevs = abbrev(fullList) + +// we have our reasons +fullList = npm.fullList = fullList.filter(function (c) { + return littleGuys.indexOf(c) === -1 +}) + +npm.spinner = + { int: null + , started: false + , start: function () { + if (npm.spinner.int) return + var c = npm.config.get("spin") + if (!c) return + var stream = npm.config.get("logstream") + var opt = { tty: c !== "always", stream: stream } + opt.cleanup = !npm.spinner.started + npm.spinner.int = charSpin(opt) + npm.spinner.started = true + } + , stop: function () { + clearInterval(npm.spinner.int) + npm.spinner.int = null + } + } + +Object.keys(abbrevs).concat(plumbing).forEach(function addCommand (c) { + Object.defineProperty(npm.commands, c, { get : function () { + if (!loaded) throw new Error( + "Call npm.load(config, cb) before using this command.\n"+ + "See the README.md or cli.js for example usage.") + var a = npm.deref(c) + if (c === "la" || c === "ll") { + npm.config.set("long", true) + } + + npm.command = c + if (commandCache[a]) return commandCache[a] + + var cmd = require(__dirname+"/"+a+".js") + + commandCache[a] = function () { + var args = Array.prototype.slice.call(arguments, 0) + if (typeof args[args.length - 1] !== "function") { + args.push(defaultCb) + } + if (args.length === 1) args.unshift([]) + + npm.registry.version = npm.version + if (!npm.registry.refer) { + npm.registry.refer = [a].concat(args[0]).map(function (arg) { + // exclude anything that might be a URL, path, or private module + // Those things will always have a slash in them somewhere + if (arg && arg.match && arg.match(/\/|\\/)) { + return "[REDACTED]" + } else { + return arg + } + }).filter(function (arg) { + return arg && arg.match + }).join(" ") + } + + cmd.apply(npm, args) + } + + Object.keys(cmd).forEach(function (k) { + commandCache[a][k] = cmd[k] + }) + + return commandCache[a] + }, enumerable: fullList.indexOf(c) !== -1, configurable: true }) + + // make css-case commands callable via camelCase as well + if (c.match(/\-([a-z])/)) { + addCommand(c.replace(/\-([a-z])/g, function (a, b) { + return b.toUpperCase() + })) + } +}) + +function defaultCb (er, data) { + if (er) console.error(er.stack || er.message) + else console.log(data) +} + +npm.deref = function (c) { + if (!c) return "" + if (c.match(/[A-Z]/)) c = c.replace(/([A-Z])/g, function (m) { + return "-" + m.toLowerCase() + }) + if (plumbing.indexOf(c) !== -1) return c + var a = abbrevs[c] + if (aliases[a]) a = aliases[a] + return a +} + +var loaded = false + , loading = false + , loadErr = null + , loadListeners = [] + +function loadCb (er) { + loadListeners.forEach(function (cb) { + process.nextTick(cb.bind(npm, er, npm)) + }) + loadListeners.length = 0 +} + +npm.load = function (cli, cb_) { + if (!cb_ && typeof cli === "function") cb_ = cli , cli = {} + if (!cb_) cb_ = function () {} + if (!cli) cli = {} + loadListeners.push(cb_) + if (loaded || loadErr) return cb(loadErr) + if (loading) return + loading = true + var onload = true + + function cb (er) { + if (loadErr) return + loadErr = er + if (er) return cb_(er) + if (npm.config.get("force")) { + log.warn("using --force", "I sure hope you know what you are doing.") + } + npm.config.loaded = true + loaded = true + loadCb(loadErr = er) + onload = onload && npm.config.get('onload-script') + if (onload) { + try { + require(onload) + } catch (err) { + log.warn('onload-script', 'failed to require onload script', onload) + log.warn('onload-script', err) + } + onload = false + } + } + + log.pause() + + load(npm, cli, cb) +} + +function load (npm, cli, cb) { + which(process.argv[0], function (er, node) { + if (!er && node.toUpperCase() !== process.execPath.toUpperCase()) { + log.verbose("node symlink", node) + process.execPath = node + process.installPrefix = path.resolve(node, "..", "..") + } + + // look up configs + //console.error("about to look up configs") + + var builtin = path.resolve(__dirname, "..", "npmrc") + npmconf.load(cli, builtin, function (er, config) { + if (er === config) er = null + + npm.config = config + if (er) return cb(er) + + // if the "project" config is not a filename, and we're + // not in global mode, then that means that it collided + // with either the default or effective userland config + if (!config.get("global") + && config.sources.project + && config.sources.project.type !== "ini") { + log.verbose("config" + , "Skipping project config: %s. " + + "(matches userconfig)" + , config.localPrefix + "/.npmrc") + } + + // Include npm-version and node-version in user-agent + var ua = config.get("user-agent") || "" + ua = ua.replace(/\{node-version\}/gi, process.version) + ua = ua.replace(/\{npm-version\}/gi, npm.version) + ua = ua.replace(/\{platform\}/gi, process.platform) + ua = ua.replace(/\{arch\}/gi, process.arch) + config.set("user-agent", ua) + + var color = config.get("color") + + log.level = config.get("loglevel") + log.heading = config.get("heading") || "npm" + log.stream = config.get("logstream") + + switch (color) { + case "always": + log.enableColor() + npm.color = true + break + case false: + log.disableColor() + npm.color = false + break + default: + var tty = require("tty") + if (process.stdout.isTTY) npm.color = true + else if (!tty.isatty) npm.color = true + else if (tty.isatty(1)) npm.color = true + else npm.color = false + break + } + + log.resume() + + // at this point the configs are all set. + // go ahead and spin up the registry client. + npm.registry = new CachingRegClient(npm.config) + + var umask = npm.config.get("umask") + npm.modes = { exec: 0777 & (~umask) + , file: 0666 & (~umask) + , umask: umask } + + var gp = Object.getOwnPropertyDescriptor(config, "globalPrefix") + Object.defineProperty(npm, "globalPrefix", gp) + + var lp = Object.getOwnPropertyDescriptor(config, "localPrefix") + Object.defineProperty(npm, "localPrefix", lp) + + return cb(null, npm) + }) + }) +} + +Object.defineProperty(npm, "prefix", + { get : function () { + return npm.config.get("global") ? npm.globalPrefix : npm.localPrefix + } + , set : function (r) { + var k = npm.config.get("global") ? "globalPrefix" : "localPrefix" + return npm[k] = r + } + , enumerable : true + }) + +Object.defineProperty(npm, "bin", + { get : function () { + if (npm.config.get("global")) return npm.globalBin + return path.resolve(npm.root, ".bin") + } + , enumerable : true + }) + +Object.defineProperty(npm, "globalBin", + { get : function () { + var b = npm.globalPrefix + if (process.platform !== "win32") b = path.resolve(b, "bin") + return b + } + }) + +Object.defineProperty(npm, "dir", + { get : function () { + if (npm.config.get("global")) return npm.globalDir + return path.resolve(npm.prefix, "node_modules") + } + , enumerable : true + }) + +Object.defineProperty(npm, "globalDir", + { get : function () { + return (process.platform !== "win32") + ? path.resolve(npm.globalPrefix, "lib", "node_modules") + : path.resolve(npm.globalPrefix, "node_modules") + } + , enumerable : true + }) + +Object.defineProperty(npm, "root", + { get : function () { return npm.dir } }) + +Object.defineProperty(npm, "cache", + { get : function () { return npm.config.get("cache") } + , set : function (r) { return npm.config.set("cache", r) } + , enumerable : true + }) + +var tmpFolder +var rand = require("crypto").randomBytes(4).toString("hex") +Object.defineProperty(npm, "tmp", + { get : function () { + if (!tmpFolder) tmpFolder = "npm-" + process.pid + "-" + rand + return path.resolve(npm.config.get("tmp"), tmpFolder) + } + , enumerable : true + }) + +// the better to repl you with +Object.getOwnPropertyNames(npm.commands).forEach(function (n) { + if (npm.hasOwnProperty(n) || n === "config") return + + Object.defineProperty(npm, n, { get: function () { + return function () { + var args = Array.prototype.slice.call(arguments, 0) + , cb = defaultCb + + if (args.length === 1 && Array.isArray(args[0])) { + args = args[0] + } + + if (typeof args[args.length - 1] === "function") { + cb = args.pop() + } + + npm.commands[n](args, cb) + } + }, enumerable: false, configurable: true }) +}) + +if (require.main === module) { + require("../bin/npm-cli.js") +} +})() diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/outdated.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/outdated.js new file mode 100644 index 00000000..331809c9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/outdated.js @@ -0,0 +1,404 @@ +/* + +npm outdated [pkg] + +Does the following: + +1. check for a new version of pkg + +If no packages are specified, then run for all installed +packages. + +--parseable creates output like this: +::: + +*/ + +module.exports = outdated + +outdated.usage = "npm outdated [ [ ...]]" + +outdated.completion = require("./utils/completion/installed-deep.js") + + +var path = require("path") + , readJson = require("read-package-json") + , cache = require("./cache.js") + , asyncMap = require("slide").asyncMap + , npm = require("./npm.js") + , url = require("url") + , color = require("ansicolors") + , styles = require("ansistyles") + , table = require("text-table") + , semver = require("semver") + , os = require("os") + , mapToRegistry = require("./utils/map-to-registry.js") + , npa = require("npm-package-arg") + , readInstalled = require("read-installed") + , long = npm.config.get("long") + , log = require("npmlog") + +function outdated (args, silent, cb) { + if (typeof cb !== "function") cb = silent, silent = false + var dir = path.resolve(npm.dir, "..") + + // default depth for `outdated` is 0 (cf. `ls`) + if (npm.config.get("depth") === Infinity) npm.config.set("depth", 0) + + outdated_(args, dir, {}, 0, function (er, list) { + if (!list) list = [] + if (er || silent || list.length === 0) return cb(er, list) + list.sort(function(a, b) { + var aa = a[1].toLowerCase() + , bb = b[1].toLowerCase() + return aa === bb ? 0 + : aa < bb ? -1 : 1 + }) + if (npm.config.get("json")) { + console.log(makeJSON(list)) + } else if (npm.config.get("parseable")) { + console.log(makeParseable(list)) + } else { + var outList = list.map(makePretty) + var outHead = [ "Package" + , "Current" + , "Wanted" + , "Latest" + , "Location" + ] + if (long) outHead.push("Package Type") + var outTable = [outHead].concat(outList) + + if (npm.color) { + outTable[0] = outTable[0].map(function(heading) { + return styles.underline(heading) + }) + } + + var tableOpts = { align: ["l", "r", "r", "r", "l"] + , stringLength: function(s) { return ansiTrim(s).length } + } + console.log(table(outTable, tableOpts)) + } + cb(null, list) + }) +} + +// [[ dir, dep, has, want, latest, type ]] +function makePretty (p) { + var dep = p[1] + , dir = path.resolve(p[0], "node_modules", dep) + , has = p[2] + , want = p[3] + , latest = p[4] + , type = p[6] + + if (!npm.config.get("global")) { + dir = path.relative(process.cwd(), dir) + } + + var columns = [ dep + , has || "MISSING" + , want + , latest + , dirToPrettyLocation(dir) + ] + if (long) columns[5] = type + + if (npm.color) { + columns[0] = color[has === want ? "yellow" : "red"](columns[0]) // dep + columns[2] = color.green(columns[2]) // want + columns[3] = color.magenta(columns[3]) // latest + columns[4] = color.brightBlack(columns[4]) // dir + if (long) columns[5] = color.brightBlack(columns[5]) // type + } + + return columns +} + +function ansiTrim (str) { + var r = new RegExp("\x1b(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|" + + "\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)", "g") + return str.replace(r, "") +} + +function dirToPrettyLocation (dir) { + return dir.replace(/^node_modules[/\\]/, "") + .replace(/[[/\\]node_modules[/\\]/g, " > ") +} + +function makeParseable (list) { + return list.map(function (p) { + + var dep = p[1] + , dir = path.resolve(p[0], "node_modules", dep) + , has = p[2] + , want = p[3] + , latest = p[4] + , type = p[6] + + var out = [ dir + , dep + "@" + want + , (has ? (dep + "@" + has) : "MISSING") + , dep + "@" + latest + ] + if (long) out.push(type) + + return out.join(":") + }).join(os.EOL) +} + +function makeJSON (list) { + var out = {} + list.forEach(function (p) { + var dir = path.resolve(p[0], "node_modules", p[1]) + if (!npm.config.get("global")) { + dir = path.relative(process.cwd(), dir) + } + out[p[1]] = { current: p[2] + , wanted: p[3] + , latest: p[4] + , location: dir + } + if (long) out[p[1]].type = p[6] + }) + return JSON.stringify(out, null, 2) +} + +function outdated_ (args, dir, parentHas, depth, cb) { + // get the deps from package.json, or {:"*"} + // asyncMap over deps: + // shouldHave = cache.add(dep, req).version + // if has === shouldHave then + // return outdated(args, dir/node_modules/dep, parentHas + has) + // else if dep in args or args is empty + // return [dir, dep, has, shouldHave] + + if (depth > npm.config.get("depth")) { + return cb(null, []) + } + var deps = null + var types = {} + readJson(path.resolve(dir, "package.json"), function (er, d) { + d = d || {} + if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) + deps = (er) ? true : (d.dependencies || {}) + if (!er) { + Object.keys(deps).forEach(function (k) { + types[k] = "dependencies" + }) + } + + if (npm.config.get("save-dev")) { + deps = d.devDependencies || {} + Object.keys(deps).forEach(function (k) { + types[k] = "devDependencies" + }) + + return next() + } + + if (npm.config.get("save")) { + // remove optional dependencies from dependencies during --save. + Object.keys(d.optionalDependencies || {}).forEach(function (k) { + delete deps[k] + }) + return next() + } + + if (npm.config.get("save-optional")) { + deps = d.optionalDependencies || {} + Object.keys(deps).forEach(function (k) { + types[k] = "optionalDependencies" + }) + return next() + } + + var doUpdate = npm.config.get("dev") || + (!npm.config.get("production") && + !Object.keys(parentHas).length && + !npm.config.get("global")) + + if (!er && d && doUpdate) { + Object.keys(d.devDependencies || {}).forEach(function (k) { + if (!(k in parentHas)) { + deps[k] = d.devDependencies[k] + types[k] = "devDependencies" + } + }) + } + return next() + }) + + var has = null + readInstalled(path.resolve(dir), { dev : true }, function (er, data) { + if (er) { + has = Object.create(parentHas) + return next() + } + var pkgs = Object.keys(data.dependencies) + pkgs = pkgs.filter(function (p) { + return !p.match(/^[\._-]/) + }) + asyncMap(pkgs, function (pkg, cb) { + var jsonFile = path.resolve(dir, "node_modules", pkg, "package.json") + readJson(jsonFile, function (er, d) { + if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) + if (d && d.name && d.private) delete deps[d.name] + cb(null, er ? [] : [[d.name, d.version, d._from]]) + }) + }, function (er, pvs) { + if (er) return cb(er) + has = Object.create(parentHas) + pvs.forEach(function (pv) { + has[pv[0]] = { + link: data.dependencies[pv[0]].link, + version: pv[1], + from: pv[2] + } + }) + + next() + }) + }) + + function next () { + if (!has || !deps) return + if (deps === true) { + deps = Object.keys(has).reduce(function (l, r) { + l[r] = "latest" + return l + }, {}) + } + + // now get what we should have, based on the dep. + // if has[dep] !== shouldHave[dep], then cb with the data + // otherwise dive into the folder + asyncMap(Object.keys(deps), function (dep, cb) { + if (!long) return shouldUpdate(args, dir, dep, has, deps[dep], depth, cb) + + shouldUpdate(args, dir, dep, has, deps[dep], depth, cb, types[dep]) + }, cb) + } +} + +function shouldUpdate (args, dir, dep, has, req, depth, cb, type) { + // look up the most recent version. + // if that's what we already have, or if it's not on the args list, + // then dive into it. Otherwise, cb() with the data. + + // { version: , from: } + var curr = has[dep] + + function skip (er) { + // show user that no viable version can be found + if (er) return cb(er) + outdated_( args + , path.resolve(dir, "node_modules", dep) + , has + , depth + 1 + , cb ) + } + + function doIt (wanted, latest) { + if (!long) { + return cb(null, [[ dir, dep, curr && curr.version, wanted, latest, req]]) + } + cb(null, [[ dir, dep, curr && curr.version, wanted, latest, req, type]]) + } + + if (args.length && args.indexOf(dep) === -1) return skip() + var parsed = npa(dep + '@' + req) + if (parsed.type === "git" || (parsed.hosted && parsed.hosted.type === "github")) { + return doIt("git", "git") + } + if (curr && curr.link) { + return doIt("linked", "linked") + } + + // search for the latest package + mapToRegistry(dep, npm.config, function (er, uri, auth) { + if (er) return cb(er) + + npm.registry.get(uri, { auth : auth }, updateDeps) + }) + + function updateLocalDeps (latestRegistryVersion) { + readJson(path.resolve(parsed.spec, 'package.json'), function (er, localDependency) { + if (er) return cb() + + var wanted = localDependency.version + var latest = localDependency.version + + if (latestRegistryVersion) { + latest = latestRegistryVersion + if (semver.lt(wanted, latestRegistryVersion)) { + wanted = latestRegistryVersion + req = dep + '@' + latest + } + } + + if (curr.version !== wanted) { + doIt(wanted, latest) + } else { + skip() + } + }) + } + + function updateDeps (er, d) { + if (er) { + if (parsed.type !== 'local') return cb(er) + return updateLocalDeps() + } + + if (!d || !d["dist-tags"] || !d.versions) return cb() + var l = d.versions[d["dist-tags"].latest] + if (!l) return cb() + + var r = req + if (d["dist-tags"][req]) + r = d["dist-tags"][req] + + if (semver.validRange(r, true)) { + // some kind of semver range. + // see if it's in the doc. + var vers = Object.keys(d.versions) + var v = semver.maxSatisfying(vers, r, true) + if (v) { + return onCacheAdd(null, d.versions[v]) + } + } + + // We didn't find the version in the doc. See if cache can find it. + cache.add(dep, req, null, false, onCacheAdd) + + function onCacheAdd(er, d) { + // if this fails, then it means we can't update this thing. + // it's probably a thing that isn't published. + if (er) { + if (er.code && er.code === "ETARGET") { + // no viable version found + return skip(er) + } + return skip() + } + + // check that the url origin hasn't changed (#1727) and that + // there is no newer version available + var dFromUrl = d._from && url.parse(d._from).protocol + var cFromUrl = curr && curr.from && url.parse(curr.from).protocol + + if (!curr || dFromUrl && cFromUrl && d._from !== curr.from + || d.version !== curr.version + || d.version !== l.version) { + if (parsed.type === 'local') return updateLocalDeps(l.version) + + doIt(d.version, l.version) + } + else { + skip() + } + } + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/owner.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/owner.js new file mode 100644 index 00000000..c9adb792 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/owner.js @@ -0,0 +1,254 @@ +module.exports = owner + +owner.usage = "npm owner add " + + "\nnpm owner rm " + + "\nnpm owner ls " + +var npm = require("./npm.js") + , log = require("npmlog") + , mapToRegistry = require("./utils/map-to-registry.js") + , readLocalPkg = require("./utils/read-local-package.js") + +owner.completion = function (opts, cb) { + var argv = opts.conf.argv.remain + if (argv.length > 4) return cb() + if (argv.length <= 2) { + var subs = ["add", "rm"] + if (opts.partialWord === "l") subs.push("ls") + else subs.push("ls", "list") + return cb(null, subs) + } + + npm.commands.whoami([], true, function (er, username) { + if (er) return cb() + + var un = encodeURIComponent(username) + var byUser, theUser + switch (argv[2]) { + case "ls": + // FIXME: there used to be registry completion here, but it stopped + // making sense somewhere around 50,000 packages on the registry + return cb() + + case "rm": + if (argv.length > 3) { + theUser = encodeURIComponent(argv[3]) + byUser = "-/by-user/" + theUser + "|" + un + return mapToRegistry(byUser, npm.config, function (er, uri, auth) { + if (er) return cb(er) + + console.error(uri) + npm.registry.get(uri, { auth : auth }, function (er, d) { + if (er) return cb(er) + // return the intersection + return cb(null, d[theUser].filter(function (p) { + // kludge for server adminery. + return un === "isaacs" || d[un].indexOf(p) === -1 + })) + }) + }) + } + // else fallthrough + case "add": + if (argv.length > 3) { + theUser = encodeURIComponent(argv[3]) + byUser = "-/by-user/" + theUser + "|" + un + return mapToRegistry(byUser, npm.config, function (er, uri, auth) { + if (er) return cb(er) + + console.error(uri) + npm.registry.get(uri, { auth : auth }, function (er, d) { + console.error(uri, er || d) + // return mine that they're not already on. + if (er) return cb(er) + var mine = d[un] || [] + , theirs = d[theUser] || [] + return cb(null, mine.filter(function (p) { + return theirs.indexOf(p) === -1 + })) + }) + }) + } + // just list all users who aren't me. + return mapToRegistry("-/users", npm.config, function (er, uri, auth) { + if (er) return cb(er) + + npm.registry.get(uri, { auth : auth }, function (er, list) { + if (er) return cb() + return cb(null, Object.keys(list).filter(function (n) { + return n !== un + })) + }) + }) + + default: + return cb() + } + }) +} + +function owner (args, cb) { + var action = args.shift() + switch (action) { + case "ls": case "list": return ls(args[0], cb) + case "add": return add(args[0], args[1], cb) + case "rm": case "remove": return rm(args[0], args[1], cb) + default: return unknown(action, cb) + } +} + +function ls (pkg, cb) { + if (!pkg) return readLocalPkg(function (er, pkg) { + if (er) return cb(er) + if (!pkg) return cb(owner.usage) + ls(pkg, cb) + }) + + mapToRegistry(pkg, npm.config, function (er, uri, auth) { + if (er) return cb(er) + + npm.registry.get(uri, { auth : auth }, function (er, data) { + var msg = "" + if (er) { + log.error("owner ls", "Couldn't get owner data", pkg) + return cb(er) + } + var owners = data.maintainers + if (!owners || !owners.length) msg = "admin party!" + else msg = owners.map(function (o) { + return o.name + " <" + o.email + ">" + }).join("\n") + console.log(msg) + cb(er, owners) + }) + }) +} + +function add (user, pkg, cb) { + if (!user) return cb(owner.usage) + if (!pkg) return readLocalPkg(function (er, pkg) { + if (er) return cb(er) + if (!pkg) return cb(new Error(owner.usage)) + add(user, pkg, cb) + }) + + log.verbose("owner add", "%s to %s", user, pkg) + mutate(pkg, user, function (u, owners) { + if (!owners) owners = [] + for (var i = 0, l = owners.length; i < l; i ++) { + var o = owners[i] + if (o.name === u.name) { + log.info( "owner add" + , "Already a package owner: " + o.name + " <" + o.email + ">") + return false + } + } + owners.push(u) + return owners + }, cb) +} + +function rm (user, pkg, cb) { + if (!pkg) return readLocalPkg(function (er, pkg) { + if (er) return cb(er) + if (!pkg) return cb(new Error(owner.usage)) + rm(user, pkg, cb) + }) + + log.verbose("owner rm", "%s from %s", user, pkg) + mutate(pkg, user, function (u, owners) { + var found = false + , m = owners.filter(function (o) { + var match = (o.name === user) + found = found || match + return !match + }) + if (!found) { + log.info("owner rm", "Not a package owner: " + user) + return false + } + if (!m.length) return new Error( + "Cannot remove all owners of a package. Add someone else first.") + return m + }, cb) +} + +function mutate (pkg, user, mutation, cb) { + if (user) { + var byUser = "-/user/org.couchdb.user:" + user + mapToRegistry(byUser, npm.config, function (er, uri, auth) { + if (er) return cb(er) + + npm.registry.get(uri, { auth : auth }, mutate_) + }) + } else { + mutate_(null, null) + } + + function mutate_ (er, u) { + if (!er && user && (!u || u.error)) er = new Error( + "Couldn't get user data for " + user + ": " + JSON.stringify(u)) + + if (er) { + log.error("owner mutate", "Error getting user data for %s", user) + return cb(er) + } + + if (u) u = { "name" : u.name, "email" : u.email } + mapToRegistry(pkg, npm.config, function (er, uri, auth) { + if (er) return cb(er) + + npm.registry.get(uri, { auth : auth }, function (er, data) { + if (er) { + log.error("owner mutate", "Error getting package data for %s", pkg) + return cb(er) + } + + // save the number of maintainers before mutation so that we can figure + // out if maintainers were added or removed + var beforeMutation = data.maintainers.length + + var m = mutation(u, data.maintainers) + if (!m) return cb() // handled + if (m instanceof Error) return cb(m) // error + + data = { + _id : data._id, + _rev : data._rev, + maintainers : m + } + var dataPath = pkg.replace("/", "%2f") + "/-rev/" + data._rev + mapToRegistry(dataPath, npm.config, function (er, uri, auth) { + if (er) return cb(er) + + var params = { + method : "PUT", + body : data, + auth : auth + } + npm.registry.request(uri, params, function (er, data) { + if (!er && data.error) { + er = new Error("Failed to update package metadata: "+JSON.stringify(data)) + } + + if (er) { + log.error("owner mutate", "Failed to update package metadata") + } + else if (m.length > beforeMutation) { + console.log("+ %s (%s)", user, pkg) + } + else if (m.length < beforeMutation) { + console.log("- %s (%s)", user, pkg) + } + + cb(er, data) + }) + }) + }) + }) + } +} + +function unknown (action, cb) { + cb("Usage: \n" + owner.usage) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/pack.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/pack.js new file mode 100644 index 00000000..ab81cc20 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/pack.js @@ -0,0 +1,69 @@ +// npm pack +// Packs the specified package into a .tgz file, which can then +// be installed. + +module.exports = pack + +var npm = require("./npm.js") + , install = require("./install.js") + , cache = require("./cache.js") + , fs = require("graceful-fs") + , chain = require("slide").chain + , path = require("path") + , cwd = process.cwd() + , writeStreamAtomic = require('fs-write-stream-atomic') + , cachedPackageRoot = require("./cache/cached-package-root.js") + +pack.usage = "npm pack " + +// if it can be installed, it can be packed. +pack.completion = install.completion + +function pack (args, silent, cb) { + if (typeof cb !== "function") cb = silent, silent = false + + if (args.length === 0) args = ["."] + + chain(args.map(function (arg) { return function (cb) { + pack_(arg, cb) + }}), function (er, files) { + if (er || silent) return cb(er, files) + printFiles(files, cb) + }) +} + +function printFiles (files, cb) { + files = files.map(function (file) { + return path.relative(cwd, file) + }) + console.log(files.join("\n")) + cb() +} + +// add to cache, then cp to the cwd +function pack_ (pkg, cb) { + cache.add(pkg, null, null, false, function (er, data) { + if (er) return cb(er) + + // scoped packages get special treatment + var name = data.name + if (name[0] === "@") name = name.substr(1).replace(/\//g, "-") + var fname = name + "-" + data.version + ".tgz" + + var cached = path.join(cachedPackageRoot(data), "package.tgz") + , from = fs.createReadStream(cached) + , to = writeStreamAtomic(fname) + , errState = null + + from.on("error", cb_) + to.on("error", cb_) + to.on("close", cb_) + from.pipe(to) + + function cb_ (er) { + if (errState) return + if (er) return cb(errState = er) + cb(null, fname) + } + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/ping.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/ping.js new file mode 100644 index 00000000..23b18bfb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/ping.js @@ -0,0 +1,20 @@ +var npm = require('./npm.js') + +module.exports = ping + +ping.usage = 'npm ping\nping registry' + +function ping (args, silent, cb) { + if (typeof cb !== 'function') { + cb = silent + silent = false + } + var registry = npm.config.get('registry') + if (!registry) return cb(new Error('no default registry set')) + var auth = npm.config.getCredentialsByURI(registry) + + npm.registry.ping(registry, {auth: auth}, function (er, pong) { + if (!silent) console.log(JSON.stringify(pong)) + cb(er, er ? null : pong) + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/prefix.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/prefix.js new file mode 100644 index 00000000..e002edea --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/prefix.js @@ -0,0 +1,11 @@ +module.exports = prefix + +var npm = require("./npm.js") + +prefix.usage = "npm prefix\nnpm prefix -g\n(just prints the prefix folder)" + +function prefix (args, silent, cb) { + if (typeof cb !== "function") cb = silent, silent = false + if (!silent) console.log(npm.prefix) + process.nextTick(cb.bind(this, null, npm.prefix)) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/prune.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/prune.js new file mode 100644 index 00000000..edba8760 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/prune.js @@ -0,0 +1,56 @@ +// prune extraneous packages. + +module.exports = prune + +prune.usage = "npm prune" + +var readInstalled = require("read-installed") + , npm = require("./npm.js") + , path = require("path") + , readJson = require("read-package-json") + , log = require("npmlog") + +prune.completion = require("./utils/completion/installed-deep.js") + +function prune (args, cb) { + //check if is a valid package.json file + var jsonFile = path.resolve(npm.dir, "..", "package.json" ) + readJson(jsonFile, log.warn, function (er) { + if (er) return cb(er) + next() + }) + + function next() { + var opt = { + depth: npm.config.get("depth"), + dev: !npm.config.get("production") || npm.config.get("dev") + } + readInstalled(npm.prefix, opt, function (er, data) { + if (er) return cb(er) + prune_(args, data, cb) + }) + } +} + +function prune_ (args, data, cb) { + npm.commands.unbuild(prunables(args, data, []), cb) +} + +function prunables (args, data, seen) { + var deps = data.dependencies || {} + return Object.keys(deps).map(function (d) { + if (typeof deps[d] !== "object" + || seen.indexOf(deps[d]) !== -1) return null + seen.push(deps[d]) + if (deps[d].extraneous + && (args.length === 0 || args.indexOf(d) !== -1)) { + var extra = deps[d] + delete deps[d] + return extra.path + } + return prunables(args, deps[d], seen) + }).filter(function (d) { return d !== null }) + .reduce(function FLAT (l, r) { + return l.concat(Array.isArray(r) ? r.reduce(FLAT,[]) : r) + }, []) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/publish.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/publish.js new file mode 100644 index 00000000..8f1c73c3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/publish.js @@ -0,0 +1,151 @@ + +module.exports = publish + +var npm = require("./npm.js") + , log = require("npmlog") + , path = require("path") + , readJson = require("read-package-json") + , lifecycle = require("./utils/lifecycle.js") + , chain = require("slide").chain + , mapToRegistry = require("./utils/map-to-registry.js") + , cachedPackageRoot = require("./cache/cached-package-root.js") + , createReadStream = require("graceful-fs").createReadStream + , npa = require("npm-package-arg") + , semver = require('semver') + , getPublishConfig = require("./utils/get-publish-config.js") + +publish.usage = "npm publish [--tag ]" + + "\nnpm publish [--tag ]" + + "\n\nPublishes '.' if no argument supplied" + + "\n\nSets tag `latest` if no --tag specified" + +publish.completion = function (opts, cb) { + // publish can complete to a folder with a package.json + // or a tarball, or a tarball url. + // for now, not yet implemented. + return cb() +} + +function publish (args, isRetry, cb) { + if (typeof cb !== "function") { + cb = isRetry + isRetry = false + } + if (args.length === 0) args = ["."] + if (args.length !== 1) return cb(publish.usage) + + log.verbose("publish", args) + + var t = npm.config.get('tag').trim() + if (semver.validRange(t)) { + var er = new Error("Tag name must not be a valid SemVer range: " + t) + return cb(er) + } + + var arg = args[0] + // if it's a local folder, then run the prepublish there, first. + readJson(path.resolve(arg, "package.json"), function (er, data) { + if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) + + if (data) { + if (!data.name) return cb(new Error("No name provided")) + if (!data.version) return cb(new Error("No version provided")) + } + + // Error is OK. Could be publishing a URL or tarball, however, that means + // that we will not have automatically run the prepublish script, since + // that gets run when adding a folder to the cache. + if (er) return cacheAddPublish(arg, false, isRetry, cb) + else cacheAddPublish(arg, true, isRetry, cb) + }) +} + +// didPre in this case means that we already ran the prepublish script, +// and that the "dir" is an actual directory, and not something silly +// like a tarball or name@version thing. +// That means that we can run publish/postpublish in the dir, rather than +// in the cache dir. +function cacheAddPublish (dir, didPre, isRetry, cb) { + npm.commands.cache.add(dir, null, null, false, function (er, data) { + if (er) return cb(er) + log.silly("publish", data) + var cachedir = path.resolve(cachedPackageRoot(data), "package") + chain([ !didPre && + [lifecycle, data, "prepublish", cachedir] + , [publish_, dir, data, isRetry, cachedir] + , [lifecycle, data, "publish", didPre ? dir : cachedir] + , [lifecycle, data, "postpublish", didPre ? dir : cachedir] ] + , cb ) + }) +} + +function publish_ (arg, data, isRetry, cachedir, cb) { + if (!data) return cb(new Error("no package.json file found")) + + var mappedConfig = getPublishConfig( + data.publishConfig, + npm.config, + npm.registry + ) + var config = mappedConfig.config + var registry = mappedConfig.client + + data._npmVersion = npm.version + data._nodeVersion = process.versions.node + + delete data.modules + if (data.private) return cb( + new Error( + "This package has been marked as private\n" + + "Remove the 'private' field from the package.json to publish it." + ) + ) + + mapToRegistry(data.name, config, function (er, registryURI, auth, registryBase) { + if (er) return cb(er) + + var tarballPath = cachedir + ".tgz" + + // we just want the base registry URL in this case + log.verbose("publish", "registryBase", registryBase) + log.silly("publish", "uploading", tarballPath) + + data._npmUser = { + name : auth.username, + email : auth.email + } + + var params = { + metadata : data, + body : createReadStream(tarballPath), + auth : auth + } + + // registry-frontdoor cares about the access level, which is only + // configurable for scoped packages + if (config.get("access")) { + if (!npa(data.name).scope && config.get("access") === "restricted") { + return cb(new Error("Can't restrict access to unscoped packages.")) + } + + params.access = config.get("access") + } + + registry.publish(registryBase, params, function (er) { + if (er && er.code === "EPUBLISHCONFLICT" && + npm.config.get("force") && !isRetry) { + log.warn("publish", "Forced publish over " + data._id) + return npm.commands.unpublish([data._id], function (er) { + // ignore errors. Use the force. Reach out with your feelings. + // but if it fails again, then report the first error. + publish([arg], er || true, cb) + }) + } + // report the unpublish error if this was a retry and unpublish failed + if (er && isRetry && isRetry !== true) return cb(isRetry) + if (er) return cb(er) + console.log("+ " + data._id) + cb() + }) + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/rebuild.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/rebuild.js new file mode 100644 index 00000000..ab372c6e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/rebuild.js @@ -0,0 +1,73 @@ + +module.exports = rebuild + +var readInstalled = require("read-installed") + , semver = require("semver") + , log = require("npmlog") + , npm = require("./npm.js") + , npa = require("npm-package-arg") + +rebuild.usage = "npm rebuild [[@] [name[@] ...]]" + +rebuild.completion = require("./utils/completion/installed-deep.js") + +function rebuild (args, cb) { + var opt = { depth: npm.config.get("depth"), dev: true } + readInstalled(npm.prefix, opt, function (er, data) { + log.info("readInstalled", typeof data) + if (er) return cb(er) + var set = filter(data, args) + , folders = Object.keys(set).filter(function (f) { + return f !== npm.prefix + }) + if (!folders.length) return cb() + log.silly("rebuild set", folders) + cleanBuild(folders, set, cb) + }) +} + +function cleanBuild (folders, set, cb) { + npm.commands.build(folders, function (er) { + if (er) return cb(er) + console.log(folders.map(function (f) { + return set[f] + " " + f + }).join("\n")) + cb() + }) +} + +function filter (data, args, set, seen) { + if (!set) set = {} + if (!seen) seen = {} + if (set.hasOwnProperty(data.path)) return set + if (seen.hasOwnProperty(data.path)) return set + seen[data.path] = true + var pass + if (!args.length) pass = true // rebuild everything + else if (data.name && data._id) { + for (var i = 0, l = args.length; i < l; i ++) { + var arg = args[i] + , nv = npa(arg) + , n = nv.name + , v = nv.rawSpec + if (n !== data.name) continue + if (!semver.satisfies(data.version, v, true)) continue + pass = true + break + } + } + if (pass && data._id) { + log.verbose("rebuild", "path, id", [data.path, data._id]) + set[data.path] = data._id + } + // need to also dive through kids, always. + // since this isn't an install these won't get auto-built unless + // they're not dependencies. + Object.keys(data.dependencies || {}).forEach(function (d) { + // return + var dep = data.dependencies[d] + if (typeof dep === "string") return + filter(dep, args, set, seen) + }) + return set +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/repo.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/repo.js new file mode 100644 index 00000000..1b045477 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/repo.js @@ -0,0 +1,78 @@ + +module.exports = repo + +repo.usage = "npm repo " + +var npm = require("./npm.js") + , opener = require("opener") + , github = require("github-url-from-git") + , githubUserRepo = require("github-url-from-username-repo") + , path = require("path") + , readJson = require("read-package-json") + , fs = require("fs") + , url_ = require("url") + , mapToRegistry = require("./utils/map-to-registry.js") + , npa = require("npm-package-arg") + +repo.completion = function (opts, cb) { + // FIXME: there used to be registry completion here, but it stopped making + // sense somewhere around 50,000 packages on the registry + cb() +} + +function repo (args, cb) { + var n = args.length && npa(args[0]).name || "." + fs.stat(n, function (er, s) { + if (er && er.code === "ENOENT") return callRegistry(n, cb) + else if (er) return cb(er) + if (!s.isDirectory()) return callRegistry(n, cb) + readJson(path.resolve(n, "package.json"), function (er, d) { + if (er) return cb(er) + getUrlAndOpen(d, cb) + }) + }) +} + +function getUrlAndOpen (d, cb) { + var r = d.repository + if (!r) return cb(new Error("no repository")) + // XXX remove this when npm@v1.3.10 from node 0.10 is deprecated + // from https://github.com/npm/npm-www/issues/418 + if (githubUserRepo(r.url)) + r.url = githubUserRepo(r.url) + + var url = (r.url && ~r.url.indexOf("github")) + ? github(r.url) + : nonGithubUrl(r.url) + + if (!url) + return cb(new Error("no repository: could not get url")) + opener(url, { command: npm.config.get("browser") }, cb) +} + +function callRegistry (n, cb) { + mapToRegistry(n, npm.config, function (er, uri) { + if (er) return cb(er) + + npm.registry.get(uri + "/latest", { timeout : 3600 }, function (er, d) { + if (er) return cb(er) + getUrlAndOpen(d, cb) + }) + }) +} + +function nonGithubUrl (url) { + try { + var idx = url.indexOf("@") + if (idx !== -1) { + url = url.slice(idx+1).replace(/:([^\d]+)/, "/$1") + } + url = url_.parse(url) + var protocol = url.protocol === "https:" + ? "https:" + : "http:" + return protocol + "//" + (url.host || "") + + url.path.replace(/\.git$/, "") + } + catch(e) {} +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/restart.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/restart.js new file mode 100644 index 00000000..69c4b913 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/restart.js @@ -0,0 +1 @@ +module.exports = require("./utils/lifecycle.js").cmd("restart") diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/root.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/root.js new file mode 100644 index 00000000..b2f731ed --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/root.js @@ -0,0 +1,11 @@ +module.exports = root + +var npm = require("./npm.js") + +root.usage = "npm root\nnpm root -g\n(just prints the root folder)" + +function root (args, silent, cb) { + if (typeof cb !== "function") cb = silent, silent = false + if (!silent) console.log(npm.dir) + process.nextTick(cb.bind(this, null, npm.dir)) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/run-script.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/run-script.js new file mode 100644 index 00000000..2c805615 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/run-script.js @@ -0,0 +1,172 @@ +module.exports = runScript + +var lifecycle = require("./utils/lifecycle.js") + , npm = require("./npm.js") + , path = require("path") + , readJson = require("read-package-json") + , log = require("npmlog") + , chain = require("slide").chain + +runScript.usage = "npm run-script [-- ]" + +runScript.completion = function (opts, cb) { + + // see if there's already a package specified. + var argv = opts.conf.argv.remain + + if (argv.length >= 4) return cb() + + if (argv.length === 3) { + // either specified a script locally, in which case, done, + // or a package, in which case, complete against its scripts + var json = path.join(npm.localPrefix, "package.json") + return readJson(json, function (er, d) { + if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) + if (er) d = {} + var scripts = Object.keys(d.scripts || {}) + console.error("local scripts", scripts) + if (scripts.indexOf(argv[2]) !== -1) return cb() + // ok, try to find out which package it was, then + var pref = npm.config.get("global") ? npm.config.get("prefix") + : npm.localPrefix + var pkgDir = path.resolve( pref, "node_modules" + , argv[2], "package.json" ) + readJson(pkgDir, function (er, d) { + if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) + if (er) d = {} + var scripts = Object.keys(d.scripts || {}) + return cb(null, scripts) + }) + }) + } + + readJson(path.join(npm.localPrefix, "package.json"), function (er, d) { + if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) + d = d || {} + cb(null, Object.keys(d.scripts || {})) + }) +} + +function runScript (args, cb) { + if (!args.length) return list(cb) + + var pkgdir = npm.localPrefix + , cmd = args.shift() + + readJson(path.resolve(pkgdir, "package.json"), function (er, d) { + if (er) return cb(er) + run(d, pkgdir, cmd, args, cb) + }) +} + +function list(cb) { + var json = path.join(npm.localPrefix, "package.json") + var cmdList = [ "publish", "install", "uninstall" + , "test", "stop", "start", "restart", "version" + ].reduce(function (l, p) { + return l.concat(["pre" + p, p, "post" + p]) + }, []) + return readJson(json, function(er, d) { + if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) + if (er) d = {} + var allScripts = Object.keys(d.scripts || {}) + var scripts = [] + var runScripts = [] + allScripts.forEach(function (script) { + if (cmdList.indexOf(script) !== -1) scripts.push(script) + else runScripts.push(script) + }) + + if (log.level === "silent") { + return cb(null, allScripts) + } + + if (npm.config.get("json")) { + console.log(JSON.stringify(d.scripts || {}, null, 2)) + return cb(null, allScripts) + } + + if (npm.config.get("parseable")) { + allScripts.forEach(function(script) { + console.log(script + ":" + d.scripts[script]) + }) + return cb(null, allScripts) + } + + var s = "\n " + var prefix = " " + if (scripts.length) { + console.log("Lifecycle scripts included in %s:", d.name) + } + scripts.forEach(function(script) { + console.log(prefix + script + s + d.scripts[script]) + }) + if (!scripts.length && runScripts.length) { + console.log("Scripts available in %s via `npm run-script`:", d.name) + } + else if (runScripts.length) { + console.log("\navailable via `npm run-script`:") + } + runScripts.forEach(function(script) { + console.log(prefix + script + s + d.scripts[script]) + }) + return cb(null, allScripts) + }) +} + +function run (pkg, wd, cmd, args, cb) { + if (!pkg.scripts) pkg.scripts = {} + + var cmds + if (cmd === "restart" && !pkg.scripts.restart) { + cmds = [ + "prestop", "stop", "poststop", + "restart", + "prestart", "start", "poststart" + ] + } else { + if (!pkg.scripts[cmd]) { + if (cmd === "test") { + pkg.scripts.test = "echo \"Error: no test specified\"" + } else if (cmd === "env") { + if (process.platform === "win32") { + log.verbose("run-script using default platform env: SET (Windows)") + pkg.scripts[cmd] = "SET" + } else { + log.verbose("run-script using default platform env: env (Unix)") + pkg.scripts[cmd] = "env" + } + } else if (npm.config.get("if-present")) { + return cb(null); + } else { + return cb(new Error("missing script: " + cmd)) + } + } + cmds = [cmd] + } + + if (!cmd.match(/^(pre|post)/)) { + cmds = ["pre"+cmd].concat(cmds).concat("post"+cmd) + } + + log.verbose("run-script", cmds) + chain(cmds.map(function (c) { + // pass cli arguments after -- to script. + if (pkg.scripts[c] && c === cmd) { + pkg.scripts[c] = pkg.scripts[c] + joinArgs(args) + } + + // when running scripts explicitly, assume that they're trusted. + return [lifecycle, pkg, c, wd, true] + }), cb) +} + +// join arguments after '--' and pass them to script, +// handle special characters such as ', ", ' '. +function joinArgs (args) { + var joinedArgs = "" + args.forEach(function(arg) { + joinedArgs += ' "' + arg.replace(/"/g, '\\"') + '"' + }) + return joinedArgs +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/search.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/search.js new file mode 100644 index 00000000..840bc2f6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/search.js @@ -0,0 +1,269 @@ + +module.exports = exports = search + +var npm = require("./npm.js") + , columnify = require("columnify") + , updateIndex = require("./cache/update-index.js") + +search.usage = "npm search [some search terms ...]" + +search.completion = function (opts, cb) { + var compl = {} + , partial = opts.partialWord + , ipartial = partial.toLowerCase() + , plen = partial.length + + // get the batch of data that matches so far. + // this is an example of using npm.commands.search programmatically + // to fetch data that has been filtered by a set of arguments. + search(opts.conf.argv.remain.slice(2), true, function (er, data) { + if (er) return cb(er) + Object.keys(data).forEach(function (name) { + data[name].words.split(" ").forEach(function (w) { + if (w.toLowerCase().indexOf(ipartial) === 0) { + compl[partial + w.substr(plen)] = true + } + }) + }) + cb(null, Object.keys(compl)) + }) +} + +function search (args, silent, staleness, cb) { + if (typeof cb !== "function") cb = staleness, staleness = 600 + if (typeof cb !== "function") cb = silent, silent = false + + var searchopts = npm.config.get("searchopts") + var searchexclude = npm.config.get("searchexclude") + + if (typeof searchopts !== "string") searchopts = "" + searchopts = searchopts.split(/\s+/) + var opts = searchopts.concat(args).map(function (s) { + return s.toLowerCase() + }).filter(function (s) { return s }) + + if (typeof searchexclude === "string") { + searchexclude = searchexclude.split(/\s+/) + } else { + searchexclude = [] + } + searchexclude = searchexclude.map(function (s) { + return s.toLowerCase() + }) + + getFilteredData(staleness, opts, searchexclude, function (er, data) { + // now data is the list of data that we want to show. + // prettify and print it, and then provide the raw + // data to the cb. + if (er || silent) return cb(er, data) + console.log(prettify(data, args)) + cb(null, data) + }) +} + +function getFilteredData (staleness, args, notArgs, cb) { + updateIndex(staleness, function (er, data) { + if (er) return cb(er) + return cb(null, filter(data, args, notArgs)) + }) +} + +function filter (data, args, notArgs) { + // data={:{package data}} + return Object.keys(data).map(function (d) { + return data[d] + }).filter(function (d) { + return typeof d === "object" + }).map(stripData).map(getWords).filter(function (data) { + return filterWords(data, args, notArgs) + }).reduce(function (l, r) { + l[r.name] = r + return l + }, {}) +} + +function stripData (data) { + return { name: data.name + , description: npm.config.get("description") ? data.description : "" + , maintainers: (data.maintainers || []).map(function (m) { + return "=" + m.name + }) + , url: !Object.keys(data.versions || {}).length ? data.url : null + , keywords: data.keywords || [] + , version: Object.keys(data.versions || {})[0] || [] + , time: data.time + && data.time.modified + && (new Date(data.time.modified).toISOString() + .split("T").join(" ") + .replace(/:[0-9]{2}\.[0-9]{3}Z$/, "")) + .slice(0, -5) // remove time + || "prehistoric" + } +} + +function getWords (data) { + data.words = [ data.name ] + .concat(data.description) + .concat(data.maintainers) + .concat(data.url && ("<" + data.url + ">")) + .concat(data.keywords) + .map(function (f) { return f && f.trim && f.trim() }) + .filter(function (f) { return f }) + .join(" ") + .toLowerCase() + return data +} + +function filterWords (data, args, notArgs) { + var words = data.words + for (var i = 0, l = args.length; i < l; i ++) { + if (!match(words, args[i])) return false + } + for (i = 0, l = notArgs.length; i < l; i ++) { + if (match(words, notArgs[i])) return false + } + return true +} + +function match (words, arg) { + if (arg.charAt(0) === "/") { + arg = arg.replace(/\/$/, "") + arg = new RegExp(arg.substr(1, arg.length - 1)) + return words.match(arg) + } + return words.indexOf(arg) !== -1 +} + +function prettify (data, args) { + var searchsort = (npm.config.get("searchsort") || "NAME").toLowerCase() + , sortField = searchsort.replace(/^\-+/, "") + , searchRev = searchsort.charAt(0) === "-" + , truncate = !npm.config.get("long") + + if (Object.keys(data).length === 0) { + return "No match found for "+(args.map(JSON.stringify).join(" ")) + } + + var lines = Object.keys(data).map(function (d) { + // strip keyname + return data[d] + }).map(function(dat) { + dat.author = dat.maintainers + delete dat.maintainers + dat.date = dat.time + delete dat.time + return dat + }).map(function(dat) { + // split keywords on whitespace or , + if (typeof dat.keywords === "string") { + dat.keywords = dat.keywords.split(/[,\s]+/) + } + if (Array.isArray(dat.keywords)) { + dat.keywords = dat.keywords.join(" ") + } + + // split author on whitespace or , + if (typeof dat.author === "string") { + dat.author = dat.author.split(/[,\s]+/) + } + if (Array.isArray(dat.author)) { + dat.author = dat.author.join(" ") + } + return dat + }) + + lines.sort(function(a, b) { + var aa = a[sortField].toLowerCase() + , bb = b[sortField].toLowerCase() + return aa === bb ? 0 + : aa < bb ? -1 : 1 + }) + + if (searchRev) lines.reverse() + + var columns = npm.config.get("description") + ? ["name", "description", "author", "date", "version", "keywords"] + : ["name", "author", "date", "version", "keywords"] + + var output = columnify(lines, { + include: columns + , truncate: truncate + , config: { + name: { maxWidth: 40, truncate: false, truncateMarker: "" } + , description: { maxWidth: 60 } + , author: { maxWidth: 20 } + , date: { maxWidth: 11 } + , version: { maxWidth: 11 } + , keywords: { maxWidth: Infinity } + } + }) + output = trimToMaxWidth(output) + output = highlightSearchTerms(output, args) + + return output +} + +var colors = [31, 33, 32, 36, 34, 35 ] + , cl = colors.length + +function addColorMarker (str, arg, i) { + var m = i % cl + 1 + , markStart = String.fromCharCode(m) + , markEnd = String.fromCharCode(0) + + if (arg.charAt(0) === "/") { + //arg = arg.replace(/\/$/, "") + return str.replace( new RegExp(arg.substr(1, arg.length - 2), "gi") + , function (bit) { return markStart + bit + markEnd } ) + + } + + // just a normal string, do the split/map thing + var pieces = str.toLowerCase().split(arg.toLowerCase()) + , p = 0 + + return pieces.map(function (piece) { + piece = str.substr(p, piece.length) + var mark = markStart + + str.substr(p+piece.length, arg.length) + + markEnd + p += piece.length + arg.length + return piece + mark + }).join("") +} + +function colorize (line) { + for (var i = 0; i < cl; i ++) { + var m = i + 1 + var color = npm.color ? "\033["+colors[i]+"m" : "" + line = line.split(String.fromCharCode(m)).join(color) + } + var uncolor = npm.color ? "\033[0m" : "" + return line.split("\u0000").join(uncolor) +} + +function getMaxWidth() { + var cols + try { + var tty = require("tty") + , stdout = process.stdout + cols = !tty.isatty(stdout.fd) ? Infinity : process.stdout.getWindowSize()[0] + cols = (cols === 0) ? Infinity : cols + } catch (ex) { cols = Infinity } + return cols +} + +function trimToMaxWidth(str) { + var maxWidth = getMaxWidth() + return str.split("\n").map(function(line) { + return line.slice(0, maxWidth) + }).join("\n") +} + +function highlightSearchTerms(str, terms) { + terms.forEach(function (arg, i) { + str = addColorMarker(str, arg, i) + }) + + return colorize(str).trim() +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/set.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/set.js new file mode 100644 index 00000000..c83602ec --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/set.js @@ -0,0 +1,13 @@ + +module.exports = set + +set.usage = "npm set (See `npm config`)" + +var npm = require("./npm.js") + +set.completion = npm.commands.config.completion + +function set (args, cb) { + if (!args.length) return cb(set.usage) + npm.commands.config(["set"].concat(args), cb) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/shrinkwrap.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/shrinkwrap.js new file mode 100644 index 00000000..03192a3f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/shrinkwrap.js @@ -0,0 +1,86 @@ +// emit JSON describing versions of all packages currently installed (for later +// use with shrinkwrap install) + +module.exports = exports = shrinkwrap + +var npm = require("./npm.js") + , log = require("npmlog") + , fs = require("fs") + , writeFileAtomic = require("write-file-atomic") + , path = require("path") + , readJson = require("read-package-json") + , sortedObject = require("sorted-object") + +shrinkwrap.usage = "npm shrinkwrap" + +function shrinkwrap (args, silent, cb) { + if (typeof cb !== "function") cb = silent, silent = false + + if (args.length) { + log.warn("shrinkwrap", "doesn't take positional args") + } + + // https://github.com/npm/npm/issues/7641 + // introduced because `npm ls` can now show dev and prod depenednecy + // trees separately + if (npm.config.get("dev")) { + npm.config.set("production", true) + } + npm.commands.ls([], true, function (er, _, pkginfo) { + if (er) return cb(er) + shrinkwrap_(pkginfo, silent, npm.config.get("dev"), cb) + }) +} + +function shrinkwrap_ (pkginfo, silent, dev, cb) { + if (pkginfo.problems) { + return cb(new Error("Problems were encountered\n" + +"Please correct and try again.\n" + +pkginfo.problems.join("\n"))) + } + + if (!dev) { + // remove dev deps unless the user does --dev + readJson(path.resolve(npm.prefix, "package.json"), function (er, data) { + if (er) + return cb(er) + if (data.devDependencies) { + Object.keys(data.devDependencies).forEach(function (dep) { + if (data.dependencies && data.dependencies[dep]) { + // do not exclude the dev dependency if it's also listed as a dependency + return + } + + log.warn("shrinkwrap", "Excluding devDependency: %s", dep, data.dependencies) + delete pkginfo.dependencies[dep] + }) + } + save(pkginfo, silent, cb) + }) + } else { + save(pkginfo, silent, cb) + } +} + + +function save (pkginfo, silent, cb) { + // copy the keys over in a well defined order + // because javascript objects serialize arbitrarily + pkginfo.dependencies = sortedObject(pkginfo.dependencies || {}) + var swdata + try { + swdata = JSON.stringify(pkginfo, null, 2) + "\n" + } catch (er) { + log.error("shrinkwrap", "Error converting package info to json") + return cb(er) + } + + var file = path.resolve(npm.prefix, "npm-shrinkwrap.json") + + writeFileAtomic(file, swdata, function (er) { + if (er) return cb(er) + if (silent) return cb(null, pkginfo) + console.log("wrote npm-shrinkwrap.json") + cb(null, pkginfo) + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/star.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/star.js new file mode 100644 index 00000000..1f324336 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/star.js @@ -0,0 +1,41 @@ + +module.exports = star + +var npm = require("./npm.js") + , log = require("npmlog") + , asyncMap = require("slide").asyncMap + , mapToRegistry = require("./utils/map-to-registry.js") + +star.usage = "npm star [pkg, pkg, ...]\n" + + "npm unstar [pkg, pkg, ...]" + +star.completion = function (opts, cb) { + // FIXME: there used to be registry completion here, but it stopped making + // sense somewhere around 50,000 packages on the registry + cb() +} + +function star (args, cb) { + if (!args.length) return cb(star.usage) + var s = npm.config.get("unicode") ? "\u2605 " : "(*)" + , u = npm.config.get("unicode") ? "\u2606 " : "( )" + , using = !(npm.command.match(/^un/)) + if (!using) s = u + asyncMap(args, function (pkg, cb) { + mapToRegistry(pkg, npm.config, function (er, uri, auth) { + if (er) return cb(er) + + var params = { + starred : using, + auth : auth + } + npm.registry.star(uri, params, function (er, data, raw, req) { + if (!er) { + console.log(s + " "+pkg) + log.verbose("star", data) + } + cb(er, data, raw, req) + }) + }) + }, cb) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/stars.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/stars.js new file mode 100644 index 00000000..01ec76e4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/stars.js @@ -0,0 +1,46 @@ +module.exports = stars + +stars.usage = "npm stars [username]" + +var npm = require("./npm.js") + , log = require("npmlog") + , mapToRegistry = require("./utils/map-to-registry.js") + +function stars (args, cb) { + npm.commands.whoami([], true, function (er, username) { + var name = args.length === 1 ? args[0] : username + + if (er) { + if (er.code === 'ENEEDAUTH' && !name) { + var needAuth = new Error("'npm stars' on your own user account requires auth") + needAuth.code = 'ENEEDAUTH' + return cb(needAuth) + } + + if (er.code !== 'ENEEDAUTH') return cb(er) + } + + mapToRegistry("", npm.config, function (er, uri, auth) { + if (er) return cb(er) + + var params = { + username : name, + auth : auth + } + npm.registry.stars(uri, params, showstars) + }) + }) + + function showstars (er, data) { + if (er) return cb(er) + + if (data.rows.length === 0) { + log.warn("stars", "user has not starred any packages.") + } else { + data.rows.forEach(function(a) { + console.log(a.value) + }) + } + cb() + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/start.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/start.js new file mode 100644 index 00000000..98823825 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/start.js @@ -0,0 +1 @@ +module.exports = require("./utils/lifecycle.js").cmd("start") diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/stop.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/stop.js new file mode 100644 index 00000000..8ea5ba6a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/stop.js @@ -0,0 +1 @@ +module.exports = require("./utils/lifecycle.js").cmd("stop") diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/substack.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/substack.js new file mode 100644 index 00000000..1929f187 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/substack.js @@ -0,0 +1,20 @@ +module.exports = substack +var npm = require("./npm.js") + +var isms = + [ "\033[32mbeep \033[35mboop\033[m" + , "Replace your configs with services" + , "SEPARATE ALL THE CONCERNS!" + , "MODULE ALL THE THINGS!" + , "\\o/" + , "but first, burritos" + , "full time mad scientist here" + , "c/,,\\" ] + +function substack (args, cb) { + var i = Math.floor(Math.random() * isms.length) + console.log(isms[i]) + var c = args.shift() + if (c) npm.commands[c](args, cb) + else cb() +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/tag.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/tag.js new file mode 100644 index 00000000..75da0b21 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/tag.js @@ -0,0 +1,41 @@ +// turns out tagging isn't very complicated +// all the smarts are in the couch. +module.exports = tag +tag.usage = "npm tag @ []" + +tag.completion = require("./unpublish.js").completion + +var npm = require("./npm.js") + , mapToRegistry = require("./utils/map-to-registry.js") + , npa = require("npm-package-arg") + , semver = require("semver") + , log = require("npmlog") + +function tag (args, cb) { + var thing = npa(args.shift() || "") + , project = thing.name + , version = thing.rawSpec + , t = args.shift() || npm.config.get("tag") + + t = t.trim() + + if (!project || !version || !t) return cb("Usage:\n"+tag.usage) + + if (semver.validRange(t)) { + var er = new Error("Tag name must not be a valid SemVer range: " + t) + return cb(er) + } + + log.warn("tag", "This command is deprecated. Use `npm dist-tag` instead.") + + mapToRegistry(project, npm.config, function (er, uri, auth) { + if (er) return cb(er) + + var params = { + version : version, + tag : t, + auth : auth + } + npm.registry.tag(uri, params, cb) + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/team.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/team.js new file mode 100644 index 00000000..324d8df5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/team.js @@ -0,0 +1,54 @@ +var mapToRegistry = require('./utils/map-to-registry.js') +var npm = require('./npm') + +module.exports = team + +team.subcommands = ['create', 'destroy', 'add', 'rm', 'ls', 'edit'] + +team.usage = + 'npm team create \n' + + 'npm team destroy \n' + + 'npm team add \n' + + 'npm team rm \n' + + 'npm team ls |\n' + + 'npm team edit ' + +team.completion = function (opts, cb) { + var argv = opts.conf.argv.remain + if (argv.length === 2) { + return cb(null, team.subcommands) + } + switch (argv[2]) { + case 'ls': + case 'create': + case 'destroy': + case 'add': + case 'rm': + case 'edit': + return cb(null, []) + default: + return cb(new Error(argv[2] + ' not recognized')) + } +} + +function team (args, cb) { + // Entities are in the format : + var cmd = args.shift() + var entity = (args.shift() || '').split(':') + return mapToRegistry('/', npm.config, function (err, uri, auth) { + if (err) { return cb(err) } + try { + return npm.registry.team(cmd, uri, { + auth: auth, + scope: entity[0], + team: entity[1], + user: args.shift() + }, function (err, data) { + !err && data && console.log(JSON.stringify(data, undefined, 2)) + cb(err, data) + }) + } catch (e) { + cb(e.message + '\n\nUsage:\n' + team.usage) + } + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/test.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/test.js new file mode 100644 index 00000000..dd4994cf --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/test.js @@ -0,0 +1,13 @@ +module.exports = test + +var testCmd = require("./utils/lifecycle.js").cmd("test") + +function test (args, cb) { + testCmd(args, function (er) { + if (!er) return cb() + if (er.code === "ELIFECYCLE") { + return cb("Test failed. See above for more details.") + } + return cb(er) + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/unbuild.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/unbuild.js new file mode 100644 index 00000000..d5fe0e6a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/unbuild.js @@ -0,0 +1,115 @@ +module.exports = unbuild +unbuild.usage = "npm unbuild \n(this is plumbing)" + +var readJson = require("read-package-json") + , gentlyRm = require("./utils/gently-rm.js") + , npm = require("./npm.js") + , path = require("path") + , isInside = require("path-is-inside") + , lifecycle = require("./utils/lifecycle.js") + , asyncMap = require("slide").asyncMap + , chain = require("slide").chain + , log = require("npmlog") + , build = require("./build.js") + +// args is a list of folders. +// remove any bins/etc, and then delete the folder. +function unbuild (args, silent, cb) { + if (typeof silent === "function") cb = silent, silent = false + asyncMap(args, unbuild_(silent), cb) +} + +function unbuild_ (silent) { return function (folder, cb_) { + function cb (er) { + cb_(er, path.relative(npm.root, folder)) + } + folder = path.resolve(folder) + var base = isInside(folder, npm.prefix) ? npm.prefix : folder + delete build._didBuild[folder] + log.verbose("unbuild", folder.substr(npm.prefix.length + 1)) + readJson(path.resolve(folder, "package.json"), function (er, pkg) { + // if no json, then just trash it, but no scripts or whatever. + if (er) return gentlyRm(folder, false, base, cb) + chain + ( [ [lifecycle, pkg, "preuninstall", folder, false, true] + , [lifecycle, pkg, "uninstall", folder, false, true] + , !silent && function(cb) { + console.log("unbuild " + pkg._id) + cb() + } + , [rmStuff, pkg, folder] + , [lifecycle, pkg, "postuninstall", folder, false, true] + , [gentlyRm, folder, false, base] ] + , cb ) + }) +}} + +function rmStuff (pkg, folder, cb) { + // if it's global, and folder is in {prefix}/node_modules, + // then bins are in {prefix}/bin + // otherwise, then bins are in folder/../.bin + var parent = path.dirname(folder) + , gnm = npm.dir + , top = gnm === parent + + log.verbose("unbuild rmStuff", pkg._id, "from", gnm) + if (!top) log.verbose("unbuild rmStuff", "in", parent) + asyncMap([rmBins, rmMans], function (fn, cb) { + fn(pkg, folder, parent, top, cb) + }, cb) +} + +function rmBins (pkg, folder, parent, top, cb) { + if (!pkg.bin) return cb() + var binRoot = top ? npm.bin : path.resolve(parent, ".bin") + asyncMap(Object.keys(pkg.bin), function (b, cb) { + if (process.platform === "win32") { + chain([ [gentlyRm, path.resolve(binRoot, b) + ".cmd", true] + , [gentlyRm, path.resolve(binRoot, b), true] ], cb) + } else { + gentlyRm(path.resolve(binRoot, b), true, cb) + } + }, cb) +} + +function rmMans (pkg, folder, parent, top, cb) { + if (!pkg.man + || !top + || process.platform === "win32" + || !npm.config.get("global")) { + return cb() + } + var manRoot = path.resolve(npm.config.get("prefix"), "share", "man") + log.verbose("rmMans", "man files are", pkg.man, "in", manRoot) + asyncMap(pkg.man, function (man, cb) { + if (Array.isArray(man)) { + man.forEach(rmMan) + } else { + rmMan(man) + } + + function rmMan (man) { + log.silly("rmMan", "preparing to remove", man) + var parseMan = man.match(/(.*\.([0-9]+)(\.gz)?)$/) + if (!parseMan) { + log.error( + "rmMan", man, "is not a valid name for a man file.", + "Man files must end with a number, " + + "and optionally a .gz suffix if they are compressed." + ) + return cb() + } + + var stem = parseMan[1] + var sxn = parseMan[2] + var gz = parseMan[3] || "" + var bn = path.basename(stem) + var manDest = path.join( + manRoot, + "man"+sxn, + (bn.indexOf(pkg.name) === 0 ? bn : pkg.name+"-"+bn)+"."+sxn+gz + ) + gentlyRm(manDest, true, cb) + } + }, cb) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/uninstall.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/uninstall.js new file mode 100644 index 00000000..600c6819 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/uninstall.js @@ -0,0 +1,128 @@ + +// remove a package. + +module.exports = uninstall + +uninstall.usage = "npm uninstall [@ [[@] ...]" + + "\nnpm rm [@ [[@] ...]" + +uninstall.completion = require("./utils/completion/installed-shallow.js") + +var fs = require("graceful-fs") + , writeFileAtomic = require("write-file-atomic") + , log = require("npmlog") + , readJson = require("read-package-json") + , path = require("path") + , npm = require("./npm.js") + , asyncMap = require("slide").asyncMap + +function uninstall (args, cb) { + // this is super easy + // get the list of args that correspond to package names in either + // the global npm.dir, + // then call unbuild on all those folders to pull out their bins + // and mans and whatnot, and then delete the folder. + + var nm = npm.dir + if (args.length === 1 && args[0] === ".") args = [] + if (args.length) return uninstall_(args, nm, cb) + + // remove this package from the global space, if it's installed there + readJson(path.resolve(npm.localPrefix, "package.json"), function (er, pkg) { + if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) + if (er) return cb(uninstall.usage) + uninstall_( [pkg.name] + , npm.globalDir + , cb ) + }) + +} + +function uninstall_ (args, nm, cb) { + // if we've been asked to --save or --save-dev or --save-optional, + // then also remove it from the associated dependencies hash. + var s = npm.config.get('save') + , d = npm.config.get('save-dev') + , o = npm.config.get('save-optional') + if (s || d || o) { + cb = saver(args, nm, cb) + } + + asyncMap(args, function (arg, cb) { + // uninstall .. should not delete /usr/local/lib/node_modules/.. + var p = path.join(path.resolve(nm), path.join("/", arg)) + if (path.resolve(p) === nm) { + log.warn("uninstall", "invalid argument: %j", arg) + return cb(null, []) + } + fs.lstat(p, function (er) { + if (er) { + log.warn("uninstall", "not installed in %s: %j", nm, arg) + return cb(null, []) + } + cb(null, p) + }) + }, function (er, folders) { + if (er) return cb(er) + asyncMap(folders, npm.commands.unbuild, cb) + }) +} + +function saver (args, nm, cb_) { + return cb + function cb (er, data) { + var s = npm.config.get('save') + , d = npm.config.get('save-dev') + , o = npm.config.get('save-optional') + if (er || !(s || d || o)) return cb_(er, data) + var pj = path.resolve(nm, '..', 'package.json') + // don't use readJson here, because we don't want all the defaults + // filled in, for mans and other bs. + fs.readFile(pj, 'utf8', function (er, json) { + var pkg + try { + pkg = JSON.parse(json) + } catch (_) {} + if (!pkg) return cb_(null, data) + + var bundle + if (npm.config.get('save-bundle')) { + bundle = pkg.bundleDependencies || pkg.bundledDependencies + if (!Array.isArray(bundle)) bundle = undefined + } + + var changed = false + args.forEach(function (a) { + ; [ [s, 'dependencies'] + , [o, 'optionalDependencies'] + , [d, 'devDependencies'] ].forEach(function (f) { + var flag = f[0] + , field = f[1] + if (!flag || !pkg[field] || !pkg[field].hasOwnProperty(a)) return + changed = true + + if (bundle) { + var i = bundle.indexOf(a) + if (i !== -1) bundle.splice(i, 1) + } + + delete pkg[field][a] + }) + }) + if (!changed) return cb_(null, data) + + if (bundle) { + delete pkg.bundledDependencies + if (bundle.length) { + pkg.bundleDependencies = bundle + } else { + delete pkg.bundleDependencies + } + } + + writeFileAtomic(pj, JSON.stringify(pkg, null, 2) + "\n", function (er) { + return cb_(er, data) + }) + }) + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/unpublish.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/unpublish.js new file mode 100644 index 00000000..111f27aa --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/unpublish.js @@ -0,0 +1,115 @@ + +module.exports = unpublish + +var log = require("npmlog") +var npm = require("./npm.js") +var readJson = require("read-package-json") +var path = require("path") +var mapToRegistry = require("./utils/map-to-registry.js") +var npa = require("npm-package-arg") +var getPublishConfig = require("./utils/get-publish-config.js") + +unpublish.usage = "npm unpublish [@]" + +unpublish.completion = function (opts, cb) { + if (opts.conf.argv.remain.length >= 3) return cb() + npm.commands.whoami([], true, function (er, username) { + if (er) return cb() + + var un = encodeURIComponent(username) + if (!un) return cb() + var byUser = "-/by-user/" + un + mapToRegistry(byUser, npm.config, function (er, uri, auth) { + if (er) return cb(er) + + npm.registry.get(uri, { auth : auth }, function (er, pkgs) { + // do a bit of filtering at this point, so that we don't need + // to fetch versions for more than one thing, but also don't + // accidentally a whole project. + pkgs = pkgs[un] + if (!pkgs || !pkgs.length) return cb() + var pp = npa(opts.partialWord).name + pkgs = pkgs.filter(function (p) { + return p.indexOf(pp) === 0 + }) + if (pkgs.length > 1) return cb(null, pkgs) + mapToRegistry(pkgs[0], npm.config, function (er, uri, auth) { + if (er) return cb(er) + + npm.registry.get(uri, { auth : auth }, function (er, d) { + if (er) return cb(er) + var vers = Object.keys(d.versions) + if (!vers.length) return cb(null, pkgs) + return cb(null, vers.map(function (v) { + return pkgs[0] + "@" + v + })) + }) + }) + }) + }) + }) +} + +function unpublish (args, cb) { + if (args.length > 1) return cb(unpublish.usage) + + var thing = args.length ? npa(args[0]) : {} + , project = thing.name + , version = thing.rawSpec + + log.silly("unpublish", "args[0]", args[0]) + log.silly("unpublish", "thing", thing) + if (!version && !npm.config.get("force")) { + return cb("Refusing to delete entire project.\n" + + "Run with --force to do this.\n" + + unpublish.usage) + } + + if (!project || path.resolve(project) === npm.localPrefix) { + // if there's a package.json in the current folder, then + // read the package name and version out of that. + var cwdJson = path.join(npm.localPrefix, "package.json") + return readJson(cwdJson, function (er, data) { + if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) + if (er) return cb("Usage:\n" + unpublish.usage) + log.verbose('unpublish', data) + gotProject(data.name, data.version, data.publishConfig, cb) + }) + } + return gotProject(project, version, cb) +} + +function gotProject (project, version, publishConfig, cb_) { + if (typeof cb_ !== 'function') { + cb_ = publishConfig + publishConfig = null + } + + function cb (er) { + if (er) return cb_(er) + console.log("- " + project + (version ? "@" + version : "")) + cb_() + } + + var mappedConfig = getPublishConfig(publishConfig, npm.config, npm.registry) + var config = mappedConfig.config + var registry = mappedConfig.client + + // remove from the cache first + npm.commands.cache(["clean", project, version], function (er) { + if (er) { + log.error("unpublish", "Failed to clean cache") + return cb(er) + } + + mapToRegistry(project, config, function (er, uri, auth) { + if (er) return cb(er) + + var params = { + version: version, + auth: auth + } + registry.unpublish(uri, params, cb) + }) + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/update.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/update.js new file mode 100644 index 00000000..3e9438e9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/update.js @@ -0,0 +1,58 @@ +/* +for each pkg in prefix that isn't a git repo + look for a new version of pkg that satisfies dep + if so, install it. + if not, then update it +*/ + +module.exports = update + +update.usage = "npm update [pkg]" + +var npm = require("./npm.js") + , asyncMap = require("slide").asyncMap + , log = require("npmlog") + + // load these, just so that we know that they'll be available, in case + // npm itself is getting overwritten. + , install = require("./install.js") + , build = require("./build.js") + +update.completion = npm.commands.outdated.completion + +function update (args, cb) { + npm.commands.outdated(args, true, function (er, outdated) { + if (er) return cb(er) + + var wanted = outdated.filter(function (ww) { + var dep = ww[1] + var current = ww[2] + var wanted = ww[3] + var latest = ww[4] + if (current === wanted && wanted !== latest) { + log.verbose( + 'outdated', + 'not updating', dep, + "because it's currently at the maximum version that matches its specified semver range" + ) + } + return current !== wanted + }) + if (wanted.length === 0) return cb() + + log.info('outdated', 'updating', wanted) + asyncMap(wanted, function (ww, cb) { + // [[ dir, dep, has, want, req ]] + var where = ww[0] + , dep = ww[1] + , want = ww[3] + , what = dep + "@" + want + , req = ww[5] + , url = require('url') + + // use the initial installation method (repo, tar, git) for updating + if (url.parse(req).protocol) what = req + npm.commands.install(where, what, cb) + }, cb) + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/completion.sh b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/completion.sh new file mode 100644 index 00000000..25bef2c1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/completion.sh @@ -0,0 +1,58 @@ +#!/bin/bash +###-begin-npm-completion-### +# +# npm command completion script +# +# Installation: npm completion >> ~/.bashrc (or ~/.zshrc) +# Or, maybe: npm completion > /usr/local/etc/bash_completion.d/npm +# + +if type complete &>/dev/null; then + _npm_completion () { + local words cword + if type _get_comp_words_by_ref &>/dev/null; then + _get_comp_words_by_ref -n = -n @ -w words -i cword + else + cword="$COMP_CWORD" + words=("${COMP_WORDS[@]}") + fi + + local si="$IFS" + IFS=$'\n' COMPREPLY=($(COMP_CWORD="$cword" \ + COMP_LINE="$COMP_LINE" \ + COMP_POINT="$COMP_POINT" \ + npm completion -- "${words[@]}" \ + 2>/dev/null)) || return $? + IFS="$si" + } + complete -o default -F _npm_completion npm +elif type compdef &>/dev/null; then + _npm_completion() { + local si=$IFS + compadd -- $(COMP_CWORD=$((CURRENT-1)) \ + COMP_LINE=$BUFFER \ + COMP_POINT=0 \ + npm completion -- "${words[@]}" \ + 2>/dev/null) + IFS=$si + } + compdef _npm_completion npm +elif type compctl &>/dev/null; then + _npm_completion () { + local cword line point words si + read -Ac words + read -cn cword + let cword-=1 + read -l line + read -ln point + si="$IFS" + IFS=$'\n' reply=($(COMP_CWORD="$cword" \ + COMP_LINE="$line" \ + COMP_POINT="$point" \ + npm completion -- "${words[@]}" \ + 2>/dev/null)) || return $? + IFS="$si" + } + compctl -K _npm_completion npm +fi +###-end-npm-completion-### diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/completion/file-completion.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/completion/file-completion.js new file mode 100644 index 00000000..6ce2f834 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/completion/file-completion.js @@ -0,0 +1,23 @@ +module.exports = fileCompletion + +var mkdir = require("mkdirp") + , path = require("path") + , glob = require("glob") + +function fileCompletion (root, req, depth, cb) { + if (typeof cb !== "function") cb = depth, depth = Infinity + mkdir(root, function (er) { + if (er) return cb(er) + + // can be either exactly the req, or a descendent + var pattern = root + "/{" + req + "," + req + "/**/*}" + , opts = { mark: true, dot: true, maxDepth: depth } + glob(pattern, opts, function (er, files) { + if (er) return cb(er) + return cb(null, (files || []).map(function (f) { + var tail = f.substr(root.length + 1).replace(/^\//, "") + return path.join(req, tail) + })) + }) + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/completion/installed-deep.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/completion/installed-deep.js new file mode 100644 index 00000000..5fb67d26 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/completion/installed-deep.js @@ -0,0 +1,50 @@ +module.exports = installedDeep + +var npm = require("../../npm.js") + , readInstalled = require("read-installed") + +function installedDeep (opts, cb) { + var local + , global + , depth = npm.config.get("depth") + , opt = { depth: depth, dev: true } + + if (npm.config.get("global")) local = [], next() + else readInstalled(npm.prefix, opt, function (er, data) { + local = getNames(data || {}) + next() + }) + + readInstalled(npm.config.get("prefix"), opt, function (er, data) { + global = getNames(data || {}) + next() + }) + + function getNames_ (d, n) { + if (d.realName && n) { + if (n[d.realName]) return n + n[d.realName] = true + } + if (!n) n = {} + Object.keys(d.dependencies || {}).forEach(function (dep) { + getNames_(d.dependencies[dep], n) + }) + return n + } + function getNames (d) { + return Object.keys(getNames_(d)) + } + + function next () { + if (!local || !global) return + if (!npm.config.get("global")) { + global = global.map(function (g) { + return [g, "-g"] + }) + } + var names = local.concat(global) + return cb(null, names) + } + +} + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/completion/installed-shallow.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/completion/installed-shallow.js new file mode 100644 index 00000000..8d64649d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/completion/installed-shallow.js @@ -0,0 +1,79 @@ + +module.exports = installedShallow + +var npm = require("../../npm.js") + , fs = require("graceful-fs") + , path = require("path") + , readJson = require("read-package-json") + , asyncMap = require("slide").asyncMap + +function installedShallow (opts, filter, cb) { + if (typeof cb !== "function") cb = filter, filter = null + var conf = opts.conf + , args = conf.argv.remain + if (args.length > 3) return cb() + var local + , global + , localDir = npm.dir + , globalDir = npm.globalDir + if (npm.config.get("global")) local = [], next() + else fs.readdir(localDir, function (er, pkgs) { + local = (pkgs || []).filter(function (p) { + return p.charAt(0) !== "." + }) + next() + }) + fs.readdir(globalDir, function (er, pkgs) { + global = (pkgs || []).filter(function (p) { + return p.charAt(0) !== "." + }) + next() + }) + function next () { + if (!local || !global) return + filterInstalled(local, global, filter, cb) + } +} + +function filterInstalled (local, global, filter, cb) { + var fl + , fg + + if (!filter) { + fl = local + fg = global + return next() + } + + asyncMap(local, function (p, cb) { + readJson(path.join(npm.dir, p, "package.json"), function (er, d) { + if (!d || !filter(d)) return cb(null, []) + return cb(null, d.name) + }) + }, function (er, local) { + fl = local || [] + next() + }) + + var globalDir = npm.globalDir + asyncMap(global, function (p, cb) { + readJson(path.join(globalDir, p, "package.json"), function (er, d) { + if (!d || !filter(d)) return cb(null, []) + return cb(null, d.name) + }) + }, function (er, global) { + fg = global || [] + next() + }) + + function next () { + if (!fg || !fl) return + if (!npm.config.get("global")) { + fg = fg.map(function (g) { + return [g, "-g"] + }) + } + console.error("filtered", fl, fg) + return cb(null, fl.concat(fg)) + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/correct-mkdir.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/correct-mkdir.js new file mode 100644 index 00000000..68c4a4ad --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/correct-mkdir.js @@ -0,0 +1,123 @@ +var chownr = require('chownr') +var dezalgo = require('dezalgo') +var fs = require('graceful-fs') +var inflight = require('inflight') +var log = require('npmlog') +var mkdirp = require('mkdirp') + +// memoize the directories created by this step +var stats = {} +var effectiveOwner +module.exports = function correctMkdir (path, cb) { + cb = dezalgo(cb) + cb = inflight('correctMkdir:' + path, cb) + if (!cb) { + return log.verbose('correctMkdir', path, 'correctMkdir already in flight; waiting') + } else { + log.verbose('correctMkdir', path, 'correctMkdir not in flight; initializing') + } + + if (stats[path]) return cb(null, stats[path]) + + fs.stat(path, function (er, st) { + if (er) return makeDirectory(path, cb) + + if (!st.isDirectory()) { + log.error('correctMkdir', 'invalid dir %s', path) + return cb(er) + } + + var ownerStats = calculateOwner() + // there's always a chance the permissions could have been frobbed, so fix + if (st.uid !== ownerStats.uid) { + stats[path] = ownerStats + setPermissions(path, ownerStats, cb) + } else { + stats[path] = st + cb(null, stats[path]) + } + }) +} + +function calculateOwner () { + if (!effectiveOwner) { + effectiveOwner = { uid: 0, gid: 0 } + + // Pretty much only on windows + if (!process.getuid) { + return effectiveOwner + } + + effectiveOwner.uid = +process.getuid() + effectiveOwner.gid = +process.getgid() + + if (effectiveOwner.uid === 0) { + if (process.env.SUDO_UID) effectiveOwner.uid = +process.env.SUDO_UID + if (process.env.SUDO_GID) effectiveOwner.gid = +process.env.SUDO_GID + } + } + + return effectiveOwner +} + +function makeDirectory (path, cb) { + cb = inflight('makeDirectory:' + path, cb) + if (!cb) { + return log.verbose('makeDirectory', path, 'creation already in flight; waiting') + } else { + log.verbose('makeDirectory', path, 'creation not in flight; initializing') + } + + var owner = calculateOwner() + + if (!process.getuid) { + return mkdirp(path, function (er) { + log.verbose('makeCacheDir', 'UID & GID are irrelevant on', process.platform) + + stats[path] = owner + return cb(er, stats[path]) + }) + } + + if (owner.uid !== 0 || !process.env.HOME) { + log.silly( + 'makeDirectory', path, + 'uid:', owner.uid, + 'gid:', owner.gid + ) + stats[path] = owner + mkdirp(path, afterMkdir) + } else { + fs.stat(process.env.HOME, function (er, st) { + if (er) { + log.error('makeDirectory', 'homeless?') + return cb(er) + } + + log.silly( + 'makeDirectory', path, + 'uid:', st.uid, + 'gid:', st.gid + ) + stats[path] = st + mkdirp(path, afterMkdir) + }) + } + + function afterMkdir (er, made) { + if (er || !stats[path] || isNaN(stats[path].uid) || isNaN(stats[path].gid)) { + return cb(er, stats[path]) + } + + if (!made) return cb(er, stats[path]) + + setPermissions(made, stats[path], cb) + } +} + +function setPermissions (path, st, cb) { + chownr(path, st.uid, st.gid, function (er) { + if (er && er.code === 'ENOENT') return cb(null, st) + return cb(er, st) + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/depr-check.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/depr-check.js new file mode 100644 index 00000000..7166348b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/depr-check.js @@ -0,0 +1,13 @@ +var log = require("npmlog") + +var deprecated = {} + , deprWarned = {} +module.exports = function deprCheck (data) { + if (deprecated[data._id]) data.deprecated = deprecated[data._id] + if (data.deprecated) deprecated[data._id] = data.deprecated + else return + if (!deprWarned[data._id]) { + deprWarned[data._id] = true + log.warn("deprecated", "%s: %s", data._id, data.deprecated) + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/error-handler.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/error-handler.js new file mode 100644 index 00000000..e5daf206 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/error-handler.js @@ -0,0 +1,414 @@ + +module.exports = errorHandler + +var cbCalled = false + , log = require("npmlog") + , npm = require("../npm.js") + , rm = require("rimraf") + , itWorked = false + , path = require("path") + , wroteLogFile = false + , exitCode = 0 + , rollbacks = npm.rollbacks + , chain = require("slide").chain + , writeStreamAtomic = require("fs-write-stream-atomic") + , nameValidator = require("validate-npm-package-name") + + +process.on("exit", function (code) { + // console.error("exit", code) + if (!npm.config || !npm.config.loaded) return + if (code) itWorked = false + if (itWorked) log.info("ok") + else { + if (!cbCalled) { + log.error("", "cb() never called!") + } + + if (wroteLogFile) { + // just a line break + if (log.levels[log.level] <= log.levels.error) console.error("") + + log.error("", + ["Please include the following file with any support request:" + ," " + path.resolve("npm-debug.log") + ].join("\n")) + wroteLogFile = false + } + if (code) { + log.error("code", code) + } + } + + var doExit = npm.config.get("_exit") + if (doExit) { + // actually exit. + if (exitCode === 0 && !itWorked) { + exitCode = 1 + } + if (exitCode !== 0) process.exit(exitCode) + } else { + itWorked = false // ready for next exit + } +}) + +function exit (code, noLog) { + exitCode = exitCode || process.exitCode || code + + var doExit = npm.config ? npm.config.get("_exit") : true + log.verbose("exit", [code, doExit]) + if (log.level === "silent") noLog = true + + if (rollbacks.length) { + chain(rollbacks.map(function (f) { + return function (cb) { + npm.commands.unbuild([f], true, cb) + } + }), function (er) { + if (er) { + log.error("error rolling back", er) + if (!code) errorHandler(er) + else if (noLog) rm("npm-debug.log", reallyExit.bind(null, er)) + else writeLogFile(reallyExit.bind(this, er)) + } else { + if (!noLog && code) writeLogFile(reallyExit) + else rm("npm-debug.log", reallyExit) + } + }) + rollbacks.length = 0 + } + else if (code && !noLog) writeLogFile(reallyExit) + else rm("npm-debug.log", reallyExit) + + function reallyExit (er) { + if (er && !code) code = typeof er.errno === "number" ? er.errno : 1 + + // truncate once it's been written. + log.record.length = 0 + + itWorked = !code + + // just emit a fake exit event. + // if we're really exiting, then let it exit on its own, so that + // in-process stuff can finish or clean up first. + if (!doExit) process.emit("exit", code) + npm.spinner.stop() + } +} + + +function errorHandler (er) { + // console.error("errorHandler", er) + if (!npm.config || !npm.config.loaded) { + // logging won't work unless we pretend that it's ready + er = er || new Error("Exit prior to config file resolving.") + console.error(er.stack || er.message) + } + + if (cbCalled) { + er = er || new Error("Callback called more than once.") + } + + cbCalled = true + if (!er) return exit(0) + if (typeof er === "string") { + log.error("", er) + return exit(1, true) + } else if (!(er instanceof Error)) { + log.error("weird error", er) + return exit(1, true) + } + + var m = er.code || er.message.match(/^(?:Error: )?(E[A-Z]+)/) + if (m && !er.code) er.code = m + + ; [ "type" + , "fstream_path" + , "fstream_unc_path" + , "fstream_type" + , "fstream_class" + , "fstream_finish_call" + , "fstream_linkpath" + , "stack" + , "fstream_stack" + , "statusCode" + , "pkgid" + ].forEach(function (k) { + var v = er[k] + if (!v) return + if (k === "fstream_stack") v = v.join("\n") + log.verbose(k, v) + }) + + log.verbose("cwd", process.cwd()) + + var os = require("os") + // log.error("System", os.type() + " " + os.release()) + // log.error("command", process.argv.map(JSON.stringify).join(" ")) + // log.error("node -v", process.version) + // log.error("npm -v", npm.version) + log.error("", os.type() + " " + os.release()) + log.error("argv", process.argv.map(JSON.stringify).join(" ")) + log.error("node", process.version) + log.error("npm ", "v" + npm.version) + + ; [ "file" + , "path" + , "code" + , "errno" + , "syscall" + ].forEach(function (k) { + var v = er[k] + if (v) log.error(k, v) + }) + + // just a line break + if (log.levels[log.level] <= log.levels.error) console.error("") + + switch (er.code) { + case "ECONNREFUSED": + log.error("", er) + log.error("", ["\nIf you are behind a proxy, please make sure that the" + ,"'proxy' config is set properly. See: 'npm help config'" + ].join("\n")) + break + + case "EACCES": + case "EPERM": + log.error("", er) + log.error("", ["\nPlease try running this command again as root/Administrator." + ].join("\n")) + break + + case "ELIFECYCLE": + log.error("", er.message) + log.error("", ["","Failed at the "+er.pkgid+" "+er.stage+" script '"+er.script+"'." + ,"This is most likely a problem with the "+er.pkgname+" package," + ,"not with npm itself." + ,"Tell the author that this fails on your system:" + ," "+er.script + ,'You can get information on how to open an issue for this project with:' + ,' npm bugs ' + er.pkgname + ,'Or if that isn\'t available, you can get their info via:', + ,' npm owner ls ' + er.pkgname + ,"There is likely additional logging output above." + ].join("\n")) + break + + case "ENOGIT": + log.error("", er.message) + log.error("", ["","Failed using git." + ,"This is most likely not a problem with npm itself." + ,"Please check if you have git installed and in your PATH." + ].join("\n")) + break + + case "EJSONPARSE": + log.error("", er.message) + log.error("", "File: "+er.file) + log.error("", ["Failed to parse package.json data." + ,"package.json must be actual JSON, not just JavaScript." + ,"","This is not a bug in npm." + ,"Tell the package author to fix their package.json file." + ].join("\n"), "JSON.parse") + break + + // TODO(isaacs) + // Add a special case here for E401 and E403 explaining auth issues? + + case "E404": + var msg = [er.message] + if (er.pkgid && er.pkgid !== "-") { + msg.push("", "'" + er.pkgid + "' is not in the npm registry.") + + var valResult = nameValidator(er.pkgid) + + if (valResult.validForNewPackages) { + msg.push("You should bug the author to publish it (or use the name yourself!)") + } else { + msg.push("Your package name is not valid, because", "") + + var errorsArray = (valResult.errors || []).concat(valResult.warnings || []) + errorsArray.forEach(function(item, idx) { + msg.push(" " + (idx + 1) + ". " + item) + }) + } + + if (er.parent) { + msg.push("It was specified as a dependency of '"+er.parent+"'") + } + msg.push("\nNote that you can also install from a" + ,"tarball, folder, http url, or git url.") + } + // There's no need to have 404 in the message as well. + msg[0] = msg[0].replace(/^404\s+/, "") + log.error("404", msg.join("\n")) + break + + case "EPUBLISHCONFLICT": + log.error("publish fail", ["Cannot publish over existing version." + ,"Update the 'version' field in package.json and try again." + ,"" + ,"To automatically increment version numbers, see:" + ," npm help version" + ].join("\n")) + break + + case "EISGIT": + log.error("git", [er.message + ," "+er.path + ,"Refusing to remove it. Update manually," + ,"or move it out of the way first." + ].join("\n")) + break + + case "ECYCLE": + log.error("cycle", [er.message + ,"While installing: "+er.pkgid + ,"Found a pathological dependency case that npm cannot solve." + ,"Please report this to the package author." + ].join("\n")) + break + + case "EBADPLATFORM": + log.error("notsup", [er.message + ,"Not compatible with your operating system or architecture: "+er.pkgid + ,"Valid OS: "+er.os.join(",") + ,"Valid Arch: "+er.cpu.join(",") + ,"Actual OS: "+process.platform + ,"Actual Arch: "+process.arch + ].join("\n")) + break + + case "EEXIST": + log.error([er.message + ,"File exists: "+er.path + ,"Move it away, and try again."].join("\n")) + break + + case "ENEEDAUTH": + log.error("need auth", [er.message + ,"You need to authorize this machine using `npm adduser`" + ].join("\n")) + break + + case "EPEERINVALID": + var peerErrors = Object.keys(er.peersDepending).map(function (peer) { + return "Peer " + peer + " wants " + er.packageName + "@" + + er.peersDepending[peer] + }) + log.error("peerinvalid", [er.message].concat(peerErrors).join("\n")) + break + + case "ECONNRESET": + case "ENOTFOUND": + case "ETIMEDOUT": + case "EAI_FAIL": + log.error("network", [er.message + ,"This is most likely not a problem with npm itself" + ,"and is related to network connectivity." + ,"In most cases you are behind a proxy or have bad network settings." + ,"\nIf you are behind a proxy, please make sure that the" + ,"'proxy' config is set properly. See: 'npm help config'" + ].join("\n")) + break + + case "ENOPACKAGEJSON": + log.error("package.json", [er.message + ,"This is most likely not a problem with npm itself." + ,"npm can't find a package.json file in your current directory." + ].join("\n")) + break + + case "ETARGET": + var msg = [er.message + ,"This is most likely not a problem with npm itself." + ,"In most cases you or one of your dependencies are requesting" + ,"a package version that doesn't exist." + ] + if (er.parent) { + msg.push("\nIt was specified as a dependency of '"+er.parent+"'\n") + } + log.error("notarget", msg.join("\n")) + break + + case "ENOTSUP": + if (er.required) { + log.error("notsup", [er.message + ,"Not compatible with your version of node/npm: "+er.pkgid + ,"Required: "+JSON.stringify(er.required) + ,"Actual: " + +JSON.stringify({npm:npm.version + ,node:npm.config.get("node-version")}) + ].join("\n")) + break + } // else passthrough + + case "ENOSPC": + log.error("nospc", [er.message + ,"This is most likely not a problem with npm itself" + ,"and is related to insufficient space on your system." + ].join("\n")) + break + + case "EROFS": + log.error("rofs", [er.message + ,"This is most likely not a problem with npm itself" + ,"and is related to the file system being read-only." + ,"\nOften virtualized file systems, or other file systems" + ,"that don't support symlinks, give this error." + ].join("\n")) + break + + case "ENOENT": + log.error("enoent", [er.message + ,"This is most likely not a problem with npm itself" + ,"and is related to npm not being able to find a file." + ,er.file?"\nCheck if the file '"+er.file+"' is present.":"" + ].join("\n")) + break + + case "EISDIR": + log.error("eisdir", [er.message + ,"This is most likely not a problem with npm itself" + ,"and is related to npm not being able to find a package.json in" + ,"a package you are trying to install." + ].join("\n")) + break + + default: + log.error("", er.message || er) + log.error("", ["", "If you need help, you may report this error at:" + ," " + ].join("\n")) + break + } + + exit(typeof er.errno === "number" ? er.errno : 1) +} + +var writingLogFile = false +function writeLogFile (cb) { + if (writingLogFile) return cb() + writingLogFile = true + wroteLogFile = true + + var fstr = writeStreamAtomic("npm-debug.log") + , os = require("os") + , out = "" + + log.record.forEach(function (m) { + var pref = [m.id, m.level] + if (m.prefix) pref.push(m.prefix) + pref = pref.join(" ") + + m.message.trim().split(/\r?\n/).map(function (line) { + return (pref + " " + line).trim() + }).forEach(function (line) { + out += line + os.EOL + }) + }) + + fstr.end(out) + fstr.on("close", cb) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/gently-rm.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/gently-rm.js new file mode 100644 index 00000000..ad0b4d03 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/gently-rm.js @@ -0,0 +1,197 @@ +// only remove the thing if it's a symlink into a specific folder. +// This is a very common use-case of npm's, but not so common elsewhere. + +module.exports = gentlyRm + +var npm = require('../npm.js') +var log = require('npmlog') +var resolve = require('path').resolve +var dirname = require('path').dirname +var lstat = require('graceful-fs').lstat +var readlink = require('graceful-fs').readlink +var isInside = require('path-is-inside') +var vacuum = require('fs-vacuum') +var some = require('async-some') +var asyncMap = require('slide').asyncMap +var normalize = require('path').normalize + +function gentlyRm (target, gently, base, cb) { + if (!cb) { + cb = base + base = undefined + } + + if (!cb) { + cb = gently + gently = false + } + + log.silly( + 'gentlyRm', + target, + 'is being', gently ? 'gently removed' : 'purged', + base ? 'from base ' + base : '' + ) + + // never rm the root, prefix, or bin dirs + // + // globals included because of `npm link` -- as far as the package requesting + // the link is concerned, the linked package is always installed globally + var prefixes = [ + npm.prefix, + npm.globalPrefix, + npm.dir, + npm.root, + npm.globalDir, + npm.bin, + npm.globalBin + ] + + var resolved = normalize(resolve(npm.prefix, target)) + if (prefixes.indexOf(resolved) !== -1) { + log.verbose('gentlyRm', resolved, "is part of npm and can't be removed") + return cb(new Error('May not delete: ' + resolved)) + } + + var options = { log: log.silly.bind(log, 'vacuum-fs') } + if (npm.config.get('force') || !gently) options.purge = true + if (base) options.base = normalize(resolve(npm.prefix, base)) + + if (!gently) { + log.verbose('gentlyRm', "don't care about contents; nuking", resolved) + return vacuum(resolved, options, cb) + } + + var parent = options.base = normalize(base ? resolve(npm.prefix, base) : npm.prefix) + + // is the parent directory managed by npm? + log.silly('gentlyRm', 'verifying', parent, 'is an npm working directory') + some(prefixes, isManaged(parent), function (er, matched) { + if (er) return cb(er) + + if (!matched) { + log.error('gentlyRm', 'containing path', parent, "isn't under npm's control") + return clobberFail(resolved, parent, cb) + } + log.silly('gentlyRm', 'containing path', parent, "is under npm's control, in", matched) + + // is the target directly contained within the (now known to be + // managed) parent? + if (isInside(resolved, parent)) { + log.silly('gentlyRm', 'deletion target', resolved, 'is under', parent) + log.verbose('gentlyRm', 'vacuuming from', resolved, 'up to', parent) + return vacuum(resolved, options, cb) + } + log.silly('gentlyRm', resolved, 'is not under', parent) + + // the target isn't directly within the parent, but is it itself managed? + log.silly('gentlyRm', 'verifying', resolved, 'is an npm working directory') + some(prefixes, isManaged(resolved), function (er, matched) { + if (er) return cb(er) + + if (matched) { + log.silly('gentlyRm', resolved, "is under npm's control, in", matched) + options.base = matched + log.verbose('gentlyRm', 'removing', resolved, 'with base', options.base) + return vacuum(resolved, options, cb) + } + log.verbose('gentlyRm', resolved, "is not under npm's control") + + // the target isn't managed directly, but maybe it's a link... + log.silly('gentlyRm', 'checking to see if', resolved, 'is a link') + lstat(resolved, function (er, stat) { + if (er) { + // race conditions are common when unbuilding + if (er.code === 'ENOENT') return cb(null) + return cb(er) + } + + if (!stat.isSymbolicLink()) { + log.error('gentlyRm', resolved, 'is outside', parent, 'and not a link') + return clobberFail(resolved, parent, cb) + } + + // ...and maybe the link source, when read... + log.silly('gentlyRm', resolved, 'is a link') + readlink(resolved, function (er, link) { + if (er) { + // race conditions are common when unbuilding + if (er.code === 'ENOENT') return cb(null) + return cb(er) + } + + // ...is inside the managed parent + var source = resolve(dirname(resolved), link) + if (isInside(source, parent)) { + log.silly('gentlyRm', source, 'symlink target', resolved, 'is inside', parent) + log.verbose('gentlyRm', 'vacuuming', resolved) + return vacuum(resolved, options, cb) + } + + log.error('gentlyRm', source, 'symlink target', resolved, 'is not controlled by npm', parent) + return clobberFail(target, parent, cb) + }) + }) + }) + }) +} + +var resolvedPaths = {} +function isManaged (target) { + return function predicate (path, cb) { + if (!path) { + log.verbose('isManaged', 'no path passed for target', target) + return cb(null, false) + } + + asyncMap([path, target], resolveSymlink, function (er, results) { + if (er) { + if (er.code === 'ENOENT') return cb(null, false) + + return cb(er) + } + + var path = results[0] + var target = results[1] + var inside = isInside(target, path) + if (!inside) log.silly('isManaged', target, 'is not inside', path) + + return cb(null, inside && path) + }) + } + + function resolveSymlink (toResolve, cb) { + var resolved = resolve(npm.prefix, toResolve) + + // if the path has already been memoized, return immediately + var cached = resolvedPaths[resolved] + if (cached) return cb(null, cached) + + // otherwise, check the path + lstat(resolved, function (er, stat) { + if (er) return cb(er) + + // if it's not a link, cache & return the path itself + if (!stat.isSymbolicLink()) { + resolvedPaths[resolved] = resolved + return cb(null, resolved) + } + + // otherwise, cache & return the link's source + readlink(resolved, function (er, source) { + if (er) return cb(er) + + resolved = resolve(resolved, source) + resolvedPaths[resolved] = resolved + cb(null, resolved) + }) + }) + } +} + +function clobberFail (target, root, cb) { + var er = new Error('Refusing to delete: ' + target + ' not in ' + root) + er.code = 'EEXIST' + er.path = target + return cb(er) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/get-publish-config.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/get-publish-config.js new file mode 100644 index 00000000..dcbb7b9c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/get-publish-config.js @@ -0,0 +1,25 @@ +var Conf = require('../config/core.js').Conf +var CachingRegClient = require('../cache/caching-client.js') +var log = require('npmlog') + +module.exports = getPublishConfig + +function getPublishConfig (publishConfig, defaultConfig, defaultClient) { + var config = defaultConfig + var client = defaultClient + log.verbose('getPublishConfig', publishConfig) + if (publishConfig) { + config = new Conf(defaultConfig) + config.save = defaultConfig.save.bind(defaultConfig) + + // don't modify the actual publishConfig object, in case we have + // to set a login token or some other data. + config.unshift(Object.keys(publishConfig).reduce(function (s, k) { + s[k] = publishConfig[k] + return s + }, {})) + client = new CachingRegClient(config) + } + + return { config: config, client: client } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/git.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/git.js new file mode 100644 index 00000000..9c80ea55 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/git.js @@ -0,0 +1,51 @@ + +// handle some git configuration for windows + +exports.spawn = spawnGit +exports.chainableExec = chainableExec +exports.whichAndExec = whichAndExec + +var exec = require("child_process").execFile + , spawn = require("./spawn") + , npm = require("../npm.js") + , which = require("which") + , git = npm.config.get("git") + , assert = require("assert") + , log = require("npmlog") + +function prefixGitArgs () { + return process.platform === "win32" ? ["-c", "core.longpaths=true"] : [] +} + +function execGit (args, options, cb) { + log.info('git', args) + var fullArgs = prefixGitArgs().concat(args || []) + return exec(git, fullArgs, options, cb) +} + +function spawnGit (args, options) { + log.info("git", args) + return spawn(git, prefixGitArgs().concat(args || []), options) +} + +function chainableExec () { + var args = Array.prototype.slice.call(arguments) + return [execGit].concat(args) +} + +function whichGit (cb) { + return which(git, cb) +} + +function whichAndExec (args, options, cb) { + assert.equal(typeof cb, "function", "no callback provided") + // check for git + whichGit(function (err) { + if (err) { + err.code = "ENOGIT" + return cb(err) + } + + execGit(args, options, cb) + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/lifecycle.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/lifecycle.js new file mode 100644 index 00000000..a1b8ebcb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/lifecycle.js @@ -0,0 +1,369 @@ +exports = module.exports = lifecycle +exports.cmd = cmd +exports.makeEnv = makeEnv + +var log = require("npmlog") +var spawn = require("./spawn") +var npm = require("../npm.js") +var path = require("path") +var fs = require("graceful-fs") +var chain = require("slide").chain +var Stream = require("stream").Stream +var PATH = "PATH" +var uidNumber = require("uid-number") +var umask = require("./umask") + +// windows calls it's path "Path" usually, but this is not guaranteed. +if (process.platform === "win32") { + PATH = "Path" + Object.keys(process.env).forEach(function (e) { + if (e.match(/^PATH$/i)) { + PATH = e + } + }) +} + +function lifecycle (pkg, stage, wd, unsafe, failOk, cb) { + if (typeof cb !== "function") cb = failOk, failOk = false + if (typeof cb !== "function") cb = unsafe, unsafe = false + if (typeof cb !== "function") cb = wd, wd = null + + while (pkg && pkg._data) pkg = pkg._data + if (!pkg) return cb(new Error("Invalid package data")) + + log.info(stage, pkg._id) + if (!pkg.scripts || npm.config.get('ignore-scripts')) pkg.scripts = {} + + validWd(wd || path.resolve(npm.dir, pkg.name), function (er, wd) { + if (er) return cb(er) + + unsafe = unsafe || npm.config.get("unsafe-perm") + + if ((wd.indexOf(npm.dir) !== 0 || + wd.indexOf(pkg.name) !== wd.length - pkg.name.length) && + !unsafe && pkg.scripts[stage]) { + log.warn( "cannot run in wd", "%s %s (wd=%s)" + , pkg._id, pkg.scripts[stage], wd) + return cb() + } + + // set the env variables, then run scripts as a child process. + var env = makeEnv(pkg) + env.npm_lifecycle_event = stage + env.npm_node_execpath = env.NODE = env.NODE || process.execPath + env.npm_execpath = require.main.filename + + // "nobody" typically doesn't have permission to write to /tmp + // even if it's never used, sh freaks out. + if (!npm.config.get("unsafe-perm")) env.TMPDIR = wd + + lifecycle_(pkg, stage, wd, env, unsafe, failOk, cb) + }) +} + +function checkForLink (pkg, cb) { + var f = path.join(npm.dir, pkg.name) + fs.lstat(f, function (er, s) { + cb(null, !(er || !s.isSymbolicLink())) + }) +} + +function lifecycle_ (pkg, stage, wd, env, unsafe, failOk, cb) { + var pathArr = [] + , p = wd.split("node_modules") + , acc = path.resolve(p.shift()) + + p.forEach(function (pp) { + pathArr.unshift(path.join(acc, "node_modules", ".bin")) + acc = path.join(acc, "node_modules", pp) + }) + pathArr.unshift(path.join(acc, "node_modules", ".bin")) + + // we also unshift the bundled node-gyp-bin folder so that + // the bundled one will be used for installing things. + pathArr.unshift(path.join(__dirname, "..", "..", "bin", "node-gyp-bin")) + + // prefer current node interpreter in child scripts + pathArr.push(path.dirname(process.execPath)) + + if (env[PATH]) pathArr.push(env[PATH]) + env[PATH] = pathArr.join(process.platform === "win32" ? ";" : ":") + + var packageLifecycle = pkg.scripts && pkg.scripts.hasOwnProperty(stage) + + if (packageLifecycle) { + // define this here so it's available to all scripts. + env.npm_lifecycle_script = pkg.scripts[stage] + } + + function done (er) { + if (er) { + if (npm.config.get("force")) { + log.info("forced, continuing", er) + er = null + } else if (failOk) { + log.warn("continuing anyway", er.message) + er = null + } + } + cb(er) + } + + chain + ( [ packageLifecycle && [runPackageLifecycle, pkg, env, wd, unsafe] + , [runHookLifecycle, pkg, env, wd, unsafe] ] + , done ) +} + +function validWd (d, cb) { + fs.stat(d, function (er, st) { + if (er || !st.isDirectory()) { + var p = path.dirname(d) + if (p === d) { + return cb(new Error("Could not find suitable wd")) + } + return validWd(p, cb) + } + return cb(null, d) + }) +} + +function runPackageLifecycle (pkg, env, wd, unsafe, cb) { + // run package lifecycle scripts in the package root, or the nearest parent. + var stage = env.npm_lifecycle_event + , cmd = env.npm_lifecycle_script + + var note = "\n> " + pkg._id + " " + stage + " " + wd + + "\n> " + cmd + "\n" + runCmd(note, cmd, pkg, env, stage, wd, unsafe, cb) +} + + +var running = false +var queue = [] +function dequeue() { + running = false + if (queue.length) { + var r = queue.shift() + runCmd.apply(null, r) + } +} + +function runCmd (note, cmd, pkg, env, stage, wd, unsafe, cb) { + if (running) { + queue.push([note, cmd, pkg, env, stage, wd, unsafe, cb]) + return + } + + running = true + log.pause() + var user = unsafe ? null : npm.config.get("user") + , group = unsafe ? null : npm.config.get("group") + + if (log.level !== 'silent') { + if (npm.spinner.int) { + npm.config.get("logstream").write("\r \r") + } + console.log(note) + } + log.verbose("unsafe-perm in lifecycle", unsafe) + + if (process.platform === "win32") { + unsafe = true + } + + if (unsafe) { + runCmd_(cmd, pkg, env, wd, stage, unsafe, 0, 0, cb) + } else { + uidNumber(user, group, function (er, uid, gid) { + runCmd_(cmd, pkg, env, wd, stage, unsafe, uid, gid, cb) + }) + } +} + +function runCmd_ (cmd, pkg, env, wd, stage, unsafe, uid, gid, cb_) { + + function cb (er) { + cb_.apply(null, arguments) + log.resume() + process.nextTick(dequeue) + } + + var conf = { cwd: wd + , env: env + , stdio: [ 0, 1, 2 ] + } + + if (!unsafe) { + conf.uid = uid ^ 0 + conf.gid = gid ^ 0 + } + + var sh = 'sh' + var shFlag = '-c' + + if (process.platform === 'win32') { + sh = process.env.comspec || 'cmd' + shFlag = '/d /s /c' + conf.windowsVerbatimArguments = true + } + + var proc = spawn(sh, [shFlag, cmd], conf) + proc.on("error", procError) + proc.on("close", function (code, signal) { + if (signal) { + process.kill(process.pid, signal); + } else if (code) { + var er = new Error("Exit status " + code) + } + procError(er) + }) + + function procError (er) { + if (er && !npm.ROLLBACK) { + log.info(pkg._id, "Failed to exec "+stage+" script") + er.message = pkg._id + " " + + stage + ": `" + cmd +"`\n" + + er.message + if (er.code !== "EPERM") { + er.code = "ELIFECYCLE" + } + er.pkgid = pkg._id + er.stage = stage + er.script = cmd + er.pkgname = pkg.name + return cb(er) + } else if (er) { + log.error(pkg._id+"."+stage, er) + log.error(pkg._id+"."+stage, "continuing anyway") + return cb() + } + cb(er) + } +} + + +function runHookLifecycle (pkg, env, wd, unsafe, cb) { + // check for a hook script, run if present. + var stage = env.npm_lifecycle_event + , hook = path.join(npm.dir, ".hooks", stage) + , user = unsafe ? null : npm.config.get("user") + , group = unsafe ? null : npm.config.get("group") + , cmd = hook + + fs.stat(hook, function (er) { + if (er) return cb() + var note = "\n> " + pkg._id + " " + stage + " " + wd + + "\n> " + cmd + runCmd(note, hook, pkg, env, stage, wd, unsafe, cb) + }) +} + +function makeEnv (data, prefix, env) { + prefix = prefix || "npm_package_" + if (!env) { + env = {} + for (var i in process.env) if (!i.match(/^npm_/)) { + env[i] = process.env[i] + } + + // npat asks for tap output + if (npm.config.get("npat")) env.TAP = 1 + + // express and others respect the NODE_ENV value. + if (npm.config.get("production")) env.NODE_ENV = "production" + + } else if (!data.hasOwnProperty("_lifecycleEnv")) { + Object.defineProperty(data, "_lifecycleEnv", + { value : env + , enumerable : false + }) + } + + for (var i in data) if (i.charAt(0) !== "_") { + var envKey = (prefix+i).replace(/[^a-zA-Z0-9_]/g, '_') + if (i === "readme") { + continue + } + if (data[i] && typeof(data[i]) === "object") { + try { + // quick and dirty detection for cyclical structures + JSON.stringify(data[i]) + makeEnv(data[i], envKey+"_", env) + } catch (ex) { + // usually these are package objects. + // just get the path and basic details. + var d = data[i] + makeEnv( { name: d.name, version: d.version, path:d.path } + , envKey+"_", env) + } + } else { + env[envKey] = String(data[i]) + env[envKey] = -1 !== env[envKey].indexOf("\n") + ? JSON.stringify(env[envKey]) + : env[envKey] + } + + } + + if (prefix !== "npm_package_") return env + + prefix = "npm_config_" + var pkgConfig = {} + , keys = npm.config.keys + , pkgVerConfig = {} + , namePref = data.name + ":" + , verPref = data.name + "@" + data.version + ":" + + keys.forEach(function (i) { + // in some rare cases (e.g. working with nerf darts), there are segmented + // "private" (underscore-prefixed) config names -- don't export + if (i.charAt(0) === '_' && i.indexOf('_' + namePref) !== 0 || i.match(/:_/)) { + return + } + var value = npm.config.get(i) + if (value instanceof Stream || Array.isArray(value)) return + if (i.match(/umask/)) value = umask.toString(value) + if (!value) value = "" + else if (typeof value === "number") value = "" + value + else if (typeof value !== "string") value = JSON.stringify(value) + + value = -1 !== value.indexOf("\n") + ? JSON.stringify(value) + : value + i = i.replace(/^_+/, "") + if (i.indexOf(namePref) === 0) { + var k = i.substr(namePref.length).replace(/[^a-zA-Z0-9_]/g, "_") + pkgConfig[ k ] = value + } else if (i.indexOf(verPref) === 0) { + var k = i.substr(verPref.length).replace(/[^a-zA-Z0-9_]/g, "_") + pkgVerConfig[ k ] = value + } + var envKey = (prefix+i).replace(/[^a-zA-Z0-9_]/g, "_") + env[envKey] = value + }) + + prefix = "npm_package_config_" + ;[pkgConfig, pkgVerConfig].forEach(function (conf) { + for (var i in conf) { + var envKey = (prefix+i) + env[envKey] = conf[i] + } + }) + + return env +} + +function cmd (stage) { + function CMD (args, cb) { + npm.commands["run-script"]([stage].concat(args), cb) + } + CMD.usage = "npm "+stage+" [-- ]" + var installedShallow = require("./completion/installed-shallow.js") + CMD.completion = function (opts, cb) { + installedShallow(opts, function (d) { + return d.scripts && d.scripts[stage] + }, cb) + } + return CMD +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/link.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/link.js new file mode 100644 index 00000000..e353bfae --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/link.js @@ -0,0 +1,40 @@ + +module.exports = link +link.ifExists = linkIfExists + +var fs = require("graceful-fs") + , chain = require("slide").chain + , mkdir = require("mkdirp") + , rm = require("./gently-rm.js") + , path = require("path") + , npm = require("../npm.js") + +function linkIfExists (from, to, gently, cb) { + fs.stat(from, function (er) { + if (er) return cb() + link(from, to, gently, cb) + }) +} + +function link (from, to, gently, abs, cb) { + if (typeof cb !== "function") cb = abs, abs = false + if (typeof cb !== "function") cb = gently, gently = null + if (npm.config.get("force")) gently = false + + to = path.resolve(to) + var target = from = path.resolve(from) + if (!abs && process.platform !== "win32") { + // junctions on windows must be absolute + target = path.relative(path.dirname(to), from) + // if there is no folder in common, then it will be much + // longer, and using a relative link is dumb. + if (target.length >= from.length) target = from + } + + chain + ( [ [fs, "stat", from] + , [rm, to, gently] + , [mkdir, path.dirname(to)] + , [fs, "symlink", target, to, "junction"] ] + , cb) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/locker.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/locker.js new file mode 100644 index 00000000..293d2da0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/locker.js @@ -0,0 +1,73 @@ +var crypto = require("crypto") +var resolve = require("path").resolve + +var lockfile = require("lockfile") +var log = require("npmlog") +var mkdirp = require("mkdirp") + +var npm = require("../npm.js") +var correctMkdir = require('../utils/correct-mkdir.js') + +var installLocks = {} + +function lockFileName (base, name) { + var c = name.replace(/[^a-zA-Z0-9]+/g, "-").replace(/^-+|-+$/g, "") + , p = resolve(base, name) + , h = crypto.createHash("sha1").update(p).digest("hex") + , l = resolve(npm.cache, "_locks") + + return resolve(l, c.substr(0, 24)+"-"+h.substr(0, 16)+".lock") +} + +function lock (base, name, cb) { + var lockDir = resolve(npm.cache, "_locks") + correctMkdir(lockDir, function (er) { + if (er) return cb(er) + + var opts = { stale: npm.config.get("cache-lock-stale") + , retries: npm.config.get("cache-lock-retries") + , wait: npm.config.get("cache-lock-wait") } + var lf = lockFileName(base, name) + lockfile.lock(lf, opts, function (er) { + if (er) log.warn("locking", lf, "failed", er) + + if (!er) { + log.verbose("lock", "using", lf, "for", resolve(base, name)) + installLocks[lf] = true + } + + cb(er) + }) + }) +} + +function unlock (base, name, cb) { + var lf = lockFileName(base, name) + , locked = installLocks[lf] + if (locked === false) { + return process.nextTick(cb) + } + else if (locked === true) { + lockfile.unlock(lf, function (er) { + if (er) { + log.warn("unlocking", lf, "failed", er) + } + else { + installLocks[lf] = false + log.verbose("unlock", "done using", lf, "for", resolve(base, name)) + } + + cb(er) + }) + } + else { + throw new Error( + "Attempt to unlock " + resolve(base, name) + ", which hasn't been locked" + ) + } +} + +module.exports = { + lock : lock, + unlock : unlock +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/map-to-registry.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/map-to-registry.js new file mode 100644 index 00000000..3f4d5ed3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/map-to-registry.js @@ -0,0 +1,100 @@ +var url = require("url") + +var log = require("npmlog") + , npa = require("npm-package-arg") + +module.exports = mapToRegistry + +function mapToRegistry(name, config, cb) { + log.silly("mapToRegistry", "name", name) + var registry + + // the name itself takes precedence + var data = npa(name) + if (data.scope) { + // the name is definitely scoped, so escape now + name = name.replace("/", "%2f") + + log.silly("mapToRegistry", "scope (from package name)", data.scope) + + registry = config.get(data.scope + ":registry") + if (!registry) { + log.verbose("mapToRegistry", "no registry URL found in name for scope", data.scope) + } + } + + // ...then --scope=@scope or --scope=scope + var scope = config.get("scope") + if (!registry && scope) { + // I'm an enabler, sorry + if (scope.charAt(0) !== "@") scope = "@" + scope + + log.silly("mapToRegistry", "scope (from config)", scope) + + registry = config.get(scope + ":registry") + if (!registry) { + log.verbose("mapToRegistry", "no registry URL found in config for scope", scope) + } + } + + // ...and finally use the default registry + if (!registry) { + log.silly("mapToRegistry", "using default registry") + registry = config.get("registry") + } + + log.silly("mapToRegistry", "registry", registry) + + var auth = config.getCredentialsByURI(registry) + + // normalize registry URL so resolution doesn't drop a piece of registry URL + var normalized = registry.slice(-1) !== '/' ? registry + '/' : registry + var uri + log.silly('mapToRegistry', 'data', data) + if (data.type === 'remote') { + uri = data.spec + } else { + uri = url.resolve(normalized, name) + } + + log.silly('mapToRegistry', 'uri', uri) + + cb(null, uri, scopeAuth(uri, registry, auth), normalized) +} + +function scopeAuth (uri, registry, auth) { + var cleaned = { + scope: auth.scope, + email: auth.email, + alwaysAuth: auth.alwaysAuth, + token: undefined, + username: undefined, + password: undefined, + auth: undefined + } + + var requestHost + var registryHost + + if (auth.token || auth.auth || (auth.username && auth.password)) { + requestHost = url.parse(uri).hostname + registryHost = url.parse(registry).hostname + + if (requestHost === registryHost) { + cleaned.token = auth.token + cleaned.auth = auth.auth + cleaned.username = auth.username + cleaned.password = auth.password + } else if (auth.alwaysAuth) { + log.verbose('scopeAuth', 'alwaysAuth set for', registry) + cleaned.token = auth.token + cleaned.auth = auth.auth + cleaned.username = auth.username + cleaned.password = auth.password + } else { + log.silly('scopeAuth', uri, "doesn't share host with registry", registry) + } + } + + return cleaned +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/read-local-package.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/read-local-package.js new file mode 100644 index 00000000..ca6d6132 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/read-local-package.js @@ -0,0 +1,12 @@ +exports = module.exports = readLocalPkg + +var npm = require("../npm.js") + , readJson = require("read-package-json") + +function readLocalPkg (cb) { + if (npm.config.get("global")) return cb() + var path = require("path") + readJson(path.resolve(npm.prefix, "package.json"), function (er, d) { + return cb(er, d && d.name) + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/spawn.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/spawn.js new file mode 100644 index 00000000..74684521 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/spawn.js @@ -0,0 +1,34 @@ +module.exports = spawn + +var _spawn = require("child_process").spawn +var EventEmitter = require("events").EventEmitter + +function spawn (cmd, args, options) { + var raw = _spawn(cmd, args, options) + var cooked = new EventEmitter() + + raw.on("error", function (er) { + er.file = cmd + cooked.emit("error", er) + }).on("close", function (code, signal) { + // Create ENOENT error because Node.js v0.8 will not emit + // an `error` event if the command could not be found. + if (code === 127) { + var er = new Error('spawn ENOENT') + er.code = 'ENOENT' + er.errno = 'ENOENT' + er.syscall = 'spawn' + er.file = cmd + cooked.emit('error', er) + } else { + cooked.emit("close", code, signal) + } + }) + + cooked.stdin = raw.stdin + cooked.stdout = raw.stdout + cooked.stderr = raw.stderr + cooked.kill = function (sig) { return raw.kill(sig) } + + return cooked +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/tar.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/tar.js new file mode 100644 index 00000000..7656b5d9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/tar.js @@ -0,0 +1,291 @@ +// commands for packing and unpacking tarballs +// this file is used by lib/cache.js + +var npm = require("../npm.js") + , fs = require("graceful-fs") + , writeFileAtomic = require("write-file-atomic") + , writeStreamAtomic = require("fs-write-stream-atomic") + , path = require("path") + , log = require("npmlog") + , uidNumber = require("uid-number") + , rm = require("./gently-rm.js") + , readJson = require("read-package-json") + , myUid = process.getuid && process.getuid() + , myGid = process.getgid && process.getgid() + , tar = require("tar") + , zlib = require("zlib") + , fstream = require("fstream") + , Packer = require("fstream-npm") + , lifecycle = require("./lifecycle.js") + +if (process.env.SUDO_UID && myUid === 0) { + if (!isNaN(process.env.SUDO_UID)) myUid = +process.env.SUDO_UID + if (!isNaN(process.env.SUDO_GID)) myGid = +process.env.SUDO_GID +} + +exports.pack = pack +exports.unpack = unpack + +function pack (tarball, folder, pkg, dfc, cb) { + log.verbose("tar pack", [tarball, folder]) + if (typeof cb !== "function") cb = dfc, dfc = false + + log.verbose("tarball", tarball) + log.verbose("folder", folder) + + if (dfc) { + // do fancy crap + return lifecycle(pkg, "prepublish", folder, function (er) { + if (er) return cb(er) + pack_(tarball, folder, pkg, cb) + }) + } else { + pack_(tarball, folder, pkg, cb) + } +} + +function pack_ (tarball, folder, pkg, cb) { + new Packer({ path: folder, type: "Directory", isDirectory: true }) + .on("error", function (er) { + if (er) log.error("tar pack", "Error reading " + folder) + return cb(er) + }) + + // By default, npm includes some proprietary attributes in the + // package tarball. This is sane, and allowed by the spec. + // However, npm *itself* excludes these from its own package, + // so that it can be more easily bootstrapped using old and + // non-compliant tar implementations. + .pipe(tar.Pack({ noProprietary: !npm.config.get("proprietary-attribs") })) + .on("error", function (er) { + if (er) log.error("tar.pack", "tar creation error", tarball) + cb(er) + }) + .pipe(zlib.Gzip()) + .on("error", function (er) { + if (er) log.error("tar.pack", "gzip error "+tarball) + cb(er) + }) + .pipe(writeStreamAtomic(tarball)) + .on("error", function (er) { + if (er) log.error("tar.pack", "Could not write "+tarball) + cb(er) + }) + .on("close", cb) +} + + +function unpack (tarball, unpackTarget, dMode, fMode, uid, gid, cb) { + log.verbose("tar", "unpack", tarball) + log.verbose("tar", "unpacking to", unpackTarget) + if (typeof cb !== "function") cb = gid, gid = null + if (typeof cb !== "function") cb = uid, uid = null + if (typeof cb !== "function") cb = fMode, fMode = npm.modes.file + if (typeof cb !== "function") cb = dMode, dMode = npm.modes.exec + + uidNumber(uid, gid, function (er, uid, gid) { + if (er) return cb(er) + unpack_(tarball, unpackTarget, dMode, fMode, uid, gid, cb) + }) +} + +function unpack_ ( tarball, unpackTarget, dMode, fMode, uid, gid, cb ) { + rm(unpackTarget, function (er) { + if (er) return cb(er) + // gzip {tarball} --decompress --stdout \ + // | tar -mvxpf - --strip-components=1 -C {unpackTarget} + gunzTarPerm( tarball, unpackTarget + , dMode, fMode + , uid, gid + , function (er, folder) { + if (er) return cb(er) + readJson(path.resolve(folder, "package.json"), cb) + }) + }) +} + + +function gunzTarPerm (tarball, target, dMode, fMode, uid, gid, cb_) { + if (!dMode) dMode = npm.modes.exec + if (!fMode) fMode = npm.modes.file + log.silly("gunzTarPerm", "modes", [dMode.toString(8), fMode.toString(8)]) + + var cbCalled = false + function cb (er) { + if (cbCalled) return + cbCalled = true + cb_(er, target) + } + + var fst = fs.createReadStream(tarball) + + fst.on("open", function (fd) { + fs.fstat(fd, function (er, st) { + if (er) return fst.emit("error", er) + if (st.size === 0) { + er = new Error("0-byte tarball\n" + + "Please run `npm cache clean`") + fst.emit("error", er) + } + }) + }) + + // figure out who we're supposed to be, if we're not pretending + // to be a specific user. + if (npm.config.get("unsafe-perm") && process.platform !== "win32") { + uid = myUid + gid = myGid + } + + function extractEntry (entry) { + log.silly("gunzTarPerm", "extractEntry", entry.path) + // never create things that are user-unreadable, + // or dirs that are user-un-listable. Only leads to headaches. + var originalMode = entry.mode = entry.mode || entry.props.mode + entry.mode = entry.mode | (entry.type === "Directory" ? dMode : fMode) + entry.mode = entry.mode & (~npm.modes.umask) + entry.props.mode = entry.mode + if (originalMode !== entry.mode) { + log.silly( "gunzTarPerm", "modified mode" + , [entry.path, originalMode, entry.mode]) + } + + // if there's a specific owner uid/gid that we want, then set that + if (process.platform !== "win32" && + typeof uid === "number" && + typeof gid === "number") { + entry.props.uid = entry.uid = uid + entry.props.gid = entry.gid = gid + } + } + + var extractOpts = { type: "Directory", path: target, strip: 1 } + + if (process.platform !== "win32" && + typeof uid === "number" && + typeof gid === "number") { + extractOpts.uid = uid + extractOpts.gid = gid + } + + var sawIgnores = {} + extractOpts.filter = function () { + // symbolic links are not allowed in packages. + if (this.type.match(/^.*Link$/)) { + log.warn( "excluding symbolic link" + , this.path.substr(target.length + 1) + + " -> " + this.linkpath ) + return false + } + + // Note: This mirrors logic in the fs read operations that are + // employed during tarball creation, in the fstream-npm module. + // It is duplicated here to handle tarballs that are created + // using other means, such as system tar or git archive. + if (this.type === "File") { + var base = path.basename(this.path) + if (base === ".npmignore") { + sawIgnores[ this.path ] = true + } else if (base === ".gitignore") { + var npmignore = this.path.replace(/\.gitignore$/, ".npmignore") + if (sawIgnores[npmignore]) { + // Skip this one, already seen. + return false + } else { + // Rename, may be clobbered later. + this.path = npmignore + this._path = npmignore + } + } + } + + return true + } + + + fst + .on("error", function (er) { + if (er) log.error("tar.unpack", "error reading "+tarball) + cb(er) + }) + .on("data", function OD (c) { + // detect what it is. + // Then, depending on that, we'll figure out whether it's + // a single-file module, gzipped tarball, or naked tarball. + // gzipped files all start with 1f8b08 + if (c[0] === 0x1F && + c[1] === 0x8B && + c[2] === 0x08) { + fst + .pipe(zlib.Unzip()) + .on("error", function (er) { + if (er) log.error("tar.unpack", "unzip error "+tarball) + cb(er) + }) + .pipe(tar.Extract(extractOpts)) + .on("entry", extractEntry) + .on("error", function (er) { + if (er) log.error("tar.unpack", "untar error "+tarball) + cb(er) + }) + .on("close", cb) + } else if (hasTarHeader(c)) { + // naked tar + fst + .pipe(tar.Extract(extractOpts)) + .on("entry", extractEntry) + .on("error", function (er) { + if (er) log.error("tar.unpack", "untar error "+tarball) + cb(er) + }) + .on("close", cb) + } else { + // naked js file + var jsOpts = { path: path.resolve(target, "index.js") } + + if (process.platform !== "win32" && + typeof uid === "number" && + typeof gid === "number") { + jsOpts.uid = uid + jsOpts.gid = gid + } + + fst + .pipe(fstream.Writer(jsOpts)) + .on("error", function (er) { + if (er) log.error("tar.unpack", "copy error "+tarball) + cb(er) + }) + .on("close", function () { + var j = path.resolve(target, "package.json") + readJson(j, function (er, d) { + if (er) { + log.error("not a package", tarball) + return cb(er) + } + writeFileAtomic(j, JSON.stringify(d) + "\n", cb) + }) + }) + } + + // now un-hook, and re-emit the chunk + fst.removeListener("data", OD) + fst.emit("data", c) + }) +} + +function hasTarHeader (c) { + return c[257] === 0x75 && // tar archives have 7573746172 at position + c[258] === 0x73 && // 257 and 003030 or 202000 at position 262 + c[259] === 0x74 && + c[260] === 0x61 && + c[261] === 0x72 && + + ((c[262] === 0x00 && + c[263] === 0x30 && + c[264] === 0x30) || + + (c[262] === 0x20 && + c[263] === 0x20 && + c[264] === 0x00)) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/umask.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/umask.js new file mode 100644 index 00000000..6ccb4a11 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/umask.js @@ -0,0 +1,17 @@ +var umask = require("umask") +var npmlog = require("npmlog") +var _fromString = umask.fromString + +module.exports = umask + +// fromString with logging callback +umask.fromString = function (val) { + _fromString(val, function (err, result) { + if (err) { + npmlog.warn("invalid umask", err.message) + } + val = result + }) + + return val +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/warn-deprecated.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/warn-deprecated.js new file mode 100644 index 00000000..ec821b9b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/utils/warn-deprecated.js @@ -0,0 +1,24 @@ +module.exports = warnDeprecated + +var log = require("npmlog") + +var deprecations = {} + +function warnDeprecated (type) { + return function warn (messages, instance) { + if (!instance) { + if (!deprecations[type]) { + deprecations[type] = {} + messages.forEach(function (m) { log.warn(type, m) }) + } + } + else { + if (!deprecations[type]) deprecations[type] = {} + + if (!deprecations[type][instance]) { + deprecations[type][instance] = true + messages.forEach(function (m) { log.warn(type, m) }) + } + } + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/version.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/version.js new file mode 100644 index 00000000..7b6eec0c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/version.js @@ -0,0 +1,209 @@ +// npm version + +module.exports = version + +var semver = require('semver') +var path = require('path') +var fs = require('graceful-fs') +var writeFileAtomic = require('write-file-atomic') +var chain = require('slide').chain +var log = require('npmlog') +var npm = require('./npm.js') +var git = require('./utils/git.js') +var assert = require('assert') +var lifecycle = require('./utils/lifecycle.js') + +version.usage = 'npm version [ | major | minor | patch | premajor | preminor | prepatch | prerelease]' + + '\n(run in package dir)\n' + + "'npm -v' or 'npm --version' to print npm version " + + '(' + npm.version + ')\n' + + "'npm view version' to view a package's " + + 'published version\n' + + "'npm ls' to inspect current package/dependency versions" + +function version (args, silent, cb_) { + if (typeof cb_ !== 'function') { + cb_ = silent + silent = false + } + if (args.length > 1) return cb_(version.usage) + + var packagePath = path.join(npm.localPrefix, 'package.json') + fs.readFile(packagePath, function (er, data) { + if (data) data = data.toString() + try { + data = JSON.parse(data) + } catch (e) { + er = e + data = null + } + + if (!args.length) return dump(data, cb_) + + if (er) { + log.error('version', 'No valid package.json found') + return cb_(er) + } + + var newVersion = semver.valid(args[0]) + if (!newVersion) newVersion = semver.inc(data.version, args[0]) + if (!newVersion) return cb_(version.usage) + if (data.version === newVersion) return cb_(new Error('Version not changed')) + data.version = newVersion + var lifecycleData = Object.create(data) + lifecycleData._id = data.name + '@' + newVersion + var localData = {} + + var where = npm.prefix + chain([ + [checkGit, localData], + [lifecycle, lifecycleData, 'preversion', where], + [updatePackage, newVersion, silent], + [lifecycle, lifecycleData, 'version', where], + [commit, localData, newVersion], + [lifecycle, lifecycleData, 'postversion', where] ], + cb_) + }) +} + +function readPackage (cb) { + var packagePath = path.join(npm.localPrefix, 'package.json') + fs.readFile(packagePath, function (er, data) { + if (er) return cb(new Error(er)) + if (data) data = data.toString() + try { + data = JSON.parse(data) + } catch (e) { + er = e + data = null + } + cb(er, data) + }) +} + +function updatePackage (newVersion, silent, cb_) { + function cb (er) { + if (!er && !silent) console.log('v' + newVersion) + cb_(er) + } + + readPackage(function (er, data) { + if (er) return cb(new Error(er)) + data.version = newVersion + write(data, 'package.json', cb) + }) +} + +function commit (localData, newVersion, cb) { + updateShrinkwrap(newVersion, function (er, hasShrinkwrap) { + if (er || !localData.hasGit) return cb(er) + _commit(newVersion, hasShrinkwrap, cb) + }) +} + +function updateShrinkwrap (newVersion, cb) { + fs.readFile(path.join(npm.localPrefix, 'npm-shrinkwrap.json'), function (er, data) { + if (er && er.code === 'ENOENT') return cb(null, false) + + try { + data = data.toString() + data = JSON.parse(data) + } catch (er) { + log.error('version', 'Bad npm-shrinkwrap.json data') + return cb(er) + } + + data.version = newVersion + write(data, 'npm-shrinkwrap.json', function (er) { + if (er) { + log.error('version', 'Bad npm-shrinkwrap.json data') + return cb(er) + } + cb(null, true) + }) + }) +} + +function dump (data, cb) { + var v = {} + + if (data && data.name && data.version) v[data.name] = data.version + v.npm = npm.version + Object.keys(process.versions).sort().forEach(function (k) { + v[k] = process.versions[k] + }) + + if (npm.config.get('json')) v = JSON.stringify(v, null, 2) + + console.log(v) + cb() +} + +function checkGit (localData, cb) { + fs.stat(path.join(npm.localPrefix, '.git'), function (er, s) { + var doGit = !er && npm.config.get('git-tag-version') + if (!doGit) { + if (er) log.verbose('version', 'error checking for .git', er) + log.verbose('version', 'not tagging in git') + return cb(null, false) + } + + // check for git + git.whichAndExec( + [ 'status', '--porcelain' ], + { env: process.env }, + function (er, stdout) { + if (er && er.code === 'ENOGIT') { + log.warn( + 'version', + 'This is a Git checkout, but the git command was not found.', + 'npm could not create a Git tag for this release!' + ) + return cb(null, false) + } + + var lines = stdout.trim().split('\n').filter(function (line) { + return line.trim() && !line.match(/^\?\? /) + }).map(function (line) { + return line.trim() + }) + if (lines.length && !npm.config.get('force')) { + return cb(new Error( + 'Git working directory not clean.\n' + lines.join('\n') + )) + } + localData.hasGit = true + cb(null, true) + } + ) + }) +} + +function _commit (version, hasShrinkwrap, cb) { + var packagePath = path.join(npm.localPrefix, 'package.json') + var options = { env: process.env } + var message = npm.config.get('message').replace(/%s/g, version) + var sign = npm.config.get('sign-git-tag') + var flag = sign ? '-sm' : '-am' + chain( + [ + git.chainableExec([ 'add', packagePath ], options), + hasShrinkwrap && git.chainableExec([ 'add', 'npm-shrinkwrap.json' ], options), + git.chainableExec([ 'commit', '-m', message ], options), + git.chainableExec([ 'tag', npm.config.get('tag-version-prefix') + version, flag, message ], options) + ], + cb + ) +} + +function write (data, file, cb) { + assert(data && typeof data === 'object', 'must pass data to version write') + assert(typeof file === 'string', 'must pass filename to write to version write') + + log.verbose('version.write', 'data', data, 'to', file) + writeFileAtomic( + path.join(npm.localPrefix, file), + new Buffer(JSON.stringify(data, null, 2) + '\n'), + cb + ) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/view.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/view.js new file mode 100644 index 00000000..9199d352 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/view.js @@ -0,0 +1,302 @@ +// npm view [pkg [pkg ...]] + +module.exports = view +view.usage = "npm view pkg[@version] [[.subfield]...]" + +var npm = require("./npm.js") + , readJson = require("read-package-json") + , log = require("npmlog") + , util = require("util") + , semver = require("semver") + , mapToRegistry = require("./utils/map-to-registry.js") + , npa = require("npm-package-arg") + , path = require("path") + +view.completion = function (opts, cb) { + if (opts.conf.argv.remain.length <= 2) { + // FIXME: there used to be registry completion here, but it stopped making + // sense somewhere around 50,000 packages on the registry + return cb() + } + // have the package, get the fields. + var tag = npm.config.get("tag") + mapToRegistry(opts.conf.argv.remain[2], npm.config, function (er, uri, auth) { + if (er) return cb(er) + + npm.registry.get(uri, { auth : auth }, function (er, d) { + if (er) return cb(er) + var dv = d.versions[d["dist-tags"][tag]] + , fields = [] + d.versions = Object.keys(d.versions).sort(semver.compareLoose) + fields = getFields(d).concat(getFields(dv)) + cb(null, fields) + }) + }) + + function getFields (d, f, pref) { + f = f || [] + if (!d) return f + pref = pref || [] + Object.keys(d).forEach(function (k) { + if (k.charAt(0) === "_" || k.indexOf(".") !== -1) return + var p = pref.concat(k).join(".") + f.push(p) + if (Array.isArray(d[k])) { + d[k].forEach(function (val, i) { + var pi = p + "[" + i + "]" + if (val && typeof val === "object") getFields(val, f, [p]) + else f.push(pi) + }) + return + } + if (typeof d[k] === "object") getFields(d[k], f, [p]) + }) + return f + } +} + +function view (args, silent, cb) { + if (typeof cb !== "function") cb = silent, silent = false + + if (!args.length) args = ["."] + + var pkg = args.shift() + , nv = npa(pkg) + , name = nv.name + , local = (name === "." || !name) + + if (npm.config.get("global") && local) { + return cb(new Error("Cannot use view command in global mode.")) + } + + if (local) { + var dir = npm.prefix + readJson(path.resolve(dir, "package.json"), function (er, d) { + d = d || {} + if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) + if (!d.name) return cb(new Error("Invalid package.json")) + + var p = d.name + nv = npa(p) + if (pkg && ~pkg.indexOf("@")) { + nv.rawSpec = pkg.split("@")[pkg.indexOf("@")] + } + + fetchAndRead(nv, args, silent, cb) + }) + } else { + fetchAndRead(nv, args, silent, cb) + } +} + +function fetchAndRead (nv, args, silent, cb) { + // get the data about this package + var name = nv.name + , version = nv.rawSpec || npm.config.get("tag") + + mapToRegistry(name, npm.config, function (er, uri, auth) { + if (er) return cb(er) + + npm.registry.get(uri, { auth : auth }, function (er, data) { + if (er) return cb(er) + if (data["dist-tags"] && data["dist-tags"].hasOwnProperty(version)) { + version = data["dist-tags"][version] + } + + if (data.time && data.time.unpublished) { + var u = data.time.unpublished + er = new Error("Unpublished by " + u.name + " on " + u.time) + er.statusCode = 404 + er.code = "E404" + er.pkgid = data._id + return cb(er, data) + } + + + var results = [] + , error = null + , versions = data.versions || {} + data.versions = Object.keys(versions).sort(semver.compareLoose) + if (!args.length) args = [""] + + // remove readme unless we asked for it + if (-1 === args.indexOf("readme")) { + delete data.readme + } + + Object.keys(versions).forEach(function (v) { + if (semver.satisfies(v, version, true)) args.forEach(function (args) { + // remove readme unless we asked for it + if (-1 === args.indexOf("readme")) { + delete versions[v].readme + } + results.push(showFields(data, versions[v], args)) + }) + }) + results = results.reduce(reducer, {}) + var retval = results + + if (args.length === 1 && args[0] === "") { + retval = cleanBlanks(retval) + log.silly("cleanup", retval) + } + + if (error || silent) cb(error, retval) + else printData(results, data._id, cb.bind(null, error, retval)) + }) + }) +} + +function cleanBlanks (obj) { + var clean = {} + Object.keys(obj).forEach(function (version) { + clean[version] = obj[version][""] + }) + return clean +} + +function reducer (l, r) { + if (r) Object.keys(r).forEach(function (v) { + l[v] = l[v] || {} + Object.keys(r[v]).forEach(function (t) { + l[v][t] = r[v][t] + }) + }) + return l +} + +// return whatever was printed +function showFields (data, version, fields) { + var o = {} + ;[data, version].forEach(function (s) { + Object.keys(s).forEach(function (k) { + o[k] = s[k] + }) + }) + return search(o, fields.split("."), version.version, fields) +} + +function search (data, fields, version, title) { + var field + , tail = fields + while (!field && fields.length) field = tail.shift() + fields = [field].concat(tail) + var o + if (!field && !tail.length) { + o = {} + o[version] = {} + o[version][title] = data + return o + } + var index = field.match(/(.+)\[([^\]]+)\]$/) + if (index) { + field = index[1] + index = index[2] + if (data.field && data.field.hasOwnProperty(index)) { + return search(data[field][index], tail, version, title) + } else { + field = field + "[" + index + "]" + } + } + if (Array.isArray(data)) { + if (data.length === 1) { + return search(data[0], fields, version, title) + } + var results = [] + data.forEach(function (data, i) { + var tl = title.length + , newt = title.substr(0, tl-(fields.join(".").length) - 1) + + "["+i+"]" + [""].concat(fields).join(".") + results.push(search(data, fields.slice(), version, newt)) + }) + results = results.reduce(reducer, {}) + return results + } + if (!data.hasOwnProperty(field)) return undefined + data = data[field] + if (tail.length) { + if (typeof data === "object") { + // there are more fields to deal with. + return search(data, tail, version, title) + } else { + return new Error("Not an object: "+data) + } + } + o = {} + o[version] = {} + o[version][title] = data + return o +} + +function printData (data, name, cb) { + var versions = Object.keys(data) + , msg = "" + , includeVersions = versions.length > 1 + , includeFields + + versions.forEach(function (v) { + var fields = Object.keys(data[v]) + includeFields = includeFields || (fields.length > 1) + fields.forEach(function (f) { + var d = cleanup(data[v][f]) + if (includeVersions || includeFields || typeof d !== "string") { + d = cleanup(data[v][f]) + d = npm.config.get("json") + ? JSON.stringify(d, null, 2) + : util.inspect(d, false, 5, npm.color) + } else if (typeof d === "string" && npm.config.get("json")) { + d = JSON.stringify(d) + } + if (f && includeFields) f += " = " + if (d.indexOf("\n") !== -1) d = " \n" + d + msg += (includeVersions ? name + "@" + v + " " : "") + + (includeFields ? f : "") + d + "\n" + }) + }) + + // preserve output symmetry by adding a whitespace-only line at the end if + // there's one at the beginning + if (/^\s*\n/.test(msg)) msg += "\n" + + // print directly to stdout to not unnecessarily add blank lines + process.stdout.write(msg) + + cb(null, data) +} +function cleanup (data) { + if (Array.isArray(data)) { + if (data.length === 1) { + data = data[0] + } else { + return data.map(cleanup) + } + } + if (!data || typeof data !== "object") return data + + if (typeof data.versions === "object" + && data.versions + && !Array.isArray(data.versions)) { + data.versions = Object.keys(data.versions || {}) + } + + var keys = Object.keys(data) + keys.forEach(function (d) { + if (d.charAt(0) === "_") delete data[d] + else if (typeof data[d] === "object") data[d] = cleanup(data[d]) + }) + keys = Object.keys(data) + if (keys.length <= 3 + && data.name + && (keys.length === 1 + || keys.length === 3 && data.email && data.url + || keys.length === 2 && (data.email || data.url))) { + data = unparsePerson(data) + } + return data +} +function unparsePerson (d) { + if (typeof d === "string") return d + return d.name + + (d.email ? " <"+d.email+">" : "") + + (d.url ? " ("+d.url+")" : "") +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/visnup.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/visnup.js new file mode 100644 index 00000000..8d710c20 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/visnup.js @@ -0,0 +1,42 @@ +module.exports = visnup +var npm = require("./npm.js") + +var handsomeFace = [ + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 232, 237, 236, 236, 232, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + ,[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 235, 236, 235, 233, 237, 235, 233, 232, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + ,[0, 0, 0, 0, 0, 0, 0, 0, 0, 232, 235, 233, 232, 235, 235, 234, 233, 236, 232, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + ,[0, 0, 0, 0, 0, 0, 0, 0, 237, 235, 232, 232, 234, 233, 233, 232, 232, 233, 232, 232, 235, 232, 233, 234, 234, 0, 0, 0, 0, 0, 0, 0, 0, 0] + ,[0, 0, 0, 0, 0, 0, 0, 232, 232, 232, 239, 238, 235, 233, 232, 232, 232, 232, 232, 232, 232, 233, 235, 232, 233, 233, 232, 0, 0, 0, 0, 0, 0, 0] + ,[0, 0, 0, 0, 234, 234, 232, 233, 234, 233, 234, 235, 233, 235, 60, 238, 238, 234, 234, 233, 234, 233, 238, 251, 246, 233, 233, 232, 0, 0, 0, 0, 0, 0] + ,[0, 0, 233, 233, 233, 232, 232, 239, 249, 251, 252, 231, 231, 188, 250, 254, 59, 60, 255, 231, 231, 231, 252, 235, 239, 235, 232, 233, 0, 0, 0, 0, 0, 0] + ,[0, 0, 232, 233, 232, 232, 232, 248, 231, 231, 231, 231, 231, 231, 231, 254, 238, 254, 231, 231, 231, 231, 231, 252, 233, 235, 237, 233, 234, 0, 0, 0, 0, 0] + ,[0, 0, 233, 232, 232, 232, 248, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 251, 233, 233, 233, 236, 233, 0, 0, 0, 0] + ,[232, 233, 233, 232, 232, 246, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 249, 233, 234, 234, 0, 0, 0, 0] + ,[232, 232, 232, 232, 233, 249, 231, 255, 255, 255, 255, 254, 109, 60, 239, 237, 238, 237, 235, 235, 235, 235, 236, 235, 235, 235, 234, 232, 232, 232, 232, 232, 233, 0] + ,[0, 232, 232, 233, 233, 233, 233, 233, 233, 233, 233, 233, 235, 236, 238, 238, 235, 188, 254, 254, 145, 236, 252, 254, 254, 254, 254, 249, 236, 235, 232, 232, 233, 0] + ,[0, 0, 233, 237, 249, 239, 233, 252, 231, 231, 231, 231, 231, 231, 254, 235, 235, 254, 231, 231, 251, 235, 237, 231, 231, 231, 231, 7, 237, 235, 232, 233, 233, 0] + ,[0, 0, 0, 0, 233, 248, 239, 233, 231, 231, 231, 231, 254, 233, 233, 235, 254, 255, 231, 254, 237, 236, 254, 239, 235, 235, 233, 233, 232, 232, 233, 232, 0, 0] + ,[0, 0, 0, 232, 233, 246, 255, 255, 236, 236, 236, 236, 236, 255, 231, 231, 231, 231, 231, 231, 252, 234, 248, 231, 231, 231, 231, 248, 232, 232, 232, 0, 0, 0] + ,[0, 0, 0, 0, 235, 237, 7, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 255, 238, 235, 7, 231, 231, 231, 246, 232, 0, 0, 0, 0, 0] + ,[0, 0, 0, 0, 0, 235, 103, 188, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 252, 232, 238, 231, 231, 255, 244, 232, 0, 0, 0, 0, 0] + ,[0, 0, 0, 0, 0, 235, 236, 103, 146, 253, 255, 231, 231, 231, 231, 231, 253, 251, 250, 250, 250, 246, 232, 235, 152, 255, 146, 66, 233, 0, 0, 0, 0, 0] + ,[0, 0, 0, 0, 0, 0, 233, 103, 146, 146, 146, 146, 254, 231, 231, 231, 109, 103, 146, 255, 188, 239, 240, 103, 255, 253, 103, 238, 234, 0, 0, 0, 0, 0] + ,[0, 0, 0, 0, 0, 0, 232, 235, 109, 146, 146, 146, 146, 146, 252, 152, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 103, 235, 233, 0, 0, 0, 0, 0] + ,[0, 0, 0, 0, 0, 0, 0, 235, 235, 103, 146, 146, 146, 146, 146, 146, 188, 188, 188, 188, 188, 188, 152, 146, 146, 146, 66, 235, 0, 0, 0, 0, 0, 0] + ,[0, 0, 0, 0, 0, 0, 0, 0, 233, 235, 66, 146, 146, 146, 146, 152, 255, 146, 240, 239, 241, 109, 146, 146, 146, 103, 233, 0, 0, 0, 0, 0, 0, 0] + ,[0, 0, 0, 0, 0, 0, 0, 0, 0, 234, 237, 109, 146, 146, 146, 146, 146, 254, 231, 231, 188, 146, 146, 146, 103, 233, 0, 0, 0, 0, 0, 0, 0, 0] + ,[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 233, 237, 60, 103, 146, 146, 146, 146, 146, 103, 66, 60, 235, 232, 0, 0, 0, 0, 0, 0, 0, 0, 0] + ,[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 232, 233, 233, 236, 235, 237, 235, 237, 237, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]] + + +function visnup (args, cb) { + handsomeFace.forEach(function (line) { + console.log(line.map(function (ch) { + return "\033[" + (ch ? "48;5;" + ch : ch) + "m" + }).join(' ')) + }) + + var c = args.shift() + if (c) npm.commands[c](args, cb) + else cb() +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/whoami.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/whoami.js new file mode 100644 index 00000000..bef0184a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/whoami.js @@ -0,0 +1,47 @@ +var npm = require("./npm.js") + +module.exports = whoami + +whoami.usage = "npm whoami\n(just prints username according to given registry)" + +function whoami (args, silent, cb) { + // FIXME: need tighter checking on this, but is a breaking change + if (typeof cb !== "function") { + cb = silent + silent = false + } + + var registry = npm.config.get("registry") + if (!registry) return cb(new Error("no default registry set")) + + var auth = npm.config.getCredentialsByURI(registry) + if (auth) { + if (auth.username) { + if (!silent) console.log(auth.username) + return process.nextTick(cb.bind(this, null, auth.username)) + } + else if (auth.token) { + return npm.registry.whoami(registry, { auth : auth }, function (er, username) { + if (er) return cb(er) + if (!username) { + var needNewSession = new Error( + "Your auth token is no longer valid. Please log in again." + ) + needNewSession.code = 'ENEEDAUTH' + return cb(needNewSession) + } + + if (!silent) console.log(username) + cb(null, username) + }) + } + } + + // At this point, if they have a credentials object, it doesn't have a token + // or auth in it. Probably just the default registry. + var needAuth = new Error( + "this command requires you to be logged in." + ) + needAuth.code = 'ENEEDAUTH' + process.nextTick(cb.bind(this, needAuth)) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/xmas.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/xmas.js new file mode 100644 index 00000000..fa8d1db5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/lib/xmas.js @@ -0,0 +1,55 @@ +// happy xmas +var log = require("npmlog") + +module.exports = function (args, cb) { +var s = process.platform === "win32" ? " *" : " \u2605" + , f = "\uFF0F" + , b = "\uFF3C" + , x = process.platform === "win32" ? " " : "" + , o = [ "\u0069" , "\u0020", "\u0020", "\u0020", "\u0020", "\u0020" + , "\u0020", "\u0020", "\u0020", "\u0020", "\u0020", "\u0020" + , "\u0020", "\u2E1B","\u2042","\u2E2E","&","@","\uFF61" ] + , oc = [21,33,34,35,36,37] + , l = "\u005e" + +function w (s) { process.stderr.write(s) } + +w("\n") +;(function T (H) { + for (var i = 0; i < H; i ++) w(" ") + w(x+"\033[33m"+s+"\n") + var M = H * 2 - 1 + for (var L = 1; L <= H; L ++) { + var O = L * 2 - 2 + var S = (M - O) / 2 + for (i = 0; i < S; i ++) w(" ") + w(x+"\033[32m"+f) + for (i = 0; i < O; i ++) w( + "\033["+oc[Math.floor(Math.random()*oc.length)]+"m"+ + o[Math.floor(Math.random() * o.length)] + ) + w(x+"\033[32m"+b+"\n") + } + w(" ") + for (i = 1; i < H; i ++) w("\033[32m"+l) + w("| "+x+" |") + for (i = 1; i < H; i ++) w("\033[32m"+l) + if (H > 10) { + w("\n ") + for (i = 1; i < H; i ++) w(" ") + w("| "+x+" |") + for (i = 1; i < H; i ++) w(" ") + } +})(20) +w("\n\n") +log.heading = '' +log.addLevel('npm', 100000, log.headingStyle) +log.npm("loves you", "Happy Xmas, Noders!") +cb() +} +var dg=false +Object.defineProperty(module.exports, "usage", {get:function () { + if (dg) module.exports([], function () {}) + dg = true + return " " +}}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/make.bat b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/make.bat new file mode 100644 index 00000000..7d71f0f9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/make.bat @@ -0,0 +1,3 @@ +:: The tests run "make doc" in the prepublish script, +:: so this file gives windows something that'll exit +:: successfully, without having to install make. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-README.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-README.1 new file mode 100644 index 00000000..fffb2370 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-README.1 @@ -0,0 +1,181 @@ +.TH "NPM" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm\fR \- a JavaScript package manager +.P +Build Status \fIhttps://img\.shields\.io/travis/npm/npm/master\.svg\fR \fIhttps://travis\-ci\.org/npm/npm\fR +.SH SYNOPSIS +.P +This is just enough info to get you up and running\. +.P +Much more info available via \fBnpm help\fP once it's installed\. +.SH IMPORTANT +.P +\fBYou need node v0\.10 or higher to run this program\.\fR +.P +To install an old \fBand unsupported\fR version of npm that works on node 0\.3 +and prior, clone the git repo and dig through the old tags and branches\. +.P +\fBnpm is configured to use npm, Inc\.'s public package registry at +https://registry\.npmjs\.org by default\.\fR +.P +You can configure npm to use any compatible registry you +like, and even run your own registry\. Check out the doc on +registries \fIhttps://docs\.npmjs\.com/misc/registry\fR\|\. +.P +Use of someone else's registry may be governed by terms of use\. The +terms of use for the default public registry are available at +https://www\.npmjs\.com\|\. +.SH Super Easy Install +.P +npm is bundled with node \fIhttp://nodejs\.org/download/\fR\|\. +.SS Windows Computers +.P +Get the MSI \fIhttp://nodejs\.org/download/\fR\|\. npm is in it\. +.SS Apple Macintosh Computers +.P +Get the pkg \fIhttp://nodejs\.org/download/\fR\|\. npm is in it\. +.SS Other Sorts of Unices +.P +Run \fBmake install\fP\|\. npm will be installed with node\. +.P +If you want a more fancy pants install (a different version, customized +paths, etc\.) then read on\. +.SH Fancy Install (Unix) +.P +There's a pretty robust install script at +https://www\.npmjs\.com/install\.sh\|\. You can download that and run it\. +.P +Here's an example using curl: +.P +.RS 2 +.nf +curl \-L https://www\.npmjs\.com/install\.sh | sh +.fi +.RE +.SS Slightly Fancier +.P +You can set any npm configuration params with that script: +.P +.RS 2 +.nf +npm_config_prefix=/some/path sh install\.sh +.fi +.RE +.P +Or, you can run it in uber\-debuggery mode: +.P +.RS 2 +.nf +npm_debug=1 sh install\.sh +.fi +.RE +.SS Even Fancier +.P +Get the code with git\. Use \fBmake\fP to build the docs and do other stuff\. +If you plan on hacking on npm, \fBmake link\fP is your friend\. +.P +If you've got the npm source code, you can also semi\-permanently set +arbitrary config keys using the \fB\|\./configure \-\-key=val \.\.\.\fP, and then +run npm commands by doing \fBnode cli\.js \fP\|\. (This is helpful +for testing, or running stuff without actually installing npm itself\.) +.SH Windows Install or Upgrade +.P +You can download a zip file from https://github\.com/npm/npm/releases, and +unpack it in the \fBnode_modules\\npm\\\fP folder inside node's installation folder\. +.P +To upgrade to npm 2, follow the Windows upgrade instructions in +the npm Troubleshooting Guide: +.P +https://github\.com/npm/npm/wiki/Troubleshooting#upgrading\-on\-windows +.P +If that's not fancy enough for you, then you can fetch the code with +git, and mess with it directly\. +.SH Installing on Cygwin +.P +No\. +.SH Uninstalling +.P +So sad to see you go\. +.P +.RS 2 +.nf +sudo npm uninstall npm \-g +.fi +.RE +.P +Or, if that fails, +.P +.RS 2 +.nf +sudo make uninstall +.fi +.RE +.SH More Severe Uninstalling +.P +Usually, the above instructions are sufficient\. That will remove +npm, but leave behind anything you've installed\. +.P +If you would like to remove all the packages that you have installed, +then you can use the \fBnpm ls\fP command to find them, and then \fBnpm rm\fP to +remove them\. +.P +To remove cruft left behind by npm 0\.x, you can use the included +\fBclean\-old\.sh\fP script file\. You can run it conveniently like this: +.P +.RS 2 +.nf +npm explore npm \-g \-\- sh scripts/clean\-old\.sh +.fi +.RE +.P +npm uses two configuration files, one for per\-user configs, and another +for global (every\-user) configs\. You can view them by doing: +.P +.RS 2 +.nf +npm config get userconfig # defaults to ~/\.npmrc +npm config get globalconfig # defaults to /usr/local/etc/npmrc +.fi +.RE +.P +Uninstalling npm does not remove configuration files by default\. You +must remove them yourself manually if you want them gone\. Note that +this means that future npm installs will not remember the settings that +you have chosen\. +.SH More Docs +.P +Check out the docs \fIhttps://docs\.npmjs\.com/\fR, +especially the faq \fIhttps://docs\.npmjs\.com/misc/faq\fR\|\. +.P +You can use the \fBnpm help\fP command to read any of them\. +.P +If you're a developer, and you want to use npm to publish your program, +you should read this \fIhttps://docs\.npmjs\.com/misc/developers\fR +.SH BUGS +.P +When you find issues, please report them: +.RS 0 +.IP \(bu 2 +web: +https://github\.com/npm/npm/issues + +.RE +.P +Be sure to include \fIall\fR of the output from the npm command that didn't work +as expected\. The \fBnpm\-debug\.log\fP file is also helpful to provide\. +.P +You can also look for isaacs in #node\.js on irc://irc\.freenode\.net\. He +will no doubt tell you to put the output in a gist or email\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help npm +.IP \(bu 2 +npm help 7 faq +.IP \(bu 2 +npm help help +.IP \(bu 2 +npm help 7 index + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-access.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-access.1 new file mode 100644 index 00000000..01fa5151 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-access.1 @@ -0,0 +1,89 @@ +.TH "NPM\-ACCESS" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-access\fR \- Set access level on published packages +.SH SYNOPSIS +.P +.RS 2 +.nf +npm access public [] +npm access restricted [] + +npm access grant [] +npm access revoke [] + +npm access ls\-packages [||] +npm access ls\-collaborators [ []] +npm access edit [] +.fi +.RE +.SH DESCRIPTION +.P +Used to set access controls on private packages\. +.P +For all of the subcommands, \fBnpm access\fP will perform actions on the packages +in the current working directory if no package name is passed to the +subcommand\. +.RS 0 +.IP \(bu 2 +public / restricted: +Set a package to be either publicly accessible or restricted\. +.IP \(bu 2 +grant / revoke: +Add or remove the ability of users and teams to have read\-only or read\-write +access to a package\. +.IP \(bu 2 +ls\-packages: +Show all of the packages a user or a team is able to access, along with the +access level, except for read\-only public packages (it won't print the whole +registry listing) +.IP \(bu 2 +ls\-collaborators: +Show all of the access privileges for a package\. Will only show permissions +for packages to which you have at least read access\. If \fB\fP is passed in, +the list is filtered only to teams \fIthat\fR user happens to belong to\. +.IP \(bu 2 +edit: +Set the access privileges for a package at once using \fB$EDITOR\fP\|\. + +.RE +.SH DETAILS +.P +\fBnpm access\fP always operates directly on the current registry, configurable +from the command line using \fB\-\-registry=\fP\|\. +.P +Unscoped packages are \fIalways public\fR\|\. +.P +Scoped packages \fIdefault to restricted\fR, but you can either publish them as +public using \fBnpm publish \-\-access=public\fP, or set their access as public using +\fBnpm access public\fP after the initial publish\. +.P +You must have privileges to set the access of a package: +.RS 0 +.IP \(bu 2 +You are an owner of an unscoped or scoped package\. +.IP \(bu 2 +You are a member of the team that owns a scope\. +.IP \(bu 2 +You have been given read\-write privileges for a package, either as a member +of a team or directly as an owner\. + +.RE +.P +If your account is not paid, then attempts to publish scoped packages will fail +with an HTTP 402 status code (logically enough), unless you use +\fB\-\-access=public\fP\|\. +.P +Management of teams and team memberships is done with the \fBnpm team\fP command\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help team +.IP \(bu 2 +npm help publish +.IP \(bu 2 +npm help 7 config +.IP \(bu 2 +npm help 7 registry + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-adduser.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-adduser.1 new file mode 100644 index 00000000..e6b501c0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-adduser.1 @@ -0,0 +1,90 @@ +.TH "NPM\-ADDUSER" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-adduser\fR \- Add a registry user account +.SH SYNOPSIS +.P +.RS 2 +.nf +npm adduser [\-\-registry=url] [\-\-scope=@orgname] [\-\-always\-auth] + +aliases: login, add\-user +.fi +.RE +.SH DESCRIPTION +.P +Create or verify a user named \fB\fP in the specified registry, and +save the credentials to the \fB\|\.npmrc\fP file\. If no registry is specified, +the default registry will be used (see npm help 7 \fBnpm\-config\fP)\. +.P +The username, password, and email are read in from prompts\. +.P +To reset your password, go to https://www\.npmjs\.com/forgot +.P +To change your email address, go to https://www\.npmjs\.com/email\-edit +.P +You may use this command multiple times with the same user account to +authorize on a new machine\. When authenticating on a new machine, +the username, password and email address must all match with +your existing record\. +.P +\fBnpm login\fP is an alias to \fBadduser\fP and behaves exactly the same way\. +.SH CONFIGURATION +.SS registry +.P +Default: https://registry\.npmjs\.org/ +.P +The base URL of the npm package registry\. If \fBscope\fP is also specified, +this registry will only be used for packages with that scope\. See npm help 7 \fBnpm\-scope\fP\|\. +.SS scope +.P +Default: none +.P +If specified, the user and login credentials given will be associated +with the specified scope\. See npm help 7 \fBnpm\-scope\fP\|\. You can use both at the same time, +e\.g\. +.P +.RS 2 +.nf +npm adduser \-\-registry=http://myregistry\.example\.com \-\-scope=@myco +.fi +.RE +.P +This will set a registry for the given scope and login or create a user for +that registry at the same time\. +.SS always\-auth +.P +Default: false +.P +If specified, save configuration indicating that all requests to the given +registry should include authorization information\. Useful for private +registries\. Can be used with \fB\-\-registry\fP and / or \fB\-\-scope\fP, e\.g\. +.P +.RS 2 +.nf +npm adduser \-\-registry=http://private\-registry\.example\.com \-\-always\-auth +.fi +.RE +.P +This will ensure that all requests to that registry (including for tarballs) +include an authorization header\. This setting may be necessary for use with +private registries where metadata and package tarballs are stored on hosts with +different hostnames\. See \fBalways\-auth\fP in npm help 7 \fBnpm\-config\fP for more details on +always\-auth\. Registry\-specific configuration of \fBalways\-auth\fP takes precedence +over any global configuration\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help 7 registry +.IP \(bu 2 +npm help config +.IP \(bu 2 +npm help 7 config +.IP \(bu 2 +npm help 5 npmrc +.IP \(bu 2 +npm help owner +.IP \(bu 2 +npm help whoami + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-bin.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-bin.1 new file mode 100644 index 00000000..67bf68a7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-bin.1 @@ -0,0 +1,30 @@ +.TH "NPM\-BIN" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-bin\fR \- Display npm bin folder +.SH SYNOPSIS +.P +.RS 2 +.nf +npm bin +.fi +.RE +.SH DESCRIPTION +.P +Print the folder where npm will install executables\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help prefix +.IP \(bu 2 +npm help root +.IP \(bu 2 +npm help 5 folders +.IP \(bu 2 +npm help config +.IP \(bu 2 +npm help 7 config +.IP \(bu 2 +npm help 5 npmrc + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-bugs.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-bugs.1 new file mode 100644 index 00000000..f4f76c51 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-bugs.1 @@ -0,0 +1,61 @@ +.TH "NPM\-BUGS" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-bugs\fR \- Bugs for a package in a web browser maybe +.SH SYNOPSIS +.P +.RS 2 +.nf +npm bugs +npm bugs (with no args in a package dir) + +aliases: issues +.fi +.RE +.SH DESCRIPTION +.P +This command tries to guess at the likely location of a package's +bug tracker URL, and then tries to open it using the \fB\-\-browser\fP +config param\. If no package name is provided, it will search for +a \fBpackage\.json\fP in the current folder and use the \fBname\fP property\. +.SH CONFIGURATION +.SS browser +.RS 0 +.IP \(bu 2 +Default: OS X: \fB"open"\fP, Windows: \fB"start"\fP, Others: \fB"xdg\-open"\fP +.IP \(bu 2 +Type: String + +.RE +.P +The browser that is called by the \fBnpm bugs\fP command to open websites\. +.SS registry +.RS 0 +.IP \(bu 2 +Default: https://registry\.npmjs\.org/ +.IP \(bu 2 +Type: url + +.RE +.P +The base URL of the npm package registry\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help docs +.IP \(bu 2 +npm help view +.IP \(bu 2 +npm help publish +.IP \(bu 2 +npm help 7 registry +.IP \(bu 2 +npm help config +.IP \(bu 2 +npm help 7 config +.IP \(bu 2 +npm help 5 npmrc +.IP \(bu 2 +npm help 5 package\.json + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-build.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-build.1 new file mode 100644 index 00000000..b1a279d0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-build.1 @@ -0,0 +1,41 @@ +.TH "NPM\-BUILD" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-build\fR \- Build a package +.SH SYNOPSIS +.P +.RS 2 +.nf +npm build +.fi +.RE +.RS 0 +.IP \(bu 2 +\fB\fP: +A folder containing a \fBpackage\.json\fP file in its root\. + +.RE +.SH DESCRIPTION +.P +This is the plumbing command called by \fBnpm link\fP and \fBnpm install\fP\|\. +.P +It should generally be called during installation, but if you need to run it +directly, run: +.P +.RS 2 +.nf +npm run\-script build +.fi +.RE +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help install +.IP \(bu 2 +npm help link +.IP \(bu 2 +npm help 7 scripts +.IP \(bu 2 +npm help 5 package\.json + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-bundle.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-bundle.1 new file mode 100644 index 00000000..685969cd --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-bundle.1 @@ -0,0 +1,17 @@ +.TH "NPM\-BUNDLE" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-bundle\fR \- REMOVED +.SH DESCRIPTION +.P +The \fBnpm bundle\fP command has been removed in 1\.0, for the simple reason +that it is no longer necessary, as the default behavior is now to +install packages into the local space\. +.P +Just use \fBnpm install\fP now to do what \fBnpm bundle\fP used to do\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help install + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-cache.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-cache.1 new file mode 100644 index 00000000..16a092c5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-cache.1 @@ -0,0 +1,86 @@ +.TH "NPM\-CACHE" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-cache\fR \- Manipulates packages cache +.SH SYNOPSIS +.P +.RS 2 +.nf +npm cache add +npm cache add +npm cache add +npm cache add @ + +npm cache ls [] + +npm cache clean [] +.fi +.RE +.SH DESCRIPTION +.P +Used to add, list, or clear the npm cache folder\. +.RS 0 +.IP \(bu 2 +add: +Add the specified package to the local cache\. This command is primarily +intended to be used internally by npm, but it can provide a way to +add data to the local installation cache explicitly\. +.IP \(bu 2 +ls: +Show the data in the cache\. Argument is a path to show in the cache +folder\. Works a bit like the \fBfind\fP program, but limited by the +\fBdepth\fP config\. +.IP \(bu 2 +clean: +Delete data out of the cache folder\. If an argument is provided, then +it specifies a subpath to delete\. If no argument is provided, then +the entire cache is cleared\. + +.RE +.SH DETAILS +.P +npm stores cache data in the directory specified in \fBnpm config get cache\fP\|\. +For each package that is added to the cache, three pieces of information are +stored in \fB{cache}/{name}/{version}\fP: +.RS 0 +.IP \(bu 2 +\|\.\.\./package/package\.json: +The package\.json file, as npm sees it\. +.IP \(bu 2 +\|\.\.\./package\.tgz: +The tarball for that version\. + +.RE +.P +Additionally, whenever a registry request is made, a \fB\|\.cache\.json\fP file +is placed at the corresponding URI, to store the ETag and the requested +data\. This is stored in \fB{cache}/{hostname}/{path}/\.cache\.json\fP\|\. +.P +Commands that make non\-essential registry requests (such as \fBsearch\fP and +\fBview\fP, or the completion scripts) generally specify a minimum timeout\. +If the \fB\|\.cache\.json\fP file is younger than the specified timeout, then +they do not make an HTTP request to the registry\. +.SH CONFIGURATION +.SS cache +.P +Default: \fB~/\.npm\fP on Posix, or \fB%AppData%/npm\-cache\fP on Windows\. +.P +The root cache folder\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help 5 folders +.IP \(bu 2 +npm help config +.IP \(bu 2 +npm help 7 config +.IP \(bu 2 +npm help 5 npmrc +.IP \(bu 2 +npm help install +.IP \(bu 2 +npm help publish +.IP \(bu 2 +npm help pack + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-completion.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-completion.1 new file mode 100644 index 00000000..7d39b608 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-completion.1 @@ -0,0 +1,37 @@ +.TH "NPM\-COMPLETION" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-completion\fR \- Tab Completion for npm +.SH SYNOPSIS +.P +.RS 2 +.nf +\|\. <(npm completion) +.fi +.RE +.SH DESCRIPTION +.P +Enables tab\-completion in all npm commands\. +.P +The synopsis above +loads the completions into your current shell\. Adding it to +your ~/\.bashrc or ~/\.zshrc will make the completions available +everywhere\. +.P +You may of course also pipe the output of npm completion to a file +such as \fB/usr/local/etc/bash_completion\.d/npm\fP if you have a system +that will read that file for you\. +.P +When \fBCOMP_CWORD\fP, \fBCOMP_LINE\fP, and \fBCOMP_POINT\fP are defined in the +environment, \fBnpm completion\fP acts in "plumbing mode", and outputs +completions based on the arguments\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help 7 developers +.IP \(bu 2 +npm help 7 faq +.IP \(bu 2 +npm help npm + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-config.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-config.1 new file mode 100644 index 00000000..d8518372 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-config.1 @@ -0,0 +1,97 @@ +.TH "NPM\-CONFIG" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-config\fR \- Manage the npm configuration files +.SH SYNOPSIS +.P +.RS 2 +.nf +npm config set [\-\-global] +npm config get +npm config delete +npm config list +npm config edit +npm c [set|get|delete|list] +npm get +npm set [\-\-global] + +aliases: c +.fi +.RE +.SH DESCRIPTION +.P +npm gets its config settings from the command line, environment +variables, \fBnpmrc\fP files, and in some cases, the \fBpackage\.json\fP file\. +.P +See npm help 5 npmrc for more information about the npmrc files\. +.P +See npm help 7 \fBnpm\-config\fP for a more thorough discussion of the mechanisms +involved\. +.P +The \fBnpm config\fP command can be used to update and edit the contents +of the user and global npmrc files\. +.SH Sub\-commands +.P +Config supports the following sub\-commands: +.SS set +.P +.RS 2 +.nf +npm config set key value +.fi +.RE +.P +Sets the config key to the value\. +.P +If value is omitted, then it sets it to "true"\. +.SS get +.P +.RS 2 +.nf +npm config get key +.fi +.RE +.P +Echo the config value to stdout\. +.SS list +.P +.RS 2 +.nf +npm config list +.fi +.RE +.P +Show all the config settings\. +.SS delete +.P +.RS 2 +.nf +npm config delete key +.fi +.RE +.P +Deletes the key from all configuration files\. +.SS edit +.P +.RS 2 +.nf +npm config edit +.fi +.RE +.P +Opens the config file in an editor\. Use the \fB\-\-global\fP flag to edit the +global config\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help 5 folders +.IP \(bu 2 +npm help 7 config +.IP \(bu 2 +npm help 5 package\.json +.IP \(bu 2 +npm help 5 npmrc +.IP \(bu 2 +npm help npm + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-dedupe.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-dedupe.1 new file mode 100644 index 00000000..9239bff6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-dedupe.1 @@ -0,0 +1,76 @@ +.TH "NPM\-DEDUPE" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-dedupe\fR \- Reduce duplication +.SH SYNOPSIS +.P +.RS 2 +.nf +npm dedupe [package names\.\.\.] +npm ddp [package names\.\.\.] + +aliases: find\-dupes, ddp +.fi +.RE +.SH DESCRIPTION +.P +Searches the local package tree and attempts to simplify the overall +structure by moving dependencies further up the tree, where they can +be more effectively shared by multiple dependent packages\. +.P +For example, consider this dependency graph: +.P +.RS 2 +.nf +a ++\-\- b <\-\- depends on c@1\.0\.x +| `\-\- c@1\.0\.3 +`\-\- d <\-\- depends on c@~1\.0\.9 + `\-\- c@1\.0\.10 +.fi +.RE +.P +In this case, npm help \fBnpm\-dedupe\fP will transform the tree to: +.P +.RS 2 +.nf +a ++\-\- b ++\-\- d +`\-\- c@1\.0\.10 +.fi +.RE +.P +Because of the hierarchical nature of node's module lookup, b and d +will both get their dependency met by the single c package at the root +level of the tree\. +.P +If a suitable version exists at the target location in the tree +already, then it will be left untouched, but the other duplicates will +be deleted\. +.P +If no suitable version can be found, then a warning is printed, and +nothing is done\. +.P +If any arguments are supplied, then they are filters, and only the +named packages will be touched\. +.P +Note that this operation transforms the dependency tree, and may +result in packages getting updated versions, perhaps from the npm +registry\. +.P +This feature is experimental, and may change in future versions\. +.P +The \fB\-\-tag\fP argument will apply to all of the affected dependencies\. If a +tag with the given name exists, the tagged version is preferred over newer +versions\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help ls +.IP \(bu 2 +npm help update +.IP \(bu 2 +npm help install + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-deprecate.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-deprecate.1 new file mode 100644 index 00000000..15572821 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-deprecate.1 @@ -0,0 +1,37 @@ +.TH "NPM\-DEPRECATE" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-deprecate\fR \- Deprecate a version of a package +.SH SYNOPSIS +.P +.RS 2 +.nf +npm deprecate [@] +.fi +.RE +.SH DESCRIPTION +.P +This command will update the npm registry entry for a package, providing +a deprecation warning to all who attempt to install it\. +.P +It works on version ranges as well as specific versions, so you can do +something like this: +.P +.RS 2 +.nf +npm deprecate my\-thing@"< 0\.2\.3" "critical bug fixed in v0\.2\.3" +.fi +.RE +.P +Note that you must be the package owner to deprecate something\. See the +\fBowner\fP and \fBadduser\fP help topics\. +.P +To un\-deprecate a package, specify an empty string (\fB""\fP) for the \fBmessage\fP argument\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help publish +.IP \(bu 2 +npm help 7 registry + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-dist-tag.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-dist-tag.1 new file mode 100644 index 00000000..aaa58bea --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-dist-tag.1 @@ -0,0 +1,109 @@ +.TH "NPM\-DIST\-TAG" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-dist-tag\fR \- Modify package distribution tags +.SH SYNOPSIS +.P +.RS 2 +.nf +npm dist\-tag add @ [] +npm dist\-tag rm +npm dist\-tag ls [] + +aliases: dist\-tags +.fi +.RE +.SH DESCRIPTION +.P +Add, remove, and enumerate distribution tags on a package: +.RS 0 +.IP \(bu 2 +add: +Tags the specified version of the package with the specified tag, or the +\fB\-\-tag\fP config if not specified\. +.IP \(bu 2 +rm: +Clear a tag that is no longer in use from the package\. +.IP \(bu 2 +ls: +Show all of the dist\-tags for a package, defaulting to the package in +the current prefix\. + +.RE +.P +A tag can be used when installing packages as a reference to a version instead +of using a specific version number: +.P +.RS 2 +.nf +npm install @ +.fi +.RE +.P +When installing dependencies, a preferred tagged version may be specified: +.P +.RS 2 +.nf +npm install \-\-tag +.fi +.RE +.P +This also applies to \fBnpm dedupe\fP\|\. +.P +Publishing a package sets the \fBlatest\fP tag to the published version unless the +\fB\-\-tag\fP option is used\. For example, \fBnpm publish \-\-tag=beta\fP\|\. +.P +By default, \fBnpm install \fP (without any \fB@\fP or \fB@\fP +specifier) installs the \fBlatest\fP tag\. +.SH PURPOSE +.P +Tags can be used to provide an alias instead of version numbers\. +.P +For example, a project might choose to have multiple streams of development +and use a different tag for each stream, +e\.g\., \fBstable\fP, \fBbeta\fP, \fBdev\fP, \fBcanary\fP\|\. +.P +By default, the \fBlatest\fP tag is used by npm to identify the current version of +a package, and \fBnpm install \fP (without any \fB@\fP or \fB@\fP +specifier) installs the \fBlatest\fP tag\. Typically, projects only use the \fBlatest\fP +tag for stable release versions, and use other tags for unstable versions such +as prereleases\. +.P +The \fBnext\fP tag is used by some projects to identify the upcoming version\. +.P +By default, other than \fBlatest\fP, no tag has any special significance to npm +itself\. +.SH CAVEATS +.P +This command used to be known as \fBnpm tag\fP, which only created new tags, and so +had a different syntax\. +.P +Tags must share a namespace with version numbers, because they are specified in +the same slot: \fBnpm install @\fP vs \fBnpm install @\fP\|\. +.P +Tags that can be interpreted as valid semver ranges will be rejected\. For +example, \fBv1\.4\fP cannot be used as a tag, because it is interpreted by semver as +\fB>=1\.4\.0 <1\.5\.0\fP\|\. See https://github\.com/npm/npm/issues/6082\|\. +.P +The simplest way to avoid semver problems with tags is to use tags that do not +begin with a number or the letter \fBv\fP\|\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help tag +.IP \(bu 2 +npm help publish +.IP \(bu 2 +npm help install +.IP \(bu 2 +npm help dedupe +.IP \(bu 2 +npm help 7 registry +.IP \(bu 2 +npm help config +.IP \(bu 2 +npm help 7 config +.IP \(bu 2 +npm help 5 npmrc + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-docs.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-docs.1 new file mode 100644 index 00000000..e3c9e3bc --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-docs.1 @@ -0,0 +1,60 @@ +.TH "NPM\-DOCS" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-docs\fR \- Docs for a package in a web browser maybe +.SH SYNOPSIS +.P +.RS 2 +.nf +npm docs [ [ \.\.\.]] +npm docs (with no args in a package dir) +npm home [ [ \.\.\.]] +npm home (with no args in a package dir) +.fi +.RE +.SH DESCRIPTION +.P +This command tries to guess at the likely location of a package's +documentation URL, and then tries to open it using the \fB\-\-browser\fP +config param\. You can pass multiple package names at once\. If no +package name is provided, it will search for a \fBpackage\.json\fP in +the current folder and use the \fBname\fP property\. +.SH CONFIGURATION +.SS browser +.RS 0 +.IP \(bu 2 +Default: OS X: \fB"open"\fP, Windows: \fB"start"\fP, Others: \fB"xdg\-open"\fP +.IP \(bu 2 +Type: String + +.RE +.P +The browser that is called by the \fBnpm docs\fP command to open websites\. +.SS registry +.RS 0 +.IP \(bu 2 +Default: https://registry\.npmjs\.org/ +.IP \(bu 2 +Type: url + +.RE +.P +The base URL of the npm package registry\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help view +.IP \(bu 2 +npm help publish +.IP \(bu 2 +npm help 7 registry +.IP \(bu 2 +npm help config +.IP \(bu 2 +npm help 7 config +.IP \(bu 2 +npm help 5 npmrc +.IP \(bu 2 +npm help 5 package\.json + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-edit.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-edit.1 new file mode 100644 index 00000000..87ff810f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-edit.1 @@ -0,0 +1,50 @@ +.TH "NPM\-EDIT" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-edit\fR \- Edit an installed package +.SH SYNOPSIS +.P +.RS 2 +.nf +npm edit [@] +.fi +.RE +.SH DESCRIPTION +.P +Opens the package folder in the default editor (or whatever you've +configured as the npm \fBeditor\fP config \-\- see npm help 7 \fBnpm\-config\fP\|\.) +.P +After it has been edited, the package is rebuilt so as to pick up any +changes in compiled packages\. +.P +For instance, you can do \fBnpm install connect\fP to install connect +into your package, and then \fBnpm edit connect\fP to make a few +changes to your locally installed copy\. +.SH CONFIGURATION +.SS editor +.RS 0 +.IP \(bu 2 +Default: \fBEDITOR\fP environment variable if set, or \fB"vi"\fP on Posix, +or \fB"notepad"\fP on Windows\. +.IP \(bu 2 +Type: path + +.RE +.P +The command to run for \fBnpm edit\fP or \fBnpm config edit\fP\|\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help 5 folders +.IP \(bu 2 +npm help explore +.IP \(bu 2 +npm help install +.IP \(bu 2 +npm help config +.IP \(bu 2 +npm help 7 config +.IP \(bu 2 +npm help 5 npmrc + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-explore.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-explore.1 new file mode 100644 index 00000000..18304604 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-explore.1 @@ -0,0 +1,55 @@ +.TH "NPM\-EXPLORE" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-explore\fR \- Browse an installed package +.SH SYNOPSIS +.P +.RS 2 +.nf +npm explore [ \-\- ] +.fi +.RE +.SH DESCRIPTION +.P +Spawn a subshell in the directory of the installed package specified\. +.P +If a command is specified, then it is run in the subshell, which then +immediately terminates\. +.P +This is particularly handy in the case of git submodules in the +\fBnode_modules\fP folder: +.P +.RS 2 +.nf +npm explore some\-dependency \-\- git pull origin master +.fi +.RE +.P +Note that the package is \fInot\fR automatically rebuilt afterwards, so be +sure to use \fBnpm rebuild \fP if you make any changes\. +.SH CONFIGURATION +.SS shell +.RS 0 +.IP \(bu 2 +Default: SHELL environment variable, or "bash" on Posix, or "cmd" on +Windows +.IP \(bu 2 +Type: path + +.RE +.P +The shell to run for the \fBnpm explore\fP command\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help 5 folders +.IP \(bu 2 +npm help edit +.IP \(bu 2 +npm help rebuild +.IP \(bu 2 +npm help build +.IP \(bu 2 +npm help install + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-help-search.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-help-search.1 new file mode 100644 index 00000000..c52da52b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-help-search.1 @@ -0,0 +1,45 @@ +.TH "NPM\-HELP\-SEARCH" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-help-search\fR \- Search npm help documentation +.SH SYNOPSIS +.P +.RS 2 +.nf +npm help\-search some search terms +.fi +.RE +.SH DESCRIPTION +.P +This command will search the npm markdown documentation files for the +terms provided, and then list the results, sorted by relevance\. +.P +If only one result is found, then it will show that help topic\. +.P +If the argument to \fBnpm help\fP is not a known help topic, then it will +call \fBhelp\-search\fP\|\. It is rarely if ever necessary to call this +command directly\. +.SH CONFIGURATION +.SS long +.RS 0 +.IP \(bu 2 +Type: Boolean +.IP \(bu 2 +Default: false + +.RE +.P +If true, the "long" flag will cause help\-search to output context around +where the terms were found in the documentation\. +.P +If false, then help\-search will just list out the help topics found\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help npm +.IP \(bu 2 +npm help 7 faq +.IP \(bu 2 +npm help help + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-help.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-help.1 new file mode 100644 index 00000000..1241d4ae --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-help.1 @@ -0,0 +1,57 @@ +.TH "NPM\-HELP" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-help\fR \- Get help on npm +.SH SYNOPSIS +.P +.RS 2 +.nf +npm help +npm help some search terms +.fi +.RE +.SH DESCRIPTION +.P +If supplied a topic, then show the appropriate documentation page\. +.P +If the topic does not exist, or if multiple terms are provided, then run +the \fBhelp\-search\fP command to find a match\. Note that, if \fBhelp\-search\fP +finds a single subject, then it will run \fBhelp\fP on that topic, so unique +matches are equivalent to specifying a topic name\. +.SH CONFIGURATION +.SS viewer +.RS 0 +.IP \(bu 2 +Default: "man" on Posix, "browser" on Windows +.IP \(bu 2 +Type: path + +.RE +.P +The program to use to view help content\. +.P +Set to \fB"browser"\fP to view html help content in the default web browser\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help npm +.IP \(bu 2 +README +.IP \(bu 2 +npm help 7 faq +.IP \(bu 2 +npm help 5 folders +.IP \(bu 2 +npm help config +.IP \(bu 2 +npm help 7 config +.IP \(bu 2 +npm help 5 npmrc +.IP \(bu 2 +npm help 5 package\.json +.IP \(bu 2 +npm help help\-search +.IP \(bu 2 +npm help 7 index + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-init.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-init.1 new file mode 100644 index 00000000..1f1337a0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-init.1 @@ -0,0 +1,49 @@ +.TH "NPM\-INIT" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-init\fR \- Interactively create a package\.json file +.SH SYNOPSIS +.P +.RS 2 +.nf +npm init [\-f|\-\-force|\-y|\-\-yes] +.fi +.RE +.SH DESCRIPTION +.P +This will ask you a bunch of questions, and then write a package\.json for you\. +.P +It attempts to make reasonable guesses about what you want things to be set to, +and then writes a package\.json file with the options you've selected\. +.P +If you already have a package\.json file, it'll read that first, and default to +the options in there\. +.P +It is strictly additive, so it does not delete options from your package\.json +without a really good reason to do so\. +.P +If you invoke it with \fB\-f\fP, \fB\-\-force\fP, \fB\-y\fP, or \fB\-\-yes\fP, it will use only +defaults and not prompt you for any options\. +.SH CONFIGURATION +.SS scope +.RS 0 +.IP \(bu 2 +Default: none +.IP \(bu 2 +Type: String + +.RE +.P +The scope under which the new module should be created\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +https://github\.com/isaacs/init\-package\-json +.IP \(bu 2 +npm help 5 package\.json +.IP \(bu 2 +npm help version +.IP \(bu 2 +npm help 7 scope + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-install.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-install.1 new file mode 100644 index 00000000..8188b35c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-install.1 @@ -0,0 +1,418 @@ +.TH "NPM\-INSTALL" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-install\fR \- Install a package +.SH SYNOPSIS +.P +.RS 2 +.nf +npm install (with no args in a package dir) +npm install +npm install +npm install +npm install [@/] [\-\-save|\-\-save\-dev|\-\-save\-optional] [\-\-save\-exact] [\-\-save\-bundle] +npm install [@/]@ +npm install [@/]@ +npm install [@/]@ +npm i (with any of the previous argument usage) +.fi +.RE +.SH DESCRIPTION +.P +This command installs a package, and any packages that it depends on\. If the +package has a shrinkwrap file, the installation of dependencies will be driven +by that\. See npm help shrinkwrap\. +.P +A \fBpackage\fP is: +.RS 0 +.IP \(bu 2 +a) a folder containing a program described by a npm help 5 \fBpackage\.json\fP file +.IP \(bu 2 +b) a gzipped tarball containing (a) +.IP \(bu 2 +c) a url that resolves to (b) +.IP \(bu 2 +d) a \fB@\fP that is published on the registry (see npm help 7 \fBnpm\-registry\fP) with (c) +.IP \(bu 2 +e) a \fB@\fP (see npm help \fBnpm\-dist\-tag\fP) that points to (d) +.IP \(bu 2 +f) a \fB\fP that has a "latest" tag satisfying (e) +.IP \(bu 2 +g) a \fB\fP that resolves to (b) + +.RE +.P +Even if you never publish your package, you can still get a lot of +benefits of using npm if you just want to write a node program (a), and +perhaps if you also want to be able to easily install it elsewhere +after packing it up into a tarball (b)\. +.RS 0 +.IP \(bu 2 +\fBnpm install\fP (in package directory, no arguments): + Install the dependencies in the local node_modules folder\. + In global mode (ie, with \fB\-g\fP or \fB\-\-global\fP appended to the command), + it installs the current package context (ie, the current working + directory) as a global package\. + By default, \fBnpm install\fP will install all modules listed as dependencies + in npm help 5 \fBpackage\.json\fP\|\. + With the \fB\-\-production\fP flag (or when the \fBNODE_ENV\fP environment variable + is set to \fBproduction\fP), npm will not install modules listed in + \fBdevDependencies\fP\|\. +.IP \(bu 2 +\fBnpm install \fP: + Install a package that is sitting in a folder on the filesystem\. +.IP \(bu 2 +\fBnpm install \fP: + Install a package that is sitting on the filesystem\. Note: if you just want + to link a dev directory into your npm root, you can do this more easily by + using \fBnpm link\fP\|\. + Example: +.P +.RS 2 +.nf + npm install \./package\.tgz +.fi +.RE +.IP \(bu 2 +\fBnpm install \fP: + Fetch the tarball url, and then install it\. In order to distinguish between + this and other options, the argument must start with "http://" or "https://" + Example: +.P +.RS 2 +.nf + npm install https://github\.com/indexzero/forever/tarball/v0\.5\.6 +.fi +.RE +.IP \(bu 2 +\fBnpm install [@/] [\-\-save|\-\-save\-dev|\-\-save\-optional]\fP: + Do a \fB@\fP install, where \fB\fP is the "tag" config\. (See + npm help 7 \fBnpm\-config\fP\|\. The config's default value is \fBlatest\fP\|\.) + In most cases, this will install the latest version + of the module published on npm\. + Example: +.P +.RS 2 +.nf + npm install sax +.fi +.RE + \fBnpm install\fP takes 3 exclusive, optional flags which save or update + the package version in your main package\.json: +.RS 0 +.IP \(bu 2 +\fB\-\-save\fP: Package will appear in your \fBdependencies\fP\|\. +.IP \(bu 2 +\fB\-\-save\-dev\fP: Package will appear in your \fBdevDependencies\fP\|\. +.IP \(bu 2 +\fB\-\-save\-optional\fP: Package will appear in your \fBoptionalDependencies\fP\|\. +When using any of the above options to save dependencies to your +package\.json, there are two additional, optional flags: +.IP \(bu 2 +\fB\-\-save\-exact\fP: Saved dependencies will be configured with an +exact version rather than using npm's default semver range +operator\. +.IP \(bu 2 +\fB\-B, \-\-save\-bundle\fP: Saved dependencies will also be added to your \fBbundleDependencies\fP list\. +Note: if you do not include the @\-symbol on your scope name, npm will +interpret this as a GitHub repository instead, see below\. Scopes names +must also be followed by a slash\. +Examples: +.P +.RS 2 +.nf +npm install sax \-\-save +npm install githubname/reponame +npm install @myorg/privatepackage +npm install node\-tap \-\-save\-dev +npm install dtrace\-provider \-\-save\-optional +npm install readable\-stream \-\-save \-\-save\-exact +npm install ansi\-regex \-\-save \-\-save\-bundle +.fi +.RE + +.RE + +.RE +.P +.RS 2 +.nf +**Note**: If there is a file or folder named `` in the current +working directory, then it will try to install that, and only try to +fetch the package by name if it is not valid\. +.fi +.RE +.RS 0 +.IP \(bu 2 +\fBnpm install [@/]@\fP: + Install the version of the package that is referenced by the specified tag\. + If the tag does not exist in the registry data for that package, then this + will fail\. + Example: +.P +.RS 2 +.nf + npm install sax@latest + npm install @myorg/mypackage@latest +.fi +.RE +.IP \(bu 2 +\fBnpm install [@/]@\fP: + Install the specified version of the package\. This will fail if the + version has not been published to the registry\. + Example: +.P +.RS 2 +.nf + npm install sax@0\.1\.1 + npm install @myorg/privatepackage@1\.5\.0 +.fi +.RE +.IP \(bu 2 +\fBnpm install [@/]@\fP: + Install a version of the package matching the specified version range\. This + will follow the same rules for resolving dependencies described in npm help 5 \fBpackage\.json\fP\|\. + Note that most version ranges must be put in quotes so that your shell will + treat it as a single argument\. + Example: +.P +.RS 2 +.nf + npm install sax@">=0\.1\.0 <0\.2\.0" + npm install @myorg/privatepackage@">=0\.1\.0 <0\.2\.0" +.fi +.RE +.IP \(bu 2 +\fBnpm install \fP: + Install a package by cloning a git remote url\. The format of the git + url is: +.P +.RS 2 +.nf + ://[[:]@][:][:/][#] +.fi +.RE + \fB\fP is one of \fBgit\fP, \fBgit+ssh\fP, \fBgit+http\fP, or + \fBgit+https\fP\|\. If no \fB\fP is specified, then \fBmaster\fP is + used\. + The following git environment variables are recognized by npm and will be added + to the environment when running git: +.RS 0 +.IP \(bu 2 +\fBGIT_ASKPASS\fP +.IP \(bu 2 +\fBGIT_EXEC_PATH\fP +.IP \(bu 2 +\fBGIT_PROXY_COMMAND\fP +.IP \(bu 2 +\fBGIT_SSH\fP +.IP \(bu 2 +\fBGIT_SSH_COMMAND\fP +.IP \(bu 2 +\fBGIT_SSL_CAINFO\fP +.IP \(bu 2 +\fBGIT_SSL_NO_VERIFY\fP +See the git man page for details\. +Examples: +.P +.RS 2 +.nf +npm install git+ssh://git@github\.com:npm/npm\.git#v1\.0\.27 +npm install git+https://isaacs@github\.com/npm/npm\.git +npm install git://github\.com/npm/npm\.git#v1\.0\.27 +GIT_SSH_COMMAND='ssh \-i ~/\.ssh/custom_ident' npm install git+ssh://git@github\.com:npm/npm\.git +.fi +.RE + +.RE +.IP \(bu 2 +\fBnpm install /[#]\fP: +.IP \(bu 2 +\fBnpm install github:/[#]\fP: + Install the package at \fBhttps://github\.com/githubname/githubrepo\fP by + attempting to clone it using \fBgit\fP\|\. + If you don't specify a \fIcommit\-ish\fR then \fBmaster\fP will be used\. + Examples: +.P +.RS 2 +.nf + npm install mygithubuser/myproject + npm install github:mygithubuser/myproject +.fi +.RE +.IP \(bu 2 +\fBnpm install gist:[/][#]\fP: + Install the package at \fBhttps://gist\.github\.com/gistID\fP by attempting to + clone it using \fBgit\fP\|\. The GitHub username associated with the gist is + optional and will not be saved in \fBpackage\.json\fP if \fB\-\-save\fP is used\. + If you don't specify a \fIcommit\-ish\fR then \fBmaster\fP will be used\. + Example: +.P +.RS 2 +.nf + npm install gist:101a11beef +.fi +.RE +.IP \(bu 2 +\fBnpm install bitbucket:/[#]\fP: + Install the package at \fBhttps://bitbucket\.org/bitbucketname/bitbucketrepo\fP + by attempting to clone it using \fBgit\fP\|\. + If you don't specify a \fIcommit\-ish\fR then \fBmaster\fP will be used\. + Example: +.P +.RS 2 +.nf + npm install bitbucket:mybitbucketuser/myproject +.fi +.RE +.IP \(bu 2 +\fBnpm install gitlab:/[#]\fP: + Install the package at \fBhttps://gitlab\.com/gitlabname/gitlabrepo\fP + by attempting to clone it using \fBgit\fP\|\. + If you don't specify a \fIcommit\-ish\fR then \fBmaster\fP will be used\. + Example: +.P +.RS 2 +.nf + npm install gitlab:mygitlabuser/myproject +.fi +.RE + +.RE +.P +You may combine multiple arguments, and even multiple types of arguments\. +For example: +.P +.RS 2 +.nf +npm install sax@">=0\.1\.0 <0\.2\.0" bench supervisor +.fi +.RE +.P +The \fB\-\-tag\fP argument will apply to all of the specified install targets\. If a +tag with the given name exists, the tagged version is preferred over newer +versions\. +.P +The \fB\-\-force\fP argument will force npm to fetch remote resources even if a +local copy exists on disk\. +.P +.RS 2 +.nf +npm install sax \-\-force +.fi +.RE +.P +The \fB\-\-global\fP argument will cause npm to install the package globally +rather than locally\. See npm help 5 \fBnpm\-folders\fP\|\. +.P +The \fB\-\-ignore\-scripts\fP argument will cause npm to not execute any +scripts defined in the package\.json\. See npm help 7 \fBnpm\-scripts\fP\|\. +.P +The \fB\-\-link\fP argument will cause npm to link global installs into the +local space in some cases\. +.P +The \fB\-\-no\-bin\-links\fP argument will prevent npm from creating symlinks for +any binaries the package might contain\. +.P +The \fB\-\-no\-optional\fP argument will prevent optional dependencies from +being installed\. +.P +The \fB\-\-no\-shrinkwrap\fP argument, which will ignore an available +shrinkwrap file and use the package\.json instead\. +.P +The \fB\-\-nodedir=/path/to/node/source\fP argument will allow npm to find the +node source code so that npm can compile native modules\. +.P +See npm help 7 \fBnpm\-config\fP\|\. Many of the configuration params have some +effect on installation, since that's most of what npm does\. +.SH ALGORITHM +.P +To install a package, npm uses the following algorithm: +.P +.RS 2 +.nf +install(where, what, family, ancestors) +fetch what, unpack to /node_modules/ +for each dep in what\.dependencies + resolve dep to precise version +for each dep@version in what\.dependencies + not in /node_modules//node_modules/* + and not in + add precise version deps to + install(/node_modules/, dep, family) +.fi +.RE +.P +For this \fBpackage{dep}\fP structure: \fBA{B,C}, B{C}, C{D}\fP, +this algorithm produces: +.P +.RS 2 +.nf +A ++\-\- B +`\-\- C + `\-\- D +.fi +.RE +.P +That is, the dependency from B to C is satisfied by the fact that A +already caused C to be installed at a higher level\. +.P +See npm help 5 folders for a more detailed description of the specific +folder structures that npm creates\. +.SS Limitations of npm's Install Algorithm +.P +There are some very rare and pathological edge\-cases where a cycle can +cause npm to try to install a never\-ending tree of packages\. Here is +the simplest case: +.P +.RS 2 +.nf +A \-> B \-> A' \-> B' \-> A \-> B \-> A' \-> B' \-> A \-> \.\.\. +.fi +.RE +.P +where \fBA\fP is some version of a package, and \fBA'\fP is a different version +of the same package\. Because \fBB\fP depends on a different version of \fBA\fP +than the one that is already in the tree, it must install a separate +copy\. The same is true of \fBA'\fP, which must install \fBB'\fP\|\. Because \fBB'\fP +depends on the original version of \fBA\fP, which has been overridden, the +cycle falls into infinite regress\. +.P +To avoid this situation, npm flat\-out refuses to install any +\fBname@version\fP that is already present anywhere in the tree of package +folder ancestors\. A more correct, but more complex, solution would be +to symlink the existing version into the new location\. If this ever +affects a real use\-case, it will be investigated\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help 5 folders +.IP \(bu 2 +npm help update +.IP \(bu 2 +npm help link +.IP \(bu 2 +npm help rebuild +.IP \(bu 2 +npm help 7 scripts +.IP \(bu 2 +npm help build +.IP \(bu 2 +npm help config +.IP \(bu 2 +npm help 7 config +.IP \(bu 2 +npm help 5 npmrc +.IP \(bu 2 +npm help 7 registry +.IP \(bu 2 +npm help tag +.IP \(bu 2 +npm help uninstall +.IP \(bu 2 +npm help shrinkwrap +.IP \(bu 2 +npm help 5 package\.json + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-link.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-link.1 new file mode 100644 index 00000000..4478c360 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-link.1 @@ -0,0 +1,103 @@ +.TH "NPM\-LINK" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-link\fR \- Symlink a package folder +.SH SYNOPSIS +.P +.RS 2 +.nf +npm link (in package folder) +npm link [@/] +npm ln (with any of the previous argument usage) +.fi +.RE +.SH DESCRIPTION +.P +Package linking is a two\-step process\. +.P +First, \fBnpm link\fP in a package folder will create a symlink in the global folder +\fB{prefix}/lib/node_modules/\fP that links to the package where the \fBnpm +link\fP command was executed\. (see npm help 7 \fBnpm\-config\fP for the value of \fBprefix\fP)\. It +will also link any bins in the package to \fB{prefix}/bin/{name}\fP\|\. +.P +Next, in some other location, \fBnpm link package\-name\fP will create a +symbolic link from globally\-installed \fBpackage\-name\fP to \fBnode_modules/\fP +of the current folder\. +.P +Note that \fBpackage\-name\fP is taken from \fBpackage\.json\fP, +not from directory name\. +.P +The package name can be optionally prefixed with a scope\. See npm help 7 \fBnpm\-scope\fP\|\. +The scope must be preceded by an @\-symbol and followed by a slash\. +.P +When creating tarballs for \fBnpm publish\fP, the linked packages are +"snapshotted" to their current state by resolving the symbolic links\. +.P +This is handy for installing your own stuff, so that you can work on it and +test it iteratively without having to continually rebuild\. +.P +For example: +.P +.RS 2 +.nf +cd ~/projects/node\-redis # go into the package directory +npm link # creates global link +cd ~/projects/node\-bloggy # go into some other package directory\. +npm link redis # link\-install the package +.fi +.RE +.P +Now, any changes to ~/projects/node\-redis will be reflected in +~/projects/node\-bloggy/node_modules/node\-redis/\. Note that the link should +be to the package name, not the directory name for that package\. +.P +You may also shortcut the two steps in one\. For example, to do the +above use\-case in a shorter way: +.P +.RS 2 +.nf +cd ~/projects/node\-bloggy # go into the dir of your main project +npm link \.\./node\-redis # link the dir of your dependency +.fi +.RE +.P +The second line is the equivalent of doing: +.P +.RS 2 +.nf +(cd \.\./node\-redis; npm link) +npm link node\-redis +.fi +.RE +.P +That is, it first creates a global link, and then links the global +installation target into your project's \fBnode_modules\fP folder\. +.P +If your linked package is scoped (see npm help 7 \fBnpm\-scope\fP) your link command must +include that scope, e\.g\. +.P +.RS 2 +.nf +npm link @myorg/privatepackage +.fi +.RE +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help 7 developers +.IP \(bu 2 +npm help 7 faq +.IP \(bu 2 +npm help 5 package\.json +.IP \(bu 2 +npm help install +.IP \(bu 2 +npm help 5 folders +.IP \(bu 2 +npm help config +.IP \(bu 2 +npm help 7 config +.IP \(bu 2 +npm help 5 npmrc + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-logout.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-logout.1 new file mode 100644 index 00000000..3b88cfdd --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-logout.1 @@ -0,0 +1,57 @@ +.TH "NPM\-LOGOUT" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-logout\fR \- Log out of the registry +.SH SYNOPSIS +.P +.RS 2 +.nf +npm logout [\-\-registry=url] [\-\-scope=@orgname] +.fi +.RE +.SH DESCRIPTION +.P +When logged into a registry that supports token\-based authentication, tell the +server to end this token's session\. This will invalidate the token everywhere +you're using it, not just for the current environment\. +.P +When logged into a legacy registry that uses username and password authentication, this will +clear the credentials in your user configuration\. In this case, it will \fIonly\fR affect +the current environment\. +.P +If \fB\-\-scope\fP is provided, this will find the credentials for the registry +connected to that scope, if set\. +.SH CONFIGURATION +.SS registry +.P +Default: https://registry\.npmjs\.org/ +.P +The base URL of the npm package registry\. If \fBscope\fP is also specified, +it takes precedence\. +.SS scope +.P +Default: none +.P +If specified, you will be logged out of the specified scope\. See npm help 7 \fBnpm\-scope\fP\|\. +.P +.RS 2 +.nf +npm logout \-\-scope=@myco +.fi +.RE +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help adduser +.IP \(bu 2 +npm help 7 registry +.IP \(bu 2 +npm help config +.IP \(bu 2 +npm help 7 config +.IP \(bu 2 +npm help 5 npmrc +.IP \(bu 2 +npm help whoami + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-ls.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-ls.1 new file mode 100644 index 00000000..822d1879 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-ls.1 @@ -0,0 +1,131 @@ +.TH "NPM\-LS" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-ls\fR \- List installed packages +.SH SYNOPSIS +.P +.RS 2 +.nf +npm list [[@/] \.\.\.] +npm ls [[@/] \.\.\.] +npm la [[@/] \.\.\.] +npm ll [[@/] \.\.\.] +.fi +.RE +.SH DESCRIPTION +.P +This command will print to stdout all the versions of packages that are +installed, as well as their dependencies, in a tree\-structure\. +.P +Positional arguments are \fBname@version\-range\fP identifiers, which will +limit the results to only the paths to the packages named\. Note that +nested packages will \fIalso\fR show the paths to the specified packages\. +For example, running \fBnpm ls promzard\fP in npm's source tree will show: +.P +.RS 2 +.nf +npm@2.15.11 /path/to/npm +└─┬ init\-package\-json@0\.0\.4 + └── promzard@0\.1\.5 +.fi +.RE +.P +It will print out extraneous, missing, and invalid packages\. +.P +If a project specifies git urls for dependencies these are shown +in parentheses after the name@version to make it easier for users to +recognize potential forks of a project\. +.P +When run as \fBll\fP or \fBla\fP, it shows extended information by default\. +.SH CONFIGURATION +.SS json +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: Boolean + +.RE +.P +Show information in JSON format\. +.SS long +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: Boolean + +.RE +.P +Show extended information\. +.SS parseable +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: Boolean + +.RE +.P +Show parseable output instead of tree view\. +.SS global +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: Boolean + +.RE +.P +List packages in the global install prefix instead of in the current +project\. +.SS depth +.RS 0 +.IP \(bu 2 +Type: Int + +.RE +.P +Max display depth of the dependency tree\. +.SS prod / production +.RS 0 +.IP \(bu 2 +Type: Boolean +.IP \(bu 2 +Default: false + +.RE +.P +Display only the dependency tree for packages in \fBdependencies\fP\|\. +.SS dev +.RS 0 +.IP \(bu 2 +Type: Boolean +.IP \(bu 2 +Default: false + +.RE +.P +Display only the dependency tree for packages in \fBdevDependencies\fP\|\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help config +.IP \(bu 2 +npm help 7 config +.IP \(bu 2 +npm help 5 npmrc +.IP \(bu 2 +npm help 5 folders +.IP \(bu 2 +npm help install +.IP \(bu 2 +npm help link +.IP \(bu 2 +npm help prune +.IP \(bu 2 +npm help outdated +.IP \(bu 2 +npm help update + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-outdated.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-outdated.1 new file mode 100644 index 00000000..49921448 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-outdated.1 @@ -0,0 +1,151 @@ +.TH "NPM\-OUTDATED" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-outdated\fR \- Check for outdated packages +.SH SYNOPSIS +.P +.RS 2 +.nf +npm outdated [ [ \.\.\.]] +.fi +.RE +.SH DESCRIPTION +.P +This command will check the registry to see if any (or, specific) installed +packages are currently outdated\. +.P +In the output: +.RS 0 +.IP \(bu 2 +\fBwanted\fP is the maximum version of the package that satisfies the semver +range specified in \fBpackage\.json\fP\|\. If there's no available semver range (i\.e\. +you're running \fBnpm outdated \-\-global\fP, or the package isn't included in +\fBpackage\.json\fP), then \fBwanted\fP shows the currently\-installed version\. +.IP \(bu 2 +\fBlatest\fP is the version of the package tagged as latest in the registry\. +Running \fBnpm publish\fP with no special configuration will publish the package +with a dist\-tag of \fBlatest\fP\|\. This may or may not be the maximum version of +the package, or the most\-recently published version of the package, depending +on how the package's developer manages the latest npm help dist\-tag\. +.IP \(bu 2 +\fBlocation\fP is where in the dependency tree the package is located\. Note that +\fBnpm outdated\fP defaults to a depth of 0, so unless you override that, you'll +always be seeing only top\-level dependencies that are outdated\. +.IP \(bu 2 +\fBpackage type\fP (when using \fB\-\-long\fP / \fB\-l\fP) tells you whether this package is +a \fBdependency\fP or a \fBdevDependency\fP\|\. Packages not included in \fBpackage\.json\fP +are always marked \fBdependencies\fP\|\. + +.RE +.SS An example +.P +.RS 2 +.nf +$ npm outdated +Package Current Wanted Latest Location +glob 5\.0\.15 5\.0\.15 6\.0\.1 test\-outdated\-output +nothingness 0\.0\.3 git git test\-outdated\-output +npm 3\.5\.1 3\.5\.2 3\.5\.1 test\-outdated\-output +local\-dev 0\.0\.3 linked linked test\-outdated\-output +once 1\.3\.2 1\.3\.3 1\.3\.3 test\-outdated\-output +.fi +.RE +.P +With these \fBdependencies\fP: +.P +.RS 2 +.nf +{ + "glob": "^5\.0\.15", + "nothingness": "github:othiym23/nothingness#master", + "npm": "^3\.5\.1", + "once": "^1\.3\.1" +} +.fi +.RE +.P +A few things to note: +.RS 0 +.IP \(bu 2 +\fBglob\fP requires \fB^5\fP, which prevents npm from installing \fBglob@6\fP, which is +outside the semver range\. +.IP \(bu 2 +Git dependencies will always be reinstalled, because of how they're specified\. +The installed committish might satisfy the dependency specifier (if it's +something immutable, like a commit SHA), or it might not, so \fBnpm outdated\fP and +\fBnpm update\fP have to fetch Git repos to check\. This is why currently doing a +reinstall of a Git dependency always forces a new clone and install\. +.IP \(bu 2 +\fBnpm@3\.5\.2\fP is marked as "wanted", but "latest" is \fBnpm@3\.5\.1\fP because npm +uses dist\-tags to manage its \fBlatest\fP and \fBnext\fP release channels\. \fBnpm update\fP +will install the \fInewest\fR version, but \fBnpm install npm\fP (with no semver range) +will install whatever's tagged as \fBlatest\fP\|\. +.IP \(bu 2 +\fBonce\fP is just plain out of date\. Reinstalling \fBnode_modules\fP from scratch or +running \fBnpm update\fP will bring it up to spec\. + +.RE +.SH CONFIGURATION +.SS json +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: Boolean + +.RE +.P +Show information in JSON format\. +.SS long +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: Boolean + +.RE +.P +Show extended information\. +.SS parseable +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: Boolean + +.RE +.P +Show parseable output instead of tree view\. +.SS global +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: Boolean + +.RE +.P +Check packages in the global install prefix instead of in the current +project\. +.SS depth +.RS 0 +.IP \(bu 2 +Default: 0 +.IP \(bu 2 +Type: Int + +.RE +.P +Max depth for checking dependency tree\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help update +.IP \(bu 2 +npm help dist\-tag +.IP \(bu 2 +npm help 7 registry +.IP \(bu 2 +npm help 5 folders + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-owner.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-owner.1 new file mode 100644 index 00000000..8e6189ce --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-owner.1 @@ -0,0 +1,49 @@ +.TH "NPM\-OWNER" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-owner\fR \- Manage package owners +.SH SYNOPSIS +.P +.RS 2 +.nf +npm owner ls +npm owner add +npm owner rm + +aliases: author +.fi +.RE +.SH DESCRIPTION +.P +Manage ownership of published packages\. +.RS 0 +.IP \(bu 2 +ls: +List all the users who have access to modify a package and push new versions\. +Handy when you need to know who to bug for help\. +.IP \(bu 2 +add: +Add a new user as a maintainer of a package\. This user is enabled to modify +metadata, publish new versions, and add other owners\. +.IP \(bu 2 +rm: +Remove a user from the package owner list\. This immediately revokes their +privileges\. + +.RE +.P +Note that there is only one level of access\. Either you can modify a package, +or you can't\. Future versions may contain more fine\-grained access levels, but +that is not implemented at this time\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help publish +.IP \(bu 2 +npm help 7 registry +.IP \(bu 2 +npm help adduser +.IP \(bu 2 +npm help 7 disputes + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-pack.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-pack.1 new file mode 100644 index 00000000..3325efa2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-pack.1 @@ -0,0 +1,37 @@ +.TH "NPM\-PACK" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-pack\fR \- Create a tarball from a package +.SH SYNOPSIS +.P +.RS 2 +.nf +npm pack [ [ \.\.\.]] +.fi +.RE +.SH DESCRIPTION +.P +For anything that's installable (that is, a package folder, tarball, +tarball url, name@tag, name@version, or name), this command will fetch +it to the cache, and then copy the tarball to the current working +directory as \fB\-\.tgz\fP, and then write the filenames out to +stdout\. +.P +If the same package is specified multiple times, then the file will be +overwritten the second time\. +.P +If no arguments are supplied, then npm packs the current package folder\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help cache +.IP \(bu 2 +npm help publish +.IP \(bu 2 +npm help config +.IP \(bu 2 +npm help 7 config +.IP \(bu 2 +npm help 5 npmrc + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-ping.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-ping.1 new file mode 100644 index 00000000..8681cd81 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-ping.1 @@ -0,0 +1,23 @@ +.TH "NPM\-PING" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-ping\fR \- Ping npm registry +.SH SYNOPSIS +.P +.RS 2 +.nf +npm ping [\-\-registry ] +.fi +.RE +.SH DESCRIPTION +.P +Ping the configured or given npm registry and verify authentication\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help config +.IP \(bu 2 +npm help 7 config +.IP \(bu 2 +npm help 5 npmrc + +.RE diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-prefix.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-prefix.1 new file mode 100644 index 00000000..c8c4fda0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-prefix.1 @@ -0,0 +1,34 @@ +.TH "NPM\-PREFIX" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-prefix\fR \- Display prefix +.SH SYNOPSIS +.P +.RS 2 +.nf +npm prefix [\-g] +.fi +.RE +.SH DESCRIPTION +.P +Print the local prefix to standard out\. This is the closest parent directory +to contain a package\.json file unless \fB\-g\fP is also specified\. +.P +If \fB\-g\fP is specified, this will be the value of the global prefix\. See +npm help 7 \fBnpm\-config\fP for more detail\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help root +.IP \(bu 2 +npm help bin +.IP \(bu 2 +npm help 5 folders +.IP \(bu 2 +npm help config +.IP \(bu 2 +npm help 7 config +.IP \(bu 2 +npm help 5 npmrc + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-prune.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-prune.1 new file mode 100644 index 00000000..db1e47af --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-prune.1 @@ -0,0 +1,35 @@ +.TH "NPM\-PRUNE" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-prune\fR \- Remove extraneous packages +.SH SYNOPSIS +.P +.RS 2 +.nf +npm prune [ [ [ [\-\-tag ] [\-\-access ] +npm publish [\-\-tag ] [\-\-access ] +.fi +.RE +.SH DESCRIPTION +.P +Publishes a package to the registry so that it can be installed by name\. All +files in the package directory are included if no local \fB\|\.gitignore\fP or +\fB\|\.npmignore\fP file is present\. See npm help 7 \fBnpm\-developers\fP for full details on +what's included in the published package, as well as details on how the package +is built\. +.P +By default npm will publish to the public registry\. This can be overridden by +specifying a different default registry or using a npm help 7 \fBnpm\-scope\fP in the name +(see npm help 5 \fBpackage\.json\fP)\. +.RS 0 +.IP \(bu 2 +\fB\fP: +A folder containing a package\.json file +.IP \(bu 2 +\fB\fP: +A url or file path to a gzipped tar archive containing a single folder +with a package\.json file inside\. +.IP \(bu 2 +\fB[\-\-tag ]\fP +Registers the published package with the given tag, such that \fBnpm install +@\fP will install this version\. By default, \fBnpm publish\fP updates +and \fBnpm install\fP installs the \fBlatest\fP tag\. See npm help \fBnpm\-dist\-tag\fP for +details about tags\. +.IP \(bu 2 +\fB[\-\-access ]\fP +Tells the registry whether this package should be published as public or +restricted\. Only applies to scoped packages, which default to \fBrestricted\fP\|\. +If you don't have a paid account, you must publish with \fB\-\-access public\fP +to publish scoped packages\. + +.RE +.P +Fails if the package name and version combination already exists in +the specified registry\. +.P +Once a package is published with a given name and version, that +specific name and version combination can never be used again, even if +it is removed with npm help unpublish\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help 7 registry +.IP \(bu 2 +npm help 7 scope +.IP \(bu 2 +npm help adduser +.IP \(bu 2 +npm help owner +.IP \(bu 2 +npm help deprecate +.IP \(bu 2 +npm help tag + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-rebuild.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-rebuild.1 new file mode 100644 index 00000000..cde8faeb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-rebuild.1 @@ -0,0 +1,31 @@ +.TH "NPM\-REBUILD" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-rebuild\fR \- Rebuild a package +.SH SYNOPSIS +.P +.RS 2 +.nf +npm rebuild [ [ \.\.\.]] +npm rb [ [ \.\.\.]] +.fi +.RE +.RS 0 +.IP \(bu 2 +\fB\fP: +The package to rebuild + +.RE +.SH DESCRIPTION +.P +This command runs the \fBnpm build\fP command on the matched folders\. This is useful +when you install a new version of node, and must recompile all your C++ addons with +the new binary\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help build +.IP \(bu 2 +npm help install + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-repo.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-repo.1 new file mode 100644 index 00000000..fa01553e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-repo.1 @@ -0,0 +1,37 @@ +.TH "NPM\-REPO" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-repo\fR \- Open package repository page in the browser +.SH SYNOPSIS +.P +.RS 2 +.nf +npm repo +npm repo (with no args in a package dir) +.fi +.RE +.SH DESCRIPTION +.P +This command tries to guess at the likely location of a package's +repository URL, and then tries to open it using the \fB\-\-browser\fP +config param\. If no package name is provided, it will search for +a \fBpackage\.json\fP in the current folder and use the \fBname\fP property\. +.SH CONFIGURATION +.SS browser +.RS 0 +.IP \(bu 2 +Default: OS X: \fB"open"\fP, Windows: \fB"start"\fP, Others: \fB"xdg\-open"\fP +.IP \(bu 2 +Type: String + +.RE +.P +The browser that is called by the \fBnpm repo\fP command to open websites\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help docs +.IP \(bu 2 +npm help config + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-restart.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-restart.1 new file mode 100644 index 00000000..88ec6716 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-restart.1 @@ -0,0 +1,61 @@ +.TH "NPM\-RESTART" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-restart\fR \- Restart a package +.SH SYNOPSIS +.P +.RS 2 +.nf +npm restart [\-\- ] +.fi +.RE +.SH DESCRIPTION +.P +This restarts a package\. +.P +This runs a package's "stop", "restart", and "start" scripts, and associated +pre\- and post\- scripts, in the order given below: +.RS 0 +.IP 1. 3 +prerestart +.IP 2. 3 +prestop +.IP 3. 3 +stop +.IP 4. 3 +poststop +.IP 5. 3 +restart +.IP 6. 3 +prestart +.IP 7. 3 +start +.IP 8. 3 +poststart +.IP 9. 3 +postrestart + +.RE +.SH NOTE +.P +Note that the "restart" script is run \fBin addition to\fR the "stop" +and "start" scripts, not instead of them\. +.P +This is the behavior as of \fBnpm\fP major version 2\. A change in this +behavior will be accompanied by an increase in major version number +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help run\-script +.IP \(bu 2 +npm help 7 scripts +.IP \(bu 2 +npm help test +.IP \(bu 2 +npm help start +.IP \(bu 2 +npm help stop +.IP \(bu 2 +npm apihelp restart + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-rm.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-rm.1 new file mode 100644 index 00000000..83e3d75c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-rm.1 @@ -0,0 +1,34 @@ +.TH "NPM\-RM" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-rm\fR \- Remove a package +.SH SYNOPSIS +.P +.RS 2 +.nf +npm rm +npm r +npm uninstall +npm un +.fi +.RE +.SH DESCRIPTION +.P +This uninstalls a package, completely removing everything npm installed +on its behalf\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help prune +.IP \(bu 2 +npm help install +.IP \(bu 2 +npm help 5 folders +.IP \(bu 2 +npm help config +.IP \(bu 2 +npm help 7 config +.IP \(bu 2 +npm help 5 npmrc + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-root.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-root.1 new file mode 100644 index 00000000..03095fd2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-root.1 @@ -0,0 +1,30 @@ +.TH "NPM\-ROOT" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-root\fR \- Display npm root +.SH SYNOPSIS +.P +.RS 2 +.nf +npm root +.fi +.RE +.SH DESCRIPTION +.P +Print the effective \fBnode_modules\fP folder to standard out\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help prefix +.IP \(bu 2 +npm help bin +.IP \(bu 2 +npm help 5 folders +.IP \(bu 2 +npm help config +.IP \(bu 2 +npm help 7 config +.IP \(bu 2 +npm help 5 npmrc + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-run-script.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-run-script.1 new file mode 100644 index 00000000..9971cb2b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-run-script.1 @@ -0,0 +1,66 @@ +.TH "NPM\-RUN\-SCRIPT" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-run-script\fR \- Run arbitrary package scripts +.SH SYNOPSIS +.P +.RS 2 +.nf +npm run\-script [command] [\-\- ] +npm run [command] [\-\- ] +.fi +.RE +.SH DESCRIPTION +.P +This runs an arbitrary command from a package's \fB"scripts"\fP object\. If no +\fB"command"\fP is provided, it will list the available scripts\. \fBrun[\-script]\fP is +used by the test, start, restart, and stop commands, but can be called +directly, as well\. When the scripts in the package are printed out, they're +separated into lifecycle (test, start, restart) and directly\-run scripts\. +.P +As of \fBnpm@2\.0\.0\fP \fIhttp://blog\.npmjs\.org/post/98131109725/npm\-2\-0\-0\fR, you can +use custom arguments when executing scripts\. The special option \fB\-\-\fP is used by +getopt \fIhttp://goo\.gl/KxMmtG\fR to delimit the end of the options\. npm will pass +all the arguments after the \fB\-\-\fP directly to your script: +.P +.RS 2 +.nf +npm run test \-\- \-\-grep="pattern" +.fi +.RE +.P +The arguments will only be passed to the script specified after \fBnpm run\fP +and not to any pre or post script\. +.P +The \fBenv\fP script is a special built\-in command that can be used to list +environment variables that will be available to the script at runtime\. If an +"env" command is defined in your package it will take precedence over the +built\-in\. +.P +In addition to the shell's pre\-existing \fBPATH\fP, \fBnpm run\fP adds +\fBnode_modules/\.bin\fP to the \fBPATH\fP provided to scripts\. Any binaries provided by +locally\-installed dependencies can be used without the \fBnode_modules/\.bin\fP +prefix\. For example, if there is a \fBdevDependency\fP on \fBtap\fP in your package, +you should write: +.P +.RS 2 +.nf +"scripts": {"test": "tap test/\\*\.js"} +.fi +.RE +.P +instead of \fB"scripts": {"test": "node_modules/\.bin/tap test/\\*\.js"}\fP to run your tests\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help 7 scripts +.IP \(bu 2 +npm help test +.IP \(bu 2 +npm help start +.IP \(bu 2 +npm help restart +.IP \(bu 2 +npm help stop + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-search.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-search.1 new file mode 100644 index 00000000..a604aed2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-search.1 @@ -0,0 +1,60 @@ +.TH "NPM\-SEARCH" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-search\fR \- Search for packages +.SH SYNOPSIS +.P +.RS 2 +.nf +npm search [\-l|\-\-long] [search terms \.\.\.] + +aliases: s, se, find +.fi +.RE +.SH DESCRIPTION +.P +Search the registry for packages matching the search terms\. +.P +If a term starts with \fB/\fP, then it's interpreted as a regular expression\. +A trailing \fB/\fP will be ignored in this case\. (Note that many regular +expression characters must be escaped or quoted in most shells\.) +.SH CONFIGURATION +.SS long +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: Boolean + +.RE +.P +Display full package descriptions and other long text across multiple +lines\. When disabled (default) search results are truncated to fit +neatly on a single line\. Modules with extremely long names will +fall on multiple lines\. +.SS registry +.RS 0 +.IP \(bu 2 +Default: https://registry\.npmjs\.org/ +.IP \(bu 2 +Type : url + +.RE +.P +Search the specified registry for modules\. If you have configured npm to point to a different default registry, +such as your internal private module repository, \fBnpm search\fP will default to that registry when searching\. +Pass a different registry url such as the default above in order to override this setting\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help 7 registry +.IP \(bu 2 +npm help config +.IP \(bu 2 +npm help 7 config +.IP \(bu 2 +npm help 5 npmrc +.IP \(bu 2 +npm help view + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-shrinkwrap.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-shrinkwrap.1 new file mode 100644 index 00000000..7a97e1d1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-shrinkwrap.1 @@ -0,0 +1,222 @@ +.TH "NPM\-SHRINKWRAP" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-shrinkwrap\fR \- Lock down dependency versions +.SH SYNOPSIS +.P +.RS 2 +.nf +npm shrinkwrap +.fi +.RE +.SH DESCRIPTION +.P +This command locks down the versions of a package's dependencies so +that you can control exactly which versions of each dependency will be +used when your package is installed\. The \fBpackage\.json\fP file is still +required if you want to use \fBnpm install\fP\|\. +.P +By default, \fBnpm install\fP recursively installs the target's +dependencies (as specified in \fBpackage\.json\fP), choosing the latest +available version that satisfies the dependency's semver pattern\. In +some situations, particularly when shipping software where each change +is tightly managed, it's desirable to fully specify each version of +each dependency recursively so that subsequent builds and deploys do +not inadvertently pick up newer versions of a dependency that satisfy +the semver pattern\. Specifying specific semver patterns in each +dependency's \fBpackage\.json\fP would facilitate this, but that's not always +possible or desirable, as when another author owns the npm package\. +It's also possible to check dependencies directly into source control, +but that may be undesirable for other reasons\. +.P +As an example, consider package A: +.P +.RS 2 +.nf +{ + "name": "A", + "version": "0\.1\.0", + "dependencies": { + "B": "<0\.1\.0" + } +} +.fi +.RE +.P +package B: +.P +.RS 2 +.nf +{ + "name": "B", + "version": "0\.0\.1", + "dependencies": { + "C": "<0\.1\.0" + } +} +.fi +.RE +.P +and package C: +.P +.RS 2 +.nf +{ + "name": "C", + "version": "0\.0\.1" +} +.fi +.RE +.P +If these are the only versions of A, B, and C available in the +registry, then a normal \fBnpm install A\fP will install: +.P +.RS 2 +.nf +A@0\.1\.0 +`\-\- B@0\.0\.1 + `\-\- C@0\.0\.1 +.fi +.RE +.P +However, if B@0\.0\.2 is published, then a fresh \fBnpm install A\fP will +install: +.P +.RS 2 +.nf +A@0\.1\.0 +`\-\- B@0\.0\.2 + `\-\- C@0\.0\.1 +.fi +.RE +.P +assuming the new version did not modify B's dependencies\. Of course, +the new version of B could include a new version of C and any number +of new dependencies\. If such changes are undesirable, the author of A +could specify a dependency on B@0\.0\.1\. However, if A's author and B's +author are not the same person, there's no way for A's author to say +that he or she does not want to pull in newly published versions of C +when B hasn't changed at all\. +.P +In this case, A's author can run +.P +.RS 2 +.nf +npm shrinkwrap +.fi +.RE +.P +This generates \fBnpm\-shrinkwrap\.json\fP, which will look something like this: +.P +.RS 2 +.nf +{ + "name": "A", + "version": "0\.1\.0", + "dependencies": { + "B": { + "version": "0\.0\.1", + "from": "B@^0\.0\.1", + "resolved": "https://registry\.npmjs\.org/B/\-/B\-0\.0\.1\.tgz", + "dependencies": { + "C": { + "version": "0\.0\.1", + "from": "org/C#v0\.0\.1", + "resolved": "git://github\.com/org/C\.git#5c380ae319fc4efe9e7f2d9c78b0faa588fd99b4" + } + } + } + } +} +.fi +.RE +.P +The shrinkwrap command has locked down the dependencies based on +what's currently installed in node_modules\. When \fBnpm install\fP +installs a package with an \fBnpm\-shrinkwrap\.json\fP in the package +root, the shrinkwrap file (rather than \fBpackage\.json\fP files) completely +drives the installation of that package and all of its dependencies +(recursively)\. So now the author publishes A@0\.1\.0, and subsequent +installs of this package will use B@0\.0\.1 and C@0\.0\.1, regardless the +dependencies and versions listed in A's, B's, and C's \fBpackage\.json\fP +files\. +.SS Using shrinkwrapped packages +.P +Using a shrinkwrapped package is no different than using any other +package: you can \fBnpm install\fP it by hand, or add a dependency to your +\fBpackage\.json\fP file and \fBnpm install\fP it\. +.SS Building shrinkwrapped packages +.P +To shrinkwrap an existing package: +.RS 0 +.IP 1. 3 +Run \fBnpm install\fP in the package root to install the current +versions of all dependencies\. +.IP 2. 3 +Validate that the package works as expected with these versions\. +.IP 3. 3 +Run \fBnpm shrinkwrap\fP, add \fBnpm\-shrinkwrap\.json\fP to git, and publish +your package\. + +.RE +.P +To add or update a dependency in a shrinkwrapped package: +.RS 0 +.IP 1. 3 +Run \fBnpm install\fP in the package root to install the current +versions of all dependencies\. +.IP 2. 3 +Add or update dependencies\. \fBnpm install\fP each new or updated +package individually and then update \fBpackage\.json\fP\|\. Note that they +must be explicitly named in order to be installed: running \fBnpm +install\fP with no arguments will merely reproduce the existing +shrinkwrap\. +.IP 3. 3 +Validate that the package works as expected with the new +dependencies\. +.IP 4. 3 +Run \fBnpm shrinkwrap\fP, commit the new \fBnpm\-shrinkwrap\.json\fP, and +publish your package\. + +.RE +.P +You can use npm help outdated to view dependencies with newer versions +available\. +.SS Other Notes +.P +A shrinkwrap file must be consistent with the package's \fBpackage\.json\fP +file\. \fBnpm shrinkwrap\fP will fail if required dependencies are not +already installed, since that would result in a shrinkwrap that +wouldn't actually work\. Similarly, the command will fail if there are +extraneous packages (not referenced by \fBpackage\.json\fP), since that would +indicate that \fBpackage\.json\fP is not correct\. +.P +Since \fBnpm shrinkwrap\fP is intended to lock down your dependencies for +production use, \fBdevDependencies\fP will not be included unless you +explicitly set the \fB\-\-dev\fP flag when you run \fBnpm shrinkwrap\fP\|\. If +installed \fBdevDependencies\fP are excluded, then npm will print a +warning\. If you want them to be installed with your module by +default, please consider adding them to \fBdependencies\fP instead\. +.P +If shrinkwrapped package A depends on shrinkwrapped package B, B's +shrinkwrap will not be used as part of the installation of A\. However, +because A's shrinkwrap is constructed from a valid installation of B +and recursively specifies all dependencies, the contents of B's +shrinkwrap will implicitly be included in A's shrinkwrap\. +.SS Caveats +.P +If you wish to lock down the specific bytes included in a package, for +example to have 100% confidence in being able to reproduce a +deployment or build, then you ought to check your dependencies into +source control, or pursue some other mechanism that can verify +contents rather than versions\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help install +.IP \(bu 2 +npm help 5 package\.json +.IP \(bu 2 +npm help ls + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-star.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-star.1 new file mode 100644 index 00000000..bbe0a0b5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-star.1 @@ -0,0 +1,30 @@ +.TH "NPM\-STAR" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-star\fR \- Mark your favorite packages +.SH SYNOPSIS +.P +.RS 2 +.nf +npm star [, \.\.\.] +npm unstar [, \.\.\.] +.fi +.RE +.SH DESCRIPTION +.P +"Starring" a package means that you have some interest in it\. It's +a vaguely positive way to show that you care\. +.P +"Unstarring" is the same thing, but in reverse\. +.P +It's a boolean thing\. Starring repeatedly has no additional effect\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help view +.IP \(bu 2 +npm help whoami +.IP \(bu 2 +npm help adduser + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-stars.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-stars.1 new file mode 100644 index 00000000..e833f946 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-stars.1 @@ -0,0 +1,31 @@ +.TH "NPM\-STARS" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-stars\fR \- View packages marked as favorites +.SH SYNOPSIS +.P +.RS 2 +.nf +npm stars +npm stars [username] +.fi +.RE +.SH DESCRIPTION +.P +If you have starred a lot of neat things and want to find them again +quickly this command lets you do just that\. +.P +You may also want to see your friend's favorite packages, in this case +you will most certainly enjoy this command\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help star +.IP \(bu 2 +npm help view +.IP \(bu 2 +npm help whoami +.IP \(bu 2 +npm help adduser + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-start.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-start.1 new file mode 100644 index 00000000..fbfc1f30 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-start.1 @@ -0,0 +1,34 @@ +.TH "NPM\-START" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-start\fR \- Start a package +.SH SYNOPSIS +.P +.RS 2 +.nf +npm start [\-\- ] +.fi +.RE +.SH DESCRIPTION +.P +This runs an arbitrary command specified in the package's \fB"start"\fP property of +its \fB"scripts"\fP object\. If no \fB"start"\fP property is specified on the +\fB"scripts"\fP object, it will run \fBnode server\.js\fP\|\. +.P +As of \fBnpm@2\.0\.0\fP \fIhttp://blog\.npmjs\.org/post/98131109725/npm\-2\-0\-0\fR, you can +use custom arguments when executing scripts\. Refer to npm help run\-script for +more details\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help run\-script +.IP \(bu 2 +npm help 7 scripts +.IP \(bu 2 +npm help test +.IP \(bu 2 +npm help restart +.IP \(bu 2 +npm help stop + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-stop.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-stop.1 new file mode 100644 index 00000000..671d037a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-stop.1 @@ -0,0 +1,28 @@ +.TH "NPM\-STOP" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-stop\fR \- Stop a package +.SH SYNOPSIS +.P +.RS 2 +.nf +npm stop [\-\- ] +.fi +.RE +.SH DESCRIPTION +.P +This runs a package's "stop" script, if one was provided\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help run\-script +.IP \(bu 2 +npm help 7 scripts +.IP \(bu 2 +npm help test +.IP \(bu 2 +npm help start +.IP \(bu 2 +npm help restart + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-tag.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-tag.1 new file mode 100644 index 00000000..024f981e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-tag.1 @@ -0,0 +1,79 @@ +.TH "NPM\-TAG" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-tag\fR \- Tag a published version +.SH SYNOPSIS +.P +.RS 2 +.nf +npm tag @ [] +.fi +.RE +.SH DESCRIPTION +.P +THIS COMMAND IS DEPRECATED\. See npm help dist\-tag for details\. +.P +Tags the specified version of the package with the specified tag, or the +\fB\-\-tag\fP config if not specified\. +.P +A tag can be used when installing packages as a reference to a version instead +of using a specific version number: +.P +.RS 2 +.nf +npm install @ +.fi +.RE +.P +When installing dependencies, a preferred tagged version may be specified: +.P +.RS 2 +.nf +npm install \-\-tag +.fi +.RE +.P +This also applies to \fBnpm dedupe\fP\|\. +.P +Publishing a package always sets the "latest" tag to the published version\. +.SH PURPOSE +.P +Tags can be used to provide an alias instead of version numbers\. For +example, \fBnpm\fP currently uses the tag "next" to identify the upcoming +version, and the tag "latest" to identify the current version\. +.P +A project might choose to have multiple streams of development, e\.g\., +"stable", "canary"\. +.SH CAVEATS +.P +Tags must share a namespace with version numbers, because they are +specified in the same slot: \fBnpm install @\fP vs \fBnpm +install @\fP\|\. +.P +Tags that can be interpreted as valid semver ranges will be +rejected\. For example, \fBv1\.4\fP cannot be used as a tag, because it is +interpreted by semver as \fB>=1\.4\.0 <1\.5\.0\fP\|\. See +https://github\.com/npm/npm/issues/6082\|\. +.P +The simplest way to avoid semver problems with tags is to use tags +that do not begin with a number or the letter \fBv\fP\|\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help publish +.IP \(bu 2 +npm help install +.IP \(bu 2 +npm help dedupe +.IP \(bu 2 +npm help 7 registry +.IP \(bu 2 +npm help config +.IP \(bu 2 +npm help 7 config +.IP \(bu 2 +npm help dist\-tag +.IP \(bu 2 +npm help 5 npmrc + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-team.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-team.1 new file mode 100644 index 00000000..dcf4e082 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-team.1 @@ -0,0 +1,63 @@ +.TH "NPM\-TEAM" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-team\fR \- Manage organization teams and team memberships +.SH SYNOPSIS +.P +.RS 2 +.nf +npm team create +npm team destroy + +npm team add +npm team rm + +npm team ls | + +npm team edit +.fi +.RE +.SH DESCRIPTION +.P +Used to manage teams in organizations, and change team memberships\. Does not +handle permissions for packages\. +.P +Teams must always be fully qualified with the organization/scope they belond to +when operating on them, separated by a colon (\fB:\fP)\. That is, if you have a +\fBdevelopers\fP team on a \fBfoo\fP organization, you must always refer to that team as +\fBfoo:developers\fP in these commands\. +.RS 0 +.IP \(bu 2 +create / destroy: +Create a new team, or destroy an existing one\. +.IP \(bu 2 +add / rm: +Add a user to an existing team, or remove a user from a team they belong to\. +.IP \(bu 2 +ls: +If performed on an organization name, will return a list of existing teams +under that organization\. If performed on a team, it will instead return a list +of all users belonging to that particular team\. + +.RE +.SH DETAILS +.P +\fBnpm team\fP always operates directly on the current registry, configurable from +the command line using \fB\-\-registry=\fP\|\. +.P +In order to create teams and manage team membership, you must be a \fIteam admin\fR +under the given organization\. Listing teams and team memberships may be done by +any member of the organizations\. +.P +Organization creation and management of team admins and \fIorganization\fR members +is done through the website, not the npm CLI\. +.P +To use teams to manage permissions on packages belonging to your organization, +use the \fBnpm access\fP command to grant or revoke the appropriate permissions\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help access +.IP \(bu 2 +npm help 7 registr + +.RE diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-test.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-test.1 new file mode 100644 index 00000000..27710752 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-test.1 @@ -0,0 +1,33 @@ +.TH "NPM\-TEST" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-test\fR \- Test a package +.SH SYNOPSIS +.P +.RS 2 +.nf + npm test [\-\- ] + + aliases: t, tst +.fi +.RE +.SH DESCRIPTION +.P +This runs a package's "test" script, if one was provided\. +.P +To run tests as a condition of installation, set the \fBnpat\fP config to +true\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help run\-script +.IP \(bu 2 +npm help 7 scripts +.IP \(bu 2 +npm help start +.IP \(bu 2 +npm help restart +.IP \(bu 2 +npm help stop + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-uninstall.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-uninstall.1 new file mode 100644 index 00000000..7ba45a5a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-uninstall.1 @@ -0,0 +1,68 @@ +.TH "NPM\-UNINSTALL" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-uninstall\fR \- Remove a package +.SH SYNOPSIS +.P +.RS 2 +.nf +npm uninstall [@/] [\-\-save|\-\-save\-dev|\-\-save\-optional] +npm rm (with any of the previous argument usage) +.fi +.RE +.SH DESCRIPTION +.P +This uninstalls a package, completely removing everything npm installed +on its behalf\. +.P +Example: +.P +.RS 2 +.nf +npm uninstall sax +.fi +.RE +.P +In global mode (ie, with \fB\-g\fP or \fB\-\-global\fP appended to the command), +it uninstalls the current package context as a global package\. +.P +\fBnpm uninstall\fP takes 3 exclusive, optional flags which save or update +the package version in your main package\.json: +.RS 0 +.IP \(bu 2 +\fB\-\-save\fP: Package will be removed from your \fBdependencies\fP\|\. +.IP \(bu 2 +\fB\-\-save\-dev\fP: Package will be removed from your \fBdevDependencies\fP\|\. +.IP \(bu 2 +\fB\-\-save\-optional\fP: Package will be removed from your \fBoptionalDependencies\fP\|\. + +.RE +.P +Scope is optional and follows the usual rules for npm help 7 \fBnpm\-scope\fP\|\. +.P +Examples: +.P +.RS 2 +.nf +npm uninstall sax \-\-save +npm uninstall @myorg/privatepackage \-\-save +npm uninstall node\-tap \-\-save\-dev +npm uninstall dtrace\-provider \-\-save\-optional +.fi +.RE +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help prune +.IP \(bu 2 +npm help install +.IP \(bu 2 +npm help 5 folders +.IP \(bu 2 +npm help config +.IP \(bu 2 +npm help 7 config +.IP \(bu 2 +npm help 5 npmrc + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-unpublish.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-unpublish.1 new file mode 100644 index 00000000..a63f3868 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-unpublish.1 @@ -0,0 +1,47 @@ +.TH "NPM\-UNPUBLISH" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-unpublish\fR \- Remove a package from the registry +.SH SYNOPSIS +.P +.RS 2 +.nf +npm unpublish [@/][@] +.fi +.RE +.SH WARNING +.P +\fBIt is generally considered bad behavior to remove versions of a library +that others are depending on!\fR +.P +Consider using the \fBdeprecate\fP command +instead, if your intent is to encourage users to upgrade\. +.P +There is plenty of room on the registry\. +.SH DESCRIPTION +.P +This removes a package version from the registry, deleting its +entry and removing the tarball\. +.P +If no version is specified, or if all versions are removed then +the root package entry is removed from the registry entirely\. +.P +Even if a package version is unpublished, that specific name and +version combination can never be reused\. In order to publish the +package again, a new version number must be used\. +.P +The scope is optional and follows the usual rules for npm help 7 \fBnpm\-scope\fP\|\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help deprecate +.IP \(bu 2 +npm help publish +.IP \(bu 2 +npm help 7 registry +.IP \(bu 2 +npm help adduser +.IP \(bu 2 +npm help owner + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-update.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-update.1 new file mode 100644 index 00000000..a6f65e79 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-update.1 @@ -0,0 +1,166 @@ +.TH "NPM\-UPDATE" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-update\fR \- Update a package +.SH SYNOPSIS +.P +.RS 2 +.nf +npm update [\-g] [ [ \.\.\.]] + +aliases: up, upgrade +.fi +.RE +.SH DESCRIPTION +.P +This command will update all the packages listed to the latest version +(specified by the \fBtag\fP config), respecting semver\. +.P +It will also install missing packages\. As with all commands that install +packages, the \fB\-\-dev\fP flag will cause \fBdevDependencies\fP to be processed +as well\. +.P +If the \fB\-g\fP flag is specified, this command will update globally installed +packages\. +.P +If no package name is specified, all packages in the specified location (global +or local) will be updated\. +.P +As of \fBnpm@2\.6\.1\fP, the \fBnpm update\fP will only inspect top\-level packages\. +Prior versions of \fBnpm\fP would also recursively inspect all dependencies\. +To get the old behavior, use \fBnpm \-\-depth 9999 update\fP\|\. +.SH EXAMPLES +.P +IMPORTANT VERSION NOTE: these examples assume \fBnpm@2\.6\.1\fP or later\. For +older versions of \fBnpm\fP, you must specify \fB\-\-depth 0\fP to get the behavior +described below\. +.P +For the examples below, assume that the current package is \fBapp\fP and it depends +on dependencies, \fBdep1\fP (\fBdep2\fP, \.\. etc\.)\. The published versions of \fBdep1\fP are: +.P +.RS 2 +.nf +{ + "dist\-tags": { "latest": "1\.2\.2" }, + "versions": [ + "1\.2\.2", + "1\.2\.1", + "1\.2\.0", + "1\.1\.2", + "1\.1\.1", + "1\.0\.0", + "0\.4\.1", + "0\.4\.0", + "0\.2\.0" + ] +} +.fi +.RE +.SS Caret Dependencies +.P +If \fBapp\fP\|'s \fBpackage\.json\fP contains: +.P +.RS 2 +.nf +"dependencies": { + "dep1": "^1\.1\.1" +} +.fi +.RE +.P +Then \fBnpm update\fP will install \fBdep1@1\.2\.2\fP, because \fB1\.2\.2\fP is \fBlatest\fP and +\fB1\.2\.2\fP satisfies \fB^1\.1\.1\fP\|\. +.SS Tilde Dependencies +.P +However, if \fBapp\fP\|'s \fBpackage\.json\fP contains: +.P +.RS 2 +.nf +"dependencies": { + "dep1": "~1\.1\.1" +} +.fi +.RE +.P +In this case, running \fBnpm update\fP will install \fBdep1@1\.1\.2\fP\|\. Even though the \fBlatest\fP +tag points to \fB1\.2\.2\fP, this version does not satisfy \fB~1\.1\.1\fP, which is equivalent +to \fB>=1\.1\.1 <1\.2\.0\fP\|\. So the highest\-sorting version that satisfies \fB~1\.1\.1\fP is used, +which is \fB1\.1\.2\fP\|\. +.SS Caret Dependencies below 1\.0\.0 +.P +Suppose \fBapp\fP has a caret dependency on a version below \fB1\.0\.0\fP, for example: +.P +.RS 2 +.nf +"dependencies": { + "dep1": "^0\.2\.0" +} +.fi +.RE +.P +\fBnpm update\fP will install \fBdep1@0\.2\.0\fP, because there are no other +versions which satisfy \fB^0\.2\.0\fP\|\. +.P +If the dependence were on \fB^0\.4\.0\fP: +.P +.RS 2 +.nf +"dependencies": { + "dep1": "^0\.4\.0" +} +.fi +.RE +.P +Then \fBnpm update\fP will install \fBdep1@0\.4\.1\fP, because that is the highest\-sorting +version that satisfies \fB^0\.4\.0\fP (\fB>= 0\.4\.0 <0\.5\.0\fP) +.SS Recording Updates with \fB\-\-save\fP +.P +When you want to update a package and save the new version as +the minimum required dependency in \fBpackage\.json\fP, you can use +\fBnpm update \-\-save\fP\|\. For example if \fBpackage\.json\fP contains +.P +.RS 2 +.nf +"dependencies": { + "dep1": "^1\.1\.1" +} +.fi +.RE +.P +Then \fBnpm update \-\-save\fP will install \fBdep1@1\.2\.2\fP (i\.e\., \fBlatest\fP), +and \fBpackage\.json\fP will be modified: +.P +.RS 2 +.nf +"dependencies": { + "dep1": "^1\.2\.2" +} +.fi +.RE +.P +Note that \fBnpm\fP will only write an updated version to \fBpackage\.json\fP +if it installs a new package\. +.SS Updating Globally\-Installed Packages +.P +\fBnpm update \-g\fP will apply the \fBupdate\fP action to each globally installed +package that is \fBoutdated\fP \-\- that is, has a version that is different from +\fBlatest\fP\|\. +.P +NOTE: If a package has been upgraded to a version newer than \fBlatest\fP, it will +be \fIdowngraded\fR\|\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help install +.IP \(bu 2 +npm help outdated +.IP \(bu 2 +npm help shrinkwrap +.IP \(bu 2 +npm help 7 registry +.IP \(bu 2 +npm help 5 folders +.IP \(bu 2 +npm help ls + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-version.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-version.1 new file mode 100644 index 00000000..6fca5685 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-version.1 @@ -0,0 +1,124 @@ +.TH "NPM\-VERSION" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-version\fR \- Bump a package version +.SH SYNOPSIS +.P +.RS 2 +.nf +npm version [ | major | minor | patch | premajor | preminor | prepatch | prerelease] +.fi +.RE +.SH DESCRIPTION +.P +Run this in a package directory to bump the version and write the new +data back to \fBpackage\.json\fP and, if present, \fBnpm\-shrinkwrap\.json\fP\|\. +.P +The \fBnewversion\fP argument should be a valid semver string, \fIor\fR a +valid second argument to semver\.inc (one of \fBpatch\fP, \fBminor\fP, \fBmajor\fP, +\fBprepatch\fP, \fBpreminor\fP, \fBpremajor\fP, \fBprerelease\fP)\. In the second case, +the existing version will be incremented by 1 in the specified field\. +.P +If run in a git repo, it will also create a version commit and tag\. +This behavior is controlled by \fBgit\-tag\-version\fP (see below), and can +be disabled on the command line by running \fBnpm \-\-no\-git\-tag\-version version\fP\|\. +It will fail if the working directory is not clean, unless the \fB\-\-force\fP +flag is set\. +.P +If supplied with \fB\-\-message\fP (shorthand: \fB\-m\fP) config option, npm will +use it as a commit message when creating a version commit\. If the +\fBmessage\fP config contains \fB%s\fP then that will be replaced with the +resulting version number\. For example: +.P +.RS 2 +.nf +npm version patch \-m "Upgrade to %s for reasons" +.fi +.RE +.P +If the \fBsign\-git\-tag\fP config is set, then the tag will be signed using +the \fB\-s\fP flag to git\. Note that you must have a default GPG key set up +in your git config for this to work properly\. For example: +.P +.RS 2 +.nf +$ npm config set sign\-git\-tag true +$ npm version patch + +You need a passphrase to unlock the secret key for +user: "isaacs (http://blog\.izs\.me/) " +2048\-bit RSA key, ID 6C481CF6, created 2010\-08\-31 + +Enter passphrase: +.fi +.RE +.P +If \fBpreversion\fP, \fBversion\fP, or \fBpostversion\fP are in the \fBscripts\fP property of +the package\.json, they will be executed as part of running \fBnpm version\fP\|\. +.P +The exact order of execution is as follows: +.RS 0 +.IP 1. 3 +Check to make sure the git working directory is clean before we get started\. +Your scripts may add files to the commit in future steps\. +This step is skipped if the \fB\-\-force\fP flag is set\. +.IP 2. 3 +Run the \fBpreversion\fP script\. These scripts have access to the old \fBversion\fP in package\.json\. +A typical use would be running your full test suite before deploying\. +Any files you want added to the commit should be explicitly added using \fBgit add\fP\|\. +.IP 3. 3 +Bump \fBversion\fP in \fBpackage\.json\fP as requested (\fBpatch\fP, \fBminor\fP, \fBmajor\fP, etc)\. +.IP 4. 3 +Run the \fBversion\fP script\. These scripts have access to the new \fBversion\fP in package\.json +(so they can incorporate it into file headers in generated files for example)\. +Again, scripts should explicitly add generated files to the commit using \fBgit add\fP\|\. +.IP 5. 3 +Commit and tag\. +.IP 6. 3 +Run the \fBpostversion\fP script\. Use it to clean up the file system or automatically push +the commit and/or tag\. + +.RE +.P +Take the following example: +.P +.RS 2 +.nf +"scripts": { + "preversion": "npm test", + "version": "npm run build && git add \-A dist", + "postversion": "git push && git push \-\-tags && rm \-rf build/temp" +} +.fi +.RE +.P +This runs all your tests, and proceeds only if they pass\. Then runs your \fBbuild\fP script, and +adds everything in the \fBdist\fP directory to the commit\. After the commit, it pushes the new commit +and tag up to the server, and deletes the \fBbuild/temp\fP directory\. +.SH CONFIGURATION +.SS git\-tag\-version +.RS 0 +.IP \(bu 2 +Default: true +.IP \(bu 2 +Type: Boolean + +.RE +.P +Commit and tag the version change\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help init +.IP \(bu 2 +npm help run\-script +.IP \(bu 2 +npm help 7 scripts +.IP \(bu 2 +npm help 5 package\.json +.IP \(bu 2 +npm help 7 semver +.IP \(bu 2 +npm help 7 config + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-view.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-view.1 new file mode 100644 index 00000000..16ec3af7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-view.1 @@ -0,0 +1,145 @@ +.TH "NPM\-VIEW" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-view\fR \- View registry info +.SH SYNOPSIS +.P +.RS 2 +.nf +npm view [@/][@] [[\.]\.\.\.] +npm v [@/][@] [[\.]\.\.\.] +.fi +.RE +.SH DESCRIPTION +.P +This command shows data about a package and prints it to the stream +referenced by the \fBoutfd\fP config, which defaults to stdout\. +.P +To show the package registry entry for the \fBconnect\fP package, you can do +this: +.P +.RS 2 +.nf +npm view connect +.fi +.RE +.P +The default version is "latest" if unspecified\. +.P +Field names can be specified after the package descriptor\. +For example, to show the dependencies of the \fBronn\fP package at version +0\.3\.5, you could do the following: +.P +.RS 2 +.nf +npm view ronn@0\.3\.5 dependencies +.fi +.RE +.P +You can view child fields by separating them with a period\. +To view the git repository URL for the latest version of npm, you could +do this: +.P +.RS 2 +.nf +npm view npm repository\.url +.fi +.RE +.P +This makes it easy to view information about a dependency with a bit of +shell scripting\. For example, to view all the data about the version of +opts that ronn depends on, you can do this: +.P +.RS 2 +.nf +npm view opts@$(npm view ronn dependencies\.opts) +.fi +.RE +.P +For fields that are arrays, requesting a non\-numeric field will return +all of the values from the objects in the list\. For example, to get all +the contributor names for the "express" project, you can do this: +.P +.RS 2 +.nf +npm view express contributors\.email +.fi +.RE +.P +You may also use numeric indices in square braces to specifically select +an item in an array field\. To just get the email address of the first +contributor in the list, you can do this: +.P +.RS 2 +.nf +npm view express contributors[0]\.email +.fi +.RE +.P +Multiple fields may be specified, and will be printed one after another\. +For exampls, to get all the contributor names and email addresses, you +can do this: +.P +.RS 2 +.nf +npm view express contributors\.name contributors\.email +.fi +.RE +.P +"Person" fields are shown as a string if they would be shown as an +object\. So, for example, this will show the list of npm contributors in +the shortened string format\. (See npm help 5 \fBpackage\.json\fP for more on this\.) +.P +.RS 2 +.nf +npm view npm contributors +.fi +.RE +.P +If a version range is provided, then data will be printed for every +matching version of the package\. This will show which version of jsdom +was required by each matching version of yui3: +.P +.RS 2 +.nf +npm view yui3@'>0\.5\.4' dependencies\.jsdom +.fi +.RE +.P +To show the \fBconnect\fP package version history, you can do +this: +.P +.RS 2 +.nf +npm view connect versions +.fi +.RE +.SH OUTPUT +.P +If only a single string field for a single version is output, then it +will not be colorized or quoted, so as to enable piping the output to +another command\. If the field is an object, it will be output as a JavaScript object literal\. +.P +If the \-\-json flag is given, the outputted fields will be JSON\. +.P +If the version range matches multiple versions, than each printed value +will be prefixed with the version it applies to\. +.P +If multiple fields are requested, than each of them are prefixed with +the field name\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help search +.IP \(bu 2 +npm help 7 registry +.IP \(bu 2 +npm help config +.IP \(bu 2 +npm help 7 config +.IP \(bu 2 +npm help 5 npmrc +.IP \(bu 2 +npm help docs + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-whoami.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-whoami.1 new file mode 100644 index 00000000..c6217a70 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm-whoami.1 @@ -0,0 +1,26 @@ +.TH "NPM\-WHOAMI" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-whoami\fR \- Display npm username +.SH SYNOPSIS +.P +.RS 2 +.nf +npm whoami +.fi +.RE +.SH DESCRIPTION +.P +Print the \fBusername\fP config to standard output\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help config +.IP \(bu 2 +npm help 7 config +.IP \(bu 2 +npm help 5 npmrc +.IP \(bu 2 +npm help adduser + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm.1 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm.1 new file mode 100644 index 00000000..3c9328fa --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man1/npm.1 @@ -0,0 +1,209 @@ +.TH "NPM" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm\fR \- javascript package manager +.SH SYNOPSIS +.P +.RS 2 +.nf +npm [args] +.fi +.RE +.SH VERSION +.P +2.15.11 +.SH DESCRIPTION +.P +npm is the package manager for the Node JavaScript platform\. It puts +modules in place so that node can find them, and manages dependency +conflicts intelligently\. +.P +It is extremely configurable to support a wide variety of use cases\. +Most commonly, it is used to publish, discover, install, and develop node +programs\. +.P +Run \fBnpm help\fP to get a list of available commands\. +.SH INTRODUCTION +.P +You probably got npm because you want to install stuff\. +.P +Use \fBnpm install blerg\fP to install the latest version of "blerg"\. Check out +npm help \fBnpm\-install\fP for more info\. It can do a lot of stuff\. +.P +Use the \fBnpm search\fP command to show everything that's available\. +Use \fBnpm ls\fP to show everything you've installed\. +.SH DEPENDENCIES +.P +If a package references to another package with a git URL, npm depends +on a preinstalled git\. +.P +If one of the packages npm tries to install is a native node module and +requires compiling of C++ Code, npm will use +node\-gyp \fIhttps://github\.com/TooTallNate/node\-gyp\fR for that task\. +For a Unix system, node\-gyp \fIhttps://github\.com/TooTallNate/node\-gyp\fR +needs Python, make and a buildchain like GCC\. On Windows, +Python and Microsoft Visual Studio C++ are needed\. Python 3 is +not supported by node\-gyp \fIhttps://github\.com/TooTallNate/node\-gyp\fR\|\. +For more information visit +the node\-gyp repository \fIhttps://github\.com/TooTallNate/node\-gyp\fR and +the node\-gyp Wiki \fIhttps://github\.com/TooTallNate/node\-gyp/wiki\fR\|\. +.SH DIRECTORIES +.P +See npm help 5 \fBnpm\-folders\fP to learn about where npm puts stuff\. +.P +In particular, npm has two modes of operation: +.RS 0 +.IP \(bu 2 +global mode: +.br +npm installs packages into the install prefix at +\fBprefix/lib/node_modules\fP and bins are installed in \fBprefix/bin\fP\|\. +.IP \(bu 2 +local mode: +.br +npm installs packages into the current project directory, which +defaults to the current working directory\. Packages are installed to +\fB\|\./node_modules\fP, and bins are installed to \fB\|\./node_modules/\.bin\fP\|\. + +.RE +.P +Local mode is the default\. Use \fB\-\-global\fP or \fB\-g\fP on any command to +operate in global mode instead\. +.SH DEVELOPER USAGE +.P +If you're using npm to develop and publish your code, check out the +following help topics: +.RS 0 +.IP \(bu 2 +json: +Make a package\.json file\. See npm help 5 \fBpackage\.json\fP\|\. +.IP \(bu 2 +link: +For linking your current working code into Node's path, so that you +don't have to reinstall every time you make a change\. Use +\fBnpm link\fP to do this\. +.IP \(bu 2 +install: +It's a good idea to install things if you don't need the symbolic link\. +Especially, installing other peoples code from the registry is done via +\fBnpm install\fP +.IP \(bu 2 +adduser: +Create an account or log in\. Credentials are stored in the +user config file\. +.IP \(bu 2 +publish: +Use the \fBnpm publish\fP command to upload your code to the registry\. + +.RE +.SH CONFIGURATION +.P +npm is extremely configurable\. It reads its configuration options from +5 places\. +.RS 0 +.IP \(bu 2 +Command line switches: +.br +Set a config with \fB\-\-key val\fP\|\. All keys take a value, even if they +are booleans (the config parser doesn't know what the options are at +the time of parsing\.) If no value is provided, then the option is set +to boolean \fBtrue\fP\|\. +.IP \(bu 2 +Environment Variables: +.br +Set any config by prefixing the name in an environment variable with +\fBnpm_config_\fP\|\. For example, \fBexport npm_config_key=val\fP\|\. +.IP \(bu 2 +User Configs: +.br +The file at $HOME/\.npmrc is an ini\-formatted list of configs\. If +present, it is parsed\. If the \fBuserconfig\fP option is set in the cli +or env, then that will be used instead\. +.IP \(bu 2 +Global Configs: +.br +The file found at \.\./etc/npmrc (from the node executable, by default +this resolves to /usr/local/etc/npmrc) will be parsed if it is found\. +If the \fBglobalconfig\fP option is set in the cli, env, or user config, +then that file is parsed instead\. +.IP \(bu 2 +Defaults: +.br +npm's default configuration options are defined in +lib/utils/config\-defs\.js\. These must not be changed\. + +.RE +.P +See npm help 7 \fBnpm\-config\fP for much much more information\. +.SH CONTRIBUTIONS +.P +Patches welcome! +.RS 0 +.IP \(bu 2 +code: +Read through npm help 7 \fBnpm\-coding\-style\fP if you plan to submit code\. +You don't have to agree with it, but you do have to follow it\. +.IP \(bu 2 +docs: +If you find an error in the documentation, edit the appropriate markdown +file in the "doc" folder\. (Don't worry about generating the man page\.) + +.RE +.P +Contributors are listed in npm's \fBpackage\.json\fP file\. You can view them +easily by doing \fBnpm view npm contributors\fP\|\. +.P +If you would like to contribute, but don't know what to work on, read +the contributing guidelines and check the issues list\. +.RS 0 +.IP \(bu 2 +https://github\.com/npm/npm/wiki/Contributing\-Guidelines +.IP \(bu 2 +https://github\.com/npm/npm/issues + +.RE +.SH BUGS +.P +When you find issues, please report them: +.RS 0 +.IP \(bu 2 +web: +https://github\.com/npm/npm/issues + +.RE +.P +Be sure to include \fIall\fR of the output from the npm command that didn't work +as expected\. The \fBnpm\-debug\.log\fP file is also helpful to provide\. +.P +You can also look for isaacs in #node\.js on irc://irc\.freenode\.net\. He +will no doubt tell you to put the output in a gist or email\. +.SH AUTHOR +.P +Isaac Z\. Schlueter \fIhttp://blog\.izs\.me/\fR :: +isaacs \fIhttps://github\.com/isaacs/\fR :: +@izs \fIhttp://twitter\.com/izs\fR :: +i@izs\.me +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help help +.IP \(bu 2 +npm help 7 faq +.IP \(bu 2 +README +.IP \(bu 2 +npm help 5 package\.json +.IP \(bu 2 +npm help install +.IP \(bu 2 +npm help config +.IP \(bu 2 +npm help 7 config +.IP \(bu 2 +npm help 5 npmrc +.IP \(bu 2 +npm help 7 index +.IP \(bu 2 +npm apihelp npm + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-bin.3 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-bin.3 new file mode 100644 index 00000000..b96267bc --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-bin.3 @@ -0,0 +1,17 @@ +.TH "NPM\-BIN" "3" "October 2016" "" "" +.SH "NAME" +\fBnpm-bin\fR \- Display npm bin folder +.SH SYNOPSIS +.P +.RS 2 +.nf +npm\.commands\.bin(args, cb) +.fi +.RE +.SH DESCRIPTION +.P +Print the folder where npm will install executables\. +.P +This function should not be used programmatically\. Instead, just refer +to the \fBnpm\.bin\fP property\. + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-bugs.3 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-bugs.3 new file mode 100644 index 00000000..65656cd2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-bugs.3 @@ -0,0 +1,23 @@ +.TH "NPM\-BUGS" "3" "October 2016" "" "" +.SH "NAME" +\fBnpm-bugs\fR \- Bugs for a package in a web browser maybe +.SH SYNOPSIS +.P +.RS 2 +.nf +npm\.commands\.bugs(package, callback) +.fi +.RE +.SH DESCRIPTION +.P +This command tries to guess at the likely location of a package's +bug tracker URL, and then tries to open it using the \fB\-\-browser\fP +config param\. +.P +Like other commands, the first parameter is an array\. This command only +uses the first element, which is expected to be a package name with an +optional version number\. +.P +This command will launch a browser, so this command may not be the most +friendly for programmatic use\. + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-cache.3 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-cache.3 new file mode 100644 index 00000000..a9f1ef15 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-cache.3 @@ -0,0 +1,34 @@ +.TH "NPM\-CACHE" "3" "October 2016" "" "" +.SH "NAME" +\fBnpm-cache\fR \- manage the npm cache programmatically +.SH SYNOPSIS +.P +.RS 2 +.nf +npm\.commands\.cache([args], callback) + +// helpers +npm\.commands\.cache\.clean([args], callback) +npm\.commands\.cache\.add([args], callback) +npm\.commands\.cache\.read(name, version, forceBypass, callback) +.fi +.RE +.SH DESCRIPTION +.P +This acts much the same ways as the npm help cache command line +functionality\. +.P +The callback is called with the package\.json data of the thing that is +eventually added to or read from the cache\. +.P +The top level \fBnpm\.commands\.cache(\.\.\.)\fP functionality is a public +interface, and like all commands on the \fBnpm\.commands\fP object, it will +match the command line behavior exactly\. +.P +However, the cache folder structure and the cache helper functions are +considered \fBinternal\fR API surface, and as such, may change in future +releases of npm, potentially without warning or significant version +incrementation\. +.P +Use at your own risk\. + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-commands.3 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-commands.3 new file mode 100644 index 00000000..a2caf649 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-commands.3 @@ -0,0 +1,28 @@ +.TH "NPM\-COMMANDS" "3" "October 2016" "" "" +.SH "NAME" +\fBnpm-commands\fR \- npm commands +.SH SYNOPSIS +.P +.RS 2 +.nf +npm\.commands[](args, callback) +.fi +.RE +.SH DESCRIPTION +.P +npm comes with a full set of commands, and each of the commands takes a +similar set of arguments\. +.P +In general, all commands on the command object take an \fBarray\fR of positional +argument \fBstrings\fR\|\. The last argument to any function is a callback\. Some +commands are special and take other optional arguments\. +.P +All commands have their own man page\. See \fBman npm\-\fP for command\-line +usage, or \fBman 3 npm\-\fP for programmatic usage\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help 7 index + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-config.3 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-config.3 new file mode 100644 index 00000000..adf644c9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-config.3 @@ -0,0 +1,49 @@ +.TH "NPM\-CONFIG" "3" "October 2016" "" "" +.SH "NAME" +\fBnpm-config\fR \- Manage the npm configuration files +.SH SYNOPSIS +.P +.RS 2 +.nf +npm\.commands\.config(args, callback) +var val = npm\.config\.get(key) +npm\.config\.set(key, val) +.fi +.RE +.SH DESCRIPTION +.P +This function acts much the same way as the command\-line version\. The first +element in the array tells config what to do\. Possible values are: +.RS 0 +.IP \(bu 2 +\fBset\fP + Sets a config parameter\. The second element in \fBargs\fP is interpreted as the + key, and the third element is interpreted as the value\. +.IP \(bu 2 +\fBget\fP + Gets the value of a config parameter\. The second element in \fBargs\fP is the + key to get the value of\. +.IP \(bu 2 +\fBdelete\fP (\fBrm\fP or \fBdel\fP) + Deletes a parameter from the config\. The second element in \fBargs\fP is the + key to delete\. +.IP \(bu 2 +\fBlist\fP (\fBls\fP) + Show all configs that aren't secret\. No parameters necessary\. +.IP \(bu 2 +\fBedit\fP: + Opens the config file in the default editor\. This command isn't very useful + programmatically, but it is made available\. + +.RE +.P +To programmatically access npm configuration settings, or set them for +the duration of a program, use the \fBnpm\.config\.set\fP and \fBnpm\.config\.get\fP +functions instead\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm apihelp npm + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-deprecate.3 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-deprecate.3 new file mode 100644 index 00000000..f10de76a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-deprecate.3 @@ -0,0 +1,43 @@ +.TH "NPM\-DEPRECATE" "3" "October 2016" "" "" +.SH "NAME" +\fBnpm-deprecate\fR \- Deprecate a version of a package +.SH SYNOPSIS +.P +.RS 2 +.nf +npm\.commands\.deprecate(args, callback) +.fi +.RE +.SH DESCRIPTION +.P +This command will update the npm registry entry for a package, providing +a deprecation warning to all who attempt to install it\. +.P +The 'args' parameter must have exactly two elements: +.RS 0 +.IP \(bu 2 +\fBpackage[@version]\fP + The \fBversion\fP portion is optional, and may be either a range, or a + specific version, or a tag\. +.IP \(bu 2 +\fBmessage\fP + The warning message that will be printed whenever a user attempts to + install the package\. + +.RE +.P +Note that you must be the package owner to deprecate something\. See the +\fBowner\fP and \fBadduser\fP help topics\. +.P +To un\-deprecate a package, specify an empty string (\fB""\fP) for the \fBmessage\fP argument\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm apihelp publish +.IP \(bu 2 +npm apihelp unpublish +.IP \(bu 2 +npm help 7 registry + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-docs.3 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-docs.3 new file mode 100644 index 00000000..04c6e54d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-docs.3 @@ -0,0 +1,23 @@ +.TH "NPM\-DOCS" "3" "October 2016" "" "" +.SH "NAME" +\fBnpm-docs\fR \- Docs for a package in a web browser maybe +.SH SYNOPSIS +.P +.RS 2 +.nf +npm\.commands\.docs(package, callback) +.fi +.RE +.SH DESCRIPTION +.P +This command tries to guess at the likely location of a package's +documentation URL, and then tries to open it using the \fB\-\-browser\fP +config param\. +.P +Like other commands, the first parameter is an array\. This command only +uses the first element, which is expected to be a package name with an +optional version number\. +.P +This command will launch a browser, so this command may not be the most +friendly for programmatic use\. + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-edit.3 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-edit.3 new file mode 100644 index 00000000..777fc40e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-edit.3 @@ -0,0 +1,28 @@ +.TH "NPM\-EDIT" "3" "October 2016" "" "" +.SH "NAME" +\fBnpm-edit\fR \- Edit an installed package +.SH SYNOPSIS +.P +.RS 2 +.nf +npm\.commands\.edit(package, callback) +.fi +.RE +.SH DESCRIPTION +.P +Opens the package folder in the default editor (or whatever you've +configured as the npm \fBeditor\fP config \-\- see \fBnpm help config\fP\|\.) +.P +After it has been edited, the package is rebuilt so as to pick up any +changes in compiled packages\. +.P +For instance, you can do \fBnpm install connect\fP to install connect +into your package, and then \fBnpm\.commands\.edit(["connect"], callback)\fP +to make a few changes to your locally installed copy\. +.P +The first parameter is a string array with a single element, the package +to open\. The package can optionally have a version number attached\. +.P +Since this command opens an editor in a new process, be careful about where +and how this is used\. + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-explore.3 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-explore.3 new file mode 100644 index 00000000..e7d57aea --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-explore.3 @@ -0,0 +1,22 @@ +.TH "NPM\-EXPLORE" "3" "October 2016" "" "" +.SH "NAME" +\fBnpm-explore\fR \- Browse an installed package +.SH SYNOPSIS +.P +.RS 2 +.nf +npm\.commands\.explore(args, callback) +.fi +.RE +.SH DESCRIPTION +.P +Spawn a subshell in the directory of the installed package specified\. +.P +If a command is specified, then it is run in the subshell, which then +immediately terminates\. +.P +Note that the package is \fInot\fR automatically rebuilt afterwards, so be +sure to use \fBnpm rebuild \fP if you make any changes\. +.P +The first element in the 'args' parameter must be a package name\. After that is the optional command, which can be any number of strings\. All of the strings will be combined into one, space\-delimited command\. + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-help-search.3 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-help-search.3 new file mode 100644 index 00000000..d9ff3c21 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-help-search.3 @@ -0,0 +1,41 @@ +.TH "NPM\-HELP\-SEARCH" "3" "October 2016" "" "" +.SH "NAME" +\fBnpm-help-search\fR \- Search the help pages +.SH SYNOPSIS +.P +.RS 2 +.nf +npm\.commands\.helpSearch(args, [silent,] callback) +.fi +.RE +.SH DESCRIPTION +.P +This command is rarely useful, but it exists in the rare case that it is\. +.P +This command takes an array of search terms and returns the help pages that +match in order of best match\. +.P +If there is only one match, then npm displays that help section\. If there +are multiple results, the results are printed to the screen formatted and the +array of results is returned\. Each result is an object with these properties: +.RS 0 +.IP \(bu 2 +hits: +A map of args to number of hits on that arg\. For example, {"npm": 3} +.IP \(bu 2 +found: +Total number of unique args that matched\. +.IP \(bu 2 +totalHits: +Total number of hits\. +.IP \(bu 2 +lines: +An array of all matching lines (and some adjacent lines)\. +.IP \(bu 2 +file: +Name of the file that matched + +.RE +.P +The silent parameter is not necessary not used, but it may in the future\. + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-init.3 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-init.3 new file mode 100644 index 00000000..82820198 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-init.3 @@ -0,0 +1,32 @@ +.TH "NPM" "" "October 2016" "" "" +.SH "NAME" +\fBnpm\fR +.SH SYNOPSIS +.P +.RS 2 +.nf +npm\.commands\.init(args, callback) +.fi +.RE +.SH DESCRIPTION +.P +This will ask you a bunch of questions, and then write a package\.json for you\. +.P +It attempts to make reasonable guesses about what you want things to be set to, +and then writes a package\.json file with the options you've selected\. +.P +If you already have a package\.json file, it'll read that first, and default to +the options in there\. +.P +It is strictly additive, so it does not delete options from your package\.json +without a really good reason to do so\. +.P +Since this function expects to be run on the command\-line, it doesn't work very +well as a programmatically\. The best option is to roll your own, and since +JavaScript makes it stupid simple to output formatted JSON, that is the +preferred method\. If you're sure you want to handle command\-line prompting, +then go ahead and use this programmatically\. +.SH SEE ALSO +.P +npm help 5 package\.json + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-install.3 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-install.3 new file mode 100644 index 00000000..65526a62 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-install.3 @@ -0,0 +1,23 @@ +.TH "NPM\-INSTALL" "3" "October 2016" "" "" +.SH "NAME" +\fBnpm-install\fR \- install a package programmatically +.SH SYNOPSIS +.P +.RS 2 +.nf +npm\.commands\.install([where,] packages, callback) +.fi +.RE +.SH DESCRIPTION +.P +This acts much the same ways as installing on the command\-line\. +.P +The 'where' parameter is optional and only used internally, and it specifies +where the packages should be installed to\. +.P +The 'packages' parameter is an array of strings\. Each element in the array is +the name of a package to be installed\. +.P +Finally, 'callback' is a function that will be called when all packages have been +installed or when an error has been encountered\. + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-link.3 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-link.3 new file mode 100644 index 00000000..56b70de0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-link.3 @@ -0,0 +1,41 @@ +.TH "NPM\-LINK" "3" "October 2016" "" "" +.SH "NAME" +\fBnpm-link\fR \- Symlink a package folder +.SH SYNOPSIS +.P +.RS 2 +.nf +npm\.commands\.link(callback) +npm\.commands\.link(packages, callback) +.fi +.RE +.SH DESCRIPTION +.P +Package linking is a two\-step process\. +.P +Without parameters, link will create a globally\-installed +symbolic link from \fBprefix/package\-name\fP to the current folder\. +.P +With a parameters, link will create a symlink from the local \fBnode_modules\fP +folder to the global symlink\. +.P +When creating tarballs for \fBnpm publish\fP, the linked packages are +"snapshotted" to their current state by resolving the symbolic links\. +.P +This is +handy for installing your own stuff, so that you can work on it and test it +iteratively without having to continually rebuild\. +.P +For example: +.P +.RS 2 +.nf +npm\.commands\.link(cb) # creates global link from the cwd + # (say redis package) +npm\.commands\.link('redis', cb) # link\-install the package +.fi +.RE +.P +Now, any changes to the redis package will be reflected in +the package in the current working directory + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-load.3 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-load.3 new file mode 100644 index 00000000..b5b7c9ea --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-load.3 @@ -0,0 +1,34 @@ +.TH "NPM\-LOAD" "3" "October 2016" "" "" +.SH "NAME" +\fBnpm-load\fR \- Load config settings +.SH SYNOPSIS +.P +.RS 2 +.nf +npm\.load(conf, cb) +.fi +.RE +.SH DESCRIPTION +.P +npm\.load() must be called before any other function call\. Both parameters are +optional, but the second is recommended\. +.P +The first parameter is an object containing command\-line config params, and the +second parameter is a callback that will be called when npm is loaded and ready +to serve\. +.P +The first parameter should follow a similar structure as the package\.json +config object\. +.P +For example, to emulate the \-\-dev flag, pass an object that looks like this: +.P +.RS 2 +.nf +{ + "dev": true +} +.fi +.RE +.P +For a list of all the available command\-line configs, see \fBnpm help config\fP + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-ls.3 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-ls.3 new file mode 100644 index 00000000..454dfd45 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-ls.3 @@ -0,0 +1,68 @@ +.TH "NPM\-LS" "3" "October 2016" "" "" +.SH "NAME" +\fBnpm-ls\fR \- List installed packages +.SH SYNOPSIS +.P +.RS 2 +.nf +npm\.commands\.ls(args, [silent,] callback) +.fi +.RE +.SH DESCRIPTION +.P +This command will print to stdout all the versions of packages that are +installed, as well as their dependencies, in a tree\-structure\. It will also +return that data using the callback\. +.P +This command does not take any arguments, but args must be defined\. +Beyond that, if any arguments are passed in, npm will politely warn that it +does not take positional arguments, though you may set config flags +like with any other command, such as \fBglobal\fP to list global packages\. +.P +It will print out extraneous, missing, and invalid packages\. +.P +If the silent parameter is set to true, nothing will be output to the screen, +but the data will still be returned\. +.P +Callback is provided an error if one occurred, the full data about which +packages are installed and which dependencies they will receive, and a +"lite" data object which just shows which versions are installed where\. +Note that the full data object is a circular structure, so care must be +taken if it is serialized to JSON\. +.SH CONFIGURATION +.SS long +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: Boolean + +.RE +.P +Show extended information\. +.SS parseable +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: Boolean + +.RE +.P +Show parseable output instead of tree view\. +.SS global +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: Boolean + +.RE +.P +List packages in the global install prefix instead of in the current +project\. +.P +Note, if parseable is set or long isn't set, then duplicates will be trimmed\. +This means that if a submodule has the same dependency as a parent module, then the +dependency will only be output once\. + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-outdated.3 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-outdated.3 new file mode 100644 index 00000000..3ded0b0b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-outdated.3 @@ -0,0 +1,17 @@ +.TH "NPM\-OUTDATED" "3" "October 2016" "" "" +.SH "NAME" +\fBnpm-outdated\fR \- Check for outdated packages +.SH SYNOPSIS +.P +.RS 2 +.nf +npm\.commands\.outdated([packages,] callback) +.fi +.RE +.SH DESCRIPTION +.P +This command will check the registry to see if the specified packages are +currently outdated\. +.P +If the 'packages' parameter is left out, npm will check all packages\. + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-owner.3 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-owner.3 new file mode 100644 index 00000000..ecae9746 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-owner.3 @@ -0,0 +1,43 @@ +.TH "NPM\-OWNER" "3" "October 2016" "" "" +.SH "NAME" +\fBnpm-owner\fR \- Manage package owners +.SH SYNOPSIS +.P +.RS 2 +.nf +npm\.commands\.owner(args, callback) +.fi +.RE +.SH DESCRIPTION +.P +The first element of the 'args' parameter defines what to do, and the subsequent +elements depend on the action\. Possible values for the action are (order of +parameters are given in parenthesis): +.RS 0 +.IP \(bu 2 +ls (package): +List all the users who have access to modify a package and push new versions\. +Handy when you need to know who to bug for help\. +.IP \(bu 2 +add (user, package): +Add a new user as a maintainer of a package\. This user is enabled to modify +metadata, publish new versions, and add other owners\. +.IP \(bu 2 +rm (user, package): +Remove a user from the package owner list\. This immediately revokes their +privileges\. + +.RE +.P +Note that there is only one level of access\. Either you can modify a package, +or you can't\. Future versions may contain more fine\-grained access levels, but +that is not implemented at this time\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm apihelp publish +.IP \(bu 2 +npm help 7 registry + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-pack.3 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-pack.3 new file mode 100644 index 00000000..88caa999 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-pack.3 @@ -0,0 +1,23 @@ +.TH "NPM\-PACK" "3" "October 2016" "" "" +.SH "NAME" +\fBnpm-pack\fR \- Create a tarball from a package +.SH SYNOPSIS +.P +.RS 2 +.nf +npm\.commands\.pack([packages,] callback) +.fi +.RE +.SH DESCRIPTION +.P +For anything that's installable (that is, a package folder, tarball, +tarball url, name@tag, name@version, or name), this command will fetch +it to the cache, and then copy the tarball to the current working +directory as \fB\-\.tgz\fP, and then write the filenames out to +stdout\. +.P +If the same package is specified multiple times, then the file will be +overwritten the second time\. +.P +If no arguments are supplied, then npm packs the current package folder\. + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-ping.3 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-ping.3 new file mode 100644 index 00000000..52d377c7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-ping.3 @@ -0,0 +1,17 @@ +.TH "NPM\-PING" "3" "October 2016" "" "" +.SH "NAME" +\fBnpm-ping\fR \- Ping npm registry +.SH SYNOPSIS +.P +.RS 2 +.nf +npm\.registry\.ping(registry, options, function (er, pong)) +.fi +.RE +.SH DESCRIPTION +.P +Attempts to connect to the given registry, returning a \fBpong\fP +object with various metadata if it succeeds\. +.P +This function is primarily useful for debugging connection issues +to npm registries\. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-prefix.3 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-prefix.3 new file mode 100644 index 00000000..71ad8efb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-prefix.3 @@ -0,0 +1,19 @@ +.TH "NPM\-PREFIX" "3" "October 2016" "" "" +.SH "NAME" +\fBnpm-prefix\fR \- Display prefix +.SH SYNOPSIS +.P +.RS 2 +.nf +npm\.commands\.prefix(args, callback) +.fi +.RE +.SH DESCRIPTION +.P +Print the prefix to standard out\. +.P +\|'args' is never used and callback is never called with data\. +\|'args' must be present or things will break\. +.P +This function is not useful programmatically + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-prune.3 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-prune.3 new file mode 100644 index 00000000..e5228f36 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-prune.3 @@ -0,0 +1,21 @@ +.TH "NPM\-PRUNE" "3" "October 2016" "" "" +.SH "NAME" +\fBnpm-prune\fR \- Remove extraneous packages +.SH SYNOPSIS +.P +.RS 2 +.nf +npm\.commands\.prune([packages,] callback) +.fi +.RE +.SH DESCRIPTION +.P +This command removes "extraneous" packages\. +.P +The first parameter is optional, and it specifies packages to be removed\. +.P +No packages are specified, then all packages will be checked\. +.P +Extraneous packages are packages that are not listed on the parent +package's dependencies list\. + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-publish.3 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-publish.3 new file mode 100644 index 00000000..89d10335 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-publish.3 @@ -0,0 +1,41 @@ +.TH "NPM\-PUBLISH" "3" "October 2016" "" "" +.SH "NAME" +\fBnpm-publish\fR \- Publish a package +.SH SYNOPSIS +.P +.RS 2 +.nf +npm\.commands\.publish([packages,] callback) +.fi +.RE +.SH DESCRIPTION +.P +Publishes a package to the registry so that it can be installed by name\. +Possible values in the 'packages' array are: +.RS 0 +.IP \(bu 2 +\fB\fP: +A folder containing a package\.json file +.IP \(bu 2 +\fB\fP: +A url or file path to a gzipped tar archive containing a single folder +with a package\.json file inside\. + +.RE +.P +If the package array is empty, npm will try to publish something in the +current working directory\. +.P +This command could fails if one of the packages specified already exists in +the registry\. Overwrites when the "force" environment variable is set\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help 7 registry +.IP \(bu 2 +npm help adduser +.IP \(bu 2 +npm apihelp owner + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-rebuild.3 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-rebuild.3 new file mode 100644 index 00000000..e956548a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-rebuild.3 @@ -0,0 +1,19 @@ +.TH "NPM\-REBUILD" "3" "October 2016" "" "" +.SH "NAME" +\fBnpm-rebuild\fR \- Rebuild a package +.SH SYNOPSIS +.P +.RS 2 +.nf +npm\.commands\.rebuild([packages,] callback) +.fi +.RE +.SH DESCRIPTION +.P +This command runs the \fBnpm build\fP command on each of the matched packages\. This is useful +when you install a new version of node, and must recompile all your C++ addons with +the new binary\. If no 'packages' parameter is specify, every package will be rebuilt\. +.SH CONFIGURATION +.P +See \fBnpm help build\fP + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-repo.3 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-repo.3 new file mode 100644 index 00000000..bba8d38e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-repo.3 @@ -0,0 +1,23 @@ +.TH "NPM\-REPO" "3" "October 2016" "" "" +.SH "NAME" +\fBnpm-repo\fR \- Open package repository page in the browser +.SH SYNOPSIS +.P +.RS 2 +.nf +npm\.commands\.repo(package, callback) +.fi +.RE +.SH DESCRIPTION +.P +This command tries to guess at the likely location of a package's +repository URL, and then tries to open it using the \fB\-\-browser\fP +config param\. +.P +Like other commands, the first parameter is an array\. This command only +uses the first element, which is expected to be a package name with an +optional version number\. +.P +This command will launch a browser, so this command may not be the most +friendly for programmatic use\. + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-restart.3 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-restart.3 new file mode 100644 index 00000000..fda16aa8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-restart.3 @@ -0,0 +1,58 @@ +.TH "NPM\-RESTART" "3" "October 2016" "" "" +.SH "NAME" +\fBnpm-restart\fR \- Restart a package +.SH SYNOPSIS +.P +.RS 2 +.nf +npm\.commands\.restart(packages, callback) +.fi +.RE +.SH DESCRIPTION +.P +This restarts a package (or multiple packages)\. +.P +This runs a package's "stop", "restart", and "start" scripts, and associated +pre\- and post\- scripts, in the order given below: +.RS 0 +.IP 1. 3 +prerestart +.IP 2. 3 +prestop +.IP 3. 3 +stop +.IP 4. 3 +poststop +.IP 5. 3 +restart +.IP 6. 3 +prestart +.IP 7. 3 +start +.IP 8. 3 +poststart +.IP 9. 3 +postrestart + +.RE +.P +If no version is specified, then it restarts the "active" version\. +.P +npm can restart multiple packages\. Just specify multiple packages in +the \fBpackages\fP parameter\. +.SH NOTE +.P +Note that the "restart" script is run \fBin addition to\fR the "stop" +and "start" scripts, not instead of them\. +.P +This is the behavior as of \fBnpm\fP major version 2\. A change in this +behavior will be accompanied by an increase in major version number +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm apihelp start +.IP \(bu 2 +npm apihelp stop + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-root.3 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-root.3 new file mode 100644 index 00000000..0d13b3e4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-root.3 @@ -0,0 +1,19 @@ +.TH "NPM\-ROOT" "3" "October 2016" "" "" +.SH "NAME" +\fBnpm-root\fR \- Display npm root +.SH SYNOPSIS +.P +.RS 2 +.nf +npm\.commands\.root(args, callback) +.fi +.RE +.SH DESCRIPTION +.P +Print the effective \fBnode_modules\fP folder to standard out\. +.P +\|'args' is never used and callback is never called with data\. +\|'args' must be present or things will break\. +.P +This function is not useful programmatically\. + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-run-script.3 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-run-script.3 new file mode 100644 index 00000000..f12a9ef0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-run-script.3 @@ -0,0 +1,37 @@ +.TH "NPM\-RUN\-SCRIPT" "3" "October 2016" "" "" +.SH "NAME" +\fBnpm-run-script\fR \- Run arbitrary package scripts +.SH SYNOPSIS +.P +.RS 2 +.nf +npm\.commands\.run\-script(args, callback) +.fi +.RE +.SH DESCRIPTION +.P +This runs an arbitrary command from a package's "scripts" object\. +.P +It is used by the test, start, restart, and stop commands, but can be +called directly, as well\. +.P +The 'args' parameter is an array of strings\. Behavior depends on the number +of elements\. If there is only one element, npm assumes that the element +represents a command to be run on the local repository\. If there is more than +one element, then the first is assumed to be the package and the second is +assumed to be the command to run\. All other elements are ignored\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help 7 scripts +.IP \(bu 2 +npm apihelp test +.IP \(bu 2 +npm apihelp start +.IP \(bu 2 +npm apihelp restart +.IP \(bu 2 +npm apihelp stop + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-search.3 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-search.3 new file mode 100644 index 00000000..be294ea9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-search.3 @@ -0,0 +1,52 @@ +.TH "NPM\-SEARCH" "3" "October 2016" "" "" +.SH "NAME" +\fBnpm-search\fR \- Search for packages +.SH SYNOPSIS +.P +.RS 2 +.nf +npm\.commands\.search(searchTerms, [silent,] [staleness,] callback) +.fi +.RE +.SH DESCRIPTION +.P +Search the registry for packages matching the search terms\. The available parameters are: +.RS 0 +.IP \(bu 2 +searchTerms: +Array of search terms\. These terms are case\-insensitive\. +.IP \(bu 2 +silent: +If true, npm will not log anything to the console\. +.IP \(bu 2 +staleness: +This is the threshold for stale packages\. "Fresh" packages are not refreshed +from the registry\. This value is measured in seconds\. +.IP \(bu 2 +callback: +Returns an object where each key is the name of a package, and the value +is information about that package along with a 'words' property, which is +a space\-delimited string of all of the interesting words in that package\. +The only properties included are those that are searched, which generally include: +.RS 0 +.IP \(bu 2 +name +.IP \(bu 2 +description +.IP \(bu 2 +maintainers +.IP \(bu 2 +url +.IP \(bu 2 +keywords + +.RE + +.RE +.P +A search on the registry excludes any result that does not match all of the +search terms\. It also removes any items from the results that contain an +excluded term (the "searchexclude" config)\. The search is case insensitive +and doesn't try to read your mind (it doesn't do any verb tense matching or the +like)\. + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-shrinkwrap.3 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-shrinkwrap.3 new file mode 100644 index 00000000..682e0e45 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-shrinkwrap.3 @@ -0,0 +1,24 @@ +.TH "NPM\-SHRINKWRAP" "3" "October 2016" "" "" +.SH "NAME" +\fBnpm-shrinkwrap\fR \- programmatically generate package shrinkwrap file +.SH SYNOPSIS +.P +.RS 2 +.nf +npm\.commands\.shrinkwrap(args, [silent,] callback) +.fi +.RE +.SH DESCRIPTION +.P +This acts much the same ways as shrinkwrapping on the command\-line\. +.P +This command does not take any arguments, but 'args' must be defined\. +Beyond that, if any arguments are passed in, npm will politely warn that it +does not take positional arguments\. +.P +If the 'silent' parameter is set to true, nothing will be output to the screen, +but the shrinkwrap file will still be written\. +.P +Finally, 'callback' is a function that will be called when the shrinkwrap has +been saved\. + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-start.3 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-start.3 new file mode 100644 index 00000000..0490c08a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-start.3 @@ -0,0 +1,17 @@ +.TH "NPM\-START" "3" "October 2016" "" "" +.SH "NAME" +\fBnpm-start\fR \- Start a package +.SH SYNOPSIS +.P +.RS 2 +.nf +npm\.commands\.start(packages, callback) +.fi +.RE +.SH DESCRIPTION +.P +This runs a package's "start" script, if one was provided\. +.P +npm can start multiple packages\. Just specify multiple packages in the +\fBpackages\fP parameter\. + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-stop.3 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-stop.3 new file mode 100644 index 00000000..8e23d5c9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-stop.3 @@ -0,0 +1,17 @@ +.TH "NPM\-STOP" "3" "October 2016" "" "" +.SH "NAME" +\fBnpm-stop\fR \- Stop a package +.SH SYNOPSIS +.P +.RS 2 +.nf +npm\.commands\.stop(packages, callback) +.fi +.RE +.SH DESCRIPTION +.P +This runs a package's "stop" script, if one was provided\. +.P +npm can run stop on multiple packages\. Just specify multiple packages +in the \fBpackages\fP parameter\. + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-tag.3 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-tag.3 new file mode 100644 index 00000000..0ad36376 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-tag.3 @@ -0,0 +1,27 @@ +.TH "NPM\-TAG" "3" "October 2016" "" "" +.SH "NAME" +\fBnpm-tag\fR \- Tag a published version +.SH SYNOPSIS +.P +.RS 2 +.nf +npm\.commands\.tag(package@version, tag, callback) +.fi +.RE +.SH DESCRIPTION +.P +Tags the specified version of the package with the specified tag, or the +\fB\-\-tag\fP config if not specified\. +.P +The 'package@version' is an array of strings, but only the first two elements are +currently used\. +.P +The first element must be in the form package@version, where package +is the package name and version is the version number (much like installing a +specific version)\. +.P +The second element is the name of the tag to tag this version with\. If this +parameter is missing or falsey (empty), the default from the config will be +used\. For more information about how to set this config, check +\fBman 3 npm\-config\fP for programmatic usage or \fBman npm\-config\fP for cli usage\. + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-test.3 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-test.3 new file mode 100644 index 00000000..5141919f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-test.3 @@ -0,0 +1,20 @@ +.TH "NPM\-TEST" "3" "October 2016" "" "" +.SH "NAME" +\fBnpm-test\fR \- Test a package +.SH SYNOPSIS +.P +.RS 2 +.nf + npm\.commands\.test(packages, callback) +.fi +.RE +.SH DESCRIPTION +.P +This runs a package's "test" script, if one was provided\. +.P +To run tests as a condition of installation, set the \fBnpat\fP config to +true\. +.P +npm can run tests on multiple packages\. Just specify multiple packages +in the \fBpackages\fP parameter\. + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-uninstall.3 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-uninstall.3 new file mode 100644 index 00000000..b0154b1a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-uninstall.3 @@ -0,0 +1,20 @@ +.TH "NPM\-UNINSTALL" "3" "October 2016" "" "" +.SH "NAME" +\fBnpm-uninstall\fR \- uninstall a package programmatically +.SH SYNOPSIS +.P +.RS 2 +.nf +npm\.commands\.uninstall(packages, callback) +.fi +.RE +.SH DESCRIPTION +.P +This acts much the same ways as uninstalling on the command\-line\. +.P +The 'packages' parameter is an array of strings\. Each element in the array is +the name of a package to be uninstalled\. +.P +Finally, 'callback' is a function that will be called when all packages have been +uninstalled or when an error has been encountered\. + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-unpublish.3 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-unpublish.3 new file mode 100644 index 00000000..ffb50d8b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-unpublish.3 @@ -0,0 +1,24 @@ +.TH "NPM\-UNPUBLISH" "3" "October 2016" "" "" +.SH "NAME" +\fBnpm-unpublish\fR \- Remove a package from the registry +.SH SYNOPSIS +.P +.RS 2 +.nf +npm\.commands\.unpublish(package, callback) +.fi +.RE +.SH DESCRIPTION +.P +This removes a package version from the registry, deleting its +entry and removing the tarball\. +.P +The package parameter must be defined\. +.P +Only the first element in the package parameter is used\. If there is no first +element, then npm assumes that the package at the current working directory +is what is meant\. +.P +If no version is specified, or if all versions are removed then +the root package entry is removed from the registry entirely\. + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-update.3 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-update.3 new file mode 100644 index 00000000..3981108f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-update.3 @@ -0,0 +1,26 @@ +.TH "NPM\-UPDATE" "3" "October 2016" "" "" +.SH "NAME" +\fBnpm-update\fR \- Update a package +.SH SYNOPSIS +.P +.RS 2 +.nf +npm\.commands\.update(packages, callback) +.fi +.RE +.TH "DESCRIPTION" "" "October 2016" "" "" +.SH "NAME" +\fBDESCRIPTION\fR +.P +Updates a package, upgrading it to the latest version\. It also installs any +missing packages\. +.P +The \fBpackages\fP argument is an array of packages to update\. The \fBcallback\fP +parameter will be called when done or when an error occurs\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help update + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-version.3 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-version.3 new file mode 100644 index 00000000..63991f9d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-version.3 @@ -0,0 +1,22 @@ +.TH "NPM\-VERSION" "3" "October 2016" "" "" +.SH "NAME" +\fBnpm-version\fR \- Bump a package version +.SH SYNOPSIS +.P +.RS 2 +.nf +npm\.commands\.version(newversion, callback) +.fi +.RE +.SH DESCRIPTION +.P +Run this in a package directory to bump the version and write the new +data back to the package\.json file\. +.P +If run in a git repo, it will also create a version commit and tag, and +fail if the repo is not clean\. +.P +Like all other commands, this function takes a string array as its first +parameter\. The difference, however, is this function will fail if it does +not have exactly one element\. The only element should be a version number\. + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-view.3 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-view.3 new file mode 100644 index 00000000..439856d4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-view.3 @@ -0,0 +1,131 @@ +.TH "NPM\-VIEW" "3" "October 2016" "" "" +.SH "NAME" +\fBnpm-view\fR \- View registry info +.SH SYNOPSIS +.P +.RS 2 +.nf +npm\.commands\.view(args, [silent,] callback) +.fi +.RE +.SH DESCRIPTION +.P +This command shows data about a package and prints it to the stream +referenced by the \fBoutfd\fP config, which defaults to stdout\. +.P +The "args" parameter is an ordered list that closely resembles the command\-line +usage\. The elements should be ordered such that the first element is +the package and version (package@version)\. The version is optional\. After that, +the rest of the parameters are fields with optional subfields ("field\.subfield") +which can be used to get only the information desired from the registry\. +.P +The callback will be passed all of the data returned by the query\. +.P +For example, to get the package registry entry for the \fBconnect\fP package, +you can do this: +.P +.RS 2 +.nf +npm\.commands\.view(["connect"], callback) +.fi +.RE +.P +If no version is specified, "latest" is assumed\. +.P +Field names can be specified after the package descriptor\. +For example, to show the dependencies of the \fBronn\fP package at version +0\.3\.5, you could do the following: +.P +.RS 2 +.nf +npm\.commands\.view(["ronn@0\.3\.5", "dependencies"], callback) +.fi +.RE +.P +You can view child field by separating them with a period\. +To view the git repository URL for the latest version of npm, you could +do this: +.P +.RS 2 +.nf +npm\.commands\.view(["npm", "repository\.url"], callback) +.fi +.RE +.P +For fields that are arrays, requesting a non\-numeric field will return +all of the values from the objects in the list\. For example, to get all +the contributor names for the "express" project, you can do this: +.P +.RS 2 +.nf +npm\.commands\.view(["express", "contributors\.email"], callback) +.fi +.RE +.P +You may also use numeric indices in square braces to specifically select +an item in an array field\. To just get the email address of the first +contributor in the list, you can do this: +.P +.RS 2 +.nf +npm\.commands\.view(["express", "contributors[0]\.email"], callback) +.fi +.RE +.P +Multiple fields may be specified, and will be printed one after another\. +For exampls, to get all the contributor names and email addresses, you +can do this: +.P +.RS 2 +.nf +npm\.commands\.view(["express", "contributors\.name", "contributors\.email"], callback) +.fi +.RE +.P +"Person" fields are shown as a string if they would be shown as an +object\. So, for example, this will show the list of npm contributors in +the shortened string format\. (See \fBnpm help json\fP for more on this\.) +.P +.RS 2 +.nf +npm\.commands\.view(["npm", "contributors"], callback) +.fi +.RE +.P +If a version range is provided, then data will be printed for every +matching version of the package\. This will show which version of jsdom +was required by each matching version of yui3: +.P +.RS 2 +.nf +npm\.commands\.view(["yui3@>0\.5\.4", "dependencies\.jsdom"], callback) +.fi +.RE +.SH OUTPUT +.P +If only a single string field for a single version is output, then it +will not be colorized or quoted, so as to enable piping the output to +another command\. +.P +If the version range matches multiple versions, than each printed value +will be prefixed with the version it applies to\. +.P +If multiple fields are requested, than each of them are prefixed with +the field name\. +.P +Console output can be disabled by setting the 'silent' parameter to true\. +.SH RETURN VALUE +.P +The data returned will be an object in this formation: +.P +.RS 2 +.nf +{ : + { : + , \.\.\. } +, \.\.\. } +.fi +.RE +.P +corresponding to the list of fields selected\. + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-whoami.3 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-whoami.3 new file mode 100644 index 00000000..41303962 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm-whoami.3 @@ -0,0 +1,19 @@ +.TH "NPM\-WHOAMI" "3" "October 2016" "" "" +.SH "NAME" +\fBnpm-whoami\fR \- Display npm username +.SH SYNOPSIS +.P +.RS 2 +.nf +npm\.commands\.whoami(args, callback) +.fi +.RE +.SH DESCRIPTION +.P +Print the \fBusername\fP config to standard output\. +.P +\|'args' is never used and callback is never called with data\. +\|'args' must be present or things will break\. +.P +This function is not useful programmatically + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm.3 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm.3 new file mode 100644 index 00000000..32dbc247 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man3/npm.3 @@ -0,0 +1,124 @@ +.TH "NPM" "3" "October 2016" "" "" +.SH "NAME" +\fBnpm\fR \- javascript package manager +.SH SYNOPSIS +.P +.RS 2 +.nf +var npm = require("npm") +npm\.load([configObject, ]function (er, npm) { + // use the npm object, now that it's loaded\. + + npm\.config\.set(key, val) + val = npm\.config\.get(key) + + console\.log("prefix = %s", npm\.prefix) + + npm\.commands\.install(["package"], cb) +}) +.fi +.RE +.SH VERSION +.P +2.15.11 +.SH DESCRIPTION +.P +This is the API documentation for npm\. +To find documentation of the command line +client, see npm help \fBnpm\fP\|\. +.P +Prior to using npm's commands, \fBnpm\.load()\fP must be called\. If you provide +\fBconfigObject\fP as an object map of top\-level configs, they override the values +stored in the various config locations\. In the npm command line client, this +set of configs is parsed from the command line options\. Additional +configuration params are loaded from two configuration files\. See +npm help \fBnpm\-config\fP, npm help 7 \fBnpm\-config\fP, and npm help 5 \fBnpmrc\fP for more information\. +.P +After that, each of the functions are accessible in the +commands object: \fBnpm\.commands\.\fP\|\. See npm help 7 \fBnpm\-index\fP for a list of +all possible commands\. +.P +All commands on the command object take an \fBarray\fR of positional argument +\fBstrings\fR\|\. The last argument to any function is a callback\. Some +commands take other optional arguments\. +.P +Configs cannot currently be set on a per function basis, as each call to +npm\.config\.set will change the value for \fIall\fR npm commands in that process\. +.P +To find API documentation for a specific command, run the \fBnpm apihelp\fP +command\. +.SH METHODS AND PROPERTIES +.RS 0 +.IP \(bu 2 +\fBnpm\.load(configs, cb)\fP + Load the configuration params, and call the \fBcb\fP function once the + globalconfig and userconfig files have been loaded as well, or on + nextTick if they've already been loaded\. +.IP \(bu 2 +\fBnpm\.config\fP + An object for accessing npm configuration parameters\. +.RS 0 +.IP \(bu 2 +\fBnpm\.config\.get(key)\fP +.IP \(bu 2 +\fBnpm\.config\.set(key, val)\fP +.IP \(bu 2 +\fBnpm\.config\.del(key)\fP + +.RE +.IP \(bu 2 +\fBnpm\.dir\fP or \fBnpm\.root\fP + The \fBnode_modules\fP directory where npm will operate\. +.IP \(bu 2 +\fBnpm\.prefix\fP + The prefix where npm is operating\. (Most often the current working + directory\.) +.IP \(bu 2 +\fBnpm\.cache\fP + The place where npm keeps JSON and tarballs it fetches from the + registry (or uploads to the registry)\. +.IP \(bu 2 +\fBnpm\.tmp\fP + npm's temporary working directory\. +.IP \(bu 2 +\fBnpm\.deref\fP + Get the "real" name for a command that has either an alias or + abbreviation\. + +.RE +.SH MAGIC +.P +For each of the methods in the \fBnpm\.commands\fP object, a method is added to the +npm object, which takes a set of positional string arguments rather than an +array and a callback\. +.P +If the last argument is a callback, then it will use the supplied +callback\. However, if no callback is provided, then it will print out +the error or results\. +.P +For example, this would work in a node repl: +.P +.RS 2 +.nf +> npm = require("npm") +> npm\.load() // wait a sec\.\.\. +> npm\.install("dnode", "express") +.fi +.RE +.P +Note that that \fIwon't\fR work in a node program, since the \fBinstall\fP +method will get called before the configuration load is completed\. +.SH ABBREVS +.P +In order to support \fBnpm ins foo\fP instead of \fBnpm install foo\fP, the +\fBnpm\.commands\fP object has a set of abbreviations as well as the full +method names\. Use the \fBnpm\.deref\fP method to find the real name\. +.P +For example: +.P +.RS 2 +.nf +var cmd = npm\.deref("unp") // cmd === "unpublish" +.fi +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man5/npm-folders.5 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man5/npm-folders.5 new file mode 100644 index 00000000..9b57fef9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man5/npm-folders.5 @@ -0,0 +1,229 @@ +.TH "NPM\-FOLDERS" "5" "October 2016" "" "" +.SH "NAME" +\fBnpm-folders\fR \- Folder Structures Used by npm +.SH DESCRIPTION +.P +npm puts various things on your computer\. That's its job\. +.P +This document will tell you what it puts where\. +.SS tl;dr +.RS 0 +.IP \(bu 2 +Local install (default): puts stuff in \fB\|\./node_modules\fP of the current +package root\. +.IP \(bu 2 +Global install (with \fB\-g\fP): puts stuff in /usr/local or wherever node +is installed\. +.IP \(bu 2 +Install it \fBlocally\fR if you're going to \fBrequire()\fP it\. +.IP \(bu 2 +Install it \fBglobally\fR if you're going to run it on the command line\. +.IP \(bu 2 +If you need both, then install it in both places, or use \fBnpm link\fP\|\. + +.RE +.SS prefix Configuration +.P +The \fBprefix\fP config defaults to the location where node is installed\. +On most systems, this is \fB/usr/local\fP\|\. On windows, this is the exact +location of the node\.exe binary\. On Unix systems, it's one level up, +since node is typically installed at \fB{prefix}/bin/node\fP rather than +\fB{prefix}/node\.exe\fP\|\. +.P +When the \fBglobal\fP flag is set, npm installs things into this prefix\. +When it is not set, it uses the root of the current package, or the +current working directory if not in a package already\. +.SS Node Modules +.P +Packages are dropped into the \fBnode_modules\fP folder under the \fBprefix\fP\|\. +When installing locally, this means that you can +\fBrequire("packagename")\fP to load its main module, or +\fBrequire("packagename/lib/path/to/sub/module")\fP to load other modules\. +.P +Global installs on Unix systems go to \fB{prefix}/lib/node_modules\fP\|\. +Global installs on Windows go to \fB{prefix}/node_modules\fP (that is, no +\fBlib\fP folder\.) +.P +Scoped packages are installed the same way, except they are grouped together +in a sub\-folder of the relevant \fBnode_modules\fP folder with the name of that +scope prefix by the @ symbol, e\.g\. \fBnpm install @myorg/package\fP would place +the package in \fB{prefix}/node_modules/@myorg/package\fP\|\. See npm help 7 \fBscope\fP for +more details\. +.P +If you wish to \fBrequire()\fP a package, then install it locally\. +.SS Executables +.P +When in global mode, executables are linked into \fB{prefix}/bin\fP on Unix, +or directly into \fB{prefix}\fP on Windows\. +.P +When in local mode, executables are linked into +\fB\|\./node_modules/\.bin\fP so that they can be made available to scripts run +through npm\. (For example, so that a test runner will be in the path +when you run \fBnpm test\fP\|\.) +.SS Man Pages +.P +When in global mode, man pages are linked into \fB{prefix}/share/man\fP\|\. +.P +When in local mode, man pages are not installed\. +.P +Man pages are not installed on Windows systems\. +.SS Cache +.P +See npm help \fBnpm\-cache\fP\|\. Cache files are stored in \fB~/\.npm\fP on Posix, or +\fB~/npm\-cache\fP on Windows\. +.P +This is controlled by the \fBcache\fP configuration param\. +.SS Temp Files +.P +Temporary files are stored by default in the folder specified by the +\fBtmp\fP config, which defaults to the TMPDIR, TMP, or TEMP environment +variables, or \fB/tmp\fP on Unix and \fBc:\\windows\\temp\fP on Windows\. +.P +Temp files are given a unique folder under this root for each run of the +program, and are deleted upon successful exit\. +.SH More Information +.P +When installing locally, npm first tries to find an appropriate +\fBprefix\fP folder\. This is so that \fBnpm install foo@1\.2\.3\fP will install +to the sensible root of your package, even if you happen to have \fBcd\fPed +into some other folder\. +.P +Starting at the $PWD, npm will walk up the folder tree checking for a +folder that contains either a \fBpackage\.json\fP file, or a \fBnode_modules\fP +folder\. If such a thing is found, then that is treated as the effective +"current directory" for the purpose of running npm commands\. (This +behavior is inspired by and similar to git's \.git\-folder seeking +logic when running git commands in a working dir\.) +.P +If no package root is found, then the current folder is used\. +.P +When you run \fBnpm install foo@1\.2\.3\fP, then the package is loaded into +the cache, and then unpacked into \fB\|\./node_modules/foo\fP\|\. Then, any of +foo's dependencies are similarly unpacked into +\fB\|\./node_modules/foo/node_modules/\.\.\.\fP\|\. +.P +Any bin files are symlinked to \fB\|\./node_modules/\.bin/\fP, so that they may +be found by npm scripts when necessary\. +.SS Global Installation +.P +If the \fBglobal\fP configuration is set to true, then npm will +install packages "globally"\. +.P +For global installation, packages are installed roughly the same way, +but using the folders described above\. +.SS Cycles, Conflicts, and Folder Parsimony +.P +Cycles are handled using the property of node's module system that it +walks up the directories looking for \fBnode_modules\fP folders\. So, at every +stage, if a package is already installed in an ancestor \fBnode_modules\fP +folder, then it is not installed at the current location\. +.P +Consider the case above, where \fBfoo \-> bar \-> baz\fP\|\. Imagine if, in +addition to that, baz depended on bar, so you'd have: +\fBfoo \-> bar \-> baz \-> bar \-> baz \.\.\.\fP\|\. However, since the folder +structure is: \fBfoo/node_modules/bar/node_modules/baz\fP, there's no need to +put another copy of bar into \fB\|\.\.\./baz/node_modules\fP, since when it calls +require("bar"), it will get the copy that is installed in +\fBfoo/node_modules/bar\fP\|\. +.P +This shortcut is only used if the exact same +version would be installed in multiple nested \fBnode_modules\fP folders\. It +is still possible to have \fBa/node_modules/b/node_modules/a\fP if the two +"a" packages are different versions\. However, without repeating the +exact same package multiple times, an infinite regress will always be +prevented\. +.P +Another optimization can be made by installing dependencies at the +highest level possible, below the localized "target" folder\. +.SS Example +.P +Consider this dependency graph: +.P +.RS 2 +.nf +foo ++\-\- blerg@1\.2\.5 ++\-\- bar@1\.2\.3 +| +\-\- blerg@1\.x (latest=1\.3\.7) +| +\-\- baz@2\.x +| | `\-\- quux@3\.x +| | `\-\- bar@1\.2\.3 (cycle) +| `\-\- asdf@* +`\-\- baz@1\.2\.3 + `\-\- quux@3\.x + `\-\- bar +.fi +.RE +.P +In this case, we might expect a folder structure like this: +.P +.RS 2 +.nf +foo ++\-\- node_modules + +\-\- blerg (1\.2\.5) <\-\-\-[A] + +\-\- bar (1\.2\.3) <\-\-\-[B] + | `\-\- node_modules + | +\-\- baz (2\.0\.2) <\-\-\-[C] + | | `\-\- node_modules + | | `\-\- quux (3\.2\.0) + | `\-\- asdf (2\.3\.4) + `\-\- baz (1\.2\.3) <\-\-\-[D] + `\-\- node_modules + `\-\- quux (3\.2\.0) <\-\-\-[E] +.fi +.RE +.P +Since foo depends directly on \fBbar@1\.2\.3\fP and \fBbaz@1\.2\.3\fP, those are +installed in foo's \fBnode_modules\fP folder\. +.P +Even though the latest copy of blerg is 1\.3\.7, foo has a specific +dependency on version 1\.2\.5\. So, that gets installed at [A]\. Since the +parent installation of blerg satisfies bar's dependency on \fBblerg@1\.x\fP, +it does not install another copy under [B]\. +.P +Bar [B] also has dependencies on baz and asdf, so those are installed in +bar's \fBnode_modules\fP folder\. Because it depends on \fBbaz@2\.x\fP, it cannot +re\-use the \fBbaz@1\.2\.3\fP installed in the parent \fBnode_modules\fP folder [D], +and must install its own copy [C]\. +.P +Underneath bar, the \fBbaz \-> quux \-> bar\fP dependency creates a cycle\. +However, because bar is already in quux's ancestry [B], it does not +unpack another copy of bar into that folder\. +.P +Underneath \fBfoo \-> baz\fP [D], quux's [E] folder tree is empty, because its +dependency on bar is satisfied by the parent folder copy installed at [B]\. +.P +For a graphical breakdown of what is installed where, use \fBnpm ls\fP\|\. +.SS Publishing +.P +Upon publishing, npm will look in the \fBnode_modules\fP folder\. If any of +the items there are not in the \fBbundledDependencies\fP array, then they will +not be included in the package tarball\. +.P +This allows a package maintainer to install all of their dependencies +(and dev dependencies) locally, but only re\-publish those items that +cannot be found elsewhere\. See npm help 5 \fBpackage\.json\fP for more information\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help 7 faq +.IP \(bu 2 +npm help 5 package\.json +.IP \(bu 2 +npm help install +.IP \(bu 2 +npm help pack +.IP \(bu 2 +npm help cache +.IP \(bu 2 +npm help config +.IP \(bu 2 +npm help 5 npmrc +.IP \(bu 2 +npm help 7 config +.IP \(bu 2 +npm help publish + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man5/npm-global.5 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man5/npm-global.5 new file mode 100644 index 00000000..9b57fef9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man5/npm-global.5 @@ -0,0 +1,229 @@ +.TH "NPM\-FOLDERS" "5" "October 2016" "" "" +.SH "NAME" +\fBnpm-folders\fR \- Folder Structures Used by npm +.SH DESCRIPTION +.P +npm puts various things on your computer\. That's its job\. +.P +This document will tell you what it puts where\. +.SS tl;dr +.RS 0 +.IP \(bu 2 +Local install (default): puts stuff in \fB\|\./node_modules\fP of the current +package root\. +.IP \(bu 2 +Global install (with \fB\-g\fP): puts stuff in /usr/local or wherever node +is installed\. +.IP \(bu 2 +Install it \fBlocally\fR if you're going to \fBrequire()\fP it\. +.IP \(bu 2 +Install it \fBglobally\fR if you're going to run it on the command line\. +.IP \(bu 2 +If you need both, then install it in both places, or use \fBnpm link\fP\|\. + +.RE +.SS prefix Configuration +.P +The \fBprefix\fP config defaults to the location where node is installed\. +On most systems, this is \fB/usr/local\fP\|\. On windows, this is the exact +location of the node\.exe binary\. On Unix systems, it's one level up, +since node is typically installed at \fB{prefix}/bin/node\fP rather than +\fB{prefix}/node\.exe\fP\|\. +.P +When the \fBglobal\fP flag is set, npm installs things into this prefix\. +When it is not set, it uses the root of the current package, or the +current working directory if not in a package already\. +.SS Node Modules +.P +Packages are dropped into the \fBnode_modules\fP folder under the \fBprefix\fP\|\. +When installing locally, this means that you can +\fBrequire("packagename")\fP to load its main module, or +\fBrequire("packagename/lib/path/to/sub/module")\fP to load other modules\. +.P +Global installs on Unix systems go to \fB{prefix}/lib/node_modules\fP\|\. +Global installs on Windows go to \fB{prefix}/node_modules\fP (that is, no +\fBlib\fP folder\.) +.P +Scoped packages are installed the same way, except they are grouped together +in a sub\-folder of the relevant \fBnode_modules\fP folder with the name of that +scope prefix by the @ symbol, e\.g\. \fBnpm install @myorg/package\fP would place +the package in \fB{prefix}/node_modules/@myorg/package\fP\|\. See npm help 7 \fBscope\fP for +more details\. +.P +If you wish to \fBrequire()\fP a package, then install it locally\. +.SS Executables +.P +When in global mode, executables are linked into \fB{prefix}/bin\fP on Unix, +or directly into \fB{prefix}\fP on Windows\. +.P +When in local mode, executables are linked into +\fB\|\./node_modules/\.bin\fP so that they can be made available to scripts run +through npm\. (For example, so that a test runner will be in the path +when you run \fBnpm test\fP\|\.) +.SS Man Pages +.P +When in global mode, man pages are linked into \fB{prefix}/share/man\fP\|\. +.P +When in local mode, man pages are not installed\. +.P +Man pages are not installed on Windows systems\. +.SS Cache +.P +See npm help \fBnpm\-cache\fP\|\. Cache files are stored in \fB~/\.npm\fP on Posix, or +\fB~/npm\-cache\fP on Windows\. +.P +This is controlled by the \fBcache\fP configuration param\. +.SS Temp Files +.P +Temporary files are stored by default in the folder specified by the +\fBtmp\fP config, which defaults to the TMPDIR, TMP, or TEMP environment +variables, or \fB/tmp\fP on Unix and \fBc:\\windows\\temp\fP on Windows\. +.P +Temp files are given a unique folder under this root for each run of the +program, and are deleted upon successful exit\. +.SH More Information +.P +When installing locally, npm first tries to find an appropriate +\fBprefix\fP folder\. This is so that \fBnpm install foo@1\.2\.3\fP will install +to the sensible root of your package, even if you happen to have \fBcd\fPed +into some other folder\. +.P +Starting at the $PWD, npm will walk up the folder tree checking for a +folder that contains either a \fBpackage\.json\fP file, or a \fBnode_modules\fP +folder\. If such a thing is found, then that is treated as the effective +"current directory" for the purpose of running npm commands\. (This +behavior is inspired by and similar to git's \.git\-folder seeking +logic when running git commands in a working dir\.) +.P +If no package root is found, then the current folder is used\. +.P +When you run \fBnpm install foo@1\.2\.3\fP, then the package is loaded into +the cache, and then unpacked into \fB\|\./node_modules/foo\fP\|\. Then, any of +foo's dependencies are similarly unpacked into +\fB\|\./node_modules/foo/node_modules/\.\.\.\fP\|\. +.P +Any bin files are symlinked to \fB\|\./node_modules/\.bin/\fP, so that they may +be found by npm scripts when necessary\. +.SS Global Installation +.P +If the \fBglobal\fP configuration is set to true, then npm will +install packages "globally"\. +.P +For global installation, packages are installed roughly the same way, +but using the folders described above\. +.SS Cycles, Conflicts, and Folder Parsimony +.P +Cycles are handled using the property of node's module system that it +walks up the directories looking for \fBnode_modules\fP folders\. So, at every +stage, if a package is already installed in an ancestor \fBnode_modules\fP +folder, then it is not installed at the current location\. +.P +Consider the case above, where \fBfoo \-> bar \-> baz\fP\|\. Imagine if, in +addition to that, baz depended on bar, so you'd have: +\fBfoo \-> bar \-> baz \-> bar \-> baz \.\.\.\fP\|\. However, since the folder +structure is: \fBfoo/node_modules/bar/node_modules/baz\fP, there's no need to +put another copy of bar into \fB\|\.\.\./baz/node_modules\fP, since when it calls +require("bar"), it will get the copy that is installed in +\fBfoo/node_modules/bar\fP\|\. +.P +This shortcut is only used if the exact same +version would be installed in multiple nested \fBnode_modules\fP folders\. It +is still possible to have \fBa/node_modules/b/node_modules/a\fP if the two +"a" packages are different versions\. However, without repeating the +exact same package multiple times, an infinite regress will always be +prevented\. +.P +Another optimization can be made by installing dependencies at the +highest level possible, below the localized "target" folder\. +.SS Example +.P +Consider this dependency graph: +.P +.RS 2 +.nf +foo ++\-\- blerg@1\.2\.5 ++\-\- bar@1\.2\.3 +| +\-\- blerg@1\.x (latest=1\.3\.7) +| +\-\- baz@2\.x +| | `\-\- quux@3\.x +| | `\-\- bar@1\.2\.3 (cycle) +| `\-\- asdf@* +`\-\- baz@1\.2\.3 + `\-\- quux@3\.x + `\-\- bar +.fi +.RE +.P +In this case, we might expect a folder structure like this: +.P +.RS 2 +.nf +foo ++\-\- node_modules + +\-\- blerg (1\.2\.5) <\-\-\-[A] + +\-\- bar (1\.2\.3) <\-\-\-[B] + | `\-\- node_modules + | +\-\- baz (2\.0\.2) <\-\-\-[C] + | | `\-\- node_modules + | | `\-\- quux (3\.2\.0) + | `\-\- asdf (2\.3\.4) + `\-\- baz (1\.2\.3) <\-\-\-[D] + `\-\- node_modules + `\-\- quux (3\.2\.0) <\-\-\-[E] +.fi +.RE +.P +Since foo depends directly on \fBbar@1\.2\.3\fP and \fBbaz@1\.2\.3\fP, those are +installed in foo's \fBnode_modules\fP folder\. +.P +Even though the latest copy of blerg is 1\.3\.7, foo has a specific +dependency on version 1\.2\.5\. So, that gets installed at [A]\. Since the +parent installation of blerg satisfies bar's dependency on \fBblerg@1\.x\fP, +it does not install another copy under [B]\. +.P +Bar [B] also has dependencies on baz and asdf, so those are installed in +bar's \fBnode_modules\fP folder\. Because it depends on \fBbaz@2\.x\fP, it cannot +re\-use the \fBbaz@1\.2\.3\fP installed in the parent \fBnode_modules\fP folder [D], +and must install its own copy [C]\. +.P +Underneath bar, the \fBbaz \-> quux \-> bar\fP dependency creates a cycle\. +However, because bar is already in quux's ancestry [B], it does not +unpack another copy of bar into that folder\. +.P +Underneath \fBfoo \-> baz\fP [D], quux's [E] folder tree is empty, because its +dependency on bar is satisfied by the parent folder copy installed at [B]\. +.P +For a graphical breakdown of what is installed where, use \fBnpm ls\fP\|\. +.SS Publishing +.P +Upon publishing, npm will look in the \fBnode_modules\fP folder\. If any of +the items there are not in the \fBbundledDependencies\fP array, then they will +not be included in the package tarball\. +.P +This allows a package maintainer to install all of their dependencies +(and dev dependencies) locally, but only re\-publish those items that +cannot be found elsewhere\. See npm help 5 \fBpackage\.json\fP for more information\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help 7 faq +.IP \(bu 2 +npm help 5 package\.json +.IP \(bu 2 +npm help install +.IP \(bu 2 +npm help pack +.IP \(bu 2 +npm help cache +.IP \(bu 2 +npm help config +.IP \(bu 2 +npm help 5 npmrc +.IP \(bu 2 +npm help 7 config +.IP \(bu 2 +npm help publish + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man5/npm-json.5 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man5/npm-json.5 new file mode 100644 index 00000000..01c1178e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man5/npm-json.5 @@ -0,0 +1,923 @@ +.TH "PACKAGE\.JSON" "5" "October 2016" "" "" +.SH "NAME" +\fBpackage.json\fR \- Specifics of npm's package\.json handling +.SH DESCRIPTION +.P +This document is all you need to know about what's required in your package\.json +file\. It must be actual JSON, not just a JavaScript object literal\. +.P +A lot of the behavior described in this document is affected by the config +settings described in npm help 7 \fBnpm\-config\fP\|\. +.SH name +.P +The \fImost\fR important things in your package\.json are the name and version fields\. +Those are actually required, and your package won't install without +them\. The name and version together form an identifier that is assumed +to be completely unique\. Changes to the package should come along with +changes to the version\. +.P +The name is what your thing is called\. +.P +Some rules: +.RS 0 +.IP \(bu 2 +The name must be less than or equal to 214 characters\. This includes the scope for +scoped packages\. +.IP \(bu 2 +The name can't start with a dot or an underscore\. +.IP \(bu 2 +New packages must not have uppercase letters in the name\. +.IP \(bu 2 +The name ends up being part of a URL, an argument on the command line, and a +folder name\. Therefore, the name can't contain any non\-URL\-safe characters\. + +.RE +.P +Some tips: +.RS 0 +.IP \(bu 2 +Don't use the same name as a core Node module\. +.IP \(bu 2 +Don't put "js" or "node" in the name\. It's assumed that it's js, since you're +writing a package\.json file, and you can specify the engine using the "engines" +field\. (See below\.) +.IP \(bu 2 +The name will probably be passed as an argument to require(), so it should +be something short, but also reasonably descriptive\. +.IP \(bu 2 +You may want to check the npm registry to see if there's something by that name +already, before you get too attached to it\. https://www\.npmjs\.com/ + +.RE +.P +A name can be optionally prefixed by a scope, e\.g\. \fB@myorg/mypackage\fP\|\. See +npm help 7 \fBnpm\-scope\fP for more detail\. +.SH version +.P +The \fImost\fR important things in your package\.json are the name and version fields\. +Those are actually required, and your package won't install without +them\. The name and version together form an identifier that is assumed +to be completely unique\. Changes to the package should come along with +changes to the version\. +.P +Version must be parseable by +node\-semver \fIhttps://github\.com/isaacs/node\-semver\fR, which is bundled +with npm as a dependency\. (\fBnpm install semver\fP to use it yourself\.) +.P +More on version numbers and ranges at npm help 7 semver\. +.SH description +.P +Put a description in it\. It's a string\. This helps people discover your +package, as it's listed in \fBnpm search\fP\|\. +.SH keywords +.P +Put keywords in it\. It's an array of strings\. This helps people +discover your package as it's listed in \fBnpm search\fP\|\. +.SH homepage +.P +The url to the project homepage\. +.P +\fBNOTE\fR: This is \fInot\fR the same as "url"\. If you put a "url" field, +then the registry will think it's a redirection to your package that has +been published somewhere else, and spit at you\. +.P +Literally\. Spit\. I'm so not kidding\. +.SH bugs +.P +The url to your project's issue tracker and / or the email address to which +issues should be reported\. These are helpful for people who encounter issues +with your package\. +.P +It should look like this: +.P +.RS 2 +.nf +{ "url" : "https://github\.com/owner/project/issues" +, "email" : "project@hostname\.com" +} +.fi +.RE +.P +You can specify either one or both values\. If you want to provide only a url, +you can specify the value for "bugs" as a simple string instead of an object\. +.P +If a url is provided, it will be used by the \fBnpm bugs\fP command\. +.SH license +.P +You should specify a license for your package so that people know how they are +permitted to use it, and any restrictions you're placing on it\. +.P +If you're using a common license such as BSD\-2\-Clause or MIT, add a +current SPDX license identifier for the license you're using, like this: +.P +.RS 2 +.nf +{ "license" : "BSD\-3\-Clause" } +.fi +.RE +.P +You can check the full list of SPDX license IDs \fIhttps://spdx\.org/licenses/\fR\|\. +Ideally you should pick one that is +OSI \fIhttps://opensource\.org/licenses/alphabetical\fR approved\. +.P +If your package is licensed under multiple common licenses, use an SPDX license +expression syntax version 2\.0 string \fIhttps://npmjs\.com/package/spdx\fR, like this: +.P +.RS 2 +.nf +{ "license" : "(ISC OR GPL\-3\.0)" } +.fi +.RE +.P +If you are using a license that hasn't been assigned an SPDX identifier, or if +you are using a custom license, use a string value like this one: +.P +.RS 2 +.nf +{ "license" : "SEE LICENSE IN " } +.fi +.RE +.P +Then include a file named \fB\fP at the top level of the package\. +.P +Some old packages used license objects or a "licenses" property containing an +array of license objects: +.P +.RS 2 +.nf +// Not valid metadata +{ "license" : + { "type" : "ISC" + , "url" : "http://opensource\.org/licenses/ISC" + } +} + +// Not valid metadata +{ "licenses" : + [ + { "type": "MIT" + , "url": "http://www\.opensource\.org/licenses/mit\-license\.php" + } + , { "type": "Apache\-2\.0" + , "url": "http://opensource\.org/licenses/apache2\.0\.php" + } + ] +} +.fi +.RE +.P +Those styles are now deprecated\. Instead, use SPDX expressions, like this: +.P +.RS 2 +.nf +{ "license": "ISC" } + +{ "license": "(MIT OR Apache\-2\.0)" } +.fi +.RE +.P +Finally, if you do not wish to grant others the right to use a private or +unpublished package under any terms: +.P +.RS 2 +.nf +{ "license": "UNLICENSED"} +.fi +.RE +.P +Consider also setting \fB"private": true\fP to prevent accidental publication\. +.SH people fields: author, contributors +.P +The "author" is one person\. "contributors" is an array of people\. A "person" +is an object with a "name" field and optionally "url" and "email", like this: +.P +.RS 2 +.nf +{ "name" : "Barney Rubble" +, "email" : "b@rubble\.com" +, "url" : "http://barnyrubble\.tumblr\.com/" +} +.fi +.RE +.P +Or you can shorten that all into a single string, and npm will parse it for you: +.P +.RS 2 +.nf +"Barney Rubble (http://barnyrubble\.tumblr\.com/)" +.fi +.RE +.P +Both email and url are optional either way\. +.P +npm also sets a top\-level "maintainers" field with your npm user info\. +.SH files +.P +The "files" field is an array of files to include in your project\. If +you name a folder in the array, then it will also include the files +inside that folder\. (Unless they would be ignored by another rule\.) +.P +You can also provide a "\.npmignore" file in the root of your package or +in subdirectories, which will keep files from being included, even +if they would be picked up by the files array\. The \fB\|\.npmignore\fP file +works just like a \fB\|\.gitignore\fP\|\. +.P +Certain files are always included, regardless of settings: +.RS 0 +.IP \(bu 2 +\fBpackage\.json\fP +.IP \(bu 2 +\fBREADME\fP +.IP \(bu 2 +\fBCHANGES\fP / \fBCHANGELOG\fP / \fBHISTORY\fP (any casing and file extension) +.IP \(bu 2 +\fBLICENSE\fP / \fBLICENCE\fP +.IP \(bu 2 +The file in the "main" field + +.RE +.P +Conversely, some files are always ignored: +.RS 0 +.IP \(bu 2 +\fB\|\.git\fP +.IP \(bu 2 +\fBCVS\fP +.IP \(bu 2 +\fB\|\.svn\fP +.IP \(bu 2 +\fB\|\.hg\fP +.IP \(bu 2 +\fB\|\.lock\-wscript\fP +.IP \(bu 2 +\fB\|\.wafpickle\-N\fP +.IP \(bu 2 +\fB\|\.*\.swp\fP +.IP \(bu 2 +\fB\|\.DS_Store\fP +.IP \(bu 2 +\fB\|\._*\fP +.IP \(bu 2 +\fBnpm\-debug\.log\fP +.IP \(bu 2 +\fB\|\.npmrc\fP +.IP \(bu 2 +\fBnode_modules\fP + +.RE +.SH main +.P +The main field is a module ID that is the primary entry point to your program\. +That is, if your package is named \fBfoo\fP, and a user installs it, and then does +\fBrequire("foo")\fP, then your main module's exports object will be returned\. +.P +This should be a module ID relative to the root of your package folder\. +.P +For most modules, it makes the most sense to have a main script and often not +much else\. +.SH bin +.P +A lot of packages have one or more executable files that they'd like to +install into the PATH\. npm makes this pretty easy (in fact, it uses this +feature to install the "npm" executable\.) +.P +To use this, supply a \fBbin\fP field in your package\.json which is a map of +command name to local file name\. On install, npm will symlink that file into +\fBprefix/bin\fP for global installs, or \fB\|\./node_modules/\.bin/\fP for local +installs\. +.P +For example, myapp could have this: +.P +.RS 2 +.nf +{ "bin" : { "myapp" : "\./cli\.js" } } +.fi +.RE +.P +So, when you install myapp, it'll create a symlink from the \fBcli\.js\fP script to +\fB/usr/local/bin/myapp\fP\|\. +.P +If you have a single executable, and its name should be the name +of the package, then you can just supply it as a string\. For example: +.P +.RS 2 +.nf +{ "name": "my\-program" +, "version": "1\.2\.5" +, "bin": "\./path/to/program" } +.fi +.RE +.P +would be the same as this: +.P +.RS 2 +.nf +{ "name": "my\-program" +, "version": "1\.2\.5" +, "bin" : { "my\-program" : "\./path/to/program" } } +.fi +.RE +.P +Please make sure that your file(s) referenced in \fBbin\fP starts with +\fB#!/usr/bin/env node\fP, otherwise the scripts are started without the node +executable! +.SH man +.P +Specify either a single file or an array of filenames to put in place for the +\fBman\fP program to find\. +.P +If only a single file is provided, then it's installed such that it is the +result from \fBman \fP, regardless of its actual filename\. For example: +.P +.RS 2 +.nf +{ "name" : "foo" +, "version" : "1\.2\.3" +, "description" : "A packaged foo fooer for fooing foos" +, "main" : "foo\.js" +, "man" : "\./man/doc\.1" +} +.fi +.RE +.P +would link the \fB\|\./man/doc\.1\fP file in such that it is the target for \fBman foo\fP +.P +If the filename doesn't start with the package name, then it's prefixed\. +So, this: +.P +.RS 2 +.nf +{ "name" : "foo" +, "version" : "1\.2\.3" +, "description" : "A packaged foo fooer for fooing foos" +, "main" : "foo\.js" +, "man" : [ "\./man/foo\.1", "\./man/bar\.1" ] +} +.fi +.RE +.P +will create files to do \fBman foo\fP and \fBman foo\-bar\fP\|\. +.P +Man files must end with a number, and optionally a \fB\|\.gz\fP suffix if they are +compressed\. The number dictates which man section the file is installed into\. +.P +.RS 2 +.nf +{ "name" : "foo" +, "version" : "1\.2\.3" +, "description" : "A packaged foo fooer for fooing foos" +, "main" : "foo\.js" +, "man" : [ "\./man/foo\.1", "\./man/foo\.2" ] +} +.fi +.RE +.P +will create entries for \fBman foo\fP and \fBman 2 foo\fP +.SH directories +.P +The CommonJS Packages \fIhttp://wiki\.commonjs\.org/wiki/Packages/1\.0\fR spec details a +few ways that you can indicate the structure of your package using a \fBdirectories\fP +object\. If you look at npm's package\.json \fIhttps://registry\.npmjs\.org/npm/latest\fR, +you'll see that it has directories for doc, lib, and man\. +.P +In the future, this information may be used in other creative ways\. +.SS directories\.lib +.P +Tell people where the bulk of your library is\. Nothing special is done +with the lib folder in any way, but it's useful meta info\. +.SS directories\.bin +.P +If you specify a \fBbin\fP directory in \fBdirectories\.bin\fP, all the files in +that folder will be added\. +.P +Because of the way the \fBbin\fP directive works, specifying both a +\fBbin\fP path and setting \fBdirectories\.bin\fP is an error\. If you want to +specify individual files, use \fBbin\fP, and for all the files in an +existing \fBbin\fP directory, use \fBdirectories\.bin\fP\|\. +.SS directories\.man +.P +A folder that is full of man pages\. Sugar to generate a "man" array by +walking the folder\. +.SS directories\.doc +.P +Put markdown files in here\. Eventually, these will be displayed nicely, +maybe, someday\. +.SS directories\.example +.P +Put example scripts in here\. Someday, it might be exposed in some clever way\. +.SS directories\.test +.P +Put your tests in here\. It is currently not exposed, but it might be in the +future\. +.SH repository +.P +Specify the place where your code lives\. This is helpful for people who +want to contribute\. If the git repo is on GitHub, then the \fBnpm docs\fP +command will be able to find you\. +.P +Do it like this: +.P +.RS 2 +.nf +"repository" : + { "type" : "git" + , "url" : "https://github\.com/npm/npm\.git" + } + +"repository" : + { "type" : "svn" + , "url" : "https://v8\.googlecode\.com/svn/trunk/" + } +.fi +.RE +.P +The URL should be a publicly available (perhaps read\-only) url that can be handed +directly to a VCS program without any modification\. It should not be a url to an +html project page that you put in your browser\. It's for computers\. +.P +For GitHub, GitHub gist, Bitbucket, or GitLab repositories you can use the same +shortcut syntax you use for \fBnpm install\fP: +.P +.RS 2 +.nf +"repository": "npm/npm" + +"repository": "gist:11081aaa281" + +"repository": "bitbucket:example/repo" + +"repository": "gitlab:another/repo" +.fi +.RE +.SH scripts +.P +The "scripts" property is a dictionary containing script commands that are run +at various times in the lifecycle of your package\. The key is the lifecycle +event, and the value is the command to run at that point\. +.P +See npm help 7 \fBnpm\-scripts\fP to find out more about writing package scripts\. +.SH config +.P +A "config" object can be used to set configuration parameters used in package +scripts that persist across upgrades\. For instance, if a package had the +following: +.P +.RS 2 +.nf +{ "name" : "foo" +, "config" : { "port" : "8080" } } +.fi +.RE +.P +and then had a "start" command that then referenced the +\fBnpm_package_config_port\fP environment variable, then the user could +override that by doing \fBnpm config set foo:port 8001\fP\|\. +.P +See npm help 7 \fBnpm\-config\fP and npm help 7 \fBnpm\-scripts\fP for more on package +configs\. +.SH dependencies +.P +Dependencies are specified in a simple object that maps a package name to a +version range\. The version range is a string which has one or more +space\-separated descriptors\. Dependencies can also be identified with a +tarball or git URL\. +.P +\fBPlease do not put test harnesses or transpilers in your +\fBdependencies\fP object\.\fR See \fBdevDependencies\fP, below\. +.P +See npm help 7 semver for more details about specifying version ranges\. +.RS 0 +.IP \(bu 2 +\fBversion\fP Must match \fBversion\fP exactly +.IP \(bu 2 +\fB>version\fP Must be greater than \fBversion\fP +.IP \(bu 2 +\fB>=version\fP etc +.IP \(bu 2 +\fB=version1 <=version2\fP\|\. +.IP \(bu 2 +\fBrange1 || range2\fP Passes if either range1 or range2 are satisfied\. +.IP \(bu 2 +\fBgit\.\.\.\fP See 'Git URLs as Dependencies' below +.IP \(bu 2 +\fBuser/repo\fP See 'GitHub URLs' below +.IP \(bu 2 +\fBtag\fP A specific version tagged and published as \fBtag\fP See npm help \fBnpm\-tag\fP +.IP \(bu 2 +\fBpath/path/path\fP See Local Paths \fI#local\-paths\fR below + +.RE +.P +For example, these are all valid: +.P +.RS 2 +.nf +{ "dependencies" : + { "foo" : "1\.0\.0 \- 2\.9999\.9999" + , "bar" : ">=1\.0\.2 <2\.1\.2" + , "baz" : ">1\.0\.2 <=2\.3\.4" + , "boo" : "2\.0\.1" + , "qux" : "<1\.0\.0 || >=2\.3\.1 <2\.4\.5 || >=2\.5\.2 <3\.0\.0" + , "asd" : "http://asdf\.com/asdf\.tar\.gz" + , "til" : "~1\.2" + , "elf" : "~1\.2\.3" + , "two" : "2\.x" + , "thr" : "3\.3\.x" + , "lat" : "latest" + , "dyl" : "file:\.\./dyl" + } +} +.fi +.RE +.SS URLs as Dependencies +.P +You may specify a tarball URL in place of a version range\. +.P +This tarball will be downloaded and installed locally to your package at +install time\. +.SS Git URLs as Dependencies +.P +Git urls can be of the form: +.P +.RS 2 +.nf +git://github\.com/user/project\.git#commit\-ish +git+ssh://user@hostname:project\.git#commit\-ish +git+ssh://user@hostname/project\.git#commit\-ish +git+http://user@hostname/project/blah\.git#commit\-ish +git+https://user@hostname/project/blah\.git#commit\-ish +.fi +.RE +.P +The \fBcommit\-ish\fP can be any tag, sha, or branch which can be supplied as +an argument to \fBgit checkout\fP\|\. The default is \fBmaster\fP\|\. +.SH GitHub URLs +.P +As of version 1\.1\.65, you can refer to GitHub urls as just "foo": +"user/foo\-project"\. Just as with git URLs, a \fBcommit\-ish\fP suffix can be +included\. For example: +.P +.RS 2 +.nf +{ + "name": "foo", + "version": "0\.0\.0", + "dependencies": { + "express": "visionmedia/express", + "mocha": "visionmedia/mocha#4727d357ea" + } +} +.fi +.RE +.SH Local Paths +.P +As of version 2\.0\.0 you can provide a path to a local directory that contains a +package\. Local paths can be saved using \fBnpm install \-\-save\fP, using any of +these forms: +.P +.RS 2 +.nf +\|\.\./foo/bar +~/foo/bar +\|\./foo/bar +/foo/bar +.fi +.RE +.P +in which case they will be normalized to a relative path and added to your +\fBpackage\.json\fP\|\. For example: +.P +.RS 2 +.nf +{ + "name": "baz", + "dependencies": { + "bar": "file:\.\./foo/bar" + } +} +.fi +.RE +.P +This feature is helpful for local offline development and creating +tests that require npm installing where you don't want to hit an +external server, but should not be used when publishing packages +to the public registry\. +.SH devDependencies +.P +If someone is planning on downloading and using your module in their +program, then they probably don't want or need to download and build +the external test or documentation framework that you use\. +.P +In this case, it's best to map these additional items in a \fBdevDependencies\fP +object\. +.P +These things will be installed when doing \fBnpm link\fP or \fBnpm install\fP +from the root of a package, and can be managed like any other npm +configuration param\. See npm help 7 \fBnpm\-config\fP for more on the topic\. +.P +For build steps that are not platform\-specific, such as compiling +CoffeeScript or other languages to JavaScript, use the \fBprepublish\fP +script to do this, and make the required package a devDependency\. +.P +For example: +.P +.RS 2 +.nf +{ "name": "ethopia\-waza", + "description": "a delightfully fruity coffee varietal", + "version": "1\.2\.3", + "devDependencies": { + "coffee\-script": "~1\.6\.3" + }, + "scripts": { + "prepublish": "coffee \-o lib/ \-c src/waza\.coffee" + }, + "main": "lib/waza\.js" +} +.fi +.RE +.P +The \fBprepublish\fP script will be run before publishing, so that users +can consume the functionality without requiring them to compile it +themselves\. In dev mode (ie, locally running \fBnpm install\fP), it'll +run this script as well, so that you can test it easily\. +.SH peerDependencies +.P +In some cases, you want to express the compatibility of your package with a +host tool or library, while not necessarily doing a \fBrequire\fP of this host\. +This is usually referred to as a \fIplugin\fR\|\. Notably, your module may be exposing +a specific interface, expected and specified by the host documentation\. +.P +For example: +.P +.RS 2 +.nf +{ + "name": "tea\-latte", + "version": "1\.3\.5", + "peerDependencies": { + "tea": "2\.x" + } +} +.fi +.RE +.P +This ensures your package \fBtea\-latte\fP can be installed \fIalong\fR with the second +major version of the host package \fBtea\fP only\. \fBnpm install tea\-latte\fP could +possibly yield the following dependency graph: +.P +.RS 2 +.nf +├── tea\-latte@1\.3\.5 +└── tea@2\.2\.0 +.fi +.RE +.P +\fBNOTE: npm versions 1 and 2 will automatically install \fBpeerDependencies\fP if +they are not explicitly depended upon higher in the dependency tree\. In the +next major version of npm (npm@3), this will no longer be the case\. You will +receive a warning that the peerDependency is not installed instead\.\fR The +behavior in npms 1 & 2 was frequently confusing and could easily put you into +dependency hell, a situation that npm is designed to avoid as much as possible\. +.P +Trying to install another plugin with a conflicting requirement will cause an +error\. For this reason, make sure your plugin requirement is as broad as +possible, and not to lock it down to specific patch versions\. +.P +Assuming the host complies with semver \fIhttp://semver\.org/\fR, only changes in +the host package's major version will break your plugin\. Thus, if you've worked +with every 1\.x version of the host package, use \fB"^1\.0"\fP or \fB"1\.x"\fP to express +this\. If you depend on features introduced in 1\.5\.2, use \fB">= 1\.5\.2 < 2"\fP\|\. +.SH bundledDependencies +.P +This defines an array of package names that will be bundled when publishing the package\. +.P +In cases where you need to preserve npm packages locally or have them available through a single file download, you can bundle the packages in a tarball file by specifying the package names in the \fBbundledDependencies\fP array and executing \fBnpm pack\fP\|\. +.P +For example: +If we define a package\.json like this: +.P +.RS 2 +.nf +{ + "name": "awesome\-web\-framework", + "version": "1\.0\.0", + "bundledDependencies": [ + 'renderized', 'super\-streams' + ] +} +.fi +.RE +.P +we can obtain \fBawesome\-web\-framework\-1\.0\.0\.tgz\fP file by running \fBnpm pack\fP\|\. This file contains the dependencies \fBrenderized\fP and \fBsuper\-streams\fP which can be installed in a new project by executing \fBnpm install awesome\-web\-framework\-1\.0\.0\.tgz\fP\|\. +.P +If this is spelled \fB"bundleDependencies"\fP, then that is also honored\. +.SH optionalDependencies +.P +If a dependency can be used, but you would like npm to proceed if it cannot be +found or fails to install, then you may put it in the \fBoptionalDependencies\fP +object\. This is a map of package name to version or url, just like the +\fBdependencies\fP object\. The difference is that build failures do not cause +installation to fail\. +.P +It is still your program's responsibility to handle the lack of the +dependency\. For example, something like this: +.P +.RS 2 +.nf +try { + var foo = require('foo') + var fooVersion = require('foo/package\.json')\.version +} catch (er) { + foo = null +} +if ( notGoodFooVersion(fooVersion) ) { + foo = null +} + +// \.\. then later in your program \.\. + +if (foo) { + foo\.doFooThings() +} +.fi +.RE +.P +Entries in \fBoptionalDependencies\fP will override entries of the same name in +\fBdependencies\fP, so it's usually best to only put in one place\. +.SH engines +.P +You can specify the version of node that your stuff works on: +.P +.RS 2 +.nf +{ "engines" : { "node" : ">=0\.10\.3 <0\.12" } } +.fi +.RE +.P +And, like with dependencies, if you don't specify the version (or if you +specify "*" as the version), then any version of node will do\. +.P +If you specify an "engines" field, then npm will require that "node" be +somewhere on that list\. If "engines" is omitted, then npm will just assume +that it works on node\. +.P +You can also use the "engines" field to specify which versions of npm +are capable of properly installing your program\. For example: +.P +.RS 2 +.nf +{ "engines" : { "npm" : "~1\.0\.20" } } +.fi +.RE +.P +Unless the user has set the \fBengine\-strict\fP config flag, this +field is advisory only will produce warnings when your package is installed as a dependency\. +.SH engineStrict +.P +\fBNOTE: This feature is deprecated and will be removed in npm 3\.0\.0\.\fR +.P +If you are sure that your module will \fIdefinitely not\fR run properly on +versions of Node/npm other than those specified in the \fBengines\fP object, +then you can set \fB"engineStrict": true\fP in your package\.json file\. +This will override the user's \fBengine\-strict\fP config setting\. +.P +Please do not do this unless you are really very very sure\. If your +engines object is something overly restrictive, you can quite easily and +inadvertently lock yourself into obscurity and prevent your users from +updating to new versions of Node\. Consider this choice carefully\. +.SH os +.P +You can specify which operating systems your +module will run on: +.P +.RS 2 +.nf +"os" : [ "darwin", "linux" ] +.fi +.RE +.P +You can also blacklist instead of whitelist operating systems, +just prepend the blacklisted os with a '!': +.P +.RS 2 +.nf +"os" : [ "!win32" ] +.fi +.RE +.P +The host operating system is determined by \fBprocess\.platform\fP +.P +It is allowed to both blacklist, and whitelist, although there isn't any +good reason to do this\. +.SH cpu +.P +If your code only runs on certain cpu architectures, +you can specify which ones\. +.P +.RS 2 +.nf +"cpu" : [ "x64", "ia32" ] +.fi +.RE +.P +Like the \fBos\fP option, you can also blacklist architectures: +.P +.RS 2 +.nf +"cpu" : [ "!arm", "!mips" ] +.fi +.RE +.P +The host architecture is determined by \fBprocess\.arch\fP +.SH preferGlobal +.P +If your package is primarily a command\-line application that should be +installed globally, then set this value to \fBtrue\fP to provide a warning +if it is installed locally\. +.P +It doesn't actually prevent users from installing it locally, but it +does help prevent some confusion if it doesn't work as expected\. +.SH private +.P +If you set \fB"private": true\fP in your package\.json, then npm will refuse +to publish it\. +.P +This is a way to prevent accidental publication of private repositories\. If +you would like to ensure that a given package is only ever published to a +specific registry (for example, an internal registry), then use the +\fBpublishConfig\fP dictionary described below to override the \fBregistry\fP config +param at publish\-time\. +.SH publishConfig +.P +This is a set of config values that will be used at publish\-time\. It's +especially handy if you want to set the tag, registry or access, so that +you can ensure that a given package is not tagged with "latest", published +to the global public registry or that a scoped module is private by default\. +.P +Any config values can be overridden, but of course only "tag", "registry" and +"access" probably matter for the purposes of publishing\. +.P +See npm help 7 \fBnpm\-config\fP to see the list of config options that can be +overridden\. +.SH DEFAULT VALUES +.P +npm will default some values based on package contents\. +.RS 0 +.IP \(bu 2 +\fB"scripts": {"start": "node server\.js"}\fP +If there is a \fBserver\.js\fP file in the root of your package, then npm +will default the \fBstart\fP command to \fBnode server\.js\fP\|\. +.IP \(bu 2 +\fB"scripts":{"install": "node\-gyp rebuild"}\fP +If there is a \fBbinding\.gyp\fP file in the root of your package and you have not defined an \fBinstall\fP or \fBpreinstall\fP script, npm will +default the \fBinstall\fP command to compile using node\-gyp\. +.IP \(bu 2 +\fB"contributors": [\.\.\.]\fP +If there is an \fBAUTHORS\fP file in the root of your package, npm will +treat each line as a \fBName (url)\fP format, where email and url +are optional\. Lines which start with a \fB#\fP or are blank, will be +ignored\. + +.RE +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help 7 semver +.IP \(bu 2 +npm help init +.IP \(bu 2 +npm help version +.IP \(bu 2 +npm help config +.IP \(bu 2 +npm help 7 config +.IP \(bu 2 +npm help help +.IP \(bu 2 +npm help 7 faq +.IP \(bu 2 +npm help install +.IP \(bu 2 +npm help publish +.IP \(bu 2 +npm help uninstall + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man5/npmrc.5 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man5/npmrc.5 new file mode 100644 index 00000000..8d745e32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man5/npmrc.5 @@ -0,0 +1,114 @@ +.TH "NPMRC" "5" "October 2016" "" "" +.SH "NAME" +\fBnpmrc\fR \- The npm config files +.SH DESCRIPTION +.P +npm gets its config settings from the command line, environment +variables, and \fBnpmrc\fP files\. +.P +The \fBnpm config\fP command can be used to update and edit the contents +of the user and global npmrc files\. +.P +For a list of available configuration options, see npm help 7 config\. +.SH FILES +.P +The four relevant files are: +.RS 0 +.IP \(bu 2 +per\-project config file (/path/to/my/project/\.npmrc) +.IP \(bu 2 +per\-user config file (~/\.npmrc) +.IP \(bu 2 +global config file ($PREFIX/etc/npmrc) +.IP \(bu 2 +npm builtin config file (/path/to/npm/npmrc) + +.RE +.P +All npm config files are an ini\-formatted list of \fBkey = value\fP +parameters\. Environment variables can be replaced using +\fB${VARIABLE_NAME}\fP\|\. For example: +.P +.RS 2 +.nf +prefix = ${HOME}/\.npm\-packages +.fi +.RE +.P +Each of these files is loaded, and config options are resolved in +priority order\. For example, a setting in the userconfig file would +override the setting in the globalconfig file\. +.P +Array values are specified by adding "[]" after the key name\. For +example: +.P +.RS 2 +.nf +key[] = "first value" +key[] = "second value" +.fi +.RE +.P +\fBNOTE:\fR Because local (per\-project or per\-user) \fB\|\.npmrc\fP files can contain +sensitive credentials, they must be readable and writable \fIonly\fR by your user +account (i\.e\. must have a mode of \fB0600\fP), otherwise they \fIwill be ignored by +npm!\fR +.SS Comments +.P +Lines in \fB\|\.npmrc\fP files are interpreted as comments when they begin with a \fB;\fP or \fB#\fP character\. \fB\|\.npmrc\fP files are parsed by npm/ini \fIhttps://github\.com/npm/ini\fR, which specifies this comment syntax\. +.P +For example: +.P +.RS 2 +.nf +# last modified: 01 Jan 2016 +; Set a new registry for a scoped package +@myscope:registry=https://mycustomregistry\.example\.org +.fi +.RE +.SS Per\-project config file +.P +When working locally in a project, a \fB\|\.npmrc\fP file in the root of the +project (ie, a sibling of \fBnode_modules\fP and \fBpackage\.json\fP) will set +config values specific to this project\. +.P +Note that this only applies to the root of the project that you're +running npm in\. It has no effect when your module is published\. For +example, you can't publish a module that forces itself to install +globally, or in a different location\. +.P +Additionally, this file is not read in global mode, such as when running +\fBnpm install \-g\fP\|\. +.SS Per\-user config file +.P +\fB$HOME/\.npmrc\fP (or the \fBuserconfig\fP param, if set in the environment +or on the command line) +.SS Global config file +.P +\fB$PREFIX/etc/npmrc\fP (or the \fBglobalconfig\fP param, if set above): +This file is an ini\-file formatted list of \fBkey = value\fP parameters\. +Environment variables can be replaced as above\. +.SS Built\-in config file +.P +\fBpath/to/npm/itself/npmrc\fP +.P +This is an unchangeable "builtin" configuration file that npm keeps +consistent across updates\. Set fields in here using the \fB\|\./configure\fP +script that comes with npm\. This is primarily for distribution +maintainers to override default configs in a standard and consistent +manner\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help 5 folders +.IP \(bu 2 +npm help config +.IP \(bu 2 +npm help 7 config +.IP \(bu 2 +npm help 5 package\.json +.IP \(bu 2 +npm help npm + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man5/package.json.5 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man5/package.json.5 new file mode 100644 index 00000000..01c1178e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man5/package.json.5 @@ -0,0 +1,923 @@ +.TH "PACKAGE\.JSON" "5" "October 2016" "" "" +.SH "NAME" +\fBpackage.json\fR \- Specifics of npm's package\.json handling +.SH DESCRIPTION +.P +This document is all you need to know about what's required in your package\.json +file\. It must be actual JSON, not just a JavaScript object literal\. +.P +A lot of the behavior described in this document is affected by the config +settings described in npm help 7 \fBnpm\-config\fP\|\. +.SH name +.P +The \fImost\fR important things in your package\.json are the name and version fields\. +Those are actually required, and your package won't install without +them\. The name and version together form an identifier that is assumed +to be completely unique\. Changes to the package should come along with +changes to the version\. +.P +The name is what your thing is called\. +.P +Some rules: +.RS 0 +.IP \(bu 2 +The name must be less than or equal to 214 characters\. This includes the scope for +scoped packages\. +.IP \(bu 2 +The name can't start with a dot or an underscore\. +.IP \(bu 2 +New packages must not have uppercase letters in the name\. +.IP \(bu 2 +The name ends up being part of a URL, an argument on the command line, and a +folder name\. Therefore, the name can't contain any non\-URL\-safe characters\. + +.RE +.P +Some tips: +.RS 0 +.IP \(bu 2 +Don't use the same name as a core Node module\. +.IP \(bu 2 +Don't put "js" or "node" in the name\. It's assumed that it's js, since you're +writing a package\.json file, and you can specify the engine using the "engines" +field\. (See below\.) +.IP \(bu 2 +The name will probably be passed as an argument to require(), so it should +be something short, but also reasonably descriptive\. +.IP \(bu 2 +You may want to check the npm registry to see if there's something by that name +already, before you get too attached to it\. https://www\.npmjs\.com/ + +.RE +.P +A name can be optionally prefixed by a scope, e\.g\. \fB@myorg/mypackage\fP\|\. See +npm help 7 \fBnpm\-scope\fP for more detail\. +.SH version +.P +The \fImost\fR important things in your package\.json are the name and version fields\. +Those are actually required, and your package won't install without +them\. The name and version together form an identifier that is assumed +to be completely unique\. Changes to the package should come along with +changes to the version\. +.P +Version must be parseable by +node\-semver \fIhttps://github\.com/isaacs/node\-semver\fR, which is bundled +with npm as a dependency\. (\fBnpm install semver\fP to use it yourself\.) +.P +More on version numbers and ranges at npm help 7 semver\. +.SH description +.P +Put a description in it\. It's a string\. This helps people discover your +package, as it's listed in \fBnpm search\fP\|\. +.SH keywords +.P +Put keywords in it\. It's an array of strings\. This helps people +discover your package as it's listed in \fBnpm search\fP\|\. +.SH homepage +.P +The url to the project homepage\. +.P +\fBNOTE\fR: This is \fInot\fR the same as "url"\. If you put a "url" field, +then the registry will think it's a redirection to your package that has +been published somewhere else, and spit at you\. +.P +Literally\. Spit\. I'm so not kidding\. +.SH bugs +.P +The url to your project's issue tracker and / or the email address to which +issues should be reported\. These are helpful for people who encounter issues +with your package\. +.P +It should look like this: +.P +.RS 2 +.nf +{ "url" : "https://github\.com/owner/project/issues" +, "email" : "project@hostname\.com" +} +.fi +.RE +.P +You can specify either one or both values\. If you want to provide only a url, +you can specify the value for "bugs" as a simple string instead of an object\. +.P +If a url is provided, it will be used by the \fBnpm bugs\fP command\. +.SH license +.P +You should specify a license for your package so that people know how they are +permitted to use it, and any restrictions you're placing on it\. +.P +If you're using a common license such as BSD\-2\-Clause or MIT, add a +current SPDX license identifier for the license you're using, like this: +.P +.RS 2 +.nf +{ "license" : "BSD\-3\-Clause" } +.fi +.RE +.P +You can check the full list of SPDX license IDs \fIhttps://spdx\.org/licenses/\fR\|\. +Ideally you should pick one that is +OSI \fIhttps://opensource\.org/licenses/alphabetical\fR approved\. +.P +If your package is licensed under multiple common licenses, use an SPDX license +expression syntax version 2\.0 string \fIhttps://npmjs\.com/package/spdx\fR, like this: +.P +.RS 2 +.nf +{ "license" : "(ISC OR GPL\-3\.0)" } +.fi +.RE +.P +If you are using a license that hasn't been assigned an SPDX identifier, or if +you are using a custom license, use a string value like this one: +.P +.RS 2 +.nf +{ "license" : "SEE LICENSE IN " } +.fi +.RE +.P +Then include a file named \fB\fP at the top level of the package\. +.P +Some old packages used license objects or a "licenses" property containing an +array of license objects: +.P +.RS 2 +.nf +// Not valid metadata +{ "license" : + { "type" : "ISC" + , "url" : "http://opensource\.org/licenses/ISC" + } +} + +// Not valid metadata +{ "licenses" : + [ + { "type": "MIT" + , "url": "http://www\.opensource\.org/licenses/mit\-license\.php" + } + , { "type": "Apache\-2\.0" + , "url": "http://opensource\.org/licenses/apache2\.0\.php" + } + ] +} +.fi +.RE +.P +Those styles are now deprecated\. Instead, use SPDX expressions, like this: +.P +.RS 2 +.nf +{ "license": "ISC" } + +{ "license": "(MIT OR Apache\-2\.0)" } +.fi +.RE +.P +Finally, if you do not wish to grant others the right to use a private or +unpublished package under any terms: +.P +.RS 2 +.nf +{ "license": "UNLICENSED"} +.fi +.RE +.P +Consider also setting \fB"private": true\fP to prevent accidental publication\. +.SH people fields: author, contributors +.P +The "author" is one person\. "contributors" is an array of people\. A "person" +is an object with a "name" field and optionally "url" and "email", like this: +.P +.RS 2 +.nf +{ "name" : "Barney Rubble" +, "email" : "b@rubble\.com" +, "url" : "http://barnyrubble\.tumblr\.com/" +} +.fi +.RE +.P +Or you can shorten that all into a single string, and npm will parse it for you: +.P +.RS 2 +.nf +"Barney Rubble (http://barnyrubble\.tumblr\.com/)" +.fi +.RE +.P +Both email and url are optional either way\. +.P +npm also sets a top\-level "maintainers" field with your npm user info\. +.SH files +.P +The "files" field is an array of files to include in your project\. If +you name a folder in the array, then it will also include the files +inside that folder\. (Unless they would be ignored by another rule\.) +.P +You can also provide a "\.npmignore" file in the root of your package or +in subdirectories, which will keep files from being included, even +if they would be picked up by the files array\. The \fB\|\.npmignore\fP file +works just like a \fB\|\.gitignore\fP\|\. +.P +Certain files are always included, regardless of settings: +.RS 0 +.IP \(bu 2 +\fBpackage\.json\fP +.IP \(bu 2 +\fBREADME\fP +.IP \(bu 2 +\fBCHANGES\fP / \fBCHANGELOG\fP / \fBHISTORY\fP (any casing and file extension) +.IP \(bu 2 +\fBLICENSE\fP / \fBLICENCE\fP +.IP \(bu 2 +The file in the "main" field + +.RE +.P +Conversely, some files are always ignored: +.RS 0 +.IP \(bu 2 +\fB\|\.git\fP +.IP \(bu 2 +\fBCVS\fP +.IP \(bu 2 +\fB\|\.svn\fP +.IP \(bu 2 +\fB\|\.hg\fP +.IP \(bu 2 +\fB\|\.lock\-wscript\fP +.IP \(bu 2 +\fB\|\.wafpickle\-N\fP +.IP \(bu 2 +\fB\|\.*\.swp\fP +.IP \(bu 2 +\fB\|\.DS_Store\fP +.IP \(bu 2 +\fB\|\._*\fP +.IP \(bu 2 +\fBnpm\-debug\.log\fP +.IP \(bu 2 +\fB\|\.npmrc\fP +.IP \(bu 2 +\fBnode_modules\fP + +.RE +.SH main +.P +The main field is a module ID that is the primary entry point to your program\. +That is, if your package is named \fBfoo\fP, and a user installs it, and then does +\fBrequire("foo")\fP, then your main module's exports object will be returned\. +.P +This should be a module ID relative to the root of your package folder\. +.P +For most modules, it makes the most sense to have a main script and often not +much else\. +.SH bin +.P +A lot of packages have one or more executable files that they'd like to +install into the PATH\. npm makes this pretty easy (in fact, it uses this +feature to install the "npm" executable\.) +.P +To use this, supply a \fBbin\fP field in your package\.json which is a map of +command name to local file name\. On install, npm will symlink that file into +\fBprefix/bin\fP for global installs, or \fB\|\./node_modules/\.bin/\fP for local +installs\. +.P +For example, myapp could have this: +.P +.RS 2 +.nf +{ "bin" : { "myapp" : "\./cli\.js" } } +.fi +.RE +.P +So, when you install myapp, it'll create a symlink from the \fBcli\.js\fP script to +\fB/usr/local/bin/myapp\fP\|\. +.P +If you have a single executable, and its name should be the name +of the package, then you can just supply it as a string\. For example: +.P +.RS 2 +.nf +{ "name": "my\-program" +, "version": "1\.2\.5" +, "bin": "\./path/to/program" } +.fi +.RE +.P +would be the same as this: +.P +.RS 2 +.nf +{ "name": "my\-program" +, "version": "1\.2\.5" +, "bin" : { "my\-program" : "\./path/to/program" } } +.fi +.RE +.P +Please make sure that your file(s) referenced in \fBbin\fP starts with +\fB#!/usr/bin/env node\fP, otherwise the scripts are started without the node +executable! +.SH man +.P +Specify either a single file or an array of filenames to put in place for the +\fBman\fP program to find\. +.P +If only a single file is provided, then it's installed such that it is the +result from \fBman \fP, regardless of its actual filename\. For example: +.P +.RS 2 +.nf +{ "name" : "foo" +, "version" : "1\.2\.3" +, "description" : "A packaged foo fooer for fooing foos" +, "main" : "foo\.js" +, "man" : "\./man/doc\.1" +} +.fi +.RE +.P +would link the \fB\|\./man/doc\.1\fP file in such that it is the target for \fBman foo\fP +.P +If the filename doesn't start with the package name, then it's prefixed\. +So, this: +.P +.RS 2 +.nf +{ "name" : "foo" +, "version" : "1\.2\.3" +, "description" : "A packaged foo fooer for fooing foos" +, "main" : "foo\.js" +, "man" : [ "\./man/foo\.1", "\./man/bar\.1" ] +} +.fi +.RE +.P +will create files to do \fBman foo\fP and \fBman foo\-bar\fP\|\. +.P +Man files must end with a number, and optionally a \fB\|\.gz\fP suffix if they are +compressed\. The number dictates which man section the file is installed into\. +.P +.RS 2 +.nf +{ "name" : "foo" +, "version" : "1\.2\.3" +, "description" : "A packaged foo fooer for fooing foos" +, "main" : "foo\.js" +, "man" : [ "\./man/foo\.1", "\./man/foo\.2" ] +} +.fi +.RE +.P +will create entries for \fBman foo\fP and \fBman 2 foo\fP +.SH directories +.P +The CommonJS Packages \fIhttp://wiki\.commonjs\.org/wiki/Packages/1\.0\fR spec details a +few ways that you can indicate the structure of your package using a \fBdirectories\fP +object\. If you look at npm's package\.json \fIhttps://registry\.npmjs\.org/npm/latest\fR, +you'll see that it has directories for doc, lib, and man\. +.P +In the future, this information may be used in other creative ways\. +.SS directories\.lib +.P +Tell people where the bulk of your library is\. Nothing special is done +with the lib folder in any way, but it's useful meta info\. +.SS directories\.bin +.P +If you specify a \fBbin\fP directory in \fBdirectories\.bin\fP, all the files in +that folder will be added\. +.P +Because of the way the \fBbin\fP directive works, specifying both a +\fBbin\fP path and setting \fBdirectories\.bin\fP is an error\. If you want to +specify individual files, use \fBbin\fP, and for all the files in an +existing \fBbin\fP directory, use \fBdirectories\.bin\fP\|\. +.SS directories\.man +.P +A folder that is full of man pages\. Sugar to generate a "man" array by +walking the folder\. +.SS directories\.doc +.P +Put markdown files in here\. Eventually, these will be displayed nicely, +maybe, someday\. +.SS directories\.example +.P +Put example scripts in here\. Someday, it might be exposed in some clever way\. +.SS directories\.test +.P +Put your tests in here\. It is currently not exposed, but it might be in the +future\. +.SH repository +.P +Specify the place where your code lives\. This is helpful for people who +want to contribute\. If the git repo is on GitHub, then the \fBnpm docs\fP +command will be able to find you\. +.P +Do it like this: +.P +.RS 2 +.nf +"repository" : + { "type" : "git" + , "url" : "https://github\.com/npm/npm\.git" + } + +"repository" : + { "type" : "svn" + , "url" : "https://v8\.googlecode\.com/svn/trunk/" + } +.fi +.RE +.P +The URL should be a publicly available (perhaps read\-only) url that can be handed +directly to a VCS program without any modification\. It should not be a url to an +html project page that you put in your browser\. It's for computers\. +.P +For GitHub, GitHub gist, Bitbucket, or GitLab repositories you can use the same +shortcut syntax you use for \fBnpm install\fP: +.P +.RS 2 +.nf +"repository": "npm/npm" + +"repository": "gist:11081aaa281" + +"repository": "bitbucket:example/repo" + +"repository": "gitlab:another/repo" +.fi +.RE +.SH scripts +.P +The "scripts" property is a dictionary containing script commands that are run +at various times in the lifecycle of your package\. The key is the lifecycle +event, and the value is the command to run at that point\. +.P +See npm help 7 \fBnpm\-scripts\fP to find out more about writing package scripts\. +.SH config +.P +A "config" object can be used to set configuration parameters used in package +scripts that persist across upgrades\. For instance, if a package had the +following: +.P +.RS 2 +.nf +{ "name" : "foo" +, "config" : { "port" : "8080" } } +.fi +.RE +.P +and then had a "start" command that then referenced the +\fBnpm_package_config_port\fP environment variable, then the user could +override that by doing \fBnpm config set foo:port 8001\fP\|\. +.P +See npm help 7 \fBnpm\-config\fP and npm help 7 \fBnpm\-scripts\fP for more on package +configs\. +.SH dependencies +.P +Dependencies are specified in a simple object that maps a package name to a +version range\. The version range is a string which has one or more +space\-separated descriptors\. Dependencies can also be identified with a +tarball or git URL\. +.P +\fBPlease do not put test harnesses or transpilers in your +\fBdependencies\fP object\.\fR See \fBdevDependencies\fP, below\. +.P +See npm help 7 semver for more details about specifying version ranges\. +.RS 0 +.IP \(bu 2 +\fBversion\fP Must match \fBversion\fP exactly +.IP \(bu 2 +\fB>version\fP Must be greater than \fBversion\fP +.IP \(bu 2 +\fB>=version\fP etc +.IP \(bu 2 +\fB=version1 <=version2\fP\|\. +.IP \(bu 2 +\fBrange1 || range2\fP Passes if either range1 or range2 are satisfied\. +.IP \(bu 2 +\fBgit\.\.\.\fP See 'Git URLs as Dependencies' below +.IP \(bu 2 +\fBuser/repo\fP See 'GitHub URLs' below +.IP \(bu 2 +\fBtag\fP A specific version tagged and published as \fBtag\fP See npm help \fBnpm\-tag\fP +.IP \(bu 2 +\fBpath/path/path\fP See Local Paths \fI#local\-paths\fR below + +.RE +.P +For example, these are all valid: +.P +.RS 2 +.nf +{ "dependencies" : + { "foo" : "1\.0\.0 \- 2\.9999\.9999" + , "bar" : ">=1\.0\.2 <2\.1\.2" + , "baz" : ">1\.0\.2 <=2\.3\.4" + , "boo" : "2\.0\.1" + , "qux" : "<1\.0\.0 || >=2\.3\.1 <2\.4\.5 || >=2\.5\.2 <3\.0\.0" + , "asd" : "http://asdf\.com/asdf\.tar\.gz" + , "til" : "~1\.2" + , "elf" : "~1\.2\.3" + , "two" : "2\.x" + , "thr" : "3\.3\.x" + , "lat" : "latest" + , "dyl" : "file:\.\./dyl" + } +} +.fi +.RE +.SS URLs as Dependencies +.P +You may specify a tarball URL in place of a version range\. +.P +This tarball will be downloaded and installed locally to your package at +install time\. +.SS Git URLs as Dependencies +.P +Git urls can be of the form: +.P +.RS 2 +.nf +git://github\.com/user/project\.git#commit\-ish +git+ssh://user@hostname:project\.git#commit\-ish +git+ssh://user@hostname/project\.git#commit\-ish +git+http://user@hostname/project/blah\.git#commit\-ish +git+https://user@hostname/project/blah\.git#commit\-ish +.fi +.RE +.P +The \fBcommit\-ish\fP can be any tag, sha, or branch which can be supplied as +an argument to \fBgit checkout\fP\|\. The default is \fBmaster\fP\|\. +.SH GitHub URLs +.P +As of version 1\.1\.65, you can refer to GitHub urls as just "foo": +"user/foo\-project"\. Just as with git URLs, a \fBcommit\-ish\fP suffix can be +included\. For example: +.P +.RS 2 +.nf +{ + "name": "foo", + "version": "0\.0\.0", + "dependencies": { + "express": "visionmedia/express", + "mocha": "visionmedia/mocha#4727d357ea" + } +} +.fi +.RE +.SH Local Paths +.P +As of version 2\.0\.0 you can provide a path to a local directory that contains a +package\. Local paths can be saved using \fBnpm install \-\-save\fP, using any of +these forms: +.P +.RS 2 +.nf +\|\.\./foo/bar +~/foo/bar +\|\./foo/bar +/foo/bar +.fi +.RE +.P +in which case they will be normalized to a relative path and added to your +\fBpackage\.json\fP\|\. For example: +.P +.RS 2 +.nf +{ + "name": "baz", + "dependencies": { + "bar": "file:\.\./foo/bar" + } +} +.fi +.RE +.P +This feature is helpful for local offline development and creating +tests that require npm installing where you don't want to hit an +external server, but should not be used when publishing packages +to the public registry\. +.SH devDependencies +.P +If someone is planning on downloading and using your module in their +program, then they probably don't want or need to download and build +the external test or documentation framework that you use\. +.P +In this case, it's best to map these additional items in a \fBdevDependencies\fP +object\. +.P +These things will be installed when doing \fBnpm link\fP or \fBnpm install\fP +from the root of a package, and can be managed like any other npm +configuration param\. See npm help 7 \fBnpm\-config\fP for more on the topic\. +.P +For build steps that are not platform\-specific, such as compiling +CoffeeScript or other languages to JavaScript, use the \fBprepublish\fP +script to do this, and make the required package a devDependency\. +.P +For example: +.P +.RS 2 +.nf +{ "name": "ethopia\-waza", + "description": "a delightfully fruity coffee varietal", + "version": "1\.2\.3", + "devDependencies": { + "coffee\-script": "~1\.6\.3" + }, + "scripts": { + "prepublish": "coffee \-o lib/ \-c src/waza\.coffee" + }, + "main": "lib/waza\.js" +} +.fi +.RE +.P +The \fBprepublish\fP script will be run before publishing, so that users +can consume the functionality without requiring them to compile it +themselves\. In dev mode (ie, locally running \fBnpm install\fP), it'll +run this script as well, so that you can test it easily\. +.SH peerDependencies +.P +In some cases, you want to express the compatibility of your package with a +host tool or library, while not necessarily doing a \fBrequire\fP of this host\. +This is usually referred to as a \fIplugin\fR\|\. Notably, your module may be exposing +a specific interface, expected and specified by the host documentation\. +.P +For example: +.P +.RS 2 +.nf +{ + "name": "tea\-latte", + "version": "1\.3\.5", + "peerDependencies": { + "tea": "2\.x" + } +} +.fi +.RE +.P +This ensures your package \fBtea\-latte\fP can be installed \fIalong\fR with the second +major version of the host package \fBtea\fP only\. \fBnpm install tea\-latte\fP could +possibly yield the following dependency graph: +.P +.RS 2 +.nf +├── tea\-latte@1\.3\.5 +└── tea@2\.2\.0 +.fi +.RE +.P +\fBNOTE: npm versions 1 and 2 will automatically install \fBpeerDependencies\fP if +they are not explicitly depended upon higher in the dependency tree\. In the +next major version of npm (npm@3), this will no longer be the case\. You will +receive a warning that the peerDependency is not installed instead\.\fR The +behavior in npms 1 & 2 was frequently confusing and could easily put you into +dependency hell, a situation that npm is designed to avoid as much as possible\. +.P +Trying to install another plugin with a conflicting requirement will cause an +error\. For this reason, make sure your plugin requirement is as broad as +possible, and not to lock it down to specific patch versions\. +.P +Assuming the host complies with semver \fIhttp://semver\.org/\fR, only changes in +the host package's major version will break your plugin\. Thus, if you've worked +with every 1\.x version of the host package, use \fB"^1\.0"\fP or \fB"1\.x"\fP to express +this\. If you depend on features introduced in 1\.5\.2, use \fB">= 1\.5\.2 < 2"\fP\|\. +.SH bundledDependencies +.P +This defines an array of package names that will be bundled when publishing the package\. +.P +In cases where you need to preserve npm packages locally or have them available through a single file download, you can bundle the packages in a tarball file by specifying the package names in the \fBbundledDependencies\fP array and executing \fBnpm pack\fP\|\. +.P +For example: +If we define a package\.json like this: +.P +.RS 2 +.nf +{ + "name": "awesome\-web\-framework", + "version": "1\.0\.0", + "bundledDependencies": [ + 'renderized', 'super\-streams' + ] +} +.fi +.RE +.P +we can obtain \fBawesome\-web\-framework\-1\.0\.0\.tgz\fP file by running \fBnpm pack\fP\|\. This file contains the dependencies \fBrenderized\fP and \fBsuper\-streams\fP which can be installed in a new project by executing \fBnpm install awesome\-web\-framework\-1\.0\.0\.tgz\fP\|\. +.P +If this is spelled \fB"bundleDependencies"\fP, then that is also honored\. +.SH optionalDependencies +.P +If a dependency can be used, but you would like npm to proceed if it cannot be +found or fails to install, then you may put it in the \fBoptionalDependencies\fP +object\. This is a map of package name to version or url, just like the +\fBdependencies\fP object\. The difference is that build failures do not cause +installation to fail\. +.P +It is still your program's responsibility to handle the lack of the +dependency\. For example, something like this: +.P +.RS 2 +.nf +try { + var foo = require('foo') + var fooVersion = require('foo/package\.json')\.version +} catch (er) { + foo = null +} +if ( notGoodFooVersion(fooVersion) ) { + foo = null +} + +// \.\. then later in your program \.\. + +if (foo) { + foo\.doFooThings() +} +.fi +.RE +.P +Entries in \fBoptionalDependencies\fP will override entries of the same name in +\fBdependencies\fP, so it's usually best to only put in one place\. +.SH engines +.P +You can specify the version of node that your stuff works on: +.P +.RS 2 +.nf +{ "engines" : { "node" : ">=0\.10\.3 <0\.12" } } +.fi +.RE +.P +And, like with dependencies, if you don't specify the version (or if you +specify "*" as the version), then any version of node will do\. +.P +If you specify an "engines" field, then npm will require that "node" be +somewhere on that list\. If "engines" is omitted, then npm will just assume +that it works on node\. +.P +You can also use the "engines" field to specify which versions of npm +are capable of properly installing your program\. For example: +.P +.RS 2 +.nf +{ "engines" : { "npm" : "~1\.0\.20" } } +.fi +.RE +.P +Unless the user has set the \fBengine\-strict\fP config flag, this +field is advisory only will produce warnings when your package is installed as a dependency\. +.SH engineStrict +.P +\fBNOTE: This feature is deprecated and will be removed in npm 3\.0\.0\.\fR +.P +If you are sure that your module will \fIdefinitely not\fR run properly on +versions of Node/npm other than those specified in the \fBengines\fP object, +then you can set \fB"engineStrict": true\fP in your package\.json file\. +This will override the user's \fBengine\-strict\fP config setting\. +.P +Please do not do this unless you are really very very sure\. If your +engines object is something overly restrictive, you can quite easily and +inadvertently lock yourself into obscurity and prevent your users from +updating to new versions of Node\. Consider this choice carefully\. +.SH os +.P +You can specify which operating systems your +module will run on: +.P +.RS 2 +.nf +"os" : [ "darwin", "linux" ] +.fi +.RE +.P +You can also blacklist instead of whitelist operating systems, +just prepend the blacklisted os with a '!': +.P +.RS 2 +.nf +"os" : [ "!win32" ] +.fi +.RE +.P +The host operating system is determined by \fBprocess\.platform\fP +.P +It is allowed to both blacklist, and whitelist, although there isn't any +good reason to do this\. +.SH cpu +.P +If your code only runs on certain cpu architectures, +you can specify which ones\. +.P +.RS 2 +.nf +"cpu" : [ "x64", "ia32" ] +.fi +.RE +.P +Like the \fBos\fP option, you can also blacklist architectures: +.P +.RS 2 +.nf +"cpu" : [ "!arm", "!mips" ] +.fi +.RE +.P +The host architecture is determined by \fBprocess\.arch\fP +.SH preferGlobal +.P +If your package is primarily a command\-line application that should be +installed globally, then set this value to \fBtrue\fP to provide a warning +if it is installed locally\. +.P +It doesn't actually prevent users from installing it locally, but it +does help prevent some confusion if it doesn't work as expected\. +.SH private +.P +If you set \fB"private": true\fP in your package\.json, then npm will refuse +to publish it\. +.P +This is a way to prevent accidental publication of private repositories\. If +you would like to ensure that a given package is only ever published to a +specific registry (for example, an internal registry), then use the +\fBpublishConfig\fP dictionary described below to override the \fBregistry\fP config +param at publish\-time\. +.SH publishConfig +.P +This is a set of config values that will be used at publish\-time\. It's +especially handy if you want to set the tag, registry or access, so that +you can ensure that a given package is not tagged with "latest", published +to the global public registry or that a scoped module is private by default\. +.P +Any config values can be overridden, but of course only "tag", "registry" and +"access" probably matter for the purposes of publishing\. +.P +See npm help 7 \fBnpm\-config\fP to see the list of config options that can be +overridden\. +.SH DEFAULT VALUES +.P +npm will default some values based on package contents\. +.RS 0 +.IP \(bu 2 +\fB"scripts": {"start": "node server\.js"}\fP +If there is a \fBserver\.js\fP file in the root of your package, then npm +will default the \fBstart\fP command to \fBnode server\.js\fP\|\. +.IP \(bu 2 +\fB"scripts":{"install": "node\-gyp rebuild"}\fP +If there is a \fBbinding\.gyp\fP file in the root of your package and you have not defined an \fBinstall\fP or \fBpreinstall\fP script, npm will +default the \fBinstall\fP command to compile using node\-gyp\. +.IP \(bu 2 +\fB"contributors": [\.\.\.]\fP +If there is an \fBAUTHORS\fP file in the root of your package, npm will +treat each line as a \fBName (url)\fP format, where email and url +are optional\. Lines which start with a \fB#\fP or are blank, will be +ignored\. + +.RE +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help 7 semver +.IP \(bu 2 +npm help init +.IP \(bu 2 +npm help version +.IP \(bu 2 +npm help config +.IP \(bu 2 +npm help 7 config +.IP \(bu 2 +npm help help +.IP \(bu 2 +npm help 7 faq +.IP \(bu 2 +npm help install +.IP \(bu 2 +npm help publish +.IP \(bu 2 +npm help uninstall + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man7/npm-coding-style.7 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man7/npm-coding-style.7 new file mode 100644 index 00000000..119985aa --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man7/npm-coding-style.7 @@ -0,0 +1,204 @@ +.TH "NPM\-CODING\-STYLE" "7" "October 2016" "" "" +.SH "NAME" +\fBnpm-coding-style\fR \- npm's "funny" coding style +.SH DESCRIPTION +.P +npm's coding style is a bit unconventional\. It is not different for +difference's sake, but rather a carefully crafted style that is +designed to reduce visual clutter and make bugs more apparent\. +.P +If you want to contribute to npm (which is very encouraged), you should +make your code conform to npm's style\. +.P +Note: this concerns npm's code not the specific packages that you can download from the npm registry\. +.SH Line Length +.P +Keep lines shorter than 80 characters\. It's better for lines to be +too short than to be too long\. Break up long lists, objects, and other +statements onto multiple lines\. +.SH Indentation +.P +Two\-spaces\. Tabs are better, but they look like hell in web browsers +(and on GitHub), and node uses 2 spaces, so that's that\. +.P +Configure your editor appropriately\. +.SH Curly braces +.P +Curly braces belong on the same line as the thing that necessitates them\. +.P +Bad: +.P +.RS 2 +.nf +function () +{ +.fi +.RE +.P +Good: +.P +.RS 2 +.nf +function () { +.fi +.RE +.P +If a block needs to wrap to the next line, use a curly brace\. Don't +use it if it doesn't\. +.P +Bad: +.P +.RS 2 +.nf +if (foo) { bar() } +while (foo) + bar() +.fi +.RE +.P +Good: +.P +.RS 2 +.nf +if (foo) bar() +while (foo) { + bar() +} +.fi +.RE +.SH Semicolons +.P +Don't use them except in four situations: +.RS 0 +.IP \(bu 2 +\fBfor (;;)\fP loops\. They're actually required\. +.IP \(bu 2 +null loops like: \fBwhile (something) ;\fP (But you'd better have a good +reason for doing that\.) +.IP \(bu 2 +\fBcase "foo": doSomething(); break\fP +.IP \(bu 2 +In front of a leading \fB(\fP or \fB[\fP at the start of the line\. +This prevents the expression from being interpreted +as a function call or property access, respectively\. + +.RE +.P +Some examples of good semicolon usage: +.P +.RS 2 +.nf +;(x || y)\.doSomething() +;[a, b, c]\.forEach(doSomething) +for (var i = 0; i < 10; i ++) { + switch (state) { + case "begin": start(); continue + case "end": finish(); break + default: throw new Error("unknown state") + } + end() +} +.fi +.RE +.P +Note that starting lines with \fB\-\fP and \fB+\fP also should be prefixed +with a semicolon, but this is much less common\. +.SH Comma First +.P +If there is a list of things separated by commas, and it wraps +across multiple lines, put the comma at the start of the next +line, directly below the token that starts the list\. Put the +final token in the list on a line by itself\. For example: +.P +.RS 2 +.nf +var magicWords = [ "abracadabra" + , "gesundheit" + , "ventrilo" + ] + , spells = { "fireball" : function () { setOnFire() } + , "water" : function () { putOut() } + } + , a = 1 + , b = "abc" + , etc + , somethingElse +.fi +.RE +.SH Whitespace +.P +Put a single space in front of ( for anything other than a function call\. +Also use a single space wherever it makes things more readable\. +.P +Don't leave trailing whitespace at the end of lines\. Don't indent empty +lines\. Don't use more spaces than are helpful\. +.SH Functions +.P +Use named functions\. They make stack traces a lot easier to read\. +.SH Callbacks, Sync/async Style +.P +Use the asynchronous/non\-blocking versions of things as much as possible\. +It might make more sense for npm to use the synchronous fs APIs, but this +way, the fs and http and child process stuff all uses the same callback\-passing +methodology\. +.P +The callback should always be the last argument in the list\. Its first +argument is the Error or null\. +.P +Be very careful never to ever ever throw anything\. It's worse than useless\. +Just send the error message back as the first argument to the callback\. +.SH Errors +.P +Always create a new Error object with your message\. Don't just return a +string message to the callback\. Stack traces are handy\. +.SH Logging +.P +Logging is done using the npmlog \fIhttps://github\.com/npm/npmlog\fR +utility\. +.P +Please clean up logs when they are no longer helpful\. In particular, +logging the same object over and over again is not helpful\. Logs should +report what's happening so that it's easier to track down where a fault +occurs\. +.P +Use appropriate log levels\. See npm help 7 \fBnpm\-config\fP and search for +"loglevel"\. +.SH Case, naming, etc\. +.P +Use \fBlowerCamelCase\fP for multiword identifiers when they refer to objects, +functions, methods, properties, or anything not specified in this section\. +.P +Use \fBUpperCamelCase\fP for class names (things that you'd pass to "new")\. +.P +Use \fBall\-lower\-hyphen\-css\-case\fP for multiword filenames and config keys\. +.P +Use named functions\. They make stack traces easier to follow\. +.P +Use \fBCAPS_SNAKE_CASE\fP for constants, things that should never change +and are rarely used\. +.P +Use a single uppercase letter for function names where the function +would normally be anonymous, but needs to call itself recursively\. It +makes it clear that it's a "throwaway" function\. +.SH null, undefined, false, 0 +.P +Boolean variables and functions should always be either \fBtrue\fP or +\fBfalse\fP\|\. Don't set it to 0 unless it's supposed to be a number\. +.P +When something is intentionally missing or removed, set it to \fBnull\fP\|\. +.P +Don't set things to \fBundefined\fP\|\. Reserve that value to mean "not yet +set to anything\." +.P +Boolean objects are verboten\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help 7 developers +.IP \(bu 2 +npm help 7 faq +.IP \(bu 2 +npm help npm + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man7/npm-config.7 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man7/npm-config.7 new file mode 100644 index 00000000..aa02cf3d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man7/npm-config.7 @@ -0,0 +1,1292 @@ +.TH "NPM\-CONFIG" "7" "October 2016" "" "" +.SH "NAME" +\fBnpm-config\fR \- More than you probably want to know about npm configuration +.SH DESCRIPTION +.P +npm gets its configuration values from the following sources, sorted by priority: +.SS Command Line Flags +.P +Putting \fB\-\-foo bar\fP on the command line sets the \fBfoo\fP configuration +parameter to \fB"bar"\fP\|\. A \fB\-\-\fP argument tells the cli parser to stop +reading flags\. A \fB\-\-flag\fP parameter that is at the \fIend\fR of the +command will be given the value of \fBtrue\fP\|\. +.SS Environment Variables +.P +Any environment variables that start with \fBnpm_config_\fP will be +interpreted as a configuration parameter\. For example, putting +\fBnpm_config_foo=bar\fP in your environment will set the \fBfoo\fP +configuration parameter to \fBbar\fP\|\. Any environment configurations that +are not given a value will be given the value of \fBtrue\fP\|\. Config +values are case\-insensitive, so \fBNPM_CONFIG_FOO=bar\fP will work the +same\. +.SS npmrc Files +.P +The four relevant files are: +.RS 0 +.IP \(bu 2 +per\-project configuration file (\fB/path/to/my/project/\.npmrc\fP) +.IP \(bu 2 +per\-user configuration file (defaults to \fB$HOME/\.npmrc\fP; configurable via CLI +option \fB\-\-userconfig\fP or environment variable \fB$NPM_CONF_USERCONFIG\fP) +.IP \(bu 2 +global configuration file (defaults to \fB$PREFIX/etc/npmrc\fP; configurable via +CLI option \fB\-\-globalconfig\fP or environment variable \fB$NPM_CONF_GLOBALCONFIG\fP) +.IP \(bu 2 +npm's built\-in configuration file (\fB/path/to/npm/npmrc\fP) + +.RE +.P +See npm help 5 npmrc for more details\. +.SS Default Configs +.P +A set of configuration parameters that are internal to npm, and are +defaults if nothing else is specified\. +.SH Shorthands and Other CLI Niceties +.P +The following shorthands are parsed on the command\-line: +.RS 0 +.IP \(bu 2 +\fB\-v\fP: \fB\-\-version\fP +.IP \(bu 2 +\fB\-h\fP, \fB\-?\fP, \fB\-\-help\fP, \fB\-H\fP: \fB\-\-usage\fP +.IP \(bu 2 +\fB\-s\fP, \fB\-\-silent\fP: \fB\-\-loglevel silent\fP +.IP \(bu 2 +\fB\-q\fP, \fB\-\-quiet\fP: \fB\-\-loglevel warn\fP +.IP \(bu 2 +\fB\-d\fP: \fB\-\-loglevel info\fP +.IP \(bu 2 +\fB\-dd\fP, \fB\-\-verbose\fP: \fB\-\-loglevel verbose\fP +.IP \(bu 2 +\fB\-ddd\fP: \fB\-\-loglevel silly\fP +.IP \(bu 2 +\fB\-g\fP: \fB\-\-global\fP +.IP \(bu 2 +\fB\-C\fP: \fB\-\-prefix\fP +.IP \(bu 2 +\fB\-l\fP: \fB\-\-long\fP +.IP \(bu 2 +\fB\-m\fP: \fB\-\-message\fP +.IP \(bu 2 +\fB\-p\fP, \fB\-\-porcelain\fP: \fB\-\-parseable\fP +.IP \(bu 2 +\fB\-reg\fP: \fB\-\-registry\fP +.IP \(bu 2 +\fB\-f\fP: \fB\-\-force\fP +.IP \(bu 2 +\fB\-desc\fP: \fB\-\-description\fP +.IP \(bu 2 +\fB\-S\fP: \fB\-\-save\fP +.IP \(bu 2 +\fB\-D\fP: \fB\-\-save\-dev\fP +.IP \(bu 2 +\fB\-O\fP: \fB\-\-save\-optional\fP +.IP \(bu 2 +\fB\-B\fP: \fB\-\-save\-bundle\fP +.IP \(bu 2 +\fB\-E\fP: \fB\-\-save\-exact\fP +.IP \(bu 2 +\fB\-y\fP: \fB\-\-yes\fP +.IP \(bu 2 +\fB\-n\fP: \fB\-\-yes false\fP +.IP \(bu 2 +\fBll\fP and \fBla\fP commands: \fBls \-\-long\fP + +.RE +.P +If the specified configuration param resolves unambiguously to a known +configuration parameter, then it is expanded to that configuration +parameter\. For example: +.P +.RS 2 +.nf +npm ls \-\-par +# same as: +npm ls \-\-parseable +.fi +.RE +.P +If multiple single\-character shorthands are strung together, and the +resulting combination is unambiguously not some other configuration +param, then it is expanded to its various component pieces\. For +example: +.P +.RS 2 +.nf +npm ls \-gpld +# same as: +npm ls \-\-global \-\-parseable \-\-long \-\-loglevel info +.fi +.RE +.SH Per\-Package Config Settings +.P +When running scripts (see npm help 7 \fBnpm\-scripts\fP) the package\.json "config" +keys are overwritten in the environment if there is a config param of +\fB[@]:\fP\|\. For example, if the package\.json has +this: +.P +.RS 2 +.nf +{ "name" : "foo" +, "config" : { "port" : "8080" } +, "scripts" : { "start" : "node server\.js" } } +.fi +.RE +.P +and the server\.js is this: +.P +.RS 2 +.nf +http\.createServer(\.\.\.)\.listen(process\.env\.npm_package_config_port) +.fi +.RE +.P +then the user could change the behavior by doing: +.P +.RS 2 +.nf +npm config set foo:port 80 +.fi +.RE +.P +See npm help 5 package\.json for more information\. +.SH Config Settings +.SS access +.RS 0 +.IP \(bu 2 +Default: \fBrestricted\fP +.IP \(bu 2 +Type: Access + +.RE +.P +When publishing scoped packages, the access level defaults to \fBrestricted\fP\|\. If +you want your scoped package to be publicly viewable (and installable) set +\fB\-\-access=public\fP\|\. The only valid values for \fBaccess\fP are \fBpublic\fP and +\fBrestricted\fP\|\. Unscoped packages \fIalways\fR have an access level of \fBpublic\fP\|\. +.SS always\-auth +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: Boolean + +.RE +.P +Force npm to always require authentication when accessing the registry, +even for \fBGET\fP requests\. +.SS bin\-links +.RS 0 +.IP \(bu 2 +Default: \fBtrue\fP +.IP \(bu 2 +Type: Boolean + +.RE +.P +Tells npm to create symlinks (or \fB\|\.cmd\fP shims on Windows) for package +executables\. +.P +Set to false to have it not do this\. This can be used to work around +the fact that some file systems don't support symlinks, even on +ostensibly Unix systems\. +.SS browser +.RS 0 +.IP \(bu 2 +Default: OS X: \fB"open"\fP, Windows: \fB"start"\fP, Others: \fB"xdg\-open"\fP +.IP \(bu 2 +Type: String + +.RE +.P +The browser that is called by the \fBnpm docs\fP command to open websites\. +.SS ca +.RS 0 +.IP \(bu 2 +Default: The npm CA certificate +.IP \(bu 2 +Type: String, Array or null + +.RE +.P +The Certificate Authority signing certificate that is trusted for SSL +connections to the registry\. Values should be in PEM format with newlines +replaced by the string "\\n"\. For example: +.P +.RS 2 +.nf +ca="\-\-\-\-\-BEGIN CERTIFICATE\-\-\-\-\-\\nXXXX\\nXXXX\\n\-\-\-\-\-END CERTIFICATE\-\-\-\-\-" +.fi +.RE +.P +Set to \fBnull\fP to only allow "known" registrars, or to a specific CA cert +to trust only that specific signing authority\. +.P +Multiple CAs can be trusted by specifying an array of certificates: +.P +.RS 2 +.nf +ca[]="\.\.\." +ca[]="\.\.\." +.fi +.RE +.P +See also the \fBstrict\-ssl\fP config\. +.SS cafile +.RS 0 +.IP \(bu 2 +Default: \fBnull\fP +.IP \(bu 2 +Type: path + +.RE +.P +A path to a file containing one or multiple Certificate Authority signing +certificates\. Similar to the \fBca\fP setting, but allows for multiple CA's, as +well as for the CA information to be stored in a file on disk\. +.SS cache +.RS 0 +.IP \(bu 2 +Default: Windows: \fB%AppData%\\npm\-cache\fP, Posix: \fB~/\.npm\fP +.IP \(bu 2 +Type: path + +.RE +.P +The location of npm's cache directory\. See npm help \fBnpm\-cache\fP +.SS cache\-lock\-stale +.RS 0 +.IP \(bu 2 +Default: 60000 (1 minute) +.IP \(bu 2 +Type: Number + +.RE +.P +The number of ms before cache folder lockfiles are considered stale\. +.SS cache\-lock\-retries +.RS 0 +.IP \(bu 2 +Default: 10 +.IP \(bu 2 +Type: Number + +.RE +.P +Number of times to retry to acquire a lock on cache folder lockfiles\. +.SS cache\-lock\-wait +.RS 0 +.IP \(bu 2 +Default: 10000 (10 seconds) +.IP \(bu 2 +Type: Number + +.RE +.P +Number of ms to wait for cache lock files to expire\. +.SS cache\-max +.RS 0 +.IP \(bu 2 +Default: Infinity +.IP \(bu 2 +Type: Number + +.RE +.P +The maximum time (in seconds) to keep items in the registry cache before +re\-checking against the registry\. +.P +Note that no purging is done unless the \fBnpm cache clean\fP command is +explicitly used, and that only GET requests use the cache\. +.SS cache\-min +.RS 0 +.IP \(bu 2 +Default: 10 +.IP \(bu 2 +Type: Number + +.RE +.P +The minimum time (in seconds) to keep items in the registry cache before +re\-checking against the registry\. +.P +Note that no purging is done unless the \fBnpm cache clean\fP command is +explicitly used, and that only GET requests use the cache\. +.SS cert +.RS 0 +.IP \(bu 2 +Default: \fBnull\fP +.IP \(bu 2 +Type: String + +.RE +.P +A client certificate to pass when accessing the registry\. Values should be in +PEM format with newlines replaced by the string "\\n"\. For example: +.P +.RS 2 +.nf +cert="\-\-\-\-\-BEGIN CERTIFICATE\-\-\-\-\-\\nXXXX\\nXXXX\\n\-\-\-\-\-END CERTIFICATE\-\-\-\-\-" +.fi +.RE +.P +It is \fInot\fR the path to a certificate file (and there is no "certfile" option)\. +.SS color +.RS 0 +.IP \(bu 2 +Default: true +.IP \(bu 2 +Type: Boolean or \fB"always"\fP + +.RE +.P +If false, never shows colors\. If \fB"always"\fP then always shows colors\. +If true, then only prints color codes for tty file descriptors\. +.SS depth +.RS 0 +.IP \(bu 2 +Default: Infinity +.IP \(bu 2 +Type: Number + +.RE +.P +The depth to go when recursing directories for \fBnpm ls\fP, +\fBnpm cache ls\fP, and \fBnpm outdated\fP\|\. +.P +For \fBnpm outdated\fP, a setting of \fBInfinity\fP will be treated as \fB0\fP +since that gives more useful information\. To show the outdated status +of all packages and dependents, use a large integer value, +e\.g\., \fBnpm outdated \-\-depth 9999\fP +.SS description +.RS 0 +.IP \(bu 2 +Default: true +.IP \(bu 2 +Type: Boolean + +.RE +.P +Show the description in \fBnpm search\fP +.SS dev +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: Boolean + +.RE +.P +Install \fBdev\-dependencies\fP along with packages\. +.P +Note that \fBdev\-dependencies\fP are also installed if the \fBnpat\fP flag is +set\. +.SS editor +.RS 0 +.IP \(bu 2 +Default: \fBEDITOR\fP environment variable if set, or \fB"vi"\fP on Posix, +or \fB"notepad"\fP on Windows\. +.IP \(bu 2 +Type: path + +.RE +.P +The command to run for \fBnpm edit\fP or \fBnpm config edit\fP\|\. +.SS engine\-strict +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: Boolean + +.RE +.P +If set to true, then npm will stubbornly refuse to install (or even +consider installing) any package that claims to not be compatible with +the current Node\.js version\. +.SS force +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: Boolean + +.RE +.P +Makes various commands more forceful\. +.RS 0 +.IP \(bu 2 +lifecycle script failure does not block progress\. +.IP \(bu 2 +publishing clobbers previously published versions\. +.IP \(bu 2 +skips cache when requesting from the registry\. +.IP \(bu 2 +prevents checks against clobbering non\-npm files\. + +.RE +.SS fetch\-retries +.RS 0 +.IP \(bu 2 +Default: 2 +.IP \(bu 2 +Type: Number + +.RE +.P +The "retries" config for the \fBretry\fP module to use when fetching +packages from the registry\. +.SS fetch\-retry\-factor +.RS 0 +.IP \(bu 2 +Default: 10 +.IP \(bu 2 +Type: Number + +.RE +.P +The "factor" config for the \fBretry\fP module to use when fetching +packages\. +.SS fetch\-retry\-mintimeout +.RS 0 +.IP \(bu 2 +Default: 10000 (10 seconds) +.IP \(bu 2 +Type: Number + +.RE +.P +The "minTimeout" config for the \fBretry\fP module to use when fetching +packages\. +.SS fetch\-retry\-maxtimeout +.RS 0 +.IP \(bu 2 +Default: 60000 (1 minute) +.IP \(bu 2 +Type: Number + +.RE +.P +The "maxTimeout" config for the \fBretry\fP module to use when fetching +packages\. +.SS git +.RS 0 +.IP \(bu 2 +Default: \fB"git"\fP +.IP \(bu 2 +Type: String + +.RE +.P +The command to use for git commands\. If git is installed on the +computer, but is not in the \fBPATH\fP, then set this to the full path to +the git binary\. +.SS git\-tag\-version +.RS 0 +.IP \(bu 2 +Default: \fBtrue\fP +.IP \(bu 2 +Type: Boolean + +.RE +.P +Tag the commit when using the \fBnpm version\fP command\. +.SS global +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: Boolean + +.RE +.P +Operates in "global" mode, so that packages are installed into the +\fBprefix\fP folder instead of the current working directory\. See +npm help 5 \fBnpm\-folders\fP for more on the differences in behavior\. +.RS 0 +.IP \(bu 2 +packages are installed into the \fB{prefix}/lib/node_modules\fP folder, instead of the +current working directory\. +.IP \(bu 2 +bin files are linked to \fB{prefix}/bin\fP +.IP \(bu 2 +man pages are linked to \fB{prefix}/share/man\fP + +.RE +.SS globalconfig +.RS 0 +.IP \(bu 2 +Default: {prefix}/etc/npmrc +.IP \(bu 2 +Type: path + +.RE +.P +The config file to read for global config options\. +.SS group +.RS 0 +.IP \(bu 2 +Default: GID of the current process +.IP \(bu 2 +Type: String or Number + +.RE +.P +The group to use when running package scripts in global mode as the root +user\. +.SS heading +.RS 0 +.IP \(bu 2 +Default: \fB"npm"\fP +.IP \(bu 2 +Type: String + +.RE +.P +The string that starts all the debugging log output\. +.SS https\-proxy +.RS 0 +.IP \(bu 2 +Default: null +.IP \(bu 2 +Type: url + +.RE +.P +A proxy to use for outgoing https requests\. If the \fBHTTPS_PROXY\fP or +\fBhttps_proxy\fP or \fBHTTP_PROXY\fP or \fBhttp_proxy\fP environment variables are set, +proxy settings will be honored by the underlying \fBrequest\fP library\. +.SS if\-present +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: Boolean + +.RE +.P +If true, npm will not exit with an error code when \fBrun\-script\fP is invoked for +a script that isn't defined in the \fBscripts\fP section of \fBpackage\.json\fP\|\. This +option can be used when it's desirable to optionally run a script when it's +present and fail if the script fails\. This is useful, for example, when running +scripts that may only apply for some builds in an otherwise generic CI setup\. +.SS ignore\-scripts +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: Boolean + +.RE +.P +If true, npm does not run scripts specified in package\.json files\. +.SS init\-module +.RS 0 +.IP \(bu 2 +Default: ~/\.npm\-init\.js +.IP \(bu 2 +Type: path + +.RE +.P +A module that will be loaded by the \fBnpm init\fP command\. See the +documentation for the +init\-package\-json \fIhttps://github\.com/isaacs/init\-package\-json\fR module +for more information, or npm help init\. +.SS init\-author\-name +.RS 0 +.IP \(bu 2 +Default: "" +.IP \(bu 2 +Type: String + +.RE +.P +The value \fBnpm init\fP should use by default for the package author's name\. +.SS init\-author\-email +.RS 0 +.IP \(bu 2 +Default: "" +.IP \(bu 2 +Type: String + +.RE +.P +The value \fBnpm init\fP should use by default for the package author's email\. +.SS init\-author\-url +.RS 0 +.IP \(bu 2 +Default: "" +.IP \(bu 2 +Type: String + +.RE +.P +The value \fBnpm init\fP should use by default for the package author's homepage\. +.SS init\-license +.RS 0 +.IP \(bu 2 +Default: "ISC" +.IP \(bu 2 +Type: String + +.RE +.P +The value \fBnpm init\fP should use by default for the package license\. +.SS init\-version +.RS 0 +.IP \(bu 2 +Default: "1\.0\.0" +.IP \(bu 2 +Type: semver + +.RE +.P +The value that \fBnpm init\fP should use by default for the package +version number, if not already set in package\.json\. +.SS json +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: Boolean + +.RE +.P +Whether or not to output JSON data, rather than the normal output\. +.P +This feature is currently experimental, and the output data structures +for many commands is either not implemented in JSON yet, or subject to +change\. Only the output from \fBnpm ls \-\-json\fP is currently valid\. +.SS key +.RS 0 +.IP \(bu 2 +Default: \fBnull\fP +.IP \(bu 2 +Type: String + +.RE +.P +A client key to pass when accessing the registry\. Values should be in PEM +format with newlines replaced by the string "\\n"\. For example: +.P +.RS 2 +.nf +key="\-\-\-\-\-BEGIN PRIVATE KEY\-\-\-\-\-\\nXXXX\\nXXXX\\n\-\-\-\-\-END PRIVATE KEY\-\-\-\-\-" +.fi +.RE +.P +It is \fInot\fR the path to a key file (and there is no "keyfile" option)\. +.SS link +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: Boolean + +.RE +.P +If true, then local installs will link if there is a suitable globally +installed package\. +.P +Note that this means that local installs can cause things to be +installed into the global space at the same time\. The link is only done +if one of the two conditions are met: +.RS 0 +.IP \(bu 2 +The package is not already installed globally, or +.IP \(bu 2 +the globally installed version is identical to the version that is +being installed locally\. + +.RE +.SS local\-address +.RS 0 +.IP \(bu 2 +Default: undefined +.IP \(bu 2 +Type: IP Address + +.RE +.P +The IP address of the local interface to use when making connections +to the npm registry\. Must be IPv4 in versions of Node prior to 0\.12\. +.SS loglevel +.RS 0 +.IP \(bu 2 +Default: "warn" +.IP \(bu 2 +Type: String +.IP \(bu 2 +Values: "silent", "error", "warn", "http", "info", "verbose", "silly" + +.RE +.P +What level of logs to report\. On failure, \fIall\fR logs are written to +\fBnpm\-debug\.log\fP in the current working directory\. +.P +Any logs of a higher level than the setting are shown\. +The default is "warn", which shows warn and error output\. +.SS logstream +.RS 0 +.IP \(bu 2 +Default: process\.stderr +.IP \(bu 2 +Type: Stream + +.RE +.P +This is the stream that is passed to the +npmlog \fIhttps://github\.com/npm/npmlog\fR module at run time\. +.P +It cannot be set from the command line, but if you are using npm +programmatically, you may wish to send logs to somewhere other than +stderr\. +.P +If the \fBcolor\fP config is set to true, then this stream will receive +colored output if it is a TTY\. +.SS long +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: Boolean + +.RE +.P +Show extended information in \fBnpm ls\fP and \fBnpm search\fP\|\. +.SS maxsockets +.RS 0 +.IP \(bu 2 +Default: 50 +.IP \(bu 2 +Type: Number + +.RE +.P +The maximum number of connections to use per origin (protocol/host/port +combination)\. Passed to the \fBhttp\fP \fBAgent\fP used to make the request\. +.SS message +.RS 0 +.IP \(bu 2 +Default: "%s" +.IP \(bu 2 +Type: String + +.RE +.P +Commit message which is used by \fBnpm version\fP when creating version commit\. +.P +Any "%s" in the message will be replaced with the version number\. +.SS node\-version +.RS 0 +.IP \(bu 2 +Default: process\.version +.IP \(bu 2 +Type: semver or false + +.RE +.P +The node version to use when checking a package's \fBengines\fP map\. +.SS npat +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: Boolean + +.RE +.P +Run tests on installation\. +.SS onload\-script +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: path + +.RE +.P +A node module to \fBrequire()\fP when npm loads\. Useful for programmatic +usage\. +.SS optional +.RS 0 +.IP \(bu 2 +Default: true +.IP \(bu 2 +Type: Boolean + +.RE +.P +Attempt to install packages in the \fBoptionalDependencies\fP object\. Note +that if these packages fail to install, the overall installation +process is not aborted\. +.SS parseable +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: Boolean + +.RE +.P +Output parseable results from commands that write to +standard output\. +.SS prefix +.RS 0 +.IP \(bu 2 +Default: see npm help 5 folders +.IP \(bu 2 +Type: path + +.RE +.P +The location to install global items\. If set on the command line, then +it forces non\-global commands to run in the specified folder\. +.SS production +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: Boolean + +.RE +.P +Set to true to run in "production" mode\. +.RS 0 +.IP 1. 3 +devDependencies are not installed at the topmost level when running +local \fBnpm install\fP without any arguments\. +.IP 2. 3 +Set the NODE_ENV="production" for lifecycle scripts\. + +.RE +.SS proprietary\-attribs +.RS 0 +.IP \(bu 2 +Default: true +.IP \(bu 2 +Type: Boolean + +.RE +.P +Whether or not to include proprietary extended attributes in the +tarballs created by npm\. +.P +Unless you are expecting to unpack package tarballs with something other +than npm \-\- particularly a very outdated tar implementation \-\- leave +this as true\. +.SS proxy +.RS 0 +.IP \(bu 2 +Default: null +.IP \(bu 2 +Type: url + +.RE +.P +A proxy to use for outgoing http requests\. If the \fBHTTP_PROXY\fP or +\fBhttp_proxy\fP environment variables are set, proxy settings will be +honored by the underlying \fBrequest\fP library\. +.SS rebuild\-bundle +.RS 0 +.IP \(bu 2 +Default: true +.IP \(bu 2 +Type: Boolean + +.RE +.P +Rebuild bundled dependencies after installation\. +.SS registry +.RS 0 +.IP \(bu 2 +Default: https://registry\.npmjs\.org/ +.IP \(bu 2 +Type: url + +.RE +.P +The base URL of the npm package registry\. +.SS rollback +.RS 0 +.IP \(bu 2 +Default: true +.IP \(bu 2 +Type: Boolean + +.RE +.P +Remove failed installs\. +.SS save +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: Boolean + +.RE +.P +Save installed packages to a package\.json file as dependencies\. +.P +When used with the \fBnpm rm\fP command, it removes it from the \fBdependencies\fP +object\. +.P +Only works if there is already a package\.json file present\. +.SS save\-bundle +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: Boolean + +.RE +.P +If a package would be saved at install time by the use of \fB\-\-save\fP, +\fB\-\-save\-dev\fP, or \fB\-\-save\-optional\fP, then also put it in the +\fBbundleDependencies\fP list\. +.P +When used with the \fBnpm rm\fP command, it removes it from the +bundledDependencies list\. +.SS save\-dev +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: Boolean + +.RE +.P +Save installed packages to a package\.json file as \fBdevDependencies\fP\|\. +.P +When used with the \fBnpm rm\fP command, it removes it from the +\fBdevDependencies\fP object\. +.P +Only works if there is already a package\.json file present\. +.SS save\-exact +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: Boolean + +.RE +.P +Dependencies saved to package\.json using \fB\-\-save\fP, \fB\-\-save\-dev\fP or +\fB\-\-save\-optional\fP will be configured with an exact version rather than +using npm's default semver range operator\. +.SS save\-optional +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: Boolean + +.RE +.P +Save installed packages to a package\.json file as +optionalDependencies\. +.P +When used with the \fBnpm rm\fP command, it removes it from the +\fBdevDependencies\fP object\. +.P +Only works if there is already a package\.json file present\. +.SS save\-prefix +.RS 0 +.IP \(bu 2 +Default: '^' +.IP \(bu 2 +Type: String + +.RE +.P +Configure how versions of packages installed to a package\.json file via +\fB\-\-save\fP or \fB\-\-save\-dev\fP get prefixed\. +.P +For example if a package has version \fB1\.2\.3\fP, by default its version is +set to \fB^1\.2\.3\fP which allows minor upgrades for that package, but after +\fBnpm config set save\-prefix='~'\fP it would be set to \fB~1\.2\.3\fP which only allows +patch upgrades\. +.SS scope +.RS 0 +.IP \(bu 2 +Default: "" +.IP \(bu 2 +Type: String + +.RE +.P +Associate an operation with a scope for a scoped registry\. Useful when logging +in to a private registry for the first time: +\fBnpm login \-\-scope=@organization \-\-registry=registry\.organization\.com\fP, which +will cause \fB@organization\fP to be mapped to the registry for future installation +of packages specified according to the pattern \fB@organization/package\fP\|\. +.SS searchopts +.RS 0 +.IP \(bu 2 +Default: "" +.IP \(bu 2 +Type: String + +.RE +.P +Space\-separated options that are always passed to search\. +.SS searchexclude +.RS 0 +.IP \(bu 2 +Default: "" +.IP \(bu 2 +Type: String + +.RE +.P +Space\-separated options that limit the results from search\. +.SS searchsort +.RS 0 +.IP \(bu 2 +Default: "name" +.IP \(bu 2 +Type: String +.IP \(bu 2 +Values: "name", "\-name", "date", "\-date", "description", +"\-description", "keywords", "\-keywords" + +.RE +.P +Indication of which field to sort search results by\. Prefix with a \fB\-\fP +character to indicate reverse sort\. +.SS shell +.RS 0 +.IP \(bu 2 +Default: SHELL environment variable, or "bash" on Posix, or "cmd" on +Windows +.IP \(bu 2 +Type: path + +.RE +.P +The shell to run for the \fBnpm explore\fP command\. +.SS shrinkwrap +.RS 0 +.IP \(bu 2 +Default: true +.IP \(bu 2 +Type: Boolean + +.RE +.P +If set to false, then ignore \fBnpm\-shrinkwrap\.json\fP files when +installing\. +.SS sign\-git\-tag +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: Boolean + +.RE +.P +If set to true, then the \fBnpm version\fP command will tag the version +using \fB\-s\fP to add a signature\. +.P +Note that git requires you to have set up GPG keys in your git configs +for this to work properly\. +.SS spin +.RS 0 +.IP \(bu 2 +Default: true +.IP \(bu 2 +Type: Boolean or \fB"always"\fP + +.RE +.P +When set to \fBtrue\fP, npm will display an ascii spinner while it is doing +things, if \fBprocess\.stderr\fP is a TTY\. +.P +Set to \fBfalse\fP to suppress the spinner, or set to \fBalways\fP to output +the spinner even for non\-TTY outputs\. +.SS strict\-ssl +.RS 0 +.IP \(bu 2 +Default: true +.IP \(bu 2 +Type: Boolean + +.RE +.P +Whether or not to do SSL key validation when making requests to the +registry via https\. +.P +See also the \fBca\fP config\. +.SS tag +.RS 0 +.IP \(bu 2 +Default: latest +.IP \(bu 2 +Type: String + +.RE +.P +If you ask npm to install a package and don't tell it a specific version, then +it will install the specified tag\. +.P +Also the tag that is added to the package@version specified by the \fBnpm +tag\fP command, if no explicit tag is given\. +.SS tag\-version\-prefix +.RS 0 +.IP \(bu 2 +Default: \fB"v"\fP +.IP \(bu 2 +Type: String + +.RE +.P +If set, alters the prefix used when tagging a new version when performing a +version increment using \fBnpm\-version\fP\|\. To remove the prefix altogether, set it +to the empty string: \fB""\fP\|\. +.P +Because other tools may rely on the convention that npm version tags look like +\fBv1\.0\.0\fP, \fIonly use this property if it is absolutely necessary\fR\|\. In +particular, use care when overriding this setting for public packages\. +.SS tmp +.RS 0 +.IP \(bu 2 +Default: TMPDIR environment variable, or "/tmp" +.IP \(bu 2 +Type: path + +.RE +.P +Where to store temporary files and folders\. All temp files are deleted +on success, but left behind on failure for forensic purposes\. +.SS unicode +.RS 0 +.IP \(bu 2 +Default: true +.IP \(bu 2 +Type: Boolean + +.RE +.P +When set to true, npm uses unicode characters in the tree output\. When +false, it uses ascii characters to draw trees\. +.SS unsafe\-perm +.RS 0 +.IP \(bu 2 +Default: false if running as root, true otherwise +.IP \(bu 2 +Type: Boolean + +.RE +.P +Set to true to suppress the UID/GID switching when running package +scripts\. If set explicitly to false, then installing as a non\-root user +will fail\. +.SS usage +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: Boolean + +.RE +.P +Set to show short usage output (like the \-H output) +instead of complete help when doing npm help \fBnpm\-help\fP\|\. +.SS user +.RS 0 +.IP \(bu 2 +Default: "nobody" +.IP \(bu 2 +Type: String or Number + +.RE +.P +The UID to set to when running package scripts as root\. +.SS userconfig +.RS 0 +.IP \(bu 2 +Default: ~/\.npmrc +.IP \(bu 2 +Type: path + +.RE +.P +The location of user\-level configuration settings\. +.SS umask +.RS 0 +.IP \(bu 2 +Default: 022 +.IP \(bu 2 +Type: Octal numeric string in range 0000\.\.0777 (0\.\.511) + +.RE +.P +The "umask" value to use when setting the file creation mode on files +and folders\. +.P +Folders and executables are given a mode which is \fB0777\fP masked against +this value\. Other files are given a mode which is \fB0666\fP masked against +this value\. Thus, the defaults are \fB0755\fP and \fB0644\fP respectively\. +.SS user\-agent +.RS 0 +.IP \(bu 2 +Default: node/{process\.version} {process\.platform} {process\.arch} +.IP \(bu 2 +Type: String + +.RE +.P +Sets a User\-Agent to the request header +.SS version +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: boolean + +.RE +.P +If true, output the npm version and exit successfully\. +.P +Only relevant when specified explicitly on the command line\. +.SS versions +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: boolean + +.RE +.P +If true, output the npm version as well as node's \fBprocess\.versions\fP map, and +exit successfully\. +.P +Only relevant when specified explicitly on the command line\. +.SS viewer +.RS 0 +.IP \(bu 2 +Default: "man" on Posix, "browser" on Windows +.IP \(bu 2 +Type: path + +.RE +.P +The program to use to view help content\. +.P +Set to \fB"browser"\fP to view html help content in the default web browser\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help config +.IP \(bu 2 +npm help 5 npmrc +.IP \(bu 2 +npm help 7 scripts +.IP \(bu 2 +npm help 5 folders +.IP \(bu 2 +npm help npm + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man7/npm-developers.7 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man7/npm-developers.7 new file mode 100644 index 00000000..9285ebb7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man7/npm-developers.7 @@ -0,0 +1,282 @@ +.TH "NPM\-DEVELOPERS" "7" "October 2016" "" "" +.SH "NAME" +\fBnpm-developers\fR \- Developer Guide +.SH DESCRIPTION +.P +So, you've decided to use npm to develop (and maybe publish/deploy) +your project\. +.P +Fantastic! +.P +There are a few things that you need to do above the simple steps +that your users will do to install your program\. +.SH About These Documents +.P +These are man pages\. If you install npm, you should be able to +then do \fBman npm\-thing\fP to get the documentation on a particular +topic, or \fBnpm help thing\fP to see the same information\. +.SH What is a \fBpackage\fP +.P +A package is: +.RS 0 +.IP \(bu 2 +a) a folder containing a program described by a package\.json file +.IP \(bu 2 +b) a gzipped tarball containing (a) +.IP \(bu 2 +c) a url that resolves to (b) +.IP \(bu 2 +d) a \fB@\fP that is published on the registry with (c) +.IP \(bu 2 +e) a \fB@\fP that points to (d) +.IP \(bu 2 +f) a \fB\fP that has a "latest" tag satisfying (e) +.IP \(bu 2 +g) a \fBgit\fP url that, when cloned, results in (a)\. + +.RE +.P +Even if you never publish your package, you can still get a lot of +benefits of using npm if you just want to write a node program (a), and +perhaps if you also want to be able to easily install it elsewhere +after packing it up into a tarball (b)\. +.P +Git urls can be of the form: +.P +.RS 2 +.nf +git://github\.com/user/project\.git#commit\-ish +git+ssh://user@hostname:project\.git#commit\-ish +git+http://user@hostname/project/blah\.git#commit\-ish +git+https://user@hostname/project/blah\.git#commit\-ish +.fi +.RE +.P +The \fBcommit\-ish\fP can be any tag, sha, or branch which can be supplied as +an argument to \fBgit checkout\fP\|\. The default is \fBmaster\fP\|\. +.SH The package\.json File +.P +You need to have a \fBpackage\.json\fP file in the root of your project to do +much of anything with npm\. That is basically the whole interface\. +.P +See npm help 5 \fBpackage\.json\fP for details about what goes in that file\. At the very +least, you need: +.RS 0 +.IP \(bu 2 +name: +This should be a string that identifies your project\. Please do not +use the name to specify that it runs on node, or is in JavaScript\. +You can use the "engines" field to explicitly state the versions of +node (or whatever else) that your program requires, and it's pretty +well assumed that it's javascript\. +It does not necessarily need to match your github repository name\. +So, \fBnode\-foo\fP and \fBbar\-js\fP are bad names\. \fBfoo\fP or \fBbar\fP are better\. +.IP \(bu 2 +version: +A semver\-compatible version\. +.IP \(bu 2 +engines: +Specify the versions of node (or whatever else) that your program +runs on\. The node API changes a lot, and there may be bugs or new +functionality that you depend on\. Be explicit\. +.IP \(bu 2 +author: +Take some credit\. +.IP \(bu 2 +scripts: +If you have a special compilation or installation script, then you +should put it in the \fBscripts\fP object\. You should definitely have at +least a basic smoke\-test command as the "scripts\.test" field\. +See npm help 7 scripts\. +.IP \(bu 2 +main: +If you have a single module that serves as the entry point to your +program (like what the "foo" package gives you at require("foo")), +then you need to specify that in the "main" field\. +.IP \(bu 2 +directories: +This is an object mapping names to folders\. The best ones to include are +"lib" and "doc", but if you use "man" to specify a folder full of man pages, +they'll get installed just like these ones\. + +.RE +.P +You can use \fBnpm init\fP in the root of your package in order to get you +started with a pretty basic package\.json file\. See npm help \fBnpm\-init\fP for +more info\. +.SH Keeping files \fIout\fR of your package +.P +Use a \fB\|\.npmignore\fP file to keep stuff out of your package\. If there's +no \fB\|\.npmignore\fP file, but there \fIis\fR a \fB\|\.gitignore\fP file, then npm will +ignore the stuff matched by the \fB\|\.gitignore\fP file\. If you \fIwant\fR to +include something that is excluded by your \fB\|\.gitignore\fP file, you can +create an empty \fB\|\.npmignore\fP file to override it\. Like \fBgit\fP, \fBnpm\fP looks +for \fB\|\.npmignore\fP and \fB\|\.gitignore\fP files in all subdirectories of your +package, not only the root directory\. +.P +\fB\|\.npmignore\fP files follow the same pattern rules \fIhttps://git\-scm\.com/book/en/v2/Git\-Basics\-Recording\-Changes\-to\-the\-Repository#Ignoring\-Files\fR +as \fB\|\.gitignore\fP files: +.RS 0 +.IP \(bu 2 +Blank lines or lines starting with \fB#\fP are ignored\. +.IP \(bu 2 +Standard glob patterns work\. +.IP \(bu 2 +You can end patterns with a forward slash \fB/\fP to specify a directory\. +.IP \(bu 2 +You can negate a pattern by starting it with an exclamation point \fB!\fP\|\. + +.RE +.P +By default, the following paths and files are ignored, so there's no +need to add them to \fB\|\.npmignore\fP explicitly: +.RS 0 +.IP \(bu 2 +\fB\|\.*\.swp\fP +.IP \(bu 2 +\fB\|\._*\fP +.IP \(bu 2 +\fB\|\.DS_Store\fP +.IP \(bu 2 +\fB\|\.git\fP +.IP \(bu 2 +\fB\|\.hg\fP +.IP \(bu 2 +\fB\|\.npmrc\fP +.IP \(bu 2 +\fB\|\.lock\-wscript\fP +.IP \(bu 2 +\fB\|\.svn\fP +.IP \(bu 2 +\fB\|\.wafpickle\-*\fP +.IP \(bu 2 +\fBconfig\.gypi\fP +.IP \(bu 2 +\fBCVS\fP +.IP \(bu 2 +\fBnpm\-debug\.log\fP + +.RE +.P +Additionally, everything in \fBnode_modules\fP is ignored, except for +bundled dependencies\. npm automatically handles this for you, so don't +bother adding \fBnode_modules\fP to \fB\|\.npmignore\fP\|\. +.P +The following paths and files are never ignored, so adding them to +\fB\|\.npmignore\fP is pointless: +.RS 0 +.IP \(bu 2 +\fBpackage\.json\fP +.IP \(bu 2 +\fBREADME\fP (and its variants) +.IP \(bu 2 +\fBCHANGELOG\fP (and its variants) +.IP \(bu 2 +\fBLICENSE\fP / \fBLICENCE\fP + +.RE +.SH Link Packages +.P +\fBnpm link\fP is designed to install a development package and see the +changes in real time without having to keep re\-installing it\. (You do +need to either re\-link or \fBnpm rebuild \-g\fP to update compiled packages, +of course\.) +.P +More info at npm help \fBnpm\-link\fP\|\. +.SH Before Publishing: Make Sure Your Package Installs and Works +.P +\fBThis is important\.\fR +.P +If you can not install it locally, you'll have +problems trying to publish it\. Or, worse yet, you'll be able to +publish it, but you'll be publishing a broken or pointless package\. +So don't do that\. +.P +In the root of your package, do this: +.P +.RS 2 +.nf +npm install \. \-g +.fi +.RE +.P +That'll show you that it's working\. If you'd rather just create a symlink +package that points to your working directory, then do this: +.P +.RS 2 +.nf +npm link +.fi +.RE +.P +Use \fBnpm ls \-g\fP to see if it's there\. +.P +To test a local install, go into some other folder, and then do: +.P +.RS 2 +.nf +cd \.\./some\-other\-folder +npm install \.\./my\-package +.fi +.RE +.P +to install it locally into the node_modules folder in that other place\. +.P +Then go into the node\-repl, and try using require("my\-thing") to +bring in your module's main module\. +.SH Create a User Account +.P +Create a user with the adduser command\. It works like this: +.P +.RS 2 +.nf +npm adduser +.fi +.RE +.P +and then follow the prompts\. +.P +This is documented better in npm help adduser\. +.SH Publish your package +.P +This part's easy\. In the root of your folder, do this: +.P +.RS 2 +.nf +npm publish +.fi +.RE +.P +You can give publish a url to a tarball, or a filename of a tarball, +or a path to a folder\. +.P +Note that pretty much \fBeverything in that folder will be exposed\fR +by default\. So, if you have secret stuff in there, use a +\fB\|\.npmignore\fP file to list out the globs to ignore, or publish +from a fresh checkout\. +.SH Brag about it +.P +Send emails, write blogs, blab in IRC\. +.P +Tell the world how easy it is to install your program! +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help 7 faq +.IP \(bu 2 +npm help npm +.IP \(bu 2 +npm help init +.IP \(bu 2 +npm help 5 package\.json +.IP \(bu 2 +npm help 7 scripts +.IP \(bu 2 +npm help publish +.IP \(bu 2 +npm help adduser +.IP \(bu 2 +npm help 7 registry + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man7/npm-disputes.7 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man7/npm-disputes.7 new file mode 100644 index 00000000..2a091216 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man7/npm-disputes.7 @@ -0,0 +1,124 @@ +.TH "NPM\-DISPUTES" "7" "October 2016" "" "" +.SH "NAME" +\fBnpm-disputes\fR \- Handling Module Name Disputes +.SH SYNOPSIS +.RS 0 +.IP 1. 3 +Get the author email with \fBnpm owner ls \fP +.IP 2. 3 +Email the author, CC support@npmjs\.com +.IP 3. 3 +After a few weeks, if there's no resolution, we'll sort it out\. + +.RE +.P +Don't squat on package names\. Publish code or move out of the way\. +.SH DESCRIPTION +.P +There sometimes arise cases where a user publishes a module, and then +later, some other user wants to use that name\. Here are some common +ways that happens (each of these is based on actual events\.) +.RS 0 +.IP 1. 3 +Joe writes a JavaScript module \fBfoo\fP, which is not node\-specific\. +Joe doesn't use node at all\. Bob wants to use \fBfoo\fP in node, so he +wraps it in an npm module\. Some time later, Joe starts using node, +and wants to take over management of his program\. +.IP 2. 3 +Bob writes an npm module \fBfoo\fP, and publishes it\. Perhaps much +later, Joe finds a bug in \fBfoo\fP, and fixes it\. He sends a pull +request to Bob, but Bob doesn't have the time to deal with it, +because he has a new job and a new baby and is focused on his new +erlang project, and kind of not involved with node any more\. Joe +would like to publish a new \fBfoo\fP, but can't, because the name is +taken\. +.IP 3. 3 +Bob writes a 10\-line flow\-control library, and calls it \fBfoo\fP, and +publishes it to the npm registry\. Being a simple little thing, it +never really has to be updated\. Joe works for Foo Inc, the makers +of the critically acclaimed and widely\-marketed \fBfoo\fP JavaScript +toolkit framework\. They publish it to npm as \fBfoojs\fP, but people are +routinely confused when \fBnpm install foo\fP is some different thing\. +.IP 4. 3 +Bob writes a parser for the widely\-known \fBfoo\fP file format, because +he needs it for work\. Then, he gets a new job, and never updates the +prototype\. Later on, Joe writes a much more complete \fBfoo\fP parser, +but can't publish, because Bob's \fBfoo\fP is in the way\. + +.RE +.P +The validity of Joe's claim in each situation can be debated\. However, +Joe's appropriate course of action in each case is the same\. +.RS 0 +.IP 1. 3 +\fBnpm owner ls foo\fP\|\. This will tell Joe the email address of the +owner (Bob)\. +.IP 2. 3 +Joe emails Bob, explaining the situation \fBas respectfully as +possible\fR, and what he would like to do with the module name\. He +adds the npm support staff support@npmjs\.com to the CC list of +the email\. Mention in the email that Bob can run \fBnpm owner add +joe foo\fP to add Joe as an owner of the \fBfoo\fP package\. +.IP 3. 3 +After a reasonable amount of time, if Bob has not responded, or if +Bob and Joe can't come to any sort of resolution, email support +support@npmjs\.com and we'll sort it out\. ("Reasonable" is +usually at least 4 weeks, but extra time is allowed around common +holidays\.) + +.RE +.SH REASONING +.P +In almost every case so far, the parties involved have been able to reach +an amicable resolution without any major intervention\. Most people +really do want to be reasonable, and are probably not even aware that +they're in your way\. +.P +Module ecosystems are most vibrant and powerful when they are as +self\-directed as possible\. If an admin one day deletes something you +had worked on, then that is going to make most people quite upset, +regardless of the justification\. When humans solve their problems by +talking to other humans with respect, everyone has the chance to end up +feeling good about the interaction\. +.SH EXCEPTIONS +.P +Some things are not allowed, and will be removed without discussion if +they are brought to the attention of the npm registry admins, including +but not limited to: +.RS 0 +.IP 1. 3 +Malware (that is, a package designed to exploit or harm the machine on +which it is installed)\. +.IP 2. 3 +Violations of copyright or licenses (for example, cloning an +MIT\-licensed program, and then removing or changing the copyright and +license statement)\. +.IP 3. 3 +Illegal content\. +.IP 4. 3 +"Squatting" on a package name that you \fIplan\fR to use, but aren't +actually using\. Sorry, I don't care how great the name is, or how +perfect a fit it is for the thing that someday might happen\. If +someone wants to use it today, and you're just taking up space with +an empty tarball, you're going to be evicted\. +.IP 5. 3 +Putting empty packages in the registry\. Packages must have SOME +functionality\. It can be silly, but it can't be \fInothing\fR\|\. (See +also: squatting\.) +.IP 6. 3 +Doing weird things with the registry, like using it as your own +personal application database or otherwise putting non\-packagey +things into it\. + +.RE +.P +If you see bad behavior like this, please report it right away\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help 7 registry +.IP \(bu 2 +npm help owner + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man7/npm-index.7 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man7/npm-index.7 new file mode 100644 index 00000000..e7c9f42d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man7/npm-index.7 @@ -0,0 +1,334 @@ +.TH "NPM\-INDEX" "7" "October 2016" "" "" +.SH "NAME" +\fBnpm-index\fR \- Index of all npm documentation +.SS npm help README +.P +a JavaScript package manager +.SH Command Line Documentation +.P +Using npm on the command line +.SS npm help npm +.P +javascript package manager +.SS npm help access +.P +Set access level on published packages +.SS npm help adduser +.P +Add a registry user account +.SS npm help bin +.P +Display npm bin folder +.SS npm help bugs +.P +Bugs for a package in a web browser maybe +.SS npm help build +.P +Build a package +.SS npm help bundle +.P +REMOVED +.SS npm help cache +.P +Manipulates packages cache +.SS npm help completion +.P +Tab Completion for npm +.SS npm help config +.P +Manage the npm configuration files +.SS npm help dedupe +.P +Reduce duplication +.SS npm help deprecate +.P +Deprecate a version of a package +.SS npm help dist\-tag +.P +Modify package distribution tags +.SS npm help docs +.P +Docs for a package in a web browser maybe +.SS npm help edit +.P +Edit an installed package +.SS npm help explore +.P +Browse an installed package +.SS npm help help\-search +.P +Search npm help documentation +.SS npm help help +.P +Get help on npm +.SS npm help init +.P +Interactively create a package\.json file +.SS npm help install +.P +Install a package +.SS npm help link +.P +Symlink a package folder +.SS npm help logout +.P +Log out of the registry +.SS npm help ls +.P +List installed packages +.SS npm help outdated +.P +Check for outdated packages +.SS npm help owner +.P +Manage package owners +.SS npm help pack +.P +Create a tarball from a package +.SS npm help ping +.P +Ping npm registry +.SS npm help prefix +.P +Display prefix +.SS npm help prune +.P +Remove extraneous packages +.SS npm help publish +.P +Publish a package +.SS npm help rebuild +.P +Rebuild a package +.SS npm help repo +.P +Open package repository page in the browser +.SS npm help restart +.P +Restart a package +.SS npm help rm +.P +Remove a package +.SS npm help root +.P +Display npm root +.SS npm help run\-script +.P +Run arbitrary package scripts +.SS npm help search +.P +Search for packages +.SS npm help shrinkwrap +.P +Lock down dependency versions +.SS npm help star +.P +Mark your favorite packages +.SS npm help stars +.P +View packages marked as favorites +.SS npm help start +.P +Start a package +.SS npm help stop +.P +Stop a package +.SS npm help tag +.P +Tag a published version +.SS npm help team +.P +Manage organization teams and team memberships +.SS npm help test +.P +Test a package +.SS npm help uninstall +.P +Remove a package +.SS npm help unpublish +.P +Remove a package from the registry +.SS npm help update +.P +Update a package +.SS npm help version +.P +Bump a package version +.SS npm help view +.P +View registry info +.SS npm help whoami +.P +Display npm username +.SH API Documentation +.P +Using npm in your Node programs +.SS npm apihelp npm +.P +javascript package manager +.SS npm apihelp bin +.P +Display npm bin folder +.SS npm apihelp bugs +.P +Bugs for a package in a web browser maybe +.SS npm apihelp cache +.P +manage the npm cache programmatically +.SS npm apihelp commands +.P +npm commands +.SS npm apihelp config +.P +Manage the npm configuration files +.SS npm apihelp deprecate +.P +Deprecate a version of a package +.SS npm apihelp docs +.P +Docs for a package in a web browser maybe +.SS npm apihelp edit +.P +Edit an installed package +.SS npm apihelp explore +.P +Browse an installed package +.SS npm apihelp help\-search +.P +Search the help pages +.SS npm apihelp init +.P +Interactively create a package\.json file +.SS npm apihelp install +.P +install a package programmatically +.SS npm apihelp link +.P +Symlink a package folder +.SS npm apihelp load +.P +Load config settings +.SS npm apihelp ls +.P +List installed packages +.SS npm apihelp outdated +.P +Check for outdated packages +.SS npm apihelp owner +.P +Manage package owners +.SS npm apihelp pack +.P +Create a tarball from a package +.SS npm apihelp ping +.P +Ping npm registry +.SS npm apihelp prefix +.P +Display prefix +.SS npm apihelp prune +.P +Remove extraneous packages +.SS npm apihelp publish +.P +Publish a package +.SS npm apihelp rebuild +.P +Rebuild a package +.SS npm apihelp repo +.P +Open package repository page in the browser +.SS npm apihelp restart +.P +Restart a package +.SS npm apihelp root +.P +Display npm root +.SS npm apihelp run\-script +.P +Run arbitrary package scripts +.SS npm apihelp search +.P +Search for packages +.SS npm apihelp shrinkwrap +.P +programmatically generate package shrinkwrap file +.SS npm apihelp start +.P +Start a package +.SS npm apihelp stop +.P +Stop a package +.SS npm apihelp tag +.P +Tag a published version +.SS npm apihelp test +.P +Test a package +.SS npm apihelp uninstall +.P +uninstall a package programmatically +.SS npm apihelp unpublish +.P +Remove a package from the registry +.SS npm apihelp update +.P +Update a package +.SS npm apihelp version +.P +Bump a package version +.SS npm apihelp view +.P +View registry info +.SS npm apihelp whoami +.P +Display npm username +.SH Files +.P +File system structures npm uses +.SS npm help 5 folders +.P +Folder Structures Used by npm +.SS npm help 5 npmrc +.P +The npm config files +.SS npm help 5 package\.json +.P +Specifics of npm's package\.json handling +.SH Misc +.P +Various other bits and bobs +.SS npm help 7 coding\-style +.P +npm's "funny" coding style +.SS npm help 7 config +.P +More than you probably want to know about npm configuration +.SS npm help 7 developers +.P +Developer Guide +.SS npm help 7 disputes +.P +Handling Module Name Disputes +.SS npm help 7 index +.P +Index of all npm documentation +.SS npm help 7 orgs +.P +Working with Teams & Orgs +.SS npm help 7 registry +.P +The JavaScript Package Registry +.SS npm help 7 scope +.P +Scoped packages +.SS npm help 7 scripts +.P +How npm handles the "scripts" field +.SS npm help 7 removing\-npm +.P +Cleaning the Slate +.SS npm help 7 semver +.P +The semantic versioner for npm + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man7/npm-orgs.7 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man7/npm-orgs.7 new file mode 100644 index 00000000..788228df --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man7/npm-orgs.7 @@ -0,0 +1,146 @@ +.TH "NPM\-ORGS" "7" "October 2016" "" "" +.SH "NAME" +\fBnpm-orgs\fR \- Working with Teams & Orgs +.SH DESCRIPTION +.P +There are three levels of org users: +.RS 0 +.IP 1. 3 +Super admin, controls billing & adding people to the org\. +.IP 2. 3 +Team admin, manages team membership & package access\. +.IP 3. 3 +Developer, works on packages they are given access to\. + +.RE +.P +The super admin is the only person who can add users to the org because it impacts the monthly bill\. The super admin will use the website to manage membership\. Every org has a \fBdevelopers\fP team that all users are automatically added to\. +.P +The team admin is the person who manages team creation, team membership, and package access for teams\. The team admin grants package access to teams, not individuals\. +.P +The developer will be able to access packages based on the teams they are on\. Access is either read\-write or read\-only\. +.P +There are two main commands: +.RS 0 +.IP 1. 3 +\fBnpm team\fP see npm help team for more details +.IP 2. 3 +\fBnpm access\fP see npm help access for more details + +.RE +.SH Team Admins create teams +.RS 0 +.IP \(bu 2 +Check who you’ve added to your org: + +.RE +.P +.RS 2 +.nf +npm team ls :developers +.fi +.RE +.RS 0 +.IP \(bu 2 +Each org is automatically given a \fBdevelopers\fP team, so you can see the whole list of team members in your org\. This team automatically gets read\-write access to all packages, but you can change that with the \fBaccess\fP command\. +.IP \(bu 2 +Create a new team: + +.RE +.P +.RS 2 +.nf +npm team create +.fi +.RE +.RS 0 +.IP \(bu 2 +Add members to that team: + +.RE +.P +.RS 2 +.nf +npm team add +.fi +.RE +.SH Publish a package and adjust package access +.RS 0 +.IP \(bu 2 +In package directory, run + +.RE +.P +.RS 2 +.nf +npm init \-\-scope= +.fi +.RE +.P +to scope it for your org & publish as usual +.RS 0 +.IP \(bu 2 +Grant access: + +.RE +.P +.RS 2 +.nf +npm access grant [] +.fi +.RE +.RS 0 +.IP \(bu 2 +Revoke access: + +.RE +.P +.RS 2 +.nf +npm access revoke [] +.fi +.RE +.SH Monitor your package access +.RS 0 +.IP \(bu 2 +See what org packages a team member can access: + +.RE +.P +.RS 2 +.nf +npm access ls\-packages +.fi +.RE +.RS 0 +.IP \(bu 2 +See packages available to a specific team: + +.RE +.P +.RS 2 +.nf +npm access ls\-packages +.fi +.RE +.RS 0 +.IP \(bu 2 +Check which teams are collaborating on a package: + +.RE +.P +.RS 2 +.nf +npm access ls\-collaborators +.fi +.RE +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help team +.IP \(bu 2 +npm help access +.IP \(bu 2 +npm help 7 scope + +.RE diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man7/npm-registry.7 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man7/npm-registry.7 new file mode 100644 index 00000000..c168fec4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man7/npm-registry.7 @@ -0,0 +1,71 @@ +.TH "NPM\-REGISTRY" "7" "October 2016" "" "" +.SH "NAME" +\fBnpm-registry\fR \- The JavaScript Package Registry +.SH DESCRIPTION +.P +To resolve packages by name and version, npm talks to a registry website +that implements the CommonJS Package Registry specification for reading +package info\. +.P +Additionally, npm's package registry implementation supports several +write APIs as well, to allow for publishing packages and managing user +account information\. +.P +The official public npm registry is at https://registry\.npmjs\.org/\|\. It +is powered by a CouchDB database, of which there is a public mirror at +https://skimdb\.npmjs\.com/registry\|\. The code for the couchapp is +available at https://github\.com/npm/npm\-registry\-couchapp\|\. +.P +The registry URL used is determined by the scope of the package (see +npm help 7 \fBnpm\-scope\fP)\. If no scope is specified, the default registry is used, which is +supplied by the \fBregistry\fP config parameter\. See npm help \fBnpm\-config\fP, +npm help 5 \fBnpmrc\fP, and npm help 7 \fBnpm\-config\fP for more on managing npm's configuration\. +.SH Can I run my own private registry? +.P +Yes! +.P +The easiest way is to replicate the couch database, and use the same (or +similar) design doc to implement the APIs\. +.P +If you set up continuous replication from the official CouchDB, and then +set your internal CouchDB as the registry config, then you'll be able +to read any published packages, in addition to your private ones, and by +default will only publish internally\. +.P +If you then want to publish a package for the whole world to see, you can +simply override the \fB\-\-registry\fP option for that \fBpublish\fP command\. +.SH I don't want my package published in the official registry\. It's private\. +.P +Set \fB"private": true\fP in your package\.json to prevent it from being +published at all, or +\fB"publishConfig":{"registry":"http://my\-internal\-registry\.local"}\fP +to force it to be published only to your internal registry\. +.P +See npm help 5 \fBpackage\.json\fP for more info on what goes in the package\.json file\. +.SH Will you replicate from my registry into the public one? +.P +No\. If you want things to be public, then publish them into the public +registry using npm\. What little security there is would be for nought +otherwise\. +.SH Do I have to use couchdb to build a registry that npm can talk to? +.P +No, but it's way easier\. Basically, yes, you do, or you have to +effectively implement the entire CouchDB API anyway\. +.SH Is there a website or something to see package docs and such? +.P +Yes, head over to https://npmjs\.com/ +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help config +.IP \(bu 2 +npm help 7 config +.IP \(bu 2 +npm help 5 npmrc +.IP \(bu 2 +npm help 7 developers +.IP \(bu 2 +npm help 7 disputes + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man7/npm-scope.7 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man7/npm-scope.7 new file mode 100644 index 00000000..585f689e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man7/npm-scope.7 @@ -0,0 +1,130 @@ +.TH "NPM\-SCOPE" "7" "October 2016" "" "" +.SH "NAME" +\fBnpm-scope\fR \- Scoped packages +.SH DESCRIPTION +.P +All npm packages have a name\. Some package names also have a scope\. A scope +follows the usual rules for package names (url\-safe characters, no leading dots +or underscores)\. When used in package names, preceded by an @\-symbol and +followed by a slash, e\.g\. +.P +.RS 2 +.nf +@somescope/somepackagename +.fi +.RE +.P +Scopes are a way of grouping related packages together, and also affect a few +things about the way npm treats the package\. +.P +Scoped packages can be published and installed as of \fBnpm@2\fP and are supported +by the primary npm registry\. The npm client is backwards\-compatible with +un\-scoped registries, so it can be used to work with scoped and un\-scoped +registries at the same time\. +.SH Installing scoped packages +.P +Scoped packages are installed to a sub\-folder of the regular installation +folder, e\.g\. if your other packages are installed in \fBnode_modules/packagename\fP, +scoped modules will be in \fBnode_modules/@myorg/packagename\fP\|\. The scope folder +(\fB@myorg\fP) is simply the name of the scope preceded by an @\-symbol, and can +contain any number of scoped packages\. +.P +A scoped package is installed by referencing it by name, preceded by an +@\-symbol, in \fBnpm install\fP: +.P +.RS 2 +.nf +npm install @myorg/mypackage +.fi +.RE +.P +Or in \fBpackage\.json\fP: +.P +.RS 2 +.nf +"dependencies": { + "@myorg/mypackage": "^1\.3\.0" +} +.fi +.RE +.P +Note that if the @\-symbol is omitted in either case npm will instead attempt to +install from GitHub; see npm help \fBnpm\-install\fP\|\. +.SH Requiring scoped packages +.P +Because scoped packages are installed into a scope folder, you have to +include the name of the scope when requiring them in your code, e\.g\. +.P +.RS 2 +.nf +require('@myorg/mypackage') +.fi +.RE +.P +There is nothing special about the way Node treats scope folders, this is +just specifying to require the module \fBmypackage\fP in the folder called \fB@myorg\fP\|\. +.SH Publishing scoped packages +.P +Scoped packages can be published from the CLI as of \fBnpm@2\fP and can be +published to any registry that supports them, including the primary npm +registry\. +.P +(As of 2015\-04\-19, and with npm 2\.0 or newer, the primary npm registry \fBdoes\fR +support scoped packages) +.P +If you wish, you may associate a scope with a registry; see below\. +.SS Publishing public scoped packages to the primary npm registry +.P +To publish a public scoped package, you must specify \fB\-\-access public\fP with +the initial publication\. This will publish the package and set access +to \fBpublic\fP as if you had run \fBnpm access public\fP after publishing\. +.SS Publishing private scoped packages to the npm registry +.P +To publish a private scoped package to the npm registry, you must have +an npm Private Modules \fIhttps://www\.npmjs\.com/private\-modules\fR +account\. +.P +You can then publish the module with \fBnpm publish\fP or \fBnpm publish +\-\-access restricted\fP, and it will be present in the npm registry, with +restricted access\. You can then change the access permissions, if +desired, with \fBnpm access\fP or on the npmjs\.com website\. +.SH Associating a scope with a registry +.P +Scopes can be associated with a separate registry\. This allows you to +seamlessly use a mix of packages from the primary npm registry and one or more +private registries, such as npm Enterprise\. +.P +You can associate a scope with a registry at login, e\.g\. +.P +.RS 2 +.nf +npm login \-\-registry=http://reg\.example\.com \-\-scope=@myco +.fi +.RE +.P +Scopes have a many\-to\-one relationship with registries: one registry can +host multiple scopes, but a scope only ever points to one registry\. +.P +You can also associate a scope with a registry using \fBnpm config\fP: +.P +.RS 2 +.nf +npm config set @myco:registry http://reg\.example\.com +.fi +.RE +.P +Once a scope is associated with a registry, any \fBnpm install\fP for a package +with that scope will request packages from that registry instead\. Any +\fBnpm publish\fP for a package name that contains the scope will be published to +that registry instead\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help install +.IP \(bu 2 +npm help publish +.IP \(bu 2 +npm help access + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man7/npm-scripts.7 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man7/npm-scripts.7 new file mode 100644 index 00000000..3eeaed71 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man7/npm-scripts.7 @@ -0,0 +1,285 @@ +.TH "NPM\-SCRIPTS" "7" "October 2016" "" "" +.SH "NAME" +\fBnpm-scripts\fR \- How npm handles the "scripts" field +.SH DESCRIPTION +.P +npm supports the "scripts" property of the package\.json script, for the +following scripts: +.RS 0 +.IP \(bu 2 +prepublish: +Run BEFORE the package is published\. (Also run on local \fBnpm +install\fP without any arguments\.) +.IP \(bu 2 +publish, postpublish: +Run AFTER the package is published\. +.IP \(bu 2 +preinstall: +Run BEFORE the package is installed +.IP \(bu 2 +install, postinstall: +Run AFTER the package is installed\. +.IP \(bu 2 +preuninstall, uninstall: +Run BEFORE the package is uninstalled\. +.IP \(bu 2 +postuninstall: +Run AFTER the package is uninstalled\. +.IP \(bu 2 +preversion, version: +Run BEFORE bumping the package version\. +.IP \(bu 2 +postversion: +Run AFTER bumping the package version\. +.IP \(bu 2 +pretest, test, posttest: +Run by the \fBnpm test\fP command\. +.IP \(bu 2 +prestop, stop, poststop: +Run by the \fBnpm stop\fP command\. +.IP \(bu 2 +prestart, start, poststart: +Run by the \fBnpm start\fP command\. +.IP \(bu 2 +prerestart, restart, postrestart: +Run by the \fBnpm restart\fP command\. Note: \fBnpm restart\fP will run the +stop and start scripts if no \fBrestart\fP script is provided\. + +.RE +.P +Additionally, arbitrary scripts can be executed by running \fBnpm +run\-script \fP\|\. \fIPre\fR and \fIpost\fR commands with matching +names will be run for those as well (e\.g\. \fBpremyscript\fP, \fBmyscript\fP, +\fBpostmyscript\fP)\. Scripts from dependencies can be run with `npm explore +.P + \-\- npm run `\. +.SH COMMON USES +.P +If you need to perform operations on your package before it is used, in a way +that is not dependent on the operating system or architecture of the +target system, use a \fBprepublish\fP script\. This includes +tasks such as: +.RS 0 +.IP \(bu 2 +Compiling CoffeeScript source code into JavaScript\. +.IP \(bu 2 +Creating minified versions of JavaScript source code\. +.IP \(bu 2 +Fetching remote resources that your package will use\. + +.RE +.P +The advantage of doing these things at \fBprepublish\fP time is that they can be done once, in a +single place, thus reducing complexity and variability\. +Additionally, this means that: +.RS 0 +.IP \(bu 2 +You can depend on \fBcoffee\-script\fP as a \fBdevDependency\fP, and thus +your users don't need to have it installed\. +.IP \(bu 2 +You don't need to include minifiers in your package, reducing +the size for your users\. +.IP \(bu 2 +You don't need to rely on your users having \fBcurl\fP or \fBwget\fP or +other system tools on the target machines\. + +.RE +.SH DEFAULT VALUES +.P +npm will default some script values based on package contents\. +.RS 0 +.IP \(bu 2 +\fB"start": "node server\.js"\fP: +If there is a \fBserver\.js\fP file in the root of your package, then npm +will default the \fBstart\fP command to \fBnode server\.js\fP\|\. +.IP \(bu 2 +\fB"install": "node\-gyp rebuild"\fP: +If there is a \fBbinding\.gyp\fP file in the root of your package and you +haven't defined your own \fBinstall\fP or \fBpreinstall\fP scripts, npm will +default the \fBinstall\fP command to compile using node\-gyp\. + +.RE +.SH USER +.P +If npm was invoked with root privileges, then it will change the uid +to the user account or uid specified by the \fBuser\fP config, which +defaults to \fBnobody\fP\|\. Set the \fBunsafe\-perm\fP flag to run scripts with +root privileges\. +.SH ENVIRONMENT +.P +Package scripts run in an environment where many pieces of information +are made available regarding the setup of npm and the current state of +the process\. +.SS path +.P +If you depend on modules that define executable scripts, like test +suites, then those executables will be added to the \fBPATH\fP for +executing the scripts\. So, if your package\.json has this: +.P +.RS 2 +.nf +{ "name" : "foo" +, "dependencies" : { "bar" : "0\.1\.x" } +, "scripts": { "start" : "bar \./test" } } +.fi +.RE +.P +then you could run \fBnpm start\fP to execute the \fBbar\fP script, which is +exported into the \fBnode_modules/\.bin\fP directory on \fBnpm install\fP\|\. +.SS package\.json vars +.P +The package\.json fields are tacked onto the \fBnpm_package_\fP prefix\. So, +for instance, if you had \fB{"name":"foo", "version":"1\.2\.5"}\fP in your +package\.json file, then your package scripts would have the +\fBnpm_package_name\fP environment variable set to "foo", and the +\fBnpm_package_version\fP set to "1\.2\.5" +.SS configuration +.P +Configuration parameters are put in the environment with the +\fBnpm_config_\fP prefix\. For instance, you can view the effective \fBroot\fP +config by checking the \fBnpm_config_root\fP environment variable\. +.SS Special: package\.json "config" object +.P +The package\.json "config" keys are overwritten in the environment if +there is a config param of \fB[@]:\fP\|\. For example, +if the package\.json has this: +.P +.RS 2 +.nf +{ "name" : "foo" +, "config" : { "port" : "8080" } +, "scripts" : { "start" : "node server\.js" } } +.fi +.RE +.P +and the server\.js is this: +.P +.RS 2 +.nf +http\.createServer(\.\.\.)\.listen(process\.env\.npm_package_config_port) +.fi +.RE +.P +then the user could change the behavior by doing: +.P +.RS 2 +.nf +npm config set foo:port 80 +.fi +.RE +.SS current lifecycle event +.P +Lastly, the \fBnpm_lifecycle_event\fP environment variable is set to +whichever stage of the cycle is being executed\. So, you could have a +single script used for different parts of the process which switches +based on what's currently happening\. +.P +Objects are flattened following this format, so if you had +\fB{"scripts":{"install":"foo\.js"}}\fP in your package\.json, then you'd +see this in the script: +.P +.RS 2 +.nf +process\.env\.npm_package_scripts_install === "foo\.js" +.fi +.RE +.SH EXAMPLES +.P +For example, if your package\.json contains this: +.P +.RS 2 +.nf +{ "scripts" : + { "install" : "scripts/install\.js" + , "postinstall" : "scripts/install\.js" + , "uninstall" : "scripts/uninstall\.js" + } +} +.fi +.RE +.P +then \fBscripts/install\.js\fP will be called for the install +and post\-install stages of the lifecycle, and \fBscripts/uninstall\.js\fP +will be called when the package is uninstalled\. Since +\fBscripts/install\.js\fP is running for two different phases, it would +be wise in this case to look at the \fBnpm_lifecycle_event\fP environment +variable\. +.P +If you want to run a make command, you can do so\. This works just +fine: +.P +.RS 2 +.nf +{ "scripts" : + { "preinstall" : "\./configure" + , "install" : "make && make install" + , "test" : "make test" + } +} +.fi +.RE +.SH EXITING +.P +Scripts are run by passing the line as a script argument to \fBsh\fP\|\. +.P +If the script exits with a code other than 0, then this will abort the +process\. +.P +Note that these script files don't have to be nodejs or even +javascript programs\. They just have to be some kind of executable +file\. +.SH HOOK SCRIPTS +.P +If you want to run a specific script at a specific lifecycle event for +ALL packages, then you can use a hook script\. +.P +Place an executable file at \fBnode_modules/\.hooks/{eventname}\fP, and +it'll get run for all packages when they are going through that point +in the package lifecycle for any packages installed in that root\. +.P +Hook scripts are run exactly the same way as package\.json scripts\. +That is, they are in a separate child process, with the env described +above\. +.SH BEST PRACTICES +.RS 0 +.IP \(bu 2 +Don't exit with a non\-zero error code unless you \fIreally\fR mean it\. +Except for uninstall scripts, this will cause the npm action to +fail, and potentially be rolled back\. If the failure is minor or +only will prevent some optional features, then it's better to just +print a warning and exit successfully\. +.IP \(bu 2 +Try not to use scripts to do what npm can do for you\. Read through +npm help 5 \fBpackage\.json\fP to see all the things that you can specify and enable +by simply describing your package appropriately\. In general, this +will lead to a more robust and consistent state\. +.IP \(bu 2 +Inspect the env to determine where to put things\. For instance, if +the \fBnpm_config_binroot\fP environment variable is set to \fB/home/user/bin\fP, then +don't try to install executables into \fB/usr/local/bin\fP\|\. The user +probably set it up that way for a reason\. +.IP \(bu 2 +Don't prefix your script commands with "sudo"\. If root permissions +are required for some reason, then it'll fail with that error, and +the user will sudo the npm command in question\. +.IP \(bu 2 +Don't use \fBinstall\fP\|\. Use a \fB\|\.gyp\fP file for compilation, and \fBprepublish\fP +for anything else\. You should almost never have to explicitly set a +preinstall or install script\. If you are doing this, please consider if +there is another option\. The only valid use of \fBinstall\fP or \fBpreinstall\fP +scripts is for compilation which must be done on the target architecture\. + +.RE +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help run\-script +.IP \(bu 2 +npm help 5 package\.json +.IP \(bu 2 +npm help 7 developers +.IP \(bu 2 +npm help install + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man7/removing-npm.7 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man7/removing-npm.7 new file mode 100644 index 00000000..2565ce29 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man7/removing-npm.7 @@ -0,0 +1,78 @@ +.TH "NPM\-REMOVAL" "1" "October 2016" "" "" +.SH "NAME" +\fBnpm-removal\fR \- Cleaning the Slate +.SH SYNOPSIS +.P +So sad to see you go\. +.P +.RS 2 +.nf +sudo npm uninstall npm \-g +.fi +.RE +.P +Or, if that fails, get the npm source code, and do: +.P +.RS 2 +.nf +sudo make uninstall +.fi +.RE +.SH More Severe Uninstalling +.P +Usually, the above instructions are sufficient\. That will remove +npm, but leave behind anything you've installed\. +.P +If that doesn't work, or if you require more drastic measures, +continue reading\. +.P +Note that this is only necessary for globally\-installed packages\. Local +installs are completely contained within a project's \fBnode_modules\fP +folder\. Delete that folder, and everything is gone (unless a package's +install script is particularly ill\-behaved)\. +.P +This assumes that you installed node and npm in the default place\. If +you configured node with a different \fB\-\-prefix\fP, or installed npm with a +different prefix setting, then adjust the paths accordingly, replacing +\fB/usr/local\fP with your install prefix\. +.P +To remove everything npm\-related manually: +.P +.RS 2 +.nf +rm \-rf /usr/local/{lib/node{,/\.npm,_modules},bin,share/man}/npm* +.fi +.RE +.P +If you installed things \fIwith\fR npm, then your best bet is to uninstall +them with npm first, and then install them again once you have a +proper install\. This can help find any symlinks that are lying +around: +.P +.RS 2 +.nf +ls \-laF /usr/local/{lib/node{,/\.npm},bin,share/man} | grep npm +.fi +.RE +.P +Prior to version 0\.3, npm used shim files for executables and node +modules\. To track those down, you can do the following: +.P +.RS 2 +.nf +find /usr/local/{lib/node,bin} \-exec grep \-l npm \\{\\} \\; ; +.fi +.RE +.P +(This is also in the README file\.) +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +README +.IP \(bu 2 +npm help uninstall +.IP \(bu 2 +npm help prune + +.RE + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man7/semver.7 b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man7/semver.7 new file mode 100644 index 00000000..95c05ffa --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/man/man7/semver.7 @@ -0,0 +1,414 @@ +.TH "SEMVER" "7" "October 2016" "" "" +.SH "NAME" +\fBsemver\fR \- The semantic versioner for npm +.SH Usage +.P +.RS 2 +.nf +$ npm install semver + +semver\.valid('1\.2\.3') // '1\.2\.3' +semver\.valid('a\.b\.c') // null +semver\.clean(' =v1\.2\.3 ') // '1\.2\.3' +semver\.satisfies('1\.2\.3', '1\.x || >=2\.5\.0 || 5\.0\.0 \- 7\.2\.3') // true +semver\.gt('1\.2\.3', '9\.8\.7') // false +semver\.lt('1\.2\.3', '9\.8\.7') // true +.fi +.RE +.P +As a command\-line utility: +.P +.RS 2 +.nf +$ semver \-h + +Usage: semver [ [\.\.\.]] [\-r | \-i | \-\-preid | \-l | \-rv] +Test if version(s) satisfy the supplied range(s), and sort them\. + +Multiple versions or ranges may be supplied, unless increment +option is specified\. In that case, only a single version may +be used, and it is incremented by the specified level + +Program exits successfully if any valid version satisfies +all supplied ranges, and prints all satisfying versions\. + +If no versions are valid, or ranges are not satisfied, +then exits failure\. + +Versions are printed in ascending order, so supplying +multiple versions to the utility will just sort them\. +.fi +.RE +.SH Versions +.P +A "version" is described by the \fBv2\.0\.0\fP specification found at +http://semver\.org/\|\. +.P +A leading \fB"="\fP or \fB"v"\fP character is stripped off and ignored\. +.SH Ranges +.P +A \fBversion range\fP is a set of \fBcomparators\fP which specify versions +that satisfy the range\. +.P +A \fBcomparator\fP is composed of an \fBoperator\fP and a \fBversion\fP\|\. The set +of primitive \fBoperators\fP is: +.RS 0 +.IP \(bu 2 +\fB<\fP Less than +.IP \(bu 2 +\fB<=\fP Less than or equal to +.IP \(bu 2 +\fB>\fP Greater than +.IP \(bu 2 +\fB>=\fP Greater than or equal to +.IP \(bu 2 +\fB=\fP Equal\. If no operator is specified, then equality is assumed, +so this operator is optional, but MAY be included\. + +.RE +.P +For example, the comparator \fB>=1\.2\.7\fP would match the versions +\fB1\.2\.7\fP, \fB1\.2\.8\fP, \fB2\.5\.3\fP, and \fB1\.3\.9\fP, but not the versions \fB1\.2\.6\fP +or \fB1\.1\.0\fP\|\. +.P +Comparators can be joined by whitespace to form a \fBcomparator set\fP, +which is satisfied by the \fBintersection\fR of all of the comparators +it includes\. +.P +A range is composed of one or more comparator sets, joined by \fB||\fP\|\. A +version matches a range if and only if every comparator in at least +one of the \fB||\fP\-separated comparator sets is satisfied by the version\. +.P +For example, the range \fB>=1\.2\.7 <1\.3\.0\fP would match the versions +\fB1\.2\.7\fP, \fB1\.2\.8\fP, and \fB1\.2\.99\fP, but not the versions \fB1\.2\.6\fP, \fB1\.3\.0\fP, +or \fB1\.1\.0\fP\|\. +.P +The range \fB1\.2\.7 || >=1\.2\.9 <2\.0\.0\fP would match the versions \fB1\.2\.7\fP, +\fB1\.2\.9\fP, and \fB1\.4\.6\fP, but not the versions \fB1\.2\.8\fP or \fB2\.0\.0\fP\|\. +.SS Prerelease Tags +.P +If a version has a prerelease tag (for example, \fB1\.2\.3\-alpha\.3\fP) then +it will only be allowed to satisfy comparator sets if at least one +comparator with the same \fB[major, minor, patch]\fP tuple also has a +prerelease tag\. +.P +For example, the range \fB>1\.2\.3\-alpha\.3\fP would be allowed to match the +version \fB1\.2\.3\-alpha\.7\fP, but it would \fInot\fR be satisfied by +\fB3\.4\.5\-alpha\.9\fP, even though \fB3\.4\.5\-alpha\.9\fP is technically "greater +than" \fB1\.2\.3\-alpha\.3\fP according to the SemVer sort rules\. The version +range only accepts prerelease tags on the \fB1\.2\.3\fP version\. The +version \fB3\.4\.5\fP \fIwould\fR satisfy the range, because it does not have a +prerelease flag, and \fB3\.4\.5\fP is greater than \fB1\.2\.3\-alpha\.7\fP\|\. +.P +The purpose for this behavior is twofold\. First, prerelease versions +frequently are updated very quickly, and contain many breaking changes +that are (by the author's design) not yet fit for public consumption\. +Therefore, by default, they are excluded from range matching +semantics\. +.P +Second, a user who has opted into using a prerelease version has +clearly indicated the intent to use \fIthat specific\fR set of +alpha/beta/rc versions\. By including a prerelease tag in the range, +the user is indicating that they are aware of the risk\. However, it +is still not appropriate to assume that they have opted into taking a +similar risk on the \fInext\fR set of prerelease versions\. +.SS Prerelease Identifiers +.P +The method \fB\|\.inc\fP takes an additional \fBidentifier\fP string argument that +will append the value of the string as a prerelease identifier: +.P +.RS 2 +.nf +> semver\.inc('1\.2\.3', 'prerelease', 'beta') +\|'1\.2\.4\-beta\.0' +.fi +.RE +.P +command\-line example: +.P +.RS 2 +.nf +$ semver 1\.2\.3 \-i prerelease \-\-preid beta +1\.2\.4\-beta\.0 +.fi +.RE +.P +Which then can be used to increment further: +.P +.RS 2 +.nf +$ semver 1\.2\.4\-beta\.0 \-i prerelease +1\.2\.4\-beta\.1 +.fi +.RE +.SS Advanced Range Syntax +.P +Advanced range syntax desugars to primitive comparators in +deterministic ways\. +.P +Advanced ranges may be combined in the same way as primitive +comparators using white space or \fB||\fP\|\. +.SS Hyphen Ranges \fBX\.Y\.Z \- A\.B\.C\fP +.P +Specifies an inclusive set\. +.RS 0 +.IP \(bu 2 +\fB1\.2\.3 \- 2\.3\.4\fP := \fB>=1\.2\.3 <=2\.3\.4\fP + +.RE +.P +If a partial version is provided as the first version in the inclusive +range, then the missing pieces are replaced with zeroes\. +.RS 0 +.IP \(bu 2 +\fB1\.2 \- 2\.3\.4\fP := \fB>=1\.2\.0 <=2\.3\.4\fP + +.RE +.P +If a partial version is provided as the second version in the +inclusive range, then all versions that start with the supplied parts +of the tuple are accepted, but nothing that would be greater than the +provided tuple parts\. +.RS 0 +.IP \(bu 2 +\fB1\.2\.3 \- 2\.3\fP := \fB>=1\.2\.3 <2\.4\.0\fP +.IP \(bu 2 +\fB1\.2\.3 \- 2\fP := \fB>=1\.2\.3 <3\.0\.0\fP + +.RE +.SS X\-Ranges \fB1\.2\.x\fP \fB1\.X\fP \fB1\.2\.*\fP \fB*\fP +.P +Any of \fBX\fP, \fBx\fP, or \fB*\fP may be used to "stand in" for one of the +numeric values in the \fB[major, minor, patch]\fP tuple\. +.RS 0 +.IP \(bu 2 +\fB*\fP := \fB>=0\.0\.0\fP (Any version satisfies) +.IP \(bu 2 +\fB1\.x\fP := \fB>=1\.0\.0 <2\.0\.0\fP (Matching major version) +.IP \(bu 2 +\fB1\.2\.x\fP := \fB>=1\.2\.0 <1\.3\.0\fP (Matching major and minor versions) + +.RE +.P +A partial version range is treated as an X\-Range, so the special +character is in fact optional\. +.RS 0 +.IP \(bu 2 +\fB""\fP (empty string) := \fB*\fP := \fB>=0\.0\.0\fP +.IP \(bu 2 +\fB1\fP := \fB1\.x\.x\fP := \fB>=1\.0\.0 <2\.0\.0\fP +.IP \(bu 2 +\fB1\.2\fP := \fB1\.2\.x\fP := \fB>=1\.2\.0 <1\.3\.0\fP + +.RE +.SS Tilde Ranges \fB~1\.2\.3\fP \fB~1\.2\fP \fB~1\fP +.P +Allows patch\-level changes if a minor version is specified on the +comparator\. Allows minor\-level changes if not\. +.RS 0 +.IP \(bu 2 +\fB~1\.2\.3\fP := \fB>=1\.2\.3 <1\.(2+1)\.0\fP := \fB>=1\.2\.3 <1\.3\.0\fP +.IP \(bu 2 +\fB~1\.2\fP := \fB>=1\.2\.0 <1\.(2+1)\.0\fP := \fB>=1\.2\.0 <1\.3\.0\fP (Same as \fB1\.2\.x\fP) +.IP \(bu 2 +\fB~1\fP := \fB>=1\.0\.0 <(1+1)\.0\.0\fP := \fB>=1\.0\.0 <2\.0\.0\fP (Same as \fB1\.x\fP) +.IP \(bu 2 +\fB~0\.2\.3\fP := \fB>=0\.2\.3 <0\.(2+1)\.0\fP := \fB>=0\.2\.3 <0\.3\.0\fP +.IP \(bu 2 +\fB~0\.2\fP := \fB>=0\.2\.0 <0\.(2+1)\.0\fP := \fB>=0\.2\.0 <0\.3\.0\fP (Same as \fB0\.2\.x\fP) +.IP \(bu 2 +\fB~0\fP := \fB>=0\.0\.0 <(0+1)\.0\.0\fP := \fB>=0\.0\.0 <1\.0\.0\fP (Same as \fB0\.x\fP) +.IP \(bu 2 +\fB~1\.2\.3\-beta\.2\fP := \fB>=1\.2\.3\-beta\.2 <1\.3\.0\fP Note that prereleases in +the \fB1\.2\.3\fP version will be allowed, if they are greater than or +equal to \fBbeta\.2\fP\|\. So, \fB1\.2\.3\-beta\.4\fP would be allowed, but +\fB1\.2\.4\-beta\.2\fP would not, because it is a prerelease of a +different \fB[major, minor, patch]\fP tuple\. + +.RE +.SS Caret Ranges \fB^1\.2\.3\fP \fB^0\.2\.5\fP \fB^0\.0\.4\fP +.P +Allows changes that do not modify the left\-most non\-zero digit in the +\fB[major, minor, patch]\fP tuple\. In other words, this allows patch and +minor updates for versions \fB1\.0\.0\fP and above, patch updates for +versions \fB0\.X >=0\.1\.0\fP, and \fIno\fR updates for versions \fB0\.0\.X\fP\|\. +.P +Many authors treat a \fB0\.x\fP version as if the \fBx\fP were the major +"breaking\-change" indicator\. +.P +Caret ranges are ideal when an author may make breaking changes +between \fB0\.2\.4\fP and \fB0\.3\.0\fP releases, which is a common practice\. +However, it presumes that there will \fInot\fR be breaking changes between +\fB0\.2\.4\fP and \fB0\.2\.5\fP\|\. It allows for changes that are presumed to be +additive (but non\-breaking), according to commonly observed practices\. +.RS 0 +.IP \(bu 2 +\fB^1\.2\.3\fP := \fB>=1\.2\.3 <2\.0\.0\fP +.IP \(bu 2 +\fB^0\.2\.3\fP := \fB>=0\.2\.3 <0\.3\.0\fP +.IP \(bu 2 +\fB^0\.0\.3\fP := \fB>=0\.0\.3 <0\.0\.4\fP +.IP \(bu 2 +\fB^1\.2\.3\-beta\.2\fP := \fB>=1\.2\.3\-beta\.2 <2\.0\.0\fP Note that prereleases in +the \fB1\.2\.3\fP version will be allowed, if they are greater than or +equal to \fBbeta\.2\fP\|\. So, \fB1\.2\.3\-beta\.4\fP would be allowed, but +\fB1\.2\.4\-beta\.2\fP would not, because it is a prerelease of a +different \fB[major, minor, patch]\fP tuple\. +.IP \(bu 2 +\fB^0\.0\.3\-beta\fP := \fB>=0\.0\.3\-beta <0\.0\.4\fP Note that prereleases in the +\fB0\.0\.3\fP version \fIonly\fR will be allowed, if they are greater than or +equal to \fBbeta\fP\|\. So, \fB0\.0\.3\-pr\.2\fP would be allowed\. + +.RE +.P +When parsing caret ranges, a missing \fBpatch\fP value desugars to the +number \fB0\fP, but will allow flexibility within that value, even if the +major and minor versions are both \fB0\fP\|\. +.RS 0 +.IP \(bu 2 +\fB^1\.2\.x\fP := \fB>=1\.2\.0 <2\.0\.0\fP +.IP \(bu 2 +\fB^0\.0\.x\fP := \fB>=0\.0\.0 <0\.1\.0\fP +.IP \(bu 2 +\fB^0\.0\fP := \fB>=0\.0\.0 <0\.1\.0\fP + +.RE +.P +A missing \fBminor\fP and \fBpatch\fP values will desugar to zero, but also +allow flexibility within those values, even if the major version is +zero\. +.RS 0 +.IP \(bu 2 +\fB^1\.x\fP := \fB>=1\.0\.0 <2\.0\.0\fP +.IP \(bu 2 +\fB^0\.x\fP := \fB>=0\.0\.0 <1\.0\.0\fP + +.RE +.SS Range Grammar +.P +Putting all this together, here is a Backus\-Naur grammar for ranges, +for the benefit of parser authors: +.P +.RS 2 +.nf +range\-set ::= range ( logical\-or range ) * +logical\-or ::= ( ' ' ) * '||' ( ' ' ) * +range ::= hyphen | simple ( ' ' simple ) * | '' +hyphen ::= partial ' \- ' partial +simple ::= primitive | partial | tilde | caret +primitive ::= ( '<' | '>' | '>=' | '<=' | '=' | ) partial +partial ::= xr ( '\.' xr ( '\.' xr qualifier ? )? )? +xr ::= 'x' | 'X' | '*' | nr +nr ::= '0' | ['1'\-'9']['0'\-'9']+ +tilde ::= '~' partial +caret ::= '^' partial +qualifier ::= ( '\-' pre )? ( '+' build )? +pre ::= parts +build ::= parts +parts ::= part ( '\.' part ) * +part ::= nr | [\-0\-9A\-Za\-z]+ +.fi +.RE +.SH Functions +.P +All methods and classes take a final \fBloose\fP boolean argument that, if +true, will be more forgiving about not\-quite\-valid semver strings\. +The resulting output will always be 100% strict, of course\. +.P +Strict\-mode Comparators and Ranges will be strict about the SemVer +strings that they parse\. +.RS 0 +.IP \(bu 2 +\fBvalid(v)\fP: Return the parsed version, or null if it's not valid\. +.IP \(bu 2 +\fBinc(v, release)\fP: Return the version incremented by the release +type (\fBmajor\fP, \fBpremajor\fP, \fBminor\fP, \fBpreminor\fP, \fBpatch\fP, +\fBprepatch\fP, or \fBprerelease\fP), or null if it's not valid +.RS 0 +.IP \(bu 2 +\fBpremajor\fP in one call will bump the version up to the next major +version and down to a prerelease of that major version\. +\fBpreminor\fP, and \fBprepatch\fP work the same way\. +.IP \(bu 2 +If called from a non\-prerelease version, the \fBprerelease\fP will work the +same as \fBprepatch\fP\|\. It increments the patch version, then makes a +prerelease\. If the input version is already a prerelease it simply +increments it\. + +.RE +.IP \(bu 2 +\fBmajor(v)\fP: Return the major version number\. +.IP \(bu 2 +\fBminor(v)\fP: Return the minor version number\. +.IP \(bu 2 +\fBpatch(v)\fP: Return the patch version number\. + +.RE +.SS Comparison +.RS 0 +.IP \(bu 2 +\fBgt(v1, v2)\fP: \fBv1 > v2\fP +.IP \(bu 2 +\fBgte(v1, v2)\fP: \fBv1 >= v2\fP +.IP \(bu 2 +\fBlt(v1, v2)\fP: \fBv1 < v2\fP +.IP \(bu 2 +\fBlte(v1, v2)\fP: \fBv1 <= v2\fP +.IP \(bu 2 +\fBeq(v1, v2)\fP: \fBv1 == v2\fP This is true if they're logically equivalent, +even if they're not the exact same string\. You already know how to +compare strings\. +.IP \(bu 2 +\fBneq(v1, v2)\fP: \fBv1 != v2\fP The opposite of \fBeq\fP\|\. +.IP \(bu 2 +\fBcmp(v1, comparator, v2)\fP: Pass in a comparison string, and it'll call +the corresponding function above\. \fB"==="\fP and \fB"!=="\fP do simple +string comparison, but are included for completeness\. Throws if an +invalid comparison string is provided\. +.IP \(bu 2 +\fBcompare(v1, v2)\fP: Return \fB0\fP if \fBv1 == v2\fP, or \fB1\fP if \fBv1\fP is greater, or \fB\-1\fP if +\fBv2\fP is greater\. Sorts in ascending order if passed to \fBArray\.sort()\fP\|\. +.IP \(bu 2 +\fBrcompare(v1, v2)\fP: The reverse of compare\. Sorts an array of versions +in descending order when passed to \fBArray\.sort()\fP\|\. +.IP \(bu 2 +\fBdiff(v1, v2)\fP: Returns difference between two versions by the release type +(\fBmajor\fP, \fBpremajor\fP, \fBminor\fP, \fBpreminor\fP, \fBpatch\fP, \fBprepatch\fP, or \fBprerelease\fP), +or null if the versions are the same\. + +.RE +.SS Ranges +.RS 0 +.IP \(bu 2 +\fBvalidRange(range)\fP: Return the valid range or null if it's not valid +.IP \(bu 2 +\fBsatisfies(version, range)\fP: Return true if the version satisfies the +range\. +.IP \(bu 2 +\fBmaxSatisfying(versions, range)\fP: Return the highest version in the list +that satisfies the range, or \fBnull\fP if none of them do\. +.IP \(bu 2 +\fBgtr(version, range)\fP: Return \fBtrue\fP if version is greater than all the +versions possible in the range\. +.IP \(bu 2 +\fBltr(version, range)\fP: Return \fBtrue\fP if version is less than all the +versions possible in the range\. +.IP \(bu 2 +\fBoutside(version, range, hilo)\fP: Return true if the version is outside +the bounds of the range in either the high or low direction\. The +\fBhilo\fP argument must be either the string \fB\|'>'\fP or \fB\|'<'\fP\|\. (This is +the function called by \fBgtr\fP and \fBltr\fP\|\.) + +.RE +.P +Note that, since ranges may be non\-contiguous, a version might not be +greater than a range, less than a range, \fIor\fR satisfy a range! For +example, the range \fB1\.2 <1\.2\.9 || >2\.0\.0\fP would have a hole from \fB1\.2\.9\fP +until \fB2\.0\.0\fP, so the version \fB1\.2\.10\fP would not be greater than the +range (because \fB2\.0\.1\fP satisfies, which is higher), nor less than the +range (since \fB1\.2\.8\fP satisfies, which is lower), and it also does not +satisfy the range\. +.P +If you want to know if a version satisfies or does not satisfy a +range, use the \fBsatisfies(version, range)\fP function\. + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/abbrev/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/abbrev/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/abbrev/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/abbrev/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/abbrev/README.md new file mode 100644 index 00000000..99746fe6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/abbrev/README.md @@ -0,0 +1,23 @@ +# abbrev-js + +Just like [ruby's Abbrev](http://apidock.com/ruby/Abbrev). + +Usage: + + var abbrev = require("abbrev"); + abbrev("foo", "fool", "folding", "flop"); + + // returns: + { fl: 'flop' + , flo: 'flop' + , flop: 'flop' + , fol: 'folding' + , fold: 'folding' + , foldi: 'folding' + , foldin: 'folding' + , folding: 'folding' + , foo: 'foo' + , fool: 'fool' + } + +This is handy for command-line scripts, or other cases where you want to be able to accept shorthands. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/abbrev/abbrev.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/abbrev/abbrev.js new file mode 100644 index 00000000..69cfeac5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/abbrev/abbrev.js @@ -0,0 +1,62 @@ + +module.exports = exports = abbrev.abbrev = abbrev + +abbrev.monkeyPatch = monkeyPatch + +function monkeyPatch () { + Object.defineProperty(Array.prototype, 'abbrev', { + value: function () { return abbrev(this) }, + enumerable: false, configurable: true, writable: true + }) + + Object.defineProperty(Object.prototype, 'abbrev', { + value: function () { return abbrev(Object.keys(this)) }, + enumerable: false, configurable: true, writable: true + }) +} + +function abbrev (list) { + if (arguments.length !== 1 || !Array.isArray(list)) { + list = Array.prototype.slice.call(arguments, 0) + } + for (var i = 0, l = list.length, args = [] ; i < l ; i ++) { + args[i] = typeof list[i] === "string" ? list[i] : String(list[i]) + } + + // sort them lexicographically, so that they're next to their nearest kin + args = args.sort(lexSort) + + // walk through each, seeing how much it has in common with the next and previous + var abbrevs = {} + , prev = "" + for (var i = 0, l = args.length ; i < l ; i ++) { + var current = args[i] + , next = args[i + 1] || "" + , nextMatches = true + , prevMatches = true + if (current === next) continue + for (var j = 0, cl = current.length ; j < cl ; j ++) { + var curChar = current.charAt(j) + nextMatches = nextMatches && curChar === next.charAt(j) + prevMatches = prevMatches && curChar === prev.charAt(j) + if (!nextMatches && !prevMatches) { + j ++ + break + } + } + prev = current + if (j === cl) { + abbrevs[current] = current + continue + } + for (var a = current.substr(0, j) ; j <= cl ; j ++) { + abbrevs[a] = current + a += current.charAt(j) + } + } + return abbrevs +} + +function lexSort (a, b) { + return a === b ? 0 : a > b ? 1 : -1 +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/abbrev/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/abbrev/package.json new file mode 100644 index 00000000..927d6f62 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/abbrev/package.json @@ -0,0 +1,54 @@ +{ + "name": "abbrev", + "version": "1.0.9", + "description": "Like ruby's abbrev module, but in js", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me" + }, + "main": "abbrev.js", + "scripts": { + "test": "tap test.js --cov" + }, + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/isaacs/abbrev-js.git" + }, + "license": "ISC", + "devDependencies": { + "tap": "^5.7.2" + }, + "files": [ + "abbrev.js" + ], + "gitHead": "c386cd9dbb1d8d7581718c54d4ba944cc9298d6f", + "bugs": { + "url": "https://github.com/isaacs/abbrev-js/issues" + }, + "homepage": "https://github.com/isaacs/abbrev-js#readme", + "_id": "abbrev@1.0.9", + "_shasum": "91b4792588a7738c25f35dd6f63752a2f8776135", + "_from": "abbrev@>=1.0.9 <1.1.0", + "_npmVersion": "3.9.1", + "_nodeVersion": "4.4.4", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "dist": { + "shasum": "91b4792588a7738c25f35dd6f63752a2f8776135", + "tarball": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/abbrev-1.0.9.tgz_1466016055839_0.7825860097073019" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansi-regex/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansi-regex/index.js new file mode 100644 index 00000000..4906755b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansi-regex/index.js @@ -0,0 +1,4 @@ +'use strict'; +module.exports = function () { + return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansi-regex/license b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansi-regex/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansi-regex/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansi-regex/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansi-regex/package.json new file mode 100644 index 00000000..88457331 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansi-regex/package.json @@ -0,0 +1,86 @@ +{ + "name": "ansi-regex", + "version": "2.0.0", + "description": "Regular expression for matching ANSI escape codes", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/ansi-regex.git" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "jbnicolai", + "email": "jappelman@xebia.com" + } + ], + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha test/test.js", + "view-supported": "node test/viewCodes.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern" + ], + "devDependencies": { + "mocha": "*" + }, + "gitHead": "57c3f2941a73079fa8b081e02a522e3d29913e2f", + "bugs": { + "url": "https://github.com/sindresorhus/ansi-regex/issues" + }, + "homepage": "https://github.com/sindresorhus/ansi-regex", + "_id": "ansi-regex@2.0.0", + "_shasum": "c5061b6e0ef8a81775e50f5d66151bf6bf371107", + "_from": "ansi-regex@2.0.0", + "_npmVersion": "2.11.2", + "_nodeVersion": "0.12.5", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "dist": { + "shasum": "c5061b6e0ef8a81775e50f5d66151bf6bf371107", + "tarball": "http://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansi-regex/readme.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansi-regex/readme.md new file mode 100644 index 00000000..1a4894ec --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansi-regex/readme.md @@ -0,0 +1,31 @@ +# ansi-regex [![Build Status](https://travis-ci.org/sindresorhus/ansi-regex.svg?branch=master)](https://travis-ci.org/sindresorhus/ansi-regex) + +> Regular expression for matching [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) + + +## Install + +``` +$ npm install --save ansi-regex +``` + + +## Usage + +```js +var ansiRegex = require('ansi-regex'); + +ansiRegex().test('\u001b[4mcake\u001b[0m'); +//=> true + +ansiRegex().test('cake'); +//=> false + +'\u001b[4mcake\u001b[0m'.match(ansiRegex()); +//=> ['\u001b[4m', '\u001b[0m'] +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansi/.jshintrc b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansi/.jshintrc new file mode 100644 index 00000000..248c5426 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansi/.jshintrc @@ -0,0 +1,4 @@ +{ + "laxcomma": true, + "asi": true +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansi/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansi/.npmignore new file mode 100644 index 00000000..3c3629e6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansi/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansi/History.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansi/History.md new file mode 100644 index 00000000..aea8aaf0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansi/History.md @@ -0,0 +1,23 @@ + +0.3.1 / 2016-01-14 +================== + + * add MIT LICENSE file (#23, @kasicka) + * preserve chaining after redundant style-method calls (#19, @drewblaisdell) + * package: add "license" field (#16, @BenjaminTsai) + +0.3.0 / 2014-05-09 +================== + + * package: remove "test" script and "devDependencies" + * package: remove "engines" section + * pacakge: remove "bin" section + * package: beautify + * examples: remove `starwars` example (#15) + * Documented goto, horizontalAbsolute, and eraseLine methods in README.md (#12, @Jammerwoch) + * add `.jshintrc` file + +< 0.3.0 +======= + + * Prehistoric diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansi/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansi/LICENSE new file mode 100644 index 00000000..2ea4dc5e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansi/LICENSE @@ -0,0 +1,24 @@ +(The MIT License) + +Copyright (c) 2012 Nathan Rajlich + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansi/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansi/README.md new file mode 100644 index 00000000..6ce19403 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansi/README.md @@ -0,0 +1,98 @@ +ansi.js +========= +### Advanced ANSI formatting tool for Node.js + +`ansi.js` is a module for Node.js that provides an easy-to-use API for +writing ANSI escape codes to `Stream` instances. ANSI escape codes are used to do +fancy things in a terminal window, like render text in colors, delete characters, +lines, the entire window, or hide and show the cursor, and lots more! + +#### Features: + + * 256 color support for the terminal! + * Make a beep sound from your terminal! + * Works with *any* writable `Stream` instance. + * Allows you to move the cursor anywhere on the terminal window. + * Allows you to delete existing contents from the terminal window. + * Allows you to hide and show the cursor. + * Converts CSS color codes and RGB values into ANSI escape codes. + * Low-level; you are in control of when escape codes are used, it's not abstracted. + + +Installation +------------ + +Install with `npm`: + +``` bash +$ npm install ansi +``` + + +Example +------- + +``` js +var ansi = require('ansi') + , cursor = ansi(process.stdout) + +// You can chain your calls forever: +cursor + .red() // Set font color to red + .bg.grey() // Set background color to grey + .write('Hello World!') // Write 'Hello World!' to stdout + .bg.reset() // Reset the bgcolor before writing the trailing \n, + // to avoid Terminal glitches + .write('\n') // And a final \n to wrap things up + +// Rendering modes are persistent: +cursor.hex('#660000').bold().underline() + +// You can use the regular logging functions, text will be green: +console.log('This is blood red, bold text') + +// To reset just the foreground color: +cursor.fg.reset() + +console.log('This will still be bold') + +// to go to a location (x,y) on the console +// note: 1-indexed, not 0-indexed: +cursor.goto(10, 5).write('Five down, ten over') + +// to clear the current line: +cursor.horizontalAbsolute(0).eraseLine().write('Starting again') + +// to go to a different column on the current line: +cursor.horizontalAbsolute(5).write('column five') + +// Clean up after yourself! +cursor.reset() +``` + + +License +------- + +(The MIT License) + +Copyright (c) 2012 Nathan Rajlich <nathan@tootallnate.net> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansi/examples/beep/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansi/examples/beep/index.js new file mode 100644 index 00000000..c1ec929d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansi/examples/beep/index.js @@ -0,0 +1,16 @@ +#!/usr/bin/env node + +/** + * Invokes the terminal "beep" sound once per second on every exact second. + */ + +process.title = 'beep' + +var cursor = require('../../')(process.stdout) + +function beep () { + cursor.beep() + setTimeout(beep, 1000 - (new Date()).getMilliseconds()) +} + +setTimeout(beep, 1000 - (new Date()).getMilliseconds()) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansi/examples/clear/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansi/examples/clear/index.js new file mode 100644 index 00000000..6ac21ffa --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansi/examples/clear/index.js @@ -0,0 +1,15 @@ +#!/usr/bin/env node + +/** + * Like GNU ncurses "clear" command. + * https://github.com/mscdex/node-ncurses/blob/master/deps/ncurses/progs/clear.c + */ + +process.title = 'clear' + +function lf () { return '\n' } + +require('../../')(process.stdout) + .write(Array.apply(null, Array(process.stdout.getWindowSize()[1])).map(lf).join('')) + .eraseData(2) + .goto(1, 1) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansi/examples/cursorPosition.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansi/examples/cursorPosition.js new file mode 100644 index 00000000..50f96449 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansi/examples/cursorPosition.js @@ -0,0 +1,32 @@ +#!/usr/bin/env node + +var tty = require('tty') +var cursor = require('../')(process.stdout) + +// listen for the queryPosition report on stdin +process.stdin.resume() +raw(true) + +process.stdin.once('data', function (b) { + var match = /\[(\d+)\;(\d+)R$/.exec(b.toString()) + if (match) { + var xy = match.slice(1, 3).reverse().map(Number) + console.error(xy) + } + + // cleanup and close stdin + raw(false) + process.stdin.pause() +}) + + +// send the query position request code to stdout +cursor.queryPosition() + +function raw (mode) { + if (process.stdin.setRawMode) { + process.stdin.setRawMode(mode) + } else { + tty.setRawMode(mode) + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansi/examples/progress/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansi/examples/progress/index.js new file mode 100644 index 00000000..d28dbda2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansi/examples/progress/index.js @@ -0,0 +1,87 @@ +#!/usr/bin/env node + +var assert = require('assert') + , ansi = require('../../') + +function Progress (stream, width) { + this.cursor = ansi(stream) + this.delta = this.cursor.newlines + this.width = width | 0 || 10 + this.open = '[' + this.close = ']' + this.complete = '█' + this.incomplete = '_' + + // initial render + this.progress = 0 +} + +Object.defineProperty(Progress.prototype, 'progress', { + get: get + , set: set + , configurable: true + , enumerable: true +}) + +function get () { + return this._progress +} + +function set (v) { + this._progress = Math.max(0, Math.min(v, 100)) + + var w = this.width - this.complete.length - this.incomplete.length + , n = w * (this._progress / 100) | 0 + , i = w - n + , com = c(this.complete, n) + , inc = c(this.incomplete, i) + , delta = this.cursor.newlines - this.delta + + assert.equal(com.length + inc.length, w) + + if (delta > 0) { + this.cursor.up(delta) + this.delta = this.cursor.newlines + } + + this.cursor + .horizontalAbsolute(0) + .eraseLine(2) + .fg.white() + .write(this.open) + .fg.grey() + .bold() + .write(com) + .resetBold() + .write(inc) + .fg.white() + .write(this.close) + .fg.reset() + .write('\n') +} + +function c (char, length) { + return Array.apply(null, Array(length)).map(function () { + return char + }).join('') +} + + + + +// Usage +var width = parseInt(process.argv[2], 10) || process.stdout.getWindowSize()[0] / 2 + , p = new Progress(process.stdout, width) + +;(function tick () { + p.progress += Math.random() * 5 + p.cursor + .eraseLine(2) + .write('Progress: ') + .bold().write(p.progress.toFixed(2)) + .write('%') + .resetBold() + .write('\n') + if (p.progress < 100) + setTimeout(tick, 100) +})() diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansi/lib/ansi.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansi/lib/ansi.js new file mode 100644 index 00000000..b1714e32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansi/lib/ansi.js @@ -0,0 +1,405 @@ + +/** + * References: + * + * - http://en.wikipedia.org/wiki/ANSI_escape_code + * - http://www.termsys.demon.co.uk/vtansi.htm + * + */ + +/** + * Module dependencies. + */ + +var emitNewlineEvents = require('./newlines') + , prefix = '\x1b[' // For all escape codes + , suffix = 'm' // Only for color codes + +/** + * The ANSI escape sequences. + */ + +var codes = { + up: 'A' + , down: 'B' + , forward: 'C' + , back: 'D' + , nextLine: 'E' + , previousLine: 'F' + , horizontalAbsolute: 'G' + , eraseData: 'J' + , eraseLine: 'K' + , scrollUp: 'S' + , scrollDown: 'T' + , savePosition: 's' + , restorePosition: 'u' + , queryPosition: '6n' + , hide: '?25l' + , show: '?25h' +} + +/** + * Rendering ANSI codes. + */ + +var styles = { + bold: 1 + , italic: 3 + , underline: 4 + , inverse: 7 +} + +/** + * The negating ANSI code for the rendering modes. + */ + +var reset = { + bold: 22 + , italic: 23 + , underline: 24 + , inverse: 27 +} + +/** + * The standard, styleable ANSI colors. + */ + +var colors = { + white: 37 + , black: 30 + , blue: 34 + , cyan: 36 + , green: 32 + , magenta: 35 + , red: 31 + , yellow: 33 + , grey: 90 + , brightBlack: 90 + , brightRed: 91 + , brightGreen: 92 + , brightYellow: 93 + , brightBlue: 94 + , brightMagenta: 95 + , brightCyan: 96 + , brightWhite: 97 +} + + +/** + * Creates a Cursor instance based off the given `writable stream` instance. + */ + +function ansi (stream, options) { + if (stream._ansicursor) { + return stream._ansicursor + } else { + return stream._ansicursor = new Cursor(stream, options) + } +} +module.exports = exports = ansi + +/** + * The `Cursor` class. + */ + +function Cursor (stream, options) { + if (!(this instanceof Cursor)) { + return new Cursor(stream, options) + } + if (typeof stream != 'object' || typeof stream.write != 'function') { + throw new Error('a valid Stream instance must be passed in') + } + + // the stream to use + this.stream = stream + + // when 'enabled' is false then all the functions are no-ops except for write() + this.enabled = options && options.enabled + if (typeof this.enabled === 'undefined') { + this.enabled = stream.isTTY + } + this.enabled = !!this.enabled + + // then `buffering` is true, then `write()` calls are buffered in + // memory until `flush()` is invoked + this.buffering = !!(options && options.buffering) + this._buffer = [] + + // controls the foreground and background colors + this.fg = this.foreground = new Colorer(this, 0) + this.bg = this.background = new Colorer(this, 10) + + // defaults + this.Bold = false + this.Italic = false + this.Underline = false + this.Inverse = false + + // keep track of the number of "newlines" that get encountered + this.newlines = 0 + emitNewlineEvents(stream) + stream.on('newline', function () { + this.newlines++ + }.bind(this)) +} +exports.Cursor = Cursor + +/** + * Helper function that calls `write()` on the underlying Stream. + * Returns `this` instead of the write() return value to keep + * the chaining going. + */ + +Cursor.prototype.write = function (data) { + if (this.buffering) { + this._buffer.push(arguments) + } else { + this.stream.write.apply(this.stream, arguments) + } + return this +} + +/** + * Buffer `write()` calls into memory. + * + * @api public + */ + +Cursor.prototype.buffer = function () { + this.buffering = true + return this +} + +/** + * Write out the in-memory buffer. + * + * @api public + */ + +Cursor.prototype.flush = function () { + this.buffering = false + var str = this._buffer.map(function (args) { + if (args.length != 1) throw new Error('unexpected args length! ' + args.length); + return args[0]; + }).join(''); + this._buffer.splice(0); // empty + this.write(str); + return this +} + + +/** + * The `Colorer` class manages both the background and foreground colors. + */ + +function Colorer (cursor, base) { + this.current = null + this.cursor = cursor + this.base = base +} +exports.Colorer = Colorer + +/** + * Write an ANSI color code, ensuring that the same code doesn't get rewritten. + */ + +Colorer.prototype._setColorCode = function setColorCode (code) { + var c = String(code) + if (this.current === c) return + this.cursor.enabled && this.cursor.write(prefix + c + suffix) + this.current = c + return this +} + + +/** + * Set up the positional ANSI codes. + */ + +Object.keys(codes).forEach(function (name) { + var code = String(codes[name]) + Cursor.prototype[name] = function () { + var c = code + if (arguments.length > 0) { + c = toArray(arguments).map(Math.round).join(';') + code + } + this.enabled && this.write(prefix + c) + return this + } +}) + +/** + * Set up the functions for the rendering ANSI codes. + */ + +Object.keys(styles).forEach(function (style) { + var name = style[0].toUpperCase() + style.substring(1) + , c = styles[style] + , r = reset[style] + + Cursor.prototype[style] = function () { + if (this[name]) return this + this.enabled && this.write(prefix + c + suffix) + this[name] = true + return this + } + + Cursor.prototype['reset' + name] = function () { + if (!this[name]) return this + this.enabled && this.write(prefix + r + suffix) + this[name] = false + return this + } +}) + +/** + * Setup the functions for the standard colors. + */ + +Object.keys(colors).forEach(function (color) { + var code = colors[color] + + Colorer.prototype[color] = function () { + this._setColorCode(this.base + code) + return this.cursor + } + + Cursor.prototype[color] = function () { + return this.foreground[color]() + } +}) + +/** + * Makes a beep sound! + */ + +Cursor.prototype.beep = function () { + this.enabled && this.write('\x07') + return this +} + +/** + * Moves cursor to specific position + */ + +Cursor.prototype.goto = function (x, y) { + x = x | 0 + y = y | 0 + this.enabled && this.write(prefix + y + ';' + x + 'H') + return this +} + +/** + * Resets the color. + */ + +Colorer.prototype.reset = function () { + this._setColorCode(this.base + 39) + return this.cursor +} + +/** + * Resets all ANSI formatting on the stream. + */ + +Cursor.prototype.reset = function () { + this.enabled && this.write(prefix + '0' + suffix) + this.Bold = false + this.Italic = false + this.Underline = false + this.Inverse = false + this.foreground.current = null + this.background.current = null + return this +} + +/** + * Sets the foreground color with the given RGB values. + * The closest match out of the 216 colors is picked. + */ + +Colorer.prototype.rgb = function (r, g, b) { + var base = this.base + 38 + , code = rgb(r, g, b) + this._setColorCode(base + ';5;' + code) + return this.cursor +} + +/** + * Same as `cursor.fg.rgb(r, g, b)`. + */ + +Cursor.prototype.rgb = function (r, g, b) { + return this.foreground.rgb(r, g, b) +} + +/** + * Accepts CSS color codes for use with ANSI escape codes. + * For example: `#FF000` would be bright red. + */ + +Colorer.prototype.hex = function (color) { + return this.rgb.apply(this, hex(color)) +} + +/** + * Same as `cursor.fg.hex(color)`. + */ + +Cursor.prototype.hex = function (color) { + return this.foreground.hex(color) +} + + +// UTIL FUNCTIONS // + +/** + * Translates a 255 RGB value to a 0-5 ANSI RGV value, + * then returns the single ANSI color code to use. + */ + +function rgb (r, g, b) { + var red = r / 255 * 5 + , green = g / 255 * 5 + , blue = b / 255 * 5 + return rgb5(red, green, blue) +} + +/** + * Turns rgb 0-5 values into a single ANSI color code to use. + */ + +function rgb5 (r, g, b) { + var red = Math.round(r) + , green = Math.round(g) + , blue = Math.round(b) + return 16 + (red*36) + (green*6) + blue +} + +/** + * Accepts a hex CSS color code string (# is optional) and + * translates it into an Array of 3 RGB 0-255 values, which + * can then be used with rgb(). + */ + +function hex (color) { + var c = color[0] === '#' ? color.substring(1) : color + , r = c.substring(0, 2) + , g = c.substring(2, 4) + , b = c.substring(4, 6) + return [parseInt(r, 16), parseInt(g, 16), parseInt(b, 16)] +} + +/** + * Turns an array-like object into a real array. + */ + +function toArray (a) { + var i = 0 + , l = a.length + , rtn = [] + for (; i 0) { + var len = data.length + , i = 0 + // now try to calculate any deltas + if (typeof data == 'string') { + for (; i open blue '\u001b[34m' +// close bgBlack '\u001b[49m' +``` + +## Tests + +Look at the [tests](https://github.com/thlorenz/ansicolors/blob/master/test/ansicolors.js) to see more examples and/or run them via: + + npm explore ansicolors && npm test + +## Alternatives + +**ansicolors** tries to meet simple use cases with a very simple API. However, if you need a more powerful ansi formatting tool, +I'd suggest to look at the [features](https://github.com/TooTallNate/ansi.js#features) of the [ansi module](https://github.com/TooTallNate/ansi.js). diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansicolors/ansicolors.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansicolors/ansicolors.js new file mode 100644 index 00000000..16b2586f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansicolors/ansicolors.js @@ -0,0 +1,65 @@ +// ColorCodes explained: http://www.termsys.demon.co.uk/vtansi.htm +'use strict'; + +var colorNums = { + white : 37 + , black : 30 + , blue : 34 + , cyan : 36 + , green : 32 + , magenta : 35 + , red : 31 + , yellow : 33 + , brightBlack : 90 + , brightRed : 91 + , brightGreen : 92 + , brightYellow : 93 + , brightBlue : 94 + , brightMagenta : 95 + , brightCyan : 96 + , brightWhite : 97 + } + , backgroundColorNums = { + bgBlack : 40 + , bgRed : 41 + , bgGreen : 42 + , bgYellow : 43 + , bgBlue : 44 + , bgMagenta : 45 + , bgCyan : 46 + , bgWhite : 47 + , bgBrightBlack : 100 + , bgBrightRed : 101 + , bgBrightGreen : 102 + , bgBrightYellow : 103 + , bgBrightBlue : 104 + , bgBrightMagenta : 105 + , bgBrightCyan : 106 + , bgBrightWhite : 107 + } + , open = {} + , close = {} + , colors = {} + ; + +Object.keys(colorNums).forEach(function (k) { + var o = open[k] = '\u001b[' + colorNums[k] + 'm'; + var c = close[k] = '\u001b[39m'; + + colors[k] = function (s) { + return o + s + c; + }; +}); + +Object.keys(backgroundColorNums).forEach(function (k) { + var o = open[k] = '\u001b[' + backgroundColorNums[k] + 'm'; + var c = close[k] = '\u001b[49m'; + + colors[k] = function (s) { + return o + s + c; + }; +}); + +module.exports = colors; +colors.open = open; +colors.close = close; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansicolors/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansicolors/package.json new file mode 100644 index 00000000..bca06da2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansicolors/package.json @@ -0,0 +1,34 @@ +{ + "name": "ansicolors", + "version": "0.3.2", + "description": "Functions that surround a string with ansicolor codes so it prints in color.", + "main": "ansicolors.js", + "scripts": { + "test": "node test/*.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/thlorenz/ansicolors.git" + }, + "keywords": [ + "ansi", + "colors", + "highlight", + "string" + ], + "author": { + "name": "Thorsten Lorenz", + "email": "thlorenz@gmx.de", + "url": "thlorenz.com" + }, + "license": "MIT", + "readmeFilename": "README.md", + "gitHead": "858847ca28e8b360d9b70eee0592700fa2ab087d", + "readme": "# ansicolors [![build status](https://secure.travis-ci.org/thlorenz/ansicolors.png)](http://next.travis-ci.org/thlorenz/ansicolors)\n\nFunctions that surround a string with ansicolor codes so it prints in color.\n\nIn case you need styles, like `bold`, have a look at [ansistyles](https://github.com/thlorenz/ansistyles).\n\n## Installation\n\n npm install ansicolors\n\n## Usage\n\n```js\nvar colors = require('ansicolors');\n\n// foreground colors\nvar redHerring = colors.red('herring');\nvar blueMoon = colors.blue('moon');\nvar brighBlueMoon = colors.brightBlue('moon');\n\nconsole.log(redHerring); // this will print 'herring' in red\nconsole.log(blueMoon); // this 'moon' in blue\nconsole.log(brightBlueMoon); // I think you got the idea\n\n// background colors\nconsole.log(colors.bgYellow('printed on yellow background'));\nconsole.log(colors.bgBrightBlue('printed on bright blue background'));\n\n// mixing background and foreground colors\n// below two lines have same result (order in which bg and fg are combined doesn't matter)\nconsole.log(colors.bgYellow(colors.blue('printed on yellow background in blue')));\nconsole.log(colors.blue(colors.bgYellow('printed on yellow background in blue')));\n```\n\n## Advanced API\n\n**ansicolors** allows you to access opening and closing escape sequences separately.\n\n```js\nvar colors = require('ansicolors');\n\nfunction inspect(obj, depth) {\n return require('util').inspect(obj, false, depth || 5, true);\n}\n\nconsole.log('open blue', inspect(colors.open.blue));\nconsole.log('close bgBlack', inspect(colors.close.bgBlack));\n\n// => open blue '\\u001b[34m'\n// close bgBlack '\\u001b[49m'\n```\n\n## Tests\n\nLook at the [tests](https://github.com/thlorenz/ansicolors/blob/master/test/ansicolors.js) to see more examples and/or run them via: \n\n npm explore ansicolors && npm test\n\n## Alternatives\n\n**ansicolors** tries to meet simple use cases with a very simple API. However, if you need a more powerful ansi formatting tool, \nI'd suggest to look at the [features](https://github.com/TooTallNate/ansi.js#features) of the [ansi module](https://github.com/TooTallNate/ansi.js).\n", + "bugs": { + "url": "https://github.com/thlorenz/ansicolors/issues" + }, + "homepage": "https://github.com/thlorenz/ansicolors", + "_id": "ansicolors@0.3.2", + "_from": "ansicolors@latest" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansicolors/test/ansicolors.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansicolors/test/ansicolors.js new file mode 100644 index 00000000..49453930 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansicolors/test/ansicolors.js @@ -0,0 +1,71 @@ +'use strict'; + +var assert = require('assert') + , colors = require('..') + , open = colors.open + , close = colors.close + +console.log('Foreground colors ..'); + +assert.equal(colors.white('printed in white'), '\u001b[37mprinted in white\u001b[39m'); + +assert.equal(colors.black('printed in black'), '\u001b[30mprinted in black\u001b[39m'); +assert.equal(colors.brightBlack('printed in bright black'), '\u001b[90mprinted in bright black\u001b[39m'); + +assert.equal(colors.green('printed in green'), '\u001b[32mprinted in green\u001b[39m'); +assert.equal(colors.brightGreen('printed in bright green'), '\u001b[92mprinted in bright green\u001b[39m'); + +assert.equal(colors.red('printed in red'), '\u001b[31mprinted in red\u001b[39m'); +assert.equal(colors.brightRed('printed in bright red'), '\u001b[91mprinted in bright red\u001b[39m'); + +console.log('OK'); + +console.log('Background colors ..'); + +assert.equal( + colors.bgBlack('printed with black background') + , '\u001b[40mprinted with black background\u001b[49m' +); + +assert.equal( + colors.bgYellow('printed with yellow background') + , '\u001b[43mprinted with yellow background\u001b[49m' +); +assert.equal( + colors.bgBrightYellow('printed with bright yellow background') + , '\u001b[103mprinted with bright yellow background\u001b[49m' +); + +assert.equal( + colors.bgWhite('printed with white background') + , '\u001b[47mprinted with white background\u001b[49m' +); + +console.log('OK'); + +console.log('Mixing background and foreground colors ..'); + +assert.equal( + colors.blue(colors.bgYellow('printed in blue with yellow background')) + , '\u001b[34m\u001b[43mprinted in blue with yellow background\u001b[49m\u001b[39m' +); +assert.equal( + colors.bgYellow(colors.blue('printed in blue with yellow background again')) + , '\u001b[43m\u001b[34mprinted in blue with yellow background again\u001b[39m\u001b[49m' +); + +console.log('OK'); + +console.log('Open ...'); + +assert.equal(open.black, '\u001b[30m'); +assert.equal(open.bgYellow, '\u001b[43m'); + +console.log('OK'); + +console.log('Close ...'); + +assert.equal(close.black, '\u001b[39m'); +assert.equal(close.bgYellow, '\u001b[49m'); + +console.log('OK'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansistyles/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansistyles/LICENSE new file mode 100644 index 00000000..41702c50 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansistyles/LICENSE @@ -0,0 +1,23 @@ +Copyright 2013 Thorsten Lorenz. +All rights reserved. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansistyles/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansistyles/README.md new file mode 100644 index 00000000..e39b8dfb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansistyles/README.md @@ -0,0 +1,71 @@ +# ansistyles [![build status](https://secure.travis-ci.org/thlorenz/ansistyles.png)](http://next.travis-ci.org/thlorenz/ansistyles) + +Functions that surround a string with ansistyle codes so it prints in style. + +In case you need colors, like `red`, have a look at [ansicolors](https://github.com/thlorenz/ansicolors). + +## Installation + + npm install ansistyles + +## Usage + +```js +var styles = require('ansistyles'); + +console.log(styles.bright('hello world')); // prints hello world in 'bright' white +console.log(styles.underline('hello world')); // prints hello world underlined +console.log(styles.inverse('hello world')); // prints hello world black on white +``` + +## Combining with ansicolors + +Get the ansicolors module: + + npm install ansicolors + +```js +var styles = require('ansistyles') + , colors = require('ansicolors'); + + console.log( + // prints hello world underlined in blue on a green background + colors.bgGreen(colors.blue(styles.underline('hello world'))) + ); +``` + +## Tests + +Look at the [tests](https://github.com/thlorenz/ansistyles/blob/master/test/ansistyles.js) to see more examples and/or run them via: + + npm explore ansistyles && npm test + +## More Styles + +As you can see from [here](https://github.com/thlorenz/ansistyles/blob/master/ansistyles.js#L4-L15), more styles are available, +but didn't have any effect on the terminals that I tested on Mac Lion and Ubuntu Linux. + +I included them for completeness, but didn't show them in the examples because they seem to have no effect. + +### reset + +A style reset function is also included, please note however that this is not nestable. + +Therefore the below only underlines `hell` only, but not `world`. + +```js +console.log(styles.underline('hell' + styles.reset('o') + ' world')); +``` + +It is essentially the same as: + +```js +console.log(styles.underline('hell') + styles.reset('') + 'o world'); +``` + + + +## Alternatives + +**ansistyles** tries to meet simple use cases with a very simple API. However, if you need a more powerful ansi formatting tool, +I'd suggest to look at the [features](https://github.com/TooTallNate/ansi.js#features) of the [ansi module](https://github.com/TooTallNate/ansi.js). diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansistyles/ansistyles.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansistyles/ansistyles.js new file mode 100644 index 00000000..5b8788c0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansistyles/ansistyles.js @@ -0,0 +1,38 @@ +'use strict'; + +/* + * Info: http://www.termsys.demon.co.uk/vtansi.htm#colors + * Following caveats + * bright - brightens the color (bold-blue is same as brigthtBlue) + * dim - nothing on Mac or Linux + * italic - nothing on Mac or Linux + * underline - underlines string + * blink - nothing on Mac or linux + * inverse - background becomes foreground and vice versa + * + * In summary, the only styles that work are: + * - bright, underline and inverse + * - the others are only included for completeness + */ + +var styleNums = { + reset : [0, 22] + , bright : [1, 22] + , dim : [2, 22] + , italic : [3, 23] + , underline : [4, 24] + , blink : [5, 25] + , inverse : [7, 27] + } + , styles = {} + ; + +Object.keys(styleNums).forEach(function (k) { + styles[k] = function (s) { + var open = styleNums[k][0] + , close = styleNums[k][1]; + return '\u001b[' + open + 'm' + s + '\u001b[' + close + 'm'; + }; +}); + +module.exports = styles; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansistyles/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansistyles/package.json new file mode 100644 index 00000000..dec9cd9e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansistyles/package.json @@ -0,0 +1,38 @@ +{ + "name": "ansistyles", + "version": "0.1.3", + "description": "Functions that surround a string with ansistyle codes so it prints in style.", + "main": "ansistyles.js", + "scripts": { + "test": "node test/ansistyles.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/thlorenz/ansistyles.git" + }, + "keywords": [ + "ansi", + "style", + "terminal", + "console" + ], + "author": { + "name": "Thorsten Lorenz", + "email": "thlorenz@gmx.de", + "url": "thlorenz.com" + }, + "license": "MIT", + "readmeFilename": "README.md", + "gitHead": "27bf1bc65231bcc7fd109bf13b13601b51f8cd04", + "readme": "# ansistyles [![build status](https://secure.travis-ci.org/thlorenz/ansistyles.png)](http://next.travis-ci.org/thlorenz/ansistyles)\n\nFunctions that surround a string with ansistyle codes so it prints in style.\n\nIn case you need colors, like `red`, have a look at [ansicolors](https://github.com/thlorenz/ansicolors).\n\n## Installation\n\n npm install ansistyles\n\n## Usage\n\n```js\nvar styles = require('ansistyles');\n\nconsole.log(styles.bright('hello world')); // prints hello world in 'bright' white\nconsole.log(styles.underline('hello world')); // prints hello world underlined\nconsole.log(styles.inverse('hello world')); // prints hello world black on white\n```\n\n## Combining with ansicolors\n\nGet the ansicolors module:\n\n npm install ansicolors\n\n```js\nvar styles = require('ansistyles')\n , colors = require('ansicolors');\n\n console.log(\n // prints hello world underlined in blue on a green background\n colors.bgGreen(colors.blue(styles.underline('hello world'))) \n );\n```\n\n## Tests\n\nLook at the [tests](https://github.com/thlorenz/ansistyles/blob/master/test/ansistyles.js) to see more examples and/or run them via: \n\n npm explore ansistyles && npm test\n\n## More Styles\n\nAs you can see from [here](https://github.com/thlorenz/ansistyles/blob/master/ansistyles.js#L4-L15), more styles are available,\nbut didn't have any effect on the terminals that I tested on Mac Lion and Ubuntu Linux.\n\nI included them for completeness, but didn't show them in the examples because they seem to have no effect.\n\n### reset\n\nA style reset function is also included, please note however that this is not nestable.\n\nTherefore the below only underlines `hell` only, but not `world`.\n\n```js\nconsole.log(styles.underline('hell' + styles.reset('o') + ' world'));\n```\n\nIt is essentially the same as:\n\n```js\nconsole.log(styles.underline('hell') + styles.reset('') + 'o world');\n```\n\n\n\n## Alternatives\n\n**ansistyles** tries to meet simple use cases with a very simple API. However, if you need a more powerful ansi formatting tool, \nI'd suggest to look at the [features](https://github.com/TooTallNate/ansi.js#features) of the [ansi module](https://github.com/TooTallNate/ansi.js).\n", + "bugs": { + "url": "https://github.com/thlorenz/ansistyles/issues" + }, + "homepage": "https://github.com/thlorenz/ansistyles", + "_id": "ansistyles@0.1.3", + "dist": { + "shasum": "b14f315fe763a2b3a88df9d3261a517e666c4615" + }, + "_from": "ansistyles@0.1.3", + "_resolved": "https://registry.npmjs.org/ansistyles/-/ansistyles-0.1.3.tgz" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansistyles/test/ansistyles.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansistyles/test/ansistyles.js new file mode 100644 index 00000000..f769bf80 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ansistyles/test/ansistyles.js @@ -0,0 +1,15 @@ +'use strict'; +/*jshint asi: true */ +var assert = require('assert') + , styles = require('../') + +function inspect(obj, depth) { + console.log(require('util').inspect(obj, false, depth || 5, true)); +} + +assert.equal(styles.reset('reset'), '\u001b[0mreset\u001b[22m', 'reset') +assert.equal(styles.underline('underlined'), '\u001b[4munderlined\u001b[24m', 'underline') +assert.equal(styles.bright('bright'), '\u001b[1mbright\u001b[22m', 'bright') +assert.equal(styles.inverse('inversed'), '\u001b[7minversed\u001b[27m', 'inverse') + +console.log('OK'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/archy/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/archy/LICENSE new file mode 100644 index 00000000..ee27ba4b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/archy/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/archy/README.markdown b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/archy/README.markdown new file mode 100644 index 00000000..ef7a5cf3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/archy/README.markdown @@ -0,0 +1,88 @@ +# archy + +Render nested hierarchies `npm ls` style with unicode pipes. + +[![browser support](http://ci.testling.com/substack/node-archy.png)](http://ci.testling.com/substack/node-archy) + +[![build status](https://secure.travis-ci.org/substack/node-archy.png)](http://travis-ci.org/substack/node-archy) + +# example + +``` js +var archy = require('archy'); +var s = archy({ + label : 'beep', + nodes : [ + 'ity', + { + label : 'boop', + nodes : [ + { + label : 'o_O', + nodes : [ + { + label : 'oh', + nodes : [ 'hello', 'puny' ] + }, + 'human' + ] + }, + 'party\ntime!' + ] + } + ] +}); +console.log(s); +``` + +output + +``` +beep +├── ity +└─┬ boop + ├─┬ o_O + │ ├─┬ oh + │ │ ├── hello + │ │ └── puny + │ └── human + └── party + time! +``` + +# methods + +var archy = require('archy') + +## archy(obj, prefix='', opts={}) + +Return a string representation of `obj` with unicode pipe characters like how +`npm ls` looks. + +`obj` should be a tree of nested objects with `'label'` and `'nodes'` fields. +`'label'` is a string of text to display at a node level and `'nodes'` is an +array of the descendents of the current node. + +If a node is a string, that string will be used as the `'label'` and an empty +array of `'nodes'` will be used. + +`prefix` gets prepended to all the lines and is used by the algorithm to +recursively update. + +If `'label'` has newlines they will be indented at the present indentation level +with the current prefix. + +To disable unicode results in favor of all-ansi output set `opts.unicode` to +`false`. + +# install + +With [npm](http://npmjs.org) do: + +``` +npm install archy +``` + +# license + +MIT diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/archy/examples/beep.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/archy/examples/beep.js new file mode 100644 index 00000000..9c070479 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/archy/examples/beep.js @@ -0,0 +1,24 @@ +var archy = require('../'); +var s = archy({ + label : 'beep', + nodes : [ + 'ity', + { + label : 'boop', + nodes : [ + { + label : 'o_O', + nodes : [ + { + label : 'oh', + nodes : [ 'hello', 'puny' ] + }, + 'human' + ] + }, + 'party\ntime!' + ] + } + ] +}); +console.log(s); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/archy/examples/multi_line.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/archy/examples/multi_line.js new file mode 100644 index 00000000..8afdfada --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/archy/examples/multi_line.js @@ -0,0 +1,25 @@ +var archy = require('../'); + +var s = archy({ + label : 'beep\none\ntwo', + nodes : [ + 'ity', + { + label : 'boop', + nodes : [ + { + label : 'o_O\nwheee', + nodes : [ + { + label : 'oh', + nodes : [ 'hello', 'puny\nmeat' ] + }, + 'creature' + ] + }, + 'party\ntime!' + ] + } + ] +}); +console.log(s); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/archy/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/archy/index.js new file mode 100644 index 00000000..869d64e6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/archy/index.js @@ -0,0 +1,35 @@ +module.exports = function archy (obj, prefix, opts) { + if (prefix === undefined) prefix = ''; + if (!opts) opts = {}; + var chr = function (s) { + var chars = { + '│' : '|', + '└' : '`', + '├' : '+', + '─' : '-', + '┬' : '-' + }; + return opts.unicode === false ? chars[s] : s; + }; + + if (typeof obj === 'string') obj = { label : obj }; + + var nodes = obj.nodes || []; + var lines = (obj.label || '').split('\n'); + var splitter = '\n' + prefix + (nodes.length ? chr('│') : ' ') + ' '; + + return prefix + + lines.join(splitter) + '\n' + + nodes.map(function (node, ix) { + var last = ix === nodes.length - 1; + var more = node.nodes && node.nodes.length; + var prefix_ = prefix + (last ? ' ' : chr('│')) + ' '; + + return prefix + + (last ? chr('└') : chr('├')) + chr('─') + + (more ? chr('┬') : chr('─')) + ' ' + + archy(node, prefix_, opts).slice(prefix.length + 2) + ; + }).join('') + ; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/archy/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/archy/package.json new file mode 100644 index 00000000..4b3da663 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/archy/package.json @@ -0,0 +1,79 @@ +{ + "name": "archy", + "version": "1.0.0", + "description": "render nested hierarchies `npm ls` style with unicode pipes", + "main": "index.js", + "devDependencies": { + "tap": "~0.3.3", + "tape": "~0.1.1" + }, + "scripts": { + "test": "tap test" + }, + "testling": { + "files": "test/*.js", + "browsers": { + "iexplore": [ + "6.0", + "7.0", + "8.0", + "9.0" + ], + "chrome": [ + "20.0" + ], + "firefox": [ + "10.0", + "15.0" + ], + "safari": [ + "5.1" + ], + "opera": [ + "12.0" + ] + } + }, + "repository": { + "type": "git", + "url": "http://github.com/substack/node-archy.git" + }, + "keywords": [ + "hierarchy", + "npm ls", + "unicode", + "pretty", + "print" + ], + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "license": "MIT", + "gitHead": "30223c16191e877bf027b15b12daf077b9b55b84", + "bugs": { + "url": "https://github.com/substack/node-archy/issues" + }, + "homepage": "https://github.com/substack/node-archy", + "_id": "archy@1.0.0", + "_shasum": "f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40", + "_from": "archy@>=1.0.0 <2.0.0", + "_npmVersion": "1.4.25", + "_npmUser": { + "name": "substack", + "email": "mail@substack.net" + }, + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + } + ], + "dist": { + "shasum": "f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40", + "tarball": "http://registry.npmjs.org/archy/-/archy-1.0.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/archy/test/beep.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/archy/test/beep.js new file mode 100644 index 00000000..4ea74f9c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/archy/test/beep.js @@ -0,0 +1,40 @@ +var test = require('tape'); +var archy = require('../'); + +test('beep', function (t) { + var s = archy({ + label : 'beep', + nodes : [ + 'ity', + { + label : 'boop', + nodes : [ + { + label : 'o_O', + nodes : [ + { + label : 'oh', + nodes : [ 'hello', 'puny' ] + }, + 'human' + ] + }, + 'party!' + ] + } + ] + }); + t.equal(s, [ + 'beep', + '├── ity', + '└─┬ boop', + ' ├─┬ o_O', + ' │ ├─┬ oh', + ' │ │ ├── hello', + ' │ │ └── puny', + ' │ └── human', + ' └── party!', + '' + ].join('\n')); + t.end(); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/archy/test/multi_line.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/archy/test/multi_line.js new file mode 100644 index 00000000..2cf2154d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/archy/test/multi_line.js @@ -0,0 +1,45 @@ +var test = require('tape'); +var archy = require('../'); + +test('multi-line', function (t) { + var s = archy({ + label : 'beep\none\ntwo', + nodes : [ + 'ity', + { + label : 'boop', + nodes : [ + { + label : 'o_O\nwheee', + nodes : [ + { + label : 'oh', + nodes : [ 'hello', 'puny\nmeat' ] + }, + 'creature' + ] + }, + 'party\ntime!' + ] + } + ] + }); + t.equal(s, [ + 'beep', + '│ one', + '│ two', + '├── ity', + '└─┬ boop', + ' ├─┬ o_O', + ' │ │ wheee', + ' │ ├─┬ oh', + ' │ │ ├── hello', + ' │ │ └── puny', + ' │ │ meat', + ' │ └── creature', + ' └── party', + ' time!', + '' + ].join('\n')); + t.end(); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/archy/test/non_unicode.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/archy/test/non_unicode.js new file mode 100644 index 00000000..7204d332 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/archy/test/non_unicode.js @@ -0,0 +1,40 @@ +var test = require('tape'); +var archy = require('../'); + +test('beep', function (t) { + var s = archy({ + label : 'beep', + nodes : [ + 'ity', + { + label : 'boop', + nodes : [ + { + label : 'o_O', + nodes : [ + { + label : 'oh', + nodes : [ 'hello', 'puny' ] + }, + 'human' + ] + }, + 'party!' + ] + } + ] + }, '', { unicode : false }); + t.equal(s, [ + 'beep', + '+-- ity', + '`-- boop', + ' +-- o_O', + ' | +-- oh', + ' | | +-- hello', + ' | | `-- puny', + ' | `-- human', + ' `-- party!', + '' + ].join('\n')); + t.end(); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/async-some/.eslintrc b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/async-some/.eslintrc new file mode 100644 index 00000000..5c39c67e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/async-some/.eslintrc @@ -0,0 +1,18 @@ +{ + "env" : { + "node" : true + }, + "rules" : { + "curly" : 0, + "no-lonely-if" : 1, + "no-mixed-requires" : 0, + "no-underscore-dangle" : 0, + "no-unused-vars" : [2, {"vars" : "all", "args" : "after-used"}], + "no-use-before-define" : [2, "nofunc"], + "quotes" : [1, "double", "avoid-escape"], + "semi" : [2, "never"], + "space-after-keywords" : 1, + "space-infix-ops" : 0, + "strict" : 0 + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/async-some/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/async-some/.npmignore new file mode 100644 index 00000000..3c3629e6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/async-some/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/async-some/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/async-some/LICENSE new file mode 100644 index 00000000..d21147bf --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/async-some/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2014-2015, Forrest L Norvell + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/async-some/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/async-some/README.md new file mode 100644 index 00000000..bb502ee0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/async-some/README.md @@ -0,0 +1,62 @@ +# some + +Short-circuited async Array.prototype.some implementation. + +Serially evaluates a list of values from a JS array or arraylike +against an asynchronous predicate, terminating on the first truthy +value. If the predicate encounters an error, pass it to the completion +callback. Otherwise, pass the truthy value passed by the predicate, or +`false` if no truthy value was passed. + +Is +[Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony)-proof, +browser-safe, and pretty efficient. + +## Usage + +```javascript +var some = require("async-some"); +var resolve = require("path").resolve; +var stat = require("fs").stat; +var readFileSync = require("fs").readFileSync; + +some(["apple", "seaweed", "ham", "quince"], porkDetector, function (error, match) { + if (error) return console.error(error); + + if (match) return console.dir(JSON.parse(readFileSync(match))); + + console.error("time to buy more Sporkle™!"); +}); + +var PREFIX = resolve(__dirname, "../pork_store"); +function porkDetector(value, cb) { + var path = resolve(PREFIX, value + ".json"); + stat(path, function (er, stat) { + if (er) { + if (er.code === "ENOENT") return cb(null, false); + + return cb(er); + } + + cb(er, path); + }); +} +``` + +### some(list, test, callback) + +* `list` {Object} An arraylike (either an Array or the arguments arraylike) to + be checked. +* `test` {Function} The predicate against which the elements of `list` will be + tested. Takes two parameters: + * `element` {any} The element of the list to be tested. + * `callback` {Function} The continuation to be called once the test is + complete. Takes (again) two values: + * `error` {Error} Any errors that the predicate encountered. + * `value` {any} A truthy value. A non-falsy result terminates checking the + entire list. +* `callback` {Function} The callback to invoke when either a value has been + found or the entire input list has been processed with no result. Is invoked + with the traditional two parameters: + * `error` {Error} Errors that were encountered during the evaluation of some(). + * `match` {any} Value successfully matched by `test`, if any. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/async-some/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/async-some/package.json new file mode 100644 index 00000000..b7d5521e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/async-some/package.json @@ -0,0 +1,41 @@ +{ + "name": "async-some", + "version": "1.0.2", + "description": "short-circuited, asynchronous version of Array.protototype.some", + "main": "some.js", + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/othiym23/async-some.git" + }, + "keywords": [ + "async", + "some", + "array", + "collections", + "fp" + ], + "author": { + "name": "Forrest L Norvell", + "email": "ogd@aoaioxxysz.net" + }, + "license": "ISC", + "bugs": { + "url": "https://github.com/othiym23/async-some/issues" + }, + "homepage": "https://github.com/othiym23/async-some", + "dependencies": { + "dezalgo": "^1.0.2" + }, + "devDependencies": { + "tap": "^1.1.0" + }, + "readme": "# some\n\nShort-circuited async Array.prototype.some implementation.\n\nSerially evaluates a list of values from a JS array or arraylike\nagainst an asynchronous predicate, terminating on the first truthy\nvalue. If the predicate encounters an error, pass it to the completion\ncallback. Otherwise, pass the truthy value passed by the predicate, or\n`false` if no truthy value was passed.\n\nIs\n[Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony)-proof,\nbrowser-safe, and pretty efficient.\n\n## Usage\n\n```javascript\nvar some = require(\"async-some\");\nvar resolve = require(\"path\").resolve;\nvar stat = require(\"fs\").stat;\nvar readFileSync = require(\"fs\").readFileSync;\n\nsome([\"apple\", \"seaweed\", \"ham\", \"quince\"], porkDetector, function (error, match) {\n if (error) return console.error(error);\n\n if (match) return console.dir(JSON.parse(readFileSync(match)));\n\n console.error(\"time to buy more Sporkle™!\");\n});\n\nvar PREFIX = resolve(__dirname, \"../pork_store\");\nfunction porkDetector(value, cb) {\n var path = resolve(PREFIX, value + \".json\");\n stat(path, function (er, stat) {\n if (er) {\n if (er.code === \"ENOENT\") return cb(null, false);\n\n return cb(er);\n }\n\n cb(er, path);\n });\n}\n```\n\n### some(list, test, callback)\n\n* `list` {Object} An arraylike (either an Array or the arguments arraylike) to\n be checked.\n* `test` {Function} The predicate against which the elements of `list` will be\n tested. Takes two parameters:\n * `element` {any} The element of the list to be tested.\n * `callback` {Function} The continuation to be called once the test is\n complete. Takes (again) two values:\n * `error` {Error} Any errors that the predicate encountered.\n * `value` {any} A truthy value. A non-falsy result terminates checking the\n entire list.\n* `callback` {Function} The callback to invoke when either a value has been\n found or the entire input list has been processed with no result. Is invoked\n with the traditional two parameters:\n * `error` {Error} Errors that were encountered during the evaluation of some().\n * `match` {any} Value successfully matched by `test`, if any.\n", + "readmeFilename": "README.md", + "gitHead": "3a5086ad54739c48b2bbf073f23bcc95658199e3", + "_id": "async-some@1.0.2", + "_shasum": "4d8a81620d5958791b5b98f802d3207776e95509", + "_from": "async-some@>=1.0.2 <1.1.0" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/async-some/some.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/async-some/some.js new file mode 100644 index 00000000..0419709f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/async-some/some.js @@ -0,0 +1,47 @@ +var assert = require("assert") +var dezalgoify = require("dezalgo") + +module.exports = some + +/** + * short-circuited async Array.prototype.some implementation + * + * Serially evaluates a list of values from a JS array or arraylike + * against an asynchronous predicate, terminating on the first truthy + * value. If the predicate encounters an error, pass it to the completion + * callback. Otherwise, pass the truthy value passed by the predicate, or + * `false` if no truthy value was passed. + */ +function some (list, test, cb) { + assert("length" in list, "array must be arraylike") + assert.equal(typeof test, "function", "predicate must be callable") + assert.equal(typeof cb, "function", "callback must be callable") + + var array = slice(list) + , index = 0 + , length = array.length + , hecomes = dezalgoify(cb) + + map() + + function map () { + if (index >= length) return hecomes(null, false) + + test(array[index], reduce) + } + + function reduce (er, result) { + if (er) return hecomes(er, false) + if (result) return hecomes(null, result) + + index++ + map() + } +} + +// Array.prototype.slice on arguments arraylike is expensive +function slice(args) { + var l = args.length, a = [], i + for (i = 0; i < l; i++) a[i] = args[i] + return a +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/async-some/test/base-case.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/async-some/test/base-case.js new file mode 100644 index 00000000..35689052 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/async-some/test/base-case.js @@ -0,0 +1,35 @@ +var test = require("tap").test + +var some = require("../some.js") + +test("some() array base case", function (t) { + some([], failer, function (error, match) { + t.ifError(error, "ran successfully") + + t.notOk(match, "nothing to find, so nothing found") + + t.end() + }) + + function failer(value, cb) { + cb(new Error("test should never have been called")) + } +}) + +test("some() arguments arraylike base case", function (t) { + go() + + function go() { + some(arguments, failer, function (error, match) { + t.ifError(error, "ran successfully") + + t.notOk(match, "nothing to find, so nothing found") + + t.end() + }) + + function failer(value, cb) { + cb(new Error("test should never have been called")) + } + } +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/async-some/test/parameters.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/async-some/test/parameters.js new file mode 100644 index 00000000..0706d1da --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/async-some/test/parameters.js @@ -0,0 +1,37 @@ +var test = require("tap").test + +var some = require("../some.js") + +var NOP = function () {} + +test("some() called with bogus parameters", function (t) { + t.throws(function () { + some() + }, "throws when called with no parameters") + + t.throws(function () { + some(null, NOP, NOP) + }, "throws when called with no list") + + t.throws(function () { + some([], null, NOP) + }, "throws when called with no predicate") + + t.throws(function () { + some([], NOP, null) + }, "throws when called with no callback") + + t.throws(function () { + some({}, NOP, NOP) + }, "throws when called with wrong list type") + + t.throws(function () { + some([], "ham", NOP) + }, "throws when called with wrong test type") + + t.throws(function () { + some([], NOP, "ham") + }, "throws when called with wrong test type") + + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/async-some/test/simple.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/async-some/test/simple.js new file mode 100644 index 00000000..3d68e1e5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/async-some/test/simple.js @@ -0,0 +1,60 @@ +var test = require("tap").test + +var some = require("../some.js") + +test("some() doesn't find anything asynchronously", function (t) { + some(["a", "b", "c", "d", "e", "f", "g"], predicate, function (error, match) { + t.ifError(error, "ran successfully") + + t.notOk(match, "nothing to find, so nothing found") + + t.end() + }) + + function predicate(value, cb) { + // dezalgo ensures it's safe to not do this, but just in case + setTimeout(function () { cb(null, value > "j" && value) }) + } +}) + +test("some() doesn't find anything synchronously", function (t) { + some(["a", "b", "c", "d", "e", "f", "g"], predicate, function (error, match) { + t.ifError(error, "ran successfully") + + t.notOk(match, "nothing to find, so nothing found") + + t.end() + }) + + function predicate(value, cb) { + cb(null, value > "j" && value) + } +}) + +test("some() doesn't find anything asynchronously", function (t) { + some(["a", "b", "c", "d", "e", "f", "g"], predicate, function (error, match) { + t.ifError(error, "ran successfully") + + t.equals(match, "d", "found expected element") + + t.end() + }) + + function predicate(value, cb) { + setTimeout(function () { cb(null, value > "c" && value) }) + } +}) + +test("some() doesn't find anything synchronously", function (t) { + some(["a", "b", "c", "d", "e", "f", "g"], predicate, function (error, match) { + t.ifError(error, "ran successfully") + + t.equals(match, "d", "found expected") + + t.end() + }) + + function predicate(value, cb) { + cb(null, value > "c" && value) + } +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/block-stream/LICENCE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/block-stream/LICENCE new file mode 100644 index 00000000..74489e2e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/block-stream/LICENCE @@ -0,0 +1,25 @@ +Copyright (c) Isaac Z. Schlueter +All rights reserved. + +The BSD License + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/block-stream/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/block-stream/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/block-stream/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/block-stream/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/block-stream/README.md new file mode 100644 index 00000000..c16e9c46 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/block-stream/README.md @@ -0,0 +1,14 @@ +# block-stream + +A stream of blocks. + +Write data into it, and it'll output data in buffer blocks the size you +specify, padding with zeroes if necessary. + +```javascript +var block = new BlockStream(512) +fs.createReadStream("some-file").pipe(block) +block.pipe(fs.createWriteStream("block-file")) +``` + +When `.end()` or `.flush()` is called, it'll pad the block with zeroes. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/block-stream/block-stream.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/block-stream/block-stream.js new file mode 100644 index 00000000..008de035 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/block-stream/block-stream.js @@ -0,0 +1,209 @@ +// write data to it, and it'll emit data in 512 byte blocks. +// if you .end() or .flush(), it'll emit whatever it's got, +// padded with nulls to 512 bytes. + +module.exports = BlockStream + +var Stream = require("stream").Stream + , inherits = require("inherits") + , assert = require("assert").ok + , debug = process.env.DEBUG ? console.error : function () {} + +function BlockStream (size, opt) { + this.writable = this.readable = true + this._opt = opt || {} + this._chunkSize = size || 512 + this._offset = 0 + this._buffer = [] + this._bufferLength = 0 + if (this._opt.nopad) this._zeroes = false + else { + this._zeroes = new Buffer(this._chunkSize) + for (var i = 0; i < this._chunkSize; i ++) { + this._zeroes[i] = 0 + } + } +} + +inherits(BlockStream, Stream) + +BlockStream.prototype.write = function (c) { + // debug(" BS write", c) + if (this._ended) throw new Error("BlockStream: write after end") + if (c && !Buffer.isBuffer(c)) c = new Buffer(c + "") + if (c.length) { + this._buffer.push(c) + this._bufferLength += c.length + } + // debug("pushed onto buffer", this._bufferLength) + if (this._bufferLength >= this._chunkSize) { + if (this._paused) { + // debug(" BS paused, return false, need drain") + this._needDrain = true + return false + } + this._emitChunk() + } + return true +} + +BlockStream.prototype.pause = function () { + // debug(" BS pausing") + this._paused = true +} + +BlockStream.prototype.resume = function () { + // debug(" BS resume") + this._paused = false + return this._emitChunk() +} + +BlockStream.prototype.end = function (chunk) { + // debug("end", chunk) + if (typeof chunk === "function") cb = chunk, chunk = null + if (chunk) this.write(chunk) + this._ended = true + this.flush() +} + +BlockStream.prototype.flush = function () { + this._emitChunk(true) +} + +BlockStream.prototype._emitChunk = function (flush) { + // debug("emitChunk flush=%j emitting=%j paused=%j", flush, this._emitting, this._paused) + + // emit a chunk + if (flush && this._zeroes) { + // debug(" BS push zeroes", this._bufferLength) + // push a chunk of zeroes + var padBytes = (this._bufferLength % this._chunkSize) + if (padBytes !== 0) padBytes = this._chunkSize - padBytes + if (padBytes > 0) { + // debug("padBytes", padBytes, this._zeroes.slice(0, padBytes)) + this._buffer.push(this._zeroes.slice(0, padBytes)) + this._bufferLength += padBytes + // debug(this._buffer[this._buffer.length - 1].length, this._bufferLength) + } + } + + if (this._emitting || this._paused) return + this._emitting = true + + // debug(" BS entering loops") + var bufferIndex = 0 + while (this._bufferLength >= this._chunkSize && + (flush || !this._paused)) { + // debug(" BS data emission loop", this._bufferLength) + + var out + , outOffset = 0 + , outHas = this._chunkSize + + while (outHas > 0 && (flush || !this._paused) ) { + // debug(" BS data inner emit loop", this._bufferLength) + var cur = this._buffer[bufferIndex] + , curHas = cur.length - this._offset + // debug("cur=", cur) + // debug("curHas=%j", curHas) + // If it's not big enough to fill the whole thing, then we'll need + // to copy multiple buffers into one. However, if it is big enough, + // then just slice out the part we want, to save unnecessary copying. + // Also, need to copy if we've already done some copying, since buffers + // can't be joined like cons strings. + if (out || curHas < outHas) { + out = out || new Buffer(this._chunkSize) + cur.copy(out, outOffset, + this._offset, this._offset + Math.min(curHas, outHas)) + } else if (cur.length === outHas && this._offset === 0) { + // shortcut -- cur is exactly long enough, and no offset. + out = cur + } else { + // slice out the piece of cur that we need. + out = cur.slice(this._offset, this._offset + outHas) + } + + if (curHas > outHas) { + // means that the current buffer couldn't be completely output + // update this._offset to reflect how much WAS written + this._offset += outHas + outHas = 0 + } else { + // output the entire current chunk. + // toss it away + outHas -= curHas + outOffset += curHas + bufferIndex ++ + this._offset = 0 + } + } + + this._bufferLength -= this._chunkSize + assert(out.length === this._chunkSize) + // debug("emitting data", out) + // debug(" BS emitting, paused=%j", this._paused, this._bufferLength) + this.emit("data", out) + out = null + } + // debug(" BS out of loops", this._bufferLength) + + // whatever is left, it's not enough to fill up a block, or we're paused + this._buffer = this._buffer.slice(bufferIndex) + if (this._paused) { + // debug(" BS paused, leaving", this._bufferLength) + this._needsDrain = true + this._emitting = false + return + } + + // if flushing, and not using null-padding, then need to emit the last + // chunk(s) sitting in the queue. We know that it's not enough to + // fill up a whole block, because otherwise it would have been emitted + // above, but there may be some offset. + var l = this._buffer.length + if (flush && !this._zeroes && l) { + if (l === 1) { + if (this._offset) { + this.emit("data", this._buffer[0].slice(this._offset)) + } else { + this.emit("data", this._buffer[0]) + } + } else { + var outHas = this._bufferLength + , out = new Buffer(outHas) + , outOffset = 0 + for (var i = 0; i < l; i ++) { + var cur = this._buffer[i] + , curHas = cur.length - this._offset + cur.copy(out, outOffset, this._offset) + this._offset = 0 + outOffset += curHas + this._bufferLength -= curHas + } + this.emit("data", out) + } + // truncate + this._buffer.length = 0 + this._bufferLength = 0 + this._offset = 0 + } + + // now either drained or ended + // debug("either draining, or ended", this._bufferLength, this._ended) + // means that we've flushed out all that we can so far. + if (this._needDrain) { + // debug("emitting drain", this._bufferLength) + this._needDrain = false + this.emit("drain") + } + + if ((this._bufferLength === 0) && this._ended && !this._endEmitted) { + // debug("emitting end", this._bufferLength) + this._endEmitted = true + this.emit("end") + } + + this._emitting = false + + // debug(" BS no longer emitting", flush, this._paused, this._emitting, this._bufferLength, this._chunkSize) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/block-stream/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/block-stream/package.json new file mode 100644 index 00000000..890c6725 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/block-stream/package.json @@ -0,0 +1,61 @@ +{ + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "name": "block-stream", + "description": "a stream of blocks", + "version": "0.0.9", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/block-stream.git" + }, + "engines": { + "node": "0.4 || >=0.5.8" + }, + "main": "block-stream.js", + "dependencies": { + "inherits": "~2.0.0" + }, + "devDependencies": { + "tap": "^5.7.1" + }, + "scripts": { + "test": "tap test/*.js --cov" + }, + "license": "ISC", + "files": [ + "block-stream.js" + ], + "gitHead": "321cf242ef6d130bb2e59c0565a61ded5dd2673f", + "bugs": { + "url": "https://github.com/isaacs/block-stream/issues" + }, + "homepage": "https://github.com/isaacs/block-stream#readme", + "_id": "block-stream@0.0.9", + "_shasum": "13ebfe778a03205cfe03751481ebb4b3300c126a", + "_from": "block-stream@0.0.9", + "_npmVersion": "3.8.5", + "_nodeVersion": "5.6.0", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "dist": { + "shasum": "13ebfe778a03205cfe03751481ebb4b3300c126a", + "tarball": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/block-stream-0.0.9.tgz_1462149852620_0.6890447810292244" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/char-spinner/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/char-spinner/LICENSE new file mode 100644 index 00000000..05eeeb88 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/char-spinner/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/char-spinner/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/char-spinner/README.md new file mode 100644 index 00000000..b1290f59 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/char-spinner/README.md @@ -0,0 +1,31 @@ +# char-spinner + +Put a little spinner on process.stderr, as unobtrusively as possible. + +## USAGE + +```javascript +var spinner = require("char-spinner") + +// All options are optional +// even the options argument itself is optional +spinner(options) +``` + +## OPTIONS + +Usually the defaults are what you want. Mostly they're just +configurable for testing purposes. + +* `stream` Output stream. Default=`process.stderr` +* `tty` Only show spinner if output stream has a truish `.isTTY`. Default=`true` +* `string` String of chars to spin. Default=`'/-\\|'` +* `interval` Number of ms between frames, bigger = slower. Default=`50` +* `cleanup` Print `'\r \r'` to stream on process exit. Default=`true` +* `unref` Unreference the spinner interval so that the process can + exit normally. Default=`true` +* `delay` Number of frames to "skip over" before printing the spinner. + Useful if you want to avoid showing the spinner for very fast + actions. Default=`2` + +Returns the generated interval, if one was created. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/char-spinner/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/char-spinner/package.json new file mode 100644 index 00000000..91092d84 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/char-spinner/package.json @@ -0,0 +1,54 @@ +{ + "name": "char-spinner", + "version": "1.0.1", + "description": "Put a little spinner on process.stderr, as unobtrusively as possible.", + "main": "spin.js", + "directories": { + "test": "test" + }, + "dependencies": {}, + "devDependencies": { + "tap": "^0.4.10" + }, + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/isaacs/char-spinner" + }, + "keywords": [ + "char", + "spinner" + ], + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "ISC", + "bugs": { + "url": "https://github.com/isaacs/char-spinner/issues" + }, + "homepage": "https://github.com/isaacs/char-spinner", + "gitHead": "091b2ff5960aa083f68a5619fa93999d072aa152", + "_id": "char-spinner@1.0.1", + "_shasum": "e6ea67bd247e107112983b7ab0479ed362800081", + "_from": "char-spinner@latest", + "_npmVersion": "1.4.13", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "dist": { + "shasum": "e6ea67bd247e107112983b7ab0479ed362800081", + "tarball": "http://registry.npmjs.org/char-spinner/-/char-spinner-1.0.1.tgz" + }, + "_resolved": "https://registry.npmjs.org/char-spinner/-/char-spinner-1.0.1.tgz" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/char-spinner/spin.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/char-spinner/spin.js new file mode 100644 index 00000000..cae8540c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/char-spinner/spin.js @@ -0,0 +1,51 @@ +module.exports = spinner + +function spinner(opt) { + opt = opt || {} + var str = opt.stream || process.stderr + var tty = typeof opt.tty === 'boolean' ? opt.tty : true + var string = opt.string || '/-\\|' + var ms = typeof opt.interval === 'number' ? opt.interval : 50 + if (ms < 0) ms = 0 + if (tty && !str.isTTY) return false + var CR = str.isTTY ? '\u001b[0G' : '\u000d'; + var CLEAR = str.isTTY ? '\u001b[2K' : '\u000d \u000d'; + + var s = 0 + var sprite = string.split('') + var wrote = false + + var delay = typeof opt.delay === 'number' ? opt.delay : 2 + + var interval = setInterval(function() { + if (--delay >= 0) return + s = ++s % sprite.length + var c = sprite[s] + str.write(c + CR) + wrote = true + }, ms) + + var unref = typeof opt.unref === 'boolean' ? opt.unref : true + if (unref && typeof interval.unref === 'function') { + interval.unref() + } + + var cleanup = typeof opt.cleanup === 'boolean' ? opt.cleanup : true + if (cleanup) { + process.on('exit', function() { + if (wrote) { + str.write(CLEAR); + } + }) + } + + module.exports.clear = function () { + str.write(CLEAR); + }; + + return interval +} + +module.exports.clear = function () {}; + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/char-spinner/test/basic.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/char-spinner/test/basic.js new file mode 100644 index 00000000..ed91b984 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/char-spinner/test/basic.js @@ -0,0 +1,35 @@ +var test = require('tap').test +var spinner = require('../spin.js') + +test('does nothing when not a tty', function(t) { + var int = spinner({ + stream: { write: function(c) { + throw new Error('wrote something: ' + JSON.stringify(c)) + }, isTTY: false }, + }) + t.notOk(int) + t.end() +}) + +test('write spinny stuff', function(t) { + var output = '' + var written = 0 + var expect = "b\u001b[0Gc\u001b[0Gd\u001b[0Ge\u001b[0Gf\u001b[0Gg\u001b[0Gh\u001b[0Gi\u001b[0Gj\u001b[0Gk\u001b[0Gl\u001b[0Gm\u001b[0Gn\u001b[0Go\u001b[0Gp\u001b[0Ga\u001b[0Gb\u001b[0Gc\u001b[0Gd\u001b[0Ge\u001b[0Gf\u001b[0Gg\u001b[0Gh\u001b[0Gi\u001b[0Gj\u001b[0Gk\u001b[0Gl\u001b[0Gm\u001b[0Gn\u001b[0Go\u001b[0Gp\u001b[0Ga\u001b[0Gb\u001b[0Gc\u001b[0Gd\u001b[0Ge\u001b[0Gf\u001b[0Gg\u001b[0Gh\u001b[0Gi\u001b[0Gj\u001b[0Gk\u001b[0Gl\u001b[0Gm\u001b[0Gn\u001b[0Go\u001b[0Gp\u001b[0Ga\u001b[0Gb\u001b[0Gc\u001b[0G" + + var int = spinner({ + interval: 0, + string: 'abcdefghijklmnop', + stream: { + write: function(c) { + output += c + if (++written == 50) { + t.equal(output, expect) + clearInterval(int) + t.end() + } + }, + isTTY: true + }, + cleanup: false + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/chmodr/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/chmodr/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/chmodr/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/chmodr/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/chmodr/README.md new file mode 100644 index 00000000..e3e9313c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/chmodr/README.md @@ -0,0 +1,3 @@ +Like `chmod -R`. + +Takes the same arguments as `fs.chmod()` diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/chmodr/chmodr.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/chmodr/chmodr.js new file mode 100644 index 00000000..2f30d2f8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/chmodr/chmodr.js @@ -0,0 +1,76 @@ +module.exports = chmodr +chmodr.sync = chmodrSync + +var fs = require("fs") +var path = require("path") + +function chmodr (p, mode, cb) { + fs.lstat(p, function (er, stats) { + if (er) + return cb(er) + if (stats.isSymbolicLink()) + return cb() + if (stats.isDirectory()) + return chmodrDir(p, mode, cb) + return fs.chmod(p, mode, cb) + }) +} + +function chmodrDir (p, mode, cb) { + fs.readdir(p, function (er, children) { + if (er) + return cb(er) + + if (!children.length) + return fs.chmod(p, dirMode(mode), cb) + + var len = children.length + var errState = null + children.forEach(function (child) { + chmodr(path.resolve(p, child), mode, then) + }) + + // return first error, but not until all are finished, + // so we don't keep performing FS operations after the cb + function then (er) { + len = len - 1 + if (er && !errState) + errState = er + if (len === 0) { + if (errState) + return cb(errState) + else + return fs.chmod(p, dirMode(mode), cb) + } + } + }) +} + +function chmodrSync (p, mode) { + var stats = fs.lstatSync(p) + if (stats.isSymbolicLink()) + return + if (stats.isDirectory()) + return chmodrDirSync(p, mode) + else + return fs.chmodSync(p, mode) +} + +function chmodrDirSync (p, mode) { + fs.readdirSync(p).forEach(function (child) { + chmodrSync(path.resolve(p, child), mode) + }) + return fs.chmodSync(p, dirMode(mode)) +} + +// If a party has r, add x +// so that dirs are listable +function dirMode(mode) { + if (mode & 0400) + mode |= 0100 + if (mode & 040) + mode |= 010 + if (mode & 04) + mode |= 01 + return mode +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/chmodr/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/chmodr/package.json new file mode 100644 index 00000000..cd32ff52 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/chmodr/package.json @@ -0,0 +1,53 @@ +{ + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "name": "chmodr", + "description": "like `chmod -R`", + "version": "1.0.2", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/chmodr.git" + }, + "main": "chmodr.js", + "devDependencies": { + "mkdirp": "0.3", + "rimraf": "", + "tap": "^1.3.2" + }, + "scripts": { + "test": "tap test/*.js" + }, + "license": "ISC", + "files": [ + "chmodr.js" + ], + "gitHead": "1eeeb38b3a4899714e11840fe28ea7fd93865f01", + "bugs": { + "url": "https://github.com/isaacs/chmodr/issues" + }, + "homepage": "https://github.com/isaacs/chmodr#readme", + "_id": "chmodr@1.0.2", + "_shasum": "04662b932d0f02ec66deaa2b0ea42811968e3eb9", + "_from": "chmodr@>=1.0.2 <1.1.0", + "_npmVersion": "3.3.2", + "_nodeVersion": "4.0.0", + "_npmUser": { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + "dist": { + "shasum": "04662b932d0f02ec66deaa2b0ea42811968e3eb9", + "tarball": "http://registry.npmjs.org/chmodr/-/chmodr-1.0.2.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/chmodr/-/chmodr-1.0.2.tgz" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/chownr/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/chownr/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/chownr/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/chownr/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/chownr/README.md new file mode 100644 index 00000000..70e9a54a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/chownr/README.md @@ -0,0 +1,3 @@ +Like `chown -R`. + +Takes the same arguments as `fs.chown()` diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/chownr/chownr.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/chownr/chownr.js new file mode 100644 index 00000000..ecd7b452 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/chownr/chownr.js @@ -0,0 +1,52 @@ +module.exports = chownr +chownr.sync = chownrSync + +var fs = require("fs") +, path = require("path") + +function chownr (p, uid, gid, cb) { + fs.readdir(p, function (er, children) { + // any error other than ENOTDIR means it's not readable, or + // doesn't exist. give up. + if (er && er.code !== "ENOTDIR") return cb(er) + if (er || !children.length) return fs.chown(p, uid, gid, cb) + + var len = children.length + , errState = null + children.forEach(function (child) { + var pathChild = path.resolve(p, child); + fs.lstat(pathChild, function(er, stats) { + if (er) + return cb(er) + if (!stats.isSymbolicLink()) + chownr(pathChild, uid, gid, then) + else + then() + }) + }) + function then (er) { + if (errState) return + if (er) return cb(errState = er) + if (-- len === 0) return fs.chown(p, uid, gid, cb) + } + }) +} + +function chownrSync (p, uid, gid) { + var children + try { + children = fs.readdirSync(p) + } catch (er) { + if (er && er.code === "ENOTDIR") return fs.chownSync(p, uid, gid) + throw er + } + if (!children.length) return fs.chownSync(p, uid, gid) + + children.forEach(function (child) { + var pathChild = path.resolve(p, child) + var stats = fs.lstatSync(pathChild) + if (!stats.isSymbolicLink()) + chownrSync(pathChild, uid, gid) + }) + return fs.chownSync(p, uid, gid) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/chownr/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/chownr/package.json new file mode 100644 index 00000000..fdd1dd23 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/chownr/package.json @@ -0,0 +1,54 @@ +{ + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "name": "chownr", + "description": "like `chown -R`", + "version": "1.0.1", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/chownr.git" + }, + "main": "chownr.js", + "files": [ + "chownr.js" + ], + "devDependencies": { + "mkdirp": "0.3", + "rimraf": "", + "tap": "^1.2.0" + }, + "scripts": { + "test": "tap test/*.js" + }, + "license": "ISC", + "gitHead": "c6c43844e80d7c7045e737a72b9fbb1ba0579a26", + "bugs": { + "url": "https://github.com/isaacs/chownr/issues" + }, + "homepage": "https://github.com/isaacs/chownr#readme", + "_id": "chownr@1.0.1", + "_shasum": "e2a75042a9551908bebd25b8523d5f9769d79181", + "_from": "chownr@1.0.1", + "_npmVersion": "3.2.2", + "_nodeVersion": "2.2.1", + "_npmUser": { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + "dist": { + "shasum": "e2a75042a9551908bebd25b8523d5f9769d79181", + "tarball": "http://registry.npmjs.org/chownr/-/chownr-1.0.1.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/chownr/-/chownr-1.0.1.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/cmd-shim/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/cmd-shim/.npmignore new file mode 100644 index 00000000..699b5d4f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/cmd-shim/.npmignore @@ -0,0 +1,16 @@ +lib-cov +*.seed +*.log +*.csv +*.dat +*.out +*.pid +*.gz + +pids +logs +results + +npm-debug.log + +node_modules diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/cmd-shim/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/cmd-shim/.travis.yml new file mode 100644 index 00000000..2ca91f28 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/cmd-shim/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.10" + - "0.8" \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/cmd-shim/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/cmd-shim/LICENSE new file mode 100644 index 00000000..0c44ae71 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/cmd-shim/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) Isaac Z. Schlueter ("Author") +All rights reserved. + +The BSD License + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/cmd-shim/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/cmd-shim/README.md new file mode 100644 index 00000000..ff6745f8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/cmd-shim/README.md @@ -0,0 +1,44 @@ +# cmd-shim + +The cmd-shim used in npm to create executable scripts on Windows, +since symlinks are not suitable for this purpose there. + +On Unix systems, you should use a symbolic link instead. + +[![Build Status](https://img.shields.io/travis/ForbesLindesay/cmd-shim/master.svg)](https://travis-ci.org/ForbesLindesay/cmd-shim) +[![Dependency Status](https://img.shields.io/david/ForbesLindesay/cmd-shim.svg)](https://david-dm.org/ForbesLindesay/cmd-shim) +[![NPM version](https://img.shields.io/npm/v/cmd-shim.svg)](https://www.npmjs.com/package/cmd-shim) + +## Installation + +``` +npm install cmd-shim +``` + +## API + +### cmdShim(from, to, cb) + +Create a cmd shim at `to` for the command line program at `from`. +e.g. + +```javascript +var cmdShim = require('cmd-shim'); +cmdShim(__dirname + '/cli.js', '/usr/bin/command-name', function (err) { + if (err) throw err; +}); +``` + +### cmdShim.ifExists(from, to, cb) + +The same as above, but will just continue if the file does not exist. +Source: + +```javascript +function cmdShimIfExists (from, to, cb) { + fs.stat(from, function (er) { + if (er) return cb() + cmdShim(from, to, cb) + }) +} +``` diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/cmd-shim/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/cmd-shim/index.js new file mode 100644 index 00000000..9f22e103 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/cmd-shim/index.js @@ -0,0 +1,180 @@ +// On windows, create a .cmd file. +// Read the #! in the file to see what it uses. The vast majority +// of the time, this will be either: +// "#!/usr/bin/env " +// or: +// "#! " +// +// Write a binroot/pkg.bin + ".cmd" file that has this line in it: +// @ %~dp0 %* + +module.exports = cmdShim +cmdShim.ifExists = cmdShimIfExists + +var fs = require("graceful-fs") + +var mkdir = require("mkdirp") + , path = require("path") + , shebangExpr = /^#\!\s*(?:\/usr\/bin\/env)?\s*([^ \t]+)(.*)$/ + +function cmdShimIfExists (from, to, cb) { + fs.stat(from, function (er) { + if (er) return cb() + cmdShim(from, to, cb) + }) +} + +// Try to unlink, but ignore errors. +// Any problems will surface later. +function rm (path, cb) { + fs.unlink(path, function(er) { + cb() + }) +} + +function cmdShim (from, to, cb) { + fs.stat(from, function (er, stat) { + if (er) + return cb(er) + + cmdShim_(from, to, cb) + }) +} + +function cmdShim_ (from, to, cb) { + var then = times(2, next, cb) + rm(to, then) + rm(to + ".cmd", then) + + function next(er) { + writeShim(from, to, cb) + } +} + +function writeShim (from, to, cb) { + // make a cmd file and a sh script + // First, check if the bin is a #! of some sort. + // If not, then assume it's something that'll be compiled, or some other + // sort of script, and just call it directly. + mkdir(path.dirname(to), function (er) { + if (er) + return cb(er) + fs.readFile(from, "utf8", function (er, data) { + if (er) return writeShim_(from, to, null, null, cb) + var firstLine = data.trim().split(/\r*\n/)[0] + , shebang = firstLine.match(shebangExpr) + if (!shebang) return writeShim_(from, to, null, null, cb) + var prog = shebang[1] + , args = shebang[2] || "" + return writeShim_(from, to, prog, args, cb) + }) + }) +} + +function writeShim_ (from, to, prog, args, cb) { + var shTarget = path.relative(path.dirname(to), from) + , target = shTarget.split("/").join("\\") + , longProg + , shProg = prog && prog.split("\\").join("/") + , shLongProg + shTarget = shTarget.split("\\").join("/") + args = args || "" + if (!prog) { + prog = "\"%~dp0\\" + target + "\"" + shProg = "\"$basedir/" + shTarget + "\"" + args = "" + target = "" + shTarget = "" + } else { + longProg = "\"%~dp0\\" + prog + ".exe\"" + shLongProg = "\"$basedir/" + prog + "\"" + target = "\"%~dp0\\" + target + "\"" + shTarget = "\"$basedir/" + shTarget + "\"" + } + + // @IF EXIST "%~dp0\node.exe" ( + // "%~dp0\node.exe" "%~dp0\.\node_modules\npm\bin\npm-cli.js" %* + // ) ELSE ( + // SETLOCAL + // SET PATHEXT=%PATHEXT:;.JS;=;% + // node "%~dp0\.\node_modules\npm\bin\npm-cli.js" %* + // ) + var cmd + if (longProg) { + cmd = "@IF EXIST " + longProg + " (\r\n" + + " " + longProg + " " + args + " " + target + " %*\r\n" + + ") ELSE (\r\n" + + " @SETLOCAL\r\n" + + " @SET PATHEXT=%PATHEXT:;.JS;=;%\r\n" + + " " + prog + " " + args + " " + target + " %*\r\n" + + ")" + } else { + cmd = "@" + prog + " " + args + " " + target + " %*\r\n" + } + + // #!/bin/sh + // basedir=`dirname "$0"` + // + // case `uname` in + // *CYGWIN*) basedir=`cygpath -w "$basedir"`;; + // esac + // + // if [ -x "$basedir/node.exe" ]; then + // "$basedir/node.exe" "$basedir/node_modules/npm/bin/npm-cli.js" "$@" + // ret=$? + // else + // node "$basedir/node_modules/npm/bin/npm-cli.js" "$@" + // ret=$? + // fi + // exit $ret + + var sh = "#!/bin/sh\n" + + if (shLongProg) { + sh = sh + + "basedir=$(dirname \"$(echo \"$0\" | sed -e 's,\\\\,/,g')\")\n" + + "\n" + + "case `uname` in\n" + + " *CYGWIN*) basedir=`cygpath -w \"$basedir\"`;;\n" + + "esac\n" + + "\n" + + sh = sh + + "if [ -x "+shLongProg+" ]; then\n" + + " " + shLongProg + " " + args + " " + shTarget + " \"$@\"\n" + + " ret=$?\n" + + "else \n" + + " " + shProg + " " + args + " " + shTarget + " \"$@\"\n" + + " ret=$?\n" + + "fi\n" + + "exit $ret\n" + } else { + sh = shProg + " " + args + " " + shTarget + " \"$@\"\n" + + "exit $?\n" + } + + var then = times(2, next, cb) + fs.writeFile(to + ".cmd", cmd, "utf8", then) + fs.writeFile(to, sh, "utf8", then) + function next () { + chmodShim(to, cb) + } +} + +function chmodShim (to, cb) { + var then = times(2, cb, cb) + fs.chmod(to, 0755, then) + fs.chmod(to + ".cmd", 0755, then) +} + +function times(n, ok, cb) { + var errState = null + return function(er) { + if (!errState) { + if (er) + cb(errState = er) + else if (--n === 0) + ok() + } + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/cmd-shim/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/cmd-shim/package.json new file mode 100644 index 00000000..c2b91db6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/cmd-shim/package.json @@ -0,0 +1,52 @@ +{ + "name": "cmd-shim", + "version": "2.0.2", + "description": "Used in npm for command line application support", + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ForbesLindesay/cmd-shim.git" + }, + "license": "BSD-2-Clause", + "dependencies": { + "graceful-fs": "^4.1.2", + "mkdirp": "~0.5.0" + }, + "devDependencies": { + "tap": "~0.4.11", + "rimraf": "~2.2.8" + }, + "gitHead": "8492e2a92b5062bb02a9eec509e57eea94b110a7", + "bugs": { + "url": "https://github.com/ForbesLindesay/cmd-shim/issues" + }, + "homepage": "https://github.com/ForbesLindesay/cmd-shim", + "_id": "cmd-shim@2.0.2", + "_shasum": "6fcbda99483a8fd15d7d30a196ca69d688a2efdb", + "_from": "cmd-shim@2.0.2", + "_npmVersion": "2.7.1", + "_nodeVersion": "1.6.2", + "_npmUser": { + "name": "forbeslindesay", + "email": "forbes@lindesay.co.uk" + }, + "dist": { + "shasum": "6fcbda99483a8fd15d7d30a196ca69d688a2efdb", + "tarball": "http://registry.npmjs.org/cmd-shim/-/cmd-shim-2.0.2.tgz" + }, + "maintainers": [ + { + "name": "forbeslindesay", + "email": "forbes@lindesay.co.uk" + } + ], + "_npmOperationalInternal": { + "host": "packages-6-west.internal.npmjs.com", + "tmp": "tmp/cmd-shim-2.0.2.tgz_1455116566936_0.7582207734230906" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/cmd-shim/-/cmd-shim-2.0.2.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/cmd-shim/test/00-setup.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/cmd-shim/test/00-setup.js new file mode 100644 index 00000000..04ec2b25 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/cmd-shim/test/00-setup.js @@ -0,0 +1,34 @@ +var test = require('tap').test +var mkdirp = require('mkdirp') +var fs = require('fs') +var path = require('path') +var fixtures = path.resolve(__dirname, 'fixtures') + +var froms = { + 'from.exe': 'exe', + 'from.env': '#!/usr/bin/env node\nconsole.log(/hi/)\n', + 'from.env.args': '#!/usr/bin/env node --expose_gc\ngc()\n', + 'from.sh': '#!/usr/bin/sh\necho hi\n', + 'from.sh.args': '#!/usr/bin/sh -x\necho hi\n' +} + +var cmdShim = require('../') + +test('create fixture', function (t) { + mkdirp(fixtures, function (er) { + if (er) + throw er + t.pass('made dir') + Object.keys(froms).forEach(function (f) { + t.test('write ' + f, function (t) { + fs.writeFile(path.resolve(fixtures, f), froms[f], function (er) { + if (er) + throw er + t.pass('wrote ' + f) + t.end() + }) + }) + }) + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/cmd-shim/test/basic.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/cmd-shim/test/basic.js new file mode 100644 index 00000000..09823158 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/cmd-shim/test/basic.js @@ -0,0 +1,175 @@ +var test = require('tap').test +var mkdirp = require('mkdirp') +var fs = require('fs') +var path = require('path') +var fixtures = path.resolve(__dirname, 'fixtures') + +var cmdShim = require('../') + +test('no shebang', function (t) { + var from = path.resolve(fixtures, 'from.exe') + var to = path.resolve(fixtures, 'exe.shim') + cmdShim(from, to, function(er) { + if (er) + throw er + t.equal(fs.readFileSync(to, 'utf8'), + "\"$basedir/from.exe\" \"$@\"\nexit $?\n") + t.equal(fs.readFileSync(to + '.cmd', 'utf8'), + "@\"%~dp0\\from.exe\" %*\r\n") + t.end() + }) +}) + +test('env shebang', function (t) { + var from = path.resolve(fixtures, 'from.env') + var to = path.resolve(fixtures, 'env.shim') + cmdShim(from, to, function(er) { + if (er) + throw er + console.error('%j', fs.readFileSync(to, 'utf8')) + console.error('%j', fs.readFileSync(to + '.cmd', 'utf8')) + + t.equal(fs.readFileSync(to, 'utf8'), + "#!/bin/sh"+ + "\nbasedir=$(dirname \"$(echo \"$0\" | sed -e 's,\\\\,/,g')\")"+ + "\n"+ + "\ncase `uname` in"+ + "\n *CYGWIN*) basedir=`cygpath -w \"$basedir\"`;;"+ + "\nesac"+ + "\n"+ + "\nif [ -x \"$basedir/node\" ]; then"+ + "\n \"$basedir/node\" \"$basedir/from.env\" \"$@\""+ + "\n ret=$?"+ + "\nelse "+ + "\n node \"$basedir/from.env\" \"$@\""+ + "\n ret=$?"+ + "\nfi"+ + "\nexit $ret"+ + "\n") + t.equal(fs.readFileSync(to + '.cmd', 'utf8'), + "@IF EXIST \"%~dp0\\node.exe\" (\r"+ + "\n \"%~dp0\\node.exe\" \"%~dp0\\from.env\" %*\r"+ + "\n) ELSE (\r"+ + "\n @SETLOCAL\r"+ + "\n @SET PATHEXT=%PATHEXT:;.JS;=;%\r"+ + "\n node \"%~dp0\\from.env\" %*\r"+ + "\n)") + t.end() + }) +}) + +test('env shebang with args', function (t) { + var from = path.resolve(fixtures, 'from.env.args') + var to = path.resolve(fixtures, 'env.args.shim') + cmdShim(from, to, function(er) { + if (er) + throw er + console.error('%j', fs.readFileSync(to, 'utf8')) + console.error('%j', fs.readFileSync(to + '.cmd', 'utf8')) + + t.equal(fs.readFileSync(to, 'utf8'), + "#!/bin/sh"+ + "\nbasedir=$(dirname \"$(echo \"$0\" | sed -e 's,\\\\,/,g')\")"+ + "\n"+ + "\ncase `uname` in"+ + "\n *CYGWIN*) basedir=`cygpath -w \"$basedir\"`;;"+ + "\nesac"+ + "\n"+ + "\nif [ -x \"$basedir/node\" ]; then"+ + "\n \"$basedir/node\" --expose_gc \"$basedir/from.env.args\" \"$@\""+ + "\n ret=$?"+ + "\nelse "+ + "\n node --expose_gc \"$basedir/from.env.args\" \"$@\""+ + "\n ret=$?"+ + "\nfi"+ + "\nexit $ret"+ + "\n") + t.equal(fs.readFileSync(to + '.cmd', 'utf8'), + "@IF EXIST \"%~dp0\\node.exe\" (\r"+ + "\n \"%~dp0\\node.exe\" --expose_gc \"%~dp0\\from.env.args\" %*\r"+ + "\n) ELSE (\r"+ + "\n @SETLOCAL\r"+ + "\n @SET PATHEXT=%PATHEXT:;.JS;=;%\r"+ + "\n node --expose_gc \"%~dp0\\from.env.args\" %*\r"+ + "\n)") + t.end() + }) +}) + +test('explicit shebang', function (t) { + var from = path.resolve(fixtures, 'from.sh') + var to = path.resolve(fixtures, 'sh.shim') + cmdShim(from, to, function(er) { + if (er) + throw er + console.error('%j', fs.readFileSync(to, 'utf8')) + console.error('%j', fs.readFileSync(to + '.cmd', 'utf8')) + + t.equal(fs.readFileSync(to, 'utf8'), + "#!/bin/sh" + + "\nbasedir=$(dirname \"$(echo \"$0\" | sed -e 's,\\\\,/,g')\")" + + "\n" + + "\ncase `uname` in" + + "\n *CYGWIN*) basedir=`cygpath -w \"$basedir\"`;;" + + "\nesac" + + "\n" + + "\nif [ -x \"$basedir//usr/bin/sh\" ]; then" + + "\n \"$basedir//usr/bin/sh\" \"$basedir/from.sh\" \"$@\"" + + "\n ret=$?" + + "\nelse " + + "\n /usr/bin/sh \"$basedir/from.sh\" \"$@\"" + + "\n ret=$?" + + "\nfi" + + "\nexit $ret" + + "\n") + + t.equal(fs.readFileSync(to + '.cmd', 'utf8'), + "@IF EXIST \"%~dp0\\/usr/bin/sh.exe\" (\r" + + "\n \"%~dp0\\/usr/bin/sh.exe\" \"%~dp0\\from.sh\" %*\r" + + "\n) ELSE (\r" + + "\n @SETLOCAL\r"+ + "\n @SET PATHEXT=%PATHEXT:;.JS;=;%\r"+ + "\n /usr/bin/sh \"%~dp0\\from.sh\" %*\r" + + "\n)") + t.end() + }) +}) + +test('explicit shebang with args', function (t) { + var from = path.resolve(fixtures, 'from.sh.args') + var to = path.resolve(fixtures, 'sh.args.shim') + cmdShim(from, to, function(er) { + if (er) + throw er + console.error('%j', fs.readFileSync(to, 'utf8')) + console.error('%j', fs.readFileSync(to + '.cmd', 'utf8')) + + t.equal(fs.readFileSync(to, 'utf8'), + "#!/bin/sh" + + "\nbasedir=$(dirname \"$(echo \"$0\" | sed -e 's,\\\\,/,g')\")" + + "\n" + + "\ncase `uname` in" + + "\n *CYGWIN*) basedir=`cygpath -w \"$basedir\"`;;" + + "\nesac" + + "\n" + + "\nif [ -x \"$basedir//usr/bin/sh\" ]; then" + + "\n \"$basedir//usr/bin/sh\" -x \"$basedir/from.sh.args\" \"$@\"" + + "\n ret=$?" + + "\nelse " + + "\n /usr/bin/sh -x \"$basedir/from.sh.args\" \"$@\"" + + "\n ret=$?" + + "\nfi" + + "\nexit $ret" + + "\n") + + t.equal(fs.readFileSync(to + '.cmd', 'utf8'), + "@IF EXIST \"%~dp0\\/usr/bin/sh.exe\" (\r" + + "\n \"%~dp0\\/usr/bin/sh.exe\" -x \"%~dp0\\from.sh.args\" %*\r" + + "\n) ELSE (\r" + + "\n @SETLOCAL\r"+ + "\n @SET PATHEXT=%PATHEXT:;.JS;=;%\r"+ + "\n /usr/bin/sh -x \"%~dp0\\from.sh.args\" %*\r" + + "\n)") + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/cmd-shim/test/zz-cleanup.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/cmd-shim/test/zz-cleanup.js new file mode 100644 index 00000000..94250310 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/cmd-shim/test/zz-cleanup.js @@ -0,0 +1,13 @@ +var test = require('tap').test +var path = require('path') +var fixtures = path.resolve(__dirname, 'fixtures') +var rimraf = require('rimraf') + +test('cleanup', function(t) { + rimraf(fixtures, function(er) { + if (er) + throw er + t.pass('cleaned up') + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/LICENSE new file mode 100644 index 00000000..ed47678e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2013 Tim Oxley + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/Makefile b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/Makefile new file mode 100644 index 00000000..3a67c57a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/Makefile @@ -0,0 +1,9 @@ + +all: columnify.js + +prepublish: all + +columnify.js: index.js package.json + babel index.js > columnify.js + +.PHONY: all prepublish diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/Readme.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/Readme.md new file mode 100644 index 00000000..4a37928a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/Readme.md @@ -0,0 +1,470 @@ +# columnify + +[![NPM](https://nodei.co/npm/columnify.png?downloads=true&downloadRank=true&stars=true&chrome)](https://nodei.co/npm-dl/columnify/) +[![NPM](https://nodei.co/npm-dl/columnify.png?months=3&height=3&chrome)](https://nodei.co/npm/columnify/) + +[![Build Status](https://img.shields.io/travis/timoxley/columnify.svg?style=flat)](https://travis-ci.org/timoxley/columnify) +[![NPM Version](https://img.shields.io/npm/v/columnify.svg?style=flat)](https://npmjs.org/package/columnify) +[![License](http://img.shields.io/npm/l/columnify.svg?style=flat)](LICENSE) +[![Dependency Status](https://david-dm.org/timoxley/columnify.svg)](https://david-dm.org/timoxley/columnify) +[![devDependency Status](https://david-dm.org/timoxley/columnify/dev-status.svg)](https://david-dm.org/timoxley/columnify#info=devDependencies) + +Create text-based columns suitable for console output from objects or +arrays of objects. + +Columns are automatically resized to fit the content of the largest +cell. Each cell will be padded with spaces to fill the available space +and ensure column contents are left-aligned. + +Designed to [handle sensible wrapping in npm search results](https://github.com/isaacs/npm/pull/2328). + +`npm search` before & after integrating columnify: + +![npm-tidy-search](https://f.cloud.github.com/assets/43438/1848959/ae02ad04-76a1-11e3-8255-4781debffc26.gif) + +## Installation & Update + +``` +$ npm install --save columnify@latest +``` + +## Usage + +```javascript +var columnify = require('columnify') +var columns = columnify(data, options) +console.log(columns) +``` + +## Examples + +### Columnify Objects + +Objects are converted to a list of key/value pairs: + +```javascript +var data = { + "commander@0.6.1": 1, + "minimatch@0.2.14": 3, + "mkdirp@0.3.5": 2, + "sigmund@1.0.0": 3 +} + +console.log(columnify(data)) +``` +#### Output: +``` +KEY VALUE +commander@0.6.1 1 +minimatch@0.2.14 3 +mkdirp@0.3.5 2 +sigmund@1.0.0 3 +``` + +### Custom Column Names + +```javascript +var data = { + "commander@0.6.1": 1, + "minimatch@0.2.14": 3, + "mkdirp@0.3.5": 2, + "sigmund@1.0.0": 3 +} + +console.log(columnify(data, {columns: ['MODULE', 'COUNT']})) +``` +#### Output: +``` +MODULE COUNT +commander@0.6.1 1 +minimatch@0.2.14 3 +mkdirp@0.3.5 2 +sigmund@1.0.0 3 +``` + +### Columnify Arrays of Objects + +Column headings are extracted from the keys in supplied objects. + +```javascript +var columnify = require('columnify') + +var columns = columnify([{ + name: 'mod1', + version: '0.0.1' +}, { + name: 'module2', + version: '0.2.0' +}]) + +console.log(columns) +``` +#### Output: +``` +NAME VERSION +mod1 0.0.1 +module2 0.2.0 +``` + +### Filtering & Ordering Columns + +By default, all properties are converted into columns, whether or not +they exist on every object or not. + +To explicitly specify which columns to include, and in which order, +supply a "columns" or "include" array ("include" is just an alias). + +```javascript +var data = [{ + name: 'module1', + description: 'some description', + version: '0.0.1', +}, { + name: 'module2', + description: 'another description', + version: '0.2.0', +}] + +var columns = columnify(data, { + columns: ['name', 'version'] +}) + +console.log(columns) +``` + +#### Output: +``` +NAME VERSION +module1 0.0.1 +module2 0.2.0 +``` + +## Global and Per Column Options +You can set a number of options at a global level (ie. for all columns) or on a per column basis. + +Set options on a per column basis by using the `config` option to specify individual columns: + +```javascript +var columns = columnify(data, { + optionName: optionValue, + config: { + columnName: {optionName: optionValue}, + columnName: {optionName: optionValue}, + } +}) +``` + +### Maximum and Minimum Column Widths +As with all options, you can define the `maxWidth` and `minWidth` globally, or for specified columns. By default, wrapping will happen at word boundaries. Empty cells or those which do not fill the `minWidth` will be padded with spaces. + +```javascript +var columns = columnify([{ + name: 'mod1', + description: 'some description which happens to be far larger than the max', + version: '0.0.1', +}, { + name: 'module-two', + description: 'another description larger than the max', + version: '0.2.0', +}], { + minWidth: 20, + config: { + description: {maxWidth: 30} + } +}) + +console.log(columns) +``` + +#### Output: +``` +NAME DESCRIPTION VERSION +mod1 some description which happens 0.0.1 + to be far larger than the max +module-two another description larger 0.2.0 + than the max +``` + +#### Maximum Line Width + +You can set a hard maximum line width using the `maxLineWidth` option. +Beyond this value data is unceremoniously truncated with no truncation +marker. + +This can either be a number or 'auto' to set the value to the width of +stdout. + +Setting this value to 'auto' prevent TTY-imposed line-wrapping when +lines exceed the screen width. + +#### Truncating Column Cells Instead of Wrapping + +You can disable wrapping and instead truncate content at the maximum +column width by using the `truncate` option. Truncation respects word boundaries. A truncation marker, `…`, will appear next to the last word in any truncated line. + +```javascript +var columns = columnify(data, { + truncate: true, + config: { + description: { + maxWidth: 20 + } + } +}) + +console.log(columns) +``` +#### Output: +``` +NAME DESCRIPTION VERSION +mod1 some description… 0.0.1 +module-two another description… 0.2.0 +``` + + +### Align Right/Center +You can set the alignment of the column data by using the `align` option. + +```js +var data = { + "mocha@1.18.2": 1, + "commander@2.0.0": 1, + "debug@0.8.1": 1 +} + +columnify(data, {config: {value: {align: 'right'}}}) +``` + +#### Output: +``` +KEY VALUE +mocha@1.18.2 1 +commander@2.0.0 1 +debug@0.8.1 1 +``` + +`align: 'center'` works in a similar way. + + +### Padding Character + +Set a character to fill whitespace within columns with the `paddingChr` option. + +```js +var data = { + "shortKey": "veryVeryVeryVeryVeryLongVal", + "veryVeryVeryVeryVeryLongKey": "shortVal" +} + +columnify(data, { paddingChr: '.'}) +``` + +#### Output: +``` +KEY........................ VALUE...................... +shortKey................... veryVeryVeryVeryVeryLongVal +veryVeryVeryVeryVeryLongKey shortVal................... +``` + +### Preserve Existing Newlines + +By default, `columnify` sanitises text by replacing any occurance of 1 or more whitespace characters with a single space. + +`columnify` can be configured to respect existing new line characters using the `preserveNewLines` option. Note this will still collapse all other whitespace. + +```javascript +var data = [{ + name: "glob@3.2.9", + paths: [ + "node_modules/tap/node_modules/glob", + "node_modules/tape/node_modules/glob" + ].join('\n') +}, { + name: "nopt@2.2.1", + paths: [ + "node_modules/tap/node_modules/nopt" + ] +}, { + name: "runforcover@0.0.2", + paths: "node_modules/tap/node_modules/runforcover" +}] + +console.log(columnify(data, {preserveNewLines: true})) +``` +#### Output: +``` +NAME PATHS +glob@3.2.9 node_modules/tap/node_modules/glob + node_modules/tape/node_modules/glob +nopt@2.2.1 node_modules/tap/node_modules/nopt +runforcover@0.0.2 node_modules/tap/node_modules/runforcover +``` + +Compare this with output without `preserveNewLines`: + +```javascript +console.log(columnify(data, {preserveNewLines: false})) +// or just +console.log(columnify(data)) +``` + +``` +NAME PATHS +glob@3.2.9 node_modules/tap/node_modules/glob node_modules/tape/node_modules/glob +nopt@2.2.1 node_modules/tap/node_modules/nopt +runforcover@0.0.2 node_modules/tap/node_modules/runforcover +``` + +### Custom Truncation Marker + +You can change the truncation marker to something other than the default +`…` by using the `truncateMarker` option. + +```javascript +var columns = columnify(data, { + truncate: true, + truncateMarker: '>', + widths: { + description: { + maxWidth: 20 + } + } +}) + +console.log(columns) +``` +#### Output: +``` +NAME DESCRIPTION VERSION +mod1 some description> 0.0.1 +module-two another description> 0.2.0 +``` + +### Custom Column Splitter + +If your columns need some bling, you can split columns with custom +characters by using the `columnSplitter` option. + +```javascript +var columns = columnify(data, { + columnSplitter: ' | ' +}) + +console.log(columns) +``` +#### Output: +``` +NAME | DESCRIPTION | VERSION +mod1 | some description which happens to be far larger than the max | 0.0.1 +module-two | another description larger than the max | 0.2.0 +``` + +### Control Header Display + +Control whether column headers are displayed by using the `showHeaders` option. + +```javascript +var columns = columnify(data, { + showHeaders: false +}) +``` + +This also works well for hiding a single column header, like an `id` column: +```javascript +var columns = columnify(data, { + config: { + id: { showHeaders: false } + } +}) +``` + +### Transforming Column Data and Headers +If you need to modify the presentation of column content or heading content there are two useful options for doing that: `dataTransform` and `headerTransform`. Both of these take a function and need to return a valid string. + +```javascript +var columns = columnify([{ + name: 'mod1', + description: 'SOME DESCRIPTION TEXT.' +}, { + name: 'module-two', + description: 'SOME SLIGHTLY LONGER DESCRIPTION TEXT.' +}], { + dataTransform: function(data) { + return data.toLowerCase() + }, + config: { + name: { + headingTransform: function(heading) { + heading = "module " + heading + return "*" + heading.toUpperCase() + "*" + } + } + } +}) +``` +#### Output: +``` +*MODULE NAME* DESCRIPTION +mod1 some description text. +module-two some slightly longer description text. +``` + + +## Multibyte Character Support + +`columnify` uses [mycoboco/wcwidth.js](https://github.com/mycoboco/wcwidth.js) to calculate length of multibyte characters: + +```javascript +var data = [{ + name: 'module-one', + description: 'some description', + version: '0.0.1', +}, { + name: '这是一个很长的名字的模块', + description: '这真的是一个描述的内容这个描述很长', + version: "0.3.3" +}] + +console.log(columnify(data)) +``` + +#### Without multibyte handling: + +i.e. before columnify added this feature + +``` +NAME DESCRIPTION VERSION +module-one some description 0.0.1 +这是一个很长的名字的模块 这真的是一个描述的内容这个描述很长 0.3.3 +``` + +#### With multibyte handling: + +``` +NAME DESCRIPTION VERSION +module-one some description 0.0.1 +这是一个很长的名字的模块 这真的是一个描述的内容这个描述很长 0.3.3 +``` + +## Contributions + +``` + project : columnify + repo age : 1 year, 2 months + active : 32 days + commits : 120 + files : 54 + authors : + 90 Tim Oxley 75.0% + 8 Tim 6.7% + 7 Arjun Mehta 5.8% + 6 Dany 5.0% + 5 Wei Gao 4.2% + 2 Dany Shaanan 1.7% + 1 Seth Miller 0.8% + 1 Isaac Z. Schlueter 0.8% +``` + +## License + +MIT diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/columnify.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/columnify.js new file mode 100644 index 00000000..334d5509 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/columnify.js @@ -0,0 +1,308 @@ +"use strict"; + +var wcwidth = require('./width'); + +var _require = require('./utils'); + +var padRight = _require.padRight; +var padCenter = _require.padCenter; +var padLeft = _require.padLeft; +var splitIntoLines = _require.splitIntoLines; +var splitLongWords = _require.splitLongWords; +var truncateString = _require.truncateString; + +var DEFAULT_HEADING_TRANSFORM = function DEFAULT_HEADING_TRANSFORM(key) { + return key.toUpperCase(); +}; + +var DEFAULT_DATA_TRANSFORM = function DEFAULT_DATA_TRANSFORM(cell, column, index) { + return cell; +}; + +var DEFAULTS = Object.freeze({ + maxWidth: Infinity, + minWidth: 0, + columnSplitter: ' ', + truncate: false, + truncateMarker: '…', + preserveNewLines: false, + paddingChr: ' ', + showHeaders: true, + headingTransform: DEFAULT_HEADING_TRANSFORM, + dataTransform: DEFAULT_DATA_TRANSFORM +}); + +module.exports = function (items) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + var columnConfigs = options.config || {}; + delete options.config; // remove config so doesn't appear on every column. + + var maxLineWidth = options.maxLineWidth || Infinity; + if (maxLineWidth === 'auto') maxLineWidth = process.stdout.columns || Infinity; + delete options.maxLineWidth; // this is a line control option, don't pass it to column + + // Option defaults inheritance: + // options.config[columnName] => options => DEFAULTS + options = mixin({}, DEFAULTS, options); + + options.config = options.config || Object.create(null); + + options.spacing = options.spacing || '\n'; // probably useless + options.preserveNewLines = !!options.preserveNewLines; + options.showHeaders = !!options.showHeaders; + options.columns = options.columns || options.include; // alias include/columns, prefer columns if supplied + var columnNames = options.columns || []; // optional user-supplied columns to include + + items = toArray(items, columnNames); + + // if not suppled column names, automatically determine columns from data keys + if (!columnNames.length) { + items.forEach(function (item) { + for (var columnName in item) { + if (columnNames.indexOf(columnName) === -1) columnNames.push(columnName); + } + }); + } + + // initialize column defaults (each column inherits from options.config) + var columns = columnNames.reduce(function (columns, columnName) { + var column = Object.create(options); + columns[columnName] = mixin(column, columnConfigs[columnName]); + return columns; + }, Object.create(null)); + + // sanitize column settings + columnNames.forEach(function (columnName) { + var column = columns[columnName]; + column.name = columnName; + column.maxWidth = Math.ceil(column.maxWidth); + column.minWidth = Math.ceil(column.minWidth); + column.truncate = !!column.truncate; + column.align = column.align || 'left'; + }); + + // sanitize data + items = items.map(function (item) { + var result = Object.create(null); + columnNames.forEach(function (columnName) { + // null/undefined -> '' + result[columnName] = item[columnName] != null ? item[columnName] : ''; + // toString everything + result[columnName] = '' + result[columnName]; + if (columns[columnName].preserveNewLines) { + // merge non-newline whitespace chars + result[columnName] = result[columnName].replace(/[^\S\n]/gmi, ' '); + } else { + // merge all whitespace chars + result[columnName] = result[columnName].replace(/\s/gmi, ' '); + } + }); + return result; + }); + + // transform data cells + columnNames.forEach(function (columnName) { + var column = columns[columnName]; + items = items.map(function (item, index) { + var col = Object.create(column); + item[columnName] = column.dataTransform(item[columnName], col, index); + + var changedKeys = Object.keys(col); + // disable default heading transform if we wrote to column.name + if (changedKeys.indexOf('name') !== -1) { + if (column.headingTransform !== DEFAULT_HEADING_TRANSFORM) return; + column.headingTransform = function (heading) { + return heading; + }; + } + changedKeys.forEach(function (key) { + return column[key] = col[key]; + }); + return item; + }); + }); + + // add headers + var headers = {}; + if (options.showHeaders) { + columnNames.forEach(function (columnName) { + var column = columns[columnName]; + + if (!column.showHeaders) { + headers[columnName] = ''; + return; + } + + headers[columnName] = column.headingTransform(column.name); + }); + items.unshift(headers); + } + // get actual max-width between min & max + // based on length of data in columns + columnNames.forEach(function (columnName) { + var column = columns[columnName]; + column.width = items.map(function (item) { + return item[columnName]; + }).reduce(function (min, cur) { + // if already at maxWidth don't bother testing + if (min >= column.maxWidth) return min; + return Math.max(min, Math.min(column.maxWidth, Math.max(column.minWidth, wcwidth(cur)))); + }, 0); + }); + + // split long words so they can break onto multiple lines + columnNames.forEach(function (columnName) { + var column = columns[columnName]; + items = items.map(function (item) { + item[columnName] = splitLongWords(item[columnName], column.width, column.truncateMarker); + return item; + }); + }); + + // wrap long lines. each item is now an array of lines. + columnNames.forEach(function (columnName) { + var column = columns[columnName]; + items = items.map(function (item, index) { + var cell = item[columnName]; + item[columnName] = splitIntoLines(cell, column.width); + + // if truncating required, only include first line + add truncation char + if (column.truncate && item[columnName].length > 1) { + item[columnName] = splitIntoLines(cell, column.width - wcwidth(column.truncateMarker)); + var firstLine = item[columnName][0]; + if (!endsWith(firstLine, column.truncateMarker)) item[columnName][0] += column.truncateMarker; + item[columnName] = item[columnName].slice(0, 1); + } + return item; + }); + }); + + // recalculate column widths from truncated output/lines + columnNames.forEach(function (columnName) { + var column = columns[columnName]; + column.width = items.map(function (item) { + return item[columnName].reduce(function (min, cur) { + if (min >= column.maxWidth) return min; + return Math.max(min, Math.min(column.maxWidth, Math.max(column.minWidth, wcwidth(cur)))); + }, 0); + }).reduce(function (min, cur) { + if (min >= column.maxWidth) return min; + return Math.max(min, Math.min(column.maxWidth, Math.max(column.minWidth, cur))); + }, 0); + }); + + var rows = createRows(items, columns, columnNames, options.paddingChr); // merge lines into rows + // conceive output + return rows.reduce(function (output, row) { + return output.concat(row.reduce(function (rowOut, line) { + return rowOut.concat(line.join(options.columnSplitter)); + }, [])); + }, []).map(function (line) { + return truncateString(line, maxLineWidth); + }).join(options.spacing); +}; + +/** + * Convert wrapped lines into rows with padded values. + * + * @param Array items data to process + * @param Array columns column width settings for wrapping + * @param Array columnNames column ordering + * @return Array items wrapped in arrays, corresponding to lines + */ + +function createRows(items, columns, columnNames, paddingChr) { + return items.map(function (item) { + var row = []; + var numLines = 0; + columnNames.forEach(function (columnName) { + numLines = Math.max(numLines, item[columnName].length); + }); + // combine matching lines of each rows + + var _loop = function _loop(i) { + row[i] = row[i] || []; + columnNames.forEach(function (columnName) { + var column = columns[columnName]; + var val = item[columnName][i] || ''; // || '' ensures empty columns get padded + if (column.align === 'right') row[i].push(padLeft(val, column.width, paddingChr));else if (column.align === 'center' || column.align === 'centre') row[i].push(padCenter(val, column.width, paddingChr));else row[i].push(padRight(val, column.width, paddingChr)); + }); + }; + + for (var i = 0; i < numLines; i++) { + _loop(i); + } + return row; + }); +} + +/** + * Object.assign + * + * @return Object Object with properties mixed in. + */ + +function mixin() { + var _Object; + + if (Object.assign) return (_Object = Object).assign.apply(_Object, arguments); + return ObjectAssign.apply(undefined, arguments); +} + +function ObjectAssign(target, firstSource) { + "use strict"; + + if (target === undefined || target === null) throw new TypeError("Cannot convert first argument to object"); + + var to = Object(target); + + var hasPendingException = false; + var pendingException; + + for (var i = 1; i < arguments.length; i++) { + var nextSource = arguments[i]; + if (nextSource === undefined || nextSource === null) continue; + + var keysArray = Object.keys(Object(nextSource)); + for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex++) { + var nextKey = keysArray[nextIndex]; + try { + var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey); + if (desc !== undefined && desc.enumerable) to[nextKey] = nextSource[nextKey]; + } catch (e) { + if (!hasPendingException) { + hasPendingException = true; + pendingException = e; + } + } + } + + if (hasPendingException) throw pendingException; + } + return to; +} + +/** + * Adapted from String.prototype.endsWith polyfill. + */ + +function endsWith(target, searchString, position) { + position = position || target.length; + position = position - searchString.length; + var lastIndex = target.lastIndexOf(searchString); + return lastIndex !== -1 && lastIndex === position; +} + +function toArray(items, columnNames) { + if (Array.isArray(items)) return items; + var rows = []; + for (var key in items) { + var item = {}; + item[columnNames[0] || 'key'] = key; + item[columnNames[1] || 'value'] = items[key]; + rows.push(item); + } + return rows; +} + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/index.js new file mode 100644 index 00000000..221269b3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/index.js @@ -0,0 +1,297 @@ +"use strict" + +const wcwidth = require('./width') +const { + padRight, + padCenter, + padLeft, + splitIntoLines, + splitLongWords, + truncateString +} = require('./utils') + +const DEFAULT_HEADING_TRANSFORM = key => key.toUpperCase() + +const DEFAULT_DATA_TRANSFORM = (cell, column, index) => cell + +const DEFAULTS = Object.freeze({ + maxWidth: Infinity, + minWidth: 0, + columnSplitter: ' ', + truncate: false, + truncateMarker: '…', + preserveNewLines: false, + paddingChr: ' ', + showHeaders: true, + headingTransform: DEFAULT_HEADING_TRANSFORM, + dataTransform: DEFAULT_DATA_TRANSFORM +}) + +module.exports = function(items, options = {}) { + + let columnConfigs = options.config || {} + delete options.config // remove config so doesn't appear on every column. + + let maxLineWidth = options.maxLineWidth || Infinity + if (maxLineWidth === 'auto') maxLineWidth = process.stdout.columns || Infinity + delete options.maxLineWidth // this is a line control option, don't pass it to column + + // Option defaults inheritance: + // options.config[columnName] => options => DEFAULTS + options = mixin({}, DEFAULTS, options) + + options.config = options.config || Object.create(null) + + options.spacing = options.spacing || '\n' // probably useless + options.preserveNewLines = !!options.preserveNewLines + options.showHeaders = !!options.showHeaders; + options.columns = options.columns || options.include // alias include/columns, prefer columns if supplied + let columnNames = options.columns || [] // optional user-supplied columns to include + + items = toArray(items, columnNames) + + // if not suppled column names, automatically determine columns from data keys + if (!columnNames.length) { + items.forEach(function(item) { + for (let columnName in item) { + if (columnNames.indexOf(columnName) === -1) columnNames.push(columnName) + } + }) + } + + // initialize column defaults (each column inherits from options.config) + let columns = columnNames.reduce((columns, columnName) => { + let column = Object.create(options) + columns[columnName] = mixin(column, columnConfigs[columnName]) + return columns + }, Object.create(null)) + + // sanitize column settings + columnNames.forEach(columnName => { + let column = columns[columnName] + column.name = columnName + column.maxWidth = Math.ceil(column.maxWidth) + column.minWidth = Math.ceil(column.minWidth) + column.truncate = !!column.truncate + column.align = column.align || 'left' + }) + + // sanitize data + items = items.map(item => { + let result = Object.create(null) + columnNames.forEach(columnName => { + // null/undefined -> '' + result[columnName] = item[columnName] != null ? item[columnName] : '' + // toString everything + result[columnName] = '' + result[columnName] + if (columns[columnName].preserveNewLines) { + // merge non-newline whitespace chars + result[columnName] = result[columnName].replace(/[^\S\n]/gmi, ' ') + } else { + // merge all whitespace chars + result[columnName] = result[columnName].replace(/\s/gmi, ' ') + } + }) + return result + }) + + // transform data cells + columnNames.forEach(columnName => { + let column = columns[columnName] + items = items.map((item, index) => { + let col = Object.create(column) + item[columnName] = column.dataTransform(item[columnName], col, index) + + let changedKeys = Object.keys(col) + // disable default heading transform if we wrote to column.name + if (changedKeys.indexOf('name') !== -1) { + if (column.headingTransform !== DEFAULT_HEADING_TRANSFORM) return + column.headingTransform = heading => heading + } + changedKeys.forEach(key => column[key] = col[key]) + return item + }) + }) + + // add headers + let headers = {} + if(options.showHeaders) { + columnNames.forEach(columnName => { + let column = columns[columnName] + + if(!column.showHeaders){ + headers[columnName] = ''; + return; + } + + headers[columnName] = column.headingTransform(column.name) + }) + items.unshift(headers) + } + // get actual max-width between min & max + // based on length of data in columns + columnNames.forEach(columnName => { + let column = columns[columnName] + column.width = items + .map(item => item[columnName]) + .reduce((min, cur) => { + // if already at maxWidth don't bother testing + if (min >= column.maxWidth) return min + return Math.max(min, Math.min(column.maxWidth, Math.max(column.minWidth, wcwidth(cur)))) + }, 0) + }) + + // split long words so they can break onto multiple lines + columnNames.forEach(columnName => { + let column = columns[columnName] + items = items.map(item => { + item[columnName] = splitLongWords(item[columnName], column.width, column.truncateMarker) + return item + }) + }) + + // wrap long lines. each item is now an array of lines. + columnNames.forEach(columnName => { + let column = columns[columnName] + items = items.map((item, index) => { + let cell = item[columnName] + item[columnName] = splitIntoLines(cell, column.width) + + // if truncating required, only include first line + add truncation char + if (column.truncate && item[columnName].length > 1) { + item[columnName] = splitIntoLines(cell, column.width - wcwidth(column.truncateMarker)) + let firstLine = item[columnName][0] + if (!endsWith(firstLine, column.truncateMarker)) item[columnName][0] += column.truncateMarker + item[columnName] = item[columnName].slice(0, 1) + } + return item + }) + }) + + // recalculate column widths from truncated output/lines + columnNames.forEach(columnName => { + let column = columns[columnName] + column.width = items.map(item => { + return item[columnName].reduce((min, cur) => { + if (min >= column.maxWidth) return min + return Math.max(min, Math.min(column.maxWidth, Math.max(column.minWidth, wcwidth(cur)))) + }, 0) + }).reduce((min, cur) => { + if (min >= column.maxWidth) return min + return Math.max(min, Math.min(column.maxWidth, Math.max(column.minWidth, cur))) + }, 0) + }) + + + let rows = createRows(items, columns, columnNames, options.paddingChr) // merge lines into rows + // conceive output + return rows.reduce((output, row) => { + return output.concat(row.reduce((rowOut, line) => { + return rowOut.concat(line.join(options.columnSplitter)) + }, [])) + }, []) + .map(line => truncateString(line, maxLineWidth)) + .join(options.spacing) +} + +/** + * Convert wrapped lines into rows with padded values. + * + * @param Array items data to process + * @param Array columns column width settings for wrapping + * @param Array columnNames column ordering + * @return Array items wrapped in arrays, corresponding to lines + */ + +function createRows(items, columns, columnNames, paddingChr) { + return items.map(item => { + let row = [] + let numLines = 0 + columnNames.forEach(columnName => { + numLines = Math.max(numLines, item[columnName].length) + }) + // combine matching lines of each rows + for (let i = 0; i < numLines; i++) { + row[i] = row[i] || [] + columnNames.forEach(columnName => { + let column = columns[columnName] + let val = item[columnName][i] || '' // || '' ensures empty columns get padded + if (column.align === 'right') row[i].push(padLeft(val, column.width, paddingChr)) + else if (column.align === 'center' || column.align === 'centre') row[i].push(padCenter(val, column.width, paddingChr)) + else row[i].push(padRight(val, column.width, paddingChr)) + }) + } + return row + }) +} + +/** + * Object.assign + * + * @return Object Object with properties mixed in. + */ + +function mixin(...args) { + if (Object.assign) return Object.assign(...args) + return ObjectAssign(...args) +} + +function ObjectAssign(target, firstSource) { + "use strict"; + if (target === undefined || target === null) + throw new TypeError("Cannot convert first argument to object"); + + var to = Object(target); + + var hasPendingException = false; + var pendingException; + + for (var i = 1; i < arguments.length; i++) { + var nextSource = arguments[i]; + if (nextSource === undefined || nextSource === null) + continue; + + var keysArray = Object.keys(Object(nextSource)); + for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex++) { + var nextKey = keysArray[nextIndex]; + try { + var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey); + if (desc !== undefined && desc.enumerable) + to[nextKey] = nextSource[nextKey]; + } catch (e) { + if (!hasPendingException) { + hasPendingException = true; + pendingException = e; + } + } + } + + if (hasPendingException) + throw pendingException; + } + return to; +} + +/** + * Adapted from String.prototype.endsWith polyfill. + */ + +function endsWith(target, searchString, position) { + position = position || target.length; + position = position - searchString.length; + let lastIndex = target.lastIndexOf(searchString); + return lastIndex !== -1 && lastIndex === position; +} + + +function toArray(items, columnNames) { + if (Array.isArray(items)) return items + let rows = [] + for (let key in items) { + let item = {} + item[columnNames[0] || 'key'] = key + item[columnNames[1] || 'value'] = items[key] + rows.push(item) + } + return rows +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/.npmignore new file mode 100644 index 00000000..3c3629e6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/LICENSE new file mode 100644 index 00000000..313ef1e8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/LICENSE @@ -0,0 +1,30 @@ +wcwidth.js: JavaScript Portng of Markus Kuhn's wcwidth() Implementation +======================================================================= + +Copyright (C) 2012 by Jun Woong. + +This package is a JavaScript porting of `wcwidth()` implementation +[by Markus Kuhn](http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c). + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/Readme.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/Readme.md new file mode 100644 index 00000000..0649a319 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/Readme.md @@ -0,0 +1,33 @@ +# wcwidth + +Determine columns needed for a fixed-size wide-character string + +---- + +wcwidth is a simple JavaScript port of [wcwidth](http://man7.org/linux/man-pages/man3/wcswidth.3.html) implemented in C by Markus Kuhn. + +JavaScript port [originally](https://github.com/mycoboco/wcwidth.js) written by Woong Jun (http://code.woong.org/) + +## Example + +```js +'한'.length // => 1 +wcwidth('한'); // => 2 + +'한글'.length // => 2 +wcwidth('한글'); // => 4 +``` + +`wcwidth()` and its string version, `wcswidth()` are defined by IEEE Std +1002.1-2001, a.k.a. POSIX.1-2001, and return the number of columns used +to represent the given wide character and string. + +Markus's implementation assumes the wide character given to those +functions to be encoded in ISO 10646, which is almost true for +JavaScript's characters. + +[Further explaination here](docs) + +## License + +MIT diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/combining.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/combining.js new file mode 100644 index 00000000..dac9789d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/combining.js @@ -0,0 +1,50 @@ +module.exports = [ + [ 0x0300, 0x036F ], [ 0x0483, 0x0486 ], [ 0x0488, 0x0489 ], + [ 0x0591, 0x05BD ], [ 0x05BF, 0x05BF ], [ 0x05C1, 0x05C2 ], + [ 0x05C4, 0x05C5 ], [ 0x05C7, 0x05C7 ], [ 0x0600, 0x0603 ], + [ 0x0610, 0x0615 ], [ 0x064B, 0x065E ], [ 0x0670, 0x0670 ], + [ 0x06D6, 0x06E4 ], [ 0x06E7, 0x06E8 ], [ 0x06EA, 0x06ED ], + [ 0x070F, 0x070F ], [ 0x0711, 0x0711 ], [ 0x0730, 0x074A ], + [ 0x07A6, 0x07B0 ], [ 0x07EB, 0x07F3 ], [ 0x0901, 0x0902 ], + [ 0x093C, 0x093C ], [ 0x0941, 0x0948 ], [ 0x094D, 0x094D ], + [ 0x0951, 0x0954 ], [ 0x0962, 0x0963 ], [ 0x0981, 0x0981 ], + [ 0x09BC, 0x09BC ], [ 0x09C1, 0x09C4 ], [ 0x09CD, 0x09CD ], + [ 0x09E2, 0x09E3 ], [ 0x0A01, 0x0A02 ], [ 0x0A3C, 0x0A3C ], + [ 0x0A41, 0x0A42 ], [ 0x0A47, 0x0A48 ], [ 0x0A4B, 0x0A4D ], + [ 0x0A70, 0x0A71 ], [ 0x0A81, 0x0A82 ], [ 0x0ABC, 0x0ABC ], + [ 0x0AC1, 0x0AC5 ], [ 0x0AC7, 0x0AC8 ], [ 0x0ACD, 0x0ACD ], + [ 0x0AE2, 0x0AE3 ], [ 0x0B01, 0x0B01 ], [ 0x0B3C, 0x0B3C ], + [ 0x0B3F, 0x0B3F ], [ 0x0B41, 0x0B43 ], [ 0x0B4D, 0x0B4D ], + [ 0x0B56, 0x0B56 ], [ 0x0B82, 0x0B82 ], [ 0x0BC0, 0x0BC0 ], + [ 0x0BCD, 0x0BCD ], [ 0x0C3E, 0x0C40 ], [ 0x0C46, 0x0C48 ], + [ 0x0C4A, 0x0C4D ], [ 0x0C55, 0x0C56 ], [ 0x0CBC, 0x0CBC ], + [ 0x0CBF, 0x0CBF ], [ 0x0CC6, 0x0CC6 ], [ 0x0CCC, 0x0CCD ], + [ 0x0CE2, 0x0CE3 ], [ 0x0D41, 0x0D43 ], [ 0x0D4D, 0x0D4D ], + [ 0x0DCA, 0x0DCA ], [ 0x0DD2, 0x0DD4 ], [ 0x0DD6, 0x0DD6 ], + [ 0x0E31, 0x0E31 ], [ 0x0E34, 0x0E3A ], [ 0x0E47, 0x0E4E ], + [ 0x0EB1, 0x0EB1 ], [ 0x0EB4, 0x0EB9 ], [ 0x0EBB, 0x0EBC ], + [ 0x0EC8, 0x0ECD ], [ 0x0F18, 0x0F19 ], [ 0x0F35, 0x0F35 ], + [ 0x0F37, 0x0F37 ], [ 0x0F39, 0x0F39 ], [ 0x0F71, 0x0F7E ], + [ 0x0F80, 0x0F84 ], [ 0x0F86, 0x0F87 ], [ 0x0F90, 0x0F97 ], + [ 0x0F99, 0x0FBC ], [ 0x0FC6, 0x0FC6 ], [ 0x102D, 0x1030 ], + [ 0x1032, 0x1032 ], [ 0x1036, 0x1037 ], [ 0x1039, 0x1039 ], + [ 0x1058, 0x1059 ], [ 0x1160, 0x11FF ], [ 0x135F, 0x135F ], + [ 0x1712, 0x1714 ], [ 0x1732, 0x1734 ], [ 0x1752, 0x1753 ], + [ 0x1772, 0x1773 ], [ 0x17B4, 0x17B5 ], [ 0x17B7, 0x17BD ], + [ 0x17C6, 0x17C6 ], [ 0x17C9, 0x17D3 ], [ 0x17DD, 0x17DD ], + [ 0x180B, 0x180D ], [ 0x18A9, 0x18A9 ], [ 0x1920, 0x1922 ], + [ 0x1927, 0x1928 ], [ 0x1932, 0x1932 ], [ 0x1939, 0x193B ], + [ 0x1A17, 0x1A18 ], [ 0x1B00, 0x1B03 ], [ 0x1B34, 0x1B34 ], + [ 0x1B36, 0x1B3A ], [ 0x1B3C, 0x1B3C ], [ 0x1B42, 0x1B42 ], + [ 0x1B6B, 0x1B73 ], [ 0x1DC0, 0x1DCA ], [ 0x1DFE, 0x1DFF ], + [ 0x200B, 0x200F ], [ 0x202A, 0x202E ], [ 0x2060, 0x2063 ], + [ 0x206A, 0x206F ], [ 0x20D0, 0x20EF ], [ 0x302A, 0x302F ], + [ 0x3099, 0x309A ], [ 0xA806, 0xA806 ], [ 0xA80B, 0xA80B ], + [ 0xA825, 0xA826 ], [ 0xFB1E, 0xFB1E ], [ 0xFE00, 0xFE0F ], + [ 0xFE20, 0xFE23 ], [ 0xFEFF, 0xFEFF ], [ 0xFFF9, 0xFFFB ], + [ 0x10A01, 0x10A03 ], [ 0x10A05, 0x10A06 ], [ 0x10A0C, 0x10A0F ], + [ 0x10A38, 0x10A3A ], [ 0x10A3F, 0x10A3F ], [ 0x1D167, 0x1D169 ], + [ 0x1D173, 0x1D182 ], [ 0x1D185, 0x1D18B ], [ 0x1D1AA, 0x1D1AD ], + [ 0x1D242, 0x1D244 ], [ 0xE0001, 0xE0001 ], [ 0xE0020, 0xE007F ], + [ 0xE0100, 0xE01EF ] +] diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/docs/index.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/docs/index.md new file mode 100644 index 00000000..5c5126d0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/docs/index.md @@ -0,0 +1,65 @@ +### Javascript porting of Markus Kuhn's wcwidth() implementation + +The following explanation comes from the original C implementation: + +This is an implementation of wcwidth() and wcswidth() (defined in +IEEE Std 1002.1-2001) for Unicode. + +http://www.opengroup.org/onlinepubs/007904975/functions/wcwidth.html +http://www.opengroup.org/onlinepubs/007904975/functions/wcswidth.html + +In fixed-width output devices, Latin characters all occupy a single +"cell" position of equal width, whereas ideographic CJK characters +occupy two such cells. Interoperability between terminal-line +applications and (teletype-style) character terminals using the +UTF-8 encoding requires agreement on which character should advance +the cursor by how many cell positions. No established formal +standards exist at present on which Unicode character shall occupy +how many cell positions on character terminals. These routines are +a first attempt of defining such behavior based on simple rules +applied to data provided by the Unicode Consortium. + +For some graphical characters, the Unicode standard explicitly +defines a character-cell width via the definition of the East Asian +FullWidth (F), Wide (W), Half-width (H), and Narrow (Na) classes. +In all these cases, there is no ambiguity about which width a +terminal shall use. For characters in the East Asian Ambiguous (A) +class, the width choice depends purely on a preference of backward +compatibility with either historic CJK or Western practice. +Choosing single-width for these characters is easy to justify as +the appropriate long-term solution, as the CJK practice of +displaying these characters as double-width comes from historic +implementation simplicity (8-bit encoded characters were displayed +single-width and 16-bit ones double-width, even for Greek, +Cyrillic, etc.) and not any typographic considerations. + +Much less clear is the choice of width for the Not East Asian +(Neutral) class. Existing practice does not dictate a width for any +of these characters. It would nevertheless make sense +typographically to allocate two character cells to characters such +as for instance EM SPACE or VOLUME INTEGRAL, which cannot be +represented adequately with a single-width glyph. The following +routines at present merely assign a single-cell width to all +neutral characters, in the interest of simplicity. This is not +entirely satisfactory and should be reconsidered before +establishing a formal standard in this area. At the moment, the +decision which Not East Asian (Neutral) characters should be +represented by double-width glyphs cannot yet be answered by +applying a simple rule from the Unicode database content. Setting +up a proper standard for the behavior of UTF-8 character terminals +will require a careful analysis not only of each Unicode character, +but also of each presentation form, something the author of these +routines has avoided to do so far. + +http://www.unicode.org/unicode/reports/tr11/ + +Markus Kuhn -- 2007-05-26 (Unicode 5.0) + +Permission to use, copy, modify, and distribute this software +for any purpose and without fee is hereby granted. The author +disclaims all warranties with regard to this software. + +Latest version: http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/index.js new file mode 100644 index 00000000..48cbb602 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/index.js @@ -0,0 +1,99 @@ +"use strict" + +var defaults = require('defaults') +var combining = require('./combining') + +var DEFAULTS = { + nul: 0, + control: 0 +} + +module.exports = function wcwidth(str) { + return wcswidth(str, DEFAULTS) +} + +module.exports.config = function(opts) { + opts = defaults(opts || {}, DEFAULTS) + return function wcwidth(str) { + return wcswidth(str, opts) + } +} + +/* + * The following functions define the column width of an ISO 10646 + * character as follows: + * - The null character (U+0000) has a column width of 0. + * - Other C0/C1 control characters and DEL will lead to a return value + * of -1. + * - Non-spacing and enclosing combining characters (general category + * code Mn or Me in the + * Unicode database) have a column width of 0. + * - SOFT HYPHEN (U+00AD) has a column width of 1. + * - Other format characters (general category code Cf in the Unicode + * database) and ZERO WIDTH + * SPACE (U+200B) have a column width of 0. + * - Hangul Jamo medial vowels and final consonants (U+1160-U+11FF) + * have a column width of 0. + * - Spacing characters in the East Asian Wide (W) or East Asian + * Full-width (F) category as + * defined in Unicode Technical Report #11 have a column width of 2. + * - All remaining characters (including all printable ISO 8859-1 and + * WGL4 characters, Unicode control characters, etc.) have a column + * width of 1. + * This implementation assumes that characters are encoded in ISO 10646. +*/ + +function wcswidth(str, opts) { + if (typeof str !== 'string') return wcwidth(str, opts) + + var s = 0 + for (var i = 0; i < str.length; i++) { + var n = wcwidth(str.charCodeAt(i), opts) + if (n < 0) return -1 + s += n + } + + return s +} + +function wcwidth(ucs, opts) { + // test for 8-bit control characters + if (ucs === 0) return opts.nul + if (ucs < 32 || (ucs >= 0x7f && ucs < 0xa0)) return opts.control + + // binary search in table of non-spacing characters + if (bisearch(ucs)) return 0 + + // if we arrive here, ucs is not a combining or C0/C1 control character + return 1 + + (ucs >= 0x1100 && + (ucs <= 0x115f || // Hangul Jamo init. consonants + ucs == 0x2329 || ucs == 0x232a || + (ucs >= 0x2e80 && ucs <= 0xa4cf && + ucs != 0x303f) || // CJK ... Yi + (ucs >= 0xac00 && ucs <= 0xd7a3) || // Hangul Syllables + (ucs >= 0xf900 && ucs <= 0xfaff) || // CJK Compatibility Ideographs + (ucs >= 0xfe10 && ucs <= 0xfe19) || // Vertical forms + (ucs >= 0xfe30 && ucs <= 0xfe6f) || // CJK Compatibility Forms + (ucs >= 0xff00 && ucs <= 0xff60) || // Fullwidth Forms + (ucs >= 0xffe0 && ucs <= 0xffe6) || + (ucs >= 0x20000 && ucs <= 0x2fffd) || + (ucs >= 0x30000 && ucs <= 0x3fffd))); +} + +function bisearch(ucs) { + var min = 0 + var max = combining.length - 1 + var mid + + if (ucs < combining[0][0] || ucs > combining[max][1]) return false + + while (max >= min) { + mid = Math.floor((min + max) / 2) + if (ucs > combining[mid][1]) min = mid + 1 + else if (ucs < combining[mid][0]) max = mid - 1 + else return true + } + + return false +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/.npmignore new file mode 100644 index 00000000..3c3629e6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/LICENSE new file mode 100644 index 00000000..d88b0720 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Elijah Insua + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/README.md new file mode 100644 index 00000000..1a4a2ea9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/README.md @@ -0,0 +1,43 @@ +# defaults + +A simple one level options merge utility + +## install + +`npm install defaults` + +## use + +```javascript + +var defaults = require('defaults'); + +var handle = function(options, fn) { + options = defaults(options, { + timeout: 100 + }); + + setTimeout(function() { + fn(options); + }, options.timeout); +} + +handle({ timeout: 1000 }, function() { + // we're here 1000 ms later +}); + +handle({ timeout: 10000 }, function() { + // we're here 10s later +}); + +``` + +## summary + +this module exports a function that takes 2 arguments: `options` and `defaults`. When called, it overrides all of `undefined` properties in `options` with the clones of properties defined in `defaults` + +Sidecases: if called with a falsy `options` value, options will be initialized to a new object before being merged onto. + +## license + +[MIT](LICENSE) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/index.js new file mode 100644 index 00000000..cb7d75c9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/index.js @@ -0,0 +1,13 @@ +var clone = require('clone'); + +module.exports = function(options, defaults) { + options = options || {}; + + Object.keys(defaults).forEach(function(key) { + if (typeof options[key] === 'undefined') { + options[key] = clone(defaults[key]); + } + }); + + return options; +}; \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/.npmignore new file mode 100644 index 00000000..c2658d7d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/.npmignore @@ -0,0 +1 @@ +node_modules/ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/.travis.yml new file mode 100644 index 00000000..20fd86b6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/.travis.yml @@ -0,0 +1,3 @@ +language: node_js +node_js: + - 0.10 diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/LICENSE new file mode 100644 index 00000000..cc3c87bc --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/LICENSE @@ -0,0 +1,18 @@ +Copyright © 2011-2015 Paul Vorbach + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the “Software”), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/README.md new file mode 100644 index 00000000..0b6cecae --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/README.md @@ -0,0 +1,126 @@ +# clone + +[![build status](https://secure.travis-ci.org/pvorb/node-clone.png)](http://travis-ci.org/pvorb/node-clone) + +[![info badge](https://nodei.co/npm/clone.png?downloads=true&downloadRank=true&stars=true)](http://npm-stat.com/charts.html?package=clone) + +offers foolproof _deep cloning_ of objects, arrays, numbers, strings etc. in JavaScript. + + +## Installation + + npm install clone + +(It also works with browserify, ender or standalone.) + + +## Example + +~~~ javascript +var clone = require('clone'); + +var a, b; + +a = { foo: { bar: 'baz' } }; // initial value of a + +b = clone(a); // clone a -> b +a.foo.bar = 'foo'; // change a + +console.log(a); // show a +console.log(b); // show b +~~~ + +This will print: + +~~~ javascript +{ foo: { bar: 'foo' } } +{ foo: { bar: 'baz' } } +~~~ + +**clone** masters cloning simple objects (even with custom prototype), arrays, +Date objects, and RegExp objects. Everything is cloned recursively, so that you +can clone dates in arrays in objects, for example. + + +## API + +`clone(val, circular, depth)` + + * `val` -- the value that you want to clone, any type allowed + * `circular` -- boolean + + Call `clone` with `circular` set to `false` if you are certain that `obj` + contains no circular references. This will give better performance if needed. + There is no error if `undefined` or `null` is passed as `obj`. + * `depth` -- depth to which the object is to be cloned (optional, + defaults to infinity) + +`clone.clonePrototype(obj)` + + * `obj` -- the object that you want to clone + +Does a prototype clone as +[described by Oran Looney](http://oranlooney.com/functional-javascript/). + + +## Circular References + +~~~ javascript +var a, b; + +a = { hello: 'world' }; + +a.myself = a; +b = clone(a); + +console.log(b); +~~~ + +This will print: + +~~~ javascript +{ hello: "world", myself: [Circular] } +~~~ + +So, `b.myself` points to `b`, not `a`. Neat! + + +## Test + + npm test + + +## Caveat + +Some special objects like a socket or `process.stdout`/`stderr` are known to not +be cloneable. If you find other objects that cannot be cloned, please [open an +issue](https://github.com/pvorb/node-clone/issues/new). + + +## Bugs and Issues + +If you encounter any bugs or issues, feel free to [open an issue at +github](https://github.com/pvorb/node-clone/issues) or send me an email to +. I also always like to hear from you, if you’re using my code. + +## License + +Copyright © 2011-2015 [Paul Vorbach](http://paul.vorba.ch/) and +[contributors](https://github.com/pvorb/node-clone/graphs/contributors). + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the “Software”), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/clone.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/clone.js new file mode 100644 index 00000000..62637592 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/clone.js @@ -0,0 +1,160 @@ +var clone = (function() { +'use strict'; + +/** + * Clones (copies) an Object using deep copying. + * + * This function supports circular references by default, but if you are certain + * there are no circular references in your object, you can save some CPU time + * by calling clone(obj, false). + * + * Caution: if `circular` is false and `parent` contains circular references, + * your program may enter an infinite loop and crash. + * + * @param `parent` - the object to be cloned + * @param `circular` - set to true if the object to be cloned may contain + * circular references. (optional - true by default) + * @param `depth` - set to a number if the object is only to be cloned to + * a particular depth. (optional - defaults to Infinity) + * @param `prototype` - sets the prototype to be used when cloning an object. + * (optional - defaults to parent prototype). +*/ +function clone(parent, circular, depth, prototype) { + var filter; + if (typeof circular === 'object') { + depth = circular.depth; + prototype = circular.prototype; + filter = circular.filter; + circular = circular.circular + } + // maintain two arrays for circular references, where corresponding parents + // and children have the same index + var allParents = []; + var allChildren = []; + + var useBuffer = typeof Buffer != 'undefined'; + + if (typeof circular == 'undefined') + circular = true; + + if (typeof depth == 'undefined') + depth = Infinity; + + // recurse this function so we don't reset allParents and allChildren + function _clone(parent, depth) { + // cloning null always returns null + if (parent === null) + return null; + + if (depth == 0) + return parent; + + var child; + var proto; + if (typeof parent != 'object') { + return parent; + } + + if (clone.__isArray(parent)) { + child = []; + } else if (clone.__isRegExp(parent)) { + child = new RegExp(parent.source, __getRegExpFlags(parent)); + if (parent.lastIndex) child.lastIndex = parent.lastIndex; + } else if (clone.__isDate(parent)) { + child = new Date(parent.getTime()); + } else if (useBuffer && Buffer.isBuffer(parent)) { + child = new Buffer(parent.length); + parent.copy(child); + return child; + } else { + if (typeof prototype == 'undefined') { + proto = Object.getPrototypeOf(parent); + child = Object.create(proto); + } + else { + child = Object.create(prototype); + proto = prototype; + } + } + + if (circular) { + var index = allParents.indexOf(parent); + + if (index != -1) { + return allChildren[index]; + } + allParents.push(parent); + allChildren.push(child); + } + + for (var i in parent) { + var attrs; + if (proto) { + attrs = Object.getOwnPropertyDescriptor(proto, i); + } + + if (attrs && attrs.set == null) { + continue; + } + child[i] = _clone(parent[i], depth - 1); + } + + return child; + } + + return _clone(parent, depth); +} + +/** + * Simple flat clone using prototype, accepts only objects, usefull for property + * override on FLAT configuration object (no nested props). + * + * USE WITH CAUTION! This may not behave as you wish if you do not know how this + * works. + */ +clone.clonePrototype = function clonePrototype(parent) { + if (parent === null) + return null; + + var c = function () {}; + c.prototype = parent; + return new c(); +}; + +// private utility functions + +function __objToStr(o) { + return Object.prototype.toString.call(o); +}; +clone.__objToStr = __objToStr; + +function __isDate(o) { + return typeof o === 'object' && __objToStr(o) === '[object Date]'; +}; +clone.__isDate = __isDate; + +function __isArray(o) { + return typeof o === 'object' && __objToStr(o) === '[object Array]'; +}; +clone.__isArray = __isArray; + +function __isRegExp(o) { + return typeof o === 'object' && __objToStr(o) === '[object RegExp]'; +}; +clone.__isRegExp = __isRegExp; + +function __getRegExpFlags(re) { + var flags = ''; + if (re.global) flags += 'g'; + if (re.ignoreCase) flags += 'i'; + if (re.multiline) flags += 'm'; + return flags; +}; +clone.__getRegExpFlags = __getRegExpFlags; + +return clone; +})(); + +if (typeof module === 'object' && module.exports) { + module.exports = clone; +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/package.json new file mode 100644 index 00000000..84d16fb5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/package.json @@ -0,0 +1,134 @@ +{ + "name": "clone", + "description": "deep cloning of objects and arrays", + "tags": [ + "clone", + "object", + "array", + "function", + "date" + ], + "version": "1.0.2", + "repository": { + "type": "git", + "url": "git://github.com/pvorb/node-clone.git" + }, + "bugs": { + "url": "https://github.com/pvorb/node-clone/issues" + }, + "main": "clone.js", + "author": { + "name": "Paul Vorbach", + "email": "paul@vorba.ch", + "url": "http://paul.vorba.ch/" + }, + "contributors": [ + { + "name": "Blake Miner", + "email": "miner.blake@gmail.com", + "url": "http://www.blakeminer.com/" + }, + { + "name": "Tian You", + "email": "axqd001@gmail.com", + "url": "http://blog.axqd.net/" + }, + { + "name": "George Stagas", + "email": "gstagas@gmail.com", + "url": "http://stagas.com/" + }, + { + "name": "Tobiasz Cudnik", + "email": "tobiasz.cudnik@gmail.com", + "url": "https://github.com/TobiaszCudnik" + }, + { + "name": "Pavel Lang", + "email": "langpavel@phpskelet.org", + "url": "https://github.com/langpavel" + }, + { + "name": "Dan MacTough", + "url": "http://yabfog.com/" + }, + { + "name": "w1nk", + "url": "https://github.com/w1nk" + }, + { + "name": "Hugh Kennedy", + "url": "http://twitter.com/hughskennedy" + }, + { + "name": "Dustin Diaz", + "url": "http://dustindiaz.com" + }, + { + "name": "Ilya Shaisultanov", + "url": "https://github.com/diversario" + }, + { + "name": "Nathan MacInnes", + "email": "nathan@macinn.es", + "url": "http://macinn.es/" + }, + { + "name": "Benjamin E. Coe", + "email": "ben@npmjs.com", + "url": "https://twitter.com/benjamincoe" + }, + { + "name": "Nathan Zadoks", + "url": "https://github.com/nathan7" + }, + { + "name": "Róbert Oroszi", + "email": "robert+gh@oroszi.net", + "url": "https://github.com/oroce" + }, + { + "name": "Aurélio A. Heckert", + "url": "http://softwarelivre.org/aurium" + }, + { + "name": "Guy Ellis", + "url": "http://www.guyellisrocks.com/" + } + ], + "license": "MIT", + "engines": { + "node": ">=0.8" + }, + "dependencies": {}, + "devDependencies": { + "nodeunit": "~0.9.0" + }, + "optionalDependencies": {}, + "scripts": { + "test": "nodeunit test.js" + }, + "gitHead": "0e8216efc672496b612fd7ab62159117d16ec4a0", + "homepage": "https://github.com/pvorb/node-clone", + "_id": "clone@1.0.2", + "_shasum": "260b7a99ebb1edfe247538175f783243cb19d149", + "_from": "clone@>=1.0.2 <2.0.0", + "_npmVersion": "1.4.14", + "_npmUser": { + "name": "pvorb", + "email": "paul@vorba.ch" + }, + "maintainers": [ + { + "name": "pvorb", + "email": "paul@vorb.de" + } + ], + "dist": { + "shasum": "260b7a99ebb1edfe247538175f783243cb19d149", + "tarball": "http://registry.npmjs.org/clone/-/clone-1.0.2.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/clone/-/clone-1.0.2.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test-apart-ctx.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test-apart-ctx.html new file mode 100644 index 00000000..4d532bb7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test-apart-ctx.html @@ -0,0 +1,22 @@ + + + + Clone Test-Suite (Browser) + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test.html b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test.html new file mode 100644 index 00000000..a9557025 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test.html @@ -0,0 +1,148 @@ + + + + + Clone Test-Suite (Browser) + + + + + +

    Clone Test-Suite (Browser)

    + Tests started: ; + Tests finished: . +
      + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test.js new file mode 100644 index 00000000..e8b65b3f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test.js @@ -0,0 +1,372 @@ +var clone = require('./'); + +function inspect(obj) { + seen = []; + return JSON.stringify(obj, function (key, val) { + if (val != null && typeof val == "object") { + if (seen.indexOf(val) >= 0) { + return '[cyclic]'; + } + + seen.push(val); + } + + return val; + }); +} + +// Creates a new VM in node, or an iframe in a browser in order to run the +// script +function apartContext(context, script, callback) { + var vm = require('vm'); + + if (vm) { + var ctx = vm.createContext({ ctx: context }); + callback(vm.runInContext(script, ctx)); + } else if (document && document.createElement) { + var iframe = document.createElement('iframe'); + iframe.style.display = 'none'; + document.body.appendChild(iframe); + + var myCtxId = 'tmpCtx' + Math.random(); + + window[myCtxId] = context; + iframe.src = 'test-apart-ctx.html?' + myCtxId + '&' + encodeURIComponent(script); + iframe.onload = function() { + try { + callback(iframe.contentWindow.results); + } catch (e) { + throw e; + } + }; + } else { + console.log('WARNING: cannot create an apart context.'); + } +} + +exports["clone string"] = function (test) { + test.expect(2); // how many tests? + + var a = "foo"; + test.strictEqual(clone(a), a); + a = ""; + test.strictEqual(clone(a), a); + + test.done(); +}; + +exports["clone number"] = function (test) { + test.expect(5); // how many tests? + + var a = 0; + test.strictEqual(clone(a), a); + a = 1; + test.strictEqual(clone(a), a); + a = -1000; + test.strictEqual(clone(a), a); + a = 3.1415927; + test.strictEqual(clone(a), a); + a = -3.1415927; + test.strictEqual(clone(a), a); + + test.done(); +}; + +exports["clone date"] = function (test) { + test.expect(3); // how many tests? + + var a = new Date; + var c = clone(a); + test.ok(!!a.getUTCDate && !!a.toUTCString); + test.ok(!!c.getUTCDate && !!c.toUTCString); + test.equal(a.getTime(), c.getTime()); + + test.done(); +}; + +exports["clone object"] = function (test) { + test.expect(1); // how many tests? + + var a = { foo: { bar: "baz" } }; + var b = clone(a); + + test.deepEqual(b, a); + + test.done(); +}; + +exports["clone array"] = function (test) { + test.expect(2); // how many tests? + + var a = [ + { foo: "bar" }, + "baz" + ]; + var b = clone(a); + + test.ok(b instanceof Array); + test.deepEqual(b, a); + + test.done(); +}; + +exports["clone buffer"] = function (test) { + if (typeof Buffer == 'undefined') { + return test.done(); + } + + test.expect(1); + + var a = new Buffer("this is a test buffer"); + var b = clone(a); + + // no underscore equal since it has no concept of Buffers + test.deepEqual(b, a); + test.done(); +}; + +exports["clone regexp"] = function (test) { + test.expect(5); + + var a = /abc123/gi; + var b = clone(a); + test.deepEqual(b, a); + + var c = /a/g; + test.ok(c.lastIndex === 0); + + c.exec('123a456a'); + test.ok(c.lastIndex === 4); + + var d = clone(c); + test.ok(d.global); + test.ok(d.lastIndex === 4); + + test.done(); +}; + +exports["clone object containing array"] = function (test) { + test.expect(1); // how many tests? + + var a = { + arr1: [ { a: '1234', b: '2345' } ], + arr2: [ { c: '345', d: '456' } ] + }; + + var b = clone(a); + + test.deepEqual(b, a); + + test.done(); +}; + +exports["clone object with circular reference"] = function (test) { + test.expect(8); // how many tests? + + var c = [1, "foo", {'hello': 'bar'}, function () {}, false, [2]]; + var b = [c, 2, 3, 4]; + + var a = {'b': b, 'c': c}; + a.loop = a; + a.loop2 = a; + c.loop = c; + c.aloop = a; + + var aCopy = clone(a); + test.ok(a != aCopy); + test.ok(a.c != aCopy.c); + test.ok(aCopy.c == aCopy.b[0]); + test.ok(aCopy.c.loop.loop.aloop == aCopy); + test.ok(aCopy.c[0] == a.c[0]); + + test.ok(eq(a, aCopy)); + aCopy.c[0] = 2; + test.ok(!eq(a, aCopy)); + aCopy.c = "2"; + test.ok(!eq(a, aCopy)); + + function eq(x, y) { + return inspect(x) === inspect(y); + } + + test.done(); +}; + +exports['clone prototype'] = function (test) { + test.expect(3); // how many tests? + + var a = { + a: "aaa", + x: 123, + y: 45.65 + }; + var b = clone.clonePrototype(a); + + test.strictEqual(b.a, a.a); + test.strictEqual(b.x, a.x); + test.strictEqual(b.y, a.y); + + test.done(); +}; + +exports['clone within an apart context'] = function (test) { + var results = apartContext({ clone: clone }, + "results = ctx.clone({ a: [1, 2, 3], d: new Date(), r: /^foo$/ig })", + function (results) { + test.ok(results.a.constructor.toString() === Array.toString()); + test.ok(results.d.constructor.toString() === Date.toString()); + test.ok(results.r.constructor.toString() === RegExp.toString()); + test.done(); + }); +}; + +exports['clone object with no constructor'] = function (test) { + test.expect(3); + + var n = null; + + var a = { foo: 'bar' }; + a.__proto__ = n; + test.ok(typeof a === 'object'); + test.ok(typeof a !== null); + + var b = clone(a); + test.ok(a.foo, b.foo); + + test.done(); +}; + +exports['clone object with depth argument'] = function (test) { + test.expect(6); + + var a = { + foo: { + bar : { + baz : 'qux' + } + } + }; + + var b = clone(a, false, 1); + test.deepEqual(b, a); + test.notEqual(b, a); + test.strictEqual(b.foo, a.foo); + + b = clone(a, true, 2); + test.deepEqual(b, a); + test.notEqual(b.foo, a.foo); + test.strictEqual(b.foo.bar, a.foo.bar); + + test.done(); +}; + +exports['maintain prototype chain in clones'] = function (test) { + test.expect(1); + + function T() {} + + var a = new T(); + var b = clone(a); + test.strictEqual(Object.getPrototypeOf(a), Object.getPrototypeOf(b)); + + test.done(); +}; + +exports['parent prototype is overriden with prototype provided'] = function (test) { + test.expect(1); + + function T() {} + + var a = new T(); + var b = clone(a, true, Infinity, null); + test.strictEqual(b.__defineSetter__, undefined); + + test.done(); +}; + +exports['clone object with null children'] = function (test) { + test.expect(1); + var a = { + foo: { + bar: null, + baz: { + qux: false + } + } + }; + + var b = clone(a); + + test.deepEqual(b, a); + test.done(); +}; + +exports['clone instance with getter'] = function (test) { + test.expect(1); + function Ctor() {}; + Object.defineProperty(Ctor.prototype, 'prop', { + configurable: true, + enumerable: true, + get: function() { + return 'value'; + } + }); + + var a = new Ctor(); + var b = clone(a); + + test.strictEqual(b.prop, 'value'); + test.done(); +}; + +exports['get RegExp flags'] = function (test) { + test.strictEqual(clone.__getRegExpFlags(/a/), '' ); + test.strictEqual(clone.__getRegExpFlags(/a/i), 'i' ); + test.strictEqual(clone.__getRegExpFlags(/a/g), 'g' ); + test.strictEqual(clone.__getRegExpFlags(/a/gi), 'gi'); + test.strictEqual(clone.__getRegExpFlags(/a/m), 'm' ); + + test.done(); +}; + +exports["recognize Array object"] = function (test) { + var results = apartContext(null, "results = [1, 2, 3]", function(alien) { + var local = [4, 5, 6]; + test.ok(clone.__isArray(alien)); // recognize in other context. + test.ok(clone.__isArray(local)); // recognize in local context. + test.ok(!clone.__isDate(alien)); + test.ok(!clone.__isDate(local)); + test.ok(!clone.__isRegExp(alien)); + test.ok(!clone.__isRegExp(local)); + test.done(); + }); +}; + +exports["recognize Date object"] = function (test) { + var results = apartContext(null, "results = new Date()", function(alien) { + var local = new Date(); + + test.ok(clone.__isDate(alien)); // recognize in other context. + test.ok(clone.__isDate(local)); // recognize in local context. + test.ok(!clone.__isArray(alien)); + test.ok(!clone.__isArray(local)); + test.ok(!clone.__isRegExp(alien)); + test.ok(!clone.__isRegExp(local)); + + test.done(); + }); +}; + +exports["recognize RegExp object"] = function (test) { + var results = apartContext(null, "results = /foo/", function(alien) { + var local = /bar/; + + test.ok(clone.__isRegExp(alien)); // recognize in other context. + test.ok(clone.__isRegExp(local)); // recognize in local context. + test.ok(!clone.__isArray(alien)); + test.ok(!clone.__isArray(local)); + test.ok(!clone.__isDate(alien)); + test.ok(!clone.__isDate(local)); + test.done(); + }); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/package.json new file mode 100644 index 00000000..8ad5116c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/package.json @@ -0,0 +1,55 @@ +{ + "name": "defaults", + "version": "1.0.3", + "description": "merge single level defaults over a config object", + "main": "index.js", + "scripts": { + "test": "node test.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/tmpvar/defaults.git" + }, + "keywords": [ + "config", + "defaults" + ], + "author": { + "name": "Elijah Insua", + "email": "tmpvar@gmail.com" + }, + "license": "MIT", + "dependencies": { + "clone": "^1.0.2" + }, + "devDependencies": { + "tap": "^2.0.0" + }, + "gitHead": "8831ec32a5f999bfae1a8c9bf32880971ed7c6f2", + "bugs": { + "url": "https://github.com/tmpvar/defaults/issues" + }, + "homepage": "https://github.com/tmpvar/defaults#readme", + "_id": "defaults@1.0.3", + "_shasum": "c656051e9817d9ff08ed881477f3fe4019f3ef7d", + "_from": "defaults@>=1.0.0 <2.0.0", + "_npmVersion": "2.14.4", + "_nodeVersion": "4.1.1", + "_npmUser": { + "name": "tmpvar", + "email": "tmpvar@gmail.com" + }, + "dist": { + "shasum": "c656051e9817d9ff08ed881477f3fe4019f3ef7d", + "tarball": "http://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz" + }, + "maintainers": [ + { + "name": "tmpvar", + "email": "tmpvar@gmail.com" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/test.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/test.js new file mode 100644 index 00000000..60e0ffba --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/test.js @@ -0,0 +1,34 @@ +var defaults = require('./'), + test = require('tap').test; + +test("ensure options is an object", function(t) { + var options = defaults(false, { a : true }); + t.ok(options.a); + t.end() +}); + +test("ensure defaults override keys", function(t) { + var result = defaults({}, { a: false, b: true }); + t.ok(result.b, 'b merges over undefined'); + t.equal(result.a, false, 'a merges over undefined'); + t.end(); +}); + +test("ensure defined keys are not overwritten", function(t) { + var result = defaults({ b: false }, { a: false, b: true }); + t.equal(result.b, false, 'b not merged'); + t.equal(result.a, false, 'a merges over undefined'); + t.end(); +}); + +test("ensure defaults clone nested objects", function(t) { + var d = { a: [1,2,3], b: { hello : 'world' } }; + var result = defaults({}, d); + t.equal(result.a.length, 3, 'objects should be clones'); + t.ok(result.a !== d.a, 'objects should be clones'); + + t.equal(Object.keys(result.b).length, 1, 'objects should be clones'); + t.ok(result.b !== d.b, 'objects should be clones'); + t.end(); +}); + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/package.json new file mode 100644 index 00000000..4744d9dc --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/package.json @@ -0,0 +1,60 @@ +{ + "name": "wcwidth", + "version": "1.0.0", + "description": "Port of C's wcwidth() and wcswidth()", + "author": { + "name": "Tim Oxley" + }, + "contributors": [ + { + "name": "Woong Jun", + "email": "woong.jun@gmail.com", + "url": "http://code.woong.org/" + } + ], + "main": "index.js", + "dependencies": { + "defaults": "^1.0.0" + }, + "devDependencies": { + "tape": "^2.13.4" + }, + "license": "MIT", + "keywords": [ + "wide character", + "wc", + "wide character string", + "wcs", + "terminal", + "width", + "wcwidth", + "wcswidth" + ], + "directories": { + "doc": "docs", + "test": "test" + }, + "scripts": { + "test": "tape test/*.js" + }, + "gitHead": "5bc3aafd45c89f233c27b9479c18a23ca91ba660", + "_id": "wcwidth@1.0.0", + "_shasum": "02d059ff7a8fc741e0f6b5da1e69b2b40daeca6f", + "_from": "wcwidth@>=1.0.0 <2.0.0", + "_npmVersion": "1.4.23", + "_npmUser": { + "name": "timoxley", + "email": "secoif@gmail.com" + }, + "maintainers": [ + { + "name": "timoxley", + "email": "secoif@gmail.com" + } + ], + "dist": { + "shasum": "02d059ff7a8fc741e0f6b5da1e69b2b40daeca6f", + "tarball": "http://registry.npmjs.org/wcwidth/-/wcwidth-1.0.0.tgz" + }, + "_resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.0.tgz" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/test/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/test/index.js new file mode 100644 index 00000000..5180599a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/node_modules/wcwidth/test/index.js @@ -0,0 +1,64 @@ +"use strict" + +var wcwidth = require('../') +var test = require('tape') + +test('handles regular strings', function(t) { + t.strictEqual(wcwidth('abc'), 3) + t.end() +}) + +test('handles multibyte strings', function(t) { + t.strictEqual(wcwidth('字的模块'), 8) + t.end() +}) + +test('handles multibyte characters mixed with regular characters', function(t) { + t.strictEqual(wcwidth('abc 字的模块'), 12) + t.end() +}) + +test('ignores control characters e.g. \\n', function(t) { + t.strictEqual(wcwidth('abc\n字的模块\ndef'), 14) + t.end() +}) + +test('ignores bad input', function(t) { + t.strictEqual(wcwidth(''), 0) + t.strictEqual(wcwidth(3), 0) + t.strictEqual(wcwidth({}), 0) + t.strictEqual(wcwidth([]), 0) + t.strictEqual(wcwidth(), 0) + t.end() +}) + +test('ignores nul (charcode 0)', function(t) { + t.strictEqual(wcwidth(String.fromCharCode(0)), 0) + t.end() +}) + +test('ignores nul mixed with chars', function(t) { + t.strictEqual(wcwidth('a' + String.fromCharCode(0) + '\n字的'), 5) + t.end() +}) + +test('can have custom value for nul', function(t) { + t.strictEqual(wcwidth.config({ + nul: 10 + })(String.fromCharCode(0) + 'a字的'), 15) + t.end() +}) + +test('can have custom control char value', function(t) { + t.strictEqual(wcwidth.config({ + control: 1 + })('abc\n字的模块\ndef'), 16) + t.end() +}) + +test('negative custom control chars == -1', function(t) { + t.strictEqual(wcwidth.config({ + control: -1 + })('abc\n字的模块\ndef'), -1) + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/package.json new file mode 100644 index 00000000..b4c3738c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/package.json @@ -0,0 +1,74 @@ +{ + "name": "columnify", + "version": "1.5.4", + "description": "Render data in text columns. Supports in-column text-wrap.", + "main": "columnify.js", + "scripts": { + "pretest": "npm prune", + "test": "make prepublish && tape test/*.js | tap-spec", + "bench": "npm test && node bench", + "prepublish": "make prepublish" + }, + "babel": { + "presets": [ + "es2015" + ] + }, + "author": { + "name": "Tim Oxley" + }, + "license": "MIT", + "devDependencies": { + "babel": "^6.3.26", + "babel-cli": "^6.3.17", + "babel-preset-es2015": "^6.3.13", + "chalk": "^1.1.1", + "tap-spec": "^4.1.1", + "tape": "^4.4.0" + }, + "repository": { + "type": "git", + "url": "git://github.com/timoxley/columnify.git" + }, + "keywords": [ + "column", + "text", + "ansi", + "console", + "terminal", + "wrap", + "table" + ], + "bugs": { + "url": "https://github.com/timoxley/columnify/issues" + }, + "homepage": "https://github.com/timoxley/columnify", + "dependencies": { + "strip-ansi": "^3.0.0", + "wcwidth": "^1.0.0" + }, + "directories": { + "test": "test" + }, + "gitHead": "b5373b3d6344bf59e1ab63c912c188c34bce5889", + "_id": "columnify@1.5.4", + "_shasum": "4737ddf1c7b69a8a7c340570782e947eec8e78bb", + "_from": "columnify@latest", + "_npmVersion": "2.14.7", + "_nodeVersion": "4.2.3", + "_npmUser": { + "name": "timoxley", + "email": "secoif@gmail.com" + }, + "maintainers": [ + { + "name": "timoxley", + "email": "secoif@gmail.com" + } + ], + "dist": { + "shasum": "4737ddf1c7b69a8a7c340570782e947eec8e78bb", + "tarball": "http://registry.npmjs.org/columnify/-/columnify-1.5.4.tgz" + }, + "_resolved": "https://registry.npmjs.org/columnify/-/columnify-1.5.4.tgz" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/utils.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/utils.js new file mode 100644 index 00000000..df3e6cc4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/utils.js @@ -0,0 +1,193 @@ +"use strict" + +var wcwidth = require('./width') + +/** + * repeat string `str` up to total length of `len` + * + * @param String str string to repeat + * @param Number len total length of output string + */ + +function repeatString(str, len) { + return Array.apply(null, {length: len + 1}).join(str).slice(0, len) +} + +/** + * Pad `str` up to total length `max` with `chr`. + * If `str` is longer than `max`, padRight will return `str` unaltered. + * + * @param String str string to pad + * @param Number max total length of output string + * @param String chr optional. Character to pad with. default: ' ' + * @return String padded str + */ + +function padRight(str, max, chr) { + str = str != null ? str : '' + str = String(str) + var length = max - wcwidth(str) + if (length <= 0) return str + return str + repeatString(chr || ' ', length) +} + +/** + * Pad `str` up to total length `max` with `chr`. + * If `str` is longer than `max`, padCenter will return `str` unaltered. + * + * @param String str string to pad + * @param Number max total length of output string + * @param String chr optional. Character to pad with. default: ' ' + * @return String padded str + */ + +function padCenter(str, max, chr) { + str = str != null ? str : '' + str = String(str) + var length = max - wcwidth(str) + if (length <= 0) return str + var lengthLeft = Math.floor(length/2) + var lengthRight = length - lengthLeft + return repeatString(chr || ' ', lengthLeft) + str + repeatString(chr || ' ', lengthRight) +} + +/** + * Pad `str` up to total length `max` with `chr`, on the left. + * If `str` is longer than `max`, padRight will return `str` unaltered. + * + * @param String str string to pad + * @param Number max total length of output string + * @param String chr optional. Character to pad with. default: ' ' + * @return String padded str + */ + +function padLeft(str, max, chr) { + str = str != null ? str : '' + str = String(str) + var length = max - wcwidth(str) + if (length <= 0) return str + return repeatString(chr || ' ', length) + str +} + +/** + * Split a String `str` into lines of maxiumum length `max`. + * Splits on word boundaries. Preserves existing new lines. + * + * @param String str string to split + * @param Number max length of each line + * @return Array Array containing lines. + */ + +function splitIntoLines(str, max) { + function _splitIntoLines(str, max) { + return str.trim().split(' ').reduce(function(lines, word) { + var line = lines[lines.length - 1] + if (line && wcwidth(line.join(' ')) + wcwidth(word) < max) { + lines[lines.length - 1].push(word) // add to line + } + else lines.push([word]) // new line + return lines + }, []).map(function(l) { + return l.join(' ') + }) + } + return str.split('\n').map(function(str) { + return _splitIntoLines(str, max) + }).reduce(function(lines, line) { + return lines.concat(line) + }, []) +} + +/** + * Add spaces and `truncationChar` between words of + * `str` which are longer than `max`. + * + * @param String str string to split + * @param Number max length of each line + * @param Number truncationChar character to append to split words + * @return String + */ + +function splitLongWords(str, max, truncationChar) { + str = str.trim() + var result = [] + var words = str.split(' ') + var remainder = '' + + var truncationWidth = wcwidth(truncationChar) + + while (remainder || words.length) { + if (remainder) { + var word = remainder + remainder = '' + } else { + var word = words.shift() + } + + if (wcwidth(word) > max) { + // slice is based on length no wcwidth + var i = 0 + var wwidth = 0 + var limit = max - truncationWidth + while (i < word.length) { + var w = wcwidth(word.charAt(i)) + if (w + wwidth > limit) { + break + } + wwidth += w + ++i + } + + remainder = word.slice(i) // get remainder + // save remainder for next loop + + word = word.slice(0, i) // grab truncated word + word += truncationChar // add trailing … or whatever + } + result.push(word) + } + + return result.join(' ') +} + + +/** + * Truncate `str` into total width `max` + * If `str` is shorter than `max`, will return `str` unaltered. + * + * @param String str string to truncated + * @param Number max total wcwidth of output string + * @return String truncated str + */ + +function truncateString(str, max) { + + str = str != null ? str : '' + str = String(str) + + if(max == Infinity) return str + + var i = 0 + var wwidth = 0 + while (i < str.length) { + var w = wcwidth(str.charAt(i)) + if(w + wwidth > max) + break + wwidth += w + ++i + } + return str.slice(0, i) +} + + + +/** + * Exports + */ + +module.exports.padRight = padRight +module.exports.padCenter = padCenter +module.exports.padLeft = padLeft +module.exports.splitIntoLines = splitIntoLines +module.exports.splitLongWords = splitLongWords +module.exports.truncateString = truncateString diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/width.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/width.js new file mode 100644 index 00000000..a9f5333b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/columnify/width.js @@ -0,0 +1,6 @@ +var stripAnsi = require('strip-ansi') +var wcwidth = require('wcwidth') + +module.exports = function(str) { + return wcwidth(stripAnsi(str)) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/.npmignore new file mode 100644 index 00000000..13abef4f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/.npmignore @@ -0,0 +1,3 @@ +node_modules +node_modules/* +npm_debug.log diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/LICENCE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/LICENCE new file mode 100644 index 00000000..171dd970 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/LICENCE @@ -0,0 +1,22 @@ +Copyright (c) 2011 Dominic Tarr + +Permission is hereby granted, free of charge, +to any person obtaining a copy of this software and +associated documentation files (the "Software"), to +deal in the Software without restriction, including +without limitation the rights to use, copy, modify, +merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom +the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/index.js new file mode 100644 index 00000000..0ef3a91f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/index.js @@ -0,0 +1,282 @@ +var ProtoList = require('proto-list') + , path = require('path') + , fs = require('fs') + , ini = require('ini') + , EE = require('events').EventEmitter + , url = require('url') + , http = require('http') + +var exports = module.exports = function () { + var args = [].slice.call(arguments) + , conf = new ConfigChain() + + while(args.length) { + var a = args.shift() + if(a) conf.push + ( 'string' === typeof a + ? json(a) + : a ) + } + + return conf +} + +//recursively find a file... + +var find = exports.find = function () { + var rel = path.join.apply(null, [].slice.call(arguments)) + + function find(start, rel) { + var file = path.join(start, rel) + try { + fs.statSync(file) + return file + } catch (err) { + if(path.dirname(start) !== start) // root + return find(path.dirname(start), rel) + } + } + return find(__dirname, rel) +} + +var parse = exports.parse = function (content, file, type) { + content = '' + content + // if we don't know what it is, try json and fall back to ini + // if we know what it is, then it must be that. + if (!type) { + try { return JSON.parse(content) } + catch (er) { return ini.parse(content) } + } else if (type === 'json') { + if (this.emit) { + try { return JSON.parse(content) } + catch (er) { this.emit('error', er) } + } else { + return JSON.parse(content) + } + } else { + return ini.parse(content) + } +} + +var json = exports.json = function () { + var args = [].slice.call(arguments).filter(function (arg) { return arg != null }) + var file = path.join.apply(null, args) + var content + try { + content = fs.readFileSync(file,'utf-8') + } catch (err) { + return + } + return parse(content, file, 'json') +} + +var env = exports.env = function (prefix, env) { + env = env || process.env + var obj = {} + var l = prefix.length + for(var k in env) { + if(k.indexOf(prefix) === 0) + obj[k.substring(l)] = env[k] + } + + return obj +} + +exports.ConfigChain = ConfigChain +function ConfigChain () { + EE.apply(this) + ProtoList.apply(this, arguments) + this._awaiting = 0 + this._saving = 0 + this.sources = {} +} + +// multi-inheritance-ish +var extras = { + constructor: { value: ConfigChain } +} +Object.keys(EE.prototype).forEach(function (k) { + extras[k] = Object.getOwnPropertyDescriptor(EE.prototype, k) +}) +ConfigChain.prototype = Object.create(ProtoList.prototype, extras) + +ConfigChain.prototype.del = function (key, where) { + // if not specified where, then delete from the whole chain, scorched + // earth style + if (where) { + var target = this.sources[where] + target = target && target.data + if (!target) { + return this.emit('error', new Error('not found '+where)) + } + delete target[key] + } else { + for (var i = 0, l = this.list.length; i < l; i ++) { + delete this.list[i][key] + } + } + return this +} + +ConfigChain.prototype.set = function (key, value, where) { + var target + + if (where) { + target = this.sources[where] + target = target && target.data + if (!target) { + return this.emit('error', new Error('not found '+where)) + } + } else { + target = this.list[0] + if (!target) { + return this.emit('error', new Error('cannot set, no confs!')) + } + } + target[key] = value + return this +} + +ConfigChain.prototype.get = function (key, where) { + if (where) { + where = this.sources[where] + if (where) where = where.data + if (where && Object.hasOwnProperty.call(where, key)) return where[key] + return undefined + } + return this.list[0][key] +} + +ConfigChain.prototype.save = function (where, type, cb) { + if (typeof type === 'function') cb = type, type = null + var target = this.sources[where] + if (!target || !(target.path || target.source) || !target.data) { + // TODO: maybe save() to a url target could be a PUT or something? + // would be easy to swap out with a reddis type thing, too + return this.emit('error', new Error('bad save target: '+where)) + } + + if (target.source) { + var pref = target.prefix || '' + Object.keys(target.data).forEach(function (k) { + target.source[pref + k] = target.data[k] + }) + return this + } + + var type = type || target.type + var data = target.data + if (target.type === 'json') { + data = JSON.stringify(data) + } else { + data = ini.stringify(data) + } + + this._saving ++ + fs.writeFile(target.path, data, 'utf8', function (er) { + this._saving -- + if (er) { + if (cb) return cb(er) + else return this.emit('error', er) + } + if (this._saving === 0) { + if (cb) cb() + this.emit('save') + } + }.bind(this)) + return this +} + +ConfigChain.prototype.addFile = function (file, type, name) { + name = name || file + var marker = {__source__:name} + this.sources[name] = { path: file, type: type } + this.push(marker) + this._await() + fs.readFile(file, 'utf8', function (er, data) { + if (er) this.emit('error', er) + this.addString(data, file, type, marker) + }.bind(this)) + return this +} + +ConfigChain.prototype.addEnv = function (prefix, env, name) { + name = name || 'env' + var data = exports.env(prefix, env) + this.sources[name] = { data: data, source: env, prefix: prefix } + return this.add(data, name) +} + +ConfigChain.prototype.addUrl = function (req, type, name) { + this._await() + var href = url.format(req) + name = name || href + var marker = {__source__:name} + this.sources[name] = { href: href, type: type } + this.push(marker) + http.request(req, function (res) { + var c = [] + var ct = res.headers['content-type'] + if (!type) { + type = ct.indexOf('json') !== -1 ? 'json' + : ct.indexOf('ini') !== -1 ? 'ini' + : href.match(/\.json$/) ? 'json' + : href.match(/\.ini$/) ? 'ini' + : null + marker.type = type + } + + res.on('data', c.push.bind(c)) + .on('end', function () { + this.addString(Buffer.concat(c), href, type, marker) + }.bind(this)) + .on('error', this.emit.bind(this, 'error')) + + }.bind(this)) + .on('error', this.emit.bind(this, 'error')) + .end() + + return this +} + +ConfigChain.prototype.addString = function (data, file, type, marker) { + data = this.parse(data, file, type) + this.add(data, marker) + return this +} + +ConfigChain.prototype.add = function (data, marker) { + if (marker && typeof marker === 'object') { + var i = this.list.indexOf(marker) + if (i === -1) { + return this.emit('error', new Error('bad marker')) + } + this.splice(i, 1, data) + marker = marker.__source__ + this.sources[marker] = this.sources[marker] || {} + this.sources[marker].data = data + // we were waiting for this. maybe emit 'load' + this._resolve() + } else { + if (typeof marker === 'string') { + this.sources[marker] = this.sources[marker] || {} + this.sources[marker].data = data + } + // trigger the load event if nothing was already going to do so. + this._await() + this.push(data) + process.nextTick(this._resolve.bind(this)) + } + return this +} + +ConfigChain.prototype.parse = exports.parse + +ConfigChain.prototype._await = function () { + this._awaiting++ +} + +ConfigChain.prototype._resolve = function () { + this._awaiting-- + if (this._awaiting === 0) this.emit('load', this) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/node_modules/proto-list/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/node_modules/proto-list/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/node_modules/proto-list/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/node_modules/proto-list/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/node_modules/proto-list/README.md new file mode 100644 index 00000000..43cfa358 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/node_modules/proto-list/README.md @@ -0,0 +1,3 @@ +A list of objects, bound by their prototype chain. + +Used in npm's config stuff. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/node_modules/proto-list/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/node_modules/proto-list/package.json new file mode 100644 index 00000000..699311ed --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/node_modules/proto-list/package.json @@ -0,0 +1,49 @@ +{ + "name": "proto-list", + "version": "1.2.4", + "description": "A utility for managing a prototype chain", + "main": "./proto-list.js", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/proto-list.git" + }, + "license": "ISC", + "devDependencies": { + "tap": "0" + }, + "gitHead": "9e4af12d4dddee2fd531f0fe0c21c9cfacb78ac0", + "bugs": { + "url": "https://github.com/isaacs/proto-list/issues" + }, + "homepage": "https://github.com/isaacs/proto-list#readme", + "_id": "proto-list@1.2.4", + "_shasum": "212d5bfe1318306a420f6402b8e26ff39647a849", + "_from": "proto-list@>=1.2.1 <1.3.0", + "_npmVersion": "2.10.0", + "_nodeVersion": "2.0.1", + "_npmUser": { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + "dist": { + "shasum": "212d5bfe1318306a420f6402b8e26ff39647a849", + "tarball": "http://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/node_modules/proto-list/proto-list.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/node_modules/proto-list/proto-list.js new file mode 100644 index 00000000..b55c25c0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/node_modules/proto-list/proto-list.js @@ -0,0 +1,88 @@ + +module.exports = ProtoList + +function setProto(obj, proto) { + if (typeof Object.setPrototypeOf === "function") + return Object.setPrototypeOf(obj, proto) + else + obj.__proto__ = proto +} + +function ProtoList () { + this.list = [] + var root = null + Object.defineProperty(this, 'root', { + get: function () { return root }, + set: function (r) { + root = r + if (this.list.length) { + setProto(this.list[this.list.length - 1], r) + } + }, + enumerable: true, + configurable: true + }) +} + +ProtoList.prototype = + { get length () { return this.list.length } + , get keys () { + var k = [] + for (var i in this.list[0]) k.push(i) + return k + } + , get snapshot () { + var o = {} + this.keys.forEach(function (k) { o[k] = this.get(k) }, this) + return o + } + , get store () { + return this.list[0] + } + , push : function (obj) { + if (typeof obj !== "object") obj = {valueOf:obj} + if (this.list.length >= 1) { + setProto(this.list[this.list.length - 1], obj) + } + setProto(obj, this.root) + return this.list.push(obj) + } + , pop : function () { + if (this.list.length >= 2) { + setProto(this.list[this.list.length - 2], this.root) + } + return this.list.pop() + } + , unshift : function (obj) { + setProto(obj, this.list[0] || this.root) + return this.list.unshift(obj) + } + , shift : function () { + if (this.list.length === 1) { + setProto(this.list[0], this.root) + } + return this.list.shift() + } + , get : function (key) { + return this.list[0][key] + } + , set : function (key, val, save) { + if (!this.length) this.push({}) + if (save && this.list[0].hasOwnProperty(key)) this.push({}) + return this.list[0][key] = val + } + , forEach : function (fn, thisp) { + for (var key in this.list[0]) fn.call(thisp, key, this.list[0][key]) + } + , slice : function () { + return this.list.slice.apply(this.list, arguments) + } + , splice : function () { + // handle injections + var ret = this.list.splice.apply(this.list, arguments) + for (var i = 0, l = this.list.length; i < l; i++) { + setProto(this.list[i], this.list[i + 1] || this.root) + } + return ret + } + } diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/node_modules/proto-list/test/basic.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/node_modules/proto-list/test/basic.js new file mode 100644 index 00000000..5cd66bef --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/node_modules/proto-list/test/basic.js @@ -0,0 +1,61 @@ +var tap = require("tap") + , test = tap.test + , ProtoList = require("../proto-list.js") + +tap.plan(1) + +tap.test("protoList tests", function (t) { + var p = new ProtoList + p.push({foo:"bar"}) + p.push({}) + p.set("foo", "baz") + t.equal(p.get("foo"), "baz") + + var p = new ProtoList + p.push({foo:"bar"}) + p.set("foo", "baz") + t.equal(p.get("foo"), "baz") + t.equal(p.length, 1) + p.pop() + t.equal(p.length, 0) + p.set("foo", "asdf") + t.equal(p.length, 1) + t.equal(p.get("foo"), "asdf") + p.push({bar:"baz"}) + t.equal(p.length, 2) + t.equal(p.get("foo"), "asdf") + p.shift() + t.equal(p.length, 1) + t.equal(p.get("foo"), undefined) + + + p.unshift({foo:"blo", bar:"rab"}) + p.unshift({foo:"boo"}) + t.equal(p.length, 3) + t.equal(p.get("foo"), "boo") + t.equal(p.get("bar"), "rab") + + var ret = p.splice(1, 1, {bar:"bar"}) + t.same(ret, [{foo:"blo", bar:"rab"}]) + t.equal(p.get("bar"), "bar") + + // should not inherit default object properties + t.equal(p.get('hasOwnProperty'), undefined) + + // unless we give it those. + p.root = {} + t.equal(p.get('hasOwnProperty'), {}.hasOwnProperty) + + p.root = {default:'monkey'} + t.equal(p.get('default'), 'monkey') + + p.push({red:'blue'}) + p.push({red:'blue'}) + p.push({red:'blue'}) + while (p.length) { + t.equal(p.get('default'), 'monkey') + p.shift() + } + + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/package.json new file mode 100644 index 00000000..ecbf8f62 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/package.json @@ -0,0 +1,61 @@ +{ + "name": "config-chain", + "version": "1.1.10", + "licenses": [ + { + "type": "MIT", + "url": "https://raw.githubusercontent.com/dominictarr/config-chain/master/LICENCE" + } + ], + "description": "HANDLE CONFIGURATION ONCE AND FOR ALL", + "homepage": "http://github.com/dominictarr/config-chain", + "repository": { + "type": "git", + "url": "git+https://github.com/dominictarr/config-chain.git" + }, + "dependencies": { + "proto-list": "~1.2.1", + "ini": "^1.3.4" + }, + "devDependencies": { + "tap": "0.3.0" + }, + "author": { + "name": "Dominic Tarr", + "email": "dominic.tarr@gmail.com", + "url": "http://dominictarr.com" + }, + "scripts": { + "test": "tap test/" + }, + "gitHead": "0b6db3e14b9cdbe31460292bc4caf3983f977816", + "bugs": { + "url": "https://github.com/dominictarr/config-chain/issues" + }, + "_id": "config-chain@1.1.10", + "_shasum": "7fc383de0fcc84d711cb465bd176579cad612346", + "_from": "config-chain@latest", + "_npmVersion": "3.3.12", + "_nodeVersion": "5.3.0", + "_npmUser": { + "name": "dominictarr", + "email": "dominic.tarr@gmail.com" + }, + "dist": { + "shasum": "7fc383de0fcc84d711cb465bd176579cad612346", + "tarball": "http://registry.npmjs.org/config-chain/-/config-chain-1.1.10.tgz" + }, + "maintainers": [ + { + "name": "dominictarr", + "email": "dominic.tarr@gmail.com" + }, + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.10.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/readme.markdown b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/readme.markdown new file mode 100644 index 00000000..c83a4306 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/readme.markdown @@ -0,0 +1,228 @@ +#config-chain + +USE THIS MODULE TO LOAD ALL YOUR CONFIGURATIONS + +``` js + + //npm install config-chain + + var cc = require('config-chain') + , opts = require('optimist').argv //ALWAYS USE OPTIMIST FOR COMMAND LINE OPTIONS. + , env = opts.env || process.env.YOUR_APP_ENV || 'dev' //SET YOUR ENV LIKE THIS. + + // EACH ARG TO CONFIGURATOR IS LOADED INTO CONFIGURATION CHAIN + // EARLIER ITEMS OVERIDE LATER ITEMS + // PUTS COMMAND LINE OPTS FIRST, AND DEFAULTS LAST! + + //strings are interpereted as filenames. + //will be loaded synchronously + + var conf = + cc( + //OVERRIDE SETTINGS WITH COMMAND LINE OPTS + opts, + + //ENV VARS IF PREFIXED WITH 'myApp_' + + cc.env('myApp_'), //myApp_foo = 'like this' + + //FILE NAMED BY ENV + path.join(__dirname, 'config.' + env + '.json'), + + //IF `env` is PRODUCTION + env === 'prod' + ? path.join(__dirname, 'special.json') //load a special file + : null //NULL IS IGNORED! + + //SUBDIR FOR ENV CONFIG + path.join(__dirname, 'config', env, 'config.json'), + + //SEARCH PARENT DIRECTORIES FROM CURRENT DIR FOR FILE + cc.find('config.json'), + + //PUT DEFAULTS LAST + { + host: 'localhost' + port: 8000 + }) + + var host = conf.get('host') + + // or + + var host = conf.store.host + +``` + +FINALLY, EASY FLEXIBLE CONFIGURATIONS! + +##see also: [proto-list](https://github.com/isaacs/proto-list/) + +WHATS THAT YOU SAY? + +YOU WANT A "CLASS" SO THAT YOU CAN DO CRAYCRAY JQUERY CRAPS? + +EXTEND WITH YOUR OWN FUNCTIONALTY!? + +## CONFIGCHAIN LIVES TO SERVE ONLY YOU! + +```javascript +var cc = require('config-chain') + +// all the stuff you did before +var config = cc({ + some: 'object' + }, + cc.find('config.json'), + cc.env('myApp_') + ) + // CONFIGS AS A SERVICE, aka "CaaS", aka EVERY DEVOPS DREAM OMG! + .addUrl('http://configurator:1234/my-configs') + // ASYNC FTW! + .addFile('/path/to/file.json') + + // OBJECTS ARE OK TOO, they're SYNC but they still ORDER RIGHT + // BECAUSE PROMISES ARE USED BUT NO, NOT *THOSE* PROMISES, JUST + // ACTUAL PROMISES LIKE YOU MAKE TO YOUR MOM, KEPT OUT OF LOVE + .add({ another: 'object' }) + + // DIE A THOUSAND DEATHS IF THIS EVER HAPPENS!! + .on('error', function (er) { + // IF ONLY THERE WAS SOMETHIGN HARDER THAN THROW + // MY SORROW COULD BE ADEQUATELY EXPRESSED. /o\ + throw er + }) + + // THROW A PARTY IN YOUR FACE WHEN ITS ALL LOADED!! + .on('load', function (config) { + console.awesome('HOLY SHIT!') + }) +``` + +# BORING API DOCS + +## cc(...args) + +MAKE A CHAIN AND ADD ALL THE ARGS. + +If the arg is a STRING, then it shall be a JSON FILENAME. + +SYNC I/O! + +RETURN THE CHAIN! + +## cc.json(...args) + +Join the args INTO A JSON FILENAME! + +SYNC I/O! + +## cc.find(relativePath) + +SEEK the RELATIVE PATH by climbing the TREE OF DIRECTORIES. + +RETURN THE FOUND PATH! + +SYNC I/O! + +## cc.parse(content, file, type) + +Parse the content string, and guess the type from either the +specified type or the filename. + +RETURN THE RESULTING OBJECT! + +NO I/O! + +## cc.env(prefix, env=process.env) + +Get all the keys on the provided env object (or process.env) which are +prefixed by the specified prefix, and put the values on a new object. + +RETURN THE RESULTING OBJECT! + +NO I/O! + +## cc.ConfigChain() + +The ConfigChain class for CRAY CRAY JQUERY STYLE METHOD CHAINING! + +One of these is returned by the main exported function, as well. + +It inherits (prototypically) from +[ProtoList](https://github.com/isaacs/proto-list/), and also inherits +(parasitically) from +[EventEmitter](http://nodejs.org/api/events.html#events_class_events_eventemitter) + +It has all the methods from both, and except where noted, they are +unchanged. + +### LET IT BE KNOWN THAT chain IS AN INSTANCE OF ConfigChain. + +## chain.sources + +A list of all the places where it got stuff. The keys are the names +passed to addFile or addUrl etc, and the value is an object with some +info about the data source. + +## chain.addFile(filename, type, [name=filename]) + +Filename is the name of the file. Name is an arbitrary string to be +used later if you desire. Type is either 'ini' or 'json', and will +try to guess intelligently if omitted. + +Loaded files can be saved later. + +## chain.addUrl(url, type, [name=url]) + +Same as the filename thing, but with a url. + +Can't be saved later. + +## chain.addEnv(prefix, env, [name='env']) + +Add all the keys from the env object that start with the prefix. + +## chain.addString(data, file, type, [name]) + +Parse the string and add it to the set. (Mainly used internally.) + +## chain.add(object, [name]) + +Add the object to the set. + +## chain.root {Object} + +The root from which all the other config objects in the set descend +prototypically. + +Put your defaults here. + +## chain.set(key, value, name) + +Set the key to the value on the named config object. If name is +unset, then set it on the first config object in the set. (That is, +the one with the highest priority, which was added first.) + +## chain.get(key, [name]) + +Get the key from the named config object explicitly, or from the +resolved configs if not specified. + +## chain.save(name, type) + +Write the named config object back to its origin. + +Currently only supported for env and file config types. + +For files, encode the data according to the type. + +## chain.on('save', function () {}) + +When one or more files are saved, emits `save` event when they're all +saved. + +## chain.on('load', function (chain) {}) + +When the config chain has loaded all the specified files and urls and +such, the 'load' event fires. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/test/broken.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/test/broken.js new file mode 100644 index 00000000..101a3e4f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/test/broken.js @@ -0,0 +1,10 @@ + + +var cc = require('..') +var assert = require('assert') + + +//throw on invalid json +assert.throws(function () { + cc(__dirname + '/broken.json') +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/test/broken.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/test/broken.json new file mode 100644 index 00000000..2107ac18 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/test/broken.json @@ -0,0 +1,21 @@ +{ + "name": "config-chain", + "version": "0.3.0", + "description": "HANDLE CONFIGURATION ONCE AND FOR ALL", + "homepage": "http://github.com/dominictarr/config-chain", + "repository": { + "type": "git", + "url": "https://github.com/dominictarr/config-chain.git" + } + //missing , and then this comment. this json is intensionally invalid + "dependencies": { + "proto-list": "1", + "ini": "~1.0.2" + }, + "bundleDependencies": ["ini"], + "REM": "REMEMBER TO REMOVE BUNDLING WHEN/IF ISAACS MERGES ini#7", + "author": "Dominic Tarr (http://dominictarr.com)", + "scripts": { + "test": "node test/find-file.js && node test/ini.js && node test/env.js" + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/test/chain-class.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/test/chain-class.js new file mode 100644 index 00000000..bbc0d4cb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/test/chain-class.js @@ -0,0 +1,100 @@ +var test = require('tap').test +var CC = require('../index.js').ConfigChain + +var env = { foo_blaz : 'blzaa', foo_env : 'myenv' } +var jsonObj = { blaz: 'json', json: true } +var iniObj = { 'x.y.z': 'xyz', blaz: 'ini' } + +var fs = require('fs') +var ini = require('ini') + +fs.writeFileSync('/tmp/config-chain-class.json', JSON.stringify(jsonObj)) +fs.writeFileSync('/tmp/config-chain-class.ini', ini.stringify(iniObj)) + +var http = require('http') +var reqs = 0 +http.createServer(function (q, s) { + if (++reqs === 2) this.close() + if (q.url === '/json') { + // make sure that the requests come back from the server + // out of order. they should still be ordered properly + // in the resulting config object set. + setTimeout(function () { + s.setHeader('content-type', 'application/json') + s.end(JSON.stringify({ + blaz: 'http', + http: true, + json: true + })) + }, 200) + } else { + s.setHeader('content-type', 'application/ini') + s.end(ini.stringify({ + blaz: 'http', + http: true, + ini: true, + json: false + })) + } +}).listen(1337) + +test('basic class test', function (t) { + var cc = new CC() + var expectlist = + [ { blaz: 'json', json: true }, + { 'x.y.z': 'xyz', blaz: 'ini' }, + { blaz: 'blzaa', env: 'myenv' }, + { blaz: 'http', http: true, json: true }, + { blaz: 'http', http: true, ini: true, json: false } ] + + cc.addFile('/tmp/config-chain-class.json') + .addFile('/tmp/config-chain-class.ini') + .addEnv('foo_', env) + .addUrl('http://localhost:1337/json') + .addUrl('http://localhost:1337/ini') + .on('load', function () { + t.same(cc.list, expectlist) + t.same(cc.snapshot, { blaz: 'json', + json: true, + 'x.y.z': 'xyz', + env: 'myenv', + http: true, + ini: true }) + + cc.del('blaz', '/tmp/config-chain-class.json') + t.same(cc.snapshot, { blaz: 'ini', + json: true, + 'x.y.z': 'xyz', + env: 'myenv', + http: true, + ini: true }) + cc.del('blaz') + t.same(cc.snapshot, { json: true, + 'x.y.z': 'xyz', + env: 'myenv', + http: true, + ini: true }) + cc.shift() + t.same(cc.snapshot, { 'x.y.z': 'xyz', + env: 'myenv', + http: true, + json: true, + ini: true }) + cc.shift() + t.same(cc.snapshot, { env: 'myenv', + http: true, + json: true, + ini: true }) + cc.shift() + t.same(cc.snapshot, { http: true, + json: true, + ini: true }) + cc.shift() + t.same(cc.snapshot, { http: true, + ini: true, + json: false }) + cc.shift() + t.same(cc.snapshot, {}) + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/test/env.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/test/env.js new file mode 100644 index 00000000..fb718f32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/test/env.js @@ -0,0 +1,10 @@ +var cc = require('..') +var assert = require('assert') + +assert.deepEqual({ + hello: true +}, cc.env('test_', { + 'test_hello': true, + 'ignore_this': 4, + 'ignore_test_this_too': [] +})) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/test/find-file.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/test/find-file.js new file mode 100644 index 00000000..23cde52e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/test/find-file.js @@ -0,0 +1,13 @@ + +var fs = require('fs') + , assert = require('assert') + , objx = { + rand: Math.random() + } + +fs.writeFileSync('/tmp/random-test-config.json', JSON.stringify(objx)) + +var cc = require('../') +var path = cc.find('tmp/random-test-config.json') + +assert.equal(path, '/tmp/random-test-config.json') \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/test/get.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/test/get.js new file mode 100644 index 00000000..d6fd79f7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/test/get.js @@ -0,0 +1,15 @@ +var cc = require("../"); + +var chain = cc() + , name = "forFun"; + +chain + .add({ + __sample:"for fun only" + }, name) + .on("load", function() { + //It throw exception here + console.log(chain.get("__sample", name)); + //But if I drop the name param, it run normally and return as expected: "for fun only" + //console.log(chain.get("__sample")); + }); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/test/ignore-unfound-file.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/test/ignore-unfound-file.js new file mode 100644 index 00000000..d742b82b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/test/ignore-unfound-file.js @@ -0,0 +1,5 @@ + +var cc = require('..') + +//should not throw +cc(__dirname, 'non_existing_file') diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/test/ini.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/test/ini.js new file mode 100644 index 00000000..5572a6ed --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/test/ini.js @@ -0,0 +1,18 @@ + + +var cc =require('..') +var INI = require('ini') +var assert = require('assert') + +function test(obj) { + + var _json, _ini + var json = cc.parse (_json = JSON.stringify(obj)) + var ini = cc.parse (_ini = INI.stringify(obj)) +console.log(_ini, _json) + assert.deepEqual(json, ini) +} + + +test({hello: true}) + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/test/save.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/test/save.js new file mode 100644 index 00000000..bc97bbd3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/config-chain/test/save.js @@ -0,0 +1,59 @@ +var CC = require('../index.js').ConfigChain +var test = require('tap').test + +var f1 = '/tmp/f1.ini' +var f2 = '/tmp/f2.json' + +var ini = require('ini') + +var f1data = {foo: {bar: 'baz'}, bloo: 'jaus'} +var f2data = {oof: {rab: 'zab'}, oolb: 'suaj'} + +var fs = require('fs') + +fs.writeFileSync(f1, ini.stringify(f1data), 'utf8') +fs.writeFileSync(f2, JSON.stringify(f2data), 'utf8') + +test('test saving and loading ini files', function (t) { + new CC() + .add({grelb:'blerg'}, 'opt') + .addFile(f1, 'ini', 'inifile') + .addFile(f2, 'json', 'jsonfile') + .on('load', function (cc) { + + t.same(cc.snapshot, { grelb: 'blerg', + bloo: 'jaus', + foo: { bar: 'baz' }, + oof: { rab: 'zab' }, + oolb: 'suaj' }) + + t.same(cc.list, [ { grelb: 'blerg' }, + { bloo: 'jaus', foo: { bar: 'baz' } }, + { oof: { rab: 'zab' }, oolb: 'suaj' } ]) + + cc.set('grelb', 'brelg', 'opt') + .set('foo', 'zoo', 'inifile') + .set('oof', 'ooz', 'jsonfile') + .save('inifile') + .save('jsonfile') + .on('save', function () { + t.equal(fs.readFileSync(f1, 'utf8'), + "bloo=jaus\nfoo=zoo\n") + t.equal(fs.readFileSync(f2, 'utf8'), + "{\"oof\":\"ooz\",\"oolb\":\"suaj\"}") + + t.same(cc.snapshot, { grelb: 'brelg', + bloo: 'jaus', + foo: 'zoo', + oof: 'ooz', + oolb: 'suaj' }) + + t.same(cc.list, [ { grelb: 'brelg' }, + { bloo: 'jaus', foo: 'zoo' }, + { oof: 'ooz', oolb: 'suaj' } ]) + + t.pass('ok') + t.end() + }) + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/dezalgo/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/dezalgo/.travis.yml new file mode 100644 index 00000000..e1bcee1a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/dezalgo/.travis.yml @@ -0,0 +1,7 @@ +language: node_js +before_script: npm install -g npm@latest +node_js: + - '0.8' + - '0.10' + - '0.12' + - 'iojs' diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/dezalgo/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/dezalgo/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/dezalgo/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/dezalgo/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/dezalgo/README.md new file mode 100644 index 00000000..bdfc8ba8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/dezalgo/README.md @@ -0,0 +1,29 @@ +# dezalgo + +Contain async insanity so that the dark pony lord doesn't eat souls + +See [this blog +post](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony). + +## USAGE + +Pass a callback to `dezalgo` and it will ensure that it is *always* +called in a future tick, and never in this tick. + +```javascript +var dz = require('dezalgo') + +var cache = {} +function maybeSync(arg, cb) { + cb = dz(cb) + + // this will actually defer to nextTick + if (cache[arg]) cb(null, cache[arg]) + + fs.readFile(arg, function (er, data) { + // since this is *already* defered, it will call immediately + if (er) cb(er) + cb(null, cache[arg] = data) + }) +} +``` diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/dezalgo/dezalgo.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/dezalgo/dezalgo.js new file mode 100644 index 00000000..04fd3ba7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/dezalgo/dezalgo.js @@ -0,0 +1,22 @@ +var wrappy = require('wrappy') +module.exports = wrappy(dezalgo) + +var asap = require('asap') + +function dezalgo (cb) { + var sync = true + asap(function () { + sync = false + }) + + return function zalgoSafe() { + var args = arguments + var me = this + if (sync) + asap(function() { + cb.apply(me, args) + }) + else + cb.apply(me, args) + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/dezalgo/node_modules/asap/CHANGES.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/dezalgo/node_modules/asap/CHANGES.md new file mode 100644 index 00000000..8e620230 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/dezalgo/node_modules/asap/CHANGES.md @@ -0,0 +1,63 @@ + +## 2.0.3 + +Version 2.0.3 fixes a bug when adjusting the capacity of the task queue. + +## 2.0.1-2.02 + +Version 2.0.1 fixes a bug in the way redirects were expressed that affected the +function of Browserify, but which Mr would tolerate. + +## 2.0.0 + +Version 2 of ASAP is a full rewrite with a few salient changes. +First, the ASAP source is CommonJS only and designed with [Browserify][] and +[Browserify-compatible][Mr] module loaders in mind. + +[Browserify]: https://github.com/substack/node-browserify +[Mr]: https://github.com/montagejs/mr + +The new version has been refactored in two dimensions. +Support for Node.js and browsers have been separated, using Browserify +redirects and ASAP has been divided into two modules. +The "raw" layer depends on the tasks to catch thrown exceptions and unravel +Node.js domains. + +The full implementation of ASAP is loadable as `require("asap")` in both Node.js +and browsers. + +The raw layer that lacks exception handling overhead is loadable as +`require("asap/raw")`. +The interface is the same for both layers. + +Tasks are no longer required to be functions, but can rather be any object that +implements `task.call()`. +With this feature you can recycle task objects to avoid garbage collector churn +and avoid closures in general. + +The implementation has been rigorously documented so that our successors can +understand the scope of the problem that this module solves and all of its +nuances, ensuring that the next generation of implementations know what details +are essential. + +- [asap.js](https://github.com/kriskowal/asap/blob/master/asap.js) +- [raw.js](https://github.com/kriskowal/asap/blob/master/raw.js) +- [browser-asap.js](https://github.com/kriskowal/asap/blob/master/browser-asap.js) +- [browser-raw.js](https://github.com/kriskowal/asap/blob/master/browser-raw.js) + +The new version has also been rigorously tested across a broad spectrum of +browsers, in both the window and worker context. +The following charts capture the browser test results for the most recent +release. +The first chart shows test results for ASAP running in the main window context. +The second chart shows test results for ASAP running in a web worker context. +Test results are inconclusive (grey) on browsers that do not support web +workers. +These data are captured automatically by [Continuous +Integration][]. + +![Browser Compatibility](http://kriskowal-asap.s3-website-us-west-2.amazonaws.com/train/integration-2/saucelabs-results-matrix.svg) + +![Compatibility in Web Workers](http://kriskowal-asap.s3-website-us-west-2.amazonaws.com/train/integration-2/saucelabs-worker-results-matrix.svg) + +[Continuous Integration]: https://github.com/kriskowal/asap/blob/master/CONTRIBUTING.md diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/dezalgo/node_modules/asap/LICENSE.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/dezalgo/node_modules/asap/LICENSE.md new file mode 100644 index 00000000..ba18c613 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/dezalgo/node_modules/asap/LICENSE.md @@ -0,0 +1,21 @@ + +Copyright 2009–2014 Contributors. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/dezalgo/node_modules/asap/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/dezalgo/node_modules/asap/README.md new file mode 100644 index 00000000..452fd8c2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/dezalgo/node_modules/asap/README.md @@ -0,0 +1,237 @@ +# ASAP + +[![Build Status](https://travis-ci.org/kriskowal/asap.png?branch=master)](https://travis-ci.org/kriskowal/asap) + +Promise and asynchronous observer libraries, as well as hand-rolled callback +programs and libraries, often need a mechanism to postpone the execution of a +callback until the next available event. +(See [Designing API’s for Asynchrony][Zalgo].) +The `asap` function executes a task **as soon as possible** but not before it +returns, waiting only for the completion of the current event and previously +scheduled tasks. + +```javascript +asap(function () { + // ... +}); +``` + +[Zalgo]: http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony + +This CommonJS package provides an `asap` module that exports a function that +executes a task function *as soon as possible*. + +ASAP strives to schedule events to occur before yielding for IO, reflow, +or redrawing. +Each event receives an independent stack, with only platform code in parent +frames and the events run in the order they are scheduled. + +ASAP provides a fast event queue that will execute tasks until it is +empty before yielding to the JavaScript engine's underlying event-loop. +When a task gets added to a previously empty event queue, ASAP schedules a flush +event, preferring for that event to occur before the JavaScript engine has an +opportunity to perform IO tasks or rendering, thus making the first task and +subsequent tasks semantically indistinguishable. +ASAP uses a variety of techniques to preserve this invariant on different +versions of browsers and Node.js. + +By design, ASAP prevents input events from being handled until the task +queue is empty. +If the process is busy enough, this may cause incoming connection requests to be +dropped, and may cause existing connections to inform the sender to reduce the +transmission rate or stall. +ASAP allows this on the theory that, if there is enough work to do, there is no +sense in looking for trouble. +As a consequence, ASAP can interfere with smooth animation. +If your task should be tied to the rendering loop, consider using +`requestAnimationFrame` instead. +A long sequence of tasks can also effect the long running script dialog. +If this is a problem, you may be able to use ASAP’s cousin `setImmediate` to +break long processes into shorter intervals and periodically allow the browser +to breathe. +`setImmediate` will yield for IO, reflow, and repaint events. +It also returns a handler and can be canceled. +For a `setImmediate` shim, consider [YuzuJS setImmediate][setImmediate]. + +[setImmediate]: https://github.com/YuzuJS/setImmediate + +Take care. +ASAP can sustain infinite recursive calls without warning. +It will not halt from a stack overflow, and it will not consume unbounded +memory. +This is behaviorally equivalent to an infinite loop. +Just as with infinite loops, you can monitor a Node.js process for this behavior +with a heart-beat signal. +As with infinite loops, a very small amount of caution goes a long way to +avoiding problems. + +```javascript +function loop() { + asap(loop); +} +loop(); +``` + +In browsers, if a task throws an exception, it will not interrupt the flushing +of high-priority tasks. +The exception will be postponed to a later, low-priority event to avoid +slow-downs. +In Node.js, if a task throws an exception, ASAP will resume flushing only if—and +only after—the error is handled by `domain.on("error")` or +`process.on("uncaughtException")`. + +## Raw ASAP + +Checking for exceptions comes at a cost. +The package also provides an `asap/raw` module that exports the underlying +implementation which is faster but stalls if a task throws an exception. +This internal version of the ASAP function does not check for errors. +If a task does throw an error, it will stall the event queue unless you manually +call `rawAsap.requestFlush()` before throwing the error, or any time after. + +In Node.js, `asap/raw` also runs all tasks outside any domain. +If you need a task to be bound to your domain, you will have to do it manually. + +```js +if (process.domain) { + task = process.domain.bind(task); +} +rawAsap(task); +``` + +## Tasks + +A task may be any object that implements `call()`. +A function will suffice, but closures tend not to be reusable and can cause +garbage collector churn. +Both `asap` and `rawAsap` accept task objects to give you the option of +recycling task objects or using higher callable object abstractions. +See the `asap` source for an illustration. + + +## Compatibility + +ASAP is tested on Node.js v0.10 and in a broad spectrum of web browsers. +The following charts capture the browser test results for the most recent +release. +The first chart shows test results for ASAP running in the main window context. +The second chart shows test results for ASAP running in a web worker context. +Test results are inconclusive (grey) on browsers that do not support web +workers. +These data are captured automatically by [Continuous +Integration][]. + +[Continuous Integration]: https://github.com/kriskowal/asap/blob/master/CONTRIBUTING.md + +![Browser Compatibility](http://kriskowal-asap.s3-website-us-west-2.amazonaws.com/train/integration-2/saucelabs-results-matrix.svg) + +![Compatibility in Web Workers](http://kriskowal-asap.s3-website-us-west-2.amazonaws.com/train/integration-2/saucelabs-worker-results-matrix.svg) + +## Caveats + +When a task is added to an empty event queue, it is not always possible to +guarantee that the task queue will begin flushing immediately after the current +event. +However, once the task queue begins flushing, it will not yield until the queue +is empty, even if the queue grows while executing tasks. + +The following browsers allow the use of [DOM mutation observers][] to access +the HTML [microtask queue][], and thus begin flushing ASAP's task queue +immediately at the end of the current event loop turn, before any rendering or +IO: + +[microtask queue]: http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#microtask-queue +[DOM mutation observers]: http://dom.spec.whatwg.org/#mutation-observers + +- Android 4–4.3 +- Chrome 26–34 +- Firefox 14–29 +- Internet Explorer 11 +- iPad Safari 6–7.1 +- iPhone Safari 7–7.1 +- Safari 6–7 + +In the absense of mutation observers, there are a few browsers, and situations +like web workers in some of the above browsers, where [message channels][] +would be a useful way to avoid falling back to timers. +Message channels give direct access to the HTML [task queue][], so the ASAP +task queue would flush after any already queued rendering and IO tasks, but +without having the minimum delay imposed by timers. +However, among these browsers, Internet Explorer 10 and Safari do not reliably +dispatch messages, so they are not worth the trouble to implement. + +[message channels]: http://www.whatwg.org/specs/web-apps/current-work/multipage/web-messaging.html#message-channels +[task queue]: http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#concept-task + +- Internet Explorer 10 +- Safair 5.0-1 +- Opera 11-12 + +In the absense of mutation observers, these browsers and the following browsers +all fall back to using `setTimeout` and `setInterval` to ensure that a `flush` +occurs. +The implementation uses both and cancels whatever handler loses the race, since +`setTimeout` tends to occasionally skip tasks in unisolated circumstances. +Timers generally delay the flushing of ASAP's task queue for four milliseconds. + +- Firefox 3–13 +- Internet Explorer 6–10 +- iPad Safari 4.3 +- Lynx 2.8.7 + + +## Heritage + +ASAP has been factored out of the [Q][] asynchronous promise library. +It originally had a naïve implementation in terms of `setTimeout`, but +[Malte Ubl][NonBlocking] provided an insight that `postMessage` might be +useful for creating a high-priority, no-delay event dispatch hack. +Since then, Internet Explorer proposed and implemented `setImmediate`. +Robert Katić began contributing to Q by measuring the performance of +the internal implementation of `asap`, paying particular attention to +error recovery. +Domenic, Robert, and Kris Kowal collectively settled on the current strategy of +unrolling the high-priority event queue internally regardless of what strategy +we used to dispatch the potentially lower-priority flush event. +Domenic went on to make ASAP cooperate with Node.js domains. + +[Q]: https://github.com/kriskowal/q +[NonBlocking]: http://www.nonblocking.io/2011/06/windownexttick.html + +For further reading, Nicholas Zakas provided a thorough article on [The +Case for setImmediate][NCZ]. + +[NCZ]: http://www.nczonline.net/blog/2013/07/09/the-case-for-setimmediate/ + +Ember’s RSVP promise implementation later [adopted][RSVP ASAP] the name ASAP but +further developed the implentation. +Particularly, The `MessagePort` implementation was abandoned due to interaction +[problems with Mobile Internet Explorer][IE Problems] in favor of an +implementation backed on the newer and more reliable DOM `MutationObserver` +interface. +These changes were back-ported into this library. + +[IE Problems]: https://github.com/cujojs/when/issues/197 +[RSVP ASAP]: https://github.com/tildeio/rsvp.js/blob/cddf7232546a9cf858524b75cde6f9edf72620a7/lib/rsvp/asap.js + +In addition, ASAP factored into `asap` and `asap/raw`, such that `asap` remained +exception-safe, but `asap/raw` provided a tight kernel that could be used for +tasks that guaranteed that they would not throw exceptions. +This core is useful for promise implementations that capture thrown errors in +rejected promises and do not need a second safety net. +At the same time, the exception handling in `asap` was factored into separate +implementations for Node.js and browsers, using the the [Browserify][Browser +Config] `browser` property in `package.json` to instruct browser module loaders +and bundlers, including [Browserify][], [Mr][], and [Mop][], to use the +browser-only implementation. + +[Browser Config]: https://gist.github.com/defunctzombie/4339901 +[Browserify]: https://github.com/substack/node-browserify +[Mr]: https://github.com/montagejs/mr +[Mop]: https://github.com/montagejs/mop + +## License + +Copyright 2009-2014 by Contributors +MIT License (enclosed) + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/dezalgo/node_modules/asap/asap.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/dezalgo/node_modules/asap/asap.js new file mode 100644 index 00000000..f04fcd58 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/dezalgo/node_modules/asap/asap.js @@ -0,0 +1,65 @@ +"use strict"; + +var rawAsap = require("./raw"); +var freeTasks = []; + +/** + * Calls a task as soon as possible after returning, in its own event, with + * priority over IO events. An exception thrown in a task can be handled by + * `process.on("uncaughtException") or `domain.on("error")`, but will otherwise + * crash the process. If the error is handled, all subsequent tasks will + * resume. + * + * @param {{call}} task A callable object, typically a function that takes no + * arguments. + */ +module.exports = asap; +function asap(task) { + var rawTask; + if (freeTasks.length) { + rawTask = freeTasks.pop(); + } else { + rawTask = new RawTask(); + } + rawTask.task = task; + rawTask.domain = process.domain; + rawAsap(rawTask); +} + +function RawTask() { + this.task = null; + this.domain = null; +} + +RawTask.prototype.call = function () { + if (this.domain) { + this.domain.enter(); + } + var threw = true; + try { + this.task.call(); + threw = false; + // If the task throws an exception (presumably) Node.js restores the + // domain stack for the next event. + if (this.domain) { + this.domain.exit(); + } + } finally { + // We use try/finally and a threw flag to avoid messing up stack traces + // when we catch and release errors. + if (threw) { + // In Node.js, uncaught exceptions are considered fatal errors. + // Re-throw them to interrupt flushing! + // Ensure that flushing continues if an uncaught exception is + // suppressed listening process.on("uncaughtException") or + // domain.on("error"). + rawAsap.requestFlush(); + } + // If the task threw an error, we do not want to exit the domain here. + // Exiting the domain would prevent the domain from catching the error. + this.task = null; + this.domain = null; + freeTasks.push(this); + } +}; + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/dezalgo/node_modules/asap/browser-asap.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/dezalgo/node_modules/asap/browser-asap.js new file mode 100644 index 00000000..805c9824 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/dezalgo/node_modules/asap/browser-asap.js @@ -0,0 +1,66 @@ +"use strict"; + +// rawAsap provides everything we need except exception management. +var rawAsap = require("./raw"); +// RawTasks are recycled to reduce GC churn. +var freeTasks = []; +// We queue errors to ensure they are thrown in right order (FIFO). +// Array-as-queue is good enough here, since we are just dealing with exceptions. +var pendingErrors = []; +var requestErrorThrow = rawAsap.makeRequestCallFromTimer(throwFirstError); + +function throwFirstError() { + if (pendingErrors.length) { + throw pendingErrors.shift(); + } +} + +/** + * Calls a task as soon as possible after returning, in its own event, with priority + * over other events like animation, reflow, and repaint. An error thrown from an + * event will not interrupt, nor even substantially slow down the processing of + * other events, but will be rather postponed to a lower priority event. + * @param {{call}} task A callable object, typically a function that takes no + * arguments. + */ +module.exports = asap; +function asap(task) { + var rawTask; + if (freeTasks.length) { + rawTask = freeTasks.pop(); + } else { + rawTask = new RawTask(); + } + rawTask.task = task; + rawAsap(rawTask); +} + +// We wrap tasks with recyclable task objects. A task object implements +// `call`, just like a function. +function RawTask() { + this.task = null; +} + +// The sole purpose of wrapping the task is to catch the exception and recycle +// the task object after its single use. +RawTask.prototype.call = function () { + try { + this.task.call(); + } catch (error) { + if (asap.onerror) { + // This hook exists purely for testing purposes. + // Its name will be periodically randomized to break any code that + // depends on its existence. + asap.onerror(error); + } else { + // In a web browser, exceptions are not fatal. However, to avoid + // slowing down the queue of pending tasks, we rethrow the error in a + // lower priority turn. + pendingErrors.push(error); + requestErrorThrow(); + } + } finally { + this.task = null; + freeTasks[freeTasks.length] = this; + } +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/dezalgo/node_modules/asap/browser-raw.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/dezalgo/node_modules/asap/browser-raw.js new file mode 100644 index 00000000..1cfd7729 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/dezalgo/node_modules/asap/browser-raw.js @@ -0,0 +1,220 @@ +"use strict"; + +// Use the fastest means possible to execute a task in its own turn, with +// priority over other events including IO, animation, reflow, and redraw +// events in browsers. +// +// An exception thrown by a task will permanently interrupt the processing of +// subsequent tasks. The higher level `asap` function ensures that if an +// exception is thrown by a task, that the task queue will continue flushing as +// soon as possible, but if you use `rawAsap` directly, you are responsible to +// either ensure that no exceptions are thrown from your task, or to manually +// call `rawAsap.requestFlush` if an exception is thrown. +module.exports = rawAsap; +function rawAsap(task) { + if (!queue.length) { + requestFlush(); + flushing = true; + } + // Equivalent to push, but avoids a function call. + queue[queue.length] = task; +} + +var queue = []; +// Once a flush has been requested, no further calls to `requestFlush` are +// necessary until the next `flush` completes. +var flushing = false; +// `requestFlush` is an implementation-specific method that attempts to kick +// off a `flush` event as quickly as possible. `flush` will attempt to exhaust +// the event queue before yielding to the browser's own event loop. +var requestFlush; +// The position of the next task to execute in the task queue. This is +// preserved between calls to `flush` so that it can be resumed if +// a task throws an exception. +var index = 0; +// If a task schedules additional tasks recursively, the task queue can grow +// unbounded. To prevent memory exhaustion, the task queue will periodically +// truncate already-completed tasks. +var capacity = 1024; + +// The flush function processes all tasks that have been scheduled with +// `rawAsap` unless and until one of those tasks throws an exception. +// If a task throws an exception, `flush` ensures that its state will remain +// consistent and will resume where it left off when called again. +// However, `flush` does not make any arrangements to be called again if an +// exception is thrown. +function flush() { + while (index < queue.length) { + var currentIndex = index; + // Advance the index before calling the task. This ensures that we will + // begin flushing on the next task the task throws an error. + index = index + 1; + queue[currentIndex].call(); + // Prevent leaking memory for long chains of recursive calls to `asap`. + // If we call `asap` within tasks scheduled by `asap`, the queue will + // grow, but to avoid an O(n) walk for every task we execute, we don't + // shift tasks off the queue after they have been executed. + // Instead, we periodically shift 1024 tasks off the queue. + if (index > capacity) { + // Manually shift all values starting at the index back to the + // beginning of the queue. + for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) { + queue[scan] = queue[scan + index]; + } + queue.length -= index; + index = 0; + } + } + queue.length = 0; + index = 0; + flushing = false; +} + +// `requestFlush` is implemented using a strategy based on data collected from +// every available SauceLabs Selenium web driver worker at time of writing. +// https://docs.google.com/spreadsheets/d/1mG-5UYGup5qxGdEMWkhP6BWCz053NUb2E1QoUTU16uA/edit#gid=783724593 + +// Safari 6 and 6.1 for desktop, iPad, and iPhone are the only browsers that +// have WebKitMutationObserver but not un-prefixed MutationObserver. +// Must use `global` instead of `window` to work in both frames and web +// workers. `global` is a provision of Browserify, Mr, Mrs, or Mop. +var BrowserMutationObserver = global.MutationObserver || global.WebKitMutationObserver; + +// MutationObservers are desirable because they have high priority and work +// reliably everywhere they are implemented. +// They are implemented in all modern browsers. +// +// - Android 4-4.3 +// - Chrome 26-34 +// - Firefox 14-29 +// - Internet Explorer 11 +// - iPad Safari 6-7.1 +// - iPhone Safari 7-7.1 +// - Safari 6-7 +if (typeof BrowserMutationObserver === "function") { + requestFlush = makeRequestCallFromMutationObserver(flush); + +// MessageChannels are desirable because they give direct access to the HTML +// task queue, are implemented in Internet Explorer 10, Safari 5.0-1, and Opera +// 11-12, and in web workers in many engines. +// Although message channels yield to any queued rendering and IO tasks, they +// would be better than imposing the 4ms delay of timers. +// However, they do not work reliably in Internet Explorer or Safari. + +// Internet Explorer 10 is the only browser that has setImmediate but does +// not have MutationObservers. +// Although setImmediate yields to the browser's renderer, it would be +// preferrable to falling back to setTimeout since it does not have +// the minimum 4ms penalty. +// Unfortunately there appears to be a bug in Internet Explorer 10 Mobile (and +// Desktop to a lesser extent) that renders both setImmediate and +// MessageChannel useless for the purposes of ASAP. +// https://github.com/kriskowal/q/issues/396 + +// Timers are implemented universally. +// We fall back to timers in workers in most engines, and in foreground +// contexts in the following browsers. +// However, note that even this simple case requires nuances to operate in a +// broad spectrum of browsers. +// +// - Firefox 3-13 +// - Internet Explorer 6-9 +// - iPad Safari 4.3 +// - Lynx 2.8.7 +} else { + requestFlush = makeRequestCallFromTimer(flush); +} + +// `requestFlush` requests that the high priority event queue be flushed as +// soon as possible. +// This is useful to prevent an error thrown in a task from stalling the event +// queue if the exception handled by Node.js’s +// `process.on("uncaughtException")` or by a domain. +rawAsap.requestFlush = requestFlush; + +// To request a high priority event, we induce a mutation observer by toggling +// the text of a text node between "1" and "-1". +function makeRequestCallFromMutationObserver(callback) { + var toggle = 1; + var observer = new BrowserMutationObserver(callback); + var node = document.createTextNode(""); + observer.observe(node, {characterData: true}); + return function requestCall() { + toggle = -toggle; + node.data = toggle; + }; +} + +// The message channel technique was discovered by Malte Ubl and was the +// original foundation for this library. +// http://www.nonblocking.io/2011/06/windownexttick.html + +// Safari 6.0.5 (at least) intermittently fails to create message ports on a +// page's first load. Thankfully, this version of Safari supports +// MutationObservers, so we don't need to fall back in that case. + +// function makeRequestCallFromMessageChannel(callback) { +// var channel = new MessageChannel(); +// channel.port1.onmessage = callback; +// return function requestCall() { +// channel.port2.postMessage(0); +// }; +// } + +// For reasons explained above, we are also unable to use `setImmediate` +// under any circumstances. +// Even if we were, there is another bug in Internet Explorer 10. +// It is not sufficient to assign `setImmediate` to `requestFlush` because +// `setImmediate` must be called *by name* and therefore must be wrapped in a +// closure. +// Never forget. + +// function makeRequestCallFromSetImmediate(callback) { +// return function requestCall() { +// setImmediate(callback); +// }; +// } + +// Safari 6.0 has a problem where timers will get lost while the user is +// scrolling. This problem does not impact ASAP because Safari 6.0 supports +// mutation observers, so that implementation is used instead. +// However, if we ever elect to use timers in Safari, the prevalent work-around +// is to add a scroll event listener that calls for a flush. + +// `setTimeout` does not call the passed callback if the delay is less than +// approximately 7 in web workers in Firefox 8 through 18, and sometimes not +// even then. + +function makeRequestCallFromTimer(callback) { + return function requestCall() { + // We dispatch a timeout with a specified delay of 0 for engines that + // can reliably accommodate that request. This will usually be snapped + // to a 4 milisecond delay, but once we're flushing, there's no delay + // between events. + var timeoutHandle = setTimeout(handleTimer, 0); + // However, since this timer gets frequently dropped in Firefox + // workers, we enlist an interval handle that will try to fire + // an event 20 times per second until it succeeds. + var intervalHandle = setInterval(handleTimer, 50); + + function handleTimer() { + // Whichever timer succeeds will cancel both timers and + // execute the callback. + clearTimeout(timeoutHandle); + clearInterval(intervalHandle); + callback(); + } + }; +} + +// This is for `asap.js` only. +// Its name will be periodically randomized to break any code that depends on +// its existence. +rawAsap.makeRequestCallFromTimer = makeRequestCallFromTimer; + +// ASAP was originally a nextTick shim included in Q. This was factored out +// into this ASAP package. It was later adapted to RSVP which made further +// amendments. These decisions, particularly to marginalize MessageChannel and +// to capture the MutationObserver implementation in a closure, were integrated +// back into ASAP proper. +// https://github.com/tildeio/rsvp.js/blob/cddf7232546a9cf858524b75cde6f9edf72620a7/lib/rsvp/asap.js diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/dezalgo/node_modules/asap/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/dezalgo/node_modules/asap/package.json new file mode 100644 index 00000000..e01b3f06 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/dezalgo/node_modules/asap/package.json @@ -0,0 +1,85 @@ +{ + "name": "asap", + "version": "2.0.3", + "description": "High-priority task queue for Node.js and browsers", + "keywords": [ + "event", + "task", + "queue" + ], + "license": { + "type": "MIT", + "url": "https://github.com/kriskowal/asap/raw/master/LICENSE.md" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/kriskowal/asap.git" + }, + "main": "./asap.js", + "browser": { + "./asap.js": "./browser-asap.js", + "./raw.js": "./browser-raw.js", + "./test/domain.js": "./test/browser-domain.js" + }, + "files": [ + "raw.js", + "asap.js", + "browser-raw.js", + "browser-asap.js" + ], + "scripts": { + "test": "npm run lint && npm run test-node", + "test-travis": "npm run lint && npm run test-node && npm run test-saucelabs && npm run test-saucelabs-worker", + "test-node": "node test/asap-test.js", + "test-publish": "node scripts/publish-bundle.js test/asap-test.js | pbcopy", + "test-browser": "node scripts/publish-bundle.js test/asap-test.js | xargs opener", + "test-saucelabs": "node scripts/saucelabs.js test/asap-test.js scripts/saucelabs-spot-configurations.json", + "test-saucelabs-all": "node scripts/saucelabs.js test/asap-test.js scripts/saucelabs-all-configurations.json", + "test-saucelabs-worker": "node scripts/saucelabs-worker-test.js scripts/saucelabs-spot-configurations.json", + "test-saucelabs-worker-all": "node scripts/saucelabs-worker-test.js scripts/saucelabs-all-configurations.json", + "lint": "jshint raw.js asap.js browser-raw.js browser-asap.js $(find scripts -name '*.js' | grep -v gauntlet)" + }, + "devDependencies": { + "events": "^1.0.1", + "jshint": "^2.5.1", + "knox": "^0.8.10", + "mr": "^2.0.5", + "opener": "^1.3.0", + "q": "^2.0.3", + "q-io": "^2.0.3", + "saucelabs": "^0.1.1", + "wd": "^0.2.21", + "weak-map": "^1.0.5" + }, + "gitHead": "ccbf94d4e4a0c3afc2df13331044020a46a74ab6", + "bugs": { + "url": "https://github.com/kriskowal/asap/issues" + }, + "homepage": "https://github.com/kriskowal/asap#readme", + "_id": "asap@2.0.3", + "_shasum": "1fc1d1564ee11620dfca6d67029850913f9f4679", + "_from": "asap@>=2.0.0 <3.0.0", + "_npmVersion": "2.8.3", + "_nodeVersion": "1.8.1", + "_npmUser": { + "name": "kriskowal", + "email": "kris.kowal@cixar.com" + }, + "maintainers": [ + { + "name": "kriskowal", + "email": "kris.kowal@cixar.com" + }, + { + "name": "forbeslindesay", + "email": "forbes@lindesay.co.uk" + } + ], + "dist": { + "shasum": "1fc1d1564ee11620dfca6d67029850913f9f4679", + "tarball": "http://registry.npmjs.org/asap/-/asap-2.0.3.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/asap/-/asap-2.0.3.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/dezalgo/node_modules/asap/raw.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/dezalgo/node_modules/asap/raw.js new file mode 100644 index 00000000..ae3b8923 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/dezalgo/node_modules/asap/raw.js @@ -0,0 +1,101 @@ +"use strict"; + +var domain; // The domain module is executed on demand +var hasSetImmediate = typeof setImmediate === "function"; + +// Use the fastest means possible to execute a task in its own turn, with +// priority over other events including network IO events in Node.js. +// +// An exception thrown by a task will permanently interrupt the processing of +// subsequent tasks. The higher level `asap` function ensures that if an +// exception is thrown by a task, that the task queue will continue flushing as +// soon as possible, but if you use `rawAsap` directly, you are responsible to +// either ensure that no exceptions are thrown from your task, or to manually +// call `rawAsap.requestFlush` if an exception is thrown. +module.exports = rawAsap; +function rawAsap(task) { + if (!queue.length) { + requestFlush(); + flushing = true; + } + // Avoids a function call + queue[queue.length] = task; +} + +var queue = []; +// Once a flush has been requested, no further calls to `requestFlush` are +// necessary until the next `flush` completes. +var flushing = false; +// The position of the next task to execute in the task queue. This is +// preserved between calls to `flush` so that it can be resumed if +// a task throws an exception. +var index = 0; +// If a task schedules additional tasks recursively, the task queue can grow +// unbounded. To prevent memory excaustion, the task queue will periodically +// truncate already-completed tasks. +var capacity = 1024; + +// The flush function processes all tasks that have been scheduled with +// `rawAsap` unless and until one of those tasks throws an exception. +// If a task throws an exception, `flush` ensures that its state will remain +// consistent and will resume where it left off when called again. +// However, `flush` does not make any arrangements to be called again if an +// exception is thrown. +function flush() { + while (index < queue.length) { + var currentIndex = index; + // Advance the index before calling the task. This ensures that we will + // begin flushing on the next task the task throws an error. + index = index + 1; + queue[currentIndex].call(); + // Prevent leaking memory for long chains of recursive calls to `asap`. + // If we call `asap` within tasks scheduled by `asap`, the queue will + // grow, but to avoid an O(n) walk for every task we execute, we don't + // shift tasks off the queue after they have been executed. + // Instead, we periodically shift 1024 tasks off the queue. + if (index > capacity) { + // Manually shift all values starting at the index back to the + // beginning of the queue. + for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) { + queue[scan] = queue[scan + index]; + } + queue.length -= index; + index = 0; + } + } + queue.length = 0; + index = 0; + flushing = false; +} + +rawAsap.requestFlush = requestFlush; +function requestFlush() { + // Ensure flushing is not bound to any domain. + // It is not sufficient to exit the domain, because domains exist on a stack. + // To execute code outside of any domain, the following dance is necessary. + var parentDomain = process.domain; + if (parentDomain) { + if (!domain) { + // Lazy execute the domain module. + // Only employed if the user elects to use domains. + domain = require("domain"); + } + domain.active = process.domain = null; + } + + // `setImmediate` is slower that `process.nextTick`, but `process.nextTick` + // cannot handle recursion. + // `requestFlush` will only be called recursively from `asap.js`, to resume + // flushing after an error is thrown into a domain. + // Conveniently, `setImmediate` was introduced in the same version + // `process.nextTick` started throwing recursion errors. + if (flushing && hasSetImmediate) { + setImmediate(flush); + } else { + process.nextTick(flush); + } + + if (parentDomain) { + domain.active = process.domain = parentDomain; + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/dezalgo/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/dezalgo/package.json new file mode 100644 index 00000000..ea2b1a6d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/dezalgo/package.json @@ -0,0 +1,52 @@ +{ + "name": "dezalgo", + "version": "1.0.3", + "description": "Contain async insanity so that the dark pony lord doesn't eat souls", + "main": "dezalgo.js", + "directories": { + "test": "test" + }, + "dependencies": { + "asap": "^2.0.0", + "wrappy": "1" + }, + "devDependencies": { + "tap": "^1.2.0" + }, + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/dezalgo.git" + }, + "keywords": [ + "async", + "zalgo", + "the dark pony", + "he comes", + "asynchrony of all holy and good", + "T̯̪ͅo̯͖̹ ̻̮̖̲͢i̥̖n̢͈͇̝͍v͏͉ok̭̬̝ͅe̞͍̩̫͍̩͝ ̩̮̖̟͇͉́t͔͔͎̗h͏̗̟e̘͉̰̦̠̞͓ ͕h͉̟͎̪̠̱͠ḭ̮̩v̺͉͇̩e̵͖-̺̪m͍i̜n̪̲̲̲̮d̷ ̢r̠̼̯̹̦̦͘ͅe͓̳͓̙p̺̗̫͙͘ͅr͔̰͜e̴͓̞s͉̩̩͟ͅe͏̣n͚͇̗̭̺͍tì͙̣n͏̖̥̗͎̰̪g̞͓̭̱̯̫̕ ̣̱͜ͅc̦̰̰̠̮͎͙̀hao̺̜̻͍͙ͅs͉͓̘.͎̼̺̼͕̹͘", + "̠̞̱̰I͖͇̝̻n̦̰͍̰̟v̤̺̫̳̭̼̗͘ò̹̟̩̩͚k̢̥̠͍͉̦̬i̖͓͔̮̱̻͘n̶̳͙̫͎g̖̯̣̲̪͉ ̞͎̗͕͚ͅt̲͕̘̺̯̗̦h̘̦̲̜̻e̳͎͉̬͙ ̴̞̪̲̥f̜̯͓͓̭̭͢e̱̘͔̮e̜̤l̺̱͖̯͓͙͈͢i̵̦̬͉͔̫͚͕n͉g̨͖̙̙̹̹̟̤ ͉̪o̞̠͍̪̰͙ͅf̬̲̺ ͔͕̲͕͕̲̕c̙͉h̝͔̩̙̕ͅa̲͖̻̗̹o̥̼̫s̝̖̜̝͚̫̟.̺͚ ̸̱̲W̶̥̣͖̦i͏̤̬̱̳̣ͅt͉h̗̪̪ ̷̱͚̹̪ǫ͕̗̣̳̦͎u̼̦͔̥̮̕ţ͖͎̻͔͉ ̴͎̩òr̹̰̖͉͈͝d̷̲̦̖͓e̲͓̠r", + "̧͚̜͓̰̭̭Ṯ̫̹̜̮̟̮͝h͚̘̩̘̖̰́e ̥̘͓͉͔͙̼N̟̜̣̘͔̪e̞̞̤͢z̰̖̘͇p̠͟e̺̱̣͍͙̝ṛ̘̬͔̙͇̠d͝ḭ̯̱̥̗̩a̛ͅn͏̦ ̷̥hi̥v̖̳̹͉̮̱͝e̹̪̘̖̰̟-̴͙͓͚̜̻mi̗̺̻͙̺ͅn̪̯͈d ͏̘͓̫̳ͅơ̹͔̳̖̣͓f͈̹̘ ͕ͅc̗̤̠̜̮̥̥h̡͍̩̭̫͚̱a̤͉̤͔͜os͕̤̼͍̲̀ͅ.̡̱ ̦Za̯̱̗̭͍̣͚l̗͉̰̤g͏̣̭̬̗̲͖ͅo̶̭̩̳̟͈.̪̦̰̳", + "H̴̱̦̗̬̣͓̺e̮ ͉̠̰̞͎̖͟ẁh̛̺̯ͅo̖̫͡ ̢Ẁa̡̗i̸t͖̣͉̀ş͔̯̩ ̤̦̮͇̞̦̲B͎̭͇̦̼e̢hin͏͙̟̪d̴̰͓̻̣̮͕ͅ T͖̮̕h͖e̘̺̰̙͘ ̥Ẁ̦͔̻͚a̞͖̪͉l̪̠̻̰̣̠l̲͎͞", + "Z̘͍̼͎̣͔͝Ą̲̜̱̱̹̤͇L̶̝̰̭͔G͍̖͍O̫͜ͅ!̼̤ͅ", + "H̝̪̜͓̀̌̂̒E̢̙̠̣ ̴̳͇̥̟̠͍̐C̹̓̑̐̆͝Ó̶̭͓̚M̬̼Ĕ̖̤͔͔̟̹̽̿̊ͥ̍ͫS̻̰̦̻̖̘̱̒ͪ͌̅͟" + ], + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/dezalgo/issues" + }, + "homepage": "https://github.com/npm/dezalgo", + "readme": "# dezalgo\n\nContain async insanity so that the dark pony lord doesn't eat souls\n\nSee [this blog\npost](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony).\n\n## USAGE\n\nPass a callback to `dezalgo` and it will ensure that it is *always*\ncalled in a future tick, and never in this tick.\n\n```javascript\nvar dz = require('dezalgo')\n\nvar cache = {}\nfunction maybeSync(arg, cb) {\n cb = dz(cb)\n\n // this will actually defer to nextTick\n if (cache[arg]) cb(null, cache[arg])\n\n fs.readFile(arg, function (er, data) {\n // since this is *already* defered, it will call immediately\n if (er) cb(er)\n cb(null, cache[arg] = data)\n })\n}\n```\n", + "readmeFilename": "README.md", + "gitHead": "d4d3f3f6f47b1a326194d5281349c83dde258458", + "_id": "dezalgo@1.0.3", + "_shasum": "7f742de066fc748bc8db820569dddce49bf0d456", + "_from": "dezalgo@>=1.0.3 <1.1.0" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/dezalgo/test/basic.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/dezalgo/test/basic.js new file mode 100644 index 00000000..da09e724 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/dezalgo/test/basic.js @@ -0,0 +1,29 @@ +var test = require('tap').test +var dz = require('../dezalgo.js') + +test('the dark pony', function(t) { + + var n = 0 + function foo(i, cb) { + cb = dz(cb) + if (++n % 2) cb(true, i) + else process.nextTick(cb.bind(null, false, i)) + } + + var called = 0 + var order = [0, 2, 4, 6, 8, 1, 3, 5, 7, 9] + var o = 0 + for (var i = 0; i < 10; i++) { + foo(i, function(cached, i) { + t.equal(i, order[o++]) + t.equal(i % 2, cached ? 0 : 1) + called++ + }) + t.equal(called, 0) + } + + setTimeout(function() { + t.equal(called, 10) + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/editor/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/editor/LICENSE new file mode 100644 index 00000000..8b856bc4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/editor/LICENSE @@ -0,0 +1,21 @@ +Copyright 2013 James Halliday (mail@substack.net) + +This project is free software released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/editor/README.markdown b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/editor/README.markdown new file mode 100644 index 00000000..c1121cad --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/editor/README.markdown @@ -0,0 +1,54 @@ +editor +====== + +Launch $EDITOR in your program. + +example +======= + +``` js +var editor = require('editor'); +editor('beep.json', function (code, sig) { + console.log('finished editing with code ' + code); +}); +``` + +*** + +``` +$ node edit.js +``` + +![editor](http://substack.net/images/screenshots/editor.png) + +``` +finished editing with code 0 +``` + +methods +======= + +``` js +var editor = require('editor') +``` + +editor(file, opts={}, cb) +------------------------- + +Launch the `$EDITOR` (or `opts.editor`) for `file`. + +When the editor exits, `cb(code, sig)` fires. + +install +======= + +With [npm](http://npmjs.org) do: + +``` +npm install editor +``` + +license +======= + +MIT diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/editor/example/beep.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/editor/example/beep.json new file mode 100644 index 00000000..ac07d2da --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/editor/example/beep.json @@ -0,0 +1,5 @@ +{ + "a" : 3, + "b" : 4, + "c" : 5 +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/editor/example/edit.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/editor/example/edit.js new file mode 100644 index 00000000..ee117287 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/editor/example/edit.js @@ -0,0 +1,4 @@ +var editor = require('../'); +editor(__dirname + '/beep.json', function (code, sig) { + console.log('finished editing with code ' + code); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/editor/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/editor/index.js new file mode 100644 index 00000000..3774edbe --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/editor/index.js @@ -0,0 +1,20 @@ +var spawn = require('child_process').spawn; + +module.exports = function (file, opts, cb) { + if (typeof opts === 'function') { + cb = opts; + opts = {}; + } + if (!opts) opts = {}; + + var ed = /^win/.test(process.platform) ? 'notepad' : 'vim'; + var editor = opts.editor || process.env.VISUAL || process.env.EDITOR || ed; + var args = editor.split(/\s+/); + var bin = args.shift(); + + var ps = spawn(bin, args.concat([ file ]), { stdio: 'inherit' }); + + ps.on('exit', function (code, sig) { + if (typeof cb === 'function') cb(code, sig) + }); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/editor/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/editor/package.json new file mode 100644 index 00000000..0e5abd3b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/editor/package.json @@ -0,0 +1,60 @@ +{ + "name": "editor", + "version": "1.0.0", + "description": "launch $EDITOR in your program", + "main": "index.js", + "directories": { + "example": "example", + "test": "test" + }, + "dependencies": {}, + "devDependencies": { + "tap": "~0.4.4" + }, + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/substack/node-editor.git" + }, + "homepage": "https://github.com/substack/node-editor", + "keywords": [ + "text", + "edit", + "shell" + ], + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "license": "MIT", + "engine": { + "node": ">=0.6" + }, + "gitHead": "15200af2c417c65a4df153f39f32143dcd476375", + "bugs": { + "url": "https://github.com/substack/node-editor/issues" + }, + "_id": "editor@1.0.0", + "_shasum": "60c7f87bd62bcc6a894fa8ccd6afb7823a24f742", + "_from": "editor@>=1.0.0 <1.1.0", + "_npmVersion": "2.7.5", + "_nodeVersion": "1.6.3", + "_npmUser": { + "name": "substack", + "email": "substack@gmail.com" + }, + "dist": { + "shasum": "60c7f87bd62bcc6a894fa8ccd6afb7823a24f742", + "tarball": "http://registry.npmjs.org/editor/-/editor-1.0.0.tgz" + }, + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + } + ], + "_resolved": "https://registry.npmjs.org/editor/-/editor-1.0.0.tgz" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/.eslintrc b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/.eslintrc new file mode 100644 index 00000000..5c39c67e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/.eslintrc @@ -0,0 +1,18 @@ +{ + "env" : { + "node" : true + }, + "rules" : { + "curly" : 0, + "no-lonely-if" : 1, + "no-mixed-requires" : 0, + "no-underscore-dangle" : 0, + "no-unused-vars" : [2, {"vars" : "all", "args" : "after-used"}], + "no-use-before-define" : [2, "nofunc"], + "quotes" : [1, "double", "avoid-escape"], + "semi" : [2, "never"], + "space-after-keywords" : 1, + "space-infix-ops" : 0, + "strict" : 0 + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/.npmignore new file mode 100644 index 00000000..3c3629e6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/.travis.yml new file mode 100644 index 00000000..2325eae0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/.travis.yml @@ -0,0 +1,14 @@ +language: node_js +node_js: + - "5" + - "4" + - iojs + - "0.12" + - "0.10" + - "0.8" +sudo: false +script: "npm test" +before_install: + - "npm -g install npm" +notifications: + slack: npm-inc:kRqQjto7YbINqHPb1X6nS3g8 diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/LICENSE new file mode 100644 index 00000000..d07fa974 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2015, Forrest L Norvell + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/README.md new file mode 100644 index 00000000..df31243d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/README.md @@ -0,0 +1,33 @@ +# fs-vacuum + +Remove the empty branches of a directory tree, optionally up to (but not +including) a specified base directory. Optionally nukes the leaf directory. + +## Usage + +```javascript +var logger = require("npmlog"); +var vacuum = require("fs-vacuum"); + +var options = { + base : "/path/to/my/tree/root", + purge : true, + log : logger.silly.bind(logger, "myCleanup") +}; + +/* Assuming there are no other files or directories in "out", "to", or "my", + * the final path will just be "/path/to/my/tree/root". + */ +vacuum("/path/to/my/tree/root/out/to/my/files", function (error) { + if (error) console.error("Unable to cleanly vacuum:", error.message); +}); +``` +# vacuum(directory, options, callback) + +* `directory` {String} Leaf node to remove. **Must be a directory, symlink, or file.** +* `options` {Object} + * `base` {String} No directories at or above this level of the filesystem will be removed. + * `purge` {Boolean} If set, nuke the whole leaf directory, including its contents. + * `log` {Function} A logging function that takes `npmlog`-compatible argument lists. +* `callback` {Function} Function to call once vacuuming is complete. + * `error` {Error} What went wrong along the way, if anything. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/package.json new file mode 100644 index 00000000..d000ed30 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/package.json @@ -0,0 +1,70 @@ +{ + "name": "fs-vacuum", + "version": "1.2.9", + "description": "recursively remove empty directories -- to a point", + "main": "vacuum.js", + "scripts": { + "test": "standard && tap test/*.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/fs-vacuum.git" + }, + "keywords": [ + "rm", + "rimraf", + "clean" + ], + "author": { + "name": "Forrest L Norvell", + "email": "ogd@aoaioxxysz.net" + }, + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/fs-vacuum/issues" + }, + "homepage": "https://github.com/npm/fs-vacuum", + "devDependencies": { + "mkdirp": "^0.5.1", + "standard": "^6.0.8", + "errno": "~0.1.0", + "require-inject": "~1.3.0", + "tap": "^5.7.1", + "tmp": "0.0.28" + }, + "dependencies": { + "graceful-fs": "^4.1.2", + "path-is-inside": "^1.0.1", + "rimraf": "^2.5.2" + }, + "gitHead": "acff37c635731a0169367acb32338d9d4e7d615c", + "_id": "fs-vacuum@1.2.9", + "_shasum": "4f90193ab8ea02890995bcd4e804659a5d366b2d", + "_from": "fs-vacuum@1.2.9", + "_npmVersion": "3.8.7", + "_nodeVersion": "5.10.1", + "_npmUser": { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + "dist": { + "shasum": "4f90193ab8ea02890995bcd4e804659a5d366b2d", + "tarball": "https://registry.npmjs.org/fs-vacuum/-/fs-vacuum-1.2.9.tgz" + }, + "maintainers": [ + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" + } + ], + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/fs-vacuum-1.2.9.tgz_1461273179969_0.39465441973879933" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/fs-vacuum/-/fs-vacuum-1.2.9.tgz" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/test/arguments.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/test/arguments.js new file mode 100644 index 00000000..17ff2ee5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/test/arguments.js @@ -0,0 +1,24 @@ +var test = require('tap').test + +var vacuum = require('../vacuum.js') + +test('vacuum throws on missing parameters', function (t) { + t.throws(vacuum, 'called with no parameters') + t.throws(function () { vacuum('directory', {}) }, 'called with no callback') + + t.end() +}) + +test('vacuum throws on incorrect types ("Forrest is pedantic" section)', function (t) { + t.throws(function () { + vacuum({}, {}, function () {}) + }, 'called with path parameter of incorrect type') + t.throws(function () { + vacuum('directory', 'directory', function () {}) + }, 'called with options of wrong type') + t.throws(function () { + vacuum('directory', {}, 'whoops') + }, "called with callback that isn't callable") + + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/test/base-leaf-mismatch.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/test/base-leaf-mismatch.js new file mode 100644 index 00000000..1a6c5356 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/test/base-leaf-mismatch.js @@ -0,0 +1,16 @@ +var test = require('tap').test + +var vacuum = require('../vacuum.js') + +test('vacuum errors when base is set and path is not under it', function (t) { + vacuum('/a/made/up/path', {base: '/root/elsewhere'}, function (er) { + t.ok(er, 'got an error') + t.equal( + er.message, + '/a/made/up/path is not a child of /root/elsewhere', + 'got the expected error message' + ) + + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/test/no-entries-file-no-purge.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/test/no-entries-file-no-purge.js new file mode 100644 index 00000000..819adcdc --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/test/no-entries-file-no-purge.js @@ -0,0 +1,78 @@ +var path = require('path') + +var test = require('tap').test +var statSync = require('graceful-fs').statSync +var writeFile = require('graceful-fs').writeFile +var readdirSync = require('graceful-fs').readdirSync +var mkdtemp = require('tmp').dir +var mkdirp = require('mkdirp') + +var vacuum = require('../vacuum.js') + +// CONSTANTS +var TEMP_OPTIONS = { + unsafeCleanup: true, + mode: '0700' +} +var SHORT_PATH = path.join('i', 'am', 'a', 'path') +var PARTIAL_PATH = path.join(SHORT_PATH, 'that', 'ends', 'at', 'a') +var FULL_PATH = path.join(PARTIAL_PATH, 'file') + +var messages = [] +function log () { messages.push(Array.prototype.slice.call(arguments).join(' ')) } + +var testBase, partialPath, fullPath +test('xXx setup xXx', function (t) { + mkdtemp(TEMP_OPTIONS, function (er, tmpdir) { + t.ifError(er, 'temp directory exists') + + testBase = path.resolve(tmpdir, SHORT_PATH) + partialPath = path.resolve(tmpdir, PARTIAL_PATH) + fullPath = path.resolve(tmpdir, FULL_PATH) + + mkdirp(partialPath, function (er) { + t.ifError(er, 'made test path') + + writeFile(fullPath, new Buffer('hi'), function (er) { + t.ifError(er, 'made file') + + t.end() + }) + }) + }) +}) + +test('remove up to a point', function (t) { + vacuum(fullPath, {purge: false, base: testBase, log: log}, function (er) { + t.ifError(er, 'cleaned up to base') + + t.equal(messages.length, 6, 'got 5 removal & 1 finish message') + t.equal(messages[5], 'finished vacuuming up to ' + testBase) + + var stat + var verifyPath = fullPath + + function verify () { stat = statSync(verifyPath) } + + // handle the file separately + t.throws(verify, verifyPath + ' cannot be statted') + t.notOk(stat && stat.isFile(), verifyPath + ' is totally gone') + verifyPath = path.dirname(verifyPath) + + for (var i = 0; i < 4; i++) { + t.throws(verify, verifyPath + ' cannot be statted') + t.notOk(stat && stat.isDirectory(), verifyPath + ' is totally gone') + verifyPath = path.dirname(verifyPath) + } + + t.doesNotThrow(function () { + stat = statSync(testBase) + }, testBase + ' can be statted') + t.ok(stat && stat.isDirectory(), testBase + ' is still a directory') + + var files = readdirSync(testBase) + t.equal(files.length, 0, 'nothing left in base directory') + + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/test/no-entries-link-no-purge.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/test/no-entries-link-no-purge.js new file mode 100644 index 00000000..833d970d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/test/no-entries-link-no-purge.js @@ -0,0 +1,78 @@ +var path = require('path') + +var test = require('tap').test +var statSync = require('graceful-fs').statSync +var symlinkSync = require('graceful-fs').symlinkSync +var readdirSync = require('graceful-fs').readdirSync +var mkdtemp = require('tmp').dir +var mkdirp = require('mkdirp') + +var vacuum = require('../vacuum.js') + +// CONSTANTS +var TEMP_OPTIONS = { + unsafeCleanup: true, + mode: '0700' +} +var SHORT_PATH = path.join('i', 'am', 'a', 'path') +var TARGET_PATH = path.join('target-link', 'in', 'the', 'middle') +var PARTIAL_PATH = path.join(SHORT_PATH, 'with', 'a') +var FULL_PATH = path.join(PARTIAL_PATH, 'link') +var EXPANDO_PATH = path.join(SHORT_PATH, 'with', 'a', 'link', 'in', 'the', 'middle') + +var messages = [] +function log () { messages.push(Array.prototype.slice.call(arguments).join(' ')) } + +var testBase, targetPath, partialPath, fullPath, expandoPath +test('xXx setup xXx', function (t) { + mkdtemp(TEMP_OPTIONS, function (er, tmpdir) { + t.ifError(er, 'temp directory exists') + + testBase = path.resolve(tmpdir, SHORT_PATH) + targetPath = path.resolve(tmpdir, TARGET_PATH) + partialPath = path.resolve(tmpdir, PARTIAL_PATH) + fullPath = path.resolve(tmpdir, FULL_PATH) + expandoPath = path.resolve(tmpdir, EXPANDO_PATH) + + mkdirp(partialPath, function (er) { + t.ifError(er, 'made test path') + + mkdirp(targetPath, function (er) { + t.ifError(er, 'made target path') + + symlinkSync(path.join(tmpdir, 'target-link'), fullPath) + + t.end() + }) + }) + }) +}) + +test('remove up to a point', function (t) { + vacuum(expandoPath, {purge: false, base: testBase, log: log}, function (er) { + t.ifError(er, 'cleaned up to base') + + t.equal(messages.length, 7, 'got 6 removal & 1 finish message') + t.equal(messages[6], 'finished vacuuming up to ' + testBase) + + var stat + var verifyPath = expandoPath + function verify () { stat = statSync(verifyPath) } + + for (var i = 0; i < 6; i++) { + t.throws(verify, verifyPath + ' cannot be statted') + t.notOk(stat && stat.isDirectory(), verifyPath + ' is totally gone') + verifyPath = path.dirname(verifyPath) + } + + t.doesNotThrow(function () { + stat = statSync(testBase) + }, testBase + ' can be statted') + t.ok(stat && stat.isDirectory(), testBase + ' is still a directory') + + var files = readdirSync(testBase) + t.equal(files.length, 0, 'nothing left in base directory') + + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/test/no-entries-no-purge.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/test/no-entries-no-purge.js new file mode 100644 index 00000000..03c17923 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/test/no-entries-no-purge.js @@ -0,0 +1,61 @@ +var path = require('path') + +var test = require('tap').test +var statSync = require('graceful-fs').statSync +var mkdtemp = require('tmp').dir +var mkdirp = require('mkdirp') + +var vacuum = require('../vacuum.js') + +// CONSTANTS +var TEMP_OPTIONS = { + unsafeCleanup: true, + mode: '0700' +} +var SHORT_PATH = path.join('i', 'am', 'a', 'path') +var LONG_PATH = path.join(SHORT_PATH, 'of', 'a', 'certain', 'length') + +var messages = [] +function log () { messages.push(Array.prototype.slice.call(arguments).join(' ')) } + +var testPath, testBase +test('xXx setup xXx', function (t) { + mkdtemp(TEMP_OPTIONS, function (er, tmpdir) { + t.ifError(er, 'temp directory exists') + + testBase = path.resolve(tmpdir, SHORT_PATH) + testPath = path.resolve(tmpdir, LONG_PATH) + + mkdirp(testPath, function (er) { + t.ifError(er, 'made test path') + + t.end() + }) + }) +}) + +test('remove up to a point', function (t) { + vacuum(testPath, {purge: false, base: testBase, log: log}, function (er) { + t.ifError(er, 'cleaned up to base') + + t.equal(messages.length, 5, 'got 4 removal & 1 finish message') + t.equal(messages[4], 'finished vacuuming up to ' + testBase) + + var stat + var verifyPath = testPath + function verify () { stat = statSync(verifyPath) } + + for (var i = 0; i < 4; i++) { + t.throws(verify, verifyPath + ' cannot be statted') + t.notOk(stat && stat.isDirectory(), verifyPath + ' is totally gone') + verifyPath = path.dirname(verifyPath) + } + + t.doesNotThrow(function () { + stat = statSync(testBase) + }, testBase + ' can be statted') + t.ok(stat && stat.isDirectory(), testBase + ' is still a directory') + + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/test/no-entries-with-link-purge.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/test/no-entries-with-link-purge.js new file mode 100644 index 00000000..990b69d8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/test/no-entries-with-link-purge.js @@ -0,0 +1,78 @@ +var path = require('path') + +var test = require('tap').test +var statSync = require('graceful-fs').statSync +var writeFileSync = require('graceful-fs').writeFileSync +var symlinkSync = require('graceful-fs').symlinkSync +var mkdtemp = require('tmp').dir +var mkdirp = require('mkdirp') + +var vacuum = require('../vacuum.js') + +// CONSTANTS +var TEMP_OPTIONS = { + unsafeCleanup: true, + mode: '0700' +} +var SHORT_PATH = path.join('i', 'am', 'a', 'path') +var TARGET_PATH = 'link-target' +var FIRST_FILE = path.join(TARGET_PATH, 'monsieurs') +var SECOND_FILE = path.join(TARGET_PATH, 'mesdames') +var PARTIAL_PATH = path.join(SHORT_PATH, 'with', 'a', 'definite') +var FULL_PATH = path.join(PARTIAL_PATH, 'target') + +var messages = [] +function log () { messages.push(Array.prototype.slice.call(arguments).join(' ')) } + +var testBase, partialPath, fullPath, targetPath +test('xXx setup xXx', function (t) { + mkdtemp(TEMP_OPTIONS, function (er, tmpdir) { + t.ifError(er, 'temp directory exists') + + testBase = path.resolve(tmpdir, SHORT_PATH) + targetPath = path.resolve(tmpdir, TARGET_PATH) + partialPath = path.resolve(tmpdir, PARTIAL_PATH) + fullPath = path.resolve(tmpdir, FULL_PATH) + + mkdirp(partialPath, function (er) { + t.ifError(er, 'made test path') + + mkdirp(targetPath, function (er) { + t.ifError(er, 'made target path') + + writeFileSync(path.resolve(tmpdir, FIRST_FILE), new Buffer("c'est vraiment joli")) + writeFileSync(path.resolve(tmpdir, SECOND_FILE), new Buffer('oui oui')) + symlinkSync(targetPath, fullPath) + + t.end() + }) + }) + }) +}) + +test('remove up to a point', function (t) { + vacuum(fullPath, {purge: true, base: testBase, log: log}, function (er) { + t.ifError(er, 'cleaned up to base') + + t.equal(messages.length, 5, 'got 4 removal & 1 finish message') + t.equal(messages[0], 'purging ' + fullPath) + t.equal(messages[4], 'finished vacuuming up to ' + testBase) + + var stat + var verifyPath = fullPath + function verify () { stat = statSync(verifyPath) } + + for (var i = 0; i < 4; i++) { + t.throws(verify, verifyPath + ' cannot be statted') + t.notOk(stat && stat.isDirectory(), verifyPath + ' is totally gone') + verifyPath = path.dirname(verifyPath) + } + + t.doesNotThrow(function () { + stat = statSync(testBase) + }, testBase + ' can be statted') + t.ok(stat && stat.isDirectory(), testBase + ' is still a directory') + + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/test/no-entries-with-purge.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/test/no-entries-with-purge.js new file mode 100644 index 00000000..d3ab0c2b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/test/no-entries-with-purge.js @@ -0,0 +1,67 @@ +var path = require('path') + +var test = require('tap').test +var statSync = require('graceful-fs').statSync +var writeFileSync = require('graceful-fs').writeFileSync +var mkdtemp = require('tmp').dir +var mkdirp = require('mkdirp') + +var vacuum = require('../vacuum.js') + +// CONSTANTS +var TEMP_OPTIONS = { + unsafeCleanup: true, + mode: '0700' +} +var SHORT_PATH = path.join('i', 'am', 'a', 'path') +var LONG_PATH = path.join(SHORT_PATH, 'of', 'a', 'certain', 'kind') +var FIRST_FILE = path.join(LONG_PATH, 'monsieurs') +var SECOND_FILE = path.join(LONG_PATH, 'mesdames') + +var messages = [] +function log () { messages.push(Array.prototype.slice.call(arguments).join(' ')) } + +var testPath, testBase +test('xXx setup xXx', function (t) { + mkdtemp(TEMP_OPTIONS, function (er, tmpdir) { + t.ifError(er, 'temp directory exists') + + testBase = path.resolve(tmpdir, SHORT_PATH) + testPath = path.resolve(tmpdir, LONG_PATH) + + mkdirp(testPath, function (er) { + t.ifError(er, 'made test path') + + writeFileSync(path.resolve(tmpdir, FIRST_FILE), new Buffer("c'est vraiment joli")) + writeFileSync(path.resolve(tmpdir, SECOND_FILE), new Buffer('oui oui')) + t.end() + }) + }) +}) + +test('remove up to a point', function (t) { + vacuum(testPath, {purge: true, base: testBase, log: log}, function (er) { + t.ifError(er, 'cleaned up to base') + + t.equal(messages.length, 5, 'got 4 removal & 1 finish message') + t.equal(messages[0], 'purging ' + testPath) + t.equal(messages[4], 'finished vacuuming up to ' + testBase) + + var stat + var verifyPath = testPath + function verify () { stat = statSync(verifyPath) } + + for (var i = 0; i < 4; i++) { + t.throws(verify, verifyPath + ' cannot be statted') + t.notOk(stat && stat.isDirectory(), verifyPath + ' is totally gone') + verifyPath = path.dirname(verifyPath) + } + + t.doesNotThrow(function () { + stat = statSync(testBase) + }, testBase + ' can be statted') + t.ok(stat && stat.isDirectory(), testBase + ' is still a directory') + + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/test/other-directories-no-purge.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/test/other-directories-no-purge.js new file mode 100644 index 00000000..b18f7eb2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/test/other-directories-no-purge.js @@ -0,0 +1,76 @@ +var path = require('path') + +var test = require('tap').test +var statSync = require('graceful-fs').statSync +var mkdtemp = require('tmp').dir +var mkdirp = require('mkdirp') + +var vacuum = require('../vacuum.js') + +// CONSTANTS +var TEMP_OPTIONS = { + unsafeCleanup: true, + mode: '0700' +} +var SHORT_PATH = path.join('i', 'am', 'a', 'path') +var REMOVE_PATH = path.join(SHORT_PATH, 'of', 'a', 'certain', 'length') +var OTHER_PATH = path.join(SHORT_PATH, 'of', 'no', 'qualities') + +var messages = [] +function log () { messages.push(Array.prototype.slice.call(arguments).join(' ')) } + +var testBase, testPath, otherPath +test('xXx setup xXx', function (t) { + mkdtemp(TEMP_OPTIONS, function (er, tmpdir) { + t.ifError(er, 'temp directory exists') + + testBase = path.resolve(tmpdir, SHORT_PATH) + testPath = path.resolve(tmpdir, REMOVE_PATH) + otherPath = path.resolve(tmpdir, OTHER_PATH) + + mkdirp(testPath, function (er) { + t.ifError(er, 'made test path') + + mkdirp(otherPath, function (er) { + t.ifError(er, 'made other path') + + t.end() + }) + }) + }) +}) + +test('remove up to a point', function (t) { + vacuum(testPath, {purge: false, base: testBase, log: log}, function (er) { + t.ifError(er, 'cleaned up to base') + + t.equal(messages.length, 4, 'got 3 removal & 1 finish message') + t.equal( + messages[3], 'quitting because other entries in ' + testBase + '/of', + 'got expected final message' + ) + + var stat + var verifyPath = testPath + function verify () { stat = statSync(verifyPath) } + + for (var i = 0; i < 3; i++) { + t.throws(verify, verifyPath + ' cannot be statted') + t.notOk(stat && stat.isDirectory(), verifyPath + ' is totally gone') + verifyPath = path.dirname(verifyPath) + } + + t.doesNotThrow(function () { + stat = statSync(otherPath) + }, otherPath + ' can be statted') + t.ok(stat && stat.isDirectory(), otherPath + ' is still a directory') + + var intersection = path.join(testBase, 'of') + t.doesNotThrow(function () { + stat = statSync(intersection) + }, intersection + ' can be statted') + t.ok(stat && stat.isDirectory(), intersection + ' is still a directory') + + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/test/racy-entries-eexist.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/test/racy-entries-eexist.js new file mode 100644 index 00000000..d467e996 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/test/racy-entries-eexist.js @@ -0,0 +1,119 @@ +var path = require('path') + +var test = require('tap').test + +var readdir = require('graceful-fs').readdir +var readdirSync = require('graceful-fs').readdirSync +var rmdir = require('graceful-fs').rmdir +var statSync = require('graceful-fs').statSync +var writeFile = require('graceful-fs').writeFile +var mkdirp = require('mkdirp') +var mkdtemp = require('tmp').dir +var tmpFile = require('tmp').file +var EEXIST = require('errno').code.EEXIST +var ENOTEMPTY = require('errno').code.ENOTEMPTY + +var requireInject = require('require-inject') +var vacuum = requireInject('../vacuum.js', { + 'graceful-fs': { + 'lstat': require('graceful-fs').lstat, + 'readdir': function (dir, cb) { + readdir(dir, function (err, files) { + // Simulate racy removal by creating a file after vacuum + // thinks the directory is empty + if (dir === partialPath && files.length === 0) { + tmpFile({dir: dir}, function (err, path, fd) { + if (err) throw err + cb(err, files) + }) + } else { + cb(err, files) + } + }) + }, + 'rmdir': function (dir, cb) { + rmdir(dir, function (err) { + // Force EEXIST error from rmdir if the directory is non-empty + var mockErr = EEXIST + if (err) { + if (err.code === ENOTEMPTY.code) { + err.code = err.errno = mockErr.code + err.message = mockErr.code + ': ' + mockErr.description + ', ' + err.syscall + ' \'' + dir + '\'' + } + } + cb(err) + }) + }, + 'unlink': require('graceful-fs').unlink + } +}) + +// CONSTANTS +var TEMP_OPTIONS = { + unsafeCleanup: true, + mode: '0700' +} +var SHORT_PATH = path.join('i', 'am', 'a', 'path') +var PARTIAL_PATH = path.join(SHORT_PATH, 'that', 'ends', 'at', 'a') +var FULL_PATH = path.join(PARTIAL_PATH, 'file') + +var messages = [] +function log () { messages.push(Array.prototype.slice.call(arguments).join(' ')) } + +var testBase, partialPath, fullPath +test('xXx setup xXx', function (t) { + mkdtemp(TEMP_OPTIONS, function (er, tmpdir) { + t.ifError(er, 'temp directory exists') + + testBase = path.resolve(tmpdir, SHORT_PATH) + partialPath = path.resolve(tmpdir, PARTIAL_PATH) + fullPath = path.resolve(tmpdir, FULL_PATH) + + mkdirp(partialPath, function (er) { + t.ifError(er, 'made test path') + + writeFile(fullPath, new Buffer('hi'), function (er) { + t.ifError(er, 'made file') + + t.end() + }) + }) + }) +}) + +test('racy removal should quit gracefully', function (t) { + vacuum(fullPath, {purge: false, base: testBase, log: log}, function (er) { + t.ifError(er, 'cleaned up to base') + + t.equal(messages.length, 3, 'got 2 removal & 1 quit message') + t.equal(messages[2], 'quitting because new (racy) entries in ' + partialPath) + + var stat + var verifyPath = fullPath + + function verify () { stat = statSync(verifyPath) } + + // handle the file separately + t.throws(verify, verifyPath + ' cannot be statted') + t.notOk(stat && stat.isFile(), verifyPath + ' is totally gone') + verifyPath = path.dirname(verifyPath) + + for (var i = 0; i < 4; i++) { + t.doesNotThrow(function () { + stat = statSync(verifyPath) + }, verifyPath + ' can be statted') + t.ok(stat && stat.isDirectory(), verifyPath + ' is still a directory') + verifyPath = path.dirname(verifyPath) + } + + t.doesNotThrow(function () { + stat = statSync(testBase) + }, testBase + ' can be statted') + t.ok(stat && stat.isDirectory(), testBase + ' is still a directory') + + var files = readdirSync(testBase) + t.equal(files.length, 1, 'base directory untouched') + + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/test/racy-entries-enotempty.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/test/racy-entries-enotempty.js new file mode 100644 index 00000000..decc3807 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/test/racy-entries-enotempty.js @@ -0,0 +1,119 @@ +var path = require('path') + +var test = require('tap').test + +var readdir = require('graceful-fs').readdir +var readdirSync = require('graceful-fs').readdirSync +var rmdir = require('graceful-fs').rmdir +var statSync = require('graceful-fs').statSync +var writeFile = require('graceful-fs').writeFile +var mkdirp = require('mkdirp') +var mkdtemp = require('tmp').dir +var tmpFile = require('tmp').file +var EEXIST = require('errno').code.EEXIST +var ENOTEMPTY = require('errno').code.ENOTEMPTY + +var requireInject = require('require-inject') +var vacuum = requireInject('../vacuum.js', { + 'graceful-fs': { + 'lstat': require('graceful-fs').lstat, + 'readdir': function (dir, cb) { + readdir(dir, function (err, files) { + // Simulate racy removal by creating a file after vacuum + // thinks the directory is empty + if (dir === partialPath && files.length === 0) { + tmpFile({dir: dir}, function (err, path, fd) { + if (err) throw err + cb(err, files) + }) + } else { + cb(err, files) + } + }) + }, + 'rmdir': function (dir, cb) { + rmdir(dir, function (err) { + // Force ENOTEMPTY error from rmdir if the directory is non-empty + var mockErr = ENOTEMPTY + if (err) { + if (err.code === EEXIST.code) { + err.code = err.errno = mockErr.code + err.message = mockErr.code + ': ' + mockErr.description + ', ' + err.syscall + ' \'' + dir + '\'' + } + } + cb(err) + }) + }, + 'unlink': require('graceful-fs').unlink + } +}) + +// CONSTANTS +var TEMP_OPTIONS = { + unsafeCleanup: true, + mode: '0700' +} +var SHORT_PATH = path.join('i', 'am', 'a', 'path') +var PARTIAL_PATH = path.join(SHORT_PATH, 'that', 'ends', 'at', 'a') +var FULL_PATH = path.join(PARTIAL_PATH, 'file') + +var messages = [] +function log () { messages.push(Array.prototype.slice.call(arguments).join(' ')) } + +var testBase, partialPath, fullPath +test('xXx setup xXx', function (t) { + mkdtemp(TEMP_OPTIONS, function (er, tmpdir) { + t.ifError(er, 'temp directory exists') + + testBase = path.resolve(tmpdir, SHORT_PATH) + partialPath = path.resolve(tmpdir, PARTIAL_PATH) + fullPath = path.resolve(tmpdir, FULL_PATH) + + mkdirp(partialPath, function (er) { + t.ifError(er, 'made test path') + + writeFile(fullPath, new Buffer('hi'), function (er) { + t.ifError(er, 'made file') + + t.end() + }) + }) + }) +}) + +test('racy removal should quit gracefully', function (t) { + vacuum(fullPath, {purge: false, base: testBase, log: log}, function (er) { + t.ifError(er, 'cleaned up to base') + + t.equal(messages.length, 3, 'got 2 removal & 1 quit message') + t.equal(messages[2], 'quitting because new (racy) entries in ' + partialPath) + + var stat + var verifyPath = fullPath + + function verify () { stat = statSync(verifyPath) } + + // handle the file separately + t.throws(verify, verifyPath + ' cannot be statted') + t.notOk(stat && stat.isFile(), verifyPath + ' is totally gone') + verifyPath = path.dirname(verifyPath) + + for (var i = 0; i < 4; i++) { + t.doesNotThrow(function () { + stat = statSync(verifyPath) + }, verifyPath + ' can be statted') + t.ok(stat && stat.isDirectory(), verifyPath + ' is still a directory') + verifyPath = path.dirname(verifyPath) + } + + t.doesNotThrow(function () { + stat = statSync(testBase) + }, testBase + ' can be statted') + t.ok(stat && stat.isDirectory(), testBase + ' is still a directory') + + var files = readdirSync(testBase) + t.equal(files.length, 1, 'base directory untouched') + + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/test/racy-entries.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/test/racy-entries.js new file mode 100644 index 00000000..c0ed5324 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/test/racy-entries.js @@ -0,0 +1,104 @@ +var path = require('path') + +var test = require('tap').test + +var readdir = require('graceful-fs').readdir +var readdirSync = require('graceful-fs').readdirSync +var statSync = require('graceful-fs').statSync +var writeFile = require('graceful-fs').writeFile +var mkdirp = require('mkdirp') +var mkdtemp = require('tmp').dir +var tmpFile = require('tmp').file + +var requireInject = require('require-inject') +var vacuum = requireInject('../vacuum.js', { + 'graceful-fs': { + 'lstat': require('graceful-fs').lstat, + 'readdir': function (dir, cb) { + readdir(dir, function (err, files) { + // Simulate racy removal by creating a file after vacuum + // thinks the directory is empty + if (dir === partialPath && files.length === 0) { + tmpFile({dir: dir}, function (err, path, fd) { + if (err) throw err + cb(err, files) + }) + } else { + cb(err, files) + } + }) + }, + 'rmdir': require('graceful-fs').rmdir, + 'unlink': require('graceful-fs').unlink + } +}) + +// CONSTANTS +var TEMP_OPTIONS = { + unsafeCleanup: true, + mode: '0700' +} +var SHORT_PATH = path.join('i', 'am', 'a', 'path') +var PARTIAL_PATH = path.join(SHORT_PATH, 'that', 'ends', 'at', 'a') +var FULL_PATH = path.join(PARTIAL_PATH, 'file') + +var messages = [] +function log () { messages.push(Array.prototype.slice.call(arguments).join(' ')) } + +var testBase, partialPath, fullPath +test('xXx setup xXx', function (t) { + mkdtemp(TEMP_OPTIONS, function (er, tmpdir) { + t.ifError(er, 'temp directory exists') + + testBase = path.resolve(tmpdir, SHORT_PATH) + partialPath = path.resolve(tmpdir, PARTIAL_PATH) + fullPath = path.resolve(tmpdir, FULL_PATH) + + mkdirp(partialPath, function (er) { + t.ifError(er, 'made test path') + + writeFile(fullPath, new Buffer('hi'), function (er) { + t.ifError(er, 'made file') + + t.end() + }) + }) + }) +}) + +test('racy removal should quit gracefully', function (t) { + vacuum(fullPath, {purge: false, base: testBase, log: log}, function (er) { + t.ifError(er, 'cleaned up to base') + + t.equal(messages.length, 3, 'got 2 removal & 1 quit message') + t.equal(messages[2], 'quitting because new (racy) entries in ' + partialPath) + + var stat + var verifyPath = fullPath + + function verify () { stat = statSync(verifyPath) } + + // handle the file separately + t.throws(verify, verifyPath + ' cannot be statted') + t.notOk(stat && stat.isFile(), verifyPath + ' is totally gone') + verifyPath = path.dirname(verifyPath) + + for (var i = 0; i < 4; i++) { + t.doesNotThrow(function () { + stat = statSync(verifyPath) + }, verifyPath + ' can be statted') + t.ok(stat && stat.isDirectory(), verifyPath + ' is still a directory') + verifyPath = path.dirname(verifyPath) + } + + t.doesNotThrow(function () { + stat = statSync(testBase) + }, testBase + ' can be statted') + t.ok(stat && stat.isDirectory(), testBase + ' is still a directory') + + var files = readdirSync(testBase) + t.equal(files.length, 1, 'base directory untouched') + + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/vacuum.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/vacuum.js new file mode 100644 index 00000000..1fb674da --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/vacuum.js @@ -0,0 +1,112 @@ +var assert = require('assert') +var dirname = require('path').dirname +var resolve = require('path').resolve +var isInside = require('path-is-inside') + +var rimraf = require('rimraf') +var lstat = require('graceful-fs').lstat +var readdir = require('graceful-fs').readdir +var rmdir = require('graceful-fs').rmdir +var unlink = require('graceful-fs').unlink + +module.exports = vacuum + +function vacuum (leaf, options, cb) { + assert(typeof leaf === 'string', 'must pass in path to remove') + assert(typeof cb === 'function', 'must pass in callback') + + if (!options) options = {} + assert(typeof options === 'object', 'options must be an object') + + var log = options.log ? options.log : function () {} + + leaf = leaf && resolve(leaf) + var base = options.base && resolve(options.base) + if (base && !isInside(leaf, base)) { + return cb(new Error(leaf + ' is not a child of ' + base)) + } + + lstat(leaf, function (error, stat) { + if (error) { + if (error.code === 'ENOENT') return cb(null) + + log(error.stack) + return cb(error) + } + + if (!(stat && (stat.isDirectory() || stat.isSymbolicLink() || stat.isFile()))) { + log(leaf, 'is not a directory, file, or link') + return cb(new Error(leaf + ' is not a directory, file, or link')) + } + + if (options.purge) { + log('purging', leaf) + rimraf(leaf, function (error) { + if (error) return cb(error) + + next(dirname(leaf)) + }) + } else if (!stat.isDirectory()) { + log('removing', leaf) + unlink(leaf, function (error) { + if (error) return cb(error) + + next(dirname(leaf)) + }) + } else { + next(leaf) + } + }) + + function next (branch) { + branch = branch && resolve(branch) + // either we've reached the base or we've reached the root + if ((base && branch === base) || branch === dirname(branch)) { + log('finished vacuuming up to', branch) + return cb(null) + } + + readdir(branch, function (error, files) { + if (error) { + if (error.code === 'ENOENT') return cb(null) + + log('unable to check directory', branch, 'due to', error.message) + return cb(error) + } + + if (files.length > 0) { + log('quitting because other entries in', branch) + return cb(null) + } + + log('removing', branch) + lstat(branch, function (error, stat) { + if (error) { + if (error.code === 'ENOENT') return cb(null) + + log('unable to lstat', branch, 'due to', error.message) + return cb(error) + } + + var remove = stat.isDirectory() ? rmdir : unlink + remove(branch, function (error) { + if (error) { + if (error.code === 'ENOENT') { + log('quitting because lost the race to remove', branch) + return cb(null) + } + if (error.code === 'ENOTEMPTY' || error.code === 'EEXIST') { + log('quitting because new (racy) entries in', branch) + return cb(null) + } + + log('unable to remove', branch, 'due to', error.message) + return cb(error) + } + + next(dirname(branch)) + }) + }) + }) + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/.npmignore new file mode 100644 index 00000000..2f24c57c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/.npmignore @@ -0,0 +1,3 @@ +node_modules/ +coverage/ +.nyc_output/ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/.travis.yml new file mode 100644 index 00000000..68946625 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/.travis.yml @@ -0,0 +1,11 @@ +language: node_js +sudo: false +before_install: + - "npm -g install npm" +node_js: + - "0.8" + - "0.10" + - "0.12" + - "iojs" + - "4" + - "5" diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/README.md new file mode 100644 index 00000000..9a15d056 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/README.md @@ -0,0 +1,35 @@ +# fs-write-stream-atomic + +Like `fs.createWriteStream(...)`, but atomic. + +Writes to a tmp file and does an atomic `fs.rename` to move it into +place when it's done. + +First rule of debugging: **It's always a race condition.** + +## USAGE + +```javascript +var fsWriteStreamAtomic = require('fs-write-stream-atomic') +// options are optional. +var write = fsWriteStreamAtomic('output.txt', options) +var read = fs.createReadStream('input.txt') +read.pipe(write) + +// When the write stream emits a 'finish' or 'close' event, +// you can be sure that it is moved into place, and contains +// all the bytes that were written to it, even if something else +// was writing to `output.txt` at the same time. +``` + +### `fsWriteStreamAtomic(filename, [options])` + +* `filename` {String} The file we want to write to +* `options` {Object} + * `chown` {Object} User and group to set ownership after write + * `uid` {Number} + * `gid` {Number} + * `encoding` {String} default = 'utf8' + * `mode` {Number} default = `0666` + * `flags` {String} default = `'w'` + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/index.js new file mode 100644 index 00000000..59b50db6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/index.js @@ -0,0 +1,124 @@ +var fs = require('graceful-fs') +var Writable = require('readable-stream').Writable +var util = require('util') +var MurmurHash3 = require('imurmurhash') +var iferr = require('iferr') + +function murmurhex () { + var hash = MurmurHash3('') + for (var ii = 0; ii < arguments.length; ++ii) { + hash.hash(hash + arguments[ii]) + } + return hash.result() +} + +var invocations = 0 +function getTmpname (filename) { + return filename + '.' + murmurhex(__filename, process.pid, ++invocations) +} + +var setImmediate = global.setImmediate || setTimeout + +module.exports = WriteStreamAtomic + +// Requirements: +// 1. Write everything written to the stream to a temp file. +// 2. If there are no errors: +// a. moves the temp file into its final destination +// b. emits `finish` & `closed` ONLY after the file is +// fully flushed and renamed. +// 3. If there's an error, removes the temp file. + +util.inherits(WriteStreamAtomic, Writable) +function WriteStreamAtomic (path, options) { + if (!(this instanceof WriteStreamAtomic)) { + return new WriteStreamAtomic(path, options) + } + Writable.call(this, options) + + this.__atomicTarget = path + this.__atomicTmp = getTmpname(path) + + this.__atomicChown = options && options.chown + + this.__atomicClosed = false + + this.__atomicStream = fs.WriteStream(this.__atomicTmp, options) + + this.__atomicStream.once('open', handleOpen(this)) + this.__atomicStream.once('close', handleClose(this)) + this.__atomicStream.once('error', handleError(this)) +} + +// We have to suppress default finish emitting, because ordinarily it +// would happen as soon as `end` is called on us and all of the +// data has been written to our target stream. So we suppress +// finish from being emitted here, and only emit it after our +// target stream is closed and we've moved everything around. +WriteStreamAtomic.prototype.emit = function (event) { + if (event === 'finish') return this.__atomicStream.end() + return Writable.prototype.emit.apply(this, arguments) +} + +WriteStreamAtomic.prototype._write = function (buffer, encoding, cb) { + var flushed = this.__atomicStream.write(buffer, encoding) + if (flushed) return cb() + this.__atomicStream.once('drain', cb) +} + +function handleOpen (writeStream) { + return function (fd) { + writeStream.emit('open', fd) + } +} + +function handleClose (writeStream) { + return function () { + if (writeStream.__atomicClosed) return + writeStream.__atomicClosed = true + if (writeStream.__atomicChown) { + var uid = writeStream.__atomicChown.uid + var gid = writeStream.__atomicChown.gid + return fs.chown(writeStream.__atomicTmp, uid, gid, iferr(cleanup, moveIntoPlace)) + } else { + moveIntoPlace() + } + } + function cleanup (err) { + fs.unlink(writeStream.__atomicTmp, function () { + writeStream.emit('error', err) + writeStream.emit('close') + }) + } + function moveIntoPlace () { + fs.rename(writeStream.__atomicTmp, writeStream.__atomicTarget, iferr(cleanup, end)) + } + function end () { + // We have to use our parent class directly because we suppress `finish` + // events fired via our own emit method. + Writable.prototype.emit.call(writeStream, 'finish') + + // Delay the close to provide the same temporal separation a physical + // file operation would have– that is, the close event is emitted only + // after the async close operation completes. + setImmediate(function () { + writeStream.emit('close') + }) + } +} + +function handleError (writeStream) { + return function (er) { + cleanupSync() + writeStream.emit('error', er) + writeStream.__atomicClosed = true + writeStream.emit('close') + } + function cleanupSync () { + try { + fs.unlinkSync(writeStream.__atomicTmp) + } finally { + return + } + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/.npmignore new file mode 100644 index 00000000..3c3629e6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/LICENSE new file mode 100644 index 00000000..19d5f4bc --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Nadav Ivgi + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/README.md new file mode 100644 index 00000000..0940763f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/README.md @@ -0,0 +1,40 @@ +# iferr + +Higher-order functions for easier error handling. + +`if (err) return cb(err);` be gone! + +## Install +```bash +npm install iferr +``` + +## Use + +### JavaScript example +```js +var iferr = require('iferr'); + +function get_friends_count(id, cb) { + User.load_user(id, iferr(cb, function(user) { + user.load_friends(iferr(cb, function(friends) { + cb(null, friends.length); + })); + })); +} +``` + +### CoffeeScript example +```coffee +iferr = require 'iferr' + +get_friends_count = (id, cb) -> + User.load_user id, iferr cb, (user) -> + user.load_friends iferr cb, (friends) -> + cb null, friends.length +``` + +(TODO: document tiferr, throwerr and printerr) + +## License +MIT diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/index.coffee b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/index.coffee new file mode 100644 index 00000000..da6d0071 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/index.coffee @@ -0,0 +1,24 @@ +# Delegates to `succ` on sucecss or to `fail` on error +# ex: Thing.load 123, iferr cb, (thing) -> ... +iferr = (fail, succ) -> (err, a...) -> + if err? then fail err + else succ? a... + +# Like iferr, but also catches errors thrown from `succ` and passes to `fail` +tiferr = (fail, succ) -> iferr fail, (a...) -> + try succ a... + catch err then fail err + +# Delegate to the success function on success, or throw the error otherwise +# ex: Thing.load 123, throwerr (thing) -> ... +throwerr = iferr.bind null, (err) -> throw err + +# Prints errors when one is passed, or does nothing otherwise +# ex: thing.save printerr +printerr = iferr (err) -> console.error err.stack or err + +module.exports = exports = iferr +exports.iferr = iferr +exports.tiferr = tiferr +exports.throwerr = throwerr +exports.printerr = printerr diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/index.js new file mode 100644 index 00000000..78fce3d2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/index.js @@ -0,0 +1,49 @@ +// Generated by CoffeeScript 1.7.1 +(function() { + var exports, iferr, printerr, throwerr, tiferr, + __slice = [].slice; + + iferr = function(fail, succ) { + return function() { + var a, err; + err = arguments[0], a = 2 <= arguments.length ? __slice.call(arguments, 1) : []; + if (err != null) { + return fail(err); + } else { + return typeof succ === "function" ? succ.apply(null, a) : void 0; + } + }; + }; + + tiferr = function(fail, succ) { + return iferr(fail, function() { + var a, err; + a = 1 <= arguments.length ? __slice.call(arguments, 0) : []; + try { + return succ.apply(null, a); + } catch (_error) { + err = _error; + return fail(err); + } + }); + }; + + throwerr = iferr.bind(null, function(err) { + throw err; + }); + + printerr = iferr(function(err) { + return console.error(err.stack || err); + }); + + module.exports = exports = iferr; + + exports.iferr = iferr; + + exports.tiferr = tiferr; + + exports.throwerr = throwerr; + + exports.printerr = printerr; + +}).call(this); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/package.json new file mode 100644 index 00000000..9017857c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/package.json @@ -0,0 +1,50 @@ +{ + "name": "iferr", + "version": "0.1.5", + "description": "Higher-order functions for easier error handling", + "main": "index.js", + "scripts": { + "test": "mocha", + "prepublish": "coffee -c index.coffee" + }, + "repository": { + "type": "git", + "url": "https://github.com/shesek/iferr" + }, + "keywords": [ + "error", + "errors" + ], + "author": { + "name": "Nadav Ivgi" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/shesek/iferr/issues" + }, + "homepage": "https://github.com/shesek/iferr", + "devDependencies": { + "coffee-script": "^1.7.1", + "mocha": "^1.18.2" + }, + "_id": "iferr@0.1.5", + "dist": { + "shasum": "c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501", + "tarball": "http://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz" + }, + "_from": "iferr@>=0.1.5 <0.2.0", + "_npmVersion": "1.4.4", + "_npmUser": { + "name": "nadav", + "email": "npm@shesek.info" + }, + "maintainers": [ + { + "name": "nadav", + "email": "npm@shesek.info" + } + ], + "directories": {}, + "_shasum": "c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501", + "_resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/test/index.coffee b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/test/index.coffee new file mode 100644 index 00000000..be0bc56f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/test/index.coffee @@ -0,0 +1,42 @@ +{ iferr, tiferr, throwerr } = require '../index.coffee' +{ equal: eq, throws } = require 'assert' + +invoke_fail = (cb) -> cb new Error 'callback error' +invoke_succ = (cb) -> cb null +throw_error = -> throw new Error 'thrown' + +describe 'iferr', -> + it 'calls the error callback on errors', (done) -> + invoke_fail iferr( + (err) -> + eq err.message, 'callback error' + do done + -> + done new Error 'shouldn\'t call the success callback' + ) + + it 'calls the success callback on success', (done) -> + invoke_succ iferr( + -> done new Error 'shouldn\'t call the error callback' + done + ) + +describe 'tiferr', -> + it 'catches errors in the success callback', (done) -> + invoke_succ tiferr( + (err) -> + eq err.message, 'thrown' + do done + throw_error + ) + +describe 'throwerr', -> + it 'throws errors passed to the callback', (done)-> + try invoke_fail throwerr -> + done 'shouldn\'t call the success callback' + catch err + eq err.message, 'callback error' + do done + + it 'delegates to the success callback otherwise', (done) -> + invoke_succ throwerr done diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/test/mocha.opts b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/test/mocha.opts new file mode 100644 index 00000000..019defcf --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/test/mocha.opts @@ -0,0 +1,2 @@ +--compilers coffee:coffee-script/register +--reporter spec diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/package.json new file mode 100644 index 00000000..0fae54c4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/package.json @@ -0,0 +1,70 @@ +{ + "name": "fs-write-stream-atomic", + "version": "1.0.8", + "description": "Like `fs.createWriteStream(...)`, but atomic.", + "main": "index.js", + "directories": { + "test": "test" + }, + "dependencies": { + "graceful-fs": "^4.1.2", + "iferr": "^0.1.5", + "imurmurhash": "^0.1.4", + "readable-stream": "1 || 2" + }, + "devDependencies": { + "rimraf": "^2.4.4", + "standard": "^5.4.1", + "tap": "^2.3.1" + }, + "scripts": { + "test": "standard && tap --coverage test/*.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/fs-write-stream-atomic.git" + }, + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/fs-write-stream-atomic/issues" + }, + "homepage": "https://github.com/npm/fs-write-stream-atomic", + "gitHead": "b55824ee4de7f1ca23784929d68b1b8f5edbf4a4", + "_id": "fs-write-stream-atomic@1.0.8", + "_shasum": "e49aaddf288f87d46ff9e882f216a13abc40778b", + "_from": "fs-write-stream-atomic@>=1.0.5 <1.1.0", + "_npmVersion": "3.5.2", + "_nodeVersion": "4.2.2", + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "dist": { + "shasum": "e49aaddf288f87d46ff9e882f216a13abc40778b", + "tarball": "http://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.8.tgz" + }, + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + }, + { + "name": "isaacs", + "email": "i@izs.me" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" + } + ], + "_resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.8.tgz" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/test/basic.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/test/basic.js new file mode 100644 index 00000000..d0205e15 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/test/basic.js @@ -0,0 +1,97 @@ +var fs = require('graceful-fs') +var test = require('tap').test +var path = require('path') +var writeStream = require('../index.js') + +var rename = fs.rename +fs.rename = function (from, to, cb) { + setTimeout(function () { + rename(from, to, cb) + }, 100) +} + +test('basic', function (t) { + // open 10 write streams to the same file. + // then write to each of them, and to the target + // and verify at the end that each of them does their thing + var target = path.resolve(__dirname, 'test.txt') + var n = 10 + + // We run all of our assertions twice: + // once for finish, once for close + // There are 6 assertions, two fixed, plus 4 lines in the file. + t.plan(n * 2 * 6) + + var streams = [] + for (var i = 0; i < n; i++) { + var s = writeStream(target) + s.on('finish', verifier('finish', i)) + s.on('close', verifier('close', i)) + streams.push(s) + } + + function verifier (ev, num) { + return function () { + if (ev === 'close') { + t.equal(this.__emittedFinish, true, num + '. closed only after finish') + } else { + this.__emittedFinish = true + t.equal(ev, 'finish', num + '. finished') + } + + // make sure that one of the atomic streams won. + var res = fs.readFileSync(target, 'utf8') + var lines = res.trim().split(/\n/) + lines.forEach(function (line, lineno) { + var first = lines[0].match(/\d+$/)[0] + var cur = line.match(/\d+$/)[0] + t.equal(cur, first, num + '. line ' + lineno + ' matches') + }) + + var resExpr = /^first write \d+\nsecond write \d+\nthird write \d+\nfinal write \d+\n$/ + t.similar(res, resExpr, num + '. content matches') + } + } + + // now write something to each stream. + streams.forEach(function (stream, i) { + stream.write('first write ' + i + '\n') + }) + + // wait a sec for those writes to go out. + setTimeout(function () { + // write something else to the target. + fs.writeFileSync(target, 'brutality!\n') + + // write some more stuff. + streams.forEach(function (stream, i) { + stream.write('second write ' + i + '\n') + }) + + setTimeout(function () { + // Oops! Deleted the file! + fs.unlinkSync(target) + + // write some more stuff. + streams.forEach(function (stream, i) { + stream.write('third write ' + i + '\n') + }) + + setTimeout(function () { + fs.writeFileSync(target, 'brutality TWO!\n') + streams.forEach(function (stream, i) { + stream.end('final write ' + i + '\n') + }) + }, 50) + }, 50) + }, 50) +}) + +test('cleanup', function (t) { + fs.readdirSync(__dirname).filter(function (f) { + return f.match(/^test.txt/) + }).forEach(function (file) { + fs.unlinkSync(path.resolve(__dirname, file)) + }) + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/test/chown.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/test/chown.js new file mode 100644 index 00000000..1733cf27 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/test/chown.js @@ -0,0 +1,44 @@ +'use strict' +var fs = require('graceful-fs') +var path = require('path') +var test = require('tap').test +var rimraf = require('rimraf') +var writeStream = require('../index.js') + +var target = path.resolve(__dirname, 'test-chown') + +test('chown works', function (t) { + t.plan(1) + var stream = writeStream(target, {chown: {uid: process.getuid(), gid: process.getgid()}}) + var hadError = false + stream.on('error', function (er) { + hadError = true + console.log('#', er) + }) + stream.on('close', function () { + t.is(hadError, false, 'no errors before close') + }) + stream.end() +}) + +test('chown fails', function (t) { + t.plan(1) + fs.chown = function (file, uid, gid, cb) { + cb(new Error('TEST BREAK')) + } + var stream = writeStream(target, {chown: {uid: process.getuid(), gid: process.getgid()}}) + var hadError = false + stream.on('error', function (er) { + hadError = true + console.log('#', er) + }) + stream.on('close', function () { + t.is(hadError, true, 'error before close') + }) + stream.end() +}) + +test('cleanup', function (t) { + rimraf.sync(target) + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/test/rename-fail.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/test/rename-fail.js new file mode 100644 index 00000000..7e27f0bf --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/test/rename-fail.js @@ -0,0 +1,30 @@ +'use strict' +var fs = require('graceful-fs') +var path = require('path') +var test = require('tap').test +var rimraf = require('rimraf') +var writeStream = require('../index.js') + +var target = path.resolve(__dirname, 'test-rename') + +test('rename fails', function (t) { + t.plan(1) + fs.rename = function (src, dest, cb) { + cb(new Error('TEST BREAK')) + } + var stream = writeStream(target) + var hadError = false + stream.on('error', function (er) { + hadError = true + console.log('#', er) + }) + stream.on('close', function () { + t.is(hadError, true, 'error before close') + }) + stream.end() +}) + +test('cleanup', function (t) { + rimraf.sync(target) + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/test/slow-close.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/test/slow-close.js new file mode 100644 index 00000000..9840a6ef --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/test/slow-close.js @@ -0,0 +1,40 @@ +'use strict' +var fs = require('graceful-fs') +var path = require('path') +var test = require('tap').test +var rimraf = require('rimraf') +var writeStream = require('../index.js') + +var target = path.resolve(__dirname, 'test-chown') + +test('slow close', function (t) { + t.plan(2) + // The goal here is to simulate the "file close" step happening so slowly + // that the whole close/rename process could finish before the file is + // actually closed (and thus buffers truely flushed to the OS). In + // previous versions of this module, this would result in the module + // emitting finish & close before the file was fully written and in + // turn, could break other layers that tried to read the new file. + var realEmit = fs.WriteStream.prototype.emit + var reallyClosed = false + fs.WriteStream.prototype.emit = function (event) { + if (event !== 'close') return realEmit.apply(this, arguments) + setTimeout(function () { + reallyClosed = true + realEmit.call(this, 'close') + }.bind(this), 200) + } + var stream = writeStream(target) + stream.on('finish', function () { + t.is(reallyClosed, true, "didn't finish before target was closed") + }) + stream.on('close', function () { + t.is(reallyClosed, true, "didn't close before target was closed") + }) + stream.end() +}) + +test('cleanup', function (t) { + rimraf.sync(target) + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/test/toolong.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/test/toolong.js new file mode 100644 index 00000000..f146cc55 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-write-stream-atomic/test/toolong.js @@ -0,0 +1,29 @@ +var path = require('path') +var test = require('tap').test +var writeStream = require('../index.js') + +function repeat (times, string) { + var output = '' + for (var ii = 0; ii < times; ++ii) { + output += string + } + return output +} + +var target = path.resolve(__dirname, repeat(1000, 'test')) + +test('name too long', function (t) { + t.plan(2) + var stream = writeStream(target) + var hadError = false + stream.on('error', function (er) { + if (!hadError) { + t.is(er.code, 'ENAMETOOLONG', target.length + ' character name results in ENAMETOOLONG') + hadError = true + } + }) + stream.on('close', function () { + t.ok(hadError, 'got error before close') + }) + stream.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/.npmignore new file mode 100644 index 00000000..c02f40ce --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/.npmignore @@ -0,0 +1,3 @@ +# ignore the output junk from the example scripts +example/output +node_modules/ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/.travis.yml new file mode 100644 index 00000000..3637c003 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/.travis.yml @@ -0,0 +1,15 @@ +language: node_js +sudo: false +node_js: + - "5" + - "4" + - iojs + - "0.12" + - "0.10" + - "0.8" +before_install: + - "npm config set spin false" + - "npm install -g npm" +script: "npm test" +notifications: + slack: npm-inc:kRqQjto7YbINqHPb1X6nS3g8 diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/README.md new file mode 100644 index 00000000..2c01e907 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/README.md @@ -0,0 +1,18 @@ +# fstream-npm + +This is an fstream DirReader class that will read a directory and filter +things according to the semantics of what goes in an npm package. + +For example: + +```javascript +// This will print out all the files that would be included +// by 'npm publish' or 'npm install' of this directory. + +var FN = require("fstream-npm") +FN({ path: "./" }) + .on("child", function (e) { + console.error(e.path.substr(e.root.path.length + 1)) + }) +``` + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/example/bundle.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/example/bundle.js new file mode 100644 index 00000000..159e4f7b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/example/bundle.js @@ -0,0 +1,13 @@ +// this example will bundle every dependency +var P = require("../") +P({ path: "./" }) + .on("package", bundleIt) + .on("entry", function (e) { + console.error(e.constructor.name, e.path.substr(e.root.dirname.length + 1)) + e.on("package", bundleIt) + }) + +function bundleIt (p) { + p.bundleDependencies = Object.keys(p.dependencies || {}) +} + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/example/dir-tar.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/example/dir-tar.js new file mode 100644 index 00000000..393c796b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/example/dir-tar.js @@ -0,0 +1,19 @@ +// this will show what ends up in the fstream-npm package +var P = require('fstream').DirReader +var tar = require('tar') +function f (entry) { + return entry.basename !== '.git' +} + +new P({ path: './', type: 'Directory', Directory: true, filter: f }) + .on('package', function (p) { + console.error('package', p) + }) + .on('ignoreFile', function (e) { + console.error('ignoreFile', e) + }) + .on('entry', function (e) { + console.error(e.constructor.name, e.path.substr(e.root.path.length + 1)) + }) + .pipe(tar.Pack()) + .pipe(process.stdout) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/example/dir.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/example/dir.js new file mode 100644 index 00000000..e524a3bf --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/example/dir.js @@ -0,0 +1,25 @@ +// this will show what ends up in the fstream-npm package +var P = require('../') +var DW = require('fstream').DirWriter + +var target = new DW({ Directory: true, type: 'Directory', + path: __dirname + '/output'}) + +function f (entry) { + return entry.basename !== '.git' +} + +P({ path: './', type: 'Directory', isDirectory: true, filter: f }) + .on('package', function (p) { + console.error('package', p) + }) + .on('ignoreFile', function (e) { + console.error('ignoreFile', e) + }) + .on('entry', function (e) { + console.error(e.constructor.name, e.path) + }) + .pipe(target) + .on('end', function () { + console.error('ended') + }) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/example/example.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/example/example.js new file mode 100644 index 00000000..2c933c44 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/example/example.js @@ -0,0 +1,12 @@ +// this will show what ends up in the fstream-npm package +var P = require('../') +P({ path: './' }) + .on('package', function (p) { + console.error('package', p) + }) + .on('ignoreFile', function (e) { + console.error('ignoreFile', e) + }) + .on('entry', function (e) { + console.error(e.constructor.name, e.path.substr(e.root.dirname.length + 1)) + }) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/example/ig-tar.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/example/ig-tar.js new file mode 100644 index 00000000..7a5b61fb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/example/ig-tar.js @@ -0,0 +1,19 @@ +// this will show what ends up in the fstream-npm package +var P = require('fstream-ignore') +var tar = require('tar') +function f (entry) { + return entry.basename !== '.git' +} + +new P({ path: './', type: 'Directory', Directory: true, filter: f }) + .on('package', function (p) { + console.error('package', p) + }) + .on('ignoreFile', function (e) { + console.error('ignoreFile', e) + }) + .on('entry', function (e) { + console.error(e.constructor.name, e.path.substr(e.root.path.length + 1)) + }) + .pipe(tar.Pack()) + .pipe(process.stdout) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/example/tar.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/example/tar.js new file mode 100644 index 00000000..b7f7e5f0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/example/tar.js @@ -0,0 +1,25 @@ +// this will show what ends up in the fstream-npm package +var P = require('../') +var tar = require('tar') +function f () { + return true +} +// function f (entry) { +// return entry.basename !== ".git" +// } + +new P({ path: './', type: 'Directory', isDirectory: true, filter: f }) + .on('package', function (p) { + console.error('package', p) + }) + .on('ignoreFile', function (e) { + console.error('ignoreFile', e) + }) + .on('entry', function (e) { + console.error(e.constructor.name, e.path) + }) + .on('end', function () { + console.error('ended') + }) + .pipe(tar.Pack()) + .pipe(process.stdout) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/fstream-npm.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/fstream-npm.js new file mode 100644 index 00000000..554b98fe --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/fstream-npm.js @@ -0,0 +1,377 @@ +var Ignore = require('fstream-ignore') +var inherits = require('inherits') +var path = require('path') +var fs = require('fs') + +module.exports = Packer + +inherits(Packer, Ignore) + +function Packer (props) { + if (!(this instanceof Packer)) { + return new Packer(props) + } + + if (typeof props === 'string') { + props = { path: props } + } + + props.ignoreFiles = props.ignoreFiles || [ '.npmignore', + '.gitignore', + 'package.json' ] + + Ignore.call(this, props) + + this.bundled = props.bundled + this.bundleLinks = props.bundleLinks + this.package = props.package + + // only do the magic bundling stuff for the node_modules folder that + // lives right next to a package.json file. + this.bundleMagic = this.parent && + this.parent.packageRoot && + this.basename === 'node_modules' + + // in a node_modules folder, resolve symbolic links to + // bundled dependencies when creating the package. + props.follow = this.follow = this.bundleMagic + // console.error("follow?", this.path, props.follow) + + if (this === this.root || + this.parent && + this.parent.bundleMagic && + this.basename.charAt(0) !== '.') { + this.readBundledLinks() + } + + this.on('entryStat', function (entry, props) { + // files should *always* get into tarballs + // in a user-writable state, even if they're + // being installed from some wackey vm-mounted + // read-only filesystem. + entry.mode = props.mode = props.mode | parseInt('0200', 8) + }) +} + +Packer.prototype.readBundledLinks = function () { + if (this._paused) { + this.once('resume', this.addIgnoreFiles) + return + } + + this.pause() + fs.readdir(this.path + '/node_modules', function (er, list) { + // no harm if there's no bundle + var l = list && list.length + if (er || l === 0) return this.resume() + + var errState = null + var then = function then (er) { + if (errState) return + if (er) { + errState = er + return this.resume() + } + if (--l === 0) return this.resume() + }.bind(this) + + list.forEach(function (pkg) { + if (pkg.charAt(0) === '.') return then() + var pd = this.path + '/node_modules/' + pkg + + // scoped packages + if (pkg.charAt(0) === '@') { + fs.readdir(pd, function (er, slist) { + var sl = slist && slist.length + if (er || sl === 0) return then(er) + + l += sl + slist.forEach(function (spkg) { + if (spkg.charAt(0) === '.') return then() + var spd = pd + '/' + spkg + fs.realpath(spd, function (er, rp) { + if (er) return then() + this.bundleLinks = this.bundleLinks || {} + this.bundleLinks[pkg + '/' + spkg] = rp + then() + }.bind(this)) + }, this) + then() + }.bind(this)) + return + } + + fs.realpath(pd, function (er, rp) { + if (er) return then() + this.bundleLinks = this.bundleLinks || {} + this.bundleLinks[pkg] = rp + then() + }.bind(this)) + }, this) + }.bind(this)) +} + +Packer.prototype.applyIgnores = function (entry, partial, entryObj) { + if (!entryObj || entryObj.type !== 'Directory') { + // package.json files can never be ignored. + if (entry === 'package.json') return true + + // readme files should never be ignored. + if (entry.match(/^readme(\.[^\.]*)$/i)) return true + + // license files should never be ignored. + if (entry.match(/^(license|licence)(\.[^\.]*)?$/i)) return true + + // copyright notice files should never be ignored. + if (entry.match(/^(notice)(\.[^\.]*)?$/i)) return true + + // changelogs should never be ignored. + if (entry.match(/^(changes|changelog|history)(\.[^\.]*)?$/i)) return true + } + + // special rules. see below. + if (entry === 'node_modules' && this.packageRoot) return true + + // package.json main file should never be ignored. + var mainFile = this.package && this.package.main + if (mainFile && path.resolve(this.path, entry) === path.resolve(this.path, mainFile)) return true + + // some files are *never* allowed under any circumstances + // (VCS folders, native build cruft, npm cruft, regular cruft) + if (entry === '.git' || + entry === 'CVS' || + entry === '.svn' || + entry === '.hg' || + entry === '.lock-wscript' || + entry.match(/^\.wafpickle-[0-9]+$/) || + (this.parent && this.parent.packageRoot && this.basename === 'build' && + entry === 'config.gypi') || + entry === 'npm-debug.log' || + entry === '.npmrc' || + entry.match(/^\..*\.swp$/) || + entry === '.DS_Store' || + entry.match(/^\._/) + ) { + return false + } + + // in a node_modules folder, we only include bundled dependencies + // also, prevent packages in node_modules from being affected + // by rules set in the containing package, so that + // bundles don't get busted. + // Also, once in a bundle, everything is installed as-is + // To prevent infinite cycles in the case of cyclic deps that are + // linked with npm link, even in a bundle, deps are only bundled + // if they're not already present at a higher level. + if (this.bundleMagic) { + if (entry.charAt(0) === '@') { + var firstSlash = entry.indexOf('/') + // continue to list the packages in this scope + if (firstSlash === -1) return true + + // bubbling up. stop here and allow anything the bundled pkg allows + if (entry.indexOf('/', firstSlash + 1) !== -1) return true + } + // bubbling up. stop here and allow anything the bundled pkg allows + else if (entry.indexOf('/') !== -1) return true + + // never include the .bin. It's typically full of platform-specific + // stuff like symlinks and .cmd files anyway. + if (entry === '.bin') return false + + // the package root. + var p = this.parent + // the package before this one. + var pp = p && p.parent + + // if this entry has already been bundled, and is a symlink, + // and it is the *same* symlink as this one, then exclude it. + if (pp && pp.bundleLinks && this.bundleLinks && + pp.bundleLinks[entry] && + pp.bundleLinks[entry] === this.bundleLinks[entry]) { + return false + } + + // since it's *not* a symbolic link, if we're *already* in a bundle, + // then we should include everything. + if (pp && pp.package && pp.basename === 'node_modules') { + return true + } + + // only include it at this point if it's a bundleDependency + var bd = this.package && this.package.bundleDependencies + + if (bd && !Array.isArray(bd)) { + throw new Error(this.package.name + '\'s `bundledDependencies` should ' + + 'be an array') + } + + var shouldBundle = bd && bd.indexOf(entry) !== -1 + // if we're not going to bundle it, then it doesn't count as a bundleLink + // if (this.bundleLinks && !shouldBundle) delete this.bundleLinks[entry] + return shouldBundle + } + // if (this.bundled) return true + + return Ignore.prototype.applyIgnores.call(this, entry, partial, entryObj) +} + +Packer.prototype.addIgnoreFiles = function () { + var entries = this.entries + // if there's a .npmignore, then we do *not* want to + // read the .gitignore. + if (entries.indexOf('.npmignore') !== -1) { + var i = entries.indexOf('.gitignore') + if (i !== -1) { + entries.splice(i, 1) + } + } + + this.entries = entries + + Ignore.prototype.addIgnoreFiles.call(this) +} + +Packer.prototype.readRules = function (buf, e) { + if (e !== 'package.json') { + return Ignore.prototype.readRules.call(this, buf, e) + } + + buf = buf.toString().trim() + + if (buf.length === 0) return [] + + try { + var p = this.package = JSON.parse(buf) + } catch (er) { + // just pretend it's a normal old file, not magic at all. + return [] + } + + if (this === this.root) { + this.bundleLinks = this.bundleLinks || {} + this.bundleLinks[p.name] = this._path + } + + this.packageRoot = true + this.emit('package', p) + + // make bundle deps predictable + if (p.bundledDependencies && !p.bundleDependencies) { + p.bundleDependencies = p.bundledDependencies + delete p.bundledDependencies + } + + if (!p.files || !Array.isArray(p.files)) return [] + + // ignore everything except what's in the files array. + return ['*'].concat(p.files.map(function (f) { + return '!' + f + })).concat(p.files.map(function (f) { + return '!' + f.replace(/\/+$/, '') + '/**' + })) +} + +Packer.prototype.getChildProps = function (stat) { + var props = Ignore.prototype.getChildProps.call(this, stat) + + props.package = this.package + + props.bundled = this.bundled && this.bundled.slice(0) + props.bundleLinks = this.bundleLinks && + Object.create(this.bundleLinks) + + // Directories have to be read as Packers + // otherwise fstream.Reader will create a DirReader instead. + if (stat.isDirectory()) { + props.type = this.constructor + } + + // only follow symbolic links directly in the node_modules folder. + props.follow = false + return props +} + +var order = [ + 'package.json', + '.npmignore', + '.gitignore', + /^README(\.md)?$/, + 'LICENCE', + 'LICENSE', + /\.js$/ +] + +Packer.prototype.sort = function (a, b) { + for (var i = 0, l = order.length; i < l; i++) { + var o = order[i] + if (typeof o === 'string') { + if (a === o) return -1 + if (b === o) return 1 + } else { + if (a.match(o)) return -1 + if (b.match(o)) return 1 + } + } + + // deps go in the back + if (a === 'node_modules') return 1 + if (b === 'node_modules') return -1 + + return Ignore.prototype.sort.call(this, a, b) +} + +Packer.prototype.emitEntry = function (entry) { + if (this._paused) { + this.once('resume', this.emitEntry.bind(this, entry)) + return + } + + // if there is a .gitignore, then we're going to + // rename it to .npmignore in the output. + if (entry.basename === '.gitignore') { + entry.basename = '.npmignore' + entry.path = path.resolve(entry.dirname, entry.basename) + } + + // all *.gyp files are renamed to binding.gyp for node-gyp + // but only when they are in the same folder as a package.json file. + if (entry.basename.match(/\.gyp$/) && + this.entries.indexOf('package.json') !== -1) { + entry.basename = 'binding.gyp' + entry.path = path.resolve(entry.dirname, entry.basename) + } + + // skip over symbolic links + if (entry.type === 'SymbolicLink') { + entry.abort() + return + } + + if (entry.type !== 'Directory') { + // make it so that the folder in the tarball is named "package" + var h = path.dirname((entry.root || entry).path) + var t = entry.path.substr(h.length + 1).replace(/^[^\/\\]+/, 'package') + var p = h + '/' + t + + entry.path = p + entry.dirname = path.dirname(p) + return Ignore.prototype.emitEntry.call(this, entry) + } + + // we don't want empty directories to show up in package + // tarballs. + // don't emit entry events for dirs, but still walk through + // and read them. This means that we need to proxy up their + // entry events so that those entries won't be missed, since + // .pipe() doesn't do anythign special with "child" events, on + // with "entry" events. + var me = this + entry.on('entry', function (e) { + if (e.parent === entry) { + e.parent = me + me.emit('entry', e) + } + }) + entry.on('package', this.emit.bind(this, 'package')) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/node_modules/fstream-ignore/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/node_modules/fstream-ignore/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/node_modules/fstream-ignore/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/node_modules/fstream-ignore/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/node_modules/fstream-ignore/README.md new file mode 100644 index 00000000..31170fea --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/node_modules/fstream-ignore/README.md @@ -0,0 +1,22 @@ +# fstream-ignore + +A fstream DirReader that filters out files that match globs in `.ignore` +files throughout the tree, like how git ignores files based on a +`.gitignore` file. + +Here's an example: + +```javascript +var Ignore = require("fstream-ignore") +Ignore({ path: __dirname + , ignoreFiles: [".ignore", ".gitignore"] + }) + .on("child", function (c) { + console.error(c.path.substr(c.root.path.length + 1)) + }) + .pipe(tar.Pack()) + .pipe(fs.createWriteStream("foo.tar")) +``` + +This will tar up the files in __dirname into `foo.tar`, ignoring +anything matched by the globs in any .iginore or .gitignore file. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/node_modules/fstream-ignore/ignore.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/node_modules/fstream-ignore/ignore.js new file mode 100644 index 00000000..212fc7bd --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/node_modules/fstream-ignore/ignore.js @@ -0,0 +1,275 @@ +// Essentially, this is a fstream.DirReader class, but with a +// bit of special logic to read the specified sort of ignore files, +// and a filter that prevents it from picking up anything excluded +// by those files. + +var Minimatch = require("minimatch").Minimatch +, fstream = require("fstream") +, DirReader = fstream.DirReader +, inherits = require("inherits") +, path = require("path") +, fs = require("fs") + +module.exports = IgnoreReader + +inherits(IgnoreReader, DirReader) + +function IgnoreReader (props) { + if (!(this instanceof IgnoreReader)) { + return new IgnoreReader(props) + } + + // must be a Directory type + if (typeof props === "string") { + props = { path: path.resolve(props) } + } + + props.type = "Directory" + props.Directory = true + + if (!props.ignoreFiles) props.ignoreFiles = [".ignore"] + this.ignoreFiles = props.ignoreFiles + + this.ignoreRules = null + + // ensure that .ignore files always show up at the top of the list + // that way, they can be read before proceeding to handle other + // entries in that same folder + if (props.sort) { + this._sort = props.sort === "alpha" ? alphasort : props.sort + props.sort = null + } + + this.on("entries", function () { + // if there are any ignore files in the list, then + // pause and add them. + // then, filter the list based on our ignoreRules + + var hasIg = this.entries.some(this.isIgnoreFile, this) + + if (!hasIg) return this.filterEntries() + + this.addIgnoreFiles() + }) + + // we filter entries before we know what they are. + // however, directories have to be re-tested against + // rules with a "/" appended, because "a/b/" will only + // match if "a/b" is a dir, and not otherwise. + this.on("_entryStat", function (entry, props) { + var t = entry.basename + if (!this.applyIgnores(entry.basename, + entry.type === "Directory", + entry)) { + entry.abort() + } + }.bind(this)) + + DirReader.call(this, props) +} + + +IgnoreReader.prototype.addIgnoreFiles = function () { + if (this._paused) { + this.once("resume", this.addIgnoreFiles) + return + } + if (this._ignoreFilesAdded) return + this._ignoreFilesAdded = true + + var newIg = this.entries.filter(this.isIgnoreFile, this) + , count = newIg.length + , errState = null + + if (!count) return + + this.pause() + + var then = function (er) { + if (errState) return + if (er) return this.emit("error", errState = er) + if (-- count === 0) { + this.filterEntries() + this.resume() + } else { + this.addIgnoreFile(newIg[newIg.length - count], then) + } + }.bind(this) + + this.addIgnoreFile(newIg[0], then) +} + + +IgnoreReader.prototype.isIgnoreFile = function (e) { + return e !== "." && + e !== ".." && + -1 !== this.ignoreFiles.indexOf(e) +} + + +IgnoreReader.prototype.getChildProps = function (stat) { + var props = DirReader.prototype.getChildProps.call(this, stat) + props.ignoreFiles = this.ignoreFiles + + // Directories have to be read as IgnoreReaders + // otherwise fstream.Reader will create a DirReader instead. + if (stat.isDirectory()) { + props.type = this.constructor + } + return props +} + + +IgnoreReader.prototype.addIgnoreFile = function (e, cb) { + // read the file, and then call addIgnoreRules + // if there's an error, then tell the cb about it. + + var ig = path.resolve(this.path, e) + fs.readFile(ig, function (er, data) { + if (er) return cb(er) + + this.emit("ignoreFile", e, data) + var rules = this.readRules(data, e) + this.addIgnoreRules(rules, e) + cb() + }.bind(this)) +} + + +IgnoreReader.prototype.readRules = function (buf, e) { + return buf.toString().split(/\r?\n/) +} + + +// Override this to do fancier things, like read the +// "files" array from a package.json file or something. +IgnoreReader.prototype.addIgnoreRules = function (set, e) { + // filter out anything obvious + set = set.filter(function (s) { + s = s.trim() + return s && !s.match(/^#/) + }) + + // no rules to add! + if (!set.length) return + + // now get a minimatch object for each one of these. + // Note that we need to allow dot files by default, and + // not switch the meaning of their exclusion + var mmopt = { matchBase: true, dot: true, flipNegate: true } + , mm = set.map(function (s) { + var m = new Minimatch(s, mmopt) + m.ignoreFile = e + return m + }) + + if (!this.ignoreRules) this.ignoreRules = [] + this.ignoreRules.push.apply(this.ignoreRules, mm) +} + + +IgnoreReader.prototype.filterEntries = function () { + // this exclusion is at the point where we know the list of + // entries in the dir, but don't know what they are. since + // some of them *might* be directories, we have to run the + // match in dir-mode as well, so that we'll pick up partials + // of files that will be included later. Anything included + // at this point will be checked again later once we know + // what it is. + this.entries = this.entries.filter(function (entry) { + // at this point, we don't know if it's a dir or not. + return this.applyIgnores(entry) || this.applyIgnores(entry, true) + }, this) +} + + +IgnoreReader.prototype.applyIgnores = function (entry, partial, obj) { + var included = true + + // this = /a/b/c + // entry = d + // parent /a/b sees c/d + if (this.parent && this.parent.applyIgnores) { + var pt = this.basename + "/" + entry + included = this.parent.applyIgnores(pt, partial) + } + + // Negated Rules + // Since we're *ignoring* things here, negating means that a file + // is re-included, if it would have been excluded by a previous + // rule. So, negated rules are only relevant if the file + // has been excluded. + // + // Similarly, if a file has been excluded, then there's no point + // trying it against rules that have already been applied + // + // We're using the "flipnegate" flag here, which tells minimatch + // to set the "negate" for our information, but still report + // whether the core pattern was a hit or a miss. + + if (!this.ignoreRules) { + return included + } + + this.ignoreRules.forEach(function (rule) { + // negation means inclusion + if (rule.negate && included || + !rule.negate && !included) { + // unnecessary + return + } + + // first, match against /foo/bar + var match = rule.match("/" + entry) + + if (!match) { + // try with the leading / trimmed off the test + // eg: foo/bar instead of /foo/bar + match = rule.match(entry) + } + + // if the entry is a directory, then it will match + // with a trailing slash. eg: /foo/bar/ or foo/bar/ + if (!match && partial) { + match = rule.match("/" + entry + "/") || + rule.match(entry + "/") + } + + // When including a file with a negated rule, it's + // relevant if a directory partially matches, since + // it may then match a file within it. + // Eg, if you ignore /a, but !/a/b/c + if (!match && rule.negate && partial) { + match = rule.match("/" + entry, true) || + rule.match(entry, true) + } + + if (match) { + included = rule.negate + } + }, this) + + return included +} + + +IgnoreReader.prototype.sort = function (a, b) { + var aig = this.ignoreFiles.indexOf(a) !== -1 + , big = this.ignoreFiles.indexOf(b) !== -1 + + if (aig && !big) return -1 + if (big && !aig) return 1 + return this._sort(a, b) +} + +IgnoreReader.prototype._sort = function (a, b) { + return 0 +} + +function alphasort (a, b) { + return a === b ? 0 + : a.toLowerCase() > b.toLowerCase() ? 1 + : a.toLowerCase() < b.toLowerCase() ? -1 + : a > b ? 1 + : -1 +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/node_modules/fstream-ignore/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/node_modules/fstream-ignore/package.json new file mode 100644 index 00000000..72dd3421 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/node_modules/fstream-ignore/package.json @@ -0,0 +1,71 @@ +{ + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "name": "fstream-ignore", + "description": "A thing for ignoring files based on globs", + "version": "1.0.5", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/fstream-ignore.git" + }, + "main": "ignore.js", + "scripts": { + "test": "tap test/*.js --cov" + }, + "dependencies": { + "fstream": "^1.0.0", + "inherits": "2", + "minimatch": "^3.0.0" + }, + "devDependencies": { + "mkdirp": "", + "rimraf": "", + "tap": "^5.7.1" + }, + "license": "ISC", + "files": [ + "ignore.js" + ], + "gitHead": "1438a1a2c25fee71327c36c86de787a14a53ffd4", + "bugs": { + "url": "https://github.com/isaacs/fstream-ignore/issues" + }, + "homepage": "https://github.com/isaacs/fstream-ignore#readme", + "_id": "fstream-ignore@1.0.5", + "_shasum": "9c31dae34767018fe1d249b24dada67d092da105", + "_from": "fstream-ignore@>=1.0.0 <2.0.0", + "_npmVersion": "3.9.1", + "_nodeVersion": "5.10.1", + "_npmUser": { + "name": "zkat", + "email": "kat@sykosomatic.org" + }, + "dist": { + "shasum": "9c31dae34767018fe1d249b24dada67d092da105", + "tarball": "https://registry.npmjs.org/fstream-ignore/-/fstream-ignore-1.0.5.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" + } + ], + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/fstream-ignore-1.0.5.tgz_1463518095640_0.10221575922332704" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/fstream-ignore/-/fstream-ignore-1.0.5.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/package.json new file mode 100644 index 00000000..35af4788 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/package.json @@ -0,0 +1,72 @@ +{ + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "name": "fstream-npm", + "description": "fstream class for creating npm packages", + "version": "1.1.1", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/fstream-npm.git" + }, + "scripts": { + "test": "standard && tap test/*.js" + }, + "main": "./fstream-npm.js", + "dependencies": { + "fstream-ignore": "^1.0.0", + "inherits": "2" + }, + "devDependencies": { + "graceful-fs": "^4.1.2", + "mkdirp": "^0.5.1", + "rimraf": "^2.4.2", + "standard": "^4.3.1", + "tap": "^1.3.2" + }, + "license": "ISC", + "gitHead": "434415a678c4759c997207f974b25c7492d39127", + "bugs": { + "url": "https://github.com/npm/fstream-npm/issues" + }, + "homepage": "https://github.com/npm/fstream-npm#readme", + "_id": "fstream-npm@1.1.1", + "_shasum": "6b9175db6239a83d8209e232426c494dbb29690c", + "_from": "fstream-npm@1.1.1", + "_npmVersion": "3.10.6", + "_nodeVersion": "5.10.1", + "_npmUser": { + "name": "zkat", + "email": "kat@sykosomatic.org" + }, + "dist": { + "shasum": "6b9175db6239a83d8209e232426c494dbb29690c", + "tarball": "https://registry.npmjs.org/fstream-npm/-/fstream-npm-1.1.1.tgz" + }, + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + }, + { + "name": "isaacs", + "email": "i@izs.me" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" + } + ], + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/fstream-npm-1.1.1.tgz_1470163716583_0.04285589815117419" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/fstream-npm/-/fstream-npm-1.1.1.tgz" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/test/ignores.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/test/ignores.js new file mode 100644 index 00000000..ac94251f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/test/ignores.js @@ -0,0 +1,132 @@ +var fs = require('graceful-fs') +var join = require('path').join + +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var test = require('tap').test + +var Packer = require('..') + +var pkg = join(__dirname, 'test-package') + +var elfJS = function () {/* +module.exports = function () { + console.log("i'm a elf") +} +*/}.toString().split('\n').slice(1, -1).join() + +var json = { + 'name': 'test-package', + 'version': '3.1.4', + 'main': 'elf.js' +} + +test('setup', function (t) { + setup() + t.end() +}) + +var included = [ + 'package.json', + 'elf.js', + join('deps', 'foo', 'config', 'config.gypi') +] + +test('follows npm package ignoring rules', function (t) { + var subject = new Packer({ path: pkg, type: 'Directory', isDirectory: true }) + var filenames = [] + subject.on('entry', function (entry) { + t.equal(entry.type, 'File', 'only files in this package') + + // include relative path in filename + var filename = entry._path.slice(entry.root._path.length + 1) + + filenames.push(filename) + }) + // need to do this so fstream doesn't explode when files are removed from + // under it + subject.on('end', function () { + // ensure we get *exactly* the results we expect by comparing in both + // directions + filenames.forEach(function (filename) { + t.ok( + included.indexOf(filename) > -1, + filename + ' is included' + ) + }) + included.forEach(function (filename) { + t.ok( + filenames.indexOf(filename) > -1, + filename + ' is not included' + ) + }) + t.end() + }) +}) + +test('cleanup', function (t) { + // rimraf.sync chokes here for some reason + rimraf(pkg, function () { t.end() }) +}) + +function setup () { + rimraf.sync(pkg) + mkdirp.sync(pkg) + fs.writeFileSync( + join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + + fs.writeFileSync( + join(pkg, 'elf.js'), + elfJS + ) + + fs.writeFileSync( + join(pkg, '.npmrc'), + 'packaged=false' + ) + + fs.writeFileSync( + join(pkg, '.npmignore'), + '.npmignore\ndummy\npackage.json' + ) + + fs.writeFileSync( + join(pkg, 'dummy'), + 'foo' + ) + + var buildDir = join(pkg, 'build') + mkdirp.sync(buildDir) + fs.writeFileSync( + join(buildDir, 'config.gypi'), + "i_wont_be_included_by_fstream='with any luck'" + ) + + var depscfg = join(pkg, 'deps', 'foo', 'config') + mkdirp.sync(depscfg) + fs.writeFileSync( + join(depscfg, 'config.gypi'), + "i_will_be_included_by_fstream='with any luck'" + ) + + fs.writeFileSync( + join(buildDir, 'npm-debug.log'), + '0 lol\n' + ) + + var gitDir = join(pkg, '.git') + mkdirp.sync(gitDir) + fs.writeFileSync( + join(gitDir, 'gitstub'), + "won't fool git, also won't be included by fstream" + ) + + var historyDir = join(pkg, 'node_modules/history') + mkdirp.sync(historyDir) + fs.writeFileSync( + join(historyDir, 'README.md'), + "please don't include me" + ) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/test/scoped.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/test/scoped.js new file mode 100644 index 00000000..c001c1b3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream-npm/test/scoped.js @@ -0,0 +1,94 @@ +var fs = require('graceful-fs') +var join = require('path').join + +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var test = require('tap').test + +var Packer = require('..') + +var pkg = join(__dirname, 'test-package-scoped') + +var elfJS = function () {/* +module.exports = function () { + console.log("i'm a elf") +} +*/}.toString().split('\n').slice(1, -1).join() + +var json = { + 'name': 'test-package-scoped', + 'version': '3.1.4', + 'main': 'elf.js', + 'bundledDependencies': [ + '@npmwombat/scoped' + ] +} + +test('setup', function (t) { + setup() + t.end() +}) + +var included = [ + 'package.json', + 'elf.js', + join('node_modules', '@npmwombat', 'scoped', 'index.js') +] + +test('includes bundledDependencies', function (t) { + var subject = new Packer({ path: pkg, type: 'Directory', isDirectory: true }) + var filenames = [] + subject.on('entry', function (entry) { + t.equal(entry.type, 'File', 'only files in this package') + + // include relative path in filename + var filename = entry._path.slice(entry.root._path.length + 1) + + filenames.push(filename) + }) + // need to do this so fstream doesn't explode when files are removed from + // under it + subject.on('end', function () { + // ensure we get *exactly* the results we expect by comparing in both + // directions + filenames.forEach(function (filename) { + t.ok( + included.indexOf(filename) > -1, + filename + ' is included' + ) + }) + included.forEach(function (filename) { + t.ok( + filenames.indexOf(filename) > -1, + filename + ' is not included' + ) + }) + t.end() + }) +}) + +test('cleanup', function (t) { + // rimraf.sync chokes here for some reason + rimraf(pkg, function () { t.end() }) +}) + +function setup () { + rimraf.sync(pkg) + mkdirp.sync(pkg) + fs.writeFileSync( + join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + + fs.writeFileSync( + join(pkg, 'elf.js'), + elfJS + ) + + var scopedDir = join(pkg, 'node_modules', '@npmwombat', 'scoped') + mkdirp.sync(scopedDir) + fs.writeFileSync( + join(scopedDir, 'index.js'), + "console.log('hello wombat')" + ) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/.npmignore new file mode 100644 index 00000000..494272a8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/.npmignore @@ -0,0 +1,5 @@ +.*.swp +node_modules/ +examples/deep-copy/ +examples/path/ +examples/filter-copy/ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/.travis.yml new file mode 100644 index 00000000..9f5972ab --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/.travis.yml @@ -0,0 +1,9 @@ +language: node_js +node_js: + - "6" + - "4" + - "0.10" + - "0.12" +before_install: + - "npm config set spin false" + - "npm install -g npm/npm" diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/README.md new file mode 100644 index 00000000..9d8cb77e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/README.md @@ -0,0 +1,76 @@ +Like FS streams, but with stat on them, and supporting directories and +symbolic links, as well as normal files. Also, you can use this to set +the stats on a file, even if you don't change its contents, or to create +a symlink, etc. + +So, for example, you can "write" a directory, and it'll call `mkdir`. You +can specify a uid and gid, and it'll call `chown`. You can specify a +`mtime` and `atime`, and it'll call `utimes`. You can call it a symlink +and provide a `linkpath` and it'll call `symlink`. + +Note that it won't automatically resolve symbolic links. So, if you +call `fstream.Reader('/some/symlink')` then you'll get an object +that stats and then ends immediately (since it has no data). To follow +symbolic links, do this: `fstream.Reader({path:'/some/symlink', follow: +true })`. + +There are various checks to make sure that the bytes emitted are the +same as the intended size, if the size is set. + +## Examples + +```javascript +fstream + .Writer({ path: "path/to/file" + , mode: 0755 + , size: 6 + }) + .write("hello\n") + .end() +``` + +This will create the directories if they're missing, and then write +`hello\n` into the file, chmod it to 0755, and assert that 6 bytes have +been written when it's done. + +```javascript +fstream + .Writer({ path: "path/to/file" + , mode: 0755 + , size: 6 + , flags: "a" + }) + .write("hello\n") + .end() +``` + +You can pass flags in, if you want to append to a file. + +```javascript +fstream + .Writer({ path: "path/to/symlink" + , linkpath: "./file" + , SymbolicLink: true + , mode: "0755" // octal strings supported + }) + .end() +``` + +If isSymbolicLink is a function, it'll be called, and if it returns +true, then it'll treat it as a symlink. If it's not a function, then +any truish value will make a symlink, or you can set `type: +'SymbolicLink'`, which does the same thing. + +Note that the linkpath is relative to the symbolic link location, not +the parent dir or cwd. + +```javascript +fstream + .Reader("path/to/dir") + .pipe(fstream.Writer("path/to/other/dir")) +``` + +This will do like `cp -Rp path/to/dir path/to/other/dir`. If the other +dir exists and isn't a directory, then it'll emit an error. It'll also +set the uid, gid, mode, etc. to be identical. In this way, it's more +like `rsync -a` than simply a copy. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/examples/filter-pipe.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/examples/filter-pipe.js new file mode 100644 index 00000000..83dadef8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/examples/filter-pipe.js @@ -0,0 +1,134 @@ +var fstream = require('../fstream.js') +var path = require('path') + +var r = fstream.Reader({ + path: path.dirname(__dirname), + filter: function () { + return !this.basename.match(/^\./) && + !this.basename.match(/^node_modules$/) && + !this.basename.match(/^deep-copy$/) && + !this.basename.match(/^filter-copy$/) + } +}) + +// this writer will only write directories +var w = fstream.Writer({ + path: path.resolve(__dirname, 'filter-copy'), + type: 'Directory', + filter: function () { + return this.type === 'Directory' + } +}) + +var indent = '' + +r.on('entry', appears) +r.on('ready', function () { + console.error('ready to begin!', r.path) +}) + +function appears (entry) { + console.error(indent + 'a %s appears!', entry.type, entry.basename, typeof entry.basename) + if (foggy) { + console.error('FOGGY!') + var p = entry + do { + console.error(p.depth, p.path, p._paused) + p = p.parent + } while (p) + + throw new Error('\u001b[mshould not have entries while foggy') + } + indent += '\t' + entry.on('data', missile(entry)) + entry.on('end', runaway(entry)) + entry.on('entry', appears) +} + +var foggy +function missile (entry) { + function liftFog (who) { + if (!foggy) return + if (who) { + console.error('%s breaks the spell!', who && who.path) + } else { + console.error('the spell expires!') + } + console.error('\u001b[mthe fog lifts!\n') + clearTimeout(foggy) + foggy = null + if (entry._paused) entry.resume() + } + + if (entry.type === 'Directory') { + var ended = false + entry.once('end', function () { ended = true }) + return function (c) { + // throw in some pathological pause()/resume() behavior + // just for extra fun. + process.nextTick(function () { + if (!foggy && !ended) { // && Math.random() < 0.3) { + console.error(indent + '%s casts a spell', entry.basename) + console.error('\na slowing fog comes over the battlefield...\n\u001b[32m') + entry.pause() + entry.once('resume', liftFog) + foggy = setTimeout(liftFog, 1000) + } + }) + } + } + + return function (c) { + var e = Math.random() < 0.5 + console.error(indent + '%s %s for %d damage!', + entry.basename, + e ? 'is struck' : 'fires a chunk', + c.length) + } +} + +function runaway (entry) { + return function () { + var e = Math.random() < 0.5 + console.error(indent + '%s %s', + entry.basename, + e ? 'turns to flee' : 'is vanquished!') + indent = indent.slice(0, -1) + } +} + +w.on('entry', attacks) +// w.on('ready', function () { attacks(w) }) +function attacks (entry) { + console.error(indent + '%s %s!', entry.basename, + entry.type === 'Directory' ? 'calls for backup' : 'attacks') + entry.on('entry', attacks) +} + +var ended = false +var i = 1 +r.on('end', function () { + if (foggy) clearTimeout(foggy) + console.error("\u001b[mIT'S OVER!!") + console.error('A WINNAR IS YOU!') + + console.log('ok ' + (i++) + ' A WINNAR IS YOU') + ended = true + // now go through and verify that everything in there is a dir. + var p = path.resolve(__dirname, 'filter-copy') + var checker = fstream.Reader({ path: p }) + checker.checker = true + checker.on('child', function (e) { + var ok = e.type === 'Directory' + console.log((ok ? '' : 'not ') + 'ok ' + (i++) + + ' should be a dir: ' + + e.path.substr(checker.path.length + 1)) + }) +}) + +process.on('exit', function () { + console.log((ended ? '' : 'not ') + 'ok ' + (i) + ' ended') + console.log('1..' + i) +}) + +r.pipe(w) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/examples/pipe.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/examples/pipe.js new file mode 100644 index 00000000..3de42ef3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/examples/pipe.js @@ -0,0 +1,118 @@ +var fstream = require('../fstream.js') +var path = require('path') + +var r = fstream.Reader({ + path: path.dirname(__dirname), + filter: function () { + return !this.basename.match(/^\./) && + !this.basename.match(/^node_modules$/) && + !this.basename.match(/^deep-copy$/) + } +}) + +var w = fstream.Writer({ + path: path.resolve(__dirname, 'deep-copy'), + type: 'Directory' +}) + +var indent = '' + +r.on('entry', appears) +r.on('ready', function () { + console.error('ready to begin!', r.path) +}) + +function appears (entry) { + console.error(indent + 'a %s appears!', entry.type, entry.basename, typeof entry.basename, entry) + if (foggy) { + console.error('FOGGY!') + var p = entry + do { + console.error(p.depth, p.path, p._paused) + p = p.parent + } while (p) + + throw new Error('\u001b[mshould not have entries while foggy') + } + indent += '\t' + entry.on('data', missile(entry)) + entry.on('end', runaway(entry)) + entry.on('entry', appears) +} + +var foggy +function missile (entry) { + function liftFog (who) { + if (!foggy) return + if (who) { + console.error('%s breaks the spell!', who && who.path) + } else { + console.error('the spell expires!') + } + console.error('\u001b[mthe fog lifts!\n') + clearTimeout(foggy) + foggy = null + if (entry._paused) entry.resume() + } + + if (entry.type === 'Directory') { + var ended = false + entry.once('end', function () { ended = true }) + return function (c) { + // throw in some pathological pause()/resume() behavior + // just for extra fun. + process.nextTick(function () { + if (!foggy && !ended) { // && Math.random() < 0.3) { + console.error(indent + '%s casts a spell', entry.basename) + console.error('\na slowing fog comes over the battlefield...\n\u001b[32m') + entry.pause() + entry.once('resume', liftFog) + foggy = setTimeout(liftFog, 10) + } + }) + } + } + + return function (c) { + var e = Math.random() < 0.5 + console.error(indent + '%s %s for %d damage!', + entry.basename, + e ? 'is struck' : 'fires a chunk', + c.length) + } +} + +function runaway (entry) { + return function () { + var e = Math.random() < 0.5 + console.error(indent + '%s %s', + entry.basename, + e ? 'turns to flee' : 'is vanquished!') + indent = indent.slice(0, -1) + } +} + +w.on('entry', attacks) +// w.on('ready', function () { attacks(w) }) +function attacks (entry) { + console.error(indent + '%s %s!', entry.basename, + entry.type === 'Directory' ? 'calls for backup' : 'attacks') + entry.on('entry', attacks) +} + +var ended = false +r.on('end', function () { + if (foggy) clearTimeout(foggy) + console.error("\u001b[mIT'S OVER!!") + console.error('A WINNAR IS YOU!') + + console.log('ok 1 A WINNAR IS YOU') + ended = true +}) + +process.on('exit', function () { + console.log((ended ? '' : 'not ') + 'ok 2 ended') + console.log('1..2') +}) + +r.pipe(w) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/examples/reader.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/examples/reader.js new file mode 100644 index 00000000..19affbe7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/examples/reader.js @@ -0,0 +1,68 @@ +var fstream = require('../fstream.js') +var tap = require('tap') +var fs = require('fs') +var path = require('path') +var dir = path.dirname(__dirname) + +tap.test('reader test', function (t) { + var children = -1 + var gotReady = false + var ended = false + + var r = fstream.Reader({ + path: dir, + filter: function () { + // return this.parent === r + return this.parent === r || this === r + } + }) + + r.on('ready', function () { + gotReady = true + children = fs.readdirSync(dir).length + console.error('Setting expected children to ' + children) + t.equal(r.type, 'Directory', 'should be a directory') + }) + + r.on('entry', function (entry) { + children-- + if (!gotReady) { + t.fail('children before ready!') + } + t.equal(entry.dirname, r.path, 'basename is parent dir') + }) + + r.on('error', function (er) { + t.fail(er) + t.end() + process.exit(1) + }) + + r.on('end', function () { + t.equal(children, 0, 'should have seen all children') + ended = true + }) + + var closed = false + r.on('close', function () { + t.ok(ended, 'saw end before close') + t.notOk(closed, 'close should only happen once') + closed = true + t.end() + }) +}) + +tap.test('reader error test', function (t) { + // assumes non-root on a *nix system + var r = fstream.Reader({ path: '/etc/shadow' }) + + r.once('error', function (er) { + t.ok(true) + t.end() + }) + + r.on('end', function () { + t.fail('reader ended without error') + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/examples/symlink-write.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/examples/symlink-write.js new file mode 100644 index 00000000..19e81eea --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/examples/symlink-write.js @@ -0,0 +1,27 @@ +var fstream = require('../fstream.js') +var notOpen = false +process.chdir(__dirname) + +fstream + .Writer({ + path: 'path/to/symlink', + linkpath: './file', + isSymbolicLink: true, + mode: '0755' // octal strings supported + }) + .on('close', function () { + notOpen = true + var fs = require('fs') + var s = fs.lstatSync('path/to/symlink') + var isSym = s.isSymbolicLink() + console.log((isSym ? '' : 'not ') + 'ok 1 should be symlink') + var t = fs.readlinkSync('path/to/symlink') + var isTarget = t === './file' + console.log((isTarget ? '' : 'not ') + 'ok 2 should link to ./file') + }) + .end() + +process.on('exit', function () { + console.log((notOpen ? '' : 'not ') + 'ok 3 should be closed') + console.log('1..3') +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/fstream.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/fstream.js new file mode 100644 index 00000000..c0eb3bea --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/fstream.js @@ -0,0 +1,35 @@ +exports.Abstract = require('./lib/abstract.js') +exports.Reader = require('./lib/reader.js') +exports.Writer = require('./lib/writer.js') + +exports.File = { + Reader: require('./lib/file-reader.js'), + Writer: require('./lib/file-writer.js') +} + +exports.Dir = { + Reader: require('./lib/dir-reader.js'), + Writer: require('./lib/dir-writer.js') +} + +exports.Link = { + Reader: require('./lib/link-reader.js'), + Writer: require('./lib/link-writer.js') +} + +exports.Proxy = { + Reader: require('./lib/proxy-reader.js'), + Writer: require('./lib/proxy-writer.js') +} + +exports.Reader.Dir = exports.DirReader = exports.Dir.Reader +exports.Reader.File = exports.FileReader = exports.File.Reader +exports.Reader.Link = exports.LinkReader = exports.Link.Reader +exports.Reader.Proxy = exports.ProxyReader = exports.Proxy.Reader + +exports.Writer.Dir = exports.DirWriter = exports.Dir.Writer +exports.Writer.File = exports.FileWriter = exports.File.Writer +exports.Writer.Link = exports.LinkWriter = exports.Link.Writer +exports.Writer.Proxy = exports.ProxyWriter = exports.Proxy.Writer + +exports.collect = require('./lib/collect.js') diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/lib/abstract.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/lib/abstract.js new file mode 100644 index 00000000..97c120e1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/lib/abstract.js @@ -0,0 +1,85 @@ +// the parent class for all fstreams. + +module.exports = Abstract + +var Stream = require('stream').Stream +var inherits = require('inherits') + +function Abstract () { + Stream.call(this) +} + +inherits(Abstract, Stream) + +Abstract.prototype.on = function (ev, fn) { + if (ev === 'ready' && this.ready) { + process.nextTick(fn.bind(this)) + } else { + Stream.prototype.on.call(this, ev, fn) + } + return this +} + +Abstract.prototype.abort = function () { + this._aborted = true + this.emit('abort') +} + +Abstract.prototype.destroy = function () {} + +Abstract.prototype.warn = function (msg, code) { + var self = this + var er = decorate(msg, code, self) + if (!self.listeners('warn')) { + console.error('%s %s\n' + + 'path = %s\n' + + 'syscall = %s\n' + + 'fstream_type = %s\n' + + 'fstream_path = %s\n' + + 'fstream_unc_path = %s\n' + + 'fstream_class = %s\n' + + 'fstream_stack =\n%s\n', + code || 'UNKNOWN', + er.stack, + er.path, + er.syscall, + er.fstream_type, + er.fstream_path, + er.fstream_unc_path, + er.fstream_class, + er.fstream_stack.join('\n')) + } else { + self.emit('warn', er) + } +} + +Abstract.prototype.info = function (msg, code) { + this.emit('info', msg, code) +} + +Abstract.prototype.error = function (msg, code, th) { + var er = decorate(msg, code, this) + if (th) throw er + else this.emit('error', er) +} + +function decorate (er, code, self) { + if (!(er instanceof Error)) er = new Error(er) + er.code = er.code || code + er.path = er.path || self.path + er.fstream_type = er.fstream_type || self.type + er.fstream_path = er.fstream_path || self.path + if (self._path !== self.path) { + er.fstream_unc_path = er.fstream_unc_path || self._path + } + if (self.linkpath) { + er.fstream_linkpath = er.fstream_linkpath || self.linkpath + } + er.fstream_class = er.fstream_class || self.constructor.name + er.fstream_stack = er.fstream_stack || + new Error().stack.split(/\n/).slice(3).map(function (s) { + return s.replace(/^ {4}at /, '') + }) + + return er +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/lib/collect.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/lib/collect.js new file mode 100644 index 00000000..e5d4f358 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/lib/collect.js @@ -0,0 +1,70 @@ +module.exports = collect + +function collect (stream) { + if (stream._collected) return + + if (stream._paused) return stream.on('resume', collect.bind(null, stream)) + + stream._collected = true + stream.pause() + + stream.on('data', save) + stream.on('end', save) + var buf = [] + function save (b) { + if (typeof b === 'string') b = new Buffer(b) + if (Buffer.isBuffer(b) && !b.length) return + buf.push(b) + } + + stream.on('entry', saveEntry) + var entryBuffer = [] + function saveEntry (e) { + collect(e) + entryBuffer.push(e) + } + + stream.on('proxy', proxyPause) + function proxyPause (p) { + p.pause() + } + + // replace the pipe method with a new version that will + // unlock the buffered stuff. if you just call .pipe() + // without a destination, then it'll re-play the events. + stream.pipe = (function (orig) { + return function (dest) { + // console.error(' === open the pipes', dest && dest.path) + + // let the entries flow through one at a time. + // Once they're all done, then we can resume completely. + var e = 0 + ;(function unblockEntry () { + var entry = entryBuffer[e++] + // console.error(" ==== unblock entry", entry && entry.path) + if (!entry) return resume() + entry.on('end', unblockEntry) + if (dest) dest.add(entry) + else stream.emit('entry', entry) + })() + + function resume () { + stream.removeListener('entry', saveEntry) + stream.removeListener('data', save) + stream.removeListener('end', save) + + stream.pipe = orig + if (dest) stream.pipe(dest) + + buf.forEach(function (b) { + if (b) stream.emit('data', b) + else stream.emit('end') + }) + + stream.resume() + } + + return dest + } + })(stream.pipe) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/lib/dir-reader.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/lib/dir-reader.js new file mode 100644 index 00000000..820cdc85 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/lib/dir-reader.js @@ -0,0 +1,252 @@ +// A thing that emits "entry" events with Reader objects +// Pausing it causes it to stop emitting entry events, and also +// pauses the current entry if there is one. + +module.exports = DirReader + +var fs = require('graceful-fs') +var inherits = require('inherits') +var path = require('path') +var Reader = require('./reader.js') +var assert = require('assert').ok + +inherits(DirReader, Reader) + +function DirReader (props) { + var self = this + if (!(self instanceof DirReader)) { + throw new Error('DirReader must be called as constructor.') + } + + // should already be established as a Directory type + if (props.type !== 'Directory' || !props.Directory) { + throw new Error('Non-directory type ' + props.type) + } + + self.entries = null + self._index = -1 + self._paused = false + self._length = -1 + + if (props.sort) { + this.sort = props.sort + } + + Reader.call(this, props) +} + +DirReader.prototype._getEntries = function () { + var self = this + + // race condition. might pause() before calling _getEntries, + // and then resume, and try to get them a second time. + if (self._gotEntries) return + self._gotEntries = true + + fs.readdir(self._path, function (er, entries) { + if (er) return self.error(er) + + self.entries = entries + + self.emit('entries', entries) + if (self._paused) self.once('resume', processEntries) + else processEntries() + + function processEntries () { + self._length = self.entries.length + if (typeof self.sort === 'function') { + self.entries = self.entries.sort(self.sort.bind(self)) + } + self._read() + } + }) +} + +// start walking the dir, and emit an "entry" event for each one. +DirReader.prototype._read = function () { + var self = this + + if (!self.entries) return self._getEntries() + + if (self._paused || self._currentEntry || self._aborted) { + // console.error('DR paused=%j, current=%j, aborted=%j', self._paused, !!self._currentEntry, self._aborted) + return + } + + self._index++ + if (self._index >= self.entries.length) { + if (!self._ended) { + self._ended = true + self.emit('end') + self.emit('close') + } + return + } + + // ok, handle this one, then. + + // save creating a proxy, by stat'ing the thing now. + var p = path.resolve(self._path, self.entries[self._index]) + assert(p !== self._path) + assert(self.entries[self._index]) + + // set this to prevent trying to _read() again in the stat time. + self._currentEntry = p + fs[ self.props.follow ? 'stat' : 'lstat' ](p, function (er, stat) { + if (er) return self.error(er) + + var who = self._proxy || self + + stat.path = p + stat.basename = path.basename(p) + stat.dirname = path.dirname(p) + var childProps = self.getChildProps.call(who, stat) + childProps.path = p + childProps.basename = path.basename(p) + childProps.dirname = path.dirname(p) + + var entry = Reader(childProps, stat) + + // console.error("DR Entry", p, stat.size) + + self._currentEntry = entry + + // "entry" events are for direct entries in a specific dir. + // "child" events are for any and all children at all levels. + // This nomenclature is not completely final. + + entry.on('pause', function (who) { + if (!self._paused && !entry._disowned) { + self.pause(who) + } + }) + + entry.on('resume', function (who) { + if (self._paused && !entry._disowned) { + self.resume(who) + } + }) + + entry.on('stat', function (props) { + self.emit('_entryStat', entry, props) + if (entry._aborted) return + if (entry._paused) { + entry.once('resume', function () { + self.emit('entryStat', entry, props) + }) + } else self.emit('entryStat', entry, props) + }) + + entry.on('ready', function EMITCHILD () { + // console.error("DR emit child", entry._path) + if (self._paused) { + // console.error(" DR emit child - try again later") + // pause the child, and emit the "entry" event once we drain. + // console.error("DR pausing child entry") + entry.pause(self) + return self.once('resume', EMITCHILD) + } + + // skip over sockets. they can't be piped around properly, + // so there's really no sense even acknowledging them. + // if someone really wants to see them, they can listen to + // the "socket" events. + if (entry.type === 'Socket') { + self.emit('socket', entry) + } else { + self.emitEntry(entry) + } + }) + + var ended = false + entry.on('close', onend) + entry.on('disown', onend) + function onend () { + if (ended) return + ended = true + self.emit('childEnd', entry) + self.emit('entryEnd', entry) + self._currentEntry = null + if (!self._paused) { + self._read() + } + } + + // XXX Remove this. Works in node as of 0.6.2 or so. + // Long filenames should not break stuff. + entry.on('error', function (er) { + if (entry._swallowErrors) { + self.warn(er) + entry.emit('end') + entry.emit('close') + } else { + self.emit('error', er) + } + }) + + // proxy up some events. + ;[ + 'child', + 'childEnd', + 'warn' + ].forEach(function (ev) { + entry.on(ev, self.emit.bind(self, ev)) + }) + }) +} + +DirReader.prototype.disown = function (entry) { + entry.emit('beforeDisown') + entry._disowned = true + entry.parent = entry.root = null + if (entry === this._currentEntry) { + this._currentEntry = null + } + entry.emit('disown') +} + +DirReader.prototype.getChildProps = function () { + return { + depth: this.depth + 1, + root: this.root || this, + parent: this, + follow: this.follow, + filter: this.filter, + sort: this.props.sort, + hardlinks: this.props.hardlinks + } +} + +DirReader.prototype.pause = function (who) { + var self = this + if (self._paused) return + who = who || self + self._paused = true + if (self._currentEntry && self._currentEntry.pause) { + self._currentEntry.pause(who) + } + self.emit('pause', who) +} + +DirReader.prototype.resume = function (who) { + var self = this + if (!self._paused) return + who = who || self + + self._paused = false + // console.error('DR Emit Resume', self._path) + self.emit('resume', who) + if (self._paused) { + // console.error('DR Re-paused', self._path) + return + } + + if (self._currentEntry) { + if (self._currentEntry.resume) self._currentEntry.resume(who) + } else self._read() +} + +DirReader.prototype.emitEntry = function (entry) { + this.emit('entry', entry) + this.emit('child', entry) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/lib/dir-writer.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/lib/dir-writer.js new file mode 100644 index 00000000..ec50dca9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/lib/dir-writer.js @@ -0,0 +1,174 @@ +// It is expected that, when .add() returns false, the consumer +// of the DirWriter will pause until a "drain" event occurs. Note +// that this is *almost always going to be the case*, unless the +// thing being written is some sort of unsupported type, and thus +// skipped over. + +module.exports = DirWriter + +var Writer = require('./writer.js') +var inherits = require('inherits') +var mkdir = require('mkdirp') +var path = require('path') +var collect = require('./collect.js') + +inherits(DirWriter, Writer) + +function DirWriter (props) { + var self = this + if (!(self instanceof DirWriter)) { + self.error('DirWriter must be called as constructor.', null, true) + } + + // should already be established as a Directory type + if (props.type !== 'Directory' || !props.Directory) { + self.error('Non-directory type ' + props.type + ' ' + + JSON.stringify(props), null, true) + } + + Writer.call(this, props) +} + +DirWriter.prototype._create = function () { + var self = this + mkdir(self._path, Writer.dirmode, function (er) { + if (er) return self.error(er) + // ready to start getting entries! + self.ready = true + self.emit('ready') + self._process() + }) +} + +// a DirWriter has an add(entry) method, but its .write() doesn't +// do anything. Why a no-op rather than a throw? Because this +// leaves open the door for writing directory metadata for +// gnu/solaris style dumpdirs. +DirWriter.prototype.write = function () { + return true +} + +DirWriter.prototype.end = function () { + this._ended = true + this._process() +} + +DirWriter.prototype.add = function (entry) { + var self = this + + // console.error('\tadd', entry._path, '->', self._path) + collect(entry) + if (!self.ready || self._currentEntry) { + self._buffer.push(entry) + return false + } + + // create a new writer, and pipe the incoming entry into it. + if (self._ended) { + return self.error('add after end') + } + + self._buffer.push(entry) + self._process() + + return this._buffer.length === 0 +} + +DirWriter.prototype._process = function () { + var self = this + + // console.error('DW Process p=%j', self._processing, self.basename) + + if (self._processing) return + + var entry = self._buffer.shift() + if (!entry) { + // console.error("DW Drain") + self.emit('drain') + if (self._ended) self._finish() + return + } + + self._processing = true + // console.error("DW Entry", entry._path) + + self.emit('entry', entry) + + // ok, add this entry + // + // don't allow recursive copying + var p = entry + var pp + do { + pp = p._path || p.path + if (pp === self.root._path || pp === self._path || + (pp && pp.indexOf(self._path) === 0)) { + // console.error('DW Exit (recursive)', entry.basename, self._path) + self._processing = false + if (entry._collected) entry.pipe() + return self._process() + } + p = p.parent + } while (p) + + // console.error("DW not recursive") + + // chop off the entry's root dir, replace with ours + var props = { + parent: self, + root: self.root || self, + type: entry.type, + depth: self.depth + 1 + } + + pp = entry._path || entry.path || entry.props.path + if (entry.parent) { + pp = pp.substr(entry.parent._path.length + 1) + } + // get rid of any ../../ shenanigans + props.path = path.join(self.path, path.join('/', pp)) + + // if i have a filter, the child should inherit it. + props.filter = self.filter + + // all the rest of the stuff, copy over from the source. + Object.keys(entry.props).forEach(function (k) { + if (!props.hasOwnProperty(k)) { + props[k] = entry.props[k] + } + }) + + // not sure at this point what kind of writer this is. + var child = self._currentChild = new Writer(props) + child.on('ready', function () { + // console.error("DW Child Ready", child.type, child._path) + // console.error(" resuming", entry._path) + entry.pipe(child) + entry.resume() + }) + + // XXX Make this work in node. + // Long filenames should not break stuff. + child.on('error', function (er) { + if (child._swallowErrors) { + self.warn(er) + child.emit('end') + child.emit('close') + } else { + self.emit('error', er) + } + }) + + // we fire _end internally *after* end, so that we don't move on + // until any "end" listeners have had their chance to do stuff. + child.on('close', onend) + var ended = false + function onend () { + if (ended) return + ended = true + // console.error("* DW Child end", child.basename) + self._currentChild = null + self._processing = false + self._process() + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/lib/file-reader.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/lib/file-reader.js new file mode 100644 index 00000000..baa01f4b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/lib/file-reader.js @@ -0,0 +1,150 @@ +// Basically just a wrapper around an fs.ReadStream + +module.exports = FileReader + +var fs = require('graceful-fs') +var inherits = require('inherits') +var Reader = require('./reader.js') +var EOF = {EOF: true} +var CLOSE = {CLOSE: true} + +inherits(FileReader, Reader) + +function FileReader (props) { + // console.error(" FR create", props.path, props.size, new Error().stack) + var self = this + if (!(self instanceof FileReader)) { + throw new Error('FileReader must be called as constructor.') + } + + // should already be established as a File type + // XXX Todo: preserve hardlinks by tracking dev+inode+nlink, + // with a HardLinkReader class. + if (!((props.type === 'Link' && props.Link) || + (props.type === 'File' && props.File))) { + throw new Error('Non-file type ' + props.type) + } + + self._buffer = [] + self._bytesEmitted = 0 + Reader.call(self, props) +} + +FileReader.prototype._getStream = function () { + var self = this + var stream = self._stream = fs.createReadStream(self._path, self.props) + + if (self.props.blksize) { + stream.bufferSize = self.props.blksize + } + + stream.on('open', self.emit.bind(self, 'open')) + + stream.on('data', function (c) { + // console.error('\t\t%d %s', c.length, self.basename) + self._bytesEmitted += c.length + // no point saving empty chunks + if (!c.length) { + return + } else if (self._paused || self._buffer.length) { + self._buffer.push(c) + self._read() + } else self.emit('data', c) + }) + + stream.on('end', function () { + if (self._paused || self._buffer.length) { + // console.error('FR Buffering End', self._path) + self._buffer.push(EOF) + self._read() + } else { + self.emit('end') + } + + if (self._bytesEmitted !== self.props.size) { + self.error("Didn't get expected byte count\n" + + 'expect: ' + self.props.size + '\n' + + 'actual: ' + self._bytesEmitted) + } + }) + + stream.on('close', function () { + if (self._paused || self._buffer.length) { + // console.error('FR Buffering Close', self._path) + self._buffer.push(CLOSE) + self._read() + } else { + // console.error('FR close 1', self._path) + self.emit('close') + } + }) + + stream.on('error', function (e) { + self.emit('error', e) + }) + + self._read() +} + +FileReader.prototype._read = function () { + var self = this + // console.error('FR _read', self._path) + if (self._paused) { + // console.error('FR _read paused', self._path) + return + } + + if (!self._stream) { + // console.error('FR _getStream calling', self._path) + return self._getStream() + } + + // clear out the buffer, if there is one. + if (self._buffer.length) { + // console.error('FR _read has buffer', self._buffer.length, self._path) + var buf = self._buffer + for (var i = 0, l = buf.length; i < l; i++) { + var c = buf[i] + if (c === EOF) { + // console.error('FR Read emitting buffered end', self._path) + self.emit('end') + } else if (c === CLOSE) { + // console.error('FR Read emitting buffered close', self._path) + self.emit('close') + } else { + // console.error('FR Read emitting buffered data', self._path) + self.emit('data', c) + } + + if (self._paused) { + // console.error('FR Read Re-pausing at '+i, self._path) + self._buffer = buf.slice(i) + return + } + } + self._buffer.length = 0 + } +// console.error("FR _read done") +// that's about all there is to it. +} + +FileReader.prototype.pause = function (who) { + var self = this + // console.error('FR Pause', self._path) + if (self._paused) return + who = who || self + self._paused = true + if (self._stream) self._stream.pause() + self.emit('pause', who) +} + +FileReader.prototype.resume = function (who) { + var self = this + // console.error('FR Resume', self._path) + if (!self._paused) return + who = who || self + self.emit('resume', who) + self._paused = false + if (self._stream) self._stream.resume() + self._read() +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/lib/file-writer.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/lib/file-writer.js new file mode 100644 index 00000000..4c803d8d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/lib/file-writer.js @@ -0,0 +1,107 @@ +module.exports = FileWriter + +var fs = require('graceful-fs') +var Writer = require('./writer.js') +var inherits = require('inherits') +var EOF = {} + +inherits(FileWriter, Writer) + +function FileWriter (props) { + var self = this + if (!(self instanceof FileWriter)) { + throw new Error('FileWriter must be called as constructor.') + } + + // should already be established as a File type + if (props.type !== 'File' || !props.File) { + throw new Error('Non-file type ' + props.type) + } + + self._buffer = [] + self._bytesWritten = 0 + + Writer.call(this, props) +} + +FileWriter.prototype._create = function () { + var self = this + if (self._stream) return + + var so = {} + if (self.props.flags) so.flags = self.props.flags + so.mode = Writer.filemode + if (self._old && self._old.blksize) so.bufferSize = self._old.blksize + + self._stream = fs.createWriteStream(self._path, so) + + self._stream.on('open', function () { + // console.error("FW open", self._buffer, self._path) + self.ready = true + self._buffer.forEach(function (c) { + if (c === EOF) self._stream.end() + else self._stream.write(c) + }) + self.emit('ready') + // give this a kick just in case it needs it. + self.emit('drain') + }) + + self._stream.on('error', function (er) { self.emit('error', er) }) + + self._stream.on('drain', function () { self.emit('drain') }) + + self._stream.on('close', function () { + // console.error('\n\nFW Stream Close', self._path, self.size) + self._finish() + }) +} + +FileWriter.prototype.write = function (c) { + var self = this + + self._bytesWritten += c.length + + if (!self.ready) { + if (!Buffer.isBuffer(c) && typeof c !== 'string') { + throw new Error('invalid write data') + } + self._buffer.push(c) + return false + } + + var ret = self._stream.write(c) + // console.error('\t-- fw wrote, _stream says', ret, self._stream._queue.length) + + // allow 2 buffered writes, because otherwise there's just too + // much stop and go bs. + if (ret === false && self._stream._queue) { + return self._stream._queue.length <= 2 + } else { + return ret + } +} + +FileWriter.prototype.end = function (c) { + var self = this + + if (c) self.write(c) + + if (!self.ready) { + self._buffer.push(EOF) + return false + } + + return self._stream.end() +} + +FileWriter.prototype._finish = function () { + var self = this + if (typeof self.size === 'number' && self._bytesWritten !== self.size) { + self.error( + 'Did not get expected byte count.\n' + + 'expect: ' + self.size + '\n' + + 'actual: ' + self._bytesWritten) + } + Writer.prototype._finish.call(self) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/lib/get-type.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/lib/get-type.js new file mode 100644 index 00000000..19f6a657 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/lib/get-type.js @@ -0,0 +1,33 @@ +module.exports = getType + +function getType (st) { + var types = [ + 'Directory', + 'File', + 'SymbolicLink', + 'Link', // special for hardlinks from tarballs + 'BlockDevice', + 'CharacterDevice', + 'FIFO', + 'Socket' + ] + var type + + if (st.type && types.indexOf(st.type) !== -1) { + st[st.type] = true + return st.type + } + + for (var i = 0, l = types.length; i < l; i++) { + type = types[i] + var is = st[type] || st['is' + type] + if (typeof is === 'function') is = is.call(st) + if (is) { + st[type] = true + st.type = type + return type + } + } + + return null +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/lib/link-reader.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/lib/link-reader.js new file mode 100644 index 00000000..fb4cc67a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/lib/link-reader.js @@ -0,0 +1,53 @@ +// Basically just a wrapper around an fs.readlink +// +// XXX: Enhance this to support the Link type, by keeping +// a lookup table of {:}, so that hardlinks +// can be preserved in tarballs. + +module.exports = LinkReader + +var fs = require('graceful-fs') +var inherits = require('inherits') +var Reader = require('./reader.js') + +inherits(LinkReader, Reader) + +function LinkReader (props) { + var self = this + if (!(self instanceof LinkReader)) { + throw new Error('LinkReader must be called as constructor.') + } + + if (!((props.type === 'Link' && props.Link) || + (props.type === 'SymbolicLink' && props.SymbolicLink))) { + throw new Error('Non-link type ' + props.type) + } + + Reader.call(self, props) +} + +// When piping a LinkReader into a LinkWriter, we have to +// already have the linkpath property set, so that has to +// happen *before* the "ready" event, which means we need to +// override the _stat method. +LinkReader.prototype._stat = function (currentStat) { + var self = this + fs.readlink(self._path, function (er, linkpath) { + if (er) return self.error(er) + self.linkpath = self.props.linkpath = linkpath + self.emit('linkpath', linkpath) + Reader.prototype._stat.call(self, currentStat) + }) +} + +LinkReader.prototype._read = function () { + var self = this + if (self._paused) return + // basically just a no-op, since we got all the info we need + // from the _stat method + if (!self._ended) { + self.emit('end') + self.emit('close') + self._ended = true + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/lib/link-writer.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/lib/link-writer.js new file mode 100644 index 00000000..af542840 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/lib/link-writer.js @@ -0,0 +1,95 @@ +module.exports = LinkWriter + +var fs = require('graceful-fs') +var Writer = require('./writer.js') +var inherits = require('inherits') +var path = require('path') +var rimraf = require('rimraf') + +inherits(LinkWriter, Writer) + +function LinkWriter (props) { + var self = this + if (!(self instanceof LinkWriter)) { + throw new Error('LinkWriter must be called as constructor.') + } + + // should already be established as a Link type + if (!((props.type === 'Link' && props.Link) || + (props.type === 'SymbolicLink' && props.SymbolicLink))) { + throw new Error('Non-link type ' + props.type) + } + + if (props.linkpath === '') props.linkpath = '.' + if (!props.linkpath) { + self.error('Need linkpath property to create ' + props.type) + } + + Writer.call(this, props) +} + +LinkWriter.prototype._create = function () { + // console.error(" LW _create") + var self = this + var hard = self.type === 'Link' || process.platform === 'win32' + var link = hard ? 'link' : 'symlink' + var lp = hard ? path.resolve(self.dirname, self.linkpath) : self.linkpath + + // can only change the link path by clobbering + // For hard links, let's just assume that's always the case, since + // there's no good way to read them if we don't already know. + if (hard) return clobber(self, lp, link) + + fs.readlink(self._path, function (er, p) { + // only skip creation if it's exactly the same link + if (p && p === lp) return finish(self) + clobber(self, lp, link) + }) +} + +function clobber (self, lp, link) { + rimraf(self._path, function (er) { + if (er) return self.error(er) + create(self, lp, link) + }) +} + +function create (self, lp, link) { + fs[link](lp, self._path, function (er) { + // if this is a hard link, and we're in the process of writing out a + // directory, it's very possible that the thing we're linking to + // doesn't exist yet (especially if it was intended as a symlink), + // so swallow ENOENT errors here and just soldier in. + // Additionally, an EPERM or EACCES can happen on win32 if it's trying + // to make a link to a directory. Again, just skip it. + // A better solution would be to have fs.symlink be supported on + // windows in some nice fashion. + if (er) { + if ((er.code === 'ENOENT' || + er.code === 'EACCES' || + er.code === 'EPERM') && process.platform === 'win32') { + self.ready = true + self.emit('ready') + self.emit('end') + self.emit('close') + self.end = self._finish = function () {} + } else return self.error(er) + } + finish(self) + }) +} + +function finish (self) { + self.ready = true + self.emit('ready') + if (self._ended && !self._finished) self._finish() +} + +LinkWriter.prototype.end = function () { + // console.error("LW finish in end") + this._ended = true + if (this.ready) { + this._finished = true + this._finish() + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/lib/proxy-reader.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/lib/proxy-reader.js new file mode 100644 index 00000000..4f431c9d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/lib/proxy-reader.js @@ -0,0 +1,95 @@ +// A reader for when we don't yet know what kind of thing +// the thing is. + +module.exports = ProxyReader + +var Reader = require('./reader.js') +var getType = require('./get-type.js') +var inherits = require('inherits') +var fs = require('graceful-fs') + +inherits(ProxyReader, Reader) + +function ProxyReader (props) { + var self = this + if (!(self instanceof ProxyReader)) { + throw new Error('ProxyReader must be called as constructor.') + } + + self.props = props + self._buffer = [] + self.ready = false + + Reader.call(self, props) +} + +ProxyReader.prototype._stat = function () { + var self = this + var props = self.props + // stat the thing to see what the proxy should be. + var stat = props.follow ? 'stat' : 'lstat' + + fs[stat](props.path, function (er, current) { + var type + if (er || !current) { + type = 'File' + } else { + type = getType(current) + } + + props[type] = true + props.type = self.type = type + + self._old = current + self._addProxy(Reader(props, current)) + }) +} + +ProxyReader.prototype._addProxy = function (proxy) { + var self = this + if (self._proxyTarget) { + return self.error('proxy already set') + } + + self._proxyTarget = proxy + proxy._proxy = self + + ;[ + 'error', + 'data', + 'end', + 'close', + 'linkpath', + 'entry', + 'entryEnd', + 'child', + 'childEnd', + 'warn', + 'stat' + ].forEach(function (ev) { + // console.error('~~ proxy event', ev, self.path) + proxy.on(ev, self.emit.bind(self, ev)) + }) + + self.emit('proxy', proxy) + + proxy.on('ready', function () { + // console.error("~~ proxy is ready!", self.path) + self.ready = true + self.emit('ready') + }) + + var calls = self._buffer + self._buffer.length = 0 + calls.forEach(function (c) { + proxy[c[0]].apply(proxy, c[1]) + }) +} + +ProxyReader.prototype.pause = function () { + return this._proxyTarget ? this._proxyTarget.pause() : false +} + +ProxyReader.prototype.resume = function () { + return this._proxyTarget ? this._proxyTarget.resume() : false +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/lib/proxy-writer.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/lib/proxy-writer.js new file mode 100644 index 00000000..a6544621 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/lib/proxy-writer.js @@ -0,0 +1,111 @@ +// A writer for when we don't know what kind of thing +// the thing is. That is, it's not explicitly set, +// so we're going to make it whatever the thing already +// is, or "File" +// +// Until then, collect all events. + +module.exports = ProxyWriter + +var Writer = require('./writer.js') +var getType = require('./get-type.js') +var inherits = require('inherits') +var collect = require('./collect.js') +var fs = require('fs') + +inherits(ProxyWriter, Writer) + +function ProxyWriter (props) { + var self = this + if (!(self instanceof ProxyWriter)) { + throw new Error('ProxyWriter must be called as constructor.') + } + + self.props = props + self._needDrain = false + + Writer.call(self, props) +} + +ProxyWriter.prototype._stat = function () { + var self = this + var props = self.props + // stat the thing to see what the proxy should be. + var stat = props.follow ? 'stat' : 'lstat' + + fs[stat](props.path, function (er, current) { + var type + if (er || !current) { + type = 'File' + } else { + type = getType(current) + } + + props[type] = true + props.type = self.type = type + + self._old = current + self._addProxy(Writer(props, current)) + }) +} + +ProxyWriter.prototype._addProxy = function (proxy) { + // console.error("~~ set proxy", this.path) + var self = this + if (self._proxy) { + return self.error('proxy already set') + } + + self._proxy = proxy + ;[ + 'ready', + 'error', + 'close', + 'pipe', + 'drain', + 'warn' + ].forEach(function (ev) { + proxy.on(ev, self.emit.bind(self, ev)) + }) + + self.emit('proxy', proxy) + + var calls = self._buffer + calls.forEach(function (c) { + // console.error("~~ ~~ proxy buffered call", c[0], c[1]) + proxy[c[0]].apply(proxy, c[1]) + }) + self._buffer.length = 0 + if (self._needsDrain) self.emit('drain') +} + +ProxyWriter.prototype.add = function (entry) { + // console.error("~~ proxy add") + collect(entry) + + if (!this._proxy) { + this._buffer.push(['add', [entry]]) + this._needDrain = true + return false + } + return this._proxy.add(entry) +} + +ProxyWriter.prototype.write = function (c) { + // console.error('~~ proxy write') + if (!this._proxy) { + this._buffer.push(['write', [c]]) + this._needDrain = true + return false + } + return this._proxy.write(c) +} + +ProxyWriter.prototype.end = function (c) { + // console.error('~~ proxy end') + if (!this._proxy) { + this._buffer.push(['end', [c]]) + return false + } + return this._proxy.end(c) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/lib/reader.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/lib/reader.js new file mode 100644 index 00000000..876021f9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/lib/reader.js @@ -0,0 +1,255 @@ +module.exports = Reader + +var fs = require('graceful-fs') +var Stream = require('stream').Stream +var inherits = require('inherits') +var path = require('path') +var getType = require('./get-type.js') +var hardLinks = Reader.hardLinks = {} +var Abstract = require('./abstract.js') + +// Must do this *before* loading the child classes +inherits(Reader, Abstract) + +var LinkReader = require('./link-reader.js') + +function Reader (props, currentStat) { + var self = this + if (!(self instanceof Reader)) return new Reader(props, currentStat) + + if (typeof props === 'string') { + props = { path: props } + } + + if (!props.path) { + self.error('Must provide a path', null, true) + } + + // polymorphism. + // call fstream.Reader(dir) to get a DirReader object, etc. + // Note that, unlike in the Writer case, ProxyReader is going + // to be the *normal* state of affairs, since we rarely know + // the type of a file prior to reading it. + + var type + var ClassType + + if (props.type && typeof props.type === 'function') { + type = props.type + ClassType = type + } else { + type = getType(props) + ClassType = Reader + } + + if (currentStat && !type) { + type = getType(currentStat) + props[type] = true + props.type = type + } + + switch (type) { + case 'Directory': + ClassType = require('./dir-reader.js') + break + + case 'Link': + // XXX hard links are just files. + // However, it would be good to keep track of files' dev+inode + // and nlink values, and create a HardLinkReader that emits + // a linkpath value of the original copy, so that the tar + // writer can preserve them. + // ClassType = HardLinkReader + // break + + case 'File': + ClassType = require('./file-reader.js') + break + + case 'SymbolicLink': + ClassType = LinkReader + break + + case 'Socket': + ClassType = require('./socket-reader.js') + break + + case null: + ClassType = require('./proxy-reader.js') + break + } + + if (!(self instanceof ClassType)) { + return new ClassType(props) + } + + Abstract.call(self) + + self.readable = true + self.writable = false + + self.type = type + self.props = props + self.depth = props.depth = props.depth || 0 + self.parent = props.parent || null + self.root = props.root || (props.parent && props.parent.root) || self + + self._path = self.path = path.resolve(props.path) + if (process.platform === 'win32') { + self.path = self._path = self.path.replace(/\?/g, '_') + if (self._path.length >= 260) { + // how DOES one create files on the moon? + // if the path has spaces in it, then UNC will fail. + self._swallowErrors = true + // if (self._path.indexOf(" ") === -1) { + self._path = '\\\\?\\' + self.path.replace(/\//g, '\\') + // } + } + } + self.basename = props.basename = path.basename(self.path) + self.dirname = props.dirname = path.dirname(self.path) + + // these have served their purpose, and are now just noisy clutter + props.parent = props.root = null + + // console.error("\n\n\n%s setting size to", props.path, props.size) + self.size = props.size + self.filter = typeof props.filter === 'function' ? props.filter : null + if (props.sort === 'alpha') props.sort = alphasort + + // start the ball rolling. + // this will stat the thing, and then call self._read() + // to start reading whatever it is. + // console.error("calling stat", props.path, currentStat) + self._stat(currentStat) +} + +function alphasort (a, b) { + return a === b ? 0 + : a.toLowerCase() > b.toLowerCase() ? 1 + : a.toLowerCase() < b.toLowerCase() ? -1 + : a > b ? 1 + : -1 +} + +Reader.prototype._stat = function (currentStat) { + var self = this + var props = self.props + var stat = props.follow ? 'stat' : 'lstat' + // console.error("Reader._stat", self._path, currentStat) + if (currentStat) process.nextTick(statCb.bind(null, null, currentStat)) + else fs[stat](self._path, statCb) + + function statCb (er, props_) { + // console.error("Reader._stat, statCb", self._path, props_, props_.nlink) + if (er) return self.error(er) + + Object.keys(props_).forEach(function (k) { + props[k] = props_[k] + }) + + // if it's not the expected size, then abort here. + if (undefined !== self.size && props.size !== self.size) { + return self.error('incorrect size') + } + self.size = props.size + + var type = getType(props) + var handleHardlinks = props.hardlinks !== false + + // special little thing for handling hardlinks. + if (handleHardlinks && type !== 'Directory' && props.nlink && props.nlink > 1) { + var k = props.dev + ':' + props.ino + // console.error("Reader has nlink", self._path, k) + if (hardLinks[k] === self._path || !hardLinks[k]) { + hardLinks[k] = self._path + } else { + // switch into hardlink mode. + type = self.type = self.props.type = 'Link' + self.Link = self.props.Link = true + self.linkpath = self.props.linkpath = hardLinks[k] + // console.error("Hardlink detected, switching mode", self._path, self.linkpath) + // Setting __proto__ would arguably be the "correct" + // approach here, but that just seems too wrong. + self._stat = self._read = LinkReader.prototype._read + } + } + + if (self.type && self.type !== type) { + self.error('Unexpected type: ' + type) + } + + // if the filter doesn't pass, then just skip over this one. + // still have to emit end so that dir-walking can move on. + if (self.filter) { + var who = self._proxy || self + // special handling for ProxyReaders + if (!self.filter.call(who, who, props)) { + if (!self._disowned) { + self.abort() + self.emit('end') + self.emit('close') + } + return + } + } + + // last chance to abort or disown before the flow starts! + var events = ['_stat', 'stat', 'ready'] + var e = 0 + ;(function go () { + if (self._aborted) { + self.emit('end') + self.emit('close') + return + } + + if (self._paused && self.type !== 'Directory') { + self.once('resume', go) + return + } + + var ev = events[e++] + if (!ev) { + return self._read() + } + self.emit(ev, props) + go() + })() + } +} + +Reader.prototype.pipe = function (dest) { + var self = this + if (typeof dest.add === 'function') { + // piping to a multi-compatible, and we've got directory entries. + self.on('entry', function (entry) { + var ret = dest.add(entry) + if (ret === false) { + self.pause() + } + }) + } + + // console.error("R Pipe apply Stream Pipe") + return Stream.prototype.pipe.apply(this, arguments) +} + +Reader.prototype.pause = function (who) { + this._paused = true + who = who || this + this.emit('pause', who) + if (this._stream) this._stream.pause(who) +} + +Reader.prototype.resume = function (who) { + this._paused = false + who = who || this + this.emit('resume', who) + if (this._stream) this._stream.resume(who) + this._read() +} + +Reader.prototype._read = function () { + this.error('Cannot read unknown type: ' + this.type) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/lib/socket-reader.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/lib/socket-reader.js new file mode 100644 index 00000000..e0456ba8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/lib/socket-reader.js @@ -0,0 +1,36 @@ +// Just get the stats, and then don't do anything. +// You can't really "read" from a socket. You "connect" to it. +// Mostly, this is here so that reading a dir with a socket in it +// doesn't blow up. + +module.exports = SocketReader + +var inherits = require('inherits') +var Reader = require('./reader.js') + +inherits(SocketReader, Reader) + +function SocketReader (props) { + var self = this + if (!(self instanceof SocketReader)) { + throw new Error('SocketReader must be called as constructor.') + } + + if (!(props.type === 'Socket' && props.Socket)) { + throw new Error('Non-socket type ' + props.type) + } + + Reader.call(self, props) +} + +SocketReader.prototype._read = function () { + var self = this + if (self._paused) return + // basically just a no-op, since we got all the info we have + // from the _stat method + if (!self._ended) { + self.emit('end') + self.emit('close') + self._ended = true + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/lib/writer.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/lib/writer.js new file mode 100644 index 00000000..ca3396b5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/lib/writer.js @@ -0,0 +1,390 @@ +module.exports = Writer + +var fs = require('graceful-fs') +var inherits = require('inherits') +var rimraf = require('rimraf') +var mkdir = require('mkdirp') +var path = require('path') +var umask = process.platform === 'win32' ? 0 : process.umask() +var getType = require('./get-type.js') +var Abstract = require('./abstract.js') + +// Must do this *before* loading the child classes +inherits(Writer, Abstract) + +Writer.dirmode = parseInt('0777', 8) & (~umask) +Writer.filemode = parseInt('0666', 8) & (~umask) + +var DirWriter = require('./dir-writer.js') +var LinkWriter = require('./link-writer.js') +var FileWriter = require('./file-writer.js') +var ProxyWriter = require('./proxy-writer.js') + +// props is the desired state. current is optionally the current stat, +// provided here so that subclasses can avoid statting the target +// more than necessary. +function Writer (props, current) { + var self = this + + if (typeof props === 'string') { + props = { path: props } + } + + if (!props.path) self.error('Must provide a path', null, true) + + // polymorphism. + // call fstream.Writer(dir) to get a DirWriter object, etc. + var type = getType(props) + var ClassType = Writer + + switch (type) { + case 'Directory': + ClassType = DirWriter + break + case 'File': + ClassType = FileWriter + break + case 'Link': + case 'SymbolicLink': + ClassType = LinkWriter + break + case null: + default: + // Don't know yet what type to create, so we wrap in a proxy. + ClassType = ProxyWriter + break + } + + if (!(self instanceof ClassType)) return new ClassType(props) + + // now get down to business. + + Abstract.call(self) + + // props is what we want to set. + // set some convenience properties as well. + self.type = props.type + self.props = props + self.depth = props.depth || 0 + self.clobber = props.clobber === false ? props.clobber : true + self.parent = props.parent || null + self.root = props.root || (props.parent && props.parent.root) || self + + self._path = self.path = path.resolve(props.path) + if (process.platform === 'win32') { + self.path = self._path = self.path.replace(/\?/g, '_') + if (self._path.length >= 260) { + self._swallowErrors = true + self._path = '\\\\?\\' + self.path.replace(/\//g, '\\') + } + } + self.basename = path.basename(props.path) + self.dirname = path.dirname(props.path) + self.linkpath = props.linkpath || null + + props.parent = props.root = null + + // console.error("\n\n\n%s setting size to", props.path, props.size) + self.size = props.size + + if (typeof props.mode === 'string') { + props.mode = parseInt(props.mode, 8) + } + + self.readable = false + self.writable = true + + // buffer until ready, or while handling another entry + self._buffer = [] + self.ready = false + + self.filter = typeof props.filter === 'function' ? props.filter : null + + // start the ball rolling. + // this checks what's there already, and then calls + // self._create() to call the impl-specific creation stuff. + self._stat(current) +} + +// Calling this means that it's something we can't create. +// Just assert that it's already there, otherwise raise a warning. +Writer.prototype._create = function () { + var self = this + fs[self.props.follow ? 'stat' : 'lstat'](self._path, function (er) { + if (er) { + return self.warn('Cannot create ' + self._path + '\n' + + 'Unsupported type: ' + self.type, 'ENOTSUP') + } + self._finish() + }) +} + +Writer.prototype._stat = function (current) { + var self = this + var props = self.props + var stat = props.follow ? 'stat' : 'lstat' + var who = self._proxy || self + + if (current) statCb(null, current) + else fs[stat](self._path, statCb) + + function statCb (er, current) { + if (self.filter && !self.filter.call(who, who, current)) { + self._aborted = true + self.emit('end') + self.emit('close') + return + } + + // if it's not there, great. We'll just create it. + // if it is there, then we'll need to change whatever differs + if (er || !current) { + return create(self) + } + + self._old = current + var currentType = getType(current) + + // if it's a type change, then we need to clobber or error. + // if it's not a type change, then let the impl take care of it. + if (currentType !== self.type) { + return rimraf(self._path, function (er) { + if (er) return self.error(er) + self._old = null + create(self) + }) + } + + // otherwise, just handle in the app-specific way + // this creates a fs.WriteStream, or mkdir's, or whatever + create(self) + } +} + +function create (self) { + // console.error("W create", self._path, Writer.dirmode) + + // XXX Need to clobber non-dirs that are in the way, + // unless { clobber: false } in the props. + mkdir(path.dirname(self._path), Writer.dirmode, function (er, made) { + // console.error("W created", path.dirname(self._path), er) + if (er) return self.error(er) + + // later on, we have to set the mode and owner for these + self._madeDir = made + return self._create() + }) +} + +function endChmod (self, want, current, path, cb) { + var wantMode = want.mode + var chmod = want.follow || self.type !== 'SymbolicLink' + ? 'chmod' : 'lchmod' + + if (!fs[chmod]) return cb() + if (typeof wantMode !== 'number') return cb() + + var curMode = current.mode & parseInt('0777', 8) + wantMode = wantMode & parseInt('0777', 8) + if (wantMode === curMode) return cb() + + fs[chmod](path, wantMode, cb) +} + +function endChown (self, want, current, path, cb) { + // Don't even try it unless root. Too easy to EPERM. + if (process.platform === 'win32') return cb() + if (!process.getuid || process.getuid() !== 0) return cb() + if (typeof want.uid !== 'number' && + typeof want.gid !== 'number') return cb() + + if (current.uid === want.uid && + current.gid === want.gid) return cb() + + var chown = (self.props.follow || self.type !== 'SymbolicLink') + ? 'chown' : 'lchown' + if (!fs[chown]) return cb() + + if (typeof want.uid !== 'number') want.uid = current.uid + if (typeof want.gid !== 'number') want.gid = current.gid + + fs[chown](path, want.uid, want.gid, cb) +} + +function endUtimes (self, want, current, path, cb) { + if (!fs.utimes || process.platform === 'win32') return cb() + + var utimes = (want.follow || self.type !== 'SymbolicLink') + ? 'utimes' : 'lutimes' + + if (utimes === 'lutimes' && !fs[utimes]) { + utimes = 'utimes' + } + + if (!fs[utimes]) return cb() + + var curA = current.atime + var curM = current.mtime + var meA = want.atime + var meM = want.mtime + + if (meA === undefined) meA = curA + if (meM === undefined) meM = curM + + if (!isDate(meA)) meA = new Date(meA) + if (!isDate(meM)) meA = new Date(meM) + + if (meA.getTime() === curA.getTime() && + meM.getTime() === curM.getTime()) return cb() + + fs[utimes](path, meA, meM, cb) +} + +// XXX This function is beastly. Break it up! +Writer.prototype._finish = function () { + var self = this + + if (self._finishing) return + self._finishing = true + + // console.error(" W Finish", self._path, self.size) + + // set up all the things. + // At this point, we're already done writing whatever we've gotta write, + // adding files to the dir, etc. + var todo = 0 + var errState = null + var done = false + + if (self._old) { + // the times will almost *certainly* have changed. + // adds the utimes syscall, but remove another stat. + self._old.atime = new Date(0) + self._old.mtime = new Date(0) + // console.error(" W Finish Stale Stat", self._path, self.size) + setProps(self._old) + } else { + var stat = self.props.follow ? 'stat' : 'lstat' + // console.error(" W Finish Stating", self._path, self.size) + fs[stat](self._path, function (er, current) { + // console.error(" W Finish Stated", self._path, self.size, current) + if (er) { + // if we're in the process of writing out a + // directory, it's very possible that the thing we're linking to + // doesn't exist yet (especially if it was intended as a symlink), + // so swallow ENOENT errors here and just soldier on. + if (er.code === 'ENOENT' && + (self.type === 'Link' || self.type === 'SymbolicLink') && + process.platform === 'win32') { + self.ready = true + self.emit('ready') + self.emit('end') + self.emit('close') + self.end = self._finish = function () {} + return + } else return self.error(er) + } + setProps(self._old = current) + }) + } + + return + + function setProps (current) { + todo += 3 + endChmod(self, self.props, current, self._path, next('chmod')) + endChown(self, self.props, current, self._path, next('chown')) + endUtimes(self, self.props, current, self._path, next('utimes')) + } + + function next (what) { + return function (er) { + // console.error(" W Finish", what, todo) + if (errState) return + if (er) { + er.fstream_finish_call = what + return self.error(errState = er) + } + if (--todo > 0) return + if (done) return + done = true + + // we may still need to set the mode/etc. on some parent dirs + // that were created previously. delay end/close until then. + if (!self._madeDir) return end() + else endMadeDir(self, self._path, end) + + function end (er) { + if (er) { + er.fstream_finish_call = 'setupMadeDir' + return self.error(er) + } + // all the props have been set, so we're completely done. + self.emit('end') + self.emit('close') + } + } + } +} + +function endMadeDir (self, p, cb) { + var made = self._madeDir + // everything *between* made and path.dirname(self._path) + // needs to be set up. Note that this may just be one dir. + var d = path.dirname(p) + + endMadeDir_(self, d, function (er) { + if (er) return cb(er) + if (d === made) { + return cb() + } + endMadeDir(self, d, cb) + }) +} + +function endMadeDir_ (self, p, cb) { + var dirProps = {} + Object.keys(self.props).forEach(function (k) { + dirProps[k] = self.props[k] + + // only make non-readable dirs if explicitly requested. + if (k === 'mode' && self.type !== 'Directory') { + dirProps[k] = dirProps[k] | parseInt('0111', 8) + } + }) + + var todo = 3 + var errState = null + fs.stat(p, function (er, current) { + if (er) return cb(errState = er) + endChmod(self, dirProps, current, p, next) + endChown(self, dirProps, current, p, next) + endUtimes(self, dirProps, current, p, next) + }) + + function next (er) { + if (errState) return + if (er) return cb(errState = er) + if (--todo === 0) return cb() + } +} + +Writer.prototype.pipe = function () { + this.error("Can't pipe from writable stream") +} + +Writer.prototype.add = function () { + this.error("Can't add to non-Directory type") +} + +Writer.prototype.write = function () { + return true +} + +function objectToString (d) { + return Object.prototype.toString.call(d) +} + +function isDate (d) { + return typeof d === 'object' && objectToString(d) === '[object Date]' +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/package.json new file mode 100644 index 00000000..9f5212a1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fstream/package.json @@ -0,0 +1,42 @@ +{ + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "name": "fstream", + "description": "Advanced file system stream things", + "version": "1.0.10", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/fstream.git" + }, + "main": "fstream.js", + "engines": { + "node": ">=0.6" + }, + "dependencies": { + "graceful-fs": "^4.1.2", + "inherits": "~2.0.0", + "mkdirp": ">=0.5 0", + "rimraf": "2" + }, + "devDependencies": { + "standard": "^4.0.0", + "tap": "^1.2.0" + }, + "scripts": { + "test": "standard && tap examples/*.js" + }, + "license": "ISC", + "readme": "Like FS streams, but with stat on them, and supporting directories and\nsymbolic links, as well as normal files. Also, you can use this to set\nthe stats on a file, even if you don't change its contents, or to create\na symlink, etc.\n\nSo, for example, you can \"write\" a directory, and it'll call `mkdir`. You\ncan specify a uid and gid, and it'll call `chown`. You can specify a\n`mtime` and `atime`, and it'll call `utimes`. You can call it a symlink\nand provide a `linkpath` and it'll call `symlink`.\n\nNote that it won't automatically resolve symbolic links. So, if you\ncall `fstream.Reader('/some/symlink')` then you'll get an object\nthat stats and then ends immediately (since it has no data). To follow\nsymbolic links, do this: `fstream.Reader({path:'/some/symlink', follow:\ntrue })`.\n\nThere are various checks to make sure that the bytes emitted are the\nsame as the intended size, if the size is set.\n\n## Examples\n\n```javascript\nfstream\n .Writer({ path: \"path/to/file\"\n , mode: 0755\n , size: 6\n })\n .write(\"hello\\n\")\n .end()\n```\n\nThis will create the directories if they're missing, and then write\n`hello\\n` into the file, chmod it to 0755, and assert that 6 bytes have\nbeen written when it's done.\n\n```javascript\nfstream\n .Writer({ path: \"path/to/file\"\n , mode: 0755\n , size: 6\n , flags: \"a\"\n })\n .write(\"hello\\n\")\n .end()\n```\n\nYou can pass flags in, if you want to append to a file.\n\n```javascript\nfstream\n .Writer({ path: \"path/to/symlink\"\n , linkpath: \"./file\"\n , SymbolicLink: true\n , mode: \"0755\" // octal strings supported\n })\n .end()\n```\n\nIf isSymbolicLink is a function, it'll be called, and if it returns\ntrue, then it'll treat it as a symlink. If it's not a function, then\nany truish value will make a symlink, or you can set `type:\n'SymbolicLink'`, which does the same thing.\n\nNote that the linkpath is relative to the symbolic link location, not\nthe parent dir or cwd.\n\n```javascript\nfstream\n .Reader(\"path/to/dir\")\n .pipe(fstream.Writer(\"path/to/other/dir\"))\n```\n\nThis will do like `cp -Rp path/to/dir path/to/other/dir`. If the other\ndir exists and isn't a directory, then it'll emit an error. It'll also\nset the uid, gid, mode, etc. to be identical. In this way, it's more\nlike `rsync -a` than simply a copy.\n", + "readmeFilename": "README.md", + "gitHead": "24fabdec32e334dd3b130d77b38c010e3119b102", + "bugs": { + "url": "https://github.com/npm/fstream/issues" + }, + "homepage": "https://github.com/npm/fstream#readme", + "_id": "fstream@1.0.10", + "_shasum": "604e8a92fe26ffd9f6fae30399d4984e1ab22822", + "_from": "fstream@>=1.0.10 <1.1.0" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/github-url-from-git/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/github-url-from-git/.npmignore new file mode 100644 index 00000000..3c3629e6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/github-url-from-git/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/github-url-from-git/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/github-url-from-git/LICENSE new file mode 100644 index 00000000..b7409302 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/github-url-from-git/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2013 TJ Holowaychuk + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/github-url-from-git/Makefile b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/github-url-from-git/Makefile new file mode 100644 index 00000000..37f330e8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/github-url-from-git/Makefile @@ -0,0 +1,5 @@ + +test: + @./node_modules/.bin/mocha test.js --reporter spec --require should + +.PHONY: test diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/github-url-from-git/Readme.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/github-url-from-git/Readme.md new file mode 100644 index 00000000..9dccaa8d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/github-url-from-git/Readme.md @@ -0,0 +1,92 @@ + +# github-url-from-git + +```js +describe('parse(url)', function(){ + it('should support git://*', function(){ + var url = 'git://github.com/jamesor/mongoose-versioner'; + parse(url).should.equal('https://github.com/jamesor/mongoose-versioner'); + }) + + it('should support git://*.git', function(){ + var url = 'git://github.com/treygriffith/cellar.git'; + parse(url).should.equal('https://github.com/treygriffith/cellar'); + }) + + it('should support https://*', function(){ + var url = 'https://github.com/Empeeric/i18n-node'; + parse(url).should.equal('https://github.com/Empeeric/i18n-node'); + }) + + it('should support https://*.git', function(){ + var url = 'https://jpillora@github.com/banchee/tranquil.git'; + parse(url).should.equal('https://github.com/banchee/tranquil'); + }) + + it('should return undefined on failure', function(){ + var url = 'git://github.com/justgord/.git'; + assert(null == parse(url)); + }) + + it('should parse git@github.com:bcoe/thumbd.git', function() { + var url = 'git@github.com:bcoe/thumbd.git'; + parse(url).should.eql('https://github.com/bcoe/thumbd'); + }) + + it('should parse git@github.com:bcoe/thumbd.git#2.7.0', function() { + var url = 'git@github.com:bcoe/thumbd.git#2.7.0'; + parse(url).should.eql('https://github.com/bcoe/thumbd'); + }) + + it('should parse git+https://github.com/bcoe/thumbd.git', function() { + var url = 'git+https://github.com/bcoe/thumbd.git'; + parse(url).should.eql('https://github.com/bcoe/thumbd'); + }) + + it('should parse git+ssh://github.com/bcoe/thumbd.git', function() { + var url = 'git+ssh://github.com/bcoe/thumbd.git'; + parse(url).should.eql('https://github.com/bcoe/thumbd'); + }) + + it('should parse https://EastCloud@github.com/EastCloud/node-websockets.git', function() { + var url = 'https://EastCloud@github.com/EastCloud/node-websockets.git'; + parse(url).should.eql('https://github.com/EastCloud/node-websockets'); + }) + + // gist urls. + + it('should parse git@gist urls', function() { + var url = 'git@gist.github.com:3135914.git'; + parse(url).should.equal('https://gist.github.com/3135914') + }) + + it('should parse https://gist urls', function() { + var url = 'https://gist.github.com/3135914.git'; + parse(url).should.equal('https://gist.github.com/3135914') + }) + + // Handle arbitrary GitHub Enterprise domains. + + it('should parse parse extra GHE urls provided', function() { + var url = 'git://github.example.com/treygriffith/cellar.git'; + parse( + url, {extraBaseUrls: ['github.example.com']} + ).should.equal('https://github.example.com/treygriffith/cellar'); + }); + + it('should parse GHE urls with multiple subdomains', function() { + var url = 'git://github.internal.example.com/treygriffith/cellar.git'; + parse( + url, {extraBaseUrls: ['github.internal.example.com']} + ).should.equal('https://github.internal.example.com/treygriffith/cellar'); + }); +}) + +describe('re', function() { + it('should expose GitHub url parsing regex', function() { + parse.re.source.should.equal( + /^(?:https?:\/\/|git:\/\/)?(?:[^@]+@)?(gist.github.com|github.com)[:\/]([^\/]+\/[^\/]+?|[0-9]+)$/.source + ) + }); +}) +``` diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/github-url-from-git/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/github-url-from-git/index.js new file mode 100644 index 00000000..44872e8c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/github-url-from-git/index.js @@ -0,0 +1,32 @@ +// convert git:// form url to github URL, e.g., +// git://github.com/bcoe/foo.git +// https://github.com/bcoe/foo. +function githubUrlFromGit(url, opts){ + try { + var m = re(opts).exec(url.replace(/\.git(#.*)?$/, '')); + var host = m[1]; + var path = m[2]; + return 'https://' + host + '/' + path; + } catch (err) { + // ignore + } +}; + +// generate the git:// parsing regex +// with options, e.g., the ability +// to specify multiple GHE domains. +function re(opts) { + opts = opts || {}; + // whitelist of URLs that should be treated as GitHub repos. + var baseUrls = ['gist.github.com', 'github.com'].concat(opts.extraBaseUrls || []); + // build regex from whitelist. + return new RegExp( + /^(?:https?:\/\/|git:\/\/|git\+ssh:\/\/|git\+https:\/\/)?(?:[^@]+@)?/.source + + '(' + baseUrls.join('|') + ')' + + /[:\/]([^\/]+\/[^\/]+?|[0-9]+)$/.source + ); +} + +githubUrlFromGit.re = re(); + +module.exports = githubUrlFromGit; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/github-url-from-git/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/github-url-from-git/package.json new file mode 100644 index 00000000..229af333 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/github-url-from-git/package.json @@ -0,0 +1,57 @@ +{ + "name": "github-url-from-git", + "version": "1.4.0", + "description": "Parse a github git url and return the github repo url", + "main": "index.js", + "scripts": { + "test": "mocha test.js --reporter spec --require should" + }, + "repository": { + "type": "git", + "url": "https://github.com/visionmedia/node-github-url-from-git.git" + }, + "keywords": [ + "github", + "git", + "url", + "parser" + ], + "author": { + "name": "TJ Holowaychuk" + }, + "license": "MIT", + "devDependencies": { + "better-assert": "~1.0.0", + "mocha": "~1.9.0", + "should": "~1.2.2" + }, + "gitHead": "154df00b0b590c29be5d2a5822e7b2e160b75345", + "bugs": { + "url": "https://github.com/visionmedia/node-github-url-from-git/issues" + }, + "homepage": "https://github.com/visionmedia/node-github-url-from-git", + "_id": "github-url-from-git@1.4.0", + "_shasum": "285e6b520819001bde128674704379e4ff03e0de", + "_from": "github-url-from-git@>=1.4.0-0 <2.0.0-0", + "_npmVersion": "2.0.0-alpha.7", + "_npmUser": { + "name": "bcoe", + "email": "bencoe@gmail.com" + }, + "maintainers": [ + { + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" + }, + { + "name": "bcoe", + "email": "bencoe@gmail.com" + } + ], + "dist": { + "shasum": "285e6b520819001bde128674704379e4ff03e0de", + "tarball": "http://registry.npmjs.org/github-url-from-git/-/github-url-from-git-1.4.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/github-url-from-git/-/github-url-from-git-1.4.0.tgz" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/github-url-from-git/test.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/github-url-from-git/test.js new file mode 100644 index 00000000..93aa38bb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/github-url-from-git/test.js @@ -0,0 +1,90 @@ +var parse = require('./'); +var assert = require('better-assert'); + +describe('parse(url)', function(){ + it('should support git://*', function(){ + var url = 'git://github.com/jamesor/mongoose-versioner'; + parse(url).should.equal('https://github.com/jamesor/mongoose-versioner'); + }) + + it('should support git://*.git', function(){ + var url = 'git://github.com/treygriffith/cellar.git'; + parse(url).should.equal('https://github.com/treygriffith/cellar'); + }) + + it('should support https://*', function(){ + var url = 'https://github.com/Empeeric/i18n-node'; + parse(url).should.equal('https://github.com/Empeeric/i18n-node'); + }) + + it('should support https://*.git', function(){ + var url = 'https://jpillora@github.com/banchee/tranquil.git'; + parse(url).should.equal('https://github.com/banchee/tranquil'); + }) + + it('should return undefined on failure', function(){ + var url = 'git://github.com/justgord/.git'; + assert(null == parse(url)); + }) + + it('should parse git@github.com:bcoe/thumbd.git', function() { + var url = 'git@github.com:bcoe/thumbd.git'; + parse(url).should.eql('https://github.com/bcoe/thumbd'); + }) + + it('should parse git@github.com:bcoe/thumbd.git#2.7.0', function() { + var url = 'git@github.com:bcoe/thumbd.git#2.7.0'; + parse(url).should.eql('https://github.com/bcoe/thumbd'); + }) + + it('should parse git+https://github.com/bcoe/thumbd.git', function() { + var url = 'git+https://github.com/bcoe/thumbd.git'; + parse(url).should.eql('https://github.com/bcoe/thumbd'); + }) + + it('should parse git+ssh://github.com/bcoe/thumbd.git', function() { + var url = 'git+ssh://github.com/bcoe/thumbd.git'; + parse(url).should.eql('https://github.com/bcoe/thumbd'); + }) + + it('should parse https://EastCloud@github.com/EastCloud/node-websockets.git', function() { + var url = 'https://EastCloud@github.com/EastCloud/node-websockets.git'; + parse(url).should.eql('https://github.com/EastCloud/node-websockets'); + }) + + // gist urls. + + it('should parse git@gist urls', function() { + var url = 'git@gist.github.com:3135914.git'; + parse(url).should.equal('https://gist.github.com/3135914') + }) + + it('should parse https://gist urls', function() { + var url = 'https://gist.github.com/3135914.git'; + parse(url).should.equal('https://gist.github.com/3135914') + }) + + // Handle arbitrary GitHub Enterprise domains. + + it('should parse parse extra GHE urls provided', function() { + var url = 'git://github.example.com/treygriffith/cellar.git'; + parse( + url, {extraBaseUrls: ['github.example.com']} + ).should.equal('https://github.example.com/treygriffith/cellar'); + }); + + it('should parse GHE urls with multiple subdomains', function() { + var url = 'git://github.internal.example.com/treygriffith/cellar.git'; + parse( + url, {extraBaseUrls: ['github.internal.example.com']} + ).should.equal('https://github.internal.example.com/treygriffith/cellar'); + }); +}) + +describe('re', function() { + it('should expose GitHub url parsing regex', function() { + parse.re.source.should.equal( + /^(?:https?:\/\/|git:\/\/|git\+ssh:\/\/|git\+https:\/\/)?(?:[^@]+@)?(gist.github.com|github.com)[:\/]([^\/]+\/[^\/]+?|[0-9]+)$/.source + ) + }); +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/github-url-from-username-repo/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/github-url-from-username-repo/.npmignore new file mode 100644 index 00000000..39747c08 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/github-url-from-username-repo/.npmignore @@ -0,0 +1,13 @@ +*.swp +.*.swp + +.DS_Store +*~ +.project +.settings +npm-debug.log +coverage.html +.idea +lib-cov + +node_modules \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/github-url-from-username-repo/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/github-url-from-username-repo/.travis.yml new file mode 100644 index 00000000..a12e3f0f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/github-url-from-username-repo/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.8" + - "0.10" \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/github-url-from-username-repo/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/github-url-from-username-repo/LICENSE new file mode 100644 index 00000000..44c152ba --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/github-url-from-username-repo/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) Robert Kowalski ("Author") +All rights reserved. + +The BSD License + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/github-url-from-username-repo/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/github-url-from-username-repo/README.md new file mode 100644 index 00000000..9adbee0e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/github-url-from-username-repo/README.md @@ -0,0 +1,21 @@ +[![Build Status](https://travis-ci.org/robertkowalski/github-url-from-username-repo.png?branch=master)](https://travis-ci.org/robertkowalski/github-url-from-username-repo) +[![Dependency Status](https://gemnasium.com/robertkowalski/github-url-from-username-repo.png)](https://gemnasium.com/robertkowalski/github-url-from-username-repo) + + +# github-url-from-username-repo + +## API + +### getUrl(url, [forBrowser]) + +Get's the url normalized for npm. +If `forBrowser` is true, return a GitHub url that is usable in a webbrowser. + +## Usage + +```javascript + +var getUrl = require("github-url-from-username-repo") +getUrl("visionmedia/express") // https://github.com/visionmedia/express + +``` diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/github-url-from-username-repo/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/github-url-from-username-repo/index.js new file mode 100644 index 00000000..f9d77f95 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/github-url-from-username-repo/index.js @@ -0,0 +1,21 @@ +module.exports = getUrl + +function getUrl (r, forBrowser) { + if (!r) return null + // Regex taken from https://github.com/npm/npm-package-arg/commit/01dce583c64afae07b66a2a8a6033aeba871c3cd + // Note: This does not fully test the git ref format. + // See https://www.kernel.org/pub/software/scm/git/docs/git-check-ref-format.html + // + // The only way to do this properly would be to shell out to + // git-check-ref-format, and as this is a fast sync function, + // we don't want to do that. Just let git fail if it turns + // out that the commit-ish is invalid. + // GH usernames cannot start with . or - + if (/^[^@%\/\s\.-][^:@%\/\s]*\/[^@\s\/%]+(?:#.*)?$/.test(r)) { + if (forBrowser) + r = r.replace("#", "/tree/") + return "https://github.com/" + r + } + + return null +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/github-url-from-username-repo/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/github-url-from-username-repo/package.json new file mode 100644 index 00000000..f8aa80d5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/github-url-from-username-repo/package.json @@ -0,0 +1,36 @@ +{ + "name": "github-url-from-username-repo", + "version": "1.0.2", + "description": "Create urls from username/repo", + "main": "index.js", + "scripts": { + "test": "mocha -R spec" + }, + "devDependencies": { + "mocha": "~1.13.0" + }, + "repository": { + "type": "git", + "url": "git@github.com:robertkowalski/github-url-from-username-repo.git" + }, + "author": { + "name": "Robert Kowalski", + "email": "rok@kowalski.gd" + }, + "license": "BSD-2-Clause", + "bugs": { + "url": "https://github.com/robertkowalski/github-url-from-username-repo/issues" + }, + "keywords": [ + "git", + "github", + "repo" + ], + "readme": "[![Build Status](https://travis-ci.org/robertkowalski/github-url-from-username-repo.png?branch=master)](https://travis-ci.org/robertkowalski/github-url-from-username-repo)\n[![Dependency Status](https://gemnasium.com/robertkowalski/github-url-from-username-repo.png)](https://gemnasium.com/robertkowalski/github-url-from-username-repo)\n\n\n# github-url-from-username-repo\n\n## API\n\n### getUrl(url, [forBrowser])\n\nGet's the url normalized for npm.\nIf `forBrowser` is true, return a GitHub url that is usable in a webbrowser.\n\n## Usage\n\n```javascript\n\nvar getUrl = require(\"github-url-from-username-repo\")\ngetUrl(\"visionmedia/express\") // https://github.com/visionmedia/express\n\n```\n", + "readmeFilename": "README.md", + "gitHead": "d404a13f7f04edaed0e2f068a43b81230b8c7aee", + "homepage": "https://github.com/robertkowalski/github-url-from-username-repo", + "_id": "github-url-from-username-repo@1.0.2", + "_shasum": "7dd79330d2abe69c10c2cef79714c97215791dfa", + "_from": "github-url-from-username-repo@>=1.0.2-0 <2.0.0-0" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/github-url-from-username-repo/test/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/github-url-from-username-repo/test/index.js new file mode 100644 index 00000000..10fe3a34 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/github-url-from-username-repo/test/index.js @@ -0,0 +1,70 @@ +var assert = require("assert") +var getUrl = require("../") + +describe("github url from username/repo", function () { + it("returns a github url for the username/repo", function () { + var url = getUrl("visionmedia/express") + assert.equal("https://github.com/visionmedia/express", url) + }) + + it("returns null if it does not match", function () { + var url = getUrl("package") + assert.deepEqual(null, url) + }) + + it("returns null if no repo/user was given", function () { + var url = getUrl() + assert.deepEqual(null, url) + }) + + it("returns null for something that's already a URI", function () { + var url = getUrl("file:../relative") + assert.deepEqual(null, url) + }) + + it("works with .", function () { + var url = getUrl("component/.download.er.js.") + assert.equal("https://github.com/component/.download.er.js.", url) + }) + + it("works with . in the beginning", function () { + var url = getUrl("component/.downloader.js") + assert.equal("https://github.com/component/.downloader.js", url) + }) + + it("works with -", function () { + var url = getUrl("component/-dow-nloader.j-s") + assert.equal("https://github.com/component/-dow-nloader.j-s", url) + }) + + it("can handle branches with #", function () { + var url = getUrl( + "component/entejs#1c3e1fe71640b4b477f04d947bd53c473799b277") + + assert.equal("https://github.com/component/entejs#1c3e1fe71640b" + + "4b477f04d947bd53c473799b277", url) + }) + + it("can handle branches with slashes", function () { + var url = getUrl( + "component/entejs#some/branch/name") + + assert.equal("https://github.com/component/entejs#some/branch/name", url) + }) + + describe("browser mode", function () { + it("is able to return urls for branches", function () { + var url = getUrl( + "component/entejs#1c3e1fe71640b4b477f04d947bd53c473799b277", true) + + assert.equal("https://github.com/component/entejs/tree/1c3e1fe71640b" + + "4b477f04d947bd53c473799b277", url) + }) + it("is able to return urls without a branch for the browser", function () { + var url = getUrl( + "component/entejs", true) + + assert.equal("https://github.com/component/entejs", url) + }) + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/README.md new file mode 100644 index 00000000..9dd9384f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/README.md @@ -0,0 +1,365 @@ +# Glob + +Match files using the patterns the shell uses, like stars and stuff. + +[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master) + +This is a glob implementation in JavaScript. It uses the `minimatch` +library to do its matching. + +![](oh-my-glob.gif) + +## Usage + +Install with npm + +``` +npm i glob +``` + +```javascript +var glob = require("glob") + +// options is optional +glob("**/*.js", options, function (er, files) { + // files is an array of filenames. + // If the `nonull` option is set, and nothing + // was found, then files is ["**/*.js"] + // er is an error object or null. +}) +``` + +## Glob Primer + +"Globs" are the patterns you type when you do stuff like `ls *.js` on +the command line, or put `build/*` in a `.gitignore` file. + +Before parsing the path part patterns, braced sections are expanded +into a set. Braced sections start with `{` and end with `}`, with any +number of comma-delimited sections within. Braced sections may contain +slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`. + +The following characters have special magic meaning when used in a +path portion: + +* `*` Matches 0 or more characters in a single path portion +* `?` Matches 1 character +* `[...]` Matches a range of characters, similar to a RegExp range. + If the first character of the range is `!` or `^` then it matches + any character not in the range. +* `!(pattern|pattern|pattern)` Matches anything that does not match + any of the patterns provided. +* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the + patterns provided. +* `+(pattern|pattern|pattern)` Matches one or more occurrences of the + patterns provided. +* `*(a|b|c)` Matches zero or more occurrences of the patterns provided +* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns + provided +* `**` If a "globstar" is alone in a path portion, then it matches + zero or more directories and subdirectories searching for matches. + It does not crawl symlinked directories. + +### Dots + +If a file or directory path portion has a `.` as the first character, +then it will not match any glob pattern unless that pattern's +corresponding path part also has a `.` as its first character. + +For example, the pattern `a/.*/c` would match the file at `a/.b/c`. +However the pattern `a/*/c` would not, because `*` does not start with +a dot character. + +You can make glob treat dots as normal characters by setting +`dot:true` in the options. + +### Basename Matching + +If you set `matchBase:true` in the options, and the pattern has no +slashes in it, then it will seek for any file anywhere in the tree +with a matching basename. For example, `*.js` would match +`test/simple/basic.js`. + +### Empty Sets + +If no matching files are found, then an empty array is returned. This +differs from the shell, where the pattern itself is returned. For +example: + + $ echo a*s*d*f + a*s*d*f + +To get the bash-style behavior, set the `nonull:true` in the options. + +### See Also: + +* `man sh` +* `man bash` (Search for "Pattern Matching") +* `man 3 fnmatch` +* `man 5 gitignore` +* [minimatch documentation](https://github.com/isaacs/minimatch) + +## glob.hasMagic(pattern, [options]) + +Returns `true` if there are any special characters in the pattern, and +`false` otherwise. + +Note that the options affect the results. If `noext:true` is set in +the options object, then `+(a|b)` will not be considered a magic +pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}` +then that is considered magical, unless `nobrace:true` is set in the +options. + +## glob(pattern, [options], cb) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* `cb` `{Function}` + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Perform an asynchronous glob search. + +## glob.sync(pattern, [options]) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* return: `{Array}` filenames found matching the pattern + +Perform a synchronous glob search. + +## Class: glob.Glob + +Create a Glob object by instantiating the `glob.Glob` class. + +```javascript +var Glob = require("glob").Glob +var mg = new Glob(pattern, options, cb) +``` + +It's an EventEmitter, and starts walking the filesystem to find matches +immediately. + +### new glob.Glob(pattern, [options], [cb]) + +* `pattern` `{String}` pattern to search for +* `options` `{Object}` +* `cb` `{Function}` Called when an error occurs, or matches are found + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Note that if the `sync` flag is set in the options, then matches will +be immediately available on the `g.found` member. + +### Properties + +* `minimatch` The minimatch object that the glob uses. +* `options` The options object passed in. +* `aborted` Boolean which is set to true when calling `abort()`. There + is no way at this time to continue a glob search after aborting, but + you can re-use the statCache to avoid having to duplicate syscalls. +* `cache` Convenience object. Each field has the following possible + values: + * `false` - Path does not exist + * `true` - Path exists + * `'FILE'` - Path exists, and is not a directory + * `'DIR'` - Path exists, and is a directory + * `[file, entries, ...]` - Path exists, is a directory, and the + array value is the results of `fs.readdir` +* `statCache` Cache of `fs.stat` results, to prevent statting the same + path multiple times. +* `symlinks` A record of which paths are symbolic links, which is + relevant in resolving `**` patterns. +* `realpathCache` An optional object which is passed to `fs.realpath` + to minimize unnecessary syscalls. It is stored on the instantiated + Glob object, and may be re-used. + +### Events + +* `end` When the matching is finished, this is emitted with all the + matches found. If the `nonull` option is set, and no match was found, + then the `matches` list contains the original pattern. The matches + are sorted, unless the `nosort` flag is set. +* `match` Every time a match is found, this is emitted with the specific + thing that matched. It is not deduplicated or resolved to a realpath. +* `error` Emitted when an unexpected error is encountered, or whenever + any fs error occurs if `options.strict` is set. +* `abort` When `abort()` is called, this event is raised. + +### Methods + +* `pause` Temporarily stop the search +* `resume` Resume the search +* `abort` Stop the search forever + +### Options + +All the options that can be passed to Minimatch can also be passed to +Glob to change pattern matching behavior. Also, some have been added, +or have glob-specific ramifications. + +All options are false by default, unless otherwise noted. + +All options are added to the Glob object, as well. + +If you are running many `glob` operations, you can pass a Glob object +as the `options` argument to a subsequent operation to shortcut some +`stat` and `readdir` calls. At the very least, you may pass in shared +`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that +parallel glob operations will be sped up by sharing information about +the filesystem. + +* `cwd` The current working directory in which to search. Defaults + to `process.cwd()`. +* `root` The place where patterns starting with `/` will be mounted + onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix + systems, and `C:\` or some such on Windows.) +* `dot` Include `.dot` files in normal matches and `globstar` matches. + Note that an explicit dot in a portion of the pattern will always + match dot files. +* `nomount` By default, a pattern starting with a forward-slash will be + "mounted" onto the root setting, so that a valid filesystem path is + returned. Set this flag to disable that behavior. +* `mark` Add a `/` character to directory matches. Note that this + requires additional stat calls. +* `nosort` Don't sort the results. +* `stat` Set to true to stat *all* results. This reduces performance + somewhat, and is completely unnecessary, unless `readdir` is presumed + to be an untrustworthy indicator of file existence. +* `silent` When an unusual error is encountered when attempting to + read a directory, a warning will be printed to stderr. Set the + `silent` option to true to suppress these warnings. +* `strict` When an unusual error is encountered when attempting to + read a directory, the process will just continue on in search of + other matches. Set the `strict` option to raise an error in these + cases. +* `cache` See `cache` property above. Pass in a previously generated + cache object to save some fs calls. +* `statCache` A cache of results of filesystem information, to prevent + unnecessary stat calls. While it should not normally be necessary + to set this, you may pass the statCache from one glob() call to the + options object of another, if you know that the filesystem will not + change between calls. (See "Race Conditions" below.) +* `symlinks` A cache of known symbolic links. You may pass in a + previously generated `symlinks` object to save `lstat` calls when + resolving `**` matches. +* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead. +* `nounique` In some cases, brace-expanded patterns can result in the + same file showing up multiple times in the result set. By default, + this implementation prevents duplicates in the result set. Set this + flag to disable that behavior. +* `nonull` Set to never return an empty set, instead returning a set + containing the pattern itself. This is the default in glob(3). +* `debug` Set to enable debug logging in minimatch and glob. +* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets. +* `noglobstar` Do not match `**` against multiple filenames. (Ie, + treat it as a normal `*` instead.) +* `noext` Do not match `+(a|b)` "extglob" patterns. +* `nocase` Perform a case-insensitive match. Note: on + case-insensitive filesystems, non-magic patterns will match by + default, since `stat` and `readdir` will not raise errors. +* `matchBase` Perform a basename-only match if the pattern does not + contain any slash characters. That is, `*.js` would be treated as + equivalent to `**/*.js`, matching all js files in all directories. +* `nodir` Do not match directories, only files. (Note: to match + *only* directories, simply put a `/` at the end of the pattern.) +* `ignore` Add a pattern or an array of glob patterns to exclude matches. + Note: `ignore` patterns are *always* in `dot:true` mode, regardless + of any other settings. +* `follow` Follow symlinked directories when expanding `**` patterns. + Note that this can result in a lot of duplicate references in the + presence of cyclic links. +* `realpath` Set to true to call `fs.realpath` on all of the results. + In the case of a symlink that cannot be resolved, the full absolute + path to the matched entry is returned (though it will usually be a + broken symlink) + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between node-glob and other +implementations, and are intentional. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.3, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +Note that symlinked directories are not crawled as part of a `**`, +though their contents may match against subsequent portions of the +pattern. This prevents infinite loops and duplicates and the like. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then glob returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. + +### Comments and Negation + +Previously, this module let you mark a pattern as a "comment" if it +started with a `#` character, or a "negated" pattern if it started +with a `!` character. + +These options were deprecated in version 5, and removed in version 6. + +To specify things that should not match, use the `ignore` option. + +## Windows + +**Please only use forward-slashes in glob expressions.** + +Though windows uses either `/` or `\` as its path separator, only `/` +characters are used by this glob implementation. You must use +forward-slashes **only** in glob expressions. Back-slashes will always +be interpreted as escape characters, not path separators. + +Results from absolute patterns such as `/foo/*` are mounted onto the +root setting using `path.join`. On windows, this will by default result +in `/foo/*` matching `C:\foo\bar.txt`. + +## Race Conditions + +Glob searching, by its very nature, is susceptible to race conditions, +since it relies on directory walking and such. + +As a result, it is possible that a file that exists when glob looks for +it may have been deleted or modified by the time it returns the result. + +As part of its internal implementation, this program caches all stat +and readdir calls that it makes, in order to cut down on system +overhead. However, this also makes it even more susceptible to races, +especially if the cache or statCache objects are reused between glob +calls. + +Users are thus advised not to use a glob result as a guarantee of +filesystem state in the face of rapid changes. For the vast majority +of operations, this is never a problem. + +## Contributing + +Any change to behavior (including bugfixes) must come with a test. + +Patches that fail tests or reduce performance will be rejected. + +``` +# to run tests +npm test + +# to re-generate test fixtures +npm run test-regen + +# to benchmark against bash/zsh +npm run bench + +# to profile javascript +npm run prof +``` diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/changelog.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/changelog.md new file mode 100644 index 00000000..41636771 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/changelog.md @@ -0,0 +1,67 @@ +## 7.0 + +- Raise error if `options.cwd` is specified, and not a directory + +## 6.0 + +- Remove comment and negation pattern support +- Ignore patterns are always in `dot:true` mode + +## 5.0 + +- Deprecate comment and negation patterns +- Fix regression in `mark` and `nodir` options from making all cache + keys absolute path. +- Abort if `fs.readdir` returns an error that's unexpected +- Don't emit `match` events for ignored items +- Treat ENOTSUP like ENOTDIR in readdir + +## 4.5 + +- Add `options.follow` to always follow directory symlinks in globstar +- Add `options.realpath` to call `fs.realpath` on all results +- Always cache based on absolute path + +## 4.4 + +- Add `options.ignore` +- Fix handling of broken symlinks + +## 4.3 + +- Bump minimatch to 2.x +- Pass all tests on Windows + +## 4.2 + +- Add `glob.hasMagic` function +- Add `options.nodir` flag + +## 4.1 + +- Refactor sync and async implementations for performance +- Throw if callback provided to sync glob function +- Treat symbolic links in globstar results the same as Bash 4.3 + +## 4.0 + +- Use `^` for dependency versions (bumped major because this breaks + older npm versions) +- Ensure callbacks are only ever called once +- switch to ISC license + +## 3.x + +- Rewrite in JavaScript +- Add support for setting root, cwd, and windows support +- Cache many fs calls +- Add globstar support +- emit match events + +## 2.x + +- Use `glob.h` and `fnmatch.h` from NetBSD + +## 1.x + +- `glob.h` static binding. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/common.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/common.js new file mode 100644 index 00000000..58dc41e6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/common.js @@ -0,0 +1,235 @@ +exports.alphasort = alphasort +exports.alphasorti = alphasorti +exports.setopts = setopts +exports.ownProp = ownProp +exports.makeAbs = makeAbs +exports.finish = finish +exports.mark = mark +exports.isIgnored = isIgnored +exports.childrenIgnored = childrenIgnored + +function ownProp (obj, field) { + return Object.prototype.hasOwnProperty.call(obj, field) +} + +var path = require("path") +var minimatch = require("minimatch") +var isAbsolute = require("path-is-absolute") +var Minimatch = minimatch.Minimatch + +function alphasorti (a, b) { + return a.toLowerCase().localeCompare(b.toLowerCase()) +} + +function alphasort (a, b) { + return a.localeCompare(b) +} + +function setupIgnores (self, options) { + self.ignore = options.ignore || [] + + if (!Array.isArray(self.ignore)) + self.ignore = [self.ignore] + + if (self.ignore.length) { + self.ignore = self.ignore.map(ignoreMap) + } +} + +// ignore patterns are always in dot:true mode. +function ignoreMap (pattern) { + var gmatcher = null + if (pattern.slice(-3) === '/**') { + var gpattern = pattern.replace(/(\/\*\*)+$/, '') + gmatcher = new Minimatch(gpattern, { dot: true }) + } + + return { + matcher: new Minimatch(pattern, { dot: true }), + gmatcher: gmatcher + } +} + +function setopts (self, pattern, options) { + if (!options) + options = {} + + // base-matching: just use globstar for that. + if (options.matchBase && -1 === pattern.indexOf("/")) { + if (options.noglobstar) { + throw new Error("base matching requires globstar") + } + pattern = "**/" + pattern + } + + self.silent = !!options.silent + self.pattern = pattern + self.strict = options.strict !== false + self.realpath = !!options.realpath + self.realpathCache = options.realpathCache || Object.create(null) + self.follow = !!options.follow + self.dot = !!options.dot + self.mark = !!options.mark + self.nodir = !!options.nodir + if (self.nodir) + self.mark = true + self.sync = !!options.sync + self.nounique = !!options.nounique + self.nonull = !!options.nonull + self.nosort = !!options.nosort + self.nocase = !!options.nocase + self.stat = !!options.stat + self.noprocess = !!options.noprocess + + self.maxLength = options.maxLength || Infinity + self.cache = options.cache || Object.create(null) + self.statCache = options.statCache || Object.create(null) + self.symlinks = options.symlinks || Object.create(null) + + setupIgnores(self, options) + + self.changedCwd = false + var cwd = process.cwd() + if (!ownProp(options, "cwd")) + self.cwd = cwd + else { + self.cwd = path.resolve(options.cwd) + self.changedCwd = self.cwd !== cwd + } + + self.root = options.root || path.resolve(self.cwd, "/") + self.root = path.resolve(self.root) + if (process.platform === "win32") + self.root = self.root.replace(/\\/g, "/") + + self.cwdAbs = makeAbs(self, self.cwd) + self.nomount = !!options.nomount + + // disable comments and negation in Minimatch. + // Note that they are not supported in Glob itself anyway. + options.nonegate = true + options.nocomment = true + + self.minimatch = new Minimatch(pattern, options) + self.options = self.minimatch.options +} + +function finish (self) { + var nou = self.nounique + var all = nou ? [] : Object.create(null) + + for (var i = 0, l = self.matches.length; i < l; i ++) { + var matches = self.matches[i] + if (!matches || Object.keys(matches).length === 0) { + if (self.nonull) { + // do like the shell, and spit out the literal glob + var literal = self.minimatch.globSet[i] + if (nou) + all.push(literal) + else + all[literal] = true + } + } else { + // had matches + var m = Object.keys(matches) + if (nou) + all.push.apply(all, m) + else + m.forEach(function (m) { + all[m] = true + }) + } + } + + if (!nou) + all = Object.keys(all) + + if (!self.nosort) + all = all.sort(self.nocase ? alphasorti : alphasort) + + // at *some* point we statted all of these + if (self.mark) { + for (var i = 0; i < all.length; i++) { + all[i] = self._mark(all[i]) + } + if (self.nodir) { + all = all.filter(function (e) { + var notDir = !(/\/$/.test(e)) + var c = self.cache[e] || self.cache[makeAbs(self, e)] + if (notDir && c) + notDir = c !== 'DIR' && !Array.isArray(c) + return notDir + }) + } + } + + if (self.ignore.length) + all = all.filter(function(m) { + return !isIgnored(self, m) + }) + + self.found = all +} + +function mark (self, p) { + var abs = makeAbs(self, p) + var c = self.cache[abs] + var m = p + if (c) { + var isDir = c === 'DIR' || Array.isArray(c) + var slash = p.slice(-1) === '/' + + if (isDir && !slash) + m += '/' + else if (!isDir && slash) + m = m.slice(0, -1) + + if (m !== p) { + var mabs = makeAbs(self, m) + self.statCache[mabs] = self.statCache[abs] + self.cache[mabs] = self.cache[abs] + } + } + + return m +} + +// lotta situps... +function makeAbs (self, f) { + var abs = f + if (f.charAt(0) === '/') { + abs = path.join(self.root, f) + } else if (isAbsolute(f) || f === '') { + abs = f + } else if (self.changedCwd) { + abs = path.resolve(self.cwd, f) + } else { + abs = path.resolve(f) + } + + if (process.platform === 'win32') + abs = abs.replace(/\\/g, '/') + + return abs +} + + +// Return true, if pattern ends with globstar '**', for the accompanying parent directory. +// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents +function isIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) + }) +} + +function childrenIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return !!(item.gmatcher && item.gmatcher.match(path)) + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/glob.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/glob.js new file mode 100644 index 00000000..9eca910b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/glob.js @@ -0,0 +1,787 @@ +// Approach: +// +// 1. Get the minimatch set +// 2. For each pattern in the set, PROCESS(pattern, false) +// 3. Store matches per-set, then uniq them +// +// PROCESS(pattern, inGlobStar) +// Get the first [n] items from pattern that are all strings +// Join these together. This is PREFIX. +// If there is no more remaining, then stat(PREFIX) and +// add to matches if it succeeds. END. +// +// If inGlobStar and PREFIX is symlink and points to dir +// set ENTRIES = [] +// else readdir(PREFIX) as ENTRIES +// If fail, END +// +// with ENTRIES +// If pattern[n] is GLOBSTAR +// // handle the case where the globstar match is empty +// // by pruning it out, and testing the resulting pattern +// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) +// // handle other cases. +// for ENTRY in ENTRIES (not dotfiles) +// // attach globstar + tail onto the entry +// // Mark that this entry is a globstar match +// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) +// +// else // not globstar +// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) +// Test ENTRY against pattern[n] +// If fails, continue +// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) +// +// Caveat: +// Cache all stats and readdirs results to minimize syscall. Since all +// we ever care about is existence and directory-ness, we can just keep +// `true` for files, and [children,...] for directories, or `false` for +// things that don't exist. + +module.exports = glob + +var fs = require('fs') +var rp = require('fs.realpath') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var inherits = require('inherits') +var EE = require('events').EventEmitter +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var globSync = require('./sync.js') +var common = require('./common.js') +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var inflight = require('inflight') +var util = require('util') +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored + +var once = require('once') + +function glob (pattern, options, cb) { + if (typeof options === 'function') cb = options, options = {} + if (!options) options = {} + + if (options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return globSync(pattern, options) + } + + return new Glob(pattern, options, cb) +} + +glob.sync = globSync +var GlobSync = glob.GlobSync = globSync.GlobSync + +// old api surface +glob.glob = glob + +function extend (origin, add) { + if (add === null || typeof add !== 'object') { + return origin + } + + var keys = Object.keys(add) + var i = keys.length + while (i--) { + origin[keys[i]] = add[keys[i]] + } + return origin +} + +glob.hasMagic = function (pattern, options_) { + var options = extend({}, options_) + options.noprocess = true + + var g = new Glob(pattern, options) + var set = g.minimatch.set + + if (!pattern) + return false + + if (set.length > 1) + return true + + for (var j = 0; j < set[0].length; j++) { + if (typeof set[0][j] !== 'string') + return true + } + + return false +} + +glob.Glob = Glob +inherits(Glob, EE) +function Glob (pattern, options, cb) { + if (typeof options === 'function') { + cb = options + options = null + } + + if (options && options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return new GlobSync(pattern, options) + } + + if (!(this instanceof Glob)) + return new Glob(pattern, options, cb) + + setopts(this, pattern, options) + this._didRealPath = false + + // process each pattern in the minimatch set + var n = this.minimatch.set.length + + // The matches are stored as {: true,...} so that + // duplicates are automagically pruned. + // Later, we do an Object.keys() on these. + // Keep them as a list so we can fill in when nonull is set. + this.matches = new Array(n) + + if (typeof cb === 'function') { + cb = once(cb) + this.on('error', cb) + this.on('end', function (matches) { + cb(null, matches) + }) + } + + var self = this + var n = this.minimatch.set.length + this._processing = 0 + this.matches = new Array(n) + + this._emitQueue = [] + this._processQueue = [] + this.paused = false + + if (this.noprocess) + return this + + if (n === 0) + return done() + + var sync = true + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false, done) + } + sync = false + + function done () { + --self._processing + if (self._processing <= 0) { + if (sync) { + process.nextTick(function () { + self._finish() + }) + } else { + self._finish() + } + } + } +} + +Glob.prototype._finish = function () { + assert(this instanceof Glob) + if (this.aborted) + return + + if (this.realpath && !this._didRealpath) + return this._realpath() + + common.finish(this) + this.emit('end', this.found) +} + +Glob.prototype._realpath = function () { + if (this._didRealpath) + return + + this._didRealpath = true + + var n = this.matches.length + if (n === 0) + return this._finish() + + var self = this + for (var i = 0; i < this.matches.length; i++) + this._realpathSet(i, next) + + function next () { + if (--n === 0) + self._finish() + } +} + +Glob.prototype._realpathSet = function (index, cb) { + var matchset = this.matches[index] + if (!matchset) + return cb() + + var found = Object.keys(matchset) + var self = this + var n = found.length + + if (n === 0) + return cb() + + var set = this.matches[index] = Object.create(null) + found.forEach(function (p, i) { + // If there's a problem with the stat, then it means that + // one or more of the links in the realpath couldn't be + // resolved. just return the abs value in that case. + p = self._makeAbs(p) + rp.realpath(p, self.realpathCache, function (er, real) { + if (!er) + set[real] = true + else if (er.syscall === 'stat') + set[p] = true + else + self.emit('error', er) // srsly wtf right here + + if (--n === 0) { + self.matches[index] = set + cb() + } + }) + }) +} + +Glob.prototype._mark = function (p) { + return common.mark(this, p) +} + +Glob.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} + +Glob.prototype.abort = function () { + this.aborted = true + this.emit('abort') +} + +Glob.prototype.pause = function () { + if (!this.paused) { + this.paused = true + this.emit('pause') + } +} + +Glob.prototype.resume = function () { + if (this.paused) { + this.emit('resume') + this.paused = false + if (this._emitQueue.length) { + var eq = this._emitQueue.slice(0) + this._emitQueue.length = 0 + for (var i = 0; i < eq.length; i ++) { + var e = eq[i] + this._emitMatch(e[0], e[1]) + } + } + if (this._processQueue.length) { + var pq = this._processQueue.slice(0) + this._processQueue.length = 0 + for (var i = 0; i < pq.length; i ++) { + var p = pq[i] + this._processing-- + this._process(p[0], p[1], p[2], p[3]) + } + } + } +} + +Glob.prototype._process = function (pattern, index, inGlobStar, cb) { + assert(this instanceof Glob) + assert(typeof cb === 'function') + + if (this.aborted) + return + + this._processing++ + if (this.paused) { + this._processQueue.push([pattern, index, inGlobStar, cb]) + return + } + + //console.error('PROCESS %d', this._processing, pattern) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // see if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index, cb) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip _processing + if (childrenIgnored(this, read)) + return cb() + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) +} + +Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + +Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return cb() + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return cb() + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return cb() + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + this._process([e].concat(remain), index, inGlobStar, cb) + } + cb() +} + +Glob.prototype._emitMatch = function (index, e) { + if (this.aborted) + return + + if (this.matches[index][e]) + return + + if (isIgnored(this, e)) + return + + if (this.paused) { + this._emitQueue.push([index, e]) + return + } + + var abs = this._makeAbs(e) + + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } + + if (this.mark) + e = this._mark(e) + + this.matches[index][e] = true + + var st = this.statCache[abs] + if (st) + this.emit('stat', e, st) + + this.emit('match', e) +} + +Glob.prototype._readdirInGlobStar = function (abs, cb) { + if (this.aborted) + return + + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false, cb) + + var lstatkey = 'lstat\0' + abs + var self = this + var lstatcb = inflight(lstatkey, lstatcb_) + + if (lstatcb) + fs.lstat(abs, lstatcb) + + function lstatcb_ (er, lstat) { + if (er) + return cb() + + var isSym = lstat.isSymbolicLink() + self.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && !lstat.isDirectory()) { + self.cache[abs] = 'FILE' + cb() + } else + self._readdir(abs, false, cb) + } +} + +Glob.prototype._readdir = function (abs, inGlobStar, cb) { + if (this.aborted) + return + + cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) + if (!cb) + return + + //console.error('RD %j %j', +inGlobStar, abs) + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs, cb) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return cb() + + if (Array.isArray(c)) + return cb(null, c) + } + + var self = this + fs.readdir(abs, readdirCb(this, abs, cb)) +} + +function readdirCb (self, abs, cb) { + return function (er, entries) { + if (er) + self._readdirError(abs, er, cb) + else + self._readdirEntries(abs, entries, cb) + } +} + +Glob.prototype._readdirEntries = function (abs, entries, cb) { + if (this.aborted) + return + + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + return cb(null, entries) +} + +Glob.prototype._readdirError = function (f, er, cb) { + if (this.aborted) + return + + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + var abs = this._makeAbs(f) + this.cache[abs] = 'FILE' + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd) + error.path = this.cwd + error.code = er.code + this.emit('error', error) + this.abort() + } + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) { + this.emit('error', er) + // If the error is handled, then we abort + // if not, we threw out of here + this.abort() + } + if (!this.silent) + console.error('glob error', er) + break + } + + return cb() +} + +Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + + +Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + //console.error('pgs2', prefix, remain[0], entries) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return cb() + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false, cb) + + var isSym = this.symlinks[abs] + var len = entries.length + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return cb() + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true, cb) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true, cb) + } + + cb() +} + +Glob.prototype._processSimple = function (prefix, index, cb) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var self = this + this._stat(prefix, function (er, exists) { + self._processSimple2(prefix, index, er, exists, cb) + }) +} +Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { + + //console.error('ps2', prefix, exists) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return cb() + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this._emitMatch(index, prefix) + cb() +} + +// Returns either 'DIR', 'FILE', or false +Glob.prototype._stat = function (f, cb) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return cb() + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return cb(null, c) + + if (needDir && c === 'FILE') + return cb() + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (stat !== undefined) { + if (stat === false) + return cb(null, stat) + else { + var type = stat.isDirectory() ? 'DIR' : 'FILE' + if (needDir && type === 'FILE') + return cb() + else + return cb(null, type, stat) + } + } + + var self = this + var statcb = inflight('stat\0' + abs, lstatcb_) + if (statcb) + fs.lstat(abs, statcb) + + function lstatcb_ (er, lstat) { + if (lstat && lstat.isSymbolicLink()) { + // If it's a symlink, then treat it as the target, unless + // the target does not exist, then treat it as a file. + return fs.stat(abs, function (er, stat) { + if (er) + self._stat2(f, abs, null, lstat, cb) + else + self._stat2(f, abs, er, stat, cb) + }) + } else { + self._stat2(f, abs, er, lstat, cb) + } + } +} + +Glob.prototype._stat2 = function (f, abs, er, stat, cb) { + if (er) { + this.statCache[abs] = false + return cb() + } + + var needDir = f.slice(-1) === '/' + this.statCache[abs] = stat + + if (abs.slice(-1) === '/' && !stat.isDirectory()) + return cb(null, false, stat) + + var c = stat.isDirectory() ? 'DIR' : 'FILE' + this.cache[abs] = this.cache[abs] || c + + if (needDir && c !== 'DIR') + return cb() + + return cb(null, c, stat) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/node_modules/fs.realpath/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/node_modules/fs.realpath/LICENSE new file mode 100644 index 00000000..5bd884c2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/node_modules/fs.realpath/LICENSE @@ -0,0 +1,43 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +---- + +This library bundles a version of the `fs.realpath` and `fs.realpathSync` +methods from Node.js v0.10 under the terms of the Node.js MIT license. + +Node's license follows, also included at the header of `old.js` which contains +the licensed code: + + Copyright Joyent, Inc. and other Node contributors. + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/node_modules/fs.realpath/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/node_modules/fs.realpath/README.md new file mode 100644 index 00000000..a42ceac6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/node_modules/fs.realpath/README.md @@ -0,0 +1,33 @@ +# fs.realpath + +A backwards-compatible fs.realpath for Node v6 and above + +In Node v6, the JavaScript implementation of fs.realpath was replaced +with a faster (but less resilient) native implementation. That raises +new and platform-specific errors and cannot handle long or excessively +symlink-looping paths. + +This module handles those cases by detecting the new errors and +falling back to the JavaScript implementation. On versions of Node +prior to v6, it has no effect. + +## USAGE + +```js +var rp = require('fs.realpath') + +// async version +rp.realpath(someLongAndLoopingPath, function (er, real) { + // the ELOOP was handled, but it was a bit slower +}) + +// sync version +var real = rp.realpathSync(someLongAndLoopingPath) + +// monkeypatch at your own risk! +// This replaces the fs.realpath/fs.realpathSync builtins +rp.monkeypatch() + +// un-do the monkeypatching +rp.unmonkeypatch() +``` diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/node_modules/fs.realpath/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/node_modules/fs.realpath/index.js new file mode 100644 index 00000000..b09c7c7e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/node_modules/fs.realpath/index.js @@ -0,0 +1,66 @@ +module.exports = realpath +realpath.realpath = realpath +realpath.sync = realpathSync +realpath.realpathSync = realpathSync +realpath.monkeypatch = monkeypatch +realpath.unmonkeypatch = unmonkeypatch + +var fs = require('fs') +var origRealpath = fs.realpath +var origRealpathSync = fs.realpathSync + +var version = process.version +var ok = /^v[0-5]\./.test(version) +var old = require('./old.js') + +function newError (er) { + return er && er.syscall === 'realpath' && ( + er.code === 'ELOOP' || + er.code === 'ENOMEM' || + er.code === 'ENAMETOOLONG' + ) +} + +function realpath (p, cache, cb) { + if (ok) { + return origRealpath(p, cache, cb) + } + + if (typeof cache === 'function') { + cb = cache + cache = null + } + origRealpath(p, cache, function (er, result) { + if (newError(er)) { + old.realpath(p, cache, cb) + } else { + cb(er, result) + } + }) +} + +function realpathSync (p, cache) { + if (ok) { + return origRealpathSync(p, cache) + } + + try { + return origRealpathSync(p, cache) + } catch (er) { + if (newError(er)) { + return old.realpathSync(p, cache) + } else { + throw er + } + } +} + +function monkeypatch () { + fs.realpath = realpath + fs.realpathSync = realpathSync +} + +function unmonkeypatch () { + fs.realpath = origRealpath + fs.realpathSync = origRealpathSync +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/node_modules/fs.realpath/old.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/node_modules/fs.realpath/old.js new file mode 100644 index 00000000..b40305e7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/node_modules/fs.realpath/old.js @@ -0,0 +1,303 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var pathModule = require('path'); +var isWindows = process.platform === 'win32'; +var fs = require('fs'); + +// JavaScript implementation of realpath, ported from node pre-v6 + +var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); + +function rethrow() { + // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and + // is fairly slow to generate. + var callback; + if (DEBUG) { + var backtrace = new Error; + callback = debugCallback; + } else + callback = missingCallback; + + return callback; + + function debugCallback(err) { + if (err) { + backtrace.message = err.message; + err = backtrace; + missingCallback(err); + } + } + + function missingCallback(err) { + if (err) { + if (process.throwDeprecation) + throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs + else if (!process.noDeprecation) { + var msg = 'fs: missing callback ' + (err.stack || err.message); + if (process.traceDeprecation) + console.trace(msg); + else + console.error(msg); + } + } + } +} + +function maybeCallback(cb) { + return typeof cb === 'function' ? cb : rethrow(); +} + +var normalize = pathModule.normalize; + +// Regexp that finds the next partion of a (partial) path +// result is [base_with_slash, base], e.g. ['somedir/', 'somedir'] +if (isWindows) { + var nextPartRe = /(.*?)(?:[\/\\]+|$)/g; +} else { + var nextPartRe = /(.*?)(?:[\/]+|$)/g; +} + +// Regex to find the device root, including trailing slash. E.g. 'c:\\'. +if (isWindows) { + var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; +} else { + var splitRootRe = /^[\/]*/; +} + +exports.realpathSync = function realpathSync(p, cache) { + // make p is absolute + p = pathModule.resolve(p); + + if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { + return cache[p]; + } + + var original = p, + seenLinks = {}, + knownHard = {}; + + // current character position in p + var pos; + // the partial path so far, including a trailing slash if any + var current; + // the partial path without a trailing slash (except when pointing at a root) + var base; + // the partial path scanned in the previous round, with slash + var previous; + + start(); + + function start() { + // Skip over roots + var m = splitRootRe.exec(p); + pos = m[0].length; + current = m[0]; + base = m[0]; + previous = ''; + + // On windows, check that the root exists. On unix there is no need. + if (isWindows && !knownHard[base]) { + fs.lstatSync(base); + knownHard[base] = true; + } + } + + // walk down the path, swapping out linked pathparts for their real + // values + // NB: p.length changes. + while (pos < p.length) { + // find the next part + nextPartRe.lastIndex = pos; + var result = nextPartRe.exec(p); + previous = current; + current += result[0]; + base = previous + result[1]; + pos = nextPartRe.lastIndex; + + // continue if not a symlink + if (knownHard[base] || (cache && cache[base] === base)) { + continue; + } + + var resolvedLink; + if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { + // some known symbolic link. no need to stat again. + resolvedLink = cache[base]; + } else { + var stat = fs.lstatSync(base); + if (!stat.isSymbolicLink()) { + knownHard[base] = true; + if (cache) cache[base] = base; + continue; + } + + // read the link if it wasn't read before + // dev/ino always return 0 on windows, so skip the check. + var linkTarget = null; + if (!isWindows) { + var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); + if (seenLinks.hasOwnProperty(id)) { + linkTarget = seenLinks[id]; + } + } + if (linkTarget === null) { + fs.statSync(base); + linkTarget = fs.readlinkSync(base); + } + resolvedLink = pathModule.resolve(previous, linkTarget); + // track this, if given a cache. + if (cache) cache[base] = resolvedLink; + if (!isWindows) seenLinks[id] = linkTarget; + } + + // resolve the link, then start over + p = pathModule.resolve(resolvedLink, p.slice(pos)); + start(); + } + + if (cache) cache[original] = p; + + return p; +}; + + +exports.realpath = function realpath(p, cache, cb) { + if (typeof cb !== 'function') { + cb = maybeCallback(cache); + cache = null; + } + + // make p is absolute + p = pathModule.resolve(p); + + if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { + return process.nextTick(cb.bind(null, null, cache[p])); + } + + var original = p, + seenLinks = {}, + knownHard = {}; + + // current character position in p + var pos; + // the partial path so far, including a trailing slash if any + var current; + // the partial path without a trailing slash (except when pointing at a root) + var base; + // the partial path scanned in the previous round, with slash + var previous; + + start(); + + function start() { + // Skip over roots + var m = splitRootRe.exec(p); + pos = m[0].length; + current = m[0]; + base = m[0]; + previous = ''; + + // On windows, check that the root exists. On unix there is no need. + if (isWindows && !knownHard[base]) { + fs.lstat(base, function(err) { + if (err) return cb(err); + knownHard[base] = true; + LOOP(); + }); + } else { + process.nextTick(LOOP); + } + } + + // walk down the path, swapping out linked pathparts for their real + // values + function LOOP() { + // stop if scanned past end of path + if (pos >= p.length) { + if (cache) cache[original] = p; + return cb(null, p); + } + + // find the next part + nextPartRe.lastIndex = pos; + var result = nextPartRe.exec(p); + previous = current; + current += result[0]; + base = previous + result[1]; + pos = nextPartRe.lastIndex; + + // continue if not a symlink + if (knownHard[base] || (cache && cache[base] === base)) { + return process.nextTick(LOOP); + } + + if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { + // known symbolic link. no need to stat again. + return gotResolvedLink(cache[base]); + } + + return fs.lstat(base, gotStat); + } + + function gotStat(err, stat) { + if (err) return cb(err); + + // if not a symlink, skip to the next path part + if (!stat.isSymbolicLink()) { + knownHard[base] = true; + if (cache) cache[base] = base; + return process.nextTick(LOOP); + } + + // stat & read the link if not read before + // call gotTarget as soon as the link target is known + // dev/ino always return 0 on windows, so skip the check. + if (!isWindows) { + var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); + if (seenLinks.hasOwnProperty(id)) { + return gotTarget(null, seenLinks[id], base); + } + } + fs.stat(base, function(err) { + if (err) return cb(err); + + fs.readlink(base, function(err, target) { + if (!isWindows) seenLinks[id] = target; + gotTarget(err, target); + }); + }); + } + + function gotTarget(err, target, base) { + if (err) return cb(err); + + var resolvedLink = pathModule.resolve(previous, target); + if (cache) cache[base] = resolvedLink; + gotResolvedLink(resolvedLink); + } + + function gotResolvedLink(resolvedLink) { + // resolve the link, then start over + p = pathModule.resolve(resolvedLink, p.slice(pos)); + start(); + } +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/node_modules/fs.realpath/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/node_modules/fs.realpath/package.json new file mode 100644 index 00000000..7db74629 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/node_modules/fs.realpath/package.json @@ -0,0 +1,61 @@ +{ + "name": "fs.realpath", + "version": "1.0.0", + "description": "Use node's fs.realpath, but fall back to the JS implementation if the native one fails", + "main": "index.js", + "dependencies": {}, + "devDependencies": {}, + "scripts": { + "test": "tap test/*.js --cov" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/fs.realpath.git" + }, + "keywords": [ + "realpath", + "fs", + "polyfill" + ], + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "ISC", + "files": [ + "old.js", + "index.js" + ], + "gitHead": "03e7c884431fe185dfebbc9b771aeca339c1807a", + "bugs": { + "url": "https://github.com/isaacs/fs.realpath/issues" + }, + "homepage": "https://github.com/isaacs/fs.realpath#readme", + "_id": "fs.realpath@1.0.0", + "_shasum": "1504ad2523158caa40db4a2787cb01411994ea4f", + "_from": "fs.realpath@>=1.0.0 <2.0.0", + "_npmVersion": "3.9.1", + "_nodeVersion": "4.4.4", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "dist": { + "shasum": "1504ad2523158caa40db4a2787cb01411994ea4f", + "tarball": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/fs.realpath-1.0.0.tgz_1466015941059_0.3332864767871797" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/node_modules/path-is-absolute/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/node_modules/path-is-absolute/index.js new file mode 100644 index 00000000..19f103f9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/node_modules/path-is-absolute/index.js @@ -0,0 +1,20 @@ +'use strict'; + +function posix(path) { + return path.charAt(0) === '/'; +}; + +function win32(path) { + // https://github.com/joyent/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56 + var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; + var result = splitDeviceRe.exec(path); + var device = result[1] || ''; + var isUnc = !!device && device.charAt(1) !== ':'; + + // UNC paths are always absolute + return !!result[2] || isUnc; +}; + +module.exports = process.platform === 'win32' ? win32 : posix; +module.exports.posix = posix; +module.exports.win32 = win32; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/node_modules/path-is-absolute/license b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/node_modules/path-is-absolute/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/node_modules/path-is-absolute/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/node_modules/path-is-absolute/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/node_modules/path-is-absolute/package.json new file mode 100644 index 00000000..8f41adea --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/node_modules/path-is-absolute/package.json @@ -0,0 +1,70 @@ +{ + "name": "path-is-absolute", + "version": "1.0.0", + "description": "Node.js 0.12 path.isAbsolute() ponyfill", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/path-is-absolute.git" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "node test.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "path", + "paths", + "file", + "dir", + "absolute", + "isabsolute", + "is-absolute", + "built-in", + "util", + "utils", + "core", + "ponyfill", + "polyfill", + "shim", + "is", + "detect", + "check" + ], + "gitHead": "7a76a0c9f2263192beedbe0a820e4d0baee5b7a1", + "bugs": { + "url": "https://github.com/sindresorhus/path-is-absolute/issues" + }, + "homepage": "https://github.com/sindresorhus/path-is-absolute", + "_id": "path-is-absolute@1.0.0", + "_shasum": "263dada66ab3f2fb10bf7f9d24dd8f3e570ef912", + "_from": "path-is-absolute@>=1.0.0 <2.0.0", + "_npmVersion": "2.5.1", + "_nodeVersion": "0.12.0", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "dist": { + "shasum": "263dada66ab3f2fb10bf7f9d24dd8f3e570ef912", + "tarball": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/node_modules/path-is-absolute/readme.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/node_modules/path-is-absolute/readme.md new file mode 100644 index 00000000..cdf94f43 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/node_modules/path-is-absolute/readme.md @@ -0,0 +1,51 @@ +# path-is-absolute [![Build Status](https://travis-ci.org/sindresorhus/path-is-absolute.svg?branch=master)](https://travis-ci.org/sindresorhus/path-is-absolute) + +> Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) ponyfill + +> Ponyfill: A polyfill that doesn't overwrite the native method + + +## Install + +``` +$ npm install --save path-is-absolute +``` + + +## Usage + +```js +var pathIsAbsolute = require('path-is-absolute'); + +// Linux +pathIsAbsolute('/home/foo'); +//=> true + +// Windows +pathIsAbsolute('C:/Users/'); +//=> true + +// Any OS +pathIsAbsolute.posix('/home/foo'); +//=> true +``` + + +## API + +See the [`path.isAbsolute()` docs](http://nodejs.org/api/path.html#path_path_isabsolute_path). + +### pathIsAbsolute(path) + +### pathIsAbsolute.posix(path) + +The Posix specific version. + +### pathIsAbsolute.win32(path) + +The Windows specific version. + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/package.json new file mode 100644 index 00000000..b7e69be9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/package.json @@ -0,0 +1,78 @@ +{ + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "name": "glob", + "description": "a little globber", + "version": "7.0.6", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-glob.git" + }, + "main": "glob.js", + "files": [ + "glob.js", + "sync.js", + "common.js" + ], + "engines": { + "node": "*" + }, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.2", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "devDependencies": { + "mkdirp": "0", + "rimraf": "^2.2.8", + "tap": "^5.7.0", + "tick": "0.0.6" + }, + "scripts": { + "prepublish": "npm run benchclean", + "profclean": "rm -f v8.log profile.txt", + "test": "tap test/*.js --cov", + "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js", + "bench": "bash benchmark.sh", + "prof": "bash prof.sh && cat profile.txt", + "benchclean": "node benchclean.js" + }, + "license": "ISC", + "gitHead": "98327d8def195b1ba200217952df8ea829426038", + "bugs": { + "url": "https://github.com/isaacs/node-glob/issues" + }, + "homepage": "https://github.com/isaacs/node-glob#readme", + "_id": "glob@7.0.6", + "_shasum": "211bafaf49e525b8cd93260d14ab136152b3f57a", + "_from": "glob@7.0.6", + "_npmVersion": "3.10.7", + "_nodeVersion": "4.5.0", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "dist": { + "shasum": "211bafaf49e525b8cd93260d14ab136152b3f57a", + "tarball": "https://registry.npmjs.org/glob/-/glob-7.0.6.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/glob-7.0.6.tgz_1472074762911_0.47247025789693" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/glob/-/glob-7.0.6.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/sync.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/sync.js new file mode 100644 index 00000000..bba2dc6a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/glob/sync.js @@ -0,0 +1,468 @@ +module.exports = globSync +globSync.GlobSync = GlobSync + +var fs = require('fs') +var rp = require('fs.realpath') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var Glob = require('./glob.js').Glob +var util = require('util') +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var common = require('./common.js') +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var childrenIgnored = common.childrenIgnored + +function globSync (pattern, options) { + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + return new GlobSync(pattern, options).found +} + +function GlobSync (pattern, options) { + if (!pattern) + throw new Error('must provide pattern') + + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + if (!(this instanceof GlobSync)) + return new GlobSync(pattern, options) + + setopts(this, pattern, options) + + if (this.noprocess) + return this + + var n = this.minimatch.set.length + this.matches = new Array(n) + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false) + } + this._finish() +} + +GlobSync.prototype._finish = function () { + assert(this instanceof GlobSync) + if (this.realpath) { + var self = this + this.matches.forEach(function (matchset, index) { + var set = self.matches[index] = Object.create(null) + for (var p in matchset) { + try { + p = self._makeAbs(p) + var real = rp.realpathSync(p, self.realpathCache) + set[real] = true + } catch (er) { + if (er.syscall === 'stat') + set[self._makeAbs(p)] = true + else + throw er + } + } + }) + } + common.finish(this) +} + + +GlobSync.prototype._process = function (pattern, index, inGlobStar) { + assert(this instanceof GlobSync) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // See if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip processing + if (childrenIgnored(this, read)) + return + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar) +} + + +GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { + var entries = this._readdir(abs, inGlobStar) + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix.slice(-1) !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this.matches[index][e] = true + } + // This was the last one, and no stats were needed + return + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) + newPattern = [prefix, e] + else + newPattern = [e] + this._process(newPattern.concat(remain), index, inGlobStar) + } +} + + +GlobSync.prototype._emitMatch = function (index, e) { + var abs = this._makeAbs(e) + if (this.mark) + e = this._mark(e) + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[this._makeAbs(e)] + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true + if (this.stat) + this._stat(e) +} + + +GlobSync.prototype._readdirInGlobStar = function (abs) { + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false) + + var entries + var lstat + var stat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + // lstat failed, doesn't exist + return null + } + + var isSym = lstat.isSymbolicLink() + this.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && !lstat.isDirectory()) + this.cache[abs] = 'FILE' + else + entries = this._readdir(abs, false) + + return entries +} + +GlobSync.prototype._readdir = function (abs, inGlobStar) { + var entries + + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return null + + if (Array.isArray(c)) + return c + } + + try { + return this._readdirEntries(abs, fs.readdirSync(abs)) + } catch (er) { + this._readdirError(abs, er) + return null + } +} + +GlobSync.prototype._readdirEntries = function (abs, entries) { + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + + // mark and cache dir-ness + return entries +} + +GlobSync.prototype._readdirError = function (f, er) { + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + var abs = this._makeAbs(f) + this.cache[abs] = 'FILE' + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd) + error.path = this.cwd + error.code = er.code + throw error + } + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) + throw er + if (!this.silent) + console.error('glob error', er) + break + } +} + +GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { + + var entries = this._readdir(abs, inGlobStar) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false) + + var len = entries.length + var isSym = this.symlinks[abs] + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true) + } +} + +GlobSync.prototype._processSimple = function (prefix, index) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var exists = this._stat(prefix) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this.matches[index][prefix] = true +} + +// Returns either 'DIR', 'FILE', or false +GlobSync.prototype._stat = function (f) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return false + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return c + + if (needDir && c === 'FILE') + return false + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (!stat) { + var lstat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + return false + } + + if (lstat.isSymbolicLink()) { + try { + stat = fs.statSync(abs) + } catch (er) { + stat = lstat + } + } else { + stat = lstat + } + } + + this.statCache[abs] = stat + + var c = stat.isDirectory() ? 'DIR' : 'FILE' + this.cache[abs] = this.cache[abs] || c + + if (needDir && c !== 'DIR') + return false + + return c +} + +GlobSync.prototype._mark = function (p) { + return common.mark(this, p) +} + +GlobSync.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/graceful-fs/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/graceful-fs/LICENSE new file mode 100644 index 00000000..9d2c8036 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/graceful-fs/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter, Ben Noordhuis, and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/graceful-fs/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/graceful-fs/README.md new file mode 100644 index 00000000..5273a50a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/graceful-fs/README.md @@ -0,0 +1,133 @@ +# graceful-fs + +graceful-fs functions as a drop-in replacement for the fs module, +making various improvements. + +The improvements are meant to normalize behavior across different +platforms and environments, and to make filesystem access more +resilient to errors. + +## Improvements over [fs module](https://nodejs.org/api/fs.html) + +* Queues up `open` and `readdir` calls, and retries them once + something closes if there is an EMFILE error from too many file + descriptors. +* fixes `lchmod` for Node versions prior to 0.6.2. +* implements `fs.lutimes` if possible. Otherwise it becomes a noop. +* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or + `lchown` if the user isn't root. +* makes `lchmod` and `lchown` become noops, if not available. +* retries reading a file if `read` results in EAGAIN error. + +On Windows, it retries renaming a file for up to one second if `EACCESS` +or `EPERM` error occurs, likely because antivirus software has locked +the directory. + +## USAGE + +```javascript +// use just like fs +var fs = require('graceful-fs') + +// now go and do stuff with it... +fs.readFileSync('some-file-or-whatever') +``` + +## Global Patching + +If you want to patch the global fs module (or any other fs-like +module) you can do this: + +```javascript +// Make sure to read the caveat below. +var realFs = require('fs') +var gracefulFs = require('graceful-fs') +gracefulFs.gracefulify(realFs) +``` + +This should only ever be done at the top-level application layer, in +order to delay on EMFILE errors from any fs-using dependencies. You +should **not** do this in a library, because it can cause unexpected +delays in other parts of the program. + +## Changes + +This module is fairly stable at this point, and used by a lot of +things. That being said, because it implements a subtle behavior +change in a core part of the node API, even modest changes can be +extremely breaking, and the versioning is thus biased towards +bumping the major when in doubt. + +The main change between major versions has been switching between +providing a fully-patched `fs` module vs monkey-patching the node core +builtin, and the approach by which a non-monkey-patched `fs` was +created. + +The goal is to trade `EMFILE` errors for slower fs operations. So, if +you try to open a zillion files, rather than crashing, `open` +operations will be queued up and wait for something else to `close`. + +There are advantages to each approach. Monkey-patching the fs means +that no `EMFILE` errors can possibly occur anywhere in your +application, because everything is using the same core `fs` module, +which is patched. However, it can also obviously cause undesirable +side-effects, especially if the module is loaded multiple times. + +Implementing a separate-but-identical patched `fs` module is more +surgical (and doesn't run the risk of patching multiple times), but +also imposes the challenge of keeping in sync with the core module. + +The current approach loads the `fs` module, and then creates a +lookalike object that has all the same methods, except a few that are +patched. It is safe to use in all versions of Node from 0.8 through +7.0. + +### v4 + +* Do not monkey-patch the fs module. This module may now be used as a + drop-in dep, and users can opt into monkey-patching the fs builtin + if their app requires it. + +### v3 + +* Monkey-patch fs, because the eval approach no longer works on recent + node. +* fixed possible type-error throw if rename fails on windows +* verify that we *never* get EMFILE errors +* Ignore ENOSYS from chmod/chown +* clarify that graceful-fs must be used as a drop-in + +### v2.1.0 + +* Use eval rather than monkey-patching fs. +* readdir: Always sort the results +* win32: requeue a file if error has an OK status + +### v2.0 + +* A return to monkey patching +* wrap process.cwd + +### v1.1 + +* wrap readFile +* Wrap fs.writeFile. +* readdir protection +* Don't clobber the fs builtin +* Handle fs.read EAGAIN errors by trying again +* Expose the curOpen counter +* No-op lchown/lchmod if not implemented +* fs.rename patch only for win32 +* Patch fs.rename to handle AV software on Windows +* Close #4 Chown should not fail on einval or eperm if non-root +* Fix isaacs/fstream#1 Only wrap fs one time +* Fix #3 Start at 1024 max files, then back off on EMFILE +* lutimes that doens't blow up on Linux +* A full on-rewrite using a queue instead of just swallowing the EMFILE error +* Wrap Read/Write streams as well + +### 1.0 + +* Update engines for node 0.6 +* Be lstat-graceful on Windows +* first diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/graceful-fs/fs.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/graceful-fs/fs.js new file mode 100644 index 00000000..8ad4a383 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/graceful-fs/fs.js @@ -0,0 +1,21 @@ +'use strict' + +var fs = require('fs') + +module.exports = clone(fs) + +function clone (obj) { + if (obj === null || typeof obj !== 'object') + return obj + + if (obj instanceof Object) + var copy = { __proto__: obj.__proto__ } + else + var copy = Object.create(null) + + Object.getOwnPropertyNames(obj).forEach(function (key) { + Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)) + }) + + return copy +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/graceful-fs/graceful-fs.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/graceful-fs/graceful-fs.js new file mode 100644 index 00000000..9bf803e6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/graceful-fs/graceful-fs.js @@ -0,0 +1,253 @@ +var fs = require('fs') +var polyfills = require('./polyfills.js') +var legacy = require('./legacy-streams.js') +var queue = [] + +var util = require('util') + +function noop () {} + +var debug = noop +if (util.debuglog) + debug = util.debuglog('gfs4') +else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) + debug = function() { + var m = util.format.apply(util, arguments) + m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ') + console.error(m) + } + +if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { + process.on('exit', function() { + debug(queue) + require('assert').equal(queue.length, 0) + }) +} + +module.exports = patch(require('./fs.js')) +if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH) { + module.exports = patch(fs) +} + +// Always patch fs.close/closeSync, because we want to +// retry() whenever a close happens *anywhere* in the program. +// This is essential when multiple graceful-fs instances are +// in play at the same time. +module.exports.close = +fs.close = (function (fs$close) { return function (fd, cb) { + return fs$close.call(fs, fd, function (err) { + if (!err) + retry() + + if (typeof cb === 'function') + cb.apply(this, arguments) + }) +}})(fs.close) + +module.exports.closeSync = +fs.closeSync = (function (fs$closeSync) { return function (fd) { + // Note that graceful-fs also retries when fs.closeSync() fails. + // Looks like a bug to me, although it's probably a harmless one. + var rval = fs$closeSync.apply(fs, arguments) + retry() + return rval +}})(fs.closeSync) + +function patch (fs) { + // Everything that references the open() function needs to be in here + polyfills(fs) + fs.gracefulify = patch + fs.FileReadStream = ReadStream; // Legacy name. + fs.FileWriteStream = WriteStream; // Legacy name. + fs.createReadStream = createReadStream + fs.createWriteStream = createWriteStream + var fs$readFile = fs.readFile + fs.readFile = readFile + function readFile (path, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$readFile(path, options, cb) + + function go$readFile (path, options, cb) { + return fs$readFile(path, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$readFile, [path, options, cb]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + }) + } + } + + var fs$writeFile = fs.writeFile + fs.writeFile = writeFile + function writeFile (path, data, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$writeFile(path, data, options, cb) + + function go$writeFile (path, data, options, cb) { + return fs$writeFile(path, data, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$writeFile, [path, data, options, cb]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + }) + } + } + + var fs$appendFile = fs.appendFile + if (fs$appendFile) + fs.appendFile = appendFile + function appendFile (path, data, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$appendFile(path, data, options, cb) + + function go$appendFile (path, data, options, cb) { + return fs$appendFile(path, data, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$appendFile, [path, data, options, cb]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + }) + } + } + + var fs$readdir = fs.readdir + fs.readdir = readdir + function readdir (path, cb) { + return go$readdir(path, cb) + + function go$readdir () { + return fs$readdir(path, function (err, files) { + if (files && files.sort) + files.sort(); // Backwards compatibility with graceful-fs. + + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$readdir, [path, cb]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + }) + } + } + + + if (process.version.substr(0, 4) === 'v0.8') { + var legStreams = legacy(fs) + ReadStream = legStreams.ReadStream + WriteStream = legStreams.WriteStream + } + + var fs$ReadStream = fs.ReadStream + ReadStream.prototype = Object.create(fs$ReadStream.prototype) + ReadStream.prototype.open = ReadStream$open + + var fs$WriteStream = fs.WriteStream + WriteStream.prototype = Object.create(fs$WriteStream.prototype) + WriteStream.prototype.open = WriteStream$open + + fs.ReadStream = ReadStream + fs.WriteStream = WriteStream + + function ReadStream (path, options) { + if (this instanceof ReadStream) + return fs$ReadStream.apply(this, arguments), this + else + return ReadStream.apply(Object.create(ReadStream.prototype), arguments) + } + + function ReadStream$open () { + var that = this + open(that.path, that.flags, that.mode, function (err, fd) { + if (err) { + if (that.autoClose) + that.destroy() + + that.emit('error', err) + } else { + that.fd = fd + that.emit('open', fd) + that.read() + } + }) + } + + function WriteStream (path, options) { + if (this instanceof WriteStream) + return fs$WriteStream.apply(this, arguments), this + else + return WriteStream.apply(Object.create(WriteStream.prototype), arguments) + } + + function WriteStream$open () { + var that = this + open(that.path, that.flags, that.mode, function (err, fd) { + if (err) { + that.destroy() + that.emit('error', err) + } else { + that.fd = fd + that.emit('open', fd) + } + }) + } + + function createReadStream (path, options) { + return new ReadStream(path, options) + } + + function createWriteStream (path, options) { + return new WriteStream(path, options) + } + + var fs$open = fs.open + fs.open = open + function open (path, flags, mode, cb) { + if (typeof mode === 'function') + cb = mode, mode = null + + return go$open(path, flags, mode, cb) + + function go$open (path, flags, mode, cb) { + return fs$open(path, flags, mode, function (err, fd) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$open, [path, flags, mode, cb]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + }) + } + } + + return fs +} + +function enqueue (elem) { + debug('ENQUEUE', elem[0].name, elem[1]) + queue.push(elem) +} + +function retry () { + var elem = queue.shift() + if (elem) { + debug('RETRY', elem[0].name, elem[1]) + elem[0].apply(null, elem[1]) + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/graceful-fs/legacy-streams.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/graceful-fs/legacy-streams.js new file mode 100644 index 00000000..d617b50f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/graceful-fs/legacy-streams.js @@ -0,0 +1,118 @@ +var Stream = require('stream').Stream + +module.exports = legacy + +function legacy (fs) { + return { + ReadStream: ReadStream, + WriteStream: WriteStream + } + + function ReadStream (path, options) { + if (!(this instanceof ReadStream)) return new ReadStream(path, options); + + Stream.call(this); + + var self = this; + + this.path = path; + this.fd = null; + this.readable = true; + this.paused = false; + + this.flags = 'r'; + this.mode = 438; /*=0666*/ + this.bufferSize = 64 * 1024; + + options = options || {}; + + // Mixin options into this + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; + } + + if (this.encoding) this.setEncoding(this.encoding); + + if (this.start !== undefined) { + if ('number' !== typeof this.start) { + throw TypeError('start must be a Number'); + } + if (this.end === undefined) { + this.end = Infinity; + } else if ('number' !== typeof this.end) { + throw TypeError('end must be a Number'); + } + + if (this.start > this.end) { + throw new Error('start must be <= end'); + } + + this.pos = this.start; + } + + if (this.fd !== null) { + process.nextTick(function() { + self._read(); + }); + return; + } + + fs.open(this.path, this.flags, this.mode, function (err, fd) { + if (err) { + self.emit('error', err); + self.readable = false; + return; + } + + self.fd = fd; + self.emit('open', fd); + self._read(); + }) + } + + function WriteStream (path, options) { + if (!(this instanceof WriteStream)) return new WriteStream(path, options); + + Stream.call(this); + + this.path = path; + this.fd = null; + this.writable = true; + + this.flags = 'w'; + this.encoding = 'binary'; + this.mode = 438; /*=0666*/ + this.bytesWritten = 0; + + options = options || {}; + + // Mixin options into this + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; + } + + if (this.start !== undefined) { + if ('number' !== typeof this.start) { + throw TypeError('start must be a Number'); + } + if (this.start < 0) { + throw new Error('start must be >= zero'); + } + + this.pos = this.start; + } + + this.busy = false; + this._queue = []; + + if (this.fd === null) { + this._open = fs.open; + this._queue.push([this._open, this.path, this.flags, this.mode, undefined]); + this.flush(); + } + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/graceful-fs/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/graceful-fs/package.json new file mode 100644 index 00000000..2a19d2cb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/graceful-fs/package.json @@ -0,0 +1,77 @@ +{ + "name": "graceful-fs", + "description": "A drop-in replacement for fs, making various improvements.", + "version": "4.1.6", + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/node-graceful-fs.git" + }, + "main": "graceful-fs.js", + "engines": { + "node": ">=0.4.0" + }, + "directories": { + "test": "test" + }, + "scripts": { + "test": "node test.js | tap -" + }, + "keywords": [ + "fs", + "module", + "reading", + "retry", + "retries", + "queue", + "error", + "errors", + "handling", + "EMFILE", + "EAGAIN", + "EINVAL", + "EPERM", + "EACCESS" + ], + "license": "ISC", + "devDependencies": { + "mkdirp": "^0.5.0", + "rimraf": "^2.2.8", + "tap": "^5.4.2" + }, + "files": [ + "fs.js", + "graceful-fs.js", + "legacy-streams.js", + "polyfills.js" + ], + "gitHead": "cfe3ba80e37af542f02e445c89aa59482aa32a63", + "bugs": { + "url": "https://github.com/isaacs/node-graceful-fs/issues" + }, + "homepage": "https://github.com/isaacs/node-graceful-fs#readme", + "_id": "graceful-fs@4.1.6", + "_shasum": "514c38772b31bee2e08bedc21a0aeb3abf54c19e", + "_from": "graceful-fs@>=4.1.5 <4.2.0", + "_npmVersion": "3.10.7", + "_nodeVersion": "4.4.4", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "dist": { + "shasum": "514c38772b31bee2e08bedc21a0aeb3abf54c19e", + "tarball": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.6.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/graceful-fs-4.1.6.tgz_1471616320359_0.39477095939219" + }, + "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.6.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/graceful-fs/polyfills.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/graceful-fs/polyfills.js new file mode 100644 index 00000000..27980506 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/graceful-fs/polyfills.js @@ -0,0 +1,275 @@ +var fs = require('./fs.js') +var constants = require('constants') + +var origCwd = process.cwd +var cwd = null +process.cwd = function() { + if (!cwd) + cwd = origCwd.call(process) + return cwd +} +try { + process.cwd() +} catch (er) {} + +var chdir = process.chdir +process.chdir = function(d) { + cwd = null + chdir.call(process, d) +} + +module.exports = patch + +function patch (fs) { + // (re-)implement some things that are known busted or missing. + + // lchmod, broken prior to 0.6.2 + // back-port the fix here. + if (constants.hasOwnProperty('O_SYMLINK') && + process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { + patchLchmod(fs) + } + + // lutimes implementation, or no-op + if (!fs.lutimes) { + patchLutimes(fs) + } + + // https://github.com/isaacs/node-graceful-fs/issues/4 + // Chown should not fail on einval or eperm if non-root. + // It should not fail on enosys ever, as this just indicates + // that a fs doesn't support the intended operation. + + fs.chown = chownFix(fs.chown) + fs.fchown = chownFix(fs.fchown) + fs.lchown = chownFix(fs.lchown) + + fs.chmod = chmodFix(fs.chmod) + fs.fchmod = chmodFix(fs.fchmod) + fs.lchmod = chmodFix(fs.lchmod) + + fs.chownSync = chownFixSync(fs.chownSync) + fs.fchownSync = chownFixSync(fs.fchownSync) + fs.lchownSync = chownFixSync(fs.lchownSync) + + fs.chmodSync = chmodFixSync(fs.chmodSync) + fs.fchmodSync = chmodFixSync(fs.fchmodSync) + fs.lchmodSync = chmodFixSync(fs.lchmodSync) + + // if lchmod/lchown do not exist, then make them no-ops + if (!fs.lchmod) { + fs.lchmod = function (path, mode, cb) { + if (cb) process.nextTick(cb) + } + fs.lchmodSync = function () {} + } + if (!fs.lchown) { + fs.lchown = function (path, uid, gid, cb) { + if (cb) process.nextTick(cb) + } + fs.lchownSync = function () {} + } + + // on Windows, A/V software can lock the directory, causing this + // to fail with an EACCES or EPERM if the directory contains newly + // created files. Try again on failure, for up to 1 second. + if (process.platform === "win32") { + fs.rename = (function (fs$rename) { return function (from, to, cb) { + var start = Date.now() + fs$rename(from, to, function CB (er) { + if (er + && (er.code === "EACCES" || er.code === "EPERM") + && Date.now() - start < 1000) { + return fs$rename(from, to, CB) + } + if (cb) cb(er) + }) + }})(fs.rename) + } + + // if read() returns EAGAIN, then just try it again. + fs.read = (function (fs$read) { return function (fd, buffer, offset, length, position, callback_) { + var callback + if (callback_ && typeof callback_ === 'function') { + var eagCounter = 0 + callback = function (er, _, __) { + if (er && er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + return fs$read.call(fs, fd, buffer, offset, length, position, callback) + } + callback_.apply(this, arguments) + } + } + return fs$read.call(fs, fd, buffer, offset, length, position, callback) + }})(fs.read) + + fs.readSync = (function (fs$readSync) { return function (fd, buffer, offset, length, position) { + var eagCounter = 0 + while (true) { + try { + return fs$readSync.call(fs, fd, buffer, offset, length, position) + } catch (er) { + if (er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + continue + } + throw er + } + } + }})(fs.readSync) +} + +function patchLchmod (fs) { + fs.lchmod = function (path, mode, callback) { + fs.open( path + , constants.O_WRONLY | constants.O_SYMLINK + , mode + , function (err, fd) { + if (err) { + if (callback) callback(err) + return + } + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + fs.fchmod(fd, mode, function (err) { + fs.close(fd, function(err2) { + if (callback) callback(err || err2) + }) + }) + }) + } + + fs.lchmodSync = function (path, mode) { + var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) + + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + var threw = true + var ret + try { + ret = fs.fchmodSync(fd, mode) + threw = false + } finally { + if (threw) { + try { + fs.closeSync(fd) + } catch (er) {} + } else { + fs.closeSync(fd) + } + } + return ret + } +} + +function patchLutimes (fs) { + if (constants.hasOwnProperty("O_SYMLINK")) { + fs.lutimes = function (path, at, mt, cb) { + fs.open(path, constants.O_SYMLINK, function (er, fd) { + if (er) { + if (cb) cb(er) + return + } + fs.futimes(fd, at, mt, function (er) { + fs.close(fd, function (er2) { + if (cb) cb(er || er2) + }) + }) + }) + } + + fs.lutimesSync = function (path, at, mt) { + var fd = fs.openSync(path, constants.O_SYMLINK) + var ret + var threw = true + try { + ret = fs.futimesSync(fd, at, mt) + threw = false + } finally { + if (threw) { + try { + fs.closeSync(fd) + } catch (er) {} + } else { + fs.closeSync(fd) + } + } + return ret + } + + } else { + fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) } + fs.lutimesSync = function () {} + } +} + +function chmodFix (orig) { + if (!orig) return orig + return function (target, mode, cb) { + return orig.call(fs, target, mode, function (er) { + if (chownErOk(er)) er = null + if (cb) cb.apply(this, arguments) + }) + } +} + +function chmodFixSync (orig) { + if (!orig) return orig + return function (target, mode) { + try { + return orig.call(fs, target, mode) + } catch (er) { + if (!chownErOk(er)) throw er + } + } +} + + +function chownFix (orig) { + if (!orig) return orig + return function (target, uid, gid, cb) { + return orig.call(fs, target, uid, gid, function (er) { + if (chownErOk(er)) er = null + if (cb) cb.apply(this, arguments) + }) + } +} + +function chownFixSync (orig) { + if (!orig) return orig + return function (target, uid, gid) { + try { + return orig.call(fs, target, uid, gid) + } catch (er) { + if (!chownErOk(er)) throw er + } + } +} + +// ENOSYS means that the fs doesn't support the op. Just ignore +// that, because it doesn't matter. +// +// if there's no getuid, or if getuid() is something other +// than 0, and the error is EINVAL or EPERM, then just ignore +// it. +// +// This specific case is a silent failure in cp, install, tar, +// and most other unix tools that manage permissions. +// +// When running as root, or if other types of errors are +// encountered, then it's strict. +function chownErOk (er) { + if (!er) + return true + + if (er.code === "ENOSYS") + return true + + var nonroot = !process.getuid || process.getuid() !== 0 + if (nonroot) { + if (er.code === "EINVAL" || er.code === "EPERM") + return true + } + + return false +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/hosted-git-info/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/hosted-git-info/.npmignore new file mode 100644 index 00000000..efab07fb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/hosted-git-info/.npmignore @@ -0,0 +1,2 @@ +test +.travis.yml diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/hosted-git-info/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/hosted-git-info/LICENSE new file mode 100644 index 00000000..45055763 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/hosted-git-info/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2015, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/hosted-git-info/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/hosted-git-info/README.md new file mode 100644 index 00000000..1db47dd6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/hosted-git-info/README.md @@ -0,0 +1,99 @@ +# hosted-git-info + +This will let you identify and transform various git hosts URLs between +protocols. It also can tell you what the URL is for the raw path for +particular file for direct access without git. + +## Usage + +```javascript +var hostedGitInfo = require("hosted-git-info") +var info = hostedGitInfo.fromUrl("git@github.com:npm/hosted-git-info.git") +/* info looks like: +{ + type: "github", + domain: "github.com", + user: "npm", + project: "hosted-git-info" +} +*/ +``` + +If the URL can't be matched with a git host, `null` will be returned. We +can match git, ssh and https urls. Additionally, we can match ssh connect +strings (`git@github.com:npm/hosted-git-info`) and shortcuts (eg, +`github:npm/hosted-git-info`). Github specifically, is detected in the case +of a third, unprefixed, form: `npm/hosted-git-info`. + +If it does match, the returned object has properties of: + +* info.type -- The short name of the service +* info.domain -- The domain for git protocol use +* info.user -- The name of the user/org on the git host +* info.project -- The name of the project on the git host + +And methods of: + +* info.file(path) + +Given the path of a file relative to the repository, returns a URL for +directly fetching it from the githost. If no committish was set then +`master` will be used as the default. + +For example `hostedGitInfo.fromUrl("git@github.com:npm/hosted-git-info.git#v1.0.0").file("package.json")` +would return `https://raw.githubusercontent.com/npm/hosted-git-info/v1.0.0/package.json` + +* info.shortcut() + +eg, `github:npm/hosted-git-info` + +* info.browse() + +eg, `https://github.com/npm/hosted-git-info/tree/v1.2.0` + +* info.bugs() + +eg, `https://github.com/npm/hosted-git-info/issues` + +* info.docs() + +eg, `https://github.com/npm/hosted-git-info/tree/v1.2.0#readme` + +* info.https() + +eg, `git+https://github.com/npm/hosted-git-info.git` + +* info.sshurl() + +eg, `git+ssh://git@github.com/npm/hosted-git-info.git` + +* info.ssh() + +eg, `git@github.com:npm/hosted-git-info.git` + +* info.path() + +eg, `npm/hosted-git-info` + +* info.getDefaultRepresentation() + +Returns the default output type. The default output type is based on the +string you passed in to be parsed + +* info.toString() + +Uses the getDefaultRepresentation to call one of the other methods to get a URL for +this resource. As such `hostedGitInfo.fromUrl(url).toString()` will give +you a normalized version of the URL that still uses the same protocol. + +Shortcuts will still be returned as shortcuts, but the special case github +form of `org/project` will be normalized to `github:org/project`. + +SSH connect strings will be normalized into `git+ssh` URLs. + + +## Supported hosts + +Currently this supports Github, Bitbucket and Gitlab. Pull requests for +additional hosts welcome. + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/hosted-git-info/git-host-info.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/hosted-git-info/git-host-info.js new file mode 100644 index 00000000..22343335 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/hosted-git-info/git-host-info.js @@ -0,0 +1,64 @@ +'use strict' + +var gitHosts = module.exports = { + github: { + // First two are insecure and generally shouldn't be used any more, but + // they are still supported. + 'protocols': [ 'git', 'http', 'git+ssh', 'git+https', 'ssh', 'https' ], + 'domain': 'github.com', + 'treepath': 'tree', + 'filetemplate': 'https://{auth@}raw.githubusercontent.com/{user}/{project}/{committish}/{path}', + 'bugstemplate': 'https://{domain}/{user}/{project}/issues', + 'gittemplate': 'git://{auth@}{domain}/{user}/{project}.git{#committish}' + }, + bitbucket: { + 'protocols': [ 'git+ssh', 'git+https', 'ssh', 'https' ], + 'domain': 'bitbucket.org', + 'treepath': 'src' + }, + gitlab: { + 'protocols': [ 'git+ssh', 'git+https', 'ssh', 'https' ], + 'domain': 'gitlab.com', + 'treepath': 'tree', + 'docstemplate': 'https://{domain}/{user}/{project}{/tree/committish}#README', + 'bugstemplate': 'https://{domain}/{user}/{project}/issues' + }, + gist: { + 'protocols': [ 'git', 'git+ssh', 'git+https', 'ssh', 'https' ], + 'domain': 'gist.github.com', + 'pathmatch': /^[/](?:([^/]+)[/])?([a-z0-9]+)(?:[.]git)?$/, + 'filetemplate': 'https://gist.githubusercontent.com/{user}/{project}/raw{/committish}/{path}', + 'bugstemplate': 'https://{domain}/{project}', + 'gittemplate': 'git://{domain}/{project}.git{#committish}', + 'sshtemplate': 'git@{domain}:/{project}.git{#committish}', + 'sshurltemplate': 'git+ssh://git@{domain}/{project}.git{#committish}', + 'browsetemplate': 'https://{domain}/{project}{/committish}', + 'docstemplate': 'https://{domain}/{project}{/committish}', + 'httpstemplate': 'git+https://{domain}/{project}.git{#committish}', + 'shortcuttemplate': '{type}:{project}{#committish}', + 'pathtemplate': '{project}{#committish}' + } +} + +var gitHostDefaults = { + 'sshtemplate': 'git@{domain}:{user}/{project}.git{#committish}', + 'sshurltemplate': 'git+ssh://git@{domain}/{user}/{project}.git{#committish}', + 'browsetemplate': 'https://{domain}/{user}/{project}{/tree/committish}', + 'docstemplate': 'https://{domain}/{user}/{project}{/tree/committish}#readme', + 'httpstemplate': 'git+https://{auth@}{domain}/{user}/{project}.git{#committish}', + 'filetemplate': 'https://{domain}/{user}/{project}/raw/{committish}/{path}', + 'shortcuttemplate': '{type}:{user}/{project}{#committish}', + 'pathtemplate': '{user}/{project}{#committish}', + 'pathmatch': /^[/]([^/]+)[/]([^/]+?)(?:[.]git)?$/ +} + +Object.keys(gitHosts).forEach(function (name) { + Object.keys(gitHostDefaults).forEach(function (key) { + if (gitHosts[name][key]) return + gitHosts[name][key] = gitHostDefaults[key] + }) + gitHosts[name].protocols_re = RegExp('^(' + + gitHosts[name].protocols.map(function (protocol) { + return protocol.replace(/([\\+*{}()\[\]$^|])/g, '\\$1') + }).join('|') + '):$') +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/hosted-git-info/git-host.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/hosted-git-info/git-host.js new file mode 100644 index 00000000..ea31380a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/hosted-git-info/git-host.js @@ -0,0 +1,96 @@ +'use strict' +var gitHosts = require('./git-host-info.js') + +var GitHost = module.exports = function (type, user, auth, project, committish, defaultRepresentation) { + var gitHostInfo = this + gitHostInfo.type = type + Object.keys(gitHosts[type]).forEach(function (key) { + gitHostInfo[key] = gitHosts[type][key] + }) + gitHostInfo.user = user + gitHostInfo.auth = auth + gitHostInfo.project = project + gitHostInfo.committish = committish + gitHostInfo.default = defaultRepresentation +} +GitHost.prototype = {} + +GitHost.prototype.hash = function () { + return this.committish ? '#' + this.committish : '' +} + +GitHost.prototype._fill = function (template, vars) { + if (!template) return + if (!vars) vars = {} + var self = this + Object.keys(this).forEach(function (key) { + if (self[key] != null && vars[key] == null) vars[key] = self[key] + }) + var rawAuth = vars.auth + var rawComittish = vars.committish + Object.keys(vars).forEach(function (key) { + vars[key] = encodeURIComponent(vars[key]) + }) + vars['auth@'] = rawAuth ? rawAuth + '@' : '' + vars['#committish'] = rawComittish ? '#' + rawComittish : '' + vars['/tree/committish'] = vars.committish + ? '/' + vars.treepath + '/' + vars.committish + : '' + vars['/committish'] = vars.committish ? '/' + vars.committish : '' + vars.committish = vars.committish || 'master' + var res = template + Object.keys(vars).forEach(function (key) { + res = res.replace(new RegExp('[{]' + key + '[}]', 'g'), vars[key]) + }) + return res +} + +GitHost.prototype.ssh = function () { + return this._fill(this.sshtemplate) +} + +GitHost.prototype.sshurl = function () { + return this._fill(this.sshurltemplate) +} + +GitHost.prototype.browse = function () { + return this._fill(this.browsetemplate) +} + +GitHost.prototype.docs = function () { + return this._fill(this.docstemplate) +} + +GitHost.prototype.bugs = function () { + return this._fill(this.bugstemplate) +} + +GitHost.prototype.https = function () { + return this._fill(this.httpstemplate) +} + +GitHost.prototype.git = function () { + return this._fill(this.gittemplate) +} + +GitHost.prototype.shortcut = function () { + return this._fill(this.shortcuttemplate) +} + +GitHost.prototype.path = function () { + return this._fill(this.pathtemplate) +} + +GitHost.prototype.file = function (P) { + return this._fill(this.filetemplate, { + path: P.replace(/^[/]+/g, '') + }) +} + +GitHost.prototype.getDefaultRepresentation = function () { + return this.default +} + +GitHost.prototype.toString = function () { + return (this[this.default] || this.sshurl).call(this) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/hosted-git-info/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/hosted-git-info/index.js new file mode 100644 index 00000000..453ce87d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/hosted-git-info/index.js @@ -0,0 +1,103 @@ +'use strict' +var url = require('url') +var gitHosts = require('./git-host-info.js') +var GitHost = module.exports = require('./git-host.js') + +var protocolToRepresentationMap = { + 'git+ssh': 'sshurl', + 'git+https': 'https', + 'ssh': 'sshurl', + 'git': 'git' +} + +function protocolToRepresentation (protocol) { + if (protocol.substr(-1) === ':') protocol = protocol.slice(0, -1) + return protocolToRepresentationMap[protocol] || protocol +} + +var authProtocols = { + 'git:': true, + 'https:': true, + 'git+https:': true, + 'http:': true, + 'git+http:': true +} + +module.exports.fromUrl = function (giturl) { + if (giturl == null || giturl === '') return + var url = fixupUnqualifiedGist( + isGitHubShorthand(giturl) ? 'github:' + giturl : giturl + ) + var parsed = parseGitUrl(url) + var matches = Object.keys(gitHosts).map(function (gitHostName) { + var gitHostInfo = gitHosts[gitHostName] + var auth = null + if (parsed.auth && authProtocols[parsed.protocol]) { + auth = decodeURIComponent(parsed.auth) + } + var committish = parsed.hash ? decodeURIComponent(parsed.hash.substr(1)) : null + var user = null + var project = null + var defaultRepresentation = null + if (parsed.protocol === gitHostName + ':') { + user = decodeURIComponent(parsed.host) + project = parsed.path && decodeURIComponent(parsed.path.replace(/^[/](.*?)(?:[.]git)?$/, '$1')) + defaultRepresentation = 'shortcut' + } else { + if (parsed.host !== gitHostInfo.domain) return + if (!gitHostInfo.protocols_re.test(parsed.protocol)) return + var pathmatch = gitHostInfo.pathmatch + var matched = parsed.path.match(pathmatch) + if (!matched) return + if (matched[1] != null) user = decodeURIComponent(matched[1]) + if (matched[2] != null) project = decodeURIComponent(matched[2]) + defaultRepresentation = protocolToRepresentation(parsed.protocol) + } + return new GitHost(gitHostName, user, auth, project, committish, defaultRepresentation) + }).filter(function (gitHostInfo) { return gitHostInfo }) + if (matches.length !== 1) return + return matches[0] +} + +function isGitHubShorthand (arg) { + // Note: This does not fully test the git ref format. + // See https://www.kernel.org/pub/software/scm/git/docs/git-check-ref-format.html + // + // The only way to do this properly would be to shell out to + // git-check-ref-format, and as this is a fast sync function, + // we don't want to do that. Just let git fail if it turns + // out that the commit-ish is invalid. + // GH usernames cannot start with . or - + return /^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(arg) +} + +function fixupUnqualifiedGist (giturl) { + // necessary for round-tripping gists + var parsed = url.parse(giturl) + if (parsed.protocol === 'gist:' && parsed.host && !parsed.path) { + return parsed.protocol + '/' + parsed.host + } else { + return giturl + } +} + +function parseGitUrl (giturl) { + if (typeof giturl !== 'string') giturl = '' + giturl + var matched = giturl.match(/^([^@]+)@([^:]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/) + if (!matched) return url.parse(giturl) + return { + protocol: 'git+ssh:', + slashes: true, + auth: matched[1], + host: matched[2], + port: null, + hostname: matched[2], + hash: matched[4], + search: null, + query: null, + pathname: '/' + matched[3], + path: '/' + matched[3], + href: 'git+ssh://' + matched[1] + '@' + matched[2] + + '/' + matched[3] + (matched[4] || '') + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/hosted-git-info/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/hosted-git-info/package.json new file mode 100644 index 00000000..3bf8cbce --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/hosted-git-info/package.json @@ -0,0 +1,68 @@ +{ + "name": "hosted-git-info", + "version": "2.1.5", + "description": "Provides metadata and conversions from repository urls for Github, Bitbucket and Gitlab", + "main": "index.js", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/hosted-git-info.git" + }, + "keywords": [ + "git", + "github", + "bitbucket", + "gitlab" + ], + "author": { + "name": "Rebecca Turner", + "email": "me@re-becca.org", + "url": "http://re-becca.org" + }, + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/hosted-git-info/issues" + }, + "homepage": "https://github.com/npm/hosted-git-info", + "scripts": { + "test": "standard && tap test/*.js" + }, + "devDependencies": { + "standard": "^3.3.2", + "tap": "^0.4.13" + }, + "gitHead": "4e6bb323a97a57c18e6b4b891527e26154d04fbe", + "_id": "hosted-git-info@2.1.5", + "_shasum": "0ba81d90da2e25ab34a332e6ec77936e1598118b", + "_from": "hosted-git-info@>=2.1.4 <2.2.0", + "_npmVersion": "3.9.1", + "_nodeVersion": "5.10.1", + "_npmUser": { + "name": "zkat", + "email": "kat@sykosomatic.org" + }, + "dist": { + "shasum": "0ba81d90da2e25ab34a332e6ec77936e1598118b", + "tarball": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.1.5.tgz" + }, + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" + } + ], + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/hosted-git-info-2.1.5.tgz_1463518889246_0.20443619322031736" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.1.5.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/imurmurhash/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/imurmurhash/README.md new file mode 100644 index 00000000..f35b20a0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/imurmurhash/README.md @@ -0,0 +1,122 @@ +iMurmurHash.js +============== + +An incremental implementation of the MurmurHash3 (32-bit) hashing algorithm for JavaScript based on [Gary Court's implementation](https://github.com/garycourt/murmurhash-js) with [kazuyukitanimura's modifications](https://github.com/kazuyukitanimura/murmurhash-js). + +This version works significantly faster than the non-incremental version if you need to hash many small strings into a single hash, since string concatenation (to build the single string to pass the non-incremental version) is fairly costly. In one case tested, using the incremental version was about 50% faster than concatenating 5-10 strings and then hashing. + +Installation +------------ + +To use iMurmurHash in the browser, [download the latest version](https://raw.github.com/jensyt/imurmurhash-js/master/imurmurhash.min.js) and include it as a script on your site. + +```html + + +``` + +--- + +To use iMurmurHash in Node.js, install the module using NPM: + +```bash +npm install imurmurhash +``` + +Then simply include it in your scripts: + +```javascript +MurmurHash3 = require('imurmurhash'); +``` + +Quick Example +------------- + +```javascript +// Create the initial hash +var hashState = MurmurHash3('string'); + +// Incrementally add text +hashState.hash('more strings'); +hashState.hash('even more strings'); + +// All calls can be chained if desired +hashState.hash('and').hash('some').hash('more'); + +// Get a result +hashState.result(); +// returns 0xe4ccfe6b +``` + +Functions +--------- + +### MurmurHash3 ([string], [seed]) +Get a hash state object, optionally initialized with the given _string_ and _seed_. _Seed_ must be a positive integer if provided. Calling this function without the `new` keyword will return a cached state object that has been reset. This is safe to use as long as the object is only used from a single thread and no other hashes are created while operating on this one. If this constraint cannot be met, you can use `new` to create a new state object. For example: + +```javascript +// Use the cached object, calling the function again will return the same +// object (but reset, so the current state would be lost) +hashState = MurmurHash3(); +... + +// Create a new object that can be safely used however you wish. Calling the +// function again will simply return a new state object, and no state loss +// will occur, at the cost of creating more objects. +hashState = new MurmurHash3(); +``` + +Both methods can be mixed however you like if you have different use cases. + +--- + +### MurmurHash3.prototype.hash (string) +Incrementally add _string_ to the hash. This can be called as many times as you want for the hash state object, including after a call to `result()`. Returns `this` so calls can be chained. + +--- + +### MurmurHash3.prototype.result () +Get the result of the hash as a 32-bit positive integer. This performs the tail and finalizer portions of the algorithm, but does not store the result in the state object. This means that it is perfectly safe to get results and then continue adding strings via `hash`. + +```javascript +// Do the whole string at once +MurmurHash3('this is a test string').result(); +// 0x70529328 + +// Do part of the string, get a result, then the other part +var m = MurmurHash3('this is a'); +m.result(); +// 0xbfc4f834 +m.hash(' test string').result(); +// 0x70529328 (same as above) +``` + +--- + +### MurmurHash3.prototype.reset ([seed]) +Reset the state object for reuse, optionally using the given _seed_ (defaults to 0 like the constructor). Returns `this` so calls can be chained. + +--- + +License (MIT) +------------- +Copyright (c) 2013 Gary Court, Jens Taylor + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/imurmurhash/imurmurhash.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/imurmurhash/imurmurhash.js new file mode 100644 index 00000000..05347a25 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/imurmurhash/imurmurhash.js @@ -0,0 +1,138 @@ +/** + * @preserve + * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013) + * + * @author Jens Taylor + * @see http://github.com/homebrewing/brauhaus-diff + * @author Gary Court + * @see http://github.com/garycourt/murmurhash-js + * @author Austin Appleby + * @see http://sites.google.com/site/murmurhash/ + */ +(function(){ + var cache; + + // Call this function without `new` to use the cached object (good for + // single-threaded environments), or with `new` to create a new object. + // + // @param {string} key A UTF-16 or ASCII string + // @param {number} seed An optional positive integer + // @return {object} A MurmurHash3 object for incremental hashing + function MurmurHash3(key, seed) { + var m = this instanceof MurmurHash3 ? this : cache; + m.reset(seed) + if (typeof key === 'string' && key.length > 0) { + m.hash(key); + } + + if (m !== this) { + return m; + } + }; + + // Incrementally add a string to this hash + // + // @param {string} key A UTF-16 or ASCII string + // @return {object} this + MurmurHash3.prototype.hash = function(key) { + var h1, k1, i, top, len; + + len = key.length; + this.len += len; + + k1 = this.k1; + i = 0; + switch (this.rem) { + case 0: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) : 0; + case 1: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 8 : 0; + case 2: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 16 : 0; + case 3: + k1 ^= len > i ? (key.charCodeAt(i) & 0xff) << 24 : 0; + k1 ^= len > i ? (key.charCodeAt(i++) & 0xff00) >> 8 : 0; + } + + this.rem = (len + this.rem) & 3; // & 3 is same as % 4 + len -= this.rem; + if (len > 0) { + h1 = this.h1; + while (1) { + k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff; + k1 = (k1 << 15) | (k1 >>> 17); + k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff; + + h1 ^= k1; + h1 = (h1 << 13) | (h1 >>> 19); + h1 = (h1 * 5 + 0xe6546b64) & 0xffffffff; + + if (i >= len) { + break; + } + + k1 = ((key.charCodeAt(i++) & 0xffff)) ^ + ((key.charCodeAt(i++) & 0xffff) << 8) ^ + ((key.charCodeAt(i++) & 0xffff) << 16); + top = key.charCodeAt(i++); + k1 ^= ((top & 0xff) << 24) ^ + ((top & 0xff00) >> 8); + } + + k1 = 0; + switch (this.rem) { + case 3: k1 ^= (key.charCodeAt(i + 2) & 0xffff) << 16; + case 2: k1 ^= (key.charCodeAt(i + 1) & 0xffff) << 8; + case 1: k1 ^= (key.charCodeAt(i) & 0xffff); + } + + this.h1 = h1; + } + + this.k1 = k1; + return this; + }; + + // Get the result of this hash + // + // @return {number} The 32-bit hash + MurmurHash3.prototype.result = function() { + var k1, h1; + + k1 = this.k1; + h1 = this.h1; + + if (k1 > 0) { + k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff; + k1 = (k1 << 15) | (k1 >>> 17); + k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff; + h1 ^= k1; + } + + h1 ^= this.len; + + h1 ^= h1 >>> 16; + h1 = (h1 * 0xca6b + (h1 & 0xffff) * 0x85eb0000) & 0xffffffff; + h1 ^= h1 >>> 13; + h1 = (h1 * 0xae35 + (h1 & 0xffff) * 0xc2b20000) & 0xffffffff; + h1 ^= h1 >>> 16; + + return h1 >>> 0; + }; + + // Reset the hash object for reuse + // + // @param {number} seed An optional positive integer + MurmurHash3.prototype.reset = function(seed) { + this.h1 = typeof seed === 'number' ? seed : 0; + this.rem = this.k1 = this.len = 0; + return this; + }; + + // A cached object to use. This can be safely used if you're in a single- + // threaded environment, otherwise you need to create new hashes to use. + cache = new MurmurHash3(); + + if (typeof(module) != 'undefined') { + module.exports = MurmurHash3; + } else { + this.MurmurHash3 = MurmurHash3; + } +}()); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/imurmurhash/imurmurhash.min.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/imurmurhash/imurmurhash.min.js new file mode 100644 index 00000000..dc0ee88d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/imurmurhash/imurmurhash.min.js @@ -0,0 +1,12 @@ +/** + * @preserve + * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013) + * + * @author Jens Taylor + * @see http://github.com/homebrewing/brauhaus-diff + * @author Gary Court + * @see http://github.com/garycourt/murmurhash-js + * @author Austin Appleby + * @see http://sites.google.com/site/murmurhash/ + */ +!function(){function t(h,r){var s=this instanceof t?this:e;return s.reset(r),"string"==typeof h&&h.length>0&&s.hash(h),s!==this?s:void 0}var e;t.prototype.hash=function(t){var e,h,r,s,i;switch(i=t.length,this.len+=i,h=this.k1,r=0,this.rem){case 0:h^=i>r?65535&t.charCodeAt(r++):0;case 1:h^=i>r?(65535&t.charCodeAt(r++))<<8:0;case 2:h^=i>r?(65535&t.charCodeAt(r++))<<16:0;case 3:h^=i>r?(255&t.charCodeAt(r))<<24:0,h^=i>r?(65280&t.charCodeAt(r++))>>8:0}if(this.rem=3&i+this.rem,i-=this.rem,i>0){for(e=this.h1;;){if(h=4294967295&11601*h+3432906752*(65535&h),h=h<<15|h>>>17,h=4294967295&13715*h+461832192*(65535&h),e^=h,e=e<<13|e>>>19,e=4294967295&5*e+3864292196,r>=i)break;h=65535&t.charCodeAt(r++)^(65535&t.charCodeAt(r++))<<8^(65535&t.charCodeAt(r++))<<16,s=t.charCodeAt(r++),h^=(255&s)<<24^(65280&s)>>8}switch(h=0,this.rem){case 3:h^=(65535&t.charCodeAt(r+2))<<16;case 2:h^=(65535&t.charCodeAt(r+1))<<8;case 1:h^=65535&t.charCodeAt(r)}this.h1=e}return this.k1=h,this},t.prototype.result=function(){var t,e;return t=this.k1,e=this.h1,t>0&&(t=4294967295&11601*t+3432906752*(65535&t),t=t<<15|t>>>17,t=4294967295&13715*t+461832192*(65535&t),e^=t),e^=this.len,e^=e>>>16,e=4294967295&51819*e+2246770688*(65535&e),e^=e>>>13,e=4294967295&44597*e+3266445312*(65535&e),e^=e>>>16,e>>>0},t.prototype.reset=function(t){return this.h1="number"==typeof t?t:0,this.rem=this.k1=this.len=0,this},e=new t,"undefined"!=typeof module?module.exports=t:this.MurmurHash3=t}(); \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/imurmurhash/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/imurmurhash/package.json new file mode 100644 index 00000000..d1e69bca --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/imurmurhash/package.json @@ -0,0 +1,60 @@ +{ + "name": "imurmurhash", + "version": "0.1.4", + "description": "An incremental implementation of MurmurHash3", + "homepage": "https://github.com/jensyt/imurmurhash-js", + "main": "imurmurhash.js", + "files": [ + "imurmurhash.js", + "imurmurhash.min.js", + "package.json", + "README.md" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/jensyt/imurmurhash-js.git" + }, + "bugs": { + "url": "https://github.com/jensyt/imurmurhash-js/issues" + }, + "keywords": [ + "murmur", + "murmurhash", + "murmurhash3", + "hash", + "incremental" + ], + "author": { + "name": "Jens Taylor", + "email": "jensyt@gmail.com", + "url": "https://github.com/homebrewing" + }, + "license": "MIT", + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.8.19" + }, + "readme": "iMurmurHash.js\n==============\n\nAn incremental implementation of the MurmurHash3 (32-bit) hashing algorithm for JavaScript based on [Gary Court's implementation](https://github.com/garycourt/murmurhash-js) with [kazuyukitanimura's modifications](https://github.com/kazuyukitanimura/murmurhash-js).\n\nThis version works significantly faster than the non-incremental version if you need to hash many small strings into a single hash, since string concatenation (to build the single string to pass the non-incremental version) is fairly costly. In one case tested, using the incremental version was about 50% faster than concatenating 5-10 strings and then hashing.\n\nInstallation\n------------\n\nTo use iMurmurHash in the browser, [download the latest version](https://raw.github.com/jensyt/imurmurhash-js/master/imurmurhash.min.js) and include it as a script on your site.\n\n```html\n\n\n```\n\n---\n\nTo use iMurmurHash in Node.js, install the module using NPM:\n\n```bash\nnpm install imurmurhash\n```\n\nThen simply include it in your scripts:\n\n```javascript\nMurmurHash3 = require('imurmurhash');\n```\n\nQuick Example\n-------------\n\n```javascript\n// Create the initial hash\nvar hashState = MurmurHash3('string');\n\n// Incrementally add text\nhashState.hash('more strings');\nhashState.hash('even more strings');\n\n// All calls can be chained if desired\nhashState.hash('and').hash('some').hash('more');\n\n// Get a result\nhashState.result();\n// returns 0xe4ccfe6b\n```\n\nFunctions\n---------\n\n### MurmurHash3 ([string], [seed])\nGet a hash state object, optionally initialized with the given _string_ and _seed_. _Seed_ must be a positive integer if provided. Calling this function without the `new` keyword will return a cached state object that has been reset. This is safe to use as long as the object is only used from a single thread and no other hashes are created while operating on this one. If this constraint cannot be met, you can use `new` to create a new state object. For example:\n\n```javascript\n// Use the cached object, calling the function again will return the same\n// object (but reset, so the current state would be lost)\nhashState = MurmurHash3();\n...\n\n// Create a new object that can be safely used however you wish. Calling the\n// function again will simply return a new state object, and no state loss\n// will occur, at the cost of creating more objects.\nhashState = new MurmurHash3();\n```\n\nBoth methods can be mixed however you like if you have different use cases.\n\n---\n\n### MurmurHash3.prototype.hash (string)\nIncrementally add _string_ to the hash. This can be called as many times as you want for the hash state object, including after a call to `result()`. Returns `this` so calls can be chained.\n\n---\n\n### MurmurHash3.prototype.result ()\nGet the result of the hash as a 32-bit positive integer. This performs the tail and finalizer portions of the algorithm, but does not store the result in the state object. This means that it is perfectly safe to get results and then continue adding strings via `hash`.\n\n```javascript\n// Do the whole string at once\nMurmurHash3('this is a test string').result();\n// 0x70529328\n\n// Do part of the string, get a result, then the other part\nvar m = MurmurHash3('this is a');\nm.result();\n// 0xbfc4f834\nm.hash(' test string').result();\n// 0x70529328 (same as above)\n```\n\n---\n\n### MurmurHash3.prototype.reset ([seed])\nReset the state object for reuse, optionally using the given _seed_ (defaults to 0 like the constructor). Returns `this` so calls can be chained.\n\n---\n\nLicense (MIT)\n-------------\nCopyright (c) 2013 Gary Court, Jens Taylor\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n", + "readmeFilename": "README.md", + "_id": "imurmurhash@0.1.4", + "dist": { + "shasum": "9218b9b2b928a238b13dc4fb6b6d576f231453ea", + "tarball": "http://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz" + }, + "_from": "imurmurhash@0.1.4", + "_npmVersion": "1.3.2", + "_npmUser": { + "name": "jensyt", + "email": "jensyt@gmail.com" + }, + "maintainers": [ + { + "name": "jensyt", + "email": "jensyt@gmail.com" + } + ], + "directories": {}, + "_shasum": "9218b9b2b928a238b13dc4fb6b6d576f231453ea", + "_resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/inflight/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/inflight/LICENSE new file mode 100644 index 00000000..05eeeb88 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/inflight/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/inflight/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/inflight/README.md new file mode 100644 index 00000000..6dc89291 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/inflight/README.md @@ -0,0 +1,37 @@ +# inflight + +Add callbacks to requests in flight to avoid async duplication + +## USAGE + +```javascript +var inflight = require('inflight') + +// some request that does some stuff +function req(key, callback) { + // key is any random string. like a url or filename or whatever. + // + // will return either a falsey value, indicating that the + // request for this key is already in flight, or a new callback + // which when called will call all callbacks passed to inflightk + // with the same key + callback = inflight(key, callback) + + // If we got a falsey value back, then there's already a req going + if (!callback) return + + // this is where you'd fetch the url or whatever + // callback is also once()-ified, so it can safely be assigned + // to multiple events etc. First call wins. + setTimeout(function() { + callback(null, key) + }, 100) +} + +// only assigns a single setTimeout +// when it dings, all cbs get called +req('foo', cb1) +req('foo', cb2) +req('foo', cb3) +req('foo', cb4) +``` diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/inflight/inflight.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/inflight/inflight.js new file mode 100644 index 00000000..8bc96cbd --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/inflight/inflight.js @@ -0,0 +1,44 @@ +var wrappy = require('wrappy') +var reqs = Object.create(null) +var once = require('once') + +module.exports = wrappy(inflight) + +function inflight (key, cb) { + if (reqs[key]) { + reqs[key].push(cb) + return null + } else { + reqs[key] = [cb] + return makeres(key) + } +} + +function makeres (key) { + return once(function RES () { + var cbs = reqs[key] + var len = cbs.length + var args = slice(arguments) + for (var i = 0; i < len; i++) { + cbs[i].apply(null, args) + } + if (cbs.length > len) { + // added more in the interim. + // de-zalgo, just in case, but don't call again. + cbs.splice(0, len) + process.nextTick(function () { + RES.apply(null, args) + }) + } else { + delete reqs[key] + } + }) +} + +function slice (args) { + var length = args.length + var array = [] + + for (var i = 0; i < length; i++) array[i] = args[i] + return array +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/inflight/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/inflight/package.json new file mode 100644 index 00000000..f7395518 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/inflight/package.json @@ -0,0 +1,72 @@ +{ + "name": "inflight", + "version": "1.0.5", + "description": "Add callbacks to requests in flight to avoid async duplication", + "main": "inflight.js", + "files": [ + "inflight.js" + ], + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + }, + "devDependencies": { + "tap": "^1.2.0" + }, + "scripts": { + "test": "tap test.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/inflight.git" + }, + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/inflight/issues" + }, + "homepage": "https://github.com/isaacs/inflight", + "license": "ISC", + "gitHead": "559e37b4f6327fca797fe8d7fe8ed6d9cae08821", + "_id": "inflight@1.0.5", + "_shasum": "db3204cd5a9de2e6cd890b85c6e2f66bcf4f620a", + "_from": "inflight@>=1.0.5 <1.1.0", + "_npmVersion": "3.9.1", + "_nodeVersion": "5.10.1", + "_npmUser": { + "name": "zkat", + "email": "kat@sykosomatic.org" + }, + "dist": { + "shasum": "db3204cd5a9de2e6cd890b85c6e2f66bcf4f620a", + "tarball": "https://registry.npmjs.org/inflight/-/inflight-1.0.5.tgz" + }, + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + }, + { + "name": "isaacs", + "email": "i@izs.me" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" + } + ], + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/inflight-1.0.5.tgz_1463529611443_0.00041943578980863094" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.5.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/inherits/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/inherits/LICENSE new file mode 100644 index 00000000..dea3013d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/inherits/LICENSE @@ -0,0 +1,16 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/inherits/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/inherits/README.md new file mode 100644 index 00000000..b1c56658 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/inherits/README.md @@ -0,0 +1,42 @@ +Browser-friendly inheritance fully compatible with standard node.js +[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor). + +This package exports standard `inherits` from node.js `util` module in +node environment, but also provides alternative browser-friendly +implementation through [browser +field](https://gist.github.com/shtylman/4339901). Alternative +implementation is a literal copy of standard one located in standalone +module to avoid requiring of `util`. It also has a shim for old +browsers with no `Object.create` support. + +While keeping you sure you are using standard `inherits` +implementation in node.js environment, it allows bundlers such as +[browserify](https://github.com/substack/node-browserify) to not +include full `util` package to your client code if all you need is +just `inherits` function. It worth, because browser shim for `util` +package is large and `inherits` is often the single function you need +from it. + +It's recommended to use this package instead of +`require('util').inherits` for any code that has chances to be used +not only in node.js but in browser too. + +## usage + +```js +var inherits = require('inherits'); +// then use exactly as the standard one +``` + +## note on version ~1.0 + +Version ~1.0 had completely different motivation and is not compatible +neither with 2.0 nor with standard node.js `inherits`. + +If you are using version ~1.0 and planning to switch to ~2.0, be +careful: + +* new version uses `super_` instead of `super` for referencing + superclass +* new version overwrites current prototype while old one preserves any + existing fields on it diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/inherits/inherits.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/inherits/inherits.js new file mode 100644 index 00000000..3b94763a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/inherits/inherits.js @@ -0,0 +1,7 @@ +try { + var util = require('util'); + if (typeof util.inherits !== 'function') throw ''; + module.exports = util.inherits; +} catch (e) { + module.exports = require('./inherits_browser.js'); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/inherits/inherits_browser.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/inherits/inherits_browser.js new file mode 100644 index 00000000..c1e78a75 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/inherits/inherits_browser.js @@ -0,0 +1,23 @@ +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/inherits/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/inherits/package.json new file mode 100644 index 00000000..092ed555 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/inherits/package.json @@ -0,0 +1,63 @@ +{ + "name": "inherits", + "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", + "version": "2.0.3", + "keywords": [ + "inheritance", + "class", + "klass", + "oop", + "object-oriented", + "inherits", + "browser", + "browserify" + ], + "main": "./inherits.js", + "browser": "./inherits_browser.js", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/inherits.git" + }, + "license": "ISC", + "scripts": { + "test": "node test" + }, + "devDependencies": { + "tap": "^7.1.0" + }, + "files": [ + "inherits.js", + "inherits_browser.js" + ], + "gitHead": "e05d0fb27c61a3ec687214f0476386b765364d5f", + "bugs": { + "url": "https://github.com/isaacs/inherits/issues" + }, + "homepage": "https://github.com/isaacs/inherits#readme", + "_id": "inherits@2.0.3", + "_shasum": "633c2c83e3da42a502f52466022480f4208261de", + "_from": "inherits@2.0.3", + "_npmVersion": "3.10.7", + "_nodeVersion": "6.5.0", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "dist": { + "shasum": "633c2c83e3da42a502f52466022480f4208261de", + "tarball": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/inherits-2.0.3.tgz_1473295776489_0.08142363070510328" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ini/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ini/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ini/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ini/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ini/README.md new file mode 100644 index 00000000..33df2582 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ini/README.md @@ -0,0 +1,102 @@ +An ini format parser and serializer for node. + +Sections are treated as nested objects. Items before the first +heading are saved on the object directly. + +## Usage + +Consider an ini-file `config.ini` that looks like this: + + ; this comment is being ignored + scope = global + + [database] + user = dbuser + password = dbpassword + database = use_this_database + + [paths.default] + datadir = /var/lib/data + array[] = first value + array[] = second value + array[] = third value + +You can read, manipulate and write the ini-file like so: + + var fs = require('fs') + , ini = require('ini') + + var config = ini.parse(fs.readFileSync('./config.ini', 'utf-8')) + + config.scope = 'local' + config.database.database = 'use_another_database' + config.paths.default.tmpdir = '/tmp' + delete config.paths.default.datadir + config.paths.default.array.push('fourth value') + + fs.writeFileSync('./config_modified.ini', ini.stringify(config, { section: 'section' })) + +This will result in a file called `config_modified.ini` being written +to the filesystem with the following content: + + [section] + scope=local + [section.database] + user=dbuser + password=dbpassword + database=use_another_database + [section.paths.default] + tmpdir=/tmp + array[]=first value + array[]=second value + array[]=third value + array[]=fourth value + + +## API + +### decode(inistring) + +Decode the ini-style formatted `inistring` into a nested object. + +### parse(inistring) + +Alias for `decode(inistring)` + +### encode(object, [options]) + +Encode the object `object` into an ini-style formatted string. If the +optional parameter `section` is given, then all top-level properties +of the object are put into this section and the `section`-string is +prepended to all sub-sections, see the usage example above. + +The `options` object may contain the following: + +* `section` A string which will be the first `section` in the encoded + ini data. Defaults to none. +* `whitespace` Boolean to specify whether to put whitespace around the + `=` character. By default, whitespace is omitted, to be friendly to + some persnickety old parsers that don't tolerate it well. But some + find that it's more human-readable and pretty with the whitespace. + +For backwards compatibility reasons, if a `string` options is passed +in, then it is assumed to be the `section` value. + +### stringify(object, [options]) + +Alias for `encode(object, [options])` + +### safe(val) + +Escapes the string `val` such that it is safe to be used as a key or +value in an ini-file. Basically escapes quotes. For example + + ini.safe('"unsafe string"') + +would result in + + "\"unsafe string\"" + +### unsafe(val) + +Unescapes the string `val` diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ini/ini.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ini/ini.js new file mode 100644 index 00000000..ddf5bd9c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ini/ini.js @@ -0,0 +1,190 @@ + +exports.parse = exports.decode = decode +exports.stringify = exports.encode = encode + +exports.safe = safe +exports.unsafe = unsafe + +var eol = process.platform === "win32" ? "\r\n" : "\n" + +function encode (obj, opt) { + var children = [] + , out = "" + + if (typeof opt === "string") { + opt = { + section: opt, + whitespace: false + } + } else { + opt = opt || {} + opt.whitespace = opt.whitespace === true + } + + var separator = opt.whitespace ? " = " : "=" + + Object.keys(obj).forEach(function (k, _, __) { + var val = obj[k] + if (val && Array.isArray(val)) { + val.forEach(function(item) { + out += safe(k + "[]") + separator + safe(item) + "\n" + }) + } + else if (val && typeof val === "object") { + children.push(k) + } else { + out += safe(k) + separator + safe(val) + eol + } + }) + + if (opt.section && out.length) { + out = "[" + safe(opt.section) + "]" + eol + out + } + + children.forEach(function (k, _, __) { + var nk = dotSplit(k).join('\\.') + var section = (opt.section ? opt.section + "." : "") + nk + var child = encode(obj[k], { + section: section, + whitespace: opt.whitespace + }) + if (out.length && child.length) { + out += eol + } + out += child + }) + + return out +} + +function dotSplit (str) { + return str.replace(/\1/g, '\u0002LITERAL\\1LITERAL\u0002') + .replace(/\\\./g, '\u0001') + .split(/\./).map(function (part) { + return part.replace(/\1/g, '\\.') + .replace(/\2LITERAL\\1LITERAL\2/g, '\u0001') + }) +} + +function decode (str) { + var out = {} + , p = out + , section = null + , state = "START" + // section |key = value + , re = /^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i + , lines = str.split(/[\r\n]+/g) + , section = null + + lines.forEach(function (line, _, __) { + if (!line || line.match(/^\s*[;#]/)) return + var match = line.match(re) + if (!match) return + if (match[1] !== undefined) { + section = unsafe(match[1]) + p = out[section] = out[section] || {} + return + } + var key = unsafe(match[2]) + , value = match[3] ? unsafe((match[4] || "")) : true + switch (value) { + case 'true': + case 'false': + case 'null': value = JSON.parse(value) + } + + // Convert keys with '[]' suffix to an array + if (key.length > 2 && key.slice(-2) === "[]") { + key = key.substring(0, key.length - 2) + if (!p[key]) { + p[key] = [] + } + else if (!Array.isArray(p[key])) { + p[key] = [p[key]] + } + } + + // safeguard against resetting a previously defined + // array by accidentally forgetting the brackets + if (Array.isArray(p[key])) { + p[key].push(value) + } + else { + p[key] = value + } + }) + + // {a:{y:1},"a.b":{x:2}} --> {a:{y:1,b:{x:2}}} + // use a filter to return the keys that have to be deleted. + Object.keys(out).filter(function (k, _, __) { + if (!out[k] || typeof out[k] !== "object" || Array.isArray(out[k])) return false + // see if the parent section is also an object. + // if so, add it to that, and mark this one for deletion + var parts = dotSplit(k) + , p = out + , l = parts.pop() + , nl = l.replace(/\\\./g, '.') + parts.forEach(function (part, _, __) { + if (!p[part] || typeof p[part] !== "object") p[part] = {} + p = p[part] + }) + if (p === out && nl === l) return false + p[nl] = out[k] + return true + }).forEach(function (del, _, __) { + delete out[del] + }) + + return out +} + +function isQuoted (val) { + return (val.charAt(0) === "\"" && val.slice(-1) === "\"") + || (val.charAt(0) === "'" && val.slice(-1) === "'") +} + +function safe (val) { + return ( typeof val !== "string" + || val.match(/[=\r\n]/) + || val.match(/^\[/) + || (val.length > 1 + && isQuoted(val)) + || val !== val.trim() ) + ? JSON.stringify(val) + : val.replace(/;/g, '\\;').replace(/#/g, "\\#") +} + +function unsafe (val, doUnesc) { + val = (val || "").trim() + if (isQuoted(val)) { + // remove the single quotes before calling JSON.parse + if (val.charAt(0) === "'") { + val = val.substr(1, val.length - 2); + } + try { val = JSON.parse(val) } catch (_) {} + } else { + // walk the val to find the first not-escaped ; character + var esc = false + var unesc = ""; + for (var i = 0, l = val.length; i < l; i++) { + var c = val.charAt(i) + if (esc) { + if ("\\;#".indexOf(c) !== -1) + unesc += c + else + unesc += "\\" + c + esc = false + } else if (";#".indexOf(c) !== -1) { + break + } else if (c === "\\") { + esc = true + } else { + unesc += c + } + } + if (esc) + unesc += "\\" + return unesc + } + return val +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ini/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ini/package.json new file mode 100644 index 00000000..e9b9d539 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/ini/package.json @@ -0,0 +1,56 @@ +{ + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "name": "ini", + "description": "An ini encoder/decoder for node", + "version": "1.3.4", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/ini.git" + }, + "main": "ini.js", + "scripts": { + "test": "tap test/*.js" + }, + "engines": { + "node": "*" + }, + "dependencies": {}, + "devDependencies": { + "tap": "^1.2.0" + }, + "license": "ISC", + "files": [ + "ini.js" + ], + "gitHead": "4a3001abc4c608e51add9f1d2b2cadf02b8e6dea", + "bugs": { + "url": "https://github.com/isaacs/ini/issues" + }, + "homepage": "https://github.com/isaacs/ini#readme", + "_id": "ini@1.3.4", + "_shasum": "0537cb79daf59b59a1a517dff706c86ec039162e", + "_from": "ini@latest", + "_npmVersion": "2.10.1", + "_nodeVersion": "2.0.1", + "_npmUser": { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + "dist": { + "shasum": "0537cb79daf59b59a1a517dff706c86ec039162e", + "tarball": "http://registry.npmjs.org/ini/-/ini-1.3.4.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/.npmignore new file mode 100644 index 00000000..44a3be18 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/.npmignore @@ -0,0 +1,2 @@ +node_modules/ +.eslintrc diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/.travis.yml new file mode 100644 index 00000000..991d04b6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - '0.10' + - '0.12' + - 'iojs' diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/LICENSE new file mode 100644 index 00000000..05eeeb88 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/README.md new file mode 100644 index 00000000..bd64c123 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/README.md @@ -0,0 +1,45 @@ +# init-package-json + +A node module to get your node module started. + +[![Build Status](https://secure.travis-ci.org/npm/init-package-json.svg)](http://travis-ci.org/npm/init-package-json) + +## Usage + +```javascript +var init = require('init-package-json') +var path = require('path') + +// a path to a promzard module. In the event that this file is +// not found, one will be provided for you. +var initFile = path.resolve(process.env.HOME, '.npm-init') + +// the dir where we're doin stuff. +var dir = process.cwd() + +// extra stuff that gets put into the PromZard module's context. +// In npm, this is the resolved config object. Exposed as 'config' +// Optional. +var configData = { some: 'extra stuff' } + +// Any existing stuff from the package.json file is also exposed in the +// PromZard module as the `package` object. There will also be free +// vars for: +// * `filename` path to the package.json file +// * `basename` the tip of the package dir +// * `dirname` the parent of the package dir + +init(dir, initFile, configData, function (er, data) { + // the data's already been written to {dir}/package.json + // now you can do stuff with it +}) +``` + +Or from the command line: + +``` +$ npm-init +``` + +See [PromZard](https://github.com/npm/promzard) for details about +what can go in the config file. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/default-input.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/default-input.js new file mode 100644 index 00000000..59f8fec6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/default-input.js @@ -0,0 +1,238 @@ +var fs = require('fs') +var glob = require('glob') +var path = require('path') +var validateLicense = require('validate-npm-package-license') +var validateName = require('validate-npm-package-name') +var npa = require('npm-package-arg') +var semver = require('semver') + +// more popular packages should go here, maybe? +function isTestPkg (p) { + return !!p.match(/^(expresso|mocha|tap|coffee-script|coco|streamline)$/) +} + +function niceName (n) { + return n.replace(/^node-|[.-]js$/g, '').toLowerCase() +} + +function readDeps (test) { return function (cb) { + fs.readdir('node_modules', function (er, dir) { + if (er) return cb() + var deps = {} + var n = dir.length + if (n === 0) return cb(null, deps) + dir.forEach(function (d) { + if (d.match(/^\./)) return next() + if (test !== isTestPkg(d)) + return next() + + var dp = path.join(dirname, 'node_modules', d, 'package.json') + fs.readFile(dp, 'utf8', function (er, p) { + if (er) return next() + try { p = JSON.parse(p) } + catch (e) { return next() } + if (!p.version) return next() + if (p._requiredBy) { + if (!p._requiredBy.some(function (req) { return req === '#USER' })) return next() + } + deps[d] = config.get('save-exact') ? p.version : config.get('save-prefix') + p.version + return next() + }) + }) + function next () { + if (--n === 0) return cb(null, deps) + } + }) +}} + +var name = package.name || basename +var spec = npa(name) +var scope = config.get('scope') +if (scope) { + if (scope.charAt(0) !== '@') scope = '@' + scope + if (spec.scope) { + name = scope + '/' + spec.name.split('/')[1] + } else { + name = scope + '/' + name + } +} +exports.name = yes ? name : prompt('name', name, function (data) { + var its = validateName(data) + if (its.validForNewPackages) return data + var errors = (its.errors || []).concat(its.warnings || []) + var er = new Error('Sorry, ' + errors.join(' and ') + '.') + er.notValid = true + return er +}) + +var version = package.version || + config.get('init.version') || + config.get('init-version') || + '1.0.0' +exports.version = yes ? + version : + prompt('version', version, function (version) { + if (semver.valid(version)) return version + var er = new Error('Invalid version: "' + version + '"') + er.notValid = true + return er + }) + +if (!package.description) { + exports.description = yes ? '' : prompt('description') +} + +if (!package.main) { + exports.main = function (cb) { + fs.readdir(dirname, function (er, f) { + if (er) f = [] + + f = f.filter(function (f) { + return f.match(/\.js$/) + }) + + if (f.indexOf('index.js') !== -1) + f = 'index.js' + else if (f.indexOf('main.js') !== -1) + f = 'main.js' + else if (f.indexOf(basename + '.js') !== -1) + f = basename + '.js' + else + f = f[0] + + var index = f || 'index.js' + return cb(null, yes ? index : prompt('entry point', index)) + }) + } +} + +if (!package.bin) { + exports.bin = function (cb) { + fs.readdir(path.resolve(dirname, 'bin'), function (er, d) { + // no bins + if (er) return cb() + // just take the first js file we find there, or nada + return cb(null, d.filter(function (f) { + return f.match(/\.js$/) + })[0]) + }) + } +} + +exports.directories = function (cb) { + fs.readdir(dirname, function (er, dirs) { + if (er) return cb(er) + var res = {} + dirs.forEach(function (d) { + switch (d) { + case 'example': case 'examples': return res.example = d + case 'test': case 'tests': return res.test = d + case 'doc': case 'docs': return res.doc = d + case 'man': return res.man = d + } + }) + if (Object.keys(res).length === 0) res = undefined + return cb(null, res) + }) +} + +if (!package.dependencies) { + exports.dependencies = readDeps(false) +} + +if (!package.devDependencies) { + exports.devDependencies = readDeps(true) +} + +// MUST have a test script! +var s = package.scripts || {} +var notest = 'echo "Error: no test specified" && exit 1' +if (!package.scripts) { + exports.scripts = function (cb) { + fs.readdir(path.join(dirname, 'node_modules'), function (er, d) { + setupScripts(d || [], cb) + }) + } +} +function setupScripts (d, cb) { + // check to see what framework is in use, if any + function tx (test) { + return test || notest + } + if (!s.test || s.test === notest) { + var commands = { + 'tap':'tap test/*.js' + , 'expresso':'expresso test' + , 'mocha':'mocha' + } + var command + Object.keys(commands).forEach(function (k) { + if (d.indexOf(k) !== -1) command = commands[k] + }) + var ps = 'test command' + if (yes) { + s.test = command || notest + } else { + s.test = command ? prompt(ps, command, tx) : prompt(ps, tx) + } + } + return cb(null, s) +} + +if (!package.repository) { + exports.repository = function (cb) { + fs.readFile('.git/config', 'utf8', function (er, gconf) { + if (er || !gconf) { + return cb(null, yes ? '' : prompt('git repository')) + } + gconf = gconf.split(/\r?\n/) + var i = gconf.indexOf('[remote "origin"]') + if (i !== -1) { + var u = gconf[i + 1] + if (!u.match(/^\s*url =/)) u = gconf[i + 2] + if (!u.match(/^\s*url =/)) u = null + else u = u.replace(/^\s*url = /, '') + } + if (u && u.match(/^git@github.com:/)) + u = u.replace(/^git@github.com:/, 'https://github.com/') + + return cb(null, yes ? u : prompt('git repository', u)) + }) + } +} + +if (!package.keywords) { + exports.keywords = yes ? '' : prompt('keywords', function (s) { + if (!s) return undefined + if (Array.isArray(s)) s = s.join(' ') + if (typeof s !== 'string') return s + return s.split(/[\s,]+/) + }) +} + +if (!package.author) { + exports.author = config.get('init.author.name') || + config.get('init-author-name') + ? { + "name" : config.get('init.author.name') || + config.get('init-author-name'), + "email" : config.get('init.author.email') || + config.get('init-author-email'), + "url" : config.get('init.author.url') || + config.get('init-author-url') + } + : yes ? '' : prompt('author') +} + +var license = package.license || + config.get('init.license') || + config.get('init-license') || + 'ISC' +exports.license = yes ? license : prompt('license', license, function (data) { + var its = validateLicense(data) + if (its.validForNewPackages) return data + var errors = (its.errors || []).concat(its.warnings || []) + var er = new Error('Sorry, ' + errors.join(' and ') + '.') + er.notValid = true + return er +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/example/example-basic.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/example/example-basic.js new file mode 100644 index 00000000..0d13bda0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/example/example-basic.js @@ -0,0 +1,7 @@ +var init = require('../init-package-json.js') +var dir = process.cwd() +var initFile = require.resolve('./init/basic-init.js') + +init(dir, initFile, function (err, data) { + if (!err) console.log('written successfully') +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/example/example-default.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/example/example-default.js new file mode 100644 index 00000000..29a81990 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/example/example-default.js @@ -0,0 +1,6 @@ +var init = require('../init-package-json.js') +var dir = process.cwd() + +init(dir, 'file that does not exist', function (err, data) { + if (!err) console.log('written successfully') +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/example/example-npm.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/example/example-npm.js new file mode 100644 index 00000000..292da6a7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/example/example-npm.js @@ -0,0 +1,11 @@ +var init = require('../init-package-json.js') +var dir = process.cwd() +var npm = require('npm') + +npm.load(function (er, npm) { + if (er) throw er + init(dir, npm.config.get('init-module'), npm.config, function (er, data) { + if (er) throw er + console.log('written successfully') + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/example/init/basic-init.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/example/init/basic-init.js new file mode 100644 index 00000000..c8615cc1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/example/init/basic-init.js @@ -0,0 +1 @@ +exports.flavor = prompt("what's your favorite flavor of ice cream buddy?", "I LIKE THEM ALL") \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/init-package-json.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/init-package-json.js new file mode 100644 index 00000000..7dc4b0a3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/init-package-json.js @@ -0,0 +1,151 @@ + +module.exports = init +module.exports.yes = yes + +var PZ = require('promzard').PromZard +var path = require('path') +var def = require.resolve('./default-input.js') + +var fs = require('fs') +var semver = require('semver') +var read = require('read') + +// to validate the data object at the end as a worthwhile package +// and assign default values for things. +// readJson.extras(file, data, cb) +var readJson = require('read-package-json') + +function yes (conf) { + return !!( + conf.get('yes') || conf.get('y') || + conf.get('force') || conf.get('f') + ) +} + +function init (dir, input, config, cb) { + if (typeof config === 'function') + cb = config, config = {} + + // accept either a plain-jane object, or a config object + // with a "get" method. + if (typeof config.get !== 'function') { + var data = config + config = { + get: function (k) { + return data[k] + }, + toJSON: function () { + return data + } + } + } + + var packageFile = path.resolve(dir, 'package.json') + input = path.resolve(input) + var pkg + var ctx = { yes: yes(config) } + + var es = readJson.extraSet + readJson.extraSet = es.filter(function (fn) { + return fn.name !== 'authors' && fn.name !== 'mans' + }) + readJson(packageFile, function (er, d) { + readJson.extraSet = es + + if (er) pkg = {} + else pkg = d + + ctx.filename = packageFile + ctx.dirname = path.dirname(packageFile) + ctx.basename = path.basename(ctx.dirname) + if (!pkg.version || !semver.valid(pkg.version)) + delete pkg.version + + ctx.package = pkg + ctx.config = config || {} + + // make sure that the input is valid. + // if not, use the default + var pz = new PZ(input, ctx) + pz.backupFile = def + pz.on('error', cb) + pz.on('data', function (data) { + Object.keys(data).forEach(function (k) { + if (data[k] !== undefined && data[k] !== null) pkg[k] = data[k] + }) + + // only do a few of these. + // no need for mans or contributors if they're in the files + var es = readJson.extraSet + readJson.extraSet = es.filter(function (fn) { + return fn.name !== 'authors' && fn.name !== 'mans' + }) + readJson.extras(packageFile, pkg, function (er, pkg) { + readJson.extraSet = es + if (er) return cb(er, pkg) + pkg = unParsePeople(pkg) + // no need for the readme now. + delete pkg.readme + delete pkg.readmeFilename + + // really don't want to have this lying around in the file + delete pkg._id + + // ditto + delete pkg.gitHead + + // if the repo is empty, remove it. + if (!pkg.repository) + delete pkg.repository + + // readJson filters out empty descriptions, but init-package-json + // traditionally leaves them alone + if (!pkg.description) + pkg.description = data.description + + var d = JSON.stringify(pkg, null, 2) + '\n' + function write (yes) { + fs.writeFile(packageFile, d, 'utf8', function (er) { + if (!er && yes && !config.get('silent')) { + console.log('Wrote to %s:\n\n%s\n', packageFile, d) + } + return cb(er, pkg) + }) + } + if (ctx.yes) { + return write(true) + } + console.log('About to write to %s:\n\n%s\n', packageFile, d) + read({prompt:'Is this ok? ', default: 'yes'}, function (er, ok) { + if (!ok || ok.toLowerCase().charAt(0) !== 'y') { + console.log('Aborted.') + } else { + return write() + } + }) + }) + }) + }) + +} + +// turn the objects into somewhat more humane strings. +function unParsePeople (data) { + if (data.author) data.author = unParsePerson(data.author) + ;["maintainers", "contributors"].forEach(function (set) { + if (!Array.isArray(data[set])) return; + data[set] = data[set].map(unParsePerson) + }) + return data +} + +function unParsePerson (person) { + if (typeof person === "string") return person + var name = person.name || "" + var u = person.url || person.web + var url = u ? (" ("+u+")") : "" + var e = person.email || person.mail + var email = e ? (" <"+e+">") : "" + return name+email+url +} + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/glob/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/glob/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/glob/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/glob/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/glob/README.md new file mode 100644 index 00000000..6960483b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/glob/README.md @@ -0,0 +1,359 @@ +# Glob + +Match files using the patterns the shell uses, like stars and stuff. + +[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master) + +This is a glob implementation in JavaScript. It uses the `minimatch` +library to do its matching. + +![](oh-my-glob.gif) + +## Usage + +```javascript +var glob = require("glob") + +// options is optional +glob("**/*.js", options, function (er, files) { + // files is an array of filenames. + // If the `nonull` option is set, and nothing + // was found, then files is ["**/*.js"] + // er is an error object or null. +}) +``` + +## Glob Primer + +"Globs" are the patterns you type when you do stuff like `ls *.js` on +the command line, or put `build/*` in a `.gitignore` file. + +Before parsing the path part patterns, braced sections are expanded +into a set. Braced sections start with `{` and end with `}`, with any +number of comma-delimited sections within. Braced sections may contain +slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`. + +The following characters have special magic meaning when used in a +path portion: + +* `*` Matches 0 or more characters in a single path portion +* `?` Matches 1 character +* `[...]` Matches a range of characters, similar to a RegExp range. + If the first character of the range is `!` or `^` then it matches + any character not in the range. +* `!(pattern|pattern|pattern)` Matches anything that does not match + any of the patterns provided. +* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the + patterns provided. +* `+(pattern|pattern|pattern)` Matches one or more occurrences of the + patterns provided. +* `*(a|b|c)` Matches zero or more occurrences of the patterns provided +* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns + provided +* `**` If a "globstar" is alone in a path portion, then it matches + zero or more directories and subdirectories searching for matches. + It does not crawl symlinked directories. + +### Dots + +If a file or directory path portion has a `.` as the first character, +then it will not match any glob pattern unless that pattern's +corresponding path part also has a `.` as its first character. + +For example, the pattern `a/.*/c` would match the file at `a/.b/c`. +However the pattern `a/*/c` would not, because `*` does not start with +a dot character. + +You can make glob treat dots as normal characters by setting +`dot:true` in the options. + +### Basename Matching + +If you set `matchBase:true` in the options, and the pattern has no +slashes in it, then it will seek for any file anywhere in the tree +with a matching basename. For example, `*.js` would match +`test/simple/basic.js`. + +### Empty Sets + +If no matching files are found, then an empty array is returned. This +differs from the shell, where the pattern itself is returned. For +example: + + $ echo a*s*d*f + a*s*d*f + +To get the bash-style behavior, set the `nonull:true` in the options. + +### See Also: + +* `man sh` +* `man bash` (Search for "Pattern Matching") +* `man 3 fnmatch` +* `man 5 gitignore` +* [minimatch documentation](https://github.com/isaacs/minimatch) + +## glob.hasMagic(pattern, [options]) + +Returns `true` if there are any special characters in the pattern, and +`false` otherwise. + +Note that the options affect the results. If `noext:true` is set in +the options object, then `+(a|b)` will not be considered a magic +pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}` +then that is considered magical, unless `nobrace:true` is set in the +options. + +## glob(pattern, [options], cb) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* `cb` `{Function}` + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Perform an asynchronous glob search. + +## glob.sync(pattern, [options]) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* return: `{Array}` filenames found matching the pattern + +Perform a synchronous glob search. + +## Class: glob.Glob + +Create a Glob object by instantiating the `glob.Glob` class. + +```javascript +var Glob = require("glob").Glob +var mg = new Glob(pattern, options, cb) +``` + +It's an EventEmitter, and starts walking the filesystem to find matches +immediately. + +### new glob.Glob(pattern, [options], [cb]) + +* `pattern` `{String}` pattern to search for +* `options` `{Object}` +* `cb` `{Function}` Called when an error occurs, or matches are found + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Note that if the `sync` flag is set in the options, then matches will +be immediately available on the `g.found` member. + +### Properties + +* `minimatch` The minimatch object that the glob uses. +* `options` The options object passed in. +* `aborted` Boolean which is set to true when calling `abort()`. There + is no way at this time to continue a glob search after aborting, but + you can re-use the statCache to avoid having to duplicate syscalls. +* `cache` Convenience object. Each field has the following possible + values: + * `false` - Path does not exist + * `true` - Path exists + * `'FILE'` - Path exists, and is not a directory + * `'DIR'` - Path exists, and is a directory + * `[file, entries, ...]` - Path exists, is a directory, and the + array value is the results of `fs.readdir` +* `statCache` Cache of `fs.stat` results, to prevent statting the same + path multiple times. +* `symlinks` A record of which paths are symbolic links, which is + relevant in resolving `**` patterns. +* `realpathCache` An optional object which is passed to `fs.realpath` + to minimize unnecessary syscalls. It is stored on the instantiated + Glob object, and may be re-used. + +### Events + +* `end` When the matching is finished, this is emitted with all the + matches found. If the `nonull` option is set, and no match was found, + then the `matches` list contains the original pattern. The matches + are sorted, unless the `nosort` flag is set. +* `match` Every time a match is found, this is emitted with the specific + thing that matched. It is not deduplicated or resolved to a realpath. +* `error` Emitted when an unexpected error is encountered, or whenever + any fs error occurs if `options.strict` is set. +* `abort` When `abort()` is called, this event is raised. + +### Methods + +* `pause` Temporarily stop the search +* `resume` Resume the search +* `abort` Stop the search forever + +### Options + +All the options that can be passed to Minimatch can also be passed to +Glob to change pattern matching behavior. Also, some have been added, +or have glob-specific ramifications. + +All options are false by default, unless otherwise noted. + +All options are added to the Glob object, as well. + +If you are running many `glob` operations, you can pass a Glob object +as the `options` argument to a subsequent operation to shortcut some +`stat` and `readdir` calls. At the very least, you may pass in shared +`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that +parallel glob operations will be sped up by sharing information about +the filesystem. + +* `cwd` The current working directory in which to search. Defaults + to `process.cwd()`. +* `root` The place where patterns starting with `/` will be mounted + onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix + systems, and `C:\` or some such on Windows.) +* `dot` Include `.dot` files in normal matches and `globstar` matches. + Note that an explicit dot in a portion of the pattern will always + match dot files. +* `nomount` By default, a pattern starting with a forward-slash will be + "mounted" onto the root setting, so that a valid filesystem path is + returned. Set this flag to disable that behavior. +* `mark` Add a `/` character to directory matches. Note that this + requires additional stat calls. +* `nosort` Don't sort the results. +* `stat` Set to true to stat *all* results. This reduces performance + somewhat, and is completely unnecessary, unless `readdir` is presumed + to be an untrustworthy indicator of file existence. +* `silent` When an unusual error is encountered when attempting to + read a directory, a warning will be printed to stderr. Set the + `silent` option to true to suppress these warnings. +* `strict` When an unusual error is encountered when attempting to + read a directory, the process will just continue on in search of + other matches. Set the `strict` option to raise an error in these + cases. +* `cache` See `cache` property above. Pass in a previously generated + cache object to save some fs calls. +* `statCache` A cache of results of filesystem information, to prevent + unnecessary stat calls. While it should not normally be necessary + to set this, you may pass the statCache from one glob() call to the + options object of another, if you know that the filesystem will not + change between calls. (See "Race Conditions" below.) +* `symlinks` A cache of known symbolic links. You may pass in a + previously generated `symlinks` object to save `lstat` calls when + resolving `**` matches. +* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead. +* `nounique` In some cases, brace-expanded patterns can result in the + same file showing up multiple times in the result set. By default, + this implementation prevents duplicates in the result set. Set this + flag to disable that behavior. +* `nonull` Set to never return an empty set, instead returning a set + containing the pattern itself. This is the default in glob(3). +* `debug` Set to enable debug logging in minimatch and glob. +* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets. +* `noglobstar` Do not match `**` against multiple filenames. (Ie, + treat it as a normal `*` instead.) +* `noext` Do not match `+(a|b)` "extglob" patterns. +* `nocase` Perform a case-insensitive match. Note: on + case-insensitive filesystems, non-magic patterns will match by + default, since `stat` and `readdir` will not raise errors. +* `matchBase` Perform a basename-only match if the pattern does not + contain any slash characters. That is, `*.js` would be treated as + equivalent to `**/*.js`, matching all js files in all directories. +* `nodir` Do not match directories, only files. (Note: to match + *only* directories, simply put a `/` at the end of the pattern.) +* `ignore` Add a pattern or an array of glob patterns to exclude matches. + Note: `ignore` patterns are *always* in `dot:true` mode, regardless + of any other settings. +* `follow` Follow symlinked directories when expanding `**` patterns. + Note that this can result in a lot of duplicate references in the + presence of cyclic links. +* `realpath` Set to true to call `fs.realpath` on all of the results. + In the case of a symlink that cannot be resolved, the full absolute + path to the matched entry is returned (though it will usually be a + broken symlink) + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between node-glob and other +implementations, and are intentional. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.3, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +Note that symlinked directories are not crawled as part of a `**`, +though their contents may match against subsequent portions of the +pattern. This prevents infinite loops and duplicates and the like. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then glob returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. + +### Comments and Negation + +Previously, this module let you mark a pattern as a "comment" if it +started with a `#` character, or a "negated" pattern if it started +with a `!` character. + +These options were deprecated in version 5, and removed in version 6. + +To specify things that should not match, use the `ignore` option. + +## Windows + +**Please only use forward-slashes in glob expressions.** + +Though windows uses either `/` or `\` as its path separator, only `/` +characters are used by this glob implementation. You must use +forward-slashes **only** in glob expressions. Back-slashes will always +be interpreted as escape characters, not path separators. + +Results from absolute patterns such as `/foo/*` are mounted onto the +root setting using `path.join`. On windows, this will by default result +in `/foo/*` matching `C:\foo\bar.txt`. + +## Race Conditions + +Glob searching, by its very nature, is susceptible to race conditions, +since it relies on directory walking and such. + +As a result, it is possible that a file that exists when glob looks for +it may have been deleted or modified by the time it returns the result. + +As part of its internal implementation, this program caches all stat +and readdir calls that it makes, in order to cut down on system +overhead. However, this also makes it even more susceptible to races, +especially if the cache or statCache objects are reused between glob +calls. + +Users are thus advised not to use a glob result as a guarantee of +filesystem state in the face of rapid changes. For the vast majority +of operations, this is never a problem. + +## Contributing + +Any change to behavior (including bugfixes) must come with a test. + +Patches that fail tests or reduce performance will be rejected. + +``` +# to run tests +npm test + +# to re-generate test fixtures +npm run test-regen + +# to benchmark against bash/zsh +npm run bench + +# to profile javascript +npm run prof +``` diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/glob/common.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/glob/common.js new file mode 100644 index 00000000..c9127eb3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/glob/common.js @@ -0,0 +1,226 @@ +exports.alphasort = alphasort +exports.alphasorti = alphasorti +exports.setopts = setopts +exports.ownProp = ownProp +exports.makeAbs = makeAbs +exports.finish = finish +exports.mark = mark +exports.isIgnored = isIgnored +exports.childrenIgnored = childrenIgnored + +function ownProp (obj, field) { + return Object.prototype.hasOwnProperty.call(obj, field) +} + +var path = require("path") +var minimatch = require("minimatch") +var isAbsolute = require("path-is-absolute") +var Minimatch = minimatch.Minimatch + +function alphasorti (a, b) { + return a.toLowerCase().localeCompare(b.toLowerCase()) +} + +function alphasort (a, b) { + return a.localeCompare(b) +} + +function setupIgnores (self, options) { + self.ignore = options.ignore || [] + + if (!Array.isArray(self.ignore)) + self.ignore = [self.ignore] + + if (self.ignore.length) { + self.ignore = self.ignore.map(ignoreMap) + } +} + +// ignore patterns are always in dot:true mode. +function ignoreMap (pattern) { + var gmatcher = null + if (pattern.slice(-3) === '/**') { + var gpattern = pattern.replace(/(\/\*\*)+$/, '') + gmatcher = new Minimatch(gpattern, { dot: true }) + } + + return { + matcher: new Minimatch(pattern, { dot: true }), + gmatcher: gmatcher + } +} + +function setopts (self, pattern, options) { + if (!options) + options = {} + + // base-matching: just use globstar for that. + if (options.matchBase && -1 === pattern.indexOf("/")) { + if (options.noglobstar) { + throw new Error("base matching requires globstar") + } + pattern = "**/" + pattern + } + + self.silent = !!options.silent + self.pattern = pattern + self.strict = options.strict !== false + self.realpath = !!options.realpath + self.realpathCache = options.realpathCache || Object.create(null) + self.follow = !!options.follow + self.dot = !!options.dot + self.mark = !!options.mark + self.nodir = !!options.nodir + if (self.nodir) + self.mark = true + self.sync = !!options.sync + self.nounique = !!options.nounique + self.nonull = !!options.nonull + self.nosort = !!options.nosort + self.nocase = !!options.nocase + self.stat = !!options.stat + self.noprocess = !!options.noprocess + + self.maxLength = options.maxLength || Infinity + self.cache = options.cache || Object.create(null) + self.statCache = options.statCache || Object.create(null) + self.symlinks = options.symlinks || Object.create(null) + + setupIgnores(self, options) + + self.changedCwd = false + var cwd = process.cwd() + if (!ownProp(options, "cwd")) + self.cwd = cwd + else { + self.cwd = options.cwd + self.changedCwd = path.resolve(options.cwd) !== cwd + } + + self.root = options.root || path.resolve(self.cwd, "/") + self.root = path.resolve(self.root) + if (process.platform === "win32") + self.root = self.root.replace(/\\/g, "/") + + self.nomount = !!options.nomount + + // disable comments and negation in Minimatch. + // Note that they are not supported in Glob itself anyway. + options.nonegate = true + options.nocomment = true + + self.minimatch = new Minimatch(pattern, options) + self.options = self.minimatch.options +} + +function finish (self) { + var nou = self.nounique + var all = nou ? [] : Object.create(null) + + for (var i = 0, l = self.matches.length; i < l; i ++) { + var matches = self.matches[i] + if (!matches || Object.keys(matches).length === 0) { + if (self.nonull) { + // do like the shell, and spit out the literal glob + var literal = self.minimatch.globSet[i] + if (nou) + all.push(literal) + else + all[literal] = true + } + } else { + // had matches + var m = Object.keys(matches) + if (nou) + all.push.apply(all, m) + else + m.forEach(function (m) { + all[m] = true + }) + } + } + + if (!nou) + all = Object.keys(all) + + if (!self.nosort) + all = all.sort(self.nocase ? alphasorti : alphasort) + + // at *some* point we statted all of these + if (self.mark) { + for (var i = 0; i < all.length; i++) { + all[i] = self._mark(all[i]) + } + if (self.nodir) { + all = all.filter(function (e) { + return !(/\/$/.test(e)) + }) + } + } + + if (self.ignore.length) + all = all.filter(function(m) { + return !isIgnored(self, m) + }) + + self.found = all +} + +function mark (self, p) { + var abs = makeAbs(self, p) + var c = self.cache[abs] + var m = p + if (c) { + var isDir = c === 'DIR' || Array.isArray(c) + var slash = p.slice(-1) === '/' + + if (isDir && !slash) + m += '/' + else if (!isDir && slash) + m = m.slice(0, -1) + + if (m !== p) { + var mabs = makeAbs(self, m) + self.statCache[mabs] = self.statCache[abs] + self.cache[mabs] = self.cache[abs] + } + } + + return m +} + +// lotta situps... +function makeAbs (self, f) { + var abs = f + if (f.charAt(0) === '/') { + abs = path.join(self.root, f) + } else if (isAbsolute(f) || f === '') { + abs = f + } else if (self.changedCwd) { + abs = path.resolve(self.cwd, f) + } else { + abs = path.resolve(f) + } + return abs +} + + +// Return true, if pattern ends with globstar '**', for the accompanying parent directory. +// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents +function isIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) + }) +} + +function childrenIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return !!(item.gmatcher && item.gmatcher.match(path)) + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/glob/glob.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/glob/glob.js new file mode 100644 index 00000000..a62da27e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/glob/glob.js @@ -0,0 +1,765 @@ +// Approach: +// +// 1. Get the minimatch set +// 2. For each pattern in the set, PROCESS(pattern, false) +// 3. Store matches per-set, then uniq them +// +// PROCESS(pattern, inGlobStar) +// Get the first [n] items from pattern that are all strings +// Join these together. This is PREFIX. +// If there is no more remaining, then stat(PREFIX) and +// add to matches if it succeeds. END. +// +// If inGlobStar and PREFIX is symlink and points to dir +// set ENTRIES = [] +// else readdir(PREFIX) as ENTRIES +// If fail, END +// +// with ENTRIES +// If pattern[n] is GLOBSTAR +// // handle the case where the globstar match is empty +// // by pruning it out, and testing the resulting pattern +// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) +// // handle other cases. +// for ENTRY in ENTRIES (not dotfiles) +// // attach globstar + tail onto the entry +// // Mark that this entry is a globstar match +// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) +// +// else // not globstar +// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) +// Test ENTRY against pattern[n] +// If fails, continue +// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) +// +// Caveat: +// Cache all stats and readdirs results to minimize syscall. Since all +// we ever care about is existence and directory-ness, we can just keep +// `true` for files, and [children,...] for directories, or `false` for +// things that don't exist. + +module.exports = glob + +var fs = require('fs') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var inherits = require('inherits') +var EE = require('events').EventEmitter +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var globSync = require('./sync.js') +var common = require('./common.js') +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var inflight = require('inflight') +var util = require('util') +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored + +var once = require('once') + +function glob (pattern, options, cb) { + if (typeof options === 'function') cb = options, options = {} + if (!options) options = {} + + if (options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return globSync(pattern, options) + } + + return new Glob(pattern, options, cb) +} + +glob.sync = globSync +var GlobSync = glob.GlobSync = globSync.GlobSync + +// old api surface +glob.glob = glob + +function extend (origin, add) { + if (add === null || typeof add !== 'object') { + return origin + } + + var keys = Object.keys(add) + var i = keys.length + while (i--) { + origin[keys[i]] = add[keys[i]] + } + return origin +} + +glob.hasMagic = function (pattern, options_) { + var options = extend({}, options_) + options.noprocess = true + + var g = new Glob(pattern, options) + var set = g.minimatch.set + if (set.length > 1) + return true + + for (var j = 0; j < set[0].length; j++) { + if (typeof set[0][j] !== 'string') + return true + } + + return false +} + +glob.Glob = Glob +inherits(Glob, EE) +function Glob (pattern, options, cb) { + if (typeof options === 'function') { + cb = options + options = null + } + + if (options && options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return new GlobSync(pattern, options) + } + + if (!(this instanceof Glob)) + return new Glob(pattern, options, cb) + + setopts(this, pattern, options) + this._didRealPath = false + + // process each pattern in the minimatch set + var n = this.minimatch.set.length + + // The matches are stored as {: true,...} so that + // duplicates are automagically pruned. + // Later, we do an Object.keys() on these. + // Keep them as a list so we can fill in when nonull is set. + this.matches = new Array(n) + + if (typeof cb === 'function') { + cb = once(cb) + this.on('error', cb) + this.on('end', function (matches) { + cb(null, matches) + }) + } + + var self = this + var n = this.minimatch.set.length + this._processing = 0 + this.matches = new Array(n) + + this._emitQueue = [] + this._processQueue = [] + this.paused = false + + if (this.noprocess) + return this + + if (n === 0) + return done() + + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false, done) + } + + function done () { + --self._processing + if (self._processing <= 0) + self._finish() + } +} + +Glob.prototype._finish = function () { + assert(this instanceof Glob) + if (this.aborted) + return + + if (this.realpath && !this._didRealpath) + return this._realpath() + + common.finish(this) + this.emit('end', this.found) +} + +Glob.prototype._realpath = function () { + if (this._didRealpath) + return + + this._didRealpath = true + + var n = this.matches.length + if (n === 0) + return this._finish() + + var self = this + for (var i = 0; i < this.matches.length; i++) + this._realpathSet(i, next) + + function next () { + if (--n === 0) + self._finish() + } +} + +Glob.prototype._realpathSet = function (index, cb) { + var matchset = this.matches[index] + if (!matchset) + return cb() + + var found = Object.keys(matchset) + var self = this + var n = found.length + + if (n === 0) + return cb() + + var set = this.matches[index] = Object.create(null) + found.forEach(function (p, i) { + // If there's a problem with the stat, then it means that + // one or more of the links in the realpath couldn't be + // resolved. just return the abs value in that case. + p = self._makeAbs(p) + fs.realpath(p, self.realpathCache, function (er, real) { + if (!er) + set[real] = true + else if (er.syscall === 'stat') + set[p] = true + else + self.emit('error', er) // srsly wtf right here + + if (--n === 0) { + self.matches[index] = set + cb() + } + }) + }) +} + +Glob.prototype._mark = function (p) { + return common.mark(this, p) +} + +Glob.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} + +Glob.prototype.abort = function () { + this.aborted = true + this.emit('abort') +} + +Glob.prototype.pause = function () { + if (!this.paused) { + this.paused = true + this.emit('pause') + } +} + +Glob.prototype.resume = function () { + if (this.paused) { + this.emit('resume') + this.paused = false + if (this._emitQueue.length) { + var eq = this._emitQueue.slice(0) + this._emitQueue.length = 0 + for (var i = 0; i < eq.length; i ++) { + var e = eq[i] + this._emitMatch(e[0], e[1]) + } + } + if (this._processQueue.length) { + var pq = this._processQueue.slice(0) + this._processQueue.length = 0 + for (var i = 0; i < pq.length; i ++) { + var p = pq[i] + this._processing-- + this._process(p[0], p[1], p[2], p[3]) + } + } + } +} + +Glob.prototype._process = function (pattern, index, inGlobStar, cb) { + assert(this instanceof Glob) + assert(typeof cb === 'function') + + if (this.aborted) + return + + this._processing++ + if (this.paused) { + this._processQueue.push([pattern, index, inGlobStar, cb]) + return + } + + //console.error('PROCESS %d', this._processing, pattern) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // see if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index, cb) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip _processing + if (childrenIgnored(this, read)) + return cb() + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) +} + +Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + +Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return cb() + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return cb() + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return cb() + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + this._process([e].concat(remain), index, inGlobStar, cb) + } + cb() +} + +Glob.prototype._emitMatch = function (index, e) { + if (this.aborted) + return + + if (this.matches[index][e]) + return + + if (isIgnored(this, e)) + return + + if (this.paused) { + this._emitQueue.push([index, e]) + return + } + + var abs = this._makeAbs(e) + + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } + + if (this.mark) + e = this._mark(e) + + this.matches[index][e] = true + + var st = this.statCache[abs] + if (st) + this.emit('stat', e, st) + + this.emit('match', e) +} + +Glob.prototype._readdirInGlobStar = function (abs, cb) { + if (this.aborted) + return + + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false, cb) + + var lstatkey = 'lstat\0' + abs + var self = this + var lstatcb = inflight(lstatkey, lstatcb_) + + if (lstatcb) + fs.lstat(abs, lstatcb) + + function lstatcb_ (er, lstat) { + if (er) + return cb() + + var isSym = lstat.isSymbolicLink() + self.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && !lstat.isDirectory()) { + self.cache[abs] = 'FILE' + cb() + } else + self._readdir(abs, false, cb) + } +} + +Glob.prototype._readdir = function (abs, inGlobStar, cb) { + if (this.aborted) + return + + cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) + if (!cb) + return + + //console.error('RD %j %j', +inGlobStar, abs) + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs, cb) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return cb() + + if (Array.isArray(c)) + return cb(null, c) + } + + var self = this + fs.readdir(abs, readdirCb(this, abs, cb)) +} + +function readdirCb (self, abs, cb) { + return function (er, entries) { + if (er) + self._readdirError(abs, er, cb) + else + self._readdirEntries(abs, entries, cb) + } +} + +Glob.prototype._readdirEntries = function (abs, entries, cb) { + if (this.aborted) + return + + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + return cb(null, entries) +} + +Glob.prototype._readdirError = function (f, er, cb) { + if (this.aborted) + return + + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + this.cache[this._makeAbs(f)] = 'FILE' + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) { + this.emit('error', er) + // If the error is handled, then we abort + // if not, we threw out of here + this.abort() + } + if (!this.silent) + console.error('glob error', er) + break + } + + return cb() +} + +Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + + +Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + //console.error('pgs2', prefix, remain[0], entries) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return cb() + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false, cb) + + var isSym = this.symlinks[abs] + var len = entries.length + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return cb() + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true, cb) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true, cb) + } + + cb() +} + +Glob.prototype._processSimple = function (prefix, index, cb) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var self = this + this._stat(prefix, function (er, exists) { + self._processSimple2(prefix, index, er, exists, cb) + }) +} +Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { + + //console.error('ps2', prefix, exists) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return cb() + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this._emitMatch(index, prefix) + cb() +} + +// Returns either 'DIR', 'FILE', or false +Glob.prototype._stat = function (f, cb) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return cb() + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return cb(null, c) + + if (needDir && c === 'FILE') + return cb() + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (stat !== undefined) { + if (stat === false) + return cb(null, stat) + else { + var type = stat.isDirectory() ? 'DIR' : 'FILE' + if (needDir && type === 'FILE') + return cb() + else + return cb(null, type, stat) + } + } + + var self = this + var statcb = inflight('stat\0' + abs, lstatcb_) + if (statcb) + fs.lstat(abs, statcb) + + function lstatcb_ (er, lstat) { + if (lstat && lstat.isSymbolicLink()) { + // If it's a symlink, then treat it as the target, unless + // the target does not exist, then treat it as a file. + return fs.stat(abs, function (er, stat) { + if (er) + self._stat2(f, abs, null, lstat, cb) + else + self._stat2(f, abs, er, stat, cb) + }) + } else { + self._stat2(f, abs, er, lstat, cb) + } + } +} + +Glob.prototype._stat2 = function (f, abs, er, stat, cb) { + if (er) { + this.statCache[abs] = false + return cb() + } + + var needDir = f.slice(-1) === '/' + this.statCache[abs] = stat + + if (abs.slice(-1) === '/' && !stat.isDirectory()) + return cb(null, false, stat) + + var c = stat.isDirectory() ? 'DIR' : 'FILE' + this.cache[abs] = this.cache[abs] || c + + if (needDir && c !== 'DIR') + return cb() + + return cb(null, c, stat) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/index.js new file mode 100644 index 00000000..19f103f9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/index.js @@ -0,0 +1,20 @@ +'use strict'; + +function posix(path) { + return path.charAt(0) === '/'; +}; + +function win32(path) { + // https://github.com/joyent/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56 + var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; + var result = splitDeviceRe.exec(path); + var device = result[1] || ''; + var isUnc = !!device && device.charAt(1) !== ':'; + + // UNC paths are always absolute + return !!result[2] || isUnc; +}; + +module.exports = process.platform === 'win32' ? win32 : posix; +module.exports.posix = posix; +module.exports.win32 = win32; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/license b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/package.json new file mode 100644 index 00000000..8f41adea --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/package.json @@ -0,0 +1,70 @@ +{ + "name": "path-is-absolute", + "version": "1.0.0", + "description": "Node.js 0.12 path.isAbsolute() ponyfill", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/path-is-absolute.git" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "node test.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "path", + "paths", + "file", + "dir", + "absolute", + "isabsolute", + "is-absolute", + "built-in", + "util", + "utils", + "core", + "ponyfill", + "polyfill", + "shim", + "is", + "detect", + "check" + ], + "gitHead": "7a76a0c9f2263192beedbe0a820e4d0baee5b7a1", + "bugs": { + "url": "https://github.com/sindresorhus/path-is-absolute/issues" + }, + "homepage": "https://github.com/sindresorhus/path-is-absolute", + "_id": "path-is-absolute@1.0.0", + "_shasum": "263dada66ab3f2fb10bf7f9d24dd8f3e570ef912", + "_from": "path-is-absolute@>=1.0.0 <2.0.0", + "_npmVersion": "2.5.1", + "_nodeVersion": "0.12.0", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "dist": { + "shasum": "263dada66ab3f2fb10bf7f9d24dd8f3e570ef912", + "tarball": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/readme.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/readme.md new file mode 100644 index 00000000..cdf94f43 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/readme.md @@ -0,0 +1,51 @@ +# path-is-absolute [![Build Status](https://travis-ci.org/sindresorhus/path-is-absolute.svg?branch=master)](https://travis-ci.org/sindresorhus/path-is-absolute) + +> Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) ponyfill + +> Ponyfill: A polyfill that doesn't overwrite the native method + + +## Install + +``` +$ npm install --save path-is-absolute +``` + + +## Usage + +```js +var pathIsAbsolute = require('path-is-absolute'); + +// Linux +pathIsAbsolute('/home/foo'); +//=> true + +// Windows +pathIsAbsolute('C:/Users/'); +//=> true + +// Any OS +pathIsAbsolute.posix('/home/foo'); +//=> true +``` + + +## API + +See the [`path.isAbsolute()` docs](http://nodejs.org/api/path.html#path_path_isabsolute_path). + +### pathIsAbsolute(path) + +### pathIsAbsolute.posix(path) + +The Posix specific version. + +### pathIsAbsolute.win32(path) + +The Windows specific version. + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/glob/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/glob/package.json new file mode 100644 index 00000000..d6cebb41 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/glob/package.json @@ -0,0 +1,73 @@ +{ + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "name": "glob", + "description": "a little globber", + "version": "6.0.4", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-glob.git" + }, + "main": "glob.js", + "files": [ + "glob.js", + "sync.js", + "common.js" + ], + "engines": { + "node": "*" + }, + "dependencies": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "devDependencies": { + "mkdirp": "0", + "rimraf": "^2.2.8", + "tap": "^5.0.0", + "tick": "0.0.6" + }, + "scripts": { + "prepublish": "npm run benchclean", + "profclean": "rm -f v8.log profile.txt", + "test": "tap test/*.js --cov", + "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js", + "bench": "bash benchmark.sh", + "prof": "bash prof.sh && cat profile.txt", + "benchclean": "node benchclean.js" + }, + "license": "ISC", + "gitHead": "3bd419c538737e56fda7e21c21ff52ca0c198df6", + "bugs": { + "url": "https://github.com/isaacs/node-glob/issues" + }, + "homepage": "https://github.com/isaacs/node-glob#readme", + "_id": "glob@6.0.4", + "_shasum": "0f08860f6a155127b2fadd4f9ce24b1aab6e4d22", + "_from": "glob@>=6.0.0 <7.0.0", + "_npmVersion": "2.14.15", + "_nodeVersion": "4.0.0", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "dist": { + "shasum": "0f08860f6a155127b2fadd4f9ce24b1aab6e4d22", + "tarball": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/glob/sync.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/glob/sync.js new file mode 100644 index 00000000..09883d2c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/glob/sync.js @@ -0,0 +1,460 @@ +module.exports = globSync +globSync.GlobSync = GlobSync + +var fs = require('fs') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var Glob = require('./glob.js').Glob +var util = require('util') +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var common = require('./common.js') +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var childrenIgnored = common.childrenIgnored + +function globSync (pattern, options) { + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + return new GlobSync(pattern, options).found +} + +function GlobSync (pattern, options) { + if (!pattern) + throw new Error('must provide pattern') + + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + if (!(this instanceof GlobSync)) + return new GlobSync(pattern, options) + + setopts(this, pattern, options) + + if (this.noprocess) + return this + + var n = this.minimatch.set.length + this.matches = new Array(n) + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false) + } + this._finish() +} + +GlobSync.prototype._finish = function () { + assert(this instanceof GlobSync) + if (this.realpath) { + var self = this + this.matches.forEach(function (matchset, index) { + var set = self.matches[index] = Object.create(null) + for (var p in matchset) { + try { + p = self._makeAbs(p) + var real = fs.realpathSync(p, self.realpathCache) + set[real] = true + } catch (er) { + if (er.syscall === 'stat') + set[self._makeAbs(p)] = true + else + throw er + } + } + }) + } + common.finish(this) +} + + +GlobSync.prototype._process = function (pattern, index, inGlobStar) { + assert(this instanceof GlobSync) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // See if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip processing + if (childrenIgnored(this, read)) + return + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar) +} + + +GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { + var entries = this._readdir(abs, inGlobStar) + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix.slice(-1) !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this.matches[index][e] = true + } + // This was the last one, and no stats were needed + return + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) + newPattern = [prefix, e] + else + newPattern = [e] + this._process(newPattern.concat(remain), index, inGlobStar) + } +} + + +GlobSync.prototype._emitMatch = function (index, e) { + var abs = this._makeAbs(e) + if (this.mark) + e = this._mark(e) + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[this._makeAbs(e)] + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true + if (this.stat) + this._stat(e) +} + + +GlobSync.prototype._readdirInGlobStar = function (abs) { + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false) + + var entries + var lstat + var stat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + // lstat failed, doesn't exist + return null + } + + var isSym = lstat.isSymbolicLink() + this.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && !lstat.isDirectory()) + this.cache[abs] = 'FILE' + else + entries = this._readdir(abs, false) + + return entries +} + +GlobSync.prototype._readdir = function (abs, inGlobStar) { + var entries + + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return null + + if (Array.isArray(c)) + return c + } + + try { + return this._readdirEntries(abs, fs.readdirSync(abs)) + } catch (er) { + this._readdirError(abs, er) + return null + } +} + +GlobSync.prototype._readdirEntries = function (abs, entries) { + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + + // mark and cache dir-ness + return entries +} + +GlobSync.prototype._readdirError = function (f, er) { + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + this.cache[this._makeAbs(f)] = 'FILE' + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) + throw er + if (!this.silent) + console.error('glob error', er) + break + } +} + +GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { + + var entries = this._readdir(abs, inGlobStar) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false) + + var len = entries.length + var isSym = this.symlinks[abs] + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true) + } +} + +GlobSync.prototype._processSimple = function (prefix, index) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var exists = this._stat(prefix) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this.matches[index][prefix] = true +} + +// Returns either 'DIR', 'FILE', or false +GlobSync.prototype._stat = function (f) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return false + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return c + + if (needDir && c === 'FILE') + return false + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (!stat) { + var lstat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + return false + } + + if (lstat.isSymbolicLink()) { + try { + stat = fs.statSync(abs) + } catch (er) { + stat = lstat + } + } else { + stat = lstat + } + } + + this.statCache[abs] = stat + + var c = stat.isDirectory() ? 'DIR' : 'FILE' + this.cache[abs] = this.cache[abs] || c + + if (needDir && c !== 'DIR') + return false + + return c +} + +GlobSync.prototype._mark = function (p) { + return common.mark(this, p) +} + +GlobSync.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/.npmignore new file mode 100644 index 00000000..15a1789a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/.npmignore @@ -0,0 +1 @@ +example/npm-init/package.json diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/LICENSE new file mode 100644 index 00000000..05eeeb88 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/README.md new file mode 100644 index 00000000..93c0418a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/README.md @@ -0,0 +1,133 @@ +# promzard + +A prompting wizard for building files from specialized PromZard modules. +Used by `npm init`. + +A reimplementation of @SubStack's +[prompter](https://github.com/substack/node-prompter), which does not +use AST traversal. + +From another point of view, it's a reimplementation of +[@Marak](https://github.com/marak)'s +[wizard](https://github.com/Marak/wizard) which doesn't use schemas. + +The goal is a nice drop-in enhancement for `npm init`. + +## Usage + +```javascript +var promzard = require('promzard') +promzard(inputFile, optionalContextAdditions, function (er, data) { + // .. you know what you doing .. +}) +``` + +In the `inputFile` you can have something like this: + +```javascript +var fs = require('fs') +module.exports = { + "greeting": prompt("Who shall you greet?", "world", function (who) { + return "Hello, " + who + }), + "filename": __filename, + "directory": function (cb) { + fs.readdir(__dirname, cb) + } +} +``` + +When run, promzard will display the prompts and resolve the async +functions in order, and then either give you an error, or the resolved +data, ready to be dropped into a JSON file or some other place. + + +### promzard(inputFile, ctx, callback) + +The inputFile is just a node module. You can require() things, set +module.exports, etc. Whatever that module exports is the result, and it +is walked over to call any functions as described below. + +The only caveat is that you must give PromZard the full absolute path +to the module (you can get this via Node's `require.resolve`.) Also, +the `prompt` function is injected into the context object, so watch out. + +Whatever you put in that `ctx` will of course also be available in the +module. You can get quite fancy with this, passing in existing configs +and so on. + +### Class: promzard.PromZard(file, ctx) + +Just like the `promzard` function, but the EventEmitter that makes it +all happen. Emits either a `data` event with the data, or a `error` +event if it blows up. + +If `error` is emitted, then `data` never will be. + +### prompt(...) + +In the promzard input module, you can call the `prompt` function. +This prompts the user to input some data. The arguments are interpreted +based on type: + +1. `string` The first string encountered is the prompt. The second is + the default value. +2. `function` A transformer function which receives the data and returns + something else. More than meets the eye. +3. `object` The `prompt` member is the prompt, the `default` member is + the default value, and the `transform` is the transformer. + +Whatever the final value is, that's what will be put on the resulting +object. + +### Functions + +If there are any functions on the promzard input module's exports, then +promzard will call each of them with a callback. This way, your module +can do asynchronous actions if necessary to validate or ascertain +whatever needs verification. + +The functions are called in the context of the ctx object, and are given +a single argument, which is a callback that should be called with either +an error, or the result to assign to that spot. + +In the async function, you can also call prompt() and return the result +of the prompt in the callback. + +For example, this works fine in a promzard module: + +``` +exports.asyncPrompt = function (cb) { + fs.stat(someFile, function (er, st) { + // if there's an error, no prompt, just error + // otherwise prompt and use the actual file size as the default + cb(er, prompt('file size', st.size)) + }) +} +``` + +You can also return other async functions in the async function +callback. Though that's a bit silly, it could be a handy way to reuse +functionality in some cases. + +### Sync vs Async + +The `prompt()` function is not synchronous, though it appears that way. +It just returns a token that is swapped out when the data object is +walked over asynchronously later, and returns a token. + +For that reason, prompt() calls whose results don't end up on the data +object are never shown to the user. For example, this will only prompt +once: + +``` +exports.promptThreeTimes = prompt('prompt me once', 'shame on you') +exports.promptThreeTimes = prompt('prompt me twice', 'um....') +exports.promptThreeTimes = prompt('you cant prompt me again') +``` + +### Isn't this exactly the sort of 'looks sync' that you said was bad about other libraries? + +Yeah, sorta. I wouldn't use promzard for anything more complicated than +a wizard that spits out prompts to set up a config file or something. +Maybe there are other use cases I haven't considered. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/example/buffer.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/example/buffer.js new file mode 100644 index 00000000..828f9d1d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/example/buffer.js @@ -0,0 +1,12 @@ +var pz = require('../promzard') + +var path = require('path') +var file = path.resolve(__dirname, 'substack-input.js') +var buf = require('fs').readFileSync(file) +var ctx = { basename: path.basename(path.dirname(file)) } + +pz.fromBuffer(buf, ctx, function (er, res) { + if (er) + throw er + console.error(JSON.stringify(res, null, 2)) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/example/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/example/index.js new file mode 100644 index 00000000..435131f3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/example/index.js @@ -0,0 +1,11 @@ +var pz = require('../promzard') + +var path = require('path') +var file = path.resolve(__dirname, 'substack-input.js') +var ctx = { basename: path.basename(path.dirname(file)) } + +pz(file, ctx, function (er, res) { + if (er) + throw er + console.error(JSON.stringify(res, null, 2)) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/example/npm-init/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/example/npm-init/README.md new file mode 100644 index 00000000..46e5592c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/example/npm-init/README.md @@ -0,0 +1,8 @@ +# npm-init + +An initter you init wit, innit? + +## More stuff here + +Blerp derp herp lerg borgle pop munch efemerate baz foo a gandt synergy +jorka chatt slurm. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/example/npm-init/init-input.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/example/npm-init/init-input.js new file mode 100644 index 00000000..ba7781b3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/example/npm-init/init-input.js @@ -0,0 +1,191 @@ +var fs = require('fs') +var path = require('path'); + +module.exports = { + "name" : prompt('name', + typeof name === 'undefined' + ? basename.replace(/^node-|[.-]js$/g, ''): name), + "version" : prompt('version', typeof version !== "undefined" + ? version : '0.0.0'), + "description" : (function () { + if (typeof description !== 'undefined' && description) { + return description + } + var value; + try { + var src = fs.readFileSync('README.md', 'utf8'); + value = src.split('\n').filter(function (line) { + return /\s+/.test(line) + && line.trim() !== basename.replace(/^node-/, '') + && !line.trim().match(/^#/) + ; + })[0] + .trim() + .replace(/^./, function (c) { return c.toLowerCase() }) + .replace(/\.$/, '') + ; + } + catch (e) { + try { + // Wouldn't it be nice if that file mattered? + var d = fs.readFileSync('.git/description', 'utf8') + } catch (e) {} + if (d.trim() && !value) value = d + } + return prompt('description', value); + })(), + "main" : (function () { + var f + try { + f = fs.readdirSync(dirname).filter(function (f) { + return f.match(/\.js$/) + }) + if (f.indexOf('index.js') !== -1) + f = 'index.js' + else if (f.indexOf('main.js') !== -1) + f = 'main.js' + else if (f.indexOf(basename + '.js') !== -1) + f = basename + '.js' + else + f = f[0] + } catch (e) {} + + return prompt('entry point', f || 'index.js') + })(), + "bin" : function (cb) { + fs.readdir(dirname + '/bin', function (er, d) { + // no bins + if (er) return cb() + // just take the first js file we find there, or nada + return cb(null, d.filter(function (f) { + return f.match(/\.js$/) + })[0]) + }) + }, + "directories" : function (cb) { + fs.readdir('.', function (er, dirs) { + if (er) return cb(er) + var res = {} + dirs.forEach(function (d) { + switch (d) { + case 'example': case 'examples': return res.example = d + case 'test': case 'tests': return res.test = d + case 'doc': case 'docs': return res.doc = d + case 'man': return res.man = d + } + }) + if (Object.keys(res).length === 0) res = undefined + return cb(null, res) + }) + }, + "dependencies" : typeof dependencies !== 'undefined' ? dependencies + : function (cb) { + fs.readdir('node_modules', function (er, dir) { + if (er) return cb() + var deps = {} + var n = dir.length + dir.forEach(function (d) { + if (d.match(/^\./)) return next() + if (d.match(/^(expresso|mocha|tap|coffee-script|coco|streamline)$/)) + return next() + fs.readFile('node_modules/' + d + '/package.json', function (er, p) { + if (er) return next() + try { p = JSON.parse(p) } catch (e) { return next() } + if (!p.version) return next() + deps[d] = '~' + p.version + return next() + }) + }) + function next () { + if (--n === 0) return cb(null, deps) + } + }) + }, + "devDependencies" : typeof devDependencies !== 'undefined' ? devDependencies + : function (cb) { + // same as dependencies but for dev deps + fs.readdir('node_modules', function (er, dir) { + if (er) return cb() + var deps = {} + var n = dir.length + dir.forEach(function (d) { + if (d.match(/^\./)) return next() + if (!d.match(/^(expresso|mocha|tap|coffee-script|coco|streamline)$/)) + return next() + fs.readFile('node_modules/' + d + '/package.json', function (er, p) { + if (er) return next() + try { p = JSON.parse(p) } catch (e) { return next() } + if (!p.version) return next() + deps[d] = '~' + p.version + return next() + }) + }) + function next () { + if (--n === 0) return cb(null, deps) + } + }) + }, + "scripts" : (function () { + // check to see what framework is in use, if any + try { var d = fs.readdirSync('node_modules') } + catch (e) { d = [] } + var s = typeof scripts === 'undefined' ? {} : scripts + + if (d.indexOf('coffee-script') !== -1) + s.prepublish = prompt('build command', + s.prepublish || 'coffee src/*.coffee -o lib') + + var notest = 'echo "Error: no test specified" && exit 1' + function tx (test) { + return test || notest + } + + if (!s.test || s.test === notest) { + if (d.indexOf('tap') !== -1) + s.test = prompt('test command', 'tap test/*.js', tx) + else if (d.indexOf('expresso') !== -1) + s.test = prompt('test command', 'expresso test', tx) + else if (d.indexOf('mocha') !== -1) + s.test = prompt('test command', 'mocha', tx) + else + s.test = prompt('test command', tx) + } + + return s + + })(), + + "repository" : (function () { + try { var gconf = fs.readFileSync('.git/config') } + catch (e) { gconf = null } + if (gconf) { + gconf = gconf.split(/\r?\n/) + var i = gconf.indexOf('[remote "origin"]') + if (i !== -1) { + var u = gconf[i + 1] + if (!u.match(/^\s*url =/)) u = gconf[i + 2] + if (!u.match(/^\s*url =/)) u = null + else u = u.replace(/^\s*url = /, '') + } + if (u && u.match(/^git@github.com:/)) + u = u.replace(/^git@github.com:/, 'git://github.com/') + } + + return prompt('git repository', u) + })(), + + "keywords" : prompt(function (s) { + if (!s) return undefined + if (Array.isArray(s)) s = s.join(' ') + if (typeof s !== 'string') return s + return s.split(/[\s,]+/) + }), + "author" : config['init.author.name'] + ? { + "name" : config['init.author.name'], + "email" : config['init.author.email'], + "url" : config['init.author.url'] + } + : undefined, + "license" : prompt('license', 'BSD') +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/example/npm-init/init.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/example/npm-init/init.js new file mode 100644 index 00000000..09484cd1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/example/npm-init/init.js @@ -0,0 +1,37 @@ +var PZ = require('../../promzard').PromZard +var path = require('path') +var input = path.resolve(__dirname, 'init-input.js') + +var fs = require('fs') +var package = path.resolve(__dirname, 'package.json') +var pkg + +fs.readFile(package, 'utf8', function (er, d) { + if (er) ctx = {} + try { ctx = JSON.parse(d); pkg = JSON.parse(d) } + catch (e) { ctx = {} } + + ctx.dirname = path.dirname(package) + ctx.basename = path.basename(ctx.dirname) + if (!ctx.version) ctx.version = undefined + + // this should be replaced with the npm conf object + ctx.config = {} + + console.error('ctx=', ctx) + + var pz = new PZ(input, ctx) + + pz.on('data', function (data) { + console.error('pz data', data) + if (!pkg) pkg = {} + Object.keys(data).forEach(function (k) { + if (data[k] !== undefined && data[k] !== null) pkg[k] = data[k] + }) + console.error('package data %s', JSON.stringify(data, null, 2)) + fs.writeFile(package, JSON.stringify(pkg, null, 2), function (er) { + if (er) throw er + console.log('ok') + }) + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/example/npm-init/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/example/npm-init/package.json new file mode 100644 index 00000000..89c6d1fb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/example/npm-init/package.json @@ -0,0 +1,10 @@ +{ + "name": "npm-init", + "version": "0.0.0", + "description": "an initter you init wit, innit?", + "main": "index.js", + "scripts": { + "test": "asdf" + }, + "license": "BSD" +} \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/example/substack-input.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/example/substack-input.js new file mode 100644 index 00000000..bf7aedb8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/example/substack-input.js @@ -0,0 +1,61 @@ +module.exports = { + "name" : basename.replace(/^node-/, ''), + "version" : "0.0.0", + "description" : (function (cb) { + var fs = require('fs'); + var value; + try { + var src = fs.readFileSync('README.markdown', 'utf8'); + value = src.split('\n').filter(function (line) { + return /\s+/.test(line) + && line.trim() !== basename.replace(/^node-/, '') + ; + })[0] + .trim() + .replace(/^./, function (c) { return c.toLowerCase() }) + .replace(/\.$/, '') + ; + } + catch (e) {} + + return prompt('description', value); + })(), + "main" : prompt('entry point', 'index.js'), + "bin" : function (cb) { + var path = require('path'); + var fs = require('fs'); + var exists = fs.exists || path.exists; + exists('bin/cmd.js', function (ex) { + var bin + if (ex) { + var bin = {} + bin[basename.replace(/^node-/, '')] = 'bin/cmd.js' + } + cb(null, bin); + }); + }, + "directories" : { + "example" : "example", + "test" : "test" + }, + "dependencies" : {}, + "devDependencies" : { + "tap" : "~0.2.5" + }, + "scripts" : { + "test" : "tap test/*.js" + }, + "repository" : { + "type" : "git", + "url" : "git://github.com/substack/" + basename + ".git" + }, + "homepage" : "https://github.com/substack/" + basename, + "keywords" : prompt(function (s) { return s.split(/\s+/) }), + "author" : { + "name" : "James Halliday", + "email" : "mail@substack.net", + "url" : "http://substack.net" + }, + "license" : "MIT", + "engine" : { "node" : ">=0.6" } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/package.json new file mode 100644 index 00000000..a90ea7fd --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/package.json @@ -0,0 +1,50 @@ +{ + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "name": "promzard", + "description": "prompting wizardly", + "version": "0.3.0", + "repository": { + "url": "git://github.com/isaacs/promzard" + }, + "dependencies": { + "read": "1" + }, + "devDependencies": { + "tap": "~0.2.5" + }, + "main": "promzard.js", + "scripts": { + "test": "tap test/*.js" + }, + "license": "ISC", + "gitHead": "780ead051299aa28be2584199ab6fa503a32d354", + "bugs": { + "url": "https://github.com/isaacs/promzard/issues" + }, + "homepage": "https://github.com/isaacs/promzard", + "_id": "promzard@0.3.0", + "_shasum": "26a5d6ee8c7dee4cb12208305acfb93ba382a9ee", + "_from": "promzard@>=0.3.0 <0.4.0", + "_npmVersion": "2.7.1", + "_nodeVersion": "1.4.2", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "dist": { + "shasum": "26a5d6ee8c7dee4cb12208305acfb93ba382a9ee", + "tarball": "https://registry.npmjs.org/promzard/-/promzard-0.3.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/promzard/-/promzard-0.3.0.tgz" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/promzard.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/promzard.js new file mode 100644 index 00000000..da1abca9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/promzard.js @@ -0,0 +1,238 @@ +module.exports = promzard +promzard.PromZard = PromZard + +var fs = require('fs') +var vm = require('vm') +var util = require('util') +var files = {} +var crypto = require('crypto') +var EventEmitter = require('events').EventEmitter +var read = require('read') + +var Module = require('module').Module +var path = require('path') + +function promzard (file, ctx, cb) { + if (typeof ctx === 'function') cb = ctx, ctx = null; + if (!ctx) ctx = {}; + var pz = new PromZard(file, ctx) + pz.on('error', cb) + pz.on('data', function (data) { + cb(null, data) + }) +} +promzard.fromBuffer = function (buf, ctx, cb) { + var filename = 0 + do { + filename = '\0' + Math.random(); + } while (files[filename]) + files[filename] = buf + var ret = promzard(filename, ctx, cb) + delete files[filename] + return ret +} + +function PromZard (file, ctx) { + if (!(this instanceof PromZard)) + return new PromZard(file, ctx) + EventEmitter.call(this) + this.file = file + this.ctx = ctx + this.unique = crypto.randomBytes(8).toString('hex') + this.load() +} + +PromZard.prototype = Object.create( + EventEmitter.prototype, + { constructor: { + value: PromZard, + readable: true, + configurable: true, + writable: true, + enumerable: false } } ) + +PromZard.prototype.load = function () { + if (files[this.file]) + return this.loaded() + + fs.readFile(this.file, 'utf8', function (er, d) { + if (er && this.backupFile) { + this.file = this.backupFile + delete this.backupFile + return this.load() + } + if (er) + return this.emit('error', this.error = er) + files[this.file] = d + this.loaded() + }.bind(this)) +} + +PromZard.prototype.loaded = function () { + this.ctx.prompt = this.makePrompt() + this.ctx.__filename = this.file + this.ctx.__dirname = path.dirname(this.file) + this.ctx.__basename = path.basename(this.file) + var mod = this.ctx.module = this.makeModule() + this.ctx.require = function (path) { + return mod.require(path) + } + this.ctx.require.resolve = function(path) { + return Module._resolveFilename(path, mod); + } + this.ctx.exports = mod.exports + + this.script = this.wrap(files[this.file]) + var fn = vm.runInThisContext(this.script, this.file) + var args = Object.keys(this.ctx).map(function (k) { + return this.ctx[k] + }.bind(this)) + try { var res = fn.apply(this.ctx, args) } + catch (er) { this.emit('error', er) } + if (res && + typeof res === 'object' && + exports === mod.exports && + Object.keys(exports).length === 1) { + this.result = res + } else { + this.result = mod.exports + } + this.walk() +} + +PromZard.prototype.makeModule = function () { + var mod = new Module(this.file, module) + mod.loaded = true + mod.filename = this.file + mod.id = this.file + mod.paths = Module._nodeModulePaths(path.dirname(this.file)) + return mod +} + +PromZard.prototype.wrap = function (body) { + var s = '(function( %s ) { %s\n })' + var args = Object.keys(this.ctx).join(', ') + return util.format(s, args, body) +} + +PromZard.prototype.makePrompt = function () { + this.prompts = [] + return prompt.bind(this) + function prompt () { + var p, d, t + for (var i = 0; i < arguments.length; i++) { + var a = arguments[i] + if (typeof a === 'string' && p) + d = a + else if (typeof a === 'string') + p = a + else if (typeof a === 'function') + t = a + else if (a && typeof a === 'object') { + p = a.prompt || p + d = a.default || d + t = a.transform || t + } + } + + try { return this.unique + '-' + this.prompts.length } + finally { this.prompts.push([p, d, t]) } + } +} + +PromZard.prototype.walk = function (o, cb) { + o = o || this.result + cb = cb || function (er, res) { + if (er) + return this.emit('error', this.error = er) + this.result = res + return this.emit('data', res) + } + cb = cb.bind(this) + var keys = Object.keys(o) + var i = 0 + var len = keys.length + + L.call(this) + function L () { + if (this.error) + return + while (i < len) { + var k = keys[i] + var v = o[k] + i++ + + if (v && typeof v === 'object') { + return this.walk(v, function (er, res) { + if (er) return cb(er) + o[k] = res + L.call(this) + }.bind(this)) + } else if (v && + typeof v === 'string' && + v.indexOf(this.unique) === 0) { + var n = +v.substr(this.unique.length + 1) + var prompt = this.prompts[n] + if (isNaN(n) || !prompt) + continue + + // default to the key + if (undefined === prompt[0]) + prompt[0] = k + + // default to the ctx value, if there is one + if (undefined === prompt[1]) + prompt[1] = this.ctx[k] + + return this.prompt(prompt, function (er, res) { + if (er) { + if (!er.notValid) { + return this.emit('error', this.error = er); + } + console.log(er.message) + i -- + return L.call(this) + } + o[k] = res + L.call(this) + }.bind(this)) + } else if (typeof v === 'function') { + try { return v.call(this.ctx, function (er, res) { + if (er) + return this.emit('error', this.error = er) + o[k] = res + // back up so that we process this one again. + // this is because it might return a prompt() call in the cb. + i -- + L.call(this) + }.bind(this)) } + catch (er) { this.emit('error', er) } + } + } + // made it to the end of the loop, maybe + if (i >= len) + return cb(null, o) + } +} + +PromZard.prototype.prompt = function (pdt, cb) { + var prompt = pdt[0] + var def = pdt[1] + var tx = pdt[2] + + if (tx) { + cb = function (cb) { return function (er, data) { + try { + var res = tx(data) + if (!er && res instanceof Error && !!res.notValid) { + return cb(res, null) + } + return cb(er, res) + } + catch (er) { this.emit('error', er) } + }}(cb).bind(this) + } + + read({ prompt: prompt + ':' , default: def }, cb) +} + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/test/basic.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/test/basic.js new file mode 100644 index 00000000..ad1c92df --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/test/basic.js @@ -0,0 +1,91 @@ +var tap = require('tap') +var pz = require('../promzard.js') +var spawn = require('child_process').spawn + +tap.test('run the example', function (t) { + + var example = require.resolve('../example/index.js') + var node = process.execPath + + var expect = { + "name": "example", + "version": "0.0.0", + "description": "testing description", + "main": "test-entry.js", + "directories": { + "example": "example", + "test": "test" + }, + "dependencies": {}, + "devDependencies": { + "tap": "~0.2.5" + }, + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/substack/example.git" + }, + "homepage": "https://github.com/substack/example", + "keywords": [ + "fugazi", + "function", + "waiting", + "room" + ], + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "license": "MIT", + "engine": { + "node": ">=0.6" + } + } + + console.error('%s %s', node, example) + var c = spawn(node, [example], { customFds: [-1,-1,-1] }) + var output = '' + c.stdout.on('data', function (d) { + output += d + respond() + }) + + var actual = '' + c.stderr.on('data', function (d) { + actual += d + }) + + function respond () { + console.error('respond', output) + if (output.match(/description: $/)) { + c.stdin.write('testing description\n') + return + } + if (output.match(/entry point: \(index\.js\) $/)) { + c.stdin.write('test-entry.js\n') + return + } + if (output.match(/keywords: $/)) { + c.stdin.write('fugazi function waiting room\n') + // "read" module is weird on node >= 0.10 when not a TTY + // requires explicit ending for reasons. + // could dig in, but really just wanna make tests pass, whatever. + c.stdin.end() + return + } + } + + c.on('exit', function () { + console.error('exit event') + }) + + c.on('close', function () { + console.error('actual', actual) + actual = JSON.parse(actual) + t.deepEqual(actual, expect) + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/test/buffer.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/test/buffer.js new file mode 100644 index 00000000..e1d240e2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/test/buffer.js @@ -0,0 +1,84 @@ +var tap = require('tap') +var pz = require('../promzard.js') +var spawn = require('child_process').spawn + +tap.test('run the example using a buffer', function (t) { + + var example = require.resolve('../example/buffer.js') + var node = process.execPath + + var expect = { + "name": "example", + "version": "0.0.0", + "description": "testing description", + "main": "test-entry.js", + "directories": { + "example": "example", + "test": "test" + }, + "dependencies": {}, + "devDependencies": { + "tap": "~0.2.5" + }, + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/substack/example.git" + }, + "homepage": "https://github.com/substack/example", + "keywords": [ + "fugazi", + "function", + "waiting", + "room" + ], + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "license": "MIT", + "engine": { + "node": ">=0.6" + } + } + + var c = spawn(node, [example], { customFds: [-1,-1,-1] }) + var output = '' + c.stdout.on('data', function (d) { + output += d + respond() + }) + + var actual = '' + c.stderr.on('data', function (d) { + actual += d + }) + + function respond () { + if (output.match(/description: $/)) { + c.stdin.write('testing description\n') + return + } + if (output.match(/entry point: \(index\.js\) $/)) { + c.stdin.write('test-entry.js\n') + return + } + if (output.match(/keywords: $/)) { + c.stdin.write('fugazi function waiting room\n') + // "read" module is weird on node >= 0.10 when not a TTY + // requires explicit ending for reasons. + // could dig in, but really just wanna make tests pass, whatever. + c.stdin.end() + return + } + } + + c.on('close', function () { + actual = JSON.parse(actual) + t.deepEqual(actual, expect) + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/test/exports.input b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/test/exports.input new file mode 100644 index 00000000..061cbfe1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/test/exports.input @@ -0,0 +1,5 @@ +exports.a = 1 + 2 +exports.b = prompt('To be or not to be?', '!2b') +exports.c = {} +exports.c.x = prompt() +exports.c.y = tmpdir + "/y/file.txt" diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/test/exports.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/test/exports.js new file mode 100644 index 00000000..c17993a4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/test/exports.js @@ -0,0 +1,48 @@ +var test = require('tap').test; +var promzard = require('../'); + +if (process.argv[2] === 'child') { + return child() +} + +test('exports', function (t) { + t.plan(1); + + var spawn = require('child_process').spawn + var child = spawn(process.execPath, [__filename, 'child']) + + var output = '' + child.stderr.on('data', function (c) { + output += c + }) + + setTimeout(function () { + child.stdin.write('\n'); + }, 100) + setTimeout(function () { + child.stdin.end('55\n'); + }, 200) + + child.on('close', function () { + console.error('output=%j', output) + output = JSON.parse(output) + t.same({ + a : 3, + b : '!2b', + c : { + x : 55, + y : '/tmp/y/file.txt', + } + }, output); + t.end() + }) +}); + +function child () { + var ctx = { tmpdir : '/tmp' } + var file = __dirname + '/exports.input'; + + promzard(file, ctx, function (err, output) { + console.error(JSON.stringify(output)) + }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/test/fn.input b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/test/fn.input new file mode 100644 index 00000000..ed6c3f1c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/test/fn.input @@ -0,0 +1,18 @@ +var fs = require('fs') + +module.exports = { + "a": 1 + 2, + "b": prompt('To be or not to be?', '!2b', function (s) { + return s.toUpperCase() + '...' + }), + "c": { + "x": prompt(function (x) { return x * 100 }), + "y": tmpdir + "/y/file.txt" + }, + a_function: function (cb) { + fs.readFile(__filename, 'utf8', cb) + }, + asyncPrompt: function (cb) { + return cb(null, prompt('a prompt at any other time would smell as sweet')) + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/test/fn.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/test/fn.js new file mode 100644 index 00000000..899ebedb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/test/fn.js @@ -0,0 +1,56 @@ +var test = require('tap').test; +var promzard = require('../'); +var fs = require('fs') +var file = __dirname + '/fn.input'; + +var expect = { + a : 3, + b : '!2B...', + c : { + x : 5500, + y : '/tmp/y/file.txt', + } +} +expect.a_function = fs.readFileSync(file, 'utf8') +expect.asyncPrompt = 'async prompt' + +if (process.argv[2] === 'child') { + return child() +} + +test('prompt callback param', function (t) { + t.plan(1); + + var spawn = require('child_process').spawn + var child = spawn(process.execPath, [__filename, 'child']) + + var output = '' + child.stderr.on('data', function (c) { + output += c + }) + + child.on('close', function () { + console.error('output=%j', output) + output = JSON.parse(output) + t.same(output, expect); + t.end() + }) + + setTimeout(function () { + child.stdin.write('\n') + }, 100) + setTimeout(function () { + child.stdin.write('55\n') + }, 150) + setTimeout(function () { + child.stdin.end('async prompt\n') + }, 200) +}) + +function child () { + var ctx = { tmpdir : '/tmp' } + var file = __dirname + '/fn.input'; + promzard(file, ctx, function (err, output) { + console.error(JSON.stringify(output)) + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/test/simple.input b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/test/simple.input new file mode 100644 index 00000000..e49def64 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/test/simple.input @@ -0,0 +1,8 @@ +module.exports = { + "a": 1 + 2, + "b": prompt('To be or not to be?', '!2b'), + "c": { + "x": prompt(), + "y": tmpdir + "/y/file.txt" + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/test/simple.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/test/simple.js new file mode 100644 index 00000000..034a8647 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/test/simple.js @@ -0,0 +1,30 @@ +var test = require('tap').test; +var promzard = require('../'); + +test('simple', function (t) { + t.plan(1); + + var ctx = { tmpdir : '/tmp' } + var file = __dirname + '/simple.input'; + promzard(file, ctx, function (err, output) { + t.same( + { + a : 3, + b : '!2b', + c : { + x : 55, + y : '/tmp/y/file.txt', + } + }, + output + ); + }); + + setTimeout(function () { + process.stdin.emit('data', '\n'); + }, 100); + + setTimeout(function () { + process.stdin.emit('data', '55\n'); + }, 200); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/test/validate.input b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/test/validate.input new file mode 100644 index 00000000..839c0652 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/test/validate.input @@ -0,0 +1,8 @@ +module.exports = { + "name": prompt("name", function (data) { + if (data === 'cool') return data + var er = new Error('not cool') + er.notValid = true + return er + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/test/validate.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/test/validate.js new file mode 100644 index 00000000..a1206814 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/node_modules/promzard/test/validate.js @@ -0,0 +1,20 @@ + +var promzard = require('../') +var test = require('tap').test + +test('validate', function (t) { + t.plan(2) + var ctx = { tmpdir : '/tmp' } + var file = __dirname + '/validate.input' + promzard(file, ctx, function (er, found) { + t.ok(!er) + var wanted = { name: 'cool' } + t.same(found, wanted) + }) + setTimeout(function () { + process.stdin.emit('data', 'not cool\n') + }, 100) + setTimeout(function () { + process.stdin.emit('data', 'cool\n') + }, 200) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/package.json new file mode 100644 index 00000000..06ba9600 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/package.json @@ -0,0 +1,86 @@ +{ + "name": "init-package-json", + "version": "1.9.4", + "main": "init-package-json.js", + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/init-package-json.git" + }, + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "ISC", + "description": "A node module to get your node module started", + "dependencies": { + "glob": "^6.0.0", + "npm-package-arg": "^4.0.0", + "promzard": "^0.3.0", + "read": "~1.0.1", + "read-package-json": "1 || 2", + "semver": "2.x || 3.x || 4 || 5", + "validate-npm-package-license": "^3.0.1", + "validate-npm-package-name": "^2.0.1" + }, + "devDependencies": { + "npm": "^2", + "rimraf": "^2.1.4", + "tap": "^1.2.0" + }, + "keywords": [ + "init", + "package.json", + "package", + "helper", + "wizard", + "wizerd", + "prompt", + "start" + ], + "gitHead": "3c34250fa58507056a94f3940ee2a28540f83592", + "bugs": { + "url": "https://github.com/npm/init-package-json/issues" + }, + "homepage": "https://github.com/npm/init-package-json#readme", + "_id": "init-package-json@1.9.4", + "_shasum": "b4053d0b40f0cf842a41966937cb3dc0f534e856", + "_from": "init-package-json@>=1.9.4 <1.10.0", + "_npmVersion": "3.9.1", + "_nodeVersion": "5.10.1", + "_npmUser": { + "name": "zkat", + "email": "kat@sykosomatic.org" + }, + "dist": { + "shasum": "b4053d0b40f0cf842a41966937cb3dc0f534e856", + "tarball": "https://registry.npmjs.org/init-package-json/-/init-package-json-1.9.4.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "iarna", + "email": "me@re-becca.org" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" + } + ], + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/init-package-json-1.9.4.tgz_1463610982259_0.011722659226506948" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-1.9.4.tgz" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/test/basic.input b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/test/basic.input new file mode 100644 index 00000000..ca309e92 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/test/basic.input @@ -0,0 +1,15 @@ +var assert = require('assert') + +exports.name = prompt('name', package.name || basename) +exports.version = '1.2.5' +exports.description = prompt('description', package.description) +exports.author = 'npmbot (http://npm.im)' +exports.scripts = package.scripts || {} +exports.scripts.test = 'make test' +exports.main = package.main || 'main.js' +exports.config = JSON.parse(JSON.stringify(config)) +try {delete exports.config.config}catch(e){} +try {delete exports.package.config}catch(e){} +try {delete exports.package.package}catch(e){} +try {delete exports.config.package}catch(e){} +exports.package = JSON.parse(JSON.stringify(package)) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/test/basic.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/test/basic.js new file mode 100644 index 00000000..d67e0c3b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/test/basic.js @@ -0,0 +1,35 @@ +var common = require('./lib/common') +var init = require('../') +var path = require('path') +var rimraf = require('rimraf') +var test = require('tap').test + +test('the basics', function (t) { + var i = path.join(__dirname, 'basic.input') + rimraf.sync(__dirname + '/package.json') + init(__dirname, i, { foo: 'bar' }, function (er, data) { + if (er) throw er + var expect = { + name: 'the-name', + version: '1.2.5', + description: 'description', + author: 'npmbot (http://npm.im)', + scripts: { test: 'make test' }, + main: 'main.js', + config: { foo: 'bar' }, + package: {} + } + console.log('') + t.same(data, expect) + t.end() + }) + common.drive([ + 'the-name\n', + 'description\n', + 'yes\n' + ]) +}) + +test('teardown', function (t) { + rimraf(__dirname + '/package.json', t.end.bind(t)) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/test/lib/common.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/test/lib/common.js new file mode 100644 index 00000000..de45089f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/test/lib/common.js @@ -0,0 +1,24 @@ +module.exports.drive = drive + +var semver = require('semver') + +function drive (input) { + var stdin = process.stdin + function emit (chunk, ms) { + setTimeout(function () { + stdin.emit('data', chunk) + }, ms) + } + if (semver.gte(process.versions.node, '0.11.0')) { + input.forEach(function (chunk) { + stdin.push(chunk) + }) + } else { + stdin.once('readable', function () { + var ms = 0 + input.forEach(function (chunk) { + emit(chunk, ms += 50) + }) + }) + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/test/license.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/test/license.js new file mode 100644 index 00000000..8d8ae93d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/test/license.js @@ -0,0 +1,41 @@ +var test = require('tap').test +var init = require('../') +var rimraf = require('rimraf') +var common = require('./lib/common') + +test('license', function (t) { + init(__dirname, '', {}, function (er, data) { + if (er) + throw er + + var wanted = { + name: 'the-name', + version: '1.0.0', + description: '', + scripts: { test: 'echo "Error: no test specified" && exit 1' }, + license: 'Apache-2.0', + author: '', + main: 'basic.js' + } + console.log('') + t.has(data, wanted) + t.end() + }) + common.drive([ + 'the-name\n', + '\n', + '\n', + '\n', + '\n', + '\n', + '\n', + '\n', + 'Apache\n', + 'Apache-2.0\n', + 'yes\n' + ]) +}) + +test('teardown', function (t) { + rimraf(__dirname + '/package.json', t.end.bind(t)) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/test/name-spaces.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/test/name-spaces.js new file mode 100644 index 00000000..a395afb9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/test/name-spaces.js @@ -0,0 +1,41 @@ +var test = require('tap').test +var init = require('../') +var rimraf = require('rimraf') +var common = require('./lib/common') + +test('spaces', function (t) { + rimraf.sync(__dirname + '/package.json') + init(__dirname, '', {}, function (er, data) { + if (er) + throw er + var wanted = { + name: 'the-name', + version: '1.0.0', + description: '', + scripts: { test: 'echo "Error: no test specified" && exit 1' }, + license: 'ISC', + author: '', + main: 'basic.js' + } + console.log('') + t.has(data, wanted) + t.end() + }) + common.drive([ + 'the name\n', + 'the-name\n', + '\n', + '\n', + '\n', + '\n', + '\n', + '\n', + '\n', + '\n', + 'yes\n' + ]) +}) + +test('teardown', function (t) { + rimraf(__dirname + '/package.json', t.end.bind(t)) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/test/name-uppercase.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/test/name-uppercase.js new file mode 100644 index 00000000..d1623260 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/test/name-uppercase.js @@ -0,0 +1,41 @@ +var test = require('tap').test +var init = require('../') +var rimraf = require('rimraf') +var common = require('./lib/common') + +test('uppercase', function (t) { + init(__dirname, '', {}, function (er, data) { + if (er) + throw er + + var wanted = { + name: 'the-name', + version: '1.0.0', + description: '', + scripts: { test: 'echo "Error: no test specified" && exit 1' }, + license: 'ISC', + author: '', + main: 'basic.js' + } + console.log('') + t.has(data, wanted) + t.end() + }) + common.drive([ + 'THE-NAME\n', + 'the-name\n', + '\n', + '\n', + '\n', + '\n', + '\n', + '\n', + '\n', + '\n', + 'yes\n' + ]) +}) + +test('teardown', function (t) { + rimraf(__dirname + '/package.json', t.end.bind(t)) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/test/npm-defaults.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/test/npm-defaults.js new file mode 100644 index 00000000..292b9623 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/test/npm-defaults.js @@ -0,0 +1,109 @@ +var test = require('tap').test +var rimraf = require('rimraf') +var resolve = require('path').resolve + +var npm = require('npm') +var init = require('../') + +var EXPECTED = { + name: 'test', + version: '3.1.4', + description: '', + main: 'basic.js', + scripts: { + test: 'echo "Error: no test specified" && exit 1' + }, + keywords: [], + author: 'npmbot (http://npm.im/)', + license: 'WTFPL' +} + +test('npm configuration values pulled from environment', function (t) { + /*eslint camelcase:0 */ + process.env.npm_config_yes = 'yes' + + process.env.npm_config_init_author_name = 'npmbot' + process.env.npm_config_init_author_email = 'n@p.m' + process.env.npm_config_init_author_url = 'http://npm.im' + + process.env.npm_config_init_license = EXPECTED.license + process.env.npm_config_init_version = EXPECTED.version + + npm.load({}, function (err) { + t.ifError(err, 'npm loaded successfully') + + // clear out dotted names from test environment + npm.config.del('init.author.name') + npm.config.del('init.author.email') + npm.config.del('init.author.url') + // the following have npm defaults, and need to be explicitly overridden + npm.config.set('init.license', '') + npm.config.set('init.version', '') + + process.chdir(resolve(__dirname)) + init(__dirname, __dirname, npm.config, function (er, data) { + t.ifError(err, 'init ran successfully') + + t.same(data, EXPECTED, 'got the package data from the environment') + t.end() + }) + }) +}) + +test('npm configuration values pulled from dotted config', function (t) { + /*eslint camelcase:0 */ + var config = { + yes: 'yes', + + 'init.author.name': 'npmbot', + 'init.author.email': 'n@p.m', + 'init.author.url': 'http://npm.im', + + 'init.license': EXPECTED.license, + 'init.version': EXPECTED.version + } + + npm.load(config, function (err) { + t.ifError(err, 'npm loaded successfully') + + process.chdir(resolve(__dirname)) + init(__dirname, __dirname, npm.config, function (er, data) { + t.ifError(err, 'init ran successfully') + + t.same(data, EXPECTED, 'got the package data from the config') + t.end() + }) + }) +}) + +test('npm configuration values pulled from dashed config', function (t) { + /*eslint camelcase:0 */ + var config = { + yes: 'yes', + + 'init-author-name': 'npmbot', + 'init-author-email': 'n@p.m', + 'init-author-url': 'http://npm.im', + + 'init-license': EXPECTED.license, + 'init-version': EXPECTED.version + } + + npm.load(config, function (err) { + t.ifError(err, 'npm loaded successfully') + + process.chdir(resolve(__dirname)) + init(__dirname, __dirname, npm.config, function (er, data) { + t.ifError(err, 'init ran successfully') + + t.same(data, EXPECTED, 'got the package data from the config') + t.end() + }) + }) +}) + +test('cleanup', function (t) { + rimraf.sync(resolve(__dirname, 'package.json')) + t.pass('cleaned up') + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/test/scope-in-config-existing-name.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/test/scope-in-config-existing-name.js new file mode 100644 index 00000000..39dc90f4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/test/scope-in-config-existing-name.js @@ -0,0 +1,30 @@ +var fs = require('fs') +var path = require('path') + +var rimraf = require('rimraf') +var tap = require('tap') + +var init = require('../') + +var json = { + name: '@already/scoped', + version: '1.0.0' +} + +tap.test('with existing package.json', function (t) { + fs.writeFileSync(path.join(__dirname, 'package.json'), JSON.stringify(json, null, 2)) + console.log(fs.readFileSync(path.join(__dirname, 'package.json'), 'utf8')) + console.error('wrote json', json) + init(__dirname, __dirname, { yes: 'yes', scope: '@still' }, function (er, data) { + if (er) throw er + + console.log('') + t.equal(data.name, '@still/scoped', 'new scope is added, basic name is kept') + t.end() + }) +}) + +tap.test('teardown', function (t) { + rimraf.sync(path.join(__dirname, 'package.json')) + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/test/scope-in-config.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/test/scope-in-config.js new file mode 100644 index 00000000..32bba16e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/test/scope-in-config.js @@ -0,0 +1,33 @@ +var fs = require('fs') +var path = require('path') + +var rimraf = require('rimraf') +var tap = require('tap') + +var init = require('../') + +var EXPECT = { + name: '@scoped/test', + version: '1.0.0', + description: '', + author: '', + scripts: { test: 'echo \"Error: no test specified\" && exit 1' }, + main: 'basic.js', + keywords: [], + license: 'ISC' +} + +tap.test('--yes with scope', function (t) { + init(__dirname, __dirname, { yes: 'yes', scope: '@scoped' }, function (er, data) { + if (er) throw er + + console.log('') + t.has(data, EXPECT) + t.end() + }) +}) + +tap.test('teardown', function (t) { + rimraf.sync(path.join(__dirname, 'package.json')) + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/test/scope.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/test/scope.js new file mode 100644 index 00000000..4fa06492 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/test/scope.js @@ -0,0 +1,39 @@ +var tap = require('tap') +var init = require('../') +var rimraf = require('rimraf') + +var EXPECT = { + name: '@foo/test', + version: '1.2.5', + description: 'description', + author: 'npmbot (http://npm.im)', + scripts: { test: 'make test' }, + main: 'main.js', + config: { scope: '@foo' }, + package: {} +} + +tap.test('the scope', function (t) { + var i = __dirname + '/basic.input' + var dir = __dirname + init(dir, i, {scope: '@foo'}, function (er, data) { + if (er) throw er + + console.log('') + t.has(data, EXPECT) + t.end() + }) + setTimeout(function () { + process.stdin.emit('data', '@foo/test\n') + }, 50) + setTimeout(function () { + process.stdin.emit('data', 'description\n') + }, 100) + setTimeout(function () { + process.stdin.emit('data', 'yes\n') + }, 150) +}) + +tap.test('teardown', function (t) { + rimraf(__dirname + '/package.json', t.end.bind(t)) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/test/silent.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/test/silent.js new file mode 100644 index 00000000..49370205 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/test/silent.js @@ -0,0 +1,23 @@ +var tap = require('tap') +var init = require('../') +var rimraf = require('rimraf') + +var log = console.log +var logged = false +console.log = function () { + logged = true +} + +tap.test('silent: true', function (t) { + init(__dirname, __dirname, {yes: 'yes', silent: true}, function (er, data) { + if (er) throw er + + t.false(logged, 'did not print anything') + t.end() + }) +}) + +tap.test('teardown', function (t) { + console.log = log + rimraf(__dirname + '/package.json', t.end.bind(t)) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/test/yes-defaults.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/test/yes-defaults.js new file mode 100644 index 00000000..f7cae28c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/init-package-json/test/yes-defaults.js @@ -0,0 +1,27 @@ +var tap = require('tap') +var init = require('../') +var rimraf = require('rimraf') + +var EXPECT = { + name: 'test', + version: '1.0.0', + description: '', + author: '', + scripts: { test: 'echo "Error: no test specified" && exit 1' }, + main: 'basic.js', + keywords: [], + license: 'ISC' +} + +tap.test('--yes defaults', function (t) { + init(__dirname, __dirname, {yes: 'yes'}, function (er, data) { + if (er) throw er + + t.has(data, EXPECT, 'used the default data') + t.end() + }) +}) + +tap.test('teardown', function (t) { + rimraf(__dirname + '/package.json', t.end.bind(t)) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lockfile/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lockfile/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lockfile/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lockfile/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lockfile/README.md new file mode 100644 index 00000000..3960194f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lockfile/README.md @@ -0,0 +1,86 @@ +# lockfile + +A very polite lock file utility, which endeavors to not litter, and to +wait patiently for others. + +## Usage + +```javascript +var lockFile = require('lockfile') + +// opts is optional, and defaults to {} +lockFile.lock('some-file.lock', opts, function (er) { + // if the er happens, then it failed to acquire a lock. + // if there was not an error, then the file was created, + // and won't be deleted until we unlock it. + + // do my stuff, free of interruptions + // then, some time later, do: + lockFile.unlock('some-file.lock', function (er) { + // er means that an error happened, and is probably bad. + }) +}) +``` + +## Methods + +Sync methods return the value/throw the error, others don't. Standard +node fs stuff. + +All known locks are removed when the process exits. Of course, it's +possible for certain types of failures to cause this to fail, but a best +effort is made to not be a litterbug. + +### lockFile.lock(path, [opts], cb) + +Acquire a file lock on the specified path + +### lockFile.lockSync(path, [opts]) + +Acquire a file lock on the specified path + +### lockFile.unlock(path, cb) + +Close and unlink the lockfile. + +### lockFile.unlockSync(path) + +Close and unlink the lockfile. + +### lockFile.check(path, [opts], cb) + +Check if the lockfile is locked and not stale. + +Callback is called with `cb(error, isLocked)`. + +### lockFile.checkSync(path, [opts]) + +Check if the lockfile is locked and not stale. + +Returns boolean. + +## Options + +### opts.wait + +A number of milliseconds to wait for locks to expire before giving up. +Only used by lockFile.lock. Poll for `opts.wait` ms. If the lock is +not cleared by the time the wait expires, then it returns with the +original error. + +### opts.pollPeriod + +When using `opts.wait`, this is the period in ms in which it polls to +check if the lock has expired. Defaults to `100`. + +### opts.stale + +A number of milliseconds before locks are considered to have expired. + +### opts.retries + +Used by lock and lockSync. Retry `n` number of times before giving up. + +### opts.retryWait + +Used by lock. Wait `n` milliseconds before retrying. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lockfile/lockfile.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lockfile/lockfile.js new file mode 100644 index 00000000..0c2c6f59 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lockfile/lockfile.js @@ -0,0 +1,311 @@ +var fs = require('fs') + +var wx = 'wx' +if (process.version.match(/^v0\.[0-6]/)) { + var c = require('constants') + wx = c.O_TRUNC | c.O_CREAT | c.O_WRONLY | c.O_EXCL +} + +var os = require('os') +exports.filetime = 'ctime' +if (os.platform() == "win32") { + exports.filetime = 'mtime' +} + +var debug +var util = require('util') +if (util.debuglog) + debug = util.debuglog('LOCKFILE') +else if (/\blockfile\b/i.test(process.env.NODE_DEBUG)) + debug = function() { + var msg = util.format.apply(util, arguments) + console.error('LOCKFILE %d %s', process.pid, msg) + } +else + debug = function() {} + +var locks = {} + +function hasOwnProperty (obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop) +} + +process.on('exit', function () { + debug('exit listener') + // cleanup + Object.keys(locks).forEach(exports.unlockSync) +}) + +// XXX https://github.com/joyent/node/issues/3555 +// Remove when node 0.8 is deprecated. +if (/^v0\.[0-8]\./.test(process.version)) { + debug('uncaughtException, version = %s', process.version) + process.on('uncaughtException', function H (er) { + debug('uncaughtException') + var l = process.listeners('uncaughtException').filter(function (h) { + return h !== H + }) + if (!l.length) { + // cleanup + try { Object.keys(locks).forEach(exports.unlockSync) } catch (e) {} + process.removeListener('uncaughtException', H) + throw er + } + }) +} + +exports.unlock = function (path, cb) { + debug('unlock', path) + // best-effort. unlocking an already-unlocked lock is a noop + delete locks[path] + fs.unlink(path, function (unlinkEr) { cb() }) +} + +exports.unlockSync = function (path) { + debug('unlockSync', path) + // best-effort. unlocking an already-unlocked lock is a noop + try { fs.unlinkSync(path) } catch (er) {} + delete locks[path] +} + + +// if the file can be opened in readonly mode, then it's there. +// if the error is something other than ENOENT, then it's not. +exports.check = function (path, opts, cb) { + if (typeof opts === 'function') cb = opts, opts = {} + debug('check', path, opts) + fs.open(path, 'r', function (er, fd) { + if (er) { + if (er.code !== 'ENOENT') return cb(er) + return cb(null, false) + } + + if (!opts.stale) { + return fs.close(fd, function (er) { + return cb(er, true) + }) + } + + fs.fstat(fd, function (er, st) { + if (er) return fs.close(fd, function (er2) { + return cb(er) + }) + + fs.close(fd, function (er) { + var age = Date.now() - st[exports.filetime].getTime() + return cb(er, age <= opts.stale) + }) + }) + }) +} + +exports.checkSync = function (path, opts) { + opts = opts || {} + debug('checkSync', path, opts) + if (opts.wait) { + throw new Error('opts.wait not supported sync for obvious reasons') + } + + try { + var fd = fs.openSync(path, 'r') + } catch (er) { + if (er.code !== 'ENOENT') throw er + return false + } + + if (!opts.stale) { + try { fs.closeSync(fd) } catch (er) {} + return true + } + + // file exists. however, might be stale + if (opts.stale) { + try { + var st = fs.fstatSync(fd) + } finally { + fs.closeSync(fd) + } + var age = Date.now() - st[exports.filetime].getTime() + return (age <= opts.stale) + } +} + + + +var req = 1 +exports.lock = function (path, opts, cb) { + if (typeof opts === 'function') cb = opts, opts = {} + opts.req = opts.req || req++ + debug('lock', path, opts) + opts.start = opts.start || Date.now() + + if (typeof opts.retries === 'number' && opts.retries > 0) { + debug('has retries', opts.retries) + var retries = opts.retries + opts.retries = 0 + cb = (function (orig) { return function cb (er, fd) { + debug('retry-mutated callback') + retries -= 1 + if (!er || retries < 0) return orig(er, fd) + + debug('lock retry', path, opts) + + if (opts.retryWait) setTimeout(retry, opts.retryWait) + else retry() + + function retry () { + opts.start = Date.now() + debug('retrying', opts.start) + exports.lock(path, opts, cb) + } + }})(cb) + } + + // try to engage the lock. + // if this succeeds, then we're in business. + fs.open(path, wx, function (er, fd) { + if (!er) { + debug('locked', path, fd) + locks[path] = fd + return fs.close(fd, function () { + return cb() + }) + } + + // something other than "currently locked" + // maybe eperm or something. + if (er.code !== 'EEXIST') return cb(er) + + // someone's got this one. see if it's valid. + if (!opts.stale) return notStale(er, path, opts, cb) + + return maybeStale(er, path, opts, false, cb) + }) +} + + +// Staleness checking algorithm +// 1. acquire $lock, fail +// 2. stat $lock, find that it is stale +// 3. acquire $lock.STALE +// 4. stat $lock, assert that it is still stale +// 5. unlink $lock +// 6. link $lock.STALE $lock +// 7. unlink $lock.STALE +// On any failure, clean up whatever we've done, and raise the error. +function maybeStale (originalEr, path, opts, hasStaleLock, cb) { + fs.stat(path, function (statEr, st) { + if (statEr) { + if (statEr.code === 'ENOENT') { + // expired already! + opts.stale = false + debug('lock stale enoent retry', path, opts) + exports.lock(path, opts, cb) + return + } + return cb(statEr) + } + + var age = Date.now() - st[exports.filetime].getTime() + if (age <= opts.stale) return notStale(originalEr, path, opts, cb) + + debug('lock stale', path, opts) + if (hasStaleLock) { + exports.unlock(path, function (er) { + if (er) return cb(er) + debug('lock stale retry', path, opts) + fs.link(path + '.STALE', path, function (er) { + fs.unlink(path + '.STALE', function () { + // best effort. if the unlink fails, oh well. + cb(er) + }) + }) + }) + } else { + debug('acquire .STALE file lock', opts) + exports.lock(path + '.STALE', opts, function (er) { + if (er) return cb(er) + maybeStale(originalEr, path, opts, true, cb) + }) + } + }) +} + +function notStale (er, path, opts, cb) { + debug('notStale', path, opts) + + // if we can't wait, then just call it a failure + if (typeof opts.wait !== 'number' || opts.wait <= 0) + return cb(er) + + // poll for some ms for the lock to clear + var now = Date.now() + var start = opts.start || now + var end = start + opts.wait + + if (end <= now) + return cb(er) + + debug('now=%d, wait until %d (delta=%d)', start, end, end-start) + var wait = Math.min(end - start, opts.pollPeriod || 100) + var timer = setTimeout(poll, wait) + + function poll () { + debug('notStale, polling', path, opts) + exports.lock(path, opts, cb) + } +} + +exports.lockSync = function (path, opts) { + opts = opts || {} + opts.req = opts.req || req++ + debug('lockSync', path, opts) + if (opts.wait || opts.retryWait) { + throw new Error('opts.wait not supported sync for obvious reasons') + } + + try { + var fd = fs.openSync(path, wx) + locks[path] = fd + try { fs.closeSync(fd) } catch (er) {} + debug('locked sync!', path, fd) + return + } catch (er) { + if (er.code !== 'EEXIST') return retryThrow(path, opts, er) + + if (opts.stale) { + var st = fs.statSync(path) + var ct = st[exports.filetime].getTime() + if (!(ct % 1000) && (opts.stale % 1000)) { + // probably don't have subsecond resolution. + // round up the staleness indicator. + // Yes, this will be wrong 1/1000 times on platforms + // with subsecond stat precision, but that's acceptable + // in exchange for not mistakenly removing locks on + // most other systems. + opts.stale = 1000 * Math.ceil(opts.stale / 1000) + } + var age = Date.now() - ct + if (age > opts.stale) { + debug('lockSync stale', path, opts, age) + exports.unlockSync(path) + return exports.lockSync(path, opts) + } + } + + // failed to lock! + debug('failed to lock', path, opts, er) + return retryThrow(path, opts, er) + } +} + +function retryThrow (path, opts, er) { + if (typeof opts.retries === 'number' && opts.retries > 0) { + var newRT = opts.retries - 1 + debug('retryThrow', path, opts, newRT) + opts.retries = newRT + return exports.lockSync(path, opts) + } + throw er +} + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lockfile/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lockfile/package.json new file mode 100644 index 00000000..cd18aa2e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lockfile/package.json @@ -0,0 +1,63 @@ +{ + "name": "lockfile", + "version": "1.0.1", + "main": "lockfile.js", + "directories": { + "test": "test" + }, + "dependencies": {}, + "devDependencies": { + "tap": "~0.2.5", + "touch": "0" + }, + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/isaacs/lockfile.git" + }, + "keywords": [ + "lockfile", + "lock", + "file", + "fs", + "O_EXCL" + ], + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "ISC", + "description": "A very polite lock file utility, which endeavors to not litter, and to wait patiently for others.", + "gitHead": "9d338ed8e3e3a166955d051f6b5fb6bb1e563ca8", + "bugs": { + "url": "https://github.com/isaacs/lockfile/issues" + }, + "homepage": "https://github.com/isaacs/lockfile#readme", + "_id": "lockfile@1.0.1", + "_shasum": "9d353ecfe3f54d150bb57f89d51746935a39c4f5", + "_from": "lockfile@>=1.0.0 <1.1.0", + "_npmVersion": "2.10.0", + "_nodeVersion": "2.0.1", + "_npmUser": { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + "dist": { + "shasum": "9d353ecfe3f54d150bb57f89d51746935a39c4f5", + "tarball": "http://registry.npmjs.org/lockfile/-/lockfile-1.0.1.tgz" + }, + "maintainers": [ + { + "name": "trevorburnham", + "email": "trevorburnham@gmail.com" + }, + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "_resolved": "https://registry.npmjs.org/lockfile/-/lockfile-1.0.1.tgz" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lockfile/test/basic.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lockfile/test/basic.js new file mode 100644 index 00000000..bc66cc35 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lockfile/test/basic.js @@ -0,0 +1,292 @@ +var test = require('tap').test +var lockFile = require('../lockfile.js') +var path = require('path') +var fs = require('fs') +var touch = require('touch') + +// On Unix systems, it uses ctime by default for staleness checks, since it's +// the most reliable. However, because this test artificially sets some locks +// to an earlier time to simulate staleness, we use mtime here. +lockFile.filetime = 'mtime' + +test('setup', function (t) { + try { lockFile.unlockSync('basic-lock') } catch (er) {} + try { lockFile.unlockSync('sync-lock') } catch (er) {} + try { lockFile.unlockSync('never-forget') } catch (er) {} + try { lockFile.unlockSync('stale-lock') } catch (er) {} + try { lockFile.unlockSync('watch-lock') } catch (er) {} + try { lockFile.unlockSync('retry-lock') } catch (er) {} + try { lockFile.unlockSync('contentious-lock') } catch (er) {} + try { lockFile.unlockSync('stale-wait-lock') } catch (er) {} + try { lockFile.unlockSync('stale-windows-lock') } catch (er) {} + t.end() +}) + +test('lock contention', function (t) { + var gotlocks = 0; + var N = 200 + var delay = 10 + // allow for some time for each lock acquisition and release. + // note that raising N higher will mean that the overhead + // increases, because we're creating more and more watchers. + // irl, you should never have several hundred contenders for a + // single lock, so this situation is somewhat pathological. + var overhead = 200 + var wait = N * overhead + delay + + // first make it locked, so that everyone has to wait + lockFile.lock('contentious-lock', function(er, lock) { + t.ifError(er, 'acquiring starter') + if (er) throw er; + t.pass('acquired starter lock') + setTimeout(function() { + lockFile.unlock('contentious-lock', function (er) { + t.ifError(er, 'unlocking starter') + if (er) throw er + t.pass('unlocked starter') + }) + }, delay) + }) + + for (var i=0; i < N; i++) + lockFile.lock('contentious-lock', { wait: wait }, function(er, lock) { + if (er) throw er; + lockFile.unlock('contentious-lock', function(er) { + if (er) throw er + gotlocks++ + t.pass('locked and unlocked #' + gotlocks) + if (gotlocks === N) { + t.pass('got all locks') + t.end() + } + }) + }) +}) + +test('basic test', function (t) { + lockFile.check('basic-lock', function (er, locked) { + if (er) throw er + t.notOk(locked) + lockFile.lock('basic-lock', function (er) { + if (er) throw er + lockFile.lock('basic-lock', function (er) { + t.ok(er) + lockFile.check('basic-lock', function (er, locked) { + if (er) throw er + t.ok(locked) + lockFile.unlock('basic-lock', function (er) { + if (er) throw er + lockFile.check('basic-lock', function (er, locked) { + if (er) throw er + t.notOk(locked) + t.end() + }) + }) + }) + }) + }) + }) +}) + +test('sync test', function (t) { + var locked + locked = lockFile.checkSync('sync-lock') + t.notOk(locked) + lockFile.lockSync('sync-lock') + locked = lockFile.checkSync('sync-lock') + t.ok(locked) + lockFile.unlockSync('sync-lock') + locked = lockFile.checkSync('sync-lock') + t.notOk(locked) + t.end() +}) + +test('exit cleanup test', function (t) { + var child = require.resolve('./fixtures/child.js') + var node = process.execPath + var spawn = require('child_process').spawn + spawn(node, [child]).on('exit', function () { + setTimeout(function () { + var locked = lockFile.checkSync('never-forget') + t.notOk(locked) + t.end() + }, 100) + }) +}) + +test('error exit cleanup test', function (t) { + var child = require.resolve('./fixtures/bad-child.js') + var node = process.execPath + var spawn = require('child_process').spawn + spawn(node, [child]).on('exit', function () { + setTimeout(function () { + var locked = lockFile.checkSync('never-forget') + t.notOk(locked) + t.end() + }, 100) + }) +}) + + +test('staleness test', function (t) { + lockFile.lock('stale-lock', function (er) { + if (er) throw er + + // simulate 2s old + touch.sync('stale-lock', { time: new Date(Date.now() - 2000) }) + + var opts = { stale: 1 } + lockFile.check('stale-lock', opts, function (er, locked) { + if (er) throw er + t.notOk(locked) + lockFile.lock('stale-lock', opts, function (er) { + if (er) throw er + lockFile.unlock('stale-lock', function (er) { + if (er) throw er + t.end() + }) + }) + }) + }) +}) + +test('staleness sync test', function (t) { + var opts = { stale: 1 } + lockFile.lockSync('stale-lock') + // simulate 2s old + touch.sync('stale-lock', { time: new Date(Date.now() - 2000) }) + var locked + locked = lockFile.checkSync('stale-lock', opts) + t.notOk(locked) + lockFile.lockSync('stale-lock', opts) + lockFile.unlockSync('stale-lock') + t.end() +}) + +test('retries', function (t) { + // next 5 opens will fail. + var opens = 5 + fs._open = fs.open + fs.open = function (path, mode, cb) { + if (--opens === 0) { + fs.open = fs._open + return fs.open(path, mode, cb) + } + var er = new Error('bogus') + // to be, or not to be, that is the question. + er.code = opens % 2 ? 'EEXIST' : 'ENOENT' + process.nextTick(cb.bind(null, er)) + } + + lockFile.lock('retry-lock', { retries: opens }, function (er) { + if (er) throw er + t.equal(opens, 0) + lockFile.unlockSync('retry-lock') + t.end() + }) +}) + +test('retryWait', function (t) { + // next 5 opens will fail. + var opens = 5 + fs._open = fs.open + fs.open = function (path, mode, cb) { + if (--opens === 0) { + fs.open = fs._open + return fs.open(path, mode, cb) + } + var er = new Error('bogus') + // to be, or not to be, that is the question. + er.code = opens % 2 ? 'EEXIST' : 'ENOENT' + process.nextTick(cb.bind(null, er)) + } + + var opts = { retries: opens, retryWait: 100 } + lockFile.lock('retry-lock', opts, function (er) { + if (er) throw er + t.equal(opens, 0) + lockFile.unlockSync('retry-lock') + t.end() + }) +}) + +test('retry sync', function (t) { + // next 5 opens will fail. + var opens = 5 + fs._openSync = fs.openSync + fs.openSync = function (path, mode) { + if (--opens === 0) { + fs.openSync = fs._openSync + return fs.openSync(path, mode) + } + var er = new Error('bogus') + // to be, or not to be, that is the question. + er.code = opens % 2 ? 'EEXIST' : 'ENOENT' + throw er + } + + var opts = { retries: opens } + lockFile.lockSync('retry-lock', opts) + t.equal(opens, 0) + lockFile.unlockSync('retry-lock') + t.end() +}) + +test('wait and stale together', function (t) { + // first locker. + var interval + lockFile.lock('stale-wait-lock', function(er) { + // keep refreshing the lock, so we keep it forever + interval = setInterval(function() { + touch.sync('stale-wait-lock') + }, 10) + + // try to get another lock. this must fail! + var opt = { stale: 1000, wait: 2000, pollInterval: 1000 } + lockFile.lock('stale-wait-lock', opt, function (er) { + if (!er) + t.fail('got second lock? that unpossible!') + else + t.pass('second lock failed, as i have foreseen it') + clearInterval(interval) + t.end() + }) + }) +}) + + +test('stale windows file tunneling test', function (t) { + // for windows only + // nt file system tunneling feature will make file creation time not updated + var opts = { stale: 1000 } + lockFile.lockSync('stale-windows-lock') + touch.sync('stale-windows-lock', { time: new Date(Date.now() - 3000) }) + + var locked + lockFile.unlockSync('stale-windows-lock') + lockFile.lockSync('stale-windows-lock', opts) + locked = lockFile.checkSync('stale-windows-lock', opts) + t.ok(locked, "should be locked and not stale") + lockFile.lock('stale-windows-lock', opts, function (er) { + if (!er) + t.fail('got second lock? impossible, windows file tunneling problem!') + else + t.pass('second lock failed, windows file tunneling problem fixed') + t.end() + }) +}) + + +test('cleanup', function (t) { + try { lockFile.unlockSync('basic-lock') } catch (er) {} + try { lockFile.unlockSync('sync-lock') } catch (er) {} + try { lockFile.unlockSync('never-forget') } catch (er) {} + try { lockFile.unlockSync('stale-lock') } catch (er) {} + try { lockFile.unlockSync('watch-lock') } catch (er) {} + try { lockFile.unlockSync('retry-lock') } catch (er) {} + try { lockFile.unlockSync('contentious-lock') } catch (er) {} + try { lockFile.unlockSync('stale-wait-lock') } catch (er) {} + try { lockFile.unlockSync('stale-windows-lock') } catch (er) {} + t.end() +}) + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lockfile/test/fixtures/bad-child.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lockfile/test/fixtures/bad-child.js new file mode 100644 index 00000000..e6530454 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lockfile/test/fixtures/bad-child.js @@ -0,0 +1,5 @@ +var lockFile = require('../../lockfile.js') + +lockFile.lockSync('never-forget') + +throw new Error('waaaaaaaaa') diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lockfile/test/fixtures/child.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lockfile/test/fixtures/child.js new file mode 100644 index 00000000..5b61d6c9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lockfile/test/fixtures/child.js @@ -0,0 +1,3 @@ +var lockFile = require('../../lockfile.js') + +lockFile.lock('never-forget', function () {}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lockfile/test/retry-time.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lockfile/test/retry-time.js new file mode 100644 index 00000000..160bc137 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lockfile/test/retry-time.js @@ -0,0 +1,62 @@ +// In these tests, we do the following: +// try for 200ms (rt=2) +// wait for 300ms +// try for 200ms (rt=1) +// wait for 300ms +// try for 200ms (rt=0) +// fail after 1200 +// Actual time will be more like 1220-ish for setTimeout irregularity +// But it should NOT be as slow as 2000. + +var lockFile = require('../') +var touch = require('touch') +var test = require('tap').test +var fs = require('fs') + +var RETRYWAIT = 100 +var WAIT = 100 +var RETRIES = 2 +var EXPECTTIME = (RETRYWAIT * RETRIES) + (WAIT * (RETRIES + 1)) +var TOOLONG = EXPECTTIME * 1.1 + +test('setup', function (t) { + touch.sync('file.lock') + t.end() +}) + +var pollPeriods = [10, 100, 10000] +pollPeriods.forEach(function (pp) { + test('retry+wait, poll=' + pp, function (t) { + var ended = false + var timer = setTimeout(function() { + t.fail('taking too long!') + ended = true + t.end() + }, 2000) + timer.unref() + + var start = Date.now() + lockFile.lock('file.lock', { + wait: WAIT, + retries: RETRIES, + retryWait: RETRYWAIT, + pollPeriod: pp + }, function (er) { + if (ended) return + var time = Date.now() - start + console.error('t=%d', time) + t.ok(time >= EXPECTTIME, 'should take at least ' + EXPECTTIME) + t.ok(time < TOOLONG, 'should take less than ' + TOOLONG) + clearTimeout(timer) + t.end() + }) + }) +}) + +test('cleanup', function (t) { + fs.unlinkSync('file.lock') + t.end() + setTimeout(function() { + process.exit(1) + }, 500).unref() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lockfile/test/stale-contention.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lockfile/test/stale-contention.js new file mode 100644 index 00000000..85cbf92e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lockfile/test/stale-contention.js @@ -0,0 +1,85 @@ +var fs = require('fs') +var lockFile = require('../') +var test = require('tap').test +var path = require('path') +var lock = path.resolve(__dirname, 'stale.lock') +var touch = require('touch') +var spawn = require('child_process').spawn +var node = process.execPath + +// We're using a lockfile with an artificially old date, +// so make it use that instead of ctime. +// Probably you should never do this in production! +lockFile.filetime = 'mtime' + +if (process.argv[2] === 'child') { + return child() +} + +function child () { + // Make fs.stat take 100ms to return its data + // This is important because, in a test scenario where + // we're statting the same exact file rapid-fire like this, + // it'll end up being cached by the FS, and never trigger + // the race condition we're trying to expose. + fs.stat = function (stat) { return function () { + var args = [].slice.call(arguments) + var cb = args.pop() + stat.apply(fs, args.concat(function(er, st) { + setTimeout(function () { + cb(er, st) + }, 100) + })) + }}(fs.stat) + + lockFile.lock(lock, { stale: 100000 }, function (er) { + if (er && er.code !== 'EEXIST') + throw er + else if (er) + process.exit(17) + else + setTimeout(function(){}, 500) + }) +} + +test('create stale file', function (t) { + try { fs.unlinkSync(lock) } catch (er) {} + touch.sync(lock, { time: '1979-07-01T19:10:00.000Z' }) + t.end() +}) + +test('contenders', function (t) { + var n = 10 + var fails = 0 + var wins = 0 + var args = [ __filename, 'child' ] + var opt = { stdio: [0, "pipe", 2] } + for (var i = 0; i < n; i++) { + spawn(node, args, opt).on('close', then) + } + + function then (code) { + if (code === 17) { + fails ++ + } else if (code) { + t.fail("unexpected failure", code) + fails ++ + } else { + wins ++ + } + if (fails + wins === n) { + done() + } + } + + function done () { + t.equal(wins, 1, "should have 1 lock winner") + t.equal(fails, n - 1, "all others should lose") + t.end() + } +}) + +test('remove stale file', function (t) { + try { fs.unlinkSync(lock) } catch (er) {} + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/README.md new file mode 100644 index 00000000..1bc7b03f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/README.md @@ -0,0 +1,142 @@ +# lru cache + +A cache object that deletes the least-recently-used items. + +[![Build Status](https://travis-ci.org/isaacs/node-lru-cache.svg?branch=master)](https://travis-ci.org/isaacs/node-lru-cache) [![Coverage Status](https://coveralls.io/repos/isaacs/node-lru-cache/badge.svg?service=github)](https://coveralls.io/github/isaacs/node-lru-cache) + +## Usage: + +```javascript +var LRU = require("lru-cache") + , options = { max: 500 + , length: function (n, key) { return n * 2 + key.length } + , dispose: function (key, n) { n.close() } + , maxAge: 1000 * 60 * 60 } + , cache = LRU(options) + , otherCache = LRU(50) // sets just the max size + +cache.set("key", "value") +cache.get("key") // "value" + +// non-string keys ARE fully supported +var someObject = {} +cache.set(someObject, 'a value') +cache.set('[object Object]', 'a different value') +assert.equal(cache.get(someObject), 'a value') + +cache.reset() // empty the cache +``` + +If you put more stuff in it, then items will fall out. + +If you try to put an oversized thing in it, then it'll fall out right +away. + +## Options + +* `max` The maximum size of the cache, checked by applying the length + function to all values in the cache. Not setting this is kind of + silly, since that's the whole purpose of this lib, but it defaults + to `Infinity`. +* `maxAge` Maximum age in ms. Items are not pro-actively pruned out + as they age, but if you try to get an item that is too old, it'll + drop it and return undefined instead of giving it to you. +* `length` Function that is used to calculate the length of stored + items. If you're storing strings or buffers, then you probably want + to do something like `function(n, key){return n.length}`. The default is + `function(){return 1}`, which is fine if you want to store `max` + like-sized things. They item is passed as the first argument, and + the key is passed as the second argumnet. +* `dispose` Function that is called on items when they are dropped + from the cache. This can be handy if you want to close file + descriptors or do other cleanup tasks when items are no longer + accessible. Called with `key, value`. It's called *before* + actually removing the item from the internal cache, so if you want + to immediately put it back in, you'll have to do that in a + `nextTick` or `setTimeout` callback or it won't do anything. +* `stale` By default, if you set a `maxAge`, it'll only actually pull + stale items out of the cache when you `get(key)`. (That is, it's + not pre-emptively doing a `setTimeout` or anything.) If you set + `stale:true`, it'll return the stale value before deleting it. If + you don't set this, then it'll return `undefined` when you try to + get a stale entry, as if it had already been deleted. + +## API + +* `set(key, value, maxAge)` +* `get(key) => value` + + Both of these will update the "recently used"-ness of the key. + They do what you think. `maxAge` is optional and overrides the + cache `maxAge` option if provided. + + If the key is not found, `get()` will return `undefined`. + + The key and val can be any value. + +* `peek(key)` + + Returns the key value (or `undefined` if not found) without + updating the "recently used"-ness of the key. + + (If you find yourself using this a lot, you *might* be using the + wrong sort of data structure, but there are some use cases where + it's handy.) + +* `del(key)` + + Deletes a key out of the cache. + +* `reset()` + + Clear the cache entirely, throwing away all values. + +* `has(key)` + + Check if a key is in the cache, without updating the recent-ness + or deleting it for being stale. + +* `forEach(function(value,key,cache), [thisp])` + + Just like `Array.prototype.forEach`. Iterates over all the keys + in the cache, in order of recent-ness. (Ie, more recently used + items are iterated over first.) + +* `rforEach(function(value,key,cache), [thisp])` + + The same as `cache.forEach(...)` but items are iterated over in + reverse order. (ie, less recently used items are iterated over + first.) + +* `keys()` + + Return an array of the keys in the cache. + +* `values()` + + Return an array of the values in the cache. + +* `length` + + Return total length of objects in cache taking into account + `length` options function. + +* `itemCount` + + Return total quantity of objects currently in cache. Note, that + `stale` (see options) items are returned as part of this item + count. + +* `dump()` + + Return an array of the cache entries ready for serialization and usage + with 'destinationCache.load(arr)`. + +* `load(cacheEntriesArray)` + + Loads another cache entries array, obtained with `sourceCache.dump()`, + into the cache. The destination cache is reset before loading new entries + +* `prune()` + + Manually iterates over the entire cache proactively pruning old entries diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/lib/lru-cache.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/lib/lru-cache.js new file mode 100644 index 00000000..e98ef78a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/lib/lru-cache.js @@ -0,0 +1,469 @@ +module.exports = LRUCache + +// This will be a proper iterable 'Map' in engines that support it, +// or a fakey-fake PseudoMap in older versions. +var Map = require('pseudomap') +var util = require('util') + +// A linked list to keep track of recently-used-ness +var Yallist = require('yallist') + +// use symbols if possible, otherwise just _props +var symbols = {} +var hasSymbol = typeof Symbol === 'function' +var makeSymbol +/* istanbul ignore if */ +if (hasSymbol) { + makeSymbol = function (key) { + return Symbol.for(key) + } +} else { + makeSymbol = function (key) { + return '_' + key + } +} + +function priv (obj, key, val) { + var sym + if (symbols[key]) { + sym = symbols[key] + } else { + sym = makeSymbol(key) + symbols[key] = sym + } + if (arguments.length === 2) { + return obj[sym] + } else { + obj[sym] = val + return val + } +} + +function naiveLength () { return 1 } + +// lruList is a yallist where the head is the youngest +// item, and the tail is the oldest. the list contains the Hit +// objects as the entries. +// Each Hit object has a reference to its Yallist.Node. This +// never changes. +// +// cache is a Map (or PseudoMap) that matches the keys to +// the Yallist.Node object. +function LRUCache (options) { + if (!(this instanceof LRUCache)) { + return new LRUCache(options) + } + + if (typeof options === 'number') { + options = { max: options } + } + + if (!options) { + options = {} + } + + var max = priv(this, 'max', options.max) + // Kind of weird to have a default max of Infinity, but oh well. + if (!max || + !(typeof max === 'number') || + max <= 0) { + priv(this, 'max', Infinity) + } + + var lc = options.length || naiveLength + if (typeof lc !== 'function') { + lc = naiveLength + } + priv(this, 'lengthCalculator', lc) + + priv(this, 'allowStale', options.stale || false) + priv(this, 'maxAge', options.maxAge || 0) + priv(this, 'dispose', options.dispose) + this.reset() +} + +// resize the cache when the max changes. +Object.defineProperty(LRUCache.prototype, 'max', { + set: function (mL) { + if (!mL || !(typeof mL === 'number') || mL <= 0) { + mL = Infinity + } + priv(this, 'max', mL) + trim(this) + }, + get: function () { + return priv(this, 'max') + }, + enumerable: true +}) + +Object.defineProperty(LRUCache.prototype, 'allowStale', { + set: function (allowStale) { + priv(this, 'allowStale', !!allowStale) + }, + get: function () { + return priv(this, 'allowStale') + }, + enumerable: true +}) + +Object.defineProperty(LRUCache.prototype, 'maxAge', { + set: function (mA) { + if (!mA || !(typeof mA === 'number') || mA < 0) { + mA = 0 + } + priv(this, 'maxAge', mA) + trim(this) + }, + get: function () { + return priv(this, 'maxAge') + }, + enumerable: true +}) + +// resize the cache when the lengthCalculator changes. +Object.defineProperty(LRUCache.prototype, 'lengthCalculator', { + set: function (lC) { + if (typeof lC !== 'function') { + lC = naiveLength + } + if (lC !== priv(this, 'lengthCalculator')) { + priv(this, 'lengthCalculator', lC) + priv(this, 'length', 0) + priv(this, 'lruList').forEach(function (hit) { + hit.length = priv(this, 'lengthCalculator').call(this, hit.value, hit.key) + priv(this, 'length', priv(this, 'length') + hit.length) + }, this) + } + trim(this) + }, + get: function () { return priv(this, 'lengthCalculator') }, + enumerable: true +}) + +Object.defineProperty(LRUCache.prototype, 'length', { + get: function () { return priv(this, 'length') }, + enumerable: true +}) + +Object.defineProperty(LRUCache.prototype, 'itemCount', { + get: function () { return priv(this, 'lruList').length }, + enumerable: true +}) + +LRUCache.prototype.rforEach = function (fn, thisp) { + thisp = thisp || this + for (var walker = priv(this, 'lruList').tail; walker !== null;) { + var prev = walker.prev + forEachStep(this, fn, walker, thisp) + walker = prev + } +} + +function forEachStep (self, fn, node, thisp) { + var hit = node.value + if (isStale(self, hit)) { + del(self, node) + if (!priv(self, 'allowStale')) { + hit = undefined + } + } + if (hit) { + fn.call(thisp, hit.value, hit.key, self) + } +} + +LRUCache.prototype.forEach = function (fn, thisp) { + thisp = thisp || this + for (var walker = priv(this, 'lruList').head; walker !== null;) { + var next = walker.next + forEachStep(this, fn, walker, thisp) + walker = next + } +} + +LRUCache.prototype.keys = function () { + return priv(this, 'lruList').toArray().map(function (k) { + return k.key + }, this) +} + +LRUCache.prototype.values = function () { + return priv(this, 'lruList').toArray().map(function (k) { + return k.value + }, this) +} + +LRUCache.prototype.reset = function () { + if (priv(this, 'dispose') && + priv(this, 'lruList') && + priv(this, 'lruList').length) { + priv(this, 'lruList').forEach(function (hit) { + priv(this, 'dispose').call(this, hit.key, hit.value) + }, this) + } + + priv(this, 'cache', new Map()) // hash of items by key + priv(this, 'lruList', new Yallist()) // list of items in order of use recency + priv(this, 'length', 0) // length of items in the list +} + +LRUCache.prototype.dump = function () { + return priv(this, 'lruList').map(function (hit) { + if (!isStale(this, hit)) { + return { + k: hit.key, + v: hit.value, + e: hit.now + (hit.maxAge || 0) + } + } + }, this).toArray().filter(function (h) { + return h + }) +} + +LRUCache.prototype.dumpLru = function () { + return priv(this, 'lruList') +} + +LRUCache.prototype.inspect = function (n, opts) { + var str = 'LRUCache {' + var extras = false + + var as = priv(this, 'allowStale') + if (as) { + str += '\n allowStale: true' + extras = true + } + + var max = priv(this, 'max') + if (max && max !== Infinity) { + if (extras) { + str += ',' + } + str += '\n max: ' + util.inspect(max, opts) + extras = true + } + + var maxAge = priv(this, 'maxAge') + if (maxAge) { + if (extras) { + str += ',' + } + str += '\n maxAge: ' + util.inspect(maxAge, opts) + extras = true + } + + var lc = priv(this, 'lengthCalculator') + if (lc && lc !== naiveLength) { + if (extras) { + str += ',' + } + str += '\n length: ' + util.inspect(priv(this, 'length'), opts) + extras = true + } + + var didFirst = false + priv(this, 'lruList').forEach(function (item) { + if (didFirst) { + str += ',\n ' + } else { + if (extras) { + str += ',\n' + } + didFirst = true + str += '\n ' + } + var key = util.inspect(item.key).split('\n').join('\n ') + var val = { value: item.value } + if (item.maxAge !== maxAge) { + val.maxAge = item.maxAge + } + if (lc !== naiveLength) { + val.length = item.length + } + if (isStale(this, item)) { + val.stale = true + } + + val = util.inspect(val, opts).split('\n').join('\n ') + str += key + ' => ' + val + }) + + if (didFirst || extras) { + str += '\n' + } + str += '}' + + return str +} + +LRUCache.prototype.set = function (key, value, maxAge) { + maxAge = maxAge || priv(this, 'maxAge') + + var now = maxAge ? Date.now() : 0 + var len = priv(this, 'lengthCalculator').call(this, value, key) + + if (priv(this, 'cache').has(key)) { + if (len > priv(this, 'max')) { + del(this, priv(this, 'cache').get(key)) + return false + } + + var node = priv(this, 'cache').get(key) + var item = node.value + + // dispose of the old one before overwriting + if (priv(this, 'dispose')) { + priv(this, 'dispose').call(this, key, item.value) + } + + item.now = now + item.maxAge = maxAge + item.value = value + priv(this, 'length', priv(this, 'length') + (len - item.length)) + item.length = len + this.get(key) + trim(this) + return true + } + + var hit = new Entry(key, value, len, now, maxAge) + + // oversized objects fall out of cache automatically. + if (hit.length > priv(this, 'max')) { + if (priv(this, 'dispose')) { + priv(this, 'dispose').call(this, key, value) + } + return false + } + + priv(this, 'length', priv(this, 'length') + hit.length) + priv(this, 'lruList').unshift(hit) + priv(this, 'cache').set(key, priv(this, 'lruList').head) + trim(this) + return true +} + +LRUCache.prototype.has = function (key) { + if (!priv(this, 'cache').has(key)) return false + var hit = priv(this, 'cache').get(key).value + if (isStale(this, hit)) { + return false + } + return true +} + +LRUCache.prototype.get = function (key) { + return get(this, key, true) +} + +LRUCache.prototype.peek = function (key) { + return get(this, key, false) +} + +LRUCache.prototype.pop = function () { + var node = priv(this, 'lruList').tail + if (!node) return null + del(this, node) + return node.value +} + +LRUCache.prototype.del = function (key) { + del(this, priv(this, 'cache').get(key)) +} + +LRUCache.prototype.load = function (arr) { + // reset the cache + this.reset() + + var now = Date.now() + // A previous serialized cache has the most recent items first + for (var l = arr.length - 1; l >= 0; l--) { + var hit = arr[l] + var expiresAt = hit.e || 0 + if (expiresAt === 0) { + // the item was created without expiration in a non aged cache + this.set(hit.k, hit.v) + } else { + var maxAge = expiresAt - now + // dont add already expired items + if (maxAge > 0) { + this.set(hit.k, hit.v, maxAge) + } + } + } +} + +LRUCache.prototype.prune = function () { + var self = this + priv(this, 'cache').forEach(function (value, key) { + get(self, key, false) + }) +} + +function get (self, key, doUse) { + var node = priv(self, 'cache').get(key) + if (node) { + var hit = node.value + if (isStale(self, hit)) { + del(self, node) + if (!priv(self, 'allowStale')) hit = undefined + } else { + if (doUse) { + priv(self, 'lruList').unshiftNode(node) + } + } + if (hit) hit = hit.value + } + return hit +} + +function isStale (self, hit) { + if (!hit || (!hit.maxAge && !priv(self, 'maxAge'))) { + return false + } + var stale = false + var diff = Date.now() - hit.now + if (hit.maxAge) { + stale = diff > hit.maxAge + } else { + stale = priv(self, 'maxAge') && (diff > priv(self, 'maxAge')) + } + return stale +} + +function trim (self) { + if (priv(self, 'length') > priv(self, 'max')) { + for (var walker = priv(self, 'lruList').tail; + priv(self, 'length') > priv(self, 'max') && walker !== null;) { + // We know that we're about to delete this one, and also + // what the next least recently used key will be, so just + // go ahead and set it now. + var prev = walker.prev + del(self, walker) + walker = prev + } + } +} + +function del (self, node) { + if (node) { + var hit = node.value + if (priv(self, 'dispose')) { + priv(self, 'dispose').call(this, hit.key, hit.value) + } + priv(self, 'length', priv(self, 'length') - hit.length) + priv(self, 'cache').delete(hit.key) + priv(self, 'lruList').removeNode(node) + } +} + +// classy, since V8 prefers predictable objects. +function Entry (key, value, length, now, maxAge) { + this.key = key + this.value = value + this.length = length + this.now = now + this.maxAge = maxAge || 0 +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/node_modules/pseudomap/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/node_modules/pseudomap/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/node_modules/pseudomap/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/node_modules/pseudomap/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/node_modules/pseudomap/README.md new file mode 100644 index 00000000..778bf01d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/node_modules/pseudomap/README.md @@ -0,0 +1,60 @@ +# pseudomap + +A thing that is a lot like ES6 `Map`, but without iterators, for use +in environments where `for..of` syntax and `Map` are not available. + +If you need iterators, or just in general a more faithful polyfill to +ES6 Maps, check out [es6-map](http://npm.im/es6-map). + +If you are in an environment where `Map` is supported, then that will +be returned instead, unless `process.env.TEST_PSEUDOMAP` is set. + +You can use any value as keys, and any value as data. Setting again +with the identical key will overwrite the previous value. + +Internally, data is stored on an `Object.create(null)` style object. +The key is coerced to a string to generate the key on the internal +data-bag object. The original key used is stored along with the data. + +In the event of a stringified-key collision, a new key is generated by +appending an increasing number to the stringified-key until finding +either the intended key or an empty spot. + +Note that because object traversal order of plain objects is not +guaranteed to be identical to insertion order, the insertion order +guarantee of `Map.prototype.forEach` is not guaranteed in this +implementation. However, in all versions of Node.js and V8 where this +module works, `forEach` does traverse data in insertion order. + +## API + +Most of the [Map +API](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map), +with the following exceptions: + +1. A `Map` object is not an iterator. +2. `values`, `keys`, and `entries` methods are not implemented, + because they return iterators. +3. The argument to the constructor can be an Array of `[key, value]` + pairs, or a `Map` or `PseudoMap` object. But, since iterators + aren't used, passing any plain-old iterator won't initialize the + map properly. + +## USAGE + +Use just like a regular ES6 Map. + +```javascript +var PseudoMap = require('pseudomap') + +// optionally provide a pseudomap, or an array of [key,value] pairs +// as the argument to initialize the map with +var myMap = new PseudoMap() + +myMap.set(1, 'number 1') +myMap.set('1', 'string 1') +var akey = {} +var bkey = {} +myMap.set(akey, { some: 'data' }) +myMap.set(bkey, { some: 'other data' }) +``` diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/node_modules/pseudomap/map.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/node_modules/pseudomap/map.js new file mode 100644 index 00000000..7db15994 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/node_modules/pseudomap/map.js @@ -0,0 +1,9 @@ +if (process.env.npm_package_name === 'pseudomap' && + process.env.npm_lifecycle_script === 'test') + process.env.TEST_PSEUDOMAP = 'true' + +if (typeof Map === 'function' && !process.env.TEST_PSEUDOMAP) { + module.exports = Map +} else { + module.exports = require('./pseudomap') +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/node_modules/pseudomap/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/node_modules/pseudomap/package.json new file mode 100644 index 00000000..b38d1897 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/node_modules/pseudomap/package.json @@ -0,0 +1,51 @@ +{ + "name": "pseudomap", + "version": "1.0.2", + "description": "A thing that is a lot like ES6 `Map`, but without iterators, for use in environments where `for..of` syntax and `Map` are not available.", + "main": "map.js", + "directories": { + "test": "test" + }, + "devDependencies": { + "tap": "^2.3.1" + }, + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/pseudomap.git" + }, + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "ISC", + "bugs": { + "url": "https://github.com/isaacs/pseudomap/issues" + }, + "homepage": "https://github.com/isaacs/pseudomap#readme", + "gitHead": "b6dc728207a0321ede6479e34506d3e0e13a940b", + "_id": "pseudomap@1.0.2", + "_shasum": "f052a28da70e618917ef0a8ac34c1ae5a68286b3", + "_from": "pseudomap@>=1.0.1 <2.0.0", + "_npmVersion": "3.3.2", + "_nodeVersion": "4.0.0", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "dist": { + "shasum": "f052a28da70e618917ef0a8ac34c1ae5a68286b3", + "tarball": "http://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "_resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/node_modules/pseudomap/pseudomap.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/node_modules/pseudomap/pseudomap.js new file mode 100644 index 00000000..25a21d82 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/node_modules/pseudomap/pseudomap.js @@ -0,0 +1,113 @@ +var hasOwnProperty = Object.prototype.hasOwnProperty + +module.exports = PseudoMap + +function PseudoMap (set) { + if (!(this instanceof PseudoMap)) // whyyyyyyy + throw new TypeError("Constructor PseudoMap requires 'new'") + + this.clear() + + if (set) { + if ((set instanceof PseudoMap) || + (typeof Map === 'function' && set instanceof Map)) + set.forEach(function (value, key) { + this.set(key, value) + }, this) + else if (Array.isArray(set)) + set.forEach(function (kv) { + this.set(kv[0], kv[1]) + }, this) + else + throw new TypeError('invalid argument') + } +} + +PseudoMap.prototype.forEach = function (fn, thisp) { + thisp = thisp || this + Object.keys(this._data).forEach(function (k) { + if (k !== 'size') + fn.call(thisp, this._data[k].value, this._data[k].key) + }, this) +} + +PseudoMap.prototype.has = function (k) { + return !!find(this._data, k) +} + +PseudoMap.prototype.get = function (k) { + var res = find(this._data, k) + return res && res.value +} + +PseudoMap.prototype.set = function (k, v) { + set(this._data, k, v) +} + +PseudoMap.prototype.delete = function (k) { + var res = find(this._data, k) + if (res) { + delete this._data[res._index] + this._data.size-- + } +} + +PseudoMap.prototype.clear = function () { + var data = Object.create(null) + data.size = 0 + + Object.defineProperty(this, '_data', { + value: data, + enumerable: false, + configurable: true, + writable: false + }) +} + +Object.defineProperty(PseudoMap.prototype, 'size', { + get: function () { + return this._data.size + }, + set: function (n) {}, + enumerable: true, + configurable: true +}) + +PseudoMap.prototype.values = +PseudoMap.prototype.keys = +PseudoMap.prototype.entries = function () { + throw new Error('iterators are not implemented in this version') +} + +// Either identical, or both NaN +function same (a, b) { + return a === b || a !== a && b !== b +} + +function Entry (k, v, i) { + this.key = k + this.value = v + this._index = i +} + +function find (data, k) { + for (var i = 0, s = '_' + k, key = s; + hasOwnProperty.call(data, key); + key = s + i++) { + if (same(data[key].key, k)) + return data[key] + } +} + +function set (data, k, v) { + for (var i = 0, s = '_' + k, key = s; + hasOwnProperty.call(data, key); + key = s + i++) { + if (same(data[key].key, k)) { + data[key].value = v + return + } + } + data.size++ + data[key] = new Entry(k, v, key) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/node_modules/pseudomap/test/basic.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/node_modules/pseudomap/test/basic.js new file mode 100644 index 00000000..4378e454 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/node_modules/pseudomap/test/basic.js @@ -0,0 +1,86 @@ +var t = require('tap') + +process.env.TEST_PSEUDOMAP = 'true' + +var PM = require('../') +runTests(PM) + +// if possible, verify that Map also behaves the same way +if (typeof Map === 'function') + runTests(Map) + + +function runTests (Map) { + t.throws(Map) + + var m = new Map() + + t.equal(m.size, 0) + + m.set(1, '1 string') + t.equal(m.get(1), '1 string') + t.equal(m.size, 1) + m.size = 1000 + t.equal(m.size, 1) + m.size = 0 + t.equal(m.size, 1) + + m = new Map([[1, 'number 1'], ['1', 'string 1']]) + t.equal(m.get(1), 'number 1') + t.equal(m.get('1'), 'string 1') + t.equal(m.size, 2) + + m = new Map(m) + t.equal(m.get(1), 'number 1') + t.equal(m.get('1'), 'string 1') + t.equal(m.size, 2) + + var akey = {} + var bkey = {} + m.set(akey, { some: 'data' }) + m.set(bkey, { some: 'other data' }) + t.same(m.get(akey), { some: 'data' }) + t.same(m.get(bkey), { some: 'other data' }) + t.equal(m.size, 4) + + var x = /x/ + var y = /x/ + m.set(x, 'x regex') + m.set(y, 'y regex') + t.equal(m.get(x), 'x regex') + m.set(x, 'x again') + t.equal(m.get(x), 'x again') + t.equal(m.size, 6) + + m.set(NaN, 'not a number') + t.equal(m.get(NaN), 'not a number') + m.set(NaN, 'it is a ' + typeof NaN) + t.equal(m.get(NaN), 'it is a number') + m.set('NaN', 'stringie nan') + t.equal(m.get(NaN), 'it is a number') + t.equal(m.get('NaN'), 'stringie nan') + t.equal(m.size, 8) + + m.delete(NaN) + t.equal(m.get(NaN), undefined) + t.equal(m.size, 7) + + var expect = [ + { value: 'number 1', key: 1 }, + { value: 'string 1', key: '1' }, + { value: { some: 'data' }, key: {} }, + { value: { some: 'other data' }, key: {} }, + { value: 'x again', key: /x/ }, + { value: 'y regex', key: /x/ }, + { value: 'stringie nan', key: 'NaN' } + ] + var actual = [] + + m.forEach(function (value, key) { + actual.push({ value: value, key: key }) + }) + t.same(actual, expect) + + m.clear() + t.equal(m.size, 0) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/node_modules/yallist/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/node_modules/yallist/.npmignore new file mode 100644 index 00000000..534108e3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/node_modules/yallist/.npmignore @@ -0,0 +1,4 @@ +node_modules/ +coverage/ +.nyc_output/ +nyc_output/ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/node_modules/yallist/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/node_modules/yallist/.travis.yml new file mode 100644 index 00000000..9c1a7b6c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/node_modules/yallist/.travis.yml @@ -0,0 +1,7 @@ +sudo: false +language: node_js +node_js: + - '0.10' + - '0.12' + - '4' + - '5' diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/node_modules/yallist/CONTRIBUTING.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/node_modules/yallist/CONTRIBUTING.md new file mode 100644 index 00000000..5f51e6f1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/node_modules/yallist/CONTRIBUTING.md @@ -0,0 +1,4 @@ +1. The whole API is public. No underscore-prefixed pretend-private + things or hidden Object.create magic mumbo jumbo here. Plain old + objects that are created from constructors. +2. 100% test coverage must be maintained. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/node_modules/yallist/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/node_modules/yallist/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/node_modules/yallist/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/node_modules/yallist/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/node_modules/yallist/README.md new file mode 100644 index 00000000..f5861018 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/node_modules/yallist/README.md @@ -0,0 +1,204 @@ +# yallist + +Yet Another Linked List + +There are many doubly-linked list implementations like it, but this +one is mine. + +For when an array would be too big, and a Map can't be iterated in +reverse order. + + +[![Build Status](https://travis-ci.org/isaacs/yallist.svg?branch=master)](https://travis-ci.org/isaacs/yallist) [![Coverage Status](https://coveralls.io/repos/isaacs/yallist/badge.svg?service=github)](https://coveralls.io/github/isaacs/yallist) + +## basic usage + +```javascript +var yallist = require('yallist') +var myList = yallist.create([1, 2, 3]) +myList.push('foo') +myList.unshift('bar') +// of course pop() and shift() are there, too +console.log(myList.toArray()) // ['bar', 1, 2, 3, 'foo'] +myList.forEach(function (k) { + // walk the list head to tail +}) +myList.forEachReverse(function (k, index, list) { + // walk the list tail to head +}) +var myDoubledList = myList.map(function (k) { + return k + k +}) +// now myDoubledList contains ['barbar', 2, 4, 6, 'foofoo'] +// mapReverse is also a thing +var myDoubledListReverse = myList.mapReverse(function (k) { + return k + k +}) // ['foofoo', 6, 4, 2, 'barbar'] + +var reduced = myList.reduce(function (set, entry) { + set += entry + return set +}, 'start') +console.log(reduced) // 'startfoo123bar' +``` + +## api + +The whole API is considered "public". + +Functions with the same name as an Array method work more or less the +same way. + +There's reverse versions of most things because that's the point. + +### Yallist + +Default export, the class that holds and manages a list. + +Call it with either a forEach-able (like an array) or a set of +arguments, to initialize the list. + +The Array-ish methods all act like you'd expect. No magic length, +though, so if you change that it won't automatically prune or add +empty spots. + +### Yallist.create(..) + +Alias for Yallist function. Some people like factories. + +#### yallist.head + +The first node in the list + +#### yallist.tail + +The last node in the list + +#### yallist.length + +The number of nodes in the list. (Change this at your peril. It is +not magic like Array length.) + +#### yallist.toArray() + +Convert the list to an array. + +#### yallist.forEach(fn, [thisp]) + +Call a function on each item in the list. + +#### yallist.forEachReverse(fn, [thisp]) + +Call a function on each item in the list, in reverse order. + +#### yallist.get(n) + +Get the data at position `n` in the list. If you use this a lot, +probably better off just using an Array. + +#### yallist.getReverse(n) + +Get the data at position `n`, counting from the tail. + +#### yallist.map(fn, thisp) + +Create a new Yallist with the result of calling the function on each +item. + +#### yallist.mapReverse(fn, thisp) + +Same as `map`, but in reverse. + +#### yallist.pop() + +Get the data from the list tail, and remove the tail from the list. + +#### yallist.push(item, ...) + +Insert one or more items to the tail of the list. + +#### yallist.reduce(fn, initialValue) + +Like Array.reduce. + +#### yallist.reduceReverse + +Like Array.reduce, but in reverse. + +#### yallist.reverse + +Reverse the list in place. + +#### yallist.shift() + +Get the data from the list head, and remove the head from the list. + +#### yallist.slice([from], [to]) + +Just like Array.slice, but returns a new Yallist. + +#### yallist.sliceReverse([from], [to]) + +Just like yallist.slice, but the result is returned in reverse. + +#### yallist.toArray() + +Create an array representation of the list. + +#### yallist.toArrayReverse() + +Create a reversed array representation of the list. + +#### yallist.unshift(item, ...) + +Insert one or more items to the head of the list. + +#### yallist.unshiftNode(node) + +Move a Node object to the front of the list. (That is, pull it out of +wherever it lives, and make it the new head.) + +If the node belongs to a different list, then that list will remove it +first. + +#### yallist.pushNode(node) + +Move a Node object to the end of the list. (That is, pull it out of +wherever it lives, and make it the new tail.) + +If the node belongs to a list already, then that list will remove it +first. + +#### yallist.removeNode(node) + +Remove a node from the list, preserving referential integrity of head +and tail and other nodes. + +Will throw an error if you try to have a list remove a node that +doesn't belong to it. + +### Yallist.Node + +The class that holds the data and is actually the list. + +Call with `var n = new Node(value, previousNode, nextNode)` + +Note that if you do direct operations on Nodes themselves, it's very +easy to get into weird states where the list is broken. Be careful :) + +#### node.next + +The next node in the list. + +#### node.prev + +The previous node in the list. + +#### node.value + +The data the node contains. + +#### node.list + +The list to which this node belongs. (Null if it does not belong to +any list.) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/node_modules/yallist/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/node_modules/yallist/package.json new file mode 100644 index 00000000..18ba2147 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/node_modules/yallist/package.json @@ -0,0 +1,52 @@ +{ + "name": "yallist", + "version": "2.0.0", + "description": "Yet Another Linked List", + "main": "yallist.js", + "directories": { + "test": "test" + }, + "dependencies": {}, + "devDependencies": { + "tap": "^2.3.2" + }, + "scripts": { + "test": "tap test/*.js --cov" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/yallist.git" + }, + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "ISC", + "gitHead": "702eaba87deefa9f8fc2f8e36cb225bc2141fdc3", + "bugs": { + "url": "https://github.com/isaacs/yallist/issues" + }, + "homepage": "https://github.com/isaacs/yallist#readme", + "_id": "yallist@2.0.0", + "_shasum": "306c543835f09ee1a4cb23b7bce9ab341c91cdd4", + "_from": "yallist@>=2.0.0 <3.0.0", + "_npmVersion": "3.3.2", + "_nodeVersion": "4.0.0", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "dist": { + "shasum": "306c543835f09ee1a4cb23b7bce9ab341c91cdd4", + "tarball": "http://registry.npmjs.org/yallist/-/yallist-2.0.0.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "_resolved": "https://registry.npmjs.org/yallist/-/yallist-2.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/node_modules/yallist/test/basic.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/node_modules/yallist/test/basic.js new file mode 100644 index 00000000..3c8d1f48 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/node_modules/yallist/test/basic.js @@ -0,0 +1,188 @@ +var t = require('tap') +var Yallist = require('../yallist.js') + +var y = new Yallist(1,2,3,4,5) +var z = new Yallist([1,2,3,4,5]) +t.similar(y, z, 'build from single list or args') + +function add10 (i) { + return i + 10 +} +t.similar(y.map(add10).toArray(), [11, 12, 13, 14, 15]) +t.similar(y.mapReverse(add10).toArray(), [15, 14, 13, 12, 11]) + +t.similar(y.map(add10).toArrayReverse(), [15, 14, 13, 12, 11]) +t.isa(Yallist(1,2,3), 'Yallist') +t.equal(y.push(6, 7, 8), 8) +t.similar(y.toArray(), [1, 2, 3, 4, 5, 6, 7, 8]) +y.pop() +y.shift() +y.unshift(100) + +var expect = [100, 2, 3, 4, 5, 6, 7] +var expectReverse = [ 7, 6, 5, 4, 3, 2, 100 ] + +t.similar(y.toArray(), expect) +t.equal(y.length, y.toArray().length) + +t.test(function forEach (t) { + t.plan(y.length * 2) + y.forEach(function (item, i, list) { + t.equal(item, expect[i]) + t.equal(list, y) + }) +}) + +t.test(function forEach (t) { + t.plan(y.length * 5) + var n = 0 + y.forEachReverse(function (item, i, list) { + t.equal(item, expectReverse[n]) + t.equal(item, expect[i]) + t.equal(item, y.get(i)) + t.equal(item, y.getReverse(n)) + n += 1 + t.equal(list, y) + }) +}) + +t.equal(y.getReverse(100), undefined) + +t.equal(y.get(9999), undefined) + + +function sum (a, b) { return a + b } +t.equal(y.reduce(sum), 127) +t.equal(y.reduce(sum, 100), 227) +t.equal(y.reduceReverse(sum), 127) +t.equal(y.reduceReverse(sum, 100), 227) + +t.equal(Yallist().pop(), undefined) +t.equal(Yallist().shift(), undefined) + +var x = Yallist() +x.unshift(1) +t.equal(x.length, 1) +t.similar(x.toArray(), [1]) + +// verify that y.toArray() returns an array and if we create a +// new Yallist from that array, we get a list matching +t.similar(Yallist(y.toArray()), y) +t.similar(Yallist.apply(null, y.toArray()), y) + +t.throws(function () { + new Yallist().reduce(function () {}) +}, {}, new TypeError('Reduce of empty list with no initial value')) +t.throws(function () { + new Yallist().reduceReverse(function () {}) +}, {}, new TypeError('Reduce of empty list with no initial value')) + +var z = y.reverse() +t.equal(z, y) +t.similar(y.toArray(), expectReverse) +y.reverse() +t.similar(y.toArray(), expect) + +var a = Yallist(1,2,3,4,5,6) +var cases = [ + [ [2, 4], [3, 4] ], + [ [2, -4], [] ], + [ [2, -2], [3, 4] ], + [ [1, -2], [2, 3, 4] ], + [ [-1, -2], [] ], + [ [-5, -2], [2, 3, 4] ], + [ [-99, 2], [1, 2] ], + [ [5, 99], [6] ], + [ [], [1,2,3,4,5,6] ] +] +t.test('slice', function (t) { + t.plan(cases.length) + cases.forEach(function (c) { + t.test(JSON.stringify(c), function (t) { + t.similar(a.slice.apply(a, c[0]), Yallist(c[1])) + t.similar([].slice.apply(a.toArray(), c[0]), c[1]) + t.end() + }) + }) +}) + +t.test('sliceReverse', function (t) { + t.plan(cases.length) + cases.forEach(function (c) { + var rev = c[1].slice().reverse() + t.test(JSON.stringify([c[0], rev]), function (t) { + t.similar(a.sliceReverse.apply(a, c[0]), Yallist(rev)) + t.similar([].slice.apply(a.toArray(), c[0]).reverse(), rev) + t.end() + }) + }) +}) + +var inserter = Yallist(1,2,3,4,5) +inserter.unshiftNode(inserter.head.next) +t.similar(inserter.toArray(), [2,1,3,4,5]) +inserter.unshiftNode(inserter.tail) +t.similar(inserter.toArray(), [5,2,1,3,4]) +inserter.unshiftNode(inserter.head) +t.similar(inserter.toArray(), [5,2,1,3,4]) + +var single = Yallist(1) +single.unshiftNode(single.head) +t.similar(single.toArray(), [1]) + +inserter = Yallist(1,2,3,4,5) +inserter.pushNode(inserter.tail.prev) +t.similar(inserter.toArray(), [1,2,3,5,4]) +inserter.pushNode(inserter.head) +t.similar(inserter.toArray(), [2,3,5,4,1]) +inserter.unshiftNode(inserter.head) +t.similar(inserter.toArray(), [2,3,5,4,1]) + +single = Yallist(1) +single.pushNode(single.tail) +t.similar(single.toArray(), [1]) + +var swiped = Yallist(9,8,7) +inserter.unshiftNode(swiped.head.next) +t.similar(inserter.toArray(), [8,2,3,5,4,1]) +t.similar(swiped.toArray(), [9,7]) + +swiped = Yallist(9,8,7) +inserter.pushNode(swiped.head.next) +t.similar(inserter.toArray(), [8,2,3,5,4,1,8]) +t.similar(swiped.toArray(), [9,7]) + +swiped.unshiftNode(Yallist.Node(99)) +t.similar(swiped.toArray(), [99,9,7]) +swiped.pushNode(Yallist.Node(66)) +t.similar(swiped.toArray(), [99,9,7,66]) + +var e = Yallist() +e.unshiftNode(Yallist.Node(1)) +t.same(e.toArray(), [1]) +e = Yallist() +e.pushNode(Yallist.Node(1)) +t.same(e.toArray(), [1]) + +// steal them back, don't break the lists +swiped.unshiftNode(inserter.head) +t.same(swiped, Yallist(8,99,9,7,66)) +t.same(inserter, Yallist(2,3,5,4,1,8)) +swiped.unshiftNode(inserter.tail) +t.same(inserter, Yallist(2,3,5,4,1)) +t.same(swiped, Yallist(8,8,99,9,7,66)) + + +t.throws(function remove_foreign_node () { + e.removeNode(swiped.head) +}, {}, new Error('removing node which does not belong to this list')) +t.throws(function remove_unlisted_node () { + e.removeNode(Yallist.Node('nope')) +}, {}, new Error('removing node which does not belong to this list')) + +e = Yallist(1,2) +e.removeNode(e.head) +t.same(e, Yallist(2)) +e = Yallist(1,2) +e.removeNode(e.tail) +t.same(e, Yallist(1)) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/node_modules/yallist/yallist.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/node_modules/yallist/yallist.js new file mode 100644 index 00000000..fb60fc28 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/node_modules/yallist/yallist.js @@ -0,0 +1,360 @@ +module.exports = Yallist + +Yallist.Node = Node +Yallist.create = Yallist + +function Yallist (list) { + var self = this + if (!(self instanceof Yallist)) { + self = new Yallist() + } + + self.tail = null + self.head = null + self.length = 0 + + if (list && typeof list.forEach === 'function') { + list.forEach(function (item) { + self.push(item) + }) + } else if (arguments.length > 0) { + for (var i = 0, l = arguments.length; i < l; i++) { + self.push(arguments[i]) + } + } + + return self +} + +Yallist.prototype.removeNode = function (node) { + if (node.list !== this) { + throw new Error('removing node which does not belong to this list') + } + + var next = node.next + var prev = node.prev + + if (next) { + next.prev = prev + } + + if (prev) { + prev.next = next + } + + if (node === this.head) { + this.head = next + } + if (node === this.tail) { + this.tail = prev + } + + node.list.length -- + node.next = null + node.prev = null + node.list = null +} + +Yallist.prototype.unshiftNode = function (node) { + if (node === this.head) { + return + } + + if (node.list) { + node.list.removeNode(node) + } + + var head = this.head + node.list = this + node.next = head + if (head) { + head.prev = node + } + + this.head = node + if (!this.tail) { + this.tail = node + } + this.length ++ +} + +Yallist.prototype.pushNode = function (node) { + if (node === this.tail) { + return + } + + if (node.list) { + node.list.removeNode(node) + } + + var tail = this.tail + node.list = this + node.prev = tail + if (tail) { + tail.next = node + } + + this.tail = node + if (!this.head) { + this.head = node + } + this.length ++ +} + +Yallist.prototype.push = function () { + for (var i = 0, l = arguments.length; i < l; i++) { + push(this, arguments[i]) + } + return this.length +} + +Yallist.prototype.unshift = function () { + for (var i = 0, l = arguments.length; i < l; i++) { + unshift(this, arguments[i]) + } + return this.length +} + +Yallist.prototype.pop = function () { + if (!this.tail) + return undefined + + var res = this.tail.value + this.tail = this.tail.prev + this.tail.next = null + this.length -- + return res +} + +Yallist.prototype.shift = function () { + if (!this.head) + return undefined + + var res = this.head.value + this.head = this.head.next + this.head.prev = null + this.length -- + return res +} + +Yallist.prototype.forEach = function (fn, thisp) { + thisp = thisp || this + for (var walker = this.head, i = 0; walker !== null; i++) { + fn.call(thisp, walker.value, i, this) + walker = walker.next + } +} + +Yallist.prototype.forEachReverse = function (fn, thisp) { + thisp = thisp || this + for (var walker = this.tail, i = this.length - 1; walker !== null; i--) { + fn.call(thisp, walker.value, i, this) + walker = walker.prev + } +} + +Yallist.prototype.get = function (n) { + for (var i = 0, walker = this.head; walker !== null && i < n; i++) { + // abort out of the list early if we hit a cycle + walker = walker.next + } + if (i === n && walker !== null) { + return walker.value + } +} + +Yallist.prototype.getReverse = function (n) { + for (var i = 0, walker = this.tail; walker !== null && i < n; i++) { + // abort out of the list early if we hit a cycle + walker = walker.prev + } + if (i === n && walker !== null) { + return walker.value + } +} + +Yallist.prototype.map = function (fn, thisp) { + thisp = thisp || this + var res = new Yallist() + for (var walker = this.head; walker !== null; ) { + res.push(fn.call(thisp, walker.value, this)) + walker = walker.next + } + return res +} + +Yallist.prototype.mapReverse = function (fn, thisp) { + thisp = thisp || this + var res = new Yallist() + for (var walker = this.tail; walker !== null;) { + res.push(fn.call(thisp, walker.value, this)) + walker = walker.prev + } + return res +} + +Yallist.prototype.reduce = function (fn, initial) { + var acc + var walker = this.head + if (arguments.length > 1) { + acc = initial + } else if (this.head) { + walker = this.head.next + acc = this.head.value + } else { + throw new TypeError('Reduce of empty list with no initial value') + } + + for (var i = 0; walker !== null; i++) { + acc = fn(acc, walker.value, i) + walker = walker.next + } + + return acc +} + +Yallist.prototype.reduceReverse = function (fn, initial) { + var acc + var walker = this.tail + if (arguments.length > 1) { + acc = initial + } else if (this.tail) { + walker = this.tail.prev + acc = this.tail.value + } else { + throw new TypeError('Reduce of empty list with no initial value') + } + + for (var i = this.length - 1; walker !== null; i--) { + acc = fn(acc, walker.value, i) + walker = walker.prev + } + + return acc +} + +Yallist.prototype.toArray = function () { + var arr = new Array(this.length) + for (var i = 0, walker = this.head; walker !== null; i++) { + arr[i] = walker.value + walker = walker.next + } + return arr +} + +Yallist.prototype.toArrayReverse = function () { + var arr = new Array(this.length) + for (var i = 0, walker = this.tail; walker !== null; i++) { + arr[i] = walker.value + walker = walker.prev + } + return arr +} + +Yallist.prototype.slice = function (from, to) { + to = to || this.length + if (to < 0) { + to += this.length + } + from = from || 0 + if (from < 0) { + from += this.length + } + var ret = new Yallist() + if (to < from || to < 0) { + return ret + } + if (from < 0) { + from = 0 + } + if (to > this.length) { + to = this.length + } + for (var i = 0, walker = this.head; walker !== null && i < from; i++) { + walker = walker.next + } + for (; walker !== null && i < to; i++, walker = walker.next) { + ret.push(walker.value) + } + return ret +} + +Yallist.prototype.sliceReverse = function (from, to) { + to = to || this.length + if (to < 0) { + to += this.length + } + from = from || 0 + if (from < 0) { + from += this.length + } + var ret = new Yallist() + if (to < from || to < 0) { + return ret + } + if (from < 0) { + from = 0 + } + if (to > this.length) { + to = this.length + } + for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) { + walker = walker.prev + } + for (; walker !== null && i > from; i--, walker = walker.prev) { + ret.push(walker.value) + } + return ret +} + +Yallist.prototype.reverse = function () { + var head = this.head + var tail = this.tail + for (var walker = head; walker !== null; walker = walker.prev) { + var p = walker.prev + walker.prev = walker.next + walker.next = p + } + this.head = tail + this.tail = head + return this +} + +function push (self, item) { + self.tail = new Node(item, self.tail, null, self) + if (!self.head) { + self.head = self.tail + } + self.length ++ +} + +function unshift (self, item) { + self.head = new Node(item, null, self.head, self) + if (!self.tail) { + self.tail = self.head + } + self.length ++ +} + +function Node (value, prev, next, list) { + if (!(this instanceof Node)) { + return new Node(value, prev, next, list) + } + + this.list = list + this.value = value + + if (prev) { + prev.next = this + this.prev = prev + } else { + this.prev = null + } + + if (next) { + next.prev = this + this.next = next + } else { + this.next = null + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/package.json new file mode 100644 index 00000000..47aedc7b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/lru-cache/package.json @@ -0,0 +1,70 @@ +{ + "name": "lru-cache", + "description": "A cache object that deletes the least-recently-used items.", + "version": "4.0.1", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me" + }, + "keywords": [ + "mru", + "lru", + "cache" + ], + "scripts": { + "test": "tap test --branches=100 --functions=100 --lines=100 --statements=100", + "posttest": "standard test/*.js lib/*.js" + }, + "main": "lib/lru-cache.js", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-lru-cache.git" + }, + "devDependencies": { + "standard": "^5.4.1", + "tap": "^5.1.1" + }, + "license": "ISC", + "dependencies": { + "pseudomap": "^1.0.1", + "yallist": "^2.0.0" + }, + "files": [ + "lib/lru-cache.js" + ], + "gitHead": "6cd8c8a43cf56c585bdb696faae94f9836cb9e28", + "bugs": { + "url": "https://github.com/isaacs/node-lru-cache/issues" + }, + "homepage": "https://github.com/isaacs/node-lru-cache#readme", + "_id": "lru-cache@4.0.1", + "_shasum": "1343955edaf2e37d9b9e7ee7241e27c4b9fb72be", + "_from": "lru-cache@4.0.1", + "_npmVersion": "3.7.3", + "_nodeVersion": "5.6.0", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "dist": { + "shasum": "1343955edaf2e37d9b9e7ee7241e27c4b9fb72be", + "tarball": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.0.1.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + } + ], + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/lru-cache-4.0.1.tgz_1458667372415_0.8005518841091543" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.0.1.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/README.md new file mode 100644 index 00000000..ad72b813 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/README.md @@ -0,0 +1,209 @@ +# minimatch + +A minimal matching utility. + +[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.svg)](http://travis-ci.org/isaacs/minimatch) + + +This is the matching library used internally by npm. + +It works by converting glob expressions into JavaScript `RegExp` +objects. + +## Usage + +```javascript +var minimatch = require("minimatch") + +minimatch("bar.foo", "*.foo") // true! +minimatch("bar.foo", "*.bar") // false! +minimatch("bar.foo", "*.+(bar|foo)", { debug: true }) // true, and noisy! +``` + +## Features + +Supports these glob features: + +* Brace Expansion +* Extended glob matching +* "Globstar" `**` matching + +See: + +* `man sh` +* `man bash` +* `man 3 fnmatch` +* `man 5 gitignore` + +## Minimatch Class + +Create a minimatch object by instantiating the `minimatch.Minimatch` class. + +```javascript +var Minimatch = require("minimatch").Minimatch +var mm = new Minimatch(pattern, options) +``` + +### Properties + +* `pattern` The original pattern the minimatch object represents. +* `options` The options supplied to the constructor. +* `set` A 2-dimensional array of regexp or string expressions. + Each row in the + array corresponds to a brace-expanded pattern. Each item in the row + corresponds to a single path-part. For example, the pattern + `{a,b/c}/d` would expand to a set of patterns like: + + [ [ a, d ] + , [ b, c, d ] ] + + If a portion of the pattern doesn't have any "magic" in it + (that is, it's something like `"foo"` rather than `fo*o?`), then it + will be left as a string rather than converted to a regular + expression. + +* `regexp` Created by the `makeRe` method. A single regular expression + expressing the entire pattern. This is useful in cases where you wish + to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled. +* `negate` True if the pattern is negated. +* `comment` True if the pattern is a comment. +* `empty` True if the pattern is `""`. + +### Methods + +* `makeRe` Generate the `regexp` member if necessary, and return it. + Will return `false` if the pattern is invalid. +* `match(fname)` Return true if the filename matches the pattern, or + false otherwise. +* `matchOne(fileArray, patternArray, partial)` Take a `/`-split + filename, and match it against a single row in the `regExpSet`. This + method is mainly for internal use, but is exposed so that it can be + used by a glob-walker that needs to avoid excessive filesystem calls. + +All other methods are internal, and will be called as necessary. + +### minimatch(path, pattern, options) + +Main export. Tests a path against the pattern using the options. + +```javascript +var isJS = minimatch(file, "*.js", { matchBase: true }) +``` + +### minimatch.filter(pattern, options) + +Returns a function that tests its +supplied argument, suitable for use with `Array.filter`. Example: + +```javascript +var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true})) +``` + +### minimatch.match(list, pattern, options) + +Match against the list of +files, in the style of fnmatch or glob. If nothing is matched, and +options.nonull is set, then return a list containing the pattern itself. + +```javascript +var javascripts = minimatch.match(fileList, "*.js", {matchBase: true})) +``` + +### minimatch.makeRe(pattern, options) + +Make a regular expression object from the pattern. + +## Options + +All options are `false` by default. + +### debug + +Dump a ton of stuff to stderr. + +### nobrace + +Do not expand `{a,b}` and `{1..3}` brace sets. + +### noglobstar + +Disable `**` matching against multiple folder names. + +### dot + +Allow patterns to match filenames starting with a period, even if +the pattern does not explicitly have a period in that spot. + +Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot` +is set. + +### noext + +Disable "extglob" style patterns like `+(a|b)`. + +### nocase + +Perform a case-insensitive match. + +### nonull + +When a match is not found by `minimatch.match`, return a list containing +the pattern itself if this option is set. When not set, an empty list +is returned if there are no matches. + +### matchBase + +If set, then patterns without slashes will be matched +against the basename of the path if it contains slashes. For example, +`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. + +### nocomment + +Suppress the behavior of treating `#` at the start of a pattern as a +comment. + +### nonegate + +Suppress the behavior of treating a leading `!` character as negation. + +### flipNegate + +Returns from negate expressions the same as if they were not negated. +(Ie, true on a hit, false on a miss.) + + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between minimatch and other +implementations, and are intentional. + +If the pattern starts with a `!` character, then it is negated. Set the +`nonegate` flag to suppress this behavior, and treat leading `!` +characters normally. This is perhaps relevant if you wish to start the +pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` +characters at the start of a pattern will negate the pattern multiple +times. + +If a pattern starts with `#`, then it is treated as a comment, and +will not match anything. Use `\#` to match a literal `#` at the +start of a line, or set the `nocomment` flag to suppress this behavior. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.1, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then minimatch.match returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/minimatch.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/minimatch.js new file mode 100644 index 00000000..5b5f8cf4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/minimatch.js @@ -0,0 +1,923 @@ +module.exports = minimatch +minimatch.Minimatch = Minimatch + +var path = { sep: '/' } +try { + path = require('path') +} catch (er) {} + +var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} +var expand = require('brace-expansion') + +var plTypes = { + '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, + '?': { open: '(?:', close: ')?' }, + '+': { open: '(?:', close: ')+' }, + '*': { open: '(?:', close: ')*' }, + '@': { open: '(?:', close: ')' } +} + +// any single thing other than / +// don't need to escape / when using new RegExp() +var qmark = '[^/]' + +// * => any number of characters +var star = qmark + '*?' + +// ** when dots are allowed. Anything goes, except .. and . +// not (^ or / followed by one or two dots followed by $ or /), +// followed by anything, any number of times. +var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' + +// not a ^ or / followed by a dot, +// followed by anything, any number of times. +var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' + +// characters that need to be escaped in RegExp. +var reSpecials = charSet('().*{}+?[]^$\\!') + +// "abc" -> { a:true, b:true, c:true } +function charSet (s) { + return s.split('').reduce(function (set, c) { + set[c] = true + return set + }, {}) +} + +// normalizes slashes. +var slashSplit = /\/+/ + +minimatch.filter = filter +function filter (pattern, options) { + options = options || {} + return function (p, i, list) { + return minimatch(p, pattern, options) + } +} + +function ext (a, b) { + a = a || {} + b = b || {} + var t = {} + Object.keys(b).forEach(function (k) { + t[k] = b[k] + }) + Object.keys(a).forEach(function (k) { + t[k] = a[k] + }) + return t +} + +minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return minimatch + + var orig = minimatch + + var m = function minimatch (p, pattern, options) { + return orig.minimatch(p, pattern, ext(def, options)) + } + + m.Minimatch = function Minimatch (pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)) + } + + return m +} + +Minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return Minimatch + return minimatch.defaults(def).Minimatch +} + +function minimatch (p, pattern, options) { + if (typeof pattern !== 'string') { + throw new TypeError('glob pattern string required') + } + + if (!options) options = {} + + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + return false + } + + // "" only matches "" + if (pattern.trim() === '') return p === '' + + return new Minimatch(pattern, options).match(p) +} + +function Minimatch (pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options) + } + + if (typeof pattern !== 'string') { + throw new TypeError('glob pattern string required') + } + + if (!options) options = {} + pattern = pattern.trim() + + // windows support: need to use /, not \ + if (path.sep !== '/') { + pattern = pattern.split(path.sep).join('/') + } + + this.options = options + this.set = [] + this.pattern = pattern + this.regexp = null + this.negate = false + this.comment = false + this.empty = false + + // make the set of regexps etc. + this.make() +} + +Minimatch.prototype.debug = function () {} + +Minimatch.prototype.make = make +function make () { + // don't do it more than once. + if (this._made) return + + var pattern = this.pattern + var options = this.options + + // empty patterns and comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + this.comment = true + return + } + if (!pattern) { + this.empty = true + return + } + + // step 1: figure out negation, etc. + this.parseNegate() + + // step 2: expand braces + var set = this.globSet = this.braceExpand() + + if (options.debug) this.debug = console.error + + this.debug(this.pattern, set) + + // step 3: now we have a set, so turn each one into a series of path-portion + // matching patterns. + // These will be regexps, except in the case of "**", which is + // set to the GLOBSTAR object for globstar behavior, + // and will not contain any / characters + set = this.globParts = set.map(function (s) { + return s.split(slashSplit) + }) + + this.debug(this.pattern, set) + + // glob --> regexps + set = set.map(function (s, si, set) { + return s.map(this.parse, this) + }, this) + + this.debug(this.pattern, set) + + // filter out everything that didn't compile properly. + set = set.filter(function (s) { + return s.indexOf(false) === -1 + }) + + this.debug(this.pattern, set) + + this.set = set +} + +Minimatch.prototype.parseNegate = parseNegate +function parseNegate () { + var pattern = this.pattern + var negate = false + var options = this.options + var negateOffset = 0 + + if (options.nonegate) return + + for (var i = 0, l = pattern.length + ; i < l && pattern.charAt(i) === '!' + ; i++) { + negate = !negate + negateOffset++ + } + + if (negateOffset) this.pattern = pattern.substr(negateOffset) + this.negate = negate +} + +// Brace expansion: +// a{b,c}d -> abd acd +// a{b,}c -> abc ac +// a{0..3}d -> a0d a1d a2d a3d +// a{b,c{d,e}f}g -> abg acdfg acefg +// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg +// +// Invalid sets are not expanded. +// a{2..}b -> a{2..}b +// a{b}c -> a{b}c +minimatch.braceExpand = function (pattern, options) { + return braceExpand(pattern, options) +} + +Minimatch.prototype.braceExpand = braceExpand + +function braceExpand (pattern, options) { + if (!options) { + if (this instanceof Minimatch) { + options = this.options + } else { + options = {} + } + } + + pattern = typeof pattern === 'undefined' + ? this.pattern : pattern + + if (typeof pattern === 'undefined') { + throw new TypeError('undefined pattern') + } + + if (options.nobrace || + !pattern.match(/\{.*\}/)) { + // shortcut. no need to expand. + return [pattern] + } + + return expand(pattern) +} + +// parse a component of the expanded set. +// At this point, no pattern may contain "/" in it +// so we're going to return a 2d array, where each entry is the full +// pattern, split on '/', and then turned into a regular expression. +// A regexp is made at the end which joins each array with an +// escaped /, and another full one which joins each regexp with |. +// +// Following the lead of Bash 4.1, note that "**" only has special meaning +// when it is the *only* thing in a path portion. Otherwise, any series +// of * is equivalent to a single *. Globstar behavior is enabled by +// default, and can be disabled by setting options.noglobstar. +Minimatch.prototype.parse = parse +var SUBPARSE = {} +function parse (pattern, isSub) { + if (pattern.length > 1024 * 64) { + throw new TypeError('pattern is too long') + } + + var options = this.options + + // shortcuts + if (!options.noglobstar && pattern === '**') return GLOBSTAR + if (pattern === '') return '' + + var re = '' + var hasMagic = !!options.nocase + var escaping = false + // ? => one single character + var patternListStack = [] + var negativeLists = [] + var stateChar + var inClass = false + var reClassStart = -1 + var classStart = -1 + // . and .. never match anything that doesn't start with ., + // even when options.dot is set. + var patternStart = pattern.charAt(0) === '.' ? '' // anything + // not (start or / followed by . or .. followed by / or end) + : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' + : '(?!\\.)' + var self = this + + function clearStateChar () { + if (stateChar) { + // we had some state-tracking character + // that wasn't consumed by this pass. + switch (stateChar) { + case '*': + re += star + hasMagic = true + break + case '?': + re += qmark + hasMagic = true + break + default: + re += '\\' + stateChar + break + } + self.debug('clearStateChar %j %j', stateChar, re) + stateChar = false + } + } + + for (var i = 0, len = pattern.length, c + ; (i < len) && (c = pattern.charAt(i)) + ; i++) { + this.debug('%s\t%s %s %j', pattern, i, re, c) + + // skip over any that are escaped. + if (escaping && reSpecials[c]) { + re += '\\' + c + escaping = false + continue + } + + switch (c) { + case '/': + // completely not allowed, even escaped. + // Should already be path-split by now. + return false + + case '\\': + clearStateChar() + escaping = true + continue + + // the various stateChar values + // for the "extglob" stuff. + case '?': + case '*': + case '+': + case '@': + case '!': + this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) + + // all of those are literals inside a class, except that + // the glob [!a] means [^a] in regexp + if (inClass) { + this.debug(' in class') + if (c === '!' && i === classStart + 1) c = '^' + re += c + continue + } + + // if we already have a stateChar, then it means + // that there was something like ** or +? in there. + // Handle the stateChar, then proceed with this one. + self.debug('call clearStateChar %j', stateChar) + clearStateChar() + stateChar = c + // if extglob is disabled, then +(asdf|foo) isn't a thing. + // just clear the statechar *now*, rather than even diving into + // the patternList stuff. + if (options.noext) clearStateChar() + continue + + case '(': + if (inClass) { + re += '(' + continue + } + + if (!stateChar) { + re += '\\(' + continue + } + + patternListStack.push({ + type: stateChar, + start: i - 1, + reStart: re.length, + open: plTypes[stateChar].open, + close: plTypes[stateChar].close + }) + // negation is (?:(?!js)[^/]*) + re += stateChar === '!' ? '(?:(?!(?:' : '(?:' + this.debug('plType %j %j', stateChar, re) + stateChar = false + continue + + case ')': + if (inClass || !patternListStack.length) { + re += '\\)' + continue + } + + clearStateChar() + hasMagic = true + var pl = patternListStack.pop() + // negation is (?:(?!js)[^/]*) + // The others are (?:) + re += pl.close + if (pl.type === '!') { + negativeLists.push(pl) + } + pl.reEnd = re.length + continue + + case '|': + if (inClass || !patternListStack.length || escaping) { + re += '\\|' + escaping = false + continue + } + + clearStateChar() + re += '|' + continue + + // these are mostly the same in regexp and glob + case '[': + // swallow any state-tracking char before the [ + clearStateChar() + + if (inClass) { + re += '\\' + c + continue + } + + inClass = true + classStart = i + reClassStart = re.length + re += c + continue + + case ']': + // a right bracket shall lose its special + // meaning and represent itself in + // a bracket expression if it occurs + // first in the list. -- POSIX.2 2.8.3.2 + if (i === classStart + 1 || !inClass) { + re += '\\' + c + escaping = false + continue + } + + // handle the case where we left a class open. + // "[z-a]" is valid, equivalent to "\[z-a\]" + if (inClass) { + // split where the last [ was, make sure we don't have + // an invalid re. if so, re-walk the contents of the + // would-be class to re-translate any characters that + // were passed through as-is + // TODO: It would probably be faster to determine this + // without a try/catch and a new RegExp, but it's tricky + // to do safely. For now, this is safe and works. + var cs = pattern.substring(classStart + 1, i) + try { + RegExp('[' + cs + ']') + } catch (er) { + // not a valid class! + var sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' + hasMagic = hasMagic || sp[1] + inClass = false + continue + } + } + + // finish up the class. + hasMagic = true + inClass = false + re += c + continue + + default: + // swallow any state char that wasn't consumed + clearStateChar() + + if (escaping) { + // no need + escaping = false + } else if (reSpecials[c] + && !(c === '^' && inClass)) { + re += '\\' + } + + re += c + + } // switch + } // for + + // handle the case where we left a class open. + // "[abc" is valid, equivalent to "\[abc" + if (inClass) { + // split where the last [ was, and escape it + // this is a huge pita. We now have to re-walk + // the contents of the would-be class to re-translate + // any characters that were passed through as-is + cs = pattern.substr(classStart + 1) + sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + hasMagic = hasMagic || sp[1] + } + + // handle the case where we had a +( thing at the *end* + // of the pattern. + // each pattern list stack adds 3 chars, and we need to go through + // and escape any | chars that were passed through as-is for the regexp. + // Go through and escape them, taking care not to double-escape any + // | chars that were already escaped. + for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { + var tail = re.slice(pl.reStart + pl.open.length) + this.debug('setting tail', re, pl) + // maybe some even number of \, then maybe 1 \, followed by a | + tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { + if (!$2) { + // the | isn't already escaped, so escape it. + $2 = '\\' + } + + // need to escape all those slashes *again*, without escaping the + // one that we need for escaping the | character. As it works out, + // escaping an even number of slashes can be done by simply repeating + // it exactly after itself. That's why this trick works. + // + // I am sorry that you have to see this. + return $1 + $1 + $2 + '|' + }) + + this.debug('tail=%j\n %s', tail, tail, pl, re) + var t = pl.type === '*' ? star + : pl.type === '?' ? qmark + : '\\' + pl.type + + hasMagic = true + re = re.slice(0, pl.reStart) + t + '\\(' + tail + } + + // handle trailing things that only matter at the very end. + clearStateChar() + if (escaping) { + // trailing \\ + re += '\\\\' + } + + // only need to apply the nodot start if the re starts with + // something that could conceivably capture a dot + var addPatternStart = false + switch (re.charAt(0)) { + case '.': + case '[': + case '(': addPatternStart = true + } + + // Hack to work around lack of negative lookbehind in JS + // A pattern like: *.!(x).!(y|z) needs to ensure that a name + // like 'a.xyz.yz' doesn't match. So, the first negative + // lookahead, has to look ALL the way ahead, to the end of + // the pattern. + for (var n = negativeLists.length - 1; n > -1; n--) { + var nl = negativeLists[n] + + var nlBefore = re.slice(0, nl.reStart) + var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) + var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + var nlAfter = re.slice(nl.reEnd) + + nlLast += nlAfter + + // Handle nested stuff like *(*.js|!(*.json)), where open parens + // mean that we should *not* include the ) in the bit that is considered + // "after" the negated section. + var openParensBefore = nlBefore.split('(').length - 1 + var cleanAfter = nlAfter + for (i = 0; i < openParensBefore; i++) { + cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') + } + nlAfter = cleanAfter + + var dollar = '' + if (nlAfter === '' && isSub !== SUBPARSE) { + dollar = '$' + } + var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast + re = newRe + } + + // if the re is not "" at this point, then we need to make sure + // it doesn't match against an empty path part. + // Otherwise a/* will match a/, which it should not. + if (re !== '' && hasMagic) { + re = '(?=.)' + re + } + + if (addPatternStart) { + re = patternStart + re + } + + // parsing just a piece of a larger pattern. + if (isSub === SUBPARSE) { + return [re, hasMagic] + } + + // skip the regexp for non-magical patterns + // unescape anything in it, though, so that it'll be + // an exact match against a file etc. + if (!hasMagic) { + return globUnescape(pattern) + } + + var flags = options.nocase ? 'i' : '' + try { + var regExp = new RegExp('^' + re + '$', flags) + } catch (er) { + // If it was an invalid regular expression, then it can't match + // anything. This trick looks for a character after the end of + // the string, which is of course impossible, except in multi-line + // mode, but it's not a /m regex. + return new RegExp('$.') + } + + regExp._glob = pattern + regExp._src = re + + return regExp +} + +minimatch.makeRe = function (pattern, options) { + return new Minimatch(pattern, options || {}).makeRe() +} + +Minimatch.prototype.makeRe = makeRe +function makeRe () { + if (this.regexp || this.regexp === false) return this.regexp + + // at this point, this.set is a 2d array of partial + // pattern strings, or "**". + // + // It's better to use .match(). This function shouldn't + // be used, really, but it's pretty convenient sometimes, + // when you just want to work with a regex. + var set = this.set + + if (!set.length) { + this.regexp = false + return this.regexp + } + var options = this.options + + var twoStar = options.noglobstar ? star + : options.dot ? twoStarDot + : twoStarNoDot + var flags = options.nocase ? 'i' : '' + + var re = set.map(function (pattern) { + return pattern.map(function (p) { + return (p === GLOBSTAR) ? twoStar + : (typeof p === 'string') ? regExpEscape(p) + : p._src + }).join('\\\/') + }).join('|') + + // must match entire pattern + // ending in a * or ** will make it less strict. + re = '^(?:' + re + ')$' + + // can match anything, as long as it's not this. + if (this.negate) re = '^(?!' + re + ').*$' + + try { + this.regexp = new RegExp(re, flags) + } catch (ex) { + this.regexp = false + } + return this.regexp +} + +minimatch.match = function (list, pattern, options) { + options = options || {} + var mm = new Minimatch(pattern, options) + list = list.filter(function (f) { + return mm.match(f) + }) + if (mm.options.nonull && !list.length) { + list.push(pattern) + } + return list +} + +Minimatch.prototype.match = match +function match (f, partial) { + this.debug('match', f, this.pattern) + // short-circuit in the case of busted things. + // comments, etc. + if (this.comment) return false + if (this.empty) return f === '' + + if (f === '/' && partial) return true + + var options = this.options + + // windows: need to use /, not \ + if (path.sep !== '/') { + f = f.split(path.sep).join('/') + } + + // treat the test path as a set of pathparts. + f = f.split(slashSplit) + this.debug(this.pattern, 'split', f) + + // just ONE of the pattern sets in this.set needs to match + // in order for it to be valid. If negating, then just one + // match means that we have failed. + // Either way, return on the first hit. + + var set = this.set + this.debug(this.pattern, 'set', set) + + // Find the basename of the path by looking for the last non-empty segment + var filename + var i + for (i = f.length - 1; i >= 0; i--) { + filename = f[i] + if (filename) break + } + + for (i = 0; i < set.length; i++) { + var pattern = set[i] + var file = f + if (options.matchBase && pattern.length === 1) { + file = [filename] + } + var hit = this.matchOne(file, pattern, partial) + if (hit) { + if (options.flipNegate) return true + return !this.negate + } + } + + // didn't get any hits. this is success if it's a negative + // pattern, failure otherwise. + if (options.flipNegate) return false + return this.negate +} + +// set partial to true to test if, for example, +// "/a/b" matches the start of "/*/b/*/d" +// Partial means, if you run out of file before you run +// out of pattern, then that's fine, as long as all +// the parts match. +Minimatch.prototype.matchOne = function (file, pattern, partial) { + var options = this.options + + this.debug('matchOne', + { 'this': this, file: file, pattern: pattern }) + + this.debug('matchOne', file.length, pattern.length) + + for (var fi = 0, + pi = 0, + fl = file.length, + pl = pattern.length + ; (fi < fl) && (pi < pl) + ; fi++, pi++) { + this.debug('matchOne loop') + var p = pattern[pi] + var f = file[fi] + + this.debug(pattern, p, f) + + // should be impossible. + // some invalid regexp stuff in the set. + if (p === false) return false + + if (p === GLOBSTAR) { + this.debug('GLOBSTAR', [pattern, p, f]) + + // "**" + // a/**/b/**/c would match the following: + // a/b/x/y/z/c + // a/x/y/z/b/c + // a/b/x/b/x/c + // a/b/c + // To do this, take the rest of the pattern after + // the **, and see if it would match the file remainder. + // If so, return success. + // If not, the ** "swallows" a segment, and try again. + // This is recursively awful. + // + // a/**/b/**/c matching a/b/x/y/z/c + // - a matches a + // - doublestar + // - matchOne(b/x/y/z/c, b/**/c) + // - b matches b + // - doublestar + // - matchOne(x/y/z/c, c) -> no + // - matchOne(y/z/c, c) -> no + // - matchOne(z/c, c) -> no + // - matchOne(c, c) yes, hit + var fr = fi + var pr = pi + 1 + if (pr === pl) { + this.debug('** at the end') + // a ** at the end will just swallow the rest. + // We have found a match. + // however, it will not swallow /.x, unless + // options.dot is set. + // . and .. are *never* matched by **, for explosively + // exponential reasons. + for (; fi < fl; fi++) { + if (file[fi] === '.' || file[fi] === '..' || + (!options.dot && file[fi].charAt(0) === '.')) return false + } + return true + } + + // ok, let's see if we can swallow whatever we can. + while (fr < fl) { + var swallowee = file[fr] + + this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) + + // XXX remove this slice. Just pass the start index. + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug('globstar found match!', fr, fl, swallowee) + // found a match. + return true + } else { + // can't swallow "." or ".." ever. + // can only swallow ".foo" when explicitly asked. + if (swallowee === '.' || swallowee === '..' || + (!options.dot && swallowee.charAt(0) === '.')) { + this.debug('dot detected!', file, fr, pattern, pr) + break + } + + // ** swallows a segment, and continue. + this.debug('globstar swallow a segment, and continue') + fr++ + } + } + + // no match was found. + // However, in partial mode, we can't say this is necessarily over. + // If there's more *pattern* left, then + if (partial) { + // ran out of file + this.debug('\n>>> no match, partial?', file, fr, pattern, pr) + if (fr === fl) return true + } + return false + } + + // something other than ** + // non-magic patterns just have to match exactly + // patterns with magic have been turned into regexps. + var hit + if (typeof p === 'string') { + if (options.nocase) { + hit = f.toLowerCase() === p.toLowerCase() + } else { + hit = f === p + } + this.debug('string match', p, f, hit) + } else { + hit = f.match(p) + this.debug('pattern match', p, f, hit) + } + + if (!hit) return false + } + + // Note: ending in / means that we'll get a final "" + // at the end of the pattern. This can only match a + // corresponding "" at the end of the file. + // If the file ends in /, then it can only match a + // a pattern that ends in /, unless the pattern just + // doesn't have any more for it. But, a/b/ should *not* + // match "a/b/*", even though "" matches against the + // [^/]*? pattern, except in partial mode, where it might + // simply not be reached yet. + // However, a/b/ should still satisfy a/* + + // now either we fell off the end of the pattern, or we're done. + if (fi === fl && pi === pl) { + // ran out of pattern and filename at the same time. + // an exact hit! + return true + } else if (fi === fl) { + // ran out of file, but still had pattern left. + // this is ok if we're doing the match as part of + // a glob fs traversal. + return partial + } else if (pi === pl) { + // ran out of pattern, still have file left. + // this is only acceptable if we're on the very last + // empty segment of a file with a trailing slash. + // a/* should match a/b/ + var emptyFileEnd = (fi === fl - 1) && (file[fi] === '') + return emptyFileEnd + } + + // should be unreachable. + throw new Error('wtf?') +} + +// replace stuff like \* with * +function globUnescape (s) { + return s.replace(/\\(.)/g, '$1') +} + +function regExpEscape (s) { + return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/README.md new file mode 100644 index 00000000..17939297 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/README.md @@ -0,0 +1,122 @@ +# brace-expansion + +[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), +as known from sh/bash, in JavaScript. + +[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) +[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) + +[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) + +## Example + +```js +var expand = require('brace-expansion'); + +expand('file-{a,b,c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('-v{,,}') +// => ['-v', '-v', '-v'] + +expand('file{0..2}.jpg') +// => ['file0.jpg', 'file1.jpg', 'file2.jpg'] + +expand('file-{a..c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('file{2..0}.jpg') +// => ['file2.jpg', 'file1.jpg', 'file0.jpg'] + +expand('file{0..4..2}.jpg') +// => ['file0.jpg', 'file2.jpg', 'file4.jpg'] + +expand('file-{a..e..2}.jpg') +// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] + +expand('file{00..10..5}.jpg') +// => ['file00.jpg', 'file05.jpg', 'file10.jpg'] + +expand('{{A..C},{a..c}}') +// => ['A', 'B', 'C', 'a', 'b', 'c'] + +expand('ppp{,config,oe{,conf}}') +// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] +``` + +## API + +```js +var expand = require('brace-expansion'); +``` + +### var expanded = expand(str) + +Return an array of all possible and valid expansions of `str`. If none are +found, `[str]` is returned. + +Valid expansions are: + +```js +/^(.*,)+(.+)?$/ +// {a,b,...} +``` + +A comma seperated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +A numeric sequence from `x` to `y` inclusive, with optional increment. +If `x` or `y` start with a leading `0`, all the numbers will be padded +to have equal length. Negative numbers and backwards iteration work too. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +An alphabetic sequence from `x` to `y` inclusive, with optional increment. +`x` and `y` must be exactly one character, and if given, `incr` must be a +number. + +For compatibility reasons, the string `${` is not eligible for brace expansion. + +## Installation + +With [npm](https://npmjs.org) do: + +```bash +npm install brace-expansion +``` + +## Contributors + +- [Julian Gruber](https://github.com/juliangruber) +- [Isaac Z. Schlueter](https://github.com/isaacs) + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/index.js new file mode 100644 index 00000000..955f27c8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/index.js @@ -0,0 +1,201 @@ +var concatMap = require('concat-map'); +var balanced = require('balanced-match'); + +module.exports = expandTop; + +var escSlash = '\0SLASH'+Math.random()+'\0'; +var escOpen = '\0OPEN'+Math.random()+'\0'; +var escClose = '\0CLOSE'+Math.random()+'\0'; +var escComma = '\0COMMA'+Math.random()+'\0'; +var escPeriod = '\0PERIOD'+Math.random()+'\0'; + +function numeric(str) { + return parseInt(str, 10) == str + ? parseInt(str, 10) + : str.charCodeAt(0); +} + +function escapeBraces(str) { + return str.split('\\\\').join(escSlash) + .split('\\{').join(escOpen) + .split('\\}').join(escClose) + .split('\\,').join(escComma) + .split('\\.').join(escPeriod); +} + +function unescapeBraces(str) { + return str.split(escSlash).join('\\') + .split(escOpen).join('{') + .split(escClose).join('}') + .split(escComma).join(',') + .split(escPeriod).join('.'); +} + + +// Basically just str.split(","), but handling cases +// where we have nested braced sections, which should be +// treated as individual members, like {a,{b,c},d} +function parseCommaParts(str) { + if (!str) + return ['']; + + var parts = []; + var m = balanced('{', '}', str); + + if (!m) + return str.split(','); + + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(','); + + p[p.length-1] += '{' + body + '}'; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length-1] += postParts.shift(); + p.push.apply(p, postParts); + } + + parts.push.apply(parts, p); + + return parts; +} + +function expandTop(str) { + if (!str) + return []; + + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.substr(0, 2) === '{}') { + str = '\\{\\}' + str.substr(2); + } + + return expand(escapeBraces(str), true).map(unescapeBraces); +} + +function identity(e) { + return e; +} + +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} + +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} + +function expand(str, isTop) { + var expansions = []; + + var m = balanced('{', '}', str); + if (!m || /\$$/.test(m.pre)) return [str]; + + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = /^(.*,)+(.+)?$/.test(m.body); + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,.*\}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand(str); + } + return [str]; + } + + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + var post = m.post.length + ? expand(m.post, false) + : ['']; + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } + } + } + + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. + + // no need to expand pre, since it is guaranteed to be free of brace-sets + var pre = m.pre; + var post = m.post.length + ? expand(m.post, false) + : ['']; + + var N; + + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length) + var incr = n.length == 3 + ? Math.abs(numeric(n[2])) + : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + var pad = n.some(isPadded); + + N = []; + + for (var i = x; test(i, y); i += incr) { + var c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') + c = ''; + } else { + c = String(i); + if (pad) { + var need = width - c.length; + if (need > 0) { + var z = new Array(need + 1).join('0'); + if (i < 0) + c = '-' + z + c.slice(1); + else + c = z + c; + } + } + } + N.push(c); + } + } else { + N = concatMap(n, function(el) { return expand(el, false) }); + } + + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } + } + + return expansions; +} + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore new file mode 100644 index 00000000..ae5d8c36 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore @@ -0,0 +1,5 @@ +test +.gitignore +.travis.yml +Makefile +example.js diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md new file mode 100644 index 00000000..2cdc8e41 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md @@ -0,0 +1,21 @@ +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md new file mode 100644 index 00000000..08e918c0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md @@ -0,0 +1,91 @@ +# balanced-match + +Match balanced string pairs, like `{` and `}` or `` and ``. Supports regular expressions as well! + +[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match) +[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match) + +[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match) + +## Example + +Get the first matching pair of braces: + +```js +var balanced = require('balanced-match'); + +console.log(balanced('{', '}', 'pre{in{nested}}post')); +console.log(balanced('{', '}', 'pre{first}between{second}post')); +console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post')); +``` + +The matches are: + +```bash +$ node example.js +{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' } +{ start: 3, + end: 9, + pre: 'pre', + body: 'first', + post: 'between{second}post' } +{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' } +``` + +## API + +### var m = balanced(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +object with those keys: + +* **start** the index of the first match of `a` +* **end** the index of the matching `b` +* **pre** the preamble, `a` and `b` not included +* **body** the match, `a` and `b` not included +* **post** the postscript, `a` and `b` not included + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`. + +### var r = balanced.range(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +array with indexes: `[ , ]`. + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`. + +## Installation + +With [npm](https://npmjs.org) do: + +```bash +npm install balanced-match +``` + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js new file mode 100644 index 00000000..e8d85870 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js @@ -0,0 +1,58 @@ +module.exports = balanced; +function balanced(a, b, str) { + if (a instanceof RegExp) a = maybeMatch(a, str); + if (b instanceof RegExp) b = maybeMatch(b, str); + + var r = range(a, b, str); + + return r && { + start: r[0], + end: r[1], + pre: str.slice(0, r[0]), + body: str.slice(r[0] + a.length, r[1]), + post: str.slice(r[1] + b.length) + }; +} + +function maybeMatch(reg, str) { + var m = str.match(reg); + return m ? m[0] : null; +} + +balanced.range = range; +function range(a, b, str) { + var begs, beg, left, right, result; + var ai = str.indexOf(a); + var bi = str.indexOf(b, ai + 1); + var i = ai; + + if (ai >= 0 && bi > 0) { + begs = []; + left = str.length; + + while (i >= 0 && !result) { + if (i == ai) { + begs.push(i); + ai = str.indexOf(a, i + 1); + } else if (begs.length == 1) { + result = [ begs.pop(), bi ]; + } else { + beg = begs.pop(); + if (beg < left) { + left = beg; + right = bi; + } + + bi = str.indexOf(b, i + 1); + } + + i = ai < bi && ai >= 0 ? ai : bi; + } + + if (begs.length) { + result = [ left, right ]; + } + } + + return result; +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json new file mode 100644 index 00000000..2557ddab --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json @@ -0,0 +1,77 @@ +{ + "name": "balanced-match", + "description": "Match balanced character pairs, like \"{\" and \"}\"", + "version": "0.4.2", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/balanced-match.git" + }, + "homepage": "https://github.com/juliangruber/balanced-match", + "main": "index.js", + "scripts": { + "test": "make test" + }, + "dependencies": {}, + "devDependencies": { + "tape": "^4.6.0" + }, + "keywords": [ + "match", + "regexp", + "test", + "balanced", + "parse" + ], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT", + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/8..latest", + "firefox/20..latest", + "firefox/nightly", + "chrome/25..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "gitHead": "57c2ea29d89a2844ae3bdcc637c6e2cbb73725e2", + "bugs": { + "url": "https://github.com/juliangruber/balanced-match/issues" + }, + "_id": "balanced-match@0.4.2", + "_shasum": "cb3f3e3c732dc0f01ee70b403f302e61d7709838", + "_from": "balanced-match@>=0.4.1 <0.5.0", + "_npmVersion": "2.15.8", + "_nodeVersion": "4.4.7", + "_npmUser": { + "name": "juliangruber", + "email": "julian@juliangruber.com" + }, + "dist": { + "shasum": "cb3f3e3c732dc0f01ee70b403f302e61d7709838", + "tarball": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz" + }, + "maintainers": [ + { + "name": "juliangruber", + "email": "julian@juliangruber.com" + } + ], + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/balanced-match-0.4.2.tgz_1468834991581_0.6590619895141572" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml new file mode 100644 index 00000000..f1d0f13c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.4 + - 0.6 diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE new file mode 100644 index 00000000..ee27ba4b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown new file mode 100644 index 00000000..408f70a1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown @@ -0,0 +1,62 @@ +concat-map +========== + +Concatenative mapdashery. + +[![browser support](http://ci.testling.com/substack/node-concat-map.png)](http://ci.testling.com/substack/node-concat-map) + +[![build status](https://secure.travis-ci.org/substack/node-concat-map.png)](http://travis-ci.org/substack/node-concat-map) + +example +======= + +``` js +var concatMap = require('concat-map'); +var xs = [ 1, 2, 3, 4, 5, 6 ]; +var ys = concatMap(xs, function (x) { + return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; +}); +console.dir(ys); +``` + +*** + +``` +[ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ] +``` + +methods +======= + +``` js +var concatMap = require('concat-map') +``` + +concatMap(xs, fn) +----------------- + +Return an array of concatenated elements by calling `fn(x, i)` for each element +`x` and each index `i` in the array `xs`. + +When `fn(x, i)` returns an array, its result will be concatenated with the +result array. If `fn(x, i)` returns anything else, that value will be pushed +onto the end of the result array. + +install +======= + +With [npm](http://npmjs.org) do: + +``` +npm install concat-map +``` + +license +======= + +MIT + +notes +===== + +This module was written while sitting high above the ground in a tree. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js new file mode 100644 index 00000000..33656217 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js @@ -0,0 +1,6 @@ +var concatMap = require('../'); +var xs = [ 1, 2, 3, 4, 5, 6 ]; +var ys = concatMap(xs, function (x) { + return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; +}); +console.dir(ys); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js new file mode 100644 index 00000000..b29a7812 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js @@ -0,0 +1,13 @@ +module.exports = function (xs, fn) { + var res = []; + for (var i = 0; i < xs.length; i++) { + var x = fn(xs[i], i); + if (isArray(x)) res.push.apply(res, x); + else res.push(x); + } + return res; +}; + +var isArray = Array.isArray || function (xs) { + return Object.prototype.toString.call(xs) === '[object Array]'; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json new file mode 100644 index 00000000..de8b785d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json @@ -0,0 +1,83 @@ +{ + "name": "concat-map", + "description": "concatenative mapdashery", + "version": "0.0.1", + "repository": { + "type": "git", + "url": "git://github.com/substack/node-concat-map.git" + }, + "main": "index.js", + "keywords": [ + "concat", + "concatMap", + "map", + "functional", + "higher-order" + ], + "directories": { + "example": "example", + "test": "test" + }, + "scripts": { + "test": "tape test/*.js" + }, + "devDependencies": { + "tape": "~2.4.0" + }, + "license": "MIT", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "testling": { + "files": "test/*.js", + "browsers": { + "ie": [ + 6, + 7, + 8, + 9 + ], + "ff": [ + 3.5, + 10, + 15 + ], + "chrome": [ + 10, + 22 + ], + "safari": [ + 5.1 + ], + "opera": [ + 12 + ] + } + }, + "bugs": { + "url": "https://github.com/substack/node-concat-map/issues" + }, + "homepage": "https://github.com/substack/node-concat-map", + "_id": "concat-map@0.0.1", + "dist": { + "shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b", + "tarball": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + }, + "_from": "concat-map@0.0.1", + "_npmVersion": "1.3.21", + "_npmUser": { + "name": "substack", + "email": "mail@substack.net" + }, + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + } + ], + "_shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b", + "_resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js new file mode 100644 index 00000000..fdbd7022 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js @@ -0,0 +1,39 @@ +var concatMap = require('../'); +var test = require('tape'); + +test('empty or not', function (t) { + var xs = [ 1, 2, 3, 4, 5, 6 ]; + var ixes = []; + var ys = concatMap(xs, function (x, ix) { + ixes.push(ix); + return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; + }); + t.same(ys, [ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ]); + t.same(ixes, [ 0, 1, 2, 3, 4, 5 ]); + t.end(); +}); + +test('always something', function (t) { + var xs = [ 'a', 'b', 'c', 'd' ]; + var ys = concatMap(xs, function (x) { + return x === 'b' ? [ 'B', 'B', 'B' ] : [ x ]; + }); + t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); + t.end(); +}); + +test('scalars', function (t) { + var xs = [ 'a', 'b', 'c', 'd' ]; + var ys = concatMap(xs, function (x) { + return x === 'b' ? [ 'B', 'B', 'B' ] : x; + }); + t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); + t.end(); +}); + +test('undefs', function (t) { + var xs = [ 'a', 'b', 'c', 'd' ]; + var ys = concatMap(xs, function () {}); + t.same(ys, [ undefined, undefined, undefined, undefined ]); + t.end(); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/package.json new file mode 100644 index 00000000..e00a73ad --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/node_modules/brace-expansion/package.json @@ -0,0 +1,79 @@ +{ + "name": "brace-expansion", + "description": "Brace expansion as known from sh/bash", + "version": "1.1.6", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/brace-expansion.git" + }, + "homepage": "https://github.com/juliangruber/brace-expansion", + "main": "index.js", + "scripts": { + "test": "tape test/*.js", + "gentest": "bash test/generate.sh" + }, + "dependencies": { + "balanced-match": "^0.4.1", + "concat-map": "0.0.1" + }, + "devDependencies": { + "tape": "^4.6.0" + }, + "keywords": [], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT", + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/8..latest", + "firefox/20..latest", + "firefox/nightly", + "chrome/25..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "gitHead": "791262fa06625e9c5594cde529a21d82086af5f2", + "bugs": { + "url": "https://github.com/juliangruber/brace-expansion/issues" + }, + "_id": "brace-expansion@1.1.6", + "_shasum": "7197d7eaa9b87e648390ea61fc66c84427420df9", + "_from": "brace-expansion@>=1.0.0 <2.0.0", + "_npmVersion": "2.15.8", + "_nodeVersion": "4.4.7", + "_npmUser": { + "name": "juliangruber", + "email": "julian@juliangruber.com" + }, + "dist": { + "shasum": "7197d7eaa9b87e648390ea61fc66c84427420df9", + "tarball": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz" + }, + "maintainers": [ + { + "name": "juliangruber", + "email": "julian@juliangruber.com" + }, + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + } + ], + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/brace-expansion-1.1.6.tgz_1469047715600_0.9362958471756428" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/package.json new file mode 100644 index 00000000..c45db5dd --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/minimatch/package.json @@ -0,0 +1,64 @@ +{ + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me" + }, + "name": "minimatch", + "description": "a glob matcher in javascript", + "version": "3.0.3", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/minimatch.git" + }, + "main": "minimatch.js", + "scripts": { + "posttest": "standard minimatch.js test/*.js", + "test": "tap test/*.js" + }, + "engines": { + "node": "*" + }, + "dependencies": { + "brace-expansion": "^1.0.0" + }, + "devDependencies": { + "standard": "^3.7.2", + "tap": "^5.6.0" + }, + "license": "ISC", + "files": [ + "minimatch.js" + ], + "gitHead": "eed89491bd4a4e6bc463aac0dfb5c29ef0d1dc13", + "bugs": { + "url": "https://github.com/isaacs/minimatch/issues" + }, + "homepage": "https://github.com/isaacs/minimatch#readme", + "_id": "minimatch@3.0.3", + "_shasum": "2a4e4090b96b2db06a9d7df01055a62a77c9b774", + "_from": "minimatch@3.0.3", + "_npmVersion": "3.10.6", + "_nodeVersion": "4.4.4", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "dist": { + "shasum": "2a4e4090b96b2db06a9d7df01055a62a77c9b774", + "tarball": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/minimatch-3.0.3.tgz_1470678322731_0.1892083385027945" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/.travis.yml new file mode 100644 index 00000000..74c57bf1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/.travis.yml @@ -0,0 +1,8 @@ +language: node_js +node_js: + - "0.8" + - "0.10" + - "0.12" + - "iojs" +before_install: + - npm install -g npm@~1.4.6 diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/LICENSE new file mode 100644 index 00000000..432d1aeb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/LICENSE @@ -0,0 +1,21 @@ +Copyright 2010 James Halliday (mail@substack.net) + +This project is free software released under the MIT/X11 license: + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/README.markdown b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/README.markdown new file mode 100644 index 00000000..3cc13153 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/README.markdown @@ -0,0 +1,100 @@ +# mkdirp + +Like `mkdir -p`, but in node.js! + +[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp) + +# example + +## pow.js + +```js +var mkdirp = require('mkdirp'); + +mkdirp('/tmp/foo/bar/baz', function (err) { + if (err) console.error(err) + else console.log('pow!') +}); +``` + +Output + +``` +pow! +``` + +And now /tmp/foo/bar/baz exists, huzzah! + +# methods + +```js +var mkdirp = require('mkdirp'); +``` + +## mkdirp(dir, opts, cb) + +Create a new directory and any necessary subdirectories at `dir` with octal +permission string `opts.mode`. If `opts` is a non-object, it will be treated as +the `opts.mode`. + +If `opts.mode` isn't specified, it defaults to `0777 & (~process.umask())`. + +`cb(err, made)` fires with the error or the first directory `made` +that had to be created, if any. + +You can optionally pass in an alternate `fs` implementation by passing in +`opts.fs`. Your implementation should have `opts.fs.mkdir(path, mode, cb)` and +`opts.fs.stat(path, cb)`. + +## mkdirp.sync(dir, opts) + +Synchronously create a new directory and any necessary subdirectories at `dir` +with octal permission string `opts.mode`. If `opts` is a non-object, it will be +treated as the `opts.mode`. + +If `opts.mode` isn't specified, it defaults to `0777 & (~process.umask())`. + +Returns the first directory that had to be created, if any. + +You can optionally pass in an alternate `fs` implementation by passing in +`opts.fs`. Your implementation should have `opts.fs.mkdirSync(path, mode)` and +`opts.fs.statSync(path)`. + +# usage + +This package also ships with a `mkdirp` command. + +``` +usage: mkdirp [DIR1,DIR2..] {OPTIONS} + + Create each supplied directory including any necessary parent directories that + don't yet exist. + + If the directory already exists, do nothing. + +OPTIONS are: + + -m, --mode If a directory needs to be created, set the mode as an octal + permission string. + +``` + +# install + +With [npm](http://npmjs.org) do: + +``` +npm install mkdirp +``` + +to get the library, or + +``` +npm install -g mkdirp +``` + +to get the command. + +# license + +MIT diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/examples/pow.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/examples/pow.js new file mode 100644 index 00000000..e6924212 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/examples/pow.js @@ -0,0 +1,6 @@ +var mkdirp = require('mkdirp'); + +mkdirp('/tmp/foo/bar/baz', function (err) { + if (err) console.error(err) + else console.log('pow!') +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/index.js new file mode 100644 index 00000000..6ce241b5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/index.js @@ -0,0 +1,98 @@ +var path = require('path'); +var fs = require('fs'); +var _0777 = parseInt('0777', 8); + +module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; + +function mkdirP (p, opts, f, made) { + if (typeof opts === 'function') { + f = opts; + opts = {}; + } + else if (!opts || typeof opts !== 'object') { + opts = { mode: opts }; + } + + var mode = opts.mode; + var xfs = opts.fs || fs; + + if (mode === undefined) { + mode = _0777 & (~process.umask()); + } + if (!made) made = null; + + var cb = f || function () {}; + p = path.resolve(p); + + xfs.mkdir(p, mode, function (er) { + if (!er) { + made = made || p; + return cb(null, made); + } + switch (er.code) { + case 'ENOENT': + mkdirP(path.dirname(p), opts, function (er, made) { + if (er) cb(er, made); + else mkdirP(p, opts, cb, made); + }); + break; + + // In the case of any other error, just see if there's a dir + // there already. If so, then hooray! If not, then something + // is borked. + default: + xfs.stat(p, function (er2, stat) { + // if the stat fails, then that's super weird. + // let the original error be the failure reason. + if (er2 || !stat.isDirectory()) cb(er, made) + else cb(null, made); + }); + break; + } + }); +} + +mkdirP.sync = function sync (p, opts, made) { + if (!opts || typeof opts !== 'object') { + opts = { mode: opts }; + } + + var mode = opts.mode; + var xfs = opts.fs || fs; + + if (mode === undefined) { + mode = _0777 & (~process.umask()); + } + if (!made) made = null; + + p = path.resolve(p); + + try { + xfs.mkdirSync(p, mode); + made = made || p; + } + catch (err0) { + switch (err0.code) { + case 'ENOENT' : + made = sync(path.dirname(p), opts, made); + sync(p, opts, made); + break; + + // In the case of any other error, just see if there's a dir + // there already. If so, then hooray! If not, then something + // is borked. + default: + var stat; + try { + stat = xfs.statSync(p); + } + catch (err1) { + throw err0; + } + if (!stat.isDirectory()) throw err0; + break; + } + } + + return made; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/node_modules/minimist/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/node_modules/minimist/.travis.yml new file mode 100644 index 00000000..cc4dba29 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/node_modules/minimist/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.8" + - "0.10" diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/node_modules/minimist/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/node_modules/minimist/LICENSE new file mode 100644 index 00000000..ee27ba4b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/node_modules/minimist/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/node_modules/minimist/example/parse.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/node_modules/minimist/example/parse.js new file mode 100644 index 00000000..abff3e8e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/node_modules/minimist/example/parse.js @@ -0,0 +1,2 @@ +var argv = require('../')(process.argv.slice(2)); +console.dir(argv); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/node_modules/minimist/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/node_modules/minimist/index.js new file mode 100644 index 00000000..584f551a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/node_modules/minimist/index.js @@ -0,0 +1,187 @@ +module.exports = function (args, opts) { + if (!opts) opts = {}; + + var flags = { bools : {}, strings : {} }; + + [].concat(opts['boolean']).filter(Boolean).forEach(function (key) { + flags.bools[key] = true; + }); + + [].concat(opts.string).filter(Boolean).forEach(function (key) { + flags.strings[key] = true; + }); + + var aliases = {}; + Object.keys(opts.alias || {}).forEach(function (key) { + aliases[key] = [].concat(opts.alias[key]); + aliases[key].forEach(function (x) { + aliases[x] = [key].concat(aliases[key].filter(function (y) { + return x !== y; + })); + }); + }); + + var defaults = opts['default'] || {}; + + var argv = { _ : [] }; + Object.keys(flags.bools).forEach(function (key) { + setArg(key, defaults[key] === undefined ? false : defaults[key]); + }); + + var notFlags = []; + + if (args.indexOf('--') !== -1) { + notFlags = args.slice(args.indexOf('--')+1); + args = args.slice(0, args.indexOf('--')); + } + + function setArg (key, val) { + var value = !flags.strings[key] && isNumber(val) + ? Number(val) : val + ; + setKey(argv, key.split('.'), value); + + (aliases[key] || []).forEach(function (x) { + setKey(argv, x.split('.'), value); + }); + } + + for (var i = 0; i < args.length; i++) { + var arg = args[i]; + + if (/^--.+=/.test(arg)) { + // Using [\s\S] instead of . because js doesn't support the + // 'dotall' regex modifier. See: + // http://stackoverflow.com/a/1068308/13216 + var m = arg.match(/^--([^=]+)=([\s\S]*)$/); + setArg(m[1], m[2]); + } + else if (/^--no-.+/.test(arg)) { + var key = arg.match(/^--no-(.+)/)[1]; + setArg(key, false); + } + else if (/^--.+/.test(arg)) { + var key = arg.match(/^--(.+)/)[1]; + var next = args[i + 1]; + if (next !== undefined && !/^-/.test(next) + && !flags.bools[key] + && (aliases[key] ? !flags.bools[aliases[key]] : true)) { + setArg(key, next); + i++; + } + else if (/^(true|false)$/.test(next)) { + setArg(key, next === 'true'); + i++; + } + else { + setArg(key, flags.strings[key] ? '' : true); + } + } + else if (/^-[^-]+/.test(arg)) { + var letters = arg.slice(1,-1).split(''); + + var broken = false; + for (var j = 0; j < letters.length; j++) { + var next = arg.slice(j+2); + + if (next === '-') { + setArg(letters[j], next) + continue; + } + + if (/[A-Za-z]/.test(letters[j]) + && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) { + setArg(letters[j], next); + broken = true; + break; + } + + if (letters[j+1] && letters[j+1].match(/\W/)) { + setArg(letters[j], arg.slice(j+2)); + broken = true; + break; + } + else { + setArg(letters[j], flags.strings[letters[j]] ? '' : true); + } + } + + var key = arg.slice(-1)[0]; + if (!broken && key !== '-') { + if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1]) + && !flags.bools[key] + && (aliases[key] ? !flags.bools[aliases[key]] : true)) { + setArg(key, args[i+1]); + i++; + } + else if (args[i+1] && /true|false/.test(args[i+1])) { + setArg(key, args[i+1] === 'true'); + i++; + } + else { + setArg(key, flags.strings[key] ? '' : true); + } + } + } + else { + argv._.push( + flags.strings['_'] || !isNumber(arg) ? arg : Number(arg) + ); + } + } + + Object.keys(defaults).forEach(function (key) { + if (!hasKey(argv, key.split('.'))) { + setKey(argv, key.split('.'), defaults[key]); + + (aliases[key] || []).forEach(function (x) { + setKey(argv, x.split('.'), defaults[key]); + }); + } + }); + + notFlags.forEach(function(key) { + argv._.push(key); + }); + + return argv; +}; + +function hasKey (obj, keys) { + var o = obj; + keys.slice(0,-1).forEach(function (key) { + o = (o[key] || {}); + }); + + var key = keys[keys.length - 1]; + return key in o; +} + +function setKey (obj, keys, value) { + var o = obj; + keys.slice(0,-1).forEach(function (key) { + if (o[key] === undefined) o[key] = {}; + o = o[key]; + }); + + var key = keys[keys.length - 1]; + if (o[key] === undefined || typeof o[key] === 'boolean') { + o[key] = value; + } + else if (Array.isArray(o[key])) { + o[key].push(value); + } + else { + o[key] = [ o[key], value ]; + } +} + +function isNumber (x) { + if (typeof x === 'number') return true; + if (/^0x[0-9a-f]+$/i.test(x)) return true; + return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x); +} + +function longest (xs) { + return Math.max.apply(null, xs.map(function (x) { return x.length })); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/node_modules/minimist/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/node_modules/minimist/package.json new file mode 100644 index 00000000..7cd80f4f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/node_modules/minimist/package.json @@ -0,0 +1,66 @@ +{ + "name": "minimist", + "version": "0.0.8", + "description": "parse argument options", + "main": "index.js", + "devDependencies": { + "tape": "~1.0.4", + "tap": "~0.4.0" + }, + "scripts": { + "test": "tap test/*.js" + }, + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/6..latest", + "ff/5", + "firefox/latest", + "chrome/10", + "chrome/latest", + "safari/5.1", + "safari/latest", + "opera/12" + ] + }, + "repository": { + "type": "git", + "url": "git://github.com/substack/minimist.git" + }, + "homepage": "https://github.com/substack/minimist", + "keywords": [ + "argv", + "getopt", + "parser", + "optimist" + ], + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/substack/minimist/issues" + }, + "_id": "minimist@0.0.8", + "dist": { + "shasum": "857fcabfc3397d2625b8228262e86aa7a011b05d", + "tarball": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz" + }, + "_from": "minimist@0.0.8", + "_npmVersion": "1.4.3", + "_npmUser": { + "name": "substack", + "email": "mail@substack.net" + }, + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + } + ], + "directories": {}, + "_shasum": "857fcabfc3397d2625b8228262e86aa7a011b05d", + "_resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/node_modules/minimist/readme.markdown b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/node_modules/minimist/readme.markdown new file mode 100644 index 00000000..c2563532 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/node_modules/minimist/readme.markdown @@ -0,0 +1,73 @@ +# minimist + +parse argument options + +This module is the guts of optimist's argument parser without all the +fanciful decoration. + +[![browser support](https://ci.testling.com/substack/minimist.png)](http://ci.testling.com/substack/minimist) + +[![build status](https://secure.travis-ci.org/substack/minimist.png)](http://travis-ci.org/substack/minimist) + +# example + +``` js +var argv = require('minimist')(process.argv.slice(2)); +console.dir(argv); +``` + +``` +$ node example/parse.js -a beep -b boop +{ _: [], a: 'beep', b: 'boop' } +``` + +``` +$ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop foo bar baz +{ _: [ 'foo', 'bar', 'baz' ], + x: 3, + y: 4, + n: 5, + a: true, + b: true, + c: true, + beep: 'boop' } +``` + +# methods + +``` js +var parseArgs = require('minimist') +``` + +## var argv = parseArgs(args, opts={}) + +Return an argument object `argv` populated with the array arguments from `args`. + +`argv._` contains all the arguments that didn't have an option associated with +them. + +Numeric-looking arguments will be returned as numbers unless `opts.string` or +`opts.boolean` is set for that argument name. + +Any arguments after `'--'` will not be parsed and will end up in `argv._`. + +options can be: + +* `opts.string` - a string or array of strings argument names to always treat as +strings +* `opts.boolean` - a string or array of strings to always treat as booleans +* `opts.alias` - an object mapping string names to strings or arrays of string +argument names to use as aliases +* `opts.default` - an object mapping string argument names to default values + +# install + +With [npm](https://npmjs.org) do: + +``` +npm install minimist +``` + +# license + +MIT diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/node_modules/minimist/test/dash.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/node_modules/minimist/test/dash.js new file mode 100644 index 00000000..8b034b99 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/node_modules/minimist/test/dash.js @@ -0,0 +1,24 @@ +var parse = require('../'); +var test = require('tape'); + +test('-', function (t) { + t.plan(5); + t.deepEqual(parse([ '-n', '-' ]), { n: '-', _: [] }); + t.deepEqual(parse([ '-' ]), { _: [ '-' ] }); + t.deepEqual(parse([ '-f-' ]), { f: '-', _: [] }); + t.deepEqual( + parse([ '-b', '-' ], { boolean: 'b' }), + { b: true, _: [ '-' ] } + ); + t.deepEqual( + parse([ '-s', '-' ], { string: 's' }), + { s: '-', _: [] } + ); +}); + +test('-a -- b', function (t) { + t.plan(3); + t.deepEqual(parse([ '-a', '--', 'b' ]), { a: true, _: [ 'b' ] }); + t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] }); + t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] }); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/node_modules/minimist/test/default_bool.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/node_modules/minimist/test/default_bool.js new file mode 100644 index 00000000..f0041ee4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/node_modules/minimist/test/default_bool.js @@ -0,0 +1,20 @@ +var test = require('tape'); +var parse = require('../'); + +test('boolean default true', function (t) { + var argv = parse([], { + boolean: 'sometrue', + default: { sometrue: true } + }); + t.equal(argv.sometrue, true); + t.end(); +}); + +test('boolean default false', function (t) { + var argv = parse([], { + boolean: 'somefalse', + default: { somefalse: false } + }); + t.equal(argv.somefalse, false); + t.end(); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/node_modules/minimist/test/dotted.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/node_modules/minimist/test/dotted.js new file mode 100644 index 00000000..ef0ae349 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/node_modules/minimist/test/dotted.js @@ -0,0 +1,16 @@ +var parse = require('../'); +var test = require('tape'); + +test('dotted alias', function (t) { + var argv = parse(['--a.b', '22'], {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); + t.equal(argv.a.b, 22); + t.equal(argv.aa.bb, 22); + t.end(); +}); + +test('dotted default', function (t) { + var argv = parse('', {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); + t.equal(argv.a.b, 11); + t.equal(argv.aa.bb, 11); + t.end(); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/node_modules/minimist/test/long.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/node_modules/minimist/test/long.js new file mode 100644 index 00000000..5d3a1e09 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/node_modules/minimist/test/long.js @@ -0,0 +1,31 @@ +var test = require('tape'); +var parse = require('../'); + +test('long opts', function (t) { + t.deepEqual( + parse([ '--bool' ]), + { bool : true, _ : [] }, + 'long boolean' + ); + t.deepEqual( + parse([ '--pow', 'xixxle' ]), + { pow : 'xixxle', _ : [] }, + 'long capture sp' + ); + t.deepEqual( + parse([ '--pow=xixxle' ]), + { pow : 'xixxle', _ : [] }, + 'long capture eq' + ); + t.deepEqual( + parse([ '--host', 'localhost', '--port', '555' ]), + { host : 'localhost', port : 555, _ : [] }, + 'long captures sp' + ); + t.deepEqual( + parse([ '--host=localhost', '--port=555' ]), + { host : 'localhost', port : 555, _ : [] }, + 'long captures eq' + ); + t.end(); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/node_modules/minimist/test/parse.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/node_modules/minimist/test/parse.js new file mode 100644 index 00000000..8a906466 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/node_modules/minimist/test/parse.js @@ -0,0 +1,318 @@ +var parse = require('../'); +var test = require('tape'); + +test('parse args', function (t) { + t.deepEqual( + parse([ '--no-moo' ]), + { moo : false, _ : [] }, + 'no' + ); + t.deepEqual( + parse([ '-v', 'a', '-v', 'b', '-v', 'c' ]), + { v : ['a','b','c'], _ : [] }, + 'multi' + ); + t.end(); +}); + +test('comprehensive', function (t) { + t.deepEqual( + parse([ + '--name=meowmers', 'bare', '-cats', 'woo', + '-h', 'awesome', '--multi=quux', + '--key', 'value', + '-b', '--bool', '--no-meep', '--multi=baz', + '--', '--not-a-flag', 'eek' + ]), + { + c : true, + a : true, + t : true, + s : 'woo', + h : 'awesome', + b : true, + bool : true, + key : 'value', + multi : [ 'quux', 'baz' ], + meep : false, + name : 'meowmers', + _ : [ 'bare', '--not-a-flag', 'eek' ] + } + ); + t.end(); +}); + +test('nums', function (t) { + var argv = parse([ + '-x', '1234', + '-y', '5.67', + '-z', '1e7', + '-w', '10f', + '--hex', '0xdeadbeef', + '789' + ]); + t.deepEqual(argv, { + x : 1234, + y : 5.67, + z : 1e7, + w : '10f', + hex : 0xdeadbeef, + _ : [ 789 ] + }); + t.deepEqual(typeof argv.x, 'number'); + t.deepEqual(typeof argv.y, 'number'); + t.deepEqual(typeof argv.z, 'number'); + t.deepEqual(typeof argv.w, 'string'); + t.deepEqual(typeof argv.hex, 'number'); + t.deepEqual(typeof argv._[0], 'number'); + t.end(); +}); + +test('flag boolean', function (t) { + var argv = parse([ '-t', 'moo' ], { boolean: 't' }); + t.deepEqual(argv, { t : true, _ : [ 'moo' ] }); + t.deepEqual(typeof argv.t, 'boolean'); + t.end(); +}); + +test('flag boolean value', function (t) { + var argv = parse(['--verbose', 'false', 'moo', '-t', 'true'], { + boolean: [ 't', 'verbose' ], + default: { verbose: true } + }); + + t.deepEqual(argv, { + verbose: false, + t: true, + _: ['moo'] + }); + + t.deepEqual(typeof argv.verbose, 'boolean'); + t.deepEqual(typeof argv.t, 'boolean'); + t.end(); +}); + +test('flag boolean default false', function (t) { + var argv = parse(['moo'], { + boolean: ['t', 'verbose'], + default: { verbose: false, t: false } + }); + + t.deepEqual(argv, { + verbose: false, + t: false, + _: ['moo'] + }); + + t.deepEqual(typeof argv.verbose, 'boolean'); + t.deepEqual(typeof argv.t, 'boolean'); + t.end(); + +}); + +test('boolean groups', function (t) { + var argv = parse([ '-x', '-z', 'one', 'two', 'three' ], { + boolean: ['x','y','z'] + }); + + t.deepEqual(argv, { + x : true, + y : false, + z : true, + _ : [ 'one', 'two', 'three' ] + }); + + t.deepEqual(typeof argv.x, 'boolean'); + t.deepEqual(typeof argv.y, 'boolean'); + t.deepEqual(typeof argv.z, 'boolean'); + t.end(); +}); + +test('newlines in params' , function (t) { + var args = parse([ '-s', "X\nX" ]) + t.deepEqual(args, { _ : [], s : "X\nX" }); + + // reproduce in bash: + // VALUE="new + // line" + // node program.js --s="$VALUE" + args = parse([ "--s=X\nX" ]) + t.deepEqual(args, { _ : [], s : "X\nX" }); + t.end(); +}); + +test('strings' , function (t) { + var s = parse([ '-s', '0001234' ], { string: 's' }).s; + t.equal(s, '0001234'); + t.equal(typeof s, 'string'); + + var x = parse([ '-x', '56' ], { string: 'x' }).x; + t.equal(x, '56'); + t.equal(typeof x, 'string'); + t.end(); +}); + +test('stringArgs', function (t) { + var s = parse([ ' ', ' ' ], { string: '_' })._; + t.same(s.length, 2); + t.same(typeof s[0], 'string'); + t.same(s[0], ' '); + t.same(typeof s[1], 'string'); + t.same(s[1], ' '); + t.end(); +}); + +test('empty strings', function(t) { + var s = parse([ '-s' ], { string: 's' }).s; + t.equal(s, ''); + t.equal(typeof s, 'string'); + + var str = parse([ '--str' ], { string: 'str' }).str; + t.equal(str, ''); + t.equal(typeof str, 'string'); + + var letters = parse([ '-art' ], { + string: [ 'a', 't' ] + }); + + t.equal(letters.a, ''); + t.equal(letters.r, true); + t.equal(letters.t, ''); + + t.end(); +}); + + +test('slashBreak', function (t) { + t.same( + parse([ '-I/foo/bar/baz' ]), + { I : '/foo/bar/baz', _ : [] } + ); + t.same( + parse([ '-xyz/foo/bar/baz' ]), + { x : true, y : true, z : '/foo/bar/baz', _ : [] } + ); + t.end(); +}); + +test('alias', function (t) { + var argv = parse([ '-f', '11', '--zoom', '55' ], { + alias: { z: 'zoom' } + }); + t.equal(argv.zoom, 55); + t.equal(argv.z, argv.zoom); + t.equal(argv.f, 11); + t.end(); +}); + +test('multiAlias', function (t) { + var argv = parse([ '-f', '11', '--zoom', '55' ], { + alias: { z: [ 'zm', 'zoom' ] } + }); + t.equal(argv.zoom, 55); + t.equal(argv.z, argv.zoom); + t.equal(argv.z, argv.zm); + t.equal(argv.f, 11); + t.end(); +}); + +test('nested dotted objects', function (t) { + var argv = parse([ + '--foo.bar', '3', '--foo.baz', '4', + '--foo.quux.quibble', '5', '--foo.quux.o_O', + '--beep.boop' + ]); + + t.same(argv.foo, { + bar : 3, + baz : 4, + quux : { + quibble : 5, + o_O : true + } + }); + t.same(argv.beep, { boop : true }); + t.end(); +}); + +test('boolean and alias with chainable api', function (t) { + var aliased = [ '-h', 'derp' ]; + var regular = [ '--herp', 'derp' ]; + var opts = { + herp: { alias: 'h', boolean: true } + }; + var aliasedArgv = parse(aliased, { + boolean: 'herp', + alias: { h: 'herp' } + }); + var propertyArgv = parse(regular, { + boolean: 'herp', + alias: { h: 'herp' } + }); + var expected = { + herp: true, + h: true, + '_': [ 'derp' ] + }; + + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + t.end(); +}); + +test('boolean and alias with options hash', function (t) { + var aliased = [ '-h', 'derp' ]; + var regular = [ '--herp', 'derp' ]; + var opts = { + alias: { 'h': 'herp' }, + boolean: 'herp' + }; + var aliasedArgv = parse(aliased, opts); + var propertyArgv = parse(regular, opts); + var expected = { + herp: true, + h: true, + '_': [ 'derp' ] + }; + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + t.end(); +}); + +test('boolean and alias using explicit true', function (t) { + var aliased = [ '-h', 'true' ]; + var regular = [ '--herp', 'true' ]; + var opts = { + alias: { h: 'herp' }, + boolean: 'h' + }; + var aliasedArgv = parse(aliased, opts); + var propertyArgv = parse(regular, opts); + var expected = { + herp: true, + h: true, + '_': [ ] + }; + + t.same(aliasedArgv, expected); + t.same(propertyArgv, expected); + t.end(); +}); + +// regression, see https://github.com/substack/node-optimist/issues/71 +test('boolean and --x=true', function(t) { + var parsed = parse(['--boool', '--other=true'], { + boolean: 'boool' + }); + + t.same(parsed.boool, true); + t.same(parsed.other, 'true'); + + parsed = parse(['--boool', '--other=false'], { + boolean: 'boool' + }); + + t.same(parsed.boool, true); + t.same(parsed.other, 'false'); + t.end(); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/node_modules/minimist/test/parse_modified.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/node_modules/minimist/test/parse_modified.js new file mode 100644 index 00000000..21851b03 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/node_modules/minimist/test/parse_modified.js @@ -0,0 +1,9 @@ +var parse = require('../'); +var test = require('tape'); + +test('parse with modifier functions' , function (t) { + t.plan(1); + + var argv = parse([ '-b', '123' ], { boolean: 'b' }); + t.deepEqual(argv, { b: true, _: ['123'] }); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/node_modules/minimist/test/short.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/node_modules/minimist/test/short.js new file mode 100644 index 00000000..d513a1c2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/node_modules/minimist/test/short.js @@ -0,0 +1,67 @@ +var parse = require('../'); +var test = require('tape'); + +test('numeric short args', function (t) { + t.plan(2); + t.deepEqual(parse([ '-n123' ]), { n: 123, _: [] }); + t.deepEqual( + parse([ '-123', '456' ]), + { 1: true, 2: true, 3: 456, _: [] } + ); +}); + +test('short', function (t) { + t.deepEqual( + parse([ '-b' ]), + { b : true, _ : [] }, + 'short boolean' + ); + t.deepEqual( + parse([ 'foo', 'bar', 'baz' ]), + { _ : [ 'foo', 'bar', 'baz' ] }, + 'bare' + ); + t.deepEqual( + parse([ '-cats' ]), + { c : true, a : true, t : true, s : true, _ : [] }, + 'group' + ); + t.deepEqual( + parse([ '-cats', 'meow' ]), + { c : true, a : true, t : true, s : 'meow', _ : [] }, + 'short group next' + ); + t.deepEqual( + parse([ '-h', 'localhost' ]), + { h : 'localhost', _ : [] }, + 'short capture' + ); + t.deepEqual( + parse([ '-h', 'localhost', '-p', '555' ]), + { h : 'localhost', p : 555, _ : [] }, + 'short captures' + ); + t.end(); +}); + +test('mixed short bool and capture', function (t) { + t.same( + parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), + { + f : true, p : 555, h : 'localhost', + _ : [ 'script.js' ] + } + ); + t.end(); +}); + +test('short and long', function (t) { + t.deepEqual( + parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), + { + f : true, p : 555, h : 'localhost', + _ : [ 'script.js' ] + } + ); + t.end(); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/node_modules/minimist/test/whitespace.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/node_modules/minimist/test/whitespace.js new file mode 100644 index 00000000..8a52a58c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/node_modules/minimist/test/whitespace.js @@ -0,0 +1,8 @@ +var parse = require('../'); +var test = require('tape'); + +test('whitespace should be whitespace' , function (t) { + t.plan(1); + var x = parse([ '-x', '\t' ]).x; + t.equal(x, '\t'); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/package.json new file mode 100644 index 00000000..24411034 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/package.json @@ -0,0 +1,59 @@ +{ + "name": "mkdirp", + "description": "Recursively mkdir, like `mkdir -p`", + "version": "0.5.1", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "main": "index.js", + "keywords": [ + "mkdir", + "directory" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/substack/node-mkdirp.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "dependencies": { + "minimist": "0.0.8" + }, + "devDependencies": { + "tap": "1", + "mock-fs": "2 >=2.7.0" + }, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "license": "MIT", + "gitHead": "d4eff0f06093aed4f387e88e9fc301cb76beedc7", + "bugs": { + "url": "https://github.com/substack/node-mkdirp/issues" + }, + "homepage": "https://github.com/substack/node-mkdirp#readme", + "_id": "mkdirp@0.5.1", + "_shasum": "30057438eac6cf7f8c4767f38648d6697d75c903", + "_from": "mkdirp@>=0.5.1 <0.6.0", + "_npmVersion": "2.9.0", + "_nodeVersion": "2.0.0", + "_npmUser": { + "name": "substack", + "email": "substack@gmail.com" + }, + "dist": { + "shasum": "30057438eac6cf7f8c4767f38648d6697d75c903", + "tarball": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz" + }, + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/chmod.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/chmod.js new file mode 100644 index 00000000..6a404b93 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/chmod.js @@ -0,0 +1,41 @@ +var mkdirp = require('../').mkdirp; +var path = require('path'); +var fs = require('fs'); +var test = require('tap').test; +var _0777 = parseInt('0777', 8); +var _0755 = parseInt('0755', 8); +var _0744 = parseInt('0744', 8); + +var ps = [ '', 'tmp' ]; + +for (var i = 0; i < 25; i++) { + var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + ps.push(dir); +} + +var file = ps.join('/'); + +test('chmod-pre', function (t) { + var mode = _0744 + mkdirp(file, mode, function (er) { + t.ifError(er, 'should not error'); + fs.stat(file, function (er, stat) { + t.ifError(er, 'should exist'); + t.ok(stat && stat.isDirectory(), 'should be directory'); + t.equal(stat && stat.mode & _0777, mode, 'should be 0744'); + t.end(); + }); + }); +}); + +test('chmod', function (t) { + var mode = _0755 + mkdirp(file, mode, function (er) { + t.ifError(er, 'should not error'); + fs.stat(file, function (er, stat) { + t.ifError(er, 'should exist'); + t.ok(stat && stat.isDirectory(), 'should be directory'); + t.end(); + }); + }); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/clobber.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/clobber.js new file mode 100644 index 00000000..2433b9ad --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/clobber.js @@ -0,0 +1,38 @@ +var mkdirp = require('../').mkdirp; +var path = require('path'); +var fs = require('fs'); +var test = require('tap').test; +var _0755 = parseInt('0755', 8); + +var ps = [ '', 'tmp' ]; + +for (var i = 0; i < 25; i++) { + var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + ps.push(dir); +} + +var file = ps.join('/'); + +// a file in the way +var itw = ps.slice(0, 3).join('/'); + + +test('clobber-pre', function (t) { + console.error("about to write to "+itw) + fs.writeFileSync(itw, 'I AM IN THE WAY, THE TRUTH, AND THE LIGHT.'); + + fs.stat(itw, function (er, stat) { + t.ifError(er) + t.ok(stat && stat.isFile(), 'should be file') + t.end() + }) +}) + +test('clobber', function (t) { + t.plan(2); + mkdirp(file, _0755, function (err) { + t.ok(err); + t.equal(err.code, 'ENOTDIR'); + t.end(); + }); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/mkdirp.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/mkdirp.js new file mode 100644 index 00000000..eaa8921c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/mkdirp.js @@ -0,0 +1,28 @@ +var mkdirp = require('../'); +var path = require('path'); +var fs = require('fs'); +var exists = fs.exists || path.exists; +var test = require('tap').test; +var _0777 = parseInt('0777', 8); +var _0755 = parseInt('0755', 8); + +test('woo', function (t) { + t.plan(5); + var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + + var file = '/tmp/' + [x,y,z].join('/'); + + mkdirp(file, _0755, function (err) { + t.ifError(err); + exists(file, function (ex) { + t.ok(ex, 'file created'); + fs.stat(file, function (err, stat) { + t.ifError(err); + t.equal(stat.mode & _0777, _0755); + t.ok(stat.isDirectory(), 'target not a directory'); + }) + }) + }); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/opts_fs.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/opts_fs.js new file mode 100644 index 00000000..97186b62 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/opts_fs.js @@ -0,0 +1,29 @@ +var mkdirp = require('../'); +var path = require('path'); +var test = require('tap').test; +var mockfs = require('mock-fs'); +var _0777 = parseInt('0777', 8); +var _0755 = parseInt('0755', 8); + +test('opts.fs', function (t) { + t.plan(5); + + var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + + var file = '/beep/boop/' + [x,y,z].join('/'); + var xfs = mockfs.fs(); + + mkdirp(file, { fs: xfs, mode: _0755 }, function (err) { + t.ifError(err); + xfs.exists(file, function (ex) { + t.ok(ex, 'created file'); + xfs.stat(file, function (err, stat) { + t.ifError(err); + t.equal(stat.mode & _0777, _0755); + t.ok(stat.isDirectory(), 'target not a directory'); + }); + }); + }); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/opts_fs_sync.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/opts_fs_sync.js new file mode 100644 index 00000000..6c370aa6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/opts_fs_sync.js @@ -0,0 +1,27 @@ +var mkdirp = require('../'); +var path = require('path'); +var test = require('tap').test; +var mockfs = require('mock-fs'); +var _0777 = parseInt('0777', 8); +var _0755 = parseInt('0755', 8); + +test('opts.fs sync', function (t) { + t.plan(4); + + var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + + var file = '/beep/boop/' + [x,y,z].join('/'); + var xfs = mockfs.fs(); + + mkdirp.sync(file, { fs: xfs, mode: _0755 }); + xfs.exists(file, function (ex) { + t.ok(ex, 'created file'); + xfs.stat(file, function (err, stat) { + t.ifError(err); + t.equal(stat.mode & _0777, _0755); + t.ok(stat.isDirectory(), 'target not a directory'); + }); + }); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/perm.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/perm.js new file mode 100644 index 00000000..fbce44b8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/perm.js @@ -0,0 +1,32 @@ +var mkdirp = require('../'); +var path = require('path'); +var fs = require('fs'); +var exists = fs.exists || path.exists; +var test = require('tap').test; +var _0777 = parseInt('0777', 8); +var _0755 = parseInt('0755', 8); + +test('async perm', function (t) { + t.plan(5); + var file = '/tmp/' + (Math.random() * (1<<30)).toString(16); + + mkdirp(file, _0755, function (err) { + t.ifError(err); + exists(file, function (ex) { + t.ok(ex, 'file created'); + fs.stat(file, function (err, stat) { + t.ifError(err); + t.equal(stat.mode & _0777, _0755); + t.ok(stat.isDirectory(), 'target not a directory'); + }) + }) + }); +}); + +test('async root perm', function (t) { + mkdirp('/tmp', _0755, function (err) { + if (err) t.fail(err); + t.end(); + }); + t.end(); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/perm_sync.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/perm_sync.js new file mode 100644 index 00000000..398229fe --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/perm_sync.js @@ -0,0 +1,36 @@ +var mkdirp = require('../'); +var path = require('path'); +var fs = require('fs'); +var exists = fs.exists || path.exists; +var test = require('tap').test; +var _0777 = parseInt('0777', 8); +var _0755 = parseInt('0755', 8); + +test('sync perm', function (t) { + t.plan(4); + var file = '/tmp/' + (Math.random() * (1<<30)).toString(16) + '.json'; + + mkdirp.sync(file, _0755); + exists(file, function (ex) { + t.ok(ex, 'file created'); + fs.stat(file, function (err, stat) { + t.ifError(err); + t.equal(stat.mode & _0777, _0755); + t.ok(stat.isDirectory(), 'target not a directory'); + }); + }); +}); + +test('sync root perm', function (t) { + t.plan(3); + + var file = '/tmp'; + mkdirp.sync(file, _0755); + exists(file, function (ex) { + t.ok(ex, 'file created'); + fs.stat(file, function (err, stat) { + t.ifError(err); + t.ok(stat.isDirectory(), 'target not a directory'); + }) + }); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/race.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/race.js new file mode 100644 index 00000000..b0b9e183 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/race.js @@ -0,0 +1,37 @@ +var mkdirp = require('../').mkdirp; +var path = require('path'); +var fs = require('fs'); +var exists = fs.exists || path.exists; +var test = require('tap').test; +var _0777 = parseInt('0777', 8); +var _0755 = parseInt('0755', 8); + +test('race', function (t) { + t.plan(10); + var ps = [ '', 'tmp' ]; + + for (var i = 0; i < 25; i++) { + var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + ps.push(dir); + } + var file = ps.join('/'); + + var res = 2; + mk(file); + + mk(file); + + function mk (file, cb) { + mkdirp(file, _0755, function (err) { + t.ifError(err); + exists(file, function (ex) { + t.ok(ex, 'file created'); + fs.stat(file, function (err, stat) { + t.ifError(err); + t.equal(stat.mode & _0777, _0755); + t.ok(stat.isDirectory(), 'target not a directory'); + }); + }) + }); + } +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/rel.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/rel.js new file mode 100644 index 00000000..4ddb3427 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/rel.js @@ -0,0 +1,32 @@ +var mkdirp = require('../'); +var path = require('path'); +var fs = require('fs'); +var exists = fs.exists || path.exists; +var test = require('tap').test; +var _0777 = parseInt('0777', 8); +var _0755 = parseInt('0755', 8); + +test('rel', function (t) { + t.plan(5); + var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + + var cwd = process.cwd(); + process.chdir('/tmp'); + + var file = [x,y,z].join('/'); + + mkdirp(file, _0755, function (err) { + t.ifError(err); + exists(file, function (ex) { + t.ok(ex, 'file created'); + fs.stat(file, function (err, stat) { + t.ifError(err); + process.chdir(cwd); + t.equal(stat.mode & _0777, _0755); + t.ok(stat.isDirectory(), 'target not a directory'); + }) + }) + }); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/return.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/return.js new file mode 100644 index 00000000..bce68e56 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/return.js @@ -0,0 +1,25 @@ +var mkdirp = require('../'); +var path = require('path'); +var fs = require('fs'); +var test = require('tap').test; + +test('return value', function (t) { + t.plan(4); + var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + + var file = '/tmp/' + [x,y,z].join('/'); + + // should return the first dir created. + // By this point, it would be profoundly surprising if /tmp didn't + // already exist, since every other test makes things in there. + mkdirp(file, function (err, made) { + t.ifError(err); + t.equal(made, '/tmp/' + x); + mkdirp(file, function (err, made) { + t.ifError(err); + t.equal(made, null); + }); + }); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/return_sync.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/return_sync.js new file mode 100644 index 00000000..7c222d35 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/return_sync.js @@ -0,0 +1,24 @@ +var mkdirp = require('../'); +var path = require('path'); +var fs = require('fs'); +var test = require('tap').test; + +test('return value', function (t) { + t.plan(2); + var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + + var file = '/tmp/' + [x,y,z].join('/'); + + // should return the first dir created. + // By this point, it would be profoundly surprising if /tmp didn't + // already exist, since every other test makes things in there. + // Note that this will throw on failure, which will fail the test. + var made = mkdirp.sync(file); + t.equal(made, '/tmp/' + x); + + // making the same file again should have no effect. + made = mkdirp.sync(file); + t.equal(made, null); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/root.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/root.js new file mode 100644 index 00000000..9e7d079d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/root.js @@ -0,0 +1,19 @@ +var mkdirp = require('../'); +var path = require('path'); +var fs = require('fs'); +var test = require('tap').test; +var _0755 = parseInt('0755', 8); + +test('root', function (t) { + // '/' on unix, 'c:/' on windows. + var file = path.resolve('/'); + + mkdirp(file, _0755, function (err) { + if (err) throw err + fs.stat(file, function (er, stat) { + if (er) throw er + t.ok(stat.isDirectory(), 'target is a directory'); + t.end(); + }) + }); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/sync.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/sync.js new file mode 100644 index 00000000..8c8dc938 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/sync.js @@ -0,0 +1,32 @@ +var mkdirp = require('../'); +var path = require('path'); +var fs = require('fs'); +var exists = fs.exists || path.exists; +var test = require('tap').test; +var _0777 = parseInt('0777', 8); +var _0755 = parseInt('0755', 8); + +test('sync', function (t) { + t.plan(4); + var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + + var file = '/tmp/' + [x,y,z].join('/'); + + try { + mkdirp.sync(file, _0755); + } catch (err) { + t.fail(err); + return t.end(); + } + + exists(file, function (ex) { + t.ok(ex, 'file created'); + fs.stat(file, function (err, stat) { + t.ifError(err); + t.equal(stat.mode & _0777, _0755); + t.ok(stat.isDirectory(), 'target not a directory'); + }); + }); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/umask.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/umask.js new file mode 100644 index 00000000..2033c63a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/umask.js @@ -0,0 +1,28 @@ +var mkdirp = require('../'); +var path = require('path'); +var fs = require('fs'); +var exists = fs.exists || path.exists; +var test = require('tap').test; +var _0777 = parseInt('0777', 8); +var _0755 = parseInt('0755', 8); + +test('implicit mode from umask', function (t) { + t.plan(5); + var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + + var file = '/tmp/' + [x,y,z].join('/'); + + mkdirp(file, function (err) { + t.ifError(err); + exists(file, function (ex) { + t.ok(ex, 'file created'); + fs.stat(file, function (err, stat) { + t.ifError(err); + t.equal(stat.mode & _0777, _0777 & (~process.umask())); + t.ok(stat.isDirectory(), 'target not a directory'); + }); + }) + }); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/umask_sync.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/umask_sync.js new file mode 100644 index 00000000..11a76147 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/mkdirp/test/umask_sync.js @@ -0,0 +1,32 @@ +var mkdirp = require('../'); +var path = require('path'); +var fs = require('fs'); +var exists = fs.exists || path.exists; +var test = require('tap').test; +var _0777 = parseInt('0777', 8); +var _0755 = parseInt('0755', 8); + +test('umask sync modes', function (t) { + t.plan(4); + var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); + + var file = '/tmp/' + [x,y,z].join('/'); + + try { + mkdirp.sync(file); + } catch (err) { + t.fail(err); + return t.end(); + } + + exists(file, function (ex) { + t.ok(ex, 'file created'); + fs.stat(file, function (err, stat) { + t.ifError(err); + t.equal(stat.mode & _0777, (_0777 & (~process.umask()))); + t.ok(stat.isDirectory(), 'target not a directory'); + }); + }); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/.jshintrc b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/.jshintrc new file mode 100644 index 00000000..52475ba2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/.jshintrc @@ -0,0 +1,7 @@ +{ + "asi": true, + "laxcomma": true, + "es5": true, + "node": true, + "strict": false +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/.npmignore new file mode 100644 index 00000000..67484920 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/.npmignore @@ -0,0 +1,3 @@ +gyp/test +node_modules +test/.node-gyp diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/0001-gyp-always-install-into-PRODUCT_DIR.patch b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/0001-gyp-always-install-into-PRODUCT_DIR.patch new file mode 100644 index 00000000..694913f5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/0001-gyp-always-install-into-PRODUCT_DIR.patch @@ -0,0 +1,35 @@ +From 9b5e8dc426ada891d67d27b09acc73122ab46849 Mon Sep 17 00:00:00 2001 +From: Nathan Rajlich +Date: Wed, 14 Nov 2012 16:48:52 -0800 +Subject: [PATCH 1/3] gyp: always install into $PRODUCT_DIR + +--- + gyp/pylib/gyp/generator/make.py | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/gyp/pylib/gyp/generator/make.py b/gyp/pylib/gyp/generator/make.py +index b88a433..9b3e4e3 100644 +--- a/gyp/pylib/gyp/generator/make.py ++++ b/gyp/pylib/gyp/generator/make.py +@@ -1888,11 +1888,13 @@ $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj)/%%%s FORCE_DO_CMD + """Returns the location of the final output for an installable target.""" + # Xcode puts shared_library results into PRODUCT_DIR, and some gyp files + # rely on this. Emulate this behavior for mac. +- if (self.type == 'shared_library' and +- (self.flavor != 'mac' or self.toolset != 'target')): +- # Install all shared libs into a common directory (per toolset) for +- # convenient access with LD_LIBRARY_PATH. +- return '$(builddir)/lib.%s/%s' % (self.toolset, self.alias) ++ ++ # XXX(TooTallNate): disabling this code since we don't want this behavior... ++ #if (self.type == 'shared_library' and ++ # (self.flavor != 'mac' or self.toolset != 'target')): ++ # # Install all shared libs into a common directory (per toolset) for ++ # # convenient access with LD_LIBRARY_PATH. ++ # return '$(builddir)/lib.%s/%s' % (self.toolset, self.alias) + return '$(builddir)/' + self.alias + + +-- +2.3.2 (Apple Git-55) + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/0002-gyp-apply-https-codereview.chromium.org-11361103.patch b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/0002-gyp-apply-https-codereview.chromium.org-11361103.patch new file mode 100644 index 00000000..d1c5cac7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/0002-gyp-apply-https-codereview.chromium.org-11361103.patch @@ -0,0 +1,36 @@ +From 511840e82116662aa825088fb8a52a9f799f7767 Mon Sep 17 00:00:00 2001 +From: Nathan Rajlich +Date: Wed, 14 Nov 2012 16:54:04 -0800 +Subject: [PATCH 2/3] gyp: apply https://codereview.chromium.org/11361103/ + +--- + gyp/pylib/gyp/generator/msvs.py | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/gyp/pylib/gyp/generator/msvs.py b/gyp/pylib/gyp/generator/msvs.py +index d8e0872..c59aea1 100644 +--- a/gyp/pylib/gyp/generator/msvs.py ++++ b/gyp/pylib/gyp/generator/msvs.py +@@ -2720,6 +2720,9 @@ def _GetMSBuildAttributes(spec, config, build_file): + product_name = spec.get('product_name', '$(ProjectName)') + target_name = prefix + product_name + msbuild_attributes['TargetName'] = target_name ++ if 'TargetExt' not in msbuild_attributes and 'product_extension' in spec: ++ ext = spec.get('product_extension') ++ msbuild_attributes['TargetExt'] = '.' + ext + + if spec.get('msvs_external_builder'): + external_out_dir = spec.get('msvs_external_builder_out_dir', '.') +@@ -2773,6 +2776,9 @@ def _GetMSBuildConfigurationGlobalProperties(spec, configurations, build_file): + attributes['OutputDirectory']) + _AddConditionalProperty(properties, condition, 'TargetName', + attributes['TargetName']) ++ if 'TargetExt' in attributes: ++ _AddConditionalProperty(properties, condition, 'TargetExt', ++ attributes['TargetExt']) + + if attributes.get('TargetPath'): + _AddConditionalProperty(properties, condition, 'TargetPath', +-- +2.3.2 (Apple Git-55) + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/0003-gyp-don-t-use-links-at-all-just-copy-the-files-inste.patch b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/0003-gyp-don-t-use-links-at-all-just-copy-the-files-inste.patch new file mode 100644 index 00000000..673a3ddd --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/0003-gyp-don-t-use-links-at-all-just-copy-the-files-inste.patch @@ -0,0 +1,39 @@ +From 0cd9f08a6d4f4be6643001b6c3b5ad40e094bdcc Mon Sep 17 00:00:00 2001 +From: Nathan Zadoks +Date: Tue, 2 Jul 2013 11:07:16 -0700 +Subject: [PATCH 3/3] gyp: don't use links at all, just copy the files instead + +--- + gyp/pylib/gyp/generator/make.py | 2 +- + gyp/pylib/gyp/generator/ninja.py | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/gyp/pylib/gyp/generator/make.py b/gyp/pylib/gyp/generator/make.py +index 9b3e4e3..b3f8a2b 100644 +--- a/gyp/pylib/gyp/generator/make.py ++++ b/gyp/pylib/gyp/generator/make.py +@@ -372,7 +372,7 @@ cmd_touch = touch $@ + + quiet_cmd_copy = COPY $@ + # send stderr to /dev/null to ignore messages when linking directories. +-cmd_copy = ln -f "$<" "$@" 2>/dev/null || (rm -rf "$@" && cp -af "$<" "$@") ++cmd_copy = rm -rf "$@" && cp -af "$<" "$@" + + %(link_commands)s + """ +diff --git a/gyp/pylib/gyp/generator/ninja.py b/gyp/pylib/gyp/generator/ninja.py +index 7461814..c2951a4 100644 +--- a/gyp/pylib/gyp/generator/ninja.py ++++ b/gyp/pylib/gyp/generator/ninja.py +@@ -2020,7 +2020,7 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params, + master_ninja.rule( + 'copy', + description='COPY $in $out', +- command='ln -f $in $out 2>/dev/null || (rm -rf $out && cp -af $in $out)') ++ command='rm -rf $out && cp -af $in $out') + master_ninja.newline() + + all_targets = set() +-- +2.3.2 (Apple Git-55) + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/CHANGELOG.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/CHANGELOG.md new file mode 100644 index 00000000..080159dd --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/CHANGELOG.md @@ -0,0 +1,81 @@ +v3.4.0 2016-06-28 + +* [[`ce5fd04e94`](https://github.com/nodejs/node-gyp/commit/ce5fd04e94)] - **deps**: update minimatch version (delphiactual) [#961](https://github.com/nodejs/node-gyp/pull/961) +* [[`77383ddd85`](https://github.com/nodejs/node-gyp/commit/77383ddd85)] - Replace fs.accessSync call to fs.statSync (Richard Lau) [#955](https://github.com/nodejs/node-gyp/pull/955) +* [[`0dba4bda57`](https://github.com/nodejs/node-gyp/commit/0dba4bda57)] - **test**: add simple addon test (Richard Lau) [#955](https://github.com/nodejs/node-gyp/pull/955) +* [[`c4344b3889`](https://github.com/nodejs/node-gyp/commit/c4344b3889)] - **doc**: add --target option to README (Gibson Fahnestock) [#958](https://github.com/nodejs/node-gyp/pull/958) +* [[`cc778e9215`](https://github.com/nodejs/node-gyp/commit/cc778e9215)] - Override BUILDING_UV_SHARED, BUILDING_V8_SHARED. (Ben Noordhuis) [#915](https://github.com/nodejs/node-gyp/pull/915) +* [[`af35b2ad32`](https://github.com/nodejs/node-gyp/commit/af35b2ad32)] - Move VC++ Build Tools to Build Tools landing page. (Andrew Pardoe) [#953](https://github.com/nodejs/node-gyp/pull/953) +* [[`f31482e226`](https://github.com/nodejs/node-gyp/commit/f31482e226)] - **win**: work around __pfnDliNotifyHook2 type change (Alexis Campailla) [#952](https://github.com/nodejs/node-gyp/pull/952) +* [[`3df8222fa5`](https://github.com/nodejs/node-gyp/commit/3df8222fa5)] - Allow for npmlog@3.x (Rebecca Turner) [#950](https://github.com/nodejs/node-gyp/pull/950) +* [[`a4fa07b390`](https://github.com/nodejs/node-gyp/commit/a4fa07b390)] - More verbose error on locating msbuild.exe failure. (Mateusz Jaworski) [#930](https://github.com/nodejs/node-gyp/pull/930) +* [[`4ee31329e0`](https://github.com/nodejs/node-gyp/commit/4ee31329e0)] - **doc**: add command options to README.md (Gibson Fahnestock) [#937](https://github.com/nodejs/node-gyp/pull/937) +* [[`c8c7ca86b9`](https://github.com/nodejs/node-gyp/commit/c8c7ca86b9)] - Add --silent option for zero output. (Gibson Fahnestock) [#937](https://github.com/nodejs/node-gyp/pull/937) +* [[`ac29d23a7c`](https://github.com/nodejs/node-gyp/commit/ac29d23a7c)] - Upgrade to glob@7.0.3. (Ben Noordhuis) [#943](https://github.com/nodejs/node-gyp/pull/943) +* [[`15fd56be3d`](https://github.com/nodejs/node-gyp/commit/15fd56be3d)] - Enable V8 deprecation warnings for native modules (Matt Loring) [#920](https://github.com/nodejs/node-gyp/pull/920) +* [[`7f1c1b960c`](https://github.com/nodejs/node-gyp/commit/7f1c1b960c)] - **gyp**: improvements for android generator (Robert Chiras) [#935](https://github.com/nodejs/node-gyp/pull/935) +* [[`088082766c`](https://github.com/nodejs/node-gyp/commit/088082766c)] - Update Windows install instructions (Sara Itani) [#867](https://github.com/nodejs/node-gyp/pull/867) +* [[`625c1515f9`](https://github.com/nodejs/node-gyp/commit/625c1515f9)] - **gyp**: inherit CC/CXX for CC/CXX.host (Johan Bergström) [#908](https://github.com/nodejs/node-gyp/pull/908) +* [[`3bcb1720e4`](https://github.com/nodejs/node-gyp/commit/3bcb1720e4)] - Add support for the Python launcher on Windows (Patrick Westerhoff) [#894](https://github.com/nodejs/node-gyp/pull/894 + +v3.3.1 2016-03-04 + +* [[`a981ef847a`](https://github.com/nodejs/node-gyp/commit/a981ef847a)] - **gyp**: fix android generator (Robert Chiras) [#889](https://github.com/nodejs/node-gyp/pull/889) + +v3.3.0 2016-02-16 + +* [[`818d854a4d`](https://github.com/nodejs/node-gyp/commit/818d854a4d)] - Introduce NODEJS_ORG_MIRROR and IOJS_ORG_MIRROR (Rod Vagg) [#878](https://github.com/nodejs/node-gyp/pull/878) +* [[`d1e4cc4b62`](https://github.com/nodejs/node-gyp/commit/d1e4cc4b62)] - **(SEMVER-MINOR)** Download headers tarball for ~0.12.10 || ~0.10.42 (Rod Vagg) [#877](https://github.com/nodejs/node-gyp/pull/877) +* [[`6e28ad1bea`](https://github.com/nodejs/node-gyp/commit/6e28ad1bea)] - Allow for npmlog@2.x (Rebecca Turner) [#861](https://github.com/nodejs/node-gyp/pull/861) +* [[`07371e5812`](https://github.com/nodejs/node-gyp/commit/07371e5812)] - Use -fPIC for NetBSD. (Marcin Cieślak) [#856](https://github.com/nodejs/node-gyp/pull/856) +* [[`8c4b0ffa50`](https://github.com/nodejs/node-gyp/commit/8c4b0ffa50)] - **(SEMVER-MINOR)** Add --cafile command line option. (Ben Noordhuis) [#837](https://github.com/nodejs/node-gyp/pull/837) +* [[`b3ad43498e`](https://github.com/nodejs/node-gyp/commit/b3ad43498e)] - **(SEMVER-MINOR)** Make download() function testable. (Ben Noordhuis) [#837](https://github.com/nodejs/node-gyp/pull/837) + +v3.2.1 2015-12-03 + +* [[`ab89b477c4`](https://github.com/nodejs/node-gyp/commit/ab89b477c4)] - Upgrade gyp to b3cef02. (Ben Noordhuis) [#831](https://github.com/nodejs/node-gyp/pull/831) +* [[`90078ecb17`](https://github.com/nodejs/node-gyp/commit/90078ecb17)] - Define WIN32_LEAN_AND_MEAN conditionally. (Ben Noordhuis) [#824](https://github.com/nodejs/node-gyp/pull/824) + +v3.2.0 2015-11-25 + +* [[`268f1ca4c7`](https://github.com/nodejs/node-gyp/commit/268f1ca4c7)] - Use result of `which` when searching for python. (Refael Ackermann) [#668](https://github.com/nodejs/node-gyp/pull/668) +* [[`817ed9bd78`](https://github.com/nodejs/node-gyp/commit/817ed9bd78)] - Add test for python executable search logic. (Ben Noordhuis) [#756](https://github.com/nodejs/node-gyp/pull/756) +* [[`0e2dfda1f3`](https://github.com/nodejs/node-gyp/commit/0e2dfda1f3)] - Fix test/test-options when run through `npm test`. (Ben Noordhuis) [#755](https://github.com/nodejs/node-gyp/pull/755) +* [[`9bfa0876b4`](https://github.com/nodejs/node-gyp/commit/9bfa0876b4)] - Add support for AIX (Michael Dawson) [#753](https://github.com/nodejs/node-gyp/pull/753) +* [[`a8d441a0a2`](https://github.com/nodejs/node-gyp/commit/a8d441a0a2)] - Update README for Windows 10 support. (Jason Williams) [#766](https://github.com/nodejs/node-gyp/pull/766) +* [[`d1d6015276`](https://github.com/nodejs/node-gyp/commit/d1d6015276)] - Update broken links and switch to HTTPS. (andrew morton) + +v3.1.0 2015-11-14 + +* [[`9049241f91`](https://github.com/nodejs/node-gyp/commit/9049241f91)] - **gyp**: don't use links at all, just copy the files instead (Nathan Zadoks) +* [[`8ef90348d1`](https://github.com/nodejs/node-gyp/commit/8ef90348d1)] - **gyp**: apply https://codereview.chromium.org/11361103/ (Nathan Rajlich) +* [[`a2ed0df84e`](https://github.com/nodejs/node-gyp/commit/a2ed0df84e)] - **gyp**: always install into $PRODUCT_DIR (Nathan Rajlich) +* [[`cc8b2fa83e`](https://github.com/nodejs/node-gyp/commit/cc8b2fa83e)] - Update gyp to b3cef02. (Imran Iqbal) [#781](https://github.com/nodejs/node-gyp/pull/781) +* [[`f5d86eb84e`](https://github.com/nodejs/node-gyp/commit/f5d86eb84e)] - Update to tar@2.0.0. (Edgar Muentes) [#797](https://github.com/nodejs/node-gyp/pull/797) +* [[`2ac7de02c4`](https://github.com/nodejs/node-gyp/commit/2ac7de02c4)] - Fix infinite loop with zero-length options. (Ben Noordhuis) [#745](https://github.com/nodejs/node-gyp/pull/745) +* [[`101bed639b`](https://github.com/nodejs/node-gyp/commit/101bed639b)] - This platform value came from debian package, and now the value (Jérémy Lal) [#738](https://github.com/nodejs/node-gyp/pull/738) + +v3.0.3 2015-09-14 + +* [[`ad827cda30`](https://github.com/nodejs/node-gyp/commit/ad827cda30)] - tarballUrl global and && when checking for iojs (Lars-Magnus Skog) [#729](https://github.com/nodejs/node-gyp/pull/729) + +v3.0.2 2015-09-12 + +* [[`6e8c3bf3c6`](https://github.com/nodejs/node-gyp/commit/6e8c3bf3c6)] - add back support for passing additional cmdline args (Rod Vagg) [#723](https://github.com/nodejs/node-gyp/pull/723) +* [[`ff82f2f3b9`](https://github.com/nodejs/node-gyp/commit/ff82f2f3b9)] - fixed broken link in docs to Visual Studio 2013 download (simon-p-r) [#722](https://github.com/nodejs/node-gyp/pull/722) + +v3.0.1 2015-09-08 + +* [[`846337e36b`](https://github.com/nodejs/node-gyp/commit/846337e36b)] - normalise versions for target == this comparison (Rod Vagg) [#716](https://github.com/nodejs/node-gyp/pull/716) + +v3.0.0 2015-09-08 + +* [[`9720d0373c`](https://github.com/nodejs/node-gyp/commit/9720d0373c)] - remove node_modules from tree (Rod Vagg) [#711](https://github.com/nodejs/node-gyp/pull/711) +* [[`6dcf220db7`](https://github.com/nodejs/node-gyp/commit/6dcf220db7)] - test version major directly, don't use semver.satisfies() (Rod Vagg) [#711](https://github.com/nodejs/node-gyp/pull/711) +* [[`938dd18d1c`](https://github.com/nodejs/node-gyp/commit/938dd18d1c)] - refactor for clarity, fix dist-url, add env var dist-url functionality (Rod Vagg) [#711](https://github.com/nodejs/node-gyp/pull/711) +* [[`9e9df66a06`](https://github.com/nodejs/node-gyp/commit/9e9df66a06)] - use process.release, make aware of io.js & node v4 differences (Rod Vagg) [#711](https://github.com/nodejs/node-gyp/pull/711) +* [[`1ea7ed01f4`](https://github.com/nodejs/node-gyp/commit/1ea7ed01f4)] - **deps**: update graceful-fs dependency to the latest (Sakthipriyan Vairamani) [#714](https://github.com/nodejs/node-gyp/pull/714) +* [[`0fbc387b35`](https://github.com/nodejs/node-gyp/commit/0fbc387b35)] - Update repository URLs. (Ben Noordhuis) [#715](https://github.com/nodejs/node-gyp/pull/715) +* [[`bbedb8868b`](https://github.com/nodejs/node-gyp/commit/bbedb8868b)] - **(SEMVER-MAJOR)** **win**: enable delay-load hook by default (Jeremiah Senkpiel) [#708](https://github.com/nodejs/node-gyp/pull/708) +* [[`85ed107565`](https://github.com/nodejs/node-gyp/commit/85ed107565)] - Merge pull request #664 from othiym23/othiym23/allow-semver-5 (Nathan Rajlich) +* [[`0c720d234c`](https://github.com/nodejs/node-gyp/commit/0c720d234c)] - allow semver@5 (Forrest L Norvell) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/History.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/History.md new file mode 100644 index 00000000..8768081e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/History.md @@ -0,0 +1,41 @@ + +2.0.2 / 2015-07-14 +================== + + * Use HTTPS for dist url (#656, @SonicHedgehog) + * Merge pull request #648 from nevosegal/master + * Merge pull request #650 from magic890/patch-1 + * Updated Installation section on README + * Updated link to gyp user documentation + * Fix download error message spelling (#643, @tomxtobin) + * Merge pull request #637 from lygstate/master + * Set NODE_GYP_DIR for addon.gypi to setting absolute path for + src/win_delay_load_hook.c, and fixes of the long relative path issue on Win32. + Fixes #636 (#637, @lygstate). + +2.0.1 / 2015-05-28 +================== + + * configure: try/catch the semver range.test() call + * README: update for visual studio 2013 (#510, @samccone) + +2.0.0 / 2015-05-24 +================== + + * configure: check for python2 executable by default, fallback to python + * configure: don't clobber existing $PYTHONPATH + * configure: use "path-array" for PYTHONPATH + * gyp: fix for non-acsii userprofile name on Windows + * gyp: always install into $PRODUCT_DIR + * gyp: apply https://codereview.chromium.org/11361103/ + * gyp: don't use links at all, just copy the files instead + * gyp: update gyp to e1c8fcf7 + * Updated README.md with updated Windows build info + * Show URL when a download fails + * package: add a "license" field + * move HMODULE m declaration to top + * Only add "-undefined dynamic_lookup" to loadable_module targets + * win: optionally allow node.exe/iojs.exe to be renamed + * Avoid downloading shasums if using tarPath + * Add target name preprocessor define: `NODE_GYP_MODULE_NAME` + * Show better error message in case of bad network settings diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/LICENSE new file mode 100644 index 00000000..2ea4dc5e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/LICENSE @@ -0,0 +1,24 @@ +(The MIT License) + +Copyright (c) 2012 Nathan Rajlich + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/README.md new file mode 100644 index 00000000..5212b124 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/README.md @@ -0,0 +1,216 @@ +node-gyp +========= +### Node.js native addon build tool + +`node-gyp` is a cross-platform command-line tool written in Node.js for compiling +native addon modules for Node.js. It bundles the [gyp](https://code.google.com/p/gyp/) +project used by the Chromium team and takes away the pain of dealing with the +various differences in build platforms. It is the replacement to the `node-waf` +program which is removed for node `v0.8`. If you have a native addon for node that +still has a `wscript` file, then you should definitely add a `binding.gyp` file +to support the latest versions of node. + +Multiple target versions of node are supported (i.e. `0.8`, ..., `4`, `5`, `6`, +etc.), regardless of what version of node is actually installed on your system +(`node-gyp` downloads the necessary development files or headers for the target version). + +#### Features: + + * Easy to use, consistent interface + * Same commands to build your module on every platform + * Supports multiple target versions of Node + + +Installation +------------ + +You can install with `npm`: + +``` bash +$ npm install -g node-gyp +``` + +You will also need to install: + + * On Unix: + * `python` (`v2.7` recommended, `v3.x.x` is __*not*__ supported) + * `make` + * A proper C/C++ compiler toolchain, like [GCC](https://gcc.gnu.org) + * On Mac OS X: + * `python` (`v2.7` recommended, `v3.x.x` is __*not*__ supported) (already installed on Mac OS X) + * [Xcode](https://developer.apple.com/xcode/download/) + * You also need to install the `Command Line Tools` via Xcode. You can find this under the menu `Xcode -> Preferences -> Downloads` + * This step will install `gcc` and the related toolchain containing `make` + * On Windows: + * Visual C++ Build Environment: + * Option 1: Install [Visual C++ Build Tools](http://landinghub.visualstudio.com/visual-cpp-build-tools) using the **Default Install** option. + + * Option 2: Install [Visual Studio 2015](https://www.visualstudio.com/products/visual-studio-community-vs) (or modify an existing installation) and select *Common Tools for Visual C++* during setup. This also works with the free Community and Express for Desktop editions. + + > :bulb: [Windows Vista / 7 only] requires [.NET Framework 4.5.1](http://www.microsoft.com/en-us/download/details.aspx?id=40773) + + * Install [Python 2.7](https://www.python.org/downloads/) (`v3.x.x` is not supported), and run `npm config set python python2.7` (or see below for further instructions on specifying the proper Python version and path.) + * Launch cmd, `npm config set msvs_version 2015` + + If the above steps didn't work for you, please visit [Microsoft's Node.js Guidelines for Windows](https://github.com/Microsoft/nodejs-guidelines/blob/master/windows-environment.md#compiling-native-addon-modules) for additional tips. + +If you have multiple Python versions installed, you can identify which Python +version `node-gyp` uses by setting the '--python' variable: + +``` bash +$ node-gyp --python /path/to/python2.7 +``` + +If `node-gyp` is called by way of `npm` *and* you have multiple versions of +Python installed, then you can set `npm`'s 'python' config key to the appropriate +value: + +``` bash +$ npm config set python /path/to/executable/python2.7 +``` + +Note that OS X is just a flavour of Unix and so needs `python`, `make`, and C/C++. +An easy way to obtain these is to install XCode from Apple, +and then use it to install the command line tools (under Preferences -> Downloads). + +How to Use +---------- + +To compile your native addon, first go to its root directory: + +``` bash +$ cd my_node_addon +``` + +The next step is to generate the appropriate project build files for the current +platform. Use `configure` for that: + +``` bash +$ node-gyp configure +``` + +__Note__: The `configure` step looks for the `binding.gyp` file in the current +directory to process. See below for instructions on creating the `binding.gyp` file. + +Now you will have either a `Makefile` (on Unix platforms) or a `vcxproj` file +(on Windows) in the `build/` directory. Next invoke the `build` command: + +``` bash +$ node-gyp build +``` + +Now you have your compiled `.node` bindings file! The compiled bindings end up +in `build/Debug/` or `build/Release/`, depending on the build mode. At this point +you can require the `.node` file with Node and run your tests! + +__Note:__ To create a _Debug_ build of the bindings file, pass the `--debug` (or +`-d`) switch when running either the `configure`, `build` or `rebuild` command. + + +The "binding.gyp" file +---------------------- + +Previously when node had `node-waf` you had to write a `wscript` file. The +replacement for that is the `binding.gyp` file, which describes the configuration +to build your module in a JSON-like format. This file gets placed in the root of +your package, alongside the `package.json` file. + +A barebones `gyp` file appropriate for building a node addon looks like: + +``` python +{ + "targets": [ + { + "target_name": "binding", + "sources": [ "src/binding.cc" ] + } + ] +} +``` + +Some additional resources for addons and writing `gyp` files: + + * ["Going Native" a nodeschool.io tutorial](http://nodeschool.io/#goingnative) + * ["Hello World" node addon example](https://github.com/nodejs/node/tree/master/test/addons/hello-world) + * [gyp user documentation](https://gyp.gsrc.io/docs/UserDocumentation.md) + * [gyp input format reference](https://gyp.gsrc.io/docs/InputFormatReference.md) + * [*"binding.gyp" files out in the wild* wiki page](https://github.com/nodejs/node-gyp/wiki/%22binding.gyp%22-files-out-in-the-wild) + + +Commands +-------- + +`node-gyp` responds to the following commands: + +| **Command** | **Description** +|:--------------|:--------------------------------------------------------------- +| `help` | Shows the help dialog +| `build` | Invokes `make`/`msbuild.exe` and builds the native addon +| `clean` | Removes the `build` directory if it exists +| `configure` | Generates project build files for the current platform +| `rebuild` | Runs `clean`, `configure` and `build` all in a row +| `install` | Installs node header files for the given version +| `list` | Lists the currently installed node header versions +| `remove` | Removes the node header files for the given version + + +Command Options +-------- + +`node-gyp` accepts the following command options: + +| **Command** | **Description** +|:----------------------------------|:------------------------------------------ +| `-j n`, `--jobs n` | Run make in parallel +| `--target=v6.2.1` | Node version to build for (default=process.version) +| `--silly`, `--loglevel=silly` | Log all progress to console +| `--verbose`, `--loglevel=verbose` | Log most progress to console +| `--silent`, `--loglevel=silent` | Don't log anything to console +| `debug`, `--debug` | Make Debug build (default=Release) +| `--release`, `--no-debug` | Make Release build +| `-C $dir`, `--directory=$dir` | Run command in different directory +| `--make=$make` | Override make command (e.g. gmake) +| `--thin=yes` | Enable thin static libraries +| `--arch=$arch` | Set target architecture (e.g. ia32) +| `--tarball=$path` | Get headers from a local tarball +| `--ensure` | Don't reinstall headers if already present +| `--dist-url=$url` | Download header tarball from custom URL +| `--proxy=$url` | Set HTTP proxy for downloading header tarball +| `--cafile=$cafile` | Override default CA chain (to download tarball) +| `--nodedir=$path` | Set the path to the node binary +| `--python=$path` | Set path to the python (2) binary +| `--msvs_version=$version` | Set Visual Studio version (win) +| `--solution=$solution` | Set Visual Studio Solution version (win) + + +License +------- + +(The MIT License) + +Copyright (c) 2012 Nathan Rajlich <nathan@tootallnate.net> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +[python-v2.7.10]: https://www.python.org/downloads/release/python-2710/ +[msvc2013]: https://www.microsoft.com/en-gb/download/details.aspx?id=44914 +[win7sdk]: https://www.microsoft.com/en-us/download/details.aspx?id=8279 +[compiler update for the Windows SDK 7.1]: https://www.microsoft.com/en-us/download/details.aspx?id=4422 diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/addon.gypi b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/addon.gypi new file mode 100644 index 00000000..3be0f591 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/addon.gypi @@ -0,0 +1,116 @@ +{ + 'target_defaults': { + 'type': 'loadable_module', + 'win_delay_load_hook': 'true', + 'product_prefix': '', + + 'include_dirs': [ + '<(node_root_dir)/include/node', + '<(node_root_dir)/src', + '<(node_root_dir)/deps/uv/include', + '<(node_root_dir)/deps/v8/include' + ], + 'defines!': [ + 'BUILDING_UV_SHARED=1', # Inherited from common.gypi. + 'BUILDING_V8_SHARED=1', # Inherited from common.gypi. + ], + 'defines': [ + 'NODE_GYP_MODULE_NAME=>(_target_name)', + 'USING_UV_SHARED=1', + 'USING_V8_SHARED=1', + # Warn when using deprecated V8 APIs. + 'V8_DEPRECATION_WARNINGS=1' + ], + + 'target_conditions': [ + ['_type=="loadable_module"', { + 'product_extension': 'node', + 'defines': [ + 'BUILDING_NODE_EXTENSION' + ], + 'xcode_settings': { + 'OTHER_LDFLAGS': [ + '-undefined dynamic_lookup' + ], + }, + }], + + ['_type=="static_library"', { + # set to `1` to *disable* the -T thin archive 'ld' flag. + # older linkers don't support this flag. + 'standalone_static_library': '<(standalone_static_library)' + }], + + ['_win_delay_load_hook=="true"', { + # If the addon specifies `'win_delay_load_hook': 'true'` in its + # binding.gyp, link a delay-load hook into the DLL. This hook ensures + # that the addon will work regardless of whether the node/iojs binary + # is named node.exe, iojs.exe, or something else. + 'conditions': [ + [ 'OS=="win"', { + 'sources': [ + '<(node_gyp_dir)/src/win_delay_load_hook.cc', + ], + 'msvs_settings': { + 'VCLinkerTool': { + 'DelayLoadDLLs': [ 'iojs.exe', 'node.exe' ], + # Don't print a linker warning when no imports from either .exe + # are used. + 'AdditionalOptions': [ '/ignore:4199' ], + }, + }, + }], + ], + }], + ], + + 'conditions': [ + [ 'OS=="mac"', { + 'defines': [ + '_DARWIN_USE_64_BIT_INODE=1' + ], + 'xcode_settings': { + 'DYLIB_INSTALL_NAME_BASE': '@rpath' + }, + }], + [ 'OS=="aix"', { + 'ldflags': [ + '-Wl,-bimport:<(node_exp_file)' + ], + }], + [ 'OS=="win"', { + 'libraries': [ + '-lkernel32.lib', + '-luser32.lib', + '-lgdi32.lib', + '-lwinspool.lib', + '-lcomdlg32.lib', + '-ladvapi32.lib', + '-lshell32.lib', + '-lole32.lib', + '-loleaut32.lib', + '-luuid.lib', + '-lodbc32.lib', + '-lDelayImp.lib', + '-l"<(node_root_dir)/$(ConfigurationName)/<(node_lib_file)"' + ], + 'msvs_disabled_warnings': [ + # warning C4251: 'node::ObjectWrap::handle_' : class 'v8::Persistent' + # needs to have dll-interface to be used by + # clients of class 'node::ObjectWrap' + 4251 + ], + }, { + # OS!="win" + 'defines': [ + '_LARGEFILE_SOURCE', + '_FILE_OFFSET_BITS=64' + ], + }], + [ 'OS in "freebsd openbsd netbsd solaris" or \ + (OS=="linux" and target_arch!="ia32")', { + 'cflags': [ '-fPIC' ], + }] + ] + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/.npmignore new file mode 100644 index 00000000..0d20b648 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/.npmignore @@ -0,0 +1 @@ +*.pyc diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/AUTHORS b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/AUTHORS new file mode 100644 index 00000000..fecf84a1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/AUTHORS @@ -0,0 +1,12 @@ +# Names should be added to this file like so: +# Name or Organization + +Google Inc. +Bloomberg Finance L.P. +Yandex LLC + +Steven Knight +Ryan Norton +David J. Sankel +Eric N. Vander Weele +Tom Freudenberg diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/DEPS b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/DEPS new file mode 100644 index 00000000..2e1120f2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/DEPS @@ -0,0 +1,24 @@ +# DEPS file for gclient use in buildbot execution of gyp tests. +# +# (You don't need to use gclient for normal GYP development work.) + +vars = { + "chrome_trunk": "http://src.chromium.org/svn/trunk", + "googlecode_url": "http://%s.googlecode.com/svn", +} + +deps = { +} + +deps_os = { + "win": { + "third_party/cygwin": + Var("chrome_trunk") + "/deps/third_party/cygwin@66844", + + "third_party/python_26": + Var("chrome_trunk") + "/tools/third_party/python_26@89111", + + "src/third_party/pefile": + (Var("googlecode_url") % "pefile") + "/trunk@63", + }, +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/LICENSE new file mode 100644 index 00000000..ab6b011a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2009 Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/OWNERS b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/OWNERS new file mode 100644 index 00000000..72e8ffc0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/OWNERS @@ -0,0 +1 @@ +* diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/PRESUBMIT.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/PRESUBMIT.py new file mode 100644 index 00000000..dde02538 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/PRESUBMIT.py @@ -0,0 +1,137 @@ +# Copyright (c) 2012 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + + +"""Top-level presubmit script for GYP. + +See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts +for more details about the presubmit API built into gcl. +""" + + +PYLINT_BLACKLIST = [ + # TODO: fix me. + # From SCons, not done in google style. + 'test/lib/TestCmd.py', + 'test/lib/TestCommon.py', + 'test/lib/TestGyp.py', +] + + +PYLINT_DISABLED_WARNINGS = [ + # TODO: fix me. + # Many tests include modules they don't use. + 'W0611', + # Possible unbalanced tuple unpacking with sequence. + 'W0632', + # Attempting to unpack a non-sequence. + 'W0633', + # Include order doesn't properly include local files? + 'F0401', + # Some use of built-in names. + 'W0622', + # Some unused variables. + 'W0612', + # Operator not preceded/followed by space. + 'C0323', + 'C0322', + # Unnecessary semicolon. + 'W0301', + # Unused argument. + 'W0613', + # String has no effect (docstring in wrong place). + 'W0105', + # map/filter on lambda could be replaced by comprehension. + 'W0110', + # Use of eval. + 'W0123', + # Comma not followed by space. + 'C0324', + # Access to a protected member. + 'W0212', + # Bad indent. + 'W0311', + # Line too long. + 'C0301', + # Undefined variable. + 'E0602', + # Not exception type specified. + 'W0702', + # No member of that name. + 'E1101', + # Dangerous default {}. + 'W0102', + # Cyclic import. + 'R0401', + # Others, too many to sort. + 'W0201', 'W0232', 'E1103', 'W0621', 'W0108', 'W0223', 'W0231', + 'R0201', 'E0101', 'C0321', + # ************* Module copy + # W0104:427,12:_test.odict.__setitem__: Statement seems to have no effect + 'W0104', +] + + +def CheckChangeOnUpload(input_api, output_api): + report = [] + report.extend(input_api.canned_checks.PanProjectChecks( + input_api, output_api)) + return report + + +def CheckChangeOnCommit(input_api, output_api): + report = [] + + # Accept any year number from 2009 to the current year. + current_year = int(input_api.time.strftime('%Y')) + allowed_years = (str(s) for s in reversed(xrange(2009, current_year + 1))) + years_re = '(' + '|'.join(allowed_years) + ')' + + # The (c) is deprecated, but tolerate it until it's removed from all files. + license = ( + r'.*? Copyright (\(c\) )?%(year)s Google Inc\. All rights reserved\.\n' + r'.*? Use of this source code is governed by a BSD-style license that ' + r'can be\n' + r'.*? found in the LICENSE file\.\n' + ) % { + 'year': years_re, + } + + report.extend(input_api.canned_checks.PanProjectChecks( + input_api, output_api, license_header=license)) + report.extend(input_api.canned_checks.CheckTreeIsOpen( + input_api, output_api, + 'http://gyp-status.appspot.com/status', + 'http://gyp-status.appspot.com/current')) + + import os + import sys + old_sys_path = sys.path + try: + sys.path = ['pylib', 'test/lib'] + sys.path + blacklist = PYLINT_BLACKLIST + if sys.platform == 'win32': + blacklist = [os.path.normpath(x).replace('\\', '\\\\') + for x in PYLINT_BLACKLIST] + report.extend(input_api.canned_checks.RunPylint( + input_api, + output_api, + black_list=blacklist, + disabled_warnings=PYLINT_DISABLED_WARNINGS)) + finally: + sys.path = old_sys_path + return report + + +TRYBOTS = [ + 'linux_try', + 'mac_try', + 'win_try', +] + + +def GetPreferredTryMasters(_, change): + return { + 'client.gyp': { t: set(['defaulttests']) for t in TRYBOTS }, + } diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/buildbot/aosp_manifest.xml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/buildbot/aosp_manifest.xml new file mode 100644 index 00000000..bd73b303 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/buildbot/aosp_manifest.xml @@ -0,0 +1,466 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/buildbot/buildbot_run.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/buildbot/buildbot_run.py new file mode 100644 index 00000000..9a2b71f1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/buildbot/buildbot_run.py @@ -0,0 +1,136 @@ +#!/usr/bin/env python +# Copyright (c) 2012 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Argument-less script to select what to run on the buildbots.""" + +import os +import shutil +import subprocess +import sys + + +BUILDBOT_DIR = os.path.dirname(os.path.abspath(__file__)) +TRUNK_DIR = os.path.dirname(BUILDBOT_DIR) +ROOT_DIR = os.path.dirname(TRUNK_DIR) +CMAKE_DIR = os.path.join(ROOT_DIR, 'cmake') +CMAKE_BIN_DIR = os.path.join(CMAKE_DIR, 'bin') +OUT_DIR = os.path.join(TRUNK_DIR, 'out') + + +def CallSubProcess(*args, **kwargs): + """Wrapper around subprocess.call which treats errors as build exceptions.""" + with open(os.devnull) as devnull_fd: + retcode = subprocess.call(stdin=devnull_fd, *args, **kwargs) + if retcode != 0: + print '@@@STEP_EXCEPTION@@@' + sys.exit(1) + + +def PrepareCmake(): + """Build CMake 2.8.8 since the version in Precise is 2.8.7.""" + if os.environ['BUILDBOT_CLOBBER'] == '1': + print '@@@BUILD_STEP Clobber CMake checkout@@@' + shutil.rmtree(CMAKE_DIR) + + # We always build CMake 2.8.8, so no need to do anything + # if the directory already exists. + if os.path.isdir(CMAKE_DIR): + return + + print '@@@BUILD_STEP Initialize CMake checkout@@@' + os.mkdir(CMAKE_DIR) + + print '@@@BUILD_STEP Sync CMake@@@' + CallSubProcess( + ['git', 'clone', + '--depth', '1', + '--single-branch', + '--branch', 'v2.8.8', + '--', + 'git://cmake.org/cmake.git', + CMAKE_DIR], + cwd=CMAKE_DIR) + + print '@@@BUILD_STEP Build CMake@@@' + CallSubProcess( + ['/bin/bash', 'bootstrap', '--prefix=%s' % CMAKE_DIR], + cwd=CMAKE_DIR) + + CallSubProcess( ['make', 'cmake'], cwd=CMAKE_DIR) + + +def GypTestFormat(title, format=None, msvs_version=None, tests=[]): + """Run the gyp tests for a given format, emitting annotator tags. + + See annotator docs at: + https://sites.google.com/a/chromium.org/dev/developers/testing/chromium-build-infrastructure/buildbot-annotations + Args: + format: gyp format to test. + Returns: + 0 for sucesss, 1 for failure. + """ + if not format: + format = title + + print '@@@BUILD_STEP ' + title + '@@@' + sys.stdout.flush() + env = os.environ.copy() + if msvs_version: + env['GYP_MSVS_VERSION'] = msvs_version + command = ' '.join( + [sys.executable, 'gyp/gyptest.py', + '--all', + '--passed', + '--format', format, + '--path', CMAKE_BIN_DIR, + '--chdir', 'gyp'] + tests) + retcode = subprocess.call(command, cwd=ROOT_DIR, env=env, shell=True) + if retcode: + # Emit failure tag, and keep going. + print '@@@STEP_FAILURE@@@' + return 1 + return 0 + + +def GypBuild(): + # Dump out/ directory. + print '@@@BUILD_STEP cleanup@@@' + print 'Removing %s...' % OUT_DIR + shutil.rmtree(OUT_DIR, ignore_errors=True) + print 'Done.' + + retcode = 0 + if sys.platform.startswith('linux'): + retcode += GypTestFormat('ninja') + retcode += GypTestFormat('make') + PrepareCmake() + retcode += GypTestFormat('cmake') + elif sys.platform == 'darwin': + retcode += GypTestFormat('ninja') + retcode += GypTestFormat('xcode') + retcode += GypTestFormat('make') + elif sys.platform == 'win32': + retcode += GypTestFormat('ninja') + if os.environ['BUILDBOT_BUILDERNAME'] == 'gyp-win64': + retcode += GypTestFormat('msvs-ninja-2013', format='msvs-ninja', + msvs_version='2013', + tests=[ + r'test\generator-output\gyptest-actions.py', + r'test\generator-output\gyptest-relocate.py', + r'test\generator-output\gyptest-rules.py']) + retcode += GypTestFormat('msvs-2013', format='msvs', msvs_version='2013') + else: + raise Exception('Unknown platform') + if retcode: + # TODO(bradnelson): once the annotator supports a postscript (section for + # after the build proper that could be used for cumulative failures), + # use that instead of this. This isolates the final return value so + # that it isn't misattributed to the last stage. + print '@@@BUILD_STEP failures@@@' + sys.exit(retcode) + + +if __name__ == '__main__': + GypBuild() diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/buildbot/commit_queue/OWNERS b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/buildbot/commit_queue/OWNERS new file mode 100644 index 00000000..b269c198 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/buildbot/commit_queue/OWNERS @@ -0,0 +1,6 @@ +set noparent +bradnelson@chromium.org +bradnelson@google.com +iannucci@chromium.org +scottmg@chromium.org +thakis@chromium.org diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/buildbot/commit_queue/README b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/buildbot/commit_queue/README new file mode 100644 index 00000000..94284978 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/buildbot/commit_queue/README @@ -0,0 +1,3 @@ +cq_config.json describes the trybots that must pass in order +to land a change through the commit queue. +Comments are here as the file is strictly JSON. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/buildbot/commit_queue/cq_config.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/buildbot/commit_queue/cq_config.json new file mode 100644 index 00000000..656c21e5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/buildbot/commit_queue/cq_config.json @@ -0,0 +1,15 @@ +{ + "trybots": { + "launched": { + "tryserver.nacl": { + "gyp-presubmit": ["defaulttests"], + "gyp-linux": ["defaulttests"], + "gyp-mac": ["defaulttests"], + "gyp-win32": ["defaulttests"], + "gyp-win64": ["defaulttests"] + } + }, + "triggered": { + } + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/codereview.settings b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/codereview.settings new file mode 100644 index 00000000..faf37f11 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/codereview.settings @@ -0,0 +1,10 @@ +# This file is used by gcl to get repository specific information. +CODE_REVIEW_SERVER: codereview.chromium.org +CC_LIST: gyp-developer@googlegroups.com +VIEW_VC: https://chromium.googlesource.com/external/gyp/+/ +TRY_ON_UPLOAD: False +TRYSERVER_PROJECT: gyp +TRYSERVER_PATCHLEVEL: 1 +TRYSERVER_ROOT: gyp +TRYSERVER_SVN_URL: svn://svn.chromium.org/chrome-try/try-nacl +PROJECT: gyp diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/data/win/large-pdb-shim.cc b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/data/win/large-pdb-shim.cc new file mode 100644 index 00000000..8bca5108 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/data/win/large-pdb-shim.cc @@ -0,0 +1,12 @@ +// Copyright (c) 2013 Google Inc. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// This file is used to generate an empty .pdb -- with a 4KB pagesize -- that is +// then used during the final link for modules that have large PDBs. Otherwise, +// the linker will generate a pdb with a page size of 1KB, which imposes a limit +// of 1GB on the .pdb. By generating an initial empty .pdb with the compiler +// (rather than the linker), this limit is avoided. With this in place PDBs may +// grow to 2GB. +// +// This file is referenced by the msvs_large_pdb mechanism in MSVSUtil.py. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/gyp b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/gyp new file mode 100644 index 00000000..1b8b9bdf --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/gyp @@ -0,0 +1,8 @@ +#!/bin/sh +# Copyright 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +set -e +base=$(dirname "$0") +exec python "${base}/gyp_main.py" "$@" diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/gyp.bat b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/gyp.bat new file mode 100644 index 00000000..ad797c30 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/gyp.bat @@ -0,0 +1,5 @@ +@rem Copyright (c) 2009 Google Inc. All rights reserved. +@rem Use of this source code is governed by a BSD-style license that can be +@rem found in the LICENSE file. + +@python "%~dp0gyp_main.py" %* diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py new file mode 100644 index 00000000..25a6eba9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python + +# Copyright (c) 2009 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import os +import sys + +# Make sure we're using the version of pylib in this repo, not one installed +# elsewhere on the system. +sys.path.insert(0, os.path.join(os.path.dirname(sys.argv[0]), 'pylib')) +import gyp + +if __name__ == '__main__': + sys.exit(gyp.script_main()) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/gyptest.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/gyptest.py new file mode 100644 index 00000000..8e4fc47d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/gyptest.py @@ -0,0 +1,274 @@ +#!/usr/bin/env python + +# Copyright (c) 2012 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +__doc__ = """ +gyptest.py -- test runner for GYP tests. +""" + +import os +import optparse +import subprocess +import sys + +class CommandRunner(object): + """ + Executor class for commands, including "commands" implemented by + Python functions. + """ + verbose = True + active = True + + def __init__(self, dictionary={}): + self.subst_dictionary(dictionary) + + def subst_dictionary(self, dictionary): + self._subst_dictionary = dictionary + + def subst(self, string, dictionary=None): + """ + Substitutes (via the format operator) the values in the specified + dictionary into the specified command. + + The command can be an (action, string) tuple. In all cases, we + perform substitution on strings and don't worry if something isn't + a string. (It's probably a Python function to be executed.) + """ + if dictionary is None: + dictionary = self._subst_dictionary + if dictionary: + try: + string = string % dictionary + except TypeError: + pass + return string + + def display(self, command, stdout=None, stderr=None): + if not self.verbose: + return + if type(command) == type(()): + func = command[0] + args = command[1:] + s = '%s(%s)' % (func.__name__, ', '.join(map(repr, args))) + if type(command) == type([]): + # TODO: quote arguments containing spaces + # TODO: handle meta characters? + s = ' '.join(command) + else: + s = self.subst(command) + if not s.endswith('\n'): + s += '\n' + sys.stdout.write(s) + sys.stdout.flush() + + def execute(self, command, stdout=None, stderr=None): + """ + Executes a single command. + """ + if not self.active: + return 0 + if type(command) == type(''): + command = self.subst(command) + cmdargs = shlex.split(command) + if cmdargs[0] == 'cd': + command = (os.chdir,) + tuple(cmdargs[1:]) + if type(command) == type(()): + func = command[0] + args = command[1:] + return func(*args) + else: + if stdout is sys.stdout: + # Same as passing sys.stdout, except python2.4 doesn't fail on it. + subout = None + else: + # Open pipe for anything else so Popen works on python2.4. + subout = subprocess.PIPE + if stderr is sys.stderr: + # Same as passing sys.stderr, except python2.4 doesn't fail on it. + suberr = None + elif stderr is None: + # Merge with stdout if stderr isn't specified. + suberr = subprocess.STDOUT + else: + # Open pipe for anything else so Popen works on python2.4. + suberr = subprocess.PIPE + p = subprocess.Popen(command, + shell=(sys.platform == 'win32'), + stdout=subout, + stderr=suberr) + p.wait() + if stdout is None: + self.stdout = p.stdout.read() + elif stdout is not sys.stdout: + stdout.write(p.stdout.read()) + if stderr not in (None, sys.stderr): + stderr.write(p.stderr.read()) + return p.returncode + + def run(self, command, display=None, stdout=None, stderr=None): + """ + Runs a single command, displaying it first. + """ + if display is None: + display = command + self.display(display) + return self.execute(command, stdout, stderr) + + +class Unbuffered(object): + def __init__(self, fp): + self.fp = fp + def write(self, arg): + self.fp.write(arg) + self.fp.flush() + def __getattr__(self, attr): + return getattr(self.fp, attr) + +sys.stdout = Unbuffered(sys.stdout) +sys.stderr = Unbuffered(sys.stderr) + + +def is_test_name(f): + return f.startswith('gyptest') and f.endswith('.py') + + +def find_all_gyptest_files(directory): + result = [] + for root, dirs, files in os.walk(directory): + if '.svn' in dirs: + dirs.remove('.svn') + result.extend([ os.path.join(root, f) for f in files if is_test_name(f) ]) + result.sort() + return result + + +def main(argv=None): + if argv is None: + argv = sys.argv + + usage = "gyptest.py [-ahlnq] [-f formats] [test ...]" + parser = optparse.OptionParser(usage=usage) + parser.add_option("-a", "--all", action="store_true", + help="run all tests") + parser.add_option("-C", "--chdir", action="store", default=None, + help="chdir to the specified directory") + parser.add_option("-f", "--format", action="store", default='', + help="run tests with the specified formats") + parser.add_option("-G", '--gyp_option', action="append", default=[], + help="Add -G options to the gyp command line") + parser.add_option("-l", "--list", action="store_true", + help="list available tests and exit") + parser.add_option("-n", "--no-exec", action="store_true", + help="no execute, just print the command line") + parser.add_option("--passed", action="store_true", + help="report passed tests") + parser.add_option("--path", action="append", default=[], + help="additional $PATH directory") + parser.add_option("-q", "--quiet", action="store_true", + help="quiet, don't print test command lines") + opts, args = parser.parse_args(argv[1:]) + + if opts.chdir: + os.chdir(opts.chdir) + + if opts.path: + extra_path = [os.path.abspath(p) for p in opts.path] + extra_path = os.pathsep.join(extra_path) + os.environ['PATH'] = extra_path + os.pathsep + os.environ['PATH'] + + if not args: + if not opts.all: + sys.stderr.write('Specify -a to get all tests.\n') + return 1 + args = ['test'] + + tests = [] + for arg in args: + if os.path.isdir(arg): + tests.extend(find_all_gyptest_files(os.path.normpath(arg))) + else: + if not is_test_name(os.path.basename(arg)): + print >>sys.stderr, arg, 'is not a valid gyp test name.' + sys.exit(1) + tests.append(arg) + + if opts.list: + for test in tests: + print test + sys.exit(0) + + CommandRunner.verbose = not opts.quiet + CommandRunner.active = not opts.no_exec + cr = CommandRunner() + + os.environ['PYTHONPATH'] = os.path.abspath('test/lib') + if not opts.quiet: + sys.stdout.write('PYTHONPATH=%s\n' % os.environ['PYTHONPATH']) + + passed = [] + failed = [] + no_result = [] + + if opts.format: + format_list = opts.format.split(',') + else: + # TODO: not duplicate this mapping from pylib/gyp/__init__.py + format_list = { + 'aix5': ['make'], + 'freebsd7': ['make'], + 'freebsd8': ['make'], + 'openbsd5': ['make'], + 'cygwin': ['msvs'], + 'win32': ['msvs', 'ninja'], + 'linux2': ['make', 'ninja'], + 'linux3': ['make', 'ninja'], + 'darwin': ['make', 'ninja', 'xcode', 'xcode-ninja'], + }[sys.platform] + + for format in format_list: + os.environ['TESTGYP_FORMAT'] = format + if not opts.quiet: + sys.stdout.write('TESTGYP_FORMAT=%s\n' % format) + + gyp_options = [] + for option in opts.gyp_option: + gyp_options += ['-G', option] + if gyp_options and not opts.quiet: + sys.stdout.write('Extra Gyp options: %s\n' % gyp_options) + + for test in tests: + status = cr.run([sys.executable, test] + gyp_options, + stdout=sys.stdout, + stderr=sys.stderr) + if status == 2: + no_result.append(test) + elif status: + failed.append(test) + else: + passed.append(test) + + if not opts.quiet: + def report(description, tests): + if tests: + if len(tests) == 1: + sys.stdout.write("\n%s the following test:\n" % description) + else: + fmt = "\n%s the following %d tests:\n" + sys.stdout.write(fmt % (description, len(tests))) + sys.stdout.write("\t" + "\n\t".join(tests) + "\n") + + if opts.passed: + report("Passed", passed) + report("Failed", failed) + report("No result from", no_result) + + if failed: + return 1 + else: + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py new file mode 100644 index 00000000..593f0e5b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py @@ -0,0 +1,340 @@ +# Copyright (c) 2012 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""New implementation of Visual Studio project generation.""" + +import os +import random + +import gyp.common + +# hashlib is supplied as of Python 2.5 as the replacement interface for md5 +# and other secure hashes. In 2.6, md5 is deprecated. Import hashlib if +# available, avoiding a deprecation warning under 2.6. Import md5 otherwise, +# preserving 2.4 compatibility. +try: + import hashlib + _new_md5 = hashlib.md5 +except ImportError: + import md5 + _new_md5 = md5.new + + +# Initialize random number generator +random.seed() + +# GUIDs for project types +ENTRY_TYPE_GUIDS = { + 'project': '{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}', + 'folder': '{2150E333-8FDC-42A3-9474-1A3956D46DE8}', +} + +#------------------------------------------------------------------------------ +# Helper functions + + +def MakeGuid(name, seed='msvs_new'): + """Returns a GUID for the specified target name. + + Args: + name: Target name. + seed: Seed for MD5 hash. + Returns: + A GUID-line string calculated from the name and seed. + + This generates something which looks like a GUID, but depends only on the + name and seed. This means the same name/seed will always generate the same + GUID, so that projects and solutions which refer to each other can explicitly + determine the GUID to refer to explicitly. It also means that the GUID will + not change when the project for a target is rebuilt. + """ + # Calculate a MD5 signature for the seed and name. + d = _new_md5(str(seed) + str(name)).hexdigest().upper() + # Convert most of the signature to GUID form (discard the rest) + guid = ('{' + d[:8] + '-' + d[8:12] + '-' + d[12:16] + '-' + d[16:20] + + '-' + d[20:32] + '}') + return guid + +#------------------------------------------------------------------------------ + + +class MSVSSolutionEntry(object): + def __cmp__(self, other): + # Sort by name then guid (so things are in order on vs2008). + return cmp((self.name, self.get_guid()), (other.name, other.get_guid())) + + +class MSVSFolder(MSVSSolutionEntry): + """Folder in a Visual Studio project or solution.""" + + def __init__(self, path, name = None, entries = None, + guid = None, items = None): + """Initializes the folder. + + Args: + path: Full path to the folder. + name: Name of the folder. + entries: List of folder entries to nest inside this folder. May contain + Folder or Project objects. May be None, if the folder is empty. + guid: GUID to use for folder, if not None. + items: List of solution items to include in the folder project. May be + None, if the folder does not directly contain items. + """ + if name: + self.name = name + else: + # Use last layer. + self.name = os.path.basename(path) + + self.path = path + self.guid = guid + + # Copy passed lists (or set to empty lists) + self.entries = sorted(list(entries or [])) + self.items = list(items or []) + + self.entry_type_guid = ENTRY_TYPE_GUIDS['folder'] + + def get_guid(self): + if self.guid is None: + # Use consistent guids for folders (so things don't regenerate). + self.guid = MakeGuid(self.path, seed='msvs_folder') + return self.guid + + +#------------------------------------------------------------------------------ + + +class MSVSProject(MSVSSolutionEntry): + """Visual Studio project.""" + + def __init__(self, path, name = None, dependencies = None, guid = None, + spec = None, build_file = None, config_platform_overrides = None, + fixpath_prefix = None): + """Initializes the project. + + Args: + path: Absolute path to the project file. + name: Name of project. If None, the name will be the same as the base + name of the project file. + dependencies: List of other Project objects this project is dependent + upon, if not None. + guid: GUID to use for project, if not None. + spec: Dictionary specifying how to build this project. + build_file: Filename of the .gyp file that the vcproj file comes from. + config_platform_overrides: optional dict of configuration platforms to + used in place of the default for this target. + fixpath_prefix: the path used to adjust the behavior of _fixpath + """ + self.path = path + self.guid = guid + self.spec = spec + self.build_file = build_file + # Use project filename if name not specified + self.name = name or os.path.splitext(os.path.basename(path))[0] + + # Copy passed lists (or set to empty lists) + self.dependencies = list(dependencies or []) + + self.entry_type_guid = ENTRY_TYPE_GUIDS['project'] + + if config_platform_overrides: + self.config_platform_overrides = config_platform_overrides + else: + self.config_platform_overrides = {} + self.fixpath_prefix = fixpath_prefix + self.msbuild_toolset = None + + def set_dependencies(self, dependencies): + self.dependencies = list(dependencies or []) + + def get_guid(self): + if self.guid is None: + # Set GUID from path + # TODO(rspangler): This is fragile. + # 1. We can't just use the project filename sans path, since there could + # be multiple projects with the same base name (for example, + # foo/unittest.vcproj and bar/unittest.vcproj). + # 2. The path needs to be relative to $SOURCE_ROOT, so that the project + # GUID is the same whether it's included from base/base.sln or + # foo/bar/baz/baz.sln. + # 3. The GUID needs to be the same each time this builder is invoked, so + # that we don't need to rebuild the solution when the project changes. + # 4. We should be able to handle pre-built project files by reading the + # GUID from the files. + self.guid = MakeGuid(self.name) + return self.guid + + def set_msbuild_toolset(self, msbuild_toolset): + self.msbuild_toolset = msbuild_toolset + +#------------------------------------------------------------------------------ + + +class MSVSSolution(object): + """Visual Studio solution.""" + + def __init__(self, path, version, entries=None, variants=None, + websiteProperties=True): + """Initializes the solution. + + Args: + path: Path to solution file. + version: Format version to emit. + entries: List of entries in solution. May contain Folder or Project + objects. May be None, if the folder is empty. + variants: List of build variant strings. If none, a default list will + be used. + websiteProperties: Flag to decide if the website properties section + is generated. + """ + self.path = path + self.websiteProperties = websiteProperties + self.version = version + + # Copy passed lists (or set to empty lists) + self.entries = list(entries or []) + + if variants: + # Copy passed list + self.variants = variants[:] + else: + # Use default + self.variants = ['Debug|Win32', 'Release|Win32'] + # TODO(rspangler): Need to be able to handle a mapping of solution config + # to project config. Should we be able to handle variants being a dict, + # or add a separate variant_map variable? If it's a dict, we can't + # guarantee the order of variants since dict keys aren't ordered. + + + # TODO(rspangler): Automatically write to disk for now; should delay until + # node-evaluation time. + self.Write() + + + def Write(self, writer=gyp.common.WriteOnDiff): + """Writes the solution file to disk. + + Raises: + IndexError: An entry appears multiple times. + """ + # Walk the entry tree and collect all the folders and projects. + all_entries = set() + entries_to_check = self.entries[:] + while entries_to_check: + e = entries_to_check.pop(0) + + # If this entry has been visited, nothing to do. + if e in all_entries: + continue + + all_entries.add(e) + + # If this is a folder, check its entries too. + if isinstance(e, MSVSFolder): + entries_to_check += e.entries + + all_entries = sorted(all_entries) + + # Open file and print header + f = writer(self.path) + f.write('Microsoft Visual Studio Solution File, ' + 'Format Version %s\r\n' % self.version.SolutionVersion()) + f.write('# %s\r\n' % self.version.Description()) + + # Project entries + sln_root = os.path.split(self.path)[0] + for e in all_entries: + relative_path = gyp.common.RelativePath(e.path, sln_root) + # msbuild does not accept an empty folder_name. + # use '.' in case relative_path is empty. + folder_name = relative_path.replace('/', '\\') or '.' + f.write('Project("%s") = "%s", "%s", "%s"\r\n' % ( + e.entry_type_guid, # Entry type GUID + e.name, # Folder name + folder_name, # Folder name (again) + e.get_guid(), # Entry GUID + )) + + # TODO(rspangler): Need a way to configure this stuff + if self.websiteProperties: + f.write('\tProjectSection(WebsiteProperties) = preProject\r\n' + '\t\tDebug.AspNetCompiler.Debug = "True"\r\n' + '\t\tRelease.AspNetCompiler.Debug = "False"\r\n' + '\tEndProjectSection\r\n') + + if isinstance(e, MSVSFolder): + if e.items: + f.write('\tProjectSection(SolutionItems) = preProject\r\n') + for i in e.items: + f.write('\t\t%s = %s\r\n' % (i, i)) + f.write('\tEndProjectSection\r\n') + + if isinstance(e, MSVSProject): + if e.dependencies: + f.write('\tProjectSection(ProjectDependencies) = postProject\r\n') + for d in e.dependencies: + f.write('\t\t%s = %s\r\n' % (d.get_guid(), d.get_guid())) + f.write('\tEndProjectSection\r\n') + + f.write('EndProject\r\n') + + # Global section + f.write('Global\r\n') + + # Configurations (variants) + f.write('\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\r\n') + for v in self.variants: + f.write('\t\t%s = %s\r\n' % (v, v)) + f.write('\tEndGlobalSection\r\n') + + # Sort config guids for easier diffing of solution changes. + config_guids = [] + config_guids_overrides = {} + for e in all_entries: + if isinstance(e, MSVSProject): + config_guids.append(e.get_guid()) + config_guids_overrides[e.get_guid()] = e.config_platform_overrides + config_guids.sort() + + f.write('\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\r\n') + for g in config_guids: + for v in self.variants: + nv = config_guids_overrides[g].get(v, v) + # Pick which project configuration to build for this solution + # configuration. + f.write('\t\t%s.%s.ActiveCfg = %s\r\n' % ( + g, # Project GUID + v, # Solution build configuration + nv, # Project build config for that solution config + )) + + # Enable project in this solution configuration. + f.write('\t\t%s.%s.Build.0 = %s\r\n' % ( + g, # Project GUID + v, # Solution build configuration + nv, # Project build config for that solution config + )) + f.write('\tEndGlobalSection\r\n') + + # TODO(rspangler): Should be able to configure this stuff too (though I've + # never seen this be any different) + f.write('\tGlobalSection(SolutionProperties) = preSolution\r\n') + f.write('\t\tHideSolutionNode = FALSE\r\n') + f.write('\tEndGlobalSection\r\n') + + # Folder mappings + # Omit this section if there are no folders + if any([e.entries for e in all_entries if isinstance(e, MSVSFolder)]): + f.write('\tGlobalSection(NestedProjects) = preSolution\r\n') + for e in all_entries: + if not isinstance(e, MSVSFolder): + continue # Does not apply to projects, only folders + for subentry in e.entries: + f.write('\t\t%s = %s\r\n' % (subentry.get_guid(), e.get_guid())) + f.write('\tEndGlobalSection\r\n') + + f.write('EndGlobal\r\n') + + f.close() diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.pyc b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.pyc new file mode 100644 index 00000000..29a35bcb Binary files /dev/null and b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.pyc differ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py new file mode 100644 index 00000000..db1ceede --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py @@ -0,0 +1,208 @@ +# Copyright (c) 2012 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Visual Studio project reader/writer.""" + +import gyp.common +import gyp.easy_xml as easy_xml + +#------------------------------------------------------------------------------ + + +class Tool(object): + """Visual Studio tool.""" + + def __init__(self, name, attrs=None): + """Initializes the tool. + + Args: + name: Tool name. + attrs: Dict of tool attributes; may be None. + """ + self._attrs = attrs or {} + self._attrs['Name'] = name + + def _GetSpecification(self): + """Creates an element for the tool. + + Returns: + A new xml.dom.Element for the tool. + """ + return ['Tool', self._attrs] + +class Filter(object): + """Visual Studio filter - that is, a virtual folder.""" + + def __init__(self, name, contents=None): + """Initializes the folder. + + Args: + name: Filter (folder) name. + contents: List of filenames and/or Filter objects contained. + """ + self.name = name + self.contents = list(contents or []) + + +#------------------------------------------------------------------------------ + + +class Writer(object): + """Visual Studio XML project writer.""" + + def __init__(self, project_path, version, name, guid=None, platforms=None): + """Initializes the project. + + Args: + project_path: Path to the project file. + version: Format version to emit. + name: Name of the project. + guid: GUID to use for project, if not None. + platforms: Array of string, the supported platforms. If null, ['Win32'] + """ + self.project_path = project_path + self.version = version + self.name = name + self.guid = guid + + # Default to Win32 for platforms. + if not platforms: + platforms = ['Win32'] + + # Initialize the specifications of the various sections. + self.platform_section = ['Platforms'] + for platform in platforms: + self.platform_section.append(['Platform', {'Name': platform}]) + self.tool_files_section = ['ToolFiles'] + self.configurations_section = ['Configurations'] + self.files_section = ['Files'] + + # Keep a dict keyed on filename to speed up access. + self.files_dict = dict() + + def AddToolFile(self, path): + """Adds a tool file to the project. + + Args: + path: Relative path from project to tool file. + """ + self.tool_files_section.append(['ToolFile', {'RelativePath': path}]) + + def _GetSpecForConfiguration(self, config_type, config_name, attrs, tools): + """Returns the specification for a configuration. + + Args: + config_type: Type of configuration node. + config_name: Configuration name. + attrs: Dict of configuration attributes; may be None. + tools: List of tools (strings or Tool objects); may be None. + Returns: + """ + # Handle defaults + if not attrs: + attrs = {} + if not tools: + tools = [] + + # Add configuration node and its attributes + node_attrs = attrs.copy() + node_attrs['Name'] = config_name + specification = [config_type, node_attrs] + + # Add tool nodes and their attributes + if tools: + for t in tools: + if isinstance(t, Tool): + specification.append(t._GetSpecification()) + else: + specification.append(Tool(t)._GetSpecification()) + return specification + + + def AddConfig(self, name, attrs=None, tools=None): + """Adds a configuration to the project. + + Args: + name: Configuration name. + attrs: Dict of configuration attributes; may be None. + tools: List of tools (strings or Tool objects); may be None. + """ + spec = self._GetSpecForConfiguration('Configuration', name, attrs, tools) + self.configurations_section.append(spec) + + def _AddFilesToNode(self, parent, files): + """Adds files and/or filters to the parent node. + + Args: + parent: Destination node + files: A list of Filter objects and/or relative paths to files. + + Will call itself recursively, if the files list contains Filter objects. + """ + for f in files: + if isinstance(f, Filter): + node = ['Filter', {'Name': f.name}] + self._AddFilesToNode(node, f.contents) + else: + node = ['File', {'RelativePath': f}] + self.files_dict[f] = node + parent.append(node) + + def AddFiles(self, files): + """Adds files to the project. + + Args: + files: A list of Filter objects and/or relative paths to files. + + This makes a copy of the file/filter tree at the time of this call. If you + later add files to a Filter object which was passed into a previous call + to AddFiles(), it will not be reflected in this project. + """ + self._AddFilesToNode(self.files_section, files) + # TODO(rspangler) This also doesn't handle adding files to an existing + # filter. That is, it doesn't merge the trees. + + def AddFileConfig(self, path, config, attrs=None, tools=None): + """Adds a configuration to a file. + + Args: + path: Relative path to the file. + config: Name of configuration to add. + attrs: Dict of configuration attributes; may be None. + tools: List of tools (strings or Tool objects); may be None. + + Raises: + ValueError: Relative path does not match any file added via AddFiles(). + """ + # Find the file node with the right relative path + parent = self.files_dict.get(path) + if not parent: + raise ValueError('AddFileConfig: file "%s" not in project.' % path) + + # Add the config to the file node + spec = self._GetSpecForConfiguration('FileConfiguration', config, attrs, + tools) + parent.append(spec) + + def WriteIfChanged(self): + """Writes the project file.""" + # First create XML content definition + content = [ + 'VisualStudioProject', + {'ProjectType': 'Visual C++', + 'Version': self.version.ProjectVersion(), + 'Name': self.name, + 'ProjectGUID': self.guid, + 'RootNamespace': self.name, + 'Keyword': 'Win32Proj' + }, + self.platform_section, + self.tool_files_section, + self.configurations_section, + ['References'], # empty section + self.files_section, + ['Globals'] # empty section + ] + easy_xml.WriteXmlIfChanged(content, self.project_path, + encoding="Windows-1252") diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.pyc b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.pyc new file mode 100644 index 00000000..e1fd243e Binary files /dev/null and b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.pyc differ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py new file mode 100644 index 00000000..4985756b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py @@ -0,0 +1,1096 @@ +# Copyright (c) 2012 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +r"""Code to validate and convert settings of the Microsoft build tools. + +This file contains code to validate and convert settings of the Microsoft +build tools. The function ConvertToMSBuildSettings(), ValidateMSVSSettings(), +and ValidateMSBuildSettings() are the entry points. + +This file was created by comparing the projects created by Visual Studio 2008 +and Visual Studio 2010 for all available settings through the user interface. +The MSBuild schemas were also considered. They are typically found in the +MSBuild install directory, e.g. c:\Program Files (x86)\MSBuild +""" + +import sys +import re + +# Dictionaries of settings validators. The key is the tool name, the value is +# a dictionary mapping setting names to validation functions. +_msvs_validators = {} +_msbuild_validators = {} + + +# A dictionary of settings converters. The key is the tool name, the value is +# a dictionary mapping setting names to conversion functions. +_msvs_to_msbuild_converters = {} + + +# Tool name mapping from MSVS to MSBuild. +_msbuild_name_of_tool = {} + + +class _Tool(object): + """Represents a tool used by MSVS or MSBuild. + + Attributes: + msvs_name: The name of the tool in MSVS. + msbuild_name: The name of the tool in MSBuild. + """ + + def __init__(self, msvs_name, msbuild_name): + self.msvs_name = msvs_name + self.msbuild_name = msbuild_name + + +def _AddTool(tool): + """Adds a tool to the four dictionaries used to process settings. + + This only defines the tool. Each setting also needs to be added. + + Args: + tool: The _Tool object to be added. + """ + _msvs_validators[tool.msvs_name] = {} + _msbuild_validators[tool.msbuild_name] = {} + _msvs_to_msbuild_converters[tool.msvs_name] = {} + _msbuild_name_of_tool[tool.msvs_name] = tool.msbuild_name + + +def _GetMSBuildToolSettings(msbuild_settings, tool): + """Returns an MSBuild tool dictionary. Creates it if needed.""" + return msbuild_settings.setdefault(tool.msbuild_name, {}) + + +class _Type(object): + """Type of settings (Base class).""" + + def ValidateMSVS(self, value): + """Verifies that the value is legal for MSVS. + + Args: + value: the value to check for this type. + + Raises: + ValueError if value is not valid for MSVS. + """ + + def ValidateMSBuild(self, value): + """Verifies that the value is legal for MSBuild. + + Args: + value: the value to check for this type. + + Raises: + ValueError if value is not valid for MSBuild. + """ + + def ConvertToMSBuild(self, value): + """Returns the MSBuild equivalent of the MSVS value given. + + Args: + value: the MSVS value to convert. + + Returns: + the MSBuild equivalent. + + Raises: + ValueError if value is not valid. + """ + return value + + +class _String(_Type): + """A setting that's just a string.""" + + def ValidateMSVS(self, value): + if not isinstance(value, basestring): + raise ValueError('expected string; got %r' % value) + + def ValidateMSBuild(self, value): + if not isinstance(value, basestring): + raise ValueError('expected string; got %r' % value) + + def ConvertToMSBuild(self, value): + # Convert the macros + return ConvertVCMacrosToMSBuild(value) + + +class _StringList(_Type): + """A settings that's a list of strings.""" + + def ValidateMSVS(self, value): + if not isinstance(value, basestring) and not isinstance(value, list): + raise ValueError('expected string list; got %r' % value) + + def ValidateMSBuild(self, value): + if not isinstance(value, basestring) and not isinstance(value, list): + raise ValueError('expected string list; got %r' % value) + + def ConvertToMSBuild(self, value): + # Convert the macros + if isinstance(value, list): + return [ConvertVCMacrosToMSBuild(i) for i in value] + else: + return ConvertVCMacrosToMSBuild(value) + + +class _Boolean(_Type): + """Boolean settings, can have the values 'false' or 'true'.""" + + def _Validate(self, value): + if value != 'true' and value != 'false': + raise ValueError('expected bool; got %r' % value) + + def ValidateMSVS(self, value): + self._Validate(value) + + def ValidateMSBuild(self, value): + self._Validate(value) + + def ConvertToMSBuild(self, value): + self._Validate(value) + return value + + +class _Integer(_Type): + """Integer settings.""" + + def __init__(self, msbuild_base=10): + _Type.__init__(self) + self._msbuild_base = msbuild_base + + def ValidateMSVS(self, value): + # Try to convert, this will raise ValueError if invalid. + self.ConvertToMSBuild(value) + + def ValidateMSBuild(self, value): + # Try to convert, this will raise ValueError if invalid. + int(value, self._msbuild_base) + + def ConvertToMSBuild(self, value): + msbuild_format = (self._msbuild_base == 10) and '%d' or '0x%04x' + return msbuild_format % int(value) + + +class _Enumeration(_Type): + """Type of settings that is an enumeration. + + In MSVS, the values are indexes like '0', '1', and '2'. + MSBuild uses text labels that are more representative, like 'Win32'. + + Constructor args: + label_list: an array of MSBuild labels that correspond to the MSVS index. + In the rare cases where MSVS has skipped an index value, None is + used in the array to indicate the unused spot. + new: an array of labels that are new to MSBuild. + """ + + def __init__(self, label_list, new=None): + _Type.__init__(self) + self._label_list = label_list + self._msbuild_values = set(value for value in label_list + if value is not None) + if new is not None: + self._msbuild_values.update(new) + + def ValidateMSVS(self, value): + # Try to convert. It will raise an exception if not valid. + self.ConvertToMSBuild(value) + + def ValidateMSBuild(self, value): + if value not in self._msbuild_values: + raise ValueError('unrecognized enumerated value %s' % value) + + def ConvertToMSBuild(self, value): + index = int(value) + if index < 0 or index >= len(self._label_list): + raise ValueError('index value (%d) not in expected range [0, %d)' % + (index, len(self._label_list))) + label = self._label_list[index] + if label is None: + raise ValueError('converted value for %s not specified.' % value) + return label + + +# Instantiate the various generic types. +_boolean = _Boolean() +_integer = _Integer() +# For now, we don't do any special validation on these types: +_string = _String() +_file_name = _String() +_folder_name = _String() +_file_list = _StringList() +_folder_list = _StringList() +_string_list = _StringList() +# Some boolean settings went from numerical values to boolean. The +# mapping is 0: default, 1: false, 2: true. +_newly_boolean = _Enumeration(['', 'false', 'true']) + + +def _Same(tool, name, setting_type): + """Defines a setting that has the same name in MSVS and MSBuild. + + Args: + tool: a dictionary that gives the names of the tool for MSVS and MSBuild. + name: the name of the setting. + setting_type: the type of this setting. + """ + _Renamed(tool, name, name, setting_type) + + +def _Renamed(tool, msvs_name, msbuild_name, setting_type): + """Defines a setting for which the name has changed. + + Args: + tool: a dictionary that gives the names of the tool for MSVS and MSBuild. + msvs_name: the name of the MSVS setting. + msbuild_name: the name of the MSBuild setting. + setting_type: the type of this setting. + """ + + def _Translate(value, msbuild_settings): + msbuild_tool_settings = _GetMSBuildToolSettings(msbuild_settings, tool) + msbuild_tool_settings[msbuild_name] = setting_type.ConvertToMSBuild(value) + + _msvs_validators[tool.msvs_name][msvs_name] = setting_type.ValidateMSVS + _msbuild_validators[tool.msbuild_name][msbuild_name] = ( + setting_type.ValidateMSBuild) + _msvs_to_msbuild_converters[tool.msvs_name][msvs_name] = _Translate + + +def _Moved(tool, settings_name, msbuild_tool_name, setting_type): + _MovedAndRenamed(tool, settings_name, msbuild_tool_name, settings_name, + setting_type) + + +def _MovedAndRenamed(tool, msvs_settings_name, msbuild_tool_name, + msbuild_settings_name, setting_type): + """Defines a setting that may have moved to a new section. + + Args: + tool: a dictionary that gives the names of the tool for MSVS and MSBuild. + msvs_settings_name: the MSVS name of the setting. + msbuild_tool_name: the name of the MSBuild tool to place the setting under. + msbuild_settings_name: the MSBuild name of the setting. + setting_type: the type of this setting. + """ + + def _Translate(value, msbuild_settings): + tool_settings = msbuild_settings.setdefault(msbuild_tool_name, {}) + tool_settings[msbuild_settings_name] = setting_type.ConvertToMSBuild(value) + + _msvs_validators[tool.msvs_name][msvs_settings_name] = ( + setting_type.ValidateMSVS) + validator = setting_type.ValidateMSBuild + _msbuild_validators[msbuild_tool_name][msbuild_settings_name] = validator + _msvs_to_msbuild_converters[tool.msvs_name][msvs_settings_name] = _Translate + + +def _MSVSOnly(tool, name, setting_type): + """Defines a setting that is only found in MSVS. + + Args: + tool: a dictionary that gives the names of the tool for MSVS and MSBuild. + name: the name of the setting. + setting_type: the type of this setting. + """ + + def _Translate(unused_value, unused_msbuild_settings): + # Since this is for MSVS only settings, no translation will happen. + pass + + _msvs_validators[tool.msvs_name][name] = setting_type.ValidateMSVS + _msvs_to_msbuild_converters[tool.msvs_name][name] = _Translate + + +def _MSBuildOnly(tool, name, setting_type): + """Defines a setting that is only found in MSBuild. + + Args: + tool: a dictionary that gives the names of the tool for MSVS and MSBuild. + name: the name of the setting. + setting_type: the type of this setting. + """ + + def _Translate(value, msbuild_settings): + # Let msbuild-only properties get translated as-is from msvs_settings. + tool_settings = msbuild_settings.setdefault(tool.msbuild_name, {}) + tool_settings[name] = value + + _msbuild_validators[tool.msbuild_name][name] = setting_type.ValidateMSBuild + _msvs_to_msbuild_converters[tool.msvs_name][name] = _Translate + + +def _ConvertedToAdditionalOption(tool, msvs_name, flag): + """Defines a setting that's handled via a command line option in MSBuild. + + Args: + tool: a dictionary that gives the names of the tool for MSVS and MSBuild. + msvs_name: the name of the MSVS setting that if 'true' becomes a flag + flag: the flag to insert at the end of the AdditionalOptions + """ + + def _Translate(value, msbuild_settings): + if value == 'true': + tool_settings = _GetMSBuildToolSettings(msbuild_settings, tool) + if 'AdditionalOptions' in tool_settings: + new_flags = '%s %s' % (tool_settings['AdditionalOptions'], flag) + else: + new_flags = flag + tool_settings['AdditionalOptions'] = new_flags + _msvs_validators[tool.msvs_name][msvs_name] = _boolean.ValidateMSVS + _msvs_to_msbuild_converters[tool.msvs_name][msvs_name] = _Translate + + +def _CustomGeneratePreprocessedFile(tool, msvs_name): + def _Translate(value, msbuild_settings): + tool_settings = _GetMSBuildToolSettings(msbuild_settings, tool) + if value == '0': + tool_settings['PreprocessToFile'] = 'false' + tool_settings['PreprocessSuppressLineNumbers'] = 'false' + elif value == '1': # /P + tool_settings['PreprocessToFile'] = 'true' + tool_settings['PreprocessSuppressLineNumbers'] = 'false' + elif value == '2': # /EP /P + tool_settings['PreprocessToFile'] = 'true' + tool_settings['PreprocessSuppressLineNumbers'] = 'true' + else: + raise ValueError('value must be one of [0, 1, 2]; got %s' % value) + # Create a bogus validator that looks for '0', '1', or '2' + msvs_validator = _Enumeration(['a', 'b', 'c']).ValidateMSVS + _msvs_validators[tool.msvs_name][msvs_name] = msvs_validator + msbuild_validator = _boolean.ValidateMSBuild + msbuild_tool_validators = _msbuild_validators[tool.msbuild_name] + msbuild_tool_validators['PreprocessToFile'] = msbuild_validator + msbuild_tool_validators['PreprocessSuppressLineNumbers'] = msbuild_validator + _msvs_to_msbuild_converters[tool.msvs_name][msvs_name] = _Translate + + +fix_vc_macro_slashes_regex_list = ('IntDir', 'OutDir') +fix_vc_macro_slashes_regex = re.compile( + r'(\$\((?:%s)\))(?:[\\/]+)' % "|".join(fix_vc_macro_slashes_regex_list) +) + +# Regular expression to detect keys that were generated by exclusion lists +_EXCLUDED_SUFFIX_RE = re.compile('^(.*)_excluded$') + + +def _ValidateExclusionSetting(setting, settings, error_msg, stderr=sys.stderr): + """Verify that 'setting' is valid if it is generated from an exclusion list. + + If the setting appears to be generated from an exclusion list, the root name + is checked. + + Args: + setting: A string that is the setting name to validate + settings: A dictionary where the keys are valid settings + error_msg: The message to emit in the event of error + stderr: The stream receiving the error messages. + """ + # This may be unrecognized because it's an exclusion list. If the + # setting name has the _excluded suffix, then check the root name. + unrecognized = True + m = re.match(_EXCLUDED_SUFFIX_RE, setting) + if m: + root_setting = m.group(1) + unrecognized = root_setting not in settings + + if unrecognized: + # We don't know this setting. Give a warning. + print >> stderr, error_msg + + +def FixVCMacroSlashes(s): + """Replace macros which have excessive following slashes. + + These macros are known to have a built-in trailing slash. Furthermore, many + scripts hiccup on processing paths with extra slashes in the middle. + + This list is probably not exhaustive. Add as needed. + """ + if '$' in s: + s = fix_vc_macro_slashes_regex.sub(r'\1', s) + return s + + +def ConvertVCMacrosToMSBuild(s): + """Convert the the MSVS macros found in the string to the MSBuild equivalent. + + This list is probably not exhaustive. Add as needed. + """ + if '$' in s: + replace_map = { + '$(ConfigurationName)': '$(Configuration)', + '$(InputDir)': '%(RelativeDir)', + '$(InputExt)': '%(Extension)', + '$(InputFileName)': '%(Filename)%(Extension)', + '$(InputName)': '%(Filename)', + '$(InputPath)': '%(Identity)', + '$(ParentName)': '$(ProjectFileName)', + '$(PlatformName)': '$(Platform)', + '$(SafeInputName)': '%(Filename)', + } + for old, new in replace_map.iteritems(): + s = s.replace(old, new) + s = FixVCMacroSlashes(s) + return s + + +def ConvertToMSBuildSettings(msvs_settings, stderr=sys.stderr): + """Converts MSVS settings (VS2008 and earlier) to MSBuild settings (VS2010+). + + Args: + msvs_settings: A dictionary. The key is the tool name. The values are + themselves dictionaries of settings and their values. + stderr: The stream receiving the error messages. + + Returns: + A dictionary of MSBuild settings. The key is either the MSBuild tool name + or the empty string (for the global settings). The values are themselves + dictionaries of settings and their values. + """ + msbuild_settings = {} + for msvs_tool_name, msvs_tool_settings in msvs_settings.iteritems(): + if msvs_tool_name in _msvs_to_msbuild_converters: + msvs_tool = _msvs_to_msbuild_converters[msvs_tool_name] + for msvs_setting, msvs_value in msvs_tool_settings.iteritems(): + if msvs_setting in msvs_tool: + # Invoke the translation function. + try: + msvs_tool[msvs_setting](msvs_value, msbuild_settings) + except ValueError, e: + print >> stderr, ('Warning: while converting %s/%s to MSBuild, ' + '%s' % (msvs_tool_name, msvs_setting, e)) + else: + _ValidateExclusionSetting(msvs_setting, + msvs_tool, + ('Warning: unrecognized setting %s/%s ' + 'while converting to MSBuild.' % + (msvs_tool_name, msvs_setting)), + stderr) + else: + print >> stderr, ('Warning: unrecognized tool %s while converting to ' + 'MSBuild.' % msvs_tool_name) + return msbuild_settings + + +def ValidateMSVSSettings(settings, stderr=sys.stderr): + """Validates that the names of the settings are valid for MSVS. + + Args: + settings: A dictionary. The key is the tool name. The values are + themselves dictionaries of settings and their values. + stderr: The stream receiving the error messages. + """ + _ValidateSettings(_msvs_validators, settings, stderr) + + +def ValidateMSBuildSettings(settings, stderr=sys.stderr): + """Validates that the names of the settings are valid for MSBuild. + + Args: + settings: A dictionary. The key is the tool name. The values are + themselves dictionaries of settings and their values. + stderr: The stream receiving the error messages. + """ + _ValidateSettings(_msbuild_validators, settings, stderr) + + +def _ValidateSettings(validators, settings, stderr): + """Validates that the settings are valid for MSBuild or MSVS. + + We currently only validate the names of the settings, not their values. + + Args: + validators: A dictionary of tools and their validators. + settings: A dictionary. The key is the tool name. The values are + themselves dictionaries of settings and their values. + stderr: The stream receiving the error messages. + """ + for tool_name in settings: + if tool_name in validators: + tool_validators = validators[tool_name] + for setting, value in settings[tool_name].iteritems(): + if setting in tool_validators: + try: + tool_validators[setting](value) + except ValueError, e: + print >> stderr, ('Warning: for %s/%s, %s' % + (tool_name, setting, e)) + else: + _ValidateExclusionSetting(setting, + tool_validators, + ('Warning: unrecognized setting %s/%s' % + (tool_name, setting)), + stderr) + + else: + print >> stderr, ('Warning: unrecognized tool %s' % tool_name) + + +# MSVS and MBuild names of the tools. +_compile = _Tool('VCCLCompilerTool', 'ClCompile') +_link = _Tool('VCLinkerTool', 'Link') +_midl = _Tool('VCMIDLTool', 'Midl') +_rc = _Tool('VCResourceCompilerTool', 'ResourceCompile') +_lib = _Tool('VCLibrarianTool', 'Lib') +_manifest = _Tool('VCManifestTool', 'Manifest') +_masm = _Tool('MASM', 'MASM') + + +_AddTool(_compile) +_AddTool(_link) +_AddTool(_midl) +_AddTool(_rc) +_AddTool(_lib) +_AddTool(_manifest) +_AddTool(_masm) +# Add sections only found in the MSBuild settings. +_msbuild_validators[''] = {} +_msbuild_validators['ProjectReference'] = {} +_msbuild_validators['ManifestResourceCompile'] = {} + +# Descriptions of the compiler options, i.e. VCCLCompilerTool in MSVS and +# ClCompile in MSBuild. +# See "c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\1033\cl.xml" for +# the schema of the MSBuild ClCompile settings. + +# Options that have the same name in MSVS and MSBuild +_Same(_compile, 'AdditionalIncludeDirectories', _folder_list) # /I +_Same(_compile, 'AdditionalOptions', _string_list) +_Same(_compile, 'AdditionalUsingDirectories', _folder_list) # /AI +_Same(_compile, 'AssemblerListingLocation', _file_name) # /Fa +_Same(_compile, 'BrowseInformationFile', _file_name) +_Same(_compile, 'BufferSecurityCheck', _boolean) # /GS +_Same(_compile, 'DisableLanguageExtensions', _boolean) # /Za +_Same(_compile, 'DisableSpecificWarnings', _string_list) # /wd +_Same(_compile, 'EnableFiberSafeOptimizations', _boolean) # /GT +_Same(_compile, 'EnablePREfast', _boolean) # /analyze Visible='false' +_Same(_compile, 'ExpandAttributedSource', _boolean) # /Fx +_Same(_compile, 'FloatingPointExceptions', _boolean) # /fp:except +_Same(_compile, 'ForceConformanceInForLoopScope', _boolean) # /Zc:forScope +_Same(_compile, 'ForcedIncludeFiles', _file_list) # /FI +_Same(_compile, 'ForcedUsingFiles', _file_list) # /FU +_Same(_compile, 'GenerateXMLDocumentationFiles', _boolean) # /doc +_Same(_compile, 'IgnoreStandardIncludePath', _boolean) # /X +_Same(_compile, 'MinimalRebuild', _boolean) # /Gm +_Same(_compile, 'OmitDefaultLibName', _boolean) # /Zl +_Same(_compile, 'OmitFramePointers', _boolean) # /Oy +_Same(_compile, 'PreprocessorDefinitions', _string_list) # /D +_Same(_compile, 'ProgramDataBaseFileName', _file_name) # /Fd +_Same(_compile, 'RuntimeTypeInfo', _boolean) # /GR +_Same(_compile, 'ShowIncludes', _boolean) # /showIncludes +_Same(_compile, 'SmallerTypeCheck', _boolean) # /RTCc +_Same(_compile, 'StringPooling', _boolean) # /GF +_Same(_compile, 'SuppressStartupBanner', _boolean) # /nologo +_Same(_compile, 'TreatWChar_tAsBuiltInType', _boolean) # /Zc:wchar_t +_Same(_compile, 'UndefineAllPreprocessorDefinitions', _boolean) # /u +_Same(_compile, 'UndefinePreprocessorDefinitions', _string_list) # /U +_Same(_compile, 'UseFullPaths', _boolean) # /FC +_Same(_compile, 'WholeProgramOptimization', _boolean) # /GL +_Same(_compile, 'XMLDocumentationFileName', _file_name) + +_Same(_compile, 'AssemblerOutput', + _Enumeration(['NoListing', + 'AssemblyCode', # /FA + 'All', # /FAcs + 'AssemblyAndMachineCode', # /FAc + 'AssemblyAndSourceCode'])) # /FAs +_Same(_compile, 'BasicRuntimeChecks', + _Enumeration(['Default', + 'StackFrameRuntimeCheck', # /RTCs + 'UninitializedLocalUsageCheck', # /RTCu + 'EnableFastChecks'])) # /RTC1 +_Same(_compile, 'BrowseInformation', + _Enumeration(['false', + 'true', # /FR + 'true'])) # /Fr +_Same(_compile, 'CallingConvention', + _Enumeration(['Cdecl', # /Gd + 'FastCall', # /Gr + 'StdCall', # /Gz + 'VectorCall'])) # /Gv +_Same(_compile, 'CompileAs', + _Enumeration(['Default', + 'CompileAsC', # /TC + 'CompileAsCpp'])) # /TP +_Same(_compile, 'DebugInformationFormat', + _Enumeration(['', # Disabled + 'OldStyle', # /Z7 + None, + 'ProgramDatabase', # /Zi + 'EditAndContinue'])) # /ZI +_Same(_compile, 'EnableEnhancedInstructionSet', + _Enumeration(['NotSet', + 'StreamingSIMDExtensions', # /arch:SSE + 'StreamingSIMDExtensions2', # /arch:SSE2 + 'AdvancedVectorExtensions', # /arch:AVX (vs2012+) + 'NoExtensions', # /arch:IA32 (vs2012+) + # This one only exists in the new msbuild format. + 'AdvancedVectorExtensions2', # /arch:AVX2 (vs2013r2+) + ])) +_Same(_compile, 'ErrorReporting', + _Enumeration(['None', # /errorReport:none + 'Prompt', # /errorReport:prompt + 'Queue'], # /errorReport:queue + new=['Send'])) # /errorReport:send" +_Same(_compile, 'ExceptionHandling', + _Enumeration(['false', + 'Sync', # /EHsc + 'Async'], # /EHa + new=['SyncCThrow'])) # /EHs +_Same(_compile, 'FavorSizeOrSpeed', + _Enumeration(['Neither', + 'Speed', # /Ot + 'Size'])) # /Os +_Same(_compile, 'FloatingPointModel', + _Enumeration(['Precise', # /fp:precise + 'Strict', # /fp:strict + 'Fast'])) # /fp:fast +_Same(_compile, 'InlineFunctionExpansion', + _Enumeration(['Default', + 'OnlyExplicitInline', # /Ob1 + 'AnySuitable'], # /Ob2 + new=['Disabled'])) # /Ob0 +_Same(_compile, 'Optimization', + _Enumeration(['Disabled', # /Od + 'MinSpace', # /O1 + 'MaxSpeed', # /O2 + 'Full'])) # /Ox +_Same(_compile, 'RuntimeLibrary', + _Enumeration(['MultiThreaded', # /MT + 'MultiThreadedDebug', # /MTd + 'MultiThreadedDLL', # /MD + 'MultiThreadedDebugDLL'])) # /MDd +_Same(_compile, 'StructMemberAlignment', + _Enumeration(['Default', + '1Byte', # /Zp1 + '2Bytes', # /Zp2 + '4Bytes', # /Zp4 + '8Bytes', # /Zp8 + '16Bytes'])) # /Zp16 +_Same(_compile, 'WarningLevel', + _Enumeration(['TurnOffAllWarnings', # /W0 + 'Level1', # /W1 + 'Level2', # /W2 + 'Level3', # /W3 + 'Level4'], # /W4 + new=['EnableAllWarnings'])) # /Wall + +# Options found in MSVS that have been renamed in MSBuild. +_Renamed(_compile, 'EnableFunctionLevelLinking', 'FunctionLevelLinking', + _boolean) # /Gy +_Renamed(_compile, 'EnableIntrinsicFunctions', 'IntrinsicFunctions', + _boolean) # /Oi +_Renamed(_compile, 'KeepComments', 'PreprocessKeepComments', _boolean) # /C +_Renamed(_compile, 'ObjectFile', 'ObjectFileName', _file_name) # /Fo +_Renamed(_compile, 'OpenMP', 'OpenMPSupport', _boolean) # /openmp +_Renamed(_compile, 'PrecompiledHeaderThrough', 'PrecompiledHeaderFile', + _file_name) # Used with /Yc and /Yu +_Renamed(_compile, 'PrecompiledHeaderFile', 'PrecompiledHeaderOutputFile', + _file_name) # /Fp +_Renamed(_compile, 'UsePrecompiledHeader', 'PrecompiledHeader', + _Enumeration(['NotUsing', # VS recognized '' for this value too. + 'Create', # /Yc + 'Use'])) # /Yu +_Renamed(_compile, 'WarnAsError', 'TreatWarningAsError', _boolean) # /WX + +_ConvertedToAdditionalOption(_compile, 'DefaultCharIsUnsigned', '/J') + +# MSVS options not found in MSBuild. +_MSVSOnly(_compile, 'Detect64BitPortabilityProblems', _boolean) +_MSVSOnly(_compile, 'UseUnicodeResponseFiles', _boolean) + +# MSBuild options not found in MSVS. +_MSBuildOnly(_compile, 'BuildingInIDE', _boolean) +_MSBuildOnly(_compile, 'CompileAsManaged', + _Enumeration([], new=['false', + 'true'])) # /clr +_MSBuildOnly(_compile, 'CreateHotpatchableImage', _boolean) # /hotpatch +_MSBuildOnly(_compile, 'MultiProcessorCompilation', _boolean) # /MP +_MSBuildOnly(_compile, 'PreprocessOutputPath', _string) # /Fi +_MSBuildOnly(_compile, 'ProcessorNumber', _integer) # the number of processors +_MSBuildOnly(_compile, 'TrackerLogDirectory', _folder_name) +_MSBuildOnly(_compile, 'TreatSpecificWarningsAsErrors', _string_list) # /we +_MSBuildOnly(_compile, 'UseUnicodeForAssemblerListing', _boolean) # /FAu + +# Defines a setting that needs very customized processing +_CustomGeneratePreprocessedFile(_compile, 'GeneratePreprocessedFile') + + +# Directives for converting MSVS VCLinkerTool to MSBuild Link. +# See "c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\1033\link.xml" for +# the schema of the MSBuild Link settings. + +# Options that have the same name in MSVS and MSBuild +_Same(_link, 'AdditionalDependencies', _file_list) +_Same(_link, 'AdditionalLibraryDirectories', _folder_list) # /LIBPATH +# /MANIFESTDEPENDENCY: +_Same(_link, 'AdditionalManifestDependencies', _file_list) +_Same(_link, 'AdditionalOptions', _string_list) +_Same(_link, 'AddModuleNamesToAssembly', _file_list) # /ASSEMBLYMODULE +_Same(_link, 'AllowIsolation', _boolean) # /ALLOWISOLATION +_Same(_link, 'AssemblyLinkResource', _file_list) # /ASSEMBLYLINKRESOURCE +_Same(_link, 'BaseAddress', _string) # /BASE +_Same(_link, 'CLRUnmanagedCodeCheck', _boolean) # /CLRUNMANAGEDCODECHECK +_Same(_link, 'DelayLoadDLLs', _file_list) # /DELAYLOAD +_Same(_link, 'DelaySign', _boolean) # /DELAYSIGN +_Same(_link, 'EmbedManagedResourceFile', _file_list) # /ASSEMBLYRESOURCE +_Same(_link, 'EnableUAC', _boolean) # /MANIFESTUAC +_Same(_link, 'EntryPointSymbol', _string) # /ENTRY +_Same(_link, 'ForceSymbolReferences', _file_list) # /INCLUDE +_Same(_link, 'FunctionOrder', _file_name) # /ORDER +_Same(_link, 'GenerateDebugInformation', _boolean) # /DEBUG +_Same(_link, 'GenerateMapFile', _boolean) # /MAP +_Same(_link, 'HeapCommitSize', _string) +_Same(_link, 'HeapReserveSize', _string) # /HEAP +_Same(_link, 'IgnoreAllDefaultLibraries', _boolean) # /NODEFAULTLIB +_Same(_link, 'IgnoreEmbeddedIDL', _boolean) # /IGNOREIDL +_Same(_link, 'ImportLibrary', _file_name) # /IMPLIB +_Same(_link, 'KeyContainer', _file_name) # /KEYCONTAINER +_Same(_link, 'KeyFile', _file_name) # /KEYFILE +_Same(_link, 'ManifestFile', _file_name) # /ManifestFile +_Same(_link, 'MapExports', _boolean) # /MAPINFO:EXPORTS +_Same(_link, 'MapFileName', _file_name) +_Same(_link, 'MergedIDLBaseFileName', _file_name) # /IDLOUT +_Same(_link, 'MergeSections', _string) # /MERGE +_Same(_link, 'MidlCommandFile', _file_name) # /MIDL +_Same(_link, 'ModuleDefinitionFile', _file_name) # /DEF +_Same(_link, 'OutputFile', _file_name) # /OUT +_Same(_link, 'PerUserRedirection', _boolean) +_Same(_link, 'Profile', _boolean) # /PROFILE +_Same(_link, 'ProfileGuidedDatabase', _file_name) # /PGD +_Same(_link, 'ProgramDatabaseFile', _file_name) # /PDB +_Same(_link, 'RegisterOutput', _boolean) +_Same(_link, 'SetChecksum', _boolean) # /RELEASE +_Same(_link, 'StackCommitSize', _string) +_Same(_link, 'StackReserveSize', _string) # /STACK +_Same(_link, 'StripPrivateSymbols', _file_name) # /PDBSTRIPPED +_Same(_link, 'SupportUnloadOfDelayLoadedDLL', _boolean) # /DELAY:UNLOAD +_Same(_link, 'SuppressStartupBanner', _boolean) # /NOLOGO +_Same(_link, 'SwapRunFromCD', _boolean) # /SWAPRUN:CD +_Same(_link, 'TurnOffAssemblyGeneration', _boolean) # /NOASSEMBLY +_Same(_link, 'TypeLibraryFile', _file_name) # /TLBOUT +_Same(_link, 'TypeLibraryResourceID', _integer) # /TLBID +_Same(_link, 'UACUIAccess', _boolean) # /uiAccess='true' +_Same(_link, 'Version', _string) # /VERSION + +_Same(_link, 'EnableCOMDATFolding', _newly_boolean) # /OPT:ICF +_Same(_link, 'FixedBaseAddress', _newly_boolean) # /FIXED +_Same(_link, 'LargeAddressAware', _newly_boolean) # /LARGEADDRESSAWARE +_Same(_link, 'OptimizeReferences', _newly_boolean) # /OPT:REF +_Same(_link, 'RandomizedBaseAddress', _newly_boolean) # /DYNAMICBASE +_Same(_link, 'TerminalServerAware', _newly_boolean) # /TSAWARE + +_subsystem_enumeration = _Enumeration( + ['NotSet', + 'Console', # /SUBSYSTEM:CONSOLE + 'Windows', # /SUBSYSTEM:WINDOWS + 'Native', # /SUBSYSTEM:NATIVE + 'EFI Application', # /SUBSYSTEM:EFI_APPLICATION + 'EFI Boot Service Driver', # /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER + 'EFI ROM', # /SUBSYSTEM:EFI_ROM + 'EFI Runtime', # /SUBSYSTEM:EFI_RUNTIME_DRIVER + 'WindowsCE'], # /SUBSYSTEM:WINDOWSCE + new=['POSIX']) # /SUBSYSTEM:POSIX + +_target_machine_enumeration = _Enumeration( + ['NotSet', + 'MachineX86', # /MACHINE:X86 + None, + 'MachineARM', # /MACHINE:ARM + 'MachineEBC', # /MACHINE:EBC + 'MachineIA64', # /MACHINE:IA64 + None, + 'MachineMIPS', # /MACHINE:MIPS + 'MachineMIPS16', # /MACHINE:MIPS16 + 'MachineMIPSFPU', # /MACHINE:MIPSFPU + 'MachineMIPSFPU16', # /MACHINE:MIPSFPU16 + None, + None, + None, + 'MachineSH4', # /MACHINE:SH4 + None, + 'MachineTHUMB', # /MACHINE:THUMB + 'MachineX64']) # /MACHINE:X64 + +_Same(_link, 'AssemblyDebug', + _Enumeration(['', + 'true', # /ASSEMBLYDEBUG + 'false'])) # /ASSEMBLYDEBUG:DISABLE +_Same(_link, 'CLRImageType', + _Enumeration(['Default', + 'ForceIJWImage', # /CLRIMAGETYPE:IJW + 'ForcePureILImage', # /Switch="CLRIMAGETYPE:PURE + 'ForceSafeILImage'])) # /Switch="CLRIMAGETYPE:SAFE +_Same(_link, 'CLRThreadAttribute', + _Enumeration(['DefaultThreadingAttribute', # /CLRTHREADATTRIBUTE:NONE + 'MTAThreadingAttribute', # /CLRTHREADATTRIBUTE:MTA + 'STAThreadingAttribute'])) # /CLRTHREADATTRIBUTE:STA +_Same(_link, 'DataExecutionPrevention', + _Enumeration(['', + 'false', # /NXCOMPAT:NO + 'true'])) # /NXCOMPAT +_Same(_link, 'Driver', + _Enumeration(['NotSet', + 'Driver', # /Driver + 'UpOnly', # /DRIVER:UPONLY + 'WDM'])) # /DRIVER:WDM +_Same(_link, 'LinkTimeCodeGeneration', + _Enumeration(['Default', + 'UseLinkTimeCodeGeneration', # /LTCG + 'PGInstrument', # /LTCG:PGInstrument + 'PGOptimization', # /LTCG:PGOptimize + 'PGUpdate'])) # /LTCG:PGUpdate +_Same(_link, 'ShowProgress', + _Enumeration(['NotSet', + 'LinkVerbose', # /VERBOSE + 'LinkVerboseLib'], # /VERBOSE:Lib + new=['LinkVerboseICF', # /VERBOSE:ICF + 'LinkVerboseREF', # /VERBOSE:REF + 'LinkVerboseSAFESEH', # /VERBOSE:SAFESEH + 'LinkVerboseCLR'])) # /VERBOSE:CLR +_Same(_link, 'SubSystem', _subsystem_enumeration) +_Same(_link, 'TargetMachine', _target_machine_enumeration) +_Same(_link, 'UACExecutionLevel', + _Enumeration(['AsInvoker', # /level='asInvoker' + 'HighestAvailable', # /level='highestAvailable' + 'RequireAdministrator'])) # /level='requireAdministrator' +_Same(_link, 'MinimumRequiredVersion', _string) +_Same(_link, 'TreatLinkerWarningAsErrors', _boolean) # /WX + + +# Options found in MSVS that have been renamed in MSBuild. +_Renamed(_link, 'ErrorReporting', 'LinkErrorReporting', + _Enumeration(['NoErrorReport', # /ERRORREPORT:NONE + 'PromptImmediately', # /ERRORREPORT:PROMPT + 'QueueForNextLogin'], # /ERRORREPORT:QUEUE + new=['SendErrorReport'])) # /ERRORREPORT:SEND +_Renamed(_link, 'IgnoreDefaultLibraryNames', 'IgnoreSpecificDefaultLibraries', + _file_list) # /NODEFAULTLIB +_Renamed(_link, 'ResourceOnlyDLL', 'NoEntryPoint', _boolean) # /NOENTRY +_Renamed(_link, 'SwapRunFromNet', 'SwapRunFromNET', _boolean) # /SWAPRUN:NET + +_Moved(_link, 'GenerateManifest', '', _boolean) +_Moved(_link, 'IgnoreImportLibrary', '', _boolean) +_Moved(_link, 'LinkIncremental', '', _newly_boolean) +_Moved(_link, 'LinkLibraryDependencies', 'ProjectReference', _boolean) +_Moved(_link, 'UseLibraryDependencyInputs', 'ProjectReference', _boolean) + +# MSVS options not found in MSBuild. +_MSVSOnly(_link, 'OptimizeForWindows98', _newly_boolean) +_MSVSOnly(_link, 'UseUnicodeResponseFiles', _boolean) + +# MSBuild options not found in MSVS. +_MSBuildOnly(_link, 'BuildingInIDE', _boolean) +_MSBuildOnly(_link, 'ImageHasSafeExceptionHandlers', _boolean) # /SAFESEH +_MSBuildOnly(_link, 'LinkDLL', _boolean) # /DLL Visible='false' +_MSBuildOnly(_link, 'LinkStatus', _boolean) # /LTCG:STATUS +_MSBuildOnly(_link, 'PreventDllBinding', _boolean) # /ALLOWBIND +_MSBuildOnly(_link, 'SupportNobindOfDelayLoadedDLL', _boolean) # /DELAY:NOBIND +_MSBuildOnly(_link, 'TrackerLogDirectory', _folder_name) +_MSBuildOnly(_link, 'MSDOSStubFileName', _file_name) # /STUB Visible='false' +_MSBuildOnly(_link, 'SectionAlignment', _integer) # /ALIGN +_MSBuildOnly(_link, 'SpecifySectionAttributes', _string) # /SECTION +_MSBuildOnly(_link, 'ForceFileOutput', + _Enumeration([], new=['Enabled', # /FORCE + # /FORCE:MULTIPLE + 'MultiplyDefinedSymbolOnly', + 'UndefinedSymbolOnly'])) # /FORCE:UNRESOLVED +_MSBuildOnly(_link, 'CreateHotPatchableImage', + _Enumeration([], new=['Enabled', # /FUNCTIONPADMIN + 'X86Image', # /FUNCTIONPADMIN:5 + 'X64Image', # /FUNCTIONPADMIN:6 + 'ItaniumImage'])) # /FUNCTIONPADMIN:16 +_MSBuildOnly(_link, 'CLRSupportLastError', + _Enumeration([], new=['Enabled', # /CLRSupportLastError + 'Disabled', # /CLRSupportLastError:NO + # /CLRSupportLastError:SYSTEMDLL + 'SystemDlls'])) + + +# Directives for converting VCResourceCompilerTool to ResourceCompile. +# See "c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\1033\rc.xml" for +# the schema of the MSBuild ResourceCompile settings. + +_Same(_rc, 'AdditionalOptions', _string_list) +_Same(_rc, 'AdditionalIncludeDirectories', _folder_list) # /I +_Same(_rc, 'Culture', _Integer(msbuild_base=16)) +_Same(_rc, 'IgnoreStandardIncludePath', _boolean) # /X +_Same(_rc, 'PreprocessorDefinitions', _string_list) # /D +_Same(_rc, 'ResourceOutputFileName', _string) # /fo +_Same(_rc, 'ShowProgress', _boolean) # /v +# There is no UI in VisualStudio 2008 to set the following properties. +# However they are found in CL and other tools. Include them here for +# completeness, as they are very likely to have the same usage pattern. +_Same(_rc, 'SuppressStartupBanner', _boolean) # /nologo +_Same(_rc, 'UndefinePreprocessorDefinitions', _string_list) # /u + +# MSBuild options not found in MSVS. +_MSBuildOnly(_rc, 'NullTerminateStrings', _boolean) # /n +_MSBuildOnly(_rc, 'TrackerLogDirectory', _folder_name) + + +# Directives for converting VCMIDLTool to Midl. +# See "c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\1033\midl.xml" for +# the schema of the MSBuild Midl settings. + +_Same(_midl, 'AdditionalIncludeDirectories', _folder_list) # /I +_Same(_midl, 'AdditionalOptions', _string_list) +_Same(_midl, 'CPreprocessOptions', _string) # /cpp_opt +_Same(_midl, 'ErrorCheckAllocations', _boolean) # /error allocation +_Same(_midl, 'ErrorCheckBounds', _boolean) # /error bounds_check +_Same(_midl, 'ErrorCheckEnumRange', _boolean) # /error enum +_Same(_midl, 'ErrorCheckRefPointers', _boolean) # /error ref +_Same(_midl, 'ErrorCheckStubData', _boolean) # /error stub_data +_Same(_midl, 'GenerateStublessProxies', _boolean) # /Oicf +_Same(_midl, 'GenerateTypeLibrary', _boolean) +_Same(_midl, 'HeaderFileName', _file_name) # /h +_Same(_midl, 'IgnoreStandardIncludePath', _boolean) # /no_def_idir +_Same(_midl, 'InterfaceIdentifierFileName', _file_name) # /iid +_Same(_midl, 'MkTypLibCompatible', _boolean) # /mktyplib203 +_Same(_midl, 'OutputDirectory', _string) # /out +_Same(_midl, 'PreprocessorDefinitions', _string_list) # /D +_Same(_midl, 'ProxyFileName', _file_name) # /proxy +_Same(_midl, 'RedirectOutputAndErrors', _file_name) # /o +_Same(_midl, 'SuppressStartupBanner', _boolean) # /nologo +_Same(_midl, 'TypeLibraryName', _file_name) # /tlb +_Same(_midl, 'UndefinePreprocessorDefinitions', _string_list) # /U +_Same(_midl, 'WarnAsError', _boolean) # /WX + +_Same(_midl, 'DefaultCharType', + _Enumeration(['Unsigned', # /char unsigned + 'Signed', # /char signed + 'Ascii'])) # /char ascii7 +_Same(_midl, 'TargetEnvironment', + _Enumeration(['NotSet', + 'Win32', # /env win32 + 'Itanium', # /env ia64 + 'X64'])) # /env x64 +_Same(_midl, 'EnableErrorChecks', + _Enumeration(['EnableCustom', + 'None', # /error none + 'All'])) # /error all +_Same(_midl, 'StructMemberAlignment', + _Enumeration(['NotSet', + '1', # Zp1 + '2', # Zp2 + '4', # Zp4 + '8'])) # Zp8 +_Same(_midl, 'WarningLevel', + _Enumeration(['0', # /W0 + '1', # /W1 + '2', # /W2 + '3', # /W3 + '4'])) # /W4 + +_Renamed(_midl, 'DLLDataFileName', 'DllDataFileName', _file_name) # /dlldata +_Renamed(_midl, 'ValidateParameters', 'ValidateAllParameters', + _boolean) # /robust + +# MSBuild options not found in MSVS. +_MSBuildOnly(_midl, 'ApplicationConfigurationMode', _boolean) # /app_config +_MSBuildOnly(_midl, 'ClientStubFile', _file_name) # /cstub +_MSBuildOnly(_midl, 'GenerateClientFiles', + _Enumeration([], new=['Stub', # /client stub + 'None'])) # /client none +_MSBuildOnly(_midl, 'GenerateServerFiles', + _Enumeration([], new=['Stub', # /client stub + 'None'])) # /client none +_MSBuildOnly(_midl, 'LocaleID', _integer) # /lcid DECIMAL +_MSBuildOnly(_midl, 'ServerStubFile', _file_name) # /sstub +_MSBuildOnly(_midl, 'SuppressCompilerWarnings', _boolean) # /no_warn +_MSBuildOnly(_midl, 'TrackerLogDirectory', _folder_name) +_MSBuildOnly(_midl, 'TypeLibFormat', + _Enumeration([], new=['NewFormat', # /newtlb + 'OldFormat'])) # /oldtlb + + +# Directives for converting VCLibrarianTool to Lib. +# See "c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\1033\lib.xml" for +# the schema of the MSBuild Lib settings. + +_Same(_lib, 'AdditionalDependencies', _file_list) +_Same(_lib, 'AdditionalLibraryDirectories', _folder_list) # /LIBPATH +_Same(_lib, 'AdditionalOptions', _string_list) +_Same(_lib, 'ExportNamedFunctions', _string_list) # /EXPORT +_Same(_lib, 'ForceSymbolReferences', _string) # /INCLUDE +_Same(_lib, 'IgnoreAllDefaultLibraries', _boolean) # /NODEFAULTLIB +_Same(_lib, 'IgnoreSpecificDefaultLibraries', _file_list) # /NODEFAULTLIB +_Same(_lib, 'ModuleDefinitionFile', _file_name) # /DEF +_Same(_lib, 'OutputFile', _file_name) # /OUT +_Same(_lib, 'SuppressStartupBanner', _boolean) # /NOLOGO +_Same(_lib, 'UseUnicodeResponseFiles', _boolean) +_Same(_lib, 'LinkTimeCodeGeneration', _boolean) # /LTCG +_Same(_lib, 'TargetMachine', _target_machine_enumeration) + +# TODO(jeanluc) _link defines the same value that gets moved to +# ProjectReference. We may want to validate that they are consistent. +_Moved(_lib, 'LinkLibraryDependencies', 'ProjectReference', _boolean) + +_MSBuildOnly(_lib, 'DisplayLibrary', _string) # /LIST Visible='false' +_MSBuildOnly(_lib, 'ErrorReporting', + _Enumeration([], new=['PromptImmediately', # /ERRORREPORT:PROMPT + 'QueueForNextLogin', # /ERRORREPORT:QUEUE + 'SendErrorReport', # /ERRORREPORT:SEND + 'NoErrorReport'])) # /ERRORREPORT:NONE +_MSBuildOnly(_lib, 'MinimumRequiredVersion', _string) +_MSBuildOnly(_lib, 'Name', _file_name) # /NAME +_MSBuildOnly(_lib, 'RemoveObjects', _file_list) # /REMOVE +_MSBuildOnly(_lib, 'SubSystem', _subsystem_enumeration) +_MSBuildOnly(_lib, 'TrackerLogDirectory', _folder_name) +_MSBuildOnly(_lib, 'TreatLibWarningAsErrors', _boolean) # /WX +_MSBuildOnly(_lib, 'Verbose', _boolean) + + +# Directives for converting VCManifestTool to Mt. +# See "c:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\1033\mt.xml" for +# the schema of the MSBuild Lib settings. + +# Options that have the same name in MSVS and MSBuild +_Same(_manifest, 'AdditionalManifestFiles', _file_list) # /manifest +_Same(_manifest, 'AdditionalOptions', _string_list) +_Same(_manifest, 'AssemblyIdentity', _string) # /identity: +_Same(_manifest, 'ComponentFileName', _file_name) # /dll +_Same(_manifest, 'GenerateCatalogFiles', _boolean) # /makecdfs +_Same(_manifest, 'InputResourceManifests', _string) # /inputresource +_Same(_manifest, 'OutputManifestFile', _file_name) # /out +_Same(_manifest, 'RegistrarScriptFile', _file_name) # /rgs +_Same(_manifest, 'ReplacementsFile', _file_name) # /replacements +_Same(_manifest, 'SuppressStartupBanner', _boolean) # /nologo +_Same(_manifest, 'TypeLibraryFile', _file_name) # /tlb: +_Same(_manifest, 'UpdateFileHashes', _boolean) # /hashupdate +_Same(_manifest, 'UpdateFileHashesSearchPath', _file_name) +_Same(_manifest, 'VerboseOutput', _boolean) # /verbose + +# Options that have moved location. +_MovedAndRenamed(_manifest, 'ManifestResourceFile', + 'ManifestResourceCompile', + 'ResourceOutputFileName', + _file_name) +_Moved(_manifest, 'EmbedManifest', '', _boolean) + +# MSVS options not found in MSBuild. +_MSVSOnly(_manifest, 'DependencyInformationFile', _file_name) +_MSVSOnly(_manifest, 'UseFAT32Workaround', _boolean) +_MSVSOnly(_manifest, 'UseUnicodeResponseFiles', _boolean) + +# MSBuild options not found in MSVS. +_MSBuildOnly(_manifest, 'EnableDPIAwareness', _boolean) +_MSBuildOnly(_manifest, 'GenerateCategoryTags', _boolean) # /category +_MSBuildOnly(_manifest, 'ManifestFromManagedAssembly', + _file_name) # /managedassemblyname +_MSBuildOnly(_manifest, 'OutputResourceManifests', _string) # /outputresource +_MSBuildOnly(_manifest, 'SuppressDependencyElement', _boolean) # /nodependency +_MSBuildOnly(_manifest, 'TrackerLogDirectory', _folder_name) + + +# Directives for MASM. +# See "$(VCTargetsPath)\BuildCustomizations\masm.xml" for the schema of the +# MSBuild MASM settings. + +# Options that have the same name in MSVS and MSBuild. +_Same(_masm, 'UseSafeExceptionHandlers', _boolean) # /safeseh diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.pyc b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.pyc new file mode 100644 index 00000000..6bfb9c5e Binary files /dev/null and b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.pyc differ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py new file mode 100644 index 00000000..bf6ea6b8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py @@ -0,0 +1,1483 @@ +#!/usr/bin/env python + +# Copyright (c) 2012 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Unit tests for the MSVSSettings.py file.""" + +import StringIO +import unittest +import gyp.MSVSSettings as MSVSSettings + + +class TestSequenceFunctions(unittest.TestCase): + + def setUp(self): + self.stderr = StringIO.StringIO() + + def _ExpectedWarnings(self, expected): + """Compares recorded lines to expected warnings.""" + self.stderr.seek(0) + actual = self.stderr.read().split('\n') + actual = [line for line in actual if line] + self.assertEqual(sorted(expected), sorted(actual)) + + def testValidateMSVSSettings_tool_names(self): + """Tests that only MSVS tool names are allowed.""" + MSVSSettings.ValidateMSVSSettings( + {'VCCLCompilerTool': {}, + 'VCLinkerTool': {}, + 'VCMIDLTool': {}, + 'foo': {}, + 'VCResourceCompilerTool': {}, + 'VCLibrarianTool': {}, + 'VCManifestTool': {}, + 'ClCompile': {}}, + self.stderr) + self._ExpectedWarnings([ + 'Warning: unrecognized tool foo', + 'Warning: unrecognized tool ClCompile']) + + def testValidateMSVSSettings_settings(self): + """Tests that for invalid MSVS settings.""" + MSVSSettings.ValidateMSVSSettings( + {'VCCLCompilerTool': { + 'AdditionalIncludeDirectories': 'folder1;folder2', + 'AdditionalOptions': ['string1', 'string2'], + 'AdditionalUsingDirectories': 'folder1;folder2', + 'AssemblerListingLocation': 'a_file_name', + 'AssemblerOutput': '0', + 'BasicRuntimeChecks': '5', + 'BrowseInformation': 'fdkslj', + 'BrowseInformationFile': 'a_file_name', + 'BufferSecurityCheck': 'true', + 'CallingConvention': '-1', + 'CompileAs': '1', + 'DebugInformationFormat': '2', + 'DefaultCharIsUnsigned': 'true', + 'Detect64BitPortabilityProblems': 'true', + 'DisableLanguageExtensions': 'true', + 'DisableSpecificWarnings': 'string1;string2', + 'EnableEnhancedInstructionSet': '1', + 'EnableFiberSafeOptimizations': 'true', + 'EnableFunctionLevelLinking': 'true', + 'EnableIntrinsicFunctions': 'true', + 'EnablePREfast': 'true', + 'Enableprefast': 'bogus', + 'ErrorReporting': '1', + 'ExceptionHandling': '1', + 'ExpandAttributedSource': 'true', + 'FavorSizeOrSpeed': '1', + 'FloatingPointExceptions': 'true', + 'FloatingPointModel': '1', + 'ForceConformanceInForLoopScope': 'true', + 'ForcedIncludeFiles': 'file1;file2', + 'ForcedUsingFiles': 'file1;file2', + 'GeneratePreprocessedFile': '1', + 'GenerateXMLDocumentationFiles': 'true', + 'IgnoreStandardIncludePath': 'true', + 'InlineFunctionExpansion': '1', + 'KeepComments': 'true', + 'MinimalRebuild': 'true', + 'ObjectFile': 'a_file_name', + 'OmitDefaultLibName': 'true', + 'OmitFramePointers': 'true', + 'OpenMP': 'true', + 'Optimization': '1', + 'PrecompiledHeaderFile': 'a_file_name', + 'PrecompiledHeaderThrough': 'a_file_name', + 'PreprocessorDefinitions': 'string1;string2', + 'ProgramDataBaseFileName': 'a_file_name', + 'RuntimeLibrary': '1', + 'RuntimeTypeInfo': 'true', + 'ShowIncludes': 'true', + 'SmallerTypeCheck': 'true', + 'StringPooling': 'true', + 'StructMemberAlignment': '1', + 'SuppressStartupBanner': 'true', + 'TreatWChar_tAsBuiltInType': 'true', + 'UndefineAllPreprocessorDefinitions': 'true', + 'UndefinePreprocessorDefinitions': 'string1;string2', + 'UseFullPaths': 'true', + 'UsePrecompiledHeader': '1', + 'UseUnicodeResponseFiles': 'true', + 'WarnAsError': 'true', + 'WarningLevel': '1', + 'WholeProgramOptimization': 'true', + 'XMLDocumentationFileName': 'a_file_name', + 'ZZXYZ': 'bogus'}, + 'VCLinkerTool': { + 'AdditionalDependencies': 'file1;file2', + 'AdditionalDependencies_excluded': 'file3', + 'AdditionalLibraryDirectories': 'folder1;folder2', + 'AdditionalManifestDependencies': 'file1;file2', + 'AdditionalOptions': 'a string1', + 'AddModuleNamesToAssembly': 'file1;file2', + 'AllowIsolation': 'true', + 'AssemblyDebug': '2', + 'AssemblyLinkResource': 'file1;file2', + 'BaseAddress': 'a string1', + 'CLRImageType': '2', + 'CLRThreadAttribute': '2', + 'CLRUnmanagedCodeCheck': 'true', + 'DataExecutionPrevention': '2', + 'DelayLoadDLLs': 'file1;file2', + 'DelaySign': 'true', + 'Driver': '2', + 'EmbedManagedResourceFile': 'file1;file2', + 'EnableCOMDATFolding': '2', + 'EnableUAC': 'true', + 'EntryPointSymbol': 'a string1', + 'ErrorReporting': '2', + 'FixedBaseAddress': '2', + 'ForceSymbolReferences': 'file1;file2', + 'FunctionOrder': 'a_file_name', + 'GenerateDebugInformation': 'true', + 'GenerateManifest': 'true', + 'GenerateMapFile': 'true', + 'HeapCommitSize': 'a string1', + 'HeapReserveSize': 'a string1', + 'IgnoreAllDefaultLibraries': 'true', + 'IgnoreDefaultLibraryNames': 'file1;file2', + 'IgnoreEmbeddedIDL': 'true', + 'IgnoreImportLibrary': 'true', + 'ImportLibrary': 'a_file_name', + 'KeyContainer': 'a_file_name', + 'KeyFile': 'a_file_name', + 'LargeAddressAware': '2', + 'LinkIncremental': '2', + 'LinkLibraryDependencies': 'true', + 'LinkTimeCodeGeneration': '2', + 'ManifestFile': 'a_file_name', + 'MapExports': 'true', + 'MapFileName': 'a_file_name', + 'MergedIDLBaseFileName': 'a_file_name', + 'MergeSections': 'a string1', + 'MidlCommandFile': 'a_file_name', + 'ModuleDefinitionFile': 'a_file_name', + 'OptimizeForWindows98': '1', + 'OptimizeReferences': '2', + 'OutputFile': 'a_file_name', + 'PerUserRedirection': 'true', + 'Profile': 'true', + 'ProfileGuidedDatabase': 'a_file_name', + 'ProgramDatabaseFile': 'a_file_name', + 'RandomizedBaseAddress': '2', + 'RegisterOutput': 'true', + 'ResourceOnlyDLL': 'true', + 'SetChecksum': 'true', + 'ShowProgress': '2', + 'StackCommitSize': 'a string1', + 'StackReserveSize': 'a string1', + 'StripPrivateSymbols': 'a_file_name', + 'SubSystem': '2', + 'SupportUnloadOfDelayLoadedDLL': 'true', + 'SuppressStartupBanner': 'true', + 'SwapRunFromCD': 'true', + 'SwapRunFromNet': 'true', + 'TargetMachine': '2', + 'TerminalServerAware': '2', + 'TurnOffAssemblyGeneration': 'true', + 'TypeLibraryFile': 'a_file_name', + 'TypeLibraryResourceID': '33', + 'UACExecutionLevel': '2', + 'UACUIAccess': 'true', + 'UseLibraryDependencyInputs': 'true', + 'UseUnicodeResponseFiles': 'true', + 'Version': 'a string1'}, + 'VCMIDLTool': { + 'AdditionalIncludeDirectories': 'folder1;folder2', + 'AdditionalOptions': 'a string1', + 'CPreprocessOptions': 'a string1', + 'DefaultCharType': '1', + 'DLLDataFileName': 'a_file_name', + 'EnableErrorChecks': '1', + 'ErrorCheckAllocations': 'true', + 'ErrorCheckBounds': 'true', + 'ErrorCheckEnumRange': 'true', + 'ErrorCheckRefPointers': 'true', + 'ErrorCheckStubData': 'true', + 'GenerateStublessProxies': 'true', + 'GenerateTypeLibrary': 'true', + 'HeaderFileName': 'a_file_name', + 'IgnoreStandardIncludePath': 'true', + 'InterfaceIdentifierFileName': 'a_file_name', + 'MkTypLibCompatible': 'true', + 'notgood': 'bogus', + 'OutputDirectory': 'a string1', + 'PreprocessorDefinitions': 'string1;string2', + 'ProxyFileName': 'a_file_name', + 'RedirectOutputAndErrors': 'a_file_name', + 'StructMemberAlignment': '1', + 'SuppressStartupBanner': 'true', + 'TargetEnvironment': '1', + 'TypeLibraryName': 'a_file_name', + 'UndefinePreprocessorDefinitions': 'string1;string2', + 'ValidateParameters': 'true', + 'WarnAsError': 'true', + 'WarningLevel': '1'}, + 'VCResourceCompilerTool': { + 'AdditionalOptions': 'a string1', + 'AdditionalIncludeDirectories': 'folder1;folder2', + 'Culture': '1003', + 'IgnoreStandardIncludePath': 'true', + 'notgood2': 'bogus', + 'PreprocessorDefinitions': 'string1;string2', + 'ResourceOutputFileName': 'a string1', + 'ShowProgress': 'true', + 'SuppressStartupBanner': 'true', + 'UndefinePreprocessorDefinitions': 'string1;string2'}, + 'VCLibrarianTool': { + 'AdditionalDependencies': 'file1;file2', + 'AdditionalLibraryDirectories': 'folder1;folder2', + 'AdditionalOptions': 'a string1', + 'ExportNamedFunctions': 'string1;string2', + 'ForceSymbolReferences': 'a string1', + 'IgnoreAllDefaultLibraries': 'true', + 'IgnoreSpecificDefaultLibraries': 'file1;file2', + 'LinkLibraryDependencies': 'true', + 'ModuleDefinitionFile': 'a_file_name', + 'OutputFile': 'a_file_name', + 'SuppressStartupBanner': 'true', + 'UseUnicodeResponseFiles': 'true'}, + 'VCManifestTool': { + 'AdditionalManifestFiles': 'file1;file2', + 'AdditionalOptions': 'a string1', + 'AssemblyIdentity': 'a string1', + 'ComponentFileName': 'a_file_name', + 'DependencyInformationFile': 'a_file_name', + 'GenerateCatalogFiles': 'true', + 'InputResourceManifests': 'a string1', + 'ManifestResourceFile': 'a_file_name', + 'OutputManifestFile': 'a_file_name', + 'RegistrarScriptFile': 'a_file_name', + 'ReplacementsFile': 'a_file_name', + 'SuppressStartupBanner': 'true', + 'TypeLibraryFile': 'a_file_name', + 'UpdateFileHashes': 'truel', + 'UpdateFileHashesSearchPath': 'a_file_name', + 'UseFAT32Workaround': 'true', + 'UseUnicodeResponseFiles': 'true', + 'VerboseOutput': 'true'}}, + self.stderr) + self._ExpectedWarnings([ + 'Warning: for VCCLCompilerTool/BasicRuntimeChecks, ' + 'index value (5) not in expected range [0, 4)', + 'Warning: for VCCLCompilerTool/BrowseInformation, ' + "invalid literal for int() with base 10: 'fdkslj'", + 'Warning: for VCCLCompilerTool/CallingConvention, ' + 'index value (-1) not in expected range [0, 4)', + 'Warning: for VCCLCompilerTool/DebugInformationFormat, ' + 'converted value for 2 not specified.', + 'Warning: unrecognized setting VCCLCompilerTool/Enableprefast', + 'Warning: unrecognized setting VCCLCompilerTool/ZZXYZ', + 'Warning: for VCLinkerTool/TargetMachine, ' + 'converted value for 2 not specified.', + 'Warning: unrecognized setting VCMIDLTool/notgood', + 'Warning: unrecognized setting VCResourceCompilerTool/notgood2', + 'Warning: for VCManifestTool/UpdateFileHashes, ' + "expected bool; got 'truel'" + '']) + + def testValidateMSBuildSettings_settings(self): + """Tests that for invalid MSBuild settings.""" + MSVSSettings.ValidateMSBuildSettings( + {'ClCompile': { + 'AdditionalIncludeDirectories': 'folder1;folder2', + 'AdditionalOptions': ['string1', 'string2'], + 'AdditionalUsingDirectories': 'folder1;folder2', + 'AssemblerListingLocation': 'a_file_name', + 'AssemblerOutput': 'NoListing', + 'BasicRuntimeChecks': 'StackFrameRuntimeCheck', + 'BrowseInformation': 'false', + 'BrowseInformationFile': 'a_file_name', + 'BufferSecurityCheck': 'true', + 'BuildingInIDE': 'true', + 'CallingConvention': 'Cdecl', + 'CompileAs': 'CompileAsC', + 'CompileAsManaged': 'true', + 'CreateHotpatchableImage': 'true', + 'DebugInformationFormat': 'ProgramDatabase', + 'DisableLanguageExtensions': 'true', + 'DisableSpecificWarnings': 'string1;string2', + 'EnableEnhancedInstructionSet': 'StreamingSIMDExtensions', + 'EnableFiberSafeOptimizations': 'true', + 'EnablePREfast': 'true', + 'Enableprefast': 'bogus', + 'ErrorReporting': 'Prompt', + 'ExceptionHandling': 'SyncCThrow', + 'ExpandAttributedSource': 'true', + 'FavorSizeOrSpeed': 'Neither', + 'FloatingPointExceptions': 'true', + 'FloatingPointModel': 'Precise', + 'ForceConformanceInForLoopScope': 'true', + 'ForcedIncludeFiles': 'file1;file2', + 'ForcedUsingFiles': 'file1;file2', + 'FunctionLevelLinking': 'false', + 'GenerateXMLDocumentationFiles': 'true', + 'IgnoreStandardIncludePath': 'true', + 'InlineFunctionExpansion': 'OnlyExplicitInline', + 'IntrinsicFunctions': 'false', + 'MinimalRebuild': 'true', + 'MultiProcessorCompilation': 'true', + 'ObjectFileName': 'a_file_name', + 'OmitDefaultLibName': 'true', + 'OmitFramePointers': 'true', + 'OpenMPSupport': 'true', + 'Optimization': 'Disabled', + 'PrecompiledHeader': 'NotUsing', + 'PrecompiledHeaderFile': 'a_file_name', + 'PrecompiledHeaderOutputFile': 'a_file_name', + 'PreprocessKeepComments': 'true', + 'PreprocessorDefinitions': 'string1;string2', + 'PreprocessOutputPath': 'a string1', + 'PreprocessSuppressLineNumbers': 'false', + 'PreprocessToFile': 'false', + 'ProcessorNumber': '33', + 'ProgramDataBaseFileName': 'a_file_name', + 'RuntimeLibrary': 'MultiThreaded', + 'RuntimeTypeInfo': 'true', + 'ShowIncludes': 'true', + 'SmallerTypeCheck': 'true', + 'StringPooling': 'true', + 'StructMemberAlignment': '1Byte', + 'SuppressStartupBanner': 'true', + 'TrackerLogDirectory': 'a_folder', + 'TreatSpecificWarningsAsErrors': 'string1;string2', + 'TreatWarningAsError': 'true', + 'TreatWChar_tAsBuiltInType': 'true', + 'UndefineAllPreprocessorDefinitions': 'true', + 'UndefinePreprocessorDefinitions': 'string1;string2', + 'UseFullPaths': 'true', + 'UseUnicodeForAssemblerListing': 'true', + 'WarningLevel': 'TurnOffAllWarnings', + 'WholeProgramOptimization': 'true', + 'XMLDocumentationFileName': 'a_file_name', + 'ZZXYZ': 'bogus'}, + 'Link': { + 'AdditionalDependencies': 'file1;file2', + 'AdditionalLibraryDirectories': 'folder1;folder2', + 'AdditionalManifestDependencies': 'file1;file2', + 'AdditionalOptions': 'a string1', + 'AddModuleNamesToAssembly': 'file1;file2', + 'AllowIsolation': 'true', + 'AssemblyDebug': '', + 'AssemblyLinkResource': 'file1;file2', + 'BaseAddress': 'a string1', + 'BuildingInIDE': 'true', + 'CLRImageType': 'ForceIJWImage', + 'CLRSupportLastError': 'Enabled', + 'CLRThreadAttribute': 'MTAThreadingAttribute', + 'CLRUnmanagedCodeCheck': 'true', + 'CreateHotPatchableImage': 'X86Image', + 'DataExecutionPrevention': 'false', + 'DelayLoadDLLs': 'file1;file2', + 'DelaySign': 'true', + 'Driver': 'NotSet', + 'EmbedManagedResourceFile': 'file1;file2', + 'EnableCOMDATFolding': 'false', + 'EnableUAC': 'true', + 'EntryPointSymbol': 'a string1', + 'FixedBaseAddress': 'false', + 'ForceFileOutput': 'Enabled', + 'ForceSymbolReferences': 'file1;file2', + 'FunctionOrder': 'a_file_name', + 'GenerateDebugInformation': 'true', + 'GenerateMapFile': 'true', + 'HeapCommitSize': 'a string1', + 'HeapReserveSize': 'a string1', + 'IgnoreAllDefaultLibraries': 'true', + 'IgnoreEmbeddedIDL': 'true', + 'IgnoreSpecificDefaultLibraries': 'a_file_list', + 'ImageHasSafeExceptionHandlers': 'true', + 'ImportLibrary': 'a_file_name', + 'KeyContainer': 'a_file_name', + 'KeyFile': 'a_file_name', + 'LargeAddressAware': 'false', + 'LinkDLL': 'true', + 'LinkErrorReporting': 'SendErrorReport', + 'LinkStatus': 'true', + 'LinkTimeCodeGeneration': 'UseLinkTimeCodeGeneration', + 'ManifestFile': 'a_file_name', + 'MapExports': 'true', + 'MapFileName': 'a_file_name', + 'MergedIDLBaseFileName': 'a_file_name', + 'MergeSections': 'a string1', + 'MidlCommandFile': 'a_file_name', + 'MinimumRequiredVersion': 'a string1', + 'ModuleDefinitionFile': 'a_file_name', + 'MSDOSStubFileName': 'a_file_name', + 'NoEntryPoint': 'true', + 'OptimizeReferences': 'false', + 'OutputFile': 'a_file_name', + 'PerUserRedirection': 'true', + 'PreventDllBinding': 'true', + 'Profile': 'true', + 'ProfileGuidedDatabase': 'a_file_name', + 'ProgramDatabaseFile': 'a_file_name', + 'RandomizedBaseAddress': 'false', + 'RegisterOutput': 'true', + 'SectionAlignment': '33', + 'SetChecksum': 'true', + 'ShowProgress': 'LinkVerboseREF', + 'SpecifySectionAttributes': 'a string1', + 'StackCommitSize': 'a string1', + 'StackReserveSize': 'a string1', + 'StripPrivateSymbols': 'a_file_name', + 'SubSystem': 'Console', + 'SupportNobindOfDelayLoadedDLL': 'true', + 'SupportUnloadOfDelayLoadedDLL': 'true', + 'SuppressStartupBanner': 'true', + 'SwapRunFromCD': 'true', + 'SwapRunFromNET': 'true', + 'TargetMachine': 'MachineX86', + 'TerminalServerAware': 'false', + 'TrackerLogDirectory': 'a_folder', + 'TreatLinkerWarningAsErrors': 'true', + 'TurnOffAssemblyGeneration': 'true', + 'TypeLibraryFile': 'a_file_name', + 'TypeLibraryResourceID': '33', + 'UACExecutionLevel': 'AsInvoker', + 'UACUIAccess': 'true', + 'Version': 'a string1'}, + 'ResourceCompile': { + 'AdditionalIncludeDirectories': 'folder1;folder2', + 'AdditionalOptions': 'a string1', + 'Culture': '0x236', + 'IgnoreStandardIncludePath': 'true', + 'NullTerminateStrings': 'true', + 'PreprocessorDefinitions': 'string1;string2', + 'ResourceOutputFileName': 'a string1', + 'ShowProgress': 'true', + 'SuppressStartupBanner': 'true', + 'TrackerLogDirectory': 'a_folder', + 'UndefinePreprocessorDefinitions': 'string1;string2'}, + 'Midl': { + 'AdditionalIncludeDirectories': 'folder1;folder2', + 'AdditionalOptions': 'a string1', + 'ApplicationConfigurationMode': 'true', + 'ClientStubFile': 'a_file_name', + 'CPreprocessOptions': 'a string1', + 'DefaultCharType': 'Signed', + 'DllDataFileName': 'a_file_name', + 'EnableErrorChecks': 'EnableCustom', + 'ErrorCheckAllocations': 'true', + 'ErrorCheckBounds': 'true', + 'ErrorCheckEnumRange': 'true', + 'ErrorCheckRefPointers': 'true', + 'ErrorCheckStubData': 'true', + 'GenerateClientFiles': 'Stub', + 'GenerateServerFiles': 'None', + 'GenerateStublessProxies': 'true', + 'GenerateTypeLibrary': 'true', + 'HeaderFileName': 'a_file_name', + 'IgnoreStandardIncludePath': 'true', + 'InterfaceIdentifierFileName': 'a_file_name', + 'LocaleID': '33', + 'MkTypLibCompatible': 'true', + 'OutputDirectory': 'a string1', + 'PreprocessorDefinitions': 'string1;string2', + 'ProxyFileName': 'a_file_name', + 'RedirectOutputAndErrors': 'a_file_name', + 'ServerStubFile': 'a_file_name', + 'StructMemberAlignment': 'NotSet', + 'SuppressCompilerWarnings': 'true', + 'SuppressStartupBanner': 'true', + 'TargetEnvironment': 'Itanium', + 'TrackerLogDirectory': 'a_folder', + 'TypeLibFormat': 'NewFormat', + 'TypeLibraryName': 'a_file_name', + 'UndefinePreprocessorDefinitions': 'string1;string2', + 'ValidateAllParameters': 'true', + 'WarnAsError': 'true', + 'WarningLevel': '1'}, + 'Lib': { + 'AdditionalDependencies': 'file1;file2', + 'AdditionalLibraryDirectories': 'folder1;folder2', + 'AdditionalOptions': 'a string1', + 'DisplayLibrary': 'a string1', + 'ErrorReporting': 'PromptImmediately', + 'ExportNamedFunctions': 'string1;string2', + 'ForceSymbolReferences': 'a string1', + 'IgnoreAllDefaultLibraries': 'true', + 'IgnoreSpecificDefaultLibraries': 'file1;file2', + 'LinkTimeCodeGeneration': 'true', + 'MinimumRequiredVersion': 'a string1', + 'ModuleDefinitionFile': 'a_file_name', + 'Name': 'a_file_name', + 'OutputFile': 'a_file_name', + 'RemoveObjects': 'file1;file2', + 'SubSystem': 'Console', + 'SuppressStartupBanner': 'true', + 'TargetMachine': 'MachineX86i', + 'TrackerLogDirectory': 'a_folder', + 'TreatLibWarningAsErrors': 'true', + 'UseUnicodeResponseFiles': 'true', + 'Verbose': 'true'}, + 'Manifest': { + 'AdditionalManifestFiles': 'file1;file2', + 'AdditionalOptions': 'a string1', + 'AssemblyIdentity': 'a string1', + 'ComponentFileName': 'a_file_name', + 'EnableDPIAwareness': 'fal', + 'GenerateCatalogFiles': 'truel', + 'GenerateCategoryTags': 'true', + 'InputResourceManifests': 'a string1', + 'ManifestFromManagedAssembly': 'a_file_name', + 'notgood3': 'bogus', + 'OutputManifestFile': 'a_file_name', + 'OutputResourceManifests': 'a string1', + 'RegistrarScriptFile': 'a_file_name', + 'ReplacementsFile': 'a_file_name', + 'SuppressDependencyElement': 'true', + 'SuppressStartupBanner': 'true', + 'TrackerLogDirectory': 'a_folder', + 'TypeLibraryFile': 'a_file_name', + 'UpdateFileHashes': 'true', + 'UpdateFileHashesSearchPath': 'a_file_name', + 'VerboseOutput': 'true'}, + 'ProjectReference': { + 'LinkLibraryDependencies': 'true', + 'UseLibraryDependencyInputs': 'true'}, + 'ManifestResourceCompile': { + 'ResourceOutputFileName': 'a_file_name'}, + '': { + 'EmbedManifest': 'true', + 'GenerateManifest': 'true', + 'IgnoreImportLibrary': 'true', + 'LinkIncremental': 'false'}}, + self.stderr) + self._ExpectedWarnings([ + 'Warning: unrecognized setting ClCompile/Enableprefast', + 'Warning: unrecognized setting ClCompile/ZZXYZ', + 'Warning: unrecognized setting Manifest/notgood3', + 'Warning: for Manifest/GenerateCatalogFiles, ' + "expected bool; got 'truel'", + 'Warning: for Lib/TargetMachine, unrecognized enumerated value ' + 'MachineX86i', + "Warning: for Manifest/EnableDPIAwareness, expected bool; got 'fal'"]) + + def testConvertToMSBuildSettings_empty(self): + """Tests an empty conversion.""" + msvs_settings = {} + expected_msbuild_settings = {} + actual_msbuild_settings = MSVSSettings.ConvertToMSBuildSettings( + msvs_settings, + self.stderr) + self.assertEqual(expected_msbuild_settings, actual_msbuild_settings) + self._ExpectedWarnings([]) + + def testConvertToMSBuildSettings_minimal(self): + """Tests a minimal conversion.""" + msvs_settings = { + 'VCCLCompilerTool': { + 'AdditionalIncludeDirectories': 'dir1', + 'AdditionalOptions': '/foo', + 'BasicRuntimeChecks': '0', + }, + 'VCLinkerTool': { + 'LinkTimeCodeGeneration': '1', + 'ErrorReporting': '1', + 'DataExecutionPrevention': '2', + }, + } + expected_msbuild_settings = { + 'ClCompile': { + 'AdditionalIncludeDirectories': 'dir1', + 'AdditionalOptions': '/foo', + 'BasicRuntimeChecks': 'Default', + }, + 'Link': { + 'LinkTimeCodeGeneration': 'UseLinkTimeCodeGeneration', + 'LinkErrorReporting': 'PromptImmediately', + 'DataExecutionPrevention': 'true', + }, + } + actual_msbuild_settings = MSVSSettings.ConvertToMSBuildSettings( + msvs_settings, + self.stderr) + self.assertEqual(expected_msbuild_settings, actual_msbuild_settings) + self._ExpectedWarnings([]) + + def testConvertToMSBuildSettings_warnings(self): + """Tests conversion that generates warnings.""" + msvs_settings = { + 'VCCLCompilerTool': { + 'AdditionalIncludeDirectories': '1', + 'AdditionalOptions': '2', + # These are incorrect values: + 'BasicRuntimeChecks': '12', + 'BrowseInformation': '21', + 'UsePrecompiledHeader': '13', + 'GeneratePreprocessedFile': '14'}, + 'VCLinkerTool': { + # These are incorrect values: + 'Driver': '10', + 'LinkTimeCodeGeneration': '31', + 'ErrorReporting': '21', + 'FixedBaseAddress': '6'}, + 'VCResourceCompilerTool': { + # Custom + 'Culture': '1003'}} + expected_msbuild_settings = { + 'ClCompile': { + 'AdditionalIncludeDirectories': '1', + 'AdditionalOptions': '2'}, + 'Link': {}, + 'ResourceCompile': { + # Custom + 'Culture': '0x03eb'}} + actual_msbuild_settings = MSVSSettings.ConvertToMSBuildSettings( + msvs_settings, + self.stderr) + self.assertEqual(expected_msbuild_settings, actual_msbuild_settings) + self._ExpectedWarnings([ + 'Warning: while converting VCCLCompilerTool/BasicRuntimeChecks to ' + 'MSBuild, index value (12) not in expected range [0, 4)', + 'Warning: while converting VCCLCompilerTool/BrowseInformation to ' + 'MSBuild, index value (21) not in expected range [0, 3)', + 'Warning: while converting VCCLCompilerTool/UsePrecompiledHeader to ' + 'MSBuild, index value (13) not in expected range [0, 3)', + 'Warning: while converting VCCLCompilerTool/GeneratePreprocessedFile to ' + 'MSBuild, value must be one of [0, 1, 2]; got 14', + + 'Warning: while converting VCLinkerTool/Driver to ' + 'MSBuild, index value (10) not in expected range [0, 4)', + 'Warning: while converting VCLinkerTool/LinkTimeCodeGeneration to ' + 'MSBuild, index value (31) not in expected range [0, 5)', + 'Warning: while converting VCLinkerTool/ErrorReporting to ' + 'MSBuild, index value (21) not in expected range [0, 3)', + 'Warning: while converting VCLinkerTool/FixedBaseAddress to ' + 'MSBuild, index value (6) not in expected range [0, 3)', + ]) + + def testConvertToMSBuildSettings_full_synthetic(self): + """Tests conversion of all the MSBuild settings.""" + msvs_settings = { + 'VCCLCompilerTool': { + 'AdditionalIncludeDirectories': 'folder1;folder2;folder3', + 'AdditionalOptions': 'a_string', + 'AdditionalUsingDirectories': 'folder1;folder2;folder3', + 'AssemblerListingLocation': 'a_file_name', + 'AssemblerOutput': '0', + 'BasicRuntimeChecks': '1', + 'BrowseInformation': '2', + 'BrowseInformationFile': 'a_file_name', + 'BufferSecurityCheck': 'true', + 'CallingConvention': '0', + 'CompileAs': '1', + 'DebugInformationFormat': '4', + 'DefaultCharIsUnsigned': 'true', + 'Detect64BitPortabilityProblems': 'true', + 'DisableLanguageExtensions': 'true', + 'DisableSpecificWarnings': 'd1;d2;d3', + 'EnableEnhancedInstructionSet': '0', + 'EnableFiberSafeOptimizations': 'true', + 'EnableFunctionLevelLinking': 'true', + 'EnableIntrinsicFunctions': 'true', + 'EnablePREfast': 'true', + 'ErrorReporting': '1', + 'ExceptionHandling': '2', + 'ExpandAttributedSource': 'true', + 'FavorSizeOrSpeed': '0', + 'FloatingPointExceptions': 'true', + 'FloatingPointModel': '1', + 'ForceConformanceInForLoopScope': 'true', + 'ForcedIncludeFiles': 'file1;file2;file3', + 'ForcedUsingFiles': 'file1;file2;file3', + 'GeneratePreprocessedFile': '1', + 'GenerateXMLDocumentationFiles': 'true', + 'IgnoreStandardIncludePath': 'true', + 'InlineFunctionExpansion': '2', + 'KeepComments': 'true', + 'MinimalRebuild': 'true', + 'ObjectFile': 'a_file_name', + 'OmitDefaultLibName': 'true', + 'OmitFramePointers': 'true', + 'OpenMP': 'true', + 'Optimization': '3', + 'PrecompiledHeaderFile': 'a_file_name', + 'PrecompiledHeaderThrough': 'a_file_name', + 'PreprocessorDefinitions': 'd1;d2;d3', + 'ProgramDataBaseFileName': 'a_file_name', + 'RuntimeLibrary': '0', + 'RuntimeTypeInfo': 'true', + 'ShowIncludes': 'true', + 'SmallerTypeCheck': 'true', + 'StringPooling': 'true', + 'StructMemberAlignment': '1', + 'SuppressStartupBanner': 'true', + 'TreatWChar_tAsBuiltInType': 'true', + 'UndefineAllPreprocessorDefinitions': 'true', + 'UndefinePreprocessorDefinitions': 'd1;d2;d3', + 'UseFullPaths': 'true', + 'UsePrecompiledHeader': '1', + 'UseUnicodeResponseFiles': 'true', + 'WarnAsError': 'true', + 'WarningLevel': '2', + 'WholeProgramOptimization': 'true', + 'XMLDocumentationFileName': 'a_file_name'}, + 'VCLinkerTool': { + 'AdditionalDependencies': 'file1;file2;file3', + 'AdditionalLibraryDirectories': 'folder1;folder2;folder3', + 'AdditionalLibraryDirectories_excluded': 'folder1;folder2;folder3', + 'AdditionalManifestDependencies': 'file1;file2;file3', + 'AdditionalOptions': 'a_string', + 'AddModuleNamesToAssembly': 'file1;file2;file3', + 'AllowIsolation': 'true', + 'AssemblyDebug': '0', + 'AssemblyLinkResource': 'file1;file2;file3', + 'BaseAddress': 'a_string', + 'CLRImageType': '1', + 'CLRThreadAttribute': '2', + 'CLRUnmanagedCodeCheck': 'true', + 'DataExecutionPrevention': '0', + 'DelayLoadDLLs': 'file1;file2;file3', + 'DelaySign': 'true', + 'Driver': '1', + 'EmbedManagedResourceFile': 'file1;file2;file3', + 'EnableCOMDATFolding': '0', + 'EnableUAC': 'true', + 'EntryPointSymbol': 'a_string', + 'ErrorReporting': '0', + 'FixedBaseAddress': '1', + 'ForceSymbolReferences': 'file1;file2;file3', + 'FunctionOrder': 'a_file_name', + 'GenerateDebugInformation': 'true', + 'GenerateManifest': 'true', + 'GenerateMapFile': 'true', + 'HeapCommitSize': 'a_string', + 'HeapReserveSize': 'a_string', + 'IgnoreAllDefaultLibraries': 'true', + 'IgnoreDefaultLibraryNames': 'file1;file2;file3', + 'IgnoreEmbeddedIDL': 'true', + 'IgnoreImportLibrary': 'true', + 'ImportLibrary': 'a_file_name', + 'KeyContainer': 'a_file_name', + 'KeyFile': 'a_file_name', + 'LargeAddressAware': '2', + 'LinkIncremental': '1', + 'LinkLibraryDependencies': 'true', + 'LinkTimeCodeGeneration': '2', + 'ManifestFile': 'a_file_name', + 'MapExports': 'true', + 'MapFileName': 'a_file_name', + 'MergedIDLBaseFileName': 'a_file_name', + 'MergeSections': 'a_string', + 'MidlCommandFile': 'a_file_name', + 'ModuleDefinitionFile': 'a_file_name', + 'OptimizeForWindows98': '1', + 'OptimizeReferences': '0', + 'OutputFile': 'a_file_name', + 'PerUserRedirection': 'true', + 'Profile': 'true', + 'ProfileGuidedDatabase': 'a_file_name', + 'ProgramDatabaseFile': 'a_file_name', + 'RandomizedBaseAddress': '1', + 'RegisterOutput': 'true', + 'ResourceOnlyDLL': 'true', + 'SetChecksum': 'true', + 'ShowProgress': '0', + 'StackCommitSize': 'a_string', + 'StackReserveSize': 'a_string', + 'StripPrivateSymbols': 'a_file_name', + 'SubSystem': '2', + 'SupportUnloadOfDelayLoadedDLL': 'true', + 'SuppressStartupBanner': 'true', + 'SwapRunFromCD': 'true', + 'SwapRunFromNet': 'true', + 'TargetMachine': '3', + 'TerminalServerAware': '2', + 'TurnOffAssemblyGeneration': 'true', + 'TypeLibraryFile': 'a_file_name', + 'TypeLibraryResourceID': '33', + 'UACExecutionLevel': '1', + 'UACUIAccess': 'true', + 'UseLibraryDependencyInputs': 'false', + 'UseUnicodeResponseFiles': 'true', + 'Version': 'a_string'}, + 'VCResourceCompilerTool': { + 'AdditionalIncludeDirectories': 'folder1;folder2;folder3', + 'AdditionalOptions': 'a_string', + 'Culture': '1003', + 'IgnoreStandardIncludePath': 'true', + 'PreprocessorDefinitions': 'd1;d2;d3', + 'ResourceOutputFileName': 'a_string', + 'ShowProgress': 'true', + 'SuppressStartupBanner': 'true', + 'UndefinePreprocessorDefinitions': 'd1;d2;d3'}, + 'VCMIDLTool': { + 'AdditionalIncludeDirectories': 'folder1;folder2;folder3', + 'AdditionalOptions': 'a_string', + 'CPreprocessOptions': 'a_string', + 'DefaultCharType': '0', + 'DLLDataFileName': 'a_file_name', + 'EnableErrorChecks': '2', + 'ErrorCheckAllocations': 'true', + 'ErrorCheckBounds': 'true', + 'ErrorCheckEnumRange': 'true', + 'ErrorCheckRefPointers': 'true', + 'ErrorCheckStubData': 'true', + 'GenerateStublessProxies': 'true', + 'GenerateTypeLibrary': 'true', + 'HeaderFileName': 'a_file_name', + 'IgnoreStandardIncludePath': 'true', + 'InterfaceIdentifierFileName': 'a_file_name', + 'MkTypLibCompatible': 'true', + 'OutputDirectory': 'a_string', + 'PreprocessorDefinitions': 'd1;d2;d3', + 'ProxyFileName': 'a_file_name', + 'RedirectOutputAndErrors': 'a_file_name', + 'StructMemberAlignment': '3', + 'SuppressStartupBanner': 'true', + 'TargetEnvironment': '1', + 'TypeLibraryName': 'a_file_name', + 'UndefinePreprocessorDefinitions': 'd1;d2;d3', + 'ValidateParameters': 'true', + 'WarnAsError': 'true', + 'WarningLevel': '4'}, + 'VCLibrarianTool': { + 'AdditionalDependencies': 'file1;file2;file3', + 'AdditionalLibraryDirectories': 'folder1;folder2;folder3', + 'AdditionalLibraryDirectories_excluded': 'folder1;folder2;folder3', + 'AdditionalOptions': 'a_string', + 'ExportNamedFunctions': 'd1;d2;d3', + 'ForceSymbolReferences': 'a_string', + 'IgnoreAllDefaultLibraries': 'true', + 'IgnoreSpecificDefaultLibraries': 'file1;file2;file3', + 'LinkLibraryDependencies': 'true', + 'ModuleDefinitionFile': 'a_file_name', + 'OutputFile': 'a_file_name', + 'SuppressStartupBanner': 'true', + 'UseUnicodeResponseFiles': 'true'}, + 'VCManifestTool': { + 'AdditionalManifestFiles': 'file1;file2;file3', + 'AdditionalOptions': 'a_string', + 'AssemblyIdentity': 'a_string', + 'ComponentFileName': 'a_file_name', + 'DependencyInformationFile': 'a_file_name', + 'EmbedManifest': 'true', + 'GenerateCatalogFiles': 'true', + 'InputResourceManifests': 'a_string', + 'ManifestResourceFile': 'my_name', + 'OutputManifestFile': 'a_file_name', + 'RegistrarScriptFile': 'a_file_name', + 'ReplacementsFile': 'a_file_name', + 'SuppressStartupBanner': 'true', + 'TypeLibraryFile': 'a_file_name', + 'UpdateFileHashes': 'true', + 'UpdateFileHashesSearchPath': 'a_file_name', + 'UseFAT32Workaround': 'true', + 'UseUnicodeResponseFiles': 'true', + 'VerboseOutput': 'true'}} + expected_msbuild_settings = { + 'ClCompile': { + 'AdditionalIncludeDirectories': 'folder1;folder2;folder3', + 'AdditionalOptions': 'a_string /J', + 'AdditionalUsingDirectories': 'folder1;folder2;folder3', + 'AssemblerListingLocation': 'a_file_name', + 'AssemblerOutput': 'NoListing', + 'BasicRuntimeChecks': 'StackFrameRuntimeCheck', + 'BrowseInformation': 'true', + 'BrowseInformationFile': 'a_file_name', + 'BufferSecurityCheck': 'true', + 'CallingConvention': 'Cdecl', + 'CompileAs': 'CompileAsC', + 'DebugInformationFormat': 'EditAndContinue', + 'DisableLanguageExtensions': 'true', + 'DisableSpecificWarnings': 'd1;d2;d3', + 'EnableEnhancedInstructionSet': 'NotSet', + 'EnableFiberSafeOptimizations': 'true', + 'EnablePREfast': 'true', + 'ErrorReporting': 'Prompt', + 'ExceptionHandling': 'Async', + 'ExpandAttributedSource': 'true', + 'FavorSizeOrSpeed': 'Neither', + 'FloatingPointExceptions': 'true', + 'FloatingPointModel': 'Strict', + 'ForceConformanceInForLoopScope': 'true', + 'ForcedIncludeFiles': 'file1;file2;file3', + 'ForcedUsingFiles': 'file1;file2;file3', + 'FunctionLevelLinking': 'true', + 'GenerateXMLDocumentationFiles': 'true', + 'IgnoreStandardIncludePath': 'true', + 'InlineFunctionExpansion': 'AnySuitable', + 'IntrinsicFunctions': 'true', + 'MinimalRebuild': 'true', + 'ObjectFileName': 'a_file_name', + 'OmitDefaultLibName': 'true', + 'OmitFramePointers': 'true', + 'OpenMPSupport': 'true', + 'Optimization': 'Full', + 'PrecompiledHeader': 'Create', + 'PrecompiledHeaderFile': 'a_file_name', + 'PrecompiledHeaderOutputFile': 'a_file_name', + 'PreprocessKeepComments': 'true', + 'PreprocessorDefinitions': 'd1;d2;d3', + 'PreprocessSuppressLineNumbers': 'false', + 'PreprocessToFile': 'true', + 'ProgramDataBaseFileName': 'a_file_name', + 'RuntimeLibrary': 'MultiThreaded', + 'RuntimeTypeInfo': 'true', + 'ShowIncludes': 'true', + 'SmallerTypeCheck': 'true', + 'StringPooling': 'true', + 'StructMemberAlignment': '1Byte', + 'SuppressStartupBanner': 'true', + 'TreatWarningAsError': 'true', + 'TreatWChar_tAsBuiltInType': 'true', + 'UndefineAllPreprocessorDefinitions': 'true', + 'UndefinePreprocessorDefinitions': 'd1;d2;d3', + 'UseFullPaths': 'true', + 'WarningLevel': 'Level2', + 'WholeProgramOptimization': 'true', + 'XMLDocumentationFileName': 'a_file_name'}, + 'Link': { + 'AdditionalDependencies': 'file1;file2;file3', + 'AdditionalLibraryDirectories': 'folder1;folder2;folder3', + 'AdditionalManifestDependencies': 'file1;file2;file3', + 'AdditionalOptions': 'a_string', + 'AddModuleNamesToAssembly': 'file1;file2;file3', + 'AllowIsolation': 'true', + 'AssemblyDebug': '', + 'AssemblyLinkResource': 'file1;file2;file3', + 'BaseAddress': 'a_string', + 'CLRImageType': 'ForceIJWImage', + 'CLRThreadAttribute': 'STAThreadingAttribute', + 'CLRUnmanagedCodeCheck': 'true', + 'DataExecutionPrevention': '', + 'DelayLoadDLLs': 'file1;file2;file3', + 'DelaySign': 'true', + 'Driver': 'Driver', + 'EmbedManagedResourceFile': 'file1;file2;file3', + 'EnableCOMDATFolding': '', + 'EnableUAC': 'true', + 'EntryPointSymbol': 'a_string', + 'FixedBaseAddress': 'false', + 'ForceSymbolReferences': 'file1;file2;file3', + 'FunctionOrder': 'a_file_name', + 'GenerateDebugInformation': 'true', + 'GenerateMapFile': 'true', + 'HeapCommitSize': 'a_string', + 'HeapReserveSize': 'a_string', + 'IgnoreAllDefaultLibraries': 'true', + 'IgnoreEmbeddedIDL': 'true', + 'IgnoreSpecificDefaultLibraries': 'file1;file2;file3', + 'ImportLibrary': 'a_file_name', + 'KeyContainer': 'a_file_name', + 'KeyFile': 'a_file_name', + 'LargeAddressAware': 'true', + 'LinkErrorReporting': 'NoErrorReport', + 'LinkTimeCodeGeneration': 'PGInstrument', + 'ManifestFile': 'a_file_name', + 'MapExports': 'true', + 'MapFileName': 'a_file_name', + 'MergedIDLBaseFileName': 'a_file_name', + 'MergeSections': 'a_string', + 'MidlCommandFile': 'a_file_name', + 'ModuleDefinitionFile': 'a_file_name', + 'NoEntryPoint': 'true', + 'OptimizeReferences': '', + 'OutputFile': 'a_file_name', + 'PerUserRedirection': 'true', + 'Profile': 'true', + 'ProfileGuidedDatabase': 'a_file_name', + 'ProgramDatabaseFile': 'a_file_name', + 'RandomizedBaseAddress': 'false', + 'RegisterOutput': 'true', + 'SetChecksum': 'true', + 'ShowProgress': 'NotSet', + 'StackCommitSize': 'a_string', + 'StackReserveSize': 'a_string', + 'StripPrivateSymbols': 'a_file_name', + 'SubSystem': 'Windows', + 'SupportUnloadOfDelayLoadedDLL': 'true', + 'SuppressStartupBanner': 'true', + 'SwapRunFromCD': 'true', + 'SwapRunFromNET': 'true', + 'TargetMachine': 'MachineARM', + 'TerminalServerAware': 'true', + 'TurnOffAssemblyGeneration': 'true', + 'TypeLibraryFile': 'a_file_name', + 'TypeLibraryResourceID': '33', + 'UACExecutionLevel': 'HighestAvailable', + 'UACUIAccess': 'true', + 'Version': 'a_string'}, + 'ResourceCompile': { + 'AdditionalIncludeDirectories': 'folder1;folder2;folder3', + 'AdditionalOptions': 'a_string', + 'Culture': '0x03eb', + 'IgnoreStandardIncludePath': 'true', + 'PreprocessorDefinitions': 'd1;d2;d3', + 'ResourceOutputFileName': 'a_string', + 'ShowProgress': 'true', + 'SuppressStartupBanner': 'true', + 'UndefinePreprocessorDefinitions': 'd1;d2;d3'}, + 'Midl': { + 'AdditionalIncludeDirectories': 'folder1;folder2;folder3', + 'AdditionalOptions': 'a_string', + 'CPreprocessOptions': 'a_string', + 'DefaultCharType': 'Unsigned', + 'DllDataFileName': 'a_file_name', + 'EnableErrorChecks': 'All', + 'ErrorCheckAllocations': 'true', + 'ErrorCheckBounds': 'true', + 'ErrorCheckEnumRange': 'true', + 'ErrorCheckRefPointers': 'true', + 'ErrorCheckStubData': 'true', + 'GenerateStublessProxies': 'true', + 'GenerateTypeLibrary': 'true', + 'HeaderFileName': 'a_file_name', + 'IgnoreStandardIncludePath': 'true', + 'InterfaceIdentifierFileName': 'a_file_name', + 'MkTypLibCompatible': 'true', + 'OutputDirectory': 'a_string', + 'PreprocessorDefinitions': 'd1;d2;d3', + 'ProxyFileName': 'a_file_name', + 'RedirectOutputAndErrors': 'a_file_name', + 'StructMemberAlignment': '4', + 'SuppressStartupBanner': 'true', + 'TargetEnvironment': 'Win32', + 'TypeLibraryName': 'a_file_name', + 'UndefinePreprocessorDefinitions': 'd1;d2;d3', + 'ValidateAllParameters': 'true', + 'WarnAsError': 'true', + 'WarningLevel': '4'}, + 'Lib': { + 'AdditionalDependencies': 'file1;file2;file3', + 'AdditionalLibraryDirectories': 'folder1;folder2;folder3', + 'AdditionalOptions': 'a_string', + 'ExportNamedFunctions': 'd1;d2;d3', + 'ForceSymbolReferences': 'a_string', + 'IgnoreAllDefaultLibraries': 'true', + 'IgnoreSpecificDefaultLibraries': 'file1;file2;file3', + 'ModuleDefinitionFile': 'a_file_name', + 'OutputFile': 'a_file_name', + 'SuppressStartupBanner': 'true', + 'UseUnicodeResponseFiles': 'true'}, + 'Manifest': { + 'AdditionalManifestFiles': 'file1;file2;file3', + 'AdditionalOptions': 'a_string', + 'AssemblyIdentity': 'a_string', + 'ComponentFileName': 'a_file_name', + 'GenerateCatalogFiles': 'true', + 'InputResourceManifests': 'a_string', + 'OutputManifestFile': 'a_file_name', + 'RegistrarScriptFile': 'a_file_name', + 'ReplacementsFile': 'a_file_name', + 'SuppressStartupBanner': 'true', + 'TypeLibraryFile': 'a_file_name', + 'UpdateFileHashes': 'true', + 'UpdateFileHashesSearchPath': 'a_file_name', + 'VerboseOutput': 'true'}, + 'ManifestResourceCompile': { + 'ResourceOutputFileName': 'my_name'}, + 'ProjectReference': { + 'LinkLibraryDependencies': 'true', + 'UseLibraryDependencyInputs': 'false'}, + '': { + 'EmbedManifest': 'true', + 'GenerateManifest': 'true', + 'IgnoreImportLibrary': 'true', + 'LinkIncremental': 'false'}} + actual_msbuild_settings = MSVSSettings.ConvertToMSBuildSettings( + msvs_settings, + self.stderr) + self.assertEqual(expected_msbuild_settings, actual_msbuild_settings) + self._ExpectedWarnings([]) + + def testConvertToMSBuildSettings_actual(self): + """Tests the conversion of an actual project. + + A VS2008 project with most of the options defined was created through the + VS2008 IDE. It was then converted to VS2010. The tool settings found in + the .vcproj and .vcxproj files were converted to the two dictionaries + msvs_settings and expected_msbuild_settings. + + Note that for many settings, the VS2010 converter adds macros like + %(AdditionalIncludeDirectories) to make sure than inherited values are + included. Since the Gyp projects we generate do not use inheritance, + we removed these macros. They were: + ClCompile: + AdditionalIncludeDirectories: ';%(AdditionalIncludeDirectories)' + AdditionalOptions: ' %(AdditionalOptions)' + AdditionalUsingDirectories: ';%(AdditionalUsingDirectories)' + DisableSpecificWarnings: ';%(DisableSpecificWarnings)', + ForcedIncludeFiles: ';%(ForcedIncludeFiles)', + ForcedUsingFiles: ';%(ForcedUsingFiles)', + PreprocessorDefinitions: ';%(PreprocessorDefinitions)', + UndefinePreprocessorDefinitions: + ';%(UndefinePreprocessorDefinitions)', + Link: + AdditionalDependencies: ';%(AdditionalDependencies)', + AdditionalLibraryDirectories: ';%(AdditionalLibraryDirectories)', + AdditionalManifestDependencies: + ';%(AdditionalManifestDependencies)', + AdditionalOptions: ' %(AdditionalOptions)', + AddModuleNamesToAssembly: ';%(AddModuleNamesToAssembly)', + AssemblyLinkResource: ';%(AssemblyLinkResource)', + DelayLoadDLLs: ';%(DelayLoadDLLs)', + EmbedManagedResourceFile: ';%(EmbedManagedResourceFile)', + ForceSymbolReferences: ';%(ForceSymbolReferences)', + IgnoreSpecificDefaultLibraries: + ';%(IgnoreSpecificDefaultLibraries)', + ResourceCompile: + AdditionalIncludeDirectories: ';%(AdditionalIncludeDirectories)', + AdditionalOptions: ' %(AdditionalOptions)', + PreprocessorDefinitions: ';%(PreprocessorDefinitions)', + Manifest: + AdditionalManifestFiles: ';%(AdditionalManifestFiles)', + AdditionalOptions: ' %(AdditionalOptions)', + InputResourceManifests: ';%(InputResourceManifests)', + """ + msvs_settings = { + 'VCCLCompilerTool': { + 'AdditionalIncludeDirectories': 'dir1', + 'AdditionalOptions': '/more', + 'AdditionalUsingDirectories': 'test', + 'AssemblerListingLocation': '$(IntDir)\\a', + 'AssemblerOutput': '1', + 'BasicRuntimeChecks': '3', + 'BrowseInformation': '1', + 'BrowseInformationFile': '$(IntDir)\\e', + 'BufferSecurityCheck': 'false', + 'CallingConvention': '1', + 'CompileAs': '1', + 'DebugInformationFormat': '4', + 'DefaultCharIsUnsigned': 'true', + 'Detect64BitPortabilityProblems': 'true', + 'DisableLanguageExtensions': 'true', + 'DisableSpecificWarnings': 'abc', + 'EnableEnhancedInstructionSet': '1', + 'EnableFiberSafeOptimizations': 'true', + 'EnableFunctionLevelLinking': 'true', + 'EnableIntrinsicFunctions': 'true', + 'EnablePREfast': 'true', + 'ErrorReporting': '2', + 'ExceptionHandling': '2', + 'ExpandAttributedSource': 'true', + 'FavorSizeOrSpeed': '2', + 'FloatingPointExceptions': 'true', + 'FloatingPointModel': '1', + 'ForceConformanceInForLoopScope': 'false', + 'ForcedIncludeFiles': 'def', + 'ForcedUsingFiles': 'ge', + 'GeneratePreprocessedFile': '2', + 'GenerateXMLDocumentationFiles': 'true', + 'IgnoreStandardIncludePath': 'true', + 'InlineFunctionExpansion': '1', + 'KeepComments': 'true', + 'MinimalRebuild': 'true', + 'ObjectFile': '$(IntDir)\\b', + 'OmitDefaultLibName': 'true', + 'OmitFramePointers': 'true', + 'OpenMP': 'true', + 'Optimization': '3', + 'PrecompiledHeaderFile': '$(IntDir)\\$(TargetName).pche', + 'PrecompiledHeaderThrough': 'StdAfx.hd', + 'PreprocessorDefinitions': 'WIN32;_DEBUG;_CONSOLE', + 'ProgramDataBaseFileName': '$(IntDir)\\vc90b.pdb', + 'RuntimeLibrary': '3', + 'RuntimeTypeInfo': 'false', + 'ShowIncludes': 'true', + 'SmallerTypeCheck': 'true', + 'StringPooling': 'true', + 'StructMemberAlignment': '3', + 'SuppressStartupBanner': 'false', + 'TreatWChar_tAsBuiltInType': 'false', + 'UndefineAllPreprocessorDefinitions': 'true', + 'UndefinePreprocessorDefinitions': 'wer', + 'UseFullPaths': 'true', + 'UsePrecompiledHeader': '0', + 'UseUnicodeResponseFiles': 'false', + 'WarnAsError': 'true', + 'WarningLevel': '3', + 'WholeProgramOptimization': 'true', + 'XMLDocumentationFileName': '$(IntDir)\\c'}, + 'VCLinkerTool': { + 'AdditionalDependencies': 'zx', + 'AdditionalLibraryDirectories': 'asd', + 'AdditionalManifestDependencies': 's2', + 'AdditionalOptions': '/mor2', + 'AddModuleNamesToAssembly': 'd1', + 'AllowIsolation': 'false', + 'AssemblyDebug': '1', + 'AssemblyLinkResource': 'd5', + 'BaseAddress': '23423', + 'CLRImageType': '3', + 'CLRThreadAttribute': '1', + 'CLRUnmanagedCodeCheck': 'true', + 'DataExecutionPrevention': '0', + 'DelayLoadDLLs': 'd4', + 'DelaySign': 'true', + 'Driver': '2', + 'EmbedManagedResourceFile': 'd2', + 'EnableCOMDATFolding': '1', + 'EnableUAC': 'false', + 'EntryPointSymbol': 'f5', + 'ErrorReporting': '2', + 'FixedBaseAddress': '1', + 'ForceSymbolReferences': 'd3', + 'FunctionOrder': 'fssdfsd', + 'GenerateDebugInformation': 'true', + 'GenerateManifest': 'false', + 'GenerateMapFile': 'true', + 'HeapCommitSize': '13', + 'HeapReserveSize': '12', + 'IgnoreAllDefaultLibraries': 'true', + 'IgnoreDefaultLibraryNames': 'flob;flok', + 'IgnoreEmbeddedIDL': 'true', + 'IgnoreImportLibrary': 'true', + 'ImportLibrary': 'f4', + 'KeyContainer': 'f7', + 'KeyFile': 'f6', + 'LargeAddressAware': '2', + 'LinkIncremental': '0', + 'LinkLibraryDependencies': 'false', + 'LinkTimeCodeGeneration': '1', + 'ManifestFile': + '$(IntDir)\\$(TargetFileName).2intermediate.manifest', + 'MapExports': 'true', + 'MapFileName': 'd5', + 'MergedIDLBaseFileName': 'f2', + 'MergeSections': 'f5', + 'MidlCommandFile': 'f1', + 'ModuleDefinitionFile': 'sdsd', + 'OptimizeForWindows98': '2', + 'OptimizeReferences': '2', + 'OutputFile': '$(OutDir)\\$(ProjectName)2.exe', + 'PerUserRedirection': 'true', + 'Profile': 'true', + 'ProfileGuidedDatabase': '$(TargetDir)$(TargetName).pgdd', + 'ProgramDatabaseFile': 'Flob.pdb', + 'RandomizedBaseAddress': '1', + 'RegisterOutput': 'true', + 'ResourceOnlyDLL': 'true', + 'SetChecksum': 'false', + 'ShowProgress': '1', + 'StackCommitSize': '15', + 'StackReserveSize': '14', + 'StripPrivateSymbols': 'd3', + 'SubSystem': '1', + 'SupportUnloadOfDelayLoadedDLL': 'true', + 'SuppressStartupBanner': 'false', + 'SwapRunFromCD': 'true', + 'SwapRunFromNet': 'true', + 'TargetMachine': '1', + 'TerminalServerAware': '1', + 'TurnOffAssemblyGeneration': 'true', + 'TypeLibraryFile': 'f3', + 'TypeLibraryResourceID': '12', + 'UACExecutionLevel': '2', + 'UACUIAccess': 'true', + 'UseLibraryDependencyInputs': 'true', + 'UseUnicodeResponseFiles': 'false', + 'Version': '333'}, + 'VCResourceCompilerTool': { + 'AdditionalIncludeDirectories': 'f3', + 'AdditionalOptions': '/more3', + 'Culture': '3084', + 'IgnoreStandardIncludePath': 'true', + 'PreprocessorDefinitions': '_UNICODE;UNICODE2', + 'ResourceOutputFileName': '$(IntDir)/$(InputName)3.res', + 'ShowProgress': 'true'}, + 'VCManifestTool': { + 'AdditionalManifestFiles': 'sfsdfsd', + 'AdditionalOptions': 'afdsdafsd', + 'AssemblyIdentity': 'sddfdsadfsa', + 'ComponentFileName': 'fsdfds', + 'DependencyInformationFile': '$(IntDir)\\mt.depdfd', + 'EmbedManifest': 'false', + 'GenerateCatalogFiles': 'true', + 'InputResourceManifests': 'asfsfdafs', + 'ManifestResourceFile': + '$(IntDir)\\$(TargetFileName).embed.manifest.resfdsf', + 'OutputManifestFile': '$(TargetPath).manifestdfs', + 'RegistrarScriptFile': 'sdfsfd', + 'ReplacementsFile': 'sdffsd', + 'SuppressStartupBanner': 'false', + 'TypeLibraryFile': 'sfsd', + 'UpdateFileHashes': 'true', + 'UpdateFileHashesSearchPath': 'sfsd', + 'UseFAT32Workaround': 'true', + 'UseUnicodeResponseFiles': 'false', + 'VerboseOutput': 'true'}} + expected_msbuild_settings = { + 'ClCompile': { + 'AdditionalIncludeDirectories': 'dir1', + 'AdditionalOptions': '/more /J', + 'AdditionalUsingDirectories': 'test', + 'AssemblerListingLocation': '$(IntDir)a', + 'AssemblerOutput': 'AssemblyCode', + 'BasicRuntimeChecks': 'EnableFastChecks', + 'BrowseInformation': 'true', + 'BrowseInformationFile': '$(IntDir)e', + 'BufferSecurityCheck': 'false', + 'CallingConvention': 'FastCall', + 'CompileAs': 'CompileAsC', + 'DebugInformationFormat': 'EditAndContinue', + 'DisableLanguageExtensions': 'true', + 'DisableSpecificWarnings': 'abc', + 'EnableEnhancedInstructionSet': 'StreamingSIMDExtensions', + 'EnableFiberSafeOptimizations': 'true', + 'EnablePREfast': 'true', + 'ErrorReporting': 'Queue', + 'ExceptionHandling': 'Async', + 'ExpandAttributedSource': 'true', + 'FavorSizeOrSpeed': 'Size', + 'FloatingPointExceptions': 'true', + 'FloatingPointModel': 'Strict', + 'ForceConformanceInForLoopScope': 'false', + 'ForcedIncludeFiles': 'def', + 'ForcedUsingFiles': 'ge', + 'FunctionLevelLinking': 'true', + 'GenerateXMLDocumentationFiles': 'true', + 'IgnoreStandardIncludePath': 'true', + 'InlineFunctionExpansion': 'OnlyExplicitInline', + 'IntrinsicFunctions': 'true', + 'MinimalRebuild': 'true', + 'ObjectFileName': '$(IntDir)b', + 'OmitDefaultLibName': 'true', + 'OmitFramePointers': 'true', + 'OpenMPSupport': 'true', + 'Optimization': 'Full', + 'PrecompiledHeader': 'NotUsing', # Actual conversion gives '' + 'PrecompiledHeaderFile': 'StdAfx.hd', + 'PrecompiledHeaderOutputFile': '$(IntDir)$(TargetName).pche', + 'PreprocessKeepComments': 'true', + 'PreprocessorDefinitions': 'WIN32;_DEBUG;_CONSOLE', + 'PreprocessSuppressLineNumbers': 'true', + 'PreprocessToFile': 'true', + 'ProgramDataBaseFileName': '$(IntDir)vc90b.pdb', + 'RuntimeLibrary': 'MultiThreadedDebugDLL', + 'RuntimeTypeInfo': 'false', + 'ShowIncludes': 'true', + 'SmallerTypeCheck': 'true', + 'StringPooling': 'true', + 'StructMemberAlignment': '4Bytes', + 'SuppressStartupBanner': 'false', + 'TreatWarningAsError': 'true', + 'TreatWChar_tAsBuiltInType': 'false', + 'UndefineAllPreprocessorDefinitions': 'true', + 'UndefinePreprocessorDefinitions': 'wer', + 'UseFullPaths': 'true', + 'WarningLevel': 'Level3', + 'WholeProgramOptimization': 'true', + 'XMLDocumentationFileName': '$(IntDir)c'}, + 'Link': { + 'AdditionalDependencies': 'zx', + 'AdditionalLibraryDirectories': 'asd', + 'AdditionalManifestDependencies': 's2', + 'AdditionalOptions': '/mor2', + 'AddModuleNamesToAssembly': 'd1', + 'AllowIsolation': 'false', + 'AssemblyDebug': 'true', + 'AssemblyLinkResource': 'd5', + 'BaseAddress': '23423', + 'CLRImageType': 'ForceSafeILImage', + 'CLRThreadAttribute': 'MTAThreadingAttribute', + 'CLRUnmanagedCodeCheck': 'true', + 'DataExecutionPrevention': '', + 'DelayLoadDLLs': 'd4', + 'DelaySign': 'true', + 'Driver': 'UpOnly', + 'EmbedManagedResourceFile': 'd2', + 'EnableCOMDATFolding': 'false', + 'EnableUAC': 'false', + 'EntryPointSymbol': 'f5', + 'FixedBaseAddress': 'false', + 'ForceSymbolReferences': 'd3', + 'FunctionOrder': 'fssdfsd', + 'GenerateDebugInformation': 'true', + 'GenerateMapFile': 'true', + 'HeapCommitSize': '13', + 'HeapReserveSize': '12', + 'IgnoreAllDefaultLibraries': 'true', + 'IgnoreEmbeddedIDL': 'true', + 'IgnoreSpecificDefaultLibraries': 'flob;flok', + 'ImportLibrary': 'f4', + 'KeyContainer': 'f7', + 'KeyFile': 'f6', + 'LargeAddressAware': 'true', + 'LinkErrorReporting': 'QueueForNextLogin', + 'LinkTimeCodeGeneration': 'UseLinkTimeCodeGeneration', + 'ManifestFile': '$(IntDir)$(TargetFileName).2intermediate.manifest', + 'MapExports': 'true', + 'MapFileName': 'd5', + 'MergedIDLBaseFileName': 'f2', + 'MergeSections': 'f5', + 'MidlCommandFile': 'f1', + 'ModuleDefinitionFile': 'sdsd', + 'NoEntryPoint': 'true', + 'OptimizeReferences': 'true', + 'OutputFile': '$(OutDir)$(ProjectName)2.exe', + 'PerUserRedirection': 'true', + 'Profile': 'true', + 'ProfileGuidedDatabase': '$(TargetDir)$(TargetName).pgdd', + 'ProgramDatabaseFile': 'Flob.pdb', + 'RandomizedBaseAddress': 'false', + 'RegisterOutput': 'true', + 'SetChecksum': 'false', + 'ShowProgress': 'LinkVerbose', + 'StackCommitSize': '15', + 'StackReserveSize': '14', + 'StripPrivateSymbols': 'd3', + 'SubSystem': 'Console', + 'SupportUnloadOfDelayLoadedDLL': 'true', + 'SuppressStartupBanner': 'false', + 'SwapRunFromCD': 'true', + 'SwapRunFromNET': 'true', + 'TargetMachine': 'MachineX86', + 'TerminalServerAware': 'false', + 'TurnOffAssemblyGeneration': 'true', + 'TypeLibraryFile': 'f3', + 'TypeLibraryResourceID': '12', + 'UACExecutionLevel': 'RequireAdministrator', + 'UACUIAccess': 'true', + 'Version': '333'}, + 'ResourceCompile': { + 'AdditionalIncludeDirectories': 'f3', + 'AdditionalOptions': '/more3', + 'Culture': '0x0c0c', + 'IgnoreStandardIncludePath': 'true', + 'PreprocessorDefinitions': '_UNICODE;UNICODE2', + 'ResourceOutputFileName': '$(IntDir)%(Filename)3.res', + 'ShowProgress': 'true'}, + 'Manifest': { + 'AdditionalManifestFiles': 'sfsdfsd', + 'AdditionalOptions': 'afdsdafsd', + 'AssemblyIdentity': 'sddfdsadfsa', + 'ComponentFileName': 'fsdfds', + 'GenerateCatalogFiles': 'true', + 'InputResourceManifests': 'asfsfdafs', + 'OutputManifestFile': '$(TargetPath).manifestdfs', + 'RegistrarScriptFile': 'sdfsfd', + 'ReplacementsFile': 'sdffsd', + 'SuppressStartupBanner': 'false', + 'TypeLibraryFile': 'sfsd', + 'UpdateFileHashes': 'true', + 'UpdateFileHashesSearchPath': 'sfsd', + 'VerboseOutput': 'true'}, + 'ProjectReference': { + 'LinkLibraryDependencies': 'false', + 'UseLibraryDependencyInputs': 'true'}, + '': { + 'EmbedManifest': 'false', + 'GenerateManifest': 'false', + 'IgnoreImportLibrary': 'true', + 'LinkIncremental': '' + }, + 'ManifestResourceCompile': { + 'ResourceOutputFileName': + '$(IntDir)$(TargetFileName).embed.manifest.resfdsf'} + } + actual_msbuild_settings = MSVSSettings.ConvertToMSBuildSettings( + msvs_settings, + self.stderr) + self.assertEqual(expected_msbuild_settings, actual_msbuild_settings) + self._ExpectedWarnings([]) + + +if __name__ == '__main__': + unittest.main() diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py new file mode 100644 index 00000000..74e529a1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py @@ -0,0 +1,58 @@ +# Copyright (c) 2012 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Visual Studio project reader/writer.""" + +import gyp.common +import gyp.easy_xml as easy_xml + + +class Writer(object): + """Visual Studio XML tool file writer.""" + + def __init__(self, tool_file_path, name): + """Initializes the tool file. + + Args: + tool_file_path: Path to the tool file. + name: Name of the tool file. + """ + self.tool_file_path = tool_file_path + self.name = name + self.rules_section = ['Rules'] + + def AddCustomBuildRule(self, name, cmd, description, + additional_dependencies, + outputs, extensions): + """Adds a rule to the tool file. + + Args: + name: Name of the rule. + description: Description of the rule. + cmd: Command line of the rule. + additional_dependencies: other files which may trigger the rule. + outputs: outputs of the rule. + extensions: extensions handled by the rule. + """ + rule = ['CustomBuildRule', + {'Name': name, + 'ExecutionDescription': description, + 'CommandLine': cmd, + 'Outputs': ';'.join(outputs), + 'FileExtensions': ';'.join(extensions), + 'AdditionalDependencies': + ';'.join(additional_dependencies) + }] + self.rules_section.append(rule) + + def WriteIfChanged(self): + """Writes the tool file.""" + content = ['VisualStudioToolFile', + {'Version': '8.00', + 'Name': self.name + }, + self.rules_section + ] + easy_xml.WriteXmlIfChanged(content, self.tool_file_path, + encoding="Windows-1252") diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.pyc b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.pyc new file mode 100644 index 00000000..08cc38b0 Binary files /dev/null and b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.pyc differ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py new file mode 100644 index 00000000..6c07e9a8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py @@ -0,0 +1,147 @@ +# Copyright (c) 2012 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Visual Studio user preferences file writer.""" + +import os +import re +import socket # for gethostname + +import gyp.common +import gyp.easy_xml as easy_xml + + +#------------------------------------------------------------------------------ + +def _FindCommandInPath(command): + """If there are no slashes in the command given, this function + searches the PATH env to find the given command, and converts it + to an absolute path. We have to do this because MSVS is looking + for an actual file to launch a debugger on, not just a command + line. Note that this happens at GYP time, so anything needing to + be built needs to have a full path.""" + if '/' in command or '\\' in command: + # If the command already has path elements (either relative or + # absolute), then assume it is constructed properly. + return command + else: + # Search through the path list and find an existing file that + # we can access. + paths = os.environ.get('PATH','').split(os.pathsep) + for path in paths: + item = os.path.join(path, command) + if os.path.isfile(item) and os.access(item, os.X_OK): + return item + return command + +def _QuoteWin32CommandLineArgs(args): + new_args = [] + for arg in args: + # Replace all double-quotes with double-double-quotes to escape + # them for cmd shell, and then quote the whole thing if there + # are any. + if arg.find('"') != -1: + arg = '""'.join(arg.split('"')) + arg = '"%s"' % arg + + # Otherwise, if there are any spaces, quote the whole arg. + elif re.search(r'[ \t\n]', arg): + arg = '"%s"' % arg + new_args.append(arg) + return new_args + +class Writer(object): + """Visual Studio XML user user file writer.""" + + def __init__(self, user_file_path, version, name): + """Initializes the user file. + + Args: + user_file_path: Path to the user file. + version: Version info. + name: Name of the user file. + """ + self.user_file_path = user_file_path + self.version = version + self.name = name + self.configurations = {} + + def AddConfig(self, name): + """Adds a configuration to the project. + + Args: + name: Configuration name. + """ + self.configurations[name] = ['Configuration', {'Name': name}] + + def AddDebugSettings(self, config_name, command, environment = {}, + working_directory=""): + """Adds a DebugSettings node to the user file for a particular config. + + Args: + command: command line to run. First element in the list is the + executable. All elements of the command will be quoted if + necessary. + working_directory: other files which may trigger the rule. (optional) + """ + command = _QuoteWin32CommandLineArgs(command) + + abs_command = _FindCommandInPath(command[0]) + + if environment and isinstance(environment, dict): + env_list = ['%s="%s"' % (key, val) + for (key,val) in environment.iteritems()] + environment = ' '.join(env_list) + else: + environment = '' + + n_cmd = ['DebugSettings', + {'Command': abs_command, + 'WorkingDirectory': working_directory, + 'CommandArguments': " ".join(command[1:]), + 'RemoteMachine': socket.gethostname(), + 'Environment': environment, + 'EnvironmentMerge': 'true', + # Currently these are all "dummy" values that we're just setting + # in the default manner that MSVS does it. We could use some of + # these to add additional capabilities, I suppose, but they might + # not have parity with other platforms then. + 'Attach': 'false', + 'DebuggerType': '3', # 'auto' debugger + 'Remote': '1', + 'RemoteCommand': '', + 'HttpUrl': '', + 'PDBPath': '', + 'SQLDebugging': '', + 'DebuggerFlavor': '0', + 'MPIRunCommand': '', + 'MPIRunArguments': '', + 'MPIRunWorkingDirectory': '', + 'ApplicationCommand': '', + 'ApplicationArguments': '', + 'ShimCommand': '', + 'MPIAcceptMode': '', + 'MPIAcceptFilter': '' + }] + + # Find the config, and add it if it doesn't exist. + if config_name not in self.configurations: + self.AddConfig(config_name) + + # Add the DebugSettings onto the appropriate config. + self.configurations[config_name].append(n_cmd) + + def WriteIfChanged(self): + """Writes the user file.""" + configs = ['Configurations'] + for config, spec in sorted(self.configurations.iteritems()): + configs.append(spec) + + content = ['VisualStudioUserFile', + {'Version': self.version.ProjectVersion(), + 'Name': self.name + }, + configs] + easy_xml.WriteXmlIfChanged(content, self.user_file_path, + encoding="Windows-1252") diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.pyc b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.pyc new file mode 100644 index 00000000..10703d17 Binary files /dev/null and b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.pyc differ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py new file mode 100644 index 00000000..0b32e911 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py @@ -0,0 +1,270 @@ +# Copyright (c) 2013 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Utility functions shared amongst the Windows generators.""" + +import copy +import os + + +# A dictionary mapping supported target types to extensions. +TARGET_TYPE_EXT = { + 'executable': 'exe', + 'loadable_module': 'dll', + 'shared_library': 'dll', + 'static_library': 'lib', +} + + +def _GetLargePdbShimCcPath(): + """Returns the path of the large_pdb_shim.cc file.""" + this_dir = os.path.abspath(os.path.dirname(__file__)) + src_dir = os.path.abspath(os.path.join(this_dir, '..', '..')) + win_data_dir = os.path.join(src_dir, 'data', 'win') + large_pdb_shim_cc = os.path.join(win_data_dir, 'large-pdb-shim.cc') + return large_pdb_shim_cc + + +def _DeepCopySomeKeys(in_dict, keys): + """Performs a partial deep-copy on |in_dict|, only copying the keys in |keys|. + + Arguments: + in_dict: The dictionary to copy. + keys: The keys to be copied. If a key is in this list and doesn't exist in + |in_dict| this is not an error. + Returns: + The partially deep-copied dictionary. + """ + d = {} + for key in keys: + if key not in in_dict: + continue + d[key] = copy.deepcopy(in_dict[key]) + return d + + +def _SuffixName(name, suffix): + """Add a suffix to the end of a target. + + Arguments: + name: name of the target (foo#target) + suffix: the suffix to be added + Returns: + Target name with suffix added (foo_suffix#target) + """ + parts = name.rsplit('#', 1) + parts[0] = '%s_%s' % (parts[0], suffix) + return '#'.join(parts) + + +def _ShardName(name, number): + """Add a shard number to the end of a target. + + Arguments: + name: name of the target (foo#target) + number: shard number + Returns: + Target name with shard added (foo_1#target) + """ + return _SuffixName(name, str(number)) + + +def ShardTargets(target_list, target_dicts): + """Shard some targets apart to work around the linkers limits. + + Arguments: + target_list: List of target pairs: 'base/base.gyp:base'. + target_dicts: Dict of target properties keyed on target pair. + Returns: + Tuple of the new sharded versions of the inputs. + """ + # Gather the targets to shard, and how many pieces. + targets_to_shard = {} + for t in target_dicts: + shards = int(target_dicts[t].get('msvs_shard', 0)) + if shards: + targets_to_shard[t] = shards + # Shard target_list. + new_target_list = [] + for t in target_list: + if t in targets_to_shard: + for i in range(targets_to_shard[t]): + new_target_list.append(_ShardName(t, i)) + else: + new_target_list.append(t) + # Shard target_dict. + new_target_dicts = {} + for t in target_dicts: + if t in targets_to_shard: + for i in range(targets_to_shard[t]): + name = _ShardName(t, i) + new_target_dicts[name] = copy.copy(target_dicts[t]) + new_target_dicts[name]['target_name'] = _ShardName( + new_target_dicts[name]['target_name'], i) + sources = new_target_dicts[name].get('sources', []) + new_sources = [] + for pos in range(i, len(sources), targets_to_shard[t]): + new_sources.append(sources[pos]) + new_target_dicts[name]['sources'] = new_sources + else: + new_target_dicts[t] = target_dicts[t] + # Shard dependencies. + for t in new_target_dicts: + for deptype in ('dependencies', 'dependencies_original'): + dependencies = copy.copy(new_target_dicts[t].get(deptype, [])) + new_dependencies = [] + for d in dependencies: + if d in targets_to_shard: + for i in range(targets_to_shard[d]): + new_dependencies.append(_ShardName(d, i)) + else: + new_dependencies.append(d) + new_target_dicts[t][deptype] = new_dependencies + + return (new_target_list, new_target_dicts) + + +def _GetPdbPath(target_dict, config_name, vars): + """Returns the path to the PDB file that will be generated by a given + configuration. + + The lookup proceeds as follows: + - Look for an explicit path in the VCLinkerTool configuration block. + - Look for an 'msvs_large_pdb_path' variable. + - Use '<(PRODUCT_DIR)/<(product_name).(exe|dll).pdb' if 'product_name' is + specified. + - Use '<(PRODUCT_DIR)/<(target_name).(exe|dll).pdb'. + + Arguments: + target_dict: The target dictionary to be searched. + config_name: The name of the configuration of interest. + vars: A dictionary of common GYP variables with generator-specific values. + Returns: + The path of the corresponding PDB file. + """ + config = target_dict['configurations'][config_name] + msvs = config.setdefault('msvs_settings', {}) + + linker = msvs.get('VCLinkerTool', {}) + + pdb_path = linker.get('ProgramDatabaseFile') + if pdb_path: + return pdb_path + + variables = target_dict.get('variables', {}) + pdb_path = variables.get('msvs_large_pdb_path', None) + if pdb_path: + return pdb_path + + + pdb_base = target_dict.get('product_name', target_dict['target_name']) + pdb_base = '%s.%s.pdb' % (pdb_base, TARGET_TYPE_EXT[target_dict['type']]) + pdb_path = vars['PRODUCT_DIR'] + '/' + pdb_base + + return pdb_path + + +def InsertLargePdbShims(target_list, target_dicts, vars): + """Insert a shim target that forces the linker to use 4KB pagesize PDBs. + + This is a workaround for targets with PDBs greater than 1GB in size, the + limit for the 1KB pagesize PDBs created by the linker by default. + + Arguments: + target_list: List of target pairs: 'base/base.gyp:base'. + target_dicts: Dict of target properties keyed on target pair. + vars: A dictionary of common GYP variables with generator-specific values. + Returns: + Tuple of the shimmed version of the inputs. + """ + # Determine which targets need shimming. + targets_to_shim = [] + for t in target_dicts: + target_dict = target_dicts[t] + + # We only want to shim targets that have msvs_large_pdb enabled. + if not int(target_dict.get('msvs_large_pdb', 0)): + continue + # This is intended for executable, shared_library and loadable_module + # targets where every configuration is set up to produce a PDB output. + # If any of these conditions is not true then the shim logic will fail + # below. + targets_to_shim.append(t) + + large_pdb_shim_cc = _GetLargePdbShimCcPath() + + for t in targets_to_shim: + target_dict = target_dicts[t] + target_name = target_dict.get('target_name') + + base_dict = _DeepCopySomeKeys(target_dict, + ['configurations', 'default_configuration', 'toolset']) + + # This is the dict for copying the source file (part of the GYP tree) + # to the intermediate directory of the project. This is necessary because + # we can't always build a relative path to the shim source file (on Windows + # GYP and the project may be on different drives), and Ninja hates absolute + # paths (it ends up generating the .obj and .obj.d alongside the source + # file, polluting GYPs tree). + copy_suffix = 'large_pdb_copy' + copy_target_name = target_name + '_' + copy_suffix + full_copy_target_name = _SuffixName(t, copy_suffix) + shim_cc_basename = os.path.basename(large_pdb_shim_cc) + shim_cc_dir = vars['SHARED_INTERMEDIATE_DIR'] + '/' + copy_target_name + shim_cc_path = shim_cc_dir + '/' + shim_cc_basename + copy_dict = copy.deepcopy(base_dict) + copy_dict['target_name'] = copy_target_name + copy_dict['type'] = 'none' + copy_dict['sources'] = [ large_pdb_shim_cc ] + copy_dict['copies'] = [{ + 'destination': shim_cc_dir, + 'files': [ large_pdb_shim_cc ] + }] + + # This is the dict for the PDB generating shim target. It depends on the + # copy target. + shim_suffix = 'large_pdb_shim' + shim_target_name = target_name + '_' + shim_suffix + full_shim_target_name = _SuffixName(t, shim_suffix) + shim_dict = copy.deepcopy(base_dict) + shim_dict['target_name'] = shim_target_name + shim_dict['type'] = 'static_library' + shim_dict['sources'] = [ shim_cc_path ] + shim_dict['dependencies'] = [ full_copy_target_name ] + + # Set up the shim to output its PDB to the same location as the final linker + # target. + for config_name, config in shim_dict.get('configurations').iteritems(): + pdb_path = _GetPdbPath(target_dict, config_name, vars) + + # A few keys that we don't want to propagate. + for key in ['msvs_precompiled_header', 'msvs_precompiled_source', 'test']: + config.pop(key, None) + + msvs = config.setdefault('msvs_settings', {}) + + # Update the compiler directives in the shim target. + compiler = msvs.setdefault('VCCLCompilerTool', {}) + compiler['DebugInformationFormat'] = '3' + compiler['ProgramDataBaseFileName'] = pdb_path + + # Set the explicit PDB path in the appropriate configuration of the + # original target. + config = target_dict['configurations'][config_name] + msvs = config.setdefault('msvs_settings', {}) + linker = msvs.setdefault('VCLinkerTool', {}) + linker['GenerateDebugInformation'] = 'true' + linker['ProgramDatabaseFile'] = pdb_path + + # Add the new targets. They must go to the beginning of the list so that + # the dependency generation works as expected in ninja. + target_list.insert(0, full_copy_target_name) + target_list.insert(0, full_shim_target_name) + target_dicts[full_copy_target_name] = copy_dict + target_dicts[full_shim_target_name] = shim_dict + + # Update the original target to depend on the shim target. + target_dict.setdefault('dependencies', []).append(full_shim_target_name) + + return (target_list, target_dicts) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.pyc b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.pyc new file mode 100644 index 00000000..92679511 Binary files /dev/null and b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.pyc differ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py new file mode 100644 index 00000000..d9bfa684 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py @@ -0,0 +1,443 @@ +# Copyright (c) 2013 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Handle version information related to Visual Stuio.""" + +import errno +import os +import re +import subprocess +import sys +import gyp +import glob + + +class VisualStudioVersion(object): + """Information regarding a version of Visual Studio.""" + + def __init__(self, short_name, description, + solution_version, project_version, flat_sln, uses_vcxproj, + path, sdk_based, default_toolset=None): + self.short_name = short_name + self.description = description + self.solution_version = solution_version + self.project_version = project_version + self.flat_sln = flat_sln + self.uses_vcxproj = uses_vcxproj + self.path = path + self.sdk_based = sdk_based + self.default_toolset = default_toolset + + def ShortName(self): + return self.short_name + + def Description(self): + """Get the full description of the version.""" + return self.description + + def SolutionVersion(self): + """Get the version number of the sln files.""" + return self.solution_version + + def ProjectVersion(self): + """Get the version number of the vcproj or vcxproj files.""" + return self.project_version + + def FlatSolution(self): + return self.flat_sln + + def UsesVcxproj(self): + """Returns true if this version uses a vcxproj file.""" + return self.uses_vcxproj + + def ProjectExtension(self): + """Returns the file extension for the project.""" + return self.uses_vcxproj and '.vcxproj' or '.vcproj' + + def Path(self): + """Returns the path to Visual Studio installation.""" + return self.path + + def ToolPath(self, tool): + """Returns the path to a given compiler tool. """ + return os.path.normpath(os.path.join(self.path, "VC/bin", tool)) + + def DefaultToolset(self): + """Returns the msbuild toolset version that will be used in the absence + of a user override.""" + return self.default_toolset + + def SetupScript(self, target_arch): + """Returns a command (with arguments) to be used to set up the + environment.""" + # Check if we are running in the SDK command line environment and use + # the setup script from the SDK if so. |target_arch| should be either + # 'x86' or 'x64'. + assert target_arch in ('x86', 'x64') + sdk_dir = os.environ.get('WindowsSDKDir') + if self.sdk_based and sdk_dir: + return [os.path.normpath(os.path.join(sdk_dir, 'Bin/SetEnv.Cmd')), + '/' + target_arch] + else: + # We don't use VC/vcvarsall.bat for x86 because vcvarsall calls + # vcvars32, which it can only find if VS??COMNTOOLS is set, which it + # isn't always. + if target_arch == 'x86': + if self.short_name >= '2013' and self.short_name[-1] != 'e' and ( + os.environ.get('PROCESSOR_ARCHITECTURE') == 'AMD64' or + os.environ.get('PROCESSOR_ARCHITEW6432') == 'AMD64'): + # VS2013 and later, non-Express have a x64-x86 cross that we want + # to prefer. + return [os.path.normpath( + os.path.join(self.path, 'VC/vcvarsall.bat')), 'amd64_x86'] + # Otherwise, the standard x86 compiler. + return [os.path.normpath( + os.path.join(self.path, 'Common7/Tools/vsvars32.bat'))] + else: + assert target_arch == 'x64' + arg = 'x86_amd64' + # Use the 64-on-64 compiler if we're not using an express + # edition and we're running on a 64bit OS. + if self.short_name[-1] != 'e' and ( + os.environ.get('PROCESSOR_ARCHITECTURE') == 'AMD64' or + os.environ.get('PROCESSOR_ARCHITEW6432') == 'AMD64'): + arg = 'amd64' + return [os.path.normpath( + os.path.join(self.path, 'VC/vcvarsall.bat')), arg] + + +def _RegistryQueryBase(sysdir, key, value): + """Use reg.exe to read a particular key. + + While ideally we might use the win32 module, we would like gyp to be + python neutral, so for instance cygwin python lacks this module. + + Arguments: + sysdir: The system subdirectory to attempt to launch reg.exe from. + key: The registry key to read from. + value: The particular value to read. + Return: + stdout from reg.exe, or None for failure. + """ + # Skip if not on Windows or Python Win32 setup issue + if sys.platform not in ('win32', 'cygwin'): + return None + # Setup params to pass to and attempt to launch reg.exe + cmd = [os.path.join(os.environ.get('WINDIR', ''), sysdir, 'reg.exe'), + 'query', key] + if value: + cmd.extend(['/v', value]) + p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + # Obtain the stdout from reg.exe, reading to the end so p.returncode is valid + # Note that the error text may be in [1] in some cases + text = p.communicate()[0] + # Check return code from reg.exe; officially 0==success and 1==error + if p.returncode: + return None + return text + + +def _RegistryQuery(key, value=None): + r"""Use reg.exe to read a particular key through _RegistryQueryBase. + + First tries to launch from %WinDir%\Sysnative to avoid WoW64 redirection. If + that fails, it falls back to System32. Sysnative is available on Vista and + up and available on Windows Server 2003 and XP through KB patch 942589. Note + that Sysnative will always fail if using 64-bit python due to it being a + virtual directory and System32 will work correctly in the first place. + + KB 942589 - http://support.microsoft.com/kb/942589/en-us. + + Arguments: + key: The registry key. + value: The particular registry value to read (optional). + Return: + stdout from reg.exe, or None for failure. + """ + text = None + try: + text = _RegistryQueryBase('Sysnative', key, value) + except OSError, e: + if e.errno == errno.ENOENT: + text = _RegistryQueryBase('System32', key, value) + else: + raise + return text + + +def _RegistryGetValueUsingWinReg(key, value): + """Use the _winreg module to obtain the value of a registry key. + + Args: + key: The registry key. + value: The particular registry value to read. + Return: + contents of the registry key's value, or None on failure. Throws + ImportError if _winreg is unavailable. + """ + import _winreg + try: + root, subkey = key.split('\\', 1) + assert root == 'HKLM' # Only need HKLM for now. + with _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, subkey) as hkey: + return _winreg.QueryValueEx(hkey, value)[0] + except WindowsError: + return None + + +def _RegistryGetValue(key, value): + """Use _winreg or reg.exe to obtain the value of a registry key. + + Using _winreg is preferable because it solves an issue on some corporate + environments where access to reg.exe is locked down. However, we still need + to fallback to reg.exe for the case where the _winreg module is not available + (for example in cygwin python). + + Args: + key: The registry key. + value: The particular registry value to read. + Return: + contents of the registry key's value, or None on failure. + """ + try: + return _RegistryGetValueUsingWinReg(key, value) + except ImportError: + pass + + # Fallback to reg.exe if we fail to import _winreg. + text = _RegistryQuery(key, value) + if not text: + return None + # Extract value. + match = re.search(r'REG_\w+\s+([^\r]+)\r\n', text) + if not match: + return None + return match.group(1) + + +def _CreateVersion(name, path, sdk_based=False): + """Sets up MSVS project generation. + + Setup is based off the GYP_MSVS_VERSION environment variable or whatever is + autodetected if GYP_MSVS_VERSION is not explicitly specified. If a version is + passed in that doesn't match a value in versions python will throw a error. + """ + if path: + path = os.path.normpath(path) + versions = { + '2015': VisualStudioVersion('2015', + 'Visual Studio 2015', + solution_version='12.00', + project_version='14.0', + flat_sln=False, + uses_vcxproj=True, + path=path, + sdk_based=sdk_based, + default_toolset='v140'), + '2013': VisualStudioVersion('2013', + 'Visual Studio 2013', + solution_version='13.00', + project_version='12.0', + flat_sln=False, + uses_vcxproj=True, + path=path, + sdk_based=sdk_based, + default_toolset='v120'), + '2013e': VisualStudioVersion('2013e', + 'Visual Studio 2013', + solution_version='13.00', + project_version='12.0', + flat_sln=True, + uses_vcxproj=True, + path=path, + sdk_based=sdk_based, + default_toolset='v120'), + '2012': VisualStudioVersion('2012', + 'Visual Studio 2012', + solution_version='12.00', + project_version='4.0', + flat_sln=False, + uses_vcxproj=True, + path=path, + sdk_based=sdk_based, + default_toolset='v110'), + '2012e': VisualStudioVersion('2012e', + 'Visual Studio 2012', + solution_version='12.00', + project_version='4.0', + flat_sln=True, + uses_vcxproj=True, + path=path, + sdk_based=sdk_based, + default_toolset='v110'), + '2010': VisualStudioVersion('2010', + 'Visual Studio 2010', + solution_version='11.00', + project_version='4.0', + flat_sln=False, + uses_vcxproj=True, + path=path, + sdk_based=sdk_based), + '2010e': VisualStudioVersion('2010e', + 'Visual C++ Express 2010', + solution_version='11.00', + project_version='4.0', + flat_sln=True, + uses_vcxproj=True, + path=path, + sdk_based=sdk_based), + '2008': VisualStudioVersion('2008', + 'Visual Studio 2008', + solution_version='10.00', + project_version='9.00', + flat_sln=False, + uses_vcxproj=False, + path=path, + sdk_based=sdk_based), + '2008e': VisualStudioVersion('2008e', + 'Visual Studio 2008', + solution_version='10.00', + project_version='9.00', + flat_sln=True, + uses_vcxproj=False, + path=path, + sdk_based=sdk_based), + '2005': VisualStudioVersion('2005', + 'Visual Studio 2005', + solution_version='9.00', + project_version='8.00', + flat_sln=False, + uses_vcxproj=False, + path=path, + sdk_based=sdk_based), + '2005e': VisualStudioVersion('2005e', + 'Visual Studio 2005', + solution_version='9.00', + project_version='8.00', + flat_sln=True, + uses_vcxproj=False, + path=path, + sdk_based=sdk_based), + } + return versions[str(name)] + + +def _ConvertToCygpath(path): + """Convert to cygwin path if we are using cygwin.""" + if sys.platform == 'cygwin': + p = subprocess.Popen(['cygpath', path], stdout=subprocess.PIPE) + path = p.communicate()[0].strip() + return path + + +def _DetectVisualStudioVersions(versions_to_check, force_express): + """Collect the list of installed visual studio versions. + + Returns: + A list of visual studio versions installed in descending order of + usage preference. + Base this on the registry and a quick check if devenv.exe exists. + Only versions 8-10 are considered. + Possibilities are: + 2005(e) - Visual Studio 2005 (8) + 2008(e) - Visual Studio 2008 (9) + 2010(e) - Visual Studio 2010 (10) + 2012(e) - Visual Studio 2012 (11) + 2013(e) - Visual Studio 2013 (12) + 2015 - Visual Studio 2015 (14) + Where (e) is e for express editions of MSVS and blank otherwise. + """ + version_to_year = { + '8.0': '2005', + '9.0': '2008', + '10.0': '2010', + '11.0': '2012', + '12.0': '2013', + '14.0': '2015', + } + versions = [] + for version in versions_to_check: + # Old method of searching for which VS version is installed + # We don't use the 2010-encouraged-way because we also want to get the + # path to the binaries, which it doesn't offer. + keys = [r'HKLM\Software\Microsoft\VisualStudio\%s' % version, + r'HKLM\Software\Wow6432Node\Microsoft\VisualStudio\%s' % version, + r'HKLM\Software\Microsoft\VCExpress\%s' % version, + r'HKLM\Software\Wow6432Node\Microsoft\VCExpress\%s' % version] + for index in range(len(keys)): + path = _RegistryGetValue(keys[index], 'InstallDir') + if not path: + continue + path = _ConvertToCygpath(path) + # Check for full. + full_path = os.path.join(path, 'devenv.exe') + express_path = os.path.join(path, '*express.exe') + if not force_express and os.path.exists(full_path): + # Add this one. + versions.append(_CreateVersion(version_to_year[version], + os.path.join(path, '..', '..'))) + # Check for express. + elif glob.glob(express_path): + # Add this one. + versions.append(_CreateVersion(version_to_year[version] + 'e', + os.path.join(path, '..', '..'))) + + # The old method above does not work when only SDK is installed. + keys = [r'HKLM\Software\Microsoft\VisualStudio\SxS\VC7', + r'HKLM\Software\Wow6432Node\Microsoft\VisualStudio\SxS\VC7'] + for index in range(len(keys)): + path = _RegistryGetValue(keys[index], version) + if not path: + continue + path = _ConvertToCygpath(path) + if version != '14.0': # There is no Express edition for 2015. + versions.append(_CreateVersion(version_to_year[version] + 'e', + os.path.join(path, '..'), sdk_based=True)) + + return versions + + +def SelectVisualStudioVersion(version='auto', allow_fallback=True): + """Select which version of Visual Studio projects to generate. + + Arguments: + version: Hook to allow caller to force a particular version (vs auto). + Returns: + An object representing a visual studio project format version. + """ + # In auto mode, check environment variable for override. + if version == 'auto': + version = os.environ.get('GYP_MSVS_VERSION', 'auto') + version_map = { + 'auto': ('14.0', '12.0', '10.0', '9.0', '8.0', '11.0'), + '2005': ('8.0',), + '2005e': ('8.0',), + '2008': ('9.0',), + '2008e': ('9.0',), + '2010': ('10.0',), + '2010e': ('10.0',), + '2012': ('11.0',), + '2012e': ('11.0',), + '2013': ('12.0',), + '2013e': ('12.0',), + '2015': ('14.0',), + } + override_path = os.environ.get('GYP_MSVS_OVERRIDE_PATH') + if override_path: + msvs_version = os.environ.get('GYP_MSVS_VERSION') + if not msvs_version: + raise ValueError('GYP_MSVS_OVERRIDE_PATH requires GYP_MSVS_VERSION to be ' + 'set to a particular version (e.g. 2010e).') + return _CreateVersion(msvs_version, override_path, sdk_based=True) + version = str(version) + versions = _DetectVisualStudioVersions(version_map[version], 'e' in version) + if not versions: + if not allow_fallback: + raise ValueError('Could not locate Visual Studio installation.') + if version == 'auto': + # Default to 2005 if we couldn't find anything + return _CreateVersion('2005', None) + else: + return _CreateVersion(version, None) + return versions[0] diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.pyc b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.pyc new file mode 100644 index 00000000..3083a8b4 Binary files /dev/null and b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.pyc differ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py new file mode 100644 index 00000000..668f38b6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py @@ -0,0 +1,548 @@ +#!/usr/bin/env python + +# Copyright (c) 2012 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import copy +import gyp.input +import optparse +import os.path +import re +import shlex +import sys +import traceback +from gyp.common import GypError + +# Default debug modes for GYP +debug = {} + +# List of "official" debug modes, but you can use anything you like. +DEBUG_GENERAL = 'general' +DEBUG_VARIABLES = 'variables' +DEBUG_INCLUDES = 'includes' + + +def DebugOutput(mode, message, *args): + if 'all' in gyp.debug or mode in gyp.debug: + ctx = ('unknown', 0, 'unknown') + try: + f = traceback.extract_stack(limit=2) + if f: + ctx = f[0][:3] + except: + pass + if args: + message %= args + print '%s:%s:%d:%s %s' % (mode.upper(), os.path.basename(ctx[0]), + ctx[1], ctx[2], message) + +def FindBuildFiles(): + extension = '.gyp' + files = os.listdir(os.getcwd()) + build_files = [] + for file in files: + if file.endswith(extension): + build_files.append(file) + return build_files + + +def Load(build_files, format, default_variables={}, + includes=[], depth='.', params=None, check=False, + circular_check=True, duplicate_basename_check=True): + """ + Loads one or more specified build files. + default_variables and includes will be copied before use. + Returns the generator for the specified format and the + data returned by loading the specified build files. + """ + if params is None: + params = {} + + if '-' in format: + format, params['flavor'] = format.split('-', 1) + + default_variables = copy.copy(default_variables) + + # Default variables provided by this program and its modules should be + # named WITH_CAPITAL_LETTERS to provide a distinct "best practice" namespace, + # avoiding collisions with user and automatic variables. + default_variables['GENERATOR'] = format + default_variables['GENERATOR_FLAVOR'] = params.get('flavor', '') + + # Format can be a custom python file, or by default the name of a module + # within gyp.generator. + if format.endswith('.py'): + generator_name = os.path.splitext(format)[0] + path, generator_name = os.path.split(generator_name) + + # Make sure the path to the custom generator is in sys.path + # Don't worry about removing it once we are done. Keeping the path + # to each generator that is used in sys.path is likely harmless and + # arguably a good idea. + path = os.path.abspath(path) + if path not in sys.path: + sys.path.insert(0, path) + else: + generator_name = 'gyp.generator.' + format + + # These parameters are passed in order (as opposed to by key) + # because ActivePython cannot handle key parameters to __import__. + generator = __import__(generator_name, globals(), locals(), generator_name) + for (key, val) in generator.generator_default_variables.items(): + default_variables.setdefault(key, val) + + # Give the generator the opportunity to set additional variables based on + # the params it will receive in the output phase. + if getattr(generator, 'CalculateVariables', None): + generator.CalculateVariables(default_variables, params) + + # Give the generator the opportunity to set generator_input_info based on + # the params it will receive in the output phase. + if getattr(generator, 'CalculateGeneratorInputInfo', None): + generator.CalculateGeneratorInputInfo(params) + + # Fetch the generator specific info that gets fed to input, we use getattr + # so we can default things and the generators only have to provide what + # they need. + generator_input_info = { + 'non_configuration_keys': + getattr(generator, 'generator_additional_non_configuration_keys', []), + 'path_sections': + getattr(generator, 'generator_additional_path_sections', []), + 'extra_sources_for_rules': + getattr(generator, 'generator_extra_sources_for_rules', []), + 'generator_supports_multiple_toolsets': + getattr(generator, 'generator_supports_multiple_toolsets', False), + 'generator_wants_static_library_dependencies_adjusted': + getattr(generator, + 'generator_wants_static_library_dependencies_adjusted', True), + 'generator_wants_sorted_dependencies': + getattr(generator, 'generator_wants_sorted_dependencies', False), + 'generator_filelist_paths': + getattr(generator, 'generator_filelist_paths', None), + } + + # Process the input specific to this generator. + result = gyp.input.Load(build_files, default_variables, includes[:], + depth, generator_input_info, check, circular_check, + duplicate_basename_check, + params['parallel'], params['root_targets']) + return [generator] + result + +def NameValueListToDict(name_value_list): + """ + Takes an array of strings of the form 'NAME=VALUE' and creates a dictionary + of the pairs. If a string is simply NAME, then the value in the dictionary + is set to True. If VALUE can be converted to an integer, it is. + """ + result = { } + for item in name_value_list: + tokens = item.split('=', 1) + if len(tokens) == 2: + # If we can make it an int, use that, otherwise, use the string. + try: + token_value = int(tokens[1]) + except ValueError: + token_value = tokens[1] + # Set the variable to the supplied value. + result[tokens[0]] = token_value + else: + # No value supplied, treat it as a boolean and set it. + result[tokens[0]] = True + return result + +def ShlexEnv(env_name): + flags = os.environ.get(env_name, []) + if flags: + flags = shlex.split(flags) + return flags + +def FormatOpt(opt, value): + if opt.startswith('--'): + return '%s=%s' % (opt, value) + return opt + value + +def RegenerateAppendFlag(flag, values, predicate, env_name, options): + """Regenerate a list of command line flags, for an option of action='append'. + + The |env_name|, if given, is checked in the environment and used to generate + an initial list of options, then the options that were specified on the + command line (given in |values|) are appended. This matches the handling of + environment variables and command line flags where command line flags override + the environment, while not requiring the environment to be set when the flags + are used again. + """ + flags = [] + if options.use_environment and env_name: + for flag_value in ShlexEnv(env_name): + value = FormatOpt(flag, predicate(flag_value)) + if value in flags: + flags.remove(value) + flags.append(value) + if values: + for flag_value in values: + flags.append(FormatOpt(flag, predicate(flag_value))) + return flags + +def RegenerateFlags(options): + """Given a parsed options object, and taking the environment variables into + account, returns a list of flags that should regenerate an equivalent options + object (even in the absence of the environment variables.) + + Any path options will be normalized relative to depth. + + The format flag is not included, as it is assumed the calling generator will + set that as appropriate. + """ + def FixPath(path): + path = gyp.common.FixIfRelativePath(path, options.depth) + if not path: + return os.path.curdir + return path + + def Noop(value): + return value + + # We always want to ignore the environment when regenerating, to avoid + # duplicate or changed flags in the environment at the time of regeneration. + flags = ['--ignore-environment'] + for name, metadata in options._regeneration_metadata.iteritems(): + opt = metadata['opt'] + value = getattr(options, name) + value_predicate = metadata['type'] == 'path' and FixPath or Noop + action = metadata['action'] + env_name = metadata['env_name'] + if action == 'append': + flags.extend(RegenerateAppendFlag(opt, value, value_predicate, + env_name, options)) + elif action in ('store', None): # None is a synonym for 'store'. + if value: + flags.append(FormatOpt(opt, value_predicate(value))) + elif options.use_environment and env_name and os.environ.get(env_name): + flags.append(FormatOpt(opt, value_predicate(os.environ.get(env_name)))) + elif action in ('store_true', 'store_false'): + if ((action == 'store_true' and value) or + (action == 'store_false' and not value)): + flags.append(opt) + elif options.use_environment and env_name: + print >>sys.stderr, ('Warning: environment regeneration unimplemented ' + 'for %s flag %r env_name %r' % (action, opt, + env_name)) + else: + print >>sys.stderr, ('Warning: regeneration unimplemented for action %r ' + 'flag %r' % (action, opt)) + + return flags + +class RegeneratableOptionParser(optparse.OptionParser): + def __init__(self): + self.__regeneratable_options = {} + optparse.OptionParser.__init__(self) + + def add_option(self, *args, **kw): + """Add an option to the parser. + + This accepts the same arguments as OptionParser.add_option, plus the + following: + regenerate: can be set to False to prevent this option from being included + in regeneration. + env_name: name of environment variable that additional values for this + option come from. + type: adds type='path', to tell the regenerator that the values of + this option need to be made relative to options.depth + """ + env_name = kw.pop('env_name', None) + if 'dest' in kw and kw.pop('regenerate', True): + dest = kw['dest'] + + # The path type is needed for regenerating, for optparse we can just treat + # it as a string. + type = kw.get('type') + if type == 'path': + kw['type'] = 'string' + + self.__regeneratable_options[dest] = { + 'action': kw.get('action'), + 'type': type, + 'env_name': env_name, + 'opt': args[0], + } + + optparse.OptionParser.add_option(self, *args, **kw) + + def parse_args(self, *args): + values, args = optparse.OptionParser.parse_args(self, *args) + values._regeneration_metadata = self.__regeneratable_options + return values, args + +def gyp_main(args): + my_name = os.path.basename(sys.argv[0]) + + parser = RegeneratableOptionParser() + usage = 'usage: %s [options ...] [build_file ...]' + parser.set_usage(usage.replace('%s', '%prog')) + parser.add_option('--build', dest='configs', action='append', + help='configuration for build after project generation') + parser.add_option('--check', dest='check', action='store_true', + help='check format of gyp files') + parser.add_option('--config-dir', dest='config_dir', action='store', + env_name='GYP_CONFIG_DIR', default=None, + help='The location for configuration files like ' + 'include.gypi.') + parser.add_option('-d', '--debug', dest='debug', metavar='DEBUGMODE', + action='append', default=[], help='turn on a debugging ' + 'mode for debugging GYP. Supported modes are "variables", ' + '"includes" and "general" or "all" for all of them.') + parser.add_option('-D', dest='defines', action='append', metavar='VAR=VAL', + env_name='GYP_DEFINES', + help='sets variable VAR to value VAL') + parser.add_option('--depth', dest='depth', metavar='PATH', type='path', + help='set DEPTH gyp variable to a relative path to PATH') + parser.add_option('-f', '--format', dest='formats', action='append', + env_name='GYP_GENERATORS', regenerate=False, + help='output formats to generate') + parser.add_option('-G', dest='generator_flags', action='append', default=[], + metavar='FLAG=VAL', env_name='GYP_GENERATOR_FLAGS', + help='sets generator flag FLAG to VAL') + parser.add_option('--generator-output', dest='generator_output', + action='store', default=None, metavar='DIR', type='path', + env_name='GYP_GENERATOR_OUTPUT', + help='puts generated build files under DIR') + parser.add_option('--ignore-environment', dest='use_environment', + action='store_false', default=True, regenerate=False, + help='do not read options from environment variables') + parser.add_option('-I', '--include', dest='includes', action='append', + metavar='INCLUDE', type='path', + help='files to include in all loaded .gyp files') + # --no-circular-check disables the check for circular relationships between + # .gyp files. These relationships should not exist, but they've only been + # observed to be harmful with the Xcode generator. Chromium's .gyp files + # currently have some circular relationships on non-Mac platforms, so this + # option allows the strict behavior to be used on Macs and the lenient + # behavior to be used elsewhere. + # TODO(mark): Remove this option when http://crbug.com/35878 is fixed. + parser.add_option('--no-circular-check', dest='circular_check', + action='store_false', default=True, regenerate=False, + help="don't check for circular relationships between files") + # --no-duplicate-basename-check disables the check for duplicate basenames + # in a static_library/shared_library project. Visual C++ 2008 generator + # doesn't support this configuration. Libtool on Mac also generates warnings + # when duplicate basenames are passed into Make generator on Mac. + # TODO(yukawa): Remove this option when these legacy generators are + # deprecated. + parser.add_option('--no-duplicate-basename-check', + dest='duplicate_basename_check', action='store_false', + default=True, regenerate=False, + help="don't check for duplicate basenames") + parser.add_option('--no-parallel', action='store_true', default=False, + help='Disable multiprocessing') + parser.add_option('-S', '--suffix', dest='suffix', default='', + help='suffix to add to generated files') + parser.add_option('--toplevel-dir', dest='toplevel_dir', action='store', + default=None, metavar='DIR', type='path', + help='directory to use as the root of the source tree') + parser.add_option('-R', '--root-target', dest='root_targets', + action='append', metavar='TARGET', + help='include only TARGET and its deep dependencies') + + options, build_files_arg = parser.parse_args(args) + build_files = build_files_arg + + # Set up the configuration directory (defaults to ~/.gyp) + if not options.config_dir: + home = None + home_dot_gyp = None + if options.use_environment: + home_dot_gyp = os.environ.get('GYP_CONFIG_DIR', None) + if home_dot_gyp: + home_dot_gyp = os.path.expanduser(home_dot_gyp) + + if not home_dot_gyp: + home_vars = ['HOME'] + if sys.platform in ('cygwin', 'win32'): + home_vars.append('USERPROFILE') + for home_var in home_vars: + home = os.getenv(home_var) + if home != None: + home_dot_gyp = os.path.join(home, '.gyp') + if not os.path.exists(home_dot_gyp): + home_dot_gyp = None + else: + break + else: + home_dot_gyp = os.path.expanduser(options.config_dir) + + if home_dot_gyp and not os.path.exists(home_dot_gyp): + home_dot_gyp = None + + if not options.formats: + # If no format was given on the command line, then check the env variable. + generate_formats = [] + if options.use_environment: + generate_formats = os.environ.get('GYP_GENERATORS', []) + if generate_formats: + generate_formats = re.split(r'[\s,]', generate_formats) + if generate_formats: + options.formats = generate_formats + else: + # Nothing in the variable, default based on platform. + if sys.platform == 'darwin': + options.formats = ['xcode'] + elif sys.platform in ('win32', 'cygwin'): + options.formats = ['msvs'] + else: + options.formats = ['make'] + + if not options.generator_output and options.use_environment: + g_o = os.environ.get('GYP_GENERATOR_OUTPUT') + if g_o: + options.generator_output = g_o + + options.parallel = not options.no_parallel + + for mode in options.debug: + gyp.debug[mode] = 1 + + # Do an extra check to avoid work when we're not debugging. + if DEBUG_GENERAL in gyp.debug: + DebugOutput(DEBUG_GENERAL, 'running with these options:') + for option, value in sorted(options.__dict__.items()): + if option[0] == '_': + continue + if isinstance(value, basestring): + DebugOutput(DEBUG_GENERAL, " %s: '%s'", option, value) + else: + DebugOutput(DEBUG_GENERAL, " %s: %s", option, value) + + if not build_files: + build_files = FindBuildFiles() + if not build_files: + raise GypError((usage + '\n\n%s: error: no build_file') % + (my_name, my_name)) + + # TODO(mark): Chromium-specific hack! + # For Chromium, the gyp "depth" variable should always be a relative path + # to Chromium's top-level "src" directory. If no depth variable was set + # on the command line, try to find a "src" directory by looking at the + # absolute path to each build file's directory. The first "src" component + # found will be treated as though it were the path used for --depth. + if not options.depth: + for build_file in build_files: + build_file_dir = os.path.abspath(os.path.dirname(build_file)) + build_file_dir_components = build_file_dir.split(os.path.sep) + components_len = len(build_file_dir_components) + for index in xrange(components_len - 1, -1, -1): + if build_file_dir_components[index] == 'src': + options.depth = os.path.sep.join(build_file_dir_components) + break + del build_file_dir_components[index] + + # If the inner loop found something, break without advancing to another + # build file. + if options.depth: + break + + if not options.depth: + raise GypError('Could not automatically locate src directory. This is' + 'a temporary Chromium feature that will be removed. Use' + '--depth as a workaround.') + + # If toplevel-dir is not set, we assume that depth is the root of our source + # tree. + if not options.toplevel_dir: + options.toplevel_dir = options.depth + + # -D on the command line sets variable defaults - D isn't just for define, + # it's for default. Perhaps there should be a way to force (-F?) a + # variable's value so that it can't be overridden by anything else. + cmdline_default_variables = {} + defines = [] + if options.use_environment: + defines += ShlexEnv('GYP_DEFINES') + if options.defines: + defines += options.defines + cmdline_default_variables = NameValueListToDict(defines) + if DEBUG_GENERAL in gyp.debug: + DebugOutput(DEBUG_GENERAL, + "cmdline_default_variables: %s", cmdline_default_variables) + + # Set up includes. + includes = [] + + # If ~/.gyp/include.gypi exists, it'll be forcibly included into every + # .gyp file that's loaded, before anything else is included. + if home_dot_gyp != None: + default_include = os.path.join(home_dot_gyp, 'include.gypi') + if os.path.exists(default_include): + print 'Using overrides found in ' + default_include + includes.append(default_include) + + # Command-line --include files come after the default include. + if options.includes: + includes.extend(options.includes) + + # Generator flags should be prefixed with the target generator since they + # are global across all generator runs. + gen_flags = [] + if options.use_environment: + gen_flags += ShlexEnv('GYP_GENERATOR_FLAGS') + if options.generator_flags: + gen_flags += options.generator_flags + generator_flags = NameValueListToDict(gen_flags) + if DEBUG_GENERAL in gyp.debug.keys(): + DebugOutput(DEBUG_GENERAL, "generator_flags: %s", generator_flags) + + # Generate all requested formats (use a set in case we got one format request + # twice) + for format in set(options.formats): + params = {'options': options, + 'build_files': build_files, + 'generator_flags': generator_flags, + 'cwd': os.getcwd(), + 'build_files_arg': build_files_arg, + 'gyp_binary': sys.argv[0], + 'home_dot_gyp': home_dot_gyp, + 'parallel': options.parallel, + 'root_targets': options.root_targets, + 'target_arch': cmdline_default_variables.get('target_arch', '')} + + # Start with the default variables from the command line. + [generator, flat_list, targets, data] = Load( + build_files, format, cmdline_default_variables, includes, options.depth, + params, options.check, options.circular_check, + options.duplicate_basename_check) + + # TODO(mark): Pass |data| for now because the generator needs a list of + # build files that came in. In the future, maybe it should just accept + # a list, and not the whole data dict. + # NOTE: flat_list is the flattened dependency graph specifying the order + # that targets may be built. Build systems that operate serially or that + # need to have dependencies defined before dependents reference them should + # generate targets in the order specified in flat_list. + generator.GenerateOutput(flat_list, targets, data, params) + + if options.configs: + valid_configs = targets[flat_list[0]]['configurations'].keys() + for conf in options.configs: + if conf not in valid_configs: + raise GypError('Invalid config specified via --build: %s' % conf) + generator.PerformBuild(data, options.configs, params) + + # Done + return 0 + + +def main(args): + try: + return gyp_main(args) + except GypError, e: + sys.stderr.write("gyp: %s\n" % e) + return 1 + +# NOTE: setuptools generated console_scripts calls function with no arguments +def script_main(): + return main(sys.argv[1:]) + +if __name__ == '__main__': + sys.exit(script_main()) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.pyc b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.pyc new file mode 100644 index 00000000..eb32b242 Binary files /dev/null and b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.pyc differ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/common.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/common.py new file mode 100644 index 00000000..256e3f3a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/common.py @@ -0,0 +1,608 @@ +# Copyright (c) 2012 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +from __future__ import with_statement + +import collections +import errno +import filecmp +import os.path +import re +import tempfile +import sys + + +# A minimal memoizing decorator. It'll blow up if the args aren't immutable, +# among other "problems". +class memoize(object): + def __init__(self, func): + self.func = func + self.cache = {} + def __call__(self, *args): + try: + return self.cache[args] + except KeyError: + result = self.func(*args) + self.cache[args] = result + return result + + +class GypError(Exception): + """Error class representing an error, which is to be presented + to the user. The main entry point will catch and display this. + """ + pass + + +def ExceptionAppend(e, msg): + """Append a message to the given exception's message.""" + if not e.args: + e.args = (msg,) + elif len(e.args) == 1: + e.args = (str(e.args[0]) + ' ' + msg,) + else: + e.args = (str(e.args[0]) + ' ' + msg,) + e.args[1:] + + +def FindQualifiedTargets(target, qualified_list): + """ + Given a list of qualified targets, return the qualified targets for the + specified |target|. + """ + return [t for t in qualified_list if ParseQualifiedTarget(t)[1] == target] + + +def ParseQualifiedTarget(target): + # Splits a qualified target into a build file, target name and toolset. + + # NOTE: rsplit is used to disambiguate the Windows drive letter separator. + target_split = target.rsplit(':', 1) + if len(target_split) == 2: + [build_file, target] = target_split + else: + build_file = None + + target_split = target.rsplit('#', 1) + if len(target_split) == 2: + [target, toolset] = target_split + else: + toolset = None + + return [build_file, target, toolset] + + +def ResolveTarget(build_file, target, toolset): + # This function resolves a target into a canonical form: + # - a fully defined build file, either absolute or relative to the current + # directory + # - a target name + # - a toolset + # + # build_file is the file relative to which 'target' is defined. + # target is the qualified target. + # toolset is the default toolset for that target. + [parsed_build_file, target, parsed_toolset] = ParseQualifiedTarget(target) + + if parsed_build_file: + if build_file: + # If a relative path, parsed_build_file is relative to the directory + # containing build_file. If build_file is not in the current directory, + # parsed_build_file is not a usable path as-is. Resolve it by + # interpreting it as relative to build_file. If parsed_build_file is + # absolute, it is usable as a path regardless of the current directory, + # and os.path.join will return it as-is. + build_file = os.path.normpath(os.path.join(os.path.dirname(build_file), + parsed_build_file)) + # Further (to handle cases like ../cwd), make it relative to cwd) + if not os.path.isabs(build_file): + build_file = RelativePath(build_file, '.') + else: + build_file = parsed_build_file + + if parsed_toolset: + toolset = parsed_toolset + + return [build_file, target, toolset] + + +def BuildFile(fully_qualified_target): + # Extracts the build file from the fully qualified target. + return ParseQualifiedTarget(fully_qualified_target)[0] + + +def GetEnvironFallback(var_list, default): + """Look up a key in the environment, with fallback to secondary keys + and finally falling back to a default value.""" + for var in var_list: + if var in os.environ: + return os.environ[var] + return default + + +def QualifiedTarget(build_file, target, toolset): + # "Qualified" means the file that a target was defined in and the target + # name, separated by a colon, suffixed by a # and the toolset name: + # /path/to/file.gyp:target_name#toolset + fully_qualified = build_file + ':' + target + if toolset: + fully_qualified = fully_qualified + '#' + toolset + return fully_qualified + + +@memoize +def RelativePath(path, relative_to, follow_path_symlink=True): + # Assuming both |path| and |relative_to| are relative to the current + # directory, returns a relative path that identifies path relative to + # relative_to. + # If |follow_symlink_path| is true (default) and |path| is a symlink, then + # this method returns a path to the real file represented by |path|. If it is + # false, this method returns a path to the symlink. If |path| is not a + # symlink, this option has no effect. + + # Convert to normalized (and therefore absolute paths). + if follow_path_symlink: + path = os.path.realpath(path) + else: + path = os.path.abspath(path) + relative_to = os.path.realpath(relative_to) + + # On Windows, we can't create a relative path to a different drive, so just + # use the absolute path. + if sys.platform == 'win32': + if (os.path.splitdrive(path)[0].lower() != + os.path.splitdrive(relative_to)[0].lower()): + return path + + # Split the paths into components. + path_split = path.split(os.path.sep) + relative_to_split = relative_to.split(os.path.sep) + + # Determine how much of the prefix the two paths share. + prefix_len = len(os.path.commonprefix([path_split, relative_to_split])) + + # Put enough ".." components to back up out of relative_to to the common + # prefix, and then append the part of path_split after the common prefix. + relative_split = [os.path.pardir] * (len(relative_to_split) - prefix_len) + \ + path_split[prefix_len:] + + if len(relative_split) == 0: + # The paths were the same. + return '' + + # Turn it back into a string and we're done. + return os.path.join(*relative_split) + + +@memoize +def InvertRelativePath(path, toplevel_dir=None): + """Given a path like foo/bar that is relative to toplevel_dir, return + the inverse relative path back to the toplevel_dir. + + E.g. os.path.normpath(os.path.join(path, InvertRelativePath(path))) + should always produce the empty string, unless the path contains symlinks. + """ + if not path: + return path + toplevel_dir = '.' if toplevel_dir is None else toplevel_dir + return RelativePath(toplevel_dir, os.path.join(toplevel_dir, path)) + + +def FixIfRelativePath(path, relative_to): + # Like RelativePath but returns |path| unchanged if it is absolute. + if os.path.isabs(path): + return path + return RelativePath(path, relative_to) + + +def UnrelativePath(path, relative_to): + # Assuming that |relative_to| is relative to the current directory, and |path| + # is a path relative to the dirname of |relative_to|, returns a path that + # identifies |path| relative to the current directory. + rel_dir = os.path.dirname(relative_to) + return os.path.normpath(os.path.join(rel_dir, path)) + + +# re objects used by EncodePOSIXShellArgument. See IEEE 1003.1 XCU.2.2 at +# http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_02 +# and the documentation for various shells. + +# _quote is a pattern that should match any argument that needs to be quoted +# with double-quotes by EncodePOSIXShellArgument. It matches the following +# characters appearing anywhere in an argument: +# \t, \n, space parameter separators +# # comments +# $ expansions (quoted to always expand within one argument) +# % called out by IEEE 1003.1 XCU.2.2 +# & job control +# ' quoting +# (, ) subshell execution +# *, ?, [ pathname expansion +# ; command delimiter +# <, >, | redirection +# = assignment +# {, } brace expansion (bash) +# ~ tilde expansion +# It also matches the empty string, because "" (or '') is the only way to +# represent an empty string literal argument to a POSIX shell. +# +# This does not match the characters in _escape, because those need to be +# backslash-escaped regardless of whether they appear in a double-quoted +# string. +_quote = re.compile('[\t\n #$%&\'()*;<=>?[{|}~]|^$') + +# _escape is a pattern that should match any character that needs to be +# escaped with a backslash, whether or not the argument matched the _quote +# pattern. _escape is used with re.sub to backslash anything in _escape's +# first match group, hence the (parentheses) in the regular expression. +# +# _escape matches the following characters appearing anywhere in an argument: +# " to prevent POSIX shells from interpreting this character for quoting +# \ to prevent POSIX shells from interpreting this character for escaping +# ` to prevent POSIX shells from interpreting this character for command +# substitution +# Missing from this list is $, because the desired behavior of +# EncodePOSIXShellArgument is to permit parameter (variable) expansion. +# +# Also missing from this list is !, which bash will interpret as the history +# expansion character when history is enabled. bash does not enable history +# by default in non-interactive shells, so this is not thought to be a problem. +# ! was omitted from this list because bash interprets "\!" as a literal string +# including the backslash character (avoiding history expansion but retaining +# the backslash), which would not be correct for argument encoding. Handling +# this case properly would also be problematic because bash allows the history +# character to be changed with the histchars shell variable. Fortunately, +# as history is not enabled in non-interactive shells and +# EncodePOSIXShellArgument is only expected to encode for non-interactive +# shells, there is no room for error here by ignoring !. +_escape = re.compile(r'(["\\`])') + +def EncodePOSIXShellArgument(argument): + """Encodes |argument| suitably for consumption by POSIX shells. + + argument may be quoted and escaped as necessary to ensure that POSIX shells + treat the returned value as a literal representing the argument passed to + this function. Parameter (variable) expansions beginning with $ are allowed + to remain intact without escaping the $, to allow the argument to contain + references to variables to be expanded by the shell. + """ + + if not isinstance(argument, str): + argument = str(argument) + + if _quote.search(argument): + quote = '"' + else: + quote = '' + + encoded = quote + re.sub(_escape, r'\\\1', argument) + quote + + return encoded + + +def EncodePOSIXShellList(list): + """Encodes |list| suitably for consumption by POSIX shells. + + Returns EncodePOSIXShellArgument for each item in list, and joins them + together using the space character as an argument separator. + """ + + encoded_arguments = [] + for argument in list: + encoded_arguments.append(EncodePOSIXShellArgument(argument)) + return ' '.join(encoded_arguments) + + +def DeepDependencyTargets(target_dicts, roots): + """Returns the recursive list of target dependencies.""" + dependencies = set() + pending = set(roots) + while pending: + # Pluck out one. + r = pending.pop() + # Skip if visited already. + if r in dependencies: + continue + # Add it. + dependencies.add(r) + # Add its children. + spec = target_dicts[r] + pending.update(set(spec.get('dependencies', []))) + pending.update(set(spec.get('dependencies_original', []))) + return list(dependencies - set(roots)) + + +def BuildFileTargets(target_list, build_file): + """From a target_list, returns the subset from the specified build_file. + """ + return [p for p in target_list if BuildFile(p) == build_file] + + +def AllTargets(target_list, target_dicts, build_file): + """Returns all targets (direct and dependencies) for the specified build_file. + """ + bftargets = BuildFileTargets(target_list, build_file) + deptargets = DeepDependencyTargets(target_dicts, bftargets) + return bftargets + deptargets + + +def WriteOnDiff(filename): + """Write to a file only if the new contents differ. + + Arguments: + filename: name of the file to potentially write to. + Returns: + A file like object which will write to temporary file and only overwrite + the target if it differs (on close). + """ + + class Writer(object): + """Wrapper around file which only covers the target if it differs.""" + def __init__(self): + # Pick temporary file. + tmp_fd, self.tmp_path = tempfile.mkstemp( + suffix='.tmp', + prefix=os.path.split(filename)[1] + '.gyp.', + dir=os.path.split(filename)[0]) + try: + self.tmp_file = os.fdopen(tmp_fd, 'wb') + except Exception: + # Don't leave turds behind. + os.unlink(self.tmp_path) + raise + + def __getattr__(self, attrname): + # Delegate everything else to self.tmp_file + return getattr(self.tmp_file, attrname) + + def close(self): + try: + # Close tmp file. + self.tmp_file.close() + # Determine if different. + same = False + try: + same = filecmp.cmp(self.tmp_path, filename, False) + except OSError, e: + if e.errno != errno.ENOENT: + raise + + if same: + # The new file is identical to the old one, just get rid of the new + # one. + os.unlink(self.tmp_path) + else: + # The new file is different from the old one, or there is no old one. + # Rename the new file to the permanent name. + # + # tempfile.mkstemp uses an overly restrictive mode, resulting in a + # file that can only be read by the owner, regardless of the umask. + # There's no reason to not respect the umask here, which means that + # an extra hoop is required to fetch it and reset the new file's mode. + # + # No way to get the umask without setting a new one? Set a safe one + # and then set it back to the old value. + umask = os.umask(077) + os.umask(umask) + os.chmod(self.tmp_path, 0666 & ~umask) + if sys.platform == 'win32' and os.path.exists(filename): + # NOTE: on windows (but not cygwin) rename will not replace an + # existing file, so it must be preceded with a remove. Sadly there + # is no way to make the switch atomic. + os.remove(filename) + os.rename(self.tmp_path, filename) + except Exception: + # Don't leave turds behind. + os.unlink(self.tmp_path) + raise + + return Writer() + + +def EnsureDirExists(path): + """Make sure the directory for |path| exists.""" + try: + os.makedirs(os.path.dirname(path)) + except OSError: + pass + + +def GetFlavor(params): + """Returns |params.flavor| if it's set, the system's default flavor else.""" + flavors = { + 'cygwin': 'win', + 'win32': 'win', + 'darwin': 'mac', + } + + if 'flavor' in params: + return params['flavor'] + if sys.platform in flavors: + return flavors[sys.platform] + if sys.platform.startswith('sunos'): + return 'solaris' + if sys.platform.startswith('freebsd'): + return 'freebsd' + if sys.platform.startswith('openbsd'): + return 'openbsd' + if sys.platform.startswith('netbsd'): + return 'netbsd' + if sys.platform.startswith('aix'): + return 'aix' + + return 'linux' + + +def CopyTool(flavor, out_path): + """Finds (flock|mac|win)_tool.gyp in the gyp directory and copies it + to |out_path|.""" + # aix and solaris just need flock emulation. mac and win use more complicated + # support scripts. + prefix = { + 'aix': 'flock', + 'solaris': 'flock', + 'mac': 'mac', + 'win': 'win' + }.get(flavor, None) + if not prefix: + return + + # Slurp input file. + source_path = os.path.join( + os.path.dirname(os.path.abspath(__file__)), '%s_tool.py' % prefix) + with open(source_path) as source_file: + source = source_file.readlines() + + # Add header and write it out. + tool_path = os.path.join(out_path, 'gyp-%s-tool' % prefix) + with open(tool_path, 'w') as tool_file: + tool_file.write( + ''.join([source[0], '# Generated by gyp. Do not edit.\n'] + source[1:])) + + # Make file executable. + os.chmod(tool_path, 0755) + + +# From Alex Martelli, +# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52560 +# ASPN: Python Cookbook: Remove duplicates from a sequence +# First comment, dated 2001/10/13. +# (Also in the printed Python Cookbook.) + +def uniquer(seq, idfun=None): + if idfun is None: + idfun = lambda x: x + seen = {} + result = [] + for item in seq: + marker = idfun(item) + if marker in seen: continue + seen[marker] = 1 + result.append(item) + return result + + +# Based on http://code.activestate.com/recipes/576694/. +class OrderedSet(collections.MutableSet): + def __init__(self, iterable=None): + self.end = end = [] + end += [None, end, end] # sentinel node for doubly linked list + self.map = {} # key --> [key, prev, next] + if iterable is not None: + self |= iterable + + def __len__(self): + return len(self.map) + + def __contains__(self, key): + return key in self.map + + def add(self, key): + if key not in self.map: + end = self.end + curr = end[1] + curr[2] = end[1] = self.map[key] = [key, curr, end] + + def discard(self, key): + if key in self.map: + key, prev_item, next_item = self.map.pop(key) + prev_item[2] = next_item + next_item[1] = prev_item + + def __iter__(self): + end = self.end + curr = end[2] + while curr is not end: + yield curr[0] + curr = curr[2] + + def __reversed__(self): + end = self.end + curr = end[1] + while curr is not end: + yield curr[0] + curr = curr[1] + + # The second argument is an addition that causes a pylint warning. + def pop(self, last=True): # pylint: disable=W0221 + if not self: + raise KeyError('set is empty') + key = self.end[1][0] if last else self.end[2][0] + self.discard(key) + return key + + def __repr__(self): + if not self: + return '%s()' % (self.__class__.__name__,) + return '%s(%r)' % (self.__class__.__name__, list(self)) + + def __eq__(self, other): + if isinstance(other, OrderedSet): + return len(self) == len(other) and list(self) == list(other) + return set(self) == set(other) + + # Extensions to the recipe. + def update(self, iterable): + for i in iterable: + if i not in self: + self.add(i) + + +class CycleError(Exception): + """An exception raised when an unexpected cycle is detected.""" + def __init__(self, nodes): + self.nodes = nodes + def __str__(self): + return 'CycleError: cycle involving: ' + str(self.nodes) + + +def TopologicallySorted(graph, get_edges): + r"""Topologically sort based on a user provided edge definition. + + Args: + graph: A list of node names. + get_edges: A function mapping from node name to a hashable collection + of node names which this node has outgoing edges to. + Returns: + A list containing all of the node in graph in topological order. + It is assumed that calling get_edges once for each node and caching is + cheaper than repeatedly calling get_edges. + Raises: + CycleError in the event of a cycle. + Example: + graph = {'a': '$(b) $(c)', 'b': 'hi', 'c': '$(b)'} + def GetEdges(node): + return re.findall(r'\$\(([^))]\)', graph[node]) + print TopologicallySorted(graph.keys(), GetEdges) + ==> + ['a', 'c', b'] + """ + get_edges = memoize(get_edges) + visited = set() + visiting = set() + ordered_nodes = [] + def Visit(node): + if node in visiting: + raise CycleError(visiting) + if node in visited: + return + visited.add(node) + visiting.add(node) + for neighbor in get_edges(node): + Visit(neighbor) + visiting.remove(node) + ordered_nodes.insert(0, node) + for node in sorted(graph): + Visit(node) + return ordered_nodes + +def CrossCompileRequested(): + # TODO: figure out how to not build extra host objects in the + # non-cross-compile case when this is enabled, and enable unconditionally. + return (os.environ.get('GYP_CROSSCOMPILE') or + os.environ.get('AR_host') or + os.environ.get('CC_host') or + os.environ.get('CXX_host') or + os.environ.get('AR_target') or + os.environ.get('CC_target') or + os.environ.get('CXX_target')) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/common.pyc b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/common.pyc new file mode 100644 index 00000000..d32f0241 Binary files /dev/null and b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/common.pyc differ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/common_test.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/common_test.py new file mode 100644 index 00000000..ad6f9a14 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/common_test.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python + +# Copyright (c) 2012 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Unit tests for the common.py file.""" + +import gyp.common +import unittest +import sys + + +class TestTopologicallySorted(unittest.TestCase): + def test_Valid(self): + """Test that sorting works on a valid graph with one possible order.""" + graph = { + 'a': ['b', 'c'], + 'b': [], + 'c': ['d'], + 'd': ['b'], + } + def GetEdge(node): + return tuple(graph[node]) + self.assertEqual( + gyp.common.TopologicallySorted(graph.keys(), GetEdge), + ['a', 'c', 'd', 'b']) + + def test_Cycle(self): + """Test that an exception is thrown on a cyclic graph.""" + graph = { + 'a': ['b'], + 'b': ['c'], + 'c': ['d'], + 'd': ['a'], + } + def GetEdge(node): + return tuple(graph[node]) + self.assertRaises( + gyp.common.CycleError, gyp.common.TopologicallySorted, + graph.keys(), GetEdge) + + +class TestGetFlavor(unittest.TestCase): + """Test that gyp.common.GetFlavor works as intended""" + original_platform = '' + + def setUp(self): + self.original_platform = sys.platform + + def tearDown(self): + sys.platform = self.original_platform + + def assertFlavor(self, expected, argument, param): + sys.platform = argument + self.assertEqual(expected, gyp.common.GetFlavor(param)) + + def test_platform_default(self): + self.assertFlavor('freebsd', 'freebsd9' , {}) + self.assertFlavor('freebsd', 'freebsd10', {}) + self.assertFlavor('openbsd', 'openbsd5' , {}) + self.assertFlavor('solaris', 'sunos5' , {}); + self.assertFlavor('solaris', 'sunos' , {}); + self.assertFlavor('linux' , 'linux2' , {}); + self.assertFlavor('linux' , 'linux3' , {}); + + def test_param(self): + self.assertFlavor('foobar', 'linux2' , {'flavor': 'foobar'}) + + +if __name__ == '__main__': + unittest.main() diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py new file mode 100644 index 00000000..2b0bb60c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py @@ -0,0 +1,162 @@ +# Copyright (c) 2011 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import re +import os + + +def XmlToString(content, encoding='utf-8', pretty=False): + """ Writes the XML content to disk, touching the file only if it has changed. + + Visual Studio files have a lot of pre-defined structures. This function makes + it easy to represent these structures as Python data structures, instead of + having to create a lot of function calls. + + Each XML element of the content is represented as a list composed of: + 1. The name of the element, a string, + 2. The attributes of the element, a dictionary (optional), and + 3+. The content of the element, if any. Strings are simple text nodes and + lists are child elements. + + Example 1: + + becomes + ['test'] + + Example 2: + + This is + it! + + + becomes + ['myelement', {'a':'value1', 'b':'value2'}, + ['childtype', 'This is'], + ['childtype', 'it!'], + ] + + Args: + content: The structured content to be converted. + encoding: The encoding to report on the first XML line. + pretty: True if we want pretty printing with indents and new lines. + + Returns: + The XML content as a string. + """ + # We create a huge list of all the elements of the file. + xml_parts = ['' % encoding] + if pretty: + xml_parts.append('\n') + _ConstructContentList(xml_parts, content, pretty) + + # Convert it to a string + return ''.join(xml_parts) + + +def _ConstructContentList(xml_parts, specification, pretty, level=0): + """ Appends the XML parts corresponding to the specification. + + Args: + xml_parts: A list of XML parts to be appended to. + specification: The specification of the element. See EasyXml docs. + pretty: True if we want pretty printing with indents and new lines. + level: Indentation level. + """ + # The first item in a specification is the name of the element. + if pretty: + indentation = ' ' * level + new_line = '\n' + else: + indentation = '' + new_line = '' + name = specification[0] + if not isinstance(name, str): + raise Exception('The first item of an EasyXml specification should be ' + 'a string. Specification was ' + str(specification)) + xml_parts.append(indentation + '<' + name) + + # Optionally in second position is a dictionary of the attributes. + rest = specification[1:] + if rest and isinstance(rest[0], dict): + for at, val in sorted(rest[0].iteritems()): + xml_parts.append(' %s="%s"' % (at, _XmlEscape(val, attr=True))) + rest = rest[1:] + if rest: + xml_parts.append('>') + all_strings = reduce(lambda x, y: x and isinstance(y, str), rest, True) + multi_line = not all_strings + if multi_line and new_line: + xml_parts.append(new_line) + for child_spec in rest: + # If it's a string, append a text node. + # Otherwise recurse over that child definition + if isinstance(child_spec, str): + xml_parts.append(_XmlEscape(child_spec)) + else: + _ConstructContentList(xml_parts, child_spec, pretty, level + 1) + if multi_line and indentation: + xml_parts.append(indentation) + xml_parts.append('%s' % (name, new_line)) + else: + xml_parts.append('/>%s' % new_line) + + +def WriteXmlIfChanged(content, path, encoding='utf-8', pretty=False, + win32=False): + """ Writes the XML content to disk, touching the file only if it has changed. + + Args: + content: The structured content to be written. + path: Location of the file. + encoding: The encoding to report on the first line of the XML file. + pretty: True if we want pretty printing with indents and new lines. + """ + xml_string = XmlToString(content, encoding, pretty) + if win32 and os.linesep != '\r\n': + xml_string = xml_string.replace('\n', '\r\n') + + try: + xml_string = xml_string.encode(encoding) + except Exception: + xml_string = unicode(xml_string, 'latin-1').encode(encoding) + + # Get the old content + try: + f = open(path, 'r') + existing = f.read() + f.close() + except: + existing = None + + # It has changed, write it + if existing != xml_string: + f = open(path, 'w') + f.write(xml_string) + f.close() + + +_xml_escape_map = { + '"': '"', + "'": ''', + '<': '<', + '>': '>', + '&': '&', + '\n': ' ', + '\r': ' ', +} + + +_xml_escape_re = re.compile( + "(%s)" % "|".join(map(re.escape, _xml_escape_map.keys()))) + + +def _XmlEscape(value, attr=False): + """ Escape a string for inclusion in XML.""" + def replace(match): + m = match.string[match.start() : match.end()] + # don't replace single quotes in attrs + if attr and m == "'": + return m + return _xml_escape_map[m] + return _xml_escape_re.sub(replace, value) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.pyc b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.pyc new file mode 100644 index 00000000..c1fbfd6d Binary files /dev/null and b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.pyc differ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py new file mode 100644 index 00000000..df643549 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py @@ -0,0 +1,103 @@ +#!/usr/bin/env python + +# Copyright (c) 2011 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +""" Unit tests for the easy_xml.py file. """ + +import gyp.easy_xml as easy_xml +import unittest +import StringIO + + +class TestSequenceFunctions(unittest.TestCase): + + def setUp(self): + self.stderr = StringIO.StringIO() + + def test_EasyXml_simple(self): + self.assertEqual( + easy_xml.XmlToString(['test']), + '') + + self.assertEqual( + easy_xml.XmlToString(['test'], encoding='Windows-1252'), + '') + + def test_EasyXml_simple_with_attributes(self): + self.assertEqual( + easy_xml.XmlToString(['test2', {'a': 'value1', 'b': 'value2'}]), + '') + + def test_EasyXml_escaping(self): + original = '\'"\r&\nfoo' + converted = '<test>\'" & foo' + converted_apos = converted.replace("'", ''') + self.assertEqual( + easy_xml.XmlToString(['test3', {'a': original}, original]), + '%s' % + (converted, converted_apos)) + + def test_EasyXml_pretty(self): + self.assertEqual( + easy_xml.XmlToString( + ['test3', + ['GrandParent', + ['Parent1', + ['Child'] + ], + ['Parent2'] + ] + ], + pretty=True), + '\n' + '\n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + ' \n' + '\n') + + + def test_EasyXml_complex(self): + # We want to create: + target = ( + '' + '' + '' + '{D2250C20-3A94-4FB9-AF73-11BC5B73884B}' + 'Win32Proj' + 'automated_ui_tests' + '' + '' + '' + 'Application' + 'Unicode' + '' + '') + + xml = easy_xml.XmlToString( + ['Project', + ['PropertyGroup', {'Label': 'Globals'}, + ['ProjectGuid', '{D2250C20-3A94-4FB9-AF73-11BC5B73884B}'], + ['Keyword', 'Win32Proj'], + ['RootNamespace', 'automated_ui_tests'] + ], + ['Import', {'Project': '$(VCTargetsPath)\\Microsoft.Cpp.props'}], + ['PropertyGroup', + {'Condition': "'$(Configuration)|$(Platform)'=='Debug|Win32'", + 'Label': 'Configuration'}, + ['ConfigurationType', 'Application'], + ['CharacterSet', 'Unicode'] + ] + ]) + self.assertEqual(xml, target) + + +if __name__ == '__main__': + unittest.main() diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py new file mode 100644 index 00000000..b38d8660 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python +# Copyright (c) 2011 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""These functions are executed via gyp-flock-tool when using the Makefile +generator. Used on systems that don't have a built-in flock.""" + +import fcntl +import os +import struct +import subprocess +import sys + + +def main(args): + executor = FlockTool() + executor.Dispatch(args) + + +class FlockTool(object): + """This class emulates the 'flock' command.""" + def Dispatch(self, args): + """Dispatches a string command to a method.""" + if len(args) < 1: + raise Exception("Not enough arguments") + + method = "Exec%s" % self._CommandifyName(args[0]) + getattr(self, method)(*args[1:]) + + def _CommandifyName(self, name_string): + """Transforms a tool name like copy-info-plist to CopyInfoPlist""" + return name_string.title().replace('-', '') + + def ExecFlock(self, lockfile, *cmd_list): + """Emulates the most basic behavior of Linux's flock(1).""" + # Rely on exception handling to report errors. + # Note that the stock python on SunOS has a bug + # where fcntl.flock(fd, LOCK_EX) always fails + # with EBADF, that's why we use this F_SETLK + # hack instead. + fd = os.open(lockfile, os.O_WRONLY|os.O_NOCTTY|os.O_CREAT, 0666) + if sys.platform.startswith('aix'): + # Python on AIX is compiled with LARGEFILE support, which changes the + # struct size. + op = struct.pack('hhIllqq', fcntl.F_WRLCK, 0, 0, 0, 0, 0, 0) + else: + op = struct.pack('hhllhhl', fcntl.F_WRLCK, 0, 0, 0, 0, 0, 0) + fcntl.fcntl(fd, fcntl.F_SETLK, op) + return subprocess.call(cmd_list) + + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/__init__.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/__init__.pyc b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/__init__.pyc new file mode 100644 index 00000000..82e06439 Binary files /dev/null and b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/__init__.pyc differ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py new file mode 100644 index 00000000..921c1a6b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py @@ -0,0 +1,741 @@ +# Copyright (c) 2014 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +""" +This script is intended for use as a GYP_GENERATOR. It takes as input (by way of +the generator flag config_path) the path of a json file that dictates the files +and targets to search for. The following keys are supported: +files: list of paths (relative) of the files to search for. +test_targets: unqualified target names to search for. Any target in this list +that depends upon a file in |files| is output regardless of the type of target +or chain of dependencies. +additional_compile_targets: Unqualified targets to search for in addition to +test_targets. Targets in the combined list that depend upon a file in |files| +are not necessarily output. For example, if the target is of type none then the +target is not output (but one of the descendants of the target will be). + +The following is output: +error: only supplied if there is an error. +compile_targets: minimal set of targets that directly or indirectly (for + targets of type none) depend on the files in |files| and is one of the + supplied targets or a target that one of the supplied targets depends on. + The expectation is this set of targets is passed into a build step. This list + always contains the output of test_targets as well. +test_targets: set of targets from the supplied |test_targets| that either + directly or indirectly depend upon a file in |files|. This list if useful + if additional processing needs to be done for certain targets after the + build, such as running tests. +status: outputs one of three values: none of the supplied files were found, + one of the include files changed so that it should be assumed everything + changed (in this case test_targets and compile_targets are not output) or at + least one file was found. +invalid_targets: list of supplied targets that were not found. + +Example: +Consider a graph like the following: + A D + / \ +B C +A depends upon both B and C, A is of type none and B and C are executables. +D is an executable, has no dependencies and nothing depends on it. +If |additional_compile_targets| = ["A"], |test_targets| = ["B", "C"] and +files = ["b.cc", "d.cc"] (B depends upon b.cc and D depends upon d.cc), then +the following is output: +|compile_targets| = ["B"] B must built as it depends upon the changed file b.cc +and the supplied target A depends upon it. A is not output as a build_target +as it is of type none with no rules and actions. +|test_targets| = ["B"] B directly depends upon the change file b.cc. + +Even though the file d.cc, which D depends upon, has changed D is not output +as it was not supplied by way of |additional_compile_targets| or |test_targets|. + +If the generator flag analyzer_output_path is specified, output is written +there. Otherwise output is written to stdout. + +In Gyp the "all" target is shorthand for the root targets in the files passed +to gyp. For example, if file "a.gyp" contains targets "a1" and +"a2", and file "b.gyp" contains targets "b1" and "b2" and "a2" has a dependency +on "b2" and gyp is supplied "a.gyp" then "all" consists of "a1" and "a2". +Notice that "b1" and "b2" are not in the "all" target as "b.gyp" was not +directly supplied to gyp. OTOH if both "a.gyp" and "b.gyp" are supplied to gyp +then the "all" target includes "b1" and "b2". +""" + +import gyp.common +import gyp.ninja_syntax as ninja_syntax +import json +import os +import posixpath +import sys + +debug = False + +found_dependency_string = 'Found dependency' +no_dependency_string = 'No dependencies' +# Status when it should be assumed that everything has changed. +all_changed_string = 'Found dependency (all)' + +# MatchStatus is used indicate if and how a target depends upon the supplied +# sources. +# The target's sources contain one of the supplied paths. +MATCH_STATUS_MATCHES = 1 +# The target has a dependency on another target that contains one of the +# supplied paths. +MATCH_STATUS_MATCHES_BY_DEPENDENCY = 2 +# The target's sources weren't in the supplied paths and none of the target's +# dependencies depend upon a target that matched. +MATCH_STATUS_DOESNT_MATCH = 3 +# The target doesn't contain the source, but the dependent targets have not yet +# been visited to determine a more specific status yet. +MATCH_STATUS_TBD = 4 + +generator_supports_multiple_toolsets = gyp.common.CrossCompileRequested() + +generator_wants_static_library_dependencies_adjusted = False + +generator_default_variables = { +} +for dirname in ['INTERMEDIATE_DIR', 'SHARED_INTERMEDIATE_DIR', 'PRODUCT_DIR', + 'LIB_DIR', 'SHARED_LIB_DIR']: + generator_default_variables[dirname] = '!!!' + +for unused in ['RULE_INPUT_PATH', 'RULE_INPUT_ROOT', 'RULE_INPUT_NAME', + 'RULE_INPUT_DIRNAME', 'RULE_INPUT_EXT', + 'EXECUTABLE_PREFIX', 'EXECUTABLE_SUFFIX', + 'STATIC_LIB_PREFIX', 'STATIC_LIB_SUFFIX', + 'SHARED_LIB_PREFIX', 'SHARED_LIB_SUFFIX', + 'CONFIGURATION_NAME']: + generator_default_variables[unused] = '' + + +def _ToGypPath(path): + """Converts a path to the format used by gyp.""" + if os.sep == '\\' and os.altsep == '/': + return path.replace('\\', '/') + return path + + +def _ResolveParent(path, base_path_components): + """Resolves |path|, which starts with at least one '../'. Returns an empty + string if the path shouldn't be considered. See _AddSources() for a + description of |base_path_components|.""" + depth = 0 + while path.startswith('../'): + depth += 1 + path = path[3:] + # Relative includes may go outside the source tree. For example, an action may + # have inputs in /usr/include, which are not in the source tree. + if depth > len(base_path_components): + return '' + if depth == len(base_path_components): + return path + return '/'.join(base_path_components[0:len(base_path_components) - depth]) + \ + '/' + path + + +def _AddSources(sources, base_path, base_path_components, result): + """Extracts valid sources from |sources| and adds them to |result|. Each + source file is relative to |base_path|, but may contain '..'. To make + resolving '..' easier |base_path_components| contains each of the + directories in |base_path|. Additionally each source may contain variables. + Such sources are ignored as it is assumed dependencies on them are expressed + and tracked in some other means.""" + # NOTE: gyp paths are always posix style. + for source in sources: + if not len(source) or source.startswith('!!!') or source.startswith('$'): + continue + # variable expansion may lead to //. + org_source = source + source = source[0] + source[1:].replace('//', '/') + if source.startswith('../'): + source = _ResolveParent(source, base_path_components) + if len(source): + result.append(source) + continue + result.append(base_path + source) + if debug: + print 'AddSource', org_source, result[len(result) - 1] + + +def _ExtractSourcesFromAction(action, base_path, base_path_components, + results): + if 'inputs' in action: + _AddSources(action['inputs'], base_path, base_path_components, results) + + +def _ToLocalPath(toplevel_dir, path): + """Converts |path| to a path relative to |toplevel_dir|.""" + if path == toplevel_dir: + return '' + if path.startswith(toplevel_dir + '/'): + return path[len(toplevel_dir) + len('/'):] + return path + + +def _ExtractSources(target, target_dict, toplevel_dir): + # |target| is either absolute or relative and in the format of the OS. Gyp + # source paths are always posix. Convert |target| to a posix path relative to + # |toplevel_dir_|. This is done to make it easy to build source paths. + base_path = posixpath.dirname(_ToLocalPath(toplevel_dir, _ToGypPath(target))) + base_path_components = base_path.split('/') + + # Add a trailing '/' so that _AddSources() can easily build paths. + if len(base_path): + base_path += '/' + + if debug: + print 'ExtractSources', target, base_path + + results = [] + if 'sources' in target_dict: + _AddSources(target_dict['sources'], base_path, base_path_components, + results) + # Include the inputs from any actions. Any changes to these affect the + # resulting output. + if 'actions' in target_dict: + for action in target_dict['actions']: + _ExtractSourcesFromAction(action, base_path, base_path_components, + results) + if 'rules' in target_dict: + for rule in target_dict['rules']: + _ExtractSourcesFromAction(rule, base_path, base_path_components, results) + + return results + + +class Target(object): + """Holds information about a particular target: + deps: set of Targets this Target depends upon. This is not recursive, only the + direct dependent Targets. + match_status: one of the MatchStatus values. + back_deps: set of Targets that have a dependency on this Target. + visited: used during iteration to indicate whether we've visited this target. + This is used for two iterations, once in building the set of Targets and + again in _GetBuildTargets(). + name: fully qualified name of the target. + requires_build: True if the target type is such that it needs to be built. + See _DoesTargetTypeRequireBuild for details. + added_to_compile_targets: used when determining if the target was added to the + set of targets that needs to be built. + in_roots: true if this target is a descendant of one of the root nodes. + is_executable: true if the type of target is executable. + is_static_library: true if the type of target is static_library. + is_or_has_linked_ancestor: true if the target does a link (eg executable), or + if there is a target in back_deps that does a link.""" + def __init__(self, name): + self.deps = set() + self.match_status = MATCH_STATUS_TBD + self.back_deps = set() + self.name = name + # TODO(sky): I don't like hanging this off Target. This state is specific + # to certain functions and should be isolated there. + self.visited = False + self.requires_build = False + self.added_to_compile_targets = False + self.in_roots = False + self.is_executable = False + self.is_static_library = False + self.is_or_has_linked_ancestor = False + + +class Config(object): + """Details what we're looking for + files: set of files to search for + targets: see file description for details.""" + def __init__(self): + self.files = [] + self.targets = set() + self.additional_compile_target_names = set() + self.test_target_names = set() + + def Init(self, params): + """Initializes Config. This is a separate method as it raises an exception + if there is a parse error.""" + generator_flags = params.get('generator_flags', {}) + config_path = generator_flags.get('config_path', None) + if not config_path: + return + try: + f = open(config_path, 'r') + config = json.load(f) + f.close() + except IOError: + raise Exception('Unable to open file ' + config_path) + except ValueError as e: + raise Exception('Unable to parse config file ' + config_path + str(e)) + if not isinstance(config, dict): + raise Exception('config_path must be a JSON file containing a dictionary') + self.files = config.get('files', []) + self.additional_compile_target_names = set( + config.get('additional_compile_targets', [])) + self.test_target_names = set(config.get('test_targets', [])) + + +def _WasBuildFileModified(build_file, data, files, toplevel_dir): + """Returns true if the build file |build_file| is either in |files| or + one of the files included by |build_file| is in |files|. |toplevel_dir| is + the root of the source tree.""" + if _ToLocalPath(toplevel_dir, _ToGypPath(build_file)) in files: + if debug: + print 'gyp file modified', build_file + return True + + # First element of included_files is the file itself. + if len(data[build_file]['included_files']) <= 1: + return False + + for include_file in data[build_file]['included_files'][1:]: + # |included_files| are relative to the directory of the |build_file|. + rel_include_file = \ + _ToGypPath(gyp.common.UnrelativePath(include_file, build_file)) + if _ToLocalPath(toplevel_dir, rel_include_file) in files: + if debug: + print 'included gyp file modified, gyp_file=', build_file, \ + 'included file=', rel_include_file + return True + return False + + +def _GetOrCreateTargetByName(targets, target_name): + """Creates or returns the Target at targets[target_name]. If there is no + Target for |target_name| one is created. Returns a tuple of whether a new + Target was created and the Target.""" + if target_name in targets: + return False, targets[target_name] + target = Target(target_name) + targets[target_name] = target + return True, target + + +def _DoesTargetTypeRequireBuild(target_dict): + """Returns true if the target type is such that it needs to be built.""" + # If a 'none' target has rules or actions we assume it requires a build. + return bool(target_dict['type'] != 'none' or + target_dict.get('actions') or target_dict.get('rules')) + + +def _GenerateTargets(data, target_list, target_dicts, toplevel_dir, files, + build_files): + """Returns a tuple of the following: + . A dictionary mapping from fully qualified name to Target. + . A list of the targets that have a source file in |files|. + . Targets that constitute the 'all' target. See description at top of file + for details on the 'all' target. + This sets the |match_status| of the targets that contain any of the source + files in |files| to MATCH_STATUS_MATCHES. + |toplevel_dir| is the root of the source tree.""" + # Maps from target name to Target. + name_to_target = {} + + # Targets that matched. + matching_targets = [] + + # Queue of targets to visit. + targets_to_visit = target_list[:] + + # Maps from build file to a boolean indicating whether the build file is in + # |files|. + build_file_in_files = {} + + # Root targets across all files. + roots = set() + + # Set of Targets in |build_files|. + build_file_targets = set() + + while len(targets_to_visit) > 0: + target_name = targets_to_visit.pop() + created_target, target = _GetOrCreateTargetByName(name_to_target, + target_name) + if created_target: + roots.add(target) + elif target.visited: + continue + + target.visited = True + target.requires_build = _DoesTargetTypeRequireBuild( + target_dicts[target_name]) + target_type = target_dicts[target_name]['type'] + target.is_executable = target_type == 'executable' + target.is_static_library = target_type == 'static_library' + target.is_or_has_linked_ancestor = (target_type == 'executable' or + target_type == 'shared_library') + + build_file = gyp.common.ParseQualifiedTarget(target_name)[0] + if not build_file in build_file_in_files: + build_file_in_files[build_file] = \ + _WasBuildFileModified(build_file, data, files, toplevel_dir) + + if build_file in build_files: + build_file_targets.add(target) + + # If a build file (or any of its included files) is modified we assume all + # targets in the file are modified. + if build_file_in_files[build_file]: + print 'matching target from modified build file', target_name + target.match_status = MATCH_STATUS_MATCHES + matching_targets.append(target) + else: + sources = _ExtractSources(target_name, target_dicts[target_name], + toplevel_dir) + for source in sources: + if _ToGypPath(os.path.normpath(source)) in files: + print 'target', target_name, 'matches', source + target.match_status = MATCH_STATUS_MATCHES + matching_targets.append(target) + break + + # Add dependencies to visit as well as updating back pointers for deps. + for dep in target_dicts[target_name].get('dependencies', []): + targets_to_visit.append(dep) + + created_dep_target, dep_target = _GetOrCreateTargetByName(name_to_target, + dep) + if not created_dep_target: + roots.discard(dep_target) + + target.deps.add(dep_target) + dep_target.back_deps.add(target) + + return name_to_target, matching_targets, roots & build_file_targets + + +def _GetUnqualifiedToTargetMapping(all_targets, to_find): + """Returns a tuple of the following: + . mapping (dictionary) from unqualified name to Target for all the + Targets in |to_find|. + . any target names not found. If this is empty all targets were found.""" + result = {} + if not to_find: + return {}, [] + to_find = set(to_find) + for target_name in all_targets.keys(): + extracted = gyp.common.ParseQualifiedTarget(target_name) + if len(extracted) > 1 and extracted[1] in to_find: + to_find.remove(extracted[1]) + result[extracted[1]] = all_targets[target_name] + if not to_find: + return result, [] + return result, [x for x in to_find] + + +def _DoesTargetDependOnMatchingTargets(target): + """Returns true if |target| or any of its dependencies is one of the + targets containing the files supplied as input to analyzer. This updates + |matches| of the Targets as it recurses. + target: the Target to look for.""" + if target.match_status == MATCH_STATUS_DOESNT_MATCH: + return False + if target.match_status == MATCH_STATUS_MATCHES or \ + target.match_status == MATCH_STATUS_MATCHES_BY_DEPENDENCY: + return True + for dep in target.deps: + if _DoesTargetDependOnMatchingTargets(dep): + target.match_status = MATCH_STATUS_MATCHES_BY_DEPENDENCY + print '\t', target.name, 'matches by dep', dep.name + return True + target.match_status = MATCH_STATUS_DOESNT_MATCH + return False + + +def _GetTargetsDependingOnMatchingTargets(possible_targets): + """Returns the list of Targets in |possible_targets| that depend (either + directly on indirectly) on at least one of the targets containing the files + supplied as input to analyzer. + possible_targets: targets to search from.""" + found = [] + print 'Targets that matched by dependency:' + for target in possible_targets: + if _DoesTargetDependOnMatchingTargets(target): + found.append(target) + return found + + +def _AddCompileTargets(target, roots, add_if_no_ancestor, result): + """Recurses through all targets that depend on |target|, adding all targets + that need to be built (and are in |roots|) to |result|. + roots: set of root targets. + add_if_no_ancestor: If true and there are no ancestors of |target| then add + |target| to |result|. |target| must still be in |roots|. + result: targets that need to be built are added here.""" + if target.visited: + return + + target.visited = True + target.in_roots = target in roots + + for back_dep_target in target.back_deps: + _AddCompileTargets(back_dep_target, roots, False, result) + target.added_to_compile_targets |= back_dep_target.added_to_compile_targets + target.in_roots |= back_dep_target.in_roots + target.is_or_has_linked_ancestor |= ( + back_dep_target.is_or_has_linked_ancestor) + + # Always add 'executable' targets. Even though they may be built by other + # targets that depend upon them it makes detection of what is going to be + # built easier. + # And always add static_libraries that have no dependencies on them from + # linkables. This is necessary as the other dependencies on them may be + # static libraries themselves, which are not compile time dependencies. + if target.in_roots and \ + (target.is_executable or + (not target.added_to_compile_targets and + (add_if_no_ancestor or target.requires_build)) or + (target.is_static_library and add_if_no_ancestor and + not target.is_or_has_linked_ancestor)): + print '\t\tadding to compile targets', target.name, 'executable', \ + target.is_executable, 'added_to_compile_targets', \ + target.added_to_compile_targets, 'add_if_no_ancestor', \ + add_if_no_ancestor, 'requires_build', target.requires_build, \ + 'is_static_library', target.is_static_library, \ + 'is_or_has_linked_ancestor', target.is_or_has_linked_ancestor + result.add(target) + target.added_to_compile_targets = True + + +def _GetCompileTargets(matching_targets, supplied_targets): + """Returns the set of Targets that require a build. + matching_targets: targets that changed and need to be built. + supplied_targets: set of targets supplied to analyzer to search from.""" + result = set() + for target in matching_targets: + print 'finding compile targets for match', target.name + _AddCompileTargets(target, supplied_targets, True, result) + return result + + +def _WriteOutput(params, **values): + """Writes the output, either to stdout or a file is specified.""" + if 'error' in values: + print 'Error:', values['error'] + if 'status' in values: + print values['status'] + if 'targets' in values: + values['targets'].sort() + print 'Supplied targets that depend on changed files:' + for target in values['targets']: + print '\t', target + if 'invalid_targets' in values: + values['invalid_targets'].sort() + print 'The following targets were not found:' + for target in values['invalid_targets']: + print '\t', target + if 'build_targets' in values: + values['build_targets'].sort() + print 'Targets that require a build:' + for target in values['build_targets']: + print '\t', target + if 'compile_targets' in values: + values['compile_targets'].sort() + print 'Targets that need to be built:' + for target in values['compile_targets']: + print '\t', target + if 'test_targets' in values: + values['test_targets'].sort() + print 'Test targets:' + for target in values['test_targets']: + print '\t', target + + output_path = params.get('generator_flags', {}).get( + 'analyzer_output_path', None) + if not output_path: + print json.dumps(values) + return + try: + f = open(output_path, 'w') + f.write(json.dumps(values) + '\n') + f.close() + except IOError as e: + print 'Error writing to output file', output_path, str(e) + + +def _WasGypIncludeFileModified(params, files): + """Returns true if one of the files in |files| is in the set of included + files.""" + if params['options'].includes: + for include in params['options'].includes: + if _ToGypPath(os.path.normpath(include)) in files: + print 'Include file modified, assuming all changed', include + return True + return False + + +def _NamesNotIn(names, mapping): + """Returns a list of the values in |names| that are not in |mapping|.""" + return [name for name in names if name not in mapping] + + +def _LookupTargets(names, mapping): + """Returns a list of the mapping[name] for each value in |names| that is in + |mapping|.""" + return [mapping[name] for name in names if name in mapping] + + +def CalculateVariables(default_variables, params): + """Calculate additional variables for use in the build (called by gyp).""" + flavor = gyp.common.GetFlavor(params) + if flavor == 'mac': + default_variables.setdefault('OS', 'mac') + elif flavor == 'win': + default_variables.setdefault('OS', 'win') + # Copy additional generator configuration data from VS, which is shared + # by the Windows Ninja generator. + import gyp.generator.msvs as msvs_generator + generator_additional_non_configuration_keys = getattr(msvs_generator, + 'generator_additional_non_configuration_keys', []) + generator_additional_path_sections = getattr(msvs_generator, + 'generator_additional_path_sections', []) + + gyp.msvs_emulation.CalculateCommonVariables(default_variables, params) + else: + operating_system = flavor + if flavor == 'android': + operating_system = 'linux' # Keep this legacy behavior for now. + default_variables.setdefault('OS', operating_system) + + +class TargetCalculator(object): + """Calculates the matching test_targets and matching compile_targets.""" + def __init__(self, files, additional_compile_target_names, test_target_names, + data, target_list, target_dicts, toplevel_dir, build_files): + self._additional_compile_target_names = set(additional_compile_target_names) + self._test_target_names = set(test_target_names) + self._name_to_target, self._changed_targets, self._root_targets = ( + _GenerateTargets(data, target_list, target_dicts, toplevel_dir, + frozenset(files), build_files)) + self._unqualified_mapping, self.invalid_targets = ( + _GetUnqualifiedToTargetMapping(self._name_to_target, + self._supplied_target_names_no_all())) + + def _supplied_target_names(self): + return self._additional_compile_target_names | self._test_target_names + + def _supplied_target_names_no_all(self): + """Returns the supplied test targets without 'all'.""" + result = self._supplied_target_names(); + result.discard('all') + return result + + def is_build_impacted(self): + """Returns true if the supplied files impact the build at all.""" + return self._changed_targets + + def find_matching_test_target_names(self): + """Returns the set of output test targets.""" + assert self.is_build_impacted() + # Find the test targets first. 'all' is special cased to mean all the + # root targets. To deal with all the supplied |test_targets| are expanded + # to include the root targets during lookup. If any of the root targets + # match, we remove it and replace it with 'all'. + test_target_names_no_all = set(self._test_target_names) + test_target_names_no_all.discard('all') + test_targets_no_all = _LookupTargets(test_target_names_no_all, + self._unqualified_mapping) + test_target_names_contains_all = 'all' in self._test_target_names + if test_target_names_contains_all: + test_targets = [x for x in (set(test_targets_no_all) | + set(self._root_targets))] + else: + test_targets = [x for x in test_targets_no_all] + print 'supplied test_targets' + for target_name in self._test_target_names: + print '\t', target_name + print 'found test_targets' + for target in test_targets: + print '\t', target.name + print 'searching for matching test targets' + matching_test_targets = _GetTargetsDependingOnMatchingTargets(test_targets) + matching_test_targets_contains_all = (test_target_names_contains_all and + set(matching_test_targets) & + set(self._root_targets)) + if matching_test_targets_contains_all: + # Remove any of the targets for all that were not explicitly supplied, + # 'all' is subsequentely added to the matching names below. + matching_test_targets = [x for x in (set(matching_test_targets) & + set(test_targets_no_all))] + print 'matched test_targets' + for target in matching_test_targets: + print '\t', target.name + matching_target_names = [gyp.common.ParseQualifiedTarget(target.name)[1] + for target in matching_test_targets] + if matching_test_targets_contains_all: + matching_target_names.append('all') + print '\tall' + return matching_target_names + + def find_matching_compile_target_names(self): + """Returns the set of output compile targets.""" + assert self.is_build_impacted(); + # Compile targets are found by searching up from changed targets. + # Reset the visited status for _GetBuildTargets. + for target in self._name_to_target.itervalues(): + target.visited = False + + supplied_targets = _LookupTargets(self._supplied_target_names_no_all(), + self._unqualified_mapping) + if 'all' in self._supplied_target_names(): + supplied_targets = [x for x in (set(supplied_targets) | + set(self._root_targets))] + print 'Supplied test_targets & compile_targets' + for target in supplied_targets: + print '\t', target.name + print 'Finding compile targets' + compile_targets = _GetCompileTargets(self._changed_targets, + supplied_targets) + return [gyp.common.ParseQualifiedTarget(target.name)[1] + for target in compile_targets] + + +def GenerateOutput(target_list, target_dicts, data, params): + """Called by gyp as the final stage. Outputs results.""" + config = Config() + try: + config.Init(params) + + if not config.files: + raise Exception('Must specify files to analyze via config_path generator ' + 'flag') + + toplevel_dir = _ToGypPath(os.path.abspath(params['options'].toplevel_dir)) + if debug: + print 'toplevel_dir', toplevel_dir + + if _WasGypIncludeFileModified(params, config.files): + result_dict = { 'status': all_changed_string, + 'test_targets': list(config.test_target_names), + 'compile_targets': list( + config.additional_compile_target_names | + config.test_target_names) } + _WriteOutput(params, **result_dict) + return + + calculator = TargetCalculator(config.files, + config.additional_compile_target_names, + config.test_target_names, data, + target_list, target_dicts, toplevel_dir, + params['build_files']) + if not calculator.is_build_impacted(): + result_dict = { 'status': no_dependency_string, + 'test_targets': [], + 'compile_targets': [] } + if calculator.invalid_targets: + result_dict['invalid_targets'] = calculator.invalid_targets + _WriteOutput(params, **result_dict) + return + + test_target_names = calculator.find_matching_test_target_names() + compile_target_names = calculator.find_matching_compile_target_names() + found_at_least_one_target = compile_target_names or test_target_names + result_dict = { 'test_targets': test_target_names, + 'status': found_dependency_string if + found_at_least_one_target else no_dependency_string, + 'compile_targets': list( + set(compile_target_names) | + set(test_target_names)) } + if calculator.invalid_targets: + result_dict['invalid_targets'] = calculator.invalid_targets + _WriteOutput(params, **result_dict) + + except Exception as e: + _WriteOutput(params, error=str(e)) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py new file mode 100644 index 00000000..5b26cc78 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py @@ -0,0 +1,1095 @@ +# Copyright (c) 2012 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Notes: +# +# This generates makefiles suitable for inclusion into the Android build system +# via an Android.mk file. It is based on make.py, the standard makefile +# generator. +# +# The code below generates a separate .mk file for each target, but +# all are sourced by the top-level GypAndroid.mk. This means that all +# variables in .mk-files clobber one another, and furthermore that any +# variables set potentially clash with other Android build system variables. +# Try to avoid setting global variables where possible. + +import gyp +import gyp.common +import gyp.generator.make as make # Reuse global functions from make backend. +import os +import re +import subprocess + +generator_default_variables = { + 'OS': 'android', + 'EXECUTABLE_PREFIX': '', + 'EXECUTABLE_SUFFIX': '', + 'STATIC_LIB_PREFIX': 'lib', + 'SHARED_LIB_PREFIX': 'lib', + 'STATIC_LIB_SUFFIX': '.a', + 'SHARED_LIB_SUFFIX': '.so', + 'INTERMEDIATE_DIR': '$(gyp_intermediate_dir)', + 'SHARED_INTERMEDIATE_DIR': '$(gyp_shared_intermediate_dir)', + 'PRODUCT_DIR': '$(gyp_shared_intermediate_dir)', + 'SHARED_LIB_DIR': '$(builddir)/lib.$(TOOLSET)', + 'LIB_DIR': '$(obj).$(TOOLSET)', + 'RULE_INPUT_ROOT': '%(INPUT_ROOT)s', # This gets expanded by Python. + 'RULE_INPUT_DIRNAME': '%(INPUT_DIRNAME)s', # This gets expanded by Python. + 'RULE_INPUT_PATH': '$(RULE_SOURCES)', + 'RULE_INPUT_EXT': '$(suffix $<)', + 'RULE_INPUT_NAME': '$(notdir $<)', + 'CONFIGURATION_NAME': '$(GYP_CONFIGURATION)', +} + +# Make supports multiple toolsets +generator_supports_multiple_toolsets = True + + +# Generator-specific gyp specs. +generator_additional_non_configuration_keys = [ + # Boolean to declare that this target does not want its name mangled. + 'android_unmangled_name', + # Map of android build system variables to set. + 'aosp_build_settings', +] +generator_additional_path_sections = [] +generator_extra_sources_for_rules = [] + + +ALL_MODULES_FOOTER = """\ +# "gyp_all_modules" is a concatenation of the "gyp_all_modules" targets from +# all the included sub-makefiles. This is just here to clarify. +gyp_all_modules: +""" + +header = """\ +# This file is generated by gyp; do not edit. + +""" + +# Map gyp target types to Android module classes. +MODULE_CLASSES = { + 'static_library': 'STATIC_LIBRARIES', + 'shared_library': 'SHARED_LIBRARIES', + 'executable': 'EXECUTABLES', +} + + +def IsCPPExtension(ext): + return make.COMPILABLE_EXTENSIONS.get(ext) == 'cxx' + + +def Sourceify(path): + """Convert a path to its source directory form. The Android backend does not + support options.generator_output, so this function is a noop.""" + return path + + +# Map from qualified target to path to output. +# For Android, the target of these maps is a tuple ('static', 'modulename'), +# ('dynamic', 'modulename'), or ('path', 'some/path') instead of a string, +# since we link by module. +target_outputs = {} +# Map from qualified target to any linkable output. A subset +# of target_outputs. E.g. when mybinary depends on liba, we want to +# include liba in the linker line; when otherbinary depends on +# mybinary, we just want to build mybinary first. +target_link_deps = {} + + +class AndroidMkWriter(object): + """AndroidMkWriter packages up the writing of one target-specific Android.mk. + + Its only real entry point is Write(), and is mostly used for namespacing. + """ + + def __init__(self, android_top_dir): + self.android_top_dir = android_top_dir + + def Write(self, qualified_target, relative_target, base_path, output_filename, + spec, configs, part_of_all, write_alias_target, sdk_version): + """The main entry point: writes a .mk file for a single target. + + Arguments: + qualified_target: target we're generating + relative_target: qualified target name relative to the root + base_path: path relative to source root we're building in, used to resolve + target-relative paths + output_filename: output .mk file name to write + spec, configs: gyp info + part_of_all: flag indicating this target is part of 'all' + write_alias_target: flag indicating whether to create short aliases for + this target + sdk_version: what to emit for LOCAL_SDK_VERSION in output + """ + gyp.common.EnsureDirExists(output_filename) + + self.fp = open(output_filename, 'w') + + self.fp.write(header) + + self.qualified_target = qualified_target + self.relative_target = relative_target + self.path = base_path + self.target = spec['target_name'] + self.type = spec['type'] + self.toolset = spec['toolset'] + + deps, link_deps = self.ComputeDeps(spec) + + # Some of the generation below can add extra output, sources, or + # link dependencies. All of the out params of the functions that + # follow use names like extra_foo. + extra_outputs = [] + extra_sources = [] + + self.android_class = MODULE_CLASSES.get(self.type, 'GYP') + self.android_module = self.ComputeAndroidModule(spec) + (self.android_stem, self.android_suffix) = self.ComputeOutputParts(spec) + self.output = self.output_binary = self.ComputeOutput(spec) + + # Standard header. + self.WriteLn('include $(CLEAR_VARS)\n') + + # Module class and name. + self.WriteLn('LOCAL_MODULE_CLASS := ' + self.android_class) + self.WriteLn('LOCAL_MODULE := ' + self.android_module) + # Only emit LOCAL_MODULE_STEM if it's different to LOCAL_MODULE. + # The library module classes fail if the stem is set. ComputeOutputParts + # makes sure that stem == modulename in these cases. + if self.android_stem != self.android_module: + self.WriteLn('LOCAL_MODULE_STEM := ' + self.android_stem) + self.WriteLn('LOCAL_MODULE_SUFFIX := ' + self.android_suffix) + if self.toolset == 'host': + self.WriteLn('LOCAL_IS_HOST_MODULE := true') + self.WriteLn('LOCAL_MULTILIB := $(GYP_HOST_MULTILIB)') + elif sdk_version > 0: + self.WriteLn('LOCAL_MODULE_TARGET_ARCH := ' + '$(TARGET_$(GYP_VAR_PREFIX)ARCH)') + self.WriteLn('LOCAL_SDK_VERSION := %s' % sdk_version) + + # Grab output directories; needed for Actions and Rules. + if self.toolset == 'host': + self.WriteLn('gyp_intermediate_dir := ' + '$(call local-intermediates-dir,,$(GYP_HOST_VAR_PREFIX))') + else: + self.WriteLn('gyp_intermediate_dir := ' + '$(call local-intermediates-dir,,$(GYP_VAR_PREFIX))') + self.WriteLn('gyp_shared_intermediate_dir := ' + '$(call intermediates-dir-for,GYP,shared,,,$(GYP_VAR_PREFIX))') + self.WriteLn() + + # List files this target depends on so that actions/rules/copies/sources + # can depend on the list. + # TODO: doesn't pull in things through transitive link deps; needed? + target_dependencies = [x[1] for x in deps if x[0] == 'path'] + self.WriteLn('# Make sure our deps are built first.') + self.WriteList(target_dependencies, 'GYP_TARGET_DEPENDENCIES', + local_pathify=True) + + # Actions must come first, since they can generate more OBJs for use below. + if 'actions' in spec: + self.WriteActions(spec['actions'], extra_sources, extra_outputs) + + # Rules must be early like actions. + if 'rules' in spec: + self.WriteRules(spec['rules'], extra_sources, extra_outputs) + + if 'copies' in spec: + self.WriteCopies(spec['copies'], extra_outputs) + + # GYP generated outputs. + self.WriteList(extra_outputs, 'GYP_GENERATED_OUTPUTS', local_pathify=True) + + # Set LOCAL_ADDITIONAL_DEPENDENCIES so that Android's build rules depend + # on both our dependency targets and our generated files. + self.WriteLn('# Make sure our deps and generated files are built first.') + self.WriteLn('LOCAL_ADDITIONAL_DEPENDENCIES := $(GYP_TARGET_DEPENDENCIES) ' + '$(GYP_GENERATED_OUTPUTS)') + self.WriteLn() + + # Sources. + if spec.get('sources', []) or extra_sources: + self.WriteSources(spec, configs, extra_sources) + + self.WriteTarget(spec, configs, deps, link_deps, part_of_all, + write_alias_target) + + # Update global list of target outputs, used in dependency tracking. + target_outputs[qualified_target] = ('path', self.output_binary) + + # Update global list of link dependencies. + if self.type == 'static_library': + target_link_deps[qualified_target] = ('static', self.android_module) + elif self.type == 'shared_library': + target_link_deps[qualified_target] = ('shared', self.android_module) + + self.fp.close() + return self.android_module + + + def WriteActions(self, actions, extra_sources, extra_outputs): + """Write Makefile code for any 'actions' from the gyp input. + + extra_sources: a list that will be filled in with newly generated source + files, if any + extra_outputs: a list that will be filled in with any outputs of these + actions (used to make other pieces dependent on these + actions) + """ + for action in actions: + name = make.StringToMakefileVariable('%s_%s' % (self.relative_target, + action['action_name'])) + self.WriteLn('### Rules for action "%s":' % action['action_name']) + inputs = action['inputs'] + outputs = action['outputs'] + + # Build up a list of outputs. + # Collect the output dirs we'll need. + dirs = set() + for out in outputs: + if not out.startswith('$'): + print ('WARNING: Action for target "%s" writes output to local path ' + '"%s".' % (self.target, out)) + dir = os.path.split(out)[0] + if dir: + dirs.add(dir) + if int(action.get('process_outputs_as_sources', False)): + extra_sources += outputs + + # Prepare the actual command. + command = gyp.common.EncodePOSIXShellList(action['action']) + if 'message' in action: + quiet_cmd = 'Gyp action: %s ($@)' % action['message'] + else: + quiet_cmd = 'Gyp action: %s ($@)' % name + if len(dirs) > 0: + command = 'mkdir -p %s' % ' '.join(dirs) + '; ' + command + + cd_action = 'cd $(gyp_local_path)/%s; ' % self.path + command = cd_action + command + + # The makefile rules are all relative to the top dir, but the gyp actions + # are defined relative to their containing dir. This replaces the gyp_* + # variables for the action rule with an absolute version so that the + # output goes in the right place. + # Only write the gyp_* rules for the "primary" output (:1); + # it's superfluous for the "extra outputs", and this avoids accidentally + # writing duplicate dummy rules for those outputs. + main_output = make.QuoteSpaces(self.LocalPathify(outputs[0])) + self.WriteLn('%s: gyp_local_path := $(LOCAL_PATH)' % main_output) + self.WriteLn('%s: gyp_var_prefix := $(GYP_VAR_PREFIX)' % main_output) + self.WriteLn('%s: gyp_intermediate_dir := ' + '$(abspath $(gyp_intermediate_dir))' % main_output) + self.WriteLn('%s: gyp_shared_intermediate_dir := ' + '$(abspath $(gyp_shared_intermediate_dir))' % main_output) + + # Android's envsetup.sh adds a number of directories to the path including + # the built host binary directory. This causes actions/rules invoked by + # gyp to sometimes use these instead of system versions, e.g. bison. + # The built host binaries may not be suitable, and can cause errors. + # So, we remove them from the PATH using the ANDROID_BUILD_PATHS variable + # set by envsetup. + self.WriteLn('%s: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))' + % main_output) + + # Don't allow spaces in input/output filenames, but make an exception for + # filenames which start with '$(' since it's okay for there to be spaces + # inside of make function/macro invocations. + for input in inputs: + if not input.startswith('$(') and ' ' in input: + raise gyp.common.GypError( + 'Action input filename "%s" in target %s contains a space' % + (input, self.target)) + for output in outputs: + if not output.startswith('$(') and ' ' in output: + raise gyp.common.GypError( + 'Action output filename "%s" in target %s contains a space' % + (output, self.target)) + + self.WriteLn('%s: %s $(GYP_TARGET_DEPENDENCIES)' % + (main_output, ' '.join(map(self.LocalPathify, inputs)))) + self.WriteLn('\t@echo "%s"' % quiet_cmd) + self.WriteLn('\t$(hide)%s\n' % command) + for output in outputs[1:]: + # Make each output depend on the main output, with an empty command + # to force make to notice that the mtime has changed. + self.WriteLn('%s: %s ;' % (self.LocalPathify(output), main_output)) + + extra_outputs += outputs + self.WriteLn() + + self.WriteLn() + + + def WriteRules(self, rules, extra_sources, extra_outputs): + """Write Makefile code for any 'rules' from the gyp input. + + extra_sources: a list that will be filled in with newly generated source + files, if any + extra_outputs: a list that will be filled in with any outputs of these + rules (used to make other pieces dependent on these rules) + """ + if len(rules) == 0: + return + + for rule in rules: + if len(rule.get('rule_sources', [])) == 0: + continue + name = make.StringToMakefileVariable('%s_%s' % (self.relative_target, + rule['rule_name'])) + self.WriteLn('\n### Generated for rule "%s":' % name) + self.WriteLn('# "%s":' % rule) + + inputs = rule.get('inputs') + for rule_source in rule.get('rule_sources', []): + (rule_source_dirname, rule_source_basename) = os.path.split(rule_source) + (rule_source_root, rule_source_ext) = \ + os.path.splitext(rule_source_basename) + + outputs = [self.ExpandInputRoot(out, rule_source_root, + rule_source_dirname) + for out in rule['outputs']] + + dirs = set() + for out in outputs: + if not out.startswith('$'): + print ('WARNING: Rule for target %s writes output to local path %s' + % (self.target, out)) + dir = os.path.dirname(out) + if dir: + dirs.add(dir) + extra_outputs += outputs + if int(rule.get('process_outputs_as_sources', False)): + extra_sources.extend(outputs) + + components = [] + for component in rule['action']: + component = self.ExpandInputRoot(component, rule_source_root, + rule_source_dirname) + if '$(RULE_SOURCES)' in component: + component = component.replace('$(RULE_SOURCES)', + rule_source) + components.append(component) + + command = gyp.common.EncodePOSIXShellList(components) + cd_action = 'cd $(gyp_local_path)/%s; ' % self.path + command = cd_action + command + if dirs: + command = 'mkdir -p %s' % ' '.join(dirs) + '; ' + command + + # We set up a rule to build the first output, and then set up + # a rule for each additional output to depend on the first. + outputs = map(self.LocalPathify, outputs) + main_output = outputs[0] + self.WriteLn('%s: gyp_local_path := $(LOCAL_PATH)' % main_output) + self.WriteLn('%s: gyp_var_prefix := $(GYP_VAR_PREFIX)' % main_output) + self.WriteLn('%s: gyp_intermediate_dir := ' + '$(abspath $(gyp_intermediate_dir))' % main_output) + self.WriteLn('%s: gyp_shared_intermediate_dir := ' + '$(abspath $(gyp_shared_intermediate_dir))' % main_output) + + # See explanation in WriteActions. + self.WriteLn('%s: export PATH := ' + '$(subst $(ANDROID_BUILD_PATHS),,$(PATH))' % main_output) + + main_output_deps = self.LocalPathify(rule_source) + if inputs: + main_output_deps += ' ' + main_output_deps += ' '.join([self.LocalPathify(f) for f in inputs]) + + self.WriteLn('%s: %s $(GYP_TARGET_DEPENDENCIES)' % + (main_output, main_output_deps)) + self.WriteLn('\t%s\n' % command) + for output in outputs[1:]: + # Make each output depend on the main output, with an empty command + # to force make to notice that the mtime has changed. + self.WriteLn('%s: %s ;' % (output, main_output)) + self.WriteLn() + + self.WriteLn() + + + def WriteCopies(self, copies, extra_outputs): + """Write Makefile code for any 'copies' from the gyp input. + + extra_outputs: a list that will be filled in with any outputs of this action + (used to make other pieces dependent on this action) + """ + self.WriteLn('### Generated for copy rule.') + + variable = make.StringToMakefileVariable(self.relative_target + '_copies') + outputs = [] + for copy in copies: + for path in copy['files']: + # The Android build system does not allow generation of files into the + # source tree. The destination should start with a variable, which will + # typically be $(gyp_intermediate_dir) or + # $(gyp_shared_intermediate_dir). Note that we can't use an assertion + # because some of the gyp tests depend on this. + if not copy['destination'].startswith('$'): + print ('WARNING: Copy rule for target %s writes output to ' + 'local path %s' % (self.target, copy['destination'])) + + # LocalPathify() calls normpath, stripping trailing slashes. + path = Sourceify(self.LocalPathify(path)) + filename = os.path.split(path)[1] + output = Sourceify(self.LocalPathify(os.path.join(copy['destination'], + filename))) + + self.WriteLn('%s: %s $(GYP_TARGET_DEPENDENCIES) | $(ACP)' % + (output, path)) + self.WriteLn('\t@echo Copying: $@') + self.WriteLn('\t$(hide) mkdir -p $(dir $@)') + self.WriteLn('\t$(hide) $(ACP) -rpf $< $@') + self.WriteLn() + outputs.append(output) + self.WriteLn('%s = %s' % (variable, + ' '.join(map(make.QuoteSpaces, outputs)))) + extra_outputs.append('$(%s)' % variable) + self.WriteLn() + + + def WriteSourceFlags(self, spec, configs): + """Write out the flags and include paths used to compile source files for + the current target. + + Args: + spec, configs: input from gyp. + """ + for configname, config in sorted(configs.iteritems()): + extracted_includes = [] + + self.WriteLn('\n# Flags passed to both C and C++ files.') + cflags, includes_from_cflags = self.ExtractIncludesFromCFlags( + config.get('cflags', []) + config.get('cflags_c', [])) + extracted_includes.extend(includes_from_cflags) + self.WriteList(cflags, 'MY_CFLAGS_%s' % configname) + + self.WriteList(config.get('defines'), 'MY_DEFS_%s' % configname, + prefix='-D', quoter=make.EscapeCppDefine) + + self.WriteLn('\n# Include paths placed before CFLAGS/CPPFLAGS') + includes = list(config.get('include_dirs', [])) + includes.extend(extracted_includes) + includes = map(Sourceify, map(self.LocalPathify, includes)) + includes = self.NormalizeIncludePaths(includes) + self.WriteList(includes, 'LOCAL_C_INCLUDES_%s' % configname) + + self.WriteLn('\n# Flags passed to only C++ (and not C) files.') + self.WriteList(config.get('cflags_cc'), 'LOCAL_CPPFLAGS_%s' % configname) + + self.WriteLn('\nLOCAL_CFLAGS := $(MY_CFLAGS_$(GYP_CONFIGURATION)) ' + '$(MY_DEFS_$(GYP_CONFIGURATION))') + # Undefine ANDROID for host modules + # TODO: the source code should not use macro ANDROID to tell if it's host + # or target module. + if self.toolset == 'host': + self.WriteLn('# Undefine ANDROID for host modules') + self.WriteLn('LOCAL_CFLAGS += -UANDROID') + self.WriteLn('LOCAL_C_INCLUDES := $(GYP_COPIED_SOURCE_ORIGIN_DIRS) ' + '$(LOCAL_C_INCLUDES_$(GYP_CONFIGURATION))') + self.WriteLn('LOCAL_CPPFLAGS := $(LOCAL_CPPFLAGS_$(GYP_CONFIGURATION))') + # Android uses separate flags for assembly file invocations, but gyp expects + # the same CFLAGS to be applied: + self.WriteLn('LOCAL_ASFLAGS := $(LOCAL_CFLAGS)') + + + def WriteSources(self, spec, configs, extra_sources): + """Write Makefile code for any 'sources' from the gyp input. + These are source files necessary to build the current target. + We need to handle shared_intermediate directory source files as + a special case by copying them to the intermediate directory and + treating them as a genereated sources. Otherwise the Android build + rules won't pick them up. + + Args: + spec, configs: input from gyp. + extra_sources: Sources generated from Actions or Rules. + """ + sources = filter(make.Compilable, spec.get('sources', [])) + generated_not_sources = [x for x in extra_sources if not make.Compilable(x)] + extra_sources = filter(make.Compilable, extra_sources) + + # Determine and output the C++ extension used by these sources. + # We simply find the first C++ file and use that extension. + all_sources = sources + extra_sources + local_cpp_extension = '.cpp' + for source in all_sources: + (root, ext) = os.path.splitext(source) + if IsCPPExtension(ext): + local_cpp_extension = ext + break + if local_cpp_extension != '.cpp': + self.WriteLn('LOCAL_CPP_EXTENSION := %s' % local_cpp_extension) + + # We need to move any non-generated sources that are coming from the + # shared intermediate directory out of LOCAL_SRC_FILES and put them + # into LOCAL_GENERATED_SOURCES. We also need to move over any C++ files + # that don't match our local_cpp_extension, since Android will only + # generate Makefile rules for a single LOCAL_CPP_EXTENSION. + local_files = [] + for source in sources: + (root, ext) = os.path.splitext(source) + if '$(gyp_shared_intermediate_dir)' in source: + extra_sources.append(source) + elif '$(gyp_intermediate_dir)' in source: + extra_sources.append(source) + elif IsCPPExtension(ext) and ext != local_cpp_extension: + extra_sources.append(source) + else: + local_files.append(os.path.normpath(os.path.join(self.path, source))) + + # For any generated source, if it is coming from the shared intermediate + # directory then we add a Make rule to copy them to the local intermediate + # directory first. This is because the Android LOCAL_GENERATED_SOURCES + # must be in the local module intermediate directory for the compile rules + # to work properly. If the file has the wrong C++ extension, then we add + # a rule to copy that to intermediates and use the new version. + final_generated_sources = [] + # If a source file gets copied, we still need to add the orginal source + # directory as header search path, for GCC searches headers in the + # directory that contains the source file by default. + origin_src_dirs = [] + for source in extra_sources: + local_file = source + if not '$(gyp_intermediate_dir)/' in local_file: + basename = os.path.basename(local_file) + local_file = '$(gyp_intermediate_dir)/' + basename + (root, ext) = os.path.splitext(local_file) + if IsCPPExtension(ext) and ext != local_cpp_extension: + local_file = root + local_cpp_extension + if local_file != source: + self.WriteLn('%s: %s' % (local_file, self.LocalPathify(source))) + self.WriteLn('\tmkdir -p $(@D); cp $< $@') + origin_src_dirs.append(os.path.dirname(source)) + final_generated_sources.append(local_file) + + # We add back in all of the non-compilable stuff to make sure that the + # make rules have dependencies on them. + final_generated_sources.extend(generated_not_sources) + self.WriteList(final_generated_sources, 'LOCAL_GENERATED_SOURCES') + + origin_src_dirs = gyp.common.uniquer(origin_src_dirs) + origin_src_dirs = map(Sourceify, map(self.LocalPathify, origin_src_dirs)) + self.WriteList(origin_src_dirs, 'GYP_COPIED_SOURCE_ORIGIN_DIRS') + + self.WriteList(local_files, 'LOCAL_SRC_FILES') + + # Write out the flags used to compile the source; this must be done last + # so that GYP_COPIED_SOURCE_ORIGIN_DIRS can be used as an include path. + self.WriteSourceFlags(spec, configs) + + + def ComputeAndroidModule(self, spec): + """Return the Android module name used for a gyp spec. + + We use the complete qualified target name to avoid collisions between + duplicate targets in different directories. We also add a suffix to + distinguish gyp-generated module names. + """ + + if int(spec.get('android_unmangled_name', 0)): + assert self.type != 'shared_library' or self.target.startswith('lib') + return self.target + + if self.type == 'shared_library': + # For reasons of convention, the Android build system requires that all + # shared library modules are named 'libfoo' when generating -l flags. + prefix = 'lib_' + else: + prefix = '' + + if spec['toolset'] == 'host': + suffix = '_$(TARGET_$(GYP_VAR_PREFIX)ARCH)_host_gyp' + else: + suffix = '_gyp' + + if self.path: + middle = make.StringToMakefileVariable('%s_%s' % (self.path, self.target)) + else: + middle = make.StringToMakefileVariable(self.target) + + return ''.join([prefix, middle, suffix]) + + + def ComputeOutputParts(self, spec): + """Return the 'output basename' of a gyp spec, split into filename + ext. + + Android libraries must be named the same thing as their module name, + otherwise the linker can't find them, so product_name and so on must be + ignored if we are building a library, and the "lib" prepending is + not done for Android. + """ + assert self.type != 'loadable_module' # TODO: not supported? + + target = spec['target_name'] + target_prefix = '' + target_ext = '' + if self.type == 'static_library': + target = self.ComputeAndroidModule(spec) + target_ext = '.a' + elif self.type == 'shared_library': + target = self.ComputeAndroidModule(spec) + target_ext = '.so' + elif self.type == 'none': + target_ext = '.stamp' + elif self.type != 'executable': + print ("ERROR: What output file should be generated?", + "type", self.type, "target", target) + + if self.type != 'static_library' and self.type != 'shared_library': + target_prefix = spec.get('product_prefix', target_prefix) + target = spec.get('product_name', target) + product_ext = spec.get('product_extension') + if product_ext: + target_ext = '.' + product_ext + + target_stem = target_prefix + target + return (target_stem, target_ext) + + + def ComputeOutputBasename(self, spec): + """Return the 'output basename' of a gyp spec. + + E.g., the loadable module 'foobar' in directory 'baz' will produce + 'libfoobar.so' + """ + return ''.join(self.ComputeOutputParts(spec)) + + + def ComputeOutput(self, spec): + """Return the 'output' (full output path) of a gyp spec. + + E.g., the loadable module 'foobar' in directory 'baz' will produce + '$(obj)/baz/libfoobar.so' + """ + if self.type == 'executable': + # We install host executables into shared_intermediate_dir so they can be + # run by gyp rules that refer to PRODUCT_DIR. + path = '$(gyp_shared_intermediate_dir)' + elif self.type == 'shared_library': + if self.toolset == 'host': + path = '$($(GYP_HOST_VAR_PREFIX)HOST_OUT_INTERMEDIATE_LIBRARIES)' + else: + path = '$($(GYP_VAR_PREFIX)TARGET_OUT_INTERMEDIATE_LIBRARIES)' + else: + # Other targets just get built into their intermediate dir. + if self.toolset == 'host': + path = ('$(call intermediates-dir-for,%s,%s,true,,' + '$(GYP_HOST_VAR_PREFIX))' % (self.android_class, + self.android_module)) + else: + path = ('$(call intermediates-dir-for,%s,%s,,,$(GYP_VAR_PREFIX))' + % (self.android_class, self.android_module)) + + assert spec.get('product_dir') is None # TODO: not supported? + return os.path.join(path, self.ComputeOutputBasename(spec)) + + def NormalizeIncludePaths(self, include_paths): + """ Normalize include_paths. + Convert absolute paths to relative to the Android top directory. + + Args: + include_paths: A list of unprocessed include paths. + Returns: + A list of normalized include paths. + """ + normalized = [] + for path in include_paths: + if path[0] == '/': + path = gyp.common.RelativePath(path, self.android_top_dir) + normalized.append(path) + return normalized + + def ExtractIncludesFromCFlags(self, cflags): + """Extract includes "-I..." out from cflags + + Args: + cflags: A list of compiler flags, which may be mixed with "-I.." + Returns: + A tuple of lists: (clean_clfags, include_paths). "-I.." is trimmed. + """ + clean_cflags = [] + include_paths = [] + for flag in cflags: + if flag.startswith('-I'): + include_paths.append(flag[2:]) + else: + clean_cflags.append(flag) + + return (clean_cflags, include_paths) + + def FilterLibraries(self, libraries): + """Filter the 'libraries' key to separate things that shouldn't be ldflags. + + Library entries that look like filenames should be converted to android + module names instead of being passed to the linker as flags. + + Args: + libraries: the value of spec.get('libraries') + Returns: + A tuple (static_lib_modules, dynamic_lib_modules, ldflags) + """ + static_lib_modules = [] + dynamic_lib_modules = [] + ldflags = [] + for libs in libraries: + # Libs can have multiple words. + for lib in libs.split(): + # Filter the system libraries, which are added by default by the Android + # build system. + if (lib == '-lc' or lib == '-lstdc++' or lib == '-lm' or + lib.endswith('libgcc.a')): + continue + match = re.search(r'([^/]+)\.a$', lib) + if match: + static_lib_modules.append(match.group(1)) + continue + match = re.search(r'([^/]+)\.so$', lib) + if match: + dynamic_lib_modules.append(match.group(1)) + continue + if lib.startswith('-l'): + ldflags.append(lib) + return (static_lib_modules, dynamic_lib_modules, ldflags) + + + def ComputeDeps(self, spec): + """Compute the dependencies of a gyp spec. + + Returns a tuple (deps, link_deps), where each is a list of + filenames that will need to be put in front of make for either + building (deps) or linking (link_deps). + """ + deps = [] + link_deps = [] + if 'dependencies' in spec: + deps.extend([target_outputs[dep] for dep in spec['dependencies'] + if target_outputs[dep]]) + for dep in spec['dependencies']: + if dep in target_link_deps: + link_deps.append(target_link_deps[dep]) + deps.extend(link_deps) + return (gyp.common.uniquer(deps), gyp.common.uniquer(link_deps)) + + + def WriteTargetFlags(self, spec, configs, link_deps): + """Write Makefile code to specify the link flags and library dependencies. + + spec, configs: input from gyp. + link_deps: link dependency list; see ComputeDeps() + """ + # Libraries (i.e. -lfoo) + # These must be included even for static libraries as some of them provide + # implicit include paths through the build system. + libraries = gyp.common.uniquer(spec.get('libraries', [])) + static_libs, dynamic_libs, ldflags_libs = self.FilterLibraries(libraries) + + if self.type != 'static_library': + for configname, config in sorted(configs.iteritems()): + ldflags = list(config.get('ldflags', [])) + self.WriteLn('') + self.WriteList(ldflags, 'LOCAL_LDFLAGS_%s' % configname) + self.WriteList(ldflags_libs, 'LOCAL_GYP_LIBS') + self.WriteLn('LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION)) ' + '$(LOCAL_GYP_LIBS)') + + # Link dependencies (i.e. other gyp targets this target depends on) + # These need not be included for static libraries as within the gyp build + # we do not use the implicit include path mechanism. + if self.type != 'static_library': + static_link_deps = [x[1] for x in link_deps if x[0] == 'static'] + shared_link_deps = [x[1] for x in link_deps if x[0] == 'shared'] + else: + static_link_deps = [] + shared_link_deps = [] + + # Only write the lists if they are non-empty. + if static_libs or static_link_deps: + self.WriteLn('') + self.WriteList(static_libs + static_link_deps, + 'LOCAL_STATIC_LIBRARIES') + self.WriteLn('# Enable grouping to fix circular references') + self.WriteLn('LOCAL_GROUP_STATIC_LIBRARIES := true') + if dynamic_libs or shared_link_deps: + self.WriteLn('') + self.WriteList(dynamic_libs + shared_link_deps, + 'LOCAL_SHARED_LIBRARIES') + + + def WriteTarget(self, spec, configs, deps, link_deps, part_of_all, + write_alias_target): + """Write Makefile code to produce the final target of the gyp spec. + + spec, configs: input from gyp. + deps, link_deps: dependency lists; see ComputeDeps() + part_of_all: flag indicating this target is part of 'all' + write_alias_target: flag indicating whether to create short aliases for this + target + """ + self.WriteLn('### Rules for final target.') + + if self.type != 'none': + self.WriteTargetFlags(spec, configs, link_deps) + + settings = spec.get('aosp_build_settings', {}) + if settings: + self.WriteLn('### Set directly by aosp_build_settings.') + for k, v in settings.iteritems(): + if isinstance(v, list): + self.WriteList(v, k) + else: + self.WriteLn('%s := %s' % (k, make.QuoteIfNecessary(v))) + self.WriteLn('') + + # Add to the set of targets which represent the gyp 'all' target. We use the + # name 'gyp_all_modules' as the Android build system doesn't allow the use + # of the Make target 'all' and because 'all_modules' is the equivalent of + # the Make target 'all' on Android. + if part_of_all and write_alias_target: + self.WriteLn('# Add target alias to "gyp_all_modules" target.') + self.WriteLn('.PHONY: gyp_all_modules') + self.WriteLn('gyp_all_modules: %s' % self.android_module) + self.WriteLn('') + + # Add an alias from the gyp target name to the Android module name. This + # simplifies manual builds of the target, and is required by the test + # framework. + if self.target != self.android_module and write_alias_target: + self.WriteLn('# Alias gyp target name.') + self.WriteLn('.PHONY: %s' % self.target) + self.WriteLn('%s: %s' % (self.target, self.android_module)) + self.WriteLn('') + + # Add the command to trigger build of the target type depending + # on the toolset. Ex: BUILD_STATIC_LIBRARY vs. BUILD_HOST_STATIC_LIBRARY + # NOTE: This has to come last! + modifier = '' + if self.toolset == 'host': + modifier = 'HOST_' + if self.type == 'static_library': + self.WriteLn('include $(BUILD_%sSTATIC_LIBRARY)' % modifier) + elif self.type == 'shared_library': + self.WriteLn('LOCAL_PRELINK_MODULE := false') + self.WriteLn('include $(BUILD_%sSHARED_LIBRARY)' % modifier) + elif self.type == 'executable': + self.WriteLn('LOCAL_CXX_STL := libc++_static') + # Executables are for build and test purposes only, so they're installed + # to a directory that doesn't get included in the system image. + self.WriteLn('LOCAL_MODULE_PATH := $(gyp_shared_intermediate_dir)') + self.WriteLn('include $(BUILD_%sEXECUTABLE)' % modifier) + else: + self.WriteLn('LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp') + self.WriteLn('LOCAL_UNINSTALLABLE_MODULE := true') + if self.toolset == 'target': + self.WriteLn('LOCAL_2ND_ARCH_VAR_PREFIX := $(GYP_VAR_PREFIX)') + else: + self.WriteLn('LOCAL_2ND_ARCH_VAR_PREFIX := $(GYP_HOST_VAR_PREFIX)') + self.WriteLn() + self.WriteLn('include $(BUILD_SYSTEM)/base_rules.mk') + self.WriteLn() + self.WriteLn('$(LOCAL_BUILT_MODULE): $(LOCAL_ADDITIONAL_DEPENDENCIES)') + self.WriteLn('\t$(hide) echo "Gyp timestamp: $@"') + self.WriteLn('\t$(hide) mkdir -p $(dir $@)') + self.WriteLn('\t$(hide) touch $@') + self.WriteLn() + self.WriteLn('LOCAL_2ND_ARCH_VAR_PREFIX :=') + + + def WriteList(self, value_list, variable=None, prefix='', + quoter=make.QuoteIfNecessary, local_pathify=False): + """Write a variable definition that is a list of values. + + E.g. WriteList(['a','b'], 'foo', prefix='blah') writes out + foo = blaha blahb + but in a pretty-printed style. + """ + values = '' + if value_list: + value_list = [quoter(prefix + l) for l in value_list] + if local_pathify: + value_list = [self.LocalPathify(l) for l in value_list] + values = ' \\\n\t' + ' \\\n\t'.join(value_list) + self.fp.write('%s :=%s\n\n' % (variable, values)) + + + def WriteLn(self, text=''): + self.fp.write(text + '\n') + + + def LocalPathify(self, path): + """Convert a subdirectory-relative path into a normalized path which starts + with the make variable $(LOCAL_PATH) (i.e. the top of the project tree). + Absolute paths, or paths that contain variables, are just normalized.""" + if '$(' in path or os.path.isabs(path): + # path is not a file in the project tree in this case, but calling + # normpath is still important for trimming trailing slashes. + return os.path.normpath(path) + local_path = os.path.join('$(LOCAL_PATH)', self.path, path) + local_path = os.path.normpath(local_path) + # Check that normalizing the path didn't ../ itself out of $(LOCAL_PATH) + # - i.e. that the resulting path is still inside the project tree. The + # path may legitimately have ended up containing just $(LOCAL_PATH), though, + # so we don't look for a slash. + assert local_path.startswith('$(LOCAL_PATH)'), ( + 'Path %s attempts to escape from gyp path %s !)' % (path, self.path)) + return local_path + + + def ExpandInputRoot(self, template, expansion, dirname): + if '%(INPUT_ROOT)s' not in template and '%(INPUT_DIRNAME)s' not in template: + return template + path = template % { + 'INPUT_ROOT': expansion, + 'INPUT_DIRNAME': dirname, + } + return os.path.normpath(path) + + +def PerformBuild(data, configurations, params): + # The android backend only supports the default configuration. + options = params['options'] + makefile = os.path.abspath(os.path.join(options.toplevel_dir, + 'GypAndroid.mk')) + env = dict(os.environ) + env['ONE_SHOT_MAKEFILE'] = makefile + arguments = ['make', '-C', os.environ['ANDROID_BUILD_TOP'], 'gyp_all_modules'] + print 'Building: %s' % arguments + subprocess.check_call(arguments, env=env) + + +def GenerateOutput(target_list, target_dicts, data, params): + options = params['options'] + generator_flags = params.get('generator_flags', {}) + builddir_name = generator_flags.get('output_dir', 'out') + limit_to_target_all = generator_flags.get('limit_to_target_all', False) + write_alias_targets = generator_flags.get('write_alias_targets', True) + sdk_version = generator_flags.get('aosp_sdk_version', 0) + android_top_dir = os.environ.get('ANDROID_BUILD_TOP') + assert android_top_dir, '$ANDROID_BUILD_TOP not set; you need to run lunch.' + + def CalculateMakefilePath(build_file, base_name): + """Determine where to write a Makefile for a given gyp file.""" + # Paths in gyp files are relative to the .gyp file, but we want + # paths relative to the source root for the master makefile. Grab + # the path of the .gyp file as the base to relativize against. + # E.g. "foo/bar" when we're constructing targets for "foo/bar/baz.gyp". + base_path = gyp.common.RelativePath(os.path.dirname(build_file), + options.depth) + # We write the file in the base_path directory. + output_file = os.path.join(options.depth, base_path, base_name) + assert not options.generator_output, ( + 'The Android backend does not support options.generator_output.') + base_path = gyp.common.RelativePath(os.path.dirname(build_file), + options.toplevel_dir) + return base_path, output_file + + # TODO: search for the first non-'Default' target. This can go + # away when we add verification that all targets have the + # necessary configurations. + default_configuration = None + toolsets = set([target_dicts[target]['toolset'] for target in target_list]) + for target in target_list: + spec = target_dicts[target] + if spec['default_configuration'] != 'Default': + default_configuration = spec['default_configuration'] + break + if not default_configuration: + default_configuration = 'Default' + + srcdir = '.' + makefile_name = 'GypAndroid' + options.suffix + '.mk' + makefile_path = os.path.join(options.toplevel_dir, makefile_name) + assert not options.generator_output, ( + 'The Android backend does not support options.generator_output.') + gyp.common.EnsureDirExists(makefile_path) + root_makefile = open(makefile_path, 'w') + + root_makefile.write(header) + + # We set LOCAL_PATH just once, here, to the top of the project tree. This + # allows all the other paths we use to be relative to the Android.mk file, + # as the Android build system expects. + root_makefile.write('\nLOCAL_PATH := $(call my-dir)\n') + + # Find the list of targets that derive from the gyp file(s) being built. + needed_targets = set() + for build_file in params['build_files']: + for target in gyp.common.AllTargets(target_list, target_dicts, build_file): + needed_targets.add(target) + + build_files = set() + include_list = set() + android_modules = {} + for qualified_target in target_list: + build_file, target, toolset = gyp.common.ParseQualifiedTarget( + qualified_target) + relative_build_file = gyp.common.RelativePath(build_file, + options.toplevel_dir) + build_files.add(relative_build_file) + included_files = data[build_file]['included_files'] + for included_file in included_files: + # The included_files entries are relative to the dir of the build file + # that included them, so we have to undo that and then make them relative + # to the root dir. + relative_include_file = gyp.common.RelativePath( + gyp.common.UnrelativePath(included_file, build_file), + options.toplevel_dir) + abs_include_file = os.path.abspath(relative_include_file) + # If the include file is from the ~/.gyp dir, we should use absolute path + # so that relocating the src dir doesn't break the path. + if (params['home_dot_gyp'] and + abs_include_file.startswith(params['home_dot_gyp'])): + build_files.add(abs_include_file) + else: + build_files.add(relative_include_file) + + base_path, output_file = CalculateMakefilePath(build_file, + target + '.' + toolset + options.suffix + '.mk') + + spec = target_dicts[qualified_target] + configs = spec['configurations'] + + part_of_all = qualified_target in needed_targets + if limit_to_target_all and not part_of_all: + continue + + relative_target = gyp.common.QualifiedTarget(relative_build_file, target, + toolset) + writer = AndroidMkWriter(android_top_dir) + android_module = writer.Write(qualified_target, relative_target, base_path, + output_file, spec, configs, + part_of_all=part_of_all, + write_alias_target=write_alias_targets, + sdk_version=sdk_version) + if android_module in android_modules: + print ('ERROR: Android module names must be unique. The following ' + 'targets both generate Android module name %s.\n %s\n %s' % + (android_module, android_modules[android_module], + qualified_target)) + return + android_modules[android_module] = qualified_target + + # Our root_makefile lives at the source root. Compute the relative path + # from there to the output_file for including. + mkfile_rel_path = gyp.common.RelativePath(output_file, + os.path.dirname(makefile_path)) + include_list.add(mkfile_rel_path) + + root_makefile.write('GYP_CONFIGURATION ?= %s\n' % default_configuration) + root_makefile.write('GYP_VAR_PREFIX ?=\n') + root_makefile.write('GYP_HOST_VAR_PREFIX ?=\n') + root_makefile.write('GYP_HOST_MULTILIB ?= first\n') + + # Write out the sorted list of includes. + root_makefile.write('\n') + for include_file in sorted(include_list): + root_makefile.write('include $(LOCAL_PATH)/' + include_file + '\n') + root_makefile.write('\n') + + if write_alias_targets: + root_makefile.write(ALL_MODULES_FOOTER) + + root_makefile.close() diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py new file mode 100644 index 00000000..17f5e639 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py @@ -0,0 +1,1221 @@ +# Copyright (c) 2013 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""cmake output module + +This module is under development and should be considered experimental. + +This module produces cmake (2.8.8+) input as its output. One CMakeLists.txt is +created for each configuration. + +This module's original purpose was to support editing in IDEs like KDevelop +which use CMake for project management. It is also possible to use CMake to +generate projects for other IDEs such as eclipse cdt and code::blocks. QtCreator +will convert the CMakeLists.txt to a code::blocks cbp for the editor to read, +but build using CMake. As a result QtCreator editor is unaware of compiler +defines. The generated CMakeLists.txt can also be used to build on Linux. There +is currently no support for building on platforms other than Linux. + +The generated CMakeLists.txt should properly compile all projects. However, +there is a mismatch between gyp and cmake with regard to linking. All attempts +are made to work around this, but CMake sometimes sees -Wl,--start-group as a +library and incorrectly repeats it. As a result the output of this generator +should not be relied on for building. + +When using with kdevelop, use version 4.4+. Previous versions of kdevelop will +not be able to find the header file directories described in the generated +CMakeLists.txt file. +""" + +import multiprocessing +import os +import signal +import string +import subprocess +import gyp.common + +generator_default_variables = { + 'EXECUTABLE_PREFIX': '', + 'EXECUTABLE_SUFFIX': '', + 'STATIC_LIB_PREFIX': 'lib', + 'STATIC_LIB_SUFFIX': '.a', + 'SHARED_LIB_PREFIX': 'lib', + 'SHARED_LIB_SUFFIX': '.so', + 'SHARED_LIB_DIR': '${builddir}/lib.${TOOLSET}', + 'LIB_DIR': '${obj}.${TOOLSET}', + 'INTERMEDIATE_DIR': '${obj}.${TOOLSET}/${TARGET}/geni', + 'SHARED_INTERMEDIATE_DIR': '${obj}/gen', + 'PRODUCT_DIR': '${builddir}', + 'RULE_INPUT_PATH': '${RULE_INPUT_PATH}', + 'RULE_INPUT_DIRNAME': '${RULE_INPUT_DIRNAME}', + 'RULE_INPUT_NAME': '${RULE_INPUT_NAME}', + 'RULE_INPUT_ROOT': '${RULE_INPUT_ROOT}', + 'RULE_INPUT_EXT': '${RULE_INPUT_EXT}', + 'CONFIGURATION_NAME': '${configuration}', +} + +FULL_PATH_VARS = ('${CMAKE_CURRENT_LIST_DIR}', '${builddir}', '${obj}') + +generator_supports_multiple_toolsets = True +generator_wants_static_library_dependencies_adjusted = True + +COMPILABLE_EXTENSIONS = { + '.c': 'cc', + '.cc': 'cxx', + '.cpp': 'cxx', + '.cxx': 'cxx', + '.s': 's', # cc + '.S': 's', # cc +} + + +def RemovePrefix(a, prefix): + """Returns 'a' without 'prefix' if it starts with 'prefix'.""" + return a[len(prefix):] if a.startswith(prefix) else a + + +def CalculateVariables(default_variables, params): + """Calculate additional variables for use in the build (called by gyp).""" + default_variables.setdefault('OS', gyp.common.GetFlavor(params)) + + +def Compilable(filename): + """Return true if the file is compilable (should be in OBJS).""" + return any(filename.endswith(e) for e in COMPILABLE_EXTENSIONS) + + +def Linkable(filename): + """Return true if the file is linkable (should be on the link line).""" + return filename.endswith('.o') + + +def NormjoinPathForceCMakeSource(base_path, rel_path): + """Resolves rel_path against base_path and returns the result. + + If rel_path is an absolute path it is returned unchanged. + Otherwise it is resolved against base_path and normalized. + If the result is a relative path, it is forced to be relative to the + CMakeLists.txt. + """ + if os.path.isabs(rel_path): + return rel_path + if any([rel_path.startswith(var) for var in FULL_PATH_VARS]): + return rel_path + # TODO: do we need to check base_path for absolute variables as well? + return os.path.join('${CMAKE_CURRENT_LIST_DIR}', + os.path.normpath(os.path.join(base_path, rel_path))) + + +def NormjoinPath(base_path, rel_path): + """Resolves rel_path against base_path and returns the result. + TODO: what is this really used for? + If rel_path begins with '$' it is returned unchanged. + Otherwise it is resolved against base_path if relative, then normalized. + """ + if rel_path.startswith('$') and not rel_path.startswith('${configuration}'): + return rel_path + return os.path.normpath(os.path.join(base_path, rel_path)) + + +def CMakeStringEscape(a): + """Escapes the string 'a' for use inside a CMake string. + + This means escaping + '\' otherwise it may be seen as modifying the next character + '"' otherwise it will end the string + ';' otherwise the string becomes a list + + The following do not need to be escaped + '#' when the lexer is in string state, this does not start a comment + + The following are yet unknown + '$' generator variables (like ${obj}) must not be escaped, + but text $ should be escaped + what is wanted is to know which $ come from generator variables + """ + return a.replace('\\', '\\\\').replace(';', '\\;').replace('"', '\\"') + + +def SetFileProperty(output, source_name, property_name, values, sep): + """Given a set of source file, sets the given property on them.""" + output.write('set_source_files_properties(') + output.write(source_name) + output.write(' PROPERTIES ') + output.write(property_name) + output.write(' "') + for value in values: + output.write(CMakeStringEscape(value)) + output.write(sep) + output.write('")\n') + + +def SetFilesProperty(output, variable, property_name, values, sep): + """Given a set of source files, sets the given property on them.""" + output.write('set_source_files_properties(') + WriteVariable(output, variable) + output.write(' PROPERTIES ') + output.write(property_name) + output.write(' "') + for value in values: + output.write(CMakeStringEscape(value)) + output.write(sep) + output.write('")\n') + + +def SetTargetProperty(output, target_name, property_name, values, sep=''): + """Given a target, sets the given property.""" + output.write('set_target_properties(') + output.write(target_name) + output.write(' PROPERTIES ') + output.write(property_name) + output.write(' "') + for value in values: + output.write(CMakeStringEscape(value)) + output.write(sep) + output.write('")\n') + + +def SetVariable(output, variable_name, value): + """Sets a CMake variable.""" + output.write('set(') + output.write(variable_name) + output.write(' "') + output.write(CMakeStringEscape(value)) + output.write('")\n') + + +def SetVariableList(output, variable_name, values): + """Sets a CMake variable to a list.""" + if not values: + return SetVariable(output, variable_name, "") + if len(values) == 1: + return SetVariable(output, variable_name, values[0]) + output.write('list(APPEND ') + output.write(variable_name) + output.write('\n "') + output.write('"\n "'.join([CMakeStringEscape(value) for value in values])) + output.write('")\n') + + +def UnsetVariable(output, variable_name): + """Unsets a CMake variable.""" + output.write('unset(') + output.write(variable_name) + output.write(')\n') + + +def WriteVariable(output, variable_name, prepend=None): + if prepend: + output.write(prepend) + output.write('${') + output.write(variable_name) + output.write('}') + + +class CMakeTargetType(object): + def __init__(self, command, modifier, property_modifier): + self.command = command + self.modifier = modifier + self.property_modifier = property_modifier + + +cmake_target_type_from_gyp_target_type = { + 'executable': CMakeTargetType('add_executable', None, 'RUNTIME'), + 'static_library': CMakeTargetType('add_library', 'STATIC', 'ARCHIVE'), + 'shared_library': CMakeTargetType('add_library', 'SHARED', 'LIBRARY'), + 'loadable_module': CMakeTargetType('add_library', 'MODULE', 'LIBRARY'), + 'none': CMakeTargetType('add_custom_target', 'SOURCES', None), +} + + +def StringToCMakeTargetName(a): + """Converts the given string 'a' to a valid CMake target name. + + All invalid characters are replaced by '_'. + Invalid for cmake: ' ', '/', '(', ')', '"' + Invalid for make: ':' + Invalid for unknown reasons but cause failures: '.' + """ + return a.translate(string.maketrans(' /():."', '_______')) + + +def WriteActions(target_name, actions, extra_sources, extra_deps, + path_to_gyp, output): + """Write CMake for the 'actions' in the target. + + Args: + target_name: the name of the CMake target being generated. + actions: the Gyp 'actions' dict for this target. + extra_sources: [(, )] to append with generated source files. + extra_deps: [] to append with generated targets. + path_to_gyp: relative path from CMakeLists.txt being generated to + the Gyp file in which the target being generated is defined. + """ + for action in actions: + action_name = StringToCMakeTargetName(action['action_name']) + action_target_name = '%s__%s' % (target_name, action_name) + + inputs = action['inputs'] + inputs_name = action_target_name + '__input' + SetVariableList(output, inputs_name, + [NormjoinPathForceCMakeSource(path_to_gyp, dep) for dep in inputs]) + + outputs = action['outputs'] + cmake_outputs = [NormjoinPathForceCMakeSource(path_to_gyp, out) + for out in outputs] + outputs_name = action_target_name + '__output' + SetVariableList(output, outputs_name, cmake_outputs) + + # Build up a list of outputs. + # Collect the output dirs we'll need. + dirs = set(dir for dir in (os.path.dirname(o) for o in outputs) if dir) + + if int(action.get('process_outputs_as_sources', False)): + extra_sources.extend(zip(cmake_outputs, outputs)) + + # add_custom_command + output.write('add_custom_command(OUTPUT ') + WriteVariable(output, outputs_name) + output.write('\n') + + if len(dirs) > 0: + for directory in dirs: + output.write(' COMMAND ${CMAKE_COMMAND} -E make_directory ') + output.write(directory) + output.write('\n') + + output.write(' COMMAND ') + output.write(gyp.common.EncodePOSIXShellList(action['action'])) + output.write('\n') + + output.write(' DEPENDS ') + WriteVariable(output, inputs_name) + output.write('\n') + + output.write(' WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/') + output.write(path_to_gyp) + output.write('\n') + + output.write(' COMMENT ') + if 'message' in action: + output.write(action['message']) + else: + output.write(action_target_name) + output.write('\n') + + output.write(' VERBATIM\n') + output.write(')\n') + + # add_custom_target + output.write('add_custom_target(') + output.write(action_target_name) + output.write('\n DEPENDS ') + WriteVariable(output, outputs_name) + output.write('\n SOURCES ') + WriteVariable(output, inputs_name) + output.write('\n)\n') + + extra_deps.append(action_target_name) + + +def NormjoinRulePathForceCMakeSource(base_path, rel_path, rule_source): + if rel_path.startswith(("${RULE_INPUT_PATH}","${RULE_INPUT_DIRNAME}")): + if any([rule_source.startswith(var) for var in FULL_PATH_VARS]): + return rel_path + return NormjoinPathForceCMakeSource(base_path, rel_path) + + +def WriteRules(target_name, rules, extra_sources, extra_deps, + path_to_gyp, output): + """Write CMake for the 'rules' in the target. + + Args: + target_name: the name of the CMake target being generated. + actions: the Gyp 'actions' dict for this target. + extra_sources: [(, )] to append with generated source files. + extra_deps: [] to append with generated targets. + path_to_gyp: relative path from CMakeLists.txt being generated to + the Gyp file in which the target being generated is defined. + """ + for rule in rules: + rule_name = StringToCMakeTargetName(target_name + '__' + rule['rule_name']) + + inputs = rule.get('inputs', []) + inputs_name = rule_name + '__input' + SetVariableList(output, inputs_name, + [NormjoinPathForceCMakeSource(path_to_gyp, dep) for dep in inputs]) + outputs = rule['outputs'] + var_outputs = [] + + for count, rule_source in enumerate(rule.get('rule_sources', [])): + action_name = rule_name + '_' + str(count) + + rule_source_dirname, rule_source_basename = os.path.split(rule_source) + rule_source_root, rule_source_ext = os.path.splitext(rule_source_basename) + + SetVariable(output, 'RULE_INPUT_PATH', rule_source) + SetVariable(output, 'RULE_INPUT_DIRNAME', rule_source_dirname) + SetVariable(output, 'RULE_INPUT_NAME', rule_source_basename) + SetVariable(output, 'RULE_INPUT_ROOT', rule_source_root) + SetVariable(output, 'RULE_INPUT_EXT', rule_source_ext) + + # Build up a list of outputs. + # Collect the output dirs we'll need. + dirs = set(dir for dir in (os.path.dirname(o) for o in outputs) if dir) + + # Create variables for the output, as 'local' variable will be unset. + these_outputs = [] + for output_index, out in enumerate(outputs): + output_name = action_name + '_' + str(output_index) + SetVariable(output, output_name, + NormjoinRulePathForceCMakeSource(path_to_gyp, out, + rule_source)) + if int(rule.get('process_outputs_as_sources', False)): + extra_sources.append(('${' + output_name + '}', out)) + these_outputs.append('${' + output_name + '}') + var_outputs.append('${' + output_name + '}') + + # add_custom_command + output.write('add_custom_command(OUTPUT\n') + for out in these_outputs: + output.write(' ') + output.write(out) + output.write('\n') + + for directory in dirs: + output.write(' COMMAND ${CMAKE_COMMAND} -E make_directory ') + output.write(directory) + output.write('\n') + + output.write(' COMMAND ') + output.write(gyp.common.EncodePOSIXShellList(rule['action'])) + output.write('\n') + + output.write(' DEPENDS ') + WriteVariable(output, inputs_name) + output.write(' ') + output.write(NormjoinPath(path_to_gyp, rule_source)) + output.write('\n') + + # CMAKE_CURRENT_LIST_DIR is where the CMakeLists.txt lives. + # The cwd is the current build directory. + output.write(' WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/') + output.write(path_to_gyp) + output.write('\n') + + output.write(' COMMENT ') + if 'message' in rule: + output.write(rule['message']) + else: + output.write(action_name) + output.write('\n') + + output.write(' VERBATIM\n') + output.write(')\n') + + UnsetVariable(output, 'RULE_INPUT_PATH') + UnsetVariable(output, 'RULE_INPUT_DIRNAME') + UnsetVariable(output, 'RULE_INPUT_NAME') + UnsetVariable(output, 'RULE_INPUT_ROOT') + UnsetVariable(output, 'RULE_INPUT_EXT') + + # add_custom_target + output.write('add_custom_target(') + output.write(rule_name) + output.write(' DEPENDS\n') + for out in var_outputs: + output.write(' ') + output.write(out) + output.write('\n') + output.write('SOURCES ') + WriteVariable(output, inputs_name) + output.write('\n') + for rule_source in rule.get('rule_sources', []): + output.write(' ') + output.write(NormjoinPath(path_to_gyp, rule_source)) + output.write('\n') + output.write(')\n') + + extra_deps.append(rule_name) + + +def WriteCopies(target_name, copies, extra_deps, path_to_gyp, output): + """Write CMake for the 'copies' in the target. + + Args: + target_name: the name of the CMake target being generated. + actions: the Gyp 'actions' dict for this target. + extra_deps: [] to append with generated targets. + path_to_gyp: relative path from CMakeLists.txt being generated to + the Gyp file in which the target being generated is defined. + """ + copy_name = target_name + '__copies' + + # CMake gets upset with custom targets with OUTPUT which specify no output. + have_copies = any(copy['files'] for copy in copies) + if not have_copies: + output.write('add_custom_target(') + output.write(copy_name) + output.write(')\n') + extra_deps.append(copy_name) + return + + class Copy(object): + def __init__(self, ext, command): + self.cmake_inputs = [] + self.cmake_outputs = [] + self.gyp_inputs = [] + self.gyp_outputs = [] + self.ext = ext + self.inputs_name = None + self.outputs_name = None + self.command = command + + file_copy = Copy('', 'copy') + dir_copy = Copy('_dirs', 'copy_directory') + + for copy in copies: + files = copy['files'] + destination = copy['destination'] + for src in files: + path = os.path.normpath(src) + basename = os.path.split(path)[1] + dst = os.path.join(destination, basename) + + copy = file_copy if os.path.basename(src) else dir_copy + + copy.cmake_inputs.append(NormjoinPathForceCMakeSource(path_to_gyp, src)) + copy.cmake_outputs.append(NormjoinPathForceCMakeSource(path_to_gyp, dst)) + copy.gyp_inputs.append(src) + copy.gyp_outputs.append(dst) + + for copy in (file_copy, dir_copy): + if copy.cmake_inputs: + copy.inputs_name = copy_name + '__input' + copy.ext + SetVariableList(output, copy.inputs_name, copy.cmake_inputs) + + copy.outputs_name = copy_name + '__output' + copy.ext + SetVariableList(output, copy.outputs_name, copy.cmake_outputs) + + # add_custom_command + output.write('add_custom_command(\n') + + output.write('OUTPUT') + for copy in (file_copy, dir_copy): + if copy.outputs_name: + WriteVariable(output, copy.outputs_name, ' ') + output.write('\n') + + for copy in (file_copy, dir_copy): + for src, dst in zip(copy.gyp_inputs, copy.gyp_outputs): + # 'cmake -E copy src dst' will create the 'dst' directory if needed. + output.write('COMMAND ${CMAKE_COMMAND} -E %s ' % copy.command) + output.write(src) + output.write(' ') + output.write(dst) + output.write("\n") + + output.write('DEPENDS') + for copy in (file_copy, dir_copy): + if copy.inputs_name: + WriteVariable(output, copy.inputs_name, ' ') + output.write('\n') + + output.write('WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/') + output.write(path_to_gyp) + output.write('\n') + + output.write('COMMENT Copying for ') + output.write(target_name) + output.write('\n') + + output.write('VERBATIM\n') + output.write(')\n') + + # add_custom_target + output.write('add_custom_target(') + output.write(copy_name) + output.write('\n DEPENDS') + for copy in (file_copy, dir_copy): + if copy.outputs_name: + WriteVariable(output, copy.outputs_name, ' ') + output.write('\n SOURCES') + if file_copy.inputs_name: + WriteVariable(output, file_copy.inputs_name, ' ') + output.write('\n)\n') + + extra_deps.append(copy_name) + + +def CreateCMakeTargetBaseName(qualified_target): + """This is the name we would like the target to have.""" + _, gyp_target_name, gyp_target_toolset = ( + gyp.common.ParseQualifiedTarget(qualified_target)) + cmake_target_base_name = gyp_target_name + if gyp_target_toolset and gyp_target_toolset != 'target': + cmake_target_base_name += '_' + gyp_target_toolset + return StringToCMakeTargetName(cmake_target_base_name) + + +def CreateCMakeTargetFullName(qualified_target): + """An unambiguous name for the target.""" + gyp_file, gyp_target_name, gyp_target_toolset = ( + gyp.common.ParseQualifiedTarget(qualified_target)) + cmake_target_full_name = gyp_file + ':' + gyp_target_name + if gyp_target_toolset and gyp_target_toolset != 'target': + cmake_target_full_name += '_' + gyp_target_toolset + return StringToCMakeTargetName(cmake_target_full_name) + + +class CMakeNamer(object): + """Converts Gyp target names into CMake target names. + + CMake requires that target names be globally unique. One way to ensure + this is to fully qualify the names of the targets. Unfortunatly, this + ends up with all targets looking like "chrome_chrome_gyp_chrome" instead + of just "chrome". If this generator were only interested in building, it + would be possible to fully qualify all target names, then create + unqualified target names which depend on all qualified targets which + should have had that name. This is more or less what the 'make' generator + does with aliases. However, one goal of this generator is to create CMake + files for use with IDEs, and fully qualified names are not as user + friendly. + + Since target name collision is rare, we do the above only when required. + + Toolset variants are always qualified from the base, as this is required for + building. However, it also makes sense for an IDE, as it is possible for + defines to be different. + """ + def __init__(self, target_list): + self.cmake_target_base_names_conficting = set() + + cmake_target_base_names_seen = set() + for qualified_target in target_list: + cmake_target_base_name = CreateCMakeTargetBaseName(qualified_target) + + if cmake_target_base_name not in cmake_target_base_names_seen: + cmake_target_base_names_seen.add(cmake_target_base_name) + else: + self.cmake_target_base_names_conficting.add(cmake_target_base_name) + + def CreateCMakeTargetName(self, qualified_target): + base_name = CreateCMakeTargetBaseName(qualified_target) + if base_name in self.cmake_target_base_names_conficting: + return CreateCMakeTargetFullName(qualified_target) + return base_name + + +def WriteTarget(namer, qualified_target, target_dicts, build_dir, config_to_use, + options, generator_flags, all_qualified_targets, output): + + # The make generator does this always. + # TODO: It would be nice to be able to tell CMake all dependencies. + circular_libs = generator_flags.get('circular', True) + + if not generator_flags.get('standalone', False): + output.write('\n#') + output.write(qualified_target) + output.write('\n') + + gyp_file, _, _ = gyp.common.ParseQualifiedTarget(qualified_target) + rel_gyp_file = gyp.common.RelativePath(gyp_file, options.toplevel_dir) + rel_gyp_dir = os.path.dirname(rel_gyp_file) + + # Relative path from build dir to top dir. + build_to_top = gyp.common.InvertRelativePath(build_dir, options.toplevel_dir) + # Relative path from build dir to gyp dir. + build_to_gyp = os.path.join(build_to_top, rel_gyp_dir) + + path_from_cmakelists_to_gyp = build_to_gyp + + spec = target_dicts.get(qualified_target, {}) + config = spec.get('configurations', {}).get(config_to_use, {}) + + target_name = spec.get('target_name', '') + target_type = spec.get('type', '') + target_toolset = spec.get('toolset') + + cmake_target_type = cmake_target_type_from_gyp_target_type.get(target_type) + if cmake_target_type is None: + print ('Target %s has unknown target type %s, skipping.' % + ( target_name, target_type ) ) + return + + SetVariable(output, 'TARGET', target_name) + SetVariable(output, 'TOOLSET', target_toolset) + + cmake_target_name = namer.CreateCMakeTargetName(qualified_target) + + extra_sources = [] + extra_deps = [] + + # Actions must come first, since they can generate more OBJs for use below. + if 'actions' in spec: + WriteActions(cmake_target_name, spec['actions'], extra_sources, extra_deps, + path_from_cmakelists_to_gyp, output) + + # Rules must be early like actions. + if 'rules' in spec: + WriteRules(cmake_target_name, spec['rules'], extra_sources, extra_deps, + path_from_cmakelists_to_gyp, output) + + # Copies + if 'copies' in spec: + WriteCopies(cmake_target_name, spec['copies'], extra_deps, + path_from_cmakelists_to_gyp, output) + + # Target and sources + srcs = spec.get('sources', []) + + # Gyp separates the sheep from the goats based on file extensions. + # A full separation is done here because of flag handing (see below). + s_sources = [] + c_sources = [] + cxx_sources = [] + linkable_sources = [] + other_sources = [] + for src in srcs: + _, ext = os.path.splitext(src) + src_type = COMPILABLE_EXTENSIONS.get(ext, None) + src_norm_path = NormjoinPath(path_from_cmakelists_to_gyp, src); + + if src_type == 's': + s_sources.append(src_norm_path) + elif src_type == 'cc': + c_sources.append(src_norm_path) + elif src_type == 'cxx': + cxx_sources.append(src_norm_path) + elif Linkable(ext): + linkable_sources.append(src_norm_path) + else: + other_sources.append(src_norm_path) + + for extra_source in extra_sources: + src, real_source = extra_source + _, ext = os.path.splitext(real_source) + src_type = COMPILABLE_EXTENSIONS.get(ext, None) + + if src_type == 's': + s_sources.append(src) + elif src_type == 'cc': + c_sources.append(src) + elif src_type == 'cxx': + cxx_sources.append(src) + elif Linkable(ext): + linkable_sources.append(src) + else: + other_sources.append(src) + + s_sources_name = None + if s_sources: + s_sources_name = cmake_target_name + '__asm_srcs' + SetVariableList(output, s_sources_name, s_sources) + + c_sources_name = None + if c_sources: + c_sources_name = cmake_target_name + '__c_srcs' + SetVariableList(output, c_sources_name, c_sources) + + cxx_sources_name = None + if cxx_sources: + cxx_sources_name = cmake_target_name + '__cxx_srcs' + SetVariableList(output, cxx_sources_name, cxx_sources) + + linkable_sources_name = None + if linkable_sources: + linkable_sources_name = cmake_target_name + '__linkable_srcs' + SetVariableList(output, linkable_sources_name, linkable_sources) + + other_sources_name = None + if other_sources: + other_sources_name = cmake_target_name + '__other_srcs' + SetVariableList(output, other_sources_name, other_sources) + + # CMake gets upset when executable targets provide no sources. + # http://www.cmake.org/pipermail/cmake/2010-July/038461.html + dummy_sources_name = None + has_sources = (s_sources_name or + c_sources_name or + cxx_sources_name or + linkable_sources_name or + other_sources_name) + if target_type == 'executable' and not has_sources: + dummy_sources_name = cmake_target_name + '__dummy_srcs' + SetVariable(output, dummy_sources_name, + "${obj}.${TOOLSET}/${TARGET}/genc/dummy.c") + output.write('if(NOT EXISTS "') + WriteVariable(output, dummy_sources_name) + output.write('")\n') + output.write(' file(WRITE "') + WriteVariable(output, dummy_sources_name) + output.write('" "")\n') + output.write("endif()\n") + + + # CMake is opposed to setting linker directories and considers the practice + # of setting linker directories dangerous. Instead, it favors the use of + # find_library and passing absolute paths to target_link_libraries. + # However, CMake does provide the command link_directories, which adds + # link directories to targets defined after it is called. + # As a result, link_directories must come before the target definition. + # CMake unfortunately has no means of removing entries from LINK_DIRECTORIES. + library_dirs = config.get('library_dirs') + if library_dirs is not None: + output.write('link_directories(') + for library_dir in library_dirs: + output.write(' ') + output.write(NormjoinPath(path_from_cmakelists_to_gyp, library_dir)) + output.write('\n') + output.write(')\n') + + output.write(cmake_target_type.command) + output.write('(') + output.write(cmake_target_name) + + if cmake_target_type.modifier is not None: + output.write(' ') + output.write(cmake_target_type.modifier) + + if s_sources_name: + WriteVariable(output, s_sources_name, ' ') + if c_sources_name: + WriteVariable(output, c_sources_name, ' ') + if cxx_sources_name: + WriteVariable(output, cxx_sources_name, ' ') + if linkable_sources_name: + WriteVariable(output, linkable_sources_name, ' ') + if other_sources_name: + WriteVariable(output, other_sources_name, ' ') + if dummy_sources_name: + WriteVariable(output, dummy_sources_name, ' ') + + output.write(')\n') + + # Let CMake know if the 'all' target should depend on this target. + exclude_from_all = ('TRUE' if qualified_target not in all_qualified_targets + else 'FALSE') + SetTargetProperty(output, cmake_target_name, + 'EXCLUDE_FROM_ALL', exclude_from_all) + for extra_target_name in extra_deps: + SetTargetProperty(output, extra_target_name, + 'EXCLUDE_FROM_ALL', exclude_from_all) + + # Output name and location. + if target_type != 'none': + # Link as 'C' if there are no other files + if not c_sources and not cxx_sources: + SetTargetProperty(output, cmake_target_name, 'LINKER_LANGUAGE', ['C']) + + # Mark uncompiled sources as uncompiled. + if other_sources_name: + output.write('set_source_files_properties(') + WriteVariable(output, other_sources_name, '') + output.write(' PROPERTIES HEADER_FILE_ONLY "TRUE")\n') + + # Mark object sources as linkable. + if linkable_sources_name: + output.write('set_source_files_properties(') + WriteVariable(output, other_sources_name, '') + output.write(' PROPERTIES EXTERNAL_OBJECT "TRUE")\n') + + # Output directory + target_output_directory = spec.get('product_dir') + if target_output_directory is None: + if target_type in ('executable', 'loadable_module'): + target_output_directory = generator_default_variables['PRODUCT_DIR'] + elif target_type == 'shared_library': + target_output_directory = '${builddir}/lib.${TOOLSET}' + elif spec.get('standalone_static_library', False): + target_output_directory = generator_default_variables['PRODUCT_DIR'] + else: + base_path = gyp.common.RelativePath(os.path.dirname(gyp_file), + options.toplevel_dir) + target_output_directory = '${obj}.${TOOLSET}' + target_output_directory = ( + os.path.join(target_output_directory, base_path)) + + cmake_target_output_directory = NormjoinPathForceCMakeSource( + path_from_cmakelists_to_gyp, + target_output_directory) + SetTargetProperty(output, + cmake_target_name, + cmake_target_type.property_modifier + '_OUTPUT_DIRECTORY', + cmake_target_output_directory) + + # Output name + default_product_prefix = '' + default_product_name = target_name + default_product_ext = '' + if target_type == 'static_library': + static_library_prefix = generator_default_variables['STATIC_LIB_PREFIX'] + default_product_name = RemovePrefix(default_product_name, + static_library_prefix) + default_product_prefix = static_library_prefix + default_product_ext = generator_default_variables['STATIC_LIB_SUFFIX'] + + elif target_type in ('loadable_module', 'shared_library'): + shared_library_prefix = generator_default_variables['SHARED_LIB_PREFIX'] + default_product_name = RemovePrefix(default_product_name, + shared_library_prefix) + default_product_prefix = shared_library_prefix + default_product_ext = generator_default_variables['SHARED_LIB_SUFFIX'] + + elif target_type != 'executable': + print ('ERROR: What output file should be generated?', + 'type', target_type, 'target', target_name) + + product_prefix = spec.get('product_prefix', default_product_prefix) + product_name = spec.get('product_name', default_product_name) + product_ext = spec.get('product_extension') + if product_ext: + product_ext = '.' + product_ext + else: + product_ext = default_product_ext + + SetTargetProperty(output, cmake_target_name, 'PREFIX', product_prefix) + SetTargetProperty(output, cmake_target_name, + cmake_target_type.property_modifier + '_OUTPUT_NAME', + product_name) + SetTargetProperty(output, cmake_target_name, 'SUFFIX', product_ext) + + # Make the output of this target referenceable as a source. + cmake_target_output_basename = product_prefix + product_name + product_ext + cmake_target_output = os.path.join(cmake_target_output_directory, + cmake_target_output_basename) + SetFileProperty(output, cmake_target_output, 'GENERATED', ['TRUE'], '') + + # Includes + includes = config.get('include_dirs') + if includes: + # This (target include directories) is what requires CMake 2.8.8 + includes_name = cmake_target_name + '__include_dirs' + SetVariableList(output, includes_name, + [NormjoinPathForceCMakeSource(path_from_cmakelists_to_gyp, include) + for include in includes]) + output.write('set_property(TARGET ') + output.write(cmake_target_name) + output.write(' APPEND PROPERTY INCLUDE_DIRECTORIES ') + WriteVariable(output, includes_name, '') + output.write(')\n') + + # Defines + defines = config.get('defines') + if defines is not None: + SetTargetProperty(output, + cmake_target_name, + 'COMPILE_DEFINITIONS', + defines, + ';') + + # Compile Flags - http://www.cmake.org/Bug/view.php?id=6493 + # CMake currently does not have target C and CXX flags. + # So, instead of doing... + + # cflags_c = config.get('cflags_c') + # if cflags_c is not None: + # SetTargetProperty(output, cmake_target_name, + # 'C_COMPILE_FLAGS', cflags_c, ' ') + + # cflags_cc = config.get('cflags_cc') + # if cflags_cc is not None: + # SetTargetProperty(output, cmake_target_name, + # 'CXX_COMPILE_FLAGS', cflags_cc, ' ') + + # Instead we must... + cflags = config.get('cflags', []) + cflags_c = config.get('cflags_c', []) + cflags_cxx = config.get('cflags_cc', []) + if (not cflags_c or not c_sources) and (not cflags_cxx or not cxx_sources): + SetTargetProperty(output, cmake_target_name, 'COMPILE_FLAGS', cflags, ' ') + + elif c_sources and not (s_sources or cxx_sources): + flags = [] + flags.extend(cflags) + flags.extend(cflags_c) + SetTargetProperty(output, cmake_target_name, 'COMPILE_FLAGS', flags, ' ') + + elif cxx_sources and not (s_sources or c_sources): + flags = [] + flags.extend(cflags) + flags.extend(cflags_cxx) + SetTargetProperty(output, cmake_target_name, 'COMPILE_FLAGS', flags, ' ') + + else: + # TODO: This is broken, one cannot generally set properties on files, + # as other targets may require different properties on the same files. + if s_sources and cflags: + SetFilesProperty(output, s_sources_name, 'COMPILE_FLAGS', cflags, ' ') + + if c_sources and (cflags or cflags_c): + flags = [] + flags.extend(cflags) + flags.extend(cflags_c) + SetFilesProperty(output, c_sources_name, 'COMPILE_FLAGS', flags, ' ') + + if cxx_sources and (cflags or cflags_cxx): + flags = [] + flags.extend(cflags) + flags.extend(cflags_cxx) + SetFilesProperty(output, cxx_sources_name, 'COMPILE_FLAGS', flags, ' ') + + # Linker flags + ldflags = config.get('ldflags') + if ldflags is not None: + SetTargetProperty(output, cmake_target_name, 'LINK_FLAGS', ldflags, ' ') + + # Note on Dependencies and Libraries: + # CMake wants to handle link order, resolving the link line up front. + # Gyp does not retain or enforce specifying enough information to do so. + # So do as other gyp generators and use --start-group and --end-group. + # Give CMake as little information as possible so that it doesn't mess it up. + + # Dependencies + rawDeps = spec.get('dependencies', []) + + static_deps = [] + shared_deps = [] + other_deps = [] + for rawDep in rawDeps: + dep_cmake_name = namer.CreateCMakeTargetName(rawDep) + dep_spec = target_dicts.get(rawDep, {}) + dep_target_type = dep_spec.get('type', None) + + if dep_target_type == 'static_library': + static_deps.append(dep_cmake_name) + elif dep_target_type == 'shared_library': + shared_deps.append(dep_cmake_name) + else: + other_deps.append(dep_cmake_name) + + # ensure all external dependencies are complete before internal dependencies + # extra_deps currently only depend on their own deps, so otherwise run early + if static_deps or shared_deps or other_deps: + for extra_dep in extra_deps: + output.write('add_dependencies(') + output.write(extra_dep) + output.write('\n') + for deps in (static_deps, shared_deps, other_deps): + for dep in gyp.common.uniquer(deps): + output.write(' ') + output.write(dep) + output.write('\n') + output.write(')\n') + + linkable = target_type in ('executable', 'loadable_module', 'shared_library') + other_deps.extend(extra_deps) + if other_deps or (not linkable and (static_deps or shared_deps)): + output.write('add_dependencies(') + output.write(cmake_target_name) + output.write('\n') + for dep in gyp.common.uniquer(other_deps): + output.write(' ') + output.write(dep) + output.write('\n') + if not linkable: + for deps in (static_deps, shared_deps): + for lib_dep in gyp.common.uniquer(deps): + output.write(' ') + output.write(lib_dep) + output.write('\n') + output.write(')\n') + + # Libraries + if linkable: + external_libs = [lib for lib in spec.get('libraries', []) if len(lib) > 0] + if external_libs or static_deps or shared_deps: + output.write('target_link_libraries(') + output.write(cmake_target_name) + output.write('\n') + if static_deps: + write_group = circular_libs and len(static_deps) > 1 + if write_group: + output.write('-Wl,--start-group\n') + for dep in gyp.common.uniquer(static_deps): + output.write(' ') + output.write(dep) + output.write('\n') + if write_group: + output.write('-Wl,--end-group\n') + if shared_deps: + for dep in gyp.common.uniquer(shared_deps): + output.write(' ') + output.write(dep) + output.write('\n') + if external_libs: + for lib in gyp.common.uniquer(external_libs): + output.write(' ') + output.write(lib) + output.write('\n') + + output.write(')\n') + + UnsetVariable(output, 'TOOLSET') + UnsetVariable(output, 'TARGET') + + +def GenerateOutputForConfig(target_list, target_dicts, data, + params, config_to_use): + options = params['options'] + generator_flags = params['generator_flags'] + + # generator_dir: relative path from pwd to where make puts build files. + # Makes migrating from make to cmake easier, cmake doesn't put anything here. + # Each Gyp configuration creates a different CMakeLists.txt file + # to avoid incompatibilities between Gyp and CMake configurations. + generator_dir = os.path.relpath(options.generator_output or '.') + + # output_dir: relative path from generator_dir to the build directory. + output_dir = generator_flags.get('output_dir', 'out') + + # build_dir: relative path from source root to our output files. + # e.g. "out/Debug" + build_dir = os.path.normpath(os.path.join(generator_dir, + output_dir, + config_to_use)) + + toplevel_build = os.path.join(options.toplevel_dir, build_dir) + + output_file = os.path.join(toplevel_build, 'CMakeLists.txt') + gyp.common.EnsureDirExists(output_file) + + output = open(output_file, 'w') + output.write('cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)\n') + output.write('cmake_policy(VERSION 2.8.8)\n') + + gyp_file, project_target, _ = gyp.common.ParseQualifiedTarget(target_list[-1]) + output.write('project(') + output.write(project_target) + output.write(')\n') + + SetVariable(output, 'configuration', config_to_use) + + ar = None + cc = None + cxx = None + + make_global_settings = data[gyp_file].get('make_global_settings', []) + build_to_top = gyp.common.InvertRelativePath(build_dir, + options.toplevel_dir) + for key, value in make_global_settings: + if key == 'AR': + ar = os.path.join(build_to_top, value) + if key == 'CC': + cc = os.path.join(build_to_top, value) + if key == 'CXX': + cxx = os.path.join(build_to_top, value) + + ar = gyp.common.GetEnvironFallback(['AR_target', 'AR'], ar) + cc = gyp.common.GetEnvironFallback(['CC_target', 'CC'], cc) + cxx = gyp.common.GetEnvironFallback(['CXX_target', 'CXX'], cxx) + + if ar: + SetVariable(output, 'CMAKE_AR', ar) + if cc: + SetVariable(output, 'CMAKE_C_COMPILER', cc) + if cxx: + SetVariable(output, 'CMAKE_CXX_COMPILER', cxx) + + # The following appears to be as-yet undocumented. + # http://public.kitware.com/Bug/view.php?id=8392 + output.write('enable_language(ASM)\n') + # ASM-ATT does not support .S files. + # output.write('enable_language(ASM-ATT)\n') + + if cc: + SetVariable(output, 'CMAKE_ASM_COMPILER', cc) + + SetVariable(output, 'builddir', '${CMAKE_CURRENT_BINARY_DIR}') + SetVariable(output, 'obj', '${builddir}/obj') + output.write('\n') + + # TODO: Undocumented/unsupported (the CMake Java generator depends on it). + # CMake by default names the object resulting from foo.c to be foo.c.o. + # Gyp traditionally names the object resulting from foo.c foo.o. + # This should be irrelevant, but some targets extract .o files from .a + # and depend on the name of the extracted .o files. + output.write('set(CMAKE_C_OUTPUT_EXTENSION_REPLACE 1)\n') + output.write('set(CMAKE_CXX_OUTPUT_EXTENSION_REPLACE 1)\n') + output.write('\n') + + # Force ninja to use rsp files. Otherwise link and ar lines can get too long, + # resulting in 'Argument list too long' errors. + output.write('set(CMAKE_NINJA_FORCE_RESPONSE_FILE 1)\n') + output.write('\n') + + namer = CMakeNamer(target_list) + + # The list of targets upon which the 'all' target should depend. + # CMake has it's own implicit 'all' target, one is not created explicitly. + all_qualified_targets = set() + for build_file in params['build_files']: + for qualified_target in gyp.common.AllTargets(target_list, + target_dicts, + os.path.normpath(build_file)): + all_qualified_targets.add(qualified_target) + + for qualified_target in target_list: + WriteTarget(namer, qualified_target, target_dicts, build_dir, config_to_use, + options, generator_flags, all_qualified_targets, output) + + output.close() + + +def PerformBuild(data, configurations, params): + options = params['options'] + generator_flags = params['generator_flags'] + + # generator_dir: relative path from pwd to where make puts build files. + # Makes migrating from make to cmake easier, cmake doesn't put anything here. + generator_dir = os.path.relpath(options.generator_output or '.') + + # output_dir: relative path from generator_dir to the build directory. + output_dir = generator_flags.get('output_dir', 'out') + + for config_name in configurations: + # build_dir: relative path from source root to our output files. + # e.g. "out/Debug" + build_dir = os.path.normpath(os.path.join(generator_dir, + output_dir, + config_name)) + arguments = ['cmake', '-G', 'Ninja'] + print 'Generating [%s]: %s' % (config_name, arguments) + subprocess.check_call(arguments, cwd=build_dir) + + arguments = ['ninja', '-C', build_dir] + print 'Building [%s]: %s' % (config_name, arguments) + subprocess.check_call(arguments) + + +def CallGenerateOutputForConfig(arglist): + # Ignore the interrupt signal so that the parent process catches it and + # kills all multiprocessing children. + signal.signal(signal.SIGINT, signal.SIG_IGN) + + target_list, target_dicts, data, params, config_name = arglist + GenerateOutputForConfig(target_list, target_dicts, data, params, config_name) + + +def GenerateOutput(target_list, target_dicts, data, params): + user_config = params.get('generator_flags', {}).get('config', None) + if user_config: + GenerateOutputForConfig(target_list, target_dicts, data, + params, user_config) + else: + config_names = target_dicts[target_list[0]]['configurations'].keys() + if params['parallel']: + try: + pool = multiprocessing.Pool(len(config_names)) + arglists = [] + for config_name in config_names: + arglists.append((target_list, target_dicts, data, + params, config_name)) + pool.map(CallGenerateOutputForConfig, arglists) + except KeyboardInterrupt, e: + pool.terminate() + raise e + else: + for config_name in config_names: + GenerateOutputForConfig(target_list, target_dicts, data, + params, config_name) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py new file mode 100644 index 00000000..160eafe2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py @@ -0,0 +1,99 @@ +# Copyright (c) 2012 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import collections +import os +import gyp +import gyp.common +import gyp.msvs_emulation +import json +import sys + +generator_supports_multiple_toolsets = True + +generator_wants_static_library_dependencies_adjusted = False + +generator_filelist_paths = { +} + +generator_default_variables = { +} +for dirname in ['INTERMEDIATE_DIR', 'SHARED_INTERMEDIATE_DIR', 'PRODUCT_DIR', + 'LIB_DIR', 'SHARED_LIB_DIR']: + # Some gyp steps fail if these are empty(!). + generator_default_variables[dirname] = 'dir' +for unused in ['RULE_INPUT_PATH', 'RULE_INPUT_ROOT', 'RULE_INPUT_NAME', + 'RULE_INPUT_DIRNAME', 'RULE_INPUT_EXT', + 'EXECUTABLE_PREFIX', 'EXECUTABLE_SUFFIX', + 'STATIC_LIB_PREFIX', 'STATIC_LIB_SUFFIX', + 'SHARED_LIB_PREFIX', 'SHARED_LIB_SUFFIX', + 'CONFIGURATION_NAME']: + generator_default_variables[unused] = '' + + +def CalculateVariables(default_variables, params): + generator_flags = params.get('generator_flags', {}) + for key, val in generator_flags.items(): + default_variables.setdefault(key, val) + default_variables.setdefault('OS', gyp.common.GetFlavor(params)) + + flavor = gyp.common.GetFlavor(params) + if flavor =='win': + # Copy additional generator configuration data from VS, which is shared + # by the Windows Ninja generator. + import gyp.generator.msvs as msvs_generator + generator_additional_non_configuration_keys = getattr(msvs_generator, + 'generator_additional_non_configuration_keys', []) + generator_additional_path_sections = getattr(msvs_generator, + 'generator_additional_path_sections', []) + + gyp.msvs_emulation.CalculateCommonVariables(default_variables, params) + + +def CalculateGeneratorInputInfo(params): + """Calculate the generator specific info that gets fed to input (called by + gyp).""" + generator_flags = params.get('generator_flags', {}) + if generator_flags.get('adjust_static_libraries', False): + global generator_wants_static_library_dependencies_adjusted + generator_wants_static_library_dependencies_adjusted = True + + toplevel = params['options'].toplevel_dir + generator_dir = os.path.relpath(params['options'].generator_output or '.') + # output_dir: relative path from generator_dir to the build directory. + output_dir = generator_flags.get('output_dir', 'out') + qualified_out_dir = os.path.normpath(os.path.join( + toplevel, generator_dir, output_dir, 'gypfiles')) + global generator_filelist_paths + generator_filelist_paths = { + 'toplevel': toplevel, + 'qualified_out_dir': qualified_out_dir, + } + +def GenerateOutput(target_list, target_dicts, data, params): + # Map of target -> list of targets it depends on. + edges = {} + + # Queue of targets to visit. + targets_to_visit = target_list[:] + + while len(targets_to_visit) > 0: + target = targets_to_visit.pop() + if target in edges: + continue + edges[target] = [] + + for dep in target_dicts[target].get('dependencies', []): + edges[target].append(dep) + targets_to_visit.append(dep) + + try: + filepath = params['generator_flags']['output_dir'] + except KeyError: + filepath = '.' + filename = os.path.join(filepath, 'dump.json') + f = open(filename, 'w') + json.dump(edges, f) + f.close() + print 'Wrote json to %s.' % filename diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py new file mode 100644 index 00000000..3544347b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py @@ -0,0 +1,425 @@ +# Copyright (c) 2012 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""GYP backend that generates Eclipse CDT settings files. + +This backend DOES NOT generate Eclipse CDT projects. Instead, it generates XML +files that can be imported into an Eclipse CDT project. The XML file contains a +list of include paths and symbols (i.e. defines). + +Because a full .cproject definition is not created by this generator, it's not +possible to properly define the include dirs and symbols for each file +individually. Instead, one set of includes/symbols is generated for the entire +project. This works fairly well (and is a vast improvement in general), but may +still result in a few indexer issues here and there. + +This generator has no automated tests, so expect it to be broken. +""" + +from xml.sax.saxutils import escape +import os.path +import subprocess +import gyp +import gyp.common +import gyp.msvs_emulation +import shlex +import xml.etree.cElementTree as ET + +generator_wants_static_library_dependencies_adjusted = False + +generator_default_variables = { +} + +for dirname in ['INTERMEDIATE_DIR', 'PRODUCT_DIR', 'LIB_DIR', 'SHARED_LIB_DIR']: + # Some gyp steps fail if these are empty(!), so we convert them to variables + generator_default_variables[dirname] = '$' + dirname + +for unused in ['RULE_INPUT_PATH', 'RULE_INPUT_ROOT', 'RULE_INPUT_NAME', + 'RULE_INPUT_DIRNAME', 'RULE_INPUT_EXT', + 'EXECUTABLE_PREFIX', 'EXECUTABLE_SUFFIX', + 'STATIC_LIB_PREFIX', 'STATIC_LIB_SUFFIX', + 'SHARED_LIB_PREFIX', 'SHARED_LIB_SUFFIX', + 'CONFIGURATION_NAME']: + generator_default_variables[unused] = '' + +# Include dirs will occasionally use the SHARED_INTERMEDIATE_DIR variable as +# part of the path when dealing with generated headers. This value will be +# replaced dynamically for each configuration. +generator_default_variables['SHARED_INTERMEDIATE_DIR'] = \ + '$SHARED_INTERMEDIATE_DIR' + + +def CalculateVariables(default_variables, params): + generator_flags = params.get('generator_flags', {}) + for key, val in generator_flags.items(): + default_variables.setdefault(key, val) + flavor = gyp.common.GetFlavor(params) + default_variables.setdefault('OS', flavor) + if flavor == 'win': + # Copy additional generator configuration data from VS, which is shared + # by the Eclipse generator. + import gyp.generator.msvs as msvs_generator + generator_additional_non_configuration_keys = getattr(msvs_generator, + 'generator_additional_non_configuration_keys', []) + generator_additional_path_sections = getattr(msvs_generator, + 'generator_additional_path_sections', []) + + gyp.msvs_emulation.CalculateCommonVariables(default_variables, params) + + +def CalculateGeneratorInputInfo(params): + """Calculate the generator specific info that gets fed to input (called by + gyp).""" + generator_flags = params.get('generator_flags', {}) + if generator_flags.get('adjust_static_libraries', False): + global generator_wants_static_library_dependencies_adjusted + generator_wants_static_library_dependencies_adjusted = True + + +def GetAllIncludeDirectories(target_list, target_dicts, + shared_intermediate_dirs, config_name, params, + compiler_path): + """Calculate the set of include directories to be used. + + Returns: + A list including all the include_dir's specified for every target followed + by any include directories that were added as cflag compiler options. + """ + + gyp_includes_set = set() + compiler_includes_list = [] + + # Find compiler's default include dirs. + if compiler_path: + command = shlex.split(compiler_path) + command.extend(['-E', '-xc++', '-v', '-']) + proc = subprocess.Popen(args=command, stdin=subprocess.PIPE, + stdout=subprocess.PIPE, stderr=subprocess.PIPE) + output = proc.communicate()[1] + # Extract the list of include dirs from the output, which has this format: + # ... + # #include "..." search starts here: + # #include <...> search starts here: + # /usr/include/c++/4.6 + # /usr/local/include + # End of search list. + # ... + in_include_list = False + for line in output.splitlines(): + if line.startswith('#include'): + in_include_list = True + continue + if line.startswith('End of search list.'): + break + if in_include_list: + include_dir = line.strip() + if include_dir not in compiler_includes_list: + compiler_includes_list.append(include_dir) + + flavor = gyp.common.GetFlavor(params) + if flavor == 'win': + generator_flags = params.get('generator_flags', {}) + for target_name in target_list: + target = target_dicts[target_name] + if config_name in target['configurations']: + config = target['configurations'][config_name] + + # Look for any include dirs that were explicitly added via cflags. This + # may be done in gyp files to force certain includes to come at the end. + # TODO(jgreenwald): Change the gyp files to not abuse cflags for this, and + # remove this. + if flavor == 'win': + msvs_settings = gyp.msvs_emulation.MsvsSettings(target, generator_flags) + cflags = msvs_settings.GetCflags(config_name) + else: + cflags = config['cflags'] + for cflag in cflags: + if cflag.startswith('-I'): + include_dir = cflag[2:] + if include_dir not in compiler_includes_list: + compiler_includes_list.append(include_dir) + + # Find standard gyp include dirs. + if config.has_key('include_dirs'): + include_dirs = config['include_dirs'] + for shared_intermediate_dir in shared_intermediate_dirs: + for include_dir in include_dirs: + include_dir = include_dir.replace('$SHARED_INTERMEDIATE_DIR', + shared_intermediate_dir) + if not os.path.isabs(include_dir): + base_dir = os.path.dirname(target_name) + + include_dir = base_dir + '/' + include_dir + include_dir = os.path.abspath(include_dir) + + gyp_includes_set.add(include_dir) + + # Generate a list that has all the include dirs. + all_includes_list = list(gyp_includes_set) + all_includes_list.sort() + for compiler_include in compiler_includes_list: + if not compiler_include in gyp_includes_set: + all_includes_list.append(compiler_include) + + # All done. + return all_includes_list + + +def GetCompilerPath(target_list, data, options): + """Determine a command that can be used to invoke the compiler. + + Returns: + If this is a gyp project that has explicit make settings, try to determine + the compiler from that. Otherwise, see if a compiler was specified via the + CC_target environment variable. + """ + # First, see if the compiler is configured in make's settings. + build_file, _, _ = gyp.common.ParseQualifiedTarget(target_list[0]) + make_global_settings_dict = data[build_file].get('make_global_settings', {}) + for key, value in make_global_settings_dict: + if key in ['CC', 'CXX']: + return os.path.join(options.toplevel_dir, value) + + # Check to see if the compiler was specified as an environment variable. + for key in ['CC_target', 'CC', 'CXX']: + compiler = os.environ.get(key) + if compiler: + return compiler + + return 'gcc' + + +def GetAllDefines(target_list, target_dicts, data, config_name, params, + compiler_path): + """Calculate the defines for a project. + + Returns: + A dict that includes explict defines declared in gyp files along with all of + the default defines that the compiler uses. + """ + + # Get defines declared in the gyp files. + all_defines = {} + flavor = gyp.common.GetFlavor(params) + if flavor == 'win': + generator_flags = params.get('generator_flags', {}) + for target_name in target_list: + target = target_dicts[target_name] + + if flavor == 'win': + msvs_settings = gyp.msvs_emulation.MsvsSettings(target, generator_flags) + extra_defines = msvs_settings.GetComputedDefines(config_name) + else: + extra_defines = [] + if config_name in target['configurations']: + config = target['configurations'][config_name] + target_defines = config['defines'] + else: + target_defines = [] + for define in target_defines + extra_defines: + split_define = define.split('=', 1) + if len(split_define) == 1: + split_define.append('1') + if split_define[0].strip() in all_defines: + # Already defined + continue + all_defines[split_define[0].strip()] = split_define[1].strip() + # Get default compiler defines (if possible). + if flavor == 'win': + return all_defines # Default defines already processed in the loop above. + if compiler_path: + command = shlex.split(compiler_path) + command.extend(['-E', '-dM', '-']) + cpp_proc = subprocess.Popen(args=command, cwd='.', + stdin=subprocess.PIPE, stdout=subprocess.PIPE) + cpp_output = cpp_proc.communicate()[0] + cpp_lines = cpp_output.split('\n') + for cpp_line in cpp_lines: + if not cpp_line.strip(): + continue + cpp_line_parts = cpp_line.split(' ', 2) + key = cpp_line_parts[1] + if len(cpp_line_parts) >= 3: + val = cpp_line_parts[2] + else: + val = '1' + all_defines[key] = val + + return all_defines + + +def WriteIncludePaths(out, eclipse_langs, include_dirs): + """Write the includes section of a CDT settings export file.""" + + out.write('
      \n') + out.write(' \n') + for lang in eclipse_langs: + out.write(' \n' % lang) + for include_dir in include_dirs: + out.write(' %s\n' % + include_dir) + out.write(' \n') + out.write('
      \n') + + +def WriteMacros(out, eclipse_langs, defines): + """Write the macros section of a CDT settings export file.""" + + out.write('
      \n') + out.write(' \n') + for lang in eclipse_langs: + out.write(' \n' % lang) + for key in sorted(defines.iterkeys()): + out.write(' %s%s\n' % + (escape(key), escape(defines[key]))) + out.write(' \n') + out.write('
      \n') + + +def GenerateOutputForConfig(target_list, target_dicts, data, params, + config_name): + options = params['options'] + generator_flags = params.get('generator_flags', {}) + + # build_dir: relative path from source root to our output files. + # e.g. "out/Debug" + build_dir = os.path.join(generator_flags.get('output_dir', 'out'), + config_name) + + toplevel_build = os.path.join(options.toplevel_dir, build_dir) + # Ninja uses out/Debug/gen while make uses out/Debug/obj/gen as the + # SHARED_INTERMEDIATE_DIR. Include both possible locations. + shared_intermediate_dirs = [os.path.join(toplevel_build, 'obj', 'gen'), + os.path.join(toplevel_build, 'gen')] + + GenerateCdtSettingsFile(target_list, + target_dicts, + data, + params, + config_name, + os.path.join(toplevel_build, + 'eclipse-cdt-settings.xml'), + options, + shared_intermediate_dirs) + GenerateClasspathFile(target_list, + target_dicts, + options.toplevel_dir, + toplevel_build, + os.path.join(toplevel_build, + 'eclipse-classpath.xml')) + + +def GenerateCdtSettingsFile(target_list, target_dicts, data, params, + config_name, out_name, options, + shared_intermediate_dirs): + gyp.common.EnsureDirExists(out_name) + with open(out_name, 'w') as out: + out.write('\n') + out.write('\n') + + eclipse_langs = ['C++ Source File', 'C Source File', 'Assembly Source File', + 'GNU C++', 'GNU C', 'Assembly'] + compiler_path = GetCompilerPath(target_list, data, options) + include_dirs = GetAllIncludeDirectories(target_list, target_dicts, + shared_intermediate_dirs, + config_name, params, compiler_path) + WriteIncludePaths(out, eclipse_langs, include_dirs) + defines = GetAllDefines(target_list, target_dicts, data, config_name, + params, compiler_path) + WriteMacros(out, eclipse_langs, defines) + + out.write('\n') + + +def GenerateClasspathFile(target_list, target_dicts, toplevel_dir, + toplevel_build, out_name): + '''Generates a classpath file suitable for symbol navigation and code + completion of Java code (such as in Android projects) by finding all + .java and .jar files used as action inputs.''' + gyp.common.EnsureDirExists(out_name) + result = ET.Element('classpath') + + def AddElements(kind, paths): + # First, we need to normalize the paths so they are all relative to the + # toplevel dir. + rel_paths = set() + for path in paths: + if os.path.isabs(path): + rel_paths.add(os.path.relpath(path, toplevel_dir)) + else: + rel_paths.add(path) + + for path in sorted(rel_paths): + entry_element = ET.SubElement(result, 'classpathentry') + entry_element.set('kind', kind) + entry_element.set('path', path) + + AddElements('lib', GetJavaJars(target_list, target_dicts, toplevel_dir)) + AddElements('src', GetJavaSourceDirs(target_list, target_dicts, toplevel_dir)) + # Include the standard JRE container and a dummy out folder + AddElements('con', ['org.eclipse.jdt.launching.JRE_CONTAINER']) + # Include a dummy out folder so that Eclipse doesn't use the default /bin + # folder in the root of the project. + AddElements('output', [os.path.join(toplevel_build, '.eclipse-java-build')]) + + ET.ElementTree(result).write(out_name) + + +def GetJavaJars(target_list, target_dicts, toplevel_dir): + '''Generates a sequence of all .jars used as inputs.''' + for target_name in target_list: + target = target_dicts[target_name] + for action in target.get('actions', []): + for input_ in action['inputs']: + if os.path.splitext(input_)[1] == '.jar' and not input_.startswith('$'): + if os.path.isabs(input_): + yield input_ + else: + yield os.path.join(os.path.dirname(target_name), input_) + + +def GetJavaSourceDirs(target_list, target_dicts, toplevel_dir): + '''Generates a sequence of all likely java package root directories.''' + for target_name in target_list: + target = target_dicts[target_name] + for action in target.get('actions', []): + for input_ in action['inputs']: + if (os.path.splitext(input_)[1] == '.java' and + not input_.startswith('$')): + dir_ = os.path.dirname(os.path.join(os.path.dirname(target_name), + input_)) + # If there is a parent 'src' or 'java' folder, navigate up to it - + # these are canonical package root names in Chromium. This will + # break if 'src' or 'java' exists in the package structure. This + # could be further improved by inspecting the java file for the + # package name if this proves to be too fragile in practice. + parent_search = dir_ + while os.path.basename(parent_search) not in ['src', 'java']: + parent_search, _ = os.path.split(parent_search) + if not parent_search or parent_search == toplevel_dir: + # Didn't find a known root, just return the original path + yield dir_ + break + else: + yield parent_search + + +def GenerateOutput(target_list, target_dicts, data, params): + """Generate an XML settings file that can be imported into a CDT project.""" + + if params['options'].generator_output: + raise NotImplementedError("--generator_output not implemented for eclipse") + + user_config = params.get('generator_flags', {}).get('config', None) + if user_config: + GenerateOutputForConfig(target_list, target_dicts, data, params, + user_config) + else: + config_names = target_dicts[target_list[0]]['configurations'].keys() + for config_name in config_names: + GenerateOutputForConfig(target_list, target_dicts, data, params, + config_name) + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py new file mode 100644 index 00000000..3efdb996 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py @@ -0,0 +1,94 @@ +# Copyright (c) 2011 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""gypd output module + +This module produces gyp input as its output. Output files are given the +.gypd extension to avoid overwriting the .gyp files that they are generated +from. Internal references to .gyp files (such as those found in +"dependencies" sections) are not adjusted to point to .gypd files instead; +unlike other paths, which are relative to the .gyp or .gypd file, such paths +are relative to the directory from which gyp was run to create the .gypd file. + +This generator module is intended to be a sample and a debugging aid, hence +the "d" for "debug" in .gypd. It is useful to inspect the results of the +various merges, expansions, and conditional evaluations performed by gyp +and to see a representation of what would be fed to a generator module. + +It's not advisable to rename .gypd files produced by this module to .gyp, +because they will have all merges, expansions, and evaluations already +performed and the relevant constructs not present in the output; paths to +dependencies may be wrong; and various sections that do not belong in .gyp +files such as such as "included_files" and "*_excluded" will be present. +Output will also be stripped of comments. This is not intended to be a +general-purpose gyp pretty-printer; for that, you probably just want to +run "pprint.pprint(eval(open('source.gyp').read()))", which will still strip +comments but won't do all of the other things done to this module's output. + +The specific formatting of the output generated by this module is subject +to change. +""" + + +import gyp.common +import errno +import os +import pprint + + +# These variables should just be spit back out as variable references. +_generator_identity_variables = [ + 'CONFIGURATION_NAME', + 'EXECUTABLE_PREFIX', + 'EXECUTABLE_SUFFIX', + 'INTERMEDIATE_DIR', + 'LIB_DIR', + 'PRODUCT_DIR', + 'RULE_INPUT_ROOT', + 'RULE_INPUT_DIRNAME', + 'RULE_INPUT_EXT', + 'RULE_INPUT_NAME', + 'RULE_INPUT_PATH', + 'SHARED_INTERMEDIATE_DIR', + 'SHARED_LIB_DIR', + 'SHARED_LIB_PREFIX', + 'SHARED_LIB_SUFFIX', + 'STATIC_LIB_PREFIX', + 'STATIC_LIB_SUFFIX', +] + +# gypd doesn't define a default value for OS like many other generator +# modules. Specify "-D OS=whatever" on the command line to provide a value. +generator_default_variables = { +} + +# gypd supports multiple toolsets +generator_supports_multiple_toolsets = True + +# TODO(mark): This always uses <, which isn't right. The input module should +# notify the generator to tell it which phase it is operating in, and this +# module should use < for the early phase and then switch to > for the late +# phase. Bonus points for carrying @ back into the output too. +for v in _generator_identity_variables: + generator_default_variables[v] = '<(%s)' % v + + +def GenerateOutput(target_list, target_dicts, data, params): + output_files = {} + for qualified_target in target_list: + [input_file, target] = \ + gyp.common.ParseQualifiedTarget(qualified_target)[0:2] + + if input_file[-4:] != '.gyp': + continue + input_file_stem = input_file[:-4] + output_file = input_file_stem + params['options'].suffix + '.gypd' + + if not output_file in output_files: + output_files[output_file] = input_file + + for output_file, input_file in output_files.iteritems(): + output = open(output_file, 'w') + pprint.pprint(data[input_file], output) + output.close() diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py new file mode 100644 index 00000000..bd405f43 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py @@ -0,0 +1,56 @@ +# Copyright (c) 2011 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""gypsh output module + +gypsh is a GYP shell. It's not really a generator per se. All it does is +fire up an interactive Python session with a few local variables set to the +variables passed to the generator. Like gypd, it's intended as a debugging +aid, to facilitate the exploration of .gyp structures after being processed +by the input module. + +The expected usage is "gyp -f gypsh -D OS=desired_os". +""" + + +import code +import sys + + +# All of this stuff about generator variables was lovingly ripped from gypd.py. +# That module has a much better description of what's going on and why. +_generator_identity_variables = [ + 'EXECUTABLE_PREFIX', + 'EXECUTABLE_SUFFIX', + 'INTERMEDIATE_DIR', + 'PRODUCT_DIR', + 'RULE_INPUT_ROOT', + 'RULE_INPUT_DIRNAME', + 'RULE_INPUT_EXT', + 'RULE_INPUT_NAME', + 'RULE_INPUT_PATH', + 'SHARED_INTERMEDIATE_DIR', +] + +generator_default_variables = { +} + +for v in _generator_identity_variables: + generator_default_variables[v] = '<(%s)' % v + + +def GenerateOutput(target_list, target_dicts, data, params): + locals = { + 'target_list': target_list, + 'target_dicts': target_dicts, + 'data': data, + } + + # Use a banner that looks like the stock Python one and like what + # code.interact uses by default, but tack on something to indicate what + # locals are available, and identify gypsh. + banner='Python %s on %s\nlocals.keys() = %s\ngypsh' % \ + (sys.version, sys.platform, repr(sorted(locals.keys()))) + + code.interact(banner, local=locals) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py new file mode 100644 index 00000000..64b9dd26 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py @@ -0,0 +1,2220 @@ +# Copyright (c) 2013 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Notes: +# +# This is all roughly based on the Makefile system used by the Linux +# kernel, but is a non-recursive make -- we put the entire dependency +# graph in front of make and let it figure it out. +# +# The code below generates a separate .mk file for each target, but +# all are sourced by the top-level Makefile. This means that all +# variables in .mk-files clobber one another. Be careful to use := +# where appropriate for immediate evaluation, and similarly to watch +# that you're not relying on a variable value to last beween different +# .mk files. +# +# TODOs: +# +# Global settings and utility functions are currently stuffed in the +# toplevel Makefile. It may make sense to generate some .mk files on +# the side to keep the the files readable. + +import os +import re +import sys +import subprocess +import gyp +import gyp.common +import gyp.xcode_emulation +from gyp.common import GetEnvironFallback +from gyp.common import GypError + +generator_default_variables = { + 'EXECUTABLE_PREFIX': '', + 'EXECUTABLE_SUFFIX': '', + 'STATIC_LIB_PREFIX': 'lib', + 'SHARED_LIB_PREFIX': 'lib', + 'STATIC_LIB_SUFFIX': '.a', + 'INTERMEDIATE_DIR': '$(obj).$(TOOLSET)/$(TARGET)/geni', + 'SHARED_INTERMEDIATE_DIR': '$(obj)/gen', + 'PRODUCT_DIR': '$(builddir)', + 'RULE_INPUT_ROOT': '%(INPUT_ROOT)s', # This gets expanded by Python. + 'RULE_INPUT_DIRNAME': '%(INPUT_DIRNAME)s', # This gets expanded by Python. + 'RULE_INPUT_PATH': '$(abspath $<)', + 'RULE_INPUT_EXT': '$(suffix $<)', + 'RULE_INPUT_NAME': '$(notdir $<)', + 'CONFIGURATION_NAME': '$(BUILDTYPE)', +} + +# Make supports multiple toolsets +generator_supports_multiple_toolsets = True + +# Request sorted dependencies in the order from dependents to dependencies. +generator_wants_sorted_dependencies = False + +# Placates pylint. +generator_additional_non_configuration_keys = [] +generator_additional_path_sections = [] +generator_extra_sources_for_rules = [] +generator_filelist_paths = None + + +def CalculateVariables(default_variables, params): + """Calculate additional variables for use in the build (called by gyp).""" + flavor = gyp.common.GetFlavor(params) + if flavor == 'mac': + default_variables.setdefault('OS', 'mac') + default_variables.setdefault('SHARED_LIB_SUFFIX', '.dylib') + default_variables.setdefault('SHARED_LIB_DIR', + generator_default_variables['PRODUCT_DIR']) + default_variables.setdefault('LIB_DIR', + generator_default_variables['PRODUCT_DIR']) + + # Copy additional generator configuration data from Xcode, which is shared + # by the Mac Make generator. + import gyp.generator.xcode as xcode_generator + global generator_additional_non_configuration_keys + generator_additional_non_configuration_keys = getattr(xcode_generator, + 'generator_additional_non_configuration_keys', []) + global generator_additional_path_sections + generator_additional_path_sections = getattr(xcode_generator, + 'generator_additional_path_sections', []) + global generator_extra_sources_for_rules + generator_extra_sources_for_rules = getattr(xcode_generator, + 'generator_extra_sources_for_rules', []) + COMPILABLE_EXTENSIONS.update({'.m': 'objc', '.mm' : 'objcxx'}) + else: + operating_system = flavor + if flavor == 'android': + operating_system = 'linux' # Keep this legacy behavior for now. + default_variables.setdefault('OS', operating_system) + default_variables.setdefault('SHARED_LIB_SUFFIX', '.so') + default_variables.setdefault('SHARED_LIB_DIR','$(builddir)/lib.$(TOOLSET)') + default_variables.setdefault('LIB_DIR', '$(obj).$(TOOLSET)') + + +def CalculateGeneratorInputInfo(params): + """Calculate the generator specific info that gets fed to input (called by + gyp).""" + generator_flags = params.get('generator_flags', {}) + android_ndk_version = generator_flags.get('android_ndk_version', None) + # Android NDK requires a strict link order. + if android_ndk_version: + global generator_wants_sorted_dependencies + generator_wants_sorted_dependencies = True + + output_dir = params['options'].generator_output or \ + params['options'].toplevel_dir + builddir_name = generator_flags.get('output_dir', 'out') + qualified_out_dir = os.path.normpath(os.path.join( + output_dir, builddir_name, 'gypfiles')) + + global generator_filelist_paths + generator_filelist_paths = { + 'toplevel': params['options'].toplevel_dir, + 'qualified_out_dir': qualified_out_dir, + } + + +# The .d checking code below uses these functions: +# wildcard, sort, foreach, shell, wordlist +# wildcard can handle spaces, the rest can't. +# Since I could find no way to make foreach work with spaces in filenames +# correctly, the .d files have spaces replaced with another character. The .d +# file for +# Chromium\ Framework.framework/foo +# is for example +# out/Release/.deps/out/Release/Chromium?Framework.framework/foo +# This is the replacement character. +SPACE_REPLACEMENT = '?' + + +LINK_COMMANDS_LINUX = """\ +quiet_cmd_alink = AR($(TOOLSET)) $@ +cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^) + +quiet_cmd_alink_thin = AR($(TOOLSET)) $@ +cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^) + +# Due to circular dependencies between libraries :(, we wrap the +# special "figure out circular dependencies" flags around the entire +# input list during linking. +quiet_cmd_link = LINK($(TOOLSET)) $@ +cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS) + +# We support two kinds of shared objects (.so): +# 1) shared_library, which is just bundling together many dependent libraries +# into a link line. +# 2) loadable_module, which is generating a module intended for dlopen(). +# +# They differ only slightly: +# In the former case, we want to package all dependent code into the .so. +# In the latter case, we want to package just the API exposed by the +# outermost module. +# This means shared_library uses --whole-archive, while loadable_module doesn't. +# (Note that --whole-archive is incompatible with the --start-group used in +# normal linking.) + +# Other shared-object link notes: +# - Set SONAME to the library filename so our binaries don't reference +# the local, absolute paths used on the link command-line. +quiet_cmd_solink = SOLINK($(TOOLSET)) $@ +cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--whole-archive $(LD_INPUTS) -Wl,--no-whole-archive $(LIBS) + +quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ +cmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS) +""" + +LINK_COMMANDS_MAC = """\ +quiet_cmd_alink = LIBTOOL-STATIC $@ +cmd_alink = rm -f $@ && ./gyp-mac-tool filter-libtool libtool $(GYP_LIBTOOLFLAGS) -static -o $@ $(filter %.o,$^) + +quiet_cmd_link = LINK($(TOOLSET)) $@ +cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS) + +quiet_cmd_solink = SOLINK($(TOOLSET)) $@ +cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS) + +quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ +cmd_solink_module = $(LINK.$(TOOLSET)) -bundle $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) +""" + +LINK_COMMANDS_ANDROID = """\ +quiet_cmd_alink = AR($(TOOLSET)) $@ +cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^) + +quiet_cmd_alink_thin = AR($(TOOLSET)) $@ +cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^) + +# Due to circular dependencies between libraries :(, we wrap the +# special "figure out circular dependencies" flags around the entire +# input list during linking. +quiet_cmd_link = LINK($(TOOLSET)) $@ +quiet_cmd_link_host = LINK($(TOOLSET)) $@ +cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS) +cmd_link_host = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) + +# Other shared-object link notes: +# - Set SONAME to the library filename so our binaries don't reference +# the local, absolute paths used on the link command-line. +quiet_cmd_solink = SOLINK($(TOOLSET)) $@ +cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--whole-archive $(LD_INPUTS) -Wl,--no-whole-archive $(LIBS) + +quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ +cmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS) +quiet_cmd_solink_module_host = SOLINK_MODULE($(TOOLSET)) $@ +cmd_solink_module_host = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) +""" + + +LINK_COMMANDS_AIX = """\ +quiet_cmd_alink = AR($(TOOLSET)) $@ +cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) -X32_64 crs $@ $(filter %.o,$^) + +quiet_cmd_alink_thin = AR($(TOOLSET)) $@ +cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) -X32_64 crs $@ $(filter %.o,$^) + +quiet_cmd_link = LINK($(TOOLSET)) $@ +cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) + +quiet_cmd_solink = SOLINK($(TOOLSET)) $@ +cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) + +quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ +cmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) +""" + + +# Header of toplevel Makefile. +# This should go into the build tree, but it's easier to keep it here for now. +SHARED_HEADER = ("""\ +# We borrow heavily from the kernel build setup, though we are simpler since +# we don't have Kconfig tweaking settings on us. + +# The implicit make rules have it looking for RCS files, among other things. +# We instead explicitly write all the rules we care about. +# It's even quicker (saves ~200ms) to pass -r on the command line. +MAKEFLAGS=-r + +# The source directory tree. +srcdir := %(srcdir)s +abs_srcdir := $(abspath $(srcdir)) + +# The name of the builddir. +builddir_name ?= %(builddir)s + +# The V=1 flag on command line makes us verbosely print command lines. +ifdef V + quiet= +else + quiet=quiet_ +endif + +# Specify BUILDTYPE=Release on the command line for a release build. +BUILDTYPE ?= %(default_configuration)s + +# Directory all our build output goes into. +# Note that this must be two directories beneath src/ for unit tests to pass, +# as they reach into the src/ directory for data with relative paths. +builddir ?= $(builddir_name)/$(BUILDTYPE) +abs_builddir := $(abspath $(builddir)) +depsdir := $(builddir)/.deps + +# Object output directory. +obj := $(builddir)/obj +abs_obj := $(abspath $(obj)) + +# We build up a list of every single one of the targets so we can slurp in the +# generated dependency rule Makefiles in one pass. +all_deps := + +%(make_global_settings)s + +CC.target ?= %(CC.target)s +CFLAGS.target ?= $(CPPFLAGS) $(CFLAGS) +CXX.target ?= %(CXX.target)s +CXXFLAGS.target ?= $(CPPFLAGS) $(CXXFLAGS) +LINK.target ?= %(LINK.target)s +LDFLAGS.target ?= $(LDFLAGS) +AR.target ?= $(AR) + +# C++ apps need to be linked with g++. +LINK ?= $(CXX.target) + +# TODO(evan): move all cross-compilation logic to gyp-time so we don't need +# to replicate this environment fallback in make as well. +CC.host ?= %(CC.host)s +CFLAGS.host ?= $(CPPFLAGS_host) $(CFLAGS_host) +CXX.host ?= %(CXX.host)s +CXXFLAGS.host ?= $(CPPFLAGS_host) $(CXXFLAGS_host) +LINK.host ?= %(LINK.host)s +LDFLAGS.host ?= +AR.host ?= %(AR.host)s + +# Define a dir function that can handle spaces. +# http://www.gnu.org/software/make/manual/make.html#Syntax-of-Functions +# "leading spaces cannot appear in the text of the first argument as written. +# These characters can be put into the argument value by variable substitution." +empty := +space := $(empty) $(empty) + +# http://stackoverflow.com/questions/1189781/using-make-dir-or-notdir-on-a-path-with-spaces +replace_spaces = $(subst $(space),""" + SPACE_REPLACEMENT + """,$1) +unreplace_spaces = $(subst """ + SPACE_REPLACEMENT + """,$(space),$1) +dirx = $(call unreplace_spaces,$(dir $(call replace_spaces,$1))) + +# Flags to make gcc output dependency info. Note that you need to be +# careful here to use the flags that ccache and distcc can understand. +# We write to a dep file on the side first and then rename at the end +# so we can't end up with a broken dep file. +depfile = $(depsdir)/$(call replace_spaces,$@).d +DEPFLAGS = -MMD -MF $(depfile).raw + +# We have to fixup the deps output in a few ways. +# (1) the file output should mention the proper .o file. +# ccache or distcc lose the path to the target, so we convert a rule of +# the form: +# foobar.o: DEP1 DEP2 +# into +# path/to/foobar.o: DEP1 DEP2 +# (2) we want missing files not to cause us to fail to build. +# We want to rewrite +# foobar.o: DEP1 DEP2 \\ +# DEP3 +# to +# DEP1: +# DEP2: +# DEP3: +# so if the files are missing, they're just considered phony rules. +# We have to do some pretty insane escaping to get those backslashes +# and dollar signs past make, the shell, and sed at the same time. +# Doesn't work with spaces, but that's fine: .d files have spaces in +# their names replaced with other characters.""" +r""" +define fixup_dep +# The depfile may not exist if the input file didn't have any #includes. +touch $(depfile).raw +# Fixup path as in (1). +sed -e "s|^$(notdir $@)|$@|" $(depfile).raw >> $(depfile) +# Add extra rules as in (2). +# We remove slashes and replace spaces with new lines; +# remove blank lines; +# delete the first line and append a colon to the remaining lines. +sed -e 's|\\||' -e 'y| |\n|' $(depfile).raw |\ + grep -v '^$$' |\ + sed -e 1d -e 's|$$|:|' \ + >> $(depfile) +rm $(depfile).raw +endef +""" +""" +# Command definitions: +# - cmd_foo is the actual command to run; +# - quiet_cmd_foo is the brief-output summary of the command. + +quiet_cmd_cc = CC($(TOOLSET)) $@ +cmd_cc = $(CC.$(TOOLSET)) $(GYP_CFLAGS) $(DEPFLAGS) $(CFLAGS.$(TOOLSET)) -c -o $@ $< + +quiet_cmd_cxx = CXX($(TOOLSET)) $@ +cmd_cxx = $(CXX.$(TOOLSET)) $(GYP_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $< +%(extra_commands)s +quiet_cmd_touch = TOUCH $@ +cmd_touch = touch $@ + +quiet_cmd_copy = COPY $@ +# send stderr to /dev/null to ignore messages when linking directories. +cmd_copy = rm -rf "$@" && cp %(copy_archive_args)s "$<" "$@" + +%(link_commands)s +""" + +r""" +# Define an escape_quotes function to escape single quotes. +# This allows us to handle quotes properly as long as we always use +# use single quotes and escape_quotes. +escape_quotes = $(subst ','\'',$(1)) +# This comment is here just to include a ' to unconfuse syntax highlighting. +# Define an escape_vars function to escape '$' variable syntax. +# This allows us to read/write command lines with shell variables (e.g. +# $LD_LIBRARY_PATH), without triggering make substitution. +escape_vars = $(subst $$,$$$$,$(1)) +# Helper that expands to a shell command to echo a string exactly as it is in +# make. This uses printf instead of echo because printf's behaviour with respect +# to escape sequences is more portable than echo's across different shells +# (e.g., dash, bash). +exact_echo = printf '%%s\n' '$(call escape_quotes,$(1))' +""" +""" +# Helper to compare the command we're about to run against the command +# we logged the last time we ran the command. Produces an empty +# string (false) when the commands match. +# Tricky point: Make has no string-equality test function. +# The kernel uses the following, but it seems like it would have false +# positives, where one string reordered its arguments. +# arg_check = $(strip $(filter-out $(cmd_$(1)), $(cmd_$@)) \\ +# $(filter-out $(cmd_$@), $(cmd_$(1)))) +# We instead substitute each for the empty string into the other, and +# say they're equal if both substitutions produce the empty string. +# .d files contain """ + SPACE_REPLACEMENT + \ + """ instead of spaces, take that into account. +command_changed = $(or $(subst $(cmd_$(1)),,$(cmd_$(call replace_spaces,$@))),\\ + $(subst $(cmd_$(call replace_spaces,$@)),,$(cmd_$(1)))) + +# Helper that is non-empty when a prerequisite changes. +# Normally make does this implicitly, but we force rules to always run +# so we can check their command lines. +# $? -- new prerequisites +# $| -- order-only dependencies +prereq_changed = $(filter-out FORCE_DO_CMD,$(filter-out $|,$?)) + +# Helper that executes all postbuilds until one fails. +define do_postbuilds + @E=0;\\ + for p in $(POSTBUILDS); do\\ + eval $$p;\\ + E=$$?;\\ + if [ $$E -ne 0 ]; then\\ + break;\\ + fi;\\ + done;\\ + if [ $$E -ne 0 ]; then\\ + rm -rf "$@";\\ + exit $$E;\\ + fi +endef + +# do_cmd: run a command via the above cmd_foo names, if necessary. +# Should always run for a given target to handle command-line changes. +# Second argument, if non-zero, makes it do asm/C/C++ dependency munging. +# Third argument, if non-zero, makes it do POSTBUILDS processing. +# Note: We intentionally do NOT call dirx for depfile, since it contains """ + \ + SPACE_REPLACEMENT + """ for +# spaces already and dirx strips the """ + SPACE_REPLACEMENT + \ + """ characters. +define do_cmd +$(if $(or $(command_changed),$(prereq_changed)), + @$(call exact_echo, $($(quiet)cmd_$(1))) + @mkdir -p "$(call dirx,$@)" "$(dir $(depfile))" + $(if $(findstring flock,$(word %(flock_index)d,$(cmd_$1))), + @$(cmd_$(1)) + @echo " $(quiet_cmd_$(1)): Finished", + @$(cmd_$(1)) + ) + @$(call exact_echo,$(call escape_vars,cmd_$(call replace_spaces,$@) := $(cmd_$(1)))) > $(depfile) + @$(if $(2),$(fixup_dep)) + $(if $(and $(3), $(POSTBUILDS)), + $(call do_postbuilds) + ) +) +endef + +# Declare the "%(default_target)s" target first so it is the default, +# even though we don't have the deps yet. +.PHONY: %(default_target)s +%(default_target)s: + +# make looks for ways to re-generate included makefiles, but in our case, we +# don't have a direct way. Explicitly telling make that it has nothing to do +# for them makes it go faster. +%%.d: ; + +# Use FORCE_DO_CMD to force a target to run. Should be coupled with +# do_cmd. +.PHONY: FORCE_DO_CMD +FORCE_DO_CMD: + +""") + +SHARED_HEADER_MAC_COMMANDS = """ +quiet_cmd_objc = CXX($(TOOLSET)) $@ +cmd_objc = $(CC.$(TOOLSET)) $(GYP_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $< + +quiet_cmd_objcxx = CXX($(TOOLSET)) $@ +cmd_objcxx = $(CXX.$(TOOLSET)) $(GYP_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $< + +# Commands for precompiled header files. +quiet_cmd_pch_c = CXX($(TOOLSET)) $@ +cmd_pch_c = $(CC.$(TOOLSET)) $(GYP_PCH_CFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $< +quiet_cmd_pch_cc = CXX($(TOOLSET)) $@ +cmd_pch_cc = $(CC.$(TOOLSET)) $(GYP_PCH_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $< +quiet_cmd_pch_m = CXX($(TOOLSET)) $@ +cmd_pch_m = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $< +quiet_cmd_pch_mm = CXX($(TOOLSET)) $@ +cmd_pch_mm = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $< + +# gyp-mac-tool is written next to the root Makefile by gyp. +# Use $(4) for the command, since $(2) and $(3) are used as flag by do_cmd +# already. +quiet_cmd_mac_tool = MACTOOL $(4) $< +cmd_mac_tool = ./gyp-mac-tool $(4) $< "$@" + +quiet_cmd_mac_package_framework = PACKAGE FRAMEWORK $@ +cmd_mac_package_framework = ./gyp-mac-tool package-framework "$@" $(4) + +quiet_cmd_infoplist = INFOPLIST $@ +cmd_infoplist = $(CC.$(TOOLSET)) -E -P -Wno-trigraphs -x c $(INFOPLIST_DEFINES) "$<" -o "$@" +""" + + +def WriteRootHeaderSuffixRules(writer): + extensions = sorted(COMPILABLE_EXTENSIONS.keys(), key=str.lower) + + writer.write('# Suffix rules, putting all outputs into $(obj).\n') + for ext in extensions: + writer.write('$(obj).$(TOOLSET)/%%.o: $(srcdir)/%%%s FORCE_DO_CMD\n' % ext) + writer.write('\t@$(call do_cmd,%s,1)\n' % COMPILABLE_EXTENSIONS[ext]) + + writer.write('\n# Try building from generated source, too.\n') + for ext in extensions: + writer.write( + '$(obj).$(TOOLSET)/%%.o: $(obj).$(TOOLSET)/%%%s FORCE_DO_CMD\n' % ext) + writer.write('\t@$(call do_cmd,%s,1)\n' % COMPILABLE_EXTENSIONS[ext]) + writer.write('\n') + for ext in extensions: + writer.write('$(obj).$(TOOLSET)/%%.o: $(obj)/%%%s FORCE_DO_CMD\n' % ext) + writer.write('\t@$(call do_cmd,%s,1)\n' % COMPILABLE_EXTENSIONS[ext]) + writer.write('\n') + + +SHARED_HEADER_SUFFIX_RULES_COMMENT1 = ("""\ +# Suffix rules, putting all outputs into $(obj). +""") + + +SHARED_HEADER_SUFFIX_RULES_COMMENT2 = ("""\ +# Try building from generated source, too. +""") + + +SHARED_FOOTER = """\ +# "all" is a concatenation of the "all" targets from all the included +# sub-makefiles. This is just here to clarify. +all: + +# Add in dependency-tracking rules. $(all_deps) is the list of every single +# target in our tree. Only consider the ones with .d (dependency) info: +d_files := $(wildcard $(foreach f,$(all_deps),$(depsdir)/$(f).d)) +ifneq ($(d_files),) + include $(d_files) +endif +""" + +header = """\ +# This file is generated by gyp; do not edit. + +""" + +# Maps every compilable file extension to the do_cmd that compiles it. +COMPILABLE_EXTENSIONS = { + '.c': 'cc', + '.cc': 'cxx', + '.cpp': 'cxx', + '.cxx': 'cxx', + '.s': 'cc', + '.S': 'cc', +} + +def Compilable(filename): + """Return true if the file is compilable (should be in OBJS).""" + for res in (filename.endswith(e) for e in COMPILABLE_EXTENSIONS): + if res: + return True + return False + + +def Linkable(filename): + """Return true if the file is linkable (should be on the link line).""" + return filename.endswith('.o') + + +def Target(filename): + """Translate a compilable filename to its .o target.""" + return os.path.splitext(filename)[0] + '.o' + + +def EscapeShellArgument(s): + """Quotes an argument so that it will be interpreted literally by a POSIX + shell. Taken from + http://stackoverflow.com/questions/35817/whats-the-best-way-to-escape-ossystem-calls-in-python + """ + return "'" + s.replace("'", "'\\''") + "'" + + +def EscapeMakeVariableExpansion(s): + """Make has its own variable expansion syntax using $. We must escape it for + string to be interpreted literally.""" + return s.replace('$', '$$') + + +def EscapeCppDefine(s): + """Escapes a CPP define so that it will reach the compiler unaltered.""" + s = EscapeShellArgument(s) + s = EscapeMakeVariableExpansion(s) + # '#' characters must be escaped even embedded in a string, else Make will + # treat it as the start of a comment. + return s.replace('#', r'\#') + + +def QuoteIfNecessary(string): + """TODO: Should this ideally be replaced with one or more of the above + functions?""" + if '"' in string: + string = '"' + string.replace('"', '\\"') + '"' + return string + + +def StringToMakefileVariable(string): + """Convert a string to a value that is acceptable as a make variable name.""" + return re.sub('[^a-zA-Z0-9_]', '_', string) + + +srcdir_prefix = '' +def Sourceify(path): + """Convert a path to its source directory form.""" + if '$(' in path: + return path + if os.path.isabs(path): + return path + return srcdir_prefix + path + + +def QuoteSpaces(s, quote=r'\ '): + return s.replace(' ', quote) + + +# TODO: Avoid code duplication with _ValidateSourcesForMSVSProject in msvs.py. +def _ValidateSourcesForOSX(spec, all_sources): + """Makes sure if duplicate basenames are not specified in the source list. + + Arguments: + spec: The target dictionary containing the properties of the target. + """ + if spec.get('type', None) != 'static_library': + return + + basenames = {} + for source in all_sources: + name, ext = os.path.splitext(source) + is_compiled_file = ext in [ + '.c', '.cc', '.cpp', '.cxx', '.m', '.mm', '.s', '.S'] + if not is_compiled_file: + continue + basename = os.path.basename(name) # Don't include extension. + basenames.setdefault(basename, []).append(source) + + error = '' + for basename, files in basenames.iteritems(): + if len(files) > 1: + error += ' %s: %s\n' % (basename, ' '.join(files)) + + if error: + print('static library %s has several files with the same basename:\n' % + spec['target_name'] + error + 'libtool on OS X will generate' + + ' warnings for them.') + raise GypError('Duplicate basenames in sources section, see list above') + + +# Map from qualified target to path to output. +target_outputs = {} +# Map from qualified target to any linkable output. A subset +# of target_outputs. E.g. when mybinary depends on liba, we want to +# include liba in the linker line; when otherbinary depends on +# mybinary, we just want to build mybinary first. +target_link_deps = {} + + +class MakefileWriter(object): + """MakefileWriter packages up the writing of one target-specific foobar.mk. + + Its only real entry point is Write(), and is mostly used for namespacing. + """ + + def __init__(self, generator_flags, flavor): + self.generator_flags = generator_flags + self.flavor = flavor + + self.suffix_rules_srcdir = {} + self.suffix_rules_objdir1 = {} + self.suffix_rules_objdir2 = {} + + # Generate suffix rules for all compilable extensions. + for ext in COMPILABLE_EXTENSIONS.keys(): + # Suffix rules for source folder. + self.suffix_rules_srcdir.update({ext: ("""\ +$(obj).$(TOOLSET)/$(TARGET)/%%.o: $(srcdir)/%%%s FORCE_DO_CMD + @$(call do_cmd,%s,1) +""" % (ext, COMPILABLE_EXTENSIONS[ext]))}) + + # Suffix rules for generated source files. + self.suffix_rules_objdir1.update({ext: ("""\ +$(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj).$(TOOLSET)/%%%s FORCE_DO_CMD + @$(call do_cmd,%s,1) +""" % (ext, COMPILABLE_EXTENSIONS[ext]))}) + self.suffix_rules_objdir2.update({ext: ("""\ +$(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj)/%%%s FORCE_DO_CMD + @$(call do_cmd,%s,1) +""" % (ext, COMPILABLE_EXTENSIONS[ext]))}) + + + def Write(self, qualified_target, base_path, output_filename, spec, configs, + part_of_all): + """The main entry point: writes a .mk file for a single target. + + Arguments: + qualified_target: target we're generating + base_path: path relative to source root we're building in, used to resolve + target-relative paths + output_filename: output .mk file name to write + spec, configs: gyp info + part_of_all: flag indicating this target is part of 'all' + """ + gyp.common.EnsureDirExists(output_filename) + + self.fp = open(output_filename, 'w') + + self.fp.write(header) + + self.qualified_target = qualified_target + self.path = base_path + self.target = spec['target_name'] + self.type = spec['type'] + self.toolset = spec['toolset'] + + self.is_mac_bundle = gyp.xcode_emulation.IsMacBundle(self.flavor, spec) + if self.flavor == 'mac': + self.xcode_settings = gyp.xcode_emulation.XcodeSettings(spec) + else: + self.xcode_settings = None + + deps, link_deps = self.ComputeDeps(spec) + + # Some of the generation below can add extra output, sources, or + # link dependencies. All of the out params of the functions that + # follow use names like extra_foo. + extra_outputs = [] + extra_sources = [] + extra_link_deps = [] + extra_mac_bundle_resources = [] + mac_bundle_deps = [] + + if self.is_mac_bundle: + self.output = self.ComputeMacBundleOutput(spec) + self.output_binary = self.ComputeMacBundleBinaryOutput(spec) + else: + self.output = self.output_binary = self.ComputeOutput(spec) + + self.is_standalone_static_library = bool( + spec.get('standalone_static_library', 0)) + self._INSTALLABLE_TARGETS = ('executable', 'loadable_module', + 'shared_library') + if (self.is_standalone_static_library or + self.type in self._INSTALLABLE_TARGETS): + self.alias = os.path.basename(self.output) + install_path = self._InstallableTargetInstallPath() + else: + self.alias = self.output + install_path = self.output + + self.WriteLn("TOOLSET := " + self.toolset) + self.WriteLn("TARGET := " + self.target) + + # Actions must come first, since they can generate more OBJs for use below. + if 'actions' in spec: + self.WriteActions(spec['actions'], extra_sources, extra_outputs, + extra_mac_bundle_resources, part_of_all) + + # Rules must be early like actions. + if 'rules' in spec: + self.WriteRules(spec['rules'], extra_sources, extra_outputs, + extra_mac_bundle_resources, part_of_all) + + if 'copies' in spec: + self.WriteCopies(spec['copies'], extra_outputs, part_of_all) + + # Bundle resources. + if self.is_mac_bundle: + all_mac_bundle_resources = ( + spec.get('mac_bundle_resources', []) + extra_mac_bundle_resources) + self.WriteMacBundleResources(all_mac_bundle_resources, mac_bundle_deps) + self.WriteMacInfoPlist(mac_bundle_deps) + + # Sources. + all_sources = spec.get('sources', []) + extra_sources + if all_sources: + if self.flavor == 'mac': + # libtool on OS X generates warnings for duplicate basenames in the same + # target. + _ValidateSourcesForOSX(spec, all_sources) + self.WriteSources( + configs, deps, all_sources, extra_outputs, + extra_link_deps, part_of_all, + gyp.xcode_emulation.MacPrefixHeader( + self.xcode_settings, lambda p: Sourceify(self.Absolutify(p)), + self.Pchify)) + sources = filter(Compilable, all_sources) + if sources: + self.WriteLn(SHARED_HEADER_SUFFIX_RULES_COMMENT1) + extensions = set([os.path.splitext(s)[1] for s in sources]) + for ext in extensions: + if ext in self.suffix_rules_srcdir: + self.WriteLn(self.suffix_rules_srcdir[ext]) + self.WriteLn(SHARED_HEADER_SUFFIX_RULES_COMMENT2) + for ext in extensions: + if ext in self.suffix_rules_objdir1: + self.WriteLn(self.suffix_rules_objdir1[ext]) + for ext in extensions: + if ext in self.suffix_rules_objdir2: + self.WriteLn(self.suffix_rules_objdir2[ext]) + self.WriteLn('# End of this set of suffix rules') + + # Add dependency from bundle to bundle binary. + if self.is_mac_bundle: + mac_bundle_deps.append(self.output_binary) + + self.WriteTarget(spec, configs, deps, extra_link_deps + link_deps, + mac_bundle_deps, extra_outputs, part_of_all) + + # Update global list of target outputs, used in dependency tracking. + target_outputs[qualified_target] = install_path + + # Update global list of link dependencies. + if self.type in ('static_library', 'shared_library'): + target_link_deps[qualified_target] = self.output_binary + + # Currently any versions have the same effect, but in future the behavior + # could be different. + if self.generator_flags.get('android_ndk_version', None): + self.WriteAndroidNdkModuleRule(self.target, all_sources, link_deps) + + self.fp.close() + + + def WriteSubMake(self, output_filename, makefile_path, targets, build_dir): + """Write a "sub-project" Makefile. + + This is a small, wrapper Makefile that calls the top-level Makefile to build + the targets from a single gyp file (i.e. a sub-project). + + Arguments: + output_filename: sub-project Makefile name to write + makefile_path: path to the top-level Makefile + targets: list of "all" targets for this sub-project + build_dir: build output directory, relative to the sub-project + """ + gyp.common.EnsureDirExists(output_filename) + self.fp = open(output_filename, 'w') + self.fp.write(header) + # For consistency with other builders, put sub-project build output in the + # sub-project dir (see test/subdirectory/gyptest-subdir-all.py). + self.WriteLn('export builddir_name ?= %s' % + os.path.join(os.path.dirname(output_filename), build_dir)) + self.WriteLn('.PHONY: all') + self.WriteLn('all:') + if makefile_path: + makefile_path = ' -C ' + makefile_path + self.WriteLn('\t$(MAKE)%s %s' % (makefile_path, ' '.join(targets))) + self.fp.close() + + + def WriteActions(self, actions, extra_sources, extra_outputs, + extra_mac_bundle_resources, part_of_all): + """Write Makefile code for any 'actions' from the gyp input. + + extra_sources: a list that will be filled in with newly generated source + files, if any + extra_outputs: a list that will be filled in with any outputs of these + actions (used to make other pieces dependent on these + actions) + part_of_all: flag indicating this target is part of 'all' + """ + env = self.GetSortedXcodeEnv() + for action in actions: + name = StringToMakefileVariable('%s_%s' % (self.qualified_target, + action['action_name'])) + self.WriteLn('### Rules for action "%s":' % action['action_name']) + inputs = action['inputs'] + outputs = action['outputs'] + + # Build up a list of outputs. + # Collect the output dirs we'll need. + dirs = set() + for out in outputs: + dir = os.path.split(out)[0] + if dir: + dirs.add(dir) + if int(action.get('process_outputs_as_sources', False)): + extra_sources += outputs + if int(action.get('process_outputs_as_mac_bundle_resources', False)): + extra_mac_bundle_resources += outputs + + # Write the actual command. + action_commands = action['action'] + if self.flavor == 'mac': + action_commands = [gyp.xcode_emulation.ExpandEnvVars(command, env) + for command in action_commands] + command = gyp.common.EncodePOSIXShellList(action_commands) + if 'message' in action: + self.WriteLn('quiet_cmd_%s = ACTION %s $@' % (name, action['message'])) + else: + self.WriteLn('quiet_cmd_%s = ACTION %s $@' % (name, name)) + if len(dirs) > 0: + command = 'mkdir -p %s' % ' '.join(dirs) + '; ' + command + + cd_action = 'cd %s; ' % Sourceify(self.path or '.') + + # command and cd_action get written to a toplevel variable called + # cmd_foo. Toplevel variables can't handle things that change per + # makefile like $(TARGET), so hardcode the target. + command = command.replace('$(TARGET)', self.target) + cd_action = cd_action.replace('$(TARGET)', self.target) + + # Set LD_LIBRARY_PATH in case the action runs an executable from this + # build which links to shared libs from this build. + # actions run on the host, so they should in theory only use host + # libraries, but until everything is made cross-compile safe, also use + # target libraries. + # TODO(piman): when everything is cross-compile safe, remove lib.target + self.WriteLn('cmd_%s = LD_LIBRARY_PATH=$(builddir)/lib.host:' + '$(builddir)/lib.target:$$LD_LIBRARY_PATH; ' + 'export LD_LIBRARY_PATH; ' + '%s%s' + % (name, cd_action, command)) + self.WriteLn() + outputs = map(self.Absolutify, outputs) + # The makefile rules are all relative to the top dir, but the gyp actions + # are defined relative to their containing dir. This replaces the obj + # variable for the action rule with an absolute version so that the output + # goes in the right place. + # Only write the 'obj' and 'builddir' rules for the "primary" output (:1); + # it's superfluous for the "extra outputs", and this avoids accidentally + # writing duplicate dummy rules for those outputs. + # Same for environment. + self.WriteLn("%s: obj := $(abs_obj)" % QuoteSpaces(outputs[0])) + self.WriteLn("%s: builddir := $(abs_builddir)" % QuoteSpaces(outputs[0])) + self.WriteSortedXcodeEnv(outputs[0], self.GetSortedXcodeEnv()) + + for input in inputs: + assert ' ' not in input, ( + "Spaces in action input filenames not supported (%s)" % input) + for output in outputs: + assert ' ' not in output, ( + "Spaces in action output filenames not supported (%s)" % output) + + # See the comment in WriteCopies about expanding env vars. + outputs = [gyp.xcode_emulation.ExpandEnvVars(o, env) for o in outputs] + inputs = [gyp.xcode_emulation.ExpandEnvVars(i, env) for i in inputs] + + self.WriteDoCmd(outputs, map(Sourceify, map(self.Absolutify, inputs)), + part_of_all=part_of_all, command=name) + + # Stuff the outputs in a variable so we can refer to them later. + outputs_variable = 'action_%s_outputs' % name + self.WriteLn('%s := %s' % (outputs_variable, ' '.join(outputs))) + extra_outputs.append('$(%s)' % outputs_variable) + self.WriteLn() + + self.WriteLn() + + + def WriteRules(self, rules, extra_sources, extra_outputs, + extra_mac_bundle_resources, part_of_all): + """Write Makefile code for any 'rules' from the gyp input. + + extra_sources: a list that will be filled in with newly generated source + files, if any + extra_outputs: a list that will be filled in with any outputs of these + rules (used to make other pieces dependent on these rules) + part_of_all: flag indicating this target is part of 'all' + """ + env = self.GetSortedXcodeEnv() + for rule in rules: + name = StringToMakefileVariable('%s_%s' % (self.qualified_target, + rule['rule_name'])) + count = 0 + self.WriteLn('### Generated for rule %s:' % name) + + all_outputs = [] + + for rule_source in rule.get('rule_sources', []): + dirs = set() + (rule_source_dirname, rule_source_basename) = os.path.split(rule_source) + (rule_source_root, rule_source_ext) = \ + os.path.splitext(rule_source_basename) + + outputs = [self.ExpandInputRoot(out, rule_source_root, + rule_source_dirname) + for out in rule['outputs']] + + for out in outputs: + dir = os.path.dirname(out) + if dir: + dirs.add(dir) + if int(rule.get('process_outputs_as_sources', False)): + extra_sources += outputs + if int(rule.get('process_outputs_as_mac_bundle_resources', False)): + extra_mac_bundle_resources += outputs + inputs = map(Sourceify, map(self.Absolutify, [rule_source] + + rule.get('inputs', []))) + actions = ['$(call do_cmd,%s_%d)' % (name, count)] + + if name == 'resources_grit': + # HACK: This is ugly. Grit intentionally doesn't touch the + # timestamp of its output file when the file doesn't change, + # which is fine in hash-based dependency systems like scons + # and forge, but not kosher in the make world. After some + # discussion, hacking around it here seems like the least + # amount of pain. + actions += ['@touch --no-create $@'] + + # See the comment in WriteCopies about expanding env vars. + outputs = [gyp.xcode_emulation.ExpandEnvVars(o, env) for o in outputs] + inputs = [gyp.xcode_emulation.ExpandEnvVars(i, env) for i in inputs] + + outputs = map(self.Absolutify, outputs) + all_outputs += outputs + # Only write the 'obj' and 'builddir' rules for the "primary" output + # (:1); it's superfluous for the "extra outputs", and this avoids + # accidentally writing duplicate dummy rules for those outputs. + self.WriteLn('%s: obj := $(abs_obj)' % outputs[0]) + self.WriteLn('%s: builddir := $(abs_builddir)' % outputs[0]) + self.WriteMakeRule(outputs, inputs, actions, + command="%s_%d" % (name, count)) + # Spaces in rule filenames are not supported, but rule variables have + # spaces in them (e.g. RULE_INPUT_PATH expands to '$(abspath $<)'). + # The spaces within the variables are valid, so remove the variables + # before checking. + variables_with_spaces = re.compile(r'\$\([^ ]* \$<\)') + for output in outputs: + output = re.sub(variables_with_spaces, '', output) + assert ' ' not in output, ( + "Spaces in rule filenames not yet supported (%s)" % output) + self.WriteLn('all_deps += %s' % ' '.join(outputs)) + + action = [self.ExpandInputRoot(ac, rule_source_root, + rule_source_dirname) + for ac in rule['action']] + mkdirs = '' + if len(dirs) > 0: + mkdirs = 'mkdir -p %s; ' % ' '.join(dirs) + cd_action = 'cd %s; ' % Sourceify(self.path or '.') + + # action, cd_action, and mkdirs get written to a toplevel variable + # called cmd_foo. Toplevel variables can't handle things that change + # per makefile like $(TARGET), so hardcode the target. + if self.flavor == 'mac': + action = [gyp.xcode_emulation.ExpandEnvVars(command, env) + for command in action] + action = gyp.common.EncodePOSIXShellList(action) + action = action.replace('$(TARGET)', self.target) + cd_action = cd_action.replace('$(TARGET)', self.target) + mkdirs = mkdirs.replace('$(TARGET)', self.target) + + # Set LD_LIBRARY_PATH in case the rule runs an executable from this + # build which links to shared libs from this build. + # rules run on the host, so they should in theory only use host + # libraries, but until everything is made cross-compile safe, also use + # target libraries. + # TODO(piman): when everything is cross-compile safe, remove lib.target + self.WriteLn( + "cmd_%(name)s_%(count)d = LD_LIBRARY_PATH=" + "$(builddir)/lib.host:$(builddir)/lib.target:$$LD_LIBRARY_PATH; " + "export LD_LIBRARY_PATH; " + "%(cd_action)s%(mkdirs)s%(action)s" % { + 'action': action, + 'cd_action': cd_action, + 'count': count, + 'mkdirs': mkdirs, + 'name': name, + }) + self.WriteLn( + 'quiet_cmd_%(name)s_%(count)d = RULE %(name)s_%(count)d $@' % { + 'count': count, + 'name': name, + }) + self.WriteLn() + count += 1 + + outputs_variable = 'rule_%s_outputs' % name + self.WriteList(all_outputs, outputs_variable) + extra_outputs.append('$(%s)' % outputs_variable) + + self.WriteLn('### Finished generating for rule: %s' % name) + self.WriteLn() + self.WriteLn('### Finished generating for all rules') + self.WriteLn('') + + + def WriteCopies(self, copies, extra_outputs, part_of_all): + """Write Makefile code for any 'copies' from the gyp input. + + extra_outputs: a list that will be filled in with any outputs of this action + (used to make other pieces dependent on this action) + part_of_all: flag indicating this target is part of 'all' + """ + self.WriteLn('### Generated for copy rule.') + + variable = StringToMakefileVariable(self.qualified_target + '_copies') + outputs = [] + for copy in copies: + for path in copy['files']: + # Absolutify() may call normpath, and will strip trailing slashes. + path = Sourceify(self.Absolutify(path)) + filename = os.path.split(path)[1] + output = Sourceify(self.Absolutify(os.path.join(copy['destination'], + filename))) + + # If the output path has variables in it, which happens in practice for + # 'copies', writing the environment as target-local doesn't work, + # because the variables are already needed for the target name. + # Copying the environment variables into global make variables doesn't + # work either, because then the .d files will potentially contain spaces + # after variable expansion, and .d file handling cannot handle spaces. + # As a workaround, manually expand variables at gyp time. Since 'copies' + # can't run scripts, there's no need to write the env then. + # WriteDoCmd() will escape spaces for .d files. + env = self.GetSortedXcodeEnv() + output = gyp.xcode_emulation.ExpandEnvVars(output, env) + path = gyp.xcode_emulation.ExpandEnvVars(path, env) + self.WriteDoCmd([output], [path], 'copy', part_of_all) + outputs.append(output) + self.WriteLn('%s = %s' % (variable, ' '.join(map(QuoteSpaces, outputs)))) + extra_outputs.append('$(%s)' % variable) + self.WriteLn() + + + def WriteMacBundleResources(self, resources, bundle_deps): + """Writes Makefile code for 'mac_bundle_resources'.""" + self.WriteLn('### Generated for mac_bundle_resources') + + for output, res in gyp.xcode_emulation.GetMacBundleResources( + generator_default_variables['PRODUCT_DIR'], self.xcode_settings, + map(Sourceify, map(self.Absolutify, resources))): + _, ext = os.path.splitext(output) + if ext != '.xcassets': + # Make does not supports '.xcassets' emulation. + self.WriteDoCmd([output], [res], 'mac_tool,,,copy-bundle-resource', + part_of_all=True) + bundle_deps.append(output) + + + def WriteMacInfoPlist(self, bundle_deps): + """Write Makefile code for bundle Info.plist files.""" + info_plist, out, defines, extra_env = gyp.xcode_emulation.GetMacInfoPlist( + generator_default_variables['PRODUCT_DIR'], self.xcode_settings, + lambda p: Sourceify(self.Absolutify(p))) + if not info_plist: + return + if defines: + # Create an intermediate file to store preprocessed results. + intermediate_plist = ('$(obj).$(TOOLSET)/$(TARGET)/' + + os.path.basename(info_plist)) + self.WriteList(defines, intermediate_plist + ': INFOPLIST_DEFINES', '-D', + quoter=EscapeCppDefine) + self.WriteMakeRule([intermediate_plist], [info_plist], + ['$(call do_cmd,infoplist)', + # "Convert" the plist so that any weird whitespace changes from the + # preprocessor do not affect the XML parser in mac_tool. + '@plutil -convert xml1 $@ $@']) + info_plist = intermediate_plist + # plists can contain envvars and substitute them into the file. + self.WriteSortedXcodeEnv( + out, self.GetSortedXcodeEnv(additional_settings=extra_env)) + self.WriteDoCmd([out], [info_plist], 'mac_tool,,,copy-info-plist', + part_of_all=True) + bundle_deps.append(out) + + + def WriteSources(self, configs, deps, sources, + extra_outputs, extra_link_deps, + part_of_all, precompiled_header): + """Write Makefile code for any 'sources' from the gyp input. + These are source files necessary to build the current target. + + configs, deps, sources: input from gyp. + extra_outputs: a list of extra outputs this action should be dependent on; + used to serialize action/rules before compilation + extra_link_deps: a list that will be filled in with any outputs of + compilation (to be used in link lines) + part_of_all: flag indicating this target is part of 'all' + """ + + # Write configuration-specific variables for CFLAGS, etc. + for configname in sorted(configs.keys()): + config = configs[configname] + self.WriteList(config.get('defines'), 'DEFS_%s' % configname, prefix='-D', + quoter=EscapeCppDefine) + + if self.flavor == 'mac': + cflags = self.xcode_settings.GetCflags(configname) + cflags_c = self.xcode_settings.GetCflagsC(configname) + cflags_cc = self.xcode_settings.GetCflagsCC(configname) + cflags_objc = self.xcode_settings.GetCflagsObjC(configname) + cflags_objcc = self.xcode_settings.GetCflagsObjCC(configname) + else: + cflags = config.get('cflags') + cflags_c = config.get('cflags_c') + cflags_cc = config.get('cflags_cc') + + self.WriteLn("# Flags passed to all source files."); + self.WriteList(cflags, 'CFLAGS_%s' % configname) + self.WriteLn("# Flags passed to only C files."); + self.WriteList(cflags_c, 'CFLAGS_C_%s' % configname) + self.WriteLn("# Flags passed to only C++ files."); + self.WriteList(cflags_cc, 'CFLAGS_CC_%s' % configname) + if self.flavor == 'mac': + self.WriteLn("# Flags passed to only ObjC files."); + self.WriteList(cflags_objc, 'CFLAGS_OBJC_%s' % configname) + self.WriteLn("# Flags passed to only ObjC++ files."); + self.WriteList(cflags_objcc, 'CFLAGS_OBJCC_%s' % configname) + includes = config.get('include_dirs') + if includes: + includes = map(Sourceify, map(self.Absolutify, includes)) + self.WriteList(includes, 'INCS_%s' % configname, prefix='-I') + + compilable = filter(Compilable, sources) + objs = map(self.Objectify, map(self.Absolutify, map(Target, compilable))) + self.WriteList(objs, 'OBJS') + + for obj in objs: + assert ' ' not in obj, ( + "Spaces in object filenames not supported (%s)" % obj) + self.WriteLn('# Add to the list of files we specially track ' + 'dependencies for.') + self.WriteLn('all_deps += $(OBJS)') + self.WriteLn() + + # Make sure our dependencies are built first. + if deps: + self.WriteMakeRule(['$(OBJS)'], deps, + comment = 'Make sure our dependencies are built ' + 'before any of us.', + order_only = True) + + # Make sure the actions and rules run first. + # If they generate any extra headers etc., the per-.o file dep tracking + # will catch the proper rebuilds, so order only is still ok here. + if extra_outputs: + self.WriteMakeRule(['$(OBJS)'], extra_outputs, + comment = 'Make sure our actions/rules run ' + 'before any of us.', + order_only = True) + + pchdeps = precompiled_header.GetObjDependencies(compilable, objs ) + if pchdeps: + self.WriteLn('# Dependencies from obj files to their precompiled headers') + for source, obj, gch in pchdeps: + self.WriteLn('%s: %s' % (obj, gch)) + self.WriteLn('# End precompiled header dependencies') + + if objs: + extra_link_deps.append('$(OBJS)') + self.WriteLn("""\ +# CFLAGS et al overrides must be target-local. +# See "Target-specific Variable Values" in the GNU Make manual.""") + self.WriteLn("$(OBJS): TOOLSET := $(TOOLSET)") + self.WriteLn("$(OBJS): GYP_CFLAGS := " + "$(DEFS_$(BUILDTYPE)) " + "$(INCS_$(BUILDTYPE)) " + "%s " % precompiled_header.GetInclude('c') + + "$(CFLAGS_$(BUILDTYPE)) " + "$(CFLAGS_C_$(BUILDTYPE))") + self.WriteLn("$(OBJS): GYP_CXXFLAGS := " + "$(DEFS_$(BUILDTYPE)) " + "$(INCS_$(BUILDTYPE)) " + "%s " % precompiled_header.GetInclude('cc') + + "$(CFLAGS_$(BUILDTYPE)) " + "$(CFLAGS_CC_$(BUILDTYPE))") + if self.flavor == 'mac': + self.WriteLn("$(OBJS): GYP_OBJCFLAGS := " + "$(DEFS_$(BUILDTYPE)) " + "$(INCS_$(BUILDTYPE)) " + "%s " % precompiled_header.GetInclude('m') + + "$(CFLAGS_$(BUILDTYPE)) " + "$(CFLAGS_C_$(BUILDTYPE)) " + "$(CFLAGS_OBJC_$(BUILDTYPE))") + self.WriteLn("$(OBJS): GYP_OBJCXXFLAGS := " + "$(DEFS_$(BUILDTYPE)) " + "$(INCS_$(BUILDTYPE)) " + "%s " % precompiled_header.GetInclude('mm') + + "$(CFLAGS_$(BUILDTYPE)) " + "$(CFLAGS_CC_$(BUILDTYPE)) " + "$(CFLAGS_OBJCC_$(BUILDTYPE))") + + self.WritePchTargets(precompiled_header.GetPchBuildCommands()) + + # If there are any object files in our input file list, link them into our + # output. + extra_link_deps += filter(Linkable, sources) + + self.WriteLn() + + def WritePchTargets(self, pch_commands): + """Writes make rules to compile prefix headers.""" + if not pch_commands: + return + + for gch, lang_flag, lang, input in pch_commands: + extra_flags = { + 'c': '$(CFLAGS_C_$(BUILDTYPE))', + 'cc': '$(CFLAGS_CC_$(BUILDTYPE))', + 'm': '$(CFLAGS_C_$(BUILDTYPE)) $(CFLAGS_OBJC_$(BUILDTYPE))', + 'mm': '$(CFLAGS_CC_$(BUILDTYPE)) $(CFLAGS_OBJCC_$(BUILDTYPE))', + }[lang] + var_name = { + 'c': 'GYP_PCH_CFLAGS', + 'cc': 'GYP_PCH_CXXFLAGS', + 'm': 'GYP_PCH_OBJCFLAGS', + 'mm': 'GYP_PCH_OBJCXXFLAGS', + }[lang] + self.WriteLn("%s: %s := %s " % (gch, var_name, lang_flag) + + "$(DEFS_$(BUILDTYPE)) " + "$(INCS_$(BUILDTYPE)) " + "$(CFLAGS_$(BUILDTYPE)) " + + extra_flags) + + self.WriteLn('%s: %s FORCE_DO_CMD' % (gch, input)) + self.WriteLn('\t@$(call do_cmd,pch_%s,1)' % lang) + self.WriteLn('') + assert ' ' not in gch, ( + "Spaces in gch filenames not supported (%s)" % gch) + self.WriteLn('all_deps += %s' % gch) + self.WriteLn('') + + + def ComputeOutputBasename(self, spec): + """Return the 'output basename' of a gyp spec. + + E.g., the loadable module 'foobar' in directory 'baz' will produce + 'libfoobar.so' + """ + assert not self.is_mac_bundle + + if self.flavor == 'mac' and self.type in ( + 'static_library', 'executable', 'shared_library', 'loadable_module'): + return self.xcode_settings.GetExecutablePath() + + target = spec['target_name'] + target_prefix = '' + target_ext = '' + if self.type == 'static_library': + if target[:3] == 'lib': + target = target[3:] + target_prefix = 'lib' + target_ext = '.a' + elif self.type in ('loadable_module', 'shared_library'): + if target[:3] == 'lib': + target = target[3:] + target_prefix = 'lib' + target_ext = '.so' + elif self.type == 'none': + target = '%s.stamp' % target + elif self.type != 'executable': + print ("ERROR: What output file should be generated?", + "type", self.type, "target", target) + + target_prefix = spec.get('product_prefix', target_prefix) + target = spec.get('product_name', target) + product_ext = spec.get('product_extension') + if product_ext: + target_ext = '.' + product_ext + + return target_prefix + target + target_ext + + + def _InstallImmediately(self): + return self.toolset == 'target' and self.flavor == 'mac' and self.type in ( + 'static_library', 'executable', 'shared_library', 'loadable_module') + + + def ComputeOutput(self, spec): + """Return the 'output' (full output path) of a gyp spec. + + E.g., the loadable module 'foobar' in directory 'baz' will produce + '$(obj)/baz/libfoobar.so' + """ + assert not self.is_mac_bundle + + path = os.path.join('$(obj).' + self.toolset, self.path) + if self.type == 'executable' or self._InstallImmediately(): + path = '$(builddir)' + path = spec.get('product_dir', path) + return os.path.join(path, self.ComputeOutputBasename(spec)) + + + def ComputeMacBundleOutput(self, spec): + """Return the 'output' (full output path) to a bundle output directory.""" + assert self.is_mac_bundle + path = generator_default_variables['PRODUCT_DIR'] + return os.path.join(path, self.xcode_settings.GetWrapperName()) + + + def ComputeMacBundleBinaryOutput(self, spec): + """Return the 'output' (full output path) to the binary in a bundle.""" + path = generator_default_variables['PRODUCT_DIR'] + return os.path.join(path, self.xcode_settings.GetExecutablePath()) + + + def ComputeDeps(self, spec): + """Compute the dependencies of a gyp spec. + + Returns a tuple (deps, link_deps), where each is a list of + filenames that will need to be put in front of make for either + building (deps) or linking (link_deps). + """ + deps = [] + link_deps = [] + if 'dependencies' in spec: + deps.extend([target_outputs[dep] for dep in spec['dependencies'] + if target_outputs[dep]]) + for dep in spec['dependencies']: + if dep in target_link_deps: + link_deps.append(target_link_deps[dep]) + deps.extend(link_deps) + # TODO: It seems we need to transitively link in libraries (e.g. -lfoo)? + # This hack makes it work: + # link_deps.extend(spec.get('libraries', [])) + return (gyp.common.uniquer(deps), gyp.common.uniquer(link_deps)) + + + def WriteDependencyOnExtraOutputs(self, target, extra_outputs): + self.WriteMakeRule([self.output_binary], extra_outputs, + comment = 'Build our special outputs first.', + order_only = True) + + + def WriteTarget(self, spec, configs, deps, link_deps, bundle_deps, + extra_outputs, part_of_all): + """Write Makefile code to produce the final target of the gyp spec. + + spec, configs: input from gyp. + deps, link_deps: dependency lists; see ComputeDeps() + extra_outputs: any extra outputs that our target should depend on + part_of_all: flag indicating this target is part of 'all' + """ + + self.WriteLn('### Rules for final target.') + + if extra_outputs: + self.WriteDependencyOnExtraOutputs(self.output_binary, extra_outputs) + self.WriteMakeRule(extra_outputs, deps, + comment=('Preserve order dependency of ' + 'special output on deps.'), + order_only = True) + + target_postbuilds = {} + if self.type != 'none': + for configname in sorted(configs.keys()): + config = configs[configname] + if self.flavor == 'mac': + ldflags = self.xcode_settings.GetLdflags(configname, + generator_default_variables['PRODUCT_DIR'], + lambda p: Sourceify(self.Absolutify(p))) + + # TARGET_POSTBUILDS_$(BUILDTYPE) is added to postbuilds later on. + gyp_to_build = gyp.common.InvertRelativePath(self.path) + target_postbuild = self.xcode_settings.AddImplicitPostbuilds( + configname, + QuoteSpaces(os.path.normpath(os.path.join(gyp_to_build, + self.output))), + QuoteSpaces(os.path.normpath(os.path.join(gyp_to_build, + self.output_binary)))) + if target_postbuild: + target_postbuilds[configname] = target_postbuild + else: + ldflags = config.get('ldflags', []) + # Compute an rpath for this output if needed. + if any(dep.endswith('.so') or '.so.' in dep for dep in deps): + # We want to get the literal string "$ORIGIN" into the link command, + # so we need lots of escaping. + ldflags.append(r'-Wl,-rpath=\$$ORIGIN/lib.%s/' % self.toolset) + ldflags.append(r'-Wl,-rpath-link=\$(builddir)/lib.%s/' % + self.toolset) + library_dirs = config.get('library_dirs', []) + ldflags += [('-L%s' % library_dir) for library_dir in library_dirs] + self.WriteList(ldflags, 'LDFLAGS_%s' % configname) + if self.flavor == 'mac': + self.WriteList(self.xcode_settings.GetLibtoolflags(configname), + 'LIBTOOLFLAGS_%s' % configname) + libraries = spec.get('libraries') + if libraries: + # Remove duplicate entries + libraries = gyp.common.uniquer(libraries) + if self.flavor == 'mac': + libraries = self.xcode_settings.AdjustLibraries(libraries) + self.WriteList(libraries, 'LIBS') + self.WriteLn('%s: GYP_LDFLAGS := $(LDFLAGS_$(BUILDTYPE))' % + QuoteSpaces(self.output_binary)) + self.WriteLn('%s: LIBS := $(LIBS)' % QuoteSpaces(self.output_binary)) + + if self.flavor == 'mac': + self.WriteLn('%s: GYP_LIBTOOLFLAGS := $(LIBTOOLFLAGS_$(BUILDTYPE))' % + QuoteSpaces(self.output_binary)) + + # Postbuild actions. Like actions, but implicitly depend on the target's + # output. + postbuilds = [] + if self.flavor == 'mac': + if target_postbuilds: + postbuilds.append('$(TARGET_POSTBUILDS_$(BUILDTYPE))') + postbuilds.extend( + gyp.xcode_emulation.GetSpecPostbuildCommands(spec)) + + if postbuilds: + # Envvars may be referenced by TARGET_POSTBUILDS_$(BUILDTYPE), + # so we must output its definition first, since we declare variables + # using ":=". + self.WriteSortedXcodeEnv(self.output, self.GetSortedXcodePostbuildEnv()) + + for configname in target_postbuilds: + self.WriteLn('%s: TARGET_POSTBUILDS_%s := %s' % + (QuoteSpaces(self.output), + configname, + gyp.common.EncodePOSIXShellList(target_postbuilds[configname]))) + + # Postbuilds expect to be run in the gyp file's directory, so insert an + # implicit postbuild to cd to there. + postbuilds.insert(0, gyp.common.EncodePOSIXShellList(['cd', self.path])) + for i in xrange(len(postbuilds)): + if not postbuilds[i].startswith('$'): + postbuilds[i] = EscapeShellArgument(postbuilds[i]) + self.WriteLn('%s: builddir := $(abs_builddir)' % QuoteSpaces(self.output)) + self.WriteLn('%s: POSTBUILDS := %s' % ( + QuoteSpaces(self.output), ' '.join(postbuilds))) + + # A bundle directory depends on its dependencies such as bundle resources + # and bundle binary. When all dependencies have been built, the bundle + # needs to be packaged. + if self.is_mac_bundle: + # If the framework doesn't contain a binary, then nothing depends + # on the actions -- make the framework depend on them directly too. + self.WriteDependencyOnExtraOutputs(self.output, extra_outputs) + + # Bundle dependencies. Note that the code below adds actions to this + # target, so if you move these two lines, move the lines below as well. + self.WriteList(map(QuoteSpaces, bundle_deps), 'BUNDLE_DEPS') + self.WriteLn('%s: $(BUNDLE_DEPS)' % QuoteSpaces(self.output)) + + # After the framework is built, package it. Needs to happen before + # postbuilds, since postbuilds depend on this. + if self.type in ('shared_library', 'loadable_module'): + self.WriteLn('\t@$(call do_cmd,mac_package_framework,,,%s)' % + self.xcode_settings.GetFrameworkVersion()) + + # Bundle postbuilds can depend on the whole bundle, so run them after + # the bundle is packaged, not already after the bundle binary is done. + if postbuilds: + self.WriteLn('\t@$(call do_postbuilds)') + postbuilds = [] # Don't write postbuilds for target's output. + + # Needed by test/mac/gyptest-rebuild.py. + self.WriteLn('\t@true # No-op, used by tests') + + # Since this target depends on binary and resources which are in + # nested subfolders, the framework directory will be older than + # its dependencies usually. To prevent this rule from executing + # on every build (expensive, especially with postbuilds), expliclity + # update the time on the framework directory. + self.WriteLn('\t@touch -c %s' % QuoteSpaces(self.output)) + + if postbuilds: + assert not self.is_mac_bundle, ('Postbuilds for bundles should be done ' + 'on the bundle, not the binary (target \'%s\')' % self.target) + assert 'product_dir' not in spec, ('Postbuilds do not work with ' + 'custom product_dir') + + if self.type == 'executable': + self.WriteLn('%s: LD_INPUTS := %s' % ( + QuoteSpaces(self.output_binary), + ' '.join(map(QuoteSpaces, link_deps)))) + if self.toolset == 'host' and self.flavor == 'android': + self.WriteDoCmd([self.output_binary], link_deps, 'link_host', + part_of_all, postbuilds=postbuilds) + else: + self.WriteDoCmd([self.output_binary], link_deps, 'link', part_of_all, + postbuilds=postbuilds) + + elif self.type == 'static_library': + for link_dep in link_deps: + assert ' ' not in link_dep, ( + "Spaces in alink input filenames not supported (%s)" % link_dep) + if (self.flavor not in ('mac', 'openbsd', 'netbsd', 'win') and not + self.is_standalone_static_library): + self.WriteDoCmd([self.output_binary], link_deps, 'alink_thin', + part_of_all, postbuilds=postbuilds) + else: + self.WriteDoCmd([self.output_binary], link_deps, 'alink', part_of_all, + postbuilds=postbuilds) + elif self.type == 'shared_library': + self.WriteLn('%s: LD_INPUTS := %s' % ( + QuoteSpaces(self.output_binary), + ' '.join(map(QuoteSpaces, link_deps)))) + self.WriteDoCmd([self.output_binary], link_deps, 'solink', part_of_all, + postbuilds=postbuilds) + elif self.type == 'loadable_module': + for link_dep in link_deps: + assert ' ' not in link_dep, ( + "Spaces in module input filenames not supported (%s)" % link_dep) + if self.toolset == 'host' and self.flavor == 'android': + self.WriteDoCmd([self.output_binary], link_deps, 'solink_module_host', + part_of_all, postbuilds=postbuilds) + else: + self.WriteDoCmd( + [self.output_binary], link_deps, 'solink_module', part_of_all, + postbuilds=postbuilds) + elif self.type == 'none': + # Write a stamp line. + self.WriteDoCmd([self.output_binary], deps, 'touch', part_of_all, + postbuilds=postbuilds) + else: + print "WARNING: no output for", self.type, target + + # Add an alias for each target (if there are any outputs). + # Installable target aliases are created below. + if ((self.output and self.output != self.target) and + (self.type not in self._INSTALLABLE_TARGETS)): + self.WriteMakeRule([self.target], [self.output], + comment='Add target alias', phony = True) + if part_of_all: + self.WriteMakeRule(['all'], [self.target], + comment = 'Add target alias to "all" target.', + phony = True) + + # Add special-case rules for our installable targets. + # 1) They need to install to the build dir or "product" dir. + # 2) They get shortcuts for building (e.g. "make chrome"). + # 3) They are part of "make all". + if (self.type in self._INSTALLABLE_TARGETS or + self.is_standalone_static_library): + if self.type == 'shared_library': + file_desc = 'shared library' + elif self.type == 'static_library': + file_desc = 'static library' + else: + file_desc = 'executable' + install_path = self._InstallableTargetInstallPath() + installable_deps = [self.output] + if (self.flavor == 'mac' and not 'product_dir' in spec and + self.toolset == 'target'): + # On mac, products are created in install_path immediately. + assert install_path == self.output, '%s != %s' % ( + install_path, self.output) + + # Point the target alias to the final binary output. + self.WriteMakeRule([self.target], [install_path], + comment='Add target alias', phony = True) + if install_path != self.output: + assert not self.is_mac_bundle # See comment a few lines above. + self.WriteDoCmd([install_path], [self.output], 'copy', + comment = 'Copy this to the %s output path.' % + file_desc, part_of_all=part_of_all) + installable_deps.append(install_path) + if self.output != self.alias and self.alias != self.target: + self.WriteMakeRule([self.alias], installable_deps, + comment = 'Short alias for building this %s.' % + file_desc, phony = True) + if part_of_all: + self.WriteMakeRule(['all'], [install_path], + comment = 'Add %s to "all" target.' % file_desc, + phony = True) + + + def WriteList(self, value_list, variable=None, prefix='', + quoter=QuoteIfNecessary): + """Write a variable definition that is a list of values. + + E.g. WriteList(['a','b'], 'foo', prefix='blah') writes out + foo = blaha blahb + but in a pretty-printed style. + """ + values = '' + if value_list: + value_list = [quoter(prefix + l) for l in value_list] + values = ' \\\n\t' + ' \\\n\t'.join(value_list) + self.fp.write('%s :=%s\n\n' % (variable, values)) + + + def WriteDoCmd(self, outputs, inputs, command, part_of_all, comment=None, + postbuilds=False): + """Write a Makefile rule that uses do_cmd. + + This makes the outputs dependent on the command line that was run, + as well as support the V= make command line flag. + """ + suffix = '' + if postbuilds: + assert ',' not in command + suffix = ',,1' # Tell do_cmd to honor $POSTBUILDS + self.WriteMakeRule(outputs, inputs, + actions = ['$(call do_cmd,%s%s)' % (command, suffix)], + comment = comment, + command = command, + force = True) + # Add our outputs to the list of targets we read depfiles from. + # all_deps is only used for deps file reading, and for deps files we replace + # spaces with ? because escaping doesn't work with make's $(sort) and + # other functions. + outputs = [QuoteSpaces(o, SPACE_REPLACEMENT) for o in outputs] + self.WriteLn('all_deps += %s' % ' '.join(outputs)) + + + def WriteMakeRule(self, outputs, inputs, actions=None, comment=None, + order_only=False, force=False, phony=False, command=None): + """Write a Makefile rule, with some extra tricks. + + outputs: a list of outputs for the rule (note: this is not directly + supported by make; see comments below) + inputs: a list of inputs for the rule + actions: a list of shell commands to run for the rule + comment: a comment to put in the Makefile above the rule (also useful + for making this Python script's code self-documenting) + order_only: if true, makes the dependency order-only + force: if true, include FORCE_DO_CMD as an order-only dep + phony: if true, the rule does not actually generate the named output, the + output is just a name to run the rule + command: (optional) command name to generate unambiguous labels + """ + outputs = map(QuoteSpaces, outputs) + inputs = map(QuoteSpaces, inputs) + + if comment: + self.WriteLn('# ' + comment) + if phony: + self.WriteLn('.PHONY: ' + ' '.join(outputs)) + if actions: + self.WriteLn("%s: TOOLSET := $(TOOLSET)" % outputs[0]) + force_append = ' FORCE_DO_CMD' if force else '' + + if order_only: + # Order only rule: Just write a simple rule. + # TODO(evanm): just make order_only a list of deps instead of this hack. + self.WriteLn('%s: | %s%s' % + (' '.join(outputs), ' '.join(inputs), force_append)) + elif len(outputs) == 1: + # Regular rule, one output: Just write a simple rule. + self.WriteLn('%s: %s%s' % (outputs[0], ' '.join(inputs), force_append)) + else: + # Regular rule, more than one output: Multiple outputs are tricky in + # make. We will write three rules: + # - All outputs depend on an intermediate file. + # - Make .INTERMEDIATE depend on the intermediate. + # - The intermediate file depends on the inputs and executes the + # actual command. + # - The intermediate recipe will 'touch' the intermediate file. + # - The multi-output rule will have an do-nothing recipe. + intermediate = "%s.intermediate" % (command if command else self.target) + self.WriteLn('%s: %s' % (' '.join(outputs), intermediate)) + self.WriteLn('\t%s' % '@:'); + self.WriteLn('%s: %s' % ('.INTERMEDIATE', intermediate)) + self.WriteLn('%s: %s%s' % + (intermediate, ' '.join(inputs), force_append)) + actions.insert(0, '$(call do_cmd,touch)') + + if actions: + for action in actions: + self.WriteLn('\t%s' % action) + self.WriteLn() + + + def WriteAndroidNdkModuleRule(self, module_name, all_sources, link_deps): + """Write a set of LOCAL_XXX definitions for Android NDK. + + These variable definitions will be used by Android NDK but do nothing for + non-Android applications. + + Arguments: + module_name: Android NDK module name, which must be unique among all + module names. + all_sources: A list of source files (will be filtered by Compilable). + link_deps: A list of link dependencies, which must be sorted in + the order from dependencies to dependents. + """ + if self.type not in ('executable', 'shared_library', 'static_library'): + return + + self.WriteLn('# Variable definitions for Android applications') + self.WriteLn('include $(CLEAR_VARS)') + self.WriteLn('LOCAL_MODULE := ' + module_name) + self.WriteLn('LOCAL_CFLAGS := $(CFLAGS_$(BUILDTYPE)) ' + '$(DEFS_$(BUILDTYPE)) ' + # LOCAL_CFLAGS is applied to both of C and C++. There is + # no way to specify $(CFLAGS_C_$(BUILDTYPE)) only for C + # sources. + '$(CFLAGS_C_$(BUILDTYPE)) ' + # $(INCS_$(BUILDTYPE)) includes the prefix '-I' while + # LOCAL_C_INCLUDES does not expect it. So put it in + # LOCAL_CFLAGS. + '$(INCS_$(BUILDTYPE))') + # LOCAL_CXXFLAGS is obsolete and LOCAL_CPPFLAGS is preferred. + self.WriteLn('LOCAL_CPPFLAGS := $(CFLAGS_CC_$(BUILDTYPE))') + self.WriteLn('LOCAL_C_INCLUDES :=') + self.WriteLn('LOCAL_LDLIBS := $(LDFLAGS_$(BUILDTYPE)) $(LIBS)') + + # Detect the C++ extension. + cpp_ext = {'.cc': 0, '.cpp': 0, '.cxx': 0} + default_cpp_ext = '.cpp' + for filename in all_sources: + ext = os.path.splitext(filename)[1] + if ext in cpp_ext: + cpp_ext[ext] += 1 + if cpp_ext[ext] > cpp_ext[default_cpp_ext]: + default_cpp_ext = ext + self.WriteLn('LOCAL_CPP_EXTENSION := ' + default_cpp_ext) + + self.WriteList(map(self.Absolutify, filter(Compilable, all_sources)), + 'LOCAL_SRC_FILES') + + # Filter out those which do not match prefix and suffix and produce + # the resulting list without prefix and suffix. + def DepsToModules(deps, prefix, suffix): + modules = [] + for filepath in deps: + filename = os.path.basename(filepath) + if filename.startswith(prefix) and filename.endswith(suffix): + modules.append(filename[len(prefix):-len(suffix)]) + return modules + + # Retrieve the default value of 'SHARED_LIB_SUFFIX' + params = {'flavor': 'linux'} + default_variables = {} + CalculateVariables(default_variables, params) + + self.WriteList( + DepsToModules(link_deps, + generator_default_variables['SHARED_LIB_PREFIX'], + default_variables['SHARED_LIB_SUFFIX']), + 'LOCAL_SHARED_LIBRARIES') + self.WriteList( + DepsToModules(link_deps, + generator_default_variables['STATIC_LIB_PREFIX'], + generator_default_variables['STATIC_LIB_SUFFIX']), + 'LOCAL_STATIC_LIBRARIES') + + if self.type == 'executable': + self.WriteLn('include $(BUILD_EXECUTABLE)') + elif self.type == 'shared_library': + self.WriteLn('include $(BUILD_SHARED_LIBRARY)') + elif self.type == 'static_library': + self.WriteLn('include $(BUILD_STATIC_LIBRARY)') + self.WriteLn() + + + def WriteLn(self, text=''): + self.fp.write(text + '\n') + + + def GetSortedXcodeEnv(self, additional_settings=None): + return gyp.xcode_emulation.GetSortedXcodeEnv( + self.xcode_settings, "$(abs_builddir)", + os.path.join("$(abs_srcdir)", self.path), "$(BUILDTYPE)", + additional_settings) + + + def GetSortedXcodePostbuildEnv(self): + # CHROMIUM_STRIP_SAVE_FILE is a chromium-specific hack. + # TODO(thakis): It would be nice to have some general mechanism instead. + strip_save_file = self.xcode_settings.GetPerTargetSetting( + 'CHROMIUM_STRIP_SAVE_FILE', '') + # Even if strip_save_file is empty, explicitly write it. Else a postbuild + # might pick up an export from an earlier target. + return self.GetSortedXcodeEnv( + additional_settings={'CHROMIUM_STRIP_SAVE_FILE': strip_save_file}) + + + def WriteSortedXcodeEnv(self, target, env): + for k, v in env: + # For + # foo := a\ b + # the escaped space does the right thing. For + # export foo := a\ b + # it does not -- the backslash is written to the env as literal character. + # So don't escape spaces in |env[k]|. + self.WriteLn('%s: export %s := %s' % (QuoteSpaces(target), k, v)) + + + def Objectify(self, path): + """Convert a path to its output directory form.""" + if '$(' in path: + path = path.replace('$(obj)/', '$(obj).%s/$(TARGET)/' % self.toolset) + if not '$(obj)' in path: + path = '$(obj).%s/$(TARGET)/%s' % (self.toolset, path) + return path + + + def Pchify(self, path, lang): + """Convert a prefix header path to its output directory form.""" + path = self.Absolutify(path) + if '$(' in path: + path = path.replace('$(obj)/', '$(obj).%s/$(TARGET)/pch-%s' % + (self.toolset, lang)) + return path + return '$(obj).%s/$(TARGET)/pch-%s/%s' % (self.toolset, lang, path) + + + def Absolutify(self, path): + """Convert a subdirectory-relative path into a base-relative path. + Skips over paths that contain variables.""" + if '$(' in path: + # Don't call normpath in this case, as it might collapse the + # path too aggressively if it features '..'. However it's still + # important to strip trailing slashes. + return path.rstrip('/') + return os.path.normpath(os.path.join(self.path, path)) + + + def ExpandInputRoot(self, template, expansion, dirname): + if '%(INPUT_ROOT)s' not in template and '%(INPUT_DIRNAME)s' not in template: + return template + path = template % { + 'INPUT_ROOT': expansion, + 'INPUT_DIRNAME': dirname, + } + return path + + + def _InstallableTargetInstallPath(self): + """Returns the location of the final output for an installable target.""" + # Xcode puts shared_library results into PRODUCT_DIR, and some gyp files + # rely on this. Emulate this behavior for mac. + + # XXX(TooTallNate): disabling this code since we don't want this behavior... + #if (self.type == 'shared_library' and + # (self.flavor != 'mac' or self.toolset != 'target')): + # # Install all shared libs into a common directory (per toolset) for + # # convenient access with LD_LIBRARY_PATH. + # return '$(builddir)/lib.%s/%s' % (self.toolset, self.alias) + return '$(builddir)/' + self.alias + + +def WriteAutoRegenerationRule(params, root_makefile, makefile_name, + build_files): + """Write the target to regenerate the Makefile.""" + options = params['options'] + build_files_args = [gyp.common.RelativePath(filename, options.toplevel_dir) + for filename in params['build_files_arg']] + + gyp_binary = gyp.common.FixIfRelativePath(params['gyp_binary'], + options.toplevel_dir) + if not gyp_binary.startswith(os.sep): + gyp_binary = os.path.join('.', gyp_binary) + + root_makefile.write( + "quiet_cmd_regen_makefile = ACTION Regenerating $@\n" + "cmd_regen_makefile = cd $(srcdir); %(cmd)s\n" + "%(makefile_name)s: %(deps)s\n" + "\t$(call do_cmd,regen_makefile)\n\n" % { + 'makefile_name': makefile_name, + 'deps': ' '.join(map(Sourceify, build_files)), + 'cmd': gyp.common.EncodePOSIXShellList( + [gyp_binary, '-fmake'] + + gyp.RegenerateFlags(options) + + build_files_args)}) + + +def PerformBuild(data, configurations, params): + options = params['options'] + for config in configurations: + arguments = ['make'] + if options.toplevel_dir and options.toplevel_dir != '.': + arguments += '-C', options.toplevel_dir + arguments.append('BUILDTYPE=' + config) + print 'Building [%s]: %s' % (config, arguments) + subprocess.check_call(arguments) + + +def GenerateOutput(target_list, target_dicts, data, params): + options = params['options'] + flavor = gyp.common.GetFlavor(params) + generator_flags = params.get('generator_flags', {}) + builddir_name = generator_flags.get('output_dir', 'out') + android_ndk_version = generator_flags.get('android_ndk_version', None) + default_target = generator_flags.get('default_target', 'all') + + def CalculateMakefilePath(build_file, base_name): + """Determine where to write a Makefile for a given gyp file.""" + # Paths in gyp files are relative to the .gyp file, but we want + # paths relative to the source root for the master makefile. Grab + # the path of the .gyp file as the base to relativize against. + # E.g. "foo/bar" when we're constructing targets for "foo/bar/baz.gyp". + base_path = gyp.common.RelativePath(os.path.dirname(build_file), + options.depth) + # We write the file in the base_path directory. + output_file = os.path.join(options.depth, base_path, base_name) + if options.generator_output: + output_file = os.path.join( + options.depth, options.generator_output, base_path, base_name) + base_path = gyp.common.RelativePath(os.path.dirname(build_file), + options.toplevel_dir) + return base_path, output_file + + # TODO: search for the first non-'Default' target. This can go + # away when we add verification that all targets have the + # necessary configurations. + default_configuration = None + toolsets = set([target_dicts[target]['toolset'] for target in target_list]) + for target in target_list: + spec = target_dicts[target] + if spec['default_configuration'] != 'Default': + default_configuration = spec['default_configuration'] + break + if not default_configuration: + default_configuration = 'Default' + + srcdir = '.' + makefile_name = 'Makefile' + options.suffix + makefile_path = os.path.join(options.toplevel_dir, makefile_name) + if options.generator_output: + global srcdir_prefix + makefile_path = os.path.join( + options.toplevel_dir, options.generator_output, makefile_name) + srcdir = gyp.common.RelativePath(srcdir, options.generator_output) + srcdir_prefix = '$(srcdir)/' + + flock_command= 'flock' + copy_archive_arguments = '-af' + header_params = { + 'default_target': default_target, + 'builddir': builddir_name, + 'default_configuration': default_configuration, + 'flock': flock_command, + 'flock_index': 1, + 'link_commands': LINK_COMMANDS_LINUX, + 'extra_commands': '', + 'srcdir': srcdir, + 'copy_archive_args': copy_archive_arguments, + } + if flavor == 'mac': + flock_command = './gyp-mac-tool flock' + header_params.update({ + 'flock': flock_command, + 'flock_index': 2, + 'link_commands': LINK_COMMANDS_MAC, + 'extra_commands': SHARED_HEADER_MAC_COMMANDS, + }) + elif flavor == 'android': + header_params.update({ + 'link_commands': LINK_COMMANDS_ANDROID, + }) + elif flavor == 'solaris': + header_params.update({ + 'flock': './gyp-flock-tool flock', + 'flock_index': 2, + }) + elif flavor == 'freebsd': + # Note: OpenBSD has sysutils/flock. lockf seems to be FreeBSD specific. + header_params.update({ + 'flock': 'lockf', + }) + elif flavor == 'openbsd': + copy_archive_arguments = '-pPRf' + header_params.update({ + 'copy_archive_args': copy_archive_arguments, + }) + elif flavor == 'aix': + copy_archive_arguments = '-pPRf' + header_params.update({ + 'copy_archive_args': copy_archive_arguments, + 'link_commands': LINK_COMMANDS_AIX, + 'flock': './gyp-flock-tool flock', + 'flock_index': 2, + }) + + header_params.update({ + 'CC.target': GetEnvironFallback(('CC_target', 'CC'), '$(CC)'), + 'AR.target': GetEnvironFallback(('AR_target', 'AR'), '$(AR)'), + 'CXX.target': GetEnvironFallback(('CXX_target', 'CXX'), '$(CXX)'), + 'LINK.target': GetEnvironFallback(('LINK_target', 'LINK'), '$(LINK)'), + 'CC.host': GetEnvironFallback(('CC_host', 'CC'), 'gcc'), + 'AR.host': GetEnvironFallback(('AR_host', 'AR'), 'ar'), + 'CXX.host': GetEnvironFallback(('CXX_host', 'CXX'), 'g++'), + 'LINK.host': GetEnvironFallback(('LINK_host', 'LINK'), '$(CXX.host)'), + }) + + build_file, _, _ = gyp.common.ParseQualifiedTarget(target_list[0]) + make_global_settings_array = data[build_file].get('make_global_settings', []) + wrappers = {} + for key, value in make_global_settings_array: + if key.endswith('_wrapper'): + wrappers[key[:-len('_wrapper')]] = '$(abspath %s)' % value + make_global_settings = '' + for key, value in make_global_settings_array: + if re.match('.*_wrapper', key): + continue + if value[0] != '$': + value = '$(abspath %s)' % value + wrapper = wrappers.get(key) + if wrapper: + value = '%s %s' % (wrapper, value) + del wrappers[key] + if key in ('CC', 'CC.host', 'CXX', 'CXX.host'): + make_global_settings += ( + 'ifneq (,$(filter $(origin %s), undefined default))\n' % key) + # Let gyp-time envvars win over global settings. + env_key = key.replace('.', '_') # CC.host -> CC_host + if env_key in os.environ: + value = os.environ[env_key] + make_global_settings += ' %s = %s\n' % (key, value) + make_global_settings += 'endif\n' + else: + make_global_settings += '%s ?= %s\n' % (key, value) + # TODO(ukai): define cmd when only wrapper is specified in + # make_global_settings. + + header_params['make_global_settings'] = make_global_settings + + gyp.common.EnsureDirExists(makefile_path) + root_makefile = open(makefile_path, 'w') + root_makefile.write(SHARED_HEADER % header_params) + # Currently any versions have the same effect, but in future the behavior + # could be different. + if android_ndk_version: + root_makefile.write( + '# Define LOCAL_PATH for build of Android applications.\n' + 'LOCAL_PATH := $(call my-dir)\n' + '\n') + for toolset in toolsets: + root_makefile.write('TOOLSET := %s\n' % toolset) + WriteRootHeaderSuffixRules(root_makefile) + + # Put build-time support tools next to the root Makefile. + dest_path = os.path.dirname(makefile_path) + gyp.common.CopyTool(flavor, dest_path) + + # Find the list of targets that derive from the gyp file(s) being built. + needed_targets = set() + for build_file in params['build_files']: + for target in gyp.common.AllTargets(target_list, target_dicts, build_file): + needed_targets.add(target) + + build_files = set() + include_list = set() + for qualified_target in target_list: + build_file, target, toolset = gyp.common.ParseQualifiedTarget( + qualified_target) + + this_make_global_settings = data[build_file].get('make_global_settings', []) + assert make_global_settings_array == this_make_global_settings, ( + "make_global_settings needs to be the same for all targets. %s vs. %s" % + (this_make_global_settings, make_global_settings)) + + build_files.add(gyp.common.RelativePath(build_file, options.toplevel_dir)) + included_files = data[build_file]['included_files'] + for included_file in included_files: + # The included_files entries are relative to the dir of the build file + # that included them, so we have to undo that and then make them relative + # to the root dir. + relative_include_file = gyp.common.RelativePath( + gyp.common.UnrelativePath(included_file, build_file), + options.toplevel_dir) + abs_include_file = os.path.abspath(relative_include_file) + # If the include file is from the ~/.gyp dir, we should use absolute path + # so that relocating the src dir doesn't break the path. + if (params['home_dot_gyp'] and + abs_include_file.startswith(params['home_dot_gyp'])): + build_files.add(abs_include_file) + else: + build_files.add(relative_include_file) + + base_path, output_file = CalculateMakefilePath(build_file, + target + '.' + toolset + options.suffix + '.mk') + + spec = target_dicts[qualified_target] + configs = spec['configurations'] + + if flavor == 'mac': + gyp.xcode_emulation.MergeGlobalXcodeSettingsToSpec(data[build_file], spec) + + writer = MakefileWriter(generator_flags, flavor) + writer.Write(qualified_target, base_path, output_file, spec, configs, + part_of_all=qualified_target in needed_targets) + + # Our root_makefile lives at the source root. Compute the relative path + # from there to the output_file for including. + mkfile_rel_path = gyp.common.RelativePath(output_file, + os.path.dirname(makefile_path)) + include_list.add(mkfile_rel_path) + + # Write out per-gyp (sub-project) Makefiles. + depth_rel_path = gyp.common.RelativePath(options.depth, os.getcwd()) + for build_file in build_files: + # The paths in build_files were relativized above, so undo that before + # testing against the non-relativized items in target_list and before + # calculating the Makefile path. + build_file = os.path.join(depth_rel_path, build_file) + gyp_targets = [target_dicts[target]['target_name'] for target in target_list + if target.startswith(build_file) and + target in needed_targets] + # Only generate Makefiles for gyp files with targets. + if not gyp_targets: + continue + base_path, output_file = CalculateMakefilePath(build_file, + os.path.splitext(os.path.basename(build_file))[0] + '.Makefile') + makefile_rel_path = gyp.common.RelativePath(os.path.dirname(makefile_path), + os.path.dirname(output_file)) + writer.WriteSubMake(output_file, makefile_rel_path, gyp_targets, + builddir_name) + + + # Write out the sorted list of includes. + root_makefile.write('\n') + for include_file in sorted(include_list): + # We wrap each .mk include in an if statement so users can tell make to + # not load a file by setting NO_LOAD. The below make code says, only + # load the .mk file if the .mk filename doesn't start with a token in + # NO_LOAD. + root_makefile.write( + "ifeq ($(strip $(foreach prefix,$(NO_LOAD),\\\n" + " $(findstring $(join ^,$(prefix)),\\\n" + " $(join ^," + include_file + ")))),)\n") + root_makefile.write(" include " + include_file + "\n") + root_makefile.write("endif\n") + root_makefile.write('\n') + + if (not generator_flags.get('standalone') + and generator_flags.get('auto_regeneration', True)): + WriteAutoRegenerationRule(params, root_makefile, makefile_name, build_files) + + root_makefile.write(SHARED_FOOTER) + + root_makefile.close() diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py new file mode 100644 index 00000000..2ecf964c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py @@ -0,0 +1,3459 @@ +# Copyright (c) 2012 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import copy +import ntpath +import os +import posixpath +import re +import subprocess +import sys + +import gyp.common +import gyp.easy_xml as easy_xml +import gyp.generator.ninja as ninja_generator +import gyp.MSVSNew as MSVSNew +import gyp.MSVSProject as MSVSProject +import gyp.MSVSSettings as MSVSSettings +import gyp.MSVSToolFile as MSVSToolFile +import gyp.MSVSUserFile as MSVSUserFile +import gyp.MSVSUtil as MSVSUtil +import gyp.MSVSVersion as MSVSVersion +from gyp.common import GypError +from gyp.common import OrderedSet + +# TODO: Remove once bots are on 2.7, http://crbug.com/241769 +def _import_OrderedDict(): + import collections + try: + return collections.OrderedDict + except AttributeError: + import gyp.ordered_dict + return gyp.ordered_dict.OrderedDict +OrderedDict = _import_OrderedDict() + + +# Regular expression for validating Visual Studio GUIDs. If the GUID +# contains lowercase hex letters, MSVS will be fine. However, +# IncrediBuild BuildConsole will parse the solution file, but then +# silently skip building the target causing hard to track down errors. +# Note that this only happens with the BuildConsole, and does not occur +# if IncrediBuild is executed from inside Visual Studio. This regex +# validates that the string looks like a GUID with all uppercase hex +# letters. +VALID_MSVS_GUID_CHARS = re.compile(r'^[A-F0-9\-]+$') + + +generator_default_variables = { + 'EXECUTABLE_PREFIX': '', + 'EXECUTABLE_SUFFIX': '.exe', + 'STATIC_LIB_PREFIX': '', + 'SHARED_LIB_PREFIX': '', + 'STATIC_LIB_SUFFIX': '.lib', + 'SHARED_LIB_SUFFIX': '.dll', + 'INTERMEDIATE_DIR': '$(IntDir)', + 'SHARED_INTERMEDIATE_DIR': '$(OutDir)obj/global_intermediate', + 'OS': 'win', + 'PRODUCT_DIR': '$(OutDir)', + 'LIB_DIR': '$(OutDir)lib', + 'RULE_INPUT_ROOT': '$(InputName)', + 'RULE_INPUT_DIRNAME': '$(InputDir)', + 'RULE_INPUT_EXT': '$(InputExt)', + 'RULE_INPUT_NAME': '$(InputFileName)', + 'RULE_INPUT_PATH': '$(InputPath)', + 'CONFIGURATION_NAME': '$(ConfigurationName)', +} + + +# The msvs specific sections that hold paths +generator_additional_path_sections = [ + 'msvs_cygwin_dirs', + 'msvs_props', +] + + +generator_additional_non_configuration_keys = [ + 'msvs_cygwin_dirs', + 'msvs_cygwin_shell', + 'msvs_large_pdb', + 'msvs_shard', + 'msvs_external_builder', + 'msvs_external_builder_out_dir', + 'msvs_external_builder_build_cmd', + 'msvs_external_builder_clean_cmd', + 'msvs_external_builder_clcompile_cmd', + 'msvs_enable_winrt', + 'msvs_requires_importlibrary', + 'msvs_enable_winphone', + 'msvs_application_type_revision', + 'msvs_target_platform_version', + 'msvs_target_platform_minversion', +] + + +# List of precompiled header related keys. +precomp_keys = [ + 'msvs_precompiled_header', + 'msvs_precompiled_source', +] + + +cached_username = None + + +cached_domain = None + + +# TODO(gspencer): Switch the os.environ calls to be +# win32api.GetDomainName() and win32api.GetUserName() once the +# python version in depot_tools has been updated to work on Vista +# 64-bit. +def _GetDomainAndUserName(): + if sys.platform not in ('win32', 'cygwin'): + return ('DOMAIN', 'USERNAME') + global cached_username + global cached_domain + if not cached_domain or not cached_username: + domain = os.environ.get('USERDOMAIN') + username = os.environ.get('USERNAME') + if not domain or not username: + call = subprocess.Popen(['net', 'config', 'Workstation'], + stdout=subprocess.PIPE) + config = call.communicate()[0] + username_re = re.compile(r'^User name\s+(\S+)', re.MULTILINE) + username_match = username_re.search(config) + if username_match: + username = username_match.group(1) + domain_re = re.compile(r'^Logon domain\s+(\S+)', re.MULTILINE) + domain_match = domain_re.search(config) + if domain_match: + domain = domain_match.group(1) + cached_domain = domain + cached_username = username + return (cached_domain, cached_username) + +fixpath_prefix = None + + +def _NormalizedSource(source): + """Normalize the path. + + But not if that gets rid of a variable, as this may expand to something + larger than one directory. + + Arguments: + source: The path to be normalize.d + + Returns: + The normalized path. + """ + normalized = os.path.normpath(source) + if source.count('$') == normalized.count('$'): + source = normalized + return source + + +def _FixPath(path): + """Convert paths to a form that will make sense in a vcproj file. + + Arguments: + path: The path to convert, may contain / etc. + Returns: + The path with all slashes made into backslashes. + """ + if fixpath_prefix and path and not os.path.isabs(path) and not path[0] == '$': + path = os.path.join(fixpath_prefix, path) + path = path.replace('/', '\\') + path = _NormalizedSource(path) + if path and path[-1] == '\\': + path = path[:-1] + return path + + +def _FixPaths(paths): + """Fix each of the paths of the list.""" + return [_FixPath(i) for i in paths] + + +def _ConvertSourcesToFilterHierarchy(sources, prefix=None, excluded=None, + list_excluded=True, msvs_version=None): + """Converts a list split source file paths into a vcproj folder hierarchy. + + Arguments: + sources: A list of source file paths split. + prefix: A list of source file path layers meant to apply to each of sources. + excluded: A set of excluded files. + msvs_version: A MSVSVersion object. + + Returns: + A hierarchy of filenames and MSVSProject.Filter objects that matches the + layout of the source tree. + For example: + _ConvertSourcesToFilterHierarchy([['a', 'bob1.c'], ['b', 'bob2.c']], + prefix=['joe']) + --> + [MSVSProject.Filter('a', contents=['joe\\a\\bob1.c']), + MSVSProject.Filter('b', contents=['joe\\b\\bob2.c'])] + """ + if not prefix: prefix = [] + result = [] + excluded_result = [] + folders = OrderedDict() + # Gather files into the final result, excluded, or folders. + for s in sources: + if len(s) == 1: + filename = _NormalizedSource('\\'.join(prefix + s)) + if filename in excluded: + excluded_result.append(filename) + else: + result.append(filename) + elif msvs_version and not msvs_version.UsesVcxproj(): + # For MSVS 2008 and earlier, we need to process all files before walking + # the sub folders. + if not folders.get(s[0]): + folders[s[0]] = [] + folders[s[0]].append(s[1:]) + else: + contents = _ConvertSourcesToFilterHierarchy([s[1:]], prefix + [s[0]], + excluded=excluded, + list_excluded=list_excluded, + msvs_version=msvs_version) + contents = MSVSProject.Filter(s[0], contents=contents) + result.append(contents) + # Add a folder for excluded files. + if excluded_result and list_excluded: + excluded_folder = MSVSProject.Filter('_excluded_files', + contents=excluded_result) + result.append(excluded_folder) + + if msvs_version and msvs_version.UsesVcxproj(): + return result + + # Populate all the folders. + for f in folders: + contents = _ConvertSourcesToFilterHierarchy(folders[f], prefix=prefix + [f], + excluded=excluded, + list_excluded=list_excluded, + msvs_version=msvs_version) + contents = MSVSProject.Filter(f, contents=contents) + result.append(contents) + return result + + +def _ToolAppend(tools, tool_name, setting, value, only_if_unset=False): + if not value: return + _ToolSetOrAppend(tools, tool_name, setting, value, only_if_unset) + + +def _ToolSetOrAppend(tools, tool_name, setting, value, only_if_unset=False): + # TODO(bradnelson): ugly hack, fix this more generally!!! + if 'Directories' in setting or 'Dependencies' in setting: + if type(value) == str: + value = value.replace('/', '\\') + else: + value = [i.replace('/', '\\') for i in value] + if not tools.get(tool_name): + tools[tool_name] = dict() + tool = tools[tool_name] + if tool.get(setting): + if only_if_unset: return + if type(tool[setting]) == list and type(value) == list: + tool[setting] += value + else: + raise TypeError( + 'Appending "%s" to a non-list setting "%s" for tool "%s" is ' + 'not allowed, previous value: %s' % ( + value, setting, tool_name, str(tool[setting]))) + else: + tool[setting] = value + + +def _ConfigPlatform(config_data): + return config_data.get('msvs_configuration_platform', 'Win32') + + +def _ConfigBaseName(config_name, platform_name): + if config_name.endswith('_' + platform_name): + return config_name[0:-len(platform_name) - 1] + else: + return config_name + + +def _ConfigFullName(config_name, config_data): + platform_name = _ConfigPlatform(config_data) + return '%s|%s' % (_ConfigBaseName(config_name, platform_name), platform_name) + + +def _BuildCommandLineForRuleRaw(spec, cmd, cygwin_shell, has_input_path, + quote_cmd, do_setup_env): + + if [x for x in cmd if '$(InputDir)' in x]: + input_dir_preamble = ( + 'set INPUTDIR=$(InputDir)\n' + 'if NOT DEFINED INPUTDIR set INPUTDIR=.\\\n' + 'set INPUTDIR=%INPUTDIR:~0,-1%\n' + ) + else: + input_dir_preamble = '' + + if cygwin_shell: + # Find path to cygwin. + cygwin_dir = _FixPath(spec.get('msvs_cygwin_dirs', ['.'])[0]) + # Prepare command. + direct_cmd = cmd + direct_cmd = [i.replace('$(IntDir)', + '`cygpath -m "${INTDIR}"`') for i in direct_cmd] + direct_cmd = [i.replace('$(OutDir)', + '`cygpath -m "${OUTDIR}"`') for i in direct_cmd] + direct_cmd = [i.replace('$(InputDir)', + '`cygpath -m "${INPUTDIR}"`') for i in direct_cmd] + if has_input_path: + direct_cmd = [i.replace('$(InputPath)', + '`cygpath -m "${INPUTPATH}"`') + for i in direct_cmd] + direct_cmd = ['\\"%s\\"' % i.replace('"', '\\\\\\"') for i in direct_cmd] + # direct_cmd = gyp.common.EncodePOSIXShellList(direct_cmd) + direct_cmd = ' '.join(direct_cmd) + # TODO(quote): regularize quoting path names throughout the module + cmd = '' + if do_setup_env: + cmd += 'call "$(ProjectDir)%(cygwin_dir)s\\setup_env.bat" && ' + cmd += 'set CYGWIN=nontsec&& ' + if direct_cmd.find('NUMBER_OF_PROCESSORS') >= 0: + cmd += 'set /a NUMBER_OF_PROCESSORS_PLUS_1=%%NUMBER_OF_PROCESSORS%%+1&& ' + if direct_cmd.find('INTDIR') >= 0: + cmd += 'set INTDIR=$(IntDir)&& ' + if direct_cmd.find('OUTDIR') >= 0: + cmd += 'set OUTDIR=$(OutDir)&& ' + if has_input_path and direct_cmd.find('INPUTPATH') >= 0: + cmd += 'set INPUTPATH=$(InputPath) && ' + cmd += 'bash -c "%(cmd)s"' + cmd = cmd % {'cygwin_dir': cygwin_dir, + 'cmd': direct_cmd} + return input_dir_preamble + cmd + else: + # Convert cat --> type to mimic unix. + if cmd[0] == 'cat': + command = ['type'] + else: + command = [cmd[0].replace('/', '\\')] + # Add call before command to ensure that commands can be tied together one + # after the other without aborting in Incredibuild, since IB makes a bat + # file out of the raw command string, and some commands (like python) are + # actually batch files themselves. + command.insert(0, 'call') + # Fix the paths + # TODO(quote): This is a really ugly heuristic, and will miss path fixing + # for arguments like "--arg=path" or "/opt:path". + # If the argument starts with a slash or dash, it's probably a command line + # switch + arguments = [i if (i[:1] in "/-") else _FixPath(i) for i in cmd[1:]] + arguments = [i.replace('$(InputDir)', '%INPUTDIR%') for i in arguments] + arguments = [MSVSSettings.FixVCMacroSlashes(i) for i in arguments] + if quote_cmd: + # Support a mode for using cmd directly. + # Convert any paths to native form (first element is used directly). + # TODO(quote): regularize quoting path names throughout the module + arguments = ['"%s"' % i for i in arguments] + # Collapse into a single command. + return input_dir_preamble + ' '.join(command + arguments) + + +def _BuildCommandLineForRule(spec, rule, has_input_path, do_setup_env): + # Currently this weird argument munging is used to duplicate the way a + # python script would need to be run as part of the chrome tree. + # Eventually we should add some sort of rule_default option to set this + # per project. For now the behavior chrome needs is the default. + mcs = rule.get('msvs_cygwin_shell') + if mcs is None: + mcs = int(spec.get('msvs_cygwin_shell', 1)) + elif isinstance(mcs, str): + mcs = int(mcs) + quote_cmd = int(rule.get('msvs_quote_cmd', 1)) + return _BuildCommandLineForRuleRaw(spec, rule['action'], mcs, has_input_path, + quote_cmd, do_setup_env=do_setup_env) + + +def _AddActionStep(actions_dict, inputs, outputs, description, command): + """Merge action into an existing list of actions. + + Care must be taken so that actions which have overlapping inputs either don't + get assigned to the same input, or get collapsed into one. + + Arguments: + actions_dict: dictionary keyed on input name, which maps to a list of + dicts describing the actions attached to that input file. + inputs: list of inputs + outputs: list of outputs + description: description of the action + command: command line to execute + """ + # Require there to be at least one input (call sites will ensure this). + assert inputs + + action = { + 'inputs': inputs, + 'outputs': outputs, + 'description': description, + 'command': command, + } + + # Pick where to stick this action. + # While less than optimal in terms of build time, attach them to the first + # input for now. + chosen_input = inputs[0] + + # Add it there. + if chosen_input not in actions_dict: + actions_dict[chosen_input] = [] + actions_dict[chosen_input].append(action) + + +def _AddCustomBuildToolForMSVS(p, spec, primary_input, + inputs, outputs, description, cmd): + """Add a custom build tool to execute something. + + Arguments: + p: the target project + spec: the target project dict + primary_input: input file to attach the build tool to + inputs: list of inputs + outputs: list of outputs + description: description of the action + cmd: command line to execute + """ + inputs = _FixPaths(inputs) + outputs = _FixPaths(outputs) + tool = MSVSProject.Tool( + 'VCCustomBuildTool', + {'Description': description, + 'AdditionalDependencies': ';'.join(inputs), + 'Outputs': ';'.join(outputs), + 'CommandLine': cmd, + }) + # Add to the properties of primary input for each config. + for config_name, c_data in spec['configurations'].iteritems(): + p.AddFileConfig(_FixPath(primary_input), + _ConfigFullName(config_name, c_data), tools=[tool]) + + +def _AddAccumulatedActionsToMSVS(p, spec, actions_dict): + """Add actions accumulated into an actions_dict, merging as needed. + + Arguments: + p: the target project + spec: the target project dict + actions_dict: dictionary keyed on input name, which maps to a list of + dicts describing the actions attached to that input file. + """ + for primary_input in actions_dict: + inputs = OrderedSet() + outputs = OrderedSet() + descriptions = [] + commands = [] + for action in actions_dict[primary_input]: + inputs.update(OrderedSet(action['inputs'])) + outputs.update(OrderedSet(action['outputs'])) + descriptions.append(action['description']) + commands.append(action['command']) + # Add the custom build step for one input file. + description = ', and also '.join(descriptions) + command = '\r\n'.join(commands) + _AddCustomBuildToolForMSVS(p, spec, + primary_input=primary_input, + inputs=inputs, + outputs=outputs, + description=description, + cmd=command) + + +def _RuleExpandPath(path, input_file): + """Given the input file to which a rule applied, string substitute a path. + + Arguments: + path: a path to string expand + input_file: the file to which the rule applied. + Returns: + The string substituted path. + """ + path = path.replace('$(InputName)', + os.path.splitext(os.path.split(input_file)[1])[0]) + path = path.replace('$(InputDir)', os.path.dirname(input_file)) + path = path.replace('$(InputExt)', + os.path.splitext(os.path.split(input_file)[1])[1]) + path = path.replace('$(InputFileName)', os.path.split(input_file)[1]) + path = path.replace('$(InputPath)', input_file) + return path + + +def _FindRuleTriggerFiles(rule, sources): + """Find the list of files which a particular rule applies to. + + Arguments: + rule: the rule in question + sources: the set of all known source files for this project + Returns: + The list of sources that trigger a particular rule. + """ + return rule.get('rule_sources', []) + + +def _RuleInputsAndOutputs(rule, trigger_file): + """Find the inputs and outputs generated by a rule. + + Arguments: + rule: the rule in question. + trigger_file: the main trigger for this rule. + Returns: + The pair of (inputs, outputs) involved in this rule. + """ + raw_inputs = _FixPaths(rule.get('inputs', [])) + raw_outputs = _FixPaths(rule.get('outputs', [])) + inputs = OrderedSet() + outputs = OrderedSet() + inputs.add(trigger_file) + for i in raw_inputs: + inputs.add(_RuleExpandPath(i, trigger_file)) + for o in raw_outputs: + outputs.add(_RuleExpandPath(o, trigger_file)) + return (inputs, outputs) + + +def _GenerateNativeRulesForMSVS(p, rules, output_dir, spec, options): + """Generate a native rules file. + + Arguments: + p: the target project + rules: the set of rules to include + output_dir: the directory in which the project/gyp resides + spec: the project dict + options: global generator options + """ + rules_filename = '%s%s.rules' % (spec['target_name'], + options.suffix) + rules_file = MSVSToolFile.Writer(os.path.join(output_dir, rules_filename), + spec['target_name']) + # Add each rule. + for r in rules: + rule_name = r['rule_name'] + rule_ext = r['extension'] + inputs = _FixPaths(r.get('inputs', [])) + outputs = _FixPaths(r.get('outputs', [])) + # Skip a rule with no action and no inputs. + if 'action' not in r and not r.get('rule_sources', []): + continue + cmd = _BuildCommandLineForRule(spec, r, has_input_path=True, + do_setup_env=True) + rules_file.AddCustomBuildRule(name=rule_name, + description=r.get('message', rule_name), + extensions=[rule_ext], + additional_dependencies=inputs, + outputs=outputs, + cmd=cmd) + # Write out rules file. + rules_file.WriteIfChanged() + + # Add rules file to project. + p.AddToolFile(rules_filename) + + +def _Cygwinify(path): + path = path.replace('$(OutDir)', '$(OutDirCygwin)') + path = path.replace('$(IntDir)', '$(IntDirCygwin)') + return path + + +def _GenerateExternalRules(rules, output_dir, spec, + sources, options, actions_to_add): + """Generate an external makefile to do a set of rules. + + Arguments: + rules: the list of rules to include + output_dir: path containing project and gyp files + spec: project specification data + sources: set of sources known + options: global generator options + actions_to_add: The list of actions we will add to. + """ + filename = '%s_rules%s.mk' % (spec['target_name'], options.suffix) + mk_file = gyp.common.WriteOnDiff(os.path.join(output_dir, filename)) + # Find cygwin style versions of some paths. + mk_file.write('OutDirCygwin:=$(shell cygpath -u "$(OutDir)")\n') + mk_file.write('IntDirCygwin:=$(shell cygpath -u "$(IntDir)")\n') + # Gather stuff needed to emit all: target. + all_inputs = OrderedSet() + all_outputs = OrderedSet() + all_output_dirs = OrderedSet() + first_outputs = [] + for rule in rules: + trigger_files = _FindRuleTriggerFiles(rule, sources) + for tf in trigger_files: + inputs, outputs = _RuleInputsAndOutputs(rule, tf) + all_inputs.update(OrderedSet(inputs)) + all_outputs.update(OrderedSet(outputs)) + # Only use one target from each rule as the dependency for + # 'all' so we don't try to build each rule multiple times. + first_outputs.append(list(outputs)[0]) + # Get the unique output directories for this rule. + output_dirs = [os.path.split(i)[0] for i in outputs] + for od in output_dirs: + all_output_dirs.add(od) + first_outputs_cyg = [_Cygwinify(i) for i in first_outputs] + # Write out all: target, including mkdir for each output directory. + mk_file.write('all: %s\n' % ' '.join(first_outputs_cyg)) + for od in all_output_dirs: + if od: + mk_file.write('\tmkdir -p `cygpath -u "%s"`\n' % od) + mk_file.write('\n') + # Define how each output is generated. + for rule in rules: + trigger_files = _FindRuleTriggerFiles(rule, sources) + for tf in trigger_files: + # Get all the inputs and outputs for this rule for this trigger file. + inputs, outputs = _RuleInputsAndOutputs(rule, tf) + inputs = [_Cygwinify(i) for i in inputs] + outputs = [_Cygwinify(i) for i in outputs] + # Prepare the command line for this rule. + cmd = [_RuleExpandPath(c, tf) for c in rule['action']] + cmd = ['"%s"' % i for i in cmd] + cmd = ' '.join(cmd) + # Add it to the makefile. + mk_file.write('%s: %s\n' % (' '.join(outputs), ' '.join(inputs))) + mk_file.write('\t%s\n\n' % cmd) + # Close up the file. + mk_file.close() + + # Add makefile to list of sources. + sources.add(filename) + # Add a build action to call makefile. + cmd = ['make', + 'OutDir=$(OutDir)', + 'IntDir=$(IntDir)', + '-j', '${NUMBER_OF_PROCESSORS_PLUS_1}', + '-f', filename] + cmd = _BuildCommandLineForRuleRaw(spec, cmd, True, False, True, True) + # Insert makefile as 0'th input, so it gets the action attached there, + # as this is easier to understand from in the IDE. + all_inputs = list(all_inputs) + all_inputs.insert(0, filename) + _AddActionStep(actions_to_add, + inputs=_FixPaths(all_inputs), + outputs=_FixPaths(all_outputs), + description='Running external rules for %s' % + spec['target_name'], + command=cmd) + + +def _EscapeEnvironmentVariableExpansion(s): + """Escapes % characters. + + Escapes any % characters so that Windows-style environment variable + expansions will leave them alone. + See http://connect.microsoft.com/VisualStudio/feedback/details/106127/cl-d-name-text-containing-percentage-characters-doesnt-compile + to understand why we have to do this. + + Args: + s: The string to be escaped. + + Returns: + The escaped string. + """ + s = s.replace('%', '%%') + return s + + +quote_replacer_regex = re.compile(r'(\\*)"') + + +def _EscapeCommandLineArgumentForMSVS(s): + """Escapes a Windows command-line argument. + + So that the Win32 CommandLineToArgv function will turn the escaped result back + into the original string. + See http://msdn.microsoft.com/en-us/library/17w5ykft.aspx + ("Parsing C++ Command-Line Arguments") to understand why we have to do + this. + + Args: + s: the string to be escaped. + Returns: + the escaped string. + """ + + def _Replace(match): + # For a literal quote, CommandLineToArgv requires an odd number of + # backslashes preceding it, and it produces half as many literal backslashes + # (rounded down). So we need to produce 2n+1 backslashes. + return 2 * match.group(1) + '\\"' + + # Escape all quotes so that they are interpreted literally. + s = quote_replacer_regex.sub(_Replace, s) + # Now add unescaped quotes so that any whitespace is interpreted literally. + s = '"' + s + '"' + return s + + +delimiters_replacer_regex = re.compile(r'(\\*)([,;]+)') + + +def _EscapeVCProjCommandLineArgListItem(s): + """Escapes command line arguments for MSVS. + + The VCProj format stores string lists in a single string using commas and + semi-colons as separators, which must be quoted if they are to be + interpreted literally. However, command-line arguments may already have + quotes, and the VCProj parser is ignorant of the backslash escaping + convention used by CommandLineToArgv, so the command-line quotes and the + VCProj quotes may not be the same quotes. So to store a general + command-line argument in a VCProj list, we need to parse the existing + quoting according to VCProj's convention and quote any delimiters that are + not already quoted by that convention. The quotes that we add will also be + seen by CommandLineToArgv, so if backslashes precede them then we also have + to escape those backslashes according to the CommandLineToArgv + convention. + + Args: + s: the string to be escaped. + Returns: + the escaped string. + """ + + def _Replace(match): + # For a non-literal quote, CommandLineToArgv requires an even number of + # backslashes preceding it, and it produces half as many literal + # backslashes. So we need to produce 2n backslashes. + return 2 * match.group(1) + '"' + match.group(2) + '"' + + segments = s.split('"') + # The unquoted segments are at the even-numbered indices. + for i in range(0, len(segments), 2): + segments[i] = delimiters_replacer_regex.sub(_Replace, segments[i]) + # Concatenate back into a single string + s = '"'.join(segments) + if len(segments) % 2 == 0: + # String ends while still quoted according to VCProj's convention. This + # means the delimiter and the next list item that follow this one in the + # .vcproj file will be misinterpreted as part of this item. There is nothing + # we can do about this. Adding an extra quote would correct the problem in + # the VCProj but cause the same problem on the final command-line. Moving + # the item to the end of the list does works, but that's only possible if + # there's only one such item. Let's just warn the user. + print >> sys.stderr, ('Warning: MSVS may misinterpret the odd number of ' + + 'quotes in ' + s) + return s + + +def _EscapeCppDefineForMSVS(s): + """Escapes a CPP define so that it will reach the compiler unaltered.""" + s = _EscapeEnvironmentVariableExpansion(s) + s = _EscapeCommandLineArgumentForMSVS(s) + s = _EscapeVCProjCommandLineArgListItem(s) + # cl.exe replaces literal # characters with = in preprocesor definitions for + # some reason. Octal-encode to work around that. + s = s.replace('#', '\\%03o' % ord('#')) + return s + + +quote_replacer_regex2 = re.compile(r'(\\+)"') + + +def _EscapeCommandLineArgumentForMSBuild(s): + """Escapes a Windows command-line argument for use by MSBuild.""" + + def _Replace(match): + return (len(match.group(1)) / 2 * 4) * '\\' + '\\"' + + # Escape all quotes so that they are interpreted literally. + s = quote_replacer_regex2.sub(_Replace, s) + return s + + +def _EscapeMSBuildSpecialCharacters(s): + escape_dictionary = { + '%': '%25', + '$': '%24', + '@': '%40', + "'": '%27', + ';': '%3B', + '?': '%3F', + '*': '%2A' + } + result = ''.join([escape_dictionary.get(c, c) for c in s]) + return result + + +def _EscapeCppDefineForMSBuild(s): + """Escapes a CPP define so that it will reach the compiler unaltered.""" + s = _EscapeEnvironmentVariableExpansion(s) + s = _EscapeCommandLineArgumentForMSBuild(s) + s = _EscapeMSBuildSpecialCharacters(s) + # cl.exe replaces literal # characters with = in preprocesor definitions for + # some reason. Octal-encode to work around that. + s = s.replace('#', '\\%03o' % ord('#')) + return s + + +def _GenerateRulesForMSVS(p, output_dir, options, spec, + sources, excluded_sources, + actions_to_add): + """Generate all the rules for a particular project. + + Arguments: + p: the project + output_dir: directory to emit rules to + options: global options passed to the generator + spec: the specification for this project + sources: the set of all known source files in this project + excluded_sources: the set of sources excluded from normal processing + actions_to_add: deferred list of actions to add in + """ + rules = spec.get('rules', []) + rules_native = [r for r in rules if not int(r.get('msvs_external_rule', 0))] + rules_external = [r for r in rules if int(r.get('msvs_external_rule', 0))] + + # Handle rules that use a native rules file. + if rules_native: + _GenerateNativeRulesForMSVS(p, rules_native, output_dir, spec, options) + + # Handle external rules (non-native rules). + if rules_external: + _GenerateExternalRules(rules_external, output_dir, spec, + sources, options, actions_to_add) + _AdjustSourcesForRules(rules, sources, excluded_sources, False) + + +def _AdjustSourcesForRules(rules, sources, excluded_sources, is_msbuild): + # Add outputs generated by each rule (if applicable). + for rule in rules: + # Add in the outputs from this rule. + trigger_files = _FindRuleTriggerFiles(rule, sources) + for trigger_file in trigger_files: + # Remove trigger_file from excluded_sources to let the rule be triggered + # (e.g. rule trigger ax_enums.idl is added to excluded_sources + # because it's also in an action's inputs in the same project) + excluded_sources.discard(_FixPath(trigger_file)) + # Done if not processing outputs as sources. + if int(rule.get('process_outputs_as_sources', False)): + inputs, outputs = _RuleInputsAndOutputs(rule, trigger_file) + inputs = OrderedSet(_FixPaths(inputs)) + outputs = OrderedSet(_FixPaths(outputs)) + inputs.remove(_FixPath(trigger_file)) + sources.update(inputs) + if not is_msbuild: + excluded_sources.update(inputs) + sources.update(outputs) + + +def _FilterActionsFromExcluded(excluded_sources, actions_to_add): + """Take inputs with actions attached out of the list of exclusions. + + Arguments: + excluded_sources: list of source files not to be built. + actions_to_add: dict of actions keyed on source file they're attached to. + Returns: + excluded_sources with files that have actions attached removed. + """ + must_keep = OrderedSet(_FixPaths(actions_to_add.keys())) + return [s for s in excluded_sources if s not in must_keep] + + +def _GetDefaultConfiguration(spec): + return spec['configurations'][spec['default_configuration']] + + +def _GetGuidOfProject(proj_path, spec): + """Get the guid for the project. + + Arguments: + proj_path: Path of the vcproj or vcxproj file to generate. + spec: The target dictionary containing the properties of the target. + Returns: + the guid. + Raises: + ValueError: if the specified GUID is invalid. + """ + # Pluck out the default configuration. + default_config = _GetDefaultConfiguration(spec) + # Decide the guid of the project. + guid = default_config.get('msvs_guid') + if guid: + if VALID_MSVS_GUID_CHARS.match(guid) is None: + raise ValueError('Invalid MSVS guid: "%s". Must match regex: "%s".' % + (guid, VALID_MSVS_GUID_CHARS.pattern)) + guid = '{%s}' % guid + guid = guid or MSVSNew.MakeGuid(proj_path) + return guid + + +def _GetMsbuildToolsetOfProject(proj_path, spec, version): + """Get the platform toolset for the project. + + Arguments: + proj_path: Path of the vcproj or vcxproj file to generate. + spec: The target dictionary containing the properties of the target. + version: The MSVSVersion object. + Returns: + the platform toolset string or None. + """ + # Pluck out the default configuration. + default_config = _GetDefaultConfiguration(spec) + toolset = default_config.get('msbuild_toolset') + if not toolset and version.DefaultToolset(): + toolset = version.DefaultToolset() + return toolset + + +def _GenerateProject(project, options, version, generator_flags): + """Generates a vcproj file. + + Arguments: + project: the MSVSProject object. + options: global generator options. + version: the MSVSVersion object. + generator_flags: dict of generator-specific flags. + Returns: + A list of source files that cannot be found on disk. + """ + default_config = _GetDefaultConfiguration(project.spec) + + # Skip emitting anything if told to with msvs_existing_vcproj option. + if default_config.get('msvs_existing_vcproj'): + return [] + + if version.UsesVcxproj(): + return _GenerateMSBuildProject(project, options, version, generator_flags) + else: + return _GenerateMSVSProject(project, options, version, generator_flags) + + +# TODO: Avoid code duplication with _ValidateSourcesForOSX in make.py. +def _ValidateSourcesForMSVSProject(spec, version): + """Makes sure if duplicate basenames are not specified in the source list. + + Arguments: + spec: The target dictionary containing the properties of the target. + version: The VisualStudioVersion object. + """ + # This validation should not be applied to MSVC2010 and later. + assert not version.UsesVcxproj() + + # TODO: Check if MSVC allows this for loadable_module targets. + if spec.get('type', None) not in ('static_library', 'shared_library'): + return + sources = spec.get('sources', []) + basenames = {} + for source in sources: + name, ext = os.path.splitext(source) + is_compiled_file = ext in [ + '.c', '.cc', '.cpp', '.cxx', '.m', '.mm', '.s', '.S'] + if not is_compiled_file: + continue + basename = os.path.basename(name) # Don't include extension. + basenames.setdefault(basename, []).append(source) + + error = '' + for basename, files in basenames.iteritems(): + if len(files) > 1: + error += ' %s: %s\n' % (basename, ' '.join(files)) + + if error: + print('static library %s has several files with the same basename:\n' % + spec['target_name'] + error + 'MSVC08 cannot handle that.') + raise GypError('Duplicate basenames in sources section, see list above') + + +def _GenerateMSVSProject(project, options, version, generator_flags): + """Generates a .vcproj file. It may create .rules and .user files too. + + Arguments: + project: The project object we will generate the file for. + options: Global options passed to the generator. + version: The VisualStudioVersion object. + generator_flags: dict of generator-specific flags. + """ + spec = project.spec + gyp.common.EnsureDirExists(project.path) + + platforms = _GetUniquePlatforms(spec) + p = MSVSProject.Writer(project.path, version, spec['target_name'], + project.guid, platforms) + + # Get directory project file is in. + project_dir = os.path.split(project.path)[0] + gyp_path = _NormalizedSource(project.build_file) + relative_path_of_gyp_file = gyp.common.RelativePath(gyp_path, project_dir) + + config_type = _GetMSVSConfigurationType(spec, project.build_file) + for config_name, config in spec['configurations'].iteritems(): + _AddConfigurationToMSVSProject(p, spec, config_type, config_name, config) + + # MSVC08 and prior version cannot handle duplicate basenames in the same + # target. + # TODO: Take excluded sources into consideration if possible. + _ValidateSourcesForMSVSProject(spec, version) + + # Prepare list of sources and excluded sources. + gyp_file = os.path.split(project.build_file)[1] + sources, excluded_sources = _PrepareListOfSources(spec, generator_flags, + gyp_file) + + # Add rules. + actions_to_add = {} + _GenerateRulesForMSVS(p, project_dir, options, spec, + sources, excluded_sources, + actions_to_add) + list_excluded = generator_flags.get('msvs_list_excluded_files', True) + sources, excluded_sources, excluded_idl = ( + _AdjustSourcesAndConvertToFilterHierarchy(spec, options, project_dir, + sources, excluded_sources, + list_excluded, version)) + + # Add in files. + missing_sources = _VerifySourcesExist(sources, project_dir) + p.AddFiles(sources) + + _AddToolFilesToMSVS(p, spec) + _HandlePreCompiledHeaders(p, sources, spec) + _AddActions(actions_to_add, spec, relative_path_of_gyp_file) + _AddCopies(actions_to_add, spec) + _WriteMSVSUserFile(project.path, version, spec) + + # NOTE: this stanza must appear after all actions have been decided. + # Don't excluded sources with actions attached, or they won't run. + excluded_sources = _FilterActionsFromExcluded( + excluded_sources, actions_to_add) + _ExcludeFilesFromBeingBuilt(p, spec, excluded_sources, excluded_idl, + list_excluded) + _AddAccumulatedActionsToMSVS(p, spec, actions_to_add) + + # Write it out. + p.WriteIfChanged() + + return missing_sources + + +def _GetUniquePlatforms(spec): + """Returns the list of unique platforms for this spec, e.g ['win32', ...]. + + Arguments: + spec: The target dictionary containing the properties of the target. + Returns: + The MSVSUserFile object created. + """ + # Gather list of unique platforms. + platforms = OrderedSet() + for configuration in spec['configurations']: + platforms.add(_ConfigPlatform(spec['configurations'][configuration])) + platforms = list(platforms) + return platforms + + +def _CreateMSVSUserFile(proj_path, version, spec): + """Generates a .user file for the user running this Gyp program. + + Arguments: + proj_path: The path of the project file being created. The .user file + shares the same path (with an appropriate suffix). + version: The VisualStudioVersion object. + spec: The target dictionary containing the properties of the target. + Returns: + The MSVSUserFile object created. + """ + (domain, username) = _GetDomainAndUserName() + vcuser_filename = '.'.join([proj_path, domain, username, 'user']) + user_file = MSVSUserFile.Writer(vcuser_filename, version, + spec['target_name']) + return user_file + + +def _GetMSVSConfigurationType(spec, build_file): + """Returns the configuration type for this project. + + It's a number defined by Microsoft. May raise an exception. + + Args: + spec: The target dictionary containing the properties of the target. + build_file: The path of the gyp file. + Returns: + An integer, the configuration type. + """ + try: + config_type = { + 'executable': '1', # .exe + 'shared_library': '2', # .dll + 'loadable_module': '2', # .dll + 'static_library': '4', # .lib + 'none': '10', # Utility type + }[spec['type']] + except KeyError: + if spec.get('type'): + raise GypError('Target type %s is not a valid target type for ' + 'target %s in %s.' % + (spec['type'], spec['target_name'], build_file)) + else: + raise GypError('Missing type field for target %s in %s.' % + (spec['target_name'], build_file)) + return config_type + + +def _AddConfigurationToMSVSProject(p, spec, config_type, config_name, config): + """Adds a configuration to the MSVS project. + + Many settings in a vcproj file are specific to a configuration. This + function the main part of the vcproj file that's configuration specific. + + Arguments: + p: The target project being generated. + spec: The target dictionary containing the properties of the target. + config_type: The configuration type, a number as defined by Microsoft. + config_name: The name of the configuration. + config: The dictionary that defines the special processing to be done + for this configuration. + """ + # Get the information for this configuration + include_dirs, midl_include_dirs, resource_include_dirs = \ + _GetIncludeDirs(config) + libraries = _GetLibraries(spec) + library_dirs = _GetLibraryDirs(config) + out_file, vc_tool, _ = _GetOutputFilePathAndTool(spec, msbuild=False) + defines = _GetDefines(config) + defines = [_EscapeCppDefineForMSVS(d) for d in defines] + disabled_warnings = _GetDisabledWarnings(config) + prebuild = config.get('msvs_prebuild') + postbuild = config.get('msvs_postbuild') + def_file = _GetModuleDefinition(spec) + precompiled_header = config.get('msvs_precompiled_header') + + # Prepare the list of tools as a dictionary. + tools = dict() + # Add in user specified msvs_settings. + msvs_settings = config.get('msvs_settings', {}) + MSVSSettings.ValidateMSVSSettings(msvs_settings) + + # Prevent default library inheritance from the environment. + _ToolAppend(tools, 'VCLinkerTool', 'AdditionalDependencies', ['$(NOINHERIT)']) + + for tool in msvs_settings: + settings = config['msvs_settings'][tool] + for setting in settings: + _ToolAppend(tools, tool, setting, settings[setting]) + # Add the information to the appropriate tool + _ToolAppend(tools, 'VCCLCompilerTool', + 'AdditionalIncludeDirectories', include_dirs) + _ToolAppend(tools, 'VCMIDLTool', + 'AdditionalIncludeDirectories', midl_include_dirs) + _ToolAppend(tools, 'VCResourceCompilerTool', + 'AdditionalIncludeDirectories', resource_include_dirs) + # Add in libraries. + _ToolAppend(tools, 'VCLinkerTool', 'AdditionalDependencies', libraries) + _ToolAppend(tools, 'VCLinkerTool', 'AdditionalLibraryDirectories', + library_dirs) + if out_file: + _ToolAppend(tools, vc_tool, 'OutputFile', out_file, only_if_unset=True) + # Add defines. + _ToolAppend(tools, 'VCCLCompilerTool', 'PreprocessorDefinitions', defines) + _ToolAppend(tools, 'VCResourceCompilerTool', 'PreprocessorDefinitions', + defines) + # Change program database directory to prevent collisions. + _ToolAppend(tools, 'VCCLCompilerTool', 'ProgramDataBaseFileName', + '$(IntDir)$(ProjectName)\\vc80.pdb', only_if_unset=True) + # Add disabled warnings. + _ToolAppend(tools, 'VCCLCompilerTool', + 'DisableSpecificWarnings', disabled_warnings) + # Add Pre-build. + _ToolAppend(tools, 'VCPreBuildEventTool', 'CommandLine', prebuild) + # Add Post-build. + _ToolAppend(tools, 'VCPostBuildEventTool', 'CommandLine', postbuild) + # Turn on precompiled headers if appropriate. + if precompiled_header: + precompiled_header = os.path.split(precompiled_header)[1] + _ToolAppend(tools, 'VCCLCompilerTool', 'UsePrecompiledHeader', '2') + _ToolAppend(tools, 'VCCLCompilerTool', + 'PrecompiledHeaderThrough', precompiled_header) + _ToolAppend(tools, 'VCCLCompilerTool', + 'ForcedIncludeFiles', precompiled_header) + # Loadable modules don't generate import libraries; + # tell dependent projects to not expect one. + if spec['type'] == 'loadable_module': + _ToolAppend(tools, 'VCLinkerTool', 'IgnoreImportLibrary', 'true') + # Set the module definition file if any. + if def_file: + _ToolAppend(tools, 'VCLinkerTool', 'ModuleDefinitionFile', def_file) + + _AddConfigurationToMSVS(p, spec, tools, config, config_type, config_name) + + +def _GetIncludeDirs(config): + """Returns the list of directories to be used for #include directives. + + Arguments: + config: The dictionary that defines the special processing to be done + for this configuration. + Returns: + The list of directory paths. + """ + # TODO(bradnelson): include_dirs should really be flexible enough not to + # require this sort of thing. + include_dirs = ( + config.get('include_dirs', []) + + config.get('msvs_system_include_dirs', [])) + midl_include_dirs = ( + config.get('midl_include_dirs', []) + + config.get('msvs_system_include_dirs', [])) + resource_include_dirs = config.get('resource_include_dirs', include_dirs) + include_dirs = _FixPaths(include_dirs) + midl_include_dirs = _FixPaths(midl_include_dirs) + resource_include_dirs = _FixPaths(resource_include_dirs) + return include_dirs, midl_include_dirs, resource_include_dirs + + +def _GetLibraryDirs(config): + """Returns the list of directories to be used for library search paths. + + Arguments: + config: The dictionary that defines the special processing to be done + for this configuration. + Returns: + The list of directory paths. + """ + + library_dirs = config.get('library_dirs', []) + library_dirs = _FixPaths(library_dirs) + return library_dirs + + +def _GetLibraries(spec): + """Returns the list of libraries for this configuration. + + Arguments: + spec: The target dictionary containing the properties of the target. + Returns: + The list of directory paths. + """ + libraries = spec.get('libraries', []) + # Strip out -l, as it is not used on windows (but is needed so we can pass + # in libraries that are assumed to be in the default library path). + # Also remove duplicate entries, leaving only the last duplicate, while + # preserving order. + found = OrderedSet() + unique_libraries_list = [] + for entry in reversed(libraries): + library = re.sub(r'^\-l', '', entry) + if not os.path.splitext(library)[1]: + library += '.lib' + if library not in found: + found.add(library) + unique_libraries_list.append(library) + unique_libraries_list.reverse() + return unique_libraries_list + + +def _GetOutputFilePathAndTool(spec, msbuild): + """Returns the path and tool to use for this target. + + Figures out the path of the file this spec will create and the name of + the VC tool that will create it. + + Arguments: + spec: The target dictionary containing the properties of the target. + Returns: + A triple of (file path, name of the vc tool, name of the msbuild tool) + """ + # Select a name for the output file. + out_file = '' + vc_tool = '' + msbuild_tool = '' + output_file_map = { + 'executable': ('VCLinkerTool', 'Link', '$(OutDir)', '.exe'), + 'shared_library': ('VCLinkerTool', 'Link', '$(OutDir)', '.dll'), + 'loadable_module': ('VCLinkerTool', 'Link', '$(OutDir)', '.dll'), + 'static_library': ('VCLibrarianTool', 'Lib', '$(OutDir)lib\\', '.lib'), + } + output_file_props = output_file_map.get(spec['type']) + if output_file_props and int(spec.get('msvs_auto_output_file', 1)): + vc_tool, msbuild_tool, out_dir, suffix = output_file_props + if spec.get('standalone_static_library', 0): + out_dir = '$(OutDir)' + out_dir = spec.get('product_dir', out_dir) + product_extension = spec.get('product_extension') + if product_extension: + suffix = '.' + product_extension + elif msbuild: + suffix = '$(TargetExt)' + prefix = spec.get('product_prefix', '') + product_name = spec.get('product_name', '$(ProjectName)') + out_file = ntpath.join(out_dir, prefix + product_name + suffix) + return out_file, vc_tool, msbuild_tool + + +def _GetOutputTargetExt(spec): + """Returns the extension for this target, including the dot + + If product_extension is specified, set target_extension to this to avoid + MSB8012, returns None otherwise. Ignores any target_extension settings in + the input files. + + Arguments: + spec: The target dictionary containing the properties of the target. + Returns: + A string with the extension, or None + """ + target_extension = spec.get('product_extension') + if target_extension: + return '.' + target_extension + return None + + +def _GetDefines(config): + """Returns the list of preprocessor definitions for this configuation. + + Arguments: + config: The dictionary that defines the special processing to be done + for this configuration. + Returns: + The list of preprocessor definitions. + """ + defines = [] + for d in config.get('defines', []): + if type(d) == list: + fd = '='.join([str(dpart) for dpart in d]) + else: + fd = str(d) + defines.append(fd) + return defines + + +def _GetDisabledWarnings(config): + return [str(i) for i in config.get('msvs_disabled_warnings', [])] + + +def _GetModuleDefinition(spec): + def_file = '' + if spec['type'] in ['shared_library', 'loadable_module', 'executable']: + def_files = [s for s in spec.get('sources', []) if s.endswith('.def')] + if len(def_files) == 1: + def_file = _FixPath(def_files[0]) + elif def_files: + raise ValueError( + 'Multiple module definition files in one target, target %s lists ' + 'multiple .def files: %s' % ( + spec['target_name'], ' '.join(def_files))) + return def_file + + +def _ConvertToolsToExpectedForm(tools): + """Convert tools to a form expected by Visual Studio. + + Arguments: + tools: A dictionary of settings; the tool name is the key. + Returns: + A list of Tool objects. + """ + tool_list = [] + for tool, settings in tools.iteritems(): + # Collapse settings with lists. + settings_fixed = {} + for setting, value in settings.iteritems(): + if type(value) == list: + if ((tool == 'VCLinkerTool' and + setting == 'AdditionalDependencies') or + setting == 'AdditionalOptions'): + settings_fixed[setting] = ' '.join(value) + else: + settings_fixed[setting] = ';'.join(value) + else: + settings_fixed[setting] = value + # Add in this tool. + tool_list.append(MSVSProject.Tool(tool, settings_fixed)) + return tool_list + + +def _AddConfigurationToMSVS(p, spec, tools, config, config_type, config_name): + """Add to the project file the configuration specified by config. + + Arguments: + p: The target project being generated. + spec: the target project dict. + tools: A dictionary of settings; the tool name is the key. + config: The dictionary that defines the special processing to be done + for this configuration. + config_type: The configuration type, a number as defined by Microsoft. + config_name: The name of the configuration. + """ + attributes = _GetMSVSAttributes(spec, config, config_type) + # Add in this configuration. + tool_list = _ConvertToolsToExpectedForm(tools) + p.AddConfig(_ConfigFullName(config_name, config), + attrs=attributes, tools=tool_list) + + +def _GetMSVSAttributes(spec, config, config_type): + # Prepare configuration attributes. + prepared_attrs = {} + source_attrs = config.get('msvs_configuration_attributes', {}) + for a in source_attrs: + prepared_attrs[a] = source_attrs[a] + # Add props files. + vsprops_dirs = config.get('msvs_props', []) + vsprops_dirs = _FixPaths(vsprops_dirs) + if vsprops_dirs: + prepared_attrs['InheritedPropertySheets'] = ';'.join(vsprops_dirs) + # Set configuration type. + prepared_attrs['ConfigurationType'] = config_type + output_dir = prepared_attrs.get('OutputDirectory', + '$(SolutionDir)$(ConfigurationName)') + prepared_attrs['OutputDirectory'] = _FixPath(output_dir) + '\\' + if 'IntermediateDirectory' not in prepared_attrs: + intermediate = '$(ConfigurationName)\\obj\\$(ProjectName)' + prepared_attrs['IntermediateDirectory'] = _FixPath(intermediate) + '\\' + else: + intermediate = _FixPath(prepared_attrs['IntermediateDirectory']) + '\\' + intermediate = MSVSSettings.FixVCMacroSlashes(intermediate) + prepared_attrs['IntermediateDirectory'] = intermediate + return prepared_attrs + + +def _AddNormalizedSources(sources_set, sources_array): + sources_set.update(_NormalizedSource(s) for s in sources_array) + + +def _PrepareListOfSources(spec, generator_flags, gyp_file): + """Prepare list of sources and excluded sources. + + Besides the sources specified directly in the spec, adds the gyp file so + that a change to it will cause a re-compile. Also adds appropriate sources + for actions and copies. Assumes later stage will un-exclude files which + have custom build steps attached. + + Arguments: + spec: The target dictionary containing the properties of the target. + gyp_file: The name of the gyp file. + Returns: + A pair of (list of sources, list of excluded sources). + The sources will be relative to the gyp file. + """ + sources = OrderedSet() + _AddNormalizedSources(sources, spec.get('sources', [])) + excluded_sources = OrderedSet() + # Add in the gyp file. + if not generator_flags.get('standalone'): + sources.add(gyp_file) + + # Add in 'action' inputs and outputs. + for a in spec.get('actions', []): + inputs = a['inputs'] + inputs = [_NormalizedSource(i) for i in inputs] + # Add all inputs to sources and excluded sources. + inputs = OrderedSet(inputs) + sources.update(inputs) + if not spec.get('msvs_external_builder'): + excluded_sources.update(inputs) + if int(a.get('process_outputs_as_sources', False)): + _AddNormalizedSources(sources, a.get('outputs', [])) + # Add in 'copies' inputs and outputs. + for cpy in spec.get('copies', []): + _AddNormalizedSources(sources, cpy.get('files', [])) + return (sources, excluded_sources) + + +def _AdjustSourcesAndConvertToFilterHierarchy( + spec, options, gyp_dir, sources, excluded_sources, list_excluded, version): + """Adjusts the list of sources and excluded sources. + + Also converts the sets to lists. + + Arguments: + spec: The target dictionary containing the properties of the target. + options: Global generator options. + gyp_dir: The path to the gyp file being processed. + sources: A set of sources to be included for this project. + excluded_sources: A set of sources to be excluded for this project. + version: A MSVSVersion object. + Returns: + A trio of (list of sources, list of excluded sources, + path of excluded IDL file) + """ + # Exclude excluded sources coming into the generator. + excluded_sources.update(OrderedSet(spec.get('sources_excluded', []))) + # Add excluded sources into sources for good measure. + sources.update(excluded_sources) + # Convert to proper windows form. + # NOTE: sources goes from being a set to a list here. + # NOTE: excluded_sources goes from being a set to a list here. + sources = _FixPaths(sources) + # Convert to proper windows form. + excluded_sources = _FixPaths(excluded_sources) + + excluded_idl = _IdlFilesHandledNonNatively(spec, sources) + + precompiled_related = _GetPrecompileRelatedFiles(spec) + # Find the excluded ones, minus the precompiled header related ones. + fully_excluded = [i for i in excluded_sources if i not in precompiled_related] + + # Convert to folders and the right slashes. + sources = [i.split('\\') for i in sources] + sources = _ConvertSourcesToFilterHierarchy(sources, excluded=fully_excluded, + list_excluded=list_excluded, + msvs_version=version) + + # Prune filters with a single child to flatten ugly directory structures + # such as ../../src/modules/module1 etc. + if version.UsesVcxproj(): + while all([isinstance(s, MSVSProject.Filter) for s in sources]) \ + and len(set([s.name for s in sources])) == 1: + assert all([len(s.contents) == 1 for s in sources]) + sources = [s.contents[0] for s in sources] + else: + while len(sources) == 1 and isinstance(sources[0], MSVSProject.Filter): + sources = sources[0].contents + + return sources, excluded_sources, excluded_idl + + +def _IdlFilesHandledNonNatively(spec, sources): + # If any non-native rules use 'idl' as an extension exclude idl files. + # Gather a list here to use later. + using_idl = False + for rule in spec.get('rules', []): + if rule['extension'] == 'idl' and int(rule.get('msvs_external_rule', 0)): + using_idl = True + break + if using_idl: + excluded_idl = [i for i in sources if i.endswith('.idl')] + else: + excluded_idl = [] + return excluded_idl + + +def _GetPrecompileRelatedFiles(spec): + # Gather a list of precompiled header related sources. + precompiled_related = [] + for _, config in spec['configurations'].iteritems(): + for k in precomp_keys: + f = config.get(k) + if f: + precompiled_related.append(_FixPath(f)) + return precompiled_related + + +def _ExcludeFilesFromBeingBuilt(p, spec, excluded_sources, excluded_idl, + list_excluded): + exclusions = _GetExcludedFilesFromBuild(spec, excluded_sources, excluded_idl) + for file_name, excluded_configs in exclusions.iteritems(): + if (not list_excluded and + len(excluded_configs) == len(spec['configurations'])): + # If we're not listing excluded files, then they won't appear in the + # project, so don't try to configure them to be excluded. + pass + else: + for config_name, config in excluded_configs: + p.AddFileConfig(file_name, _ConfigFullName(config_name, config), + {'ExcludedFromBuild': 'true'}) + + +def _GetExcludedFilesFromBuild(spec, excluded_sources, excluded_idl): + exclusions = {} + # Exclude excluded sources from being built. + for f in excluded_sources: + excluded_configs = [] + for config_name, config in spec['configurations'].iteritems(): + precomped = [_FixPath(config.get(i, '')) for i in precomp_keys] + # Don't do this for ones that are precompiled header related. + if f not in precomped: + excluded_configs.append((config_name, config)) + exclusions[f] = excluded_configs + # If any non-native rules use 'idl' as an extension exclude idl files. + # Exclude them now. + for f in excluded_idl: + excluded_configs = [] + for config_name, config in spec['configurations'].iteritems(): + excluded_configs.append((config_name, config)) + exclusions[f] = excluded_configs + return exclusions + + +def _AddToolFilesToMSVS(p, spec): + # Add in tool files (rules). + tool_files = OrderedSet() + for _, config in spec['configurations'].iteritems(): + for f in config.get('msvs_tool_files', []): + tool_files.add(f) + for f in tool_files: + p.AddToolFile(f) + + +def _HandlePreCompiledHeaders(p, sources, spec): + # Pre-compiled header source stubs need a different compiler flag + # (generate precompiled header) and any source file not of the same + # kind (i.e. C vs. C++) as the precompiled header source stub needs + # to have use of precompiled headers disabled. + extensions_excluded_from_precompile = [] + for config_name, config in spec['configurations'].iteritems(): + source = config.get('msvs_precompiled_source') + if source: + source = _FixPath(source) + # UsePrecompiledHeader=1 for if using precompiled headers. + tool = MSVSProject.Tool('VCCLCompilerTool', + {'UsePrecompiledHeader': '1'}) + p.AddFileConfig(source, _ConfigFullName(config_name, config), + {}, tools=[tool]) + basename, extension = os.path.splitext(source) + if extension == '.c': + extensions_excluded_from_precompile = ['.cc', '.cpp', '.cxx'] + else: + extensions_excluded_from_precompile = ['.c'] + def DisableForSourceTree(source_tree): + for source in source_tree: + if isinstance(source, MSVSProject.Filter): + DisableForSourceTree(source.contents) + else: + basename, extension = os.path.splitext(source) + if extension in extensions_excluded_from_precompile: + for config_name, config in spec['configurations'].iteritems(): + tool = MSVSProject.Tool('VCCLCompilerTool', + {'UsePrecompiledHeader': '0', + 'ForcedIncludeFiles': '$(NOINHERIT)'}) + p.AddFileConfig(_FixPath(source), + _ConfigFullName(config_name, config), + {}, tools=[tool]) + # Do nothing if there was no precompiled source. + if extensions_excluded_from_precompile: + DisableForSourceTree(sources) + + +def _AddActions(actions_to_add, spec, relative_path_of_gyp_file): + # Add actions. + actions = spec.get('actions', []) + # Don't setup_env every time. When all the actions are run together in one + # batch file in VS, the PATH will grow too long. + # Membership in this set means that the cygwin environment has been set up, + # and does not need to be set up again. + have_setup_env = set() + for a in actions: + # Attach actions to the gyp file if nothing else is there. + inputs = a.get('inputs') or [relative_path_of_gyp_file] + attached_to = inputs[0] + need_setup_env = attached_to not in have_setup_env + cmd = _BuildCommandLineForRule(spec, a, has_input_path=False, + do_setup_env=need_setup_env) + have_setup_env.add(attached_to) + # Add the action. + _AddActionStep(actions_to_add, + inputs=inputs, + outputs=a.get('outputs', []), + description=a.get('message', a['action_name']), + command=cmd) + + +def _WriteMSVSUserFile(project_path, version, spec): + # Add run_as and test targets. + if 'run_as' in spec: + run_as = spec['run_as'] + action = run_as.get('action', []) + environment = run_as.get('environment', []) + working_directory = run_as.get('working_directory', '.') + elif int(spec.get('test', 0)): + action = ['$(TargetPath)', '--gtest_print_time'] + environment = [] + working_directory = '.' + else: + return # Nothing to add + # Write out the user file. + user_file = _CreateMSVSUserFile(project_path, version, spec) + for config_name, c_data in spec['configurations'].iteritems(): + user_file.AddDebugSettings(_ConfigFullName(config_name, c_data), + action, environment, working_directory) + user_file.WriteIfChanged() + + +def _AddCopies(actions_to_add, spec): + copies = _GetCopies(spec) + for inputs, outputs, cmd, description in copies: + _AddActionStep(actions_to_add, inputs=inputs, outputs=outputs, + description=description, command=cmd) + + +def _GetCopies(spec): + copies = [] + # Add copies. + for cpy in spec.get('copies', []): + for src in cpy.get('files', []): + dst = os.path.join(cpy['destination'], os.path.basename(src)) + # _AddCustomBuildToolForMSVS() will call _FixPath() on the inputs and + # outputs, so do the same for our generated command line. + if src.endswith('/'): + src_bare = src[:-1] + base_dir = posixpath.split(src_bare)[0] + outer_dir = posixpath.split(src_bare)[1] + cmd = 'cd "%s" && xcopy /e /f /y "%s" "%s\\%s\\"' % ( + _FixPath(base_dir), outer_dir, _FixPath(dst), outer_dir) + copies.append(([src], ['dummy_copies', dst], cmd, + 'Copying %s to %s' % (src, dst))) + else: + cmd = 'mkdir "%s" 2>nul & set ERRORLEVEL=0 & copy /Y "%s" "%s"' % ( + _FixPath(cpy['destination']), _FixPath(src), _FixPath(dst)) + copies.append(([src], [dst], cmd, 'Copying %s to %s' % (src, dst))) + return copies + + +def _GetPathDict(root, path): + # |path| will eventually be empty (in the recursive calls) if it was initially + # relative; otherwise it will eventually end up as '\', 'D:\', etc. + if not path or path.endswith(os.sep): + return root + parent, folder = os.path.split(path) + parent_dict = _GetPathDict(root, parent) + if folder not in parent_dict: + parent_dict[folder] = dict() + return parent_dict[folder] + + +def _DictsToFolders(base_path, bucket, flat): + # Convert to folders recursively. + children = [] + for folder, contents in bucket.iteritems(): + if type(contents) == dict: + folder_children = _DictsToFolders(os.path.join(base_path, folder), + contents, flat) + if flat: + children += folder_children + else: + folder_children = MSVSNew.MSVSFolder(os.path.join(base_path, folder), + name='(' + folder + ')', + entries=folder_children) + children.append(folder_children) + else: + children.append(contents) + return children + + +def _CollapseSingles(parent, node): + # Recursively explorer the tree of dicts looking for projects which are + # the sole item in a folder which has the same name as the project. Bring + # such projects up one level. + if (type(node) == dict and + len(node) == 1 and + node.keys()[0] == parent + '.vcproj'): + return node[node.keys()[0]] + if type(node) != dict: + return node + for child in node: + node[child] = _CollapseSingles(child, node[child]) + return node + + +def _GatherSolutionFolders(sln_projects, project_objects, flat): + root = {} + # Convert into a tree of dicts on path. + for p in sln_projects: + gyp_file, target = gyp.common.ParseQualifiedTarget(p)[0:2] + gyp_dir = os.path.dirname(gyp_file) + path_dict = _GetPathDict(root, gyp_dir) + path_dict[target + '.vcproj'] = project_objects[p] + # Walk down from the top until we hit a folder that has more than one entry. + # In practice, this strips the top-level "src/" dir from the hierarchy in + # the solution. + while len(root) == 1 and type(root[root.keys()[0]]) == dict: + root = root[root.keys()[0]] + # Collapse singles. + root = _CollapseSingles('', root) + # Merge buckets until everything is a root entry. + return _DictsToFolders('', root, flat) + + +def _GetPathOfProject(qualified_target, spec, options, msvs_version): + default_config = _GetDefaultConfiguration(spec) + proj_filename = default_config.get('msvs_existing_vcproj') + if not proj_filename: + proj_filename = (spec['target_name'] + options.suffix + + msvs_version.ProjectExtension()) + + build_file = gyp.common.BuildFile(qualified_target) + proj_path = os.path.join(os.path.dirname(build_file), proj_filename) + fix_prefix = None + if options.generator_output: + project_dir_path = os.path.dirname(os.path.abspath(proj_path)) + proj_path = os.path.join(options.generator_output, proj_path) + fix_prefix = gyp.common.RelativePath(project_dir_path, + os.path.dirname(proj_path)) + return proj_path, fix_prefix + + +def _GetPlatformOverridesOfProject(spec): + # Prepare a dict indicating which project configurations are used for which + # solution configurations for this target. + config_platform_overrides = {} + for config_name, c in spec['configurations'].iteritems(): + config_fullname = _ConfigFullName(config_name, c) + platform = c.get('msvs_target_platform', _ConfigPlatform(c)) + fixed_config_fullname = '%s|%s' % ( + _ConfigBaseName(config_name, _ConfigPlatform(c)), platform) + config_platform_overrides[config_fullname] = fixed_config_fullname + return config_platform_overrides + + +def _CreateProjectObjects(target_list, target_dicts, options, msvs_version): + """Create a MSVSProject object for the targets found in target list. + + Arguments: + target_list: the list of targets to generate project objects for. + target_dicts: the dictionary of specifications. + options: global generator options. + msvs_version: the MSVSVersion object. + Returns: + A set of created projects, keyed by target. + """ + global fixpath_prefix + # Generate each project. + projects = {} + for qualified_target in target_list: + spec = target_dicts[qualified_target] + if spec['toolset'] != 'target': + raise GypError( + 'Multiple toolsets not supported in msvs build (target %s)' % + qualified_target) + proj_path, fixpath_prefix = _GetPathOfProject(qualified_target, spec, + options, msvs_version) + guid = _GetGuidOfProject(proj_path, spec) + overrides = _GetPlatformOverridesOfProject(spec) + build_file = gyp.common.BuildFile(qualified_target) + # Create object for this project. + obj = MSVSNew.MSVSProject( + proj_path, + name=spec['target_name'], + guid=guid, + spec=spec, + build_file=build_file, + config_platform_overrides=overrides, + fixpath_prefix=fixpath_prefix) + # Set project toolset if any (MS build only) + if msvs_version.UsesVcxproj(): + obj.set_msbuild_toolset( + _GetMsbuildToolsetOfProject(proj_path, spec, msvs_version)) + projects[qualified_target] = obj + # Set all the dependencies, but not if we are using an external builder like + # ninja + for project in projects.values(): + if not project.spec.get('msvs_external_builder'): + deps = project.spec.get('dependencies', []) + deps = [projects[d] for d in deps] + project.set_dependencies(deps) + return projects + + +def _InitNinjaFlavor(params, target_list, target_dicts): + """Initialize targets for the ninja flavor. + + This sets up the necessary variables in the targets to generate msvs projects + that use ninja as an external builder. The variables in the spec are only set + if they have not been set. This allows individual specs to override the + default values initialized here. + Arguments: + params: Params provided to the generator. + target_list: List of target pairs: 'base/base.gyp:base'. + target_dicts: Dict of target properties keyed on target pair. + """ + for qualified_target in target_list: + spec = target_dicts[qualified_target] + if spec.get('msvs_external_builder'): + # The spec explicitly defined an external builder, so don't change it. + continue + + path_to_ninja = spec.get('msvs_path_to_ninja', 'ninja.exe') + + spec['msvs_external_builder'] = 'ninja' + if not spec.get('msvs_external_builder_out_dir'): + gyp_file, _, _ = gyp.common.ParseQualifiedTarget(qualified_target) + gyp_dir = os.path.dirname(gyp_file) + configuration = '$(Configuration)' + if params.get('target_arch') == 'x64': + configuration += '_x64' + spec['msvs_external_builder_out_dir'] = os.path.join( + gyp.common.RelativePath(params['options'].toplevel_dir, gyp_dir), + ninja_generator.ComputeOutputDir(params), + configuration) + if not spec.get('msvs_external_builder_build_cmd'): + spec['msvs_external_builder_build_cmd'] = [ + path_to_ninja, + '-C', + '$(OutDir)', + '$(ProjectName)', + ] + if not spec.get('msvs_external_builder_clean_cmd'): + spec['msvs_external_builder_clean_cmd'] = [ + path_to_ninja, + '-C', + '$(OutDir)', + '-tclean', + '$(ProjectName)', + ] + + +def CalculateVariables(default_variables, params): + """Generated variables that require params to be known.""" + + generator_flags = params.get('generator_flags', {}) + + # Select project file format version (if unset, default to auto detecting). + msvs_version = MSVSVersion.SelectVisualStudioVersion( + generator_flags.get('msvs_version', 'auto')) + # Stash msvs_version for later (so we don't have to probe the system twice). + params['msvs_version'] = msvs_version + + # Set a variable so conditions can be based on msvs_version. + default_variables['MSVS_VERSION'] = msvs_version.ShortName() + + # To determine processor word size on Windows, in addition to checking + # PROCESSOR_ARCHITECTURE (which reflects the word size of the current + # process), it is also necessary to check PROCESSOR_ARCITEW6432 (which + # contains the actual word size of the system when running thru WOW64). + if (os.environ.get('PROCESSOR_ARCHITECTURE', '').find('64') >= 0 or + os.environ.get('PROCESSOR_ARCHITEW6432', '').find('64') >= 0): + default_variables['MSVS_OS_BITS'] = 64 + else: + default_variables['MSVS_OS_BITS'] = 32 + + if gyp.common.GetFlavor(params) == 'ninja': + default_variables['SHARED_INTERMEDIATE_DIR'] = '$(OutDir)gen' + + +def PerformBuild(data, configurations, params): + options = params['options'] + msvs_version = params['msvs_version'] + devenv = os.path.join(msvs_version.path, 'Common7', 'IDE', 'devenv.com') + + for build_file, build_file_dict in data.iteritems(): + (build_file_root, build_file_ext) = os.path.splitext(build_file) + if build_file_ext != '.gyp': + continue + sln_path = build_file_root + options.suffix + '.sln' + if options.generator_output: + sln_path = os.path.join(options.generator_output, sln_path) + + for config in configurations: + arguments = [devenv, sln_path, '/Build', config] + print 'Building [%s]: %s' % (config, arguments) + rtn = subprocess.check_call(arguments) + + +def GenerateOutput(target_list, target_dicts, data, params): + """Generate .sln and .vcproj files. + + This is the entry point for this generator. + Arguments: + target_list: List of target pairs: 'base/base.gyp:base'. + target_dicts: Dict of target properties keyed on target pair. + data: Dictionary containing per .gyp data. + """ + global fixpath_prefix + + options = params['options'] + + # Get the project file format version back out of where we stashed it in + # GeneratorCalculatedVariables. + msvs_version = params['msvs_version'] + + generator_flags = params.get('generator_flags', {}) + + # Optionally shard targets marked with 'msvs_shard': SHARD_COUNT. + (target_list, target_dicts) = MSVSUtil.ShardTargets(target_list, target_dicts) + + # Optionally use the large PDB workaround for targets marked with + # 'msvs_large_pdb': 1. + (target_list, target_dicts) = MSVSUtil.InsertLargePdbShims( + target_list, target_dicts, generator_default_variables) + + # Optionally configure each spec to use ninja as the external builder. + if params.get('flavor') == 'ninja': + _InitNinjaFlavor(params, target_list, target_dicts) + + # Prepare the set of configurations. + configs = set() + for qualified_target in target_list: + spec = target_dicts[qualified_target] + for config_name, config in spec['configurations'].iteritems(): + configs.add(_ConfigFullName(config_name, config)) + configs = list(configs) + + # Figure out all the projects that will be generated and their guids + project_objects = _CreateProjectObjects(target_list, target_dicts, options, + msvs_version) + + # Generate each project. + missing_sources = [] + for project in project_objects.values(): + fixpath_prefix = project.fixpath_prefix + missing_sources.extend(_GenerateProject(project, options, msvs_version, + generator_flags)) + fixpath_prefix = None + + for build_file in data: + # Validate build_file extension + if not build_file.endswith('.gyp'): + continue + sln_path = os.path.splitext(build_file)[0] + options.suffix + '.sln' + if options.generator_output: + sln_path = os.path.join(options.generator_output, sln_path) + # Get projects in the solution, and their dependents. + sln_projects = gyp.common.BuildFileTargets(target_list, build_file) + sln_projects += gyp.common.DeepDependencyTargets(target_dicts, sln_projects) + # Create folder hierarchy. + root_entries = _GatherSolutionFolders( + sln_projects, project_objects, flat=msvs_version.FlatSolution()) + # Create solution. + sln = MSVSNew.MSVSSolution(sln_path, + entries=root_entries, + variants=configs, + websiteProperties=False, + version=msvs_version) + sln.Write() + + if missing_sources: + error_message = "Missing input files:\n" + \ + '\n'.join(set(missing_sources)) + if generator_flags.get('msvs_error_on_missing_sources', False): + raise GypError(error_message) + else: + print >> sys.stdout, "Warning: " + error_message + + +def _GenerateMSBuildFiltersFile(filters_path, source_files, + rule_dependencies, extension_to_rule_name): + """Generate the filters file. + + This file is used by Visual Studio to organize the presentation of source + files into folders. + + Arguments: + filters_path: The path of the file to be created. + source_files: The hierarchical structure of all the sources. + extension_to_rule_name: A dictionary mapping file extensions to rules. + """ + filter_group = [] + source_group = [] + _AppendFiltersForMSBuild('', source_files, rule_dependencies, + extension_to_rule_name, filter_group, source_group) + if filter_group: + content = ['Project', + {'ToolsVersion': '4.0', + 'xmlns': 'http://schemas.microsoft.com/developer/msbuild/2003' + }, + ['ItemGroup'] + filter_group, + ['ItemGroup'] + source_group + ] + easy_xml.WriteXmlIfChanged(content, filters_path, pretty=True, win32=True) + elif os.path.exists(filters_path): + # We don't need this filter anymore. Delete the old filter file. + os.unlink(filters_path) + + +def _AppendFiltersForMSBuild(parent_filter_name, sources, rule_dependencies, + extension_to_rule_name, + filter_group, source_group): + """Creates the list of filters and sources to be added in the filter file. + + Args: + parent_filter_name: The name of the filter under which the sources are + found. + sources: The hierarchy of filters and sources to process. + extension_to_rule_name: A dictionary mapping file extensions to rules. + filter_group: The list to which filter entries will be appended. + source_group: The list to which source entries will be appeneded. + """ + for source in sources: + if isinstance(source, MSVSProject.Filter): + # We have a sub-filter. Create the name of that sub-filter. + if not parent_filter_name: + filter_name = source.name + else: + filter_name = '%s\\%s' % (parent_filter_name, source.name) + # Add the filter to the group. + filter_group.append( + ['Filter', {'Include': filter_name}, + ['UniqueIdentifier', MSVSNew.MakeGuid(source.name)]]) + # Recurse and add its dependents. + _AppendFiltersForMSBuild(filter_name, source.contents, + rule_dependencies, extension_to_rule_name, + filter_group, source_group) + else: + # It's a source. Create a source entry. + _, element = _MapFileToMsBuildSourceType(source, rule_dependencies, + extension_to_rule_name) + source_entry = [element, {'Include': source}] + # Specify the filter it is part of, if any. + if parent_filter_name: + source_entry.append(['Filter', parent_filter_name]) + source_group.append(source_entry) + + +def _MapFileToMsBuildSourceType(source, rule_dependencies, + extension_to_rule_name): + """Returns the group and element type of the source file. + + Arguments: + source: The source file name. + extension_to_rule_name: A dictionary mapping file extensions to rules. + + Returns: + A pair of (group this file should be part of, the label of element) + """ + _, ext = os.path.splitext(source) + if ext in extension_to_rule_name: + group = 'rule' + element = extension_to_rule_name[ext] + elif ext in ['.cc', '.cpp', '.c', '.cxx']: + group = 'compile' + element = 'ClCompile' + elif ext in ['.h', '.hxx']: + group = 'include' + element = 'ClInclude' + elif ext == '.rc': + group = 'resource' + element = 'ResourceCompile' + elif ext == '.asm': + group = 'masm' + element = 'MASM' + elif ext == '.idl': + group = 'midl' + element = 'Midl' + elif source in rule_dependencies: + group = 'rule_dependency' + element = 'CustomBuild' + else: + group = 'none' + element = 'None' + return (group, element) + + +def _GenerateRulesForMSBuild(output_dir, options, spec, + sources, excluded_sources, + props_files_of_rules, targets_files_of_rules, + actions_to_add, rule_dependencies, + extension_to_rule_name): + # MSBuild rules are implemented using three files: an XML file, a .targets + # file and a .props file. + # See http://blogs.msdn.com/b/vcblog/archive/2010/04/21/quick-help-on-vs2010-custom-build-rule.aspx + # for more details. + rules = spec.get('rules', []) + rules_native = [r for r in rules if not int(r.get('msvs_external_rule', 0))] + rules_external = [r for r in rules if int(r.get('msvs_external_rule', 0))] + + msbuild_rules = [] + for rule in rules_native: + # Skip a rule with no action and no inputs. + if 'action' not in rule and not rule.get('rule_sources', []): + continue + msbuild_rule = MSBuildRule(rule, spec) + msbuild_rules.append(msbuild_rule) + rule_dependencies.update(msbuild_rule.additional_dependencies.split(';')) + extension_to_rule_name[msbuild_rule.extension] = msbuild_rule.rule_name + if msbuild_rules: + base = spec['target_name'] + options.suffix + props_name = base + '.props' + targets_name = base + '.targets' + xml_name = base + '.xml' + + props_files_of_rules.add(props_name) + targets_files_of_rules.add(targets_name) + + props_path = os.path.join(output_dir, props_name) + targets_path = os.path.join(output_dir, targets_name) + xml_path = os.path.join(output_dir, xml_name) + + _GenerateMSBuildRulePropsFile(props_path, msbuild_rules) + _GenerateMSBuildRuleTargetsFile(targets_path, msbuild_rules) + _GenerateMSBuildRuleXmlFile(xml_path, msbuild_rules) + + if rules_external: + _GenerateExternalRules(rules_external, output_dir, spec, + sources, options, actions_to_add) + _AdjustSourcesForRules(rules, sources, excluded_sources, True) + + +class MSBuildRule(object): + """Used to store information used to generate an MSBuild rule. + + Attributes: + rule_name: The rule name, sanitized to use in XML. + target_name: The name of the target. + after_targets: The name of the AfterTargets element. + before_targets: The name of the BeforeTargets element. + depends_on: The name of the DependsOn element. + compute_output: The name of the ComputeOutput element. + dirs_to_make: The name of the DirsToMake element. + inputs: The name of the _inputs element. + tlog: The name of the _tlog element. + extension: The extension this rule applies to. + description: The message displayed when this rule is invoked. + additional_dependencies: A string listing additional dependencies. + outputs: The outputs of this rule. + command: The command used to run the rule. + """ + + def __init__(self, rule, spec): + self.display_name = rule['rule_name'] + # Assure that the rule name is only characters and numbers + self.rule_name = re.sub(r'\W', '_', self.display_name) + # Create the various element names, following the example set by the + # Visual Studio 2008 to 2010 conversion. I don't know if VS2010 + # is sensitive to the exact names. + self.target_name = '_' + self.rule_name + self.after_targets = self.rule_name + 'AfterTargets' + self.before_targets = self.rule_name + 'BeforeTargets' + self.depends_on = self.rule_name + 'DependsOn' + self.compute_output = 'Compute%sOutput' % self.rule_name + self.dirs_to_make = self.rule_name + 'DirsToMake' + self.inputs = self.rule_name + '_inputs' + self.tlog = self.rule_name + '_tlog' + self.extension = rule['extension'] + if not self.extension.startswith('.'): + self.extension = '.' + self.extension + + self.description = MSVSSettings.ConvertVCMacrosToMSBuild( + rule.get('message', self.rule_name)) + old_additional_dependencies = _FixPaths(rule.get('inputs', [])) + self.additional_dependencies = ( + ';'.join([MSVSSettings.ConvertVCMacrosToMSBuild(i) + for i in old_additional_dependencies])) + old_outputs = _FixPaths(rule.get('outputs', [])) + self.outputs = ';'.join([MSVSSettings.ConvertVCMacrosToMSBuild(i) + for i in old_outputs]) + old_command = _BuildCommandLineForRule(spec, rule, has_input_path=True, + do_setup_env=True) + self.command = MSVSSettings.ConvertVCMacrosToMSBuild(old_command) + + +def _GenerateMSBuildRulePropsFile(props_path, msbuild_rules): + """Generate the .props file.""" + content = ['Project', + {'xmlns': 'http://schemas.microsoft.com/developer/msbuild/2003'}] + for rule in msbuild_rules: + content.extend([ + ['PropertyGroup', + {'Condition': "'$(%s)' == '' and '$(%s)' == '' and " + "'$(ConfigurationType)' != 'Makefile'" % (rule.before_targets, + rule.after_targets) + }, + [rule.before_targets, 'Midl'], + [rule.after_targets, 'CustomBuild'], + ], + ['PropertyGroup', + [rule.depends_on, + {'Condition': "'$(ConfigurationType)' != 'Makefile'"}, + '_SelectedFiles;$(%s)' % rule.depends_on + ], + ], + ['ItemDefinitionGroup', + [rule.rule_name, + ['CommandLineTemplate', rule.command], + ['Outputs', rule.outputs], + ['ExecutionDescription', rule.description], + ['AdditionalDependencies', rule.additional_dependencies], + ], + ] + ]) + easy_xml.WriteXmlIfChanged(content, props_path, pretty=True, win32=True) + + +def _GenerateMSBuildRuleTargetsFile(targets_path, msbuild_rules): + """Generate the .targets file.""" + content = ['Project', + {'xmlns': 'http://schemas.microsoft.com/developer/msbuild/2003' + } + ] + item_group = [ + 'ItemGroup', + ['PropertyPageSchema', + {'Include': '$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml'} + ] + ] + for rule in msbuild_rules: + item_group.append( + ['AvailableItemName', + {'Include': rule.rule_name}, + ['Targets', rule.target_name], + ]) + content.append(item_group) + + for rule in msbuild_rules: + content.append( + ['UsingTask', + {'TaskName': rule.rule_name, + 'TaskFactory': 'XamlTaskFactory', + 'AssemblyName': 'Microsoft.Build.Tasks.v4.0' + }, + ['Task', '$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml'], + ]) + for rule in msbuild_rules: + rule_name = rule.rule_name + target_outputs = '%%(%s.Outputs)' % rule_name + target_inputs = ('%%(%s.Identity);%%(%s.AdditionalDependencies);' + '$(MSBuildProjectFile)') % (rule_name, rule_name) + rule_inputs = '%%(%s.Identity)' % rule_name + extension_condition = ("'%(Extension)'=='.obj' or " + "'%(Extension)'=='.res' or " + "'%(Extension)'=='.rsc' or " + "'%(Extension)'=='.lib'") + remove_section = [ + 'ItemGroup', + {'Condition': "'@(SelectedFiles)' != ''"}, + [rule_name, + {'Remove': '@(%s)' % rule_name, + 'Condition': "'%(Identity)' != '@(SelectedFiles)'" + } + ] + ] + inputs_section = [ + 'ItemGroup', + [rule.inputs, {'Include': '%%(%s.AdditionalDependencies)' % rule_name}] + ] + logging_section = [ + 'ItemGroup', + [rule.tlog, + {'Include': '%%(%s.Outputs)' % rule_name, + 'Condition': ("'%%(%s.Outputs)' != '' and " + "'%%(%s.ExcludedFromBuild)' != 'true'" % + (rule_name, rule_name)) + }, + ['Source', "@(%s, '|')" % rule_name], + ['Inputs', "@(%s -> '%%(Fullpath)', ';')" % rule.inputs], + ], + ] + message_section = [ + 'Message', + {'Importance': 'High', + 'Text': '%%(%s.ExecutionDescription)' % rule_name + } + ] + write_tlog_section = [ + 'WriteLinesToFile', + {'Condition': "'@(%s)' != '' and '%%(%s.ExcludedFromBuild)' != " + "'true'" % (rule.tlog, rule.tlog), + 'File': '$(IntDir)$(ProjectName).write.1.tlog', + 'Lines': "^%%(%s.Source);@(%s->'%%(Fullpath)')" % (rule.tlog, + rule.tlog) + } + ] + read_tlog_section = [ + 'WriteLinesToFile', + {'Condition': "'@(%s)' != '' and '%%(%s.ExcludedFromBuild)' != " + "'true'" % (rule.tlog, rule.tlog), + 'File': '$(IntDir)$(ProjectName).read.1.tlog', + 'Lines': "^%%(%s.Source);%%(%s.Inputs)" % (rule.tlog, rule.tlog) + } + ] + command_and_input_section = [ + rule_name, + {'Condition': "'@(%s)' != '' and '%%(%s.ExcludedFromBuild)' != " + "'true'" % (rule_name, rule_name), + 'EchoOff': 'true', + 'StandardOutputImportance': 'High', + 'StandardErrorImportance': 'High', + 'CommandLineTemplate': '%%(%s.CommandLineTemplate)' % rule_name, + 'AdditionalOptions': '%%(%s.AdditionalOptions)' % rule_name, + 'Inputs': rule_inputs + } + ] + content.extend([ + ['Target', + {'Name': rule.target_name, + 'BeforeTargets': '$(%s)' % rule.before_targets, + 'AfterTargets': '$(%s)' % rule.after_targets, + 'Condition': "'@(%s)' != ''" % rule_name, + 'DependsOnTargets': '$(%s);%s' % (rule.depends_on, + rule.compute_output), + 'Outputs': target_outputs, + 'Inputs': target_inputs + }, + remove_section, + inputs_section, + logging_section, + message_section, + write_tlog_section, + read_tlog_section, + command_and_input_section, + ], + ['PropertyGroup', + ['ComputeLinkInputsTargets', + '$(ComputeLinkInputsTargets);', + '%s;' % rule.compute_output + ], + ['ComputeLibInputsTargets', + '$(ComputeLibInputsTargets);', + '%s;' % rule.compute_output + ], + ], + ['Target', + {'Name': rule.compute_output, + 'Condition': "'@(%s)' != ''" % rule_name + }, + ['ItemGroup', + [rule.dirs_to_make, + {'Condition': "'@(%s)' != '' and " + "'%%(%s.ExcludedFromBuild)' != 'true'" % (rule_name, rule_name), + 'Include': '%%(%s.Outputs)' % rule_name + } + ], + ['Link', + {'Include': '%%(%s.Identity)' % rule.dirs_to_make, + 'Condition': extension_condition + } + ], + ['Lib', + {'Include': '%%(%s.Identity)' % rule.dirs_to_make, + 'Condition': extension_condition + } + ], + ['ImpLib', + {'Include': '%%(%s.Identity)' % rule.dirs_to_make, + 'Condition': extension_condition + } + ], + ], + ['MakeDir', + {'Directories': ("@(%s->'%%(RootDir)%%(Directory)')" % + rule.dirs_to_make) + } + ] + ], + ]) + easy_xml.WriteXmlIfChanged(content, targets_path, pretty=True, win32=True) + + +def _GenerateMSBuildRuleXmlFile(xml_path, msbuild_rules): + # Generate the .xml file + content = [ + 'ProjectSchemaDefinitions', + {'xmlns': ('clr-namespace:Microsoft.Build.Framework.XamlTypes;' + 'assembly=Microsoft.Build.Framework'), + 'xmlns:x': 'http://schemas.microsoft.com/winfx/2006/xaml', + 'xmlns:sys': 'clr-namespace:System;assembly=mscorlib', + 'xmlns:transformCallback': + 'Microsoft.Cpp.Dev10.ConvertPropertyCallback' + } + ] + for rule in msbuild_rules: + content.extend([ + ['Rule', + {'Name': rule.rule_name, + 'PageTemplate': 'tool', + 'DisplayName': rule.display_name, + 'Order': '200' + }, + ['Rule.DataSource', + ['DataSource', + {'Persistence': 'ProjectFile', + 'ItemType': rule.rule_name + } + ] + ], + ['Rule.Categories', + ['Category', + {'Name': 'General'}, + ['Category.DisplayName', + ['sys:String', 'General'], + ], + ], + ['Category', + {'Name': 'Command Line', + 'Subtype': 'CommandLine' + }, + ['Category.DisplayName', + ['sys:String', 'Command Line'], + ], + ], + ], + ['StringListProperty', + {'Name': 'Inputs', + 'Category': 'Command Line', + 'IsRequired': 'true', + 'Switch': ' ' + }, + ['StringListProperty.DataSource', + ['DataSource', + {'Persistence': 'ProjectFile', + 'ItemType': rule.rule_name, + 'SourceType': 'Item' + } + ] + ], + ], + ['StringProperty', + {'Name': 'CommandLineTemplate', + 'DisplayName': 'Command Line', + 'Visible': 'False', + 'IncludeInCommandLine': 'False' + } + ], + ['DynamicEnumProperty', + {'Name': rule.before_targets, + 'Category': 'General', + 'EnumProvider': 'Targets', + 'IncludeInCommandLine': 'False' + }, + ['DynamicEnumProperty.DisplayName', + ['sys:String', 'Execute Before'], + ], + ['DynamicEnumProperty.Description', + ['sys:String', 'Specifies the targets for the build customization' + ' to run before.' + ], + ], + ['DynamicEnumProperty.ProviderSettings', + ['NameValuePair', + {'Name': 'Exclude', + 'Value': '^%s|^Compute' % rule.before_targets + } + ] + ], + ['DynamicEnumProperty.DataSource', + ['DataSource', + {'Persistence': 'ProjectFile', + 'HasConfigurationCondition': 'true' + } + ] + ], + ], + ['DynamicEnumProperty', + {'Name': rule.after_targets, + 'Category': 'General', + 'EnumProvider': 'Targets', + 'IncludeInCommandLine': 'False' + }, + ['DynamicEnumProperty.DisplayName', + ['sys:String', 'Execute After'], + ], + ['DynamicEnumProperty.Description', + ['sys:String', ('Specifies the targets for the build customization' + ' to run after.') + ], + ], + ['DynamicEnumProperty.ProviderSettings', + ['NameValuePair', + {'Name': 'Exclude', + 'Value': '^%s|^Compute' % rule.after_targets + } + ] + ], + ['DynamicEnumProperty.DataSource', + ['DataSource', + {'Persistence': 'ProjectFile', + 'ItemType': '', + 'HasConfigurationCondition': 'true' + } + ] + ], + ], + ['StringListProperty', + {'Name': 'Outputs', + 'DisplayName': 'Outputs', + 'Visible': 'False', + 'IncludeInCommandLine': 'False' + } + ], + ['StringProperty', + {'Name': 'ExecutionDescription', + 'DisplayName': 'Execution Description', + 'Visible': 'False', + 'IncludeInCommandLine': 'False' + } + ], + ['StringListProperty', + {'Name': 'AdditionalDependencies', + 'DisplayName': 'Additional Dependencies', + 'IncludeInCommandLine': 'False', + 'Visible': 'false' + } + ], + ['StringProperty', + {'Subtype': 'AdditionalOptions', + 'Name': 'AdditionalOptions', + 'Category': 'Command Line' + }, + ['StringProperty.DisplayName', + ['sys:String', 'Additional Options'], + ], + ['StringProperty.Description', + ['sys:String', 'Additional Options'], + ], + ], + ], + ['ItemType', + {'Name': rule.rule_name, + 'DisplayName': rule.display_name + } + ], + ['FileExtension', + {'Name': '*' + rule.extension, + 'ContentType': rule.rule_name + } + ], + ['ContentType', + {'Name': rule.rule_name, + 'DisplayName': '', + 'ItemType': rule.rule_name + } + ] + ]) + easy_xml.WriteXmlIfChanged(content, xml_path, pretty=True, win32=True) + + +def _GetConfigurationAndPlatform(name, settings): + configuration = name.rsplit('_', 1)[0] + platform = settings.get('msvs_configuration_platform', 'Win32') + return (configuration, platform) + + +def _GetConfigurationCondition(name, settings): + return (r"'$(Configuration)|$(Platform)'=='%s|%s'" % + _GetConfigurationAndPlatform(name, settings)) + + +def _GetMSBuildProjectConfigurations(configurations): + group = ['ItemGroup', {'Label': 'ProjectConfigurations'}] + for (name, settings) in sorted(configurations.iteritems()): + configuration, platform = _GetConfigurationAndPlatform(name, settings) + designation = '%s|%s' % (configuration, platform) + group.append( + ['ProjectConfiguration', {'Include': designation}, + ['Configuration', configuration], + ['Platform', platform]]) + return [group] + + +def _GetMSBuildGlobalProperties(spec, guid, gyp_file_name): + namespace = os.path.splitext(gyp_file_name)[0] + properties = [ + ['PropertyGroup', {'Label': 'Globals'}, + ['ProjectGuid', guid], + ['Keyword', 'Win32Proj'], + ['RootNamespace', namespace], + ['IgnoreWarnCompileDuplicatedFilename', 'true'], + ] + ] + + if os.environ.get('PROCESSOR_ARCHITECTURE') == 'AMD64' or \ + os.environ.get('PROCESSOR_ARCHITEW6432') == 'AMD64': + properties[0].append(['PreferredToolArchitecture', 'x64']) + + if spec.get('msvs_enable_winrt'): + properties[0].append(['DefaultLanguage', 'en-US']) + properties[0].append(['AppContainerApplication', 'true']) + if spec.get('msvs_application_type_revision'): + app_type_revision = spec.get('msvs_application_type_revision') + properties[0].append(['ApplicationTypeRevision', app_type_revision]) + else: + properties[0].append(['ApplicationTypeRevision', '8.1']) + + if spec.get('msvs_target_platform_version'): + target_platform_version = spec.get('msvs_target_platform_version') + properties[0].append(['WindowsTargetPlatformVersion', + target_platform_version]) + if spec.get('msvs_target_platform_minversion'): + target_platform_minversion = spec.get('msvs_target_platform_minversion') + properties[0].append(['WindowsTargetPlatformMinVersion', + target_platform_minversion]) + else: + properties[0].append(['WindowsTargetPlatformMinVersion', + target_platform_version]) + if spec.get('msvs_enable_winphone'): + properties[0].append(['ApplicationType', 'Windows Phone']) + else: + properties[0].append(['ApplicationType', 'Windows Store']) + + return properties + +def _GetMSBuildConfigurationDetails(spec, build_file): + properties = {} + for name, settings in spec['configurations'].iteritems(): + msbuild_attributes = _GetMSBuildAttributes(spec, settings, build_file) + condition = _GetConfigurationCondition(name, settings) + character_set = msbuild_attributes.get('CharacterSet') + _AddConditionalProperty(properties, condition, 'ConfigurationType', + msbuild_attributes['ConfigurationType']) + if character_set: + if 'msvs_enable_winrt' not in spec : + _AddConditionalProperty(properties, condition, 'CharacterSet', + character_set) + return _GetMSBuildPropertyGroup(spec, 'Configuration', properties) + + +def _GetMSBuildLocalProperties(msbuild_toolset): + # Currently the only local property we support is PlatformToolset + properties = {} + if msbuild_toolset: + properties = [ + ['PropertyGroup', {'Label': 'Locals'}, + ['PlatformToolset', msbuild_toolset], + ] + ] + return properties + + +def _GetMSBuildPropertySheets(configurations): + user_props = r'$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props' + additional_props = {} + props_specified = False + for name, settings in sorted(configurations.iteritems()): + configuration = _GetConfigurationCondition(name, settings) + if settings.has_key('msbuild_props'): + additional_props[configuration] = _FixPaths(settings['msbuild_props']) + props_specified = True + else: + additional_props[configuration] = '' + + if not props_specified: + return [ + ['ImportGroup', + {'Label': 'PropertySheets'}, + ['Import', + {'Project': user_props, + 'Condition': "exists('%s')" % user_props, + 'Label': 'LocalAppDataPlatform' + } + ] + ] + ] + else: + sheets = [] + for condition, props in additional_props.iteritems(): + import_group = [ + 'ImportGroup', + {'Label': 'PropertySheets', + 'Condition': condition + }, + ['Import', + {'Project': user_props, + 'Condition': "exists('%s')" % user_props, + 'Label': 'LocalAppDataPlatform' + } + ] + ] + for props_file in props: + import_group.append(['Import', {'Project':props_file}]) + sheets.append(import_group) + return sheets + +def _ConvertMSVSBuildAttributes(spec, config, build_file): + config_type = _GetMSVSConfigurationType(spec, build_file) + msvs_attributes = _GetMSVSAttributes(spec, config, config_type) + msbuild_attributes = {} + for a in msvs_attributes: + if a in ['IntermediateDirectory', 'OutputDirectory']: + directory = MSVSSettings.ConvertVCMacrosToMSBuild(msvs_attributes[a]) + if not directory.endswith('\\'): + directory += '\\' + msbuild_attributes[a] = directory + elif a == 'CharacterSet': + msbuild_attributes[a] = _ConvertMSVSCharacterSet(msvs_attributes[a]) + elif a == 'ConfigurationType': + msbuild_attributes[a] = _ConvertMSVSConfigurationType(msvs_attributes[a]) + else: + print 'Warning: Do not know how to convert MSVS attribute ' + a + return msbuild_attributes + + +def _ConvertMSVSCharacterSet(char_set): + if char_set.isdigit(): + char_set = { + '0': 'MultiByte', + '1': 'Unicode', + '2': 'MultiByte', + }[char_set] + return char_set + + +def _ConvertMSVSConfigurationType(config_type): + if config_type.isdigit(): + config_type = { + '1': 'Application', + '2': 'DynamicLibrary', + '4': 'StaticLibrary', + '10': 'Utility' + }[config_type] + return config_type + + +def _GetMSBuildAttributes(spec, config, build_file): + if 'msbuild_configuration_attributes' not in config: + msbuild_attributes = _ConvertMSVSBuildAttributes(spec, config, build_file) + + else: + config_type = _GetMSVSConfigurationType(spec, build_file) + config_type = _ConvertMSVSConfigurationType(config_type) + msbuild_attributes = config.get('msbuild_configuration_attributes', {}) + msbuild_attributes.setdefault('ConfigurationType', config_type) + output_dir = msbuild_attributes.get('OutputDirectory', + '$(SolutionDir)$(Configuration)') + msbuild_attributes['OutputDirectory'] = _FixPath(output_dir) + '\\' + if 'IntermediateDirectory' not in msbuild_attributes: + intermediate = _FixPath('$(Configuration)') + '\\' + msbuild_attributes['IntermediateDirectory'] = intermediate + if 'CharacterSet' in msbuild_attributes: + msbuild_attributes['CharacterSet'] = _ConvertMSVSCharacterSet( + msbuild_attributes['CharacterSet']) + if 'TargetName' not in msbuild_attributes: + prefix = spec.get('product_prefix', '') + product_name = spec.get('product_name', '$(ProjectName)') + target_name = prefix + product_name + msbuild_attributes['TargetName'] = target_name + if 'TargetExt' not in msbuild_attributes and 'product_extension' in spec: + ext = spec.get('product_extension') + msbuild_attributes['TargetExt'] = '.' + ext + + if spec.get('msvs_external_builder'): + external_out_dir = spec.get('msvs_external_builder_out_dir', '.') + msbuild_attributes['OutputDirectory'] = _FixPath(external_out_dir) + '\\' + + # Make sure that 'TargetPath' matches 'Lib.OutputFile' or 'Link.OutputFile' + # (depending on the tool used) to avoid MSB8012 warning. + msbuild_tool_map = { + 'executable': 'Link', + 'shared_library': 'Link', + 'loadable_module': 'Link', + 'static_library': 'Lib', + } + msbuild_tool = msbuild_tool_map.get(spec['type']) + if msbuild_tool: + msbuild_settings = config['finalized_msbuild_settings'] + out_file = msbuild_settings[msbuild_tool].get('OutputFile') + if out_file: + msbuild_attributes['TargetPath'] = _FixPath(out_file) + target_ext = msbuild_settings[msbuild_tool].get('TargetExt') + if target_ext: + msbuild_attributes['TargetExt'] = target_ext + + return msbuild_attributes + + +def _GetMSBuildConfigurationGlobalProperties(spec, configurations, build_file): + # TODO(jeanluc) We could optimize out the following and do it only if + # there are actions. + # TODO(jeanluc) Handle the equivalent of setting 'CYGWIN=nontsec'. + new_paths = [] + cygwin_dirs = spec.get('msvs_cygwin_dirs', ['.'])[0] + if cygwin_dirs: + cyg_path = '$(MSBuildProjectDirectory)\\%s\\bin\\' % _FixPath(cygwin_dirs) + new_paths.append(cyg_path) + # TODO(jeanluc) Change the convention to have both a cygwin_dir and a + # python_dir. + python_path = cyg_path.replace('cygwin\\bin', 'python_26') + new_paths.append(python_path) + if new_paths: + new_paths = '$(ExecutablePath);' + ';'.join(new_paths) + + properties = {} + for (name, configuration) in sorted(configurations.iteritems()): + condition = _GetConfigurationCondition(name, configuration) + attributes = _GetMSBuildAttributes(spec, configuration, build_file) + msbuild_settings = configuration['finalized_msbuild_settings'] + _AddConditionalProperty(properties, condition, 'IntDir', + attributes['IntermediateDirectory']) + _AddConditionalProperty(properties, condition, 'OutDir', + attributes['OutputDirectory']) + _AddConditionalProperty(properties, condition, 'TargetName', + attributes['TargetName']) + if 'TargetExt' in attributes: + _AddConditionalProperty(properties, condition, 'TargetExt', + attributes['TargetExt']) + + if attributes.get('TargetPath'): + _AddConditionalProperty(properties, condition, 'TargetPath', + attributes['TargetPath']) + if attributes.get('TargetExt'): + _AddConditionalProperty(properties, condition, 'TargetExt', + attributes['TargetExt']) + + if new_paths: + _AddConditionalProperty(properties, condition, 'ExecutablePath', + new_paths) + tool_settings = msbuild_settings.get('', {}) + for name, value in sorted(tool_settings.iteritems()): + formatted_value = _GetValueFormattedForMSBuild('', name, value) + _AddConditionalProperty(properties, condition, name, formatted_value) + return _GetMSBuildPropertyGroup(spec, None, properties) + + +def _AddConditionalProperty(properties, condition, name, value): + """Adds a property / conditional value pair to a dictionary. + + Arguments: + properties: The dictionary to be modified. The key is the name of the + property. The value is itself a dictionary; its key is the value and + the value a list of condition for which this value is true. + condition: The condition under which the named property has the value. + name: The name of the property. + value: The value of the property. + """ + if name not in properties: + properties[name] = {} + values = properties[name] + if value not in values: + values[value] = [] + conditions = values[value] + conditions.append(condition) + + +# Regex for msvs variable references ( i.e. $(FOO) ). +MSVS_VARIABLE_REFERENCE = re.compile(r'\$\(([a-zA-Z_][a-zA-Z0-9_]*)\)') + + +def _GetMSBuildPropertyGroup(spec, label, properties): + """Returns a PropertyGroup definition for the specified properties. + + Arguments: + spec: The target project dict. + label: An optional label for the PropertyGroup. + properties: The dictionary to be converted. The key is the name of the + property. The value is itself a dictionary; its key is the value and + the value a list of condition for which this value is true. + """ + group = ['PropertyGroup'] + if label: + group.append({'Label': label}) + num_configurations = len(spec['configurations']) + def GetEdges(node): + # Use a definition of edges such that user_of_variable -> used_varible. + # This happens to be easier in this case, since a variable's + # definition contains all variables it references in a single string. + edges = set() + for value in sorted(properties[node].keys()): + # Add to edges all $(...) references to variables. + # + # Variable references that refer to names not in properties are excluded + # These can exist for instance to refer built in definitions like + # $(SolutionDir). + # + # Self references are ignored. Self reference is used in a few places to + # append to the default value. I.e. PATH=$(PATH);other_path + edges.update(set([v for v in MSVS_VARIABLE_REFERENCE.findall(value) + if v in properties and v != node])) + return edges + properties_ordered = gyp.common.TopologicallySorted( + properties.keys(), GetEdges) + # Walk properties in the reverse of a topological sort on + # user_of_variable -> used_variable as this ensures variables are + # defined before they are used. + # NOTE: reverse(topsort(DAG)) = topsort(reverse_edges(DAG)) + for name in reversed(properties_ordered): + values = properties[name] + for value, conditions in sorted(values.iteritems()): + if len(conditions) == num_configurations: + # If the value is the same all configurations, + # just add one unconditional entry. + group.append([name, value]) + else: + for condition in conditions: + group.append([name, {'Condition': condition}, value]) + return [group] + + +def _GetMSBuildToolSettingsSections(spec, configurations): + groups = [] + for (name, configuration) in sorted(configurations.iteritems()): + msbuild_settings = configuration['finalized_msbuild_settings'] + group = ['ItemDefinitionGroup', + {'Condition': _GetConfigurationCondition(name, configuration)} + ] + for tool_name, tool_settings in sorted(msbuild_settings.iteritems()): + # Skip the tool named '' which is a holder of global settings handled + # by _GetMSBuildConfigurationGlobalProperties. + if tool_name: + if tool_settings: + tool = [tool_name] + for name, value in sorted(tool_settings.iteritems()): + formatted_value = _GetValueFormattedForMSBuild(tool_name, name, + value) + tool.append([name, formatted_value]) + group.append(tool) + groups.append(group) + return groups + + +def _FinalizeMSBuildSettings(spec, configuration): + if 'msbuild_settings' in configuration: + converted = False + msbuild_settings = configuration['msbuild_settings'] + MSVSSettings.ValidateMSBuildSettings(msbuild_settings) + else: + converted = True + msvs_settings = configuration.get('msvs_settings', {}) + msbuild_settings = MSVSSettings.ConvertToMSBuildSettings(msvs_settings) + include_dirs, midl_include_dirs, resource_include_dirs = \ + _GetIncludeDirs(configuration) + libraries = _GetLibraries(spec) + library_dirs = _GetLibraryDirs(configuration) + out_file, _, msbuild_tool = _GetOutputFilePathAndTool(spec, msbuild=True) + target_ext = _GetOutputTargetExt(spec) + defines = _GetDefines(configuration) + if converted: + # Visual Studio 2010 has TR1 + defines = [d for d in defines if d != '_HAS_TR1=0'] + # Warn of ignored settings + ignored_settings = ['msvs_tool_files'] + for ignored_setting in ignored_settings: + value = configuration.get(ignored_setting) + if value: + print ('Warning: The automatic conversion to MSBuild does not handle ' + '%s. Ignoring setting of %s' % (ignored_setting, str(value))) + + defines = [_EscapeCppDefineForMSBuild(d) for d in defines] + disabled_warnings = _GetDisabledWarnings(configuration) + prebuild = configuration.get('msvs_prebuild') + postbuild = configuration.get('msvs_postbuild') + def_file = _GetModuleDefinition(spec) + precompiled_header = configuration.get('msvs_precompiled_header') + + # Add the information to the appropriate tool + # TODO(jeanluc) We could optimize and generate these settings only if + # the corresponding files are found, e.g. don't generate ResourceCompile + # if you don't have any resources. + _ToolAppend(msbuild_settings, 'ClCompile', + 'AdditionalIncludeDirectories', include_dirs) + _ToolAppend(msbuild_settings, 'Midl', + 'AdditionalIncludeDirectories', midl_include_dirs) + _ToolAppend(msbuild_settings, 'ResourceCompile', + 'AdditionalIncludeDirectories', resource_include_dirs) + # Add in libraries, note that even for empty libraries, we want this + # set, to prevent inheriting default libraries from the enviroment. + _ToolSetOrAppend(msbuild_settings, 'Link', 'AdditionalDependencies', + libraries) + _ToolAppend(msbuild_settings, 'Link', 'AdditionalLibraryDirectories', + library_dirs) + if out_file: + _ToolAppend(msbuild_settings, msbuild_tool, 'OutputFile', out_file, + only_if_unset=True) + if target_ext: + _ToolAppend(msbuild_settings, msbuild_tool, 'TargetExt', target_ext, + only_if_unset=True) + # Add defines. + _ToolAppend(msbuild_settings, 'ClCompile', + 'PreprocessorDefinitions', defines) + _ToolAppend(msbuild_settings, 'ResourceCompile', + 'PreprocessorDefinitions', defines) + # Add disabled warnings. + _ToolAppend(msbuild_settings, 'ClCompile', + 'DisableSpecificWarnings', disabled_warnings) + # Turn on precompiled headers if appropriate. + if precompiled_header: + precompiled_header = os.path.split(precompiled_header)[1] + _ToolAppend(msbuild_settings, 'ClCompile', 'PrecompiledHeader', 'Use') + _ToolAppend(msbuild_settings, 'ClCompile', + 'PrecompiledHeaderFile', precompiled_header) + _ToolAppend(msbuild_settings, 'ClCompile', + 'ForcedIncludeFiles', [precompiled_header]) + else: + _ToolAppend(msbuild_settings, 'ClCompile', 'PrecompiledHeader', 'NotUsing') + # Turn off WinRT compilation + _ToolAppend(msbuild_settings, 'ClCompile', 'CompileAsWinRT', 'false') + # Turn on import libraries if appropriate + if spec.get('msvs_requires_importlibrary'): + _ToolAppend(msbuild_settings, '', 'IgnoreImportLibrary', 'false') + # Loadable modules don't generate import libraries; + # tell dependent projects to not expect one. + if spec['type'] == 'loadable_module': + _ToolAppend(msbuild_settings, '', 'IgnoreImportLibrary', 'true') + # Set the module definition file if any. + if def_file: + _ToolAppend(msbuild_settings, 'Link', 'ModuleDefinitionFile', def_file) + configuration['finalized_msbuild_settings'] = msbuild_settings + if prebuild: + _ToolAppend(msbuild_settings, 'PreBuildEvent', 'Command', prebuild) + if postbuild: + _ToolAppend(msbuild_settings, 'PostBuildEvent', 'Command', postbuild) + + +def _GetValueFormattedForMSBuild(tool_name, name, value): + if type(value) == list: + # For some settings, VS2010 does not automatically extends the settings + # TODO(jeanluc) Is this what we want? + if name in ['AdditionalIncludeDirectories', + 'AdditionalLibraryDirectories', + 'AdditionalOptions', + 'DelayLoadDLLs', + 'DisableSpecificWarnings', + 'PreprocessorDefinitions']: + value.append('%%(%s)' % name) + # For most tools, entries in a list should be separated with ';' but some + # settings use a space. Check for those first. + exceptions = { + 'ClCompile': ['AdditionalOptions'], + 'Link': ['AdditionalOptions'], + 'Lib': ['AdditionalOptions']} + if tool_name in exceptions and name in exceptions[tool_name]: + char = ' ' + else: + char = ';' + formatted_value = char.join( + [MSVSSettings.ConvertVCMacrosToMSBuild(i) for i in value]) + else: + formatted_value = MSVSSettings.ConvertVCMacrosToMSBuild(value) + return formatted_value + + +def _VerifySourcesExist(sources, root_dir): + """Verifies that all source files exist on disk. + + Checks that all regular source files, i.e. not created at run time, + exist on disk. Missing files cause needless recompilation but no otherwise + visible errors. + + Arguments: + sources: A recursive list of Filter/file names. + root_dir: The root directory for the relative path names. + Returns: + A list of source files that cannot be found on disk. + """ + missing_sources = [] + for source in sources: + if isinstance(source, MSVSProject.Filter): + missing_sources.extend(_VerifySourcesExist(source.contents, root_dir)) + else: + if '$' not in source: + full_path = os.path.join(root_dir, source) + if not os.path.exists(full_path): + missing_sources.append(full_path) + return missing_sources + + +def _GetMSBuildSources(spec, sources, exclusions, rule_dependencies, + extension_to_rule_name, actions_spec, + sources_handled_by_action, list_excluded): + groups = ['none', 'masm', 'midl', 'include', 'compile', 'resource', 'rule', + 'rule_dependency'] + grouped_sources = {} + for g in groups: + grouped_sources[g] = [] + + _AddSources2(spec, sources, exclusions, grouped_sources, + rule_dependencies, extension_to_rule_name, + sources_handled_by_action, list_excluded) + sources = [] + for g in groups: + if grouped_sources[g]: + sources.append(['ItemGroup'] + grouped_sources[g]) + if actions_spec: + sources.append(['ItemGroup'] + actions_spec) + return sources + + +def _AddSources2(spec, sources, exclusions, grouped_sources, + rule_dependencies, extension_to_rule_name, + sources_handled_by_action, + list_excluded): + extensions_excluded_from_precompile = [] + for source in sources: + if isinstance(source, MSVSProject.Filter): + _AddSources2(spec, source.contents, exclusions, grouped_sources, + rule_dependencies, extension_to_rule_name, + sources_handled_by_action, + list_excluded) + else: + if not source in sources_handled_by_action: + detail = [] + excluded_configurations = exclusions.get(source, []) + if len(excluded_configurations) == len(spec['configurations']): + detail.append(['ExcludedFromBuild', 'true']) + else: + for config_name, configuration in sorted(excluded_configurations): + condition = _GetConfigurationCondition(config_name, configuration) + detail.append(['ExcludedFromBuild', + {'Condition': condition}, + 'true']) + # Add precompile if needed + for config_name, configuration in spec['configurations'].iteritems(): + precompiled_source = configuration.get('msvs_precompiled_source', '') + if precompiled_source != '': + precompiled_source = _FixPath(precompiled_source) + if not extensions_excluded_from_precompile: + # If the precompiled header is generated by a C source, we must + # not try to use it for C++ sources, and vice versa. + basename, extension = os.path.splitext(precompiled_source) + if extension == '.c': + extensions_excluded_from_precompile = ['.cc', '.cpp', '.cxx'] + else: + extensions_excluded_from_precompile = ['.c'] + + if precompiled_source == source: + condition = _GetConfigurationCondition(config_name, configuration) + detail.append(['PrecompiledHeader', + {'Condition': condition}, + 'Create' + ]) + else: + # Turn off precompiled header usage for source files of a + # different type than the file that generated the + # precompiled header. + for extension in extensions_excluded_from_precompile: + if source.endswith(extension): + detail.append(['PrecompiledHeader', '']) + detail.append(['ForcedIncludeFiles', '']) + + group, element = _MapFileToMsBuildSourceType(source, rule_dependencies, + extension_to_rule_name) + grouped_sources[group].append([element, {'Include': source}] + detail) + + +def _GetMSBuildProjectReferences(project): + references = [] + if project.dependencies: + group = ['ItemGroup'] + for dependency in project.dependencies: + guid = dependency.guid + project_dir = os.path.split(project.path)[0] + relative_path = gyp.common.RelativePath(dependency.path, project_dir) + project_ref = ['ProjectReference', + {'Include': relative_path}, + ['Project', guid], + ['ReferenceOutputAssembly', 'false'] + ] + for config in dependency.spec.get('configurations', {}).itervalues(): + # If it's disabled in any config, turn it off in the reference. + if config.get('msvs_2010_disable_uldi_when_referenced', 0): + project_ref.append(['UseLibraryDependencyInputs', 'false']) + break + group.append(project_ref) + references.append(group) + return references + + +def _GenerateMSBuildProject(project, options, version, generator_flags): + spec = project.spec + configurations = spec['configurations'] + project_dir, project_file_name = os.path.split(project.path) + gyp.common.EnsureDirExists(project.path) + # Prepare list of sources and excluded sources. + gyp_path = _NormalizedSource(project.build_file) + relative_path_of_gyp_file = gyp.common.RelativePath(gyp_path, project_dir) + + gyp_file = os.path.split(project.build_file)[1] + sources, excluded_sources = _PrepareListOfSources(spec, generator_flags, + gyp_file) + # Add rules. + actions_to_add = {} + props_files_of_rules = set() + targets_files_of_rules = set() + rule_dependencies = set() + extension_to_rule_name = {} + list_excluded = generator_flags.get('msvs_list_excluded_files', True) + + # Don't generate rules if we are using an external builder like ninja. + if not spec.get('msvs_external_builder'): + _GenerateRulesForMSBuild(project_dir, options, spec, + sources, excluded_sources, + props_files_of_rules, targets_files_of_rules, + actions_to_add, rule_dependencies, + extension_to_rule_name) + else: + rules = spec.get('rules', []) + _AdjustSourcesForRules(rules, sources, excluded_sources, True) + + sources, excluded_sources, excluded_idl = ( + _AdjustSourcesAndConvertToFilterHierarchy(spec, options, + project_dir, sources, + excluded_sources, + list_excluded, version)) + + # Don't add actions if we are using an external builder like ninja. + if not spec.get('msvs_external_builder'): + _AddActions(actions_to_add, spec, project.build_file) + _AddCopies(actions_to_add, spec) + + # NOTE: this stanza must appear after all actions have been decided. + # Don't excluded sources with actions attached, or they won't run. + excluded_sources = _FilterActionsFromExcluded( + excluded_sources, actions_to_add) + + exclusions = _GetExcludedFilesFromBuild(spec, excluded_sources, excluded_idl) + actions_spec, sources_handled_by_action = _GenerateActionsForMSBuild( + spec, actions_to_add) + + _GenerateMSBuildFiltersFile(project.path + '.filters', sources, + rule_dependencies, + extension_to_rule_name) + missing_sources = _VerifySourcesExist(sources, project_dir) + + for configuration in configurations.itervalues(): + _FinalizeMSBuildSettings(spec, configuration) + + # Add attributes to root element + + import_default_section = [ + ['Import', {'Project': r'$(VCTargetsPath)\Microsoft.Cpp.Default.props'}]] + import_cpp_props_section = [ + ['Import', {'Project': r'$(VCTargetsPath)\Microsoft.Cpp.props'}]] + import_cpp_targets_section = [ + ['Import', {'Project': r'$(VCTargetsPath)\Microsoft.Cpp.targets'}]] + import_masm_props_section = [ + ['Import', + {'Project': r'$(VCTargetsPath)\BuildCustomizations\masm.props'}]] + import_masm_targets_section = [ + ['Import', + {'Project': r'$(VCTargetsPath)\BuildCustomizations\masm.targets'}]] + macro_section = [['PropertyGroup', {'Label': 'UserMacros'}]] + + content = [ + 'Project', + {'xmlns': 'http://schemas.microsoft.com/developer/msbuild/2003', + 'ToolsVersion': version.ProjectVersion(), + 'DefaultTargets': 'Build' + }] + + content += _GetMSBuildProjectConfigurations(configurations) + content += _GetMSBuildGlobalProperties(spec, project.guid, project_file_name) + content += import_default_section + content += _GetMSBuildConfigurationDetails(spec, project.build_file) + if spec.get('msvs_enable_winphone'): + content += _GetMSBuildLocalProperties('v120_wp81') + else: + content += _GetMSBuildLocalProperties(project.msbuild_toolset) + content += import_cpp_props_section + content += import_masm_props_section + content += _GetMSBuildExtensions(props_files_of_rules) + content += _GetMSBuildPropertySheets(configurations) + content += macro_section + content += _GetMSBuildConfigurationGlobalProperties(spec, configurations, + project.build_file) + content += _GetMSBuildToolSettingsSections(spec, configurations) + content += _GetMSBuildSources( + spec, sources, exclusions, rule_dependencies, extension_to_rule_name, + actions_spec, sources_handled_by_action, list_excluded) + content += _GetMSBuildProjectReferences(project) + content += import_cpp_targets_section + content += import_masm_targets_section + content += _GetMSBuildExtensionTargets(targets_files_of_rules) + + if spec.get('msvs_external_builder'): + content += _GetMSBuildExternalBuilderTargets(spec) + + # TODO(jeanluc) File a bug to get rid of runas. We had in MSVS: + # has_run_as = _WriteMSVSUserFile(project.path, version, spec) + + easy_xml.WriteXmlIfChanged(content, project.path, pretty=True, win32=True) + + return missing_sources + + +def _GetMSBuildExternalBuilderTargets(spec): + """Return a list of MSBuild targets for external builders. + + The "Build" and "Clean" targets are always generated. If the spec contains + 'msvs_external_builder_clcompile_cmd', then the "ClCompile" target will also + be generated, to support building selected C/C++ files. + + Arguments: + spec: The gyp target spec. + Returns: + List of MSBuild 'Target' specs. + """ + build_cmd = _BuildCommandLineForRuleRaw( + spec, spec['msvs_external_builder_build_cmd'], + False, False, False, False) + build_target = ['Target', {'Name': 'Build'}] + build_target.append(['Exec', {'Command': build_cmd}]) + + clean_cmd = _BuildCommandLineForRuleRaw( + spec, spec['msvs_external_builder_clean_cmd'], + False, False, False, False) + clean_target = ['Target', {'Name': 'Clean'}] + clean_target.append(['Exec', {'Command': clean_cmd}]) + + targets = [build_target, clean_target] + + if spec.get('msvs_external_builder_clcompile_cmd'): + clcompile_cmd = _BuildCommandLineForRuleRaw( + spec, spec['msvs_external_builder_clcompile_cmd'], + False, False, False, False) + clcompile_target = ['Target', {'Name': 'ClCompile'}] + clcompile_target.append(['Exec', {'Command': clcompile_cmd}]) + targets.append(clcompile_target) + + return targets + + +def _GetMSBuildExtensions(props_files_of_rules): + extensions = ['ImportGroup', {'Label': 'ExtensionSettings'}] + for props_file in props_files_of_rules: + extensions.append(['Import', {'Project': props_file}]) + return [extensions] + + +def _GetMSBuildExtensionTargets(targets_files_of_rules): + targets_node = ['ImportGroup', {'Label': 'ExtensionTargets'}] + for targets_file in sorted(targets_files_of_rules): + targets_node.append(['Import', {'Project': targets_file}]) + return [targets_node] + + +def _GenerateActionsForMSBuild(spec, actions_to_add): + """Add actions accumulated into an actions_to_add, merging as needed. + + Arguments: + spec: the target project dict + actions_to_add: dictionary keyed on input name, which maps to a list of + dicts describing the actions attached to that input file. + + Returns: + A pair of (action specification, the sources handled by this action). + """ + sources_handled_by_action = OrderedSet() + actions_spec = [] + for primary_input, actions in actions_to_add.iteritems(): + inputs = OrderedSet() + outputs = OrderedSet() + descriptions = [] + commands = [] + for action in actions: + inputs.update(OrderedSet(action['inputs'])) + outputs.update(OrderedSet(action['outputs'])) + descriptions.append(action['description']) + cmd = action['command'] + # For most actions, add 'call' so that actions that invoke batch files + # return and continue executing. msbuild_use_call provides a way to + # disable this but I have not seen any adverse effect from doing that + # for everything. + if action.get('msbuild_use_call', True): + cmd = 'call ' + cmd + commands.append(cmd) + # Add the custom build action for one input file. + description = ', and also '.join(descriptions) + + # We can't join the commands simply with && because the command line will + # get too long. See also _AddActions: cygwin's setup_env mustn't be called + # for every invocation or the command that sets the PATH will grow too + # long. + command = '\r\n'.join([c + '\r\nif %errorlevel% neq 0 exit /b %errorlevel%' + for c in commands]) + _AddMSBuildAction(spec, + primary_input, + inputs, + outputs, + command, + description, + sources_handled_by_action, + actions_spec) + return actions_spec, sources_handled_by_action + + +def _AddMSBuildAction(spec, primary_input, inputs, outputs, cmd, description, + sources_handled_by_action, actions_spec): + command = MSVSSettings.ConvertVCMacrosToMSBuild(cmd) + primary_input = _FixPath(primary_input) + inputs_array = _FixPaths(inputs) + outputs_array = _FixPaths(outputs) + additional_inputs = ';'.join([i for i in inputs_array + if i != primary_input]) + outputs = ';'.join(outputs_array) + sources_handled_by_action.add(primary_input) + action_spec = ['CustomBuild', {'Include': primary_input}] + action_spec.extend( + # TODO(jeanluc) 'Document' for all or just if as_sources? + [['FileType', 'Document'], + ['Command', command], + ['Message', description], + ['Outputs', outputs] + ]) + if additional_inputs: + action_spec.append(['AdditionalInputs', additional_inputs]) + actions_spec.append(action_spec) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.pyc b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.pyc new file mode 100644 index 00000000..e810bd3d Binary files /dev/null and b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.pyc differ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs_test.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs_test.py new file mode 100644 index 00000000..c0b021df --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs_test.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python +# Copyright (c) 2012 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +""" Unit tests for the msvs.py file. """ + +import gyp.generator.msvs as msvs +import unittest +import StringIO + + +class TestSequenceFunctions(unittest.TestCase): + + def setUp(self): + self.stderr = StringIO.StringIO() + + def test_GetLibraries(self): + self.assertEqual( + msvs._GetLibraries({}), + []) + self.assertEqual( + msvs._GetLibraries({'libraries': []}), + []) + self.assertEqual( + msvs._GetLibraries({'other':'foo', 'libraries': ['a.lib']}), + ['a.lib']) + self.assertEqual( + msvs._GetLibraries({'libraries': ['-la']}), + ['a.lib']) + self.assertEqual( + msvs._GetLibraries({'libraries': ['a.lib', 'b.lib', 'c.lib', '-lb.lib', + '-lb.lib', 'd.lib', 'a.lib']}), + ['c.lib', 'b.lib', 'd.lib', 'a.lib']) + +if __name__ == '__main__': + unittest.main() diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py new file mode 100644 index 00000000..841067ed --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py @@ -0,0 +1,2410 @@ +# Copyright (c) 2013 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import collections +import copy +import hashlib +import json +import multiprocessing +import os.path +import re +import signal +import subprocess +import sys +import gyp +import gyp.common +from gyp.common import OrderedSet +import gyp.msvs_emulation +import gyp.MSVSUtil as MSVSUtil +import gyp.xcode_emulation +from cStringIO import StringIO + +from gyp.common import GetEnvironFallback +import gyp.ninja_syntax as ninja_syntax + +generator_default_variables = { + 'EXECUTABLE_PREFIX': '', + 'EXECUTABLE_SUFFIX': '', + 'STATIC_LIB_PREFIX': 'lib', + 'STATIC_LIB_SUFFIX': '.a', + 'SHARED_LIB_PREFIX': 'lib', + + # Gyp expects the following variables to be expandable by the build + # system to the appropriate locations. Ninja prefers paths to be + # known at gyp time. To resolve this, introduce special + # variables starting with $! and $| (which begin with a $ so gyp knows it + # should be treated specially, but is otherwise an invalid + # ninja/shell variable) that are passed to gyp here but expanded + # before writing out into the target .ninja files; see + # ExpandSpecial. + # $! is used for variables that represent a path and that can only appear at + # the start of a string, while $| is used for variables that can appear + # anywhere in a string. + 'INTERMEDIATE_DIR': '$!INTERMEDIATE_DIR', + 'SHARED_INTERMEDIATE_DIR': '$!PRODUCT_DIR/gen', + 'PRODUCT_DIR': '$!PRODUCT_DIR', + 'CONFIGURATION_NAME': '$|CONFIGURATION_NAME', + + # Special variables that may be used by gyp 'rule' targets. + # We generate definitions for these variables on the fly when processing a + # rule. + 'RULE_INPUT_ROOT': '${root}', + 'RULE_INPUT_DIRNAME': '${dirname}', + 'RULE_INPUT_PATH': '${source}', + 'RULE_INPUT_EXT': '${ext}', + 'RULE_INPUT_NAME': '${name}', +} + +# Placates pylint. +generator_additional_non_configuration_keys = [] +generator_additional_path_sections = [] +generator_extra_sources_for_rules = [] +generator_filelist_paths = None + +generator_supports_multiple_toolsets = gyp.common.CrossCompileRequested() + +def StripPrefix(arg, prefix): + if arg.startswith(prefix): + return arg[len(prefix):] + return arg + + +def QuoteShellArgument(arg, flavor): + """Quote a string such that it will be interpreted as a single argument + by the shell.""" + # Rather than attempting to enumerate the bad shell characters, just + # whitelist common OK ones and quote anything else. + if re.match(r'^[a-zA-Z0-9_=.\\/-]+$', arg): + return arg # No quoting necessary. + if flavor == 'win': + return gyp.msvs_emulation.QuoteForRspFile(arg) + return "'" + arg.replace("'", "'" + '"\'"' + "'") + "'" + + +def Define(d, flavor): + """Takes a preprocessor define and returns a -D parameter that's ninja- and + shell-escaped.""" + if flavor == 'win': + # cl.exe replaces literal # characters with = in preprocesor definitions for + # some reason. Octal-encode to work around that. + d = d.replace('#', '\\%03o' % ord('#')) + return QuoteShellArgument(ninja_syntax.escape('-D' + d), flavor) + + +def AddArch(output, arch): + """Adds an arch string to an output path.""" + output, extension = os.path.splitext(output) + return '%s.%s%s' % (output, arch, extension) + + +class Target(object): + """Target represents the paths used within a single gyp target. + + Conceptually, building a single target A is a series of steps: + + 1) actions/rules/copies generates source/resources/etc. + 2) compiles generates .o files + 3) link generates a binary (library/executable) + 4) bundle merges the above in a mac bundle + + (Any of these steps can be optional.) + + From a build ordering perspective, a dependent target B could just + depend on the last output of this series of steps. + + But some dependent commands sometimes need to reach inside the box. + For example, when linking B it needs to get the path to the static + library generated by A. + + This object stores those paths. To keep things simple, member + variables only store concrete paths to single files, while methods + compute derived values like "the last output of the target". + """ + def __init__(self, type): + # Gyp type ("static_library", etc.) of this target. + self.type = type + # File representing whether any input dependencies necessary for + # dependent actions have completed. + self.preaction_stamp = None + # File representing whether any input dependencies necessary for + # dependent compiles have completed. + self.precompile_stamp = None + # File representing the completion of actions/rules/copies, if any. + self.actions_stamp = None + # Path to the output of the link step, if any. + self.binary = None + # Path to the file representing the completion of building the bundle, + # if any. + self.bundle = None + # On Windows, incremental linking requires linking against all the .objs + # that compose a .lib (rather than the .lib itself). That list is stored + # here. In this case, we also need to save the compile_deps for the target, + # so that the the target that directly depends on the .objs can also depend + # on those. + self.component_objs = None + self.compile_deps = None + # Windows only. The import .lib is the output of a build step, but + # because dependents only link against the lib (not both the lib and the + # dll) we keep track of the import library here. + self.import_lib = None + + def Linkable(self): + """Return true if this is a target that can be linked against.""" + return self.type in ('static_library', 'shared_library') + + def UsesToc(self, flavor): + """Return true if the target should produce a restat rule based on a TOC + file.""" + # For bundles, the .TOC should be produced for the binary, not for + # FinalOutput(). But the naive approach would put the TOC file into the + # bundle, so don't do this for bundles for now. + if flavor == 'win' or self.bundle: + return False + return self.type in ('shared_library', 'loadable_module') + + def PreActionInput(self, flavor): + """Return the path, if any, that should be used as a dependency of + any dependent action step.""" + if self.UsesToc(flavor): + return self.FinalOutput() + '.TOC' + return self.FinalOutput() or self.preaction_stamp + + def PreCompileInput(self): + """Return the path, if any, that should be used as a dependency of + any dependent compile step.""" + return self.actions_stamp or self.precompile_stamp + + def FinalOutput(self): + """Return the last output of the target, which depends on all prior + steps.""" + return self.bundle or self.binary or self.actions_stamp + + +# A small discourse on paths as used within the Ninja build: +# All files we produce (both at gyp and at build time) appear in the +# build directory (e.g. out/Debug). +# +# Paths within a given .gyp file are always relative to the directory +# containing the .gyp file. Call these "gyp paths". This includes +# sources as well as the starting directory a given gyp rule/action +# expects to be run from. We call the path from the source root to +# the gyp file the "base directory" within the per-.gyp-file +# NinjaWriter code. +# +# All paths as written into the .ninja files are relative to the build +# directory. Call these paths "ninja paths". +# +# We translate between these two notions of paths with two helper +# functions: +# +# - GypPathToNinja translates a gyp path (i.e. relative to the .gyp file) +# into the equivalent ninja path. +# +# - GypPathToUniqueOutput translates a gyp path into a ninja path to write +# an output file; the result can be namespaced such that it is unique +# to the input file name as well as the output target name. + +class NinjaWriter(object): + def __init__(self, hash_for_rules, target_outputs, base_dir, build_dir, + output_file, toplevel_build, output_file_name, flavor, + toplevel_dir=None): + """ + base_dir: path from source root to directory containing this gyp file, + by gyp semantics, all input paths are relative to this + build_dir: path from source root to build output + toplevel_dir: path to the toplevel directory + """ + + self.hash_for_rules = hash_for_rules + self.target_outputs = target_outputs + self.base_dir = base_dir + self.build_dir = build_dir + self.ninja = ninja_syntax.Writer(output_file) + self.toplevel_build = toplevel_build + self.output_file_name = output_file_name + + self.flavor = flavor + self.abs_build_dir = None + if toplevel_dir is not None: + self.abs_build_dir = os.path.abspath(os.path.join(toplevel_dir, + build_dir)) + self.obj_ext = '.obj' if flavor == 'win' else '.o' + if flavor == 'win': + # See docstring of msvs_emulation.GenerateEnvironmentFiles(). + self.win_env = {} + for arch in ('x86', 'x64'): + self.win_env[arch] = 'environment.' + arch + + # Relative path from build output dir to base dir. + build_to_top = gyp.common.InvertRelativePath(build_dir, toplevel_dir) + self.build_to_base = os.path.join(build_to_top, base_dir) + # Relative path from base dir to build dir. + base_to_top = gyp.common.InvertRelativePath(base_dir, toplevel_dir) + self.base_to_build = os.path.join(base_to_top, build_dir) + + def ExpandSpecial(self, path, product_dir=None): + """Expand specials like $!PRODUCT_DIR in |path|. + + If |product_dir| is None, assumes the cwd is already the product + dir. Otherwise, |product_dir| is the relative path to the product + dir. + """ + + PRODUCT_DIR = '$!PRODUCT_DIR' + if PRODUCT_DIR in path: + if product_dir: + path = path.replace(PRODUCT_DIR, product_dir) + else: + path = path.replace(PRODUCT_DIR + '/', '') + path = path.replace(PRODUCT_DIR + '\\', '') + path = path.replace(PRODUCT_DIR, '.') + + INTERMEDIATE_DIR = '$!INTERMEDIATE_DIR' + if INTERMEDIATE_DIR in path: + int_dir = self.GypPathToUniqueOutput('gen') + # GypPathToUniqueOutput generates a path relative to the product dir, + # so insert product_dir in front if it is provided. + path = path.replace(INTERMEDIATE_DIR, + os.path.join(product_dir or '', int_dir)) + + CONFIGURATION_NAME = '$|CONFIGURATION_NAME' + path = path.replace(CONFIGURATION_NAME, self.config_name) + + return path + + def ExpandRuleVariables(self, path, root, dirname, source, ext, name): + if self.flavor == 'win': + path = self.msvs_settings.ConvertVSMacros( + path, config=self.config_name) + path = path.replace(generator_default_variables['RULE_INPUT_ROOT'], root) + path = path.replace(generator_default_variables['RULE_INPUT_DIRNAME'], + dirname) + path = path.replace(generator_default_variables['RULE_INPUT_PATH'], source) + path = path.replace(generator_default_variables['RULE_INPUT_EXT'], ext) + path = path.replace(generator_default_variables['RULE_INPUT_NAME'], name) + return path + + def GypPathToNinja(self, path, env=None): + """Translate a gyp path to a ninja path, optionally expanding environment + variable references in |path| with |env|. + + See the above discourse on path conversions.""" + if env: + if self.flavor == 'mac': + path = gyp.xcode_emulation.ExpandEnvVars(path, env) + elif self.flavor == 'win': + path = gyp.msvs_emulation.ExpandMacros(path, env) + if path.startswith('$!'): + expanded = self.ExpandSpecial(path) + if self.flavor == 'win': + expanded = os.path.normpath(expanded) + return expanded + if '$|' in path: + path = self.ExpandSpecial(path) + assert '$' not in path, path + return os.path.normpath(os.path.join(self.build_to_base, path)) + + def GypPathToUniqueOutput(self, path, qualified=True): + """Translate a gyp path to a ninja path for writing output. + + If qualified is True, qualify the resulting filename with the name + of the target. This is necessary when e.g. compiling the same + path twice for two separate output targets. + + See the above discourse on path conversions.""" + + path = self.ExpandSpecial(path) + assert not path.startswith('$'), path + + # Translate the path following this scheme: + # Input: foo/bar.gyp, target targ, references baz/out.o + # Output: obj/foo/baz/targ.out.o (if qualified) + # obj/foo/baz/out.o (otherwise) + # (and obj.host instead of obj for cross-compiles) + # + # Why this scheme and not some other one? + # 1) for a given input, you can compute all derived outputs by matching + # its path, even if the input is brought via a gyp file with '..'. + # 2) simple files like libraries and stamps have a simple filename. + + obj = 'obj' + if self.toolset != 'target': + obj += '.' + self.toolset + + path_dir, path_basename = os.path.split(path) + assert not os.path.isabs(path_dir), ( + "'%s' can not be absolute path (see crbug.com/462153)." % path_dir) + + if qualified: + path_basename = self.name + '.' + path_basename + return os.path.normpath(os.path.join(obj, self.base_dir, path_dir, + path_basename)) + + def WriteCollapsedDependencies(self, name, targets, order_only=None): + """Given a list of targets, return a path for a single file + representing the result of building all the targets or None. + + Uses a stamp file if necessary.""" + + assert targets == filter(None, targets), targets + if len(targets) == 0: + assert not order_only + return None + if len(targets) > 1 or order_only: + stamp = self.GypPathToUniqueOutput(name + '.stamp') + targets = self.ninja.build(stamp, 'stamp', targets, order_only=order_only) + self.ninja.newline() + return targets[0] + + def _SubninjaNameForArch(self, arch): + output_file_base = os.path.splitext(self.output_file_name)[0] + return '%s.%s.ninja' % (output_file_base, arch) + + def WriteSpec(self, spec, config_name, generator_flags): + """The main entry point for NinjaWriter: write the build rules for a spec. + + Returns a Target object, which represents the output paths for this spec. + Returns None if there are no outputs (e.g. a settings-only 'none' type + target).""" + + self.config_name = config_name + self.name = spec['target_name'] + self.toolset = spec['toolset'] + config = spec['configurations'][config_name] + self.target = Target(spec['type']) + self.is_standalone_static_library = bool( + spec.get('standalone_static_library', 0)) + # Track if this target contains any C++ files, to decide if gcc or g++ + # should be used for linking. + self.uses_cpp = False + + self.is_mac_bundle = gyp.xcode_emulation.IsMacBundle(self.flavor, spec) + self.xcode_settings = self.msvs_settings = None + if self.flavor == 'mac': + self.xcode_settings = gyp.xcode_emulation.XcodeSettings(spec) + if self.flavor == 'win': + self.msvs_settings = gyp.msvs_emulation.MsvsSettings(spec, + generator_flags) + arch = self.msvs_settings.GetArch(config_name) + self.ninja.variable('arch', self.win_env[arch]) + self.ninja.variable('cc', '$cl_' + arch) + self.ninja.variable('cxx', '$cl_' + arch) + self.ninja.variable('cc_host', '$cl_' + arch) + self.ninja.variable('cxx_host', '$cl_' + arch) + self.ninja.variable('asm', '$ml_' + arch) + + if self.flavor == 'mac': + self.archs = self.xcode_settings.GetActiveArchs(config_name) + if len(self.archs) > 1: + self.arch_subninjas = dict( + (arch, ninja_syntax.Writer( + OpenOutput(os.path.join(self.toplevel_build, + self._SubninjaNameForArch(arch)), + 'w'))) + for arch in self.archs) + + # Compute predepends for all rules. + # actions_depends is the dependencies this target depends on before running + # any of its action/rule/copy steps. + # compile_depends is the dependencies this target depends on before running + # any of its compile steps. + actions_depends = [] + compile_depends = [] + # TODO(evan): it is rather confusing which things are lists and which + # are strings. Fix these. + if 'dependencies' in spec: + for dep in spec['dependencies']: + if dep in self.target_outputs: + target = self.target_outputs[dep] + actions_depends.append(target.PreActionInput(self.flavor)) + compile_depends.append(target.PreCompileInput()) + actions_depends = filter(None, actions_depends) + compile_depends = filter(None, compile_depends) + actions_depends = self.WriteCollapsedDependencies('actions_depends', + actions_depends) + compile_depends = self.WriteCollapsedDependencies('compile_depends', + compile_depends) + self.target.preaction_stamp = actions_depends + self.target.precompile_stamp = compile_depends + + # Write out actions, rules, and copies. These must happen before we + # compile any sources, so compute a list of predependencies for sources + # while we do it. + extra_sources = [] + mac_bundle_depends = [] + self.target.actions_stamp = self.WriteActionsRulesCopies( + spec, extra_sources, actions_depends, mac_bundle_depends) + + # If we have actions/rules/copies, we depend directly on those, but + # otherwise we depend on dependent target's actions/rules/copies etc. + # We never need to explicitly depend on previous target's link steps, + # because no compile ever depends on them. + compile_depends_stamp = (self.target.actions_stamp or compile_depends) + + # Write out the compilation steps, if any. + link_deps = [] + sources = extra_sources + spec.get('sources', []) + if sources: + if self.flavor == 'mac' and len(self.archs) > 1: + # Write subninja file containing compile and link commands scoped to + # a single arch if a fat binary is being built. + for arch in self.archs: + self.ninja.subninja(self._SubninjaNameForArch(arch)) + + pch = None + if self.flavor == 'win': + gyp.msvs_emulation.VerifyMissingSources( + sources, self.abs_build_dir, generator_flags, self.GypPathToNinja) + pch = gyp.msvs_emulation.PrecompiledHeader( + self.msvs_settings, config_name, self.GypPathToNinja, + self.GypPathToUniqueOutput, self.obj_ext) + else: + pch = gyp.xcode_emulation.MacPrefixHeader( + self.xcode_settings, self.GypPathToNinja, + lambda path, lang: self.GypPathToUniqueOutput(path + '-' + lang)) + link_deps = self.WriteSources( + self.ninja, config_name, config, sources, compile_depends_stamp, pch, + spec) + # Some actions/rules output 'sources' that are already object files. + obj_outputs = [f for f in sources if f.endswith(self.obj_ext)] + if obj_outputs: + if self.flavor != 'mac' or len(self.archs) == 1: + link_deps += [self.GypPathToNinja(o) for o in obj_outputs] + else: + print "Warning: Actions/rules writing object files don't work with " \ + "multiarch targets, dropping. (target %s)" % spec['target_name'] + elif self.flavor == 'mac' and len(self.archs) > 1: + link_deps = collections.defaultdict(list) + + compile_deps = self.target.actions_stamp or actions_depends + if self.flavor == 'win' and self.target.type == 'static_library': + self.target.component_objs = link_deps + self.target.compile_deps = compile_deps + + # Write out a link step, if needed. + output = None + is_empty_bundle = not link_deps and not mac_bundle_depends + if link_deps or self.target.actions_stamp or actions_depends: + output = self.WriteTarget(spec, config_name, config, link_deps, + compile_deps) + if self.is_mac_bundle: + mac_bundle_depends.append(output) + + # Bundle all of the above together, if needed. + if self.is_mac_bundle: + output = self.WriteMacBundle(spec, mac_bundle_depends, is_empty_bundle) + + if not output: + return None + + assert self.target.FinalOutput(), output + return self.target + + def _WinIdlRule(self, source, prebuild, outputs): + """Handle the implicit VS .idl rule for one source file. Fills |outputs| + with files that are generated.""" + outdir, output, vars, flags = self.msvs_settings.GetIdlBuildData( + source, self.config_name) + outdir = self.GypPathToNinja(outdir) + def fix_path(path, rel=None): + path = os.path.join(outdir, path) + dirname, basename = os.path.split(source) + root, ext = os.path.splitext(basename) + path = self.ExpandRuleVariables( + path, root, dirname, source, ext, basename) + if rel: + path = os.path.relpath(path, rel) + return path + vars = [(name, fix_path(value, outdir)) for name, value in vars] + output = [fix_path(p) for p in output] + vars.append(('outdir', outdir)) + vars.append(('idlflags', flags)) + input = self.GypPathToNinja(source) + self.ninja.build(output, 'idl', input, + variables=vars, order_only=prebuild) + outputs.extend(output) + + def WriteWinIdlFiles(self, spec, prebuild): + """Writes rules to match MSVS's implicit idl handling.""" + assert self.flavor == 'win' + if self.msvs_settings.HasExplicitIdlRulesOrActions(spec): + return [] + outputs = [] + for source in filter(lambda x: x.endswith('.idl'), spec['sources']): + self._WinIdlRule(source, prebuild, outputs) + return outputs + + def WriteActionsRulesCopies(self, spec, extra_sources, prebuild, + mac_bundle_depends): + """Write out the Actions, Rules, and Copies steps. Return a path + representing the outputs of these steps.""" + outputs = [] + if self.is_mac_bundle: + mac_bundle_resources = spec.get('mac_bundle_resources', [])[:] + else: + mac_bundle_resources = [] + extra_mac_bundle_resources = [] + + if 'actions' in spec: + outputs += self.WriteActions(spec['actions'], extra_sources, prebuild, + extra_mac_bundle_resources) + if 'rules' in spec: + outputs += self.WriteRules(spec['rules'], extra_sources, prebuild, + mac_bundle_resources, + extra_mac_bundle_resources) + if 'copies' in spec: + outputs += self.WriteCopies(spec['copies'], prebuild, mac_bundle_depends) + + if 'sources' in spec and self.flavor == 'win': + outputs += self.WriteWinIdlFiles(spec, prebuild) + + stamp = self.WriteCollapsedDependencies('actions_rules_copies', outputs) + + if self.is_mac_bundle: + xcassets = self.WriteMacBundleResources( + extra_mac_bundle_resources + mac_bundle_resources, mac_bundle_depends) + partial_info_plist = self.WriteMacXCassets(xcassets, mac_bundle_depends) + self.WriteMacInfoPlist(partial_info_plist, mac_bundle_depends) + + return stamp + + def GenerateDescription(self, verb, message, fallback): + """Generate and return a description of a build step. + + |verb| is the short summary, e.g. ACTION or RULE. + |message| is a hand-written description, or None if not available. + |fallback| is the gyp-level name of the step, usable as a fallback. + """ + if self.toolset != 'target': + verb += '(%s)' % self.toolset + if message: + return '%s %s' % (verb, self.ExpandSpecial(message)) + else: + return '%s %s: %s' % (verb, self.name, fallback) + + def WriteActions(self, actions, extra_sources, prebuild, + extra_mac_bundle_resources): + # Actions cd into the base directory. + env = self.GetToolchainEnv() + all_outputs = [] + for action in actions: + # First write out a rule for the action. + name = '%s_%s' % (action['action_name'], self.hash_for_rules) + description = self.GenerateDescription('ACTION', + action.get('message', None), + name) + is_cygwin = (self.msvs_settings.IsRuleRunUnderCygwin(action) + if self.flavor == 'win' else False) + args = action['action'] + depfile = action.get('depfile', None) + if depfile: + depfile = self.ExpandSpecial(depfile, self.base_to_build) + pool = 'console' if int(action.get('ninja_use_console', 0)) else None + rule_name, _ = self.WriteNewNinjaRule(name, args, description, + is_cygwin, env, pool, + depfile=depfile) + + inputs = [self.GypPathToNinja(i, env) for i in action['inputs']] + if int(action.get('process_outputs_as_sources', False)): + extra_sources += action['outputs'] + if int(action.get('process_outputs_as_mac_bundle_resources', False)): + extra_mac_bundle_resources += action['outputs'] + outputs = [self.GypPathToNinja(o, env) for o in action['outputs']] + + # Then write out an edge using the rule. + self.ninja.build(outputs, rule_name, inputs, + order_only=prebuild) + all_outputs += outputs + + self.ninja.newline() + + return all_outputs + + def WriteRules(self, rules, extra_sources, prebuild, + mac_bundle_resources, extra_mac_bundle_resources): + env = self.GetToolchainEnv() + all_outputs = [] + for rule in rules: + # Skip a rule with no action and no inputs. + if 'action' not in rule and not rule.get('rule_sources', []): + continue + + # First write out a rule for the rule action. + name = '%s_%s' % (rule['rule_name'], self.hash_for_rules) + + args = rule['action'] + description = self.GenerateDescription( + 'RULE', + rule.get('message', None), + ('%s ' + generator_default_variables['RULE_INPUT_PATH']) % name) + is_cygwin = (self.msvs_settings.IsRuleRunUnderCygwin(rule) + if self.flavor == 'win' else False) + pool = 'console' if int(rule.get('ninja_use_console', 0)) else None + rule_name, args = self.WriteNewNinjaRule( + name, args, description, is_cygwin, env, pool) + + # TODO: if the command references the outputs directly, we should + # simplify it to just use $out. + + # Rules can potentially make use of some special variables which + # must vary per source file. + # Compute the list of variables we'll need to provide. + special_locals = ('source', 'root', 'dirname', 'ext', 'name') + needed_variables = set(['source']) + for argument in args: + for var in special_locals: + if '${%s}' % var in argument: + needed_variables.add(var) + + def cygwin_munge(path): + # pylint: disable=cell-var-from-loop + if is_cygwin: + return path.replace('\\', '/') + return path + + inputs = [self.GypPathToNinja(i, env) for i in rule.get('inputs', [])] + + # If there are n source files matching the rule, and m additional rule + # inputs, then adding 'inputs' to each build edge written below will + # write m * n inputs. Collapsing reduces this to m + n. + sources = rule.get('rule_sources', []) + num_inputs = len(inputs) + if prebuild: + num_inputs += 1 + if num_inputs > 2 and len(sources) > 2: + inputs = [self.WriteCollapsedDependencies( + rule['rule_name'], inputs, order_only=prebuild)] + prebuild = [] + + # For each source file, write an edge that generates all the outputs. + for source in sources: + source = os.path.normpath(source) + dirname, basename = os.path.split(source) + root, ext = os.path.splitext(basename) + + # Gather the list of inputs and outputs, expanding $vars if possible. + outputs = [self.ExpandRuleVariables(o, root, dirname, + source, ext, basename) + for o in rule['outputs']] + + if int(rule.get('process_outputs_as_sources', False)): + extra_sources += outputs + + was_mac_bundle_resource = source in mac_bundle_resources + if was_mac_bundle_resource or \ + int(rule.get('process_outputs_as_mac_bundle_resources', False)): + extra_mac_bundle_resources += outputs + # Note: This is n_resources * n_outputs_in_rule. Put to-be-removed + # items in a set and remove them all in a single pass if this becomes + # a performance issue. + if was_mac_bundle_resource: + mac_bundle_resources.remove(source) + + extra_bindings = [] + for var in needed_variables: + if var == 'root': + extra_bindings.append(('root', cygwin_munge(root))) + elif var == 'dirname': + # '$dirname' is a parameter to the rule action, which means + # it shouldn't be converted to a Ninja path. But we don't + # want $!PRODUCT_DIR in there either. + dirname_expanded = self.ExpandSpecial(dirname, self.base_to_build) + extra_bindings.append(('dirname', cygwin_munge(dirname_expanded))) + elif var == 'source': + # '$source' is a parameter to the rule action, which means + # it shouldn't be converted to a Ninja path. But we don't + # want $!PRODUCT_DIR in there either. + source_expanded = self.ExpandSpecial(source, self.base_to_build) + extra_bindings.append(('source', cygwin_munge(source_expanded))) + elif var == 'ext': + extra_bindings.append(('ext', ext)) + elif var == 'name': + extra_bindings.append(('name', cygwin_munge(basename))) + else: + assert var == None, repr(var) + + outputs = [self.GypPathToNinja(o, env) for o in outputs] + if self.flavor == 'win': + # WriteNewNinjaRule uses unique_name for creating an rsp file on win. + extra_bindings.append(('unique_name', + hashlib.md5(outputs[0]).hexdigest())) + self.ninja.build(outputs, rule_name, self.GypPathToNinja(source), + implicit=inputs, + order_only=prebuild, + variables=extra_bindings) + + all_outputs.extend(outputs) + + return all_outputs + + def WriteCopies(self, copies, prebuild, mac_bundle_depends): + outputs = [] + env = self.GetToolchainEnv() + for copy in copies: + for path in copy['files']: + # Normalize the path so trailing slashes don't confuse us. + path = os.path.normpath(path) + basename = os.path.split(path)[1] + src = self.GypPathToNinja(path, env) + dst = self.GypPathToNinja(os.path.join(copy['destination'], basename), + env) + outputs += self.ninja.build(dst, 'copy', src, order_only=prebuild) + if self.is_mac_bundle: + # gyp has mac_bundle_resources to copy things into a bundle's + # Resources folder, but there's no built-in way to copy files to other + # places in the bundle. Hence, some targets use copies for this. Check + # if this file is copied into the current bundle, and if so add it to + # the bundle depends so that dependent targets get rebuilt if the copy + # input changes. + if dst.startswith(self.xcode_settings.GetBundleContentsFolderPath()): + mac_bundle_depends.append(dst) + + return outputs + + def WriteMacBundleResources(self, resources, bundle_depends): + """Writes ninja edges for 'mac_bundle_resources'.""" + xcassets = [] + for output, res in gyp.xcode_emulation.GetMacBundleResources( + generator_default_variables['PRODUCT_DIR'], + self.xcode_settings, map(self.GypPathToNinja, resources)): + output = self.ExpandSpecial(output) + if os.path.splitext(output)[-1] != '.xcassets': + isBinary = self.xcode_settings.IsBinaryOutputFormat(self.config_name) + self.ninja.build(output, 'mac_tool', res, + variables=[('mactool_cmd', 'copy-bundle-resource'), \ + ('binary', isBinary)]) + bundle_depends.append(output) + else: + xcassets.append(res) + return xcassets + + def WriteMacXCassets(self, xcassets, bundle_depends): + """Writes ninja edges for 'mac_bundle_resources' .xcassets files. + + This add an invocation of 'actool' via the 'mac_tool.py' helper script. + It assumes that the assets catalogs define at least one imageset and + thus an Assets.car file will be generated in the application resources + directory. If this is not the case, then the build will probably be done + at each invocation of ninja.""" + if not xcassets: + return + + extra_arguments = {} + settings_to_arg = { + 'XCASSETS_APP_ICON': 'app-icon', + 'XCASSETS_LAUNCH_IMAGE': 'launch-image', + } + settings = self.xcode_settings.xcode_settings[self.config_name] + for settings_key, arg_name in settings_to_arg.iteritems(): + value = settings.get(settings_key) + if value: + extra_arguments[arg_name] = value + + partial_info_plist = None + if extra_arguments: + partial_info_plist = self.GypPathToUniqueOutput( + 'assetcatalog_generated_info.plist') + extra_arguments['output-partial-info-plist'] = partial_info_plist + + outputs = [] + outputs.append( + os.path.join( + self.xcode_settings.GetBundleResourceFolder(), + 'Assets.car')) + if partial_info_plist: + outputs.append(partial_info_plist) + + keys = QuoteShellArgument(json.dumps(extra_arguments), self.flavor) + extra_env = self.xcode_settings.GetPerTargetSettings() + env = self.GetSortedXcodeEnv(additional_settings=extra_env) + env = self.ComputeExportEnvString(env) + + bundle_depends.extend(self.ninja.build( + outputs, 'compile_xcassets', xcassets, + variables=[('env', env), ('keys', keys)])) + return partial_info_plist + + def WriteMacInfoPlist(self, partial_info_plist, bundle_depends): + """Write build rules for bundle Info.plist files.""" + info_plist, out, defines, extra_env = gyp.xcode_emulation.GetMacInfoPlist( + generator_default_variables['PRODUCT_DIR'], + self.xcode_settings, self.GypPathToNinja) + if not info_plist: + return + out = self.ExpandSpecial(out) + if defines: + # Create an intermediate file to store preprocessed results. + intermediate_plist = self.GypPathToUniqueOutput( + os.path.basename(info_plist)) + defines = ' '.join([Define(d, self.flavor) for d in defines]) + info_plist = self.ninja.build( + intermediate_plist, 'preprocess_infoplist', info_plist, + variables=[('defines',defines)]) + + env = self.GetSortedXcodeEnv(additional_settings=extra_env) + env = self.ComputeExportEnvString(env) + + if partial_info_plist: + intermediate_plist = self.GypPathToUniqueOutput('merged_info.plist') + info_plist = self.ninja.build( + intermediate_plist, 'merge_infoplist', + [partial_info_plist, info_plist]) + + keys = self.xcode_settings.GetExtraPlistItems(self.config_name) + keys = QuoteShellArgument(json.dumps(keys), self.flavor) + isBinary = self.xcode_settings.IsBinaryOutputFormat(self.config_name) + self.ninja.build(out, 'copy_infoplist', info_plist, + variables=[('env', env), ('keys', keys), + ('binary', isBinary)]) + bundle_depends.append(out) + + def WriteSources(self, ninja_file, config_name, config, sources, predepends, + precompiled_header, spec): + """Write build rules to compile all of |sources|.""" + if self.toolset == 'host': + self.ninja.variable('ar', '$ar_host') + self.ninja.variable('cc', '$cc_host') + self.ninja.variable('cxx', '$cxx_host') + self.ninja.variable('ld', '$ld_host') + self.ninja.variable('ldxx', '$ldxx_host') + self.ninja.variable('nm', '$nm_host') + self.ninja.variable('readelf', '$readelf_host') + + if self.flavor != 'mac' or len(self.archs) == 1: + return self.WriteSourcesForArch( + self.ninja, config_name, config, sources, predepends, + precompiled_header, spec) + else: + return dict((arch, self.WriteSourcesForArch( + self.arch_subninjas[arch], config_name, config, sources, predepends, + precompiled_header, spec, arch=arch)) + for arch in self.archs) + + def WriteSourcesForArch(self, ninja_file, config_name, config, sources, + predepends, precompiled_header, spec, arch=None): + """Write build rules to compile all of |sources|.""" + + extra_defines = [] + if self.flavor == 'mac': + cflags = self.xcode_settings.GetCflags(config_name, arch=arch) + cflags_c = self.xcode_settings.GetCflagsC(config_name) + cflags_cc = self.xcode_settings.GetCflagsCC(config_name) + cflags_objc = ['$cflags_c'] + \ + self.xcode_settings.GetCflagsObjC(config_name) + cflags_objcc = ['$cflags_cc'] + \ + self.xcode_settings.GetCflagsObjCC(config_name) + elif self.flavor == 'win': + asmflags = self.msvs_settings.GetAsmflags(config_name) + cflags = self.msvs_settings.GetCflags(config_name) + cflags_c = self.msvs_settings.GetCflagsC(config_name) + cflags_cc = self.msvs_settings.GetCflagsCC(config_name) + extra_defines = self.msvs_settings.GetComputedDefines(config_name) + # See comment at cc_command for why there's two .pdb files. + pdbpath_c = pdbpath_cc = self.msvs_settings.GetCompilerPdbName( + config_name, self.ExpandSpecial) + if not pdbpath_c: + obj = 'obj' + if self.toolset != 'target': + obj += '.' + self.toolset + pdbpath = os.path.normpath(os.path.join(obj, self.base_dir, self.name)) + pdbpath_c = pdbpath + '.c.pdb' + pdbpath_cc = pdbpath + '.cc.pdb' + self.WriteVariableList(ninja_file, 'pdbname_c', [pdbpath_c]) + self.WriteVariableList(ninja_file, 'pdbname_cc', [pdbpath_cc]) + self.WriteVariableList(ninja_file, 'pchprefix', [self.name]) + else: + cflags = config.get('cflags', []) + cflags_c = config.get('cflags_c', []) + cflags_cc = config.get('cflags_cc', []) + + # Respect environment variables related to build, but target-specific + # flags can still override them. + if self.toolset == 'target': + cflags_c = (os.environ.get('CPPFLAGS', '').split() + + os.environ.get('CFLAGS', '').split() + cflags_c) + cflags_cc = (os.environ.get('CPPFLAGS', '').split() + + os.environ.get('CXXFLAGS', '').split() + cflags_cc) + elif self.toolset == 'host': + cflags_c = (os.environ.get('CPPFLAGS_host', '').split() + + os.environ.get('CFLAGS_host', '').split() + cflags_c) + cflags_cc = (os.environ.get('CPPFLAGS_host', '').split() + + os.environ.get('CXXFLAGS_host', '').split() + cflags_cc) + + defines = config.get('defines', []) + extra_defines + self.WriteVariableList(ninja_file, 'defines', + [Define(d, self.flavor) for d in defines]) + if self.flavor == 'win': + self.WriteVariableList(ninja_file, 'asmflags', + map(self.ExpandSpecial, asmflags)) + self.WriteVariableList(ninja_file, 'rcflags', + [QuoteShellArgument(self.ExpandSpecial(f), self.flavor) + for f in self.msvs_settings.GetRcflags(config_name, + self.GypPathToNinja)]) + + include_dirs = config.get('include_dirs', []) + + env = self.GetToolchainEnv() + if self.flavor == 'win': + include_dirs = self.msvs_settings.AdjustIncludeDirs(include_dirs, + config_name) + self.WriteVariableList(ninja_file, 'includes', + [QuoteShellArgument('-I' + self.GypPathToNinja(i, env), self.flavor) + for i in include_dirs]) + + if self.flavor == 'win': + midl_include_dirs = config.get('midl_include_dirs', []) + midl_include_dirs = self.msvs_settings.AdjustMidlIncludeDirs( + midl_include_dirs, config_name) + self.WriteVariableList(ninja_file, 'midl_includes', + [QuoteShellArgument('-I' + self.GypPathToNinja(i, env), self.flavor) + for i in midl_include_dirs]) + + pch_commands = precompiled_header.GetPchBuildCommands(arch) + if self.flavor == 'mac': + # Most targets use no precompiled headers, so only write these if needed. + for ext, var in [('c', 'cflags_pch_c'), ('cc', 'cflags_pch_cc'), + ('m', 'cflags_pch_objc'), ('mm', 'cflags_pch_objcc')]: + include = precompiled_header.GetInclude(ext, arch) + if include: ninja_file.variable(var, include) + + arflags = config.get('arflags', []) + + self.WriteVariableList(ninja_file, 'cflags', + map(self.ExpandSpecial, cflags)) + self.WriteVariableList(ninja_file, 'cflags_c', + map(self.ExpandSpecial, cflags_c)) + self.WriteVariableList(ninja_file, 'cflags_cc', + map(self.ExpandSpecial, cflags_cc)) + if self.flavor == 'mac': + self.WriteVariableList(ninja_file, 'cflags_objc', + map(self.ExpandSpecial, cflags_objc)) + self.WriteVariableList(ninja_file, 'cflags_objcc', + map(self.ExpandSpecial, cflags_objcc)) + self.WriteVariableList(ninja_file, 'arflags', + map(self.ExpandSpecial, arflags)) + ninja_file.newline() + outputs = [] + has_rc_source = False + for source in sources: + filename, ext = os.path.splitext(source) + ext = ext[1:] + obj_ext = self.obj_ext + if ext in ('cc', 'cpp', 'cxx'): + command = 'cxx' + self.uses_cpp = True + elif ext == 'c' or (ext == 'S' and self.flavor != 'win'): + command = 'cc' + elif ext == 's' and self.flavor != 'win': # Doesn't generate .o.d files. + command = 'cc_s' + elif (self.flavor == 'win' and ext == 'asm' and + not self.msvs_settings.HasExplicitAsmRules(spec)): + command = 'asm' + # Add the _asm suffix as msvs is capable of handling .cc and + # .asm files of the same name without collision. + obj_ext = '_asm.obj' + elif self.flavor == 'mac' and ext == 'm': + command = 'objc' + elif self.flavor == 'mac' and ext == 'mm': + command = 'objcxx' + self.uses_cpp = True + elif self.flavor == 'win' and ext == 'rc': + command = 'rc' + obj_ext = '.res' + has_rc_source = True + else: + # Ignore unhandled extensions. + continue + input = self.GypPathToNinja(source) + output = self.GypPathToUniqueOutput(filename + obj_ext) + if arch is not None: + output = AddArch(output, arch) + implicit = precompiled_header.GetObjDependencies([input], [output], arch) + variables = [] + if self.flavor == 'win': + variables, output, implicit = precompiled_header.GetFlagsModifications( + input, output, implicit, command, cflags_c, cflags_cc, + self.ExpandSpecial) + ninja_file.build(output, command, input, + implicit=[gch for _, _, gch in implicit], + order_only=predepends, variables=variables) + outputs.append(output) + + if has_rc_source: + resource_include_dirs = config.get('resource_include_dirs', include_dirs) + self.WriteVariableList(ninja_file, 'resource_includes', + [QuoteShellArgument('-I' + self.GypPathToNinja(i, env), self.flavor) + for i in resource_include_dirs]) + + self.WritePchTargets(ninja_file, pch_commands) + + ninja_file.newline() + return outputs + + def WritePchTargets(self, ninja_file, pch_commands): + """Writes ninja rules to compile prefix headers.""" + if not pch_commands: + return + + for gch, lang_flag, lang, input in pch_commands: + var_name = { + 'c': 'cflags_pch_c', + 'cc': 'cflags_pch_cc', + 'm': 'cflags_pch_objc', + 'mm': 'cflags_pch_objcc', + }[lang] + + map = { 'c': 'cc', 'cc': 'cxx', 'm': 'objc', 'mm': 'objcxx', } + cmd = map.get(lang) + ninja_file.build(gch, cmd, input, variables=[(var_name, lang_flag)]) + + def WriteLink(self, spec, config_name, config, link_deps): + """Write out a link step. Fills out target.binary. """ + if self.flavor != 'mac' or len(self.archs) == 1: + return self.WriteLinkForArch( + self.ninja, spec, config_name, config, link_deps) + else: + output = self.ComputeOutput(spec) + inputs = [self.WriteLinkForArch(self.arch_subninjas[arch], spec, + config_name, config, link_deps[arch], + arch=arch) + for arch in self.archs] + extra_bindings = [] + build_output = output + if not self.is_mac_bundle: + self.AppendPostbuildVariable(extra_bindings, spec, output, output) + + # TODO(yyanagisawa): more work needed to fix: + # https://code.google.com/p/gyp/issues/detail?id=411 + if (spec['type'] in ('shared_library', 'loadable_module') and + not self.is_mac_bundle): + extra_bindings.append(('lib', output)) + self.ninja.build([output, output + '.TOC'], 'solipo', inputs, + variables=extra_bindings) + else: + self.ninja.build(build_output, 'lipo', inputs, variables=extra_bindings) + return output + + def WriteLinkForArch(self, ninja_file, spec, config_name, config, + link_deps, arch=None): + """Write out a link step. Fills out target.binary. """ + command = { + 'executable': 'link', + 'loadable_module': 'solink_module', + 'shared_library': 'solink', + }[spec['type']] + command_suffix = '' + + implicit_deps = set() + solibs = set() + order_deps = set() + + if 'dependencies' in spec: + # Two kinds of dependencies: + # - Linkable dependencies (like a .a or a .so): add them to the link line. + # - Non-linkable dependencies (like a rule that generates a file + # and writes a stamp file): add them to implicit_deps + extra_link_deps = set() + for dep in spec['dependencies']: + target = self.target_outputs.get(dep) + if not target: + continue + linkable = target.Linkable() + if linkable: + new_deps = [] + if (self.flavor == 'win' and + target.component_objs and + self.msvs_settings.IsUseLibraryDependencyInputs(config_name)): + new_deps = target.component_objs + if target.compile_deps: + order_deps.add(target.compile_deps) + elif self.flavor == 'win' and target.import_lib: + new_deps = [target.import_lib] + elif target.UsesToc(self.flavor): + solibs.add(target.binary) + implicit_deps.add(target.binary + '.TOC') + else: + new_deps = [target.binary] + for new_dep in new_deps: + if new_dep not in extra_link_deps: + extra_link_deps.add(new_dep) + link_deps.append(new_dep) + + final_output = target.FinalOutput() + if not linkable or final_output != target.binary: + implicit_deps.add(final_output) + + extra_bindings = [] + if self.uses_cpp and self.flavor != 'win': + extra_bindings.append(('ld', '$ldxx')) + + output = self.ComputeOutput(spec, arch) + if arch is None and not self.is_mac_bundle: + self.AppendPostbuildVariable(extra_bindings, spec, output, output) + + is_executable = spec['type'] == 'executable' + # The ldflags config key is not used on mac or win. On those platforms + # linker flags are set via xcode_settings and msvs_settings, respectively. + env_ldflags = os.environ.get('LDFLAGS', '').split() + if self.flavor == 'mac': + ldflags = self.xcode_settings.GetLdflags(config_name, + self.ExpandSpecial(generator_default_variables['PRODUCT_DIR']), + self.GypPathToNinja, arch) + ldflags = env_ldflags + ldflags + elif self.flavor == 'win': + manifest_base_name = self.GypPathToUniqueOutput( + self.ComputeOutputFileName(spec)) + ldflags, intermediate_manifest, manifest_files = \ + self.msvs_settings.GetLdflags(config_name, self.GypPathToNinja, + self.ExpandSpecial, manifest_base_name, + output, is_executable, + self.toplevel_build) + ldflags = env_ldflags + ldflags + self.WriteVariableList(ninja_file, 'manifests', manifest_files) + implicit_deps = implicit_deps.union(manifest_files) + if intermediate_manifest: + self.WriteVariableList( + ninja_file, 'intermediatemanifest', [intermediate_manifest]) + command_suffix = _GetWinLinkRuleNameSuffix( + self.msvs_settings.IsEmbedManifest(config_name)) + def_file = self.msvs_settings.GetDefFile(self.GypPathToNinja) + if def_file: + implicit_deps.add(def_file) + else: + # Respect environment variables related to build, but target-specific + # flags can still override them. + ldflags = env_ldflags + config.get('ldflags', []) + if is_executable and len(solibs): + rpath = 'lib/' + if self.toolset != 'target': + rpath += self.toolset + ldflags.append(r'-Wl,-rpath=\$$ORIGIN/%s' % rpath) + ldflags.append('-Wl,-rpath-link=%s' % rpath) + self.WriteVariableList(ninja_file, 'ldflags', + map(self.ExpandSpecial, ldflags)) + + library_dirs = config.get('library_dirs', []) + if self.flavor == 'win': + library_dirs = [self.msvs_settings.ConvertVSMacros(l, config_name) + for l in library_dirs] + library_dirs = ['/LIBPATH:' + QuoteShellArgument(self.GypPathToNinja(l), + self.flavor) + for l in library_dirs] + else: + library_dirs = [QuoteShellArgument('-L' + self.GypPathToNinja(l), + self.flavor) + for l in library_dirs] + + libraries = gyp.common.uniquer(map(self.ExpandSpecial, + spec.get('libraries', []))) + if self.flavor == 'mac': + libraries = self.xcode_settings.AdjustLibraries(libraries, config_name) + elif self.flavor == 'win': + libraries = self.msvs_settings.AdjustLibraries(libraries) + + self.WriteVariableList(ninja_file, 'libs', library_dirs + libraries) + + linked_binary = output + + if command in ('solink', 'solink_module'): + extra_bindings.append(('soname', os.path.split(output)[1])) + extra_bindings.append(('lib', + gyp.common.EncodePOSIXShellArgument(output))) + if self.flavor != 'win': + link_file_list = output + if self.is_mac_bundle: + # 'Dependency Framework.framework/Versions/A/Dependency Framework' -> + # 'Dependency Framework.framework.rsp' + link_file_list = self.xcode_settings.GetWrapperName() + if arch: + link_file_list += '.' + arch + link_file_list += '.rsp' + # If an rspfile contains spaces, ninja surrounds the filename with + # quotes around it and then passes it to open(), creating a file with + # quotes in its name (and when looking for the rsp file, the name + # makes it through bash which strips the quotes) :-/ + link_file_list = link_file_list.replace(' ', '_') + extra_bindings.append( + ('link_file_list', + gyp.common.EncodePOSIXShellArgument(link_file_list))) + if self.flavor == 'win': + extra_bindings.append(('binary', output)) + if ('/NOENTRY' not in ldflags and + not self.msvs_settings.GetNoImportLibrary(config_name)): + self.target.import_lib = output + '.lib' + extra_bindings.append(('implibflag', + '/IMPLIB:%s' % self.target.import_lib)) + pdbname = self.msvs_settings.GetPDBName( + config_name, self.ExpandSpecial, output + '.pdb') + output = [output, self.target.import_lib] + if pdbname: + output.append(pdbname) + elif not self.is_mac_bundle: + output = [output, output + '.TOC'] + else: + command = command + '_notoc' + elif self.flavor == 'win': + extra_bindings.append(('binary', output)) + pdbname = self.msvs_settings.GetPDBName( + config_name, self.ExpandSpecial, output + '.pdb') + if pdbname: + output = [output, pdbname] + + + if len(solibs): + extra_bindings.append(('solibs', gyp.common.EncodePOSIXShellList(solibs))) + + ninja_file.build(output, command + command_suffix, link_deps, + implicit=list(implicit_deps), + order_only=list(order_deps), + variables=extra_bindings) + return linked_binary + + def WriteTarget(self, spec, config_name, config, link_deps, compile_deps): + extra_link_deps = any(self.target_outputs.get(dep).Linkable() + for dep in spec.get('dependencies', []) + if dep in self.target_outputs) + if spec['type'] == 'none' or (not link_deps and not extra_link_deps): + # TODO(evan): don't call this function for 'none' target types, as + # it doesn't do anything, and we fake out a 'binary' with a stamp file. + self.target.binary = compile_deps + self.target.type = 'none' + elif spec['type'] == 'static_library': + self.target.binary = self.ComputeOutput(spec) + if (self.flavor not in ('mac', 'openbsd', 'netbsd', 'win') and not + self.is_standalone_static_library): + self.ninja.build(self.target.binary, 'alink_thin', link_deps, + order_only=compile_deps) + else: + variables = [] + if self.xcode_settings: + libtool_flags = self.xcode_settings.GetLibtoolflags(config_name) + if libtool_flags: + variables.append(('libtool_flags', libtool_flags)) + if self.msvs_settings: + libflags = self.msvs_settings.GetLibFlags(config_name, + self.GypPathToNinja) + variables.append(('libflags', libflags)) + + if self.flavor != 'mac' or len(self.archs) == 1: + self.AppendPostbuildVariable(variables, spec, + self.target.binary, self.target.binary) + self.ninja.build(self.target.binary, 'alink', link_deps, + order_only=compile_deps, variables=variables) + else: + inputs = [] + for arch in self.archs: + output = self.ComputeOutput(spec, arch) + self.arch_subninjas[arch].build(output, 'alink', link_deps[arch], + order_only=compile_deps, + variables=variables) + inputs.append(output) + # TODO: It's not clear if libtool_flags should be passed to the alink + # call that combines single-arch .a files into a fat .a file. + self.AppendPostbuildVariable(variables, spec, + self.target.binary, self.target.binary) + self.ninja.build(self.target.binary, 'alink', inputs, + # FIXME: test proving order_only=compile_deps isn't + # needed. + variables=variables) + else: + self.target.binary = self.WriteLink(spec, config_name, config, link_deps) + return self.target.binary + + def WriteMacBundle(self, spec, mac_bundle_depends, is_empty): + assert self.is_mac_bundle + package_framework = spec['type'] in ('shared_library', 'loadable_module') + output = self.ComputeMacBundleOutput() + if is_empty: + output += '.stamp' + variables = [] + self.AppendPostbuildVariable(variables, spec, output, self.target.binary, + is_command_start=not package_framework) + if package_framework and not is_empty: + variables.append(('version', self.xcode_settings.GetFrameworkVersion())) + self.ninja.build(output, 'package_framework', mac_bundle_depends, + variables=variables) + else: + self.ninja.build(output, 'stamp', mac_bundle_depends, + variables=variables) + self.target.bundle = output + return output + + def GetToolchainEnv(self, additional_settings=None): + """Returns the variables toolchain would set for build steps.""" + env = self.GetSortedXcodeEnv(additional_settings=additional_settings) + if self.flavor == 'win': + env = self.GetMsvsToolchainEnv( + additional_settings=additional_settings) + return env + + def GetMsvsToolchainEnv(self, additional_settings=None): + """Returns the variables Visual Studio would set for build steps.""" + return self.msvs_settings.GetVSMacroEnv('$!PRODUCT_DIR', + config=self.config_name) + + def GetSortedXcodeEnv(self, additional_settings=None): + """Returns the variables Xcode would set for build steps.""" + assert self.abs_build_dir + abs_build_dir = self.abs_build_dir + return gyp.xcode_emulation.GetSortedXcodeEnv( + self.xcode_settings, abs_build_dir, + os.path.join(abs_build_dir, self.build_to_base), self.config_name, + additional_settings) + + def GetSortedXcodePostbuildEnv(self): + """Returns the variables Xcode would set for postbuild steps.""" + postbuild_settings = {} + # CHROMIUM_STRIP_SAVE_FILE is a chromium-specific hack. + # TODO(thakis): It would be nice to have some general mechanism instead. + strip_save_file = self.xcode_settings.GetPerTargetSetting( + 'CHROMIUM_STRIP_SAVE_FILE') + if strip_save_file: + postbuild_settings['CHROMIUM_STRIP_SAVE_FILE'] = strip_save_file + return self.GetSortedXcodeEnv(additional_settings=postbuild_settings) + + def AppendPostbuildVariable(self, variables, spec, output, binary, + is_command_start=False): + """Adds a 'postbuild' variable if there is a postbuild for |output|.""" + postbuild = self.GetPostbuildCommand(spec, output, binary, is_command_start) + if postbuild: + variables.append(('postbuilds', postbuild)) + + def GetPostbuildCommand(self, spec, output, output_binary, is_command_start): + """Returns a shell command that runs all the postbuilds, and removes + |output| if any of them fails. If |is_command_start| is False, then the + returned string will start with ' && '.""" + if not self.xcode_settings or spec['type'] == 'none' or not output: + return '' + output = QuoteShellArgument(output, self.flavor) + postbuilds = gyp.xcode_emulation.GetSpecPostbuildCommands(spec, quiet=True) + if output_binary is not None: + postbuilds = self.xcode_settings.AddImplicitPostbuilds( + self.config_name, + os.path.normpath(os.path.join(self.base_to_build, output)), + QuoteShellArgument( + os.path.normpath(os.path.join(self.base_to_build, output_binary)), + self.flavor), + postbuilds, quiet=True) + + if not postbuilds: + return '' + # Postbuilds expect to be run in the gyp file's directory, so insert an + # implicit postbuild to cd to there. + postbuilds.insert(0, gyp.common.EncodePOSIXShellList( + ['cd', self.build_to_base])) + env = self.ComputeExportEnvString(self.GetSortedXcodePostbuildEnv()) + # G will be non-null if any postbuild fails. Run all postbuilds in a + # subshell. + commands = env + ' (' + \ + ' && '.join([ninja_syntax.escape(command) for command in postbuilds]) + command_string = (commands + '); G=$$?; ' + # Remove the final output if any postbuild failed. + '((exit $$G) || rm -rf %s) ' % output + '&& exit $$G)') + if is_command_start: + return '(' + command_string + ' && ' + else: + return '$ && (' + command_string + + def ComputeExportEnvString(self, env): + """Given an environment, returns a string looking like + 'export FOO=foo; export BAR="${FOO} bar;' + that exports |env| to the shell.""" + export_str = [] + for k, v in env: + export_str.append('export %s=%s;' % + (k, ninja_syntax.escape(gyp.common.EncodePOSIXShellArgument(v)))) + return ' '.join(export_str) + + def ComputeMacBundleOutput(self): + """Return the 'output' (full output path) to a bundle output directory.""" + assert self.is_mac_bundle + path = generator_default_variables['PRODUCT_DIR'] + return self.ExpandSpecial( + os.path.join(path, self.xcode_settings.GetWrapperName())) + + def ComputeOutputFileName(self, spec, type=None): + """Compute the filename of the final output for the current target.""" + if not type: + type = spec['type'] + + default_variables = copy.copy(generator_default_variables) + CalculateVariables(default_variables, {'flavor': self.flavor}) + + # Compute filename prefix: the product prefix, or a default for + # the product type. + DEFAULT_PREFIX = { + 'loadable_module': default_variables['SHARED_LIB_PREFIX'], + 'shared_library': default_variables['SHARED_LIB_PREFIX'], + 'static_library': default_variables['STATIC_LIB_PREFIX'], + 'executable': default_variables['EXECUTABLE_PREFIX'], + } + prefix = spec.get('product_prefix', DEFAULT_PREFIX.get(type, '')) + + # Compute filename extension: the product extension, or a default + # for the product type. + DEFAULT_EXTENSION = { + 'loadable_module': default_variables['SHARED_LIB_SUFFIX'], + 'shared_library': default_variables['SHARED_LIB_SUFFIX'], + 'static_library': default_variables['STATIC_LIB_SUFFIX'], + 'executable': default_variables['EXECUTABLE_SUFFIX'], + } + extension = spec.get('product_extension') + if extension: + extension = '.' + extension + else: + extension = DEFAULT_EXTENSION.get(type, '') + + if 'product_name' in spec: + # If we were given an explicit name, use that. + target = spec['product_name'] + else: + # Otherwise, derive a name from the target name. + target = spec['target_name'] + if prefix == 'lib': + # Snip out an extra 'lib' from libs if appropriate. + target = StripPrefix(target, 'lib') + + if type in ('static_library', 'loadable_module', 'shared_library', + 'executable'): + return '%s%s%s' % (prefix, target, extension) + elif type == 'none': + return '%s.stamp' % target + else: + raise Exception('Unhandled output type %s' % type) + + def ComputeOutput(self, spec, arch=None): + """Compute the path for the final output of the spec.""" + type = spec['type'] + + if self.flavor == 'win': + override = self.msvs_settings.GetOutputName(self.config_name, + self.ExpandSpecial) + if override: + return override + + if arch is None and self.flavor == 'mac' and type in ( + 'static_library', 'executable', 'shared_library', 'loadable_module'): + filename = self.xcode_settings.GetExecutablePath() + else: + filename = self.ComputeOutputFileName(spec, type) + + if arch is None and 'product_dir' in spec: + path = os.path.join(spec['product_dir'], filename) + return self.ExpandSpecial(path) + + # Some products go into the output root, libraries go into shared library + # dir, and everything else goes into the normal place. + type_in_output_root = ['executable', 'loadable_module'] + if self.flavor == 'mac' and self.toolset == 'target': + type_in_output_root += ['shared_library', 'static_library'] + elif self.flavor == 'win' and self.toolset == 'target': + type_in_output_root += ['shared_library'] + + if arch is not None: + # Make sure partial executables don't end up in a bundle or the regular + # output directory. + archdir = 'arch' + if self.toolset != 'target': + archdir = os.path.join('arch', '%s' % self.toolset) + return os.path.join(archdir, AddArch(filename, arch)) + elif type in type_in_output_root or self.is_standalone_static_library: + return filename + elif type == 'shared_library': + libdir = 'lib' + if self.toolset != 'target': + libdir = os.path.join('lib', '%s' % self.toolset) + return os.path.join(libdir, filename) + else: + return self.GypPathToUniqueOutput(filename, qualified=False) + + def WriteVariableList(self, ninja_file, var, values): + assert not isinstance(values, str) + if values is None: + values = [] + ninja_file.variable(var, ' '.join(values)) + + def WriteNewNinjaRule(self, name, args, description, is_cygwin, env, pool, + depfile=None): + """Write out a new ninja "rule" statement for a given command. + + Returns the name of the new rule, and a copy of |args| with variables + expanded.""" + + if self.flavor == 'win': + args = [self.msvs_settings.ConvertVSMacros( + arg, self.base_to_build, config=self.config_name) + for arg in args] + description = self.msvs_settings.ConvertVSMacros( + description, config=self.config_name) + elif self.flavor == 'mac': + # |env| is an empty list on non-mac. + args = [gyp.xcode_emulation.ExpandEnvVars(arg, env) for arg in args] + description = gyp.xcode_emulation.ExpandEnvVars(description, env) + + # TODO: we shouldn't need to qualify names; we do it because + # currently the ninja rule namespace is global, but it really + # should be scoped to the subninja. + rule_name = self.name + if self.toolset == 'target': + rule_name += '.' + self.toolset + rule_name += '.' + name + rule_name = re.sub('[^a-zA-Z0-9_]', '_', rule_name) + + # Remove variable references, but not if they refer to the magic rule + # variables. This is not quite right, as it also protects these for + # actions, not just for rules where they are valid. Good enough. + protect = [ '${root}', '${dirname}', '${source}', '${ext}', '${name}' ] + protect = '(?!' + '|'.join(map(re.escape, protect)) + ')' + description = re.sub(protect + r'\$', '_', description) + + # gyp dictates that commands are run from the base directory. + # cd into the directory before running, and adjust paths in + # the arguments to point to the proper locations. + rspfile = None + rspfile_content = None + args = [self.ExpandSpecial(arg, self.base_to_build) for arg in args] + if self.flavor == 'win': + rspfile = rule_name + '.$unique_name.rsp' + # The cygwin case handles this inside the bash sub-shell. + run_in = '' if is_cygwin else ' ' + self.build_to_base + if is_cygwin: + rspfile_content = self.msvs_settings.BuildCygwinBashCommandLine( + args, self.build_to_base) + else: + rspfile_content = gyp.msvs_emulation.EncodeRspFileList(args) + command = ('%s gyp-win-tool action-wrapper $arch ' % sys.executable + + rspfile + run_in) + else: + env = self.ComputeExportEnvString(env) + command = gyp.common.EncodePOSIXShellList(args) + command = 'cd %s; ' % self.build_to_base + env + command + + # GYP rules/actions express being no-ops by not touching their outputs. + # Avoid executing downstream dependencies in this case by specifying + # restat=1 to ninja. + self.ninja.rule(rule_name, command, description, depfile=depfile, + restat=True, pool=pool, + rspfile=rspfile, rspfile_content=rspfile_content) + self.ninja.newline() + + return rule_name, args + + +def CalculateVariables(default_variables, params): + """Calculate additional variables for use in the build (called by gyp).""" + global generator_additional_non_configuration_keys + global generator_additional_path_sections + flavor = gyp.common.GetFlavor(params) + if flavor == 'mac': + default_variables.setdefault('OS', 'mac') + default_variables.setdefault('SHARED_LIB_SUFFIX', '.dylib') + default_variables.setdefault('SHARED_LIB_DIR', + generator_default_variables['PRODUCT_DIR']) + default_variables.setdefault('LIB_DIR', + generator_default_variables['PRODUCT_DIR']) + + # Copy additional generator configuration data from Xcode, which is shared + # by the Mac Ninja generator. + import gyp.generator.xcode as xcode_generator + generator_additional_non_configuration_keys = getattr(xcode_generator, + 'generator_additional_non_configuration_keys', []) + generator_additional_path_sections = getattr(xcode_generator, + 'generator_additional_path_sections', []) + global generator_extra_sources_for_rules + generator_extra_sources_for_rules = getattr(xcode_generator, + 'generator_extra_sources_for_rules', []) + elif flavor == 'win': + exts = gyp.MSVSUtil.TARGET_TYPE_EXT + default_variables.setdefault('OS', 'win') + default_variables['EXECUTABLE_SUFFIX'] = '.' + exts['executable'] + default_variables['STATIC_LIB_PREFIX'] = '' + default_variables['STATIC_LIB_SUFFIX'] = '.' + exts['static_library'] + default_variables['SHARED_LIB_PREFIX'] = '' + default_variables['SHARED_LIB_SUFFIX'] = '.' + exts['shared_library'] + + # Copy additional generator configuration data from VS, which is shared + # by the Windows Ninja generator. + import gyp.generator.msvs as msvs_generator + generator_additional_non_configuration_keys = getattr(msvs_generator, + 'generator_additional_non_configuration_keys', []) + generator_additional_path_sections = getattr(msvs_generator, + 'generator_additional_path_sections', []) + + gyp.msvs_emulation.CalculateCommonVariables(default_variables, params) + else: + operating_system = flavor + if flavor == 'android': + operating_system = 'linux' # Keep this legacy behavior for now. + default_variables.setdefault('OS', operating_system) + default_variables.setdefault('SHARED_LIB_SUFFIX', '.so') + default_variables.setdefault('SHARED_LIB_DIR', + os.path.join('$!PRODUCT_DIR', 'lib')) + default_variables.setdefault('LIB_DIR', + os.path.join('$!PRODUCT_DIR', 'obj')) + +def ComputeOutputDir(params): + """Returns the path from the toplevel_dir to the build output directory.""" + # generator_dir: relative path from pwd to where make puts build files. + # Makes migrating from make to ninja easier, ninja doesn't put anything here. + generator_dir = os.path.relpath(params['options'].generator_output or '.') + + # output_dir: relative path from generator_dir to the build directory. + output_dir = params.get('generator_flags', {}).get('output_dir', 'out') + + # Relative path from source root to our output files. e.g. "out" + return os.path.normpath(os.path.join(generator_dir, output_dir)) + + +def CalculateGeneratorInputInfo(params): + """Called by __init__ to initialize generator values based on params.""" + # E.g. "out/gypfiles" + toplevel = params['options'].toplevel_dir + qualified_out_dir = os.path.normpath(os.path.join( + toplevel, ComputeOutputDir(params), 'gypfiles')) + + global generator_filelist_paths + generator_filelist_paths = { + 'toplevel': toplevel, + 'qualified_out_dir': qualified_out_dir, + } + + +def OpenOutput(path, mode='w'): + """Open |path| for writing, creating directories if necessary.""" + gyp.common.EnsureDirExists(path) + return open(path, mode) + + +def CommandWithWrapper(cmd, wrappers, prog): + wrapper = wrappers.get(cmd, '') + if wrapper: + return wrapper + ' ' + prog + return prog + + +def GetDefaultConcurrentLinks(): + """Returns a best-guess for a number of concurrent links.""" + pool_size = int(os.environ.get('GYP_LINK_CONCURRENCY', 0)) + if pool_size: + return pool_size + + if sys.platform in ('win32', 'cygwin'): + import ctypes + + class MEMORYSTATUSEX(ctypes.Structure): + _fields_ = [ + ("dwLength", ctypes.c_ulong), + ("dwMemoryLoad", ctypes.c_ulong), + ("ullTotalPhys", ctypes.c_ulonglong), + ("ullAvailPhys", ctypes.c_ulonglong), + ("ullTotalPageFile", ctypes.c_ulonglong), + ("ullAvailPageFile", ctypes.c_ulonglong), + ("ullTotalVirtual", ctypes.c_ulonglong), + ("ullAvailVirtual", ctypes.c_ulonglong), + ("sullAvailExtendedVirtual", ctypes.c_ulonglong), + ] + + stat = MEMORYSTATUSEX() + stat.dwLength = ctypes.sizeof(stat) + ctypes.windll.kernel32.GlobalMemoryStatusEx(ctypes.byref(stat)) + + # VS 2015 uses 20% more working set than VS 2013 and can consume all RAM + # on a 64 GB machine. + mem_limit = max(1, stat.ullTotalPhys / (5 * (2 ** 30))) # total / 5GB + hard_cap = max(1, int(os.environ.get('GYP_LINK_CONCURRENCY_MAX', 2**32))) + return min(mem_limit, hard_cap) + elif sys.platform.startswith('linux'): + if os.path.exists("/proc/meminfo"): + with open("/proc/meminfo") as meminfo: + memtotal_re = re.compile(r'^MemTotal:\s*(\d*)\s*kB') + for line in meminfo: + match = memtotal_re.match(line) + if not match: + continue + # Allow 8Gb per link on Linux because Gold is quite memory hungry + return max(1, int(match.group(1)) / (8 * (2 ** 20))) + return 1 + elif sys.platform == 'darwin': + try: + avail_bytes = int(subprocess.check_output(['sysctl', '-n', 'hw.memsize'])) + # A static library debug build of Chromium's unit_tests takes ~2.7GB, so + # 4GB per ld process allows for some more bloat. + return max(1, avail_bytes / (4 * (2 ** 30))) # total / 4GB + except: + return 1 + else: + # TODO(scottmg): Implement this for other platforms. + return 1 + + +def _GetWinLinkRuleNameSuffix(embed_manifest): + """Returns the suffix used to select an appropriate linking rule depending on + whether the manifest embedding is enabled.""" + return '_embed' if embed_manifest else '' + + +def _AddWinLinkRules(master_ninja, embed_manifest): + """Adds link rules for Windows platform to |master_ninja|.""" + def FullLinkCommand(ldcmd, out, binary_type): + resource_name = { + 'exe': '1', + 'dll': '2', + }[binary_type] + return '%(python)s gyp-win-tool link-with-manifests $arch %(embed)s ' \ + '%(out)s "%(ldcmd)s" %(resname)s $mt $rc "$intermediatemanifest" ' \ + '$manifests' % { + 'python': sys.executable, + 'out': out, + 'ldcmd': ldcmd, + 'resname': resource_name, + 'embed': embed_manifest } + rule_name_suffix = _GetWinLinkRuleNameSuffix(embed_manifest) + use_separate_mspdbsrv = ( + int(os.environ.get('GYP_USE_SEPARATE_MSPDBSRV', '0')) != 0) + dlldesc = 'LINK%s(DLL) $binary' % rule_name_suffix.upper() + dllcmd = ('%s gyp-win-tool link-wrapper $arch %s ' + '$ld /nologo $implibflag /DLL /OUT:$binary ' + '@$binary.rsp' % (sys.executable, use_separate_mspdbsrv)) + dllcmd = FullLinkCommand(dllcmd, '$binary', 'dll') + master_ninja.rule('solink' + rule_name_suffix, + description=dlldesc, command=dllcmd, + rspfile='$binary.rsp', + rspfile_content='$libs $in_newline $ldflags', + restat=True, + pool='link_pool') + master_ninja.rule('solink_module' + rule_name_suffix, + description=dlldesc, command=dllcmd, + rspfile='$binary.rsp', + rspfile_content='$libs $in_newline $ldflags', + restat=True, + pool='link_pool') + # Note that ldflags goes at the end so that it has the option of + # overriding default settings earlier in the command line. + exe_cmd = ('%s gyp-win-tool link-wrapper $arch %s ' + '$ld /nologo /OUT:$binary @$binary.rsp' % + (sys.executable, use_separate_mspdbsrv)) + exe_cmd = FullLinkCommand(exe_cmd, '$binary', 'exe') + master_ninja.rule('link' + rule_name_suffix, + description='LINK%s $binary' % rule_name_suffix.upper(), + command=exe_cmd, + rspfile='$binary.rsp', + rspfile_content='$in_newline $libs $ldflags', + pool='link_pool') + + +def GenerateOutputForConfig(target_list, target_dicts, data, params, + config_name): + options = params['options'] + flavor = gyp.common.GetFlavor(params) + generator_flags = params.get('generator_flags', {}) + + # build_dir: relative path from source root to our output files. + # e.g. "out/Debug" + build_dir = os.path.normpath( + os.path.join(ComputeOutputDir(params), config_name)) + + toplevel_build = os.path.join(options.toplevel_dir, build_dir) + + master_ninja_file = OpenOutput(os.path.join(toplevel_build, 'build.ninja')) + master_ninja = ninja_syntax.Writer(master_ninja_file, width=120) + + # Put build-time support tools in out/{config_name}. + gyp.common.CopyTool(flavor, toplevel_build) + + # Grab make settings for CC/CXX. + # The rules are + # - The priority from low to high is gcc/g++, the 'make_global_settings' in + # gyp, the environment variable. + # - If there is no 'make_global_settings' for CC.host/CXX.host or + # 'CC_host'/'CXX_host' enviroment variable, cc_host/cxx_host should be set + # to cc/cxx. + if flavor == 'win': + ar = 'lib.exe' + # cc and cxx must be set to the correct architecture by overriding with one + # of cl_x86 or cl_x64 below. + cc = 'UNSET' + cxx = 'UNSET' + ld = 'link.exe' + ld_host = '$ld' + else: + ar = 'ar' + cc = 'cc' + cxx = 'c++' + ld = '$cc' + ldxx = '$cxx' + ld_host = '$cc_host' + ldxx_host = '$cxx_host' + + ar_host = 'ar' + cc_host = None + cxx_host = None + cc_host_global_setting = None + cxx_host_global_setting = None + clang_cl = None + nm = 'nm' + nm_host = 'nm' + readelf = 'readelf' + readelf_host = 'readelf' + + build_file, _, _ = gyp.common.ParseQualifiedTarget(target_list[0]) + make_global_settings = data[build_file].get('make_global_settings', []) + build_to_root = gyp.common.InvertRelativePath(build_dir, + options.toplevel_dir) + wrappers = {} + for key, value in make_global_settings: + if key == 'AR': + ar = os.path.join(build_to_root, value) + if key == 'AR.host': + ar_host = os.path.join(build_to_root, value) + if key == 'CC': + cc = os.path.join(build_to_root, value) + if cc.endswith('clang-cl'): + clang_cl = cc + if key == 'CXX': + cxx = os.path.join(build_to_root, value) + if key == 'CC.host': + cc_host = os.path.join(build_to_root, value) + cc_host_global_setting = value + if key == 'CXX.host': + cxx_host = os.path.join(build_to_root, value) + cxx_host_global_setting = value + if key == 'LD': + ld = os.path.join(build_to_root, value) + if key == 'LD.host': + ld_host = os.path.join(build_to_root, value) + if key == 'NM': + nm = os.path.join(build_to_root, value) + if key == 'NM.host': + nm_host = os.path.join(build_to_root, value) + if key == 'READELF': + readelf = os.path.join(build_to_root, value) + if key == 'READELF.host': + readelf_host = os.path.join(build_to_root, value) + if key.endswith('_wrapper'): + wrappers[key[:-len('_wrapper')]] = os.path.join(build_to_root, value) + + # Support wrappers from environment variables too. + for key, value in os.environ.iteritems(): + if key.lower().endswith('_wrapper'): + key_prefix = key[:-len('_wrapper')] + key_prefix = re.sub(r'\.HOST$', '.host', key_prefix) + wrappers[key_prefix] = os.path.join(build_to_root, value) + + if flavor == 'win': + configs = [target_dicts[qualified_target]['configurations'][config_name] + for qualified_target in target_list] + shared_system_includes = None + if not generator_flags.get('ninja_use_custom_environment_files', 0): + shared_system_includes = \ + gyp.msvs_emulation.ExtractSharedMSVSSystemIncludes( + configs, generator_flags) + cl_paths = gyp.msvs_emulation.GenerateEnvironmentFiles( + toplevel_build, generator_flags, shared_system_includes, OpenOutput) + for arch, path in cl_paths.iteritems(): + if clang_cl: + # If we have selected clang-cl, use that instead. + path = clang_cl + command = CommandWithWrapper('CC', wrappers, + QuoteShellArgument(path, 'win')) + if clang_cl: + # Use clang-cl to cross-compile for x86 or x86_64. + command += (' -m32' if arch == 'x86' else ' -m64') + master_ninja.variable('cl_' + arch, command) + + cc = GetEnvironFallback(['CC_target', 'CC'], cc) + master_ninja.variable('cc', CommandWithWrapper('CC', wrappers, cc)) + cxx = GetEnvironFallback(['CXX_target', 'CXX'], cxx) + master_ninja.variable('cxx', CommandWithWrapper('CXX', wrappers, cxx)) + + if flavor == 'win': + master_ninja.variable('ld', ld) + master_ninja.variable('idl', 'midl.exe') + master_ninja.variable('ar', ar) + master_ninja.variable('rc', 'rc.exe') + master_ninja.variable('ml_x86', 'ml.exe') + master_ninja.variable('ml_x64', 'ml64.exe') + master_ninja.variable('mt', 'mt.exe') + else: + master_ninja.variable('ld', CommandWithWrapper('LINK', wrappers, ld)) + master_ninja.variable('ldxx', CommandWithWrapper('LINK', wrappers, ldxx)) + master_ninja.variable('ar', GetEnvironFallback(['AR_target', 'AR'], ar)) + if flavor != 'mac': + # Mac does not use readelf/nm for .TOC generation, so avoiding polluting + # the master ninja with extra unused variables. + master_ninja.variable( + 'nm', GetEnvironFallback(['NM_target', 'NM'], nm)) + master_ninja.variable( + 'readelf', GetEnvironFallback(['READELF_target', 'READELF'], readelf)) + + if generator_supports_multiple_toolsets: + if not cc_host: + cc_host = cc + if not cxx_host: + cxx_host = cxx + + master_ninja.variable('ar_host', GetEnvironFallback(['AR_host'], ar_host)) + master_ninja.variable('nm_host', GetEnvironFallback(['NM_host'], nm_host)) + master_ninja.variable('readelf_host', + GetEnvironFallback(['READELF_host'], readelf_host)) + cc_host = GetEnvironFallback(['CC_host'], cc_host) + cxx_host = GetEnvironFallback(['CXX_host'], cxx_host) + + # The environment variable could be used in 'make_global_settings', like + # ['CC.host', '$(CC)'] or ['CXX.host', '$(CXX)'], transform them here. + if '$(CC)' in cc_host and cc_host_global_setting: + cc_host = cc_host_global_setting.replace('$(CC)', cc) + if '$(CXX)' in cxx_host and cxx_host_global_setting: + cxx_host = cxx_host_global_setting.replace('$(CXX)', cxx) + master_ninja.variable('cc_host', + CommandWithWrapper('CC.host', wrappers, cc_host)) + master_ninja.variable('cxx_host', + CommandWithWrapper('CXX.host', wrappers, cxx_host)) + if flavor == 'win': + master_ninja.variable('ld_host', ld_host) + else: + master_ninja.variable('ld_host', CommandWithWrapper( + 'LINK', wrappers, ld_host)) + master_ninja.variable('ldxx_host', CommandWithWrapper( + 'LINK', wrappers, ldxx_host)) + + master_ninja.newline() + + master_ninja.pool('link_pool', depth=GetDefaultConcurrentLinks()) + master_ninja.newline() + + deps = 'msvc' if flavor == 'win' else 'gcc' + + if flavor != 'win': + master_ninja.rule( + 'cc', + description='CC $out', + command=('$cc -MMD -MF $out.d $defines $includes $cflags $cflags_c ' + '$cflags_pch_c -c $in -o $out'), + depfile='$out.d', + deps=deps) + master_ninja.rule( + 'cc_s', + description='CC $out', + command=('$cc $defines $includes $cflags $cflags_c ' + '$cflags_pch_c -c $in -o $out')) + master_ninja.rule( + 'cxx', + description='CXX $out', + command=('$cxx -MMD -MF $out.d $defines $includes $cflags $cflags_cc ' + '$cflags_pch_cc -c $in -o $out'), + depfile='$out.d', + deps=deps) + else: + # TODO(scottmg) Separate pdb names is a test to see if it works around + # http://crbug.com/142362. It seems there's a race between the creation of + # the .pdb by the precompiled header step for .cc and the compilation of + # .c files. This should be handled by mspdbsrv, but rarely errors out with + # c1xx : fatal error C1033: cannot open program database + # By making the rules target separate pdb files this might be avoided. + cc_command = ('ninja -t msvc -e $arch ' + + '-- ' + '$cc /nologo /showIncludes /FC ' + '@$out.rsp /c $in /Fo$out /Fd$pdbname_c ') + cxx_command = ('ninja -t msvc -e $arch ' + + '-- ' + '$cxx /nologo /showIncludes /FC ' + '@$out.rsp /c $in /Fo$out /Fd$pdbname_cc ') + master_ninja.rule( + 'cc', + description='CC $out', + command=cc_command, + rspfile='$out.rsp', + rspfile_content='$defines $includes $cflags $cflags_c', + deps=deps) + master_ninja.rule( + 'cxx', + description='CXX $out', + command=cxx_command, + rspfile='$out.rsp', + rspfile_content='$defines $includes $cflags $cflags_cc', + deps=deps) + master_ninja.rule( + 'idl', + description='IDL $in', + command=('%s gyp-win-tool midl-wrapper $arch $outdir ' + '$tlb $h $dlldata $iid $proxy $in ' + '$midl_includes $idlflags' % sys.executable)) + master_ninja.rule( + 'rc', + description='RC $in', + # Note: $in must be last otherwise rc.exe complains. + command=('%s gyp-win-tool rc-wrapper ' + '$arch $rc $defines $resource_includes $rcflags /fo$out $in' % + sys.executable)) + master_ninja.rule( + 'asm', + description='ASM $out', + command=('%s gyp-win-tool asm-wrapper ' + '$arch $asm $defines $includes $asmflags /c /Fo $out $in' % + sys.executable)) + + if flavor != 'mac' and flavor != 'win': + master_ninja.rule( + 'alink', + description='AR $out', + command='rm -f $out && $ar rcs $arflags $out $in') + master_ninja.rule( + 'alink_thin', + description='AR $out', + command='rm -f $out && $ar rcsT $arflags $out $in') + + # This allows targets that only need to depend on $lib's API to declare an + # order-only dependency on $lib.TOC and avoid relinking such downstream + # dependencies when $lib changes only in non-public ways. + # The resulting string leaves an uninterpolated %{suffix} which + # is used in the final substitution below. + mtime_preserving_solink_base = ( + 'if [ ! -e $lib -o ! -e $lib.TOC ]; then ' + '%(solink)s && %(extract_toc)s > $lib.TOC; else ' + '%(solink)s && %(extract_toc)s > $lib.tmp && ' + 'if ! cmp -s $lib.tmp $lib.TOC; then mv $lib.tmp $lib.TOC ; ' + 'fi; fi' + % { 'solink': + '$ld -shared $ldflags -o $lib -Wl,-soname=$soname %(suffix)s', + 'extract_toc': + ('{ $readelf -d $lib | grep SONAME ; ' + '$nm -gD -f p $lib | cut -f1-2 -d\' \'; }')}) + + master_ninja.rule( + 'solink', + description='SOLINK $lib', + restat=True, + command=mtime_preserving_solink_base % {'suffix': '@$link_file_list'}, + rspfile='$link_file_list', + rspfile_content= + '-Wl,--whole-archive $in $solibs -Wl,--no-whole-archive $libs', + pool='link_pool') + master_ninja.rule( + 'solink_module', + description='SOLINK(module) $lib', + restat=True, + command=mtime_preserving_solink_base % {'suffix': '@$link_file_list'}, + rspfile='$link_file_list', + rspfile_content='-Wl,--start-group $in -Wl,--end-group $solibs $libs', + pool='link_pool') + master_ninja.rule( + 'link', + description='LINK $out', + command=('$ld $ldflags -o $out ' + '-Wl,--start-group $in -Wl,--end-group $solibs $libs'), + pool='link_pool') + elif flavor == 'win': + master_ninja.rule( + 'alink', + description='LIB $out', + command=('%s gyp-win-tool link-wrapper $arch False ' + '$ar /nologo /ignore:4221 /OUT:$out @$out.rsp' % + sys.executable), + rspfile='$out.rsp', + rspfile_content='$in_newline $libflags') + _AddWinLinkRules(master_ninja, embed_manifest=True) + _AddWinLinkRules(master_ninja, embed_manifest=False) + else: + master_ninja.rule( + 'objc', + description='OBJC $out', + command=('$cc -MMD -MF $out.d $defines $includes $cflags $cflags_objc ' + '$cflags_pch_objc -c $in -o $out'), + depfile='$out.d', + deps=deps) + master_ninja.rule( + 'objcxx', + description='OBJCXX $out', + command=('$cxx -MMD -MF $out.d $defines $includes $cflags $cflags_objcc ' + '$cflags_pch_objcc -c $in -o $out'), + depfile='$out.d', + deps=deps) + master_ninja.rule( + 'alink', + description='LIBTOOL-STATIC $out, POSTBUILDS', + command='rm -f $out && ' + './gyp-mac-tool filter-libtool libtool $libtool_flags ' + '-static -o $out $in' + '$postbuilds') + master_ninja.rule( + 'lipo', + description='LIPO $out, POSTBUILDS', + command='rm -f $out && lipo -create $in -output $out$postbuilds') + master_ninja.rule( + 'solipo', + description='SOLIPO $out, POSTBUILDS', + command=( + 'rm -f $lib $lib.TOC && lipo -create $in -output $lib$postbuilds &&' + '%(extract_toc)s > $lib.TOC' + % { 'extract_toc': + '{ otool -l $lib | grep LC_ID_DYLIB -A 5; ' + 'nm -gP $lib | cut -f1-2 -d\' \' | grep -v U$$; true; }'})) + + + # Record the public interface of $lib in $lib.TOC. See the corresponding + # comment in the posix section above for details. + solink_base = '$ld %(type)s $ldflags -o $lib %(suffix)s' + mtime_preserving_solink_base = ( + 'if [ ! -e $lib -o ! -e $lib.TOC ] || ' + # Always force dependent targets to relink if this library + # reexports something. Handling this correctly would require + # recursive TOC dumping but this is rare in practice, so punt. + 'otool -l $lib | grep -q LC_REEXPORT_DYLIB ; then ' + '%(solink)s && %(extract_toc)s > $lib.TOC; ' + 'else ' + '%(solink)s && %(extract_toc)s > $lib.tmp && ' + 'if ! cmp -s $lib.tmp $lib.TOC; then ' + 'mv $lib.tmp $lib.TOC ; ' + 'fi; ' + 'fi' + % { 'solink': solink_base, + 'extract_toc': + '{ otool -l $lib | grep LC_ID_DYLIB -A 5; ' + 'nm -gP $lib | cut -f1-2 -d\' \' | grep -v U$$; true; }'}) + + + solink_suffix = '@$link_file_list$postbuilds' + master_ninja.rule( + 'solink', + description='SOLINK $lib, POSTBUILDS', + restat=True, + command=mtime_preserving_solink_base % {'suffix': solink_suffix, + 'type': '-shared'}, + rspfile='$link_file_list', + rspfile_content='$in $solibs $libs', + pool='link_pool') + master_ninja.rule( + 'solink_notoc', + description='SOLINK $lib, POSTBUILDS', + restat=True, + command=solink_base % {'suffix':solink_suffix, 'type': '-shared'}, + rspfile='$link_file_list', + rspfile_content='$in $solibs $libs', + pool='link_pool') + + master_ninja.rule( + 'solink_module', + description='SOLINK(module) $lib, POSTBUILDS', + restat=True, + command=mtime_preserving_solink_base % {'suffix': solink_suffix, + 'type': '-bundle'}, + rspfile='$link_file_list', + rspfile_content='$in $solibs $libs', + pool='link_pool') + master_ninja.rule( + 'solink_module_notoc', + description='SOLINK(module) $lib, POSTBUILDS', + restat=True, + command=solink_base % {'suffix': solink_suffix, 'type': '-bundle'}, + rspfile='$link_file_list', + rspfile_content='$in $solibs $libs', + pool='link_pool') + + master_ninja.rule( + 'link', + description='LINK $out, POSTBUILDS', + command=('$ld $ldflags -o $out ' + '$in $solibs $libs$postbuilds'), + pool='link_pool') + master_ninja.rule( + 'preprocess_infoplist', + description='PREPROCESS INFOPLIST $out', + command=('$cc -E -P -Wno-trigraphs -x c $defines $in -o $out && ' + 'plutil -convert xml1 $out $out')) + master_ninja.rule( + 'copy_infoplist', + description='COPY INFOPLIST $in', + command='$env ./gyp-mac-tool copy-info-plist $in $out $binary $keys') + master_ninja.rule( + 'merge_infoplist', + description='MERGE INFOPLISTS $in', + command='$env ./gyp-mac-tool merge-info-plist $out $in') + master_ninja.rule( + 'compile_xcassets', + description='COMPILE XCASSETS $in', + command='$env ./gyp-mac-tool compile-xcassets $keys $in') + master_ninja.rule( + 'mac_tool', + description='MACTOOL $mactool_cmd $in', + command='$env ./gyp-mac-tool $mactool_cmd $in $out $binary') + master_ninja.rule( + 'package_framework', + description='PACKAGE FRAMEWORK $out, POSTBUILDS', + command='./gyp-mac-tool package-framework $out $version$postbuilds ' + '&& touch $out') + if flavor == 'win': + master_ninja.rule( + 'stamp', + description='STAMP $out', + command='%s gyp-win-tool stamp $out' % sys.executable) + master_ninja.rule( + 'copy', + description='COPY $in $out', + command='%s gyp-win-tool recursive-mirror $in $out' % sys.executable) + else: + master_ninja.rule( + 'stamp', + description='STAMP $out', + command='${postbuilds}touch $out') + master_ninja.rule( + 'copy', + description='COPY $in $out', + command='rm -rf $out && cp -af $in $out') + master_ninja.newline() + + all_targets = set() + for build_file in params['build_files']: + for target in gyp.common.AllTargets(target_list, + target_dicts, + os.path.normpath(build_file)): + all_targets.add(target) + all_outputs = set() + + # target_outputs is a map from qualified target name to a Target object. + target_outputs = {} + # target_short_names is a map from target short name to a list of Target + # objects. + target_short_names = {} + + # short name of targets that were skipped because they didn't contain anything + # interesting. + # NOTE: there may be overlap between this an non_empty_target_names. + empty_target_names = set() + + # Set of non-empty short target names. + # NOTE: there may be overlap between this an empty_target_names. + non_empty_target_names = set() + + for qualified_target in target_list: + # qualified_target is like: third_party/icu/icu.gyp:icui18n#target + build_file, name, toolset = \ + gyp.common.ParseQualifiedTarget(qualified_target) + + this_make_global_settings = data[build_file].get('make_global_settings', []) + assert make_global_settings == this_make_global_settings, ( + "make_global_settings needs to be the same for all targets. %s vs. %s" % + (this_make_global_settings, make_global_settings)) + + spec = target_dicts[qualified_target] + if flavor == 'mac': + gyp.xcode_emulation.MergeGlobalXcodeSettingsToSpec(data[build_file], spec) + + # If build_file is a symlink, we must not follow it because there's a chance + # it could point to a path above toplevel_dir, and we cannot correctly deal + # with that case at the moment. + build_file = gyp.common.RelativePath(build_file, options.toplevel_dir, + False) + + qualified_target_for_hash = gyp.common.QualifiedTarget(build_file, name, + toolset) + hash_for_rules = hashlib.md5(qualified_target_for_hash).hexdigest() + + base_path = os.path.dirname(build_file) + obj = 'obj' + if toolset != 'target': + obj += '.' + toolset + output_file = os.path.join(obj, base_path, name + '.ninja') + + ninja_output = StringIO() + writer = NinjaWriter(hash_for_rules, target_outputs, base_path, build_dir, + ninja_output, + toplevel_build, output_file, + flavor, toplevel_dir=options.toplevel_dir) + + target = writer.WriteSpec(spec, config_name, generator_flags) + + if ninja_output.tell() > 0: + # Only create files for ninja files that actually have contents. + with OpenOutput(os.path.join(toplevel_build, output_file)) as ninja_file: + ninja_file.write(ninja_output.getvalue()) + ninja_output.close() + master_ninja.subninja(output_file) + + if target: + if name != target.FinalOutput() and spec['toolset'] == 'target': + target_short_names.setdefault(name, []).append(target) + target_outputs[qualified_target] = target + if qualified_target in all_targets: + all_outputs.add(target.FinalOutput()) + non_empty_target_names.add(name) + else: + empty_target_names.add(name) + + if target_short_names: + # Write a short name to build this target. This benefits both the + # "build chrome" case as well as the gyp tests, which expect to be + # able to run actions and build libraries by their short name. + master_ninja.newline() + master_ninja.comment('Short names for targets.') + for short_name in target_short_names: + master_ninja.build(short_name, 'phony', [x.FinalOutput() for x in + target_short_names[short_name]]) + + # Write phony targets for any empty targets that weren't written yet. As + # short names are not necessarily unique only do this for short names that + # haven't already been output for another target. + empty_target_names = empty_target_names - non_empty_target_names + if empty_target_names: + master_ninja.newline() + master_ninja.comment('Empty targets (output for completeness).') + for name in sorted(empty_target_names): + master_ninja.build(name, 'phony') + + if all_outputs: + master_ninja.newline() + master_ninja.build('all', 'phony', list(all_outputs)) + master_ninja.default(generator_flags.get('default_target', 'all')) + + master_ninja_file.close() + + +def PerformBuild(data, configurations, params): + options = params['options'] + for config in configurations: + builddir = os.path.join(options.toplevel_dir, 'out', config) + arguments = ['ninja', '-C', builddir] + print 'Building [%s]: %s' % (config, arguments) + subprocess.check_call(arguments) + + +def CallGenerateOutputForConfig(arglist): + # Ignore the interrupt signal so that the parent process catches it and + # kills all multiprocessing children. + signal.signal(signal.SIGINT, signal.SIG_IGN) + + (target_list, target_dicts, data, params, config_name) = arglist + GenerateOutputForConfig(target_list, target_dicts, data, params, config_name) + + +def GenerateOutput(target_list, target_dicts, data, params): + # Update target_dicts for iOS device builds. + target_dicts = gyp.xcode_emulation.CloneConfigurationForDeviceAndEmulator( + target_dicts) + + user_config = params.get('generator_flags', {}).get('config', None) + if gyp.common.GetFlavor(params) == 'win': + target_list, target_dicts = MSVSUtil.ShardTargets(target_list, target_dicts) + target_list, target_dicts = MSVSUtil.InsertLargePdbShims( + target_list, target_dicts, generator_default_variables) + + if user_config: + GenerateOutputForConfig(target_list, target_dicts, data, params, + user_config) + else: + config_names = target_dicts[target_list[0]]['configurations'].keys() + if params['parallel']: + try: + pool = multiprocessing.Pool(len(config_names)) + arglists = [] + for config_name in config_names: + arglists.append( + (target_list, target_dicts, data, params, config_name)) + pool.map(CallGenerateOutputForConfig, arglists) + except KeyboardInterrupt, e: + pool.terminate() + raise e + else: + for config_name in config_names: + GenerateOutputForConfig(target_list, target_dicts, data, params, + config_name) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.pyc b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.pyc new file mode 100644 index 00000000..ce5d1039 Binary files /dev/null and b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.pyc differ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py new file mode 100644 index 00000000..1767b2f4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python + +# Copyright (c) 2012 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +""" Unit tests for the ninja.py file. """ + +import gyp.generator.ninja as ninja +import unittest +import StringIO +import sys +import TestCommon + + +class TestPrefixesAndSuffixes(unittest.TestCase): + def test_BinaryNamesWindows(self): + # These cannot run on non-Windows as they require a VS installation to + # correctly handle variable expansion. + if sys.platform.startswith('win'): + writer = ninja.NinjaWriter('foo', 'wee', '.', '.', 'build.ninja', '.', + 'build.ninja', 'win') + spec = { 'target_name': 'wee' } + self.assertTrue(writer.ComputeOutputFileName(spec, 'executable'). + endswith('.exe')) + self.assertTrue(writer.ComputeOutputFileName(spec, 'shared_library'). + endswith('.dll')) + self.assertTrue(writer.ComputeOutputFileName(spec, 'static_library'). + endswith('.lib')) + + def test_BinaryNamesLinux(self): + writer = ninja.NinjaWriter('foo', 'wee', '.', '.', 'build.ninja', '.', + 'build.ninja', 'linux') + spec = { 'target_name': 'wee' } + self.assertTrue('.' not in writer.ComputeOutputFileName(spec, + 'executable')) + self.assertTrue(writer.ComputeOutputFileName(spec, 'shared_library'). + startswith('lib')) + self.assertTrue(writer.ComputeOutputFileName(spec, 'static_library'). + startswith('lib')) + self.assertTrue(writer.ComputeOutputFileName(spec, 'shared_library'). + endswith('.so')) + self.assertTrue(writer.ComputeOutputFileName(spec, 'static_library'). + endswith('.a')) + +if __name__ == '__main__': + unittest.main() diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py new file mode 100644 index 00000000..0e3fb930 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py @@ -0,0 +1,1300 @@ +# Copyright (c) 2012 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import filecmp +import gyp.common +import gyp.xcodeproj_file +import gyp.xcode_ninja +import errno +import os +import sys +import posixpath +import re +import shutil +import subprocess +import tempfile + + +# Project files generated by this module will use _intermediate_var as a +# custom Xcode setting whose value is a DerivedSources-like directory that's +# project-specific and configuration-specific. The normal choice, +# DERIVED_FILE_DIR, is target-specific, which is thought to be too restrictive +# as it is likely that multiple targets within a single project file will want +# to access the same set of generated files. The other option, +# PROJECT_DERIVED_FILE_DIR, is unsuitable because while it is project-specific, +# it is not configuration-specific. INTERMEDIATE_DIR is defined as +# $(PROJECT_DERIVED_FILE_DIR)/$(CONFIGURATION). +_intermediate_var = 'INTERMEDIATE_DIR' + +# SHARED_INTERMEDIATE_DIR is the same, except that it is shared among all +# targets that share the same BUILT_PRODUCTS_DIR. +_shared_intermediate_var = 'SHARED_INTERMEDIATE_DIR' + +_library_search_paths_var = 'LIBRARY_SEARCH_PATHS' + +generator_default_variables = { + 'EXECUTABLE_PREFIX': '', + 'EXECUTABLE_SUFFIX': '', + 'STATIC_LIB_PREFIX': 'lib', + 'SHARED_LIB_PREFIX': 'lib', + 'STATIC_LIB_SUFFIX': '.a', + 'SHARED_LIB_SUFFIX': '.dylib', + # INTERMEDIATE_DIR is a place for targets to build up intermediate products. + # It is specific to each build environment. It is only guaranteed to exist + # and be constant within the context of a project, corresponding to a single + # input file. Some build environments may allow their intermediate directory + # to be shared on a wider scale, but this is not guaranteed. + 'INTERMEDIATE_DIR': '$(%s)' % _intermediate_var, + 'OS': 'mac', + 'PRODUCT_DIR': '$(BUILT_PRODUCTS_DIR)', + 'LIB_DIR': '$(BUILT_PRODUCTS_DIR)', + 'RULE_INPUT_ROOT': '$(INPUT_FILE_BASE)', + 'RULE_INPUT_EXT': '$(INPUT_FILE_SUFFIX)', + 'RULE_INPUT_NAME': '$(INPUT_FILE_NAME)', + 'RULE_INPUT_PATH': '$(INPUT_FILE_PATH)', + 'RULE_INPUT_DIRNAME': '$(INPUT_FILE_DIRNAME)', + 'SHARED_INTERMEDIATE_DIR': '$(%s)' % _shared_intermediate_var, + 'CONFIGURATION_NAME': '$(CONFIGURATION)', +} + +# The Xcode-specific sections that hold paths. +generator_additional_path_sections = [ + 'mac_bundle_resources', + 'mac_framework_headers', + 'mac_framework_private_headers', + # 'mac_framework_dirs', input already handles _dirs endings. +] + +# The Xcode-specific keys that exist on targets and aren't moved down to +# configurations. +generator_additional_non_configuration_keys = [ + 'ios_app_extension', + 'ios_watch_app', + 'ios_watchkit_extension', + 'mac_bundle', + 'mac_bundle_resources', + 'mac_framework_headers', + 'mac_framework_private_headers', + 'mac_xctest_bundle', + 'xcode_create_dependents_test_runner', +] + +# We want to let any rules apply to files that are resources also. +generator_extra_sources_for_rules = [ + 'mac_bundle_resources', + 'mac_framework_headers', + 'mac_framework_private_headers', +] + +generator_filelist_paths = None + +# Xcode's standard set of library directories, which don't need to be duplicated +# in LIBRARY_SEARCH_PATHS. This list is not exhaustive, but that's okay. +xcode_standard_library_dirs = frozenset([ + '$(SDKROOT)/usr/lib', + '$(SDKROOT)/usr/local/lib', +]) + +def CreateXCConfigurationList(configuration_names): + xccl = gyp.xcodeproj_file.XCConfigurationList({'buildConfigurations': []}) + if len(configuration_names) == 0: + configuration_names = ['Default'] + for configuration_name in configuration_names: + xcbc = gyp.xcodeproj_file.XCBuildConfiguration({ + 'name': configuration_name}) + xccl.AppendProperty('buildConfigurations', xcbc) + xccl.SetProperty('defaultConfigurationName', configuration_names[0]) + return xccl + + +class XcodeProject(object): + def __init__(self, gyp_path, path, build_file_dict): + self.gyp_path = gyp_path + self.path = path + self.project = gyp.xcodeproj_file.PBXProject(path=path) + projectDirPath = gyp.common.RelativePath( + os.path.dirname(os.path.abspath(self.gyp_path)), + os.path.dirname(path) or '.') + self.project.SetProperty('projectDirPath', projectDirPath) + self.project_file = \ + gyp.xcodeproj_file.XCProjectFile({'rootObject': self.project}) + self.build_file_dict = build_file_dict + + # TODO(mark): add destructor that cleans up self.path if created_dir is + # True and things didn't complete successfully. Or do something even + # better with "try"? + self.created_dir = False + try: + os.makedirs(self.path) + self.created_dir = True + except OSError, e: + if e.errno != errno.EEXIST: + raise + + def Finalize1(self, xcode_targets, serialize_all_tests): + # Collect a list of all of the build configuration names used by the + # various targets in the file. It is very heavily advised to keep each + # target in an entire project (even across multiple project files) using + # the same set of configuration names. + configurations = [] + for xct in self.project.GetProperty('targets'): + xccl = xct.GetProperty('buildConfigurationList') + xcbcs = xccl.GetProperty('buildConfigurations') + for xcbc in xcbcs: + name = xcbc.GetProperty('name') + if name not in configurations: + configurations.append(name) + + # Replace the XCConfigurationList attached to the PBXProject object with + # a new one specifying all of the configuration names used by the various + # targets. + try: + xccl = CreateXCConfigurationList(configurations) + self.project.SetProperty('buildConfigurationList', xccl) + except: + sys.stderr.write("Problem with gyp file %s\n" % self.gyp_path) + raise + + # The need for this setting is explained above where _intermediate_var is + # defined. The comments below about wanting to avoid project-wide build + # settings apply here too, but this needs to be set on a project-wide basis + # so that files relative to the _intermediate_var setting can be displayed + # properly in the Xcode UI. + # + # Note that for configuration-relative files such as anything relative to + # _intermediate_var, for the purposes of UI tree view display, Xcode will + # only resolve the configuration name once, when the project file is + # opened. If the active build configuration is changed, the project file + # must be closed and reopened if it is desired for the tree view to update. + # This is filed as Apple radar 6588391. + xccl.SetBuildSetting(_intermediate_var, + '$(PROJECT_DERIVED_FILE_DIR)/$(CONFIGURATION)') + xccl.SetBuildSetting(_shared_intermediate_var, + '$(SYMROOT)/DerivedSources/$(CONFIGURATION)') + + # Set user-specified project-wide build settings and config files. This + # is intended to be used very sparingly. Really, almost everything should + # go into target-specific build settings sections. The project-wide + # settings are only intended to be used in cases where Xcode attempts to + # resolve variable references in a project context as opposed to a target + # context, such as when resolving sourceTree references while building up + # the tree tree view for UI display. + # Any values set globally are applied to all configurations, then any + # per-configuration values are applied. + for xck, xcv in self.build_file_dict.get('xcode_settings', {}).iteritems(): + xccl.SetBuildSetting(xck, xcv) + if 'xcode_config_file' in self.build_file_dict: + config_ref = self.project.AddOrGetFileInRootGroup( + self.build_file_dict['xcode_config_file']) + xccl.SetBaseConfiguration(config_ref) + build_file_configurations = self.build_file_dict.get('configurations', {}) + if build_file_configurations: + for config_name in configurations: + build_file_configuration_named = \ + build_file_configurations.get(config_name, {}) + if build_file_configuration_named: + xcc = xccl.ConfigurationNamed(config_name) + for xck, xcv in build_file_configuration_named.get('xcode_settings', + {}).iteritems(): + xcc.SetBuildSetting(xck, xcv) + if 'xcode_config_file' in build_file_configuration_named: + config_ref = self.project.AddOrGetFileInRootGroup( + build_file_configurations[config_name]['xcode_config_file']) + xcc.SetBaseConfiguration(config_ref) + + # Sort the targets based on how they appeared in the input. + # TODO(mark): Like a lot of other things here, this assumes internal + # knowledge of PBXProject - in this case, of its "targets" property. + + # ordinary_targets are ordinary targets that are already in the project + # file. run_test_targets are the targets that run unittests and should be + # used for the Run All Tests target. support_targets are the action/rule + # targets used by GYP file targets, just kept for the assert check. + ordinary_targets = [] + run_test_targets = [] + support_targets = [] + + # targets is full list of targets in the project. + targets = [] + + # does the it define it's own "all"? + has_custom_all = False + + # targets_for_all is the list of ordinary_targets that should be listed + # in this project's "All" target. It includes each non_runtest_target + # that does not have suppress_wildcard set. + targets_for_all = [] + + for target in self.build_file_dict['targets']: + target_name = target['target_name'] + toolset = target['toolset'] + qualified_target = gyp.common.QualifiedTarget(self.gyp_path, target_name, + toolset) + xcode_target = xcode_targets[qualified_target] + # Make sure that the target being added to the sorted list is already in + # the unsorted list. + assert xcode_target in self.project._properties['targets'] + targets.append(xcode_target) + ordinary_targets.append(xcode_target) + if xcode_target.support_target: + support_targets.append(xcode_target.support_target) + targets.append(xcode_target.support_target) + + if not int(target.get('suppress_wildcard', False)): + targets_for_all.append(xcode_target) + + if target_name.lower() == 'all': + has_custom_all = True; + + # If this target has a 'run_as' attribute, add its target to the + # targets, and add it to the test targets. + if target.get('run_as'): + # Make a target to run something. It should have one + # dependency, the parent xcode target. + xccl = CreateXCConfigurationList(configurations) + run_target = gyp.xcodeproj_file.PBXAggregateTarget({ + 'name': 'Run ' + target_name, + 'productName': xcode_target.GetProperty('productName'), + 'buildConfigurationList': xccl, + }, + parent=self.project) + run_target.AddDependency(xcode_target) + + command = target['run_as'] + script = '' + if command.get('working_directory'): + script = script + 'cd "%s"\n' % \ + gyp.xcodeproj_file.ConvertVariablesToShellSyntax( + command.get('working_directory')) + + if command.get('environment'): + script = script + "\n".join( + ['export %s="%s"' % + (key, gyp.xcodeproj_file.ConvertVariablesToShellSyntax(val)) + for (key, val) in command.get('environment').iteritems()]) + "\n" + + # Some test end up using sockets, files on disk, etc. and can get + # confused if more then one test runs at a time. The generator + # flag 'xcode_serialize_all_test_runs' controls the forcing of all + # tests serially. It defaults to True. To get serial runs this + # little bit of python does the same as the linux flock utility to + # make sure only one runs at a time. + command_prefix = '' + if serialize_all_tests: + command_prefix = \ +"""python -c "import fcntl, subprocess, sys +file = open('$TMPDIR/GYP_serialize_test_runs', 'a') +fcntl.flock(file.fileno(), fcntl.LOCK_EX) +sys.exit(subprocess.call(sys.argv[1:]))" """ + + # If we were unable to exec for some reason, we want to exit + # with an error, and fixup variable references to be shell + # syntax instead of xcode syntax. + script = script + 'exec ' + command_prefix + '%s\nexit 1\n' % \ + gyp.xcodeproj_file.ConvertVariablesToShellSyntax( + gyp.common.EncodePOSIXShellList(command.get('action'))) + + ssbp = gyp.xcodeproj_file.PBXShellScriptBuildPhase({ + 'shellScript': script, + 'showEnvVarsInLog': 0, + }) + run_target.AppendProperty('buildPhases', ssbp) + + # Add the run target to the project file. + targets.append(run_target) + run_test_targets.append(run_target) + xcode_target.test_runner = run_target + + + # Make sure that the list of targets being replaced is the same length as + # the one replacing it, but allow for the added test runner targets. + assert len(self.project._properties['targets']) == \ + len(ordinary_targets) + len(support_targets) + + self.project._properties['targets'] = targets + + # Get rid of unnecessary levels of depth in groups like the Source group. + self.project.RootGroupsTakeOverOnlyChildren(True) + + # Sort the groups nicely. Do this after sorting the targets, because the + # Products group is sorted based on the order of the targets. + self.project.SortGroups() + + # Create an "All" target if there's more than one target in this project + # file and the project didn't define its own "All" target. Put a generated + # "All" target first so that people opening up the project for the first + # time will build everything by default. + if len(targets_for_all) > 1 and not has_custom_all: + xccl = CreateXCConfigurationList(configurations) + all_target = gyp.xcodeproj_file.PBXAggregateTarget( + { + 'buildConfigurationList': xccl, + 'name': 'All', + }, + parent=self.project) + + for target in targets_for_all: + all_target.AddDependency(target) + + # TODO(mark): This is evil because it relies on internal knowledge of + # PBXProject._properties. It's important to get the "All" target first, + # though. + self.project._properties['targets'].insert(0, all_target) + + # The same, but for run_test_targets. + if len(run_test_targets) > 1: + xccl = CreateXCConfigurationList(configurations) + run_all_tests_target = gyp.xcodeproj_file.PBXAggregateTarget( + { + 'buildConfigurationList': xccl, + 'name': 'Run All Tests', + }, + parent=self.project) + for run_test_target in run_test_targets: + run_all_tests_target.AddDependency(run_test_target) + + # Insert after the "All" target, which must exist if there is more than + # one run_test_target. + self.project._properties['targets'].insert(1, run_all_tests_target) + + def Finalize2(self, xcode_targets, xcode_target_to_target_dict): + # Finalize2 needs to happen in a separate step because the process of + # updating references to other projects depends on the ordering of targets + # within remote project files. Finalize1 is responsible for sorting duty, + # and once all project files are sorted, Finalize2 can come in and update + # these references. + + # To support making a "test runner" target that will run all the tests + # that are direct dependents of any given target, we look for + # xcode_create_dependents_test_runner being set on an Aggregate target, + # and generate a second target that will run the tests runners found under + # the marked target. + for bf_tgt in self.build_file_dict['targets']: + if int(bf_tgt.get('xcode_create_dependents_test_runner', 0)): + tgt_name = bf_tgt['target_name'] + toolset = bf_tgt['toolset'] + qualified_target = gyp.common.QualifiedTarget(self.gyp_path, + tgt_name, toolset) + xcode_target = xcode_targets[qualified_target] + if isinstance(xcode_target, gyp.xcodeproj_file.PBXAggregateTarget): + # Collect all the run test targets. + all_run_tests = [] + pbxtds = xcode_target.GetProperty('dependencies') + for pbxtd in pbxtds: + pbxcip = pbxtd.GetProperty('targetProxy') + dependency_xct = pbxcip.GetProperty('remoteGlobalIDString') + if hasattr(dependency_xct, 'test_runner'): + all_run_tests.append(dependency_xct.test_runner) + + # Directly depend on all the runners as they depend on the target + # that builds them. + if len(all_run_tests) > 0: + run_all_target = gyp.xcodeproj_file.PBXAggregateTarget({ + 'name': 'Run %s Tests' % tgt_name, + 'productName': tgt_name, + }, + parent=self.project) + for run_test_target in all_run_tests: + run_all_target.AddDependency(run_test_target) + + # Insert the test runner after the related target. + idx = self.project._properties['targets'].index(xcode_target) + self.project._properties['targets'].insert(idx + 1, run_all_target) + + # Update all references to other projects, to make sure that the lists of + # remote products are complete. Otherwise, Xcode will fill them in when + # it opens the project file, which will result in unnecessary diffs. + # TODO(mark): This is evil because it relies on internal knowledge of + # PBXProject._other_pbxprojects. + for other_pbxproject in self.project._other_pbxprojects.keys(): + self.project.AddOrGetProjectReference(other_pbxproject) + + self.project.SortRemoteProductReferences() + + # Give everything an ID. + self.project_file.ComputeIDs() + + # Make sure that no two objects in the project file have the same ID. If + # multiple objects wind up with the same ID, upon loading the file, Xcode + # will only recognize one object (the last one in the file?) and the + # results are unpredictable. + self.project_file.EnsureNoIDCollisions() + + def Write(self): + # Write the project file to a temporary location first. Xcode watches for + # changes to the project file and presents a UI sheet offering to reload + # the project when it does change. However, in some cases, especially when + # multiple projects are open or when Xcode is busy, things don't work so + # seamlessly. Sometimes, Xcode is able to detect that a project file has + # changed but can't unload it because something else is referencing it. + # To mitigate this problem, and to avoid even having Xcode present the UI + # sheet when an open project is rewritten for inconsequential changes, the + # project file is written to a temporary file in the xcodeproj directory + # first. The new temporary file is then compared to the existing project + # file, if any. If they differ, the new file replaces the old; otherwise, + # the new project file is simply deleted. Xcode properly detects a file + # being renamed over an open project file as a change and so it remains + # able to present the "project file changed" sheet under this system. + # Writing to a temporary file first also avoids the possible problem of + # Xcode rereading an incomplete project file. + (output_fd, new_pbxproj_path) = \ + tempfile.mkstemp(suffix='.tmp', prefix='project.pbxproj.gyp.', + dir=self.path) + + try: + output_file = os.fdopen(output_fd, 'wb') + + self.project_file.Print(output_file) + output_file.close() + + pbxproj_path = os.path.join(self.path, 'project.pbxproj') + + same = False + try: + same = filecmp.cmp(pbxproj_path, new_pbxproj_path, False) + except OSError, e: + if e.errno != errno.ENOENT: + raise + + if same: + # The new file is identical to the old one, just get rid of the new + # one. + os.unlink(new_pbxproj_path) + else: + # The new file is different from the old one, or there is no old one. + # Rename the new file to the permanent name. + # + # tempfile.mkstemp uses an overly restrictive mode, resulting in a + # file that can only be read by the owner, regardless of the umask. + # There's no reason to not respect the umask here, which means that + # an extra hoop is required to fetch it and reset the new file's mode. + # + # No way to get the umask without setting a new one? Set a safe one + # and then set it back to the old value. + umask = os.umask(077) + os.umask(umask) + + os.chmod(new_pbxproj_path, 0666 & ~umask) + os.rename(new_pbxproj_path, pbxproj_path) + + except Exception: + # Don't leave turds behind. In fact, if this code was responsible for + # creating the xcodeproj directory, get rid of that too. + os.unlink(new_pbxproj_path) + if self.created_dir: + shutil.rmtree(self.path, True) + raise + + +def AddSourceToTarget(source, type, pbxp, xct): + # TODO(mark): Perhaps source_extensions and library_extensions can be made a + # little bit fancier. + source_extensions = ['c', 'cc', 'cpp', 'cxx', 'm', 'mm', 's', 'swift'] + + # .o is conceptually more of a "source" than a "library," but Xcode thinks + # of "sources" as things to compile and "libraries" (or "frameworks") as + # things to link with. Adding an object file to an Xcode target's frameworks + # phase works properly. + library_extensions = ['a', 'dylib', 'framework', 'o'] + + basename = posixpath.basename(source) + (root, ext) = posixpath.splitext(basename) + if ext: + ext = ext[1:].lower() + + if ext in source_extensions and type != 'none': + xct.SourcesPhase().AddFile(source) + elif ext in library_extensions and type != 'none': + xct.FrameworksPhase().AddFile(source) + else: + # Files that aren't added to a sources or frameworks build phase can still + # go into the project file, just not as part of a build phase. + pbxp.AddOrGetFileInRootGroup(source) + + +def AddResourceToTarget(resource, pbxp, xct): + # TODO(mark): Combine with AddSourceToTarget above? Or just inline this call + # where it's used. + xct.ResourcesPhase().AddFile(resource) + + +def AddHeaderToTarget(header, pbxp, xct, is_public): + # TODO(mark): Combine with AddSourceToTarget above? Or just inline this call + # where it's used. + settings = '{ATTRIBUTES = (%s, ); }' % ('Private', 'Public')[is_public] + xct.HeadersPhase().AddFile(header, settings) + + +_xcode_variable_re = re.compile(r'(\$\((.*?)\))') +def ExpandXcodeVariables(string, expansions): + """Expands Xcode-style $(VARIABLES) in string per the expansions dict. + + In some rare cases, it is appropriate to expand Xcode variables when a + project file is generated. For any substring $(VAR) in string, if VAR is a + key in the expansions dict, $(VAR) will be replaced with expansions[VAR]. + Any $(VAR) substring in string for which VAR is not a key in the expansions + dict will remain in the returned string. + """ + + matches = _xcode_variable_re.findall(string) + if matches == None: + return string + + matches.reverse() + for match in matches: + (to_replace, variable) = match + if not variable in expansions: + continue + + replacement = expansions[variable] + string = re.sub(re.escape(to_replace), replacement, string) + + return string + + +_xcode_define_re = re.compile(r'([\\\"\' ])') +def EscapeXcodeDefine(s): + """We must escape the defines that we give to XCode so that it knows not to + split on spaces and to respect backslash and quote literals. However, we + must not quote the define, or Xcode will incorrectly intepret variables + especially $(inherited).""" + return re.sub(_xcode_define_re, r'\\\1', s) + + +def PerformBuild(data, configurations, params): + options = params['options'] + + for build_file, build_file_dict in data.iteritems(): + (build_file_root, build_file_ext) = os.path.splitext(build_file) + if build_file_ext != '.gyp': + continue + xcodeproj_path = build_file_root + options.suffix + '.xcodeproj' + if options.generator_output: + xcodeproj_path = os.path.join(options.generator_output, xcodeproj_path) + + for config in configurations: + arguments = ['xcodebuild', '-project', xcodeproj_path] + arguments += ['-configuration', config] + print "Building [%s]: %s" % (config, arguments) + subprocess.check_call(arguments) + + +def CalculateGeneratorInputInfo(params): + toplevel = params['options'].toplevel_dir + if params.get('flavor') == 'ninja': + generator_dir = os.path.relpath(params['options'].generator_output or '.') + output_dir = params.get('generator_flags', {}).get('output_dir', 'out') + output_dir = os.path.normpath(os.path.join(generator_dir, output_dir)) + qualified_out_dir = os.path.normpath(os.path.join( + toplevel, output_dir, 'gypfiles-xcode-ninja')) + else: + output_dir = os.path.normpath(os.path.join(toplevel, 'xcodebuild')) + qualified_out_dir = os.path.normpath(os.path.join( + toplevel, output_dir, 'gypfiles')) + + global generator_filelist_paths + generator_filelist_paths = { + 'toplevel': toplevel, + 'qualified_out_dir': qualified_out_dir, + } + + +def GenerateOutput(target_list, target_dicts, data, params): + # Optionally configure each spec to use ninja as the external builder. + ninja_wrapper = params.get('flavor') == 'ninja' + if ninja_wrapper: + (target_list, target_dicts, data) = \ + gyp.xcode_ninja.CreateWrapper(target_list, target_dicts, data, params) + + options = params['options'] + generator_flags = params.get('generator_flags', {}) + parallel_builds = generator_flags.get('xcode_parallel_builds', True) + serialize_all_tests = \ + generator_flags.get('xcode_serialize_all_test_runs', True) + upgrade_check_project_version = \ + generator_flags.get('xcode_upgrade_check_project_version', None) + + # Format upgrade_check_project_version with leading zeros as needed. + if upgrade_check_project_version: + upgrade_check_project_version = str(upgrade_check_project_version) + while len(upgrade_check_project_version) < 4: + upgrade_check_project_version = '0' + upgrade_check_project_version + + skip_excluded_files = \ + not generator_flags.get('xcode_list_excluded_files', True) + xcode_projects = {} + for build_file, build_file_dict in data.iteritems(): + (build_file_root, build_file_ext) = os.path.splitext(build_file) + if build_file_ext != '.gyp': + continue + xcodeproj_path = build_file_root + options.suffix + '.xcodeproj' + if options.generator_output: + xcodeproj_path = os.path.join(options.generator_output, xcodeproj_path) + xcp = XcodeProject(build_file, xcodeproj_path, build_file_dict) + xcode_projects[build_file] = xcp + pbxp = xcp.project + + # Set project-level attributes from multiple options + project_attributes = {}; + if parallel_builds: + project_attributes['BuildIndependentTargetsInParallel'] = 'YES' + if upgrade_check_project_version: + project_attributes['LastUpgradeCheck'] = upgrade_check_project_version + project_attributes['LastTestingUpgradeCheck'] = \ + upgrade_check_project_version + project_attributes['LastSwiftUpdateCheck'] = \ + upgrade_check_project_version + pbxp.SetProperty('attributes', project_attributes) + + # Add gyp/gypi files to project + if not generator_flags.get('standalone'): + main_group = pbxp.GetProperty('mainGroup') + build_group = gyp.xcodeproj_file.PBXGroup({'name': 'Build'}) + main_group.AppendChild(build_group) + for included_file in build_file_dict['included_files']: + build_group.AddOrGetFileByPath(included_file, False) + + xcode_targets = {} + xcode_target_to_target_dict = {} + for qualified_target in target_list: + [build_file, target_name, toolset] = \ + gyp.common.ParseQualifiedTarget(qualified_target) + + spec = target_dicts[qualified_target] + if spec['toolset'] != 'target': + raise Exception( + 'Multiple toolsets not supported in xcode build (target %s)' % + qualified_target) + configuration_names = [spec['default_configuration']] + for configuration_name in sorted(spec['configurations'].keys()): + if configuration_name not in configuration_names: + configuration_names.append(configuration_name) + xcp = xcode_projects[build_file] + pbxp = xcp.project + + # Set up the configurations for the target according to the list of names + # supplied. + xccl = CreateXCConfigurationList(configuration_names) + + # Create an XCTarget subclass object for the target. The type with + # "+bundle" appended will be used if the target has "mac_bundle" set. + # loadable_modules not in a mac_bundle are mapped to + # com.googlecode.gyp.xcode.bundle, a pseudo-type that xcode.py interprets + # to create a single-file mh_bundle. + _types = { + 'executable': 'com.apple.product-type.tool', + 'loadable_module': 'com.googlecode.gyp.xcode.bundle', + 'shared_library': 'com.apple.product-type.library.dynamic', + 'static_library': 'com.apple.product-type.library.static', + 'mac_kernel_extension': 'com.apple.product-type.kernel-extension', + 'executable+bundle': 'com.apple.product-type.application', + 'loadable_module+bundle': 'com.apple.product-type.bundle', + 'loadable_module+xctest': 'com.apple.product-type.bundle.unit-test', + 'shared_library+bundle': 'com.apple.product-type.framework', + 'executable+extension+bundle': 'com.apple.product-type.app-extension', + 'executable+watch+extension+bundle': + 'com.apple.product-type.watchkit-extension', + 'executable+watch+bundle': + 'com.apple.product-type.application.watchapp', + 'mac_kernel_extension+bundle': 'com.apple.product-type.kernel-extension', + } + + target_properties = { + 'buildConfigurationList': xccl, + 'name': target_name, + } + + type = spec['type'] + is_xctest = int(spec.get('mac_xctest_bundle', 0)) + is_bundle = int(spec.get('mac_bundle', 0)) or is_xctest + is_app_extension = int(spec.get('ios_app_extension', 0)) + is_watchkit_extension = int(spec.get('ios_watchkit_extension', 0)) + is_watch_app = int(spec.get('ios_watch_app', 0)) + if type != 'none': + type_bundle_key = type + if is_xctest: + type_bundle_key += '+xctest' + assert type == 'loadable_module', ( + 'mac_xctest_bundle targets must have type loadable_module ' + '(target %s)' % target_name) + elif is_app_extension: + assert is_bundle, ('ios_app_extension flag requires mac_bundle ' + '(target %s)' % target_name) + type_bundle_key += '+extension+bundle' + elif is_watchkit_extension: + assert is_bundle, ('ios_watchkit_extension flag requires mac_bundle ' + '(target %s)' % target_name) + type_bundle_key += '+watch+extension+bundle' + elif is_watch_app: + assert is_bundle, ('ios_watch_app flag requires mac_bundle ' + '(target %s)' % target_name) + type_bundle_key += '+watch+bundle' + elif is_bundle: + type_bundle_key += '+bundle' + + xctarget_type = gyp.xcodeproj_file.PBXNativeTarget + try: + target_properties['productType'] = _types[type_bundle_key] + except KeyError, e: + gyp.common.ExceptionAppend(e, "-- unknown product type while " + "writing target %s" % target_name) + raise + else: + xctarget_type = gyp.xcodeproj_file.PBXAggregateTarget + assert not is_bundle, ( + 'mac_bundle targets cannot have type none (target "%s")' % + target_name) + assert not is_xctest, ( + 'mac_xctest_bundle targets cannot have type none (target "%s")' % + target_name) + + target_product_name = spec.get('product_name') + if target_product_name is not None: + target_properties['productName'] = target_product_name + + xct = xctarget_type(target_properties, parent=pbxp, + force_outdir=spec.get('product_dir'), + force_prefix=spec.get('product_prefix'), + force_extension=spec.get('product_extension')) + pbxp.AppendProperty('targets', xct) + xcode_targets[qualified_target] = xct + xcode_target_to_target_dict[xct] = spec + + spec_actions = spec.get('actions', []) + spec_rules = spec.get('rules', []) + + # Xcode has some "issues" with checking dependencies for the "Compile + # sources" step with any source files/headers generated by actions/rules. + # To work around this, if a target is building anything directly (not + # type "none"), then a second target is used to run the GYP actions/rules + # and is made a dependency of this target. This way the work is done + # before the dependency checks for what should be recompiled. + support_xct = None + # The Xcode "issues" don't affect xcode-ninja builds, since the dependency + # logic all happens in ninja. Don't bother creating the extra targets in + # that case. + if type != 'none' and (spec_actions or spec_rules) and not ninja_wrapper: + support_xccl = CreateXCConfigurationList(configuration_names); + support_target_suffix = generator_flags.get( + 'support_target_suffix', ' Support') + support_target_properties = { + 'buildConfigurationList': support_xccl, + 'name': target_name + support_target_suffix, + } + if target_product_name: + support_target_properties['productName'] = \ + target_product_name + ' Support' + support_xct = \ + gyp.xcodeproj_file.PBXAggregateTarget(support_target_properties, + parent=pbxp) + pbxp.AppendProperty('targets', support_xct) + xct.AddDependency(support_xct) + # Hang the support target off the main target so it can be tested/found + # by the generator during Finalize. + xct.support_target = support_xct + + prebuild_index = 0 + + # Add custom shell script phases for "actions" sections. + for action in spec_actions: + # There's no need to write anything into the script to ensure that the + # output directories already exist, because Xcode will look at the + # declared outputs and automatically ensure that they exist for us. + + # Do we have a message to print when this action runs? + message = action.get('message') + if message: + message = 'echo note: ' + gyp.common.EncodePOSIXShellArgument(message) + else: + message = '' + + # Turn the list into a string that can be passed to a shell. + action_string = gyp.common.EncodePOSIXShellList(action['action']) + + # Convert Xcode-type variable references to sh-compatible environment + # variable references. + message_sh = gyp.xcodeproj_file.ConvertVariablesToShellSyntax(message) + action_string_sh = gyp.xcodeproj_file.ConvertVariablesToShellSyntax( + action_string) + + script = '' + # Include the optional message + if message_sh: + script += message_sh + '\n' + # Be sure the script runs in exec, and that if exec fails, the script + # exits signalling an error. + script += 'exec ' + action_string_sh + '\nexit 1\n' + ssbp = gyp.xcodeproj_file.PBXShellScriptBuildPhase({ + 'inputPaths': action['inputs'], + 'name': 'Action "' + action['action_name'] + '"', + 'outputPaths': action['outputs'], + 'shellScript': script, + 'showEnvVarsInLog': 0, + }) + + if support_xct: + support_xct.AppendProperty('buildPhases', ssbp) + else: + # TODO(mark): this assumes too much knowledge of the internals of + # xcodeproj_file; some of these smarts should move into xcodeproj_file + # itself. + xct._properties['buildPhases'].insert(prebuild_index, ssbp) + prebuild_index = prebuild_index + 1 + + # TODO(mark): Should verify that at most one of these is specified. + if int(action.get('process_outputs_as_sources', False)): + for output in action['outputs']: + AddSourceToTarget(output, type, pbxp, xct) + + if int(action.get('process_outputs_as_mac_bundle_resources', False)): + for output in action['outputs']: + AddResourceToTarget(output, pbxp, xct) + + # tgt_mac_bundle_resources holds the list of bundle resources so + # the rule processing can check against it. + if is_bundle: + tgt_mac_bundle_resources = spec.get('mac_bundle_resources', []) + else: + tgt_mac_bundle_resources = [] + + # Add custom shell script phases driving "make" for "rules" sections. + # + # Xcode's built-in rule support is almost powerful enough to use directly, + # but there are a few significant deficiencies that render them unusable. + # There are workarounds for some of its inadequacies, but in aggregate, + # the workarounds added complexity to the generator, and some workarounds + # actually require input files to be crafted more carefully than I'd like. + # Consequently, until Xcode rules are made more capable, "rules" input + # sections will be handled in Xcode output by shell script build phases + # performed prior to the compilation phase. + # + # The following problems with Xcode rules were found. The numbers are + # Apple radar IDs. I hope that these shortcomings are addressed, I really + # liked having the rules handled directly in Xcode during the period that + # I was prototyping this. + # + # 6588600 Xcode compiles custom script rule outputs too soon, compilation + # fails. This occurs when rule outputs from distinct inputs are + # interdependent. The only workaround is to put rules and their + # inputs in a separate target from the one that compiles the rule + # outputs. This requires input file cooperation and it means that + # process_outputs_as_sources is unusable. + # 6584932 Need to declare that custom rule outputs should be excluded from + # compilation. A possible workaround is to lie to Xcode about a + # rule's output, giving it a dummy file it doesn't know how to + # compile. The rule action script would need to touch the dummy. + # 6584839 I need a way to declare additional inputs to a custom rule. + # A possible workaround is a shell script phase prior to + # compilation that touches a rule's primary input files if any + # would-be additional inputs are newer than the output. Modifying + # the source tree - even just modification times - feels dirty. + # 6564240 Xcode "custom script" build rules always dump all environment + # variables. This is a low-prioroty problem and is not a + # show-stopper. + rules_by_ext = {} + for rule in spec_rules: + rules_by_ext[rule['extension']] = rule + + # First, some definitions: + # + # A "rule source" is a file that was listed in a target's "sources" + # list and will have a rule applied to it on the basis of matching the + # rule's "extensions" attribute. Rule sources are direct inputs to + # rules. + # + # Rule definitions may specify additional inputs in their "inputs" + # attribute. These additional inputs are used for dependency tracking + # purposes. + # + # A "concrete output" is a rule output with input-dependent variables + # resolved. For example, given a rule with: + # 'extension': 'ext', 'outputs': ['$(INPUT_FILE_BASE).cc'], + # if the target's "sources" list contained "one.ext" and "two.ext", + # the "concrete output" for rule input "two.ext" would be "two.cc". If + # a rule specifies multiple outputs, each input file that the rule is + # applied to will have the same number of concrete outputs. + # + # If any concrete outputs are outdated or missing relative to their + # corresponding rule_source or to any specified additional input, the + # rule action must be performed to generate the concrete outputs. + + # concrete_outputs_by_rule_source will have an item at the same index + # as the rule['rule_sources'] that it corresponds to. Each item is a + # list of all of the concrete outputs for the rule_source. + concrete_outputs_by_rule_source = [] + + # concrete_outputs_all is a flat list of all concrete outputs that this + # rule is able to produce, given the known set of input files + # (rule_sources) that apply to it. + concrete_outputs_all = [] + + # messages & actions are keyed by the same indices as rule['rule_sources'] + # and concrete_outputs_by_rule_source. They contain the message and + # action to perform after resolving input-dependent variables. The + # message is optional, in which case None is stored for each rule source. + messages = [] + actions = [] + + for rule_source in rule.get('rule_sources', []): + rule_source_dirname, rule_source_basename = \ + posixpath.split(rule_source) + (rule_source_root, rule_source_ext) = \ + posixpath.splitext(rule_source_basename) + + # These are the same variable names that Xcode uses for its own native + # rule support. Because Xcode's rule engine is not being used, they + # need to be expanded as they are written to the makefile. + rule_input_dict = { + 'INPUT_FILE_BASE': rule_source_root, + 'INPUT_FILE_SUFFIX': rule_source_ext, + 'INPUT_FILE_NAME': rule_source_basename, + 'INPUT_FILE_PATH': rule_source, + 'INPUT_FILE_DIRNAME': rule_source_dirname, + } + + concrete_outputs_for_this_rule_source = [] + for output in rule.get('outputs', []): + # Fortunately, Xcode and make both use $(VAR) format for their + # variables, so the expansion is the only transformation necessary. + # Any remaning $(VAR)-type variables in the string can be given + # directly to make, which will pick up the correct settings from + # what Xcode puts into the environment. + concrete_output = ExpandXcodeVariables(output, rule_input_dict) + concrete_outputs_for_this_rule_source.append(concrete_output) + + # Add all concrete outputs to the project. + pbxp.AddOrGetFileInRootGroup(concrete_output) + + concrete_outputs_by_rule_source.append( \ + concrete_outputs_for_this_rule_source) + concrete_outputs_all.extend(concrete_outputs_for_this_rule_source) + + # TODO(mark): Should verify that at most one of these is specified. + if int(rule.get('process_outputs_as_sources', False)): + for output in concrete_outputs_for_this_rule_source: + AddSourceToTarget(output, type, pbxp, xct) + + # If the file came from the mac_bundle_resources list or if the rule + # is marked to process outputs as bundle resource, do so. + was_mac_bundle_resource = rule_source in tgt_mac_bundle_resources + if was_mac_bundle_resource or \ + int(rule.get('process_outputs_as_mac_bundle_resources', False)): + for output in concrete_outputs_for_this_rule_source: + AddResourceToTarget(output, pbxp, xct) + + # Do we have a message to print when this rule runs? + message = rule.get('message') + if message: + message = gyp.common.EncodePOSIXShellArgument(message) + message = ExpandXcodeVariables(message, rule_input_dict) + messages.append(message) + + # Turn the list into a string that can be passed to a shell. + action_string = gyp.common.EncodePOSIXShellList(rule['action']) + + action = ExpandXcodeVariables(action_string, rule_input_dict) + actions.append(action) + + if len(concrete_outputs_all) > 0: + # TODO(mark): There's a possibilty for collision here. Consider + # target "t" rule "A_r" and target "t_A" rule "r". + makefile_name = '%s.make' % re.sub( + '[^a-zA-Z0-9_]', '_' , '%s_%s' % (target_name, rule['rule_name'])) + makefile_path = os.path.join(xcode_projects[build_file].path, + makefile_name) + # TODO(mark): try/close? Write to a temporary file and swap it only + # if it's got changes? + makefile = open(makefile_path, 'wb') + + # make will build the first target in the makefile by default. By + # convention, it's called "all". List all (or at least one) + # concrete output for each rule source as a prerequisite of the "all" + # target. + makefile.write('all: \\\n') + for concrete_output_index in \ + xrange(0, len(concrete_outputs_by_rule_source)): + # Only list the first (index [0]) concrete output of each input + # in the "all" target. Otherwise, a parallel make (-j > 1) would + # attempt to process each input multiple times simultaneously. + # Otherwise, "all" could just contain the entire list of + # concrete_outputs_all. + concrete_output = \ + concrete_outputs_by_rule_source[concrete_output_index][0] + if concrete_output_index == len(concrete_outputs_by_rule_source) - 1: + eol = '' + else: + eol = ' \\' + makefile.write(' %s%s\n' % (concrete_output, eol)) + + for (rule_source, concrete_outputs, message, action) in \ + zip(rule['rule_sources'], concrete_outputs_by_rule_source, + messages, actions): + makefile.write('\n') + + # Add a rule that declares it can build each concrete output of a + # rule source. Collect the names of the directories that are + # required. + concrete_output_dirs = [] + for concrete_output_index in xrange(0, len(concrete_outputs)): + concrete_output = concrete_outputs[concrete_output_index] + if concrete_output_index == 0: + bol = '' + else: + bol = ' ' + makefile.write('%s%s \\\n' % (bol, concrete_output)) + + concrete_output_dir = posixpath.dirname(concrete_output) + if (concrete_output_dir and + concrete_output_dir not in concrete_output_dirs): + concrete_output_dirs.append(concrete_output_dir) + + makefile.write(' : \\\n') + + # The prerequisites for this rule are the rule source itself and + # the set of additional rule inputs, if any. + prerequisites = [rule_source] + prerequisites.extend(rule.get('inputs', [])) + for prerequisite_index in xrange(0, len(prerequisites)): + prerequisite = prerequisites[prerequisite_index] + if prerequisite_index == len(prerequisites) - 1: + eol = '' + else: + eol = ' \\' + makefile.write(' %s%s\n' % (prerequisite, eol)) + + # Make sure that output directories exist before executing the rule + # action. + if len(concrete_output_dirs) > 0: + makefile.write('\t@mkdir -p "%s"\n' % + '" "'.join(concrete_output_dirs)) + + # The rule message and action have already had the necessary variable + # substitutions performed. + if message: + # Mark it with note: so Xcode picks it up in build output. + makefile.write('\t@echo note: %s\n' % message) + makefile.write('\t%s\n' % action) + + makefile.close() + + # It might be nice to ensure that needed output directories exist + # here rather than in each target in the Makefile, but that wouldn't + # work if there ever was a concrete output that had an input-dependent + # variable anywhere other than in the leaf position. + + # Don't declare any inputPaths or outputPaths. If they're present, + # Xcode will provide a slight optimization by only running the script + # phase if any output is missing or outdated relative to any input. + # Unfortunately, it will also assume that all outputs are touched by + # the script, and if the outputs serve as files in a compilation + # phase, they will be unconditionally rebuilt. Since make might not + # rebuild everything that could be declared here as an output, this + # extra compilation activity is unnecessary. With inputPaths and + # outputPaths not supplied, make will always be called, but it knows + # enough to not do anything when everything is up-to-date. + + # To help speed things up, pass -j COUNT to make so it does some work + # in parallel. Don't use ncpus because Xcode will build ncpus targets + # in parallel and if each target happens to have a rules step, there + # would be ncpus^2 things going. With a machine that has 2 quad-core + # Xeons, a build can quickly run out of processes based on + # scheduling/other tasks, and randomly failing builds are no good. + script = \ +"""JOB_COUNT="$(/usr/sbin/sysctl -n hw.ncpu)" +if [ "${JOB_COUNT}" -gt 4 ]; then + JOB_COUNT=4 +fi +exec xcrun make -f "${PROJECT_FILE_PATH}/%s" -j "${JOB_COUNT}" +exit 1 +""" % makefile_name + ssbp = gyp.xcodeproj_file.PBXShellScriptBuildPhase({ + 'name': 'Rule "' + rule['rule_name'] + '"', + 'shellScript': script, + 'showEnvVarsInLog': 0, + }) + + if support_xct: + support_xct.AppendProperty('buildPhases', ssbp) + else: + # TODO(mark): this assumes too much knowledge of the internals of + # xcodeproj_file; some of these smarts should move into xcodeproj_file + # itself. + xct._properties['buildPhases'].insert(prebuild_index, ssbp) + prebuild_index = prebuild_index + 1 + + # Extra rule inputs also go into the project file. Concrete outputs were + # already added when they were computed. + groups = ['inputs', 'inputs_excluded'] + if skip_excluded_files: + groups = [x for x in groups if not x.endswith('_excluded')] + for group in groups: + for item in rule.get(group, []): + pbxp.AddOrGetFileInRootGroup(item) + + # Add "sources". + for source in spec.get('sources', []): + (source_root, source_extension) = posixpath.splitext(source) + if source_extension[1:] not in rules_by_ext: + # AddSourceToTarget will add the file to a root group if it's not + # already there. + AddSourceToTarget(source, type, pbxp, xct) + else: + pbxp.AddOrGetFileInRootGroup(source) + + # Add "mac_bundle_resources" and "mac_framework_private_headers" if + # it's a bundle of any type. + if is_bundle: + for resource in tgt_mac_bundle_resources: + (resource_root, resource_extension) = posixpath.splitext(resource) + if resource_extension[1:] not in rules_by_ext: + AddResourceToTarget(resource, pbxp, xct) + else: + pbxp.AddOrGetFileInRootGroup(resource) + + for header in spec.get('mac_framework_private_headers', []): + AddHeaderToTarget(header, pbxp, xct, False) + + # Add "mac_framework_headers". These can be valid for both frameworks + # and static libraries. + if is_bundle or type == 'static_library': + for header in spec.get('mac_framework_headers', []): + AddHeaderToTarget(header, pbxp, xct, True) + + # Add "copies". + pbxcp_dict = {} + for copy_group in spec.get('copies', []): + dest = copy_group['destination'] + if dest[0] not in ('/', '$'): + # Relative paths are relative to $(SRCROOT). + dest = '$(SRCROOT)/' + dest + + code_sign = int(copy_group.get('xcode_code_sign', 0)) + settings = (None, '{ATTRIBUTES = (CodeSignOnCopy, ); }')[code_sign]; + + # Coalesce multiple "copies" sections in the same target with the same + # "destination" property into the same PBXCopyFilesBuildPhase, otherwise + # they'll wind up with ID collisions. + pbxcp = pbxcp_dict.get(dest, None) + if pbxcp is None: + pbxcp = gyp.xcodeproj_file.PBXCopyFilesBuildPhase({ + 'name': 'Copy to ' + copy_group['destination'] + }, + parent=xct) + pbxcp.SetDestination(dest) + + # TODO(mark): The usual comment about this knowing too much about + # gyp.xcodeproj_file internals applies. + xct._properties['buildPhases'].insert(prebuild_index, pbxcp) + + pbxcp_dict[dest] = pbxcp + + for file in copy_group['files']: + pbxcp.AddFile(file, settings) + + # Excluded files can also go into the project file. + if not skip_excluded_files: + for key in ['sources', 'mac_bundle_resources', 'mac_framework_headers', + 'mac_framework_private_headers']: + excluded_key = key + '_excluded' + for item in spec.get(excluded_key, []): + pbxp.AddOrGetFileInRootGroup(item) + + # So can "inputs" and "outputs" sections of "actions" groups. + groups = ['inputs', 'inputs_excluded', 'outputs', 'outputs_excluded'] + if skip_excluded_files: + groups = [x for x in groups if not x.endswith('_excluded')] + for action in spec.get('actions', []): + for group in groups: + for item in action.get(group, []): + # Exclude anything in BUILT_PRODUCTS_DIR. They're products, not + # sources. + if not item.startswith('$(BUILT_PRODUCTS_DIR)/'): + pbxp.AddOrGetFileInRootGroup(item) + + for postbuild in spec.get('postbuilds', []): + action_string_sh = gyp.common.EncodePOSIXShellList(postbuild['action']) + script = 'exec ' + action_string_sh + '\nexit 1\n' + + # Make the postbuild step depend on the output of ld or ar from this + # target. Apparently putting the script step after the link step isn't + # sufficient to ensure proper ordering in all cases. With an input + # declared but no outputs, the script step should run every time, as + # desired. + ssbp = gyp.xcodeproj_file.PBXShellScriptBuildPhase({ + 'inputPaths': ['$(BUILT_PRODUCTS_DIR)/$(EXECUTABLE_PATH)'], + 'name': 'Postbuild "' + postbuild['postbuild_name'] + '"', + 'shellScript': script, + 'showEnvVarsInLog': 0, + }) + xct.AppendProperty('buildPhases', ssbp) + + # Add dependencies before libraries, because adding a dependency may imply + # adding a library. It's preferable to keep dependencies listed first + # during a link phase so that they can override symbols that would + # otherwise be provided by libraries, which will usually include system + # libraries. On some systems, ld is finicky and even requires the + # libraries to be ordered in such a way that unresolved symbols in + # earlier-listed libraries may only be resolved by later-listed libraries. + # The Mac linker doesn't work that way, but other platforms do, and so + # their linker invocations need to be constructed in this way. There's + # no compelling reason for Xcode's linker invocations to differ. + + if 'dependencies' in spec: + for dependency in spec['dependencies']: + xct.AddDependency(xcode_targets[dependency]) + # The support project also gets the dependencies (in case they are + # needed for the actions/rules to work). + if support_xct: + support_xct.AddDependency(xcode_targets[dependency]) + + if 'libraries' in spec: + for library in spec['libraries']: + xct.FrameworksPhase().AddFile(library) + # Add the library's directory to LIBRARY_SEARCH_PATHS if necessary. + # I wish Xcode handled this automatically. + library_dir = posixpath.dirname(library) + if library_dir not in xcode_standard_library_dirs and ( + not xct.HasBuildSetting(_library_search_paths_var) or + library_dir not in xct.GetBuildSetting(_library_search_paths_var)): + xct.AppendBuildSetting(_library_search_paths_var, library_dir) + + for configuration_name in configuration_names: + configuration = spec['configurations'][configuration_name] + xcbc = xct.ConfigurationNamed(configuration_name) + for include_dir in configuration.get('mac_framework_dirs', []): + xcbc.AppendBuildSetting('FRAMEWORK_SEARCH_PATHS', include_dir) + for include_dir in configuration.get('include_dirs', []): + xcbc.AppendBuildSetting('HEADER_SEARCH_PATHS', include_dir) + for library_dir in configuration.get('library_dirs', []): + if library_dir not in xcode_standard_library_dirs and ( + not xcbc.HasBuildSetting(_library_search_paths_var) or + library_dir not in xcbc.GetBuildSetting(_library_search_paths_var)): + xcbc.AppendBuildSetting(_library_search_paths_var, library_dir) + + if 'defines' in configuration: + for define in configuration['defines']: + set_define = EscapeXcodeDefine(define) + xcbc.AppendBuildSetting('GCC_PREPROCESSOR_DEFINITIONS', set_define) + if 'xcode_settings' in configuration: + for xck, xcv in configuration['xcode_settings'].iteritems(): + xcbc.SetBuildSetting(xck, xcv) + if 'xcode_config_file' in configuration: + config_ref = pbxp.AddOrGetFileInRootGroup( + configuration['xcode_config_file']) + xcbc.SetBaseConfiguration(config_ref) + + build_files = [] + for build_file, build_file_dict in data.iteritems(): + if build_file.endswith('.gyp'): + build_files.append(build_file) + + for build_file in build_files: + xcode_projects[build_file].Finalize1(xcode_targets, serialize_all_tests) + + for build_file in build_files: + xcode_projects[build_file].Finalize2(xcode_targets, + xcode_target_to_target_dict) + + for build_file in build_files: + xcode_projects[build_file].Write() diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode_test.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode_test.py new file mode 100644 index 00000000..260324a4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode_test.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python + +# Copyright (c) 2013 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +""" Unit tests for the xcode.py file. """ + +import gyp.generator.xcode as xcode +import unittest +import sys + + +class TestEscapeXcodeDefine(unittest.TestCase): + if sys.platform == 'darwin': + def test_InheritedRemainsUnescaped(self): + self.assertEqual(xcode.EscapeXcodeDefine('$(inherited)'), '$(inherited)') + + def test_Escaping(self): + self.assertEqual(xcode.EscapeXcodeDefine('a b"c\\'), 'a\\ b\\"c\\\\') + +if __name__ == '__main__': + unittest.main() diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py new file mode 100644 index 00000000..20178672 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py @@ -0,0 +1,2894 @@ +# Copyright (c) 2012 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +from compiler.ast import Const +from compiler.ast import Dict +from compiler.ast import Discard +from compiler.ast import List +from compiler.ast import Module +from compiler.ast import Node +from compiler.ast import Stmt +import compiler +import gyp.common +import gyp.simple_copy +import multiprocessing +import optparse +import os.path +import re +import shlex +import signal +import subprocess +import sys +import threading +import time +import traceback +from gyp.common import GypError +from gyp.common import OrderedSet + + +# A list of types that are treated as linkable. +linkable_types = [ + 'executable', + 'shared_library', + 'loadable_module', + 'mac_kernel_extension', +] + +# A list of sections that contain links to other targets. +dependency_sections = ['dependencies', 'export_dependent_settings'] + +# base_path_sections is a list of sections defined by GYP that contain +# pathnames. The generators can provide more keys, the two lists are merged +# into path_sections, but you should call IsPathSection instead of using either +# list directly. +base_path_sections = [ + 'destination', + 'files', + 'include_dirs', + 'inputs', + 'libraries', + 'outputs', + 'sources', +] +path_sections = set() + +# These per-process dictionaries are used to cache build file data when loading +# in parallel mode. +per_process_data = {} +per_process_aux_data = {} + +def IsPathSection(section): + # If section ends in one of the '=+?!' characters, it's applied to a section + # without the trailing characters. '/' is notably absent from this list, + # because there's no way for a regular expression to be treated as a path. + while section and section[-1:] in '=+?!': + section = section[:-1] + + if section in path_sections: + return True + + # Sections mathing the regexp '_(dir|file|path)s?$' are also + # considered PathSections. Using manual string matching since that + # is much faster than the regexp and this can be called hundreds of + # thousands of times so micro performance matters. + if "_" in section: + tail = section[-6:] + if tail[-1] == 's': + tail = tail[:-1] + if tail[-5:] in ('_file', '_path'): + return True + return tail[-4:] == '_dir' + + return False + +# base_non_configuration_keys is a list of key names that belong in the target +# itself and should not be propagated into its configurations. It is merged +# with a list that can come from the generator to +# create non_configuration_keys. +base_non_configuration_keys = [ + # Sections that must exist inside targets and not configurations. + 'actions', + 'configurations', + 'copies', + 'default_configuration', + 'dependencies', + 'dependencies_original', + 'libraries', + 'postbuilds', + 'product_dir', + 'product_extension', + 'product_name', + 'product_prefix', + 'rules', + 'run_as', + 'sources', + 'standalone_static_library', + 'suppress_wildcard', + 'target_name', + 'toolset', + 'toolsets', + 'type', + + # Sections that can be found inside targets or configurations, but that + # should not be propagated from targets into their configurations. + 'variables', +] +non_configuration_keys = [] + +# Keys that do not belong inside a configuration dictionary. +invalid_configuration_keys = [ + 'actions', + 'all_dependent_settings', + 'configurations', + 'dependencies', + 'direct_dependent_settings', + 'libraries', + 'link_settings', + 'sources', + 'standalone_static_library', + 'target_name', + 'type', +] + +# Controls whether or not the generator supports multiple toolsets. +multiple_toolsets = False + +# Paths for converting filelist paths to output paths: { +# toplevel, +# qualified_output_dir, +# } +generator_filelist_paths = None + +def GetIncludedBuildFiles(build_file_path, aux_data, included=None): + """Return a list of all build files included into build_file_path. + + The returned list will contain build_file_path as well as all other files + that it included, either directly or indirectly. Note that the list may + contain files that were included into a conditional section that evaluated + to false and was not merged into build_file_path's dict. + + aux_data is a dict containing a key for each build file or included build + file. Those keys provide access to dicts whose "included" keys contain + lists of all other files included by the build file. + + included should be left at its default None value by external callers. It + is used for recursion. + + The returned list will not contain any duplicate entries. Each build file + in the list will be relative to the current directory. + """ + + if included == None: + included = [] + + if build_file_path in included: + return included + + included.append(build_file_path) + + for included_build_file in aux_data[build_file_path].get('included', []): + GetIncludedBuildFiles(included_build_file, aux_data, included) + + return included + + +def CheckedEval(file_contents): + """Return the eval of a gyp file. + + The gyp file is restricted to dictionaries and lists only, and + repeated keys are not allowed. + + Note that this is slower than eval() is. + """ + + ast = compiler.parse(file_contents) + assert isinstance(ast, Module) + c1 = ast.getChildren() + assert c1[0] is None + assert isinstance(c1[1], Stmt) + c2 = c1[1].getChildren() + assert isinstance(c2[0], Discard) + c3 = c2[0].getChildren() + assert len(c3) == 1 + return CheckNode(c3[0], []) + + +def CheckNode(node, keypath): + if isinstance(node, Dict): + c = node.getChildren() + dict = {} + for n in range(0, len(c), 2): + assert isinstance(c[n], Const) + key = c[n].getChildren()[0] + if key in dict: + raise GypError("Key '" + key + "' repeated at level " + + repr(len(keypath) + 1) + " with key path '" + + '.'.join(keypath) + "'") + kp = list(keypath) # Make a copy of the list for descending this node. + kp.append(key) + dict[key] = CheckNode(c[n + 1], kp) + return dict + elif isinstance(node, List): + c = node.getChildren() + children = [] + for index, child in enumerate(c): + kp = list(keypath) # Copy list. + kp.append(repr(index)) + children.append(CheckNode(child, kp)) + return children + elif isinstance(node, Const): + return node.getChildren()[0] + else: + raise TypeError("Unknown AST node at key path '" + '.'.join(keypath) + + "': " + repr(node)) + + +def LoadOneBuildFile(build_file_path, data, aux_data, includes, + is_target, check): + if build_file_path in data: + return data[build_file_path] + + if os.path.exists(build_file_path): + build_file_contents = open(build_file_path).read() + else: + raise GypError("%s not found (cwd: %s)" % (build_file_path, os.getcwd())) + + build_file_data = None + try: + if check: + build_file_data = CheckedEval(build_file_contents) + else: + build_file_data = eval(build_file_contents, {'__builtins__': None}, + None) + except SyntaxError, e: + e.filename = build_file_path + raise + except Exception, e: + gyp.common.ExceptionAppend(e, 'while reading ' + build_file_path) + raise + + if type(build_file_data) is not dict: + raise GypError("%s does not evaluate to a dictionary." % build_file_path) + + data[build_file_path] = build_file_data + aux_data[build_file_path] = {} + + # Scan for includes and merge them in. + if ('skip_includes' not in build_file_data or + not build_file_data['skip_includes']): + try: + if is_target: + LoadBuildFileIncludesIntoDict(build_file_data, build_file_path, data, + aux_data, includes, check) + else: + LoadBuildFileIncludesIntoDict(build_file_data, build_file_path, data, + aux_data, None, check) + except Exception, e: + gyp.common.ExceptionAppend(e, + 'while reading includes of ' + build_file_path) + raise + + return build_file_data + + +def LoadBuildFileIncludesIntoDict(subdict, subdict_path, data, aux_data, + includes, check): + includes_list = [] + if includes != None: + includes_list.extend(includes) + if 'includes' in subdict: + for include in subdict['includes']: + # "include" is specified relative to subdict_path, so compute the real + # path to include by appending the provided "include" to the directory + # in which subdict_path resides. + relative_include = \ + os.path.normpath(os.path.join(os.path.dirname(subdict_path), include)) + includes_list.append(relative_include) + # Unhook the includes list, it's no longer needed. + del subdict['includes'] + + # Merge in the included files. + for include in includes_list: + if not 'included' in aux_data[subdict_path]: + aux_data[subdict_path]['included'] = [] + aux_data[subdict_path]['included'].append(include) + + gyp.DebugOutput(gyp.DEBUG_INCLUDES, "Loading Included File: '%s'", include) + + MergeDicts(subdict, + LoadOneBuildFile(include, data, aux_data, None, False, check), + subdict_path, include) + + # Recurse into subdictionaries. + for k, v in subdict.iteritems(): + if type(v) is dict: + LoadBuildFileIncludesIntoDict(v, subdict_path, data, aux_data, + None, check) + elif type(v) is list: + LoadBuildFileIncludesIntoList(v, subdict_path, data, aux_data, + check) + + +# This recurses into lists so that it can look for dicts. +def LoadBuildFileIncludesIntoList(sublist, sublist_path, data, aux_data, check): + for item in sublist: + if type(item) is dict: + LoadBuildFileIncludesIntoDict(item, sublist_path, data, aux_data, + None, check) + elif type(item) is list: + LoadBuildFileIncludesIntoList(item, sublist_path, data, aux_data, check) + +# Processes toolsets in all the targets. This recurses into condition entries +# since they can contain toolsets as well. +def ProcessToolsetsInDict(data): + if 'targets' in data: + target_list = data['targets'] + new_target_list = [] + for target in target_list: + # If this target already has an explicit 'toolset', and no 'toolsets' + # list, don't modify it further. + if 'toolset' in target and 'toolsets' not in target: + new_target_list.append(target) + continue + if multiple_toolsets: + toolsets = target.get('toolsets', ['target']) + else: + toolsets = ['target'] + # Make sure this 'toolsets' definition is only processed once. + if 'toolsets' in target: + del target['toolsets'] + if len(toolsets) > 0: + # Optimization: only do copies if more than one toolset is specified. + for build in toolsets[1:]: + new_target = gyp.simple_copy.deepcopy(target) + new_target['toolset'] = build + new_target_list.append(new_target) + target['toolset'] = toolsets[0] + new_target_list.append(target) + data['targets'] = new_target_list + if 'conditions' in data: + for condition in data['conditions']: + if type(condition) is list: + for condition_dict in condition[1:]: + if type(condition_dict) is dict: + ProcessToolsetsInDict(condition_dict) + + +# TODO(mark): I don't love this name. It just means that it's going to load +# a build file that contains targets and is expected to provide a targets dict +# that contains the targets... +def LoadTargetBuildFile(build_file_path, data, aux_data, variables, includes, + depth, check, load_dependencies): + # If depth is set, predefine the DEPTH variable to be a relative path from + # this build file's directory to the directory identified by depth. + if depth: + # TODO(dglazkov) The backslash/forward-slash replacement at the end is a + # temporary measure. This should really be addressed by keeping all paths + # in POSIX until actual project generation. + d = gyp.common.RelativePath(depth, os.path.dirname(build_file_path)) + if d == '': + variables['DEPTH'] = '.' + else: + variables['DEPTH'] = d.replace('\\', '/') + + # The 'target_build_files' key is only set when loading target build files in + # the non-parallel code path, where LoadTargetBuildFile is called + # recursively. In the parallel code path, we don't need to check whether the + # |build_file_path| has already been loaded, because the 'scheduled' set in + # ParallelState guarantees that we never load the same |build_file_path| + # twice. + if 'target_build_files' in data: + if build_file_path in data['target_build_files']: + # Already loaded. + return False + data['target_build_files'].add(build_file_path) + + gyp.DebugOutput(gyp.DEBUG_INCLUDES, + "Loading Target Build File '%s'", build_file_path) + + build_file_data = LoadOneBuildFile(build_file_path, data, aux_data, + includes, True, check) + + # Store DEPTH for later use in generators. + build_file_data['_DEPTH'] = depth + + # Set up the included_files key indicating which .gyp files contributed to + # this target dict. + if 'included_files' in build_file_data: + raise GypError(build_file_path + ' must not contain included_files key') + + included = GetIncludedBuildFiles(build_file_path, aux_data) + build_file_data['included_files'] = [] + for included_file in included: + # included_file is relative to the current directory, but it needs to + # be made relative to build_file_path's directory. + included_relative = \ + gyp.common.RelativePath(included_file, + os.path.dirname(build_file_path)) + build_file_data['included_files'].append(included_relative) + + # Do a first round of toolsets expansion so that conditions can be defined + # per toolset. + ProcessToolsetsInDict(build_file_data) + + # Apply "pre"/"early" variable expansions and condition evaluations. + ProcessVariablesAndConditionsInDict( + build_file_data, PHASE_EARLY, variables, build_file_path) + + # Since some toolsets might have been defined conditionally, perform + # a second round of toolsets expansion now. + ProcessToolsetsInDict(build_file_data) + + # Look at each project's target_defaults dict, and merge settings into + # targets. + if 'target_defaults' in build_file_data: + if 'targets' not in build_file_data: + raise GypError("Unable to find targets in build file %s" % + build_file_path) + + index = 0 + while index < len(build_file_data['targets']): + # This procedure needs to give the impression that target_defaults is + # used as defaults, and the individual targets inherit from that. + # The individual targets need to be merged into the defaults. Make + # a deep copy of the defaults for each target, merge the target dict + # as found in the input file into that copy, and then hook up the + # copy with the target-specific data merged into it as the replacement + # target dict. + old_target_dict = build_file_data['targets'][index] + new_target_dict = gyp.simple_copy.deepcopy( + build_file_data['target_defaults']) + MergeDicts(new_target_dict, old_target_dict, + build_file_path, build_file_path) + build_file_data['targets'][index] = new_target_dict + index += 1 + + # No longer needed. + del build_file_data['target_defaults'] + + # Look for dependencies. This means that dependency resolution occurs + # after "pre" conditionals and variable expansion, but before "post" - + # in other words, you can't put a "dependencies" section inside a "post" + # conditional within a target. + + dependencies = [] + if 'targets' in build_file_data: + for target_dict in build_file_data['targets']: + if 'dependencies' not in target_dict: + continue + for dependency in target_dict['dependencies']: + dependencies.append( + gyp.common.ResolveTarget(build_file_path, dependency, None)[0]) + + if load_dependencies: + for dependency in dependencies: + try: + LoadTargetBuildFile(dependency, data, aux_data, variables, + includes, depth, check, load_dependencies) + except Exception, e: + gyp.common.ExceptionAppend( + e, 'while loading dependencies of %s' % build_file_path) + raise + else: + return (build_file_path, dependencies) + +def CallLoadTargetBuildFile(global_flags, + build_file_path, variables, + includes, depth, check, + generator_input_info): + """Wrapper around LoadTargetBuildFile for parallel processing. + + This wrapper is used when LoadTargetBuildFile is executed in + a worker process. + """ + + try: + signal.signal(signal.SIGINT, signal.SIG_IGN) + + # Apply globals so that the worker process behaves the same. + for key, value in global_flags.iteritems(): + globals()[key] = value + + SetGeneratorGlobals(generator_input_info) + result = LoadTargetBuildFile(build_file_path, per_process_data, + per_process_aux_data, variables, + includes, depth, check, False) + if not result: + return result + + (build_file_path, dependencies) = result + + # We can safely pop the build_file_data from per_process_data because it + # will never be referenced by this process again, so we don't need to keep + # it in the cache. + build_file_data = per_process_data.pop(build_file_path) + + # This gets serialized and sent back to the main process via a pipe. + # It's handled in LoadTargetBuildFileCallback. + return (build_file_path, + build_file_data, + dependencies) + except GypError, e: + sys.stderr.write("gyp: %s\n" % e) + return None + except Exception, e: + print >>sys.stderr, 'Exception:', e + print >>sys.stderr, traceback.format_exc() + return None + + +class ParallelProcessingError(Exception): + pass + + +class ParallelState(object): + """Class to keep track of state when processing input files in parallel. + + If build files are loaded in parallel, use this to keep track of + state during farming out and processing parallel jobs. It's stored + in a global so that the callback function can have access to it. + """ + + def __init__(self): + # The multiprocessing pool. + self.pool = None + # The condition variable used to protect this object and notify + # the main loop when there might be more data to process. + self.condition = None + # The "data" dict that was passed to LoadTargetBuildFileParallel + self.data = None + # The number of parallel calls outstanding; decremented when a response + # was received. + self.pending = 0 + # The set of all build files that have been scheduled, so we don't + # schedule the same one twice. + self.scheduled = set() + # A list of dependency build file paths that haven't been scheduled yet. + self.dependencies = [] + # Flag to indicate if there was an error in a child process. + self.error = False + + def LoadTargetBuildFileCallback(self, result): + """Handle the results of running LoadTargetBuildFile in another process. + """ + self.condition.acquire() + if not result: + self.error = True + self.condition.notify() + self.condition.release() + return + (build_file_path0, build_file_data0, dependencies0) = result + self.data[build_file_path0] = build_file_data0 + self.data['target_build_files'].add(build_file_path0) + for new_dependency in dependencies0: + if new_dependency not in self.scheduled: + self.scheduled.add(new_dependency) + self.dependencies.append(new_dependency) + self.pending -= 1 + self.condition.notify() + self.condition.release() + + +def LoadTargetBuildFilesParallel(build_files, data, variables, includes, depth, + check, generator_input_info): + parallel_state = ParallelState() + parallel_state.condition = threading.Condition() + # Make copies of the build_files argument that we can modify while working. + parallel_state.dependencies = list(build_files) + parallel_state.scheduled = set(build_files) + parallel_state.pending = 0 + parallel_state.data = data + + try: + parallel_state.condition.acquire() + while parallel_state.dependencies or parallel_state.pending: + if parallel_state.error: + break + if not parallel_state.dependencies: + parallel_state.condition.wait() + continue + + dependency = parallel_state.dependencies.pop() + + parallel_state.pending += 1 + global_flags = { + 'path_sections': globals()['path_sections'], + 'non_configuration_keys': globals()['non_configuration_keys'], + 'multiple_toolsets': globals()['multiple_toolsets']} + + if not parallel_state.pool: + parallel_state.pool = multiprocessing.Pool(multiprocessing.cpu_count()) + parallel_state.pool.apply_async( + CallLoadTargetBuildFile, + args = (global_flags, dependency, + variables, includes, depth, check, generator_input_info), + callback = parallel_state.LoadTargetBuildFileCallback) + except KeyboardInterrupt, e: + parallel_state.pool.terminate() + raise e + + parallel_state.condition.release() + + parallel_state.pool.close() + parallel_state.pool.join() + parallel_state.pool = None + + if parallel_state.error: + sys.exit(1) + +# Look for the bracket that matches the first bracket seen in a +# string, and return the start and end as a tuple. For example, if +# the input is something like "<(foo <(bar)) blah", then it would +# return (1, 13), indicating the entire string except for the leading +# "<" and trailing " blah". +LBRACKETS= set('{[(') +BRACKETS = {'}': '{', ']': '[', ')': '('} +def FindEnclosingBracketGroup(input_str): + stack = [] + start = -1 + for index, char in enumerate(input_str): + if char in LBRACKETS: + stack.append(char) + if start == -1: + start = index + elif char in BRACKETS: + if not stack: + return (-1, -1) + if stack.pop() != BRACKETS[char]: + return (-1, -1) + if not stack: + return (start, index + 1) + return (-1, -1) + + +def IsStrCanonicalInt(string): + """Returns True if |string| is in its canonical integer form. + + The canonical form is such that str(int(string)) == string. + """ + if type(string) is str: + # This function is called a lot so for maximum performance, avoid + # involving regexps which would otherwise make the code much + # shorter. Regexps would need twice the time of this function. + if string: + if string == "0": + return True + if string[0] == "-": + string = string[1:] + if not string: + return False + if '1' <= string[0] <= '9': + return string.isdigit() + + return False + + +# This matches things like "<(asdf)", "(?P<(?:(?:!?@?)|\|)?)' + r'(?P[-a-zA-Z0-9_.]+)?' + r'\((?P\s*\[?)' + r'(?P.*?)(\]?)\))') + +# This matches the same as early_variable_re, but with '>' instead of '<'. +late_variable_re = re.compile( + r'(?P(?P>(?:(?:!?@?)|\|)?)' + r'(?P[-a-zA-Z0-9_.]+)?' + r'\((?P\s*\[?)' + r'(?P.*?)(\]?)\))') + +# This matches the same as early_variable_re, but with '^' instead of '<'. +latelate_variable_re = re.compile( + r'(?P(?P[\^](?:(?:!?@?)|\|)?)' + r'(?P[-a-zA-Z0-9_.]+)?' + r'\((?P\s*\[?)' + r'(?P.*?)(\]?)\))') + +# Global cache of results from running commands so they don't have to be run +# more then once. +cached_command_results = {} + + +def FixupPlatformCommand(cmd): + if sys.platform == 'win32': + if type(cmd) is list: + cmd = [re.sub('^cat ', 'type ', cmd[0])] + cmd[1:] + else: + cmd = re.sub('^cat ', 'type ', cmd) + return cmd + + +PHASE_EARLY = 0 +PHASE_LATE = 1 +PHASE_LATELATE = 2 + + +def ExpandVariables(input, phase, variables, build_file): + # Look for the pattern that gets expanded into variables + if phase == PHASE_EARLY: + variable_re = early_variable_re + expansion_symbol = '<' + elif phase == PHASE_LATE: + variable_re = late_variable_re + expansion_symbol = '>' + elif phase == PHASE_LATELATE: + variable_re = latelate_variable_re + expansion_symbol = '^' + else: + assert False + + input_str = str(input) + if IsStrCanonicalInt(input_str): + return int(input_str) + + # Do a quick scan to determine if an expensive regex search is warranted. + if expansion_symbol not in input_str: + return input_str + + # Get the entire list of matches as a list of MatchObject instances. + # (using findall here would return strings instead of MatchObjects). + matches = list(variable_re.finditer(input_str)) + if not matches: + return input_str + + output = input_str + # Reverse the list of matches so that replacements are done right-to-left. + # That ensures that earlier replacements won't mess up the string in a + # way that causes later calls to find the earlier substituted text instead + # of what's intended for replacement. + matches.reverse() + for match_group in matches: + match = match_group.groupdict() + gyp.DebugOutput(gyp.DEBUG_VARIABLES, "Matches: %r", match) + # match['replace'] is the substring to look for, match['type'] + # is the character code for the replacement type (< > ! <| >| <@ + # >@ !@), match['is_array'] contains a '[' for command + # arrays, and match['content'] is the name of the variable (< >) + # or command to run (!). match['command_string'] is an optional + # command string. Currently, only 'pymod_do_main' is supported. + + # run_command is true if a ! variant is used. + run_command = '!' in match['type'] + command_string = match['command_string'] + + # file_list is true if a | variant is used. + file_list = '|' in match['type'] + + # Capture these now so we can adjust them later. + replace_start = match_group.start('replace') + replace_end = match_group.end('replace') + + # Find the ending paren, and re-evaluate the contained string. + (c_start, c_end) = FindEnclosingBracketGroup(input_str[replace_start:]) + + # Adjust the replacement range to match the entire command + # found by FindEnclosingBracketGroup (since the variable_re + # probably doesn't match the entire command if it contained + # nested variables). + replace_end = replace_start + c_end + + # Find the "real" replacement, matching the appropriate closing + # paren, and adjust the replacement start and end. + replacement = input_str[replace_start:replace_end] + + # Figure out what the contents of the variable parens are. + contents_start = replace_start + c_start + 1 + contents_end = replace_end - 1 + contents = input_str[contents_start:contents_end] + + # Do filter substitution now for <|(). + # Admittedly, this is different than the evaluation order in other + # contexts. However, since filtration has no chance to run on <|(), + # this seems like the only obvious way to give them access to filters. + if file_list: + processed_variables = gyp.simple_copy.deepcopy(variables) + ProcessListFiltersInDict(contents, processed_variables) + # Recurse to expand variables in the contents + contents = ExpandVariables(contents, phase, + processed_variables, build_file) + else: + # Recurse to expand variables in the contents + contents = ExpandVariables(contents, phase, variables, build_file) + + # Strip off leading/trailing whitespace so that variable matches are + # simpler below (and because they are rarely needed). + contents = contents.strip() + + # expand_to_list is true if an @ variant is used. In that case, + # the expansion should result in a list. Note that the caller + # is to be expecting a list in return, and not all callers do + # because not all are working in list context. Also, for list + # expansions, there can be no other text besides the variable + # expansion in the input string. + expand_to_list = '@' in match['type'] and input_str == replacement + + if run_command or file_list: + # Find the build file's directory, so commands can be run or file lists + # generated relative to it. + build_file_dir = os.path.dirname(build_file) + if build_file_dir == '' and not file_list: + # If build_file is just a leaf filename indicating a file in the + # current directory, build_file_dir might be an empty string. Set + # it to None to signal to subprocess.Popen that it should run the + # command in the current directory. + build_file_dir = None + + # Support <|(listfile.txt ...) which generates a file + # containing items from a gyp list, generated at gyp time. + # This works around actions/rules which have more inputs than will + # fit on the command line. + if file_list: + if type(contents) is list: + contents_list = contents + else: + contents_list = contents.split(' ') + replacement = contents_list[0] + if os.path.isabs(replacement): + raise GypError('| cannot handle absolute paths, got "%s"' % replacement) + + if not generator_filelist_paths: + path = os.path.join(build_file_dir, replacement) + else: + if os.path.isabs(build_file_dir): + toplevel = generator_filelist_paths['toplevel'] + rel_build_file_dir = gyp.common.RelativePath(build_file_dir, toplevel) + else: + rel_build_file_dir = build_file_dir + qualified_out_dir = generator_filelist_paths['qualified_out_dir'] + path = os.path.join(qualified_out_dir, rel_build_file_dir, replacement) + gyp.common.EnsureDirExists(path) + + replacement = gyp.common.RelativePath(path, build_file_dir) + f = gyp.common.WriteOnDiff(path) + for i in contents_list[1:]: + f.write('%s\n' % i) + f.close() + + elif run_command: + use_shell = True + if match['is_array']: + contents = eval(contents) + use_shell = False + + # Check for a cached value to avoid executing commands, or generating + # file lists more than once. The cache key contains the command to be + # run as well as the directory to run it from, to account for commands + # that depend on their current directory. + # TODO(http://code.google.com/p/gyp/issues/detail?id=111): In theory, + # someone could author a set of GYP files where each time the command + # is invoked it produces different output by design. When the need + # arises, the syntax should be extended to support no caching off a + # command's output so it is run every time. + cache_key = (str(contents), build_file_dir) + cached_value = cached_command_results.get(cache_key, None) + if cached_value is None: + gyp.DebugOutput(gyp.DEBUG_VARIABLES, + "Executing command '%s' in directory '%s'", + contents, build_file_dir) + + replacement = '' + + if command_string == 'pymod_do_main': + # (sources/) etc. to resolve to + # and empty list if undefined. This allows actions to: + # 'action!': [ + # '>@(_sources!)', + # ], + # 'action/': [ + # '>@(_sources/)', + # ], + replacement = [] + else: + raise GypError('Undefined variable ' + contents + + ' in ' + build_file) + else: + replacement = variables[contents] + + if type(replacement) is list: + for item in replacement: + if not contents[-1] == '/' and type(item) not in (str, int): + raise GypError('Variable ' + contents + + ' must expand to a string or list of strings; ' + + 'list contains a ' + + item.__class__.__name__) + # Run through the list and handle variable expansions in it. Since + # the list is guaranteed not to contain dicts, this won't do anything + # with conditions sections. + ProcessVariablesAndConditionsInList(replacement, phase, variables, + build_file) + elif type(replacement) not in (str, int): + raise GypError('Variable ' + contents + + ' must expand to a string or list of strings; ' + + 'found a ' + replacement.__class__.__name__) + + if expand_to_list: + # Expanding in list context. It's guaranteed that there's only one + # replacement to do in |input_str| and that it's this replacement. See + # above. + if type(replacement) is list: + # If it's already a list, make a copy. + output = replacement[:] + else: + # Split it the same way sh would split arguments. + output = shlex.split(str(replacement)) + else: + # Expanding in string context. + encoded_replacement = '' + if type(replacement) is list: + # When expanding a list into string context, turn the list items + # into a string in a way that will work with a subprocess call. + # + # TODO(mark): This isn't completely correct. This should + # call a generator-provided function that observes the + # proper list-to-argument quoting rules on a specific + # platform instead of just calling the POSIX encoding + # routine. + encoded_replacement = gyp.common.EncodePOSIXShellList(replacement) + else: + encoded_replacement = replacement + + output = output[:replace_start] + str(encoded_replacement) + \ + output[replace_end:] + # Prepare for the next match iteration. + input_str = output + + if output == input: + gyp.DebugOutput(gyp.DEBUG_VARIABLES, + "Found only identity matches on %r, avoiding infinite " + "recursion.", + output) + else: + # Look for more matches now that we've replaced some, to deal with + # expanding local variables (variables defined in the same + # variables block as this one). + gyp.DebugOutput(gyp.DEBUG_VARIABLES, "Found output %r, recursing.", output) + if type(output) is list: + if output and type(output[0]) is list: + # Leave output alone if it's a list of lists. + # We don't want such lists to be stringified. + pass + else: + new_output = [] + for item in output: + new_output.append( + ExpandVariables(item, phase, variables, build_file)) + output = new_output + else: + output = ExpandVariables(output, phase, variables, build_file) + + # Convert all strings that are canonically-represented integers into integers. + if type(output) is list: + for index in xrange(0, len(output)): + if IsStrCanonicalInt(output[index]): + output[index] = int(output[index]) + elif IsStrCanonicalInt(output): + output = int(output) + + return output + +# The same condition is often evaluated over and over again so it +# makes sense to cache as much as possible between evaluations. +cached_conditions_asts = {} + +def EvalCondition(condition, conditions_key, phase, variables, build_file): + """Returns the dict that should be used or None if the result was + that nothing should be used.""" + if type(condition) is not list: + raise GypError(conditions_key + ' must be a list') + if len(condition) < 2: + # It's possible that condition[0] won't work in which case this + # attempt will raise its own IndexError. That's probably fine. + raise GypError(conditions_key + ' ' + condition[0] + + ' must be at least length 2, not ' + str(len(condition))) + + i = 0 + result = None + while i < len(condition): + cond_expr = condition[i] + true_dict = condition[i + 1] + if type(true_dict) is not dict: + raise GypError('{} {} must be followed by a dictionary, not {}'.format( + conditions_key, cond_expr, type(true_dict))) + if len(condition) > i + 2 and type(condition[i + 2]) is dict: + false_dict = condition[i + 2] + i = i + 3 + if i != len(condition): + raise GypError('{} {} has {} unexpected trailing items'.format( + conditions_key, cond_expr, len(condition) - i)) + else: + false_dict = None + i = i + 2 + if result == None: + result = EvalSingleCondition( + cond_expr, true_dict, false_dict, phase, variables, build_file) + + return result + + +def EvalSingleCondition( + cond_expr, true_dict, false_dict, phase, variables, build_file): + """Returns true_dict if cond_expr evaluates to true, and false_dict + otherwise.""" + # Do expansions on the condition itself. Since the conditon can naturally + # contain variable references without needing to resort to GYP expansion + # syntax, this is of dubious value for variables, but someone might want to + # use a command expansion directly inside a condition. + cond_expr_expanded = ExpandVariables(cond_expr, phase, variables, + build_file) + if type(cond_expr_expanded) not in (str, int): + raise ValueError( + 'Variable expansion in this context permits str and int ' + \ + 'only, found ' + cond_expr_expanded.__class__.__name__) + + try: + if cond_expr_expanded in cached_conditions_asts: + ast_code = cached_conditions_asts[cond_expr_expanded] + else: + ast_code = compile(cond_expr_expanded, '', 'eval') + cached_conditions_asts[cond_expr_expanded] = ast_code + if eval(ast_code, {'__builtins__': None}, variables): + return true_dict + return false_dict + except SyntaxError, e: + syntax_error = SyntaxError('%s while evaluating condition \'%s\' in %s ' + 'at character %d.' % + (str(e.args[0]), e.text, build_file, e.offset), + e.filename, e.lineno, e.offset, e.text) + raise syntax_error + except NameError, e: + gyp.common.ExceptionAppend(e, 'while evaluating condition \'%s\' in %s' % + (cond_expr_expanded, build_file)) + raise GypError(e) + + +def ProcessConditionsInDict(the_dict, phase, variables, build_file): + # Process a 'conditions' or 'target_conditions' section in the_dict, + # depending on phase. + # early -> conditions + # late -> target_conditions + # latelate -> no conditions + # + # Each item in a conditions list consists of cond_expr, a string expression + # evaluated as the condition, and true_dict, a dict that will be merged into + # the_dict if cond_expr evaluates to true. Optionally, a third item, + # false_dict, may be present. false_dict is merged into the_dict if + # cond_expr evaluates to false. + # + # Any dict merged into the_dict will be recursively processed for nested + # conditionals and other expansions, also according to phase, immediately + # prior to being merged. + + if phase == PHASE_EARLY: + conditions_key = 'conditions' + elif phase == PHASE_LATE: + conditions_key = 'target_conditions' + elif phase == PHASE_LATELATE: + return + else: + assert False + + if not conditions_key in the_dict: + return + + conditions_list = the_dict[conditions_key] + # Unhook the conditions list, it's no longer needed. + del the_dict[conditions_key] + + for condition in conditions_list: + merge_dict = EvalCondition(condition, conditions_key, phase, variables, + build_file) + + if merge_dict != None: + # Expand variables and nested conditinals in the merge_dict before + # merging it. + ProcessVariablesAndConditionsInDict(merge_dict, phase, + variables, build_file) + + MergeDicts(the_dict, merge_dict, build_file, build_file) + + +def LoadAutomaticVariablesFromDict(variables, the_dict): + # Any keys with plain string values in the_dict become automatic variables. + # The variable name is the key name with a "_" character prepended. + for key, value in the_dict.iteritems(): + if type(value) in (str, int, list): + variables['_' + key] = value + + +def LoadVariablesFromVariablesDict(variables, the_dict, the_dict_key): + # Any keys in the_dict's "variables" dict, if it has one, becomes a + # variable. The variable name is the key name in the "variables" dict. + # Variables that end with the % character are set only if they are unset in + # the variables dict. the_dict_key is the name of the key that accesses + # the_dict in the_dict's parent dict. If the_dict's parent is not a dict + # (it could be a list or it could be parentless because it is a root dict), + # the_dict_key will be None. + for key, value in the_dict.get('variables', {}).iteritems(): + if type(value) not in (str, int, list): + continue + + if key.endswith('%'): + variable_name = key[:-1] + if variable_name in variables: + # If the variable is already set, don't set it. + continue + if the_dict_key is 'variables' and variable_name in the_dict: + # If the variable is set without a % in the_dict, and the_dict is a + # variables dict (making |variables| a varaibles sub-dict of a + # variables dict), use the_dict's definition. + value = the_dict[variable_name] + else: + variable_name = key + + variables[variable_name] = value + + +def ProcessVariablesAndConditionsInDict(the_dict, phase, variables_in, + build_file, the_dict_key=None): + """Handle all variable and command expansion and conditional evaluation. + + This function is the public entry point for all variable expansions and + conditional evaluations. The variables_in dictionary will not be modified + by this function. + """ + + # Make a copy of the variables_in dict that can be modified during the + # loading of automatics and the loading of the variables dict. + variables = variables_in.copy() + LoadAutomaticVariablesFromDict(variables, the_dict) + + if 'variables' in the_dict: + # Make sure all the local variables are added to the variables + # list before we process them so that you can reference one + # variable from another. They will be fully expanded by recursion + # in ExpandVariables. + for key, value in the_dict['variables'].iteritems(): + variables[key] = value + + # Handle the associated variables dict first, so that any variable + # references within can be resolved prior to using them as variables. + # Pass a copy of the variables dict to avoid having it be tainted. + # Otherwise, it would have extra automatics added for everything that + # should just be an ordinary variable in this scope. + ProcessVariablesAndConditionsInDict(the_dict['variables'], phase, + variables, build_file, 'variables') + + LoadVariablesFromVariablesDict(variables, the_dict, the_dict_key) + + for key, value in the_dict.iteritems(): + # Skip "variables", which was already processed if present. + if key != 'variables' and type(value) is str: + expanded = ExpandVariables(value, phase, variables, build_file) + if type(expanded) not in (str, int): + raise ValueError( + 'Variable expansion in this context permits str and int ' + \ + 'only, found ' + expanded.__class__.__name__ + ' for ' + key) + the_dict[key] = expanded + + # Variable expansion may have resulted in changes to automatics. Reload. + # TODO(mark): Optimization: only reload if no changes were made. + variables = variables_in.copy() + LoadAutomaticVariablesFromDict(variables, the_dict) + LoadVariablesFromVariablesDict(variables, the_dict, the_dict_key) + + # Process conditions in this dict. This is done after variable expansion + # so that conditions may take advantage of expanded variables. For example, + # if the_dict contains: + # {'type': '<(library_type)', + # 'conditions': [['_type=="static_library"', { ... }]]}, + # _type, as used in the condition, will only be set to the value of + # library_type if variable expansion is performed before condition + # processing. However, condition processing should occur prior to recursion + # so that variables (both automatic and "variables" dict type) may be + # adjusted by conditions sections, merged into the_dict, and have the + # intended impact on contained dicts. + # + # This arrangement means that a "conditions" section containing a "variables" + # section will only have those variables effective in subdicts, not in + # the_dict. The workaround is to put a "conditions" section within a + # "variables" section. For example: + # {'conditions': [['os=="mac"', {'variables': {'define': 'IS_MAC'}}]], + # 'defines': ['<(define)'], + # 'my_subdict': {'defines': ['<(define)']}}, + # will not result in "IS_MAC" being appended to the "defines" list in the + # current scope but would result in it being appended to the "defines" list + # within "my_subdict". By comparison: + # {'variables': {'conditions': [['os=="mac"', {'define': 'IS_MAC'}]]}, + # 'defines': ['<(define)'], + # 'my_subdict': {'defines': ['<(define)']}}, + # will append "IS_MAC" to both "defines" lists. + + # Evaluate conditions sections, allowing variable expansions within them + # as well as nested conditionals. This will process a 'conditions' or + # 'target_conditions' section, perform appropriate merging and recursive + # conditional and variable processing, and then remove the conditions section + # from the_dict if it is present. + ProcessConditionsInDict(the_dict, phase, variables, build_file) + + # Conditional processing may have resulted in changes to automatics or the + # variables dict. Reload. + variables = variables_in.copy() + LoadAutomaticVariablesFromDict(variables, the_dict) + LoadVariablesFromVariablesDict(variables, the_dict, the_dict_key) + + # Recurse into child dicts, or process child lists which may result in + # further recursion into descendant dicts. + for key, value in the_dict.iteritems(): + # Skip "variables" and string values, which were already processed if + # present. + if key == 'variables' or type(value) is str: + continue + if type(value) is dict: + # Pass a copy of the variables dict so that subdicts can't influence + # parents. + ProcessVariablesAndConditionsInDict(value, phase, variables, + build_file, key) + elif type(value) is list: + # The list itself can't influence the variables dict, and + # ProcessVariablesAndConditionsInList will make copies of the variables + # dict if it needs to pass it to something that can influence it. No + # copy is necessary here. + ProcessVariablesAndConditionsInList(value, phase, variables, + build_file) + elif type(value) is not int: + raise TypeError('Unknown type ' + value.__class__.__name__ + \ + ' for ' + key) + + +def ProcessVariablesAndConditionsInList(the_list, phase, variables, + build_file): + # Iterate using an index so that new values can be assigned into the_list. + index = 0 + while index < len(the_list): + item = the_list[index] + if type(item) is dict: + # Make a copy of the variables dict so that it won't influence anything + # outside of its own scope. + ProcessVariablesAndConditionsInDict(item, phase, variables, build_file) + elif type(item) is list: + ProcessVariablesAndConditionsInList(item, phase, variables, build_file) + elif type(item) is str: + expanded = ExpandVariables(item, phase, variables, build_file) + if type(expanded) in (str, int): + the_list[index] = expanded + elif type(expanded) is list: + the_list[index:index+1] = expanded + index += len(expanded) + + # index now identifies the next item to examine. Continue right now + # without falling into the index increment below. + continue + else: + raise ValueError( + 'Variable expansion in this context permits strings and ' + \ + 'lists only, found ' + expanded.__class__.__name__ + ' at ' + \ + index) + elif type(item) is not int: + raise TypeError('Unknown type ' + item.__class__.__name__ + \ + ' at index ' + index) + index = index + 1 + + +def BuildTargetsDict(data): + """Builds a dict mapping fully-qualified target names to their target dicts. + + |data| is a dict mapping loaded build files by pathname relative to the + current directory. Values in |data| are build file contents. For each + |data| value with a "targets" key, the value of the "targets" key is taken + as a list containing target dicts. Each target's fully-qualified name is + constructed from the pathname of the build file (|data| key) and its + "target_name" property. These fully-qualified names are used as the keys + in the returned dict. These keys provide access to the target dicts, + the dicts in the "targets" lists. + """ + + targets = {} + for build_file in data['target_build_files']: + for target in data[build_file].get('targets', []): + target_name = gyp.common.QualifiedTarget(build_file, + target['target_name'], + target['toolset']) + if target_name in targets: + raise GypError('Duplicate target definitions for ' + target_name) + targets[target_name] = target + + return targets + + +def QualifyDependencies(targets): + """Make dependency links fully-qualified relative to the current directory. + + |targets| is a dict mapping fully-qualified target names to their target + dicts. For each target in this dict, keys known to contain dependency + links are examined, and any dependencies referenced will be rewritten + so that they are fully-qualified and relative to the current directory. + All rewritten dependencies are suitable for use as keys to |targets| or a + similar dict. + """ + + all_dependency_sections = [dep + op + for dep in dependency_sections + for op in ('', '!', '/')] + + for target, target_dict in targets.iteritems(): + target_build_file = gyp.common.BuildFile(target) + toolset = target_dict['toolset'] + for dependency_key in all_dependency_sections: + dependencies = target_dict.get(dependency_key, []) + for index in xrange(0, len(dependencies)): + dep_file, dep_target, dep_toolset = gyp.common.ResolveTarget( + target_build_file, dependencies[index], toolset) + if not multiple_toolsets: + # Ignore toolset specification in the dependency if it is specified. + dep_toolset = toolset + dependency = gyp.common.QualifiedTarget(dep_file, + dep_target, + dep_toolset) + dependencies[index] = dependency + + # Make sure anything appearing in a list other than "dependencies" also + # appears in the "dependencies" list. + if dependency_key != 'dependencies' and \ + dependency not in target_dict['dependencies']: + raise GypError('Found ' + dependency + ' in ' + dependency_key + + ' of ' + target + ', but not in dependencies') + + +def ExpandWildcardDependencies(targets, data): + """Expands dependencies specified as build_file:*. + + For each target in |targets|, examines sections containing links to other + targets. If any such section contains a link of the form build_file:*, it + is taken as a wildcard link, and is expanded to list each target in + build_file. The |data| dict provides access to build file dicts. + + Any target that does not wish to be included by wildcard can provide an + optional "suppress_wildcard" key in its target dict. When present and + true, a wildcard dependency link will not include such targets. + + All dependency names, including the keys to |targets| and the values in each + dependency list, must be qualified when this function is called. + """ + + for target, target_dict in targets.iteritems(): + toolset = target_dict['toolset'] + target_build_file = gyp.common.BuildFile(target) + for dependency_key in dependency_sections: + dependencies = target_dict.get(dependency_key, []) + + # Loop this way instead of "for dependency in" or "for index in xrange" + # because the dependencies list will be modified within the loop body. + index = 0 + while index < len(dependencies): + (dependency_build_file, dependency_target, dependency_toolset) = \ + gyp.common.ParseQualifiedTarget(dependencies[index]) + if dependency_target != '*' and dependency_toolset != '*': + # Not a wildcard. Keep it moving. + index = index + 1 + continue + + if dependency_build_file == target_build_file: + # It's an error for a target to depend on all other targets in + # the same file, because a target cannot depend on itself. + raise GypError('Found wildcard in ' + dependency_key + ' of ' + + target + ' referring to same build file') + + # Take the wildcard out and adjust the index so that the next + # dependency in the list will be processed the next time through the + # loop. + del dependencies[index] + index = index - 1 + + # Loop through the targets in the other build file, adding them to + # this target's list of dependencies in place of the removed + # wildcard. + dependency_target_dicts = data[dependency_build_file]['targets'] + for dependency_target_dict in dependency_target_dicts: + if int(dependency_target_dict.get('suppress_wildcard', False)): + continue + dependency_target_name = dependency_target_dict['target_name'] + if (dependency_target != '*' and + dependency_target != dependency_target_name): + continue + dependency_target_toolset = dependency_target_dict['toolset'] + if (dependency_toolset != '*' and + dependency_toolset != dependency_target_toolset): + continue + dependency = gyp.common.QualifiedTarget(dependency_build_file, + dependency_target_name, + dependency_target_toolset) + index = index + 1 + dependencies.insert(index, dependency) + + index = index + 1 + + +def Unify(l): + """Removes duplicate elements from l, keeping the first element.""" + seen = {} + return [seen.setdefault(e, e) for e in l if e not in seen] + + +def RemoveDuplicateDependencies(targets): + """Makes sure every dependency appears only once in all targets's dependency + lists.""" + for target_name, target_dict in targets.iteritems(): + for dependency_key in dependency_sections: + dependencies = target_dict.get(dependency_key, []) + if dependencies: + target_dict[dependency_key] = Unify(dependencies) + + +def Filter(l, item): + """Removes item from l.""" + res = {} + return [res.setdefault(e, e) for e in l if e != item] + + +def RemoveSelfDependencies(targets): + """Remove self dependencies from targets that have the prune_self_dependency + variable set.""" + for target_name, target_dict in targets.iteritems(): + for dependency_key in dependency_sections: + dependencies = target_dict.get(dependency_key, []) + if dependencies: + for t in dependencies: + if t == target_name: + if targets[t].get('variables', {}).get('prune_self_dependency', 0): + target_dict[dependency_key] = Filter(dependencies, target_name) + + +def RemoveLinkDependenciesFromNoneTargets(targets): + """Remove dependencies having the 'link_dependency' attribute from the 'none' + targets.""" + for target_name, target_dict in targets.iteritems(): + for dependency_key in dependency_sections: + dependencies = target_dict.get(dependency_key, []) + if dependencies: + for t in dependencies: + if target_dict.get('type', None) == 'none': + if targets[t].get('variables', {}).get('link_dependency', 0): + target_dict[dependency_key] = \ + Filter(target_dict[dependency_key], t) + + +class DependencyGraphNode(object): + """ + + Attributes: + ref: A reference to an object that this DependencyGraphNode represents. + dependencies: List of DependencyGraphNodes on which this one depends. + dependents: List of DependencyGraphNodes that depend on this one. + """ + + class CircularException(GypError): + pass + + def __init__(self, ref): + self.ref = ref + self.dependencies = [] + self.dependents = [] + + def __repr__(self): + return '' % self.ref + + def FlattenToList(self): + # flat_list is the sorted list of dependencies - actually, the list items + # are the "ref" attributes of DependencyGraphNodes. Every target will + # appear in flat_list after all of its dependencies, and before all of its + # dependents. + flat_list = OrderedSet() + + # in_degree_zeros is the list of DependencyGraphNodes that have no + # dependencies not in flat_list. Initially, it is a copy of the children + # of this node, because when the graph was built, nodes with no + # dependencies were made implicit dependents of the root node. + in_degree_zeros = set(self.dependents[:]) + + while in_degree_zeros: + # Nodes in in_degree_zeros have no dependencies not in flat_list, so they + # can be appended to flat_list. Take these nodes out of in_degree_zeros + # as work progresses, so that the next node to process from the list can + # always be accessed at a consistent position. + node = in_degree_zeros.pop() + flat_list.add(node.ref) + + # Look at dependents of the node just added to flat_list. Some of them + # may now belong in in_degree_zeros. + for node_dependent in node.dependents: + is_in_degree_zero = True + # TODO: We want to check through the + # node_dependent.dependencies list but if it's long and we + # always start at the beginning, then we get O(n^2) behaviour. + for node_dependent_dependency in node_dependent.dependencies: + if not node_dependent_dependency.ref in flat_list: + # The dependent one or more dependencies not in flat_list. There + # will be more chances to add it to flat_list when examining + # it again as a dependent of those other dependencies, provided + # that there are no cycles. + is_in_degree_zero = False + break + + if is_in_degree_zero: + # All of the dependent's dependencies are already in flat_list. Add + # it to in_degree_zeros where it will be processed in a future + # iteration of the outer loop. + in_degree_zeros.add(node_dependent) + + return list(flat_list) + + def FindCycles(self): + """ + Returns a list of cycles in the graph, where each cycle is its own list. + """ + results = [] + visited = set() + + def Visit(node, path): + for child in node.dependents: + if child in path: + results.append([child] + path[:path.index(child) + 1]) + elif not child in visited: + visited.add(child) + Visit(child, [child] + path) + + visited.add(self) + Visit(self, [self]) + + return results + + def DirectDependencies(self, dependencies=None): + """Returns a list of just direct dependencies.""" + if dependencies == None: + dependencies = [] + + for dependency in self.dependencies: + # Check for None, corresponding to the root node. + if dependency.ref != None and dependency.ref not in dependencies: + dependencies.append(dependency.ref) + + return dependencies + + def _AddImportedDependencies(self, targets, dependencies=None): + """Given a list of direct dependencies, adds indirect dependencies that + other dependencies have declared to export their settings. + + This method does not operate on self. Rather, it operates on the list + of dependencies in the |dependencies| argument. For each dependency in + that list, if any declares that it exports the settings of one of its + own dependencies, those dependencies whose settings are "passed through" + are added to the list. As new items are added to the list, they too will + be processed, so it is possible to import settings through multiple levels + of dependencies. + + This method is not terribly useful on its own, it depends on being + "primed" with a list of direct dependencies such as one provided by + DirectDependencies. DirectAndImportedDependencies is intended to be the + public entry point. + """ + + if dependencies == None: + dependencies = [] + + index = 0 + while index < len(dependencies): + dependency = dependencies[index] + dependency_dict = targets[dependency] + # Add any dependencies whose settings should be imported to the list + # if not already present. Newly-added items will be checked for + # their own imports when the list iteration reaches them. + # Rather than simply appending new items, insert them after the + # dependency that exported them. This is done to more closely match + # the depth-first method used by DeepDependencies. + add_index = 1 + for imported_dependency in \ + dependency_dict.get('export_dependent_settings', []): + if imported_dependency not in dependencies: + dependencies.insert(index + add_index, imported_dependency) + add_index = add_index + 1 + index = index + 1 + + return dependencies + + def DirectAndImportedDependencies(self, targets, dependencies=None): + """Returns a list of a target's direct dependencies and all indirect + dependencies that a dependency has advertised settings should be exported + through the dependency for. + """ + + dependencies = self.DirectDependencies(dependencies) + return self._AddImportedDependencies(targets, dependencies) + + def DeepDependencies(self, dependencies=None): + """Returns an OrderedSet of all of a target's dependencies, recursively.""" + if dependencies is None: + # Using a list to get ordered output and a set to do fast "is it + # already added" checks. + dependencies = OrderedSet() + + for dependency in self.dependencies: + # Check for None, corresponding to the root node. + if dependency.ref is None: + continue + if dependency.ref not in dependencies: + dependency.DeepDependencies(dependencies) + dependencies.add(dependency.ref) + + return dependencies + + def _LinkDependenciesInternal(self, targets, include_shared_libraries, + dependencies=None, initial=True): + """Returns an OrderedSet of dependency targets that are linked + into this target. + + This function has a split personality, depending on the setting of + |initial|. Outside callers should always leave |initial| at its default + setting. + + When adding a target to the list of dependencies, this function will + recurse into itself with |initial| set to False, to collect dependencies + that are linked into the linkable target for which the list is being built. + + If |include_shared_libraries| is False, the resulting dependencies will not + include shared_library targets that are linked into this target. + """ + if dependencies is None: + # Using a list to get ordered output and a set to do fast "is it + # already added" checks. + dependencies = OrderedSet() + + # Check for None, corresponding to the root node. + if self.ref is None: + return dependencies + + # It's kind of sucky that |targets| has to be passed into this function, + # but that's presently the easiest way to access the target dicts so that + # this function can find target types. + + if 'target_name' not in targets[self.ref]: + raise GypError("Missing 'target_name' field in target.") + + if 'type' not in targets[self.ref]: + raise GypError("Missing 'type' field in target %s" % + targets[self.ref]['target_name']) + + target_type = targets[self.ref]['type'] + + is_linkable = target_type in linkable_types + + if initial and not is_linkable: + # If this is the first target being examined and it's not linkable, + # return an empty list of link dependencies, because the link + # dependencies are intended to apply to the target itself (initial is + # True) and this target won't be linked. + return dependencies + + # Don't traverse 'none' targets if explicitly excluded. + if (target_type == 'none' and + not targets[self.ref].get('dependencies_traverse', True)): + dependencies.add(self.ref) + return dependencies + + # Executables, mac kernel extensions and loadable modules are already fully + # and finally linked. Nothing else can be a link dependency of them, there + # can only be dependencies in the sense that a dependent target might run + # an executable or load the loadable_module. + if not initial and target_type in ('executable', 'loadable_module', + 'mac_kernel_extension'): + return dependencies + + # Shared libraries are already fully linked. They should only be included + # in |dependencies| when adjusting static library dependencies (in order to + # link against the shared_library's import lib), but should not be included + # in |dependencies| when propagating link_settings. + # The |include_shared_libraries| flag controls which of these two cases we + # are handling. + if (not initial and target_type == 'shared_library' and + not include_shared_libraries): + return dependencies + + # The target is linkable, add it to the list of link dependencies. + if self.ref not in dependencies: + dependencies.add(self.ref) + if initial or not is_linkable: + # If this is a subsequent target and it's linkable, don't look any + # further for linkable dependencies, as they'll already be linked into + # this target linkable. Always look at dependencies of the initial + # target, and always look at dependencies of non-linkables. + for dependency in self.dependencies: + dependency._LinkDependenciesInternal(targets, + include_shared_libraries, + dependencies, False) + + return dependencies + + def DependenciesForLinkSettings(self, targets): + """ + Returns a list of dependency targets whose link_settings should be merged + into this target. + """ + + # TODO(sbaig) Currently, chrome depends on the bug that shared libraries' + # link_settings are propagated. So for now, we will allow it, unless the + # 'allow_sharedlib_linksettings_propagation' flag is explicitly set to + # False. Once chrome is fixed, we can remove this flag. + include_shared_libraries = \ + targets[self.ref].get('allow_sharedlib_linksettings_propagation', True) + return self._LinkDependenciesInternal(targets, include_shared_libraries) + + def DependenciesToLinkAgainst(self, targets): + """ + Returns a list of dependency targets that are linked into this target. + """ + return self._LinkDependenciesInternal(targets, True) + + +def BuildDependencyList(targets): + # Create a DependencyGraphNode for each target. Put it into a dict for easy + # access. + dependency_nodes = {} + for target, spec in targets.iteritems(): + if target not in dependency_nodes: + dependency_nodes[target] = DependencyGraphNode(target) + + # Set up the dependency links. Targets that have no dependencies are treated + # as dependent on root_node. + root_node = DependencyGraphNode(None) + for target, spec in targets.iteritems(): + target_node = dependency_nodes[target] + target_build_file = gyp.common.BuildFile(target) + dependencies = spec.get('dependencies') + if not dependencies: + target_node.dependencies = [root_node] + root_node.dependents.append(target_node) + else: + for dependency in dependencies: + dependency_node = dependency_nodes.get(dependency) + if not dependency_node: + raise GypError("Dependency '%s' not found while " + "trying to load target %s" % (dependency, target)) + target_node.dependencies.append(dependency_node) + dependency_node.dependents.append(target_node) + + flat_list = root_node.FlattenToList() + + # If there's anything left unvisited, there must be a circular dependency + # (cycle). + if len(flat_list) != len(targets): + if not root_node.dependents: + # If all targets have dependencies, add the first target as a dependent + # of root_node so that the cycle can be discovered from root_node. + target = targets.keys()[0] + target_node = dependency_nodes[target] + target_node.dependencies.append(root_node) + root_node.dependents.append(target_node) + + cycles = [] + for cycle in root_node.FindCycles(): + paths = [node.ref for node in cycle] + cycles.append('Cycle: %s' % ' -> '.join(paths)) + raise DependencyGraphNode.CircularException( + 'Cycles in dependency graph detected:\n' + '\n'.join(cycles)) + + return [dependency_nodes, flat_list] + + +def VerifyNoGYPFileCircularDependencies(targets): + # Create a DependencyGraphNode for each gyp file containing a target. Put + # it into a dict for easy access. + dependency_nodes = {} + for target in targets.iterkeys(): + build_file = gyp.common.BuildFile(target) + if not build_file in dependency_nodes: + dependency_nodes[build_file] = DependencyGraphNode(build_file) + + # Set up the dependency links. + for target, spec in targets.iteritems(): + build_file = gyp.common.BuildFile(target) + build_file_node = dependency_nodes[build_file] + target_dependencies = spec.get('dependencies', []) + for dependency in target_dependencies: + try: + dependency_build_file = gyp.common.BuildFile(dependency) + except GypError, e: + gyp.common.ExceptionAppend( + e, 'while computing dependencies of .gyp file %s' % build_file) + raise + + if dependency_build_file == build_file: + # A .gyp file is allowed to refer back to itself. + continue + dependency_node = dependency_nodes.get(dependency_build_file) + if not dependency_node: + raise GypError("Dependancy '%s' not found" % dependency_build_file) + if dependency_node not in build_file_node.dependencies: + build_file_node.dependencies.append(dependency_node) + dependency_node.dependents.append(build_file_node) + + + # Files that have no dependencies are treated as dependent on root_node. + root_node = DependencyGraphNode(None) + for build_file_node in dependency_nodes.itervalues(): + if len(build_file_node.dependencies) == 0: + build_file_node.dependencies.append(root_node) + root_node.dependents.append(build_file_node) + + flat_list = root_node.FlattenToList() + + # If there's anything left unvisited, there must be a circular dependency + # (cycle). + if len(flat_list) != len(dependency_nodes): + if not root_node.dependents: + # If all files have dependencies, add the first file as a dependent + # of root_node so that the cycle can be discovered from root_node. + file_node = dependency_nodes.values()[0] + file_node.dependencies.append(root_node) + root_node.dependents.append(file_node) + cycles = [] + for cycle in root_node.FindCycles(): + paths = [node.ref for node in cycle] + cycles.append('Cycle: %s' % ' -> '.join(paths)) + raise DependencyGraphNode.CircularException( + 'Cycles in .gyp file dependency graph detected:\n' + '\n'.join(cycles)) + + +def DoDependentSettings(key, flat_list, targets, dependency_nodes): + # key should be one of all_dependent_settings, direct_dependent_settings, + # or link_settings. + + for target in flat_list: + target_dict = targets[target] + build_file = gyp.common.BuildFile(target) + + if key == 'all_dependent_settings': + dependencies = dependency_nodes[target].DeepDependencies() + elif key == 'direct_dependent_settings': + dependencies = \ + dependency_nodes[target].DirectAndImportedDependencies(targets) + elif key == 'link_settings': + dependencies = \ + dependency_nodes[target].DependenciesForLinkSettings(targets) + else: + raise GypError("DoDependentSettings doesn't know how to determine " + 'dependencies for ' + key) + + for dependency in dependencies: + dependency_dict = targets[dependency] + if not key in dependency_dict: + continue + dependency_build_file = gyp.common.BuildFile(dependency) + MergeDicts(target_dict, dependency_dict[key], + build_file, dependency_build_file) + + +def AdjustStaticLibraryDependencies(flat_list, targets, dependency_nodes, + sort_dependencies): + # Recompute target "dependencies" properties. For each static library + # target, remove "dependencies" entries referring to other static libraries, + # unless the dependency has the "hard_dependency" attribute set. For each + # linkable target, add a "dependencies" entry referring to all of the + # target's computed list of link dependencies (including static libraries + # if no such entry is already present. + for target in flat_list: + target_dict = targets[target] + target_type = target_dict['type'] + + if target_type == 'static_library': + if not 'dependencies' in target_dict: + continue + + target_dict['dependencies_original'] = target_dict.get( + 'dependencies', [])[:] + + # A static library should not depend on another static library unless + # the dependency relationship is "hard," which should only be done when + # a dependent relies on some side effect other than just the build + # product, like a rule or action output. Further, if a target has a + # non-hard dependency, but that dependency exports a hard dependency, + # the non-hard dependency can safely be removed, but the exported hard + # dependency must be added to the target to keep the same dependency + # ordering. + dependencies = \ + dependency_nodes[target].DirectAndImportedDependencies(targets) + index = 0 + while index < len(dependencies): + dependency = dependencies[index] + dependency_dict = targets[dependency] + + # Remove every non-hard static library dependency and remove every + # non-static library dependency that isn't a direct dependency. + if (dependency_dict['type'] == 'static_library' and \ + not dependency_dict.get('hard_dependency', False)) or \ + (dependency_dict['type'] != 'static_library' and \ + not dependency in target_dict['dependencies']): + # Take the dependency out of the list, and don't increment index + # because the next dependency to analyze will shift into the index + # formerly occupied by the one being removed. + del dependencies[index] + else: + index = index + 1 + + # Update the dependencies. If the dependencies list is empty, it's not + # needed, so unhook it. + if len(dependencies) > 0: + target_dict['dependencies'] = dependencies + else: + del target_dict['dependencies'] + + elif target_type in linkable_types: + # Get a list of dependency targets that should be linked into this + # target. Add them to the dependencies list if they're not already + # present. + + link_dependencies = \ + dependency_nodes[target].DependenciesToLinkAgainst(targets) + for dependency in link_dependencies: + if dependency == target: + continue + if not 'dependencies' in target_dict: + target_dict['dependencies'] = [] + if not dependency in target_dict['dependencies']: + target_dict['dependencies'].append(dependency) + # Sort the dependencies list in the order from dependents to dependencies. + # e.g. If A and B depend on C and C depends on D, sort them in A, B, C, D. + # Note: flat_list is already sorted in the order from dependencies to + # dependents. + if sort_dependencies and 'dependencies' in target_dict: + target_dict['dependencies'] = [dep for dep in reversed(flat_list) + if dep in target_dict['dependencies']] + + +# Initialize this here to speed up MakePathRelative. +exception_re = re.compile(r'''["']?[-/$<>^]''') + + +def MakePathRelative(to_file, fro_file, item): + # If item is a relative path, it's relative to the build file dict that it's + # coming from. Fix it up to make it relative to the build file dict that + # it's going into. + # Exception: any |item| that begins with these special characters is + # returned without modification. + # / Used when a path is already absolute (shortcut optimization; + # such paths would be returned as absolute anyway) + # $ Used for build environment variables + # - Used for some build environment flags (such as -lapr-1 in a + # "libraries" section) + # < Used for our own variable and command expansions (see ExpandVariables) + # > Used for our own variable and command expansions (see ExpandVariables) + # ^ Used for our own variable and command expansions (see ExpandVariables) + # + # "/' Used when a value is quoted. If these are present, then we + # check the second character instead. + # + if to_file == fro_file or exception_re.match(item): + return item + else: + # TODO(dglazkov) The backslash/forward-slash replacement at the end is a + # temporary measure. This should really be addressed by keeping all paths + # in POSIX until actual project generation. + ret = os.path.normpath(os.path.join( + gyp.common.RelativePath(os.path.dirname(fro_file), + os.path.dirname(to_file)), + item)).replace('\\', '/') + if item[-1] == '/': + ret += '/' + return ret + +def MergeLists(to, fro, to_file, fro_file, is_paths=False, append=True): + # Python documentation recommends objects which do not support hash + # set this value to None. Python library objects follow this rule. + is_hashable = lambda val: val.__hash__ + + # If x is hashable, returns whether x is in s. Else returns whether x is in l. + def is_in_set_or_list(x, s, l): + if is_hashable(x): + return x in s + return x in l + + prepend_index = 0 + + # Make membership testing of hashables in |to| (in particular, strings) + # faster. + hashable_to_set = set(x for x in to if is_hashable(x)) + for item in fro: + singleton = False + if type(item) in (str, int): + # The cheap and easy case. + if is_paths: + to_item = MakePathRelative(to_file, fro_file, item) + else: + to_item = item + + if not (type(item) is str and item.startswith('-')): + # Any string that doesn't begin with a "-" is a singleton - it can + # only appear once in a list, to be enforced by the list merge append + # or prepend. + singleton = True + elif type(item) is dict: + # Make a copy of the dictionary, continuing to look for paths to fix. + # The other intelligent aspects of merge processing won't apply because + # item is being merged into an empty dict. + to_item = {} + MergeDicts(to_item, item, to_file, fro_file) + elif type(item) is list: + # Recurse, making a copy of the list. If the list contains any + # descendant dicts, path fixing will occur. Note that here, custom + # values for is_paths and append are dropped; those are only to be + # applied to |to| and |fro|, not sublists of |fro|. append shouldn't + # matter anyway because the new |to_item| list is empty. + to_item = [] + MergeLists(to_item, item, to_file, fro_file) + else: + raise TypeError( + 'Attempt to merge list item of unsupported type ' + \ + item.__class__.__name__) + + if append: + # If appending a singleton that's already in the list, don't append. + # This ensures that the earliest occurrence of the item will stay put. + if not singleton or not is_in_set_or_list(to_item, hashable_to_set, to): + to.append(to_item) + if is_hashable(to_item): + hashable_to_set.add(to_item) + else: + # If prepending a singleton that's already in the list, remove the + # existing instance and proceed with the prepend. This ensures that the + # item appears at the earliest possible position in the list. + while singleton and to_item in to: + to.remove(to_item) + + # Don't just insert everything at index 0. That would prepend the new + # items to the list in reverse order, which would be an unwelcome + # surprise. + to.insert(prepend_index, to_item) + if is_hashable(to_item): + hashable_to_set.add(to_item) + prepend_index = prepend_index + 1 + + +def MergeDicts(to, fro, to_file, fro_file): + # I wanted to name the parameter "from" but it's a Python keyword... + for k, v in fro.iteritems(): + # It would be nice to do "if not k in to: to[k] = v" but that wouldn't give + # copy semantics. Something else may want to merge from the |fro| dict + # later, and having the same dict ref pointed to twice in the tree isn't + # what anyone wants considering that the dicts may subsequently be + # modified. + if k in to: + bad_merge = False + if type(v) in (str, int): + if type(to[k]) not in (str, int): + bad_merge = True + elif type(v) is not type(to[k]): + bad_merge = True + + if bad_merge: + raise TypeError( + 'Attempt to merge dict value of type ' + v.__class__.__name__ + \ + ' into incompatible type ' + to[k].__class__.__name__ + \ + ' for key ' + k) + if type(v) in (str, int): + # Overwrite the existing value, if any. Cheap and easy. + is_path = IsPathSection(k) + if is_path: + to[k] = MakePathRelative(to_file, fro_file, v) + else: + to[k] = v + elif type(v) is dict: + # Recurse, guaranteeing copies will be made of objects that require it. + if not k in to: + to[k] = {} + MergeDicts(to[k], v, to_file, fro_file) + elif type(v) is list: + # Lists in dicts can be merged with different policies, depending on + # how the key in the "from" dict (k, the from-key) is written. + # + # If the from-key has ...the to-list will have this action + # this character appended:... applied when receiving the from-list: + # = replace + # + prepend + # ? set, only if to-list does not yet exist + # (none) append + # + # This logic is list-specific, but since it relies on the associated + # dict key, it's checked in this dict-oriented function. + ext = k[-1] + append = True + if ext == '=': + list_base = k[:-1] + lists_incompatible = [list_base, list_base + '?'] + to[list_base] = [] + elif ext == '+': + list_base = k[:-1] + lists_incompatible = [list_base + '=', list_base + '?'] + append = False + elif ext == '?': + list_base = k[:-1] + lists_incompatible = [list_base, list_base + '=', list_base + '+'] + else: + list_base = k + lists_incompatible = [list_base + '=', list_base + '?'] + + # Some combinations of merge policies appearing together are meaningless. + # It's stupid to replace and append simultaneously, for example. Append + # and prepend are the only policies that can coexist. + for list_incompatible in lists_incompatible: + if list_incompatible in fro: + raise GypError('Incompatible list policies ' + k + ' and ' + + list_incompatible) + + if list_base in to: + if ext == '?': + # If the key ends in "?", the list will only be merged if it doesn't + # already exist. + continue + elif type(to[list_base]) is not list: + # This may not have been checked above if merging in a list with an + # extension character. + raise TypeError( + 'Attempt to merge dict value of type ' + v.__class__.__name__ + \ + ' into incompatible type ' + to[list_base].__class__.__name__ + \ + ' for key ' + list_base + '(' + k + ')') + else: + to[list_base] = [] + + # Call MergeLists, which will make copies of objects that require it. + # MergeLists can recurse back into MergeDicts, although this will be + # to make copies of dicts (with paths fixed), there will be no + # subsequent dict "merging" once entering a list because lists are + # always replaced, appended to, or prepended to. + is_paths = IsPathSection(list_base) + MergeLists(to[list_base], v, to_file, fro_file, is_paths, append) + else: + raise TypeError( + 'Attempt to merge dict value of unsupported type ' + \ + v.__class__.__name__ + ' for key ' + k) + + +def MergeConfigWithInheritance(new_configuration_dict, build_file, + target_dict, configuration, visited): + # Skip if previously visted. + if configuration in visited: + return + + # Look at this configuration. + configuration_dict = target_dict['configurations'][configuration] + + # Merge in parents. + for parent in configuration_dict.get('inherit_from', []): + MergeConfigWithInheritance(new_configuration_dict, build_file, + target_dict, parent, visited + [configuration]) + + # Merge it into the new config. + MergeDicts(new_configuration_dict, configuration_dict, + build_file, build_file) + + # Drop abstract. + if 'abstract' in new_configuration_dict: + del new_configuration_dict['abstract'] + + +def SetUpConfigurations(target, target_dict): + # key_suffixes is a list of key suffixes that might appear on key names. + # These suffixes are handled in conditional evaluations (for =, +, and ?) + # and rules/exclude processing (for ! and /). Keys with these suffixes + # should be treated the same as keys without. + key_suffixes = ['=', '+', '?', '!', '/'] + + build_file = gyp.common.BuildFile(target) + + # Provide a single configuration by default if none exists. + # TODO(mark): Signal an error if default_configurations exists but + # configurations does not. + if not 'configurations' in target_dict: + target_dict['configurations'] = {'Default': {}} + if not 'default_configuration' in target_dict: + concrete = [i for (i, config) in target_dict['configurations'].iteritems() + if not config.get('abstract')] + target_dict['default_configuration'] = sorted(concrete)[0] + + merged_configurations = {} + configs = target_dict['configurations'] + for (configuration, old_configuration_dict) in configs.iteritems(): + # Skip abstract configurations (saves work only). + if old_configuration_dict.get('abstract'): + continue + # Configurations inherit (most) settings from the enclosing target scope. + # Get the inheritance relationship right by making a copy of the target + # dict. + new_configuration_dict = {} + for (key, target_val) in target_dict.iteritems(): + key_ext = key[-1:] + if key_ext in key_suffixes: + key_base = key[:-1] + else: + key_base = key + if not key_base in non_configuration_keys: + new_configuration_dict[key] = gyp.simple_copy.deepcopy(target_val) + + # Merge in configuration (with all its parents first). + MergeConfigWithInheritance(new_configuration_dict, build_file, + target_dict, configuration, []) + + merged_configurations[configuration] = new_configuration_dict + + # Put the new configurations back into the target dict as a configuration. + for configuration in merged_configurations.keys(): + target_dict['configurations'][configuration] = ( + merged_configurations[configuration]) + + # Now drop all the abstract ones. + for configuration in target_dict['configurations'].keys(): + old_configuration_dict = target_dict['configurations'][configuration] + if old_configuration_dict.get('abstract'): + del target_dict['configurations'][configuration] + + # Now that all of the target's configurations have been built, go through + # the target dict's keys and remove everything that's been moved into a + # "configurations" section. + delete_keys = [] + for key in target_dict: + key_ext = key[-1:] + if key_ext in key_suffixes: + key_base = key[:-1] + else: + key_base = key + if not key_base in non_configuration_keys: + delete_keys.append(key) + for key in delete_keys: + del target_dict[key] + + # Check the configurations to see if they contain invalid keys. + for configuration in target_dict['configurations'].keys(): + configuration_dict = target_dict['configurations'][configuration] + for key in configuration_dict.keys(): + if key in invalid_configuration_keys: + raise GypError('%s not allowed in the %s configuration, found in ' + 'target %s' % (key, configuration, target)) + + + +def ProcessListFiltersInDict(name, the_dict): + """Process regular expression and exclusion-based filters on lists. + + An exclusion list is in a dict key named with a trailing "!", like + "sources!". Every item in such a list is removed from the associated + main list, which in this example, would be "sources". Removed items are + placed into a "sources_excluded" list in the dict. + + Regular expression (regex) filters are contained in dict keys named with a + trailing "/", such as "sources/" to operate on the "sources" list. Regex + filters in a dict take the form: + 'sources/': [ ['exclude', '_(linux|mac|win)\\.cc$'], + ['include', '_mac\\.cc$'] ], + The first filter says to exclude all files ending in _linux.cc, _mac.cc, and + _win.cc. The second filter then includes all files ending in _mac.cc that + are now or were once in the "sources" list. Items matching an "exclude" + filter are subject to the same processing as would occur if they were listed + by name in an exclusion list (ending in "!"). Items matching an "include" + filter are brought back into the main list if previously excluded by an + exclusion list or exclusion regex filter. Subsequent matching "exclude" + patterns can still cause items to be excluded after matching an "include". + """ + + # Look through the dictionary for any lists whose keys end in "!" or "/". + # These are lists that will be treated as exclude lists and regular + # expression-based exclude/include lists. Collect the lists that are + # needed first, looking for the lists that they operate on, and assemble + # then into |lists|. This is done in a separate loop up front, because + # the _included and _excluded keys need to be added to the_dict, and that + # can't be done while iterating through it. + + lists = [] + del_lists = [] + for key, value in the_dict.iteritems(): + operation = key[-1] + if operation != '!' and operation != '/': + continue + + if type(value) is not list: + raise ValueError(name + ' key ' + key + ' must be list, not ' + \ + value.__class__.__name__) + + list_key = key[:-1] + if list_key not in the_dict: + # This happens when there's a list like "sources!" but no corresponding + # "sources" list. Since there's nothing for it to operate on, queue up + # the "sources!" list for deletion now. + del_lists.append(key) + continue + + if type(the_dict[list_key]) is not list: + value = the_dict[list_key] + raise ValueError(name + ' key ' + list_key + \ + ' must be list, not ' + \ + value.__class__.__name__ + ' when applying ' + \ + {'!': 'exclusion', '/': 'regex'}[operation]) + + if not list_key in lists: + lists.append(list_key) + + # Delete the lists that are known to be unneeded at this point. + for del_list in del_lists: + del the_dict[del_list] + + for list_key in lists: + the_list = the_dict[list_key] + + # Initialize the list_actions list, which is parallel to the_list. Each + # item in list_actions identifies whether the corresponding item in + # the_list should be excluded, unconditionally preserved (included), or + # whether no exclusion or inclusion has been applied. Items for which + # no exclusion or inclusion has been applied (yet) have value -1, items + # excluded have value 0, and items included have value 1. Includes and + # excludes override previous actions. All items in list_actions are + # initialized to -1 because no excludes or includes have been processed + # yet. + list_actions = list((-1,) * len(the_list)) + + exclude_key = list_key + '!' + if exclude_key in the_dict: + for exclude_item in the_dict[exclude_key]: + for index in xrange(0, len(the_list)): + if exclude_item == the_list[index]: + # This item matches the exclude_item, so set its action to 0 + # (exclude). + list_actions[index] = 0 + + # The "whatever!" list is no longer needed, dump it. + del the_dict[exclude_key] + + regex_key = list_key + '/' + if regex_key in the_dict: + for regex_item in the_dict[regex_key]: + [action, pattern] = regex_item + pattern_re = re.compile(pattern) + + if action == 'exclude': + # This item matches an exclude regex, so set its value to 0 (exclude). + action_value = 0 + elif action == 'include': + # This item matches an include regex, so set its value to 1 (include). + action_value = 1 + else: + # This is an action that doesn't make any sense. + raise ValueError('Unrecognized action ' + action + ' in ' + name + \ + ' key ' + regex_key) + + for index in xrange(0, len(the_list)): + list_item = the_list[index] + if list_actions[index] == action_value: + # Even if the regex matches, nothing will change so continue (regex + # searches are expensive). + continue + if pattern_re.search(list_item): + # Regular expression match. + list_actions[index] = action_value + + # The "whatever/" list is no longer needed, dump it. + del the_dict[regex_key] + + # Add excluded items to the excluded list. + # + # Note that exclude_key ("sources!") is different from excluded_key + # ("sources_excluded"). The exclude_key list is input and it was already + # processed and deleted; the excluded_key list is output and it's about + # to be created. + excluded_key = list_key + '_excluded' + if excluded_key in the_dict: + raise GypError(name + ' key ' + excluded_key + + ' must not be present prior ' + ' to applying exclusion/regex filters for ' + list_key) + + excluded_list = [] + + # Go backwards through the list_actions list so that as items are deleted, + # the indices of items that haven't been seen yet don't shift. That means + # that things need to be prepended to excluded_list to maintain them in the + # same order that they existed in the_list. + for index in xrange(len(list_actions) - 1, -1, -1): + if list_actions[index] == 0: + # Dump anything with action 0 (exclude). Keep anything with action 1 + # (include) or -1 (no include or exclude seen for the item). + excluded_list.insert(0, the_list[index]) + del the_list[index] + + # If anything was excluded, put the excluded list into the_dict at + # excluded_key. + if len(excluded_list) > 0: + the_dict[excluded_key] = excluded_list + + # Now recurse into subdicts and lists that may contain dicts. + for key, value in the_dict.iteritems(): + if type(value) is dict: + ProcessListFiltersInDict(key, value) + elif type(value) is list: + ProcessListFiltersInList(key, value) + + +def ProcessListFiltersInList(name, the_list): + for item in the_list: + if type(item) is dict: + ProcessListFiltersInDict(name, item) + elif type(item) is list: + ProcessListFiltersInList(name, item) + + +def ValidateTargetType(target, target_dict): + """Ensures the 'type' field on the target is one of the known types. + + Arguments: + target: string, name of target. + target_dict: dict, target spec. + + Raises an exception on error. + """ + VALID_TARGET_TYPES = ('executable', 'loadable_module', + 'static_library', 'shared_library', + 'mac_kernel_extension', 'none') + target_type = target_dict.get('type', None) + if target_type not in VALID_TARGET_TYPES: + raise GypError("Target %s has an invalid target type '%s'. " + "Must be one of %s." % + (target, target_type, '/'.join(VALID_TARGET_TYPES))) + if (target_dict.get('standalone_static_library', 0) and + not target_type == 'static_library'): + raise GypError('Target %s has type %s but standalone_static_library flag is' + ' only valid for static_library type.' % (target, + target_type)) + + +def ValidateSourcesInTarget(target, target_dict, build_file, + duplicate_basename_check): + if not duplicate_basename_check: + return + if target_dict.get('type', None) != 'static_library': + return + sources = target_dict.get('sources', []) + basenames = {} + for source in sources: + name, ext = os.path.splitext(source) + is_compiled_file = ext in [ + '.c', '.cc', '.cpp', '.cxx', '.m', '.mm', '.s', '.S'] + if not is_compiled_file: + continue + basename = os.path.basename(name) # Don't include extension. + basenames.setdefault(basename, []).append(source) + + error = '' + for basename, files in basenames.iteritems(): + if len(files) > 1: + error += ' %s: %s\n' % (basename, ' '.join(files)) + + if error: + print('static library %s has several files with the same basename:\n' % + target + error + 'libtool on Mac cannot handle that. Use ' + '--no-duplicate-basename-check to disable this validation.') + raise GypError('Duplicate basenames in sources section, see list above') + + +def ValidateRulesInTarget(target, target_dict, extra_sources_for_rules): + """Ensures that the rules sections in target_dict are valid and consistent, + and determines which sources they apply to. + + Arguments: + target: string, name of target. + target_dict: dict, target spec containing "rules" and "sources" lists. + extra_sources_for_rules: a list of keys to scan for rule matches in + addition to 'sources'. + """ + + # Dicts to map between values found in rules' 'rule_name' and 'extension' + # keys and the rule dicts themselves. + rule_names = {} + rule_extensions = {} + + rules = target_dict.get('rules', []) + for rule in rules: + # Make sure that there's no conflict among rule names and extensions. + rule_name = rule['rule_name'] + if rule_name in rule_names: + raise GypError('rule %s exists in duplicate, target %s' % + (rule_name, target)) + rule_names[rule_name] = rule + + rule_extension = rule['extension'] + if rule_extension.startswith('.'): + rule_extension = rule_extension[1:] + if rule_extension in rule_extensions: + raise GypError(('extension %s associated with multiple rules, ' + + 'target %s rules %s and %s') % + (rule_extension, target, + rule_extensions[rule_extension]['rule_name'], + rule_name)) + rule_extensions[rule_extension] = rule + + # Make sure rule_sources isn't already there. It's going to be + # created below if needed. + if 'rule_sources' in rule: + raise GypError( + 'rule_sources must not exist in input, target %s rule %s' % + (target, rule_name)) + + rule_sources = [] + source_keys = ['sources'] + source_keys.extend(extra_sources_for_rules) + for source_key in source_keys: + for source in target_dict.get(source_key, []): + (source_root, source_extension) = os.path.splitext(source) + if source_extension.startswith('.'): + source_extension = source_extension[1:] + if source_extension == rule_extension: + rule_sources.append(source) + + if len(rule_sources) > 0: + rule['rule_sources'] = rule_sources + + +def ValidateRunAsInTarget(target, target_dict, build_file): + target_name = target_dict.get('target_name') + run_as = target_dict.get('run_as') + if not run_as: + return + if type(run_as) is not dict: + raise GypError("The 'run_as' in target %s from file %s should be a " + "dictionary." % + (target_name, build_file)) + action = run_as.get('action') + if not action: + raise GypError("The 'run_as' in target %s from file %s must have an " + "'action' section." % + (target_name, build_file)) + if type(action) is not list: + raise GypError("The 'action' for 'run_as' in target %s from file %s " + "must be a list." % + (target_name, build_file)) + working_directory = run_as.get('working_directory') + if working_directory and type(working_directory) is not str: + raise GypError("The 'working_directory' for 'run_as' in target %s " + "in file %s should be a string." % + (target_name, build_file)) + environment = run_as.get('environment') + if environment and type(environment) is not dict: + raise GypError("The 'environment' for 'run_as' in target %s " + "in file %s should be a dictionary." % + (target_name, build_file)) + + +def ValidateActionsInTarget(target, target_dict, build_file): + '''Validates the inputs to the actions in a target.''' + target_name = target_dict.get('target_name') + actions = target_dict.get('actions', []) + for action in actions: + action_name = action.get('action_name') + if not action_name: + raise GypError("Anonymous action in target %s. " + "An action must have an 'action_name' field." % + target_name) + inputs = action.get('inputs', None) + if inputs is None: + raise GypError('Action in target %s has no inputs.' % target_name) + action_command = action.get('action') + if action_command and not action_command[0]: + raise GypError("Empty action as command in target %s." % target_name) + + +def TurnIntIntoStrInDict(the_dict): + """Given dict the_dict, recursively converts all integers into strings. + """ + # Use items instead of iteritems because there's no need to try to look at + # reinserted keys and their associated values. + for k, v in the_dict.items(): + if type(v) is int: + v = str(v) + the_dict[k] = v + elif type(v) is dict: + TurnIntIntoStrInDict(v) + elif type(v) is list: + TurnIntIntoStrInList(v) + + if type(k) is int: + del the_dict[k] + the_dict[str(k)] = v + + +def TurnIntIntoStrInList(the_list): + """Given list the_list, recursively converts all integers into strings. + """ + for index in xrange(0, len(the_list)): + item = the_list[index] + if type(item) is int: + the_list[index] = str(item) + elif type(item) is dict: + TurnIntIntoStrInDict(item) + elif type(item) is list: + TurnIntIntoStrInList(item) + + +def PruneUnwantedTargets(targets, flat_list, dependency_nodes, root_targets, + data): + """Return only the targets that are deep dependencies of |root_targets|.""" + qualified_root_targets = [] + for target in root_targets: + target = target.strip() + qualified_targets = gyp.common.FindQualifiedTargets(target, flat_list) + if not qualified_targets: + raise GypError("Could not find target %s" % target) + qualified_root_targets.extend(qualified_targets) + + wanted_targets = {} + for target in qualified_root_targets: + wanted_targets[target] = targets[target] + for dependency in dependency_nodes[target].DeepDependencies(): + wanted_targets[dependency] = targets[dependency] + + wanted_flat_list = [t for t in flat_list if t in wanted_targets] + + # Prune unwanted targets from each build_file's data dict. + for build_file in data['target_build_files']: + if not 'targets' in data[build_file]: + continue + new_targets = [] + for target in data[build_file]['targets']: + qualified_name = gyp.common.QualifiedTarget(build_file, + target['target_name'], + target['toolset']) + if qualified_name in wanted_targets: + new_targets.append(target) + data[build_file]['targets'] = new_targets + + return wanted_targets, wanted_flat_list + + +def VerifyNoCollidingTargets(targets): + """Verify that no two targets in the same directory share the same name. + + Arguments: + targets: A list of targets in the form 'path/to/file.gyp:target_name'. + """ + # Keep a dict going from 'subdirectory:target_name' to 'foo.gyp'. + used = {} + for target in targets: + # Separate out 'path/to/file.gyp, 'target_name' from + # 'path/to/file.gyp:target_name'. + path, name = target.rsplit(':', 1) + # Separate out 'path/to', 'file.gyp' from 'path/to/file.gyp'. + subdir, gyp = os.path.split(path) + # Use '.' for the current directory '', so that the error messages make + # more sense. + if not subdir: + subdir = '.' + # Prepare a key like 'path/to:target_name'. + key = subdir + ':' + name + if key in used: + # Complain if this target is already used. + raise GypError('Duplicate target name "%s" in directory "%s" used both ' + 'in "%s" and "%s".' % (name, subdir, gyp, used[key])) + used[key] = gyp + + +def SetGeneratorGlobals(generator_input_info): + # Set up path_sections and non_configuration_keys with the default data plus + # the generator-specific data. + global path_sections + path_sections = set(base_path_sections) + path_sections.update(generator_input_info['path_sections']) + + global non_configuration_keys + non_configuration_keys = base_non_configuration_keys[:] + non_configuration_keys.extend(generator_input_info['non_configuration_keys']) + + global multiple_toolsets + multiple_toolsets = generator_input_info[ + 'generator_supports_multiple_toolsets'] + + global generator_filelist_paths + generator_filelist_paths = generator_input_info['generator_filelist_paths'] + + +def Load(build_files, variables, includes, depth, generator_input_info, check, + circular_check, duplicate_basename_check, parallel, root_targets): + SetGeneratorGlobals(generator_input_info) + # A generator can have other lists (in addition to sources) be processed + # for rules. + extra_sources_for_rules = generator_input_info['extra_sources_for_rules'] + + # Load build files. This loads every target-containing build file into + # the |data| dictionary such that the keys to |data| are build file names, + # and the values are the entire build file contents after "early" or "pre" + # processing has been done and includes have been resolved. + # NOTE: data contains both "target" files (.gyp) and "includes" (.gypi), as + # well as meta-data (e.g. 'included_files' key). 'target_build_files' keeps + # track of the keys corresponding to "target" files. + data = {'target_build_files': set()} + # Normalize paths everywhere. This is important because paths will be + # used as keys to the data dict and for references between input files. + build_files = set(map(os.path.normpath, build_files)) + if parallel: + LoadTargetBuildFilesParallel(build_files, data, variables, includes, depth, + check, generator_input_info) + else: + aux_data = {} + for build_file in build_files: + try: + LoadTargetBuildFile(build_file, data, aux_data, + variables, includes, depth, check, True) + except Exception, e: + gyp.common.ExceptionAppend(e, 'while trying to load %s' % build_file) + raise + + # Build a dict to access each target's subdict by qualified name. + targets = BuildTargetsDict(data) + + # Fully qualify all dependency links. + QualifyDependencies(targets) + + # Remove self-dependencies from targets that have 'prune_self_dependencies' + # set to 1. + RemoveSelfDependencies(targets) + + # Expand dependencies specified as build_file:*. + ExpandWildcardDependencies(targets, data) + + # Remove all dependencies marked as 'link_dependency' from the targets of + # type 'none'. + RemoveLinkDependenciesFromNoneTargets(targets) + + # Apply exclude (!) and regex (/) list filters only for dependency_sections. + for target_name, target_dict in targets.iteritems(): + tmp_dict = {} + for key_base in dependency_sections: + for op in ('', '!', '/'): + key = key_base + op + if key in target_dict: + tmp_dict[key] = target_dict[key] + del target_dict[key] + ProcessListFiltersInDict(target_name, tmp_dict) + # Write the results back to |target_dict|. + for key in tmp_dict: + target_dict[key] = tmp_dict[key] + + # Make sure every dependency appears at most once. + RemoveDuplicateDependencies(targets) + + if circular_check: + # Make sure that any targets in a.gyp don't contain dependencies in other + # .gyp files that further depend on a.gyp. + VerifyNoGYPFileCircularDependencies(targets) + + [dependency_nodes, flat_list] = BuildDependencyList(targets) + + if root_targets: + # Remove, from |targets| and |flat_list|, the targets that are not deep + # dependencies of the targets specified in |root_targets|. + targets, flat_list = PruneUnwantedTargets( + targets, flat_list, dependency_nodes, root_targets, data) + + # Check that no two targets in the same directory have the same name. + VerifyNoCollidingTargets(flat_list) + + # Handle dependent settings of various types. + for settings_type in ['all_dependent_settings', + 'direct_dependent_settings', + 'link_settings']: + DoDependentSettings(settings_type, flat_list, targets, dependency_nodes) + + # Take out the dependent settings now that they've been published to all + # of the targets that require them. + for target in flat_list: + if settings_type in targets[target]: + del targets[target][settings_type] + + # Make sure static libraries don't declare dependencies on other static + # libraries, but that linkables depend on all unlinked static libraries + # that they need so that their link steps will be correct. + gii = generator_input_info + if gii['generator_wants_static_library_dependencies_adjusted']: + AdjustStaticLibraryDependencies(flat_list, targets, dependency_nodes, + gii['generator_wants_sorted_dependencies']) + + # Apply "post"/"late"/"target" variable expansions and condition evaluations. + for target in flat_list: + target_dict = targets[target] + build_file = gyp.common.BuildFile(target) + ProcessVariablesAndConditionsInDict( + target_dict, PHASE_LATE, variables, build_file) + + # Move everything that can go into a "configurations" section into one. + for target in flat_list: + target_dict = targets[target] + SetUpConfigurations(target, target_dict) + + # Apply exclude (!) and regex (/) list filters. + for target in flat_list: + target_dict = targets[target] + ProcessListFiltersInDict(target, target_dict) + + # Apply "latelate" variable expansions and condition evaluations. + for target in flat_list: + target_dict = targets[target] + build_file = gyp.common.BuildFile(target) + ProcessVariablesAndConditionsInDict( + target_dict, PHASE_LATELATE, variables, build_file) + + # Make sure that the rules make sense, and build up rule_sources lists as + # needed. Not all generators will need to use the rule_sources lists, but + # some may, and it seems best to build the list in a common spot. + # Also validate actions and run_as elements in targets. + for target in flat_list: + target_dict = targets[target] + build_file = gyp.common.BuildFile(target) + ValidateTargetType(target, target_dict) + ValidateSourcesInTarget(target, target_dict, build_file, + duplicate_basename_check) + ValidateRulesInTarget(target, target_dict, extra_sources_for_rules) + ValidateRunAsInTarget(target, target_dict, build_file) + ValidateActionsInTarget(target, target_dict, build_file) + + # Generators might not expect ints. Turn them into strs. + TurnIntIntoStrInDict(data) + + # TODO(mark): Return |data| for now because the generator needs a list of + # build files that came in. In the future, maybe it should just accept + # a list, and not the whole data dict. + return [flat_list, targets, data] diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.pyc b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.pyc new file mode 100644 index 00000000..98a5767c Binary files /dev/null and b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.pyc differ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input_test.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input_test.py new file mode 100644 index 00000000..4234fbb8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input_test.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python + +# Copyright 2013 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Unit tests for the input.py file.""" + +import gyp.input +import unittest +import sys + + +class TestFindCycles(unittest.TestCase): + def setUp(self): + self.nodes = {} + for x in ('a', 'b', 'c', 'd', 'e'): + self.nodes[x] = gyp.input.DependencyGraphNode(x) + + def _create_dependency(self, dependent, dependency): + dependent.dependencies.append(dependency) + dependency.dependents.append(dependent) + + def test_no_cycle_empty_graph(self): + for label, node in self.nodes.iteritems(): + self.assertEquals([], node.FindCycles()) + + def test_no_cycle_line(self): + self._create_dependency(self.nodes['a'], self.nodes['b']) + self._create_dependency(self.nodes['b'], self.nodes['c']) + self._create_dependency(self.nodes['c'], self.nodes['d']) + + for label, node in self.nodes.iteritems(): + self.assertEquals([], node.FindCycles()) + + def test_no_cycle_dag(self): + self._create_dependency(self.nodes['a'], self.nodes['b']) + self._create_dependency(self.nodes['a'], self.nodes['c']) + self._create_dependency(self.nodes['b'], self.nodes['c']) + + for label, node in self.nodes.iteritems(): + self.assertEquals([], node.FindCycles()) + + def test_cycle_self_reference(self): + self._create_dependency(self.nodes['a'], self.nodes['a']) + + self.assertEquals([[self.nodes['a'], self.nodes['a']]], + self.nodes['a'].FindCycles()) + + def test_cycle_two_nodes(self): + self._create_dependency(self.nodes['a'], self.nodes['b']) + self._create_dependency(self.nodes['b'], self.nodes['a']) + + self.assertEquals([[self.nodes['a'], self.nodes['b'], self.nodes['a']]], + self.nodes['a'].FindCycles()) + self.assertEquals([[self.nodes['b'], self.nodes['a'], self.nodes['b']]], + self.nodes['b'].FindCycles()) + + def test_two_cycles(self): + self._create_dependency(self.nodes['a'], self.nodes['b']) + self._create_dependency(self.nodes['b'], self.nodes['a']) + + self._create_dependency(self.nodes['b'], self.nodes['c']) + self._create_dependency(self.nodes['c'], self.nodes['b']) + + cycles = self.nodes['a'].FindCycles() + self.assertTrue( + [self.nodes['a'], self.nodes['b'], self.nodes['a']] in cycles) + self.assertTrue( + [self.nodes['b'], self.nodes['c'], self.nodes['b']] in cycles) + self.assertEquals(2, len(cycles)) + + def test_big_cycle(self): + self._create_dependency(self.nodes['a'], self.nodes['b']) + self._create_dependency(self.nodes['b'], self.nodes['c']) + self._create_dependency(self.nodes['c'], self.nodes['d']) + self._create_dependency(self.nodes['d'], self.nodes['e']) + self._create_dependency(self.nodes['e'], self.nodes['a']) + + self.assertEquals([[self.nodes['a'], + self.nodes['b'], + self.nodes['c'], + self.nodes['d'], + self.nodes['e'], + self.nodes['a']]], + self.nodes['a'].FindCycles()) + + +if __name__ == '__main__': + unittest.main() diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py new file mode 100644 index 00000000..eeeaceb0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py @@ -0,0 +1,610 @@ +#!/usr/bin/env python +# Copyright (c) 2012 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Utility functions to perform Xcode-style build steps. + +These functions are executed via gyp-mac-tool when using the Makefile generator. +""" + +import fcntl +import fnmatch +import glob +import json +import os +import plistlib +import re +import shutil +import string +import subprocess +import sys +import tempfile + + +def main(args): + executor = MacTool() + exit_code = executor.Dispatch(args) + if exit_code is not None: + sys.exit(exit_code) + + +class MacTool(object): + """This class performs all the Mac tooling steps. The methods can either be + executed directly, or dispatched from an argument list.""" + + def Dispatch(self, args): + """Dispatches a string command to a method.""" + if len(args) < 1: + raise Exception("Not enough arguments") + + method = "Exec%s" % self._CommandifyName(args[0]) + return getattr(self, method)(*args[1:]) + + def _CommandifyName(self, name_string): + """Transforms a tool name like copy-info-plist to CopyInfoPlist""" + return name_string.title().replace('-', '') + + def ExecCopyBundleResource(self, source, dest, convert_to_binary): + """Copies a resource file to the bundle/Resources directory, performing any + necessary compilation on each resource.""" + extension = os.path.splitext(source)[1].lower() + if os.path.isdir(source): + # Copy tree. + # TODO(thakis): This copies file attributes like mtime, while the + # single-file branch below doesn't. This should probably be changed to + # be consistent with the single-file branch. + if os.path.exists(dest): + shutil.rmtree(dest) + shutil.copytree(source, dest) + elif extension == '.xib': + return self._CopyXIBFile(source, dest) + elif extension == '.storyboard': + return self._CopyXIBFile(source, dest) + elif extension == '.strings': + self._CopyStringsFile(source, dest, convert_to_binary) + else: + shutil.copy(source, dest) + + def _CopyXIBFile(self, source, dest): + """Compiles a XIB file with ibtool into a binary plist in the bundle.""" + + # ibtool sometimes crashes with relative paths. See crbug.com/314728. + base = os.path.dirname(os.path.realpath(__file__)) + if os.path.relpath(source): + source = os.path.join(base, source) + if os.path.relpath(dest): + dest = os.path.join(base, dest) + + args = ['xcrun', 'ibtool', '--errors', '--warnings', '--notices', + '--output-format', 'human-readable-text', '--compile', dest, source] + ibtool_section_re = re.compile(r'/\*.*\*/') + ibtool_re = re.compile(r'.*note:.*is clipping its content') + ibtoolout = subprocess.Popen(args, stdout=subprocess.PIPE) + current_section_header = None + for line in ibtoolout.stdout: + if ibtool_section_re.match(line): + current_section_header = line + elif not ibtool_re.match(line): + if current_section_header: + sys.stdout.write(current_section_header) + current_section_header = None + sys.stdout.write(line) + return ibtoolout.returncode + + def _ConvertToBinary(self, dest): + subprocess.check_call([ + 'xcrun', 'plutil', '-convert', 'binary1', '-o', dest, dest]) + + def _CopyStringsFile(self, source, dest, convert_to_binary): + """Copies a .strings file using iconv to reconvert the input into UTF-16.""" + input_code = self._DetectInputEncoding(source) or "UTF-8" + + # Xcode's CpyCopyStringsFile / builtin-copyStrings seems to call + # CFPropertyListCreateFromXMLData() behind the scenes; at least it prints + # CFPropertyListCreateFromXMLData(): Old-style plist parser: missing + # semicolon in dictionary. + # on invalid files. Do the same kind of validation. + import CoreFoundation + s = open(source, 'rb').read() + d = CoreFoundation.CFDataCreate(None, s, len(s)) + _, error = CoreFoundation.CFPropertyListCreateFromXMLData(None, d, 0, None) + if error: + return + + fp = open(dest, 'wb') + fp.write(s.decode(input_code).encode('UTF-16')) + fp.close() + + if convert_to_binary == 'True': + self._ConvertToBinary(dest) + + def _DetectInputEncoding(self, file_name): + """Reads the first few bytes from file_name and tries to guess the text + encoding. Returns None as a guess if it can't detect it.""" + fp = open(file_name, 'rb') + try: + header = fp.read(3) + except e: + fp.close() + return None + fp.close() + if header.startswith("\xFE\xFF"): + return "UTF-16" + elif header.startswith("\xFF\xFE"): + return "UTF-16" + elif header.startswith("\xEF\xBB\xBF"): + return "UTF-8" + else: + return None + + def ExecCopyInfoPlist(self, source, dest, convert_to_binary, *keys): + """Copies the |source| Info.plist to the destination directory |dest|.""" + # Read the source Info.plist into memory. + fd = open(source, 'r') + lines = fd.read() + fd.close() + + # Insert synthesized key/value pairs (e.g. BuildMachineOSBuild). + plist = plistlib.readPlistFromString(lines) + if keys: + plist = dict(plist.items() + json.loads(keys[0]).items()) + lines = plistlib.writePlistToString(plist) + + # Go through all the environment variables and replace them as variables in + # the file. + IDENT_RE = re.compile(r'[/\s]') + for key in os.environ: + if key.startswith('_'): + continue + evar = '${%s}' % key + evalue = os.environ[key] + lines = string.replace(lines, evar, evalue) + + # Xcode supports various suffices on environment variables, which are + # all undocumented. :rfc1034identifier is used in the standard project + # template these days, and :identifier was used earlier. They are used to + # convert non-url characters into things that look like valid urls -- + # except that the replacement character for :identifier, '_' isn't valid + # in a URL either -- oops, hence :rfc1034identifier was born. + evar = '${%s:identifier}' % key + evalue = IDENT_RE.sub('_', os.environ[key]) + lines = string.replace(lines, evar, evalue) + + evar = '${%s:rfc1034identifier}' % key + evalue = IDENT_RE.sub('-', os.environ[key]) + lines = string.replace(lines, evar, evalue) + + # Remove any keys with values that haven't been replaced. + lines = lines.split('\n') + for i in range(len(lines)): + if lines[i].strip().startswith("${"): + lines[i] = None + lines[i - 1] = None + lines = '\n'.join(filter(lambda x: x is not None, lines)) + + # Write out the file with variables replaced. + fd = open(dest, 'w') + fd.write(lines) + fd.close() + + # Now write out PkgInfo file now that the Info.plist file has been + # "compiled". + self._WritePkgInfo(dest) + + if convert_to_binary == 'True': + self._ConvertToBinary(dest) + + def _WritePkgInfo(self, info_plist): + """This writes the PkgInfo file from the data stored in Info.plist.""" + plist = plistlib.readPlist(info_plist) + if not plist: + return + + # Only create PkgInfo for executable types. + package_type = plist['CFBundlePackageType'] + if package_type != 'APPL': + return + + # The format of PkgInfo is eight characters, representing the bundle type + # and bundle signature, each four characters. If that is missing, four + # '?' characters are used instead. + signature_code = plist.get('CFBundleSignature', '????') + if len(signature_code) != 4: # Wrong length resets everything, too. + signature_code = '?' * 4 + + dest = os.path.join(os.path.dirname(info_plist), 'PkgInfo') + fp = open(dest, 'w') + fp.write('%s%s' % (package_type, signature_code)) + fp.close() + + def ExecFlock(self, lockfile, *cmd_list): + """Emulates the most basic behavior of Linux's flock(1).""" + # Rely on exception handling to report errors. + fd = os.open(lockfile, os.O_RDONLY|os.O_NOCTTY|os.O_CREAT, 0o666) + fcntl.flock(fd, fcntl.LOCK_EX) + return subprocess.call(cmd_list) + + def ExecFilterLibtool(self, *cmd_list): + """Calls libtool and filters out '/path/to/libtool: file: foo.o has no + symbols'.""" + libtool_re = re.compile(r'^.*libtool: file: .* has no symbols$') + libtool_re5 = re.compile( + r'^.*libtool: warning for library: ' + + r'.* the table of contents is empty ' + + r'\(no object file members in the library define global symbols\)$') + env = os.environ.copy() + # Ref: + # http://www.opensource.apple.com/source/cctools/cctools-809/misc/libtool.c + # The problem with this flag is that it resets the file mtime on the file to + # epoch=0, e.g. 1970-1-1 or 1969-12-31 depending on timezone. + env['ZERO_AR_DATE'] = '1' + libtoolout = subprocess.Popen(cmd_list, stderr=subprocess.PIPE, env=env) + _, err = libtoolout.communicate() + for line in err.splitlines(): + if not libtool_re.match(line) and not libtool_re5.match(line): + print >>sys.stderr, line + # Unconditionally touch the output .a file on the command line if present + # and the command succeeded. A bit hacky. + if not libtoolout.returncode: + for i in range(len(cmd_list) - 1): + if cmd_list[i] == "-o" and cmd_list[i+1].endswith('.a'): + os.utime(cmd_list[i+1], None) + break + return libtoolout.returncode + + def ExecPackageFramework(self, framework, version): + """Takes a path to Something.framework and the Current version of that and + sets up all the symlinks.""" + # Find the name of the binary based on the part before the ".framework". + binary = os.path.basename(framework).split('.')[0] + + CURRENT = 'Current' + RESOURCES = 'Resources' + VERSIONS = 'Versions' + + if not os.path.exists(os.path.join(framework, VERSIONS, version, binary)): + # Binary-less frameworks don't seem to contain symlinks (see e.g. + # chromium's out/Debug/org.chromium.Chromium.manifest/ bundle). + return + + # Move into the framework directory to set the symlinks correctly. + pwd = os.getcwd() + os.chdir(framework) + + # Set up the Current version. + self._Relink(version, os.path.join(VERSIONS, CURRENT)) + + # Set up the root symlinks. + self._Relink(os.path.join(VERSIONS, CURRENT, binary), binary) + self._Relink(os.path.join(VERSIONS, CURRENT, RESOURCES), RESOURCES) + + # Back to where we were before! + os.chdir(pwd) + + def _Relink(self, dest, link): + """Creates a symlink to |dest| named |link|. If |link| already exists, + it is overwritten.""" + if os.path.lexists(link): + os.remove(link) + os.symlink(dest, link) + + def ExecCompileXcassets(self, keys, *inputs): + """Compiles multiple .xcassets files into a single .car file. + + This invokes 'actool' to compile all the inputs .xcassets files. The + |keys| arguments is a json-encoded dictionary of extra arguments to + pass to 'actool' when the asset catalogs contains an application icon + or a launch image. + + Note that 'actool' does not create the Assets.car file if the asset + catalogs does not contains imageset. + """ + command_line = [ + 'xcrun', 'actool', '--output-format', 'human-readable-text', + '--compress-pngs', '--notices', '--warnings', '--errors', + ] + is_iphone_target = 'IPHONEOS_DEPLOYMENT_TARGET' in os.environ + if is_iphone_target: + platform = os.environ['CONFIGURATION'].split('-')[-1] + if platform not in ('iphoneos', 'iphonesimulator'): + platform = 'iphonesimulator' + command_line.extend([ + '--platform', platform, '--target-device', 'iphone', + '--target-device', 'ipad', '--minimum-deployment-target', + os.environ['IPHONEOS_DEPLOYMENT_TARGET'], '--compile', + os.path.abspath(os.environ['CONTENTS_FOLDER_PATH']), + ]) + else: + command_line.extend([ + '--platform', 'macosx', '--target-device', 'mac', + '--minimum-deployment-target', os.environ['MACOSX_DEPLOYMENT_TARGET'], + '--compile', + os.path.abspath(os.environ['UNLOCALIZED_RESOURCES_FOLDER_PATH']), + ]) + if keys: + keys = json.loads(keys) + for key, value in keys.iteritems(): + arg_name = '--' + key + if isinstance(value, bool): + if value: + command_line.append(arg_name) + elif isinstance(value, list): + for v in value: + command_line.append(arg_name) + command_line.append(str(v)) + else: + command_line.append(arg_name) + command_line.append(str(value)) + # Note: actool crashes if inputs path are relative, so use os.path.abspath + # to get absolute path name for inputs. + command_line.extend(map(os.path.abspath, inputs)) + subprocess.check_call(command_line) + + def ExecMergeInfoPlist(self, output, *inputs): + """Merge multiple .plist files into a single .plist file.""" + merged_plist = {} + for path in inputs: + plist = self._LoadPlistMaybeBinary(path) + self._MergePlist(merged_plist, plist) + plistlib.writePlist(merged_plist, output) + + def ExecCodeSignBundle(self, key, resource_rules, entitlements, provisioning): + """Code sign a bundle. + + This function tries to code sign an iOS bundle, following the same + algorithm as Xcode: + 1. copy ResourceRules.plist from the user or the SDK into the bundle, + 2. pick the provisioning profile that best match the bundle identifier, + and copy it into the bundle as embedded.mobileprovision, + 3. copy Entitlements.plist from user or SDK next to the bundle, + 4. code sign the bundle. + """ + resource_rules_path = self._InstallResourceRules(resource_rules) + substitutions, overrides = self._InstallProvisioningProfile( + provisioning, self._GetCFBundleIdentifier()) + entitlements_path = self._InstallEntitlements( + entitlements, substitutions, overrides) + subprocess.check_call([ + 'codesign', '--force', '--sign', key, '--resource-rules', + resource_rules_path, '--entitlements', entitlements_path, + os.path.join( + os.environ['TARGET_BUILD_DIR'], + os.environ['FULL_PRODUCT_NAME'])]) + + def _InstallResourceRules(self, resource_rules): + """Installs ResourceRules.plist from user or SDK into the bundle. + + Args: + resource_rules: string, optional, path to the ResourceRules.plist file + to use, default to "${SDKROOT}/ResourceRules.plist" + + Returns: + Path to the copy of ResourceRules.plist into the bundle. + """ + source_path = resource_rules + target_path = os.path.join( + os.environ['BUILT_PRODUCTS_DIR'], + os.environ['CONTENTS_FOLDER_PATH'], + 'ResourceRules.plist') + if not source_path: + source_path = os.path.join( + os.environ['SDKROOT'], 'ResourceRules.plist') + shutil.copy2(source_path, target_path) + return target_path + + def _InstallProvisioningProfile(self, profile, bundle_identifier): + """Installs embedded.mobileprovision into the bundle. + + Args: + profile: string, optional, short name of the .mobileprovision file + to use, if empty or the file is missing, the best file installed + will be used + bundle_identifier: string, value of CFBundleIdentifier from Info.plist + + Returns: + A tuple containing two dictionary: variables substitutions and values + to overrides when generating the entitlements file. + """ + source_path, provisioning_data, team_id = self._FindProvisioningProfile( + profile, bundle_identifier) + target_path = os.path.join( + os.environ['BUILT_PRODUCTS_DIR'], + os.environ['CONTENTS_FOLDER_PATH'], + 'embedded.mobileprovision') + shutil.copy2(source_path, target_path) + substitutions = self._GetSubstitutions(bundle_identifier, team_id + '.') + return substitutions, provisioning_data['Entitlements'] + + def _FindProvisioningProfile(self, profile, bundle_identifier): + """Finds the .mobileprovision file to use for signing the bundle. + + Checks all the installed provisioning profiles (or if the user specified + the PROVISIONING_PROFILE variable, only consult it) and select the most + specific that correspond to the bundle identifier. + + Args: + profile: string, optional, short name of the .mobileprovision file + to use, if empty or the file is missing, the best file installed + will be used + bundle_identifier: string, value of CFBundleIdentifier from Info.plist + + Returns: + A tuple of the path to the selected provisioning profile, the data of + the embedded plist in the provisioning profile and the team identifier + to use for code signing. + + Raises: + SystemExit: if no .mobileprovision can be used to sign the bundle. + """ + profiles_dir = os.path.join( + os.environ['HOME'], 'Library', 'MobileDevice', 'Provisioning Profiles') + if not os.path.isdir(profiles_dir): + print >>sys.stderr, ( + 'cannot find mobile provisioning for %s' % bundle_identifier) + sys.exit(1) + provisioning_profiles = None + if profile: + profile_path = os.path.join(profiles_dir, profile + '.mobileprovision') + if os.path.exists(profile_path): + provisioning_profiles = [profile_path] + if not provisioning_profiles: + provisioning_profiles = glob.glob( + os.path.join(profiles_dir, '*.mobileprovision')) + valid_provisioning_profiles = {} + for profile_path in provisioning_profiles: + profile_data = self._LoadProvisioningProfile(profile_path) + app_id_pattern = profile_data.get( + 'Entitlements', {}).get('application-identifier', '') + for team_identifier in profile_data.get('TeamIdentifier', []): + app_id = '%s.%s' % (team_identifier, bundle_identifier) + if fnmatch.fnmatch(app_id, app_id_pattern): + valid_provisioning_profiles[app_id_pattern] = ( + profile_path, profile_data, team_identifier) + if not valid_provisioning_profiles: + print >>sys.stderr, ( + 'cannot find mobile provisioning for %s' % bundle_identifier) + sys.exit(1) + # If the user has multiple provisioning profiles installed that can be + # used for ${bundle_identifier}, pick the most specific one (ie. the + # provisioning profile whose pattern is the longest). + selected_key = max(valid_provisioning_profiles, key=lambda v: len(v)) + return valid_provisioning_profiles[selected_key] + + def _LoadProvisioningProfile(self, profile_path): + """Extracts the plist embedded in a provisioning profile. + + Args: + profile_path: string, path to the .mobileprovision file + + Returns: + Content of the plist embedded in the provisioning profile as a dictionary. + """ + with tempfile.NamedTemporaryFile() as temp: + subprocess.check_call([ + 'security', 'cms', '-D', '-i', profile_path, '-o', temp.name]) + return self._LoadPlistMaybeBinary(temp.name) + + def _MergePlist(self, merged_plist, plist): + """Merge |plist| into |merged_plist|.""" + for key, value in plist.iteritems(): + if isinstance(value, dict): + merged_value = merged_plist.get(key, {}) + if isinstance(merged_value, dict): + self._MergePlist(merged_value, value) + merged_plist[key] = merged_value + else: + merged_plist[key] = value + else: + merged_plist[key] = value + + def _LoadPlistMaybeBinary(self, plist_path): + """Loads into a memory a plist possibly encoded in binary format. + + This is a wrapper around plistlib.readPlist that tries to convert the + plist to the XML format if it can't be parsed (assuming that it is in + the binary format). + + Args: + plist_path: string, path to a plist file, in XML or binary format + + Returns: + Content of the plist as a dictionary. + """ + try: + # First, try to read the file using plistlib that only supports XML, + # and if an exception is raised, convert a temporary copy to XML and + # load that copy. + return plistlib.readPlist(plist_path) + except: + pass + with tempfile.NamedTemporaryFile() as temp: + shutil.copy2(plist_path, temp.name) + subprocess.check_call(['plutil', '-convert', 'xml1', temp.name]) + return plistlib.readPlist(temp.name) + + def _GetSubstitutions(self, bundle_identifier, app_identifier_prefix): + """Constructs a dictionary of variable substitutions for Entitlements.plist. + + Args: + bundle_identifier: string, value of CFBundleIdentifier from Info.plist + app_identifier_prefix: string, value for AppIdentifierPrefix + + Returns: + Dictionary of substitutions to apply when generating Entitlements.plist. + """ + return { + 'CFBundleIdentifier': bundle_identifier, + 'AppIdentifierPrefix': app_identifier_prefix, + } + + def _GetCFBundleIdentifier(self): + """Extracts CFBundleIdentifier value from Info.plist in the bundle. + + Returns: + Value of CFBundleIdentifier in the Info.plist located in the bundle. + """ + info_plist_path = os.path.join( + os.environ['TARGET_BUILD_DIR'], + os.environ['INFOPLIST_PATH']) + info_plist_data = self._LoadPlistMaybeBinary(info_plist_path) + return info_plist_data['CFBundleIdentifier'] + + def _InstallEntitlements(self, entitlements, substitutions, overrides): + """Generates and install the ${BundleName}.xcent entitlements file. + + Expands variables "$(variable)" pattern in the source entitlements file, + add extra entitlements defined in the .mobileprovision file and the copy + the generated plist to "${BundlePath}.xcent". + + Args: + entitlements: string, optional, path to the Entitlements.plist template + to use, defaults to "${SDKROOT}/Entitlements.plist" + substitutions: dictionary, variable substitutions + overrides: dictionary, values to add to the entitlements + + Returns: + Path to the generated entitlements file. + """ + source_path = entitlements + target_path = os.path.join( + os.environ['BUILT_PRODUCTS_DIR'], + os.environ['PRODUCT_NAME'] + '.xcent') + if not source_path: + source_path = os.path.join( + os.environ['SDKROOT'], + 'Entitlements.plist') + shutil.copy2(source_path, target_path) + data = self._LoadPlistMaybeBinary(target_path) + data = self._ExpandVariables(data, substitutions) + if overrides: + for key in overrides: + if key not in data: + data[key] = overrides[key] + plistlib.writePlist(data, target_path) + return target_path + + def _ExpandVariables(self, data, substitutions): + """Expands variables "$(variable)" in data. + + Args: + data: object, can be either string, list or dictionary + substitutions: dictionary, variable substitutions to perform + + Returns: + Copy of data where each references to "$(variable)" has been replaced + by the corresponding value found in substitutions, or left intact if + the key was not found. + """ + if isinstance(data, str): + for key, value in substitutions.iteritems(): + data = data.replace('$(%s)' % key, value) + return data + if isinstance(data, list): + return [self._ExpandVariables(v, substitutions) for v in data] + if isinstance(data, dict): + return {k: self._ExpandVariables(data[k], substitutions) for k in data} + return data + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py new file mode 100644 index 00000000..ca67b122 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py @@ -0,0 +1,1087 @@ +# Copyright (c) 2012 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +""" +This module helps emulate Visual Studio 2008 behavior on top of other +build systems, primarily ninja. +""" + +import os +import re +import subprocess +import sys + +from gyp.common import OrderedSet +import gyp.MSVSUtil +import gyp.MSVSVersion + + +windows_quoter_regex = re.compile(r'(\\*)"') + + +def QuoteForRspFile(arg): + """Quote a command line argument so that it appears as one argument when + processed via cmd.exe and parsed by CommandLineToArgvW (as is typical for + Windows programs).""" + # See http://goo.gl/cuFbX and http://goo.gl/dhPnp including the comment + # threads. This is actually the quoting rules for CommandLineToArgvW, not + # for the shell, because the shell doesn't do anything in Windows. This + # works more or less because most programs (including the compiler, etc.) + # use that function to handle command line arguments. + + # For a literal quote, CommandLineToArgvW requires 2n+1 backslashes + # preceding it, and results in n backslashes + the quote. So we substitute + # in 2* what we match, +1 more, plus the quote. + arg = windows_quoter_regex.sub(lambda mo: 2 * mo.group(1) + '\\"', arg) + + # %'s also need to be doubled otherwise they're interpreted as batch + # positional arguments. Also make sure to escape the % so that they're + # passed literally through escaping so they can be singled to just the + # original %. Otherwise, trying to pass the literal representation that + # looks like an environment variable to the shell (e.g. %PATH%) would fail. + arg = arg.replace('%', '%%') + + # These commands are used in rsp files, so no escaping for the shell (via ^) + # is necessary. + + # Finally, wrap the whole thing in quotes so that the above quote rule + # applies and whitespace isn't a word break. + return '"' + arg + '"' + + +def EncodeRspFileList(args): + """Process a list of arguments using QuoteCmdExeArgument.""" + # Note that the first argument is assumed to be the command. Don't add + # quotes around it because then built-ins like 'echo', etc. won't work. + # Take care to normpath only the path in the case of 'call ../x.bat' because + # otherwise the whole thing is incorrectly interpreted as a path and not + # normalized correctly. + if not args: return '' + if args[0].startswith('call '): + call, program = args[0].split(' ', 1) + program = call + ' ' + os.path.normpath(program) + else: + program = os.path.normpath(args[0]) + return program + ' ' + ' '.join(QuoteForRspFile(arg) for arg in args[1:]) + + +def _GenericRetrieve(root, default, path): + """Given a list of dictionary keys |path| and a tree of dicts |root|, find + value at path, or return |default| if any of the path doesn't exist.""" + if not root: + return default + if not path: + return root + return _GenericRetrieve(root.get(path[0]), default, path[1:]) + + +def _AddPrefix(element, prefix): + """Add |prefix| to |element| or each subelement if element is iterable.""" + if element is None: + return element + # Note, not Iterable because we don't want to handle strings like that. + if isinstance(element, list) or isinstance(element, tuple): + return [prefix + e for e in element] + else: + return prefix + element + + +def _DoRemapping(element, map): + """If |element| then remap it through |map|. If |element| is iterable then + each item will be remapped. Any elements not found will be removed.""" + if map is not None and element is not None: + if not callable(map): + map = map.get # Assume it's a dict, otherwise a callable to do the remap. + if isinstance(element, list) or isinstance(element, tuple): + element = filter(None, [map(elem) for elem in element]) + else: + element = map(element) + return element + + +def _AppendOrReturn(append, element): + """If |append| is None, simply return |element|. If |append| is not None, + then add |element| to it, adding each item in |element| if it's a list or + tuple.""" + if append is not None and element is not None: + if isinstance(element, list) or isinstance(element, tuple): + append.extend(element) + else: + append.append(element) + else: + return element + + +def _FindDirectXInstallation(): + """Try to find an installation location for the DirectX SDK. Check for the + standard environment variable, and if that doesn't exist, try to find + via the registry. May return None if not found in either location.""" + # Return previously calculated value, if there is one + if hasattr(_FindDirectXInstallation, 'dxsdk_dir'): + return _FindDirectXInstallation.dxsdk_dir + + dxsdk_dir = os.environ.get('DXSDK_DIR') + if not dxsdk_dir: + # Setup params to pass to and attempt to launch reg.exe. + cmd = ['reg.exe', 'query', r'HKLM\Software\Microsoft\DirectX', '/s'] + p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + for line in p.communicate()[0].splitlines(): + if 'InstallPath' in line: + dxsdk_dir = line.split(' ')[3] + "\\" + + # Cache return value + _FindDirectXInstallation.dxsdk_dir = dxsdk_dir + return dxsdk_dir + + +def GetGlobalVSMacroEnv(vs_version): + """Get a dict of variables mapping internal VS macro names to their gyp + equivalents. Returns all variables that are independent of the target.""" + env = {} + # '$(VSInstallDir)' and '$(VCInstallDir)' are available when and only when + # Visual Studio is actually installed. + if vs_version.Path(): + env['$(VSInstallDir)'] = vs_version.Path() + env['$(VCInstallDir)'] = os.path.join(vs_version.Path(), 'VC') + '\\' + # Chromium uses DXSDK_DIR in include/lib paths, but it may or may not be + # set. This happens when the SDK is sync'd via src-internal, rather than + # by typical end-user installation of the SDK. If it's not set, we don't + # want to leave the unexpanded variable in the path, so simply strip it. + dxsdk_dir = _FindDirectXInstallation() + env['$(DXSDK_DIR)'] = dxsdk_dir if dxsdk_dir else '' + # Try to find an installation location for the Windows DDK by checking + # the WDK_DIR environment variable, may be None. + env['$(WDK_DIR)'] = os.environ.get('WDK_DIR', '') + return env + +def ExtractSharedMSVSSystemIncludes(configs, generator_flags): + """Finds msvs_system_include_dirs that are common to all targets, removes + them from all targets, and returns an OrderedSet containing them.""" + all_system_includes = OrderedSet( + configs[0].get('msvs_system_include_dirs', [])) + for config in configs[1:]: + system_includes = config.get('msvs_system_include_dirs', []) + all_system_includes = all_system_includes & OrderedSet(system_includes) + if not all_system_includes: + return None + # Expand macros in all_system_includes. + env = GetGlobalVSMacroEnv(GetVSVersion(generator_flags)) + expanded_system_includes = OrderedSet([ExpandMacros(include, env) + for include in all_system_includes]) + if any(['$' in include for include in expanded_system_includes]): + # Some path relies on target-specific variables, bail. + return None + + # Remove system includes shared by all targets from the targets. + for config in configs: + includes = config.get('msvs_system_include_dirs', []) + if includes: # Don't insert a msvs_system_include_dirs key if not needed. + # This must check the unexpanded includes list: + new_includes = [i for i in includes if i not in all_system_includes] + config['msvs_system_include_dirs'] = new_includes + return expanded_system_includes + + +class MsvsSettings(object): + """A class that understands the gyp 'msvs_...' values (especially the + msvs_settings field). They largely correpond to the VS2008 IDE DOM. This + class helps map those settings to command line options.""" + + def __init__(self, spec, generator_flags): + self.spec = spec + self.vs_version = GetVSVersion(generator_flags) + + supported_fields = [ + ('msvs_configuration_attributes', dict), + ('msvs_settings', dict), + ('msvs_system_include_dirs', list), + ('msvs_disabled_warnings', list), + ('msvs_precompiled_header', str), + ('msvs_precompiled_source', str), + ('msvs_configuration_platform', str), + ('msvs_target_platform', str), + ] + configs = spec['configurations'] + for field, default in supported_fields: + setattr(self, field, {}) + for configname, config in configs.iteritems(): + getattr(self, field)[configname] = config.get(field, default()) + + self.msvs_cygwin_dirs = spec.get('msvs_cygwin_dirs', ['.']) + + unsupported_fields = [ + 'msvs_prebuild', + 'msvs_postbuild', + ] + unsupported = [] + for field in unsupported_fields: + for config in configs.values(): + if field in config: + unsupported += ["%s not supported (target %s)." % + (field, spec['target_name'])] + if unsupported: + raise Exception('\n'.join(unsupported)) + + def GetExtension(self): + """Returns the extension for the target, with no leading dot. + + Uses 'product_extension' if specified, otherwise uses MSVS defaults based on + the target type. + """ + ext = self.spec.get('product_extension', None) + if ext: + return ext + return gyp.MSVSUtil.TARGET_TYPE_EXT.get(self.spec['type'], '') + + def GetVSMacroEnv(self, base_to_build=None, config=None): + """Get a dict of variables mapping internal VS macro names to their gyp + equivalents.""" + target_platform = 'Win32' if self.GetArch(config) == 'x86' else 'x64' + target_name = self.spec.get('product_prefix', '') + \ + self.spec.get('product_name', self.spec['target_name']) + target_dir = base_to_build + '\\' if base_to_build else '' + target_ext = '.' + self.GetExtension() + target_file_name = target_name + target_ext + + replacements = { + '$(InputName)': '${root}', + '$(InputPath)': '${source}', + '$(IntDir)': '$!INTERMEDIATE_DIR', + '$(OutDir)\\': target_dir, + '$(PlatformName)': target_platform, + '$(ProjectDir)\\': '', + '$(ProjectName)': self.spec['target_name'], + '$(TargetDir)\\': target_dir, + '$(TargetExt)': target_ext, + '$(TargetFileName)': target_file_name, + '$(TargetName)': target_name, + '$(TargetPath)': os.path.join(target_dir, target_file_name), + } + replacements.update(GetGlobalVSMacroEnv(self.vs_version)) + return replacements + + def ConvertVSMacros(self, s, base_to_build=None, config=None): + """Convert from VS macro names to something equivalent.""" + env = self.GetVSMacroEnv(base_to_build, config=config) + return ExpandMacros(s, env) + + def AdjustLibraries(self, libraries): + """Strip -l from library if it's specified with that.""" + libs = [lib[2:] if lib.startswith('-l') else lib for lib in libraries] + return [lib + '.lib' if not lib.endswith('.lib') else lib for lib in libs] + + def _GetAndMunge(self, field, path, default, prefix, append, map): + """Retrieve a value from |field| at |path| or return |default|. If + |append| is specified, and the item is found, it will be appended to that + object instead of returned. If |map| is specified, results will be + remapped through |map| before being returned or appended.""" + result = _GenericRetrieve(field, default, path) + result = _DoRemapping(result, map) + result = _AddPrefix(result, prefix) + return _AppendOrReturn(append, result) + + class _GetWrapper(object): + def __init__(self, parent, field, base_path, append=None): + self.parent = parent + self.field = field + self.base_path = [base_path] + self.append = append + def __call__(self, name, map=None, prefix='', default=None): + return self.parent._GetAndMunge(self.field, self.base_path + [name], + default=default, prefix=prefix, append=self.append, map=map) + + def GetArch(self, config): + """Get architecture based on msvs_configuration_platform and + msvs_target_platform. Returns either 'x86' or 'x64'.""" + configuration_platform = self.msvs_configuration_platform.get(config, '') + platform = self.msvs_target_platform.get(config, '') + if not platform: # If no specific override, use the configuration's. + platform = configuration_platform + # Map from platform to architecture. + return {'Win32': 'x86', 'x64': 'x64'}.get(platform, 'x86') + + def _TargetConfig(self, config): + """Returns the target-specific configuration.""" + # There's two levels of architecture/platform specification in VS. The + # first level is globally for the configuration (this is what we consider + # "the" config at the gyp level, which will be something like 'Debug' or + # 'Release_x64'), and a second target-specific configuration, which is an + # override for the global one. |config| is remapped here to take into + # account the local target-specific overrides to the global configuration. + arch = self.GetArch(config) + if arch == 'x64' and not config.endswith('_x64'): + config += '_x64' + if arch == 'x86' and config.endswith('_x64'): + config = config.rsplit('_', 1)[0] + return config + + def _Setting(self, path, config, + default=None, prefix='', append=None, map=None): + """_GetAndMunge for msvs_settings.""" + return self._GetAndMunge( + self.msvs_settings[config], path, default, prefix, append, map) + + def _ConfigAttrib(self, path, config, + default=None, prefix='', append=None, map=None): + """_GetAndMunge for msvs_configuration_attributes.""" + return self._GetAndMunge( + self.msvs_configuration_attributes[config], + path, default, prefix, append, map) + + def AdjustIncludeDirs(self, include_dirs, config): + """Updates include_dirs to expand VS specific paths, and adds the system + include dirs used for platform SDK and similar.""" + config = self._TargetConfig(config) + includes = include_dirs + self.msvs_system_include_dirs[config] + includes.extend(self._Setting( + ('VCCLCompilerTool', 'AdditionalIncludeDirectories'), config, default=[])) + return [self.ConvertVSMacros(p, config=config) for p in includes] + + def AdjustMidlIncludeDirs(self, midl_include_dirs, config): + """Updates midl_include_dirs to expand VS specific paths, and adds the + system include dirs used for platform SDK and similar.""" + config = self._TargetConfig(config) + includes = midl_include_dirs + self.msvs_system_include_dirs[config] + includes.extend(self._Setting( + ('VCMIDLTool', 'AdditionalIncludeDirectories'), config, default=[])) + return [self.ConvertVSMacros(p, config=config) for p in includes] + + def GetComputedDefines(self, config): + """Returns the set of defines that are injected to the defines list based + on other VS settings.""" + config = self._TargetConfig(config) + defines = [] + if self._ConfigAttrib(['CharacterSet'], config) == '1': + defines.extend(('_UNICODE', 'UNICODE')) + if self._ConfigAttrib(['CharacterSet'], config) == '2': + defines.append('_MBCS') + defines.extend(self._Setting( + ('VCCLCompilerTool', 'PreprocessorDefinitions'), config, default=[])) + return defines + + def GetCompilerPdbName(self, config, expand_special): + """Get the pdb file name that should be used for compiler invocations, or + None if there's no explicit name specified.""" + config = self._TargetConfig(config) + pdbname = self._Setting( + ('VCCLCompilerTool', 'ProgramDataBaseFileName'), config) + if pdbname: + pdbname = expand_special(self.ConvertVSMacros(pdbname)) + return pdbname + + def GetMapFileName(self, config, expand_special): + """Gets the explicitly overriden map file name for a target or returns None + if it's not set.""" + config = self._TargetConfig(config) + map_file = self._Setting(('VCLinkerTool', 'MapFileName'), config) + if map_file: + map_file = expand_special(self.ConvertVSMacros(map_file, config=config)) + return map_file + + def GetOutputName(self, config, expand_special): + """Gets the explicitly overridden output name for a target or returns None + if it's not overridden.""" + config = self._TargetConfig(config) + type = self.spec['type'] + root = 'VCLibrarianTool' if type == 'static_library' else 'VCLinkerTool' + # TODO(scottmg): Handle OutputDirectory without OutputFile. + output_file = self._Setting((root, 'OutputFile'), config) + if output_file: + output_file = expand_special(self.ConvertVSMacros( + output_file, config=config)) + return output_file + + def GetPDBName(self, config, expand_special, default): + """Gets the explicitly overridden pdb name for a target or returns + default if it's not overridden, or if no pdb will be generated.""" + config = self._TargetConfig(config) + output_file = self._Setting(('VCLinkerTool', 'ProgramDatabaseFile'), config) + generate_debug_info = self._Setting( + ('VCLinkerTool', 'GenerateDebugInformation'), config) + if generate_debug_info == 'true': + if output_file: + return expand_special(self.ConvertVSMacros(output_file, config=config)) + else: + return default + else: + return None + + def GetNoImportLibrary(self, config): + """If NoImportLibrary: true, ninja will not expect the output to include + an import library.""" + config = self._TargetConfig(config) + noimplib = self._Setting(('NoImportLibrary',), config) + return noimplib == 'true' + + def GetAsmflags(self, config): + """Returns the flags that need to be added to ml invocations.""" + config = self._TargetConfig(config) + asmflags = [] + safeseh = self._Setting(('MASM', 'UseSafeExceptionHandlers'), config) + if safeseh == 'true': + asmflags.append('/safeseh') + return asmflags + + def GetCflags(self, config): + """Returns the flags that need to be added to .c and .cc compilations.""" + config = self._TargetConfig(config) + cflags = [] + cflags.extend(['/wd' + w for w in self.msvs_disabled_warnings[config]]) + cl = self._GetWrapper(self, self.msvs_settings[config], + 'VCCLCompilerTool', append=cflags) + cl('Optimization', + map={'0': 'd', '1': '1', '2': '2', '3': 'x'}, prefix='/O', default='2') + cl('InlineFunctionExpansion', prefix='/Ob') + cl('DisableSpecificWarnings', prefix='/wd') + cl('StringPooling', map={'true': '/GF'}) + cl('EnableFiberSafeOptimizations', map={'true': '/GT'}) + cl('OmitFramePointers', map={'false': '-', 'true': ''}, prefix='/Oy') + cl('EnableIntrinsicFunctions', map={'false': '-', 'true': ''}, prefix='/Oi') + cl('FavorSizeOrSpeed', map={'1': 't', '2': 's'}, prefix='/O') + cl('FloatingPointModel', + map={'0': 'precise', '1': 'strict', '2': 'fast'}, prefix='/fp:', + default='0') + cl('CompileAsManaged', map={'false': '', 'true': '/clr'}) + cl('WholeProgramOptimization', map={'true': '/GL'}) + cl('WarningLevel', prefix='/W') + cl('WarnAsError', map={'true': '/WX'}) + cl('CallingConvention', + map={'0': 'd', '1': 'r', '2': 'z', '3': 'v'}, prefix='/G') + cl('DebugInformationFormat', + map={'1': '7', '3': 'i', '4': 'I'}, prefix='/Z') + cl('RuntimeTypeInfo', map={'true': '/GR', 'false': '/GR-'}) + cl('EnableFunctionLevelLinking', map={'true': '/Gy', 'false': '/Gy-'}) + cl('MinimalRebuild', map={'true': '/Gm'}) + cl('BufferSecurityCheck', map={'true': '/GS', 'false': '/GS-'}) + cl('BasicRuntimeChecks', map={'1': 's', '2': 'u', '3': '1'}, prefix='/RTC') + cl('RuntimeLibrary', + map={'0': 'T', '1': 'Td', '2': 'D', '3': 'Dd'}, prefix='/M') + cl('ExceptionHandling', map={'1': 'sc','2': 'a'}, prefix='/EH') + cl('DefaultCharIsUnsigned', map={'true': '/J'}) + cl('TreatWChar_tAsBuiltInType', + map={'false': '-', 'true': ''}, prefix='/Zc:wchar_t') + cl('EnablePREfast', map={'true': '/analyze'}) + cl('AdditionalOptions', prefix='') + cl('EnableEnhancedInstructionSet', + map={'1': 'SSE', '2': 'SSE2', '3': 'AVX', '4': 'IA32', '5': 'AVX2'}, + prefix='/arch:') + cflags.extend(['/FI' + f for f in self._Setting( + ('VCCLCompilerTool', 'ForcedIncludeFiles'), config, default=[])]) + if self.vs_version.short_name in ('2013', '2013e', '2015'): + # New flag required in 2013 to maintain previous PDB behavior. + cflags.append('/FS') + # ninja handles parallelism by itself, don't have the compiler do it too. + cflags = filter(lambda x: not x.startswith('/MP'), cflags) + return cflags + + def _GetPchFlags(self, config, extension): + """Get the flags to be added to the cflags for precompiled header support. + """ + config = self._TargetConfig(config) + # The PCH is only built once by a particular source file. Usage of PCH must + # only be for the same language (i.e. C vs. C++), so only include the pch + # flags when the language matches. + if self.msvs_precompiled_header[config]: + source_ext = os.path.splitext(self.msvs_precompiled_source[config])[1] + if _LanguageMatchesForPch(source_ext, extension): + pch = os.path.split(self.msvs_precompiled_header[config])[1] + return ['/Yu' + pch, '/FI' + pch, '/Fp${pchprefix}.' + pch + '.pch'] + return [] + + def GetCflagsC(self, config): + """Returns the flags that need to be added to .c compilations.""" + config = self._TargetConfig(config) + return self._GetPchFlags(config, '.c') + + def GetCflagsCC(self, config): + """Returns the flags that need to be added to .cc compilations.""" + config = self._TargetConfig(config) + return ['/TP'] + self._GetPchFlags(config, '.cc') + + def _GetAdditionalLibraryDirectories(self, root, config, gyp_to_build_path): + """Get and normalize the list of paths in AdditionalLibraryDirectories + setting.""" + config = self._TargetConfig(config) + libpaths = self._Setting((root, 'AdditionalLibraryDirectories'), + config, default=[]) + libpaths = [os.path.normpath( + gyp_to_build_path(self.ConvertVSMacros(p, config=config))) + for p in libpaths] + return ['/LIBPATH:"' + p + '"' for p in libpaths] + + def GetLibFlags(self, config, gyp_to_build_path): + """Returns the flags that need to be added to lib commands.""" + config = self._TargetConfig(config) + libflags = [] + lib = self._GetWrapper(self, self.msvs_settings[config], + 'VCLibrarianTool', append=libflags) + libflags.extend(self._GetAdditionalLibraryDirectories( + 'VCLibrarianTool', config, gyp_to_build_path)) + lib('LinkTimeCodeGeneration', map={'true': '/LTCG'}) + lib('TargetMachine', map={'1': 'X86', '17': 'X64', '3': 'ARM'}, + prefix='/MACHINE:') + lib('AdditionalOptions') + return libflags + + def GetDefFile(self, gyp_to_build_path): + """Returns the .def file from sources, if any. Otherwise returns None.""" + spec = self.spec + if spec['type'] in ('shared_library', 'loadable_module', 'executable'): + def_files = [s for s in spec.get('sources', []) if s.endswith('.def')] + if len(def_files) == 1: + return gyp_to_build_path(def_files[0]) + elif len(def_files) > 1: + raise Exception("Multiple .def files") + return None + + def _GetDefFileAsLdflags(self, ldflags, gyp_to_build_path): + """.def files get implicitly converted to a ModuleDefinitionFile for the + linker in the VS generator. Emulate that behaviour here.""" + def_file = self.GetDefFile(gyp_to_build_path) + if def_file: + ldflags.append('/DEF:"%s"' % def_file) + + def GetPGDName(self, config, expand_special): + """Gets the explicitly overridden pgd name for a target or returns None + if it's not overridden.""" + config = self._TargetConfig(config) + output_file = self._Setting( + ('VCLinkerTool', 'ProfileGuidedDatabase'), config) + if output_file: + output_file = expand_special(self.ConvertVSMacros( + output_file, config=config)) + return output_file + + def GetLdflags(self, config, gyp_to_build_path, expand_special, + manifest_base_name, output_name, is_executable, build_dir): + """Returns the flags that need to be added to link commands, and the + manifest files.""" + config = self._TargetConfig(config) + ldflags = [] + ld = self._GetWrapper(self, self.msvs_settings[config], + 'VCLinkerTool', append=ldflags) + self._GetDefFileAsLdflags(ldflags, gyp_to_build_path) + ld('GenerateDebugInformation', map={'true': '/DEBUG'}) + ld('TargetMachine', map={'1': 'X86', '17': 'X64', '3': 'ARM'}, + prefix='/MACHINE:') + ldflags.extend(self._GetAdditionalLibraryDirectories( + 'VCLinkerTool', config, gyp_to_build_path)) + ld('DelayLoadDLLs', prefix='/DELAYLOAD:') + ld('TreatLinkerWarningAsErrors', prefix='/WX', + map={'true': '', 'false': ':NO'}) + out = self.GetOutputName(config, expand_special) + if out: + ldflags.append('/OUT:' + out) + pdb = self.GetPDBName(config, expand_special, output_name + '.pdb') + if pdb: + ldflags.append('/PDB:' + pdb) + pgd = self.GetPGDName(config, expand_special) + if pgd: + ldflags.append('/PGD:' + pgd) + map_file = self.GetMapFileName(config, expand_special) + ld('GenerateMapFile', map={'true': '/MAP:' + map_file if map_file + else '/MAP'}) + ld('MapExports', map={'true': '/MAPINFO:EXPORTS'}) + ld('AdditionalOptions', prefix='') + + minimum_required_version = self._Setting( + ('VCLinkerTool', 'MinimumRequiredVersion'), config, default='') + if minimum_required_version: + minimum_required_version = ',' + minimum_required_version + ld('SubSystem', + map={'1': 'CONSOLE%s' % minimum_required_version, + '2': 'WINDOWS%s' % minimum_required_version}, + prefix='/SUBSYSTEM:') + + stack_reserve_size = self._Setting( + ('VCLinkerTool', 'StackReserveSize'), config, default='') + if stack_reserve_size: + stack_commit_size = self._Setting( + ('VCLinkerTool', 'StackCommitSize'), config, default='') + if stack_commit_size: + stack_commit_size = ',' + stack_commit_size + ldflags.append('/STACK:%s%s' % (stack_reserve_size, stack_commit_size)) + + ld('TerminalServerAware', map={'1': ':NO', '2': ''}, prefix='/TSAWARE') + ld('LinkIncremental', map={'1': ':NO', '2': ''}, prefix='/INCREMENTAL') + ld('BaseAddress', prefix='/BASE:') + ld('FixedBaseAddress', map={'1': ':NO', '2': ''}, prefix='/FIXED') + ld('RandomizedBaseAddress', + map={'1': ':NO', '2': ''}, prefix='/DYNAMICBASE') + ld('DataExecutionPrevention', + map={'1': ':NO', '2': ''}, prefix='/NXCOMPAT') + ld('OptimizeReferences', map={'1': 'NOREF', '2': 'REF'}, prefix='/OPT:') + ld('ForceSymbolReferences', prefix='/INCLUDE:') + ld('EnableCOMDATFolding', map={'1': 'NOICF', '2': 'ICF'}, prefix='/OPT:') + ld('LinkTimeCodeGeneration', + map={'1': '', '2': ':PGINSTRUMENT', '3': ':PGOPTIMIZE', + '4': ':PGUPDATE'}, + prefix='/LTCG') + ld('IgnoreDefaultLibraryNames', prefix='/NODEFAULTLIB:') + ld('ResourceOnlyDLL', map={'true': '/NOENTRY'}) + ld('EntryPointSymbol', prefix='/ENTRY:') + ld('Profile', map={'true': '/PROFILE'}) + ld('LargeAddressAware', + map={'1': ':NO', '2': ''}, prefix='/LARGEADDRESSAWARE') + # TODO(scottmg): This should sort of be somewhere else (not really a flag). + ld('AdditionalDependencies', prefix='') + + if self.GetArch(config) == 'x86': + safeseh_default = 'true' + else: + safeseh_default = None + ld('ImageHasSafeExceptionHandlers', + map={'false': ':NO', 'true': ''}, prefix='/SAFESEH', + default=safeseh_default) + + # If the base address is not specifically controlled, DYNAMICBASE should + # be on by default. + base_flags = filter(lambda x: 'DYNAMICBASE' in x or x == '/FIXED', + ldflags) + if not base_flags: + ldflags.append('/DYNAMICBASE') + + # If the NXCOMPAT flag has not been specified, default to on. Despite the + # documentation that says this only defaults to on when the subsystem is + # Vista or greater (which applies to the linker), the IDE defaults it on + # unless it's explicitly off. + if not filter(lambda x: 'NXCOMPAT' in x, ldflags): + ldflags.append('/NXCOMPAT') + + have_def_file = filter(lambda x: x.startswith('/DEF:'), ldflags) + manifest_flags, intermediate_manifest, manifest_files = \ + self._GetLdManifestFlags(config, manifest_base_name, gyp_to_build_path, + is_executable and not have_def_file, build_dir) + ldflags.extend(manifest_flags) + return ldflags, intermediate_manifest, manifest_files + + def _GetLdManifestFlags(self, config, name, gyp_to_build_path, + allow_isolation, build_dir): + """Returns a 3-tuple: + - the set of flags that need to be added to the link to generate + a default manifest + - the intermediate manifest that the linker will generate that should be + used to assert it doesn't add anything to the merged one. + - the list of all the manifest files to be merged by the manifest tool and + included into the link.""" + generate_manifest = self._Setting(('VCLinkerTool', 'GenerateManifest'), + config, + default='true') + if generate_manifest != 'true': + # This means not only that the linker should not generate the intermediate + # manifest but also that the manifest tool should do nothing even when + # additional manifests are specified. + return ['/MANIFEST:NO'], [], [] + + output_name = name + '.intermediate.manifest' + flags = [ + '/MANIFEST', + '/ManifestFile:' + output_name, + ] + + # Instead of using the MANIFESTUAC flags, we generate a .manifest to + # include into the list of manifests. This allows us to avoid the need to + # do two passes during linking. The /MANIFEST flag and /ManifestFile are + # still used, and the intermediate manifest is used to assert that the + # final manifest we get from merging all the additional manifest files + # (plus the one we generate here) isn't modified by merging the + # intermediate into it. + + # Always NO, because we generate a manifest file that has what we want. + flags.append('/MANIFESTUAC:NO') + + config = self._TargetConfig(config) + enable_uac = self._Setting(('VCLinkerTool', 'EnableUAC'), config, + default='true') + manifest_files = [] + generated_manifest_outer = \ +"" \ +"%s" \ +"" + if enable_uac == 'true': + execution_level = self._Setting(('VCLinkerTool', 'UACExecutionLevel'), + config, default='0') + execution_level_map = { + '0': 'asInvoker', + '1': 'highestAvailable', + '2': 'requireAdministrator' + } + + ui_access = self._Setting(('VCLinkerTool', 'UACUIAccess'), config, + default='false') + + inner = ''' + + + + + + +''' % (execution_level_map[execution_level], ui_access) + else: + inner = '' + + generated_manifest_contents = generated_manifest_outer % inner + generated_name = name + '.generated.manifest' + # Need to join with the build_dir here as we're writing it during + # generation time, but we return the un-joined version because the build + # will occur in that directory. We only write the file if the contents + # have changed so that simply regenerating the project files doesn't + # cause a relink. + build_dir_generated_name = os.path.join(build_dir, generated_name) + gyp.common.EnsureDirExists(build_dir_generated_name) + f = gyp.common.WriteOnDiff(build_dir_generated_name) + f.write(generated_manifest_contents) + f.close() + manifest_files = [generated_name] + + if allow_isolation: + flags.append('/ALLOWISOLATION') + + manifest_files += self._GetAdditionalManifestFiles(config, + gyp_to_build_path) + return flags, output_name, manifest_files + + def _GetAdditionalManifestFiles(self, config, gyp_to_build_path): + """Gets additional manifest files that are added to the default one + generated by the linker.""" + files = self._Setting(('VCManifestTool', 'AdditionalManifestFiles'), config, + default=[]) + if isinstance(files, str): + files = files.split(';') + return [os.path.normpath( + gyp_to_build_path(self.ConvertVSMacros(f, config=config))) + for f in files] + + def IsUseLibraryDependencyInputs(self, config): + """Returns whether the target should be linked via Use Library Dependency + Inputs (using component .objs of a given .lib).""" + config = self._TargetConfig(config) + uldi = self._Setting(('VCLinkerTool', 'UseLibraryDependencyInputs'), config) + return uldi == 'true' + + def IsEmbedManifest(self, config): + """Returns whether manifest should be linked into binary.""" + config = self._TargetConfig(config) + embed = self._Setting(('VCManifestTool', 'EmbedManifest'), config, + default='true') + return embed == 'true' + + def IsLinkIncremental(self, config): + """Returns whether the target should be linked incrementally.""" + config = self._TargetConfig(config) + link_inc = self._Setting(('VCLinkerTool', 'LinkIncremental'), config) + return link_inc != '1' + + def GetRcflags(self, config, gyp_to_ninja_path): + """Returns the flags that need to be added to invocations of the resource + compiler.""" + config = self._TargetConfig(config) + rcflags = [] + rc = self._GetWrapper(self, self.msvs_settings[config], + 'VCResourceCompilerTool', append=rcflags) + rc('AdditionalIncludeDirectories', map=gyp_to_ninja_path, prefix='/I') + rcflags.append('/I' + gyp_to_ninja_path('.')) + rc('PreprocessorDefinitions', prefix='/d') + # /l arg must be in hex without leading '0x' + rc('Culture', prefix='/l', map=lambda x: hex(int(x))[2:]) + return rcflags + + def BuildCygwinBashCommandLine(self, args, path_to_base): + """Build a command line that runs args via cygwin bash. We assume that all + incoming paths are in Windows normpath'd form, so they need to be + converted to posix style for the part of the command line that's passed to + bash. We also have to do some Visual Studio macro emulation here because + various rules use magic VS names for things. Also note that rules that + contain ninja variables cannot be fixed here (for example ${source}), so + the outer generator needs to make sure that the paths that are written out + are in posix style, if the command line will be used here.""" + cygwin_dir = os.path.normpath( + os.path.join(path_to_base, self.msvs_cygwin_dirs[0])) + cd = ('cd %s' % path_to_base).replace('\\', '/') + args = [a.replace('\\', '/').replace('"', '\\"') for a in args] + args = ["'%s'" % a.replace("'", "'\\''") for a in args] + bash_cmd = ' '.join(args) + cmd = ( + 'call "%s\\setup_env.bat" && set CYGWIN=nontsec && ' % cygwin_dir + + 'bash -c "%s ; %s"' % (cd, bash_cmd)) + return cmd + + def IsRuleRunUnderCygwin(self, rule): + """Determine if an action should be run under cygwin. If the variable is + unset, or set to 1 we use cygwin.""" + return int(rule.get('msvs_cygwin_shell', + self.spec.get('msvs_cygwin_shell', 1))) != 0 + + def _HasExplicitRuleForExtension(self, spec, extension): + """Determine if there's an explicit rule for a particular extension.""" + for rule in spec.get('rules', []): + if rule['extension'] == extension: + return True + return False + + def _HasExplicitIdlActions(self, spec): + """Determine if an action should not run midl for .idl files.""" + return any([action.get('explicit_idl_action', 0) + for action in spec.get('actions', [])]) + + def HasExplicitIdlRulesOrActions(self, spec): + """Determine if there's an explicit rule or action for idl files. When + there isn't we need to generate implicit rules to build MIDL .idl files.""" + return (self._HasExplicitRuleForExtension(spec, 'idl') or + self._HasExplicitIdlActions(spec)) + + def HasExplicitAsmRules(self, spec): + """Determine if there's an explicit rule for asm files. When there isn't we + need to generate implicit rules to assemble .asm files.""" + return self._HasExplicitRuleForExtension(spec, 'asm') + + def GetIdlBuildData(self, source, config): + """Determine the implicit outputs for an idl file. Returns output + directory, outputs, and variables and flags that are required.""" + config = self._TargetConfig(config) + midl_get = self._GetWrapper(self, self.msvs_settings[config], 'VCMIDLTool') + def midl(name, default=None): + return self.ConvertVSMacros(midl_get(name, default=default), + config=config) + tlb = midl('TypeLibraryName', default='${root}.tlb') + header = midl('HeaderFileName', default='${root}.h') + dlldata = midl('DLLDataFileName', default='dlldata.c') + iid = midl('InterfaceIdentifierFileName', default='${root}_i.c') + proxy = midl('ProxyFileName', default='${root}_p.c') + # Note that .tlb is not included in the outputs as it is not always + # generated depending on the content of the input idl file. + outdir = midl('OutputDirectory', default='') + output = [header, dlldata, iid, proxy] + variables = [('tlb', tlb), + ('h', header), + ('dlldata', dlldata), + ('iid', iid), + ('proxy', proxy)] + # TODO(scottmg): Are there configuration settings to set these flags? + target_platform = 'win32' if self.GetArch(config) == 'x86' else 'x64' + flags = ['/char', 'signed', '/env', target_platform, '/Oicf'] + return outdir, output, variables, flags + + +def _LanguageMatchesForPch(source_ext, pch_source_ext): + c_exts = ('.c',) + cc_exts = ('.cc', '.cxx', '.cpp') + return ((source_ext in c_exts and pch_source_ext in c_exts) or + (source_ext in cc_exts and pch_source_ext in cc_exts)) + + +class PrecompiledHeader(object): + """Helper to generate dependencies and build rules to handle generation of + precompiled headers. Interface matches the GCH handler in xcode_emulation.py. + """ + def __init__( + self, settings, config, gyp_to_build_path, gyp_to_unique_output, obj_ext): + self.settings = settings + self.config = config + pch_source = self.settings.msvs_precompiled_source[self.config] + self.pch_source = gyp_to_build_path(pch_source) + filename, _ = os.path.splitext(pch_source) + self.output_obj = gyp_to_unique_output(filename + obj_ext).lower() + + def _PchHeader(self): + """Get the header that will appear in an #include line for all source + files.""" + return os.path.split(self.settings.msvs_precompiled_header[self.config])[1] + + def GetObjDependencies(self, sources, objs, arch): + """Given a list of sources files and the corresponding object files, + returns a list of the pch files that should be depended upon. The + additional wrapping in the return value is for interface compatibility + with make.py on Mac, and xcode_emulation.py.""" + assert arch is None + if not self._PchHeader(): + return [] + pch_ext = os.path.splitext(self.pch_source)[1] + for source in sources: + if _LanguageMatchesForPch(os.path.splitext(source)[1], pch_ext): + return [(None, None, self.output_obj)] + return [] + + def GetPchBuildCommands(self, arch): + """Not used on Windows as there are no additional build steps required + (instead, existing steps are modified in GetFlagsModifications below).""" + return [] + + def GetFlagsModifications(self, input, output, implicit, command, + cflags_c, cflags_cc, expand_special): + """Get the modified cflags and implicit dependencies that should be used + for the pch compilation step.""" + if input == self.pch_source: + pch_output = ['/Yc' + self._PchHeader()] + if command == 'cxx': + return ([('cflags_cc', map(expand_special, cflags_cc + pch_output))], + self.output_obj, []) + elif command == 'cc': + return ([('cflags_c', map(expand_special, cflags_c + pch_output))], + self.output_obj, []) + return [], output, implicit + + +vs_version = None +def GetVSVersion(generator_flags): + global vs_version + if not vs_version: + vs_version = gyp.MSVSVersion.SelectVisualStudioVersion( + generator_flags.get('msvs_version', 'auto'), + allow_fallback=False) + return vs_version + +def _GetVsvarsSetupArgs(generator_flags, arch): + vs = GetVSVersion(generator_flags) + return vs.SetupScript() + +def ExpandMacros(string, expansions): + """Expand $(Variable) per expansions dict. See MsvsSettings.GetVSMacroEnv + for the canonical way to retrieve a suitable dict.""" + if '$' in string: + for old, new in expansions.iteritems(): + assert '$(' not in new, new + string = string.replace(old, new) + return string + +def _ExtractImportantEnvironment(output_of_set): + """Extracts environment variables required for the toolchain to run from + a textual dump output by the cmd.exe 'set' command.""" + envvars_to_save = ( + 'goma_.*', # TODO(scottmg): This is ugly, but needed for goma. + 'include', + 'lib', + 'libpath', + 'path', + 'pathext', + 'systemroot', + 'temp', + 'tmp', + ) + env = {} + for line in output_of_set.splitlines(): + for envvar in envvars_to_save: + if re.match(envvar + '=', line.lower()): + var, setting = line.split('=', 1) + if envvar == 'path': + # Our own rules (for running gyp-win-tool) and other actions in + # Chromium rely on python being in the path. Add the path to this + # python here so that if it's not in the path when ninja is run + # later, python will still be found. + setting = os.path.dirname(sys.executable) + os.pathsep + setting + env[var.upper()] = setting + break + for required in ('SYSTEMROOT', 'TEMP', 'TMP'): + if required not in env: + raise Exception('Environment variable "%s" ' + 'required to be set to valid path' % required) + return env + +def _FormatAsEnvironmentBlock(envvar_dict): + """Format as an 'environment block' directly suitable for CreateProcess. + Briefly this is a list of key=value\0, terminated by an additional \0. See + CreateProcess documentation for more details.""" + block = '' + nul = '\0' + for key, value in envvar_dict.iteritems(): + block += key + '=' + value + nul + block += nul + return block + +def _ExtractCLPath(output_of_where): + """Gets the path to cl.exe based on the output of calling the environment + setup batch file, followed by the equivalent of `where`.""" + # Take the first line, as that's the first found in the PATH. + for line in output_of_where.strip().splitlines(): + if line.startswith('LOC:'): + return line[len('LOC:'):].strip() + +def GenerateEnvironmentFiles(toplevel_build_dir, generator_flags, + system_includes, open_out): + """It's not sufficient to have the absolute path to the compiler, linker, + etc. on Windows, as those tools rely on .dlls being in the PATH. We also + need to support both x86 and x64 compilers within the same build (to support + msvs_target_platform hackery). Different architectures require a different + compiler binary, and different supporting environment variables (INCLUDE, + LIB, LIBPATH). So, we extract the environment here, wrap all invocations + of compiler tools (cl, link, lib, rc, midl, etc.) via win_tool.py which + sets up the environment, and then we do not prefix the compiler with + an absolute path, instead preferring something like "cl.exe" in the rule + which will then run whichever the environment setup has put in the path. + When the following procedure to generate environment files does not + meet your requirement (e.g. for custom toolchains), you can pass + "-G ninja_use_custom_environment_files" to the gyp to suppress file + generation and use custom environment files prepared by yourself.""" + archs = ('x86', 'x64') + if generator_flags.get('ninja_use_custom_environment_files', 0): + cl_paths = {} + for arch in archs: + cl_paths[arch] = 'cl.exe' + return cl_paths + vs = GetVSVersion(generator_flags) + cl_paths = {} + for arch in archs: + # Extract environment variables for subprocesses. + args = vs.SetupScript(arch) + args.extend(('&&', 'set')) + popen = subprocess.Popen( + args, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + variables, _ = popen.communicate() + env = _ExtractImportantEnvironment(variables) + + # Inject system includes from gyp files into INCLUDE. + if system_includes: + system_includes = system_includes | OrderedSet( + env.get('INCLUDE', '').split(';')) + env['INCLUDE'] = ';'.join(system_includes) + + env_block = _FormatAsEnvironmentBlock(env) + f = open_out(os.path.join(toplevel_build_dir, 'environment.' + arch), 'wb') + f.write(env_block) + f.close() + + # Find cl.exe location for this architecture. + args = vs.SetupScript(arch) + args.extend(('&&', + 'for', '%i', 'in', '(cl.exe)', 'do', '@echo', 'LOC:%~$PATH:i')) + popen = subprocess.Popen(args, shell=True, stdout=subprocess.PIPE) + output, _ = popen.communicate() + cl_paths[arch] = _ExtractCLPath(output) + return cl_paths + +def VerifyMissingSources(sources, build_dir, generator_flags, gyp_to_ninja): + """Emulate behavior of msvs_error_on_missing_sources present in the msvs + generator: Check that all regular source files, i.e. not created at run time, + exist on disk. Missing files cause needless recompilation when building via + VS, and we want this check to match for people/bots that build using ninja, + so they're not surprised when the VS build fails.""" + if int(generator_flags.get('msvs_error_on_missing_sources', 0)): + no_specials = filter(lambda x: '$' not in x, sources) + relative = [os.path.join(build_dir, gyp_to_ninja(s)) for s in no_specials] + missing = filter(lambda x: not os.path.exists(x), relative) + if missing: + # They'll look like out\Release\..\..\stuff\things.cc, so normalize the + # path for a slightly less crazy looking output. + cleaned_up = [os.path.normpath(x) for x in missing] + raise Exception('Missing input files:\n%s' % '\n'.join(cleaned_up)) + +# Sets some values in default_variables, which are required for many +# generators, run on Windows. +def CalculateCommonVariables(default_variables, params): + generator_flags = params.get('generator_flags', {}) + + # Set a variable so conditions can be based on msvs_version. + msvs_version = gyp.msvs_emulation.GetVSVersion(generator_flags) + default_variables['MSVS_VERSION'] = msvs_version.ShortName() + + # To determine processor word size on Windows, in addition to checking + # PROCESSOR_ARCHITECTURE (which reflects the word size of the current + # process), it is also necessary to check PROCESSOR_ARCHITEW6432 (which + # contains the actual word size of the system when running thru WOW64). + if ('64' in os.environ.get('PROCESSOR_ARCHITECTURE', '') or + '64' in os.environ.get('PROCESSOR_ARCHITEW6432', '')): + default_variables['MSVS_OS_BITS'] = 64 + else: + default_variables['MSVS_OS_BITS'] = 32 diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.pyc b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.pyc new file mode 100644 index 00000000..1c9e9341 Binary files /dev/null and b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.pyc differ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py new file mode 100644 index 00000000..d2948f06 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py @@ -0,0 +1,160 @@ +# This file comes from +# https://github.com/martine/ninja/blob/master/misc/ninja_syntax.py +# Do not edit! Edit the upstream one instead. + +"""Python module for generating .ninja files. + +Note that this is emphatically not a required piece of Ninja; it's +just a helpful utility for build-file-generation systems that already +use Python. +""" + +import textwrap +import re + +def escape_path(word): + return word.replace('$ ','$$ ').replace(' ','$ ').replace(':', '$:') + +class Writer(object): + def __init__(self, output, width=78): + self.output = output + self.width = width + + def newline(self): + self.output.write('\n') + + def comment(self, text): + for line in textwrap.wrap(text, self.width - 2): + self.output.write('# ' + line + '\n') + + def variable(self, key, value, indent=0): + if value is None: + return + if isinstance(value, list): + value = ' '.join(filter(None, value)) # Filter out empty strings. + self._line('%s = %s' % (key, value), indent) + + def pool(self, name, depth): + self._line('pool %s' % name) + self.variable('depth', depth, indent=1) + + def rule(self, name, command, description=None, depfile=None, + generator=False, pool=None, restat=False, rspfile=None, + rspfile_content=None, deps=None): + self._line('rule %s' % name) + self.variable('command', command, indent=1) + if description: + self.variable('description', description, indent=1) + if depfile: + self.variable('depfile', depfile, indent=1) + if generator: + self.variable('generator', '1', indent=1) + if pool: + self.variable('pool', pool, indent=1) + if restat: + self.variable('restat', '1', indent=1) + if rspfile: + self.variable('rspfile', rspfile, indent=1) + if rspfile_content: + self.variable('rspfile_content', rspfile_content, indent=1) + if deps: + self.variable('deps', deps, indent=1) + + def build(self, outputs, rule, inputs=None, implicit=None, order_only=None, + variables=None): + outputs = self._as_list(outputs) + all_inputs = self._as_list(inputs)[:] + out_outputs = list(map(escape_path, outputs)) + all_inputs = list(map(escape_path, all_inputs)) + + if implicit: + implicit = map(escape_path, self._as_list(implicit)) + all_inputs.append('|') + all_inputs.extend(implicit) + if order_only: + order_only = map(escape_path, self._as_list(order_only)) + all_inputs.append('||') + all_inputs.extend(order_only) + + self._line('build %s: %s' % (' '.join(out_outputs), + ' '.join([rule] + all_inputs))) + + if variables: + if isinstance(variables, dict): + iterator = iter(variables.items()) + else: + iterator = iter(variables) + + for key, val in iterator: + self.variable(key, val, indent=1) + + return outputs + + def include(self, path): + self._line('include %s' % path) + + def subninja(self, path): + self._line('subninja %s' % path) + + def default(self, paths): + self._line('default %s' % ' '.join(self._as_list(paths))) + + def _count_dollars_before_index(self, s, i): + """Returns the number of '$' characters right in front of s[i].""" + dollar_count = 0 + dollar_index = i - 1 + while dollar_index > 0 and s[dollar_index] == '$': + dollar_count += 1 + dollar_index -= 1 + return dollar_count + + def _line(self, text, indent=0): + """Write 'text' word-wrapped at self.width characters.""" + leading_space = ' ' * indent + while len(leading_space) + len(text) > self.width: + # The text is too wide; wrap if possible. + + # Find the rightmost space that would obey our width constraint and + # that's not an escaped space. + available_space = self.width - len(leading_space) - len(' $') + space = available_space + while True: + space = text.rfind(' ', 0, space) + if space < 0 or \ + self._count_dollars_before_index(text, space) % 2 == 0: + break + + if space < 0: + # No such space; just use the first unescaped space we can find. + space = available_space - 1 + while True: + space = text.find(' ', space + 1) + if space < 0 or \ + self._count_dollars_before_index(text, space) % 2 == 0: + break + if space < 0: + # Give up on breaking. + break + + self.output.write(leading_space + text[0:space] + ' $\n') + text = text[space+1:] + + # Subsequent lines are continuations, so indent them. + leading_space = ' ' * (indent+2) + + self.output.write(leading_space + text + '\n') + + def _as_list(self, input): + if input is None: + return [] + if isinstance(input, list): + return input + return [input] + + +def escape(string): + """Escape a string such that it can be embedded into a Ninja file without + further interpretation.""" + assert '\n' not in string, 'Ninja syntax does not allow newlines' + # We only have one special metacharacter: '$'. + return string.replace('$', '$$') diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.pyc b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.pyc new file mode 100644 index 00000000..c63c82e5 Binary files /dev/null and b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.pyc differ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/ordered_dict.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/ordered_dict.py new file mode 100644 index 00000000..a1e89f91 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/ordered_dict.py @@ -0,0 +1,289 @@ +# Unmodified from http://code.activestate.com/recipes/576693/ +# other than to add MIT license header (as specified on page, but not in code). +# Linked from Python documentation here: +# http://docs.python.org/2/library/collections.html#collections.OrderedDict +# +# This should be deleted once Py2.7 is available on all bots, see +# http://crbug.com/241769. +# +# Copyright (c) 2009 Raymond Hettinger. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +# Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy. +# Passes Python2.7's test suite and incorporates all the latest updates. + +try: + from thread import get_ident as _get_ident +except ImportError: + from dummy_thread import get_ident as _get_ident + +try: + from _abcoll import KeysView, ValuesView, ItemsView +except ImportError: + pass + + +class OrderedDict(dict): + 'Dictionary that remembers insertion order' + # An inherited dict maps keys to values. + # The inherited dict provides __getitem__, __len__, __contains__, and get. + # The remaining methods are order-aware. + # Big-O running times for all methods are the same as for regular dictionaries. + + # The internal self.__map dictionary maps keys to links in a doubly linked list. + # The circular doubly linked list starts and ends with a sentinel element. + # The sentinel element never gets deleted (this simplifies the algorithm). + # Each link is stored as a list of length three: [PREV, NEXT, KEY]. + + def __init__(self, *args, **kwds): + '''Initialize an ordered dictionary. Signature is the same as for + regular dictionaries, but keyword arguments are not recommended + because their insertion order is arbitrary. + + ''' + if len(args) > 1: + raise TypeError('expected at most 1 arguments, got %d' % len(args)) + try: + self.__root + except AttributeError: + self.__root = root = [] # sentinel node + root[:] = [root, root, None] + self.__map = {} + self.__update(*args, **kwds) + + def __setitem__(self, key, value, dict_setitem=dict.__setitem__): + 'od.__setitem__(i, y) <==> od[i]=y' + # Setting a new item creates a new link which goes at the end of the linked + # list, and the inherited dictionary is updated with the new key/value pair. + if key not in self: + root = self.__root + last = root[0] + last[1] = root[0] = self.__map[key] = [last, root, key] + dict_setitem(self, key, value) + + def __delitem__(self, key, dict_delitem=dict.__delitem__): + 'od.__delitem__(y) <==> del od[y]' + # Deleting an existing item uses self.__map to find the link which is + # then removed by updating the links in the predecessor and successor nodes. + dict_delitem(self, key) + link_prev, link_next, key = self.__map.pop(key) + link_prev[1] = link_next + link_next[0] = link_prev + + def __iter__(self): + 'od.__iter__() <==> iter(od)' + root = self.__root + curr = root[1] + while curr is not root: + yield curr[2] + curr = curr[1] + + def __reversed__(self): + 'od.__reversed__() <==> reversed(od)' + root = self.__root + curr = root[0] + while curr is not root: + yield curr[2] + curr = curr[0] + + def clear(self): + 'od.clear() -> None. Remove all items from od.' + try: + for node in self.__map.itervalues(): + del node[:] + root = self.__root + root[:] = [root, root, None] + self.__map.clear() + except AttributeError: + pass + dict.clear(self) + + def popitem(self, last=True): + '''od.popitem() -> (k, v), return and remove a (key, value) pair. + Pairs are returned in LIFO order if last is true or FIFO order if false. + + ''' + if not self: + raise KeyError('dictionary is empty') + root = self.__root + if last: + link = root[0] + link_prev = link[0] + link_prev[1] = root + root[0] = link_prev + else: + link = root[1] + link_next = link[1] + root[1] = link_next + link_next[0] = root + key = link[2] + del self.__map[key] + value = dict.pop(self, key) + return key, value + + # -- the following methods do not depend on the internal structure -- + + def keys(self): + 'od.keys() -> list of keys in od' + return list(self) + + def values(self): + 'od.values() -> list of values in od' + return [self[key] for key in self] + + def items(self): + 'od.items() -> list of (key, value) pairs in od' + return [(key, self[key]) for key in self] + + def iterkeys(self): + 'od.iterkeys() -> an iterator over the keys in od' + return iter(self) + + def itervalues(self): + 'od.itervalues -> an iterator over the values in od' + for k in self: + yield self[k] + + def iteritems(self): + 'od.iteritems -> an iterator over the (key, value) items in od' + for k in self: + yield (k, self[k]) + + # Suppress 'OrderedDict.update: Method has no argument': + # pylint: disable=E0211 + def update(*args, **kwds): + '''od.update(E, **F) -> None. Update od from dict/iterable E and F. + + If E is a dict instance, does: for k in E: od[k] = E[k] + If E has a .keys() method, does: for k in E.keys(): od[k] = E[k] + Or if E is an iterable of items, does: for k, v in E: od[k] = v + In either case, this is followed by: for k, v in F.items(): od[k] = v + + ''' + if len(args) > 2: + raise TypeError('update() takes at most 2 positional ' + 'arguments (%d given)' % (len(args),)) + elif not args: + raise TypeError('update() takes at least 1 argument (0 given)') + self = args[0] + # Make progressively weaker assumptions about "other" + other = () + if len(args) == 2: + other = args[1] + if isinstance(other, dict): + for key in other: + self[key] = other[key] + elif hasattr(other, 'keys'): + for key in other.keys(): + self[key] = other[key] + else: + for key, value in other: + self[key] = value + for key, value in kwds.items(): + self[key] = value + + __update = update # let subclasses override update without breaking __init__ + + __marker = object() + + def pop(self, key, default=__marker): + '''od.pop(k[,d]) -> v, remove specified key and return the corresponding value. + If key is not found, d is returned if given, otherwise KeyError is raised. + + ''' + if key in self: + result = self[key] + del self[key] + return result + if default is self.__marker: + raise KeyError(key) + return default + + def setdefault(self, key, default=None): + 'od.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in od' + if key in self: + return self[key] + self[key] = default + return default + + def __repr__(self, _repr_running={}): + 'od.__repr__() <==> repr(od)' + call_key = id(self), _get_ident() + if call_key in _repr_running: + return '...' + _repr_running[call_key] = 1 + try: + if not self: + return '%s()' % (self.__class__.__name__,) + return '%s(%r)' % (self.__class__.__name__, self.items()) + finally: + del _repr_running[call_key] + + def __reduce__(self): + 'Return state information for pickling' + items = [[k, self[k]] for k in self] + inst_dict = vars(self).copy() + for k in vars(OrderedDict()): + inst_dict.pop(k, None) + if inst_dict: + return (self.__class__, (items,), inst_dict) + return self.__class__, (items,) + + def copy(self): + 'od.copy() -> a shallow copy of od' + return self.__class__(self) + + @classmethod + def fromkeys(cls, iterable, value=None): + '''OD.fromkeys(S[, v]) -> New ordered dictionary with keys from S + and values equal to v (which defaults to None). + + ''' + d = cls() + for key in iterable: + d[key] = value + return d + + def __eq__(self, other): + '''od.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive + while comparison to a regular mapping is order-insensitive. + + ''' + if isinstance(other, OrderedDict): + return len(self)==len(other) and self.items() == other.items() + return dict.__eq__(self, other) + + def __ne__(self, other): + return not self == other + + # -- the following methods are only used in Python 2.7 -- + + def viewkeys(self): + "od.viewkeys() -> a set-like object providing a view on od's keys" + return KeysView(self) + + def viewvalues(self): + "od.viewvalues() -> an object providing a view on od's values" + return ValuesView(self) + + def viewitems(self): + "od.viewitems() -> a set-like object providing a view on od's items" + return ItemsView(self) + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py new file mode 100644 index 00000000..74c98c5a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py @@ -0,0 +1,46 @@ +# Copyright 2014 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""A clone of the default copy.deepcopy that doesn't handle cyclic +structures or complex types except for dicts and lists. This is +because gyp copies so large structure that small copy overhead ends up +taking seconds in a project the size of Chromium.""" + +class Error(Exception): + pass + +__all__ = ["Error", "deepcopy"] + +def deepcopy(x): + """Deep copy operation on gyp objects such as strings, ints, dicts + and lists. More than twice as fast as copy.deepcopy but much less + generic.""" + + try: + return _deepcopy_dispatch[type(x)](x) + except KeyError: + raise Error('Unsupported type %s for deepcopy. Use copy.deepcopy ' + + 'or expand simple_copy support.' % type(x)) + +_deepcopy_dispatch = d = {} + +def _deepcopy_atomic(x): + return x + +for x in (type(None), int, long, float, + bool, str, unicode, type): + d[x] = _deepcopy_atomic + +def _deepcopy_list(x): + return [deepcopy(a) for a in x] +d[list] = _deepcopy_list + +def _deepcopy_dict(x): + y = {} + for key, value in x.iteritems(): + y[deepcopy(key)] = deepcopy(value) + return y +d[dict] = _deepcopy_dict + +del d diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.pyc b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.pyc new file mode 100644 index 00000000..45b53468 Binary files /dev/null and b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.pyc differ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py new file mode 100644 index 00000000..bb6f1ea4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py @@ -0,0 +1,314 @@ +#!/usr/bin/env python + +# Copyright (c) 2012 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Utility functions for Windows builds. + +These functions are executed via gyp-win-tool when using the ninja generator. +""" + +import os +import re +import shutil +import subprocess +import stat +import string +import sys + +BASE_DIR = os.path.dirname(os.path.abspath(__file__)) + +# A regex matching an argument corresponding to the output filename passed to +# link.exe. +_LINK_EXE_OUT_ARG = re.compile('/OUT:(?P.+)$', re.IGNORECASE) + +def main(args): + executor = WinTool() + exit_code = executor.Dispatch(args) + if exit_code is not None: + sys.exit(exit_code) + + +class WinTool(object): + """This class performs all the Windows tooling steps. The methods can either + be executed directly, or dispatched from an argument list.""" + + def _UseSeparateMspdbsrv(self, env, args): + """Allows to use a unique instance of mspdbsrv.exe per linker instead of a + shared one.""" + if len(args) < 1: + raise Exception("Not enough arguments") + + if args[0] != 'link.exe': + return + + # Use the output filename passed to the linker to generate an endpoint name + # for mspdbsrv.exe. + endpoint_name = None + for arg in args: + m = _LINK_EXE_OUT_ARG.match(arg) + if m: + endpoint_name = re.sub(r'\W+', '', + '%s_%d' % (m.group('out'), os.getpid())) + break + + if endpoint_name is None: + return + + # Adds the appropriate environment variable. This will be read by link.exe + # to know which instance of mspdbsrv.exe it should connect to (if it's + # not set then the default endpoint is used). + env['_MSPDBSRV_ENDPOINT_'] = endpoint_name + + def Dispatch(self, args): + """Dispatches a string command to a method.""" + if len(args) < 1: + raise Exception("Not enough arguments") + + method = "Exec%s" % self._CommandifyName(args[0]) + return getattr(self, method)(*args[1:]) + + def _CommandifyName(self, name_string): + """Transforms a tool name like recursive-mirror to RecursiveMirror.""" + return name_string.title().replace('-', '') + + def _GetEnv(self, arch): + """Gets the saved environment from a file for a given architecture.""" + # The environment is saved as an "environment block" (see CreateProcess + # and msvs_emulation for details). We convert to a dict here. + # Drop last 2 NULs, one for list terminator, one for trailing vs. separator. + pairs = open(arch).read()[:-2].split('\0') + kvs = [item.split('=', 1) for item in pairs] + return dict(kvs) + + def ExecStamp(self, path): + """Simple stamp command.""" + open(path, 'w').close() + + def ExecRecursiveMirror(self, source, dest): + """Emulation of rm -rf out && cp -af in out.""" + if os.path.exists(dest): + if os.path.isdir(dest): + def _on_error(fn, path, excinfo): + # The operation failed, possibly because the file is set to + # read-only. If that's why, make it writable and try the op again. + if not os.access(path, os.W_OK): + os.chmod(path, stat.S_IWRITE) + fn(path) + shutil.rmtree(dest, onerror=_on_error) + else: + if not os.access(dest, os.W_OK): + # Attempt to make the file writable before deleting it. + os.chmod(dest, stat.S_IWRITE) + os.unlink(dest) + + if os.path.isdir(source): + shutil.copytree(source, dest) + else: + shutil.copy2(source, dest) + + def ExecLinkWrapper(self, arch, use_separate_mspdbsrv, *args): + """Filter diagnostic output from link that looks like: + ' Creating library ui.dll.lib and object ui.dll.exp' + This happens when there are exports from the dll or exe. + """ + env = self._GetEnv(arch) + if use_separate_mspdbsrv == 'True': + self._UseSeparateMspdbsrv(env, args) + link = subprocess.Popen([args[0].replace('/', '\\')] + list(args[1:]), + shell=True, + env=env, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT) + out, _ = link.communicate() + for line in out.splitlines(): + if (not line.startswith(' Creating library ') and + not line.startswith('Generating code') and + not line.startswith('Finished generating code')): + print line + return link.returncode + + def ExecLinkWithManifests(self, arch, embed_manifest, out, ldcmd, resname, + mt, rc, intermediate_manifest, *manifests): + """A wrapper for handling creating a manifest resource and then executing + a link command.""" + # The 'normal' way to do manifests is to have link generate a manifest + # based on gathering dependencies from the object files, then merge that + # manifest with other manifests supplied as sources, convert the merged + # manifest to a resource, and then *relink*, including the compiled + # version of the manifest resource. This breaks incremental linking, and + # is generally overly complicated. Instead, we merge all the manifests + # provided (along with one that includes what would normally be in the + # linker-generated one, see msvs_emulation.py), and include that into the + # first and only link. We still tell link to generate a manifest, but we + # only use that to assert that our simpler process did not miss anything. + variables = { + 'python': sys.executable, + 'arch': arch, + 'out': out, + 'ldcmd': ldcmd, + 'resname': resname, + 'mt': mt, + 'rc': rc, + 'intermediate_manifest': intermediate_manifest, + 'manifests': ' '.join(manifests), + } + add_to_ld = '' + if manifests: + subprocess.check_call( + '%(python)s gyp-win-tool manifest-wrapper %(arch)s %(mt)s -nologo ' + '-manifest %(manifests)s -out:%(out)s.manifest' % variables) + if embed_manifest == 'True': + subprocess.check_call( + '%(python)s gyp-win-tool manifest-to-rc %(arch)s %(out)s.manifest' + ' %(out)s.manifest.rc %(resname)s' % variables) + subprocess.check_call( + '%(python)s gyp-win-tool rc-wrapper %(arch)s %(rc)s ' + '%(out)s.manifest.rc' % variables) + add_to_ld = ' %(out)s.manifest.res' % variables + subprocess.check_call(ldcmd + add_to_ld) + + # Run mt.exe on the theoretically complete manifest we generated, merging + # it with the one the linker generated to confirm that the linker + # generated one does not add anything. This is strictly unnecessary for + # correctness, it's only to verify that e.g. /MANIFESTDEPENDENCY was not + # used in a #pragma comment. + if manifests: + # Merge the intermediate one with ours to .assert.manifest, then check + # that .assert.manifest is identical to ours. + subprocess.check_call( + '%(python)s gyp-win-tool manifest-wrapper %(arch)s %(mt)s -nologo ' + '-manifest %(out)s.manifest %(intermediate_manifest)s ' + '-out:%(out)s.assert.manifest' % variables) + assert_manifest = '%(out)s.assert.manifest' % variables + our_manifest = '%(out)s.manifest' % variables + # Load and normalize the manifests. mt.exe sometimes removes whitespace, + # and sometimes doesn't unfortunately. + with open(our_manifest, 'rb') as our_f: + with open(assert_manifest, 'rb') as assert_f: + our_data = our_f.read().translate(None, string.whitespace) + assert_data = assert_f.read().translate(None, string.whitespace) + if our_data != assert_data: + os.unlink(out) + def dump(filename): + sys.stderr.write('%s\n-----\n' % filename) + with open(filename, 'rb') as f: + sys.stderr.write(f.read() + '\n-----\n') + dump(intermediate_manifest) + dump(our_manifest) + dump(assert_manifest) + sys.stderr.write( + 'Linker generated manifest "%s" added to final manifest "%s" ' + '(result in "%s"). ' + 'Were /MANIFEST switches used in #pragma statements? ' % ( + intermediate_manifest, our_manifest, assert_manifest)) + return 1 + + def ExecManifestWrapper(self, arch, *args): + """Run manifest tool with environment set. Strip out undesirable warning + (some XML blocks are recognized by the OS loader, but not the manifest + tool).""" + env = self._GetEnv(arch) + popen = subprocess.Popen(args, shell=True, env=env, + stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + out, _ = popen.communicate() + for line in out.splitlines(): + if line and 'manifest authoring warning 81010002' not in line: + print line + return popen.returncode + + def ExecManifestToRc(self, arch, *args): + """Creates a resource file pointing a SxS assembly manifest. + |args| is tuple containing path to resource file, path to manifest file + and resource name which can be "1" (for executables) or "2" (for DLLs).""" + manifest_path, resource_path, resource_name = args + with open(resource_path, 'wb') as output: + output.write('#include \n%s RT_MANIFEST "%s"' % ( + resource_name, + os.path.abspath(manifest_path).replace('\\', '/'))) + + def ExecMidlWrapper(self, arch, outdir, tlb, h, dlldata, iid, proxy, idl, + *flags): + """Filter noisy filenames output from MIDL compile step that isn't + quietable via command line flags. + """ + args = ['midl', '/nologo'] + list(flags) + [ + '/out', outdir, + '/tlb', tlb, + '/h', h, + '/dlldata', dlldata, + '/iid', iid, + '/proxy', proxy, + idl] + env = self._GetEnv(arch) + popen = subprocess.Popen(args, shell=True, env=env, + stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + out, _ = popen.communicate() + # Filter junk out of stdout, and write filtered versions. Output we want + # to filter is pairs of lines that look like this: + # Processing C:\Program Files (x86)\Microsoft SDKs\...\include\objidl.idl + # objidl.idl + lines = out.splitlines() + prefixes = ('Processing ', '64 bit Processing ') + processing = set(os.path.basename(x) + for x in lines if x.startswith(prefixes)) + for line in lines: + if not line.startswith(prefixes) and line not in processing: + print line + return popen.returncode + + def ExecAsmWrapper(self, arch, *args): + """Filter logo banner from invocations of asm.exe.""" + env = self._GetEnv(arch) + popen = subprocess.Popen(args, shell=True, env=env, + stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + out, _ = popen.communicate() + for line in out.splitlines(): + if (not line.startswith('Copyright (C) Microsoft Corporation') and + not line.startswith('Microsoft (R) Macro Assembler') and + not line.startswith(' Assembling: ') and + line): + print line + return popen.returncode + + def ExecRcWrapper(self, arch, *args): + """Filter logo banner from invocations of rc.exe. Older versions of RC + don't support the /nologo flag.""" + env = self._GetEnv(arch) + popen = subprocess.Popen(args, shell=True, env=env, + stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + out, _ = popen.communicate() + for line in out.splitlines(): + if (not line.startswith('Microsoft (R) Windows (R) Resource Compiler') and + not line.startswith('Copyright (C) Microsoft Corporation') and + line): + print line + return popen.returncode + + def ExecActionWrapper(self, arch, rspfile, *dir): + """Runs an action command line from a response file using the environment + for |arch|. If |dir| is supplied, use that as the working directory.""" + env = self._GetEnv(arch) + # TODO(scottmg): This is a temporary hack to get some specific variables + # through to actions that are set after gyp-time. http://crbug.com/333738. + for k, v in os.environ.iteritems(): + if k not in env: + env[k] = v + args = open(rspfile).read() + dir = dir[0] if dir else None + return subprocess.call(args, shell=True, env=env, cwd=dir) + + def ExecClCompile(self, project_dir, selected_files): + """Executed by msvs-ninja projects when the 'ClCompile' target is used to + build selected C/C++ files.""" + project_dir = os.path.relpath(project_dir, BASE_DIR) + selected_files = selected_files.split(';') + ninja_targets = [os.path.join(project_dir, filename) + '^^' + for filename in selected_files] + cmd = ['ninja.exe'] + cmd.extend(ninja_targets) + return subprocess.call(cmd, shell=True, cwd=BASE_DIR) + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py new file mode 100644 index 00000000..b06bdc4e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py @@ -0,0 +1,1629 @@ +# Copyright (c) 2012 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +""" +This module contains classes that help to emulate xcodebuild behavior on top of +other build systems, such as make and ninja. +""" + +import copy +import gyp.common +import os +import os.path +import re +import shlex +import subprocess +import sys +import tempfile +from gyp.common import GypError + +# Populated lazily by XcodeVersion, for efficiency, and to fix an issue when +# "xcodebuild" is called too quickly (it has been found to return incorrect +# version number). +XCODE_VERSION_CACHE = None + +# Populated lazily by GetXcodeArchsDefault, to an |XcodeArchsDefault| instance +# corresponding to the installed version of Xcode. +XCODE_ARCHS_DEFAULT_CACHE = None + + +def XcodeArchsVariableMapping(archs, archs_including_64_bit=None): + """Constructs a dictionary with expansion for $(ARCHS_STANDARD) variable, + and optionally for $(ARCHS_STANDARD_INCLUDING_64_BIT).""" + mapping = {'$(ARCHS_STANDARD)': archs} + if archs_including_64_bit: + mapping['$(ARCHS_STANDARD_INCLUDING_64_BIT)'] = archs_including_64_bit + return mapping + +class XcodeArchsDefault(object): + """A class to resolve ARCHS variable from xcode_settings, resolving Xcode + macros and implementing filtering by VALID_ARCHS. The expansion of macros + depends on the SDKROOT used ("macosx", "iphoneos", "iphonesimulator") and + on the version of Xcode. + """ + + # Match variable like $(ARCHS_STANDARD). + variable_pattern = re.compile(r'\$\([a-zA-Z_][a-zA-Z0-9_]*\)$') + + def __init__(self, default, mac, iphonesimulator, iphoneos): + self._default = (default,) + self._archs = {'mac': mac, 'ios': iphoneos, 'iossim': iphonesimulator} + + def _VariableMapping(self, sdkroot): + """Returns the dictionary of variable mapping depending on the SDKROOT.""" + sdkroot = sdkroot.lower() + if 'iphoneos' in sdkroot: + return self._archs['ios'] + elif 'iphonesimulator' in sdkroot: + return self._archs['iossim'] + else: + return self._archs['mac'] + + def _ExpandArchs(self, archs, sdkroot): + """Expands variables references in ARCHS, and remove duplicates.""" + variable_mapping = self._VariableMapping(sdkroot) + expanded_archs = [] + for arch in archs: + if self.variable_pattern.match(arch): + variable = arch + try: + variable_expansion = variable_mapping[variable] + for arch in variable_expansion: + if arch not in expanded_archs: + expanded_archs.append(arch) + except KeyError as e: + print 'Warning: Ignoring unsupported variable "%s".' % variable + elif arch not in expanded_archs: + expanded_archs.append(arch) + return expanded_archs + + def ActiveArchs(self, archs, valid_archs, sdkroot): + """Expands variables references in ARCHS, and filter by VALID_ARCHS if it + is defined (if not set, Xcode accept any value in ARCHS, otherwise, only + values present in VALID_ARCHS are kept).""" + expanded_archs = self._ExpandArchs(archs or self._default, sdkroot or '') + if valid_archs: + filtered_archs = [] + for arch in expanded_archs: + if arch in valid_archs: + filtered_archs.append(arch) + expanded_archs = filtered_archs + return expanded_archs + + +def GetXcodeArchsDefault(): + """Returns the |XcodeArchsDefault| object to use to expand ARCHS for the + installed version of Xcode. The default values used by Xcode for ARCHS + and the expansion of the variables depends on the version of Xcode used. + + For all version anterior to Xcode 5.0 or posterior to Xcode 5.1 included + uses $(ARCHS_STANDARD) if ARCHS is unset, while Xcode 5.0 to 5.0.2 uses + $(ARCHS_STANDARD_INCLUDING_64_BIT). This variable was added to Xcode 5.0 + and deprecated with Xcode 5.1. + + For "macosx" SDKROOT, all version starting with Xcode 5.0 includes 64-bit + architecture as part of $(ARCHS_STANDARD) and default to only building it. + + For "iphoneos" and "iphonesimulator" SDKROOT, 64-bit architectures are part + of $(ARCHS_STANDARD_INCLUDING_64_BIT) from Xcode 5.0. From Xcode 5.1, they + are also part of $(ARCHS_STANDARD). + + All thoses rules are coded in the construction of the |XcodeArchsDefault| + object to use depending on the version of Xcode detected. The object is + for performance reason.""" + global XCODE_ARCHS_DEFAULT_CACHE + if XCODE_ARCHS_DEFAULT_CACHE: + return XCODE_ARCHS_DEFAULT_CACHE + xcode_version, _ = XcodeVersion() + if xcode_version < '0500': + XCODE_ARCHS_DEFAULT_CACHE = XcodeArchsDefault( + '$(ARCHS_STANDARD)', + XcodeArchsVariableMapping(['i386']), + XcodeArchsVariableMapping(['i386']), + XcodeArchsVariableMapping(['armv7'])) + elif xcode_version < '0510': + XCODE_ARCHS_DEFAULT_CACHE = XcodeArchsDefault( + '$(ARCHS_STANDARD_INCLUDING_64_BIT)', + XcodeArchsVariableMapping(['x86_64'], ['x86_64']), + XcodeArchsVariableMapping(['i386'], ['i386', 'x86_64']), + XcodeArchsVariableMapping( + ['armv7', 'armv7s'], + ['armv7', 'armv7s', 'arm64'])) + else: + XCODE_ARCHS_DEFAULT_CACHE = XcodeArchsDefault( + '$(ARCHS_STANDARD)', + XcodeArchsVariableMapping(['x86_64'], ['x86_64']), + XcodeArchsVariableMapping(['i386', 'x86_64'], ['i386', 'x86_64']), + XcodeArchsVariableMapping( + ['armv7', 'armv7s', 'arm64'], + ['armv7', 'armv7s', 'arm64'])) + return XCODE_ARCHS_DEFAULT_CACHE + + +class XcodeSettings(object): + """A class that understands the gyp 'xcode_settings' object.""" + + # Populated lazily by _SdkPath(). Shared by all XcodeSettings, so cached + # at class-level for efficiency. + _sdk_path_cache = {} + _sdk_root_cache = {} + + # Populated lazily by GetExtraPlistItems(). Shared by all XcodeSettings, so + # cached at class-level for efficiency. + _plist_cache = {} + + # Populated lazily by GetIOSPostbuilds. Shared by all XcodeSettings, so + # cached at class-level for efficiency. + _codesigning_key_cache = {} + + def __init__(self, spec): + self.spec = spec + + self.isIOS = False + + # Per-target 'xcode_settings' are pushed down into configs earlier by gyp. + # This means self.xcode_settings[config] always contains all settings + # for that config -- the per-target settings as well. Settings that are + # the same for all configs are implicitly per-target settings. + self.xcode_settings = {} + configs = spec['configurations'] + for configname, config in configs.iteritems(): + self.xcode_settings[configname] = config.get('xcode_settings', {}) + self._ConvertConditionalKeys(configname) + if self.xcode_settings[configname].get('IPHONEOS_DEPLOYMENT_TARGET', + None): + self.isIOS = True + + # This is only non-None temporarily during the execution of some methods. + self.configname = None + + # Used by _AdjustLibrary to match .a and .dylib entries in libraries. + self.library_re = re.compile(r'^lib([^/]+)\.(a|dylib)$') + + def _ConvertConditionalKeys(self, configname): + """Converts or warns on conditional keys. Xcode supports conditional keys, + such as CODE_SIGN_IDENTITY[sdk=iphoneos*]. This is a partial implementation + with some keys converted while the rest force a warning.""" + settings = self.xcode_settings[configname] + conditional_keys = [key for key in settings if key.endswith(']')] + for key in conditional_keys: + # If you need more, speak up at http://crbug.com/122592 + if key.endswith("[sdk=iphoneos*]"): + if configname.endswith("iphoneos"): + new_key = key.split("[")[0] + settings[new_key] = settings[key] + else: + print 'Warning: Conditional keys not implemented, ignoring:', \ + ' '.join(conditional_keys) + del settings[key] + + def _Settings(self): + assert self.configname + return self.xcode_settings[self.configname] + + def _Test(self, test_key, cond_key, default): + return self._Settings().get(test_key, default) == cond_key + + def _Appendf(self, lst, test_key, format_str, default=None): + if test_key in self._Settings(): + lst.append(format_str % str(self._Settings()[test_key])) + elif default: + lst.append(format_str % str(default)) + + def _WarnUnimplemented(self, test_key): + if test_key in self._Settings(): + print 'Warning: Ignoring not yet implemented key "%s".' % test_key + + def IsBinaryOutputFormat(self, configname): + default = "binary" if self.isIOS else "xml" + format = self.xcode_settings[configname].get('INFOPLIST_OUTPUT_FORMAT', + default) + return format == "binary" + + def _IsBundle(self): + return int(self.spec.get('mac_bundle', 0)) != 0 + + def _IsIosAppExtension(self): + return int(self.spec.get('ios_app_extension', 0)) != 0 + + def _IsIosWatchKitExtension(self): + return int(self.spec.get('ios_watchkit_extension', 0)) != 0 + + def _IsIosWatchApp(self): + return int(self.spec.get('ios_watch_app', 0)) != 0 + + def GetFrameworkVersion(self): + """Returns the framework version of the current target. Only valid for + bundles.""" + assert self._IsBundle() + return self.GetPerTargetSetting('FRAMEWORK_VERSION', default='A') + + def GetWrapperExtension(self): + """Returns the bundle extension (.app, .framework, .plugin, etc). Only + valid for bundles.""" + assert self._IsBundle() + if self.spec['type'] in ('loadable_module', 'shared_library'): + default_wrapper_extension = { + 'loadable_module': 'bundle', + 'shared_library': 'framework', + }[self.spec['type']] + wrapper_extension = self.GetPerTargetSetting( + 'WRAPPER_EXTENSION', default=default_wrapper_extension) + return '.' + self.spec.get('product_extension', wrapper_extension) + elif self.spec['type'] == 'executable': + if self._IsIosAppExtension() or self._IsIosWatchKitExtension(): + return '.' + self.spec.get('product_extension', 'appex') + else: + return '.' + self.spec.get('product_extension', 'app') + else: + assert False, "Don't know extension for '%s', target '%s'" % ( + self.spec['type'], self.spec['target_name']) + + def GetProductName(self): + """Returns PRODUCT_NAME.""" + return self.spec.get('product_name', self.spec['target_name']) + + def GetFullProductName(self): + """Returns FULL_PRODUCT_NAME.""" + if self._IsBundle(): + return self.GetWrapperName() + else: + return self._GetStandaloneBinaryPath() + + def GetWrapperName(self): + """Returns the directory name of the bundle represented by this target. + Only valid for bundles.""" + assert self._IsBundle() + return self.GetProductName() + self.GetWrapperExtension() + + def GetBundleContentsFolderPath(self): + """Returns the qualified path to the bundle's contents folder. E.g. + Chromium.app/Contents or Foo.bundle/Versions/A. Only valid for bundles.""" + if self.isIOS: + return self.GetWrapperName() + assert self._IsBundle() + if self.spec['type'] == 'shared_library': + return os.path.join( + self.GetWrapperName(), 'Versions', self.GetFrameworkVersion()) + else: + # loadable_modules have a 'Contents' folder like executables. + return os.path.join(self.GetWrapperName(), 'Contents') + + def GetBundleResourceFolder(self): + """Returns the qualified path to the bundle's resource folder. E.g. + Chromium.app/Contents/Resources. Only valid for bundles.""" + assert self._IsBundle() + if self.isIOS: + return self.GetBundleContentsFolderPath() + return os.path.join(self.GetBundleContentsFolderPath(), 'Resources') + + def GetBundlePlistPath(self): + """Returns the qualified path to the bundle's plist file. E.g. + Chromium.app/Contents/Info.plist. Only valid for bundles.""" + assert self._IsBundle() + if self.spec['type'] in ('executable', 'loadable_module'): + return os.path.join(self.GetBundleContentsFolderPath(), 'Info.plist') + else: + return os.path.join(self.GetBundleContentsFolderPath(), + 'Resources', 'Info.plist') + + def GetProductType(self): + """Returns the PRODUCT_TYPE of this target.""" + if self._IsIosAppExtension(): + assert self._IsBundle(), ('ios_app_extension flag requires mac_bundle ' + '(target %s)' % self.spec['target_name']) + return 'com.apple.product-type.app-extension' + if self._IsIosWatchKitExtension(): + assert self._IsBundle(), ('ios_watchkit_extension flag requires ' + 'mac_bundle (target %s)' % self.spec['target_name']) + return 'com.apple.product-type.watchkit-extension' + if self._IsIosWatchApp(): + assert self._IsBundle(), ('ios_watch_app flag requires mac_bundle ' + '(target %s)' % self.spec['target_name']) + return 'com.apple.product-type.application.watchapp' + if self._IsBundle(): + return { + 'executable': 'com.apple.product-type.application', + 'loadable_module': 'com.apple.product-type.bundle', + 'shared_library': 'com.apple.product-type.framework', + }[self.spec['type']] + else: + return { + 'executable': 'com.apple.product-type.tool', + 'loadable_module': 'com.apple.product-type.library.dynamic', + 'shared_library': 'com.apple.product-type.library.dynamic', + 'static_library': 'com.apple.product-type.library.static', + }[self.spec['type']] + + def GetMachOType(self): + """Returns the MACH_O_TYPE of this target.""" + # Weird, but matches Xcode. + if not self._IsBundle() and self.spec['type'] == 'executable': + return '' + return { + 'executable': 'mh_execute', + 'static_library': 'staticlib', + 'shared_library': 'mh_dylib', + 'loadable_module': 'mh_bundle', + }[self.spec['type']] + + def _GetBundleBinaryPath(self): + """Returns the name of the bundle binary of by this target. + E.g. Chromium.app/Contents/MacOS/Chromium. Only valid for bundles.""" + assert self._IsBundle() + if self.spec['type'] in ('shared_library') or self.isIOS: + path = self.GetBundleContentsFolderPath() + elif self.spec['type'] in ('executable', 'loadable_module'): + path = os.path.join(self.GetBundleContentsFolderPath(), 'MacOS') + return os.path.join(path, self.GetExecutableName()) + + def _GetStandaloneExecutableSuffix(self): + if 'product_extension' in self.spec: + return '.' + self.spec['product_extension'] + return { + 'executable': '', + 'static_library': '.a', + 'shared_library': '.dylib', + 'loadable_module': '.so', + }[self.spec['type']] + + def _GetStandaloneExecutablePrefix(self): + return self.spec.get('product_prefix', { + 'executable': '', + 'static_library': 'lib', + 'shared_library': 'lib', + # Non-bundled loadable_modules are called foo.so for some reason + # (that is, .so and no prefix) with the xcode build -- match that. + 'loadable_module': '', + }[self.spec['type']]) + + def _GetStandaloneBinaryPath(self): + """Returns the name of the non-bundle binary represented by this target. + E.g. hello_world. Only valid for non-bundles.""" + assert not self._IsBundle() + assert self.spec['type'] in ( + 'executable', 'shared_library', 'static_library', 'loadable_module'), ( + 'Unexpected type %s' % self.spec['type']) + target = self.spec['target_name'] + if self.spec['type'] == 'static_library': + if target[:3] == 'lib': + target = target[3:] + elif self.spec['type'] in ('loadable_module', 'shared_library'): + if target[:3] == 'lib': + target = target[3:] + + target_prefix = self._GetStandaloneExecutablePrefix() + target = self.spec.get('product_name', target) + target_ext = self._GetStandaloneExecutableSuffix() + return target_prefix + target + target_ext + + def GetExecutableName(self): + """Returns the executable name of the bundle represented by this target. + E.g. Chromium.""" + if self._IsBundle(): + return self.spec.get('product_name', self.spec['target_name']) + else: + return self._GetStandaloneBinaryPath() + + def GetExecutablePath(self): + """Returns the directory name of the bundle represented by this target. E.g. + Chromium.app/Contents/MacOS/Chromium.""" + if self._IsBundle(): + return self._GetBundleBinaryPath() + else: + return self._GetStandaloneBinaryPath() + + def GetActiveArchs(self, configname): + """Returns the architectures this target should be built for.""" + config_settings = self.xcode_settings[configname] + xcode_archs_default = GetXcodeArchsDefault() + return xcode_archs_default.ActiveArchs( + config_settings.get('ARCHS'), + config_settings.get('VALID_ARCHS'), + config_settings.get('SDKROOT')) + + def _GetSdkVersionInfoItem(self, sdk, infoitem): + # xcodebuild requires Xcode and can't run on Command Line Tools-only + # systems from 10.7 onward. + # Since the CLT has no SDK paths anyway, returning None is the + # most sensible route and should still do the right thing. + try: + return GetStdout(['xcodebuild', '-version', '-sdk', sdk, infoitem]) + except: + pass + + def _SdkRoot(self, configname): + if configname is None: + configname = self.configname + return self.GetPerConfigSetting('SDKROOT', configname, default='') + + def _SdkPath(self, configname=None): + sdk_root = self._SdkRoot(configname) + if sdk_root.startswith('/'): + return sdk_root + return self._XcodeSdkPath(sdk_root) + + def _XcodeSdkPath(self, sdk_root): + if sdk_root not in XcodeSettings._sdk_path_cache: + sdk_path = self._GetSdkVersionInfoItem(sdk_root, 'Path') + XcodeSettings._sdk_path_cache[sdk_root] = sdk_path + if sdk_root: + XcodeSettings._sdk_root_cache[sdk_path] = sdk_root + return XcodeSettings._sdk_path_cache[sdk_root] + + def _AppendPlatformVersionMinFlags(self, lst): + self._Appendf(lst, 'MACOSX_DEPLOYMENT_TARGET', '-mmacosx-version-min=%s') + if 'IPHONEOS_DEPLOYMENT_TARGET' in self._Settings(): + # TODO: Implement this better? + sdk_path_basename = os.path.basename(self._SdkPath()) + if sdk_path_basename.lower().startswith('iphonesimulator'): + self._Appendf(lst, 'IPHONEOS_DEPLOYMENT_TARGET', + '-mios-simulator-version-min=%s') + else: + self._Appendf(lst, 'IPHONEOS_DEPLOYMENT_TARGET', + '-miphoneos-version-min=%s') + + def GetCflags(self, configname, arch=None): + """Returns flags that need to be added to .c, .cc, .m, and .mm + compilations.""" + # This functions (and the similar ones below) do not offer complete + # emulation of all xcode_settings keys. They're implemented on demand. + + self.configname = configname + cflags = [] + + sdk_root = self._SdkPath() + if 'SDKROOT' in self._Settings() and sdk_root: + cflags.append('-isysroot %s' % sdk_root) + + if self._Test('CLANG_WARN_CONSTANT_CONVERSION', 'YES', default='NO'): + cflags.append('-Wconstant-conversion') + + if self._Test('GCC_CHAR_IS_UNSIGNED_CHAR', 'YES', default='NO'): + cflags.append('-funsigned-char') + + if self._Test('GCC_CW_ASM_SYNTAX', 'YES', default='YES'): + cflags.append('-fasm-blocks') + + if 'GCC_DYNAMIC_NO_PIC' in self._Settings(): + if self._Settings()['GCC_DYNAMIC_NO_PIC'] == 'YES': + cflags.append('-mdynamic-no-pic') + else: + pass + # TODO: In this case, it depends on the target. xcode passes + # mdynamic-no-pic by default for executable and possibly static lib + # according to mento + + if self._Test('GCC_ENABLE_PASCAL_STRINGS', 'YES', default='YES'): + cflags.append('-mpascal-strings') + + self._Appendf(cflags, 'GCC_OPTIMIZATION_LEVEL', '-O%s', default='s') + + if self._Test('GCC_GENERATE_DEBUGGING_SYMBOLS', 'YES', default='YES'): + dbg_format = self._Settings().get('DEBUG_INFORMATION_FORMAT', 'dwarf') + if dbg_format == 'dwarf': + cflags.append('-gdwarf-2') + elif dbg_format == 'stabs': + raise NotImplementedError('stabs debug format is not supported yet.') + elif dbg_format == 'dwarf-with-dsym': + cflags.append('-gdwarf-2') + else: + raise NotImplementedError('Unknown debug format %s' % dbg_format) + + if self._Settings().get('GCC_STRICT_ALIASING') == 'YES': + cflags.append('-fstrict-aliasing') + elif self._Settings().get('GCC_STRICT_ALIASING') == 'NO': + cflags.append('-fno-strict-aliasing') + + if self._Test('GCC_SYMBOLS_PRIVATE_EXTERN', 'YES', default='NO'): + cflags.append('-fvisibility=hidden') + + if self._Test('GCC_TREAT_WARNINGS_AS_ERRORS', 'YES', default='NO'): + cflags.append('-Werror') + + if self._Test('GCC_WARN_ABOUT_MISSING_NEWLINE', 'YES', default='NO'): + cflags.append('-Wnewline-eof') + + # In Xcode, this is only activated when GCC_COMPILER_VERSION is clang or + # llvm-gcc. It also requires a fairly recent libtool, and + # if the system clang isn't used, DYLD_LIBRARY_PATH needs to contain the + # path to the libLTO.dylib that matches the used clang. + if self._Test('LLVM_LTO', 'YES', default='NO'): + cflags.append('-flto') + + self._AppendPlatformVersionMinFlags(cflags) + + # TODO: + if self._Test('COPY_PHASE_STRIP', 'YES', default='NO'): + self._WarnUnimplemented('COPY_PHASE_STRIP') + self._WarnUnimplemented('GCC_DEBUGGING_SYMBOLS') + self._WarnUnimplemented('GCC_ENABLE_OBJC_EXCEPTIONS') + + # TODO: This is exported correctly, but assigning to it is not supported. + self._WarnUnimplemented('MACH_O_TYPE') + self._WarnUnimplemented('PRODUCT_TYPE') + + if arch is not None: + archs = [arch] + else: + assert self.configname + archs = self.GetActiveArchs(self.configname) + if len(archs) != 1: + # TODO: Supporting fat binaries will be annoying. + self._WarnUnimplemented('ARCHS') + archs = ['i386'] + cflags.append('-arch ' + archs[0]) + + if archs[0] in ('i386', 'x86_64'): + if self._Test('GCC_ENABLE_SSE3_EXTENSIONS', 'YES', default='NO'): + cflags.append('-msse3') + if self._Test('GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS', 'YES', + default='NO'): + cflags.append('-mssse3') # Note 3rd 's'. + if self._Test('GCC_ENABLE_SSE41_EXTENSIONS', 'YES', default='NO'): + cflags.append('-msse4.1') + if self._Test('GCC_ENABLE_SSE42_EXTENSIONS', 'YES', default='NO'): + cflags.append('-msse4.2') + + cflags += self._Settings().get('WARNING_CFLAGS', []) + + if sdk_root: + framework_root = sdk_root + else: + framework_root = '' + config = self.spec['configurations'][self.configname] + framework_dirs = config.get('mac_framework_dirs', []) + for directory in framework_dirs: + cflags.append('-F' + directory.replace('$(SDKROOT)', framework_root)) + + self.configname = None + return cflags + + def GetCflagsC(self, configname): + """Returns flags that need to be added to .c, and .m compilations.""" + self.configname = configname + cflags_c = [] + if self._Settings().get('GCC_C_LANGUAGE_STANDARD', '') == 'ansi': + cflags_c.append('-ansi') + else: + self._Appendf(cflags_c, 'GCC_C_LANGUAGE_STANDARD', '-std=%s') + cflags_c += self._Settings().get('OTHER_CFLAGS', []) + self.configname = None + return cflags_c + + def GetCflagsCC(self, configname): + """Returns flags that need to be added to .cc, and .mm compilations.""" + self.configname = configname + cflags_cc = [] + + clang_cxx_language_standard = self._Settings().get( + 'CLANG_CXX_LANGUAGE_STANDARD') + # Note: Don't make c++0x to c++11 so that c++0x can be used with older + # clangs that don't understand c++11 yet (like Xcode 4.2's). + if clang_cxx_language_standard: + cflags_cc.append('-std=%s' % clang_cxx_language_standard) + + self._Appendf(cflags_cc, 'CLANG_CXX_LIBRARY', '-stdlib=%s') + + if self._Test('GCC_ENABLE_CPP_RTTI', 'NO', default='YES'): + cflags_cc.append('-fno-rtti') + if self._Test('GCC_ENABLE_CPP_EXCEPTIONS', 'NO', default='YES'): + cflags_cc.append('-fno-exceptions') + if self._Test('GCC_INLINES_ARE_PRIVATE_EXTERN', 'YES', default='NO'): + cflags_cc.append('-fvisibility-inlines-hidden') + if self._Test('GCC_THREADSAFE_STATICS', 'NO', default='YES'): + cflags_cc.append('-fno-threadsafe-statics') + # Note: This flag is a no-op for clang, it only has an effect for gcc. + if self._Test('GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO', 'NO', default='YES'): + cflags_cc.append('-Wno-invalid-offsetof') + + other_ccflags = [] + + for flag in self._Settings().get('OTHER_CPLUSPLUSFLAGS', ['$(inherited)']): + # TODO: More general variable expansion. Missing in many other places too. + if flag in ('$inherited', '$(inherited)', '${inherited}'): + flag = '$OTHER_CFLAGS' + if flag in ('$OTHER_CFLAGS', '$(OTHER_CFLAGS)', '${OTHER_CFLAGS}'): + other_ccflags += self._Settings().get('OTHER_CFLAGS', []) + else: + other_ccflags.append(flag) + cflags_cc += other_ccflags + + self.configname = None + return cflags_cc + + def _AddObjectiveCGarbageCollectionFlags(self, flags): + gc_policy = self._Settings().get('GCC_ENABLE_OBJC_GC', 'unsupported') + if gc_policy == 'supported': + flags.append('-fobjc-gc') + elif gc_policy == 'required': + flags.append('-fobjc-gc-only') + + def _AddObjectiveCARCFlags(self, flags): + if self._Test('CLANG_ENABLE_OBJC_ARC', 'YES', default='NO'): + flags.append('-fobjc-arc') + + def _AddObjectiveCMissingPropertySynthesisFlags(self, flags): + if self._Test('CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS', + 'YES', default='NO'): + flags.append('-Wobjc-missing-property-synthesis') + + def GetCflagsObjC(self, configname): + """Returns flags that need to be added to .m compilations.""" + self.configname = configname + cflags_objc = [] + self._AddObjectiveCGarbageCollectionFlags(cflags_objc) + self._AddObjectiveCARCFlags(cflags_objc) + self._AddObjectiveCMissingPropertySynthesisFlags(cflags_objc) + self.configname = None + return cflags_objc + + def GetCflagsObjCC(self, configname): + """Returns flags that need to be added to .mm compilations.""" + self.configname = configname + cflags_objcc = [] + self._AddObjectiveCGarbageCollectionFlags(cflags_objcc) + self._AddObjectiveCARCFlags(cflags_objcc) + self._AddObjectiveCMissingPropertySynthesisFlags(cflags_objcc) + if self._Test('GCC_OBJC_CALL_CXX_CDTORS', 'YES', default='NO'): + cflags_objcc.append('-fobjc-call-cxx-cdtors') + self.configname = None + return cflags_objcc + + def GetInstallNameBase(self): + """Return DYLIB_INSTALL_NAME_BASE for this target.""" + # Xcode sets this for shared_libraries, and for nonbundled loadable_modules. + if (self.spec['type'] != 'shared_library' and + (self.spec['type'] != 'loadable_module' or self._IsBundle())): + return None + install_base = self.GetPerTargetSetting( + 'DYLIB_INSTALL_NAME_BASE', + default='/Library/Frameworks' if self._IsBundle() else '/usr/local/lib') + return install_base + + def _StandardizePath(self, path): + """Do :standardizepath processing for path.""" + # I'm not quite sure what :standardizepath does. Just call normpath(), + # but don't let @executable_path/../foo collapse to foo. + if '/' in path: + prefix, rest = '', path + if path.startswith('@'): + prefix, rest = path.split('/', 1) + rest = os.path.normpath(rest) # :standardizepath + path = os.path.join(prefix, rest) + return path + + def GetInstallName(self): + """Return LD_DYLIB_INSTALL_NAME for this target.""" + # Xcode sets this for shared_libraries, and for nonbundled loadable_modules. + if (self.spec['type'] != 'shared_library' and + (self.spec['type'] != 'loadable_module' or self._IsBundle())): + return None + + default_install_name = \ + '$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)' + install_name = self.GetPerTargetSetting( + 'LD_DYLIB_INSTALL_NAME', default=default_install_name) + + # Hardcode support for the variables used in chromium for now, to + # unblock people using the make build. + if '$' in install_name: + assert install_name in ('$(DYLIB_INSTALL_NAME_BASE:standardizepath)/' + '$(WRAPPER_NAME)/$(PRODUCT_NAME)', default_install_name), ( + 'Variables in LD_DYLIB_INSTALL_NAME are not generally supported ' + 'yet in target \'%s\' (got \'%s\')' % + (self.spec['target_name'], install_name)) + + install_name = install_name.replace( + '$(DYLIB_INSTALL_NAME_BASE:standardizepath)', + self._StandardizePath(self.GetInstallNameBase())) + if self._IsBundle(): + # These are only valid for bundles, hence the |if|. + install_name = install_name.replace( + '$(WRAPPER_NAME)', self.GetWrapperName()) + install_name = install_name.replace( + '$(PRODUCT_NAME)', self.GetProductName()) + else: + assert '$(WRAPPER_NAME)' not in install_name + assert '$(PRODUCT_NAME)' not in install_name + + install_name = install_name.replace( + '$(EXECUTABLE_PATH)', self.GetExecutablePath()) + return install_name + + def _MapLinkerFlagFilename(self, ldflag, gyp_to_build_path): + """Checks if ldflag contains a filename and if so remaps it from + gyp-directory-relative to build-directory-relative.""" + # This list is expanded on demand. + # They get matched as: + # -exported_symbols_list file + # -Wl,exported_symbols_list file + # -Wl,exported_symbols_list,file + LINKER_FILE = r'(\S+)' + WORD = r'\S+' + linker_flags = [ + ['-exported_symbols_list', LINKER_FILE], # Needed for NaCl. + ['-unexported_symbols_list', LINKER_FILE], + ['-reexported_symbols_list', LINKER_FILE], + ['-sectcreate', WORD, WORD, LINKER_FILE], # Needed for remoting. + ] + for flag_pattern in linker_flags: + regex = re.compile('(?:-Wl,)?' + '[ ,]'.join(flag_pattern)) + m = regex.match(ldflag) + if m: + ldflag = ldflag[:m.start(1)] + gyp_to_build_path(m.group(1)) + \ + ldflag[m.end(1):] + # Required for ffmpeg (no idea why they don't use LIBRARY_SEARCH_PATHS, + # TODO(thakis): Update ffmpeg.gyp): + if ldflag.startswith('-L'): + ldflag = '-L' + gyp_to_build_path(ldflag[len('-L'):]) + return ldflag + + def GetLdflags(self, configname, product_dir, gyp_to_build_path, arch=None): + """Returns flags that need to be passed to the linker. + + Args: + configname: The name of the configuration to get ld flags for. + product_dir: The directory where products such static and dynamic + libraries are placed. This is added to the library search path. + gyp_to_build_path: A function that converts paths relative to the + current gyp file to paths relative to the build direcotry. + """ + self.configname = configname + ldflags = [] + + # The xcode build is relative to a gyp file's directory, and OTHER_LDFLAGS + # can contain entries that depend on this. Explicitly absolutify these. + for ldflag in self._Settings().get('OTHER_LDFLAGS', []): + ldflags.append(self._MapLinkerFlagFilename(ldflag, gyp_to_build_path)) + + if self._Test('DEAD_CODE_STRIPPING', 'YES', default='NO'): + ldflags.append('-Wl,-dead_strip') + + if self._Test('PREBINDING', 'YES', default='NO'): + ldflags.append('-Wl,-prebind') + + self._Appendf( + ldflags, 'DYLIB_COMPATIBILITY_VERSION', '-compatibility_version %s') + self._Appendf( + ldflags, 'DYLIB_CURRENT_VERSION', '-current_version %s') + + self._AppendPlatformVersionMinFlags(ldflags) + + if 'SDKROOT' in self._Settings() and self._SdkPath(): + ldflags.append('-isysroot ' + self._SdkPath()) + + for library_path in self._Settings().get('LIBRARY_SEARCH_PATHS', []): + ldflags.append('-L' + gyp_to_build_path(library_path)) + + if 'ORDER_FILE' in self._Settings(): + ldflags.append('-Wl,-order_file ' + + '-Wl,' + gyp_to_build_path( + self._Settings()['ORDER_FILE'])) + + if arch is not None: + archs = [arch] + else: + assert self.configname + archs = self.GetActiveArchs(self.configname) + if len(archs) != 1: + # TODO: Supporting fat binaries will be annoying. + self._WarnUnimplemented('ARCHS') + archs = ['i386'] + ldflags.append('-arch ' + archs[0]) + + # Xcode adds the product directory by default. + ldflags.append('-L' + product_dir) + + install_name = self.GetInstallName() + if install_name and self.spec['type'] != 'loadable_module': + ldflags.append('-install_name ' + install_name.replace(' ', r'\ ')) + + for rpath in self._Settings().get('LD_RUNPATH_SEARCH_PATHS', []): + ldflags.append('-Wl,-rpath,' + rpath) + + sdk_root = self._SdkPath() + if not sdk_root: + sdk_root = '' + config = self.spec['configurations'][self.configname] + framework_dirs = config.get('mac_framework_dirs', []) + for directory in framework_dirs: + ldflags.append('-F' + directory.replace('$(SDKROOT)', sdk_root)) + + is_extension = self._IsIosAppExtension() or self._IsIosWatchKitExtension() + if sdk_root and is_extension: + # Adds the link flags for extensions. These flags are common for all + # extensions and provide loader and main function. + # These flags reflect the compilation options used by xcode to compile + # extensions. + ldflags.append('-lpkstart') + if XcodeVersion() < '0900': + ldflags.append(sdk_root + + '/System/Library/PrivateFrameworks/PlugInKit.framework/PlugInKit') + ldflags.append('-fapplication-extension') + ldflags.append('-Xlinker -rpath ' + '-Xlinker @executable_path/../../Frameworks') + + self._Appendf(ldflags, 'CLANG_CXX_LIBRARY', '-stdlib=%s') + + self.configname = None + return ldflags + + def GetLibtoolflags(self, configname): + """Returns flags that need to be passed to the static linker. + + Args: + configname: The name of the configuration to get ld flags for. + """ + self.configname = configname + libtoolflags = [] + + for libtoolflag in self._Settings().get('OTHER_LDFLAGS', []): + libtoolflags.append(libtoolflag) + # TODO(thakis): ARCHS? + + self.configname = None + return libtoolflags + + def GetPerTargetSettings(self): + """Gets a list of all the per-target settings. This will only fetch keys + whose values are the same across all configurations.""" + first_pass = True + result = {} + for configname in sorted(self.xcode_settings.keys()): + if first_pass: + result = dict(self.xcode_settings[configname]) + first_pass = False + else: + for key, value in self.xcode_settings[configname].iteritems(): + if key not in result: + continue + elif result[key] != value: + del result[key] + return result + + def GetPerConfigSetting(self, setting, configname, default=None): + if configname in self.xcode_settings: + return self.xcode_settings[configname].get(setting, default) + else: + return self.GetPerTargetSetting(setting, default) + + def GetPerTargetSetting(self, setting, default=None): + """Tries to get xcode_settings.setting from spec. Assumes that the setting + has the same value in all configurations and throws otherwise.""" + is_first_pass = True + result = None + for configname in sorted(self.xcode_settings.keys()): + if is_first_pass: + result = self.xcode_settings[configname].get(setting, None) + is_first_pass = False + else: + assert result == self.xcode_settings[configname].get(setting, None), ( + "Expected per-target setting for '%s', got per-config setting " + "(target %s)" % (setting, self.spec['target_name'])) + if result is None: + return default + return result + + def _GetStripPostbuilds(self, configname, output_binary, quiet): + """Returns a list of shell commands that contain the shell commands + neccessary to strip this target's binary. These should be run as postbuilds + before the actual postbuilds run.""" + self.configname = configname + + result = [] + if (self._Test('DEPLOYMENT_POSTPROCESSING', 'YES', default='NO') and + self._Test('STRIP_INSTALLED_PRODUCT', 'YES', default='NO')): + + default_strip_style = 'debugging' + if self.spec['type'] == 'loadable_module' and self._IsBundle(): + default_strip_style = 'non-global' + elif self.spec['type'] == 'executable': + default_strip_style = 'all' + + strip_style = self._Settings().get('STRIP_STYLE', default_strip_style) + strip_flags = { + 'all': '', + 'non-global': '-x', + 'debugging': '-S', + }[strip_style] + + explicit_strip_flags = self._Settings().get('STRIPFLAGS', '') + if explicit_strip_flags: + strip_flags += ' ' + _NormalizeEnvVarReferences(explicit_strip_flags) + + if not quiet: + result.append('echo STRIP\\(%s\\)' % self.spec['target_name']) + result.append('strip %s %s' % (strip_flags, output_binary)) + + self.configname = None + return result + + def _GetDebugInfoPostbuilds(self, configname, output, output_binary, quiet): + """Returns a list of shell commands that contain the shell commands + neccessary to massage this target's debug information. These should be run + as postbuilds before the actual postbuilds run.""" + self.configname = configname + + # For static libraries, no dSYMs are created. + result = [] + if (self._Test('GCC_GENERATE_DEBUGGING_SYMBOLS', 'YES', default='YES') and + self._Test( + 'DEBUG_INFORMATION_FORMAT', 'dwarf-with-dsym', default='dwarf') and + self.spec['type'] != 'static_library'): + if not quiet: + result.append('echo DSYMUTIL\\(%s\\)' % self.spec['target_name']) + result.append('dsymutil %s -o %s' % (output_binary, output + '.dSYM')) + + self.configname = None + return result + + def _GetTargetPostbuilds(self, configname, output, output_binary, + quiet=False): + """Returns a list of shell commands that contain the shell commands + to run as postbuilds for this target, before the actual postbuilds.""" + # dSYMs need to build before stripping happens. + return ( + self._GetDebugInfoPostbuilds(configname, output, output_binary, quiet) + + self._GetStripPostbuilds(configname, output_binary, quiet)) + + def _GetIOSPostbuilds(self, configname, output_binary): + """Return a shell command to codesign the iOS output binary so it can + be deployed to a device. This should be run as the very last step of the + build.""" + if not (self.isIOS and self.spec['type'] == 'executable'): + return [] + + settings = self.xcode_settings[configname] + key = self._GetIOSCodeSignIdentityKey(settings) + if not key: + return [] + + # Warn for any unimplemented signing xcode keys. + unimpl = ['OTHER_CODE_SIGN_FLAGS'] + unimpl = set(unimpl) & set(self.xcode_settings[configname].keys()) + if unimpl: + print 'Warning: Some codesign keys not implemented, ignoring: %s' % ( + ', '.join(sorted(unimpl))) + + return ['%s code-sign-bundle "%s" "%s" "%s" "%s"' % ( + os.path.join('${TARGET_BUILD_DIR}', 'gyp-mac-tool'), key, + settings.get('CODE_SIGN_RESOURCE_RULES_PATH', ''), + settings.get('CODE_SIGN_ENTITLEMENTS', ''), + settings.get('PROVISIONING_PROFILE', '')) + ] + + def _GetIOSCodeSignIdentityKey(self, settings): + identity = settings.get('CODE_SIGN_IDENTITY') + if not identity: + return None + if identity not in XcodeSettings._codesigning_key_cache: + output = subprocess.check_output( + ['security', 'find-identity', '-p', 'codesigning', '-v']) + for line in output.splitlines(): + if identity in line: + fingerprint = line.split()[1] + cache = XcodeSettings._codesigning_key_cache + assert identity not in cache or fingerprint == cache[identity], ( + "Multiple codesigning fingerprints for identity: %s" % identity) + XcodeSettings._codesigning_key_cache[identity] = fingerprint + return XcodeSettings._codesigning_key_cache.get(identity, '') + + def AddImplicitPostbuilds(self, configname, output, output_binary, + postbuilds=[], quiet=False): + """Returns a list of shell commands that should run before and after + |postbuilds|.""" + assert output_binary is not None + pre = self._GetTargetPostbuilds(configname, output, output_binary, quiet) + post = self._GetIOSPostbuilds(configname, output_binary) + return pre + postbuilds + post + + def _AdjustLibrary(self, library, config_name=None): + if library.endswith('.framework'): + l = '-framework ' + os.path.splitext(os.path.basename(library))[0] + else: + m = self.library_re.match(library) + if m: + l = '-l' + m.group(1) + else: + l = library + + sdk_root = self._SdkPath(config_name) + if not sdk_root: + sdk_root = '' + # Xcode 7 started shipping with ".tbd" (text based stubs) files instead of + # ".dylib" without providing a real support for them. What it does, for + # "/usr/lib" libraries, is do "-L/usr/lib -lname" which is dependent on the + # library order and cause collision when building Chrome. + # + # Instead substitude ".tbd" to ".dylib" in the generated project when the + # following conditions are both true: + # - library is referenced in the gyp file as "$(SDKROOT)/**/*.dylib", + # - the ".dylib" file does not exists but a ".tbd" file do. + library = l.replace('$(SDKROOT)', sdk_root) + if l.startswith('$(SDKROOT)'): + basename, ext = os.path.splitext(library) + if ext == '.dylib' and not os.path.exists(library): + tbd_library = basename + '.tbd' + if os.path.exists(tbd_library): + library = tbd_library + return library + + def AdjustLibraries(self, libraries, config_name=None): + """Transforms entries like 'Cocoa.framework' in libraries into entries like + '-framework Cocoa', 'libcrypto.dylib' into '-lcrypto', etc. + """ + libraries = [self._AdjustLibrary(library, config_name) + for library in libraries] + return libraries + + def _BuildMachineOSBuild(self): + return GetStdout(['sw_vers', '-buildVersion']) + + def _XcodeIOSDeviceFamily(self, configname): + family = self.xcode_settings[configname].get('TARGETED_DEVICE_FAMILY', '1') + return [int(x) for x in family.split(',')] + + def GetExtraPlistItems(self, configname=None): + """Returns a dictionary with extra items to insert into Info.plist.""" + if configname not in XcodeSettings._plist_cache: + cache = {} + cache['BuildMachineOSBuild'] = self._BuildMachineOSBuild() + + xcode, xcode_build = XcodeVersion() + cache['DTXcode'] = xcode + cache['DTXcodeBuild'] = xcode_build + + sdk_root = self._SdkRoot(configname) + if not sdk_root: + sdk_root = self._DefaultSdkRoot() + cache['DTSDKName'] = sdk_root + if xcode >= '0430': + cache['DTSDKBuild'] = self._GetSdkVersionInfoItem( + sdk_root, 'ProductBuildVersion') + else: + cache['DTSDKBuild'] = cache['BuildMachineOSBuild'] + + if self.isIOS: + cache['DTPlatformName'] = cache['DTSDKName'] + if configname.endswith("iphoneos"): + cache['DTPlatformVersion'] = self._GetSdkVersionInfoItem( + sdk_root, 'ProductVersion') + cache['CFBundleSupportedPlatforms'] = ['iPhoneOS'] + else: + cache['CFBundleSupportedPlatforms'] = ['iPhoneSimulator'] + XcodeSettings._plist_cache[configname] = cache + + # Include extra plist items that are per-target, not per global + # XcodeSettings. + items = dict(XcodeSettings._plist_cache[configname]) + if self.isIOS: + items['UIDeviceFamily'] = self._XcodeIOSDeviceFamily(configname) + return items + + def _DefaultSdkRoot(self): + """Returns the default SDKROOT to use. + + Prior to version 5.0.0, if SDKROOT was not explicitly set in the Xcode + project, then the environment variable was empty. Starting with this + version, Xcode uses the name of the newest SDK installed. + """ + xcode_version, xcode_build = XcodeVersion() + if xcode_version < '0500': + return '' + default_sdk_path = self._XcodeSdkPath('') + default_sdk_root = XcodeSettings._sdk_root_cache.get(default_sdk_path) + if default_sdk_root: + return default_sdk_root + try: + all_sdks = GetStdout(['xcodebuild', '-showsdks']) + except: + # If xcodebuild fails, there will be no valid SDKs + return '' + for line in all_sdks.splitlines(): + items = line.split() + if len(items) >= 3 and items[-2] == '-sdk': + sdk_root = items[-1] + sdk_path = self._XcodeSdkPath(sdk_root) + if sdk_path == default_sdk_path: + return sdk_root + return '' + + +class MacPrefixHeader(object): + """A class that helps with emulating Xcode's GCC_PREFIX_HEADER feature. + + This feature consists of several pieces: + * If GCC_PREFIX_HEADER is present, all compilations in that project get an + additional |-include path_to_prefix_header| cflag. + * If GCC_PRECOMPILE_PREFIX_HEADER is present too, then the prefix header is + instead compiled, and all other compilations in the project get an + additional |-include path_to_compiled_header| instead. + + Compiled prefix headers have the extension gch. There is one gch file for + every language used in the project (c, cc, m, mm), since gch files for + different languages aren't compatible. + + gch files themselves are built with the target's normal cflags, but they + obviously don't get the |-include| flag. Instead, they need a -x flag that + describes their language. + + All o files in the target need to depend on the gch file, to make sure + it's built before any o file is built. + + This class helps with some of these tasks, but it needs help from the build + system for writing dependencies to the gch files, for writing build commands + for the gch files, and for figuring out the location of the gch files. + """ + def __init__(self, xcode_settings, + gyp_path_to_build_path, gyp_path_to_build_output): + """If xcode_settings is None, all methods on this class are no-ops. + + Args: + gyp_path_to_build_path: A function that takes a gyp-relative path, + and returns a path relative to the build directory. + gyp_path_to_build_output: A function that takes a gyp-relative path and + a language code ('c', 'cc', 'm', or 'mm'), and that returns a path + to where the output of precompiling that path for that language + should be placed (without the trailing '.gch'). + """ + # This doesn't support per-configuration prefix headers. Good enough + # for now. + self.header = None + self.compile_headers = False + if xcode_settings: + self.header = xcode_settings.GetPerTargetSetting('GCC_PREFIX_HEADER') + self.compile_headers = xcode_settings.GetPerTargetSetting( + 'GCC_PRECOMPILE_PREFIX_HEADER', default='NO') != 'NO' + self.compiled_headers = {} + if self.header: + if self.compile_headers: + for lang in ['c', 'cc', 'm', 'mm']: + self.compiled_headers[lang] = gyp_path_to_build_output( + self.header, lang) + self.header = gyp_path_to_build_path(self.header) + + def _CompiledHeader(self, lang, arch): + assert self.compile_headers + h = self.compiled_headers[lang] + if arch: + h += '.' + arch + return h + + def GetInclude(self, lang, arch=None): + """Gets the cflags to include the prefix header for language |lang|.""" + if self.compile_headers and lang in self.compiled_headers: + return '-include %s' % self._CompiledHeader(lang, arch) + elif self.header: + return '-include %s' % self.header + else: + return '' + + def _Gch(self, lang, arch): + """Returns the actual file name of the prefix header for language |lang|.""" + assert self.compile_headers + return self._CompiledHeader(lang, arch) + '.gch' + + def GetObjDependencies(self, sources, objs, arch=None): + """Given a list of source files and the corresponding object files, returns + a list of (source, object, gch) tuples, where |gch| is the build-directory + relative path to the gch file each object file depends on. |compilable[i]| + has to be the source file belonging to |objs[i]|.""" + if not self.header or not self.compile_headers: + return [] + + result = [] + for source, obj in zip(sources, objs): + ext = os.path.splitext(source)[1] + lang = { + '.c': 'c', + '.cpp': 'cc', '.cc': 'cc', '.cxx': 'cc', + '.m': 'm', + '.mm': 'mm', + }.get(ext, None) + if lang: + result.append((source, obj, self._Gch(lang, arch))) + return result + + def GetPchBuildCommands(self, arch=None): + """Returns [(path_to_gch, language_flag, language, header)]. + |path_to_gch| and |header| are relative to the build directory. + """ + if not self.header or not self.compile_headers: + return [] + return [ + (self._Gch('c', arch), '-x c-header', 'c', self.header), + (self._Gch('cc', arch), '-x c++-header', 'cc', self.header), + (self._Gch('m', arch), '-x objective-c-header', 'm', self.header), + (self._Gch('mm', arch), '-x objective-c++-header', 'mm', self.header), + ] + + +def XcodeVersion(): + """Returns a tuple of version and build version of installed Xcode.""" + # `xcodebuild -version` output looks like + # Xcode 4.6.3 + # Build version 4H1503 + # or like + # Xcode 3.2.6 + # Component versions: DevToolsCore-1809.0; DevToolsSupport-1806.0 + # BuildVersion: 10M2518 + # Convert that to '0463', '4H1503'. + global XCODE_VERSION_CACHE + if XCODE_VERSION_CACHE: + return XCODE_VERSION_CACHE + try: + version_list = GetStdout(['xcodebuild', '-version']).splitlines() + # In some circumstances xcodebuild exits 0 but doesn't return + # the right results; for example, a user on 10.7 or 10.8 with + # a bogus path set via xcode-select + # In that case this may be a CLT-only install so fall back to + # checking that version. + if len(version_list) < 2: + raise GypError("xcodebuild returned unexpected results") + except: + version = CLTVersion() + if version: + version = re.match(r'(\d\.\d\.?\d*)', version).groups()[0] + else: + raise GypError("No Xcode or CLT version detected!") + # The CLT has no build information, so we return an empty string. + version_list = [version, ''] + version = version_list[0] + build = version_list[-1] + # Be careful to convert "4.2" to "0420": + version = version.split()[-1].replace('.', '') + version = (version + '0' * (3 - len(version))).zfill(4) + if build: + build = build.split()[-1] + XCODE_VERSION_CACHE = (version, build) + return XCODE_VERSION_CACHE + + +# This function ported from the logic in Homebrew's CLT version check +def CLTVersion(): + """Returns the version of command-line tools from pkgutil.""" + # pkgutil output looks like + # package-id: com.apple.pkg.CLTools_Executables + # version: 5.0.1.0.1.1382131676 + # volume: / + # location: / + # install-time: 1382544035 + # groups: com.apple.FindSystemFiles.pkg-group com.apple.DevToolsBoth.pkg-group com.apple.DevToolsNonRelocatableShared.pkg-group + STANDALONE_PKG_ID = "com.apple.pkg.DeveloperToolsCLILeo" + FROM_XCODE_PKG_ID = "com.apple.pkg.DeveloperToolsCLI" + MAVERICKS_PKG_ID = "com.apple.pkg.CLTools_Executables" + + regex = re.compile('version: (?P.+)') + for key in [MAVERICKS_PKG_ID, STANDALONE_PKG_ID, FROM_XCODE_PKG_ID]: + try: + output = GetStdout(['/usr/sbin/pkgutil', '--pkg-info', key]) + return re.search(regex, output).groupdict()['version'] + except: + continue + + +def GetStdout(cmdlist): + """Returns the content of standard output returned by invoking |cmdlist|. + Raises |GypError| if the command return with a non-zero return code.""" + job = subprocess.Popen(cmdlist, stdout=subprocess.PIPE) + out = job.communicate()[0] + if job.returncode != 0: + sys.stderr.write(out + '\n') + raise GypError('Error %d running %s' % (job.returncode, cmdlist[0])) + return out.rstrip('\n') + + +def MergeGlobalXcodeSettingsToSpec(global_dict, spec): + """Merges the global xcode_settings dictionary into each configuration of the + target represented by spec. For keys that are both in the global and the local + xcode_settings dict, the local key gets precendence. + """ + # The xcode generator special-cases global xcode_settings and does something + # that amounts to merging in the global xcode_settings into each local + # xcode_settings dict. + global_xcode_settings = global_dict.get('xcode_settings', {}) + for config in spec['configurations'].values(): + if 'xcode_settings' in config: + new_settings = global_xcode_settings.copy() + new_settings.update(config['xcode_settings']) + config['xcode_settings'] = new_settings + + +def IsMacBundle(flavor, spec): + """Returns if |spec| should be treated as a bundle. + + Bundles are directories with a certain subdirectory structure, instead of + just a single file. Bundle rules do not produce a binary but also package + resources into that directory.""" + is_mac_bundle = (int(spec.get('mac_bundle', 0)) != 0 and flavor == 'mac') + if is_mac_bundle: + assert spec['type'] != 'none', ( + 'mac_bundle targets cannot have type none (target "%s")' % + spec['target_name']) + return is_mac_bundle + + +def GetMacBundleResources(product_dir, xcode_settings, resources): + """Yields (output, resource) pairs for every resource in |resources|. + Only call this for mac bundle targets. + + Args: + product_dir: Path to the directory containing the output bundle, + relative to the build directory. + xcode_settings: The XcodeSettings of the current target. + resources: A list of bundle resources, relative to the build directory. + """ + dest = os.path.join(product_dir, + xcode_settings.GetBundleResourceFolder()) + for res in resources: + output = dest + + # The make generator doesn't support it, so forbid it everywhere + # to keep the generators more interchangable. + assert ' ' not in res, ( + "Spaces in resource filenames not supported (%s)" % res) + + # Split into (path,file). + res_parts = os.path.split(res) + + # Now split the path into (prefix,maybe.lproj). + lproj_parts = os.path.split(res_parts[0]) + # If the resource lives in a .lproj bundle, add that to the destination. + if lproj_parts[1].endswith('.lproj'): + output = os.path.join(output, lproj_parts[1]) + + output = os.path.join(output, res_parts[1]) + # Compiled XIB files are referred to by .nib. + if output.endswith('.xib'): + output = os.path.splitext(output)[0] + '.nib' + # Compiled storyboard files are referred to by .storyboardc. + if output.endswith('.storyboard'): + output = os.path.splitext(output)[0] + '.storyboardc' + + yield output, res + + +def GetMacInfoPlist(product_dir, xcode_settings, gyp_path_to_build_path): + """Returns (info_plist, dest_plist, defines, extra_env), where: + * |info_plist| is the source plist path, relative to the + build directory, + * |dest_plist| is the destination plist path, relative to the + build directory, + * |defines| is a list of preprocessor defines (empty if the plist + shouldn't be preprocessed, + * |extra_env| is a dict of env variables that should be exported when + invoking |mac_tool copy-info-plist|. + + Only call this for mac bundle targets. + + Args: + product_dir: Path to the directory containing the output bundle, + relative to the build directory. + xcode_settings: The XcodeSettings of the current target. + gyp_to_build_path: A function that converts paths relative to the + current gyp file to paths relative to the build direcotry. + """ + info_plist = xcode_settings.GetPerTargetSetting('INFOPLIST_FILE') + if not info_plist: + return None, None, [], {} + + # The make generator doesn't support it, so forbid it everywhere + # to keep the generators more interchangable. + assert ' ' not in info_plist, ( + "Spaces in Info.plist filenames not supported (%s)" % info_plist) + + info_plist = gyp_path_to_build_path(info_plist) + + # If explicitly set to preprocess the plist, invoke the C preprocessor and + # specify any defines as -D flags. + if xcode_settings.GetPerTargetSetting( + 'INFOPLIST_PREPROCESS', default='NO') == 'YES': + # Create an intermediate file based on the path. + defines = shlex.split(xcode_settings.GetPerTargetSetting( + 'INFOPLIST_PREPROCESSOR_DEFINITIONS', default='')) + else: + defines = [] + + dest_plist = os.path.join(product_dir, xcode_settings.GetBundlePlistPath()) + extra_env = xcode_settings.GetPerTargetSettings() + + return info_plist, dest_plist, defines, extra_env + + +def _GetXcodeEnv(xcode_settings, built_products_dir, srcroot, configuration, + additional_settings=None): + """Return the environment variables that Xcode would set. See + http://developer.apple.com/library/mac/#documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html#//apple_ref/doc/uid/TP40003931-CH3-SW153 + for a full list. + + Args: + xcode_settings: An XcodeSettings object. If this is None, this function + returns an empty dict. + built_products_dir: Absolute path to the built products dir. + srcroot: Absolute path to the source root. + configuration: The build configuration name. + additional_settings: An optional dict with more values to add to the + result. + """ + if not xcode_settings: return {} + + # This function is considered a friend of XcodeSettings, so let it reach into + # its implementation details. + spec = xcode_settings.spec + + # These are filled in on a as-needed basis. + env = { + 'BUILT_FRAMEWORKS_DIR' : built_products_dir, + 'BUILT_PRODUCTS_DIR' : built_products_dir, + 'CONFIGURATION' : configuration, + 'PRODUCT_NAME' : xcode_settings.GetProductName(), + # See /Developer/Platforms/MacOSX.platform/Developer/Library/Xcode/Specifications/MacOSX\ Product\ Types.xcspec for FULL_PRODUCT_NAME + 'SRCROOT' : srcroot, + 'SOURCE_ROOT': '${SRCROOT}', + # This is not true for static libraries, but currently the env is only + # written for bundles: + 'TARGET_BUILD_DIR' : built_products_dir, + 'TEMP_DIR' : '${TMPDIR}', + } + if xcode_settings.GetPerConfigSetting('SDKROOT', configuration): + env['SDKROOT'] = xcode_settings._SdkPath(configuration) + else: + env['SDKROOT'] = '' + + if spec['type'] in ( + 'executable', 'static_library', 'shared_library', 'loadable_module'): + env['EXECUTABLE_NAME'] = xcode_settings.GetExecutableName() + env['EXECUTABLE_PATH'] = xcode_settings.GetExecutablePath() + env['FULL_PRODUCT_NAME'] = xcode_settings.GetFullProductName() + mach_o_type = xcode_settings.GetMachOType() + if mach_o_type: + env['MACH_O_TYPE'] = mach_o_type + env['PRODUCT_TYPE'] = xcode_settings.GetProductType() + if xcode_settings._IsBundle(): + env['CONTENTS_FOLDER_PATH'] = \ + xcode_settings.GetBundleContentsFolderPath() + env['UNLOCALIZED_RESOURCES_FOLDER_PATH'] = \ + xcode_settings.GetBundleResourceFolder() + env['INFOPLIST_PATH'] = xcode_settings.GetBundlePlistPath() + env['WRAPPER_NAME'] = xcode_settings.GetWrapperName() + + install_name = xcode_settings.GetInstallName() + if install_name: + env['LD_DYLIB_INSTALL_NAME'] = install_name + install_name_base = xcode_settings.GetInstallNameBase() + if install_name_base: + env['DYLIB_INSTALL_NAME_BASE'] = install_name_base + if XcodeVersion() >= '0500' and not env.get('SDKROOT'): + sdk_root = xcode_settings._SdkRoot(configuration) + if not sdk_root: + sdk_root = xcode_settings._XcodeSdkPath('') + if sdk_root is None: + sdk_root = '' + env['SDKROOT'] = sdk_root + + if not additional_settings: + additional_settings = {} + else: + # Flatten lists to strings. + for k in additional_settings: + if not isinstance(additional_settings[k], str): + additional_settings[k] = ' '.join(additional_settings[k]) + additional_settings.update(env) + + for k in additional_settings: + additional_settings[k] = _NormalizeEnvVarReferences(additional_settings[k]) + + return additional_settings + + +def _NormalizeEnvVarReferences(str): + """Takes a string containing variable references in the form ${FOO}, $(FOO), + or $FOO, and returns a string with all variable references in the form ${FOO}. + """ + # $FOO -> ${FOO} + str = re.sub(r'\$([a-zA-Z_][a-zA-Z0-9_]*)', r'${\1}', str) + + # $(FOO) -> ${FOO} + matches = re.findall(r'(\$\(([a-zA-Z0-9\-_]+)\))', str) + for match in matches: + to_replace, variable = match + assert '$(' not in match, '$($(FOO)) variables not supported: ' + match + str = str.replace(to_replace, '${' + variable + '}') + + return str + + +def ExpandEnvVars(string, expansions): + """Expands ${VARIABLES}, $(VARIABLES), and $VARIABLES in string per the + expansions list. If the variable expands to something that references + another variable, this variable is expanded as well if it's in env -- + until no variables present in env are left.""" + for k, v in reversed(expansions): + string = string.replace('${' + k + '}', v) + string = string.replace('$(' + k + ')', v) + string = string.replace('$' + k, v) + return string + + +def _TopologicallySortedEnvVarKeys(env): + """Takes a dict |env| whose values are strings that can refer to other keys, + for example env['foo'] = '$(bar) and $(baz)'. Returns a list L of all keys of + env such that key2 is after key1 in L if env[key2] refers to env[key1]. + + Throws an Exception in case of dependency cycles. + """ + # Since environment variables can refer to other variables, the evaluation + # order is important. Below is the logic to compute the dependency graph + # and sort it. + regex = re.compile(r'\$\{([a-zA-Z0-9\-_]+)\}') + def GetEdges(node): + # Use a definition of edges such that user_of_variable -> used_varible. + # This happens to be easier in this case, since a variable's + # definition contains all variables it references in a single string. + # We can then reverse the result of the topological sort at the end. + # Since: reverse(topsort(DAG)) = topsort(reverse_edges(DAG)) + matches = set([v for v in regex.findall(env[node]) if v in env]) + for dependee in matches: + assert '${' not in dependee, 'Nested variables not supported: ' + dependee + return matches + + try: + # Topologically sort, and then reverse, because we used an edge definition + # that's inverted from the expected result of this function (see comment + # above). + order = gyp.common.TopologicallySorted(env.keys(), GetEdges) + order.reverse() + return order + except gyp.common.CycleError, e: + raise GypError( + 'Xcode environment variables are cyclically dependent: ' + str(e.nodes)) + + +def GetSortedXcodeEnv(xcode_settings, built_products_dir, srcroot, + configuration, additional_settings=None): + env = _GetXcodeEnv(xcode_settings, built_products_dir, srcroot, configuration, + additional_settings) + return [(key, env[key]) for key in _TopologicallySortedEnvVarKeys(env)] + + +def GetSpecPostbuildCommands(spec, quiet=False): + """Returns the list of postbuilds explicitly defined on |spec|, in a form + executable by a shell.""" + postbuilds = [] + for postbuild in spec.get('postbuilds', []): + if not quiet: + postbuilds.append('echo POSTBUILD\\(%s\\) %s' % ( + spec['target_name'], postbuild['postbuild_name'])) + postbuilds.append(gyp.common.EncodePOSIXShellList(postbuild['action'])) + return postbuilds + + +def _HasIOSTarget(targets): + """Returns true if any target contains the iOS specific key + IPHONEOS_DEPLOYMENT_TARGET.""" + for target_dict in targets.values(): + for config in target_dict['configurations'].values(): + if config.get('xcode_settings', {}).get('IPHONEOS_DEPLOYMENT_TARGET'): + return True + return False + + +def _AddIOSDeviceConfigurations(targets): + """Clone all targets and append -iphoneos to the name. Configure these targets + to build for iOS devices and use correct architectures for those builds.""" + for target_dict in targets.itervalues(): + toolset = target_dict['toolset'] + configs = target_dict['configurations'] + for config_name, config_dict in dict(configs).iteritems(): + iphoneos_config_dict = copy.deepcopy(config_dict) + configs[config_name + '-iphoneos'] = iphoneos_config_dict + configs[config_name + '-iphonesimulator'] = config_dict + if toolset == 'target': + iphoneos_config_dict['xcode_settings']['SDKROOT'] = 'iphoneos' + return targets + +def CloneConfigurationForDeviceAndEmulator(target_dicts): + """If |target_dicts| contains any iOS targets, automatically create -iphoneos + targets for iOS device builds.""" + if _HasIOSTarget(target_dicts): + return _AddIOSDeviceConfigurations(target_dicts) + return target_dicts diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.pyc b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.pyc new file mode 100644 index 00000000..cb3ec674 Binary files /dev/null and b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.pyc differ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py new file mode 100644 index 00000000..3820d6bf --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py @@ -0,0 +1,270 @@ +# Copyright (c) 2014 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Xcode-ninja wrapper project file generator. + +This updates the data structures passed to the Xcode gyp generator to build +with ninja instead. The Xcode project itself is transformed into a list of +executable targets, each with a build step to build with ninja, and a target +with every source and resource file. This appears to sidestep some of the +major performance headaches experienced using complex projects and large number +of targets within Xcode. +""" + +import errno +import gyp.generator.ninja +import os +import re +import xml.sax.saxutils + + +def _WriteWorkspace(main_gyp, sources_gyp, params): + """ Create a workspace to wrap main and sources gyp paths. """ + (build_file_root, build_file_ext) = os.path.splitext(main_gyp) + workspace_path = build_file_root + '.xcworkspace' + options = params['options'] + if options.generator_output: + workspace_path = os.path.join(options.generator_output, workspace_path) + try: + os.makedirs(workspace_path) + except OSError, e: + if e.errno != errno.EEXIST: + raise + output_string = '\n' + \ + '\n' + for gyp_name in [main_gyp, sources_gyp]: + name = os.path.splitext(os.path.basename(gyp_name))[0] + '.xcodeproj' + name = xml.sax.saxutils.quoteattr("group:" + name) + output_string += ' \n' % name + output_string += '\n' + + workspace_file = os.path.join(workspace_path, "contents.xcworkspacedata") + + try: + with open(workspace_file, 'r') as input_file: + input_string = input_file.read() + if input_string == output_string: + return + except IOError: + # Ignore errors if the file doesn't exist. + pass + + with open(workspace_file, 'w') as output_file: + output_file.write(output_string) + +def _TargetFromSpec(old_spec, params): + """ Create fake target for xcode-ninja wrapper. """ + # Determine ninja top level build dir (e.g. /path/to/out). + ninja_toplevel = None + jobs = 0 + if params: + options = params['options'] + ninja_toplevel = \ + os.path.join(options.toplevel_dir, + gyp.generator.ninja.ComputeOutputDir(params)) + jobs = params.get('generator_flags', {}).get('xcode_ninja_jobs', 0) + + target_name = old_spec.get('target_name') + product_name = old_spec.get('product_name', target_name) + product_extension = old_spec.get('product_extension') + + ninja_target = {} + ninja_target['target_name'] = target_name + ninja_target['product_name'] = product_name + if product_extension: + ninja_target['product_extension'] = product_extension + ninja_target['toolset'] = old_spec.get('toolset') + ninja_target['default_configuration'] = old_spec.get('default_configuration') + ninja_target['configurations'] = {} + + # Tell Xcode to look in |ninja_toplevel| for build products. + new_xcode_settings = {} + if ninja_toplevel: + new_xcode_settings['CONFIGURATION_BUILD_DIR'] = \ + "%s/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)" % ninja_toplevel + + if 'configurations' in old_spec: + for config in old_spec['configurations'].iterkeys(): + old_xcode_settings = \ + old_spec['configurations'][config].get('xcode_settings', {}) + if 'IPHONEOS_DEPLOYMENT_TARGET' in old_xcode_settings: + new_xcode_settings['CODE_SIGNING_REQUIRED'] = "NO" + new_xcode_settings['IPHONEOS_DEPLOYMENT_TARGET'] = \ + old_xcode_settings['IPHONEOS_DEPLOYMENT_TARGET'] + ninja_target['configurations'][config] = {} + ninja_target['configurations'][config]['xcode_settings'] = \ + new_xcode_settings + + ninja_target['mac_bundle'] = old_spec.get('mac_bundle', 0) + ninja_target['ios_app_extension'] = old_spec.get('ios_app_extension', 0) + ninja_target['ios_watchkit_extension'] = \ + old_spec.get('ios_watchkit_extension', 0) + ninja_target['ios_watchkit_app'] = old_spec.get('ios_watchkit_app', 0) + ninja_target['type'] = old_spec['type'] + if ninja_toplevel: + ninja_target['actions'] = [ + { + 'action_name': 'Compile and copy %s via ninja' % target_name, + 'inputs': [], + 'outputs': [], + 'action': [ + 'env', + 'PATH=%s' % os.environ['PATH'], + 'ninja', + '-C', + new_xcode_settings['CONFIGURATION_BUILD_DIR'], + target_name, + ], + 'message': 'Compile and copy %s via ninja' % target_name, + }, + ] + if jobs > 0: + ninja_target['actions'][0]['action'].extend(('-j', jobs)) + return ninja_target + +def IsValidTargetForWrapper(target_extras, executable_target_pattern, spec): + """Limit targets for Xcode wrapper. + + Xcode sometimes performs poorly with too many targets, so only include + proper executable targets, with filters to customize. + Arguments: + target_extras: Regular expression to always add, matching any target. + executable_target_pattern: Regular expression limiting executable targets. + spec: Specifications for target. + """ + target_name = spec.get('target_name') + # Always include targets matching target_extras. + if target_extras is not None and re.search(target_extras, target_name): + return True + + # Otherwise just show executable targets. + if spec.get('type', '') == 'executable' and \ + spec.get('product_extension', '') != 'bundle': + + # If there is a filter and the target does not match, exclude the target. + if executable_target_pattern is not None: + if not re.search(executable_target_pattern, target_name): + return False + return True + return False + +def CreateWrapper(target_list, target_dicts, data, params): + """Initialize targets for the ninja wrapper. + + This sets up the necessary variables in the targets to generate Xcode projects + that use ninja as an external builder. + Arguments: + target_list: List of target pairs: 'base/base.gyp:base'. + target_dicts: Dict of target properties keyed on target pair. + data: Dict of flattened build files keyed on gyp path. + params: Dict of global options for gyp. + """ + orig_gyp = params['build_files'][0] + for gyp_name, gyp_dict in data.iteritems(): + if gyp_name == orig_gyp: + depth = gyp_dict['_DEPTH'] + + # Check for custom main gyp name, otherwise use the default CHROMIUM_GYP_FILE + # and prepend .ninja before the .gyp extension. + generator_flags = params.get('generator_flags', {}) + main_gyp = generator_flags.get('xcode_ninja_main_gyp', None) + if main_gyp is None: + (build_file_root, build_file_ext) = os.path.splitext(orig_gyp) + main_gyp = build_file_root + ".ninja" + build_file_ext + + # Create new |target_list|, |target_dicts| and |data| data structures. + new_target_list = [] + new_target_dicts = {} + new_data = {} + + # Set base keys needed for |data|. + new_data[main_gyp] = {} + new_data[main_gyp]['included_files'] = [] + new_data[main_gyp]['targets'] = [] + new_data[main_gyp]['xcode_settings'] = \ + data[orig_gyp].get('xcode_settings', {}) + + # Normally the xcode-ninja generator includes only valid executable targets. + # If |xcode_ninja_executable_target_pattern| is set, that list is reduced to + # executable targets that match the pattern. (Default all) + executable_target_pattern = \ + generator_flags.get('xcode_ninja_executable_target_pattern', None) + + # For including other non-executable targets, add the matching target name + # to the |xcode_ninja_target_pattern| regular expression. (Default none) + target_extras = generator_flags.get('xcode_ninja_target_pattern', None) + + for old_qualified_target in target_list: + spec = target_dicts[old_qualified_target] + if IsValidTargetForWrapper(target_extras, executable_target_pattern, spec): + # Add to new_target_list. + target_name = spec.get('target_name') + new_target_name = '%s:%s#target' % (main_gyp, target_name) + new_target_list.append(new_target_name) + + # Add to new_target_dicts. + new_target_dicts[new_target_name] = _TargetFromSpec(spec, params) + + # Add to new_data. + for old_target in data[old_qualified_target.split(':')[0]]['targets']: + if old_target['target_name'] == target_name: + new_data_target = {} + new_data_target['target_name'] = old_target['target_name'] + new_data_target['toolset'] = old_target['toolset'] + new_data[main_gyp]['targets'].append(new_data_target) + + # Create sources target. + sources_target_name = 'sources_for_indexing' + sources_target = _TargetFromSpec( + { 'target_name' : sources_target_name, + 'toolset': 'target', + 'default_configuration': 'Default', + 'mac_bundle': '0', + 'type': 'executable' + }, None) + + # Tell Xcode to look everywhere for headers. + sources_target['configurations'] = {'Default': { 'include_dirs': [ depth ] } } + + sources = [] + for target, target_dict in target_dicts.iteritems(): + base = os.path.dirname(target) + files = target_dict.get('sources', []) + \ + target_dict.get('mac_bundle_resources', []) + for action in target_dict.get('actions', []): + files.extend(action.get('inputs', [])) + # Remove files starting with $. These are mostly intermediate files for the + # build system. + files = [ file for file in files if not file.startswith('$')] + + # Make sources relative to root build file. + relative_path = os.path.dirname(main_gyp) + sources += [ os.path.relpath(os.path.join(base, file), relative_path) + for file in files ] + + sources_target['sources'] = sorted(set(sources)) + + # Put sources_to_index in it's own gyp. + sources_gyp = \ + os.path.join(os.path.dirname(main_gyp), sources_target_name + ".gyp") + fully_qualified_target_name = \ + '%s:%s#target' % (sources_gyp, sources_target_name) + + # Add to new_target_list, new_target_dicts and new_data. + new_target_list.append(fully_qualified_target_name) + new_target_dicts[fully_qualified_target_name] = sources_target + new_data_target = {} + new_data_target['target_name'] = sources_target['target_name'] + new_data_target['_DEPTH'] = depth + new_data_target['toolset'] = "target" + new_data[sources_gyp] = {} + new_data[sources_gyp]['targets'] = [] + new_data[sources_gyp]['included_files'] = [] + new_data[sources_gyp]['xcode_settings'] = \ + data[orig_gyp].get('xcode_settings', {}) + new_data[sources_gyp]['targets'].append(new_data_target) + + # Write workspace to file. + _WriteWorkspace(main_gyp, sources_gyp, params) + return (new_target_list, new_target_dicts, new_data) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py new file mode 100644 index 00000000..d08b7f77 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py @@ -0,0 +1,2927 @@ +# Copyright (c) 2012 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Xcode project file generator. + +This module is both an Xcode project file generator and a documentation of the +Xcode project file format. Knowledge of the project file format was gained +based on extensive experience with Xcode, and by making changes to projects in +Xcode.app and observing the resultant changes in the associated project files. + +XCODE PROJECT FILES + +The generator targets the file format as written by Xcode 3.2 (specifically, +3.2.6), but past experience has taught that the format has not changed +significantly in the past several years, and future versions of Xcode are able +to read older project files. + +Xcode project files are "bundled": the project "file" from an end-user's +perspective is actually a directory with an ".xcodeproj" extension. The +project file from this module's perspective is actually a file inside this +directory, always named "project.pbxproj". This file contains a complete +description of the project and is all that is needed to use the xcodeproj. +Other files contained in the xcodeproj directory are simply used to store +per-user settings, such as the state of various UI elements in the Xcode +application. + +The project.pbxproj file is a property list, stored in a format almost +identical to the NeXTstep property list format. The file is able to carry +Unicode data, and is encoded in UTF-8. The root element in the property list +is a dictionary that contains several properties of minimal interest, and two +properties of immense interest. The most important property is a dictionary +named "objects". The entire structure of the project is represented by the +children of this property. The objects dictionary is keyed by unique 96-bit +values represented by 24 uppercase hexadecimal characters. Each value in the +objects dictionary is itself a dictionary, describing an individual object. + +Each object in the dictionary is a member of a class, which is identified by +the "isa" property of each object. A variety of classes are represented in a +project file. Objects can refer to other objects by ID, using the 24-character +hexadecimal object key. A project's objects form a tree, with a root object +of class PBXProject at the root. As an example, the PBXProject object serves +as parent to an XCConfigurationList object defining the build configurations +used in the project, a PBXGroup object serving as a container for all files +referenced in the project, and a list of target objects, each of which defines +a target in the project. There are several different types of target object, +such as PBXNativeTarget and PBXAggregateTarget. In this module, this +relationship is expressed by having each target type derive from an abstract +base named XCTarget. + +The project.pbxproj file's root dictionary also contains a property, sibling to +the "objects" dictionary, named "rootObject". The value of rootObject is a +24-character object key referring to the root PBXProject object in the +objects dictionary. + +In Xcode, every file used as input to a target or produced as a final product +of a target must appear somewhere in the hierarchy rooted at the PBXGroup +object referenced by the PBXProject's mainGroup property. A PBXGroup is +generally represented as a folder in the Xcode application. PBXGroups can +contain other PBXGroups as well as PBXFileReferences, which are pointers to +actual files. + +Each XCTarget contains a list of build phases, represented in this module by +the abstract base XCBuildPhase. Examples of concrete XCBuildPhase derivations +are PBXSourcesBuildPhase and PBXFrameworksBuildPhase, which correspond to the +"Compile Sources" and "Link Binary With Libraries" phases displayed in the +Xcode application. Files used as input to these phases (for example, source +files in the former case and libraries and frameworks in the latter) are +represented by PBXBuildFile objects, referenced by elements of "files" lists +in XCTarget objects. Each PBXBuildFile object refers to a PBXBuildFile +object as a "weak" reference: it does not "own" the PBXBuildFile, which is +owned by the root object's mainGroup or a descendant group. In most cases, the +layer of indirection between an XCBuildPhase and a PBXFileReference via a +PBXBuildFile appears extraneous, but there's actually one reason for this: +file-specific compiler flags are added to the PBXBuildFile object so as to +allow a single file to be a member of multiple targets while having distinct +compiler flags for each. These flags can be modified in the Xcode applciation +in the "Build" tab of a File Info window. + +When a project is open in the Xcode application, Xcode will rewrite it. As +such, this module is careful to adhere to the formatting used by Xcode, to +avoid insignificant changes appearing in the file when it is used in the +Xcode application. This will keep version control repositories happy, and +makes it possible to compare a project file used in Xcode to one generated by +this module to determine if any significant changes were made in the +application. + +Xcode has its own way of assigning 24-character identifiers to each object, +which is not duplicated here. Because the identifier only is only generated +once, when an object is created, and is then left unchanged, there is no need +to attempt to duplicate Xcode's behavior in this area. The generator is free +to select any identifier, even at random, to refer to the objects it creates, +and Xcode will retain those identifiers and use them when subsequently +rewriting the project file. However, the generator would choose new random +identifiers each time the project files are generated, leading to difficulties +comparing "used" project files to "pristine" ones produced by this module, +and causing the appearance of changes as every object identifier is changed +when updated projects are checked in to a version control repository. To +mitigate this problem, this module chooses identifiers in a more deterministic +way, by hashing a description of each object as well as its parent and ancestor +objects. This strategy should result in minimal "shift" in IDs as successive +generations of project files are produced. + +THIS MODULE + +This module introduces several classes, all derived from the XCObject class. +Nearly all of the "brains" are built into the XCObject class, which understands +how to create and modify objects, maintain the proper tree structure, compute +identifiers, and print objects. For the most part, classes derived from +XCObject need only provide a _schema class object, a dictionary that +expresses what properties objects of the class may contain. + +Given this structure, it's possible to build a minimal project file by creating +objects of the appropriate types and making the proper connections: + + config_list = XCConfigurationList() + group = PBXGroup() + project = PBXProject({'buildConfigurationList': config_list, + 'mainGroup': group}) + +With the project object set up, it can be added to an XCProjectFile object. +XCProjectFile is a pseudo-class in the sense that it is a concrete XCObject +subclass that does not actually correspond to a class type found in a project +file. Rather, it is used to represent the project file's root dictionary. +Printing an XCProjectFile will print the entire project file, including the +full "objects" dictionary. + + project_file = XCProjectFile({'rootObject': project}) + project_file.ComputeIDs() + project_file.Print() + +Xcode project files are always encoded in UTF-8. This module will accept +strings of either the str class or the unicode class. Strings of class str +are assumed to already be encoded in UTF-8. Obviously, if you're just using +ASCII, you won't encounter difficulties because ASCII is a UTF-8 subset. +Strings of class unicode are handled properly and encoded in UTF-8 when +a project file is output. +""" + +import gyp.common +import posixpath +import re +import struct +import sys + +# hashlib is supplied as of Python 2.5 as the replacement interface for sha +# and other secure hashes. In 2.6, sha is deprecated. Import hashlib if +# available, avoiding a deprecation warning under 2.6. Import sha otherwise, +# preserving 2.4 compatibility. +try: + import hashlib + _new_sha1 = hashlib.sha1 +except ImportError: + import sha + _new_sha1 = sha.new + + +# See XCObject._EncodeString. This pattern is used to determine when a string +# can be printed unquoted. Strings that match this pattern may be printed +# unquoted. Strings that do not match must be quoted and may be further +# transformed to be properly encoded. Note that this expression matches the +# characters listed with "+", for 1 or more occurrences: if a string is empty, +# it must not match this pattern, because it needs to be encoded as "". +_unquoted = re.compile('^[A-Za-z0-9$./_]+$') + +# Strings that match this pattern are quoted regardless of what _unquoted says. +# Oddly, Xcode will quote any string with a run of three or more underscores. +_quoted = re.compile('___') + +# This pattern should match any character that needs to be escaped by +# XCObject._EncodeString. See that function. +_escaped = re.compile('[\\\\"]|[\x00-\x1f]') + + +# Used by SourceTreeAndPathFromPath +_path_leading_variable = re.compile(r'^\$\((.*?)\)(/(.*))?$') + +def SourceTreeAndPathFromPath(input_path): + """Given input_path, returns a tuple with sourceTree and path values. + + Examples: + input_path (source_tree, output_path) + '$(VAR)/path' ('VAR', 'path') + '$(VAR)' ('VAR', None) + 'path' (None, 'path') + """ + + source_group_match = _path_leading_variable.match(input_path) + if source_group_match: + source_tree = source_group_match.group(1) + output_path = source_group_match.group(3) # This may be None. + else: + source_tree = None + output_path = input_path + + return (source_tree, output_path) + +def ConvertVariablesToShellSyntax(input_string): + return re.sub(r'\$\((.*?)\)', '${\\1}', input_string) + +class XCObject(object): + """The abstract base of all class types used in Xcode project files. + + Class variables: + _schema: A dictionary defining the properties of this class. The keys to + _schema are string property keys as used in project files. Values + are a list of four or five elements: + [ is_list, property_type, is_strong, is_required, default ] + is_list: True if the property described is a list, as opposed + to a single element. + property_type: The type to use as the value of the property, + or if is_list is True, the type to use for each + element of the value's list. property_type must + be an XCObject subclass, or one of the built-in + types str, int, or dict. + is_strong: If property_type is an XCObject subclass, is_strong + is True to assert that this class "owns," or serves + as parent, to the property value (or, if is_list is + True, values). is_strong must be False if + property_type is not an XCObject subclass. + is_required: True if the property is required for the class. + Note that is_required being True does not preclude + an empty string ("", in the case of property_type + str) or list ([], in the case of is_list True) from + being set for the property. + default: Optional. If is_requried is True, default may be set + to provide a default value for objects that do not supply + their own value. If is_required is True and default + is not provided, users of the class must supply their own + value for the property. + Note that although the values of the array are expressed in + boolean terms, subclasses provide values as integers to conserve + horizontal space. + _should_print_single_line: False in XCObject. Subclasses whose objects + should be written to the project file in the + alternate single-line format, such as + PBXFileReference and PBXBuildFile, should + set this to True. + _encode_transforms: Used by _EncodeString to encode unprintable characters. + The index into this list is the ordinal of the + character to transform; each value is a string + used to represent the character in the output. XCObject + provides an _encode_transforms list suitable for most + XCObject subclasses. + _alternate_encode_transforms: Provided for subclasses that wish to use + the alternate encoding rules. Xcode seems + to use these rules when printing objects in + single-line format. Subclasses that desire + this behavior should set _encode_transforms + to _alternate_encode_transforms. + _hashables: A list of XCObject subclasses that can be hashed by ComputeIDs + to construct this object's ID. Most classes that need custom + hashing behavior should do it by overriding Hashables, + but in some cases an object's parent may wish to push a + hashable value into its child, and it can do so by appending + to _hashables. + Attributes: + id: The object's identifier, a 24-character uppercase hexadecimal string. + Usually, objects being created should not set id until the entire + project file structure is built. At that point, UpdateIDs() should + be called on the root object to assign deterministic values for id to + each object in the tree. + parent: The object's parent. This is set by a parent XCObject when a child + object is added to it. + _properties: The object's property dictionary. An object's properties are + described by its class' _schema variable. + """ + + _schema = {} + _should_print_single_line = False + + # See _EncodeString. + _encode_transforms = [] + i = 0 + while i < ord(' '): + _encode_transforms.append('\\U%04x' % i) + i = i + 1 + _encode_transforms[7] = '\\a' + _encode_transforms[8] = '\\b' + _encode_transforms[9] = '\\t' + _encode_transforms[10] = '\\n' + _encode_transforms[11] = '\\v' + _encode_transforms[12] = '\\f' + _encode_transforms[13] = '\\n' + + _alternate_encode_transforms = list(_encode_transforms) + _alternate_encode_transforms[9] = chr(9) + _alternate_encode_transforms[10] = chr(10) + _alternate_encode_transforms[11] = chr(11) + + def __init__(self, properties=None, id=None, parent=None): + self.id = id + self.parent = parent + self._properties = {} + self._hashables = [] + self._SetDefaultsFromSchema() + self.UpdateProperties(properties) + + def __repr__(self): + try: + name = self.Name() + except NotImplementedError: + return '<%s at 0x%x>' % (self.__class__.__name__, id(self)) + return '<%s %r at 0x%x>' % (self.__class__.__name__, name, id(self)) + + def Copy(self): + """Make a copy of this object. + + The new object will have its own copy of lists and dicts. Any XCObject + objects owned by this object (marked "strong") will be copied in the + new object, even those found in lists. If this object has any weak + references to other XCObjects, the same references are added to the new + object without making a copy. + """ + + that = self.__class__(id=self.id, parent=self.parent) + for key, value in self._properties.iteritems(): + is_strong = self._schema[key][2] + + if isinstance(value, XCObject): + if is_strong: + new_value = value.Copy() + new_value.parent = that + that._properties[key] = new_value + else: + that._properties[key] = value + elif isinstance(value, str) or isinstance(value, unicode) or \ + isinstance(value, int): + that._properties[key] = value + elif isinstance(value, list): + if is_strong: + # If is_strong is True, each element is an XCObject, so it's safe to + # call Copy. + that._properties[key] = [] + for item in value: + new_item = item.Copy() + new_item.parent = that + that._properties[key].append(new_item) + else: + that._properties[key] = value[:] + elif isinstance(value, dict): + # dicts are never strong. + if is_strong: + raise TypeError('Strong dict for key ' + key + ' in ' + \ + self.__class__.__name__) + else: + that._properties[key] = value.copy() + else: + raise TypeError('Unexpected type ' + value.__class__.__name__ + \ + ' for key ' + key + ' in ' + self.__class__.__name__) + + return that + + def Name(self): + """Return the name corresponding to an object. + + Not all objects necessarily need to be nameable, and not all that do have + a "name" property. Override as needed. + """ + + # If the schema indicates that "name" is required, try to access the + # property even if it doesn't exist. This will result in a KeyError + # being raised for the property that should be present, which seems more + # appropriate than NotImplementedError in this case. + if 'name' in self._properties or \ + ('name' in self._schema and self._schema['name'][3]): + return self._properties['name'] + + raise NotImplementedError(self.__class__.__name__ + ' must implement Name') + + def Comment(self): + """Return a comment string for the object. + + Most objects just use their name as the comment, but PBXProject uses + different values. + + The returned comment is not escaped and does not have any comment marker + strings applied to it. + """ + + return self.Name() + + def Hashables(self): + hashables = [self.__class__.__name__] + + name = self.Name() + if name != None: + hashables.append(name) + + hashables.extend(self._hashables) + + return hashables + + def HashablesForChild(self): + return None + + def ComputeIDs(self, recursive=True, overwrite=True, seed_hash=None): + """Set "id" properties deterministically. + + An object's "id" property is set based on a hash of its class type and + name, as well as the class type and name of all ancestor objects. As + such, it is only advisable to call ComputeIDs once an entire project file + tree is built. + + If recursive is True, recurse into all descendant objects and update their + hashes. + + If overwrite is True, any existing value set in the "id" property will be + replaced. + """ + + def _HashUpdate(hash, data): + """Update hash with data's length and contents. + + If the hash were updated only with the value of data, it would be + possible for clowns to induce collisions by manipulating the names of + their objects. By adding the length, it's exceedingly less likely that + ID collisions will be encountered, intentionally or not. + """ + + hash.update(struct.pack('>i', len(data))) + hash.update(data) + + if seed_hash is None: + seed_hash = _new_sha1() + + hash = seed_hash.copy() + + hashables = self.Hashables() + assert len(hashables) > 0 + for hashable in hashables: + _HashUpdate(hash, hashable) + + if recursive: + hashables_for_child = self.HashablesForChild() + if hashables_for_child is None: + child_hash = hash + else: + assert len(hashables_for_child) > 0 + child_hash = seed_hash.copy() + for hashable in hashables_for_child: + _HashUpdate(child_hash, hashable) + + for child in self.Children(): + child.ComputeIDs(recursive, overwrite, child_hash) + + if overwrite or self.id is None: + # Xcode IDs are only 96 bits (24 hex characters), but a SHA-1 digest is + # is 160 bits. Instead of throwing out 64 bits of the digest, xor them + # into the portion that gets used. + assert hash.digest_size % 4 == 0 + digest_int_count = hash.digest_size / 4 + digest_ints = struct.unpack('>' + 'I' * digest_int_count, hash.digest()) + id_ints = [0, 0, 0] + for index in xrange(0, digest_int_count): + id_ints[index % 3] ^= digest_ints[index] + self.id = '%08X%08X%08X' % tuple(id_ints) + + def EnsureNoIDCollisions(self): + """Verifies that no two objects have the same ID. Checks all descendants. + """ + + ids = {} + descendants = self.Descendants() + for descendant in descendants: + if descendant.id in ids: + other = ids[descendant.id] + raise KeyError( + 'Duplicate ID %s, objects "%s" and "%s" in "%s"' % \ + (descendant.id, str(descendant._properties), + str(other._properties), self._properties['rootObject'].Name())) + ids[descendant.id] = descendant + + def Children(self): + """Returns a list of all of this object's owned (strong) children.""" + + children = [] + for property, attributes in self._schema.iteritems(): + (is_list, property_type, is_strong) = attributes[0:3] + if is_strong and property in self._properties: + if not is_list: + children.append(self._properties[property]) + else: + children.extend(self._properties[property]) + return children + + def Descendants(self): + """Returns a list of all of this object's descendants, including this + object. + """ + + children = self.Children() + descendants = [self] + for child in children: + descendants.extend(child.Descendants()) + return descendants + + def PBXProjectAncestor(self): + # The base case for recursion is defined at PBXProject.PBXProjectAncestor. + if self.parent: + return self.parent.PBXProjectAncestor() + return None + + def _EncodeComment(self, comment): + """Encodes a comment to be placed in the project file output, mimicing + Xcode behavior. + """ + + # This mimics Xcode behavior by wrapping the comment in "/*" and "*/". If + # the string already contains a "*/", it is turned into "(*)/". This keeps + # the file writer from outputting something that would be treated as the + # end of a comment in the middle of something intended to be entirely a + # comment. + + return '/* ' + comment.replace('*/', '(*)/') + ' */' + + def _EncodeTransform(self, match): + # This function works closely with _EncodeString. It will only be called + # by re.sub with match.group(0) containing a character matched by the + # the _escaped expression. + char = match.group(0) + + # Backslashes (\) and quotation marks (") are always replaced with a + # backslash-escaped version of the same. Everything else gets its + # replacement from the class' _encode_transforms array. + if char == '\\': + return '\\\\' + if char == '"': + return '\\"' + return self._encode_transforms[ord(char)] + + def _EncodeString(self, value): + """Encodes a string to be placed in the project file output, mimicing + Xcode behavior. + """ + + # Use quotation marks when any character outside of the range A-Z, a-z, 0-9, + # $ (dollar sign), . (period), and _ (underscore) is present. Also use + # quotation marks to represent empty strings. + # + # Escape " (double-quote) and \ (backslash) by preceding them with a + # backslash. + # + # Some characters below the printable ASCII range are encoded specially: + # 7 ^G BEL is encoded as "\a" + # 8 ^H BS is encoded as "\b" + # 11 ^K VT is encoded as "\v" + # 12 ^L NP is encoded as "\f" + # 127 ^? DEL is passed through as-is without escaping + # - In PBXFileReference and PBXBuildFile objects: + # 9 ^I HT is passed through as-is without escaping + # 10 ^J NL is passed through as-is without escaping + # 13 ^M CR is passed through as-is without escaping + # - In other objects: + # 9 ^I HT is encoded as "\t" + # 10 ^J NL is encoded as "\n" + # 13 ^M CR is encoded as "\n" rendering it indistinguishable from + # 10 ^J NL + # All other characters within the ASCII control character range (0 through + # 31 inclusive) are encoded as "\U001f" referring to the Unicode code point + # in hexadecimal. For example, character 14 (^N SO) is encoded as "\U000e". + # Characters above the ASCII range are passed through to the output encoded + # as UTF-8 without any escaping. These mappings are contained in the + # class' _encode_transforms list. + + if _unquoted.search(value) and not _quoted.search(value): + return value + + return '"' + _escaped.sub(self._EncodeTransform, value) + '"' + + def _XCPrint(self, file, tabs, line): + file.write('\t' * tabs + line) + + def _XCPrintableValue(self, tabs, value, flatten_list=False): + """Returns a representation of value that may be printed in a project file, + mimicing Xcode's behavior. + + _XCPrintableValue can handle str and int values, XCObjects (which are + made printable by returning their id property), and list and dict objects + composed of any of the above types. When printing a list or dict, and + _should_print_single_line is False, the tabs parameter is used to determine + how much to indent the lines corresponding to the items in the list or + dict. + + If flatten_list is True, single-element lists will be transformed into + strings. + """ + + printable = '' + comment = None + + if self._should_print_single_line: + sep = ' ' + element_tabs = '' + end_tabs = '' + else: + sep = '\n' + element_tabs = '\t' * (tabs + 1) + end_tabs = '\t' * tabs + + if isinstance(value, XCObject): + printable += value.id + comment = value.Comment() + elif isinstance(value, str): + printable += self._EncodeString(value) + elif isinstance(value, unicode): + printable += self._EncodeString(value.encode('utf-8')) + elif isinstance(value, int): + printable += str(value) + elif isinstance(value, list): + if flatten_list and len(value) <= 1: + if len(value) == 0: + printable += self._EncodeString('') + else: + printable += self._EncodeString(value[0]) + else: + printable = '(' + sep + for item in value: + printable += element_tabs + \ + self._XCPrintableValue(tabs + 1, item, flatten_list) + \ + ',' + sep + printable += end_tabs + ')' + elif isinstance(value, dict): + printable = '{' + sep + for item_key, item_value in sorted(value.iteritems()): + printable += element_tabs + \ + self._XCPrintableValue(tabs + 1, item_key, flatten_list) + ' = ' + \ + self._XCPrintableValue(tabs + 1, item_value, flatten_list) + ';' + \ + sep + printable += end_tabs + '}' + else: + raise TypeError("Can't make " + value.__class__.__name__ + ' printable') + + if comment != None: + printable += ' ' + self._EncodeComment(comment) + + return printable + + def _XCKVPrint(self, file, tabs, key, value): + """Prints a key and value, members of an XCObject's _properties dictionary, + to file. + + tabs is an int identifying the indentation level. If the class' + _should_print_single_line variable is True, tabs is ignored and the + key-value pair will be followed by a space insead of a newline. + """ + + if self._should_print_single_line: + printable = '' + after_kv = ' ' + else: + printable = '\t' * tabs + after_kv = '\n' + + # Xcode usually prints remoteGlobalIDString values in PBXContainerItemProxy + # objects without comments. Sometimes it prints them with comments, but + # the majority of the time, it doesn't. To avoid unnecessary changes to + # the project file after Xcode opens it, don't write comments for + # remoteGlobalIDString. This is a sucky hack and it would certainly be + # cleaner to extend the schema to indicate whether or not a comment should + # be printed, but since this is the only case where the problem occurs and + # Xcode itself can't seem to make up its mind, the hack will suffice. + # + # Also see PBXContainerItemProxy._schema['remoteGlobalIDString']. + if key == 'remoteGlobalIDString' and isinstance(self, + PBXContainerItemProxy): + value_to_print = value.id + else: + value_to_print = value + + # PBXBuildFile's settings property is represented in the output as a dict, + # but a hack here has it represented as a string. Arrange to strip off the + # quotes so that it shows up in the output as expected. + if key == 'settings' and isinstance(self, PBXBuildFile): + strip_value_quotes = True + else: + strip_value_quotes = False + + # In another one-off, let's set flatten_list on buildSettings properties + # of XCBuildConfiguration objects, because that's how Xcode treats them. + if key == 'buildSettings' and isinstance(self, XCBuildConfiguration): + flatten_list = True + else: + flatten_list = False + + try: + printable_key = self._XCPrintableValue(tabs, key, flatten_list) + printable_value = self._XCPrintableValue(tabs, value_to_print, + flatten_list) + if strip_value_quotes and len(printable_value) > 1 and \ + printable_value[0] == '"' and printable_value[-1] == '"': + printable_value = printable_value[1:-1] + printable += printable_key + ' = ' + printable_value + ';' + after_kv + except TypeError, e: + gyp.common.ExceptionAppend(e, + 'while printing key "%s"' % key) + raise + + self._XCPrint(file, 0, printable) + + def Print(self, file=sys.stdout): + """Prints a reprentation of this object to file, adhering to Xcode output + formatting. + """ + + self.VerifyHasRequiredProperties() + + if self._should_print_single_line: + # When printing an object in a single line, Xcode doesn't put any space + # between the beginning of a dictionary (or presumably a list) and the + # first contained item, so you wind up with snippets like + # ...CDEF = {isa = PBXFileReference; fileRef = 0123... + # If it were me, I would have put a space in there after the opening + # curly, but I guess this is just another one of those inconsistencies + # between how Xcode prints PBXFileReference and PBXBuildFile objects as + # compared to other objects. Mimic Xcode's behavior here by using an + # empty string for sep. + sep = '' + end_tabs = 0 + else: + sep = '\n' + end_tabs = 2 + + # Start the object. For example, '\t\tPBXProject = {\n'. + self._XCPrint(file, 2, self._XCPrintableValue(2, self) + ' = {' + sep) + + # "isa" isn't in the _properties dictionary, it's an intrinsic property + # of the class which the object belongs to. Xcode always outputs "isa" + # as the first element of an object dictionary. + self._XCKVPrint(file, 3, 'isa', self.__class__.__name__) + + # The remaining elements of an object dictionary are sorted alphabetically. + for property, value in sorted(self._properties.iteritems()): + self._XCKVPrint(file, 3, property, value) + + # End the object. + self._XCPrint(file, end_tabs, '};\n') + + def UpdateProperties(self, properties, do_copy=False): + """Merge the supplied properties into the _properties dictionary. + + The input properties must adhere to the class schema or a KeyError or + TypeError exception will be raised. If adding an object of an XCObject + subclass and the schema indicates a strong relationship, the object's + parent will be set to this object. + + If do_copy is True, then lists, dicts, strong-owned XCObjects, and + strong-owned XCObjects in lists will be copied instead of having their + references added. + """ + + if properties is None: + return + + for property, value in properties.iteritems(): + # Make sure the property is in the schema. + if not property in self._schema: + raise KeyError(property + ' not in ' + self.__class__.__name__) + + # Make sure the property conforms to the schema. + (is_list, property_type, is_strong) = self._schema[property][0:3] + if is_list: + if value.__class__ != list: + raise TypeError( + property + ' of ' + self.__class__.__name__ + \ + ' must be list, not ' + value.__class__.__name__) + for item in value: + if not isinstance(item, property_type) and \ + not (item.__class__ == unicode and property_type == str): + # Accept unicode where str is specified. str is treated as + # UTF-8-encoded. + raise TypeError( + 'item of ' + property + ' of ' + self.__class__.__name__ + \ + ' must be ' + property_type.__name__ + ', not ' + \ + item.__class__.__name__) + elif not isinstance(value, property_type) and \ + not (value.__class__ == unicode and property_type == str): + # Accept unicode where str is specified. str is treated as + # UTF-8-encoded. + raise TypeError( + property + ' of ' + self.__class__.__name__ + ' must be ' + \ + property_type.__name__ + ', not ' + value.__class__.__name__) + + # Checks passed, perform the assignment. + if do_copy: + if isinstance(value, XCObject): + if is_strong: + self._properties[property] = value.Copy() + else: + self._properties[property] = value + elif isinstance(value, str) or isinstance(value, unicode) or \ + isinstance(value, int): + self._properties[property] = value + elif isinstance(value, list): + if is_strong: + # If is_strong is True, each element is an XCObject, so it's safe + # to call Copy. + self._properties[property] = [] + for item in value: + self._properties[property].append(item.Copy()) + else: + self._properties[property] = value[:] + elif isinstance(value, dict): + self._properties[property] = value.copy() + else: + raise TypeError("Don't know how to copy a " + \ + value.__class__.__name__ + ' object for ' + \ + property + ' in ' + self.__class__.__name__) + else: + self._properties[property] = value + + # Set up the child's back-reference to this object. Don't use |value| + # any more because it may not be right if do_copy is true. + if is_strong: + if not is_list: + self._properties[property].parent = self + else: + for item in self._properties[property]: + item.parent = self + + def HasProperty(self, key): + return key in self._properties + + def GetProperty(self, key): + return self._properties[key] + + def SetProperty(self, key, value): + self.UpdateProperties({key: value}) + + def DelProperty(self, key): + if key in self._properties: + del self._properties[key] + + def AppendProperty(self, key, value): + # TODO(mark): Support ExtendProperty too (and make this call that)? + + # Schema validation. + if not key in self._schema: + raise KeyError(key + ' not in ' + self.__class__.__name__) + + (is_list, property_type, is_strong) = self._schema[key][0:3] + if not is_list: + raise TypeError(key + ' of ' + self.__class__.__name__ + ' must be list') + if not isinstance(value, property_type): + raise TypeError('item of ' + key + ' of ' + self.__class__.__name__ + \ + ' must be ' + property_type.__name__ + ', not ' + \ + value.__class__.__name__) + + # If the property doesn't exist yet, create a new empty list to receive the + # item. + if not key in self._properties: + self._properties[key] = [] + + # Set up the ownership link. + if is_strong: + value.parent = self + + # Store the item. + self._properties[key].append(value) + + def VerifyHasRequiredProperties(self): + """Ensure that all properties identified as required by the schema are + set. + """ + + # TODO(mark): A stronger verification mechanism is needed. Some + # subclasses need to perform validation beyond what the schema can enforce. + for property, attributes in self._schema.iteritems(): + (is_list, property_type, is_strong, is_required) = attributes[0:4] + if is_required and not property in self._properties: + raise KeyError(self.__class__.__name__ + ' requires ' + property) + + def _SetDefaultsFromSchema(self): + """Assign object default values according to the schema. This will not + overwrite properties that have already been set.""" + + defaults = {} + for property, attributes in self._schema.iteritems(): + (is_list, property_type, is_strong, is_required) = attributes[0:4] + if is_required and len(attributes) >= 5 and \ + not property in self._properties: + default = attributes[4] + + defaults[property] = default + + if len(defaults) > 0: + # Use do_copy=True so that each new object gets its own copy of strong + # objects, lists, and dicts. + self.UpdateProperties(defaults, do_copy=True) + + +class XCHierarchicalElement(XCObject): + """Abstract base for PBXGroup and PBXFileReference. Not represented in a + project file.""" + + # TODO(mark): Do name and path belong here? Probably so. + # If path is set and name is not, name may have a default value. Name will + # be set to the basename of path, if the basename of path is different from + # the full value of path. If path is already just a leaf name, name will + # not be set. + _schema = XCObject._schema.copy() + _schema.update({ + 'comments': [0, str, 0, 0], + 'fileEncoding': [0, str, 0, 0], + 'includeInIndex': [0, int, 0, 0], + 'indentWidth': [0, int, 0, 0], + 'lineEnding': [0, int, 0, 0], + 'sourceTree': [0, str, 0, 1, ''], + 'tabWidth': [0, int, 0, 0], + 'usesTabs': [0, int, 0, 0], + 'wrapsLines': [0, int, 0, 0], + }) + + def __init__(self, properties=None, id=None, parent=None): + # super + XCObject.__init__(self, properties, id, parent) + if 'path' in self._properties and not 'name' in self._properties: + path = self._properties['path'] + name = posixpath.basename(path) + if name != '' and path != name: + self.SetProperty('name', name) + + if 'path' in self._properties and \ + (not 'sourceTree' in self._properties or \ + self._properties['sourceTree'] == ''): + # If the pathname begins with an Xcode variable like "$(SDKROOT)/", take + # the variable out and make the path be relative to that variable by + # assigning the variable name as the sourceTree. + (source_tree, path) = SourceTreeAndPathFromPath(self._properties['path']) + if source_tree != None: + self._properties['sourceTree'] = source_tree + if path != None: + self._properties['path'] = path + if source_tree != None and path is None and \ + not 'name' in self._properties: + # The path was of the form "$(SDKROOT)" with no path following it. + # This object is now relative to that variable, so it has no path + # attribute of its own. It does, however, keep a name. + del self._properties['path'] + self._properties['name'] = source_tree + + def Name(self): + if 'name' in self._properties: + return self._properties['name'] + elif 'path' in self._properties: + return self._properties['path'] + else: + # This happens in the case of the root PBXGroup. + return None + + def Hashables(self): + """Custom hashables for XCHierarchicalElements. + + XCHierarchicalElements are special. Generally, their hashes shouldn't + change if the paths don't change. The normal XCObject implementation of + Hashables adds a hashable for each object, which means that if + the hierarchical structure changes (possibly due to changes caused when + TakeOverOnlyChild runs and encounters slight changes in the hierarchy), + the hashes will change. For example, if a project file initially contains + a/b/f1 and a/b becomes collapsed into a/b, f1 will have a single parent + a/b. If someone later adds a/f2 to the project file, a/b can no longer be + collapsed, and f1 winds up with parent b and grandparent a. That would + be sufficient to change f1's hash. + + To counteract this problem, hashables for all XCHierarchicalElements except + for the main group (which has neither a name nor a path) are taken to be + just the set of path components. Because hashables are inherited from + parents, this provides assurance that a/b/f1 has the same set of hashables + whether its parent is b or a/b. + + The main group is a special case. As it is permitted to have no name or + path, it is permitted to use the standard XCObject hash mechanism. This + is not considered a problem because there can be only one main group. + """ + + if self == self.PBXProjectAncestor()._properties['mainGroup']: + # super + return XCObject.Hashables(self) + + hashables = [] + + # Put the name in first, ensuring that if TakeOverOnlyChild collapses + # children into a top-level group like "Source", the name always goes + # into the list of hashables without interfering with path components. + if 'name' in self._properties: + # Make it less likely for people to manipulate hashes by following the + # pattern of always pushing an object type value onto the list first. + hashables.append(self.__class__.__name__ + '.name') + hashables.append(self._properties['name']) + + # NOTE: This still has the problem that if an absolute path is encountered, + # including paths with a sourceTree, they'll still inherit their parents' + # hashables, even though the paths aren't relative to their parents. This + # is not expected to be much of a problem in practice. + path = self.PathFromSourceTreeAndPath() + if path != None: + components = path.split(posixpath.sep) + for component in components: + hashables.append(self.__class__.__name__ + '.path') + hashables.append(component) + + hashables.extend(self._hashables) + + return hashables + + def Compare(self, other): + # Allow comparison of these types. PBXGroup has the highest sort rank; + # PBXVariantGroup is treated as equal to PBXFileReference. + valid_class_types = { + PBXFileReference: 'file', + PBXGroup: 'group', + PBXVariantGroup: 'file', + } + self_type = valid_class_types[self.__class__] + other_type = valid_class_types[other.__class__] + + if self_type == other_type: + # If the two objects are of the same sort rank, compare their names. + return cmp(self.Name(), other.Name()) + + # Otherwise, sort groups before everything else. + if self_type == 'group': + return -1 + return 1 + + def CompareRootGroup(self, other): + # This function should be used only to compare direct children of the + # containing PBXProject's mainGroup. These groups should appear in the + # listed order. + # TODO(mark): "Build" is used by gyp.generator.xcode, perhaps the + # generator should have a way of influencing this list rather than having + # to hardcode for the generator here. + order = ['Source', 'Intermediates', 'Projects', 'Frameworks', 'Products', + 'Build'] + + # If the groups aren't in the listed order, do a name comparison. + # Otherwise, groups in the listed order should come before those that + # aren't. + self_name = self.Name() + other_name = other.Name() + self_in = isinstance(self, PBXGroup) and self_name in order + other_in = isinstance(self, PBXGroup) and other_name in order + if not self_in and not other_in: + return self.Compare(other) + if self_name in order and not other_name in order: + return -1 + if other_name in order and not self_name in order: + return 1 + + # If both groups are in the listed order, go by the defined order. + self_index = order.index(self_name) + other_index = order.index(other_name) + if self_index < other_index: + return -1 + if self_index > other_index: + return 1 + return 0 + + def PathFromSourceTreeAndPath(self): + # Turn the object's sourceTree and path properties into a single flat + # string of a form comparable to the path parameter. If there's a + # sourceTree property other than "", wrap it in $(...) for the + # comparison. + components = [] + if self._properties['sourceTree'] != '': + components.append('$(' + self._properties['sourceTree'] + ')') + if 'path' in self._properties: + components.append(self._properties['path']) + + if len(components) > 0: + return posixpath.join(*components) + + return None + + def FullPath(self): + # Returns a full path to self relative to the project file, or relative + # to some other source tree. Start with self, and walk up the chain of + # parents prepending their paths, if any, until no more parents are + # available (project-relative path) or until a path relative to some + # source tree is found. + xche = self + path = None + while isinstance(xche, XCHierarchicalElement) and \ + (path is None or \ + (not path.startswith('/') and not path.startswith('$'))): + this_path = xche.PathFromSourceTreeAndPath() + if this_path != None and path != None: + path = posixpath.join(this_path, path) + elif this_path != None: + path = this_path + xche = xche.parent + + return path + + +class PBXGroup(XCHierarchicalElement): + """ + Attributes: + _children_by_path: Maps pathnames of children of this PBXGroup to the + actual child XCHierarchicalElement objects. + _variant_children_by_name_and_path: Maps (name, path) tuples of + PBXVariantGroup children to the actual child PBXVariantGroup objects. + """ + + _schema = XCHierarchicalElement._schema.copy() + _schema.update({ + 'children': [1, XCHierarchicalElement, 1, 1, []], + 'name': [0, str, 0, 0], + 'path': [0, str, 0, 0], + }) + + def __init__(self, properties=None, id=None, parent=None): + # super + XCHierarchicalElement.__init__(self, properties, id, parent) + self._children_by_path = {} + self._variant_children_by_name_and_path = {} + for child in self._properties.get('children', []): + self._AddChildToDicts(child) + + def Hashables(self): + # super + hashables = XCHierarchicalElement.Hashables(self) + + # It is not sufficient to just rely on name and parent to build a unique + # hashable : a node could have two child PBXGroup sharing a common name. + # To add entropy the hashable is enhanced with the names of all its + # children. + for child in self._properties.get('children', []): + child_name = child.Name() + if child_name != None: + hashables.append(child_name) + + return hashables + + def HashablesForChild(self): + # To avoid a circular reference the hashables used to compute a child id do + # not include the child names. + return XCHierarchicalElement.Hashables(self) + + def _AddChildToDicts(self, child): + # Sets up this PBXGroup object's dicts to reference the child properly. + child_path = child.PathFromSourceTreeAndPath() + if child_path: + if child_path in self._children_by_path: + raise ValueError('Found multiple children with path ' + child_path) + self._children_by_path[child_path] = child + + if isinstance(child, PBXVariantGroup): + child_name = child._properties.get('name', None) + key = (child_name, child_path) + if key in self._variant_children_by_name_and_path: + raise ValueError('Found multiple PBXVariantGroup children with ' + \ + 'name ' + str(child_name) + ' and path ' + \ + str(child_path)) + self._variant_children_by_name_and_path[key] = child + + def AppendChild(self, child): + # Callers should use this instead of calling + # AppendProperty('children', child) directly because this function + # maintains the group's dicts. + self.AppendProperty('children', child) + self._AddChildToDicts(child) + + def GetChildByName(self, name): + # This is not currently optimized with a dict as GetChildByPath is because + # it has few callers. Most callers probably want GetChildByPath. This + # function is only useful to get children that have names but no paths, + # which is rare. The children of the main group ("Source", "Products", + # etc.) is pretty much the only case where this likely to come up. + # + # TODO(mark): Maybe this should raise an error if more than one child is + # present with the same name. + if not 'children' in self._properties: + return None + + for child in self._properties['children']: + if child.Name() == name: + return child + + return None + + def GetChildByPath(self, path): + if not path: + return None + + if path in self._children_by_path: + return self._children_by_path[path] + + return None + + def GetChildByRemoteObject(self, remote_object): + # This method is a little bit esoteric. Given a remote_object, which + # should be a PBXFileReference in another project file, this method will + # return this group's PBXReferenceProxy object serving as a local proxy + # for the remote PBXFileReference. + # + # This function might benefit from a dict optimization as GetChildByPath + # for some workloads, but profiling shows that it's not currently a + # problem. + if not 'children' in self._properties: + return None + + for child in self._properties['children']: + if not isinstance(child, PBXReferenceProxy): + continue + + container_proxy = child._properties['remoteRef'] + if container_proxy._properties['remoteGlobalIDString'] == remote_object: + return child + + return None + + def AddOrGetFileByPath(self, path, hierarchical): + """Returns an existing or new file reference corresponding to path. + + If hierarchical is True, this method will create or use the necessary + hierarchical group structure corresponding to path. Otherwise, it will + look in and create an item in the current group only. + + If an existing matching reference is found, it is returned, otherwise, a + new one will be created, added to the correct group, and returned. + + If path identifies a directory by virtue of carrying a trailing slash, + this method returns a PBXFileReference of "folder" type. If path + identifies a variant, by virtue of it identifying a file inside a directory + with an ".lproj" extension, this method returns a PBXVariantGroup + containing the variant named by path, and possibly other variants. For + all other paths, a "normal" PBXFileReference will be returned. + """ + + # Adding or getting a directory? Directories end with a trailing slash. + is_dir = False + if path.endswith('/'): + is_dir = True + path = posixpath.normpath(path) + if is_dir: + path = path + '/' + + # Adding or getting a variant? Variants are files inside directories + # with an ".lproj" extension. Xcode uses variants for localization. For + # a variant path/to/Language.lproj/MainMenu.nib, put a variant group named + # MainMenu.nib inside path/to, and give it a variant named Language. In + # this example, grandparent would be set to path/to and parent_root would + # be set to Language. + variant_name = None + parent = posixpath.dirname(path) + grandparent = posixpath.dirname(parent) + parent_basename = posixpath.basename(parent) + (parent_root, parent_ext) = posixpath.splitext(parent_basename) + if parent_ext == '.lproj': + variant_name = parent_root + if grandparent == '': + grandparent = None + + # Putting a directory inside a variant group is not currently supported. + assert not is_dir or variant_name is None + + path_split = path.split(posixpath.sep) + if len(path_split) == 1 or \ + ((is_dir or variant_name != None) and len(path_split) == 2) or \ + not hierarchical: + # The PBXFileReference or PBXVariantGroup will be added to or gotten from + # this PBXGroup, no recursion necessary. + if variant_name is None: + # Add or get a PBXFileReference. + file_ref = self.GetChildByPath(path) + if file_ref != None: + assert file_ref.__class__ == PBXFileReference + else: + file_ref = PBXFileReference({'path': path}) + self.AppendChild(file_ref) + else: + # Add or get a PBXVariantGroup. The variant group name is the same + # as the basename (MainMenu.nib in the example above). grandparent + # specifies the path to the variant group itself, and path_split[-2:] + # is the path of the specific variant relative to its group. + variant_group_name = posixpath.basename(path) + variant_group_ref = self.AddOrGetVariantGroupByNameAndPath( + variant_group_name, grandparent) + variant_path = posixpath.sep.join(path_split[-2:]) + variant_ref = variant_group_ref.GetChildByPath(variant_path) + if variant_ref != None: + assert variant_ref.__class__ == PBXFileReference + else: + variant_ref = PBXFileReference({'name': variant_name, + 'path': variant_path}) + variant_group_ref.AppendChild(variant_ref) + # The caller is interested in the variant group, not the specific + # variant file. + file_ref = variant_group_ref + return file_ref + else: + # Hierarchical recursion. Add or get a PBXGroup corresponding to the + # outermost path component, and then recurse into it, chopping off that + # path component. + next_dir = path_split[0] + group_ref = self.GetChildByPath(next_dir) + if group_ref != None: + assert group_ref.__class__ == PBXGroup + else: + group_ref = PBXGroup({'path': next_dir}) + self.AppendChild(group_ref) + return group_ref.AddOrGetFileByPath(posixpath.sep.join(path_split[1:]), + hierarchical) + + def AddOrGetVariantGroupByNameAndPath(self, name, path): + """Returns an existing or new PBXVariantGroup for name and path. + + If a PBXVariantGroup identified by the name and path arguments is already + present as a child of this object, it is returned. Otherwise, a new + PBXVariantGroup with the correct properties is created, added as a child, + and returned. + + This method will generally be called by AddOrGetFileByPath, which knows + when to create a variant group based on the structure of the pathnames + passed to it. + """ + + key = (name, path) + if key in self._variant_children_by_name_and_path: + variant_group_ref = self._variant_children_by_name_and_path[key] + assert variant_group_ref.__class__ == PBXVariantGroup + return variant_group_ref + + variant_group_properties = {'name': name} + if path != None: + variant_group_properties['path'] = path + variant_group_ref = PBXVariantGroup(variant_group_properties) + self.AppendChild(variant_group_ref) + + return variant_group_ref + + def TakeOverOnlyChild(self, recurse=False): + """If this PBXGroup has only one child and it's also a PBXGroup, take + it over by making all of its children this object's children. + + This function will continue to take over only children when those children + are groups. If there are three PBXGroups representing a, b, and c, with + c inside b and b inside a, and a and b have no other children, this will + result in a taking over both b and c, forming a PBXGroup for a/b/c. + + If recurse is True, this function will recurse into children and ask them + to collapse themselves by taking over only children as well. Assuming + an example hierarchy with files at a/b/c/d1, a/b/c/d2, and a/b/c/d3/e/f + (d1, d2, and f are files, the rest are groups), recursion will result in + a group for a/b/c containing a group for d3/e. + """ + + # At this stage, check that child class types are PBXGroup exactly, + # instead of using isinstance. The only subclass of PBXGroup, + # PBXVariantGroup, should not participate in reparenting in the same way: + # reparenting by merging different object types would be wrong. + while len(self._properties['children']) == 1 and \ + self._properties['children'][0].__class__ == PBXGroup: + # Loop to take over the innermost only-child group possible. + + child = self._properties['children'][0] + + # Assume the child's properties, including its children. Save a copy + # of this object's old properties, because they'll still be needed. + # This object retains its existing id and parent attributes. + old_properties = self._properties + self._properties = child._properties + self._children_by_path = child._children_by_path + + if not 'sourceTree' in self._properties or \ + self._properties['sourceTree'] == '': + # The child was relative to its parent. Fix up the path. Note that + # children with a sourceTree other than "" are not relative to + # their parents, so no path fix-up is needed in that case. + if 'path' in old_properties: + if 'path' in self._properties: + # Both the original parent and child have paths set. + self._properties['path'] = posixpath.join(old_properties['path'], + self._properties['path']) + else: + # Only the original parent has a path, use it. + self._properties['path'] = old_properties['path'] + if 'sourceTree' in old_properties: + # The original parent had a sourceTree set, use it. + self._properties['sourceTree'] = old_properties['sourceTree'] + + # If the original parent had a name set, keep using it. If the original + # parent didn't have a name but the child did, let the child's name + # live on. If the name attribute seems unnecessary now, get rid of it. + if 'name' in old_properties and old_properties['name'] != None and \ + old_properties['name'] != self.Name(): + self._properties['name'] = old_properties['name'] + if 'name' in self._properties and 'path' in self._properties and \ + self._properties['name'] == self._properties['path']: + del self._properties['name'] + + # Notify all children of their new parent. + for child in self._properties['children']: + child.parent = self + + # If asked to recurse, recurse. + if recurse: + for child in self._properties['children']: + if child.__class__ == PBXGroup: + child.TakeOverOnlyChild(recurse) + + def SortGroup(self): + self._properties['children'] = \ + sorted(self._properties['children'], cmp=lambda x,y: x.Compare(y)) + + # Recurse. + for child in self._properties['children']: + if isinstance(child, PBXGroup): + child.SortGroup() + + +class XCFileLikeElement(XCHierarchicalElement): + # Abstract base for objects that can be used as the fileRef property of + # PBXBuildFile. + + def PathHashables(self): + # A PBXBuildFile that refers to this object will call this method to + # obtain additional hashables specific to this XCFileLikeElement. Don't + # just use this object's hashables, they're not specific and unique enough + # on their own (without access to the parent hashables.) Instead, provide + # hashables that identify this object by path by getting its hashables as + # well as the hashables of ancestor XCHierarchicalElement objects. + + hashables = [] + xche = self + while xche != None and isinstance(xche, XCHierarchicalElement): + xche_hashables = xche.Hashables() + for index in xrange(0, len(xche_hashables)): + hashables.insert(index, xche_hashables[index]) + xche = xche.parent + return hashables + + +class XCContainerPortal(XCObject): + # Abstract base for objects that can be used as the containerPortal property + # of PBXContainerItemProxy. + pass + + +class XCRemoteObject(XCObject): + # Abstract base for objects that can be used as the remoteGlobalIDString + # property of PBXContainerItemProxy. + pass + + +class PBXFileReference(XCFileLikeElement, XCContainerPortal, XCRemoteObject): + _schema = XCFileLikeElement._schema.copy() + _schema.update({ + 'explicitFileType': [0, str, 0, 0], + 'lastKnownFileType': [0, str, 0, 0], + 'name': [0, str, 0, 0], + 'path': [0, str, 0, 1], + }) + + # Weird output rules for PBXFileReference. + _should_print_single_line = True + # super + _encode_transforms = XCFileLikeElement._alternate_encode_transforms + + def __init__(self, properties=None, id=None, parent=None): + # super + XCFileLikeElement.__init__(self, properties, id, parent) + if 'path' in self._properties and self._properties['path'].endswith('/'): + self._properties['path'] = self._properties['path'][:-1] + is_dir = True + else: + is_dir = False + + if 'path' in self._properties and \ + not 'lastKnownFileType' in self._properties and \ + not 'explicitFileType' in self._properties: + # TODO(mark): This is the replacement for a replacement for a quick hack. + # It is no longer incredibly sucky, but this list needs to be extended. + extension_map = { + 'a': 'archive.ar', + 'app': 'wrapper.application', + 'bdic': 'file', + 'bundle': 'wrapper.cfbundle', + 'c': 'sourcecode.c.c', + 'cc': 'sourcecode.cpp.cpp', + 'cpp': 'sourcecode.cpp.cpp', + 'css': 'text.css', + 'cxx': 'sourcecode.cpp.cpp', + 'dart': 'sourcecode', + 'dylib': 'compiled.mach-o.dylib', + 'framework': 'wrapper.framework', + 'gyp': 'sourcecode', + 'gypi': 'sourcecode', + 'h': 'sourcecode.c.h', + 'hxx': 'sourcecode.cpp.h', + 'icns': 'image.icns', + 'java': 'sourcecode.java', + 'js': 'sourcecode.javascript', + 'kext': 'wrapper.kext', + 'm': 'sourcecode.c.objc', + 'mm': 'sourcecode.cpp.objcpp', + 'nib': 'wrapper.nib', + 'o': 'compiled.mach-o.objfile', + 'pdf': 'image.pdf', + 'pl': 'text.script.perl', + 'plist': 'text.plist.xml', + 'pm': 'text.script.perl', + 'png': 'image.png', + 'py': 'text.script.python', + 'r': 'sourcecode.rez', + 'rez': 'sourcecode.rez', + 's': 'sourcecode.asm', + 'storyboard': 'file.storyboard', + 'strings': 'text.plist.strings', + 'swift': 'sourcecode.swift', + 'ttf': 'file', + 'xcassets': 'folder.assetcatalog', + 'xcconfig': 'text.xcconfig', + 'xcdatamodel': 'wrapper.xcdatamodel', + 'xcdatamodeld':'wrapper.xcdatamodeld', + 'xib': 'file.xib', + 'y': 'sourcecode.yacc', + } + + prop_map = { + 'dart': 'explicitFileType', + 'gyp': 'explicitFileType', + 'gypi': 'explicitFileType', + } + + if is_dir: + file_type = 'folder' + prop_name = 'lastKnownFileType' + else: + basename = posixpath.basename(self._properties['path']) + (root, ext) = posixpath.splitext(basename) + # Check the map using a lowercase extension. + # TODO(mark): Maybe it should try with the original case first and fall + # back to lowercase, in case there are any instances where case + # matters. There currently aren't. + if ext != '': + ext = ext[1:].lower() + + # TODO(mark): "text" is the default value, but "file" is appropriate + # for unrecognized files not containing text. Xcode seems to choose + # based on content. + file_type = extension_map.get(ext, 'text') + prop_name = prop_map.get(ext, 'lastKnownFileType') + + self._properties[prop_name] = file_type + + +class PBXVariantGroup(PBXGroup, XCFileLikeElement): + """PBXVariantGroup is used by Xcode to represent localizations.""" + # No additions to the schema relative to PBXGroup. + pass + + +# PBXReferenceProxy is also an XCFileLikeElement subclass. It is defined below +# because it uses PBXContainerItemProxy, defined below. + + +class XCBuildConfiguration(XCObject): + _schema = XCObject._schema.copy() + _schema.update({ + 'baseConfigurationReference': [0, PBXFileReference, 0, 0], + 'buildSettings': [0, dict, 0, 1, {}], + 'name': [0, str, 0, 1], + }) + + def HasBuildSetting(self, key): + return key in self._properties['buildSettings'] + + def GetBuildSetting(self, key): + return self._properties['buildSettings'][key] + + def SetBuildSetting(self, key, value): + # TODO(mark): If a list, copy? + self._properties['buildSettings'][key] = value + + def AppendBuildSetting(self, key, value): + if not key in self._properties['buildSettings']: + self._properties['buildSettings'][key] = [] + self._properties['buildSettings'][key].append(value) + + def DelBuildSetting(self, key): + if key in self._properties['buildSettings']: + del self._properties['buildSettings'][key] + + def SetBaseConfiguration(self, value): + self._properties['baseConfigurationReference'] = value + +class XCConfigurationList(XCObject): + # _configs is the default list of configurations. + _configs = [ XCBuildConfiguration({'name': 'Debug'}), + XCBuildConfiguration({'name': 'Release'}) ] + + _schema = XCObject._schema.copy() + _schema.update({ + 'buildConfigurations': [1, XCBuildConfiguration, 1, 1, _configs], + 'defaultConfigurationIsVisible': [0, int, 0, 1, 1], + 'defaultConfigurationName': [0, str, 0, 1, 'Release'], + }) + + def Name(self): + return 'Build configuration list for ' + \ + self.parent.__class__.__name__ + ' "' + self.parent.Name() + '"' + + def ConfigurationNamed(self, name): + """Convenience accessor to obtain an XCBuildConfiguration by name.""" + for configuration in self._properties['buildConfigurations']: + if configuration._properties['name'] == name: + return configuration + + raise KeyError(name) + + def DefaultConfiguration(self): + """Convenience accessor to obtain the default XCBuildConfiguration.""" + return self.ConfigurationNamed(self._properties['defaultConfigurationName']) + + def HasBuildSetting(self, key): + """Determines the state of a build setting in all XCBuildConfiguration + child objects. + + If all child objects have key in their build settings, and the value is the + same in all child objects, returns 1. + + If no child objects have the key in their build settings, returns 0. + + If some, but not all, child objects have the key in their build settings, + or if any children have different values for the key, returns -1. + """ + + has = None + value = None + for configuration in self._properties['buildConfigurations']: + configuration_has = configuration.HasBuildSetting(key) + if has is None: + has = configuration_has + elif has != configuration_has: + return -1 + + if configuration_has: + configuration_value = configuration.GetBuildSetting(key) + if value is None: + value = configuration_value + elif value != configuration_value: + return -1 + + if not has: + return 0 + + return 1 + + def GetBuildSetting(self, key): + """Gets the build setting for key. + + All child XCConfiguration objects must have the same value set for the + setting, or a ValueError will be raised. + """ + + # TODO(mark): This is wrong for build settings that are lists. The list + # contents should be compared (and a list copy returned?) + + value = None + for configuration in self._properties['buildConfigurations']: + configuration_value = configuration.GetBuildSetting(key) + if value is None: + value = configuration_value + else: + if value != configuration_value: + raise ValueError('Variant values for ' + key) + + return value + + def SetBuildSetting(self, key, value): + """Sets the build setting for key to value in all child + XCBuildConfiguration objects. + """ + + for configuration in self._properties['buildConfigurations']: + configuration.SetBuildSetting(key, value) + + def AppendBuildSetting(self, key, value): + """Appends value to the build setting for key, which is treated as a list, + in all child XCBuildConfiguration objects. + """ + + for configuration in self._properties['buildConfigurations']: + configuration.AppendBuildSetting(key, value) + + def DelBuildSetting(self, key): + """Deletes the build setting key from all child XCBuildConfiguration + objects. + """ + + for configuration in self._properties['buildConfigurations']: + configuration.DelBuildSetting(key) + + def SetBaseConfiguration(self, value): + """Sets the build configuration in all child XCBuildConfiguration objects. + """ + + for configuration in self._properties['buildConfigurations']: + configuration.SetBaseConfiguration(value) + + +class PBXBuildFile(XCObject): + _schema = XCObject._schema.copy() + _schema.update({ + 'fileRef': [0, XCFileLikeElement, 0, 1], + 'settings': [0, str, 0, 0], # hack, it's a dict + }) + + # Weird output rules for PBXBuildFile. + _should_print_single_line = True + _encode_transforms = XCObject._alternate_encode_transforms + + def Name(self): + # Example: "main.cc in Sources" + return self._properties['fileRef'].Name() + ' in ' + self.parent.Name() + + def Hashables(self): + # super + hashables = XCObject.Hashables(self) + + # It is not sufficient to just rely on Name() to get the + # XCFileLikeElement's name, because that is not a complete pathname. + # PathHashables returns hashables unique enough that no two + # PBXBuildFiles should wind up with the same set of hashables, unless + # someone adds the same file multiple times to the same target. That + # would be considered invalid anyway. + hashables.extend(self._properties['fileRef'].PathHashables()) + + return hashables + + +class XCBuildPhase(XCObject): + """Abstract base for build phase classes. Not represented in a project + file. + + Attributes: + _files_by_path: A dict mapping each path of a child in the files list by + path (keys) to the corresponding PBXBuildFile children (values). + _files_by_xcfilelikeelement: A dict mapping each XCFileLikeElement (keys) + to the corresponding PBXBuildFile children (values). + """ + + # TODO(mark): Some build phase types, like PBXShellScriptBuildPhase, don't + # actually have a "files" list. XCBuildPhase should not have "files" but + # another abstract subclass of it should provide this, and concrete build + # phase types that do have "files" lists should be derived from that new + # abstract subclass. XCBuildPhase should only provide buildActionMask and + # runOnlyForDeploymentPostprocessing, and not files or the various + # file-related methods and attributes. + + _schema = XCObject._schema.copy() + _schema.update({ + 'buildActionMask': [0, int, 0, 1, 0x7fffffff], + 'files': [1, PBXBuildFile, 1, 1, []], + 'runOnlyForDeploymentPostprocessing': [0, int, 0, 1, 0], + }) + + def __init__(self, properties=None, id=None, parent=None): + # super + XCObject.__init__(self, properties, id, parent) + + self._files_by_path = {} + self._files_by_xcfilelikeelement = {} + for pbxbuildfile in self._properties.get('files', []): + self._AddBuildFileToDicts(pbxbuildfile) + + def FileGroup(self, path): + # Subclasses must override this by returning a two-element tuple. The + # first item in the tuple should be the PBXGroup to which "path" should be + # added, either as a child or deeper descendant. The second item should + # be a boolean indicating whether files should be added into hierarchical + # groups or one single flat group. + raise NotImplementedError( + self.__class__.__name__ + ' must implement FileGroup') + + def _AddPathToDict(self, pbxbuildfile, path): + """Adds path to the dict tracking paths belonging to this build phase. + + If the path is already a member of this build phase, raises an exception. + """ + + if path in self._files_by_path: + raise ValueError('Found multiple build files with path ' + path) + self._files_by_path[path] = pbxbuildfile + + def _AddBuildFileToDicts(self, pbxbuildfile, path=None): + """Maintains the _files_by_path and _files_by_xcfilelikeelement dicts. + + If path is specified, then it is the path that is being added to the + phase, and pbxbuildfile must contain either a PBXFileReference directly + referencing that path, or it must contain a PBXVariantGroup that itself + contains a PBXFileReference referencing the path. + + If path is not specified, either the PBXFileReference's path or the paths + of all children of the PBXVariantGroup are taken as being added to the + phase. + + If the path is already present in the phase, raises an exception. + + If the PBXFileReference or PBXVariantGroup referenced by pbxbuildfile + are already present in the phase, referenced by a different PBXBuildFile + object, raises an exception. This does not raise an exception when + a PBXFileReference or PBXVariantGroup reappear and are referenced by the + same PBXBuildFile that has already introduced them, because in the case + of PBXVariantGroup objects, they may correspond to multiple paths that are + not all added simultaneously. When this situation occurs, the path needs + to be added to _files_by_path, but nothing needs to change in + _files_by_xcfilelikeelement, and the caller should have avoided adding + the PBXBuildFile if it is already present in the list of children. + """ + + xcfilelikeelement = pbxbuildfile._properties['fileRef'] + + paths = [] + if path != None: + # It's best when the caller provides the path. + if isinstance(xcfilelikeelement, PBXVariantGroup): + paths.append(path) + else: + # If the caller didn't provide a path, there can be either multiple + # paths (PBXVariantGroup) or one. + if isinstance(xcfilelikeelement, PBXVariantGroup): + for variant in xcfilelikeelement._properties['children']: + paths.append(variant.FullPath()) + else: + paths.append(xcfilelikeelement.FullPath()) + + # Add the paths first, because if something's going to raise, the + # messages provided by _AddPathToDict are more useful owing to its + # having access to a real pathname and not just an object's Name(). + for a_path in paths: + self._AddPathToDict(pbxbuildfile, a_path) + + # If another PBXBuildFile references this XCFileLikeElement, there's a + # problem. + if xcfilelikeelement in self._files_by_xcfilelikeelement and \ + self._files_by_xcfilelikeelement[xcfilelikeelement] != pbxbuildfile: + raise ValueError('Found multiple build files for ' + \ + xcfilelikeelement.Name()) + self._files_by_xcfilelikeelement[xcfilelikeelement] = pbxbuildfile + + def AppendBuildFile(self, pbxbuildfile, path=None): + # Callers should use this instead of calling + # AppendProperty('files', pbxbuildfile) directly because this function + # maintains the object's dicts. Better yet, callers can just call AddFile + # with a pathname and not worry about building their own PBXBuildFile + # objects. + self.AppendProperty('files', pbxbuildfile) + self._AddBuildFileToDicts(pbxbuildfile, path) + + def AddFile(self, path, settings=None): + (file_group, hierarchical) = self.FileGroup(path) + file_ref = file_group.AddOrGetFileByPath(path, hierarchical) + + if file_ref in self._files_by_xcfilelikeelement and \ + isinstance(file_ref, PBXVariantGroup): + # There's already a PBXBuildFile in this phase corresponding to the + # PBXVariantGroup. path just provides a new variant that belongs to + # the group. Add the path to the dict. + pbxbuildfile = self._files_by_xcfilelikeelement[file_ref] + self._AddBuildFileToDicts(pbxbuildfile, path) + else: + # Add a new PBXBuildFile to get file_ref into the phase. + if settings is None: + pbxbuildfile = PBXBuildFile({'fileRef': file_ref}) + else: + pbxbuildfile = PBXBuildFile({'fileRef': file_ref, 'settings': settings}) + self.AppendBuildFile(pbxbuildfile, path) + + +class PBXHeadersBuildPhase(XCBuildPhase): + # No additions to the schema relative to XCBuildPhase. + + def Name(self): + return 'Headers' + + def FileGroup(self, path): + return self.PBXProjectAncestor().RootGroupForPath(path) + + +class PBXResourcesBuildPhase(XCBuildPhase): + # No additions to the schema relative to XCBuildPhase. + + def Name(self): + return 'Resources' + + def FileGroup(self, path): + return self.PBXProjectAncestor().RootGroupForPath(path) + + +class PBXSourcesBuildPhase(XCBuildPhase): + # No additions to the schema relative to XCBuildPhase. + + def Name(self): + return 'Sources' + + def FileGroup(self, path): + return self.PBXProjectAncestor().RootGroupForPath(path) + + +class PBXFrameworksBuildPhase(XCBuildPhase): + # No additions to the schema relative to XCBuildPhase. + + def Name(self): + return 'Frameworks' + + def FileGroup(self, path): + (root, ext) = posixpath.splitext(path) + if ext != '': + ext = ext[1:].lower() + if ext == 'o': + # .o files are added to Xcode Frameworks phases, but conceptually aren't + # frameworks, they're more like sources or intermediates. Redirect them + # to show up in one of those other groups. + return self.PBXProjectAncestor().RootGroupForPath(path) + else: + return (self.PBXProjectAncestor().FrameworksGroup(), False) + + +class PBXShellScriptBuildPhase(XCBuildPhase): + _schema = XCBuildPhase._schema.copy() + _schema.update({ + 'inputPaths': [1, str, 0, 1, []], + 'name': [0, str, 0, 0], + 'outputPaths': [1, str, 0, 1, []], + 'shellPath': [0, str, 0, 1, '/bin/sh'], + 'shellScript': [0, str, 0, 1], + 'showEnvVarsInLog': [0, int, 0, 0], + }) + + def Name(self): + if 'name' in self._properties: + return self._properties['name'] + + return 'ShellScript' + + +class PBXCopyFilesBuildPhase(XCBuildPhase): + _schema = XCBuildPhase._schema.copy() + _schema.update({ + 'dstPath': [0, str, 0, 1], + 'dstSubfolderSpec': [0, int, 0, 1], + 'name': [0, str, 0, 0], + }) + + # path_tree_re matches "$(DIR)/path" or just "$(DIR)". Match group 1 is + # "DIR", match group 3 is "path" or None. + path_tree_re = re.compile('^\\$\\((.*)\\)(/(.*)|)$') + + # path_tree_to_subfolder maps names of Xcode variables to the associated + # dstSubfolderSpec property value used in a PBXCopyFilesBuildPhase object. + path_tree_to_subfolder = { + 'BUILT_FRAMEWORKS_DIR': 10, # Frameworks Directory + 'BUILT_PRODUCTS_DIR': 16, # Products Directory + # Other types that can be chosen via the Xcode UI. + # TODO(mark): Map Xcode variable names to these. + # : 1, # Wrapper + # : 6, # Executables: 6 + # : 7, # Resources + # : 15, # Java Resources + # : 11, # Shared Frameworks + # : 12, # Shared Support + # : 13, # PlugIns + } + + def Name(self): + if 'name' in self._properties: + return self._properties['name'] + + return 'CopyFiles' + + def FileGroup(self, path): + return self.PBXProjectAncestor().RootGroupForPath(path) + + def SetDestination(self, path): + """Set the dstSubfolderSpec and dstPath properties from path. + + path may be specified in the same notation used for XCHierarchicalElements, + specifically, "$(DIR)/path". + """ + + path_tree_match = self.path_tree_re.search(path) + if path_tree_match: + # Everything else needs to be relative to an Xcode variable. + path_tree = path_tree_match.group(1) + relative_path = path_tree_match.group(3) + + if path_tree in self.path_tree_to_subfolder: + subfolder = self.path_tree_to_subfolder[path_tree] + if relative_path is None: + relative_path = '' + else: + # The path starts with an unrecognized Xcode variable + # name like $(SRCROOT). Xcode will still handle this + # as an "absolute path" that starts with the variable. + subfolder = 0 + relative_path = path + elif path.startswith('/'): + # Special case. Absolute paths are in dstSubfolderSpec 0. + subfolder = 0 + relative_path = path[1:] + else: + raise ValueError('Can\'t use path %s in a %s' % \ + (path, self.__class__.__name__)) + + self._properties['dstPath'] = relative_path + self._properties['dstSubfolderSpec'] = subfolder + + +class PBXBuildRule(XCObject): + _schema = XCObject._schema.copy() + _schema.update({ + 'compilerSpec': [0, str, 0, 1], + 'filePatterns': [0, str, 0, 0], + 'fileType': [0, str, 0, 1], + 'isEditable': [0, int, 0, 1, 1], + 'outputFiles': [1, str, 0, 1, []], + 'script': [0, str, 0, 0], + }) + + def Name(self): + # Not very inspired, but it's what Xcode uses. + return self.__class__.__name__ + + def Hashables(self): + # super + hashables = XCObject.Hashables(self) + + # Use the hashables of the weak objects that this object refers to. + hashables.append(self._properties['fileType']) + if 'filePatterns' in self._properties: + hashables.append(self._properties['filePatterns']) + return hashables + + +class PBXContainerItemProxy(XCObject): + # When referencing an item in this project file, containerPortal is the + # PBXProject root object of this project file. When referencing an item in + # another project file, containerPortal is a PBXFileReference identifying + # the other project file. + # + # When serving as a proxy to an XCTarget (in this project file or another), + # proxyType is 1. When serving as a proxy to a PBXFileReference (in another + # project file), proxyType is 2. Type 2 is used for references to the + # producs of the other project file's targets. + # + # Xcode is weird about remoteGlobalIDString. Usually, it's printed without + # a comment, indicating that it's tracked internally simply as a string, but + # sometimes it's printed with a comment (usually when the object is initially + # created), indicating that it's tracked as a project file object at least + # sometimes. This module always tracks it as an object, but contains a hack + # to prevent it from printing the comment in the project file output. See + # _XCKVPrint. + _schema = XCObject._schema.copy() + _schema.update({ + 'containerPortal': [0, XCContainerPortal, 0, 1], + 'proxyType': [0, int, 0, 1], + 'remoteGlobalIDString': [0, XCRemoteObject, 0, 1], + 'remoteInfo': [0, str, 0, 1], + }) + + def __repr__(self): + props = self._properties + name = '%s.gyp:%s' % (props['containerPortal'].Name(), props['remoteInfo']) + return '<%s %r at 0x%x>' % (self.__class__.__name__, name, id(self)) + + def Name(self): + # Admittedly not the best name, but it's what Xcode uses. + return self.__class__.__name__ + + def Hashables(self): + # super + hashables = XCObject.Hashables(self) + + # Use the hashables of the weak objects that this object refers to. + hashables.extend(self._properties['containerPortal'].Hashables()) + hashables.extend(self._properties['remoteGlobalIDString'].Hashables()) + return hashables + + +class PBXTargetDependency(XCObject): + # The "target" property accepts an XCTarget object, and obviously not + # NoneType. But XCTarget is defined below, so it can't be put into the + # schema yet. The definition of PBXTargetDependency can't be moved below + # XCTarget because XCTarget's own schema references PBXTargetDependency. + # Python doesn't deal well with this circular relationship, and doesn't have + # a real way to do forward declarations. To work around, the type of + # the "target" property is reset below, after XCTarget is defined. + # + # At least one of "name" and "target" is required. + _schema = XCObject._schema.copy() + _schema.update({ + 'name': [0, str, 0, 0], + 'target': [0, None.__class__, 0, 0], + 'targetProxy': [0, PBXContainerItemProxy, 1, 1], + }) + + def __repr__(self): + name = self._properties.get('name') or self._properties['target'].Name() + return '<%s %r at 0x%x>' % (self.__class__.__name__, name, id(self)) + + def Name(self): + # Admittedly not the best name, but it's what Xcode uses. + return self.__class__.__name__ + + def Hashables(self): + # super + hashables = XCObject.Hashables(self) + + # Use the hashables of the weak objects that this object refers to. + hashables.extend(self._properties['targetProxy'].Hashables()) + return hashables + + +class PBXReferenceProxy(XCFileLikeElement): + _schema = XCFileLikeElement._schema.copy() + _schema.update({ + 'fileType': [0, str, 0, 1], + 'path': [0, str, 0, 1], + 'remoteRef': [0, PBXContainerItemProxy, 1, 1], + }) + + +class XCTarget(XCRemoteObject): + # An XCTarget is really just an XCObject, the XCRemoteObject thing is just + # to allow PBXProject to be used in the remoteGlobalIDString property of + # PBXContainerItemProxy. + # + # Setting a "name" property at instantiation may also affect "productName", + # which may in turn affect the "PRODUCT_NAME" build setting in children of + # "buildConfigurationList". See __init__ below. + _schema = XCRemoteObject._schema.copy() + _schema.update({ + 'buildConfigurationList': [0, XCConfigurationList, 1, 1, + XCConfigurationList()], + 'buildPhases': [1, XCBuildPhase, 1, 1, []], + 'dependencies': [1, PBXTargetDependency, 1, 1, []], + 'name': [0, str, 0, 1], + 'productName': [0, str, 0, 1], + }) + + def __init__(self, properties=None, id=None, parent=None, + force_outdir=None, force_prefix=None, force_extension=None): + # super + XCRemoteObject.__init__(self, properties, id, parent) + + # Set up additional defaults not expressed in the schema. If a "name" + # property was supplied, set "productName" if it is not present. Also set + # the "PRODUCT_NAME" build setting in each configuration, but only if + # the setting is not present in any build configuration. + if 'name' in self._properties: + if not 'productName' in self._properties: + self.SetProperty('productName', self._properties['name']) + + if 'productName' in self._properties: + if 'buildConfigurationList' in self._properties: + configs = self._properties['buildConfigurationList'] + if configs.HasBuildSetting('PRODUCT_NAME') == 0: + configs.SetBuildSetting('PRODUCT_NAME', + self._properties['productName']) + + def AddDependency(self, other): + pbxproject = self.PBXProjectAncestor() + other_pbxproject = other.PBXProjectAncestor() + if pbxproject == other_pbxproject: + # Add a dependency to another target in the same project file. + container = PBXContainerItemProxy({'containerPortal': pbxproject, + 'proxyType': 1, + 'remoteGlobalIDString': other, + 'remoteInfo': other.Name()}) + dependency = PBXTargetDependency({'target': other, + 'targetProxy': container}) + self.AppendProperty('dependencies', dependency) + else: + # Add a dependency to a target in a different project file. + other_project_ref = \ + pbxproject.AddOrGetProjectReference(other_pbxproject)[1] + container = PBXContainerItemProxy({ + 'containerPortal': other_project_ref, + 'proxyType': 1, + 'remoteGlobalIDString': other, + 'remoteInfo': other.Name(), + }) + dependency = PBXTargetDependency({'name': other.Name(), + 'targetProxy': container}) + self.AppendProperty('dependencies', dependency) + + # Proxy all of these through to the build configuration list. + + def ConfigurationNamed(self, name): + return self._properties['buildConfigurationList'].ConfigurationNamed(name) + + def DefaultConfiguration(self): + return self._properties['buildConfigurationList'].DefaultConfiguration() + + def HasBuildSetting(self, key): + return self._properties['buildConfigurationList'].HasBuildSetting(key) + + def GetBuildSetting(self, key): + return self._properties['buildConfigurationList'].GetBuildSetting(key) + + def SetBuildSetting(self, key, value): + return self._properties['buildConfigurationList'].SetBuildSetting(key, \ + value) + + def AppendBuildSetting(self, key, value): + return self._properties['buildConfigurationList'].AppendBuildSetting(key, \ + value) + + def DelBuildSetting(self, key): + return self._properties['buildConfigurationList'].DelBuildSetting(key) + + +# Redefine the type of the "target" property. See PBXTargetDependency._schema +# above. +PBXTargetDependency._schema['target'][1] = XCTarget + + +class PBXNativeTarget(XCTarget): + # buildPhases is overridden in the schema to be able to set defaults. + # + # NOTE: Contrary to most objects, it is advisable to set parent when + # constructing PBXNativeTarget. A parent of an XCTarget must be a PBXProject + # object. A parent reference is required for a PBXNativeTarget during + # construction to be able to set up the target defaults for productReference, + # because a PBXBuildFile object must be created for the target and it must + # be added to the PBXProject's mainGroup hierarchy. + _schema = XCTarget._schema.copy() + _schema.update({ + 'buildPhases': [1, XCBuildPhase, 1, 1, + [PBXSourcesBuildPhase(), PBXFrameworksBuildPhase()]], + 'buildRules': [1, PBXBuildRule, 1, 1, []], + 'productReference': [0, PBXFileReference, 0, 1], + 'productType': [0, str, 0, 1], + }) + + # Mapping from Xcode product-types to settings. The settings are: + # filetype : used for explicitFileType in the project file + # prefix : the prefix for the file name + # suffix : the suffix for the file name + _product_filetypes = { + 'com.apple.product-type.application': ['wrapper.application', + '', '.app'], + 'com.apple.product-type.application.watchapp': ['wrapper.application', + '', '.app'], + 'com.apple.product-type.watchkit-extension': ['wrapper.app-extension', + '', '.appex'], + 'com.apple.product-type.app-extension': ['wrapper.app-extension', + '', '.appex'], + 'com.apple.product-type.bundle': ['wrapper.cfbundle', + '', '.bundle'], + 'com.apple.product-type.framework': ['wrapper.framework', + '', '.framework'], + 'com.apple.product-type.library.dynamic': ['compiled.mach-o.dylib', + 'lib', '.dylib'], + 'com.apple.product-type.library.static': ['archive.ar', + 'lib', '.a'], + 'com.apple.product-type.tool': ['compiled.mach-o.executable', + '', ''], + 'com.apple.product-type.bundle.unit-test': ['wrapper.cfbundle', + '', '.xctest'], + 'com.googlecode.gyp.xcode.bundle': ['compiled.mach-o.dylib', + '', '.so'], + 'com.apple.product-type.kernel-extension': ['wrapper.kext', + '', '.kext'], + } + + def __init__(self, properties=None, id=None, parent=None, + force_outdir=None, force_prefix=None, force_extension=None): + # super + XCTarget.__init__(self, properties, id, parent) + + if 'productName' in self._properties and \ + 'productType' in self._properties and \ + not 'productReference' in self._properties and \ + self._properties['productType'] in self._product_filetypes: + products_group = None + pbxproject = self.PBXProjectAncestor() + if pbxproject != None: + products_group = pbxproject.ProductsGroup() + + if products_group != None: + (filetype, prefix, suffix) = \ + self._product_filetypes[self._properties['productType']] + # Xcode does not have a distinct type for loadable modules that are + # pure BSD targets (not in a bundle wrapper). GYP allows such modules + # to be specified by setting a target type to loadable_module without + # having mac_bundle set. These are mapped to the pseudo-product type + # com.googlecode.gyp.xcode.bundle. + # + # By picking up this special type and converting it to a dynamic + # library (com.apple.product-type.library.dynamic) with fix-ups, + # single-file loadable modules can be produced. + # + # MACH_O_TYPE is changed to mh_bundle to produce the proper file type + # (as opposed to mh_dylib). In order for linking to succeed, + # DYLIB_CURRENT_VERSION and DYLIB_COMPATIBILITY_VERSION must be + # cleared. They are meaningless for type mh_bundle. + # + # Finally, the .so extension is forcibly applied over the default + # (.dylib), unless another forced extension is already selected. + # .dylib is plainly wrong, and .bundle is used by loadable_modules in + # bundle wrappers (com.apple.product-type.bundle). .so seems an odd + # choice because it's used as the extension on many other systems that + # don't distinguish between linkable shared libraries and non-linkable + # loadable modules, but there's precedent: Python loadable modules on + # Mac OS X use an .so extension. + if self._properties['productType'] == 'com.googlecode.gyp.xcode.bundle': + self._properties['productType'] = \ + 'com.apple.product-type.library.dynamic' + self.SetBuildSetting('MACH_O_TYPE', 'mh_bundle') + self.SetBuildSetting('DYLIB_CURRENT_VERSION', '') + self.SetBuildSetting('DYLIB_COMPATIBILITY_VERSION', '') + if force_extension is None: + force_extension = suffix[1:] + + if self._properties['productType'] == \ + 'com.apple.product-type-bundle.unit.test': + if force_extension is None: + force_extension = suffix[1:] + + if force_extension is not None: + # If it's a wrapper (bundle), set WRAPPER_EXTENSION. + # Extension override. + suffix = '.' + force_extension + if filetype.startswith('wrapper.'): + self.SetBuildSetting('WRAPPER_EXTENSION', force_extension) + else: + self.SetBuildSetting('EXECUTABLE_EXTENSION', force_extension) + + if filetype.startswith('compiled.mach-o.executable'): + product_name = self._properties['productName'] + product_name += suffix + suffix = '' + self.SetProperty('productName', product_name) + self.SetBuildSetting('PRODUCT_NAME', product_name) + + # Xcode handles most prefixes based on the target type, however there + # are exceptions. If a "BSD Dynamic Library" target is added in the + # Xcode UI, Xcode sets EXECUTABLE_PREFIX. This check duplicates that + # behavior. + if force_prefix is not None: + prefix = force_prefix + if filetype.startswith('wrapper.'): + self.SetBuildSetting('WRAPPER_PREFIX', prefix) + else: + self.SetBuildSetting('EXECUTABLE_PREFIX', prefix) + + if force_outdir is not None: + self.SetBuildSetting('TARGET_BUILD_DIR', force_outdir) + + # TODO(tvl): Remove the below hack. + # http://code.google.com/p/gyp/issues/detail?id=122 + + # Some targets include the prefix in the target_name. These targets + # really should just add a product_name setting that doesn't include + # the prefix. For example: + # target_name = 'libevent', product_name = 'event' + # This check cleans up for them. + product_name = self._properties['productName'] + prefix_len = len(prefix) + if prefix_len and (product_name[:prefix_len] == prefix): + product_name = product_name[prefix_len:] + self.SetProperty('productName', product_name) + self.SetBuildSetting('PRODUCT_NAME', product_name) + + ref_props = { + 'explicitFileType': filetype, + 'includeInIndex': 0, + 'path': prefix + product_name + suffix, + 'sourceTree': 'BUILT_PRODUCTS_DIR', + } + file_ref = PBXFileReference(ref_props) + products_group.AppendChild(file_ref) + self.SetProperty('productReference', file_ref) + + def GetBuildPhaseByType(self, type): + if not 'buildPhases' in self._properties: + return None + + the_phase = None + for phase in self._properties['buildPhases']: + if isinstance(phase, type): + # Some phases may be present in multiples in a well-formed project file, + # but phases like PBXSourcesBuildPhase may only be present singly, and + # this function is intended as an aid to GetBuildPhaseByType. Loop + # over the entire list of phases and assert if more than one of the + # desired type is found. + assert the_phase is None + the_phase = phase + + return the_phase + + def HeadersPhase(self): + headers_phase = self.GetBuildPhaseByType(PBXHeadersBuildPhase) + if headers_phase is None: + headers_phase = PBXHeadersBuildPhase() + + # The headers phase should come before the resources, sources, and + # frameworks phases, if any. + insert_at = len(self._properties['buildPhases']) + for index in xrange(0, len(self._properties['buildPhases'])): + phase = self._properties['buildPhases'][index] + if isinstance(phase, PBXResourcesBuildPhase) or \ + isinstance(phase, PBXSourcesBuildPhase) or \ + isinstance(phase, PBXFrameworksBuildPhase): + insert_at = index + break + + self._properties['buildPhases'].insert(insert_at, headers_phase) + headers_phase.parent = self + + return headers_phase + + def ResourcesPhase(self): + resources_phase = self.GetBuildPhaseByType(PBXResourcesBuildPhase) + if resources_phase is None: + resources_phase = PBXResourcesBuildPhase() + + # The resources phase should come before the sources and frameworks + # phases, if any. + insert_at = len(self._properties['buildPhases']) + for index in xrange(0, len(self._properties['buildPhases'])): + phase = self._properties['buildPhases'][index] + if isinstance(phase, PBXSourcesBuildPhase) or \ + isinstance(phase, PBXFrameworksBuildPhase): + insert_at = index + break + + self._properties['buildPhases'].insert(insert_at, resources_phase) + resources_phase.parent = self + + return resources_phase + + def SourcesPhase(self): + sources_phase = self.GetBuildPhaseByType(PBXSourcesBuildPhase) + if sources_phase is None: + sources_phase = PBXSourcesBuildPhase() + self.AppendProperty('buildPhases', sources_phase) + + return sources_phase + + def FrameworksPhase(self): + frameworks_phase = self.GetBuildPhaseByType(PBXFrameworksBuildPhase) + if frameworks_phase is None: + frameworks_phase = PBXFrameworksBuildPhase() + self.AppendProperty('buildPhases', frameworks_phase) + + return frameworks_phase + + def AddDependency(self, other): + # super + XCTarget.AddDependency(self, other) + + static_library_type = 'com.apple.product-type.library.static' + shared_library_type = 'com.apple.product-type.library.dynamic' + framework_type = 'com.apple.product-type.framework' + if isinstance(other, PBXNativeTarget) and \ + 'productType' in self._properties and \ + self._properties['productType'] != static_library_type and \ + 'productType' in other._properties and \ + (other._properties['productType'] == static_library_type or \ + ((other._properties['productType'] == shared_library_type or \ + other._properties['productType'] == framework_type) and \ + ((not other.HasBuildSetting('MACH_O_TYPE')) or + other.GetBuildSetting('MACH_O_TYPE') != 'mh_bundle'))): + + file_ref = other.GetProperty('productReference') + + pbxproject = self.PBXProjectAncestor() + other_pbxproject = other.PBXProjectAncestor() + if pbxproject != other_pbxproject: + other_project_product_group = \ + pbxproject.AddOrGetProjectReference(other_pbxproject)[0] + file_ref = other_project_product_group.GetChildByRemoteObject(file_ref) + + self.FrameworksPhase().AppendProperty('files', + PBXBuildFile({'fileRef': file_ref})) + + +class PBXAggregateTarget(XCTarget): + pass + + +class PBXProject(XCContainerPortal): + # A PBXProject is really just an XCObject, the XCContainerPortal thing is + # just to allow PBXProject to be used in the containerPortal property of + # PBXContainerItemProxy. + """ + + Attributes: + path: "sample.xcodeproj". TODO(mark) Document me! + _other_pbxprojects: A dictionary, keyed by other PBXProject objects. Each + value is a reference to the dict in the + projectReferences list associated with the keyed + PBXProject. + """ + + _schema = XCContainerPortal._schema.copy() + _schema.update({ + 'attributes': [0, dict, 0, 0], + 'buildConfigurationList': [0, XCConfigurationList, 1, 1, + XCConfigurationList()], + 'compatibilityVersion': [0, str, 0, 1, 'Xcode 3.2'], + 'hasScannedForEncodings': [0, int, 0, 1, 1], + 'mainGroup': [0, PBXGroup, 1, 1, PBXGroup()], + 'projectDirPath': [0, str, 0, 1, ''], + 'projectReferences': [1, dict, 0, 0], + 'projectRoot': [0, str, 0, 1, ''], + 'targets': [1, XCTarget, 1, 1, []], + }) + + def __init__(self, properties=None, id=None, parent=None, path=None): + self.path = path + self._other_pbxprojects = {} + # super + return XCContainerPortal.__init__(self, properties, id, parent) + + def Name(self): + name = self.path + if name[-10:] == '.xcodeproj': + name = name[:-10] + return posixpath.basename(name) + + def Path(self): + return self.path + + def Comment(self): + return 'Project object' + + def Children(self): + # super + children = XCContainerPortal.Children(self) + + # Add children that the schema doesn't know about. Maybe there's a more + # elegant way around this, but this is the only case where we need to own + # objects in a dictionary (that is itself in a list), and three lines for + # a one-off isn't that big a deal. + if 'projectReferences' in self._properties: + for reference in self._properties['projectReferences']: + children.append(reference['ProductGroup']) + + return children + + def PBXProjectAncestor(self): + return self + + def _GroupByName(self, name): + if not 'mainGroup' in self._properties: + self.SetProperty('mainGroup', PBXGroup()) + + main_group = self._properties['mainGroup'] + group = main_group.GetChildByName(name) + if group is None: + group = PBXGroup({'name': name}) + main_group.AppendChild(group) + + return group + + # SourceGroup and ProductsGroup are created by default in Xcode's own + # templates. + def SourceGroup(self): + return self._GroupByName('Source') + + def ProductsGroup(self): + return self._GroupByName('Products') + + # IntermediatesGroup is used to collect source-like files that are generated + # by rules or script phases and are placed in intermediate directories such + # as DerivedSources. + def IntermediatesGroup(self): + return self._GroupByName('Intermediates') + + # FrameworksGroup and ProjectsGroup are top-level groups used to collect + # frameworks and projects. + def FrameworksGroup(self): + return self._GroupByName('Frameworks') + + def ProjectsGroup(self): + return self._GroupByName('Projects') + + def RootGroupForPath(self, path): + """Returns a PBXGroup child of this object to which path should be added. + + This method is intended to choose between SourceGroup and + IntermediatesGroup on the basis of whether path is present in a source + directory or an intermediates directory. For the purposes of this + determination, any path located within a derived file directory such as + PROJECT_DERIVED_FILE_DIR is treated as being in an intermediates + directory. + + The returned value is a two-element tuple. The first element is the + PBXGroup, and the second element specifies whether that group should be + organized hierarchically (True) or as a single flat list (False). + """ + + # TODO(mark): make this a class variable and bind to self on call? + # Also, this list is nowhere near exhaustive. + # INTERMEDIATE_DIR and SHARED_INTERMEDIATE_DIR are used by + # gyp.generator.xcode. There should probably be some way for that module + # to push the names in, rather than having to hard-code them here. + source_tree_groups = { + 'DERIVED_FILE_DIR': (self.IntermediatesGroup, True), + 'INTERMEDIATE_DIR': (self.IntermediatesGroup, True), + 'PROJECT_DERIVED_FILE_DIR': (self.IntermediatesGroup, True), + 'SHARED_INTERMEDIATE_DIR': (self.IntermediatesGroup, True), + } + + (source_tree, path) = SourceTreeAndPathFromPath(path) + if source_tree != None and source_tree in source_tree_groups: + (group_func, hierarchical) = source_tree_groups[source_tree] + group = group_func() + return (group, hierarchical) + + # TODO(mark): make additional choices based on file extension. + + return (self.SourceGroup(), True) + + def AddOrGetFileInRootGroup(self, path): + """Returns a PBXFileReference corresponding to path in the correct group + according to RootGroupForPath's heuristics. + + If an existing PBXFileReference for path exists, it will be returned. + Otherwise, one will be created and returned. + """ + + (group, hierarchical) = self.RootGroupForPath(path) + return group.AddOrGetFileByPath(path, hierarchical) + + def RootGroupsTakeOverOnlyChildren(self, recurse=False): + """Calls TakeOverOnlyChild for all groups in the main group.""" + + for group in self._properties['mainGroup']._properties['children']: + if isinstance(group, PBXGroup): + group.TakeOverOnlyChild(recurse) + + def SortGroups(self): + # Sort the children of the mainGroup (like "Source" and "Products") + # according to their defined order. + self._properties['mainGroup']._properties['children'] = \ + sorted(self._properties['mainGroup']._properties['children'], + cmp=lambda x,y: x.CompareRootGroup(y)) + + # Sort everything else by putting group before files, and going + # alphabetically by name within sections of groups and files. SortGroup + # is recursive. + for group in self._properties['mainGroup']._properties['children']: + if not isinstance(group, PBXGroup): + continue + + if group.Name() == 'Products': + # The Products group is a special case. Instead of sorting + # alphabetically, sort things in the order of the targets that + # produce the products. To do this, just build up a new list of + # products based on the targets. + products = [] + for target in self._properties['targets']: + if not isinstance(target, PBXNativeTarget): + continue + product = target._properties['productReference'] + # Make sure that the product is already in the products group. + assert product in group._properties['children'] + products.append(product) + + # Make sure that this process doesn't miss anything that was already + # in the products group. + assert len(products) == len(group._properties['children']) + group._properties['children'] = products + else: + group.SortGroup() + + def AddOrGetProjectReference(self, other_pbxproject): + """Add a reference to another project file (via PBXProject object) to this + one. + + Returns [ProductGroup, ProjectRef]. ProductGroup is a PBXGroup object in + this project file that contains a PBXReferenceProxy object for each + product of each PBXNativeTarget in the other project file. ProjectRef is + a PBXFileReference to the other project file. + + If this project file already references the other project file, the + existing ProductGroup and ProjectRef are returned. The ProductGroup will + still be updated if necessary. + """ + + if not 'projectReferences' in self._properties: + self._properties['projectReferences'] = [] + + product_group = None + project_ref = None + + if not other_pbxproject in self._other_pbxprojects: + # This project file isn't yet linked to the other one. Establish the + # link. + product_group = PBXGroup({'name': 'Products'}) + + # ProductGroup is strong. + product_group.parent = self + + # There's nothing unique about this PBXGroup, and if left alone, it will + # wind up with the same set of hashables as all other PBXGroup objects + # owned by the projectReferences list. Add the hashables of the + # remote PBXProject that it's related to. + product_group._hashables.extend(other_pbxproject.Hashables()) + + # The other project reports its path as relative to the same directory + # that this project's path is relative to. The other project's path + # is not necessarily already relative to this project. Figure out the + # pathname that this project needs to use to refer to the other one. + this_path = posixpath.dirname(self.Path()) + projectDirPath = self.GetProperty('projectDirPath') + if projectDirPath: + if posixpath.isabs(projectDirPath[0]): + this_path = projectDirPath + else: + this_path = posixpath.join(this_path, projectDirPath) + other_path = gyp.common.RelativePath(other_pbxproject.Path(), this_path) + + # ProjectRef is weak (it's owned by the mainGroup hierarchy). + project_ref = PBXFileReference({ + 'lastKnownFileType': 'wrapper.pb-project', + 'path': other_path, + 'sourceTree': 'SOURCE_ROOT', + }) + self.ProjectsGroup().AppendChild(project_ref) + + ref_dict = {'ProductGroup': product_group, 'ProjectRef': project_ref} + self._other_pbxprojects[other_pbxproject] = ref_dict + self.AppendProperty('projectReferences', ref_dict) + + # Xcode seems to sort this list case-insensitively + self._properties['projectReferences'] = \ + sorted(self._properties['projectReferences'], cmp=lambda x,y: + cmp(x['ProjectRef'].Name().lower(), + y['ProjectRef'].Name().lower())) + else: + # The link already exists. Pull out the relevnt data. + project_ref_dict = self._other_pbxprojects[other_pbxproject] + product_group = project_ref_dict['ProductGroup'] + project_ref = project_ref_dict['ProjectRef'] + + self._SetUpProductReferences(other_pbxproject, product_group, project_ref) + + inherit_unique_symroot = self._AllSymrootsUnique(other_pbxproject, False) + targets = other_pbxproject.GetProperty('targets') + if all(self._AllSymrootsUnique(t, inherit_unique_symroot) for t in targets): + dir_path = project_ref._properties['path'] + product_group._hashables.extend(dir_path) + + return [product_group, project_ref] + + def _AllSymrootsUnique(self, target, inherit_unique_symroot): + # Returns True if all configurations have a unique 'SYMROOT' attribute. + # The value of inherit_unique_symroot decides, if a configuration is assumed + # to inherit a unique 'SYMROOT' attribute from its parent, if it doesn't + # define an explicit value for 'SYMROOT'. + symroots = self._DefinedSymroots(target) + for s in self._DefinedSymroots(target): + if (s is not None and not self._IsUniqueSymrootForTarget(s) or + s is None and not inherit_unique_symroot): + return False + return True if symroots else inherit_unique_symroot + + def _DefinedSymroots(self, target): + # Returns all values for the 'SYMROOT' attribute defined in all + # configurations for this target. If any configuration doesn't define the + # 'SYMROOT' attribute, None is added to the returned set. If all + # configurations don't define the 'SYMROOT' attribute, an empty set is + # returned. + config_list = target.GetProperty('buildConfigurationList') + symroots = set() + for config in config_list.GetProperty('buildConfigurations'): + setting = config.GetProperty('buildSettings') + if 'SYMROOT' in setting: + symroots.add(setting['SYMROOT']) + else: + symroots.add(None) + if len(symroots) == 1 and None in symroots: + return set() + return symroots + + def _IsUniqueSymrootForTarget(self, symroot): + # This method returns True if all configurations in target contain a + # 'SYMROOT' attribute that is unique for the given target. A value is + # unique, if the Xcode macro '$SRCROOT' appears in it in any form. + uniquifier = ['$SRCROOT', '$(SRCROOT)'] + if any(x in symroot for x in uniquifier): + return True + return False + + def _SetUpProductReferences(self, other_pbxproject, product_group, + project_ref): + # TODO(mark): This only adds references to products in other_pbxproject + # when they don't exist in this pbxproject. Perhaps it should also + # remove references from this pbxproject that are no longer present in + # other_pbxproject. Perhaps it should update various properties if they + # change. + for target in other_pbxproject._properties['targets']: + if not isinstance(target, PBXNativeTarget): + continue + + other_fileref = target._properties['productReference'] + if product_group.GetChildByRemoteObject(other_fileref) is None: + # Xcode sets remoteInfo to the name of the target and not the name + # of its product, despite this proxy being a reference to the product. + container_item = PBXContainerItemProxy({ + 'containerPortal': project_ref, + 'proxyType': 2, + 'remoteGlobalIDString': other_fileref, + 'remoteInfo': target.Name() + }) + # TODO(mark): Does sourceTree get copied straight over from the other + # project? Can the other project ever have lastKnownFileType here + # instead of explicitFileType? (Use it if so?) Can path ever be + # unset? (I don't think so.) Can other_fileref have name set, and + # does it impact the PBXReferenceProxy if so? These are the questions + # that perhaps will be answered one day. + reference_proxy = PBXReferenceProxy({ + 'fileType': other_fileref._properties['explicitFileType'], + 'path': other_fileref._properties['path'], + 'sourceTree': other_fileref._properties['sourceTree'], + 'remoteRef': container_item, + }) + + product_group.AppendChild(reference_proxy) + + def SortRemoteProductReferences(self): + # For each remote project file, sort the associated ProductGroup in the + # same order that the targets are sorted in the remote project file. This + # is the sort order used by Xcode. + + def CompareProducts(x, y, remote_products): + # x and y are PBXReferenceProxy objects. Go through their associated + # PBXContainerItem to get the remote PBXFileReference, which will be + # present in the remote_products list. + x_remote = x._properties['remoteRef']._properties['remoteGlobalIDString'] + y_remote = y._properties['remoteRef']._properties['remoteGlobalIDString'] + x_index = remote_products.index(x_remote) + y_index = remote_products.index(y_remote) + + # Use the order of each remote PBXFileReference in remote_products to + # determine the sort order. + return cmp(x_index, y_index) + + for other_pbxproject, ref_dict in self._other_pbxprojects.iteritems(): + # Build up a list of products in the remote project file, ordered the + # same as the targets that produce them. + remote_products = [] + for target in other_pbxproject._properties['targets']: + if not isinstance(target, PBXNativeTarget): + continue + remote_products.append(target._properties['productReference']) + + # Sort the PBXReferenceProxy children according to the list of remote + # products. + product_group = ref_dict['ProductGroup'] + product_group._properties['children'] = sorted( + product_group._properties['children'], + cmp=lambda x, y, rp=remote_products: CompareProducts(x, y, rp)) + + +class XCProjectFile(XCObject): + _schema = XCObject._schema.copy() + _schema.update({ + 'archiveVersion': [0, int, 0, 1, 1], + 'classes': [0, dict, 0, 1, {}], + 'objectVersion': [0, int, 0, 1, 46], + 'rootObject': [0, PBXProject, 1, 1], + }) + + def ComputeIDs(self, recursive=True, overwrite=True, hash=None): + # Although XCProjectFile is implemented here as an XCObject, it's not a + # proper object in the Xcode sense, and it certainly doesn't have its own + # ID. Pass through an attempt to update IDs to the real root object. + if recursive: + self._properties['rootObject'].ComputeIDs(recursive, overwrite, hash) + + def Print(self, file=sys.stdout): + self.VerifyHasRequiredProperties() + + # Add the special "objects" property, which will be caught and handled + # separately during printing. This structure allows a fairly standard + # loop do the normal printing. + self._properties['objects'] = {} + self._XCPrint(file, 0, '// !$*UTF8*$!\n') + if self._should_print_single_line: + self._XCPrint(file, 0, '{ ') + else: + self._XCPrint(file, 0, '{\n') + for property, value in sorted(self._properties.iteritems(), + cmp=lambda x, y: cmp(x, y)): + if property == 'objects': + self._PrintObjects(file) + else: + self._XCKVPrint(file, 1, property, value) + self._XCPrint(file, 0, '}\n') + del self._properties['objects'] + + def _PrintObjects(self, file): + if self._should_print_single_line: + self._XCPrint(file, 0, 'objects = {') + else: + self._XCPrint(file, 1, 'objects = {\n') + + objects_by_class = {} + for object in self.Descendants(): + if object == self: + continue + class_name = object.__class__.__name__ + if not class_name in objects_by_class: + objects_by_class[class_name] = [] + objects_by_class[class_name].append(object) + + for class_name in sorted(objects_by_class): + self._XCPrint(file, 0, '\n') + self._XCPrint(file, 0, '/* Begin ' + class_name + ' section */\n') + for object in sorted(objects_by_class[class_name], + cmp=lambda x, y: cmp(x.id, y.id)): + object.Print(file) + self._XCPrint(file, 0, '/* End ' + class_name + ' section */\n') + + if self._should_print_single_line: + self._XCPrint(file, 0, '}; ') + else: + self._XCPrint(file, 1, '};\n') diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py new file mode 100644 index 00000000..5de84815 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py @@ -0,0 +1,69 @@ +# Copyright (c) 2011 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Applies a fix to CR LF TAB handling in xml.dom. + +Fixes this: http://code.google.com/p/chromium/issues/detail?id=76293 +Working around this: http://bugs.python.org/issue5752 +TODO(bradnelson): Consider dropping this when we drop XP support. +""" + + +import xml.dom.minidom + + +def _Replacement_write_data(writer, data, is_attrib=False): + """Writes datachars to writer.""" + data = data.replace("&", "&").replace("<", "<") + data = data.replace("\"", """).replace(">", ">") + if is_attrib: + data = data.replace( + "\r", " ").replace( + "\n", " ").replace( + "\t", " ") + writer.write(data) + + +def _Replacement_writexml(self, writer, indent="", addindent="", newl=""): + # indent = current indentation + # addindent = indentation to add to higher levels + # newl = newline string + writer.write(indent+"<" + self.tagName) + + attrs = self._get_attributes() + a_names = attrs.keys() + a_names.sort() + + for a_name in a_names: + writer.write(" %s=\"" % a_name) + _Replacement_write_data(writer, attrs[a_name].value, is_attrib=True) + writer.write("\"") + if self.childNodes: + writer.write(">%s" % newl) + for node in self.childNodes: + node.writexml(writer, indent + addindent, addindent, newl) + writer.write("%s%s" % (indent, self.tagName, newl)) + else: + writer.write("/>%s" % newl) + + +class XmlFix(object): + """Object to manage temporary patching of xml.dom.minidom.""" + + def __init__(self): + # Preserve current xml.dom.minidom functions. + self.write_data = xml.dom.minidom._write_data + self.writexml = xml.dom.minidom.Element.writexml + # Inject replacement versions of a function and a method. + xml.dom.minidom._write_data = _Replacement_write_data + xml.dom.minidom.Element.writexml = _Replacement_writexml + + def Cleanup(self): + if self.write_data: + xml.dom.minidom._write_data = self.write_data + xml.dom.minidom.Element.writexml = self.writexml + self.write_data = None + + def __del__(self): + self.Cleanup() diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/samples/samples b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/samples/samples new file mode 100644 index 00000000..804b6189 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/samples/samples @@ -0,0 +1,81 @@ +#!/usr/bin/python + +# Copyright (c) 2009 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import os.path +import shutil +import sys + + +gyps = [ + 'app/app.gyp', + 'base/base.gyp', + 'build/temp_gyp/googleurl.gyp', + 'build/all.gyp', + 'build/common.gypi', + 'build/external_code.gypi', + 'chrome/test/security_tests/security_tests.gyp', + 'chrome/third_party/hunspell/hunspell.gyp', + 'chrome/chrome.gyp', + 'media/media.gyp', + 'net/net.gyp', + 'printing/printing.gyp', + 'sdch/sdch.gyp', + 'skia/skia.gyp', + 'testing/gmock.gyp', + 'testing/gtest.gyp', + 'third_party/bzip2/bzip2.gyp', + 'third_party/icu38/icu38.gyp', + 'third_party/libevent/libevent.gyp', + 'third_party/libjpeg/libjpeg.gyp', + 'third_party/libpng/libpng.gyp', + 'third_party/libxml/libxml.gyp', + 'third_party/libxslt/libxslt.gyp', + 'third_party/lzma_sdk/lzma_sdk.gyp', + 'third_party/modp_b64/modp_b64.gyp', + 'third_party/npapi/npapi.gyp', + 'third_party/sqlite/sqlite.gyp', + 'third_party/zlib/zlib.gyp', + 'v8/tools/gyp/v8.gyp', + 'webkit/activex_shim/activex_shim.gyp', + 'webkit/activex_shim_dll/activex_shim_dll.gyp', + 'webkit/build/action_csspropertynames.py', + 'webkit/build/action_cssvaluekeywords.py', + 'webkit/build/action_jsconfig.py', + 'webkit/build/action_makenames.py', + 'webkit/build/action_maketokenizer.py', + 'webkit/build/action_useragentstylesheets.py', + 'webkit/build/rule_binding.py', + 'webkit/build/rule_bison.py', + 'webkit/build/rule_gperf.py', + 'webkit/tools/test_shell/test_shell.gyp', + 'webkit/webkit.gyp', +] + + +def Main(argv): + if len(argv) != 3 or argv[1] not in ['push', 'pull']: + print 'Usage: %s push/pull PATH_TO_CHROME' % argv[0] + return 1 + + path_to_chrome = argv[2] + + for g in gyps: + chrome_file = os.path.join(path_to_chrome, g) + local_file = os.path.join(os.path.dirname(argv[0]), os.path.split(g)[1]) + if argv[1] == 'push': + print 'Copying %s to %s' % (local_file, chrome_file) + shutil.copyfile(local_file, chrome_file) + elif argv[1] == 'pull': + print 'Copying %s to %s' % (chrome_file, local_file) + shutil.copyfile(chrome_file, local_file) + else: + assert False + + return 0 + + +if __name__ == '__main__': + sys.exit(Main(sys.argv)) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/samples/samples.bat b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/samples/samples.bat new file mode 100644 index 00000000..56832556 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/samples/samples.bat @@ -0,0 +1,5 @@ +@rem Copyright (c) 2009 Google Inc. All rights reserved. +@rem Use of this source code is governed by a BSD-style license that can be +@rem found in the LICENSE file. + +@python %~dp0/samples %* diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/setup.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/setup.py new file mode 100644 index 00000000..75a42558 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/setup.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python + +# Copyright (c) 2009 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +from setuptools import setup + +setup( + name='gyp', + version='0.1', + description='Generate Your Projects', + author='Chromium Authors', + author_email='chromium-dev@googlegroups.com', + url='http://code.google.com/p/gyp', + package_dir = {'': 'pylib'}, + packages=['gyp', 'gyp.generator'], + entry_points = {'console_scripts': ['gyp=gyp:script_main'] } +) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/tools/README b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/tools/README new file mode 100644 index 00000000..712e4efb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/tools/README @@ -0,0 +1,15 @@ +pretty_vcproj: + Usage: pretty_vcproj.py "c:\path\to\vcproj.vcproj" [key1=value1] [key2=value2] + + They key/value pair are used to resolve vsprops name. + + For example, if I want to diff the base.vcproj project: + + pretty_vcproj.py z:\dev\src-chrome\src\base\build\base.vcproj "$(SolutionDir)=z:\dev\src-chrome\src\chrome\\" "$(CHROMIUM_BUILD)=" "$(CHROME_BUILD_TYPE)=" > orignal.txt + pretty_vcproj.py z:\dev\src-chrome\src\base\base_gyp.vcproj "$(SolutionDir)=z:\dev\src-chrome\src\chrome\\" "$(CHROMIUM_BUILD)=" "$(CHROME_BUILD_TYPE)=" > gyp.txt + + And you can use your favorite diff tool to see the changes. + + Note: In the case of base.vcproj, the original vcproj is one level up the generated one. + I suggest you do a search and replace for '"..\' and replace it with '"' in original.txt + before you perform the diff. \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/tools/Xcode/README b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/tools/Xcode/README new file mode 100644 index 00000000..2492a2c2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/tools/Xcode/README @@ -0,0 +1,5 @@ +Specifications contains syntax formatters for Xcode 3. These do not appear to be supported yet on Xcode 4. To use these with Xcode 3 please install both the gyp.pbfilespec and gyp.xclangspec files in + +~/Library/Application Support/Developer/Shared/Xcode/Specifications/ + +and restart Xcode. \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/tools/Xcode/Specifications/gyp.pbfilespec b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/tools/Xcode/Specifications/gyp.pbfilespec new file mode 100644 index 00000000..85e2e268 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/tools/Xcode/Specifications/gyp.pbfilespec @@ -0,0 +1,27 @@ +/* + gyp.pbfilespec + GYP source file spec for Xcode 3 + + There is not much documentation available regarding the format + of .pbfilespec files. As a starting point, see for instance the + outdated documentation at: + http://maxao.free.fr/xcode-plugin-interface/specifications.html + and the files in: + /Developer/Library/PrivateFrameworks/XcodeEdit.framework/Versions/A/Resources/ + + Place this file in directory: + ~/Library/Application Support/Developer/Shared/Xcode/Specifications/ +*/ + +( + { + Identifier = sourcecode.gyp; + BasedOn = sourcecode; + Name = "GYP Files"; + Extensions = ("gyp", "gypi"); + MIMETypes = ("text/gyp"); + Language = "xcode.lang.gyp"; + IsTextFile = YES; + IsSourceFile = YES; + } +) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/tools/Xcode/Specifications/gyp.xclangspec b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/tools/Xcode/Specifications/gyp.xclangspec new file mode 100644 index 00000000..3b3506d3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/tools/Xcode/Specifications/gyp.xclangspec @@ -0,0 +1,226 @@ +/* + Copyright (c) 2011 Google Inc. All rights reserved. + Use of this source code is governed by a BSD-style license that can be + found in the LICENSE file. + + gyp.xclangspec + GYP language specification for Xcode 3 + + There is not much documentation available regarding the format + of .xclangspec files. As a starting point, see for instance the + outdated documentation at: + http://maxao.free.fr/xcode-plugin-interface/specifications.html + and the files in: + /Developer/Library/PrivateFrameworks/XcodeEdit.framework/Versions/A/Resources/ + + Place this file in directory: + ~/Library/Application Support/Developer/Shared/Xcode/Specifications/ +*/ + +( + + { + Identifier = "xcode.lang.gyp.keyword"; + Syntax = { + Words = ( + "and", + "or", + " (caar gyp-parse-history) target-point) + (setq gyp-parse-history (cdr gyp-parse-history)))) + +(defun gyp-parse-point () + "The point of the last parse state added by gyp-parse-to." + (caar gyp-parse-history)) + +(defun gyp-parse-sections () + "A list of section symbols holding at the last parse state point." + (cdar gyp-parse-history)) + +(defun gyp-inside-dictionary-p () + "Predicate returning true if the parser is inside a dictionary." + (not (eq (cadar gyp-parse-history) 'list))) + +(defun gyp-add-parse-history (point sections) + "Add parse state SECTIONS to the parse history at POINT so that parsing can be + resumed instantly." + (while (>= (caar gyp-parse-history) point) + (setq gyp-parse-history (cdr gyp-parse-history))) + (setq gyp-parse-history (cons (cons point sections) gyp-parse-history))) + +(defun gyp-parse-to (target-point) + "Parses from (point) to TARGET-POINT adding the parse state information to + gyp-parse-state-history. Parsing stops if TARGET-POINT is reached or if a + string literal has been parsed. Returns nil if no further parsing can be + done, otherwise returns the position of the start of a parsed string, leaving + the point at the end of the string." + (let ((parsing t) + string-start) + (while parsing + (setq string-start nil) + ;; Parse up to a character that starts a sexp, or if the nesting + ;; level decreases. + (let ((state (parse-partial-sexp (gyp-parse-point) + target-point + -1 + t)) + (sections (gyp-parse-sections))) + (if (= (nth 0 state) -1) + (setq sections (cdr sections)) ; pop out a level + (cond ((looking-at-p "['\"]") ; a string + (setq string-start (point)) + (goto-char (scan-sexps (point) 1)) + (if (gyp-inside-dictionary-p) + ;; Look for sections inside a dictionary + (let ((section (gyp-section-name + (buffer-substring-no-properties + (+ 1 string-start) + (- (point) 1))))) + (setq sections (cons section (cdr sections))))) + ;; Stop after the string so it can be fontified. + (setq target-point (point))) + ((looking-at-p "{") + ;; Inside a dictionary. Increase nesting. + (forward-char 1) + (setq sections (cons 'unknown sections))) + ((looking-at-p "\\[") + ;; Inside a list. Increase nesting + (forward-char 1) + (setq sections (cons 'list sections))) + ((not (eobp)) + ;; other + (forward-char 1)))) + (gyp-add-parse-history (point) sections) + (setq parsing (< (point) target-point)))) + string-start)) + +(defun gyp-section-at-point () + "Transform the last parse state, which is a list of nested sections and return + the section symbol that should be used to determine font-lock information for + the string. Can return nil indicating the string should not have any attached + section." + (let ((sections (gyp-parse-sections))) + (cond + ((eq (car sections) 'conditions) + ;; conditions can occur in a variables section, but we still want to + ;; highlight it as a keyword. + nil) + ((and (eq (car sections) 'list) + (eq (cadr sections) 'list)) + ;; conditions and sources can have items in [[ ]] + (caddr sections)) + (t (cadr sections))))) + +(defun gyp-section-match (limit) + "Parse from (point) to LIMIT returning by means of match data what was + matched. The group of the match indicates what style font-lock should apply. + See also `gyp-add-font-lock-keywords'." + (gyp-invalidate-parse-states-after (point)) + (let ((group nil) + (string-start t)) + (while (and (< (point) limit) + (not group) + string-start) + (setq string-start (gyp-parse-to limit)) + (if string-start + (setq group (case (gyp-section-at-point) + ('dependencies 1) + ('variables 2) + ('conditions 2) + ('sources 3) + ('defines 4) + (nil nil))))) + (if group + (progn + ;; Set the match data to indicate to the font-lock mechanism the + ;; highlighting to be performed. + (set-match-data (append (list string-start (point)) + (make-list (* (1- group) 2) nil) + (list (1+ string-start) (1- (point))))) + t)))) + +;;; Please see http://code.google.com/p/gyp/wiki/GypLanguageSpecification for +;;; canonical list of keywords. +(defun gyp-add-font-lock-keywords () + "Add gyp-mode keywords to font-lock mechanism." + ;; TODO(jknotten): Move all the keyword highlighting into gyp-section-match + ;; so that we can do the font-locking in a single font-lock pass. + (font-lock-add-keywords + nil + (list + ;; Top-level keywords + (list (concat "['\"]\\(" + (regexp-opt (list "action" "action_name" "actions" "cflags" + "cflags_cc" "conditions" "configurations" + "copies" "defines" "dependencies" "destination" + "direct_dependent_settings" + "export_dependent_settings" "extension" "files" + "include_dirs" "includes" "inputs" "ldflags" "libraries" + "link_settings" "mac_bundle" "message" + "msvs_external_rule" "outputs" "product_name" + "process_outputs_as_sources" "rules" "rule_name" + "sources" "suppress_wildcard" + "target_conditions" "target_defaults" + "target_defines" "target_name" "toolsets" + "targets" "type" "variables" "xcode_settings")) + "[!/+=]?\\)") 1 'font-lock-keyword-face t) + ;; Type of target + (list (concat "['\"]\\(" + (regexp-opt (list "loadable_module" "static_library" + "shared_library" "executable" "none")) + "\\)") 1 'font-lock-type-face t) + (list "\\(?:target\\|action\\)_name['\"]\\s-*:\\s-*['\"]\\([^ '\"]*\\)" 1 + 'font-lock-function-name-face t) + (list 'gyp-section-match + (list 1 'font-lock-function-name-face t t) ; dependencies + (list 2 'font-lock-variable-name-face t t) ; variables, conditions + (list 3 'font-lock-constant-face t t) ; sources + (list 4 'font-lock-preprocessor-face t t)) ; preprocessor + ;; Variable expansion + (list "<@?(\\([^\n )]+\\))" 1 'font-lock-variable-name-face t) + ;; Command expansion + (list " "%s"' % (src, dst) + + print '}' + + +def main(): + if len(sys.argv) < 2: + print >>sys.stderr, __doc__ + print >>sys.stderr + print >>sys.stderr, 'usage: %s target1 target2...' % (sys.argv[0]) + return 1 + + edges = LoadEdges('dump.json', sys.argv[1:]) + + WriteGraph(edges) + return 0 + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/tools/pretty_gyp.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/tools/pretty_gyp.py new file mode 100644 index 00000000..c51d3587 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/tools/pretty_gyp.py @@ -0,0 +1,155 @@ +#!/usr/bin/env python + +# Copyright (c) 2012 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Pretty-prints the contents of a GYP file.""" + +import sys +import re + + +# Regex to remove comments when we're counting braces. +COMMENT_RE = re.compile(r'\s*#.*') + +# Regex to remove quoted strings when we're counting braces. +# It takes into account quoted quotes, and makes sure that the quotes match. +# NOTE: It does not handle quotes that span more than one line, or +# cases where an escaped quote is preceeded by an escaped backslash. +QUOTE_RE_STR = r'(?P[\'"])(.*?)(? 0: + after = True + + # This catches the special case of a closing brace having something + # other than just whitespace ahead of it -- we don't want to + # unindent that until after this line is printed so it stays with + # the previous indentation level. + if cnt < 0 and closing_prefix_re.match(stripline): + after = True + return (cnt, after) + + +def prettyprint_input(lines): + """Does the main work of indenting the input based on the brace counts.""" + indent = 0 + basic_offset = 2 + last_line = "" + for line in lines: + if COMMENT_RE.match(line): + print line + else: + line = line.strip('\r\n\t ') # Otherwise doesn't strip \r on Unix. + if len(line) > 0: + (brace_diff, after) = count_braces(line) + if brace_diff != 0: + if after: + print " " * (basic_offset * indent) + line + indent += brace_diff + else: + indent += brace_diff + print " " * (basic_offset * indent) + line + else: + print " " * (basic_offset * indent) + line + else: + print "" + last_line = line + + +def main(): + if len(sys.argv) > 1: + data = open(sys.argv[1]).read().splitlines() + else: + data = sys.stdin.read().splitlines() + # Split up the double braces. + lines = split_double_braces(data) + + # Indent and print the output. + prettyprint_input(lines) + return 0 + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/tools/pretty_sln.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/tools/pretty_sln.py new file mode 100644 index 00000000..ca8cf4ad --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/tools/pretty_sln.py @@ -0,0 +1,169 @@ +#!/usr/bin/env python + +# Copyright (c) 2012 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Prints the information in a sln file in a diffable way. + + It first outputs each projects in alphabetical order with their + dependencies. + + Then it outputs a possible build order. +""" + +__author__ = 'nsylvain (Nicolas Sylvain)' + +import os +import re +import sys +import pretty_vcproj + +def BuildProject(project, built, projects, deps): + # if all dependencies are done, we can build it, otherwise we try to build the + # dependency. + # This is not infinite-recursion proof. + for dep in deps[project]: + if dep not in built: + BuildProject(dep, built, projects, deps) + print project + built.append(project) + +def ParseSolution(solution_file): + # All projects, their clsid and paths. + projects = dict() + + # A list of dependencies associated with a project. + dependencies = dict() + + # Regular expressions that matches the SLN format. + # The first line of a project definition. + begin_project = re.compile(r'^Project\("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942' + r'}"\) = "(.*)", "(.*)", "(.*)"$') + # The last line of a project definition. + end_project = re.compile('^EndProject$') + # The first line of a dependency list. + begin_dep = re.compile( + r'ProjectSection\(ProjectDependencies\) = postProject$') + # The last line of a dependency list. + end_dep = re.compile('EndProjectSection$') + # A line describing a dependency. + dep_line = re.compile(' *({.*}) = ({.*})$') + + in_deps = False + solution = open(solution_file) + for line in solution: + results = begin_project.search(line) + if results: + # Hack to remove icu because the diff is too different. + if results.group(1).find('icu') != -1: + continue + # We remove "_gyp" from the names because it helps to diff them. + current_project = results.group(1).replace('_gyp', '') + projects[current_project] = [results.group(2).replace('_gyp', ''), + results.group(3), + results.group(2)] + dependencies[current_project] = [] + continue + + results = end_project.search(line) + if results: + current_project = None + continue + + results = begin_dep.search(line) + if results: + in_deps = True + continue + + results = end_dep.search(line) + if results: + in_deps = False + continue + + results = dep_line.search(line) + if results and in_deps and current_project: + dependencies[current_project].append(results.group(1)) + continue + + # Change all dependencies clsid to name instead. + for project in dependencies: + # For each dependencies in this project + new_dep_array = [] + for dep in dependencies[project]: + # Look for the project name matching this cldis + for project_info in projects: + if projects[project_info][1] == dep: + new_dep_array.append(project_info) + dependencies[project] = sorted(new_dep_array) + + return (projects, dependencies) + +def PrintDependencies(projects, deps): + print "---------------------------------------" + print "Dependencies for all projects" + print "---------------------------------------" + print "-- --" + + for (project, dep_list) in sorted(deps.items()): + print "Project : %s" % project + print "Path : %s" % projects[project][0] + if dep_list: + for dep in dep_list: + print " - %s" % dep + print "" + + print "-- --" + +def PrintBuildOrder(projects, deps): + print "---------------------------------------" + print "Build order " + print "---------------------------------------" + print "-- --" + + built = [] + for (project, _) in sorted(deps.items()): + if project not in built: + BuildProject(project, built, projects, deps) + + print "-- --" + +def PrintVCProj(projects): + + for project in projects: + print "-------------------------------------" + print "-------------------------------------" + print project + print project + print project + print "-------------------------------------" + print "-------------------------------------" + + project_path = os.path.abspath(os.path.join(os.path.dirname(sys.argv[1]), + projects[project][2])) + + pretty = pretty_vcproj + argv = [ '', + project_path, + '$(SolutionDir)=%s\\' % os.path.dirname(sys.argv[1]), + ] + argv.extend(sys.argv[3:]) + pretty.main(argv) + +def main(): + # check if we have exactly 1 parameter. + if len(sys.argv) < 2: + print 'Usage: %s "c:\\path\\to\\project.sln"' % sys.argv[0] + return 1 + + (projects, deps) = ParseSolution(sys.argv[1]) + PrintDependencies(projects, deps) + PrintBuildOrder(projects, deps) + + if '--recursive' in sys.argv: + PrintVCProj(projects) + return 0 + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/tools/pretty_vcproj.py b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/tools/pretty_vcproj.py new file mode 100644 index 00000000..6099bd7c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/gyp/tools/pretty_vcproj.py @@ -0,0 +1,329 @@ +#!/usr/bin/env python + +# Copyright (c) 2012 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Make the format of a vcproj really pretty. + + This script normalize and sort an xml. It also fetches all the properties + inside linked vsprops and include them explicitly in the vcproj. + + It outputs the resulting xml to stdout. +""" + +__author__ = 'nsylvain (Nicolas Sylvain)' + +import os +import sys + +from xml.dom.minidom import parse +from xml.dom.minidom import Node + +REPLACEMENTS = dict() +ARGUMENTS = None + + +class CmpTuple(object): + """Compare function between 2 tuple.""" + def __call__(self, x, y): + return cmp(x[0], y[0]) + + +class CmpNode(object): + """Compare function between 2 xml nodes.""" + + def __call__(self, x, y): + def get_string(node): + node_string = "node" + node_string += node.nodeName + if node.nodeValue: + node_string += node.nodeValue + + if node.attributes: + # We first sort by name, if present. + node_string += node.getAttribute("Name") + + all_nodes = [] + for (name, value) in node.attributes.items(): + all_nodes.append((name, value)) + + all_nodes.sort(CmpTuple()) + for (name, value) in all_nodes: + node_string += name + node_string += value + + return node_string + + return cmp(get_string(x), get_string(y)) + + +def PrettyPrintNode(node, indent=0): + if node.nodeType == Node.TEXT_NODE: + if node.data.strip(): + print '%s%s' % (' '*indent, node.data.strip()) + return + + if node.childNodes: + node.normalize() + # Get the number of attributes + attr_count = 0 + if node.attributes: + attr_count = node.attributes.length + + # Print the main tag + if attr_count == 0: + print '%s<%s>' % (' '*indent, node.nodeName) + else: + print '%s<%s' % (' '*indent, node.nodeName) + + all_attributes = [] + for (name, value) in node.attributes.items(): + all_attributes.append((name, value)) + all_attributes.sort(CmpTuple()) + for (name, value) in all_attributes: + print '%s %s="%s"' % (' '*indent, name, value) + print '%s>' % (' '*indent) + if node.nodeValue: + print '%s %s' % (' '*indent, node.nodeValue) + + for sub_node in node.childNodes: + PrettyPrintNode(sub_node, indent=indent+2) + print '%s' % (' '*indent, node.nodeName) + + +def FlattenFilter(node): + """Returns a list of all the node and sub nodes.""" + node_list = [] + + if (node.attributes and + node.getAttribute('Name') == '_excluded_files'): + # We don't add the "_excluded_files" filter. + return [] + + for current in node.childNodes: + if current.nodeName == 'Filter': + node_list.extend(FlattenFilter(current)) + else: + node_list.append(current) + + return node_list + + +def FixFilenames(filenames, current_directory): + new_list = [] + for filename in filenames: + if filename: + for key in REPLACEMENTS: + filename = filename.replace(key, REPLACEMENTS[key]) + os.chdir(current_directory) + filename = filename.strip('"\' ') + if filename.startswith('$'): + new_list.append(filename) + else: + new_list.append(os.path.abspath(filename)) + return new_list + + +def AbsoluteNode(node): + """Makes all the properties we know about in this node absolute.""" + if node.attributes: + for (name, value) in node.attributes.items(): + if name in ['InheritedPropertySheets', 'RelativePath', + 'AdditionalIncludeDirectories', + 'IntermediateDirectory', 'OutputDirectory', + 'AdditionalLibraryDirectories']: + # We want to fix up these paths + path_list = value.split(';') + new_list = FixFilenames(path_list, os.path.dirname(ARGUMENTS[1])) + node.setAttribute(name, ';'.join(new_list)) + if not value: + node.removeAttribute(name) + + +def CleanupVcproj(node): + """For each sub node, we call recursively this function.""" + for sub_node in node.childNodes: + AbsoluteNode(sub_node) + CleanupVcproj(sub_node) + + # Normalize the node, and remove all extranous whitespaces. + for sub_node in node.childNodes: + if sub_node.nodeType == Node.TEXT_NODE: + sub_node.data = sub_node.data.replace("\r", "") + sub_node.data = sub_node.data.replace("\n", "") + sub_node.data = sub_node.data.rstrip() + + # Fix all the semicolon separated attributes to be sorted, and we also + # remove the dups. + if node.attributes: + for (name, value) in node.attributes.items(): + sorted_list = sorted(value.split(';')) + unique_list = [] + for i in sorted_list: + if not unique_list.count(i): + unique_list.append(i) + node.setAttribute(name, ';'.join(unique_list)) + if not value: + node.removeAttribute(name) + + if node.childNodes: + node.normalize() + + # For each node, take a copy, and remove it from the list. + node_array = [] + while node.childNodes and node.childNodes[0]: + # Take a copy of the node and remove it from the list. + current = node.childNodes[0] + node.removeChild(current) + + # If the child is a filter, we want to append all its children + # to this same list. + if current.nodeName == 'Filter': + node_array.extend(FlattenFilter(current)) + else: + node_array.append(current) + + + # Sort the list. + node_array.sort(CmpNode()) + + # Insert the nodes in the correct order. + for new_node in node_array: + # But don't append empty tool node. + if new_node.nodeName == 'Tool': + if new_node.attributes and new_node.attributes.length == 1: + # This one was empty. + continue + if new_node.nodeName == 'UserMacro': + continue + node.appendChild(new_node) + + +def GetConfiguationNodes(vcproj): + #TODO(nsylvain): Find a better way to navigate the xml. + nodes = [] + for node in vcproj.childNodes: + if node.nodeName == "Configurations": + for sub_node in node.childNodes: + if sub_node.nodeName == "Configuration": + nodes.append(sub_node) + + return nodes + + +def GetChildrenVsprops(filename): + dom = parse(filename) + if dom.documentElement.attributes: + vsprops = dom.documentElement.getAttribute('InheritedPropertySheets') + return FixFilenames(vsprops.split(';'), os.path.dirname(filename)) + return [] + +def SeekToNode(node1, child2): + # A text node does not have properties. + if child2.nodeType == Node.TEXT_NODE: + return None + + # Get the name of the current node. + current_name = child2.getAttribute("Name") + if not current_name: + # There is no name. We don't know how to merge. + return None + + # Look through all the nodes to find a match. + for sub_node in node1.childNodes: + if sub_node.nodeName == child2.nodeName: + name = sub_node.getAttribute("Name") + if name == current_name: + return sub_node + + # No match. We give up. + return None + + +def MergeAttributes(node1, node2): + # No attributes to merge? + if not node2.attributes: + return + + for (name, value2) in node2.attributes.items(): + # Don't merge the 'Name' attribute. + if name == 'Name': + continue + value1 = node1.getAttribute(name) + if value1: + # The attribute exist in the main node. If it's equal, we leave it + # untouched, otherwise we concatenate it. + if value1 != value2: + node1.setAttribute(name, ';'.join([value1, value2])) + else: + # The attribute does nto exist in the main node. We append this one. + node1.setAttribute(name, value2) + + # If the attribute was a property sheet attributes, we remove it, since + # they are useless. + if name == 'InheritedPropertySheets': + node1.removeAttribute(name) + + +def MergeProperties(node1, node2): + MergeAttributes(node1, node2) + for child2 in node2.childNodes: + child1 = SeekToNode(node1, child2) + if child1: + MergeProperties(child1, child2) + else: + node1.appendChild(child2.cloneNode(True)) + + +def main(argv): + """Main function of this vcproj prettifier.""" + global ARGUMENTS + ARGUMENTS = argv + + # check if we have exactly 1 parameter. + if len(argv) < 2: + print ('Usage: %s "c:\\path\\to\\vcproj.vcproj" [key1=value1] ' + '[key2=value2]' % argv[0]) + return 1 + + # Parse the keys + for i in range(2, len(argv)): + (key, value) = argv[i].split('=') + REPLACEMENTS[key] = value + + # Open the vcproj and parse the xml. + dom = parse(argv[1]) + + # First thing we need to do is find the Configuration Node and merge them + # with the vsprops they include. + for configuration_node in GetConfiguationNodes(dom.documentElement): + # Get the property sheets associated with this configuration. + vsprops = configuration_node.getAttribute('InheritedPropertySheets') + + # Fix the filenames to be absolute. + vsprops_list = FixFilenames(vsprops.strip().split(';'), + os.path.dirname(argv[1])) + + # Extend the list of vsprops with all vsprops contained in the current + # vsprops. + for current_vsprops in vsprops_list: + vsprops_list.extend(GetChildrenVsprops(current_vsprops)) + + # Now that we have all the vsprops, we need to merge them. + for current_vsprops in vsprops_list: + MergeProperties(configuration_node, + parse(current_vsprops).documentElement) + + # Now that everything is merged, we need to cleanup the xml. + CleanupVcproj(dom.documentElement) + + # Finally, we use the prett xml function to print the vcproj back to the + # user. + #print dom.toprettyxml(newl="\n") + PrettyPrintNode(dom.documentElement) + return 0 + + +if __name__ == '__main__': + sys.exit(main(sys.argv)) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/lib/build.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/lib/build.js new file mode 100644 index 00000000..22f25836 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/lib/build.js @@ -0,0 +1,284 @@ + +module.exports = exports = build + +/** + * Module dependencies. + */ + +var fs = require('graceful-fs') + , rm = require('rimraf') + , path = require('path') + , glob = require('glob') + , log = require('npmlog') + , which = require('which') + , mkdirp = require('mkdirp') + , exec = require('child_process').exec + , processRelease = require('./process-release') + , win = process.platform == 'win32' + +exports.usage = 'Invokes `' + (win ? 'msbuild' : 'make') + '` and builds the module' + +function build (gyp, argv, callback) { + var platformMake = 'make' + if (process.platform === 'aix') { + platformMake = 'gmake' + } else if (process.platform.indexOf('bsd') !== -1) { + platformMake = 'gmake' + } + + var release = processRelease(argv, gyp, process.version, process.release) + , makeCommand = gyp.opts.make || process.env.MAKE || platformMake + , command = win ? 'msbuild' : makeCommand + , buildDir = path.resolve('build') + , configPath = path.resolve(buildDir, 'config.gypi') + , jobs = gyp.opts.jobs || process.env.JOBS + , buildType + , config + , arch + , nodeDir + , copyDevLib + + loadConfigGypi() + + /** + * Load the "config.gypi" file that was generated during "configure". + */ + + function loadConfigGypi () { + fs.readFile(configPath, 'utf8', function (err, data) { + if (err) { + if (err.code == 'ENOENT') { + callback(new Error('You must run `node-gyp configure` first!')) + } else { + callback(err) + } + return + } + config = JSON.parse(data.replace(/\#.+\n/, '')) + + // get the 'arch', 'buildType', and 'nodeDir' vars from the config + buildType = config.target_defaults.default_configuration + arch = config.variables.target_arch + nodeDir = config.variables.nodedir + copyDevLib = config.variables.copy_dev_lib == 'true' + + if ('debug' in gyp.opts) { + buildType = gyp.opts.debug ? 'Debug' : 'Release' + } + if (!buildType) { + buildType = 'Release' + } + + log.verbose('build type', buildType) + log.verbose('architecture', arch) + log.verbose('node dev dir', nodeDir) + + if (win) { + findSolutionFile() + } else { + doWhich() + } + }) + } + + /** + * On Windows, find the first build/*.sln file. + */ + + function findSolutionFile () { + glob('build/*.sln', function (err, files) { + if (err) return callback(err) + if (files.length === 0) { + return callback(new Error('Could not find *.sln file. Did you run "configure"?')) + } + guessedSolution = files[0] + log.verbose('found first Solution file', guessedSolution) + doWhich() + }) + } + + /** + * Uses node-which to locate the msbuild / make executable. + */ + + function doWhich () { + // First make sure we have the build command in the PATH + which(command, function (err, execPath) { + if (err) { + if (win && /not found/.test(err.message)) { + // On windows and no 'msbuild' found. Let's guess where it is + findMsbuild() + } else { + // Some other error or 'make' not found on Unix, report that to the user + callback(err) + } + return + } + log.verbose('`which` succeeded for `' + command + '`', execPath) + copyNodeLib() + }) + } + + /** + * Search for the location of "msbuild.exe" file on Windows. + */ + + function findMsbuild () { + log.verbose('could not find "msbuild.exe" in PATH - finding location in registry') + var notfoundErr = 'Can\'t find "msbuild.exe". Do you have Microsoft Visual Studio C++ 2008+ installed?' + var cmd = 'reg query "HKLM\\Software\\Microsoft\\MSBuild\\ToolsVersions" /s' + if (process.arch !== 'ia32') + cmd += ' /reg:32' + exec(cmd, function (err, stdout, stderr) { + if (err) { + return callback(new Error(err.message + '\n' + notfoundErr)) + } + var reVers = /ToolsVersions\\([^\\]+)$/i + , rePath = /\r\n[ \t]+MSBuildToolsPath[ \t]+REG_SZ[ \t]+([^\r]+)/i + , msbuilds = [] + , r + , msbuildPath + stdout.split('\r\n\r\n').forEach(function(l) { + if (!l) return + l = l.trim() + if (r = reVers.exec(l.substring(0, l.indexOf('\r\n')))) { + var ver = parseFloat(r[1], 10) + if (ver >= 3.5) { + if (r = rePath.exec(l)) { + msbuilds.push({ + version: ver, + path: r[1] + }) + } + } + } + }) + msbuilds.sort(function (x, y) { + return (x.version < y.version ? -1 : 1) + }) + ;(function verifyMsbuild () { + if (!msbuilds.length) return callback(new Error(notfoundErr)) + msbuildPath = path.resolve(msbuilds.pop().path, 'msbuild.exe') + fs.stat(msbuildPath, function (err, stat) { + if (err) { + if (err.code == 'ENOENT') { + if (msbuilds.length) { + return verifyMsbuild() + } else { + callback(new Error(notfoundErr)) + } + } else { + callback(err) + } + return + } + command = msbuildPath + copyNodeLib() + }) + })() + }) + } + + /** + * Copies the node.lib file for the current target architecture into the + * current proper dev dir location. + */ + + function copyNodeLib () { + if (!win || !copyDevLib) return doBuild() + + var buildDir = path.resolve(nodeDir, buildType) + , archNodeLibPath = path.resolve(nodeDir, arch, release.name + '.lib') + , buildNodeLibPath = path.resolve(buildDir, release.name + '.lib') + + mkdirp(buildDir, function (err, isNew) { + if (err) return callback(err) + log.verbose('"' + buildType + '" dir needed to be created?', isNew) + var rs = fs.createReadStream(archNodeLibPath) + , ws = fs.createWriteStream(buildNodeLibPath) + log.verbose('copying "' + release.name + '.lib" for ' + arch, buildNodeLibPath) + rs.pipe(ws) + rs.on('error', callback) + ws.on('error', callback) + rs.on('end', doBuild) + }) + } + + /** + * Actually spawn the process and compile the module. + */ + + function doBuild () { + + // Enable Verbose build + var verbose = log.levels[log.level] <= log.levels.verbose + if (!win && verbose) { + argv.push('V=1') + } + if (win && !verbose) { + argv.push('/clp:Verbosity=minimal') + } + + if (win) { + // Turn off the Microsoft logo on Windows + argv.push('/nologo') + } + + // Specify the build type, Release by default + if (win) { + var p = arch === 'x64' ? 'x64' : 'Win32' + argv.push('/p:Configuration=' + buildType + ';Platform=' + p) + if (jobs) { + var j = parseInt(jobs, 10) + if (!isNaN(j) && j > 0) { + argv.push('/m:' + j) + } else if (jobs.toUpperCase() === 'MAX') { + argv.push('/m:' + require('os').cpus().length) + } + } + } else { + argv.push('BUILDTYPE=' + buildType) + // Invoke the Makefile in the 'build' dir. + argv.push('-C') + argv.push('build') + if (jobs) { + var j = parseInt(jobs, 10) + if (!isNaN(j) && j > 0) { + argv.push('--jobs') + argv.push(j) + } else if (jobs.toUpperCase() === 'MAX') { + argv.push('--jobs') + argv.push(require('os').cpus().length) + } + } + } + + if (win) { + // did the user specify their own .sln file? + var hasSln = argv.some(function (arg) { + return path.extname(arg) == '.sln' + }) + if (!hasSln) { + argv.unshift(gyp.opts.solution || guessedSolution) + } + } + + var proc = gyp.spawn(command, argv) + proc.on('exit', onExit) + } + + /** + * Invoked after the make/msbuild command exits. + */ + + function onExit (code, signal) { + if (code !== 0) { + return callback(new Error('`' + command + '` failed with exit code: ' + code)) + } + if (signal) { + return callback(new Error('`' + command + '` got signal: ' + signal)) + } + callback() + } + +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/lib/clean.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/lib/clean.js new file mode 100644 index 00000000..e69164d4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/lib/clean.js @@ -0,0 +1,22 @@ + +module.exports = exports = clean + +exports.usage = 'Removes any generated build files and the "out" dir' + +/** + * Module dependencies. + */ + +var rm = require('rimraf') +var log = require('npmlog') + + +function clean (gyp, argv, callback) { + + // Remove the 'build' dir + var buildDir = 'build' + + log.verbose('clean', 'removing "%s" directory', buildDir) + rm(buildDir, callback) + +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/lib/configure.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/lib/configure.js new file mode 100644 index 00000000..4543bce7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/lib/configure.js @@ -0,0 +1,458 @@ +module.exports = exports = configure +module.exports.test = { findAccessibleSync: findAccessibleSync, + findPython: findPython } + +/** + * Module dependencies. + */ + +var fs = require('graceful-fs') + , path = require('path') + , log = require('npmlog') + , osenv = require('osenv') + , which = require('which') + , semver = require('semver') + , mkdirp = require('mkdirp') + , cp = require('child_process') + , PathArray = require('path-array') + , extend = require('util')._extend + , processRelease = require('./process-release') + , spawn = cp.spawn + , execFile = cp.execFile + , win = process.platform == 'win32' + , findNodeDirectory = require('./find-node-directory') + , msgFormat = require('util').format + +exports.usage = 'Generates ' + (win ? 'MSVC project files' : 'a Makefile') + ' for the current module' + +function configure (gyp, argv, callback) { + + var python = gyp.opts.python || process.env.PYTHON || 'python2' + , buildDir = path.resolve('build') + , configNames = [ 'config.gypi', 'common.gypi' ] + , configs = [] + , nodeDir + , release = processRelease(argv, gyp, process.version, process.release) + + findPython(python, function (err, found) { + if (err) { + callback(err) + } else { + python = found + getNodeDir() + } + }) + + function getNodeDir () { + + // 'python' should be set by now + process.env.PYTHON = python + + if (gyp.opts.nodedir) { + // --nodedir was specified. use that for the dev files + nodeDir = gyp.opts.nodedir.replace(/^~/, osenv.home()) + + log.verbose('get node dir', 'compiling against specified --nodedir dev files: %s', nodeDir) + createBuildDir() + + } else { + // if no --nodedir specified, ensure node dependencies are installed + if ('v' + release.version !== process.version) { + // if --target was given, then determine a target version to compile for + log.verbose('get node dir', 'compiling against --target node version: %s', release.version) + } else { + // if no --target was specified then use the current host node version + log.verbose('get node dir', 'no --target version specified, falling back to host node version: %s', release.version) + } + + if (!release.semver) { + // could not parse the version string with semver + return callback(new Error('Invalid version number: ' + release.version)) + } + + // ensure that the target node version's dev files are installed + gyp.opts.ensure = true + gyp.commands.install([ release.version ], function (err, version) { + if (err) return callback(err) + log.verbose('get node dir', 'target node version installed:', release.versionDir) + nodeDir = path.resolve(gyp.devDir, release.versionDir) + createBuildDir() + }) + } + } + + function createBuildDir () { + log.verbose('build dir', 'attempting to create "build" dir: %s', buildDir) + mkdirp(buildDir, function (err, isNew) { + if (err) return callback(err) + log.verbose('build dir', '"build" dir needed to be created?', isNew) + createConfigFile() + }) + } + + function createConfigFile (err) { + if (err) return callback(err) + + var configFilename = 'config.gypi' + var configPath = path.resolve(buildDir, configFilename) + + log.verbose('build/' + configFilename, 'creating config file') + + var config = process.config || {} + , defaults = config.target_defaults + , variables = config.variables + + // default "config.variables" + if (!variables) variables = config.variables = {} + + // default "config.defaults" + if (!defaults) defaults = config.target_defaults = {} + + // don't inherit the "defaults" from node's `process.config` object. + // doing so could cause problems in cases where the `node` executable was + // compiled on a different machine (with different lib/include paths) than + // the machine where the addon is being built to + defaults.cflags = [] + defaults.defines = [] + defaults.include_dirs = [] + defaults.libraries = [] + + // set the default_configuration prop + if ('debug' in gyp.opts) { + defaults.default_configuration = gyp.opts.debug ? 'Debug' : 'Release' + } + if (!defaults.default_configuration) { + defaults.default_configuration = 'Release' + } + + // set the target_arch variable + variables.target_arch = gyp.opts.arch || process.arch || 'ia32' + + // set the node development directory + variables.nodedir = nodeDir + + // don't copy dev libraries with nodedir option + variables.copy_dev_lib = !gyp.opts.nodedir + + // disable -T "thin" static archives by default + variables.standalone_static_library = gyp.opts.thin ? 0 : 1 + + // loop through the rest of the opts and add the unknown ones as variables. + // this allows for module-specific configure flags like: + // + // $ node-gyp configure --shared-libxml2 + Object.keys(gyp.opts).forEach(function (opt) { + if (opt === 'argv') return + if (opt in gyp.configDefs) return + variables[opt.replace(/-/g, '_')] = gyp.opts[opt] + }) + + // ensures that any boolean values from `process.config` get stringified + function boolsToString (k, v) { + if (typeof v === 'boolean') + return String(v) + return v + } + + log.silly('build/' + configFilename, config) + + // now write out the config.gypi file to the build/ dir + var prefix = '# Do not edit. File was generated by node-gyp\'s "configure" step' + , json = JSON.stringify(config, boolsToString, 2) + log.verbose('build/' + configFilename, 'writing out config file: %s', configPath) + configs.push(configPath) + fs.writeFile(configPath, [prefix, json, ''].join('\n'), findConfigs) + } + + function findConfigs (err) { + if (err) return callback(err) + var name = configNames.shift() + if (!name) return runGyp() + var fullPath = path.resolve(name) + log.verbose(name, 'checking for gypi file: %s', fullPath) + fs.stat(fullPath, function (err, stat) { + if (err) { + if (err.code == 'ENOENT') { + findConfigs() // check next gypi filename + } else { + callback(err) + } + } else { + log.verbose(name, 'found gypi file') + configs.push(fullPath) + findConfigs() + } + }) + } + + function runGyp (err) { + if (err) return callback(err) + + if (!~argv.indexOf('-f') && !~argv.indexOf('--format')) { + if (win) { + log.verbose('gyp', 'gyp format was not specified; forcing "msvs"') + // force the 'make' target for non-Windows + argv.push('-f', 'msvs') + } else { + log.verbose('gyp', 'gyp format was not specified; forcing "make"') + // force the 'make' target for non-Windows + argv.push('-f', 'make') + } + } + + function hasMsvsVersion () { + return argv.some(function (arg) { + return arg.indexOf('msvs_version') === 0 + }) + } + + if (win && !hasMsvsVersion()) { + if ('msvs_version' in gyp.opts) { + argv.push('-G', 'msvs_version=' + gyp.opts.msvs_version) + } else { + argv.push('-G', 'msvs_version=auto') + } + } + + // include all the ".gypi" files that were found + configs.forEach(function (config) { + argv.push('-I', config) + }) + + // for AIX we need to set up the path to the exp file + // which contains the symbols needed for linking. + // The file will either be in one of the following + // depending on whether it is an installed or + // development environment: + // - the include/node directory + // - the out/Release directory + // - the out/Debug directory + // - the root directory + var node_exp_file = undefined + if (process.platform === 'aix') { + var node_root_dir = findNodeDirectory() + var candidates = ['include/node/node.exp', + 'out/Release/node.exp', + 'out/Debug/node.exp', + 'node.exp'] + var logprefix = 'find exports file' + node_exp_file = findAccessibleSync(logprefix, node_root_dir, candidates) + if (node_exp_file !== undefined) { + log.verbose(logprefix, 'Found exports file: %s', node_exp_file) + } else { + var msg = msgFormat('Could not find node.exp file in %s', node_root_dir) + log.error(logprefix, 'Could not find exports file') + return callback(new Error(msg)) + } + } + + // this logic ported from the old `gyp_addon` python file + var gyp_script = path.resolve(__dirname, '..', 'gyp', 'gyp_main.py') + var addon_gypi = path.resolve(__dirname, '..', 'addon.gypi') + var common_gypi = path.resolve(nodeDir, 'include/node/common.gypi') + fs.stat(common_gypi, function (err, stat) { + if (err) + common_gypi = path.resolve(nodeDir, 'common.gypi') + + var output_dir = 'build' + if (win) { + // Windows expects an absolute path + output_dir = buildDir + } + var nodeGypDir = path.resolve(__dirname, '..') + + argv.push('-I', addon_gypi) + argv.push('-I', common_gypi) + argv.push('-Dlibrary=shared_library') + argv.push('-Dvisibility=default') + argv.push('-Dnode_root_dir=' + nodeDir) + if (process.platform === 'aix') { + argv.push('-Dnode_exp_file=' + node_exp_file) + } + argv.push('-Dnode_gyp_dir=' + nodeGypDir) + argv.push('-Dnode_lib_file=' + release.name + '.lib') + argv.push('-Dmodule_root_dir=' + process.cwd()) + argv.push('--depth=.') + argv.push('--no-parallel') + + // tell gyp to write the Makefile/Solution files into output_dir + argv.push('--generator-output', output_dir) + + // tell make to write its output into the same dir + argv.push('-Goutput_dir=.') + + // enforce use of the "binding.gyp" file + argv.unshift('binding.gyp') + + // execute `gyp` from the current target nodedir + argv.unshift(gyp_script) + + // make sure python uses files that came with this particular node package + var pypath = new PathArray(process.env, 'PYTHONPATH') + pypath.unshift(path.join(__dirname, '..', 'gyp', 'pylib')) + + var cp = gyp.spawn(python, argv) + cp.on('exit', onCpExit) + }) + } + + /** + * Called when the `gyp` child process exits. + */ + + function onCpExit (code, signal) { + if (code !== 0) { + callback(new Error('`gyp` failed with exit code: ' + code)) + } else { + // we're done + callback() + } + } + +} + +/** + * Returns the first file or directory from an array of candidates that is + * readable by the current user, or undefined if none of the candidates are + * readable. + */ +function findAccessibleSync (logprefix, dir, candidates) { + for (var next = 0; next < candidates.length; next++) { + var candidate = path.resolve(dir, candidates[next]) + try { + var fd = fs.openSync(candidate, 'r') + } catch (e) { + // this candidate was not found or not readable, do nothing + log.silly(logprefix, 'Could not open %s: %s', candidate, e.message) + continue + } + fs.closeSync(fd) + log.silly(logprefix, 'Found readable %s', candidate) + return candidate + } + + return undefined +} + +function findPython (python, callback) { + checkPython() + + // Check if Python is in the $PATH + function checkPython () { + log.verbose('check python', 'checking for Python executable "%s" in the PATH', python) + which(python, function (err, execPath) { + if (err) { + log.verbose('`which` failed', python, err) + if (python === 'python2') { + python = 'python' + return checkPython() + } + if (win) { + checkPythonLauncher() + } else { + failNoPython() + } + } else { + log.verbose('`which` succeeded', python, execPath) + // Found the `python` exceutable, and from now on we use it explicitly. + // This solves #667 and #750 (`execFile` won't run batch files + // (*.cmd, and *.bat)) + python = execPath + checkPythonVersion() + } + }) + } + + // Distributions of Python on Windows by default install with the "py.exe" + // Python launcher which is more likely to exist than the Python executable + // being in the $PATH. + // Because the Python launcher supports all versions of Python, we have to + // explicitly request a Python 2 version. This is done by supplying "-2" as + // the first command line argument. Since "py.exe -2" would be an invalid + // executable for "execFile", we have to use the launcher to figure out + // where the actual "python.exe" executable is located. + function checkPythonLauncher () { + log.verbose('could not find "' + python + '". checking python launcher') + var env = extend({}, process.env) + env.TERM = 'dumb' + + var launcherArgs = ['-2', '-c', 'import sys; print sys.executable'] + execFile('py.exe', launcherArgs, { env: env }, function (err, stdout) { + if (err) { + guessPython() + return + } + python = stdout.trim() + log.verbose('check python launcher', 'python executable found: %j', python) + checkPythonVersion() + }) + } + + // Called on Windows when "python" isn't available in the current $PATH. + // We're gonna check if "%SystemDrive%\python27\python.exe" exists. + function guessPython () { + log.verbose('could not find "' + python + '". guessing location') + var rootDir = process.env.SystemDrive || 'C:\\' + if (rootDir[rootDir.length - 1] !== '\\') { + rootDir += '\\' + } + var pythonPath = path.resolve(rootDir, 'Python27', 'python.exe') + log.verbose('ensuring that file exists:', pythonPath) + fs.stat(pythonPath, function (err, stat) { + if (err) { + if (err.code == 'ENOENT') { + failNoPython() + } else { + callback(err) + } + return + } + python = pythonPath + checkPythonVersion() + }) + } + + function checkPythonVersion () { + var env = extend({}, process.env) + env.TERM = 'dumb' + + execFile(python, ['-c', 'import platform; print(platform.python_version());'], { env: env }, function (err, stdout) { + if (err) { + return callback(err) + } + log.verbose('check python version', '`%s -c "import platform; print(platform.python_version());"` returned: %j', python, stdout) + var version = stdout.trim() + if (~version.indexOf('+')) { + log.silly('stripping "+" sign(s) from version') + version = version.replace(/\+/g, '') + } + if (~version.indexOf('rc')) { + log.silly('stripping "rc" identifier from version') + version = version.replace(/rc(.*)$/ig, '') + } + var range = semver.Range('>=2.5.0 <3.0.0') + var valid = false + try { + valid = range.test(version) + } catch (e) { + log.silly('range.test() error', e) + } + if (valid) { + callback(null, python) + } else { + failPythonVersion(version) + } + }) + } + + function failNoPython () { + callback(new Error('Can\'t find Python executable "' + python + + '", you can set the PYTHON env variable.')) + } + + function failPythonVersion (badVersion) { + callback(new Error('Python executable "' + python + + '" is v' + badVersion + ', which is not supported by gyp.\n' + + 'You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.')) + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/lib/find-node-directory.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/lib/find-node-directory.js new file mode 100644 index 00000000..3aee8a10 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/lib/find-node-directory.js @@ -0,0 +1,61 @@ +var path = require('path') + , log = require('npmlog') + +function findNodeDirectory(scriptLocation, processObj) { + // set dirname and process if not passed in + // this facilitates regression tests + if (scriptLocation === undefined) { + scriptLocation = __dirname + } + if (processObj === undefined) { + processObj = process + } + + // Have a look to see what is above us, to try and work out where we are + npm_parent_directory = path.join(scriptLocation, '../../../..') + log.verbose('node-gyp root', 'npm_parent_directory is ' + + path.basename(npm_parent_directory)) + node_root_dir = "" + + log.verbose('node-gyp root', 'Finding node root directory') + if (path.basename(npm_parent_directory) === 'deps') { + // We are in a build directory where this script lives in + // deps/npm/node_modules/node-gyp/lib + node_root_dir = path.join(npm_parent_directory, '..') + log.verbose('node-gyp root', 'in build directory, root = ' + + node_root_dir) + } else if (path.basename(npm_parent_directory) === 'node_modules') { + // We are in a node install directory where this script lives in + // lib/node_modules/npm/node_modules/node-gyp/lib or + // node_modules/npm/node_modules/node-gyp/lib depending on the + // platform + if (processObj.platform === 'win32') { + node_root_dir = path.join(npm_parent_directory, '..') + } else { + node_root_dir = path.join(npm_parent_directory, '../..') + } + log.verbose('node-gyp root', 'in install directory, root = ' + + node_root_dir) + } else { + // We don't know where we are, try working it out from the location + // of the node binary + var node_dir = path.dirname(processObj.execPath) + var directory_up = path.basename(node_dir) + if (directory_up === 'bin') { + node_root_dir = path.join(node_dir, '..') + } else if (directory_up === 'Release' || directory_up === 'Debug') { + // If we are a recently built node, and the directory structure + // is that of a repository. If we are on Windows then we only need + // to go one level up, everything else, two + if (processObj.platform === 'win32') { + node_root_dir = path.join(node_dir, '..') + } else { + node_root_dir = path.join(node_dir, '../..') + } + } + // Else return the default blank, "". + } + return node_root_dir +} + +module.exports = findNodeDirectory diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/lib/install.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/lib/install.js new file mode 100644 index 00000000..fa2e1c54 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/lib/install.js @@ -0,0 +1,469 @@ + +module.exports = exports = install + +module.exports.test = { download: download, readCAFile: readCAFile } + +exports.usage = 'Install node development files for the specified node version.' + +/** + * Module dependencies. + */ + +var fs = require('graceful-fs') + , osenv = require('osenv') + , tar = require('tar') + , rm = require('rimraf') + , path = require('path') + , crypto = require('crypto') + , zlib = require('zlib') + , log = require('npmlog') + , semver = require('semver') + , fstream = require('fstream') + , request = require('request') + , minimatch = require('minimatch') + , mkdir = require('mkdirp') + , processRelease = require('./process-release') + , win = process.platform == 'win32' + +function install (gyp, argv, callback) { + + var release = processRelease(argv, gyp, process.version, process.release) + + // ensure no double-callbacks happen + function cb (err) { + if (cb.done) return + cb.done = true + if (err) { + log.warn('install', 'got an error, rolling back install') + // roll-back the install if anything went wrong + gyp.commands.remove([ release.versionDir ], function (err2) { + callback(err) + }) + } else { + callback(null, release.version) + } + } + + // Determine which node dev files version we are installing + log.verbose('install', 'input version string %j', release.version) + + if (!release.semver) { + // could not parse the version string with semver + return callback(new Error('Invalid version number: ' + release.version)) + } + + if (semver.lt(release.version, '0.8.0')) { + return callback(new Error('Minimum target version is `0.8.0` or greater. Got: ' + release.version)) + } + + // 0.x.y-pre versions are not published yet and cannot be installed. Bail. + if (release.semver.prerelease[0] === 'pre') { + log.verbose('detected "pre" node version', release.version) + if (gyp.opts.nodedir) { + log.verbose('--nodedir flag was passed; skipping install', gyp.opts.nodedir) + callback() + } else { + callback(new Error('"pre" versions of node cannot be installed, use the --nodedir flag instead')) + } + return + } + + // flatten version into String + log.verbose('install', 'installing version: %s', release.versionDir) + + // the directory where the dev files will be installed + var devDir = path.resolve(gyp.devDir, release.versionDir) + + // If '--ensure' was passed, then don't *always* install the version; + // check if it is already installed, and only install when needed + if (gyp.opts.ensure) { + log.verbose('install', '--ensure was passed, so won\'t reinstall if already installed') + fs.stat(devDir, function (err, stat) { + if (err) { + if (err.code == 'ENOENT') { + log.verbose('install', 'version not already installed, continuing with install', release.version) + go() + } else if (err.code == 'EACCES') { + eaccesFallback() + } else { + cb(err) + } + return + } + log.verbose('install', 'version is already installed, need to check "installVersion"') + var installVersionFile = path.resolve(devDir, 'installVersion') + fs.readFile(installVersionFile, 'ascii', function (err, ver) { + if (err && err.code != 'ENOENT') { + return cb(err) + } + var installVersion = parseInt(ver, 10) || 0 + log.verbose('got "installVersion"', installVersion) + log.verbose('needs "installVersion"', gyp.package.installVersion) + if (installVersion < gyp.package.installVersion) { + log.verbose('install', 'version is no good; reinstalling') + go() + } else { + log.verbose('install', 'version is good') + cb() + } + }) + }) + } else { + go() + } + + function getContentSha(res, callback) { + var shasum = crypto.createHash('sha256') + res.on('data', function (chunk) { + shasum.update(chunk) + }).on('end', function () { + callback(null, shasum.digest('hex')) + }) + } + + function go () { + + log.verbose('ensuring nodedir is created', devDir) + + // first create the dir for the node dev files + mkdir(devDir, function (err, created) { + if (err) { + if (err.code == 'EACCES') { + eaccesFallback() + } else { + cb(err) + } + return + } + + if (created) { + log.verbose('created nodedir', created) + } + + // now download the node tarball + var tarPath = gyp.opts.tarball + var badDownload = false + , extractCount = 0 + , gunzip = zlib.createGunzip() + , extracter = tar.Extract({ path: devDir, strip: 1, filter: isValid }) + + var contentShasums = {} + var expectShasums = {} + + // checks if a file to be extracted from the tarball is valid. + // only .h header files and the gyp files get extracted + function isValid () { + var name = this.path.substring(devDir.length + 1) + var isValid = valid(name) + if (name === '' && this.type === 'Directory') { + // the first directory entry is ok + return true + } + if (isValid) { + log.verbose('extracted file from tarball', name) + extractCount++ + } else { + // invalid + log.silly('ignoring from tarball', name) + } + return isValid + } + + gunzip.on('error', cb) + extracter.on('error', cb) + extracter.on('end', afterTarball) + + // download the tarball, gunzip and extract! + + if (tarPath) { + var input = fs.createReadStream(tarPath) + input.pipe(gunzip).pipe(extracter) + return + } + + try { + var req = download(gyp, process.env, release.tarballUrl) + } catch (e) { + return cb(e) + } + + // something went wrong downloading the tarball? + req.on('error', function (err) { + if (err.code === 'ENOTFOUND') { + return cb(new Error('This is most likely not a problem with node-gyp or the package itself and\n' + + 'is related to network connectivity. In most cases you are behind a proxy or have bad \n' + + 'network settings.')) + } + badDownload = true + cb(err) + }) + + req.on('close', function () { + if (extractCount === 0) { + cb(new Error('Connection closed while downloading tarball file')) + } + }) + + req.on('response', function (res) { + if (res.statusCode !== 200) { + badDownload = true + cb(new Error(res.statusCode + ' response downloading ' + release.tarballUrl)) + return + } + // content checksum + getContentSha(res, function (_, checksum) { + var filename = path.basename(release.tarballUrl).trim() + contentShasums[filename] = checksum + log.verbose('content checksum', filename, checksum) + }) + + // start unzipping and untaring + req.pipe(gunzip).pipe(extracter) + }) + + // invoked after the tarball has finished being extracted + function afterTarball () { + if (badDownload) return + if (extractCount === 0) { + return cb(new Error('There was a fatal problem while downloading/extracting the tarball')) + } + log.verbose('tarball', 'done parsing tarball') + var async = 0 + + if (win) { + // need to download node.lib + async++ + downloadNodeLib(deref) + } + + // write the "installVersion" file + async++ + var installVersionPath = path.resolve(devDir, 'installVersion') + fs.writeFile(installVersionPath, gyp.package.installVersion + '\n', deref) + + // Only download SHASUMS.txt if not using tarPath override + if (!tarPath) { + // download SHASUMS.txt + async++ + downloadShasums(deref) + } + + if (async === 0) { + // no async tasks required + cb() + } + + function deref (err) { + if (err) return cb(err) + + async-- + if (!async) { + log.verbose('download contents checksum', JSON.stringify(contentShasums)) + // check content shasums + for (var k in contentShasums) { + log.verbose('validating download checksum for ' + k, '(%s == %s)', contentShasums[k], expectShasums[k]) + if (contentShasums[k] !== expectShasums[k]) { + cb(new Error(k + ' local checksum ' + contentShasums[k] + ' not match remote ' + expectShasums[k])) + return + } + } + cb() + } + } + } + + function downloadShasums(done) { + log.verbose('check download content checksum, need to download `SHASUMS256.txt`...') + var shasumsPath = path.resolve(devDir, 'SHASUMS256.txt') + + log.verbose('checksum url', release.shasumsUrl) + try { + var req = download(gyp, process.env, release.shasumsUrl) + } catch (e) { + return cb(e) + } + + req.on('error', done) + req.on('response', function (res) { + if (res.statusCode !== 200) { + done(new Error(res.statusCode + ' status code downloading checksum')) + return + } + + var chunks = [] + res.on('data', function (chunk) { + chunks.push(chunk) + }) + res.on('end', function () { + var lines = Buffer.concat(chunks).toString().trim().split('\n') + lines.forEach(function (line) { + var items = line.trim().split(/\s+/) + if (items.length !== 2) return + + // 0035d18e2dcf9aad669b1c7c07319e17abfe3762 ./node-v0.11.4.tar.gz + var name = items[1].replace(/^\.\//, '') + expectShasums[name] = items[0] + }) + + log.verbose('checksum data', JSON.stringify(expectShasums)) + done() + }) + }) + } + + function downloadNodeLib (done) { + log.verbose('on Windows; need to download `' + release.name + '.lib`...') + var dir32 = path.resolve(devDir, 'ia32') + , dir64 = path.resolve(devDir, 'x64') + , libPath32 = path.resolve(dir32, release.name + '.lib') + , libPath64 = path.resolve(dir64, release.name + '.lib') + + log.verbose('32-bit ' + release.name + '.lib dir', dir32) + log.verbose('64-bit ' + release.name + '.lib dir', dir64) + log.verbose('`' + release.name + '.lib` 32-bit url', release.libUrl32) + log.verbose('`' + release.name + '.lib` 64-bit url', release.libUrl64) + + var async = 2 + mkdir(dir32, function (err) { + if (err) return done(err) + log.verbose('streaming 32-bit ' + release.name + '.lib to:', libPath32) + + try { + var req = download(gyp, process.env, release.libUrl32, cb) + } catch (e) { + return cb(e) + } + + req.on('error', done) + req.on('response', function (res) { + if (res.statusCode !== 200) { + done(new Error(res.statusCode + ' status code downloading 32-bit ' + release.name + '.lib')) + return + } + + getContentSha(res, function (_, checksum) { + contentShasums[release.libPath32] = checksum + log.verbose('content checksum', release.libPath32, checksum) + }) + + var ws = fs.createWriteStream(libPath32) + ws.on('error', cb) + req.pipe(ws) + }) + req.on('end', function () { + --async || done() + }) + }) + mkdir(dir64, function (err) { + if (err) return done(err) + log.verbose('streaming 64-bit ' + release.name + '.lib to:', libPath64) + + try { + var req = download(gyp, process.env, release.libUrl64, cb) + } catch (e) { + return cb(e) + } + + req.on('error', done) + req.on('response', function (res) { + if (res.statusCode !== 200) { + done(new Error(res.statusCode + ' status code downloading 64-bit ' + release.name + '.lib')) + return + } + + getContentSha(res, function (_, checksum) { + contentShasums[release.libPath64] = checksum + log.verbose('content checksum', release.libPath64, checksum) + }) + + var ws = fs.createWriteStream(libPath64) + ws.on('error', cb) + req.pipe(ws) + }) + req.on('end', function () { + --async || done() + }) + }) + } // downloadNodeLib() + + }) // mkdir() + + } // go() + + /** + * Checks if a given filename is "valid" for this installation. + */ + + function valid (file) { + // header files + return minimatch(file, '*.h', { matchBase: true }) || + minimatch(file, '*.gypi', { matchBase: true }) + } + + /** + * The EACCES fallback is a workaround for npm's `sudo` behavior, where + * it drops the permissions before invoking any child processes (like + * node-gyp). So what happens is the "nobody" user doesn't have + * permission to create the dev dir. As a fallback, make the tmpdir() be + * the dev dir for this installation. This is not ideal, but at least + * the compilation will succeed... + */ + + function eaccesFallback () { + var tmpdir = osenv.tmpdir() + gyp.devDir = path.resolve(tmpdir, '.node-gyp') + log.warn('EACCES', 'user "%s" does not have permission to access the dev dir "%s"', osenv.user(), devDir) + log.warn('EACCES', 'attempting to reinstall using temporary dev dir "%s"', gyp.devDir) + if (process.cwd() == tmpdir) { + log.verbose('tmpdir == cwd', 'automatically will remove dev files after to save disk space') + gyp.todo.push({ name: 'remove', args: argv }) + } + gyp.commands.install(argv, cb) + } + +} + +function download (gyp, env, url) { + log.http('GET', url) + + var requestOpts = { + uri: url + , headers: { + 'User-Agent': 'node-gyp v' + gyp.version + ' (node ' + process.version + ')' + } + } + + var cafile = gyp.opts.cafile + if (cafile) { + requestOpts.ca = readCAFile(cafile) + } + + // basic support for a proxy server + var proxyUrl = gyp.opts.proxy + || env.http_proxy + || env.HTTP_PROXY + || env.npm_config_proxy + if (proxyUrl) { + if (/^https?:\/\//i.test(proxyUrl)) { + log.verbose('download', 'using proxy url: "%s"', proxyUrl) + requestOpts.proxy = proxyUrl + } else { + log.warn('download', 'ignoring invalid "proxy" config setting: "%s"', proxyUrl) + } + } + + var req = request(requestOpts) + req.on('response', function (res) { + log.http(res.statusCode, url) + }) + + return req +} + +function readCAFile (filename) { + // The CA file can contain multiple certificates so split on certificate + // boundaries. [\S\s]*? is used to match everything including newlines. + var ca = fs.readFileSync(filename, 'utf8') + var re = /(-----BEGIN CERTIFICATE-----[\S\s]*?-----END CERTIFICATE-----)/g + return ca.match(re) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/lib/list.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/lib/list.js new file mode 100644 index 00000000..9d680a56 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/lib/list.js @@ -0,0 +1,33 @@ + +module.exports = exports = list + +exports.usage = 'Prints a listing of the currently installed node development files' + +/** + * Module dependencies. + */ + +var fs = require('graceful-fs') + , path = require('path') + , log = require('npmlog') + +function list (gyp, args, callback) { + + var devDir = gyp.devDir + log.verbose('list', 'using node-gyp dir:', devDir) + + // readdir() the node-gyp dir + fs.readdir(devDir, onreaddir) + + function onreaddir (err, versions) { + if (err && err.code != 'ENOENT') { + return callback(err) + } + if (Array.isArray(versions)) { + versions = versions.filter(function (v) { return v != 'current' }) + } else { + versions = [] + } + callback(null, versions) + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/lib/node-gyp.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/lib/node-gyp.js new file mode 100644 index 00000000..3b8f5b0a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/lib/node-gyp.js @@ -0,0 +1,226 @@ + +/** + * Module exports. + */ + +module.exports = exports = gyp + +/** + * Module dependencies. + */ + +var fs = require('graceful-fs') + , path = require('path') + , nopt = require('nopt') + , log = require('npmlog') + , child_process = require('child_process') + , EE = require('events').EventEmitter + , inherits = require('util').inherits + , commands = [ + // Module build commands + 'build' + , 'clean' + , 'configure' + , 'rebuild' + // Development Header File management commands + , 'install' + , 'list' + , 'remove' + ] + , aliases = { + 'ls': 'list' + , 'rm': 'remove' + } + +// differentiate node-gyp's logs from npm's +log.heading = 'gyp' + +/** + * The `gyp` function. + */ + +function gyp () { + return new Gyp() +} + +function Gyp () { + var self = this + + // set the dir where node-gyp dev files get installed + // TODO: make this *more* configurable? + // see: https://github.com/nodejs/node-gyp/issues/21 + var homeDir = process.env.HOME || process.env.USERPROFILE + if (!homeDir) { + throw new Error( + "node-gyp requires that the user's home directory is specified " + + "in either of the environmental variables HOME or USERPROFILE" + ); + } + this.devDir = path.resolve(homeDir, '.node-gyp') + + this.commands = {} + + commands.forEach(function (command) { + self.commands[command] = function (argv, callback) { + log.verbose('command', command, argv) + return require('./' + command)(self, argv, callback) + } + }) +} +inherits(Gyp, EE) +exports.Gyp = Gyp +var proto = Gyp.prototype + +/** + * Export the contents of the package.json. + */ + +proto.package = require('../package') + +/** + * nopt configuration definitions + */ + +proto.configDefs = { + help: Boolean // everywhere + , arch: String // 'configure' + , cafile: String // 'install' + , debug: Boolean // 'build' + , directory: String // bin + , make: String // 'build' + , msvs_version: String // 'configure' + , ensure: Boolean // 'install' + , solution: String // 'build' (windows only) + , proxy: String // 'install' + , nodedir: String // 'configure' + , loglevel: String // everywhere + , python: String // 'configure' + , 'dist-url': String // 'install' + , 'tarball': String // 'install' + , jobs: String // 'build' + , thin: String // 'configure' +} + +/** + * nopt shorthands + */ + +proto.shorthands = { + release: '--no-debug' + , C: '--directory' + , debug: '--debug' + , j: '--jobs' + , silly: '--loglevel=silly' + , verbose: '--loglevel=verbose' + , silent: '--loglevel=silent' +} + +/** + * expose the command aliases for the bin file to use. + */ + +proto.aliases = aliases + +/** + * Parses the given argv array and sets the 'opts', + * 'argv' and 'command' properties. + */ + +proto.parseArgv = function parseOpts (argv) { + this.opts = nopt(this.configDefs, this.shorthands, argv) + this.argv = this.opts.argv.remain.slice() + + var commands = this.todo = [] + + // create a copy of the argv array with aliases mapped + argv = this.argv.map(function (arg) { + // is this an alias? + if (arg in this.aliases) { + arg = this.aliases[arg] + } + return arg + }, this) + + // process the mapped args into "command" objects ("name" and "args" props) + argv.slice().forEach(function (arg) { + if (arg in this.commands) { + var args = argv.splice(0, argv.indexOf(arg)) + argv.shift() + if (commands.length > 0) { + commands[commands.length - 1].args = args + } + commands.push({ name: arg, args: [] }) + } + }, this) + if (commands.length > 0) { + commands[commands.length - 1].args = argv.splice(0) + } + + // support for inheriting config env variables from npm + var npm_config_prefix = 'npm_config_' + Object.keys(process.env).forEach(function (name) { + if (name.indexOf(npm_config_prefix) !== 0) return + var val = process.env[name] + if (name === npm_config_prefix + 'loglevel') { + log.level = val + } else { + // add the user-defined options to the config + name = name.substring(npm_config_prefix.length) + // gyp@741b7f1 enters an infinite loop when it encounters + // zero-length options so ensure those don't get through. + if (name) this.opts[name] = val + } + }, this) + + if (this.opts.loglevel) { + log.level = this.opts.loglevel + } + log.resume() +} + +/** + * Spawns a child process and emits a 'spawn' event. + */ + +proto.spawn = function spawn (command, args, opts) { + if (!opts) opts = {} + if (!opts.silent && !opts.stdio) { + opts.stdio = [ 0, 1, 2 ] + } + var cp = child_process.spawn(command, args, opts) + log.info('spawn', command) + log.info('spawn args', args) + return cp +} + +/** + * Returns the usage instructions for node-gyp. + */ + +proto.usage = function usage () { + var str = [ + '' + , ' Usage: node-gyp [options]' + , '' + , ' where is one of:' + , commands.map(function (c) { + return ' - ' + c + ' - ' + require('./' + c).usage + }).join('\n') + , '' + , 'node-gyp@' + this.version + ' ' + path.resolve(__dirname, '..') + , 'node@' + process.versions.node + ].join('\n') + return str +} + +/** + * Version number getter. + */ + +Object.defineProperty(proto, 'version', { + get: function () { + return this.package.version + } + , enumerable: true +}) + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/lib/process-release.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/lib/process-release.js new file mode 100644 index 00000000..f5a3cca6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/lib/process-release.js @@ -0,0 +1,153 @@ +var semver = require('semver') + , url = require('url') + , path = require('path') + , log = require('npmlog') + + // versions where -headers.tar.gz started shipping + , headersTarballRange = '>= 3.0.0 || ~0.12.10 || ~0.10.42' + , bitsre = /\/win-(x86|x64)\// + , bitsreV3 = /\/win-(x86|ia32|x64)\// // io.js v3.x.x shipped with "ia32" but should + // have been "x86" + +// Captures all the logic required to determine download URLs, local directory and +// file names. Inputs come from command-line switches (--target, --dist-url), +// `process.version` and `process.release` where it exists. +function processRelease (argv, gyp, defaultVersion, defaultRelease) { + var version = (semver.valid(argv[0]) && argv[0]) || gyp.opts.target || defaultVersion + , versionSemver = semver.parse(version) + , overrideDistUrl = gyp.opts['dist-url'] || gyp.opts.disturl + , isDefaultVersion + , isIojs + , name + , distBaseUrl + , baseUrl + , libUrl32 + , libUrl64 + , tarballUrl + , canGetHeaders + + if (!versionSemver) { + // not a valid semver string, nothing we can do + return { version: version } + } + // flatten version into String + version = versionSemver.version + + // defaultVersion should come from process.version so ought to be valid semver + isDefaultVersion = version === semver.parse(defaultVersion).version + + // can't use process.release if we're using --target=x.y.z + if (!isDefaultVersion) + defaultRelease = null + + if (defaultRelease) { + // v3 onward, has process.release + name = defaultRelease.name.replace(/io\.js/, 'iojs') // remove the '.' for directory naming purposes + isIojs = name === 'iojs' + } else { + // old node or alternative --target= + // semver.satisfies() doesn't like prerelease tags so test major directly + isIojs = versionSemver.major >= 1 && versionSemver.major < 4 + name = isIojs ? 'iojs' : 'node' + } + + // check for the nvm.sh standard mirror env variables + if (!overrideDistUrl) { + if (isIojs) { + if (process.env.IOJS_ORG_MIRROR) { + overrideDistUrl = process.env.IOJS_ORG_MIRROR + } else if (process.env.NVM_IOJS_ORG_MIRROR) {// remove on next semver-major + overrideDistUrl = process.env.NVM_IOJS_ORG_MIRROR + log.warn('download', + 'NVM_IOJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, ' + + 'please use IOJS_ORG_MIRROR') + } + } else { + if (process.env.NODEJS_ORG_MIRROR) { + overrideDistUrl = process.env.NODEJS_ORG_MIRROR + } else if (process.env.NVM_NODEJS_ORG_MIRROR) {// remove on next semver-major + overrideDistUrl = process.env.NVM_NODEJS_ORG_MIRROR + log.warn('download', + 'NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, ' + + 'please use NODEJS_ORG_MIRROR') + } + } + } + + + if (overrideDistUrl) + distBaseUrl = overrideDistUrl.replace(/\/+$/, '') + else + distBaseUrl = isIojs ? 'https://iojs.org/download/release' : 'https://nodejs.org/dist' + distBaseUrl += '/v' + version + '/' + + // new style, based on process.release so we have a lot of the data we need + if (defaultRelease && defaultRelease.headersUrl && !overrideDistUrl) { + baseUrl = url.resolve(defaultRelease.headersUrl, './') + libUrl32 = resolveLibUrl(name, defaultRelease.libUrl || baseUrl || distBaseUrl, 'x86', versionSemver.major) + libUrl64 = resolveLibUrl(name, defaultRelease.libUrl || baseUrl || distBaseUrl, 'x64', versionSemver.major) + + return { + version: version, + semver: versionSemver, + name: name, + baseUrl: baseUrl, + tarballUrl: defaultRelease.headersUrl, + shasumsUrl: url.resolve(baseUrl, 'SHASUMS256.txt'), + versionDir: (name !== 'node' ? name + '-' : '') + version, + libUrl32: libUrl32, + libUrl64: libUrl64, + libPath32: normalizePath(path.relative(url.parse(baseUrl).path, url.parse(libUrl32).path)), + libPath64: normalizePath(path.relative(url.parse(baseUrl).path, url.parse(libUrl64).path)) + } + } + + // older versions without process.release are captured here and we have to make + // a lot of assumptions, additionally if you --target=x.y.z then we can't use the + // current process.release + + baseUrl = distBaseUrl + libUrl32 = resolveLibUrl(name, baseUrl, 'x86', versionSemver.major) + libUrl64 = resolveLibUrl(name, baseUrl, 'x64', versionSemver.major) + // making the bold assumption that anything with a version number >3.0.0 will + // have a *-headers.tar.gz file in its dist location, even some frankenstein + // custom version + canGetHeaders = semver.satisfies(versionSemver, headersTarballRange) + tarballUrl = url.resolve(baseUrl, name + '-v' + version + (canGetHeaders ? '-headers' : '') + '.tar.gz') + + return { + version: version, + semver: versionSemver, + name: name, + baseUrl: baseUrl, + tarballUrl: tarballUrl, + shasumsUrl: url.resolve(baseUrl, 'SHASUMS256.txt'), + versionDir: (name !== 'node' ? name + '-' : '') + version, + libUrl32: libUrl32, + libUrl64: libUrl64, + libPath32: normalizePath(path.relative(url.parse(baseUrl).path, url.parse(libUrl32).path)), + libPath64: normalizePath(path.relative(url.parse(baseUrl).path, url.parse(libUrl64).path)) + } +} + +function normalizePath (p) { + return path.normalize(p).replace(/\\/g, '/') +} + +function resolveLibUrl (name, defaultUrl, arch, versionMajor) { + var base = url.resolve(defaultUrl, './') + , hasLibUrl = bitsre.test(defaultUrl) || (versionMajor === 3 && bitsreV3.test(defaultUrl)) + + if (!hasLibUrl) { + // let's assume it's a baseUrl then + if (versionMajor >= 1) + return url.resolve(base, 'win-' + arch +'/' + name + '.lib') + // prior to io.js@1.0.0 32-bit node.lib lives in /, 64-bit lives in /x64/ + return url.resolve(base, (arch === 'x64' ? 'x64/' : '') + name + '.lib') + } + + // else we have a proper url to a .lib, just make sure it's the right arch + return defaultUrl.replace(versionMajor === 3 ? bitsreV3 : bitsre, '/win-' + arch + '/') +} + +module.exports = processRelease diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/lib/rebuild.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/lib/rebuild.js new file mode 100644 index 00000000..4c6f472a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/lib/rebuild.js @@ -0,0 +1,14 @@ + +module.exports = exports = rebuild + +exports.usage = 'Runs "clean", "configure" and "build" all at once' + +function rebuild (gyp, argv, callback) { + + gyp.todo.push( + { name: 'clean', args: [] } + , { name: 'configure', args: argv } + , { name: 'build', args: [] } + ) + process.nextTick(callback) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/lib/remove.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/lib/remove.js new file mode 100644 index 00000000..eb80981b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/lib/remove.js @@ -0,0 +1,52 @@ + +module.exports = exports = remove + +exports.usage = 'Removes the node development files for the specified version' + +/** + * Module dependencies. + */ + +var fs = require('fs') + , rm = require('rimraf') + , path = require('path') + , log = require('npmlog') + , semver = require('semver') + +function remove (gyp, argv, callback) { + + var devDir = gyp.devDir + log.verbose('remove', 'using node-gyp dir:', devDir) + + // get the user-specified version to remove + var version = argv[0] || gyp.opts.target + log.verbose('remove', 'removing target version:', version) + + if (!version) { + return callback(new Error('You must specify a version number to remove. Ex: "' + process.version + '"')) + } + + var versionSemver = semver.parse(version) + if (versionSemver) { + // flatten the version Array into a String + version = versionSemver.version + } + + var versionPath = path.resolve(gyp.devDir, version) + log.verbose('remove', 'removing development files for version:', version) + + // first check if its even installed + fs.stat(versionPath, function (err, stat) { + if (err) { + if (err.code == 'ENOENT') { + callback(null, 'version was already uninstalled: ' + version) + } else { + callback(err) + } + return + } + // Go ahead and delete the dir + rm(versionPath, callback) + }) + +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/.npmignore new file mode 100644 index 00000000..07e6e472 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/.npmignore @@ -0,0 +1 @@ +/node_modules diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/.travis.yml new file mode 100644 index 00000000..41840cb3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/.travis.yml @@ -0,0 +1,27 @@ +sudo: false + +language: node_js + +node_js: + - "0.8" + - "0.10" + - "0.12" + - "1" + - "2" + - "3" + - "4" + - "5" + +install: + - PATH="`npm bin`:`npm bin -g`:$PATH" + # Node 0.8 comes with a too obsolete npm + - if [[ "`node --version`" =~ ^v0\.8\. ]]; then npm install -g npm@1.4.28 ; fi + # Install dependencies and build + - npm install + +script: + # Output useful info for debugging + - node --version + - npm --version + # Run tests + - npm test diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/History.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/History.md new file mode 100644 index 00000000..bbdacd30 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/History.md @@ -0,0 +1,30 @@ + +1.0.1 / 2016-01-14 +================== + + * add MIT LICENSE file + * update "array-index" to v1.0.0 with new API + * travis: test more node versions and fix v0.8 + * travis: use quotes around node versions + +1.0.0 / 2014-11-11 +================== + + * index: add support for a configrable `property` name to use + * README: fix Travis badge + +0.0.2 / 2013-12-22 +================== + + * README++ + * test: add unshift() test + * test: add more tests + * index: ensure that the indexed getters/setters are set up in the constructor + * add .travis.yml file + * add initial tests + +0.0.1 / 2013-12-21 +================== + + * add README.md + * initial commit diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/LICENSE new file mode 100644 index 00000000..2a54ccd2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/LICENSE @@ -0,0 +1,24 @@ +(The MIT License) + +Copyright (c) 2013 Nathan Rajlich + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/README.md new file mode 100644 index 00000000..2595316a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/README.md @@ -0,0 +1,92 @@ +path-array +========== +### Treat your `$PATH` like a JavaScript Array +[![Build Status](https://travis-ci.org/TooTallNate/path-array.svg?branch=master)](https://travis-ci.org/TooTallNate/path-array) + +This module provides a JavaScript `Array` implementation that is backed by your +`$PATH` env variable. That is, you can use regular Array functions like `shift()`, +`pop()`, `push()`, `unshift()`, etc. to mutate your `$PATH`. + +Also works for preparing an `env` object for passing to +[`child_process.spawn()`][cp.spawn]. + + +Installation +------------ + +Install with `npm`: + +``` bash +$ npm install path-array +``` + + +Example +------- + +Interacting with your own `$PATH` env variable: + +``` js +var PathArray = require('path-array'); + +// no args uses `process.env` by default +var p = new PathArray(); + +console.log(p); +// [ './node_modules/.bin', +// '/opt/local/bin', +// '/opt/local/sbin', +// '/usr/local/bin', +// '/usr/local/sbin', +// '/usr/bin', +// '/bin', +// '/usr/sbin', +// '/sbin', +// '/usr/local/bin', +// '/opt/X11/bin' ] + +// push another path entry. this function mutates the `process.env.PATH` +p.unshift('/foo'); + +console.log(process.env.PATH); +// '/foo:./node_modules/.bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin' +``` + + +API +--- + +### new PathArray([env]) → PathArray + +Creates and returns a new `PathArray` instance with the given `env` object. If no +`env` is specified, then [`process.env`][process.env] is used by default. + + +License +------- + +(The MIT License) + +Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +[process.env]: http://nodejs.org/docs/latest/api/process.html#process_process_env +[cp.spawn]: http://nodejs.org/docs/latest/api/child_process.html#child_process_child_process_spawn_command_args_options diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/index.js new file mode 100644 index 00000000..1e817013 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/index.js @@ -0,0 +1,137 @@ + +/** + * Module dependencies. + */ + +var inherits = require('util').inherits; +var delimiter = require('path').delimiter || ':'; +var ArrayIndex = require('array-index'); + +/** + * Module exports. + */ + +module.exports = PathArray; + +/** + * `PathArray` constructor. Treat your `$PATH` like a mutable JavaScript Array! + * + * @param {Env} env - `process.env` object to use. + * @param {String} [property] - optional property name to use (`PATH` by default). + * @public + */ + +function PathArray (env, property) { + if (!(this instanceof PathArray)) return new PathArray(env); + ArrayIndex.call(this); + + this.property = property || 'PATH'; + + // overwrite only the `get` operator of the ".length" property + Object.defineProperty(this, 'length', { + get: this._getLength + }); + + // store the `process.env` object as a non-enumerable `_env` + Object.defineProperty(this, '_env', { + value: env || process.env, + writable: true, + enumerable: false, + configurable: true + }); + + // need to invoke the `length` getter to ensure that the + // indexed getters/setters are set up at this point + void(this.length); +} + +// inherit from ArrayIndex +inherits(PathArray, ArrayIndex); + +/** + * Returns the current $PATH representation as an Array. + * + * @api private + */ + +PathArray.prototype._array = function () { + var path = this._env[this.property]; + if (!path) return []; + return path.split(delimiter); +}; + +/** + * Sets the `env` object's `PATH` string to the values in the passed in Array + * instance. + * + * @api private + */ + +PathArray.prototype._setArray = function (arr) { + // mutate the $PATH + this._env[this.property] = arr.join(delimiter); +}; + +/** + * `.length` getter operation implementation. + * + * @api private + */ + +PathArray.prototype._getLength = function () { + var length = this._array().length; + + // invoke the ArrayIndex internal `set` operator to ensure that + // there's getters/setters defined for the determined length so far... + this.length = length; + + return length; +}; + +/** + * ArrayIndex [0] getter operator implementation. + * + * @api private + */ + +PathArray.prototype[ArrayIndex.get] = function get (index) { + return this._array()[index]; +}; + +/** + * ArrayIndex [0]= setter operator implementation. + * + * @api private + */ + +PathArray.prototype[ArrayIndex.set] = function set (index, value) { + var arr = this._array(); + arr[index] = value; + this._setArray(arr); + return value; +}; + +/** + * `toString()` returns the current $PATH string. + * + * @api public + */ + +PathArray.prototype.toString = function toString () { + return this._env[this.property] || ''; +}; + +// proxy the JavaScript Array functions, and mutate the $PATH +Object.getOwnPropertyNames(Array.prototype).forEach(function (name) { + if ('constructor' == name) return; + if ('function' != typeof Array.prototype[name]) return; + if (/to(Locale)?String/.test(name)) return; + //console.log('proxy %s', name); + + PathArray.prototype[name] = function () { + var arr = this._array(); + var rtn = arr[name].apply(arr, arguments); + this._setArray(arr); + return rtn; + }; +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/.npmignore new file mode 100644 index 00000000..3c3629e6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/.travis.yml new file mode 100644 index 00000000..41840cb3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/.travis.yml @@ -0,0 +1,27 @@ +sudo: false + +language: node_js + +node_js: + - "0.8" + - "0.10" + - "0.12" + - "1" + - "2" + - "3" + - "4" + - "5" + +install: + - PATH="`npm bin`:`npm bin -g`:$PATH" + # Node 0.8 comes with a too obsolete npm + - if [[ "`node --version`" =~ ^v0\.8\. ]]; then npm install -g npm@1.4.28 ; fi + # Install dependencies and build + - npm install + +script: + # Output useful info for debugging + - node --version + - npm --version + # Run tests + - npm test diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/History.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/History.md new file mode 100644 index 00000000..12990228 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/History.md @@ -0,0 +1,67 @@ + +1.0.0 / 2016-01-02 +================== + + * remove `__get__` and `__set__` functionality + * README: s/->/→/ + +0.9.1 / 2015-12-29 +================== + + * fix backwards compat with tests + * README: update samples for new Symbols API + * travis: attempt to fix node v8 + +0.9.0 / 2015-12-27 +================== + + * add backwards compat logic with deprecate message + * add LICENSE field and entry in package.json + * convert to using es6 Symbols + * remove extraneous debug() calls + * travis: test moar Node.js versions + +0.2.0 / 2015-12-02 +================== + + * add support for invoking as a Mixin + * travis: test node v0.6 + +0.1.1 / 2014-11-03 +================== + + * index: use `%o` debug formatters + * .travis: don't test node v0.9.x + * README: use svg for Travis badge + * add .jshintrc file + +0.1.0 / 2013-12-01 +================== + + * add `History.md` file + * .travis.yml: test node v0.8-v0.11 + * add component.json + * package: update "main" field + * package: beautify + +0.0.4 / 2013-09-27 +================== + + * ensure that the `length` property has the same maximum as regular Arrays + +0.0.3 / 2013-09-15 +================== + + * add `toArray()`, `toJSON()`, and `toString()` functions + * add an `inspect()` function + +0.0.2 / 2013-09-15 +================== + + * use "configurable: true" + * add `travis.yml` file + +0.0.1 / 2013-06-14 +================== + + * Initial release diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/LICENSE new file mode 100644 index 00000000..2ea4dc5e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/LICENSE @@ -0,0 +1,24 @@ +(The MIT License) + +Copyright (c) 2012 Nathan Rajlich + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/Makefile b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/Makefile new file mode 100644 index 00000000..0f14dac3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/Makefile @@ -0,0 +1,11 @@ + +build: components index.js + @component build --dev + +components: component.json + @component install --dev + +clean: + rm -fr build components template.js + +.PHONY: clean diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/README.md new file mode 100644 index 00000000..b8d715d6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/README.md @@ -0,0 +1,155 @@ +array-index +=========== +### Invoke getter/setter functions on array-like objects +[![Build Status](https://secure.travis-ci.org/TooTallNate/array-index.svg)](http://travis-ci.org/TooTallNate/array-index) + + +This little module provides an `ArrayIndex` constructor function that you can +inherit from with your own objects. When a numbered property gets read, then the +`ArrayIndex.get` function on the object will be invoked. When a numbered property gets +set, then the `ArrayIndex.set` function on the object will be invoked. + + +Installation +------------ + +Install with `npm`: + +``` bash +$ npm install array-index +``` + + +Examples +-------- + +A quick silly example, using `Math.sqrt()` for the "getter": + +``` js +var ArrayIndex = require('array-index'); + +// let's just create a singleton instance. +var a = new ArrayIndex(); + +// the "ArrayIndex.get" function is invoked for each "a[n]" access. +// it is given a single argument, the "index" currently being accessed. +// so here, we're passing in the `Math.sqrt()` function, so accessing +// "a[9]" will return `Math.sqrt(9)`. +a[ArrayIndex.get] = Math.sqrt; + +// the "ArrayIndex.get" and "ArrayIndex.set" functions are only invoked up +// to "a.length", so we must set that manually. +a.length = 10; + +console.log(a); +// [ 0, +// 1, +// 1.4142135623730951, +// 1.7320508075688772, +// 2, +// 2.23606797749979, +// 2.449489742783178, +// 2.6457513110645907, +// 2.8284271247461903, +// 3 ] +``` + +Here's an example of creating a subclass of `ArrayIndex` using `util.inherits()`: + +``` js +var ArrayIndex = require('array-index'); +var inherits = require('util').inherits; + +function MyArray (length) { + // be sure to call the ArrayIndex constructor in your own constructor + ArrayIndex.call(this, length); + + // the "set" object will contain values at indexes previously set, + // so that they can be returned in the "getter" function. This is just a + // silly example, your subclass will have more meaningful logic. + Object.defineProperty(this, 'set', { + value: Object.create(null), + enumerable: false + }); +} + +// inherit from the ArrayIndex's prototype +inherits(MyArray, ArrayIndex); + +MyArray.prototype[ArrayIndex.get] = function (index) { + if (index in this.set) return this.set[index]; + return index * 2; +}; + +MyArray.prototype[ArrayIndex.set] = function (index, v) { + this.set[index] = v; +}; + + +// and now you can create some instances +var a = new MyArray(15); +a[9] = a[10] = a[14] = '_'; +a[0] = 'nate'; + +console.log(a); +// [ 'nate', 2, 4, 6, 8, 10, 12, 14, 16, '_', '_', 22, 24, 26, '_' ] +``` + +API +--- + +The `ArrayIndex` base class is meant to be subclassed, but it also has a few +convenient functions built-in. + +### "length" → Number + +The length of the ArrayIndex instance. The `ArrayIndex.get` and `ArrayIndex.set` functions will +only be invoked on the object up to this "length". You may set this length at any +time to adjust the amount range where the getters/setters will be invoked. + +### "toArray()" → Array + +Returns a new regular Array instance with the same values that this ArrayIndex +class would have. This function calls the `ArrayIndex.get` function repeatedly from +`0...length-1` and returns the "flattened" array instance. + +### "toJSON()" → Array + +All `ArrayIndex` instances get basic support for `JSON.stringify()`, which is +the same as a "flattened" Array being stringified. + +### "toString()" → String + +The `toString()` override is basically just `array.toArray().toString()`. + +### "format()" → String + +The `inspect()` implementation for the REPL attempts to mimic what a regular +Array looks like in the REPL. + + +License +------- + +(The MIT License) + +Copyright (c) 2012 Nathan Rajlich <nathan@tootallnate.net> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/component.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/component.json new file mode 100644 index 00000000..f5f21fc7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/component.json @@ -0,0 +1,22 @@ +{ + "name": "array-index", + "repo": "TooTallNate/array-index", + "description": "Invoke getter/setter functions on array-like objects", + "keywords": [ + "index", + "array", + "getter", + "setter", + "proxy" + ], + "version": "1.0.0", + "dependencies": { + "visionmedia/debug": "*" + }, + "development": {}, + "license": "MIT", + "main": "index.js", + "scripts": [ + "index.js" + ] +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/index.js new file mode 100644 index 00000000..a2e4110c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/index.js @@ -0,0 +1,182 @@ + +/** + * Module dependencies. + */ + +var Symbol = require('es6-symbol'); +var debug = require('debug')('array-index'); + +var get = Symbol('get'); +var set = Symbol('set'); +var length = Symbol('length'); + +/** + * JavaScript Array "length" is bound to an unsigned 32-bit int. + * See: http://stackoverflow.com/a/6155063/376773 + */ + +var MAX_LENGTH = Math.pow(2, 32); + +/** + * Module exports. + */ + +module.exports = ArrayIndex; +ArrayIndex.get = get; +ArrayIndex.set = set; + +/** + * Subclass this. + */ + +function ArrayIndex (_length) { + Object.defineProperty(this, 'length', { + get: getLength, + set: setLength, + enumerable: false, + configurable: true + }); + + this[length] = 0; + + if (arguments.length > 0) { + setLength.call(this, _length); + } +} + +/** + * You overwrite the "get" Symbol in your subclass. + */ + +ArrayIndex.prototype[ArrayIndex.get] = function () { + throw new Error('you must implement the `ArrayIndex.get` Symbol'); +}; + +/** + * You overwrite the "set" Symbol in your subclass. + */ + +ArrayIndex.prototype[ArrayIndex.set] = function () { + throw new Error('you must implement the `ArrayIndex.set` Symbol'); +}; + +/** + * Converts this array class into a real JavaScript Array. Note that this + * is a "flattened" array and your defined getters and setters won't be invoked + * when you interact with the returned Array. This function will call the + * getter on every array index of the object. + * + * @return {Array} The flattened array + * @api public + */ + +ArrayIndex.prototype.toArray = function toArray () { + var i = 0; + var l = this.length; + var array = new Array(l); + for (; i < l; i++) { + array[i] = this[i]; + } + return array; +}; + +/** + * Basic support for `JSON.stringify()`. + */ + +ArrayIndex.prototype.toJSON = function toJSON () { + return this.toArray(); +}; + +/** + * toString() override. Use Array.prototype.toString(). + */ + +ArrayIndex.prototype.toString = function toString () { + var a = this.toArray(); + return a.toString.apply(a, arguments); +}; + +/** + * inspect() override. For the REPL. + */ + +ArrayIndex.prototype.inspect = function inspect () { + var a = this.toArray(); + Object.keys(this).forEach(function (k) { + a[k] = this[k]; + }, this); + return a; +}; + +/** + * Getter for the "length" property. + * Returns the value of the "length" Symbol. + */ + +function getLength () { + debug('getting "length": %o', this[length]); + return this[length]; +}; + +/** + * Setter for the "length" property. + * Calls "ensureLength()", then sets the "length" Symbol. + */ + +function setLength (v) { + debug('setting "length": %o', v); + return this[length] = ensureLength(this, v); +}; + +/** + * Ensures that getters/setters from 0 up to "_newLength" have been defined + * on `Object.getPrototypeOf(this)`. + * + * @api private + */ + +function ensureLength (self, _newLength) { + var newLength; + if (_newLength > MAX_LENGTH) { + newLength = MAX_LENGTH; + } else { + newLength = _newLength | 0; + } + var proto = Object.getPrototypeOf(self); + var cur = proto[length] | 0; + var num = newLength - cur; + if (num > 0) { + var desc = {}; + debug('creating a descriptor object with %o entries', num); + for (var i = cur; i < newLength; i++) { + desc[i] = setup(i); + } + debug('calling `Object.defineProperties()` with %o entries', num); + Object.defineProperties(proto, desc); + proto[length] = newLength; + } + return newLength; +} + +/** + * Returns a property descriptor for the given "index", with "get" and "set" + * functions created within the closure. + * + * @api private + */ + +function setup (index) { + function get () { + return this[ArrayIndex.get](index); + } + function set (v) { + return this[ArrayIndex.set](index, v); + } + return { + enumerable: true, + configurable: true, + get: get, + set: set + }; +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/.npmignore new file mode 100644 index 00000000..7e6163db --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/.npmignore @@ -0,0 +1,6 @@ +support +test +examples +example +*.sock +dist diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/History.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/History.md new file mode 100644 index 00000000..854c9711 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/History.md @@ -0,0 +1,195 @@ + +2.2.0 / 2015-05-09 +================== + + * package: update "ms" to v0.7.1 (#202, @dougwilson) + * README: add logging to file example (#193, @DanielOchoa) + * README: fixed a typo (#191, @amir-s) + * browser: expose `storage` (#190, @stephenmathieson) + * Makefile: add a `distclean` target (#189, @stephenmathieson) + +2.1.3 / 2015-03-13 +================== + + * Updated stdout/stderr example (#186) + * Updated example/stdout.js to match debug current behaviour + * Renamed example/stderr.js to stdout.js + * Update Readme.md (#184) + * replace high intensity foreground color for bold (#182, #183) + +2.1.2 / 2015-03-01 +================== + + * dist: recompile + * update "ms" to v0.7.0 + * package: update "browserify" to v9.0.3 + * component: fix "ms.js" repo location + * changed bower package name + * updated documentation about using debug in a browser + * fix: security error on safari (#167, #168, @yields) + +2.1.1 / 2014-12-29 +================== + + * browser: use `typeof` to check for `console` existence + * browser: check for `console.log` truthiness (fix IE 8/9) + * browser: add support for Chrome apps + * Readme: added Windows usage remarks + * Add `bower.json` to properly support bower install + +2.1.0 / 2014-10-15 +================== + + * node: implement `DEBUG_FD` env variable support + * package: update "browserify" to v6.1.0 + * package: add "license" field to package.json (#135, @panuhorsmalahti) + +2.0.0 / 2014-09-01 +================== + + * package: update "browserify" to v5.11.0 + * node: use stderr rather than stdout for logging (#29, @stephenmathieson) + +1.0.4 / 2014-07-15 +================== + + * dist: recompile + * example: remove `console.info()` log usage + * example: add "Content-Type" UTF-8 header to browser example + * browser: place %c marker after the space character + * browser: reset the "content" color via `color: inherit` + * browser: add colors support for Firefox >= v31 + * debug: prefer an instance `log()` function over the global one (#119) + * Readme: update documentation about styled console logs for FF v31 (#116, @wryk) + +1.0.3 / 2014-07-09 +================== + + * Add support for multiple wildcards in namespaces (#122, @seegno) + * browser: fix lint + +1.0.2 / 2014-06-10 +================== + + * browser: update color palette (#113, @gscottolson) + * common: make console logging function configurable (#108, @timoxley) + * node: fix %o colors on old node <= 0.8.x + * Makefile: find node path using shell/which (#109, @timoxley) + +1.0.1 / 2014-06-06 +================== + + * browser: use `removeItem()` to clear localStorage + * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777) + * package: add "contributors" section + * node: fix comment typo + * README: list authors + +1.0.0 / 2014-06-04 +================== + + * make ms diff be global, not be scope + * debug: ignore empty strings in enable() + * node: make DEBUG_COLORS able to disable coloring + * *: export the `colors` array + * npmignore: don't publish the `dist` dir + * Makefile: refactor to use browserify + * package: add "browserify" as a dev dependency + * Readme: add Web Inspector Colors section + * node: reset terminal color for the debug content + * node: map "%o" to `util.inspect()` + * browser: map "%j" to `JSON.stringify()` + * debug: add custom "formatters" + * debug: use "ms" module for humanizing the diff + * Readme: add "bash" syntax highlighting + * browser: add Firebug color support + * browser: add colors for WebKit browsers + * node: apply log to `console` + * rewrite: abstract common logic for Node & browsers + * add .jshintrc file + +0.8.1 / 2014-04-14 +================== + + * package: re-add the "component" section + +0.8.0 / 2014-03-30 +================== + + * add `enable()` method for nodejs. Closes #27 + * change from stderr to stdout + * remove unnecessary index.js file + +0.7.4 / 2013-11-13 +================== + + * remove "browserify" key from package.json (fixes something in browserify) + +0.7.3 / 2013-10-30 +================== + + * fix: catch localStorage security error when cookies are blocked (Chrome) + * add debug(err) support. Closes #46 + * add .browser prop to package.json. Closes #42 + +0.7.2 / 2013-02-06 +================== + + * fix package.json + * fix: Mobile Safari (private mode) is broken with debug + * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript + +0.7.1 / 2013-02-05 +================== + + * add repository URL to package.json + * add DEBUG_COLORED to force colored output + * add browserify support + * fix component. Closes #24 + +0.7.0 / 2012-05-04 +================== + + * Added .component to package.json + * Added debug.component.js build + +0.6.0 / 2012-03-16 +================== + + * Added support for "-" prefix in DEBUG [Vinay Pulim] + * Added `.enabled` flag to the node version [TooTallNate] + +0.5.0 / 2012-02-02 +================== + + * Added: humanize diffs. Closes #8 + * Added `debug.disable()` to the CS variant + * Removed padding. Closes #10 + * Fixed: persist client-side variant again. Closes #9 + +0.4.0 / 2012-02-01 +================== + + * Added browser variant support for older browsers [TooTallNate] + * Added `debug.enable('project:*')` to browser variant [TooTallNate] + * Added padding to diff (moved it to the right) + +0.3.0 / 2012-01-26 +================== + + * Added millisecond diff when isatty, otherwise UTC string + +0.2.0 / 2012-01-22 +================== + + * Added wildcard support + +0.1.0 / 2011-12-02 +================== + + * Added: remove colors unless stderr isatty [TooTallNate] + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/Makefile b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/Makefile new file mode 100644 index 00000000..5cf4a596 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/Makefile @@ -0,0 +1,36 @@ + +# get Makefile directory name: http://stackoverflow.com/a/5982798/376773 +THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) +THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd) + +# BIN directory +BIN := $(THIS_DIR)/node_modules/.bin + +# applications +NODE ?= $(shell which node) +NPM ?= $(NODE) $(shell which npm) +BROWSERIFY ?= $(NODE) $(BIN)/browserify + +all: dist/debug.js + +install: node_modules + +clean: + @rm -rf dist + +dist: + @mkdir -p $@ + +dist/debug.js: node_modules browser.js debug.js dist + @$(BROWSERIFY) \ + --standalone debug \ + . > $@ + +distclean: clean + @rm -rf node_modules + +node_modules: package.json + @NODE_ENV= $(NPM) install + @touch node_modules + +.PHONY: all install clean distclean diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/Readme.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/Readme.md new file mode 100644 index 00000000..b4f45e3c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/Readme.md @@ -0,0 +1,188 @@ +# debug + + tiny node.js debugging utility modelled after node core's debugging technique. + +## Installation + +```bash +$ npm install debug +``` + +## Usage + + With `debug` you simply invoke the exported function to generate your debug function, passing it a name which will determine if a noop function is returned, or a decorated `console.error`, so all of the `console` format string goodies you're used to work fine. A unique color is selected per-function for visibility. + +Example _app.js_: + +```js +var debug = require('debug')('http') + , http = require('http') + , name = 'My App'; + +// fake app + +debug('booting %s', name); + +http.createServer(function(req, res){ + debug(req.method + ' ' + req.url); + res.end('hello\n'); +}).listen(3000, function(){ + debug('listening'); +}); + +// fake worker of some kind + +require('./worker'); +``` + +Example _worker.js_: + +```js +var debug = require('debug')('worker'); + +setInterval(function(){ + debug('doing some work'); +}, 1000); +``` + + The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples: + + ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png) + + ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png) + +#### Windows note + + On Windows the environment variable is set using the `set` command. + + ```cmd + set DEBUG=*,-not_this + ``` + +Then, run the program to be debugged as usual. + +## Millisecond diff + + When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. + + ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png) + + When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below: + + ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png) + +## Conventions + + If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". + +## Wildcards + + The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. + + You can also exclude specific debuggers by prefixing them with a "-" character. For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:". + +## Browser support + + Debug works in the browser as well, currently persisted by `localStorage`. Consider the situation shown below where you have `worker:a` and `worker:b`, and wish to debug both. Somewhere in the code on your page, include: + +```js +window.myDebug = require("debug"); +``` + + ("debug" is a global object in the browser so we give this object a different name.) When your page is open in the browser, type the following in the console: + +```js +myDebug.enable("worker:*") +``` + + Refresh the page. Debug output will continue to be sent to the console until it is disabled by typing `myDebug.disable()` in the console. + +```js +a = debug('worker:a'); +b = debug('worker:b'); + +setInterval(function(){ + a('doing some work'); +}, 1000); + +setInterval(function(){ + b('doing some work'); +}, 1200); +``` + +#### Web Inspector Colors + + Colors are also enabled on "Web Inspectors" that understand the `%c` formatting + option. These are WebKit web inspectors, Firefox ([since version + 31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) + and the Firebug plugin for Firefox (any version). + + Colored output looks something like: + + ![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png) + +### stderr vs stdout + +You can set an alternative logging method per-namespace by overriding the `log` method on a per-namespace or globally: + +Example _stdout.js_: + +```js +var debug = require('debug'); +var error = debug('app:error'); + +// by default stderr is used +error('goes to stderr!'); + +var log = debug('app:log'); +// set this namespace to log via console.log +log.log = console.log.bind(console); // don't forget to bind to console! +log('goes to stdout'); +error('still goes to stderr!'); + +// set all output to go via console.info +// overrides all per-namespace log settings +debug.log = console.info.bind(console); +error('now goes to stdout via console.info'); +log('still goes to stdout, but via console.info now'); +``` + +### Save debug output to a file + +You can save all debug statements to a file by piping them. + +Example: + +```bash +$ DEBUG_FD=3 node your-app.js 3> whatever.log +``` + +## Authors + + - TJ Holowaychuk + - Nathan Rajlich + +## License + +(The MIT License) + +Copyright (c) 2014 TJ Holowaychuk <tj@vision-media.ca> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/bower.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/bower.json new file mode 100644 index 00000000..6af573ff --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/bower.json @@ -0,0 +1,28 @@ +{ + "name": "visionmedia-debug", + "main": "dist/debug.js", + "version": "2.2.0", + "homepage": "https://github.com/visionmedia/debug", + "authors": [ + "TJ Holowaychuk " + ], + "description": "visionmedia-debug", + "moduleType": [ + "amd", + "es6", + "globals", + "node" + ], + "keywords": [ + "visionmedia", + "debug" + ], + "license": "MIT", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests" + ] +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/browser.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/browser.js new file mode 100644 index 00000000..7c764522 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/browser.js @@ -0,0 +1,168 @@ + +/** + * This is the web browser implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = require('./debug'); +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.storage = 'undefined' != typeof chrome + && 'undefined' != typeof chrome.storage + ? chrome.storage.local + : localstorage(); + +/** + * Colors. + */ + +exports.colors = [ + 'lightseagreen', + 'forestgreen', + 'goldenrod', + 'dodgerblue', + 'darkorchid', + 'crimson' +]; + +/** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ + +function useColors() { + // is webkit? http://stackoverflow.com/a/16459606/376773 + return ('WebkitAppearance' in document.documentElement.style) || + // is firebug? http://stackoverflow.com/a/398120/376773 + (window.console && (console.firebug || (console.exception && console.table))) || + // is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31); +} + +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + +exports.formatters.j = function(v) { + return JSON.stringify(v); +}; + + +/** + * Colorize log arguments if enabled. + * + * @api public + */ + +function formatArgs() { + var args = arguments; + var useColors = this.useColors; + + args[0] = (useColors ? '%c' : '') + + this.namespace + + (useColors ? ' %c' : ' ') + + args[0] + + (useColors ? '%c ' : ' ') + + '+' + exports.humanize(this.diff); + + if (!useColors) return args; + + var c = 'color: ' + this.color; + args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1)); + + // the final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + var index = 0; + var lastC = 0; + args[0].replace(/%[a-z%]/g, function(match) { + if ('%%' === match) return; + index++; + if ('%c' === match) { + // we only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); + + args.splice(lastC, 0, c); + return args; +} + +/** + * Invokes `console.log()` when available. + * No-op when `console.log` is not a "function". + * + * @api public + */ + +function log() { + // this hackery is required for IE8/9, where + // the `console.log` function doesn't have 'apply' + return 'object' === typeof console + && console.log + && Function.prototype.apply.call(console.log, console, arguments); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + +function save(namespaces) { + try { + if (null == namespaces) { + exports.storage.removeItem('debug'); + } else { + exports.storage.debug = namespaces; + } + } catch(e) {} +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + var r; + try { + r = exports.storage.debug; + } catch(e) {} + return r; +} + +/** + * Enable namespaces listed in `localStorage.debug` initially. + */ + +exports.enable(load()); + +/** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ + +function localstorage(){ + try { + return window.localStorage; + } catch (e) {} +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/component.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/component.json new file mode 100644 index 00000000..ca106372 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/component.json @@ -0,0 +1,19 @@ +{ + "name": "debug", + "repo": "visionmedia/debug", + "description": "small debugging utility", + "version": "2.2.0", + "keywords": [ + "debug", + "log", + "debugger" + ], + "main": "browser.js", + "scripts": [ + "browser.js", + "debug.js" + ], + "dependencies": { + "rauchg/ms.js": "0.7.1" + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/debug.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/debug.js new file mode 100644 index 00000000..7571a860 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/debug.js @@ -0,0 +1,197 @@ + +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = debug; +exports.coerce = coerce; +exports.disable = disable; +exports.enable = enable; +exports.enabled = enabled; +exports.humanize = require('ms'); + +/** + * The currently active debug mode names, and names to skip. + */ + +exports.names = []; +exports.skips = []; + +/** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lowercased letter, i.e. "n". + */ + +exports.formatters = {}; + +/** + * Previously assigned color. + */ + +var prevColor = 0; + +/** + * Previous log timestamp. + */ + +var prevTime; + +/** + * Select a color. + * + * @return {Number} + * @api private + */ + +function selectColor() { + return exports.colors[prevColor++ % exports.colors.length]; +} + +/** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + +function debug(namespace) { + + // define the `disabled` version + function disabled() { + } + disabled.enabled = false; + + // define the `enabled` version + function enabled() { + + var self = enabled; + + // set `diff` timestamp + var curr = +new Date(); + var ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + + // add the `color` if not set + if (null == self.useColors) self.useColors = exports.useColors(); + if (null == self.color && self.useColors) self.color = selectColor(); + + var args = Array.prototype.slice.call(arguments); + + args[0] = exports.coerce(args[0]); + + if ('string' !== typeof args[0]) { + // anything else let's inspect with %o + args = ['%o'].concat(args); + } + + // apply any `formatters` transformations + var index = 0; + args[0] = args[0].replace(/%([a-z%])/g, function(match, format) { + // if we encounter an escaped % then don't increase the array index + if (match === '%%') return match; + index++; + var formatter = exports.formatters[format]; + if ('function' === typeof formatter) { + var val = args[index]; + match = formatter.call(self, val); + + // now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); + + if ('function' === typeof exports.formatArgs) { + args = exports.formatArgs.apply(self, args); + } + var logFn = enabled.log || exports.log || console.log.bind(console); + logFn.apply(self, args); + } + enabled.enabled = true; + + var fn = exports.enabled(namespace) ? enabled : disabled; + + fn.namespace = namespace; + + return fn; +} + +/** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + +function enable(namespaces) { + exports.save(namespaces); + + var split = (namespaces || '').split(/[\s,]+/); + var len = split.length; + + for (var i = 0; i < len; i++) { + if (!split[i]) continue; // ignore empty strings + namespaces = split[i].replace(/\*/g, '.*?'); + if (namespaces[0] === '-') { + exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); + } else { + exports.names.push(new RegExp('^' + namespaces + '$')); + } + } +} + +/** + * Disable debug output. + * + * @api public + */ + +function disable() { + exports.enable(''); +} + +/** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + +function enabled(name) { + var i, len; + for (i = 0, len = exports.skips.length; i < len; i++) { + if (exports.skips[i].test(name)) { + return false; + } + } + for (i = 0, len = exports.names.length; i < len; i++) { + if (exports.names[i].test(name)) { + return true; + } + } + return false; +} + +/** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + +function coerce(val) { + if (val instanceof Error) return val.stack || val.message; + return val; +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/node.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/node.js new file mode 100644 index 00000000..1d392a81 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/node.js @@ -0,0 +1,209 @@ + +/** + * Module dependencies. + */ + +var tty = require('tty'); +var util = require('util'); + +/** + * This is the Node.js implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = require('./debug'); +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; + +/** + * Colors. + */ + +exports.colors = [6, 2, 3, 4, 5, 1]; + +/** + * The file descriptor to write the `debug()` calls to. + * Set the `DEBUG_FD` env variable to override with another value. i.e.: + * + * $ DEBUG_FD=3 node script.js 3>debug.log + */ + +var fd = parseInt(process.env.DEBUG_FD, 10) || 2; +var stream = 1 === fd ? process.stdout : + 2 === fd ? process.stderr : + createWritableStdioStream(fd); + +/** + * Is stdout a TTY? Colored output is enabled when `true`. + */ + +function useColors() { + var debugColors = (process.env.DEBUG_COLORS || '').trim().toLowerCase(); + if (0 === debugColors.length) { + return tty.isatty(fd); + } else { + return '0' !== debugColors + && 'no' !== debugColors + && 'false' !== debugColors + && 'disabled' !== debugColors; + } +} + +/** + * Map %o to `util.inspect()`, since Node doesn't do that out of the box. + */ + +var inspect = (4 === util.inspect.length ? + // node <= 0.8.x + function (v, colors) { + return util.inspect(v, void 0, void 0, colors); + } : + // node > 0.8.x + function (v, colors) { + return util.inspect(v, { colors: colors }); + } +); + +exports.formatters.o = function(v) { + return inspect(v, this.useColors) + .replace(/\s*\n\s*/g, ' '); +}; + +/** + * Adds ANSI color escape codes if enabled. + * + * @api public + */ + +function formatArgs() { + var args = arguments; + var useColors = this.useColors; + var name = this.namespace; + + if (useColors) { + var c = this.color; + + args[0] = ' \u001b[3' + c + ';1m' + name + ' ' + + '\u001b[0m' + + args[0] + '\u001b[3' + c + 'm' + + ' +' + exports.humanize(this.diff) + '\u001b[0m'; + } else { + args[0] = new Date().toUTCString() + + ' ' + name + ' ' + args[0]; + } + return args; +} + +/** + * Invokes `console.error()` with the specified arguments. + */ + +function log() { + return stream.write(util.format.apply(this, arguments) + '\n'); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + +function save(namespaces) { + if (null == namespaces) { + // If you set a process.env field to null or undefined, it gets cast to the + // string 'null' or 'undefined'. Just delete instead. + delete process.env.DEBUG; + } else { + process.env.DEBUG = namespaces; + } +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + return process.env.DEBUG; +} + +/** + * Copied from `node/src/node.js`. + * + * XXX: It's lame that node doesn't expose this API out-of-the-box. It also + * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame. + */ + +function createWritableStdioStream (fd) { + var stream; + var tty_wrap = process.binding('tty_wrap'); + + // Note stream._type is used for test-module-load-list.js + + switch (tty_wrap.guessHandleType(fd)) { + case 'TTY': + stream = new tty.WriteStream(fd); + stream._type = 'tty'; + + // Hack to have stream not keep the event loop alive. + // See https://github.com/joyent/node/issues/1726 + if (stream._handle && stream._handle.unref) { + stream._handle.unref(); + } + break; + + case 'FILE': + var fs = require('fs'); + stream = new fs.SyncWriteStream(fd, { autoClose: false }); + stream._type = 'fs'; + break; + + case 'PIPE': + case 'TCP': + var net = require('net'); + stream = new net.Socket({ + fd: fd, + readable: false, + writable: true + }); + + // FIXME Should probably have an option in net.Socket to create a + // stream from an existing fd which is writable only. But for now + // we'll just add this hack and set the `readable` member to false. + // Test: ./node test/fixtures/echo.js < /etc/passwd + stream.readable = false; + stream.read = null; + stream._type = 'pipe'; + + // FIXME Hack to have stream not keep the event loop alive. + // See https://github.com/joyent/node/issues/1726 + if (stream._handle && stream._handle.unref) { + stream._handle.unref(); + } + break; + + default: + // Probably an error on in uv_guess_handle() + throw new Error('Implement me. Unknown stream file type!'); + } + + // For supporting legacy API we put the FD here. + stream.fd = fd; + + stream._isStdio = true; + + return stream; +} + +/** + * Enable namespaces listed in `process.env.DEBUG` initially. + */ + +exports.enable(load()); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/node_modules/ms/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/node_modules/ms/.npmignore new file mode 100644 index 00000000..d1aa0ce4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/node_modules/ms/.npmignore @@ -0,0 +1,5 @@ +node_modules +test +History.md +Makefile +component.json diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/node_modules/ms/History.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/node_modules/ms/History.md new file mode 100644 index 00000000..32fdfc17 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/node_modules/ms/History.md @@ -0,0 +1,66 @@ + +0.7.1 / 2015-04-20 +================== + + * prevent extraordinary long inputs (@evilpacket) + * Fixed broken readme link + +0.7.0 / 2014-11-24 +================== + + * add time abbreviations, updated tests and readme for the new units + * fix example in the readme. + * add LICENSE file + +0.6.2 / 2013-12-05 +================== + + * Adding repository section to package.json to suppress warning from NPM. + +0.6.1 / 2013-05-10 +================== + + * fix singularization [visionmedia] + +0.6.0 / 2013-03-15 +================== + + * fix minutes + +0.5.1 / 2013-02-24 +================== + + * add component namespace + +0.5.0 / 2012-11-09 +================== + + * add short formatting as default and .long option + * add .license property to component.json + * add version to component.json + +0.4.0 / 2012-10-22 +================== + + * add rounding to fix crazy decimals + +0.3.0 / 2012-09-07 +================== + + * fix `ms()` [visionmedia] + +0.2.0 / 2012-09-03 +================== + + * add component.json [visionmedia] + * add days support [visionmedia] + * add hours support [visionmedia] + * add minutes support [visionmedia] + * add seconds support [visionmedia] + * add ms string support [visionmedia] + * refactor tests to facilitate ms(number) [visionmedia] + +0.1.0 / 2012-03-07 +================== + + * Initial release diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/node_modules/ms/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/node_modules/ms/LICENSE new file mode 100644 index 00000000..6c07561b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/node_modules/ms/LICENSE @@ -0,0 +1,20 @@ +(The MIT License) + +Copyright (c) 2014 Guillermo Rauch + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/node_modules/ms/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/node_modules/ms/README.md new file mode 100644 index 00000000..9b4fd035 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/node_modules/ms/README.md @@ -0,0 +1,35 @@ +# ms.js: miliseconds conversion utility + +```js +ms('2 days') // 172800000 +ms('1d') // 86400000 +ms('10h') // 36000000 +ms('2.5 hrs') // 9000000 +ms('2h') // 7200000 +ms('1m') // 60000 +ms('5s') // 5000 +ms('100') // 100 +``` + +```js +ms(60000) // "1m" +ms(2 * 60000) // "2m" +ms(ms('10 hours')) // "10h" +``` + +```js +ms(60000, { long: true }) // "1 minute" +ms(2 * 60000, { long: true }) // "2 minutes" +ms(ms('10 hours'), { long: true }) // "10 hours" +``` + +- Node/Browser compatible. Published as [`ms`](https://www.npmjs.org/package/ms) in [NPM](http://nodejs.org/download). +- If a number is supplied to `ms`, a string with a unit is returned. +- If a string that contains the number is supplied, it returns it as +a number (e.g: it returns `100` for `'100'`). +- If you pass a string with a number and a valid unit, the number of +equivalent ms is returned. + +## License + +MIT diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/node_modules/ms/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/node_modules/ms/index.js new file mode 100644 index 00000000..4f927716 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/node_modules/ms/index.js @@ -0,0 +1,125 @@ +/** + * Helpers. + */ + +var s = 1000; +var m = s * 60; +var h = m * 60; +var d = h * 24; +var y = d * 365.25; + +/** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} options + * @return {String|Number} + * @api public + */ + +module.exports = function(val, options){ + options = options || {}; + if ('string' == typeof val) return parse(val); + return options.long + ? long(val) + : short(val); +}; + +/** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ + +function parse(str) { + str = '' + str; + if (str.length > 10000) return; + var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str); + if (!match) return; + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; + case 'days': + case 'day': + case 'd': + return n * d; + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + } +} + +/** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function short(ms) { + if (ms >= d) return Math.round(ms / d) + 'd'; + if (ms >= h) return Math.round(ms / h) + 'h'; + if (ms >= m) return Math.round(ms / m) + 'm'; + if (ms >= s) return Math.round(ms / s) + 's'; + return ms + 'ms'; +} + +/** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function long(ms) { + return plural(ms, d, 'day') + || plural(ms, h, 'hour') + || plural(ms, m, 'minute') + || plural(ms, s, 'second') + || ms + ' ms'; +} + +/** + * Pluralization helper. + */ + +function plural(ms, n, name) { + if (ms < n) return; + if (ms < n * 1.5) return Math.floor(ms / n) + ' ' + name; + return Math.ceil(ms / n) + ' ' + name + 's'; +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/node_modules/ms/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/node_modules/ms/package.json new file mode 100644 index 00000000..e36489ef --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/node_modules/ms/package.json @@ -0,0 +1,48 @@ +{ + "name": "ms", + "version": "0.7.1", + "description": "Tiny ms conversion utility", + "repository": { + "type": "git", + "url": "git://github.com/guille/ms.js.git" + }, + "main": "./index", + "devDependencies": { + "mocha": "*", + "expect.js": "*", + "serve": "*" + }, + "component": { + "scripts": { + "ms/index.js": "index.js" + } + }, + "gitHead": "713dcf26d9e6fd9dbc95affe7eff9783b7f1b909", + "bugs": { + "url": "https://github.com/guille/ms.js/issues" + }, + "homepage": "https://github.com/guille/ms.js", + "_id": "ms@0.7.1", + "scripts": {}, + "_shasum": "9cd13c03adbff25b65effde7ce864ee952017098", + "_from": "ms@0.7.1", + "_npmVersion": "2.7.5", + "_nodeVersion": "0.12.2", + "_npmUser": { + "name": "rauchg", + "email": "rauchg@gmail.com" + }, + "maintainers": [ + { + "name": "rauchg", + "email": "rauchg@gmail.com" + } + ], + "dist": { + "shasum": "9cd13c03adbff25b65effde7ce864ee952017098", + "tarball": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/package.json new file mode 100644 index 00000000..40adf87c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/package.json @@ -0,0 +1,73 @@ +{ + "name": "debug", + "version": "2.2.0", + "repository": { + "type": "git", + "url": "git://github.com/visionmedia/debug.git" + }, + "description": "small debugging utility", + "keywords": [ + "debug", + "log", + "debugger" + ], + "author": { + "name": "TJ Holowaychuk", + "email": "tj@vision-media.ca" + }, + "contributors": [ + { + "name": "Nathan Rajlich", + "email": "nathan@tootallnate.net", + "url": "http://n8.io" + } + ], + "license": "MIT", + "dependencies": { + "ms": "0.7.1" + }, + "devDependencies": { + "browserify": "9.0.3", + "mocha": "*" + }, + "main": "./node.js", + "browser": "./browser.js", + "component": { + "scripts": { + "debug/index.js": "browser.js", + "debug/debug.js": "debug.js" + } + }, + "gitHead": "b38458422b5aa8aa6d286b10dfe427e8a67e2b35", + "bugs": { + "url": "https://github.com/visionmedia/debug/issues" + }, + "homepage": "https://github.com/visionmedia/debug", + "_id": "debug@2.2.0", + "scripts": {}, + "_shasum": "f87057e995b1a1f6ae6a4960664137bc56f039da", + "_from": "debug@>=2.2.0 <3.0.0", + "_npmVersion": "2.7.4", + "_nodeVersion": "0.12.2", + "_npmUser": { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + }, + "maintainers": [ + { + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" + }, + { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + } + ], + "dist": { + "shasum": "f87057e995b1a1f6ae6a4960664137bc56f039da", + "tarball": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/.lint b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/.lint new file mode 100644 index 00000000..df1e53cd --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/.lint @@ -0,0 +1,15 @@ +@root + +module + +tabs +indent 2 +maxlen 100 + +ass +nomen +plusplus +newcap +vars + +predef+ Symbol diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/.npmignore new file mode 100644 index 00000000..155e41f6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/.npmignore @@ -0,0 +1,4 @@ +.DS_Store +/node_modules +/npm-debug.log +/.lintcache diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/.travis.yml new file mode 100644 index 00000000..0b1f5e4a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/.travis.yml @@ -0,0 +1,11 @@ +sudo: false # http://docs.travis-ci.com/user/workers/container-based-infrastructure/ +language: node_js +node_js: + - 0.12 + - v4 + - v5 + - v6 + +notifications: + email: + - medikoo+es6-symbol@medikoo.com diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/CHANGES b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/CHANGES new file mode 100644 index 00000000..6aebe74a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/CHANGES @@ -0,0 +1,52 @@ +v3.1.0 -- 2016.05.17 +* Fix internals of symbol detection +* Ensure Symbol.prototype[Symbol.toPrimitive] in all cases returns primitive value + (fixes Node v6 support) +* Create native symbols whenver possible + +v3.0.2 -- 2015.12.12 +* Fix definition flow, so uneven state of Symbol implementation doesn't crash initialization of + polyfill. See #13 + +v3.0.1 -- 2015.10.22 +* Workaround for IE11 bug (reported in #12) + +v3.0.0 -- 2015.10.02 +* Reuse native symbols (e.g. iterator, toStringTag etc.) in a polyfill if they're available + Otherwise polyfill symbols may not be recognized by other functions +* Improve documentation + +v2.0.1 -- 2015.01.28 +* Fix Symbol.prototype[Symbol.isPrimitive] implementation +* Improve validation within Symbol.prototype.toString and + Symbol.prototype.valueOf + +v2.0.0 -- 2015.01.28 +* Update up to changes in specification: + * Implement `for` and `keyFor` + * Remove `Symbol.create` and `Symbol.isRegExp` + * Add `Symbol.match`, `Symbol.replace`, `Symbol.search`, `Symbol.species` and + `Symbol.split` +* Rename `validSymbol` to `validateSymbol` +* Improve documentation +* Remove dead test modules + +v1.0.0 -- 2015.01.26 +* Fix enumerability for symbol properties set normally (e.g. obj[symbol] = value) +* Introduce initialization via hidden constructor +* Fix isSymbol handling of polyfill values when native Symbol is present +* Fix spelling of LICENSE +* Configure lint scripts + +v0.1.1 -- 2014.10.07 +* Fix isImplemented, so it returns true in case of polyfill +* Improve documentations + +v0.1.0 -- 2014.04.28 +* Assure strictly npm dependencies +* Update to use latest versions of dependencies +* Fix implementation detection so it doesn't crash on `String(symbol)` +* throw on `new Symbol()` (as decided by TC39) + +v0.0.0 -- 2013.11.15 +* Initial (dev) version \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/LICENSE new file mode 100644 index 00000000..04724a3a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2013-2015 Mariusz Nowak (www.medikoo.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/README.md new file mode 100644 index 00000000..0fa89784 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/README.md @@ -0,0 +1,71 @@ +# es6-symbol +## ECMAScript 6 Symbol polyfill + +For more information about symbols see following links +- [Symbols in ECMAScript 6 by Axel Rauschmayer](http://www.2ality.com/2014/12/es6-symbols.html) +- [MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) +- [Specification](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-symbol-constructor) + +### Limitations + +Underneath it uses real string property names which can easily be retrieved, however accidental collision with other property names is unlikely. + +### Usage + +It’s safest to use *es6-symbol* as a [ponyfill](http://kikobeats.com/polyfill-ponyfill-and-prollyfill/) – a polyfill which doesn’t touch global objects: + +```javascript +var Symbol = require('es6-symbol'); +``` + +If you want to make sure your environment implements `Symbol` globally, do: + +```javascript +require('es6-symbol/implement'); +``` + +If you strictly want to use polyfill even if native `Symbol` exists (hard to find a good reason for that), do: + +```javascript +var Symbol = require('es6-symbol/polyfill'); +``` + +#### API + +Best is to refer to [specification](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-symbol-objects). Still if you want quick look, follow examples: + +```javascript +var Symbol = require('es6-symbol'); + +var symbol = Symbol('My custom symbol'); +var x = {}; + +x[symbol] = 'foo'; +console.log(x[symbol]); 'foo' + +// Detect iterable: +var iterator, result; +if (possiblyIterable[Symbol.iterator]) { + iterator = possiblyIterable[Symbol.iterator](); + result = iterator.next(); + while(!result.done) { + console.log(result.value); + result = iterator.next(); + } +} +``` + +### Installation +#### NPM + +In your project path: + + $ npm install es6-symbol + +##### Browser + +To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/) + +## Tests [![Build Status](https://travis-ci.org/medikoo/es6-symbol.png)](https://travis-ci.org/medikoo/es6-symbol) + + $ npm test diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/implement.js new file mode 100644 index 00000000..153edacd --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/implement.js @@ -0,0 +1,7 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(require('es5-ext/global'), 'Symbol', + { value: require('./polyfill'), configurable: true, enumerable: false, + writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/index.js new file mode 100644 index 00000000..609f1faf --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./is-implemented')() ? Symbol : require('./polyfill'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/is-implemented.js new file mode 100644 index 00000000..93629d2f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/is-implemented.js @@ -0,0 +1,17 @@ +'use strict'; + +var validTypes = { object: true, symbol: true }; + +module.exports = function () { + var symbol; + if (typeof Symbol !== 'function') return false; + symbol = Symbol('test symbol'); + try { String(symbol); } catch (e) { return false; } + + // Return 'true' also for polyfills + if (!validTypes[typeof Symbol.iterator]) return false; + if (!validTypes[typeof Symbol.toPrimitive]) return false; + if (!validTypes[typeof Symbol.toStringTag]) return false; + + return true; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/is-native-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/is-native-implemented.js new file mode 100644 index 00000000..5f073a19 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/is-native-implemented.js @@ -0,0 +1,8 @@ +// Exports true if environment provides native `Symbol` implementation + +'use strict'; + +module.exports = (function () { + if (typeof Symbol !== 'function') return false; + return (typeof Symbol() === 'symbol'); +}()); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/is-symbol.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/is-symbol.js new file mode 100644 index 00000000..074cb07f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/is-symbol.js @@ -0,0 +1,9 @@ +'use strict'; + +module.exports = function (x) { + if (!x) return false; + if (typeof x === 'symbol') return true; + if (!x.constructor) return false; + if (x.constructor.name !== 'Symbol') return false; + return (x[x.constructor.toStringTag] === 'Symbol'); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/.lint b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/.lint new file mode 100644 index 00000000..858b7535 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/.lint @@ -0,0 +1,12 @@ +@root + +es5 +module + +tabs +indent 2 +maxlen 80 + +ass +nomen +plusplus diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/.npmignore new file mode 100644 index 00000000..155e41f6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/.npmignore @@ -0,0 +1,4 @@ +.DS_Store +/node_modules +/npm-debug.log +/.lintcache diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/.travis.yml new file mode 100644 index 00000000..50008b23 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/.travis.yml @@ -0,0 +1,9 @@ +language: node_js +node_js: + - 0.8 + - 0.10 + - 0.11 + +notifications: + email: + - medikoo+d@medikoo.com diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/CHANGES b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/CHANGES new file mode 100644 index 00000000..45233f74 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/CHANGES @@ -0,0 +1,7 @@ +v0.1.1 -- 2014.04.24 +- Add `autoBind` and `lazy` utilities +- Allow to pass other options to be merged onto created descriptor. + Useful when used with other custom utilties + +v0.1.0 -- 2013.06.20 +Initial (derived from es5-ext project) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/LICENCE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/LICENCE new file mode 100644 index 00000000..aaf35282 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/LICENCE @@ -0,0 +1,19 @@ +Copyright (C) 2013 Mariusz Nowak (www.medikoo.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/README.md new file mode 100644 index 00000000..872d493e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/README.md @@ -0,0 +1,108 @@ +# D - Property descriptor factory + +_Originally derived from [es5-ext](https://github.com/medikoo/es5-ext) package._ + +Defining properties with descriptors is very verbose: + +```javascript +var Account = function () {}; +Object.defineProperties(Account.prototype, { + deposit: { value: function () { + /* ... */ + }, configurable: true, enumerable: false, writable: true }, + whithdraw: { value: function () { + /* ... */ + }, configurable: true, enumerable: false, writable: true }, + balance: { get: function () { + /* ... */ + }, configurable: true, enumerable: false } +}); +``` + +D cuts that to: + +```javascript +var d = require('d'); + +var Account = function () {}; +Object.defineProperties(Account.prototype, { + deposit: d(function () { + /* ... */ + }), + whithdraw: d(function () { + /* ... */ + }), + balance: d.gs(function () { + /* ... */ + }) +}); +``` + +By default, created descriptor follow characteristics of native ES5 properties, and defines values as: + +```javascript +{ configurable: true, enumerable: false, writable: true } +``` + +You can overwrite it by preceding _value_ argument with instruction: +```javascript +d('c', value); // { configurable: true, enumerable: false, writable: false } +d('ce', value); // { configurable: true, enumerable: true, writable: false } +d('e', value); // { configurable: false, enumerable: true, writable: false } + +// Same way for get/set: +d.gs('e', value); // { configurable: false, enumerable: true } +``` + +### Other utilities + +#### autoBind(obj, props) _(d/auto-bind)_ + +Define methods which will be automatically bound to its instances + +```javascript +var d = require('d'); +var autoBind = require('d/auto-bind'); + +var Foo = function () { this._count = 0; }; +autoBind(Foo.prototype, { + increment: d(function () { ++this._count; }); +}); + +var foo = new Foo(); + +// Increment foo counter on each domEl click +domEl.addEventListener('click', foo.increment, false); +``` + +#### lazy(obj, props) _(d/lazy)_ + +Define lazy properties, which will be resolved on first access + +```javascript +var d = require('d'); +var lazy = require('d/lazy'); + +var Foo = function () {}; +lazy(Foo.prototype, { + items: d(function () { return []; }) +}); + +var foo = new Foo(); +foo.items.push(1, 2); // foo.items array created +``` + +## Installation +### NPM + +In your project path: + + $ npm install d + +### Browser + +You can easily bundle _D_ for browser with [modules-webmake](https://github.com/medikoo/modules-webmake) + +## Tests [![Build Status](https://travis-ci.org/medikoo/d.png)](https://travis-ci.org/medikoo/d) + + $ npm test diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/auto-bind.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/auto-bind.js new file mode 100644 index 00000000..1b00dba3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/auto-bind.js @@ -0,0 +1,31 @@ +'use strict'; + +var copy = require('es5-ext/object/copy') + , map = require('es5-ext/object/map') + , callable = require('es5-ext/object/valid-callable') + , validValue = require('es5-ext/object/valid-value') + + , bind = Function.prototype.bind, defineProperty = Object.defineProperty + , hasOwnProperty = Object.prototype.hasOwnProperty + , define; + +define = function (name, desc, bindTo) { + var value = validValue(desc) && callable(desc.value), dgs; + dgs = copy(desc); + delete dgs.writable; + delete dgs.value; + dgs.get = function () { + if (hasOwnProperty.call(this, name)) return value; + desc.value = bind.call(value, (bindTo == null) ? this : this[bindTo]); + defineProperty(this, name, desc); + return this[name]; + }; + return dgs; +}; + +module.exports = function (props/*, bindTo*/) { + var bindTo = arguments[1]; + return map(props, function (desc, name) { + return define(name, desc, bindTo); + }); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/index.js new file mode 100644 index 00000000..076ae465 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/index.js @@ -0,0 +1,63 @@ +'use strict'; + +var assign = require('es5-ext/object/assign') + , normalizeOpts = require('es5-ext/object/normalize-options') + , isCallable = require('es5-ext/object/is-callable') + , contains = require('es5-ext/string/#/contains') + + , d; + +d = module.exports = function (dscr, value/*, options*/) { + var c, e, w, options, desc; + if ((arguments.length < 2) || (typeof dscr !== 'string')) { + options = value; + value = dscr; + dscr = null; + } else { + options = arguments[2]; + } + if (dscr == null) { + c = w = true; + e = false; + } else { + c = contains.call(dscr, 'c'); + e = contains.call(dscr, 'e'); + w = contains.call(dscr, 'w'); + } + + desc = { value: value, configurable: c, enumerable: e, writable: w }; + return !options ? desc : assign(normalizeOpts(options), desc); +}; + +d.gs = function (dscr, get, set/*, options*/) { + var c, e, options, desc; + if (typeof dscr !== 'string') { + options = set; + set = get; + get = dscr; + dscr = null; + } else { + options = arguments[3]; + } + if (get == null) { + get = undefined; + } else if (!isCallable(get)) { + options = get; + get = set = undefined; + } else if (set == null) { + set = undefined; + } else if (!isCallable(set)) { + options = set; + set = undefined; + } + if (dscr == null) { + c = true; + e = false; + } else { + c = contains.call(dscr, 'c'); + e = contains.call(dscr, 'e'); + } + + desc = { get: get, set: set, configurable: c, enumerable: e }; + return !options ? desc : assign(normalizeOpts(options), desc); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/lazy.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/lazy.js new file mode 100644 index 00000000..61e46653 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/lazy.js @@ -0,0 +1,111 @@ +'use strict'; + +var map = require('es5-ext/object/map') + , isCallable = require('es5-ext/object/is-callable') + , validValue = require('es5-ext/object/valid-value') + , contains = require('es5-ext/string/#/contains') + + , call = Function.prototype.call + , defineProperty = Object.defineProperty + , getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor + , getPrototypeOf = Object.getPrototypeOf + , hasOwnProperty = Object.prototype.hasOwnProperty + , cacheDesc = { configurable: false, enumerable: false, writable: false, + value: null } + , define; + +define = function (name, options) { + var value, dgs, cacheName, desc, writable = false, resolvable + , flat; + options = Object(validValue(options)); + cacheName = options.cacheName; + flat = options.flat; + if (cacheName == null) cacheName = name; + delete options.cacheName; + value = options.value; + resolvable = isCallable(value); + delete options.value; + dgs = { configurable: Boolean(options.configurable), + enumerable: Boolean(options.enumerable) }; + if (name !== cacheName) { + dgs.get = function () { + if (hasOwnProperty.call(this, cacheName)) return this[cacheName]; + cacheDesc.value = resolvable ? call.call(value, this, options) : value; + cacheDesc.writable = writable; + defineProperty(this, cacheName, cacheDesc); + cacheDesc.value = null; + if (desc) defineProperty(this, name, desc); + return this[cacheName]; + }; + } else if (!flat) { + dgs.get = function self() { + var ownDesc; + if (hasOwnProperty.call(this, name)) { + ownDesc = getOwnPropertyDescriptor(this, name); + // It happens in Safari, that getter is still called after property + // was defined with a value, following workarounds that + if (ownDesc.hasOwnProperty('value')) return ownDesc.value; + if ((typeof ownDesc.get === 'function') && (ownDesc.get !== self)) { + return ownDesc.get.call(this); + } + return value; + } + desc.value = resolvable ? call.call(value, this, options) : value; + defineProperty(this, name, desc); + desc.value = null; + return this[name]; + }; + } else { + dgs.get = function self() { + var base = this, ownDesc; + if (hasOwnProperty.call(this, name)) { + // It happens in Safari, that getter is still called after property + // was defined with a value, following workarounds that + ownDesc = getOwnPropertyDescriptor(this, name); + if (ownDesc.hasOwnProperty('value')) return ownDesc.value; + if ((typeof ownDesc.get === 'function') && (ownDesc.get !== self)) { + return ownDesc.get.call(this); + } + } + while (!hasOwnProperty.call(base, name)) base = getPrototypeOf(base); + desc.value = resolvable ? call.call(value, base, options) : value; + defineProperty(base, name, desc); + desc.value = null; + return base[name]; + }; + } + dgs.set = function (value) { + dgs.get.call(this); + this[cacheName] = value; + }; + if (options.desc) { + desc = { + configurable: contains.call(options.desc, 'c'), + enumerable: contains.call(options.desc, 'e') + }; + if (cacheName === name) { + desc.writable = contains.call(options.desc, 'w'); + desc.value = null; + } else { + writable = contains.call(options.desc, 'w'); + desc.get = dgs.get; + desc.set = dgs.set; + } + delete options.desc; + } else if (cacheName === name) { + desc = { + configurable: Boolean(options.configurable), + enumerable: Boolean(options.enumerable), + writable: Boolean(options.writable), + value: null + }; + } + delete options.configurable; + delete options.enumerable; + delete options.writable; + return dgs; +}; + +module.exports = function (props) { + return map(props, function (desc, name) { return define(name, desc); }); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/package.json new file mode 100644 index 00000000..114c94c8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/package.json @@ -0,0 +1,59 @@ +{ + "name": "d", + "version": "0.1.1", + "description": "Property descriptor factory", + "author": { + "name": "Mariusz Nowak", + "email": "medyk@medikoo.com", + "url": "http://www.medikoo.com/" + }, + "scripts": { + "test": "node node_modules/tad/bin/tad" + }, + "repository": { + "type": "git", + "url": "git://github.com/medikoo/d.git" + }, + "keywords": [ + "descriptor", + "es", + "ecmascript", + "ecma", + "property", + "descriptors", + "meta", + "properties" + ], + "dependencies": { + "es5-ext": "~0.10.2" + }, + "devDependencies": { + "tad": "~0.1.21" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/medikoo/d/issues" + }, + "homepage": "https://github.com/medikoo/d", + "_id": "d@0.1.1", + "dist": { + "shasum": "da184c535d18d8ee7ba2aa229b914009fae11309", + "tarball": "https://registry.npmjs.org/d/-/d-0.1.1.tgz" + }, + "_from": "d@>=0.1.1 <0.2.0", + "_npmVersion": "1.4.3", + "_npmUser": { + "name": "medikoo", + "email": "medikoo+npm@medikoo.com" + }, + "maintainers": [ + { + "name": "medikoo", + "email": "medikoo+npm@medikoo.com" + } + ], + "directories": {}, + "_shasum": "da184c535d18d8ee7ba2aa229b914009fae11309", + "_resolved": "https://registry.npmjs.org/d/-/d-0.1.1.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/test/auto-bind.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/test/auto-bind.js new file mode 100644 index 00000000..89edfb88 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/test/auto-bind.js @@ -0,0 +1,12 @@ +'use strict'; + +var d = require('../'); + +module.exports = function (t, a) { + var o = Object.defineProperties({}, t({ + bar: d(function () { return this === o; }), + bar2: d(function () { return this; }) + })); + + a.deep([(o.bar)(), (o.bar2)()], [true, o]); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/test/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/test/index.js new file mode 100644 index 00000000..3db0af10 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/test/index.js @@ -0,0 +1,182 @@ +'use strict'; + +var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + +module.exports = function (t, a) { + var o, c, cg, cs, ce, ceg, ces, cew, cw, e, eg, es, ew, v, vg, vs, w, df, dfg + , dfs; + + o = Object.create(Object.prototype, { + c: t('c', c = {}), + cgs: t.gs('c', cg = function () {}, cs = function () {}), + ce: t('ce', ce = {}), + cegs: t.gs('ce', ceg = function () {}, ces = function () {}), + cew: t('cew', cew = {}), + cw: t('cw', cw = {}), + e: t('e', e = {}), + egs: t.gs('e', eg = function () {}, es = function () {}), + ew: t('ew', ew = {}), + v: t('', v = {}), + vgs: t.gs('', vg = function () {}, vs = function () {}), + w: t('w', w = {}), + + df: t(df = {}), + dfgs: t.gs(dfg = function () {}, dfs = function () {}) + }); + + return { + c: function (a) { + var d = getOwnPropertyDescriptor(o, 'c'); + a(d.value, c, "Value"); + a(d.get, undefined, "Get"); + a(d.set, undefined, "Set"); + a(d.configurable, true, "Configurable"); + a(d.enumerable, false, "Enumerable"); + a(d.writable, false, "Writable"); + + d = getOwnPropertyDescriptor(o, 'cgs'); + a(d.value, undefined, "GS Value"); + a(d.get, cg, "GS Get"); + a(d.set, cs, "GS Set"); + a(d.configurable, true, "GS Configurable"); + a(d.enumerable, false, "GS Enumerable"); + a(d.writable, undefined, "GS Writable"); + }, + ce: function (a) { + var d = getOwnPropertyDescriptor(o, 'ce'); + a(d.value, ce, "Value"); + a(d.get, undefined, "Get"); + a(d.set, undefined, "Set"); + a(d.configurable, true, "Configurable"); + a(d.enumerable, true, "Enumerable"); + a(d.writable, false, "Writable"); + + d = getOwnPropertyDescriptor(o, 'cegs'); + a(d.value, undefined, "GS Value"); + a(d.get, ceg, "GS Get"); + a(d.set, ces, "GS Set"); + a(d.configurable, true, "GS Configurable"); + a(d.enumerable, true, "GS Enumerable"); + a(d.writable, undefined, "GS Writable"); + }, + cew: function (a) { + var d = getOwnPropertyDescriptor(o, 'cew'); + a(d.value, cew, "Value"); + a(d.get, undefined, "Get"); + a(d.set, undefined, "Set"); + a(d.configurable, true, "Configurable"); + a(d.enumerable, true, "Enumerable"); + a(d.writable, true, "Writable"); + }, + cw: function (a) { + var d = getOwnPropertyDescriptor(o, 'cw'); + a(d.value, cw, "Value"); + a(d.get, undefined, "Get"); + a(d.set, undefined, "Set"); + a(d.configurable, true, "Configurable"); + a(d.enumerable, false, "Enumerable"); + a(d.writable, true, "Writable"); + }, + e: function (a) { + var d = getOwnPropertyDescriptor(o, 'e'); + a(d.value, e, "Value"); + a(d.get, undefined, "Get"); + a(d.set, undefined, "Set"); + a(d.configurable, false, "Configurable"); + a(d.enumerable, true, "Enumerable"); + a(d.writable, false, "Writable"); + + d = getOwnPropertyDescriptor(o, 'egs'); + a(d.value, undefined, "GS Value"); + a(d.get, eg, "GS Get"); + a(d.set, es, "GS Set"); + a(d.configurable, false, "GS Configurable"); + a(d.enumerable, true, "GS Enumerable"); + a(d.writable, undefined, "GS Writable"); + }, + ew: function (a) { + var d = getOwnPropertyDescriptor(o, 'ew'); + a(d.value, ew, "Value"); + a(d.get, undefined, "Get"); + a(d.set, undefined, "Set"); + a(d.configurable, false, "Configurable"); + a(d.enumerable, true, "Enumerable"); + a(d.writable, true, "Writable"); + }, + v: function (a) { + var d = getOwnPropertyDescriptor(o, 'v'); + a(d.value, v, "Value"); + a(d.get, undefined, "Get"); + a(d.set, undefined, "Set"); + a(d.configurable, false, "Configurable"); + a(d.enumerable, false, "Enumerable"); + a(d.writable, false, "Writable"); + + d = getOwnPropertyDescriptor(o, 'vgs'); + a(d.value, undefined, "GS Value"); + a(d.get, vg, "GS Get"); + a(d.set, vs, "GS Set"); + a(d.configurable, false, "GS Configurable"); + a(d.enumerable, false, "GS Enumerable"); + a(d.writable, undefined, "GS Writable"); + }, + w: function (a) { + var d = getOwnPropertyDescriptor(o, 'w'); + a(d.value, w, "Value"); + a(d.get, undefined, "Get"); + a(d.set, undefined, "Set"); + a(d.configurable, false, "Configurable"); + a(d.enumerable, false, "Enumerable"); + a(d.writable, true, "Writable"); + }, + d: function (a) { + var d = getOwnPropertyDescriptor(o, 'df'); + a(d.value, df, "Value"); + a(d.get, undefined, "Get"); + a(d.set, undefined, "Set"); + a(d.configurable, true, "Configurable"); + a(d.enumerable, false, "Enumerable"); + a(d.writable, true, "Writable"); + + d = getOwnPropertyDescriptor(o, 'dfgs'); + a(d.value, undefined, "GS Value"); + a(d.get, dfg, "GS Get"); + a(d.set, dfs, "GS Set"); + a(d.configurable, true, "GS Configurable"); + a(d.enumerable, false, "GS Enumerable"); + a(d.writable, undefined, "GS Writable"); + }, + Options: { + v: function (a) { + var x = {}, d = t(x, { foo: true }); + a.deep(d, { configurable: true, enumerable: false, writable: true, + value: x, foo: true }, "No descriptor"); + d = t('c', 'foo', { marko: 'elo' }); + a.deep(d, { configurable: true, enumerable: false, writable: false, + value: 'foo', marko: 'elo' }, "Descriptor"); + }, + gs: function (a) { + var gFn = function () {}, sFn = function () {}, d; + d = t.gs(gFn, sFn, { foo: true }); + a.deep(d, { configurable: true, enumerable: false, get: gFn, set: sFn, + foo: true }, "No descriptor"); + d = t.gs(null, sFn, { foo: true }); + a.deep(d, { configurable: true, enumerable: false, get: undefined, + set: sFn, foo: true }, "No descriptor: Just set"); + d = t.gs(gFn, { foo: true }); + a.deep(d, { configurable: true, enumerable: false, get: gFn, + set: undefined, foo: true }, "No descriptor: Just get"); + + d = t.gs('e', gFn, sFn, { bar: true }); + a.deep(d, { configurable: false, enumerable: true, get: gFn, set: sFn, + bar: true }, "Descriptor"); + d = t.gs('e', null, sFn, { bar: true }); + a.deep(d, { configurable: false, enumerable: true, get: undefined, + set: sFn, bar: true }, "Descriptor: Just set"); + d = t.gs('e', gFn, { bar: true }); + a.deep(d, { configurable: false, enumerable: true, get: gFn, + set: undefined, bar: true }, "Descriptor: Just get"); + } + } + }; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/test/lazy.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/test/lazy.js new file mode 100644 index 00000000..8266deb2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/test/lazy.js @@ -0,0 +1,77 @@ +'use strict'; + +var d = require('../') + + , getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + +module.exports = function (t, a) { + var Foo = function () {}, i = 1, o, o2, desc; + Object.defineProperties(Foo.prototype, t({ + bar: d(function () { return ++i; }), + bar2: d(function () { return this.bar + 23; }), + bar3: d(function () { return this.bar2 + 34; }, { desc: 'ew' }), + bar4: d(function () { return this.bar3 + 12; }, { cacheName: '_bar4_' }), + bar5: d(function () { return this.bar4 + 3; }, + { cacheName: '_bar5_', desc: 'e' }) + })); + + desc = getOwnPropertyDescriptor(Foo.prototype, 'bar'); + a(desc.configurable, true, "Configurable: default"); + a(desc.enumerable, false, "Enumerable: default"); + + o = new Foo(); + a.deep([o.bar, o.bar2, o.bar3, o.bar4, o.bar5], [2, 25, 59, 71, 74], + "Values"); + + a.deep(getOwnPropertyDescriptor(o, 'bar3'), { configurable: false, + enumerable: true, writable: true, value: 59 }, "Desc"); + a(o.hasOwnProperty('bar4'), false, "Cache not exposed"); + desc = getOwnPropertyDescriptor(o, 'bar5'); + a.deep(desc, { configurable: false, + enumerable: true, get: desc.get, set: desc.set }, "Cache & Desc: desc"); + + o2 = Object.create(o); + o2.bar = 30; + o2.bar3 = 100; + + a.deep([o2.bar, o2.bar2, o2.bar3, o2.bar4, o2.bar5], [30, 25, 100, 112, 115], + "Extension Values"); + + Foo = function () {}; + Object.defineProperties(Foo.prototype, t({ + test: d('w', function () { return 'raz'; }), + test2: d('', function () { return 'raz'; }, { desc: 'w' }), + test3: d('', function () { return 'raz'; }, + { cacheName: '__test3__', desc: 'w' }), + test4: d('w', 'bar') + })); + + o = new Foo(); + o.test = 'marko'; + a.deep(getOwnPropertyDescriptor(o, 'test'), + { configurable: false, enumerable: false, writable: true, value: 'marko' }, + "Set before get"); + o.test2 = 'marko2'; + a.deep(getOwnPropertyDescriptor(o, 'test2'), + { configurable: false, enumerable: false, writable: true, value: 'marko2' }, + "Set before get: Custom desc"); + o.test3 = 'marko3'; + a.deep(getOwnPropertyDescriptor(o, '__test3__'), + { configurable: false, enumerable: false, writable: true, value: 'marko3' }, + "Set before get: Custom cache name"); + a(o.test4, 'bar', "Resolve by value"); + + a.h1("Flat"); + Object.defineProperties(Foo.prototype, t({ + flat: d(function () { return 'foo'; }, { flat: true }), + flat2: d(function () { return 'bar'; }, { flat: true }) + })); + + a.h2("Instance"); + a(o.flat, 'foo', "Value"); + a(o.hasOwnProperty('flat'), false, "Instance"); + a(Foo.prototype.flat, 'foo', "Prototype"); + + a.h2("Direct"); + a(Foo.prototype.flat2, 'bar'); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/.lint b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/.lint new file mode 100644 index 00000000..d1da6103 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/.lint @@ -0,0 +1,38 @@ +@root + +module + +indent 2 +maxlen 100 +tabs + +ass +continue +forin +nomen +plusplus +vars + +./global.js +./function/_define-length.js +./function/#/copy.js +./object/unserialize.js +./test/function/valid-function.js +evil + +./math/_pack-ieee754.js +./math/_unpack-ieee754.js +./math/clz32/shim.js +./math/imul/shim.js +./number/to-uint32.js +./string/#/at.js +bitwise + +./math/fround/shim.js +predef+ Float32Array + +./object/first-key.js +forin + +./test/reg-exp/#/index.js +predef+ __dirname diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/.lintignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/.lintignore new file mode 100644 index 00000000..eece4ff3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/.lintignore @@ -0,0 +1,9 @@ +/string/#/normalize/_data.js +/test/boolean/is-boolean.js +/test/date/is-date.js +/test/number/is-number.js +/test/object/is-copy.js +/test/object/is-number-value.js +/test/object/is-object.js +/test/reg-exp/is-reg-exp.js +/test/string/is-string.js diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/.npmignore new file mode 100644 index 00000000..eb09b500 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/.npmignore @@ -0,0 +1,4 @@ +.DS_Store +/node_modules +/.lintcache +/npm-debug.log diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/.travis.yml new file mode 100644 index 00000000..39fd70e6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/.travis.yml @@ -0,0 +1,16 @@ +sudo: false # http://docs.travis-ci.com/user/workers/container-based-infrastructure/ +language: node_js +node_js: + - 0.12 + - 4 + - 5 + - 6 + +before_install: + - mkdir node_modules; ln -s ../ node_modules/es5-ext + +notifications: + email: + - medikoo+es5-ext@medikoo.com + +script: "npm test && npm run lint" diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/CHANGES b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/CHANGES new file mode 100644 index 00000000..4ecc2db0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/CHANGES @@ -0,0 +1,633 @@ +v0.10.12 -- 2016.07.01 +* Ensure symbols are copied in Object.mixin +* Prevent RangeError errors in array#flatten +* Do not validate invalidate dates in validDate + +v0.10.11 -- 2015.12.18 +* Ensure that check for implementation of RegExp flags doesn't crash in V8 (thanks @mathiasbynens) + +v0.10.10 -- 2015.12.11 +* Add Object.isNumberValue util + +v0.10.9 -- 2015.12.01 +* Add Object.ensureNaturalNumber and Object.ensureNaturalNumberValue + +v0.10.8 -- 2015.10.02 +* Add Number.isNatural +* Add Object.find and Object.findKey +* Support arrays in Object.copyDeep +* Fix iteration issue in forEachRight and someRight +* Fix detection of native sinh +* Depend on es6-symbol v3 + +v0.10.7 -- 2015.04.22 +* New utlitities. They're convention differs from v0.10, as they were supposed to land in v1. + Still they're non breaking and start the conventions to be used in v1 + * Object.validateArrayLike + * Object.validateArrayLikeObject + * Object.validateStringifiable + * Object.validateStringifiableValue + * Universal utilities for array-like/iterable objects + * Iterable.is + * Iterable.validate + * Iterable.validateObject + * Iterable.forEach +* Fix camelToHyphen resolution, it must be absolutely reversable by hyphenToCamel +* Fix calculations of large numbers in Math.tanh +* Fix algorithm of Math.sinh +* Fix indexes to not use real symbols +* Fix length of String.fromCodePoint +* Fix tests of Array#copyWithin +* Update Travis CI configuration + +v0.10.6 -- 2015.02.02 +* Fix handling of infinite values in Math.trunc +* Fix handling of getters in Object.normalizeOptions + +v0.10.5 -- 2015.01.20 +* Add Function#toStringTokens +* Add Object.serialize and Object.unserialize +* Add String.randomUniq +* Fix Strin#camelToHyphen issue with tokens that end with digit +* Optimise Number.isInteger logic +* Improve documentation +* Configure lint scripts +* Fix spelling of LICENSE + +v0.10.4 -- 2014.04.30 +* Assure maximum spec compliance of Array.of and Array.from (thanks @mathiasbynens) +* Improve documentations + +v0.10.3 -- 2014.04.29 +Provide accurate iterators handling: +* Array.from improvements: + * Assure right unicode symbols resolution when processing strings in Array.from + * Rely on ES6 symbol shim and use native @@iterator Symbol if provided by environment +* Add methods: + * Array.prototype.entries + * Array.prototype.keys + * Array.prototype.values + * Array.prototype[@@iterator] + * String.prototype[@@iterator] + +Improve documentation + +v0.10.2 -- 2014.04.24 +- Simplify and deprecate `isCallable`. It seems in ES5 based engines there are + no callable objects which are `typeof obj !== 'function'` +- Update Array.from map callback signature (up to latest resolution of TC39) +- Improve documentation + +v0.10.1 -- 2014.04.14 +Bump version for npm +(Workaround for accidental premature publish & unpublish of v0.10.0 a while ago) + +v0.10.0 -- 2014.04.13 +Major update: +- All methods and function specified for ECMAScript 6 are now introduced as + shims accompanied with functions through which (optionally) they can be + implementend on native objects +- Filename convention was changed to shorter and strictly lower case names. e.g. + `lib/String/prototype/starts-with` became `string/#/starts-with` +- Generated functions are guaranteed to have expected length +- Objects with null prototype (created via `Object.create(null)`) are widely + supported (older version have crashed due to implied `obj.hasOwnProperty` and + related invocations) +- Support array subclasses +- When handling lists do not limit its length to Uint32 range +- Use newly introduced `Object.eq` for strict equality in place of `Object.is` +- Iteration of Object have been improved so properties that were hidden or + removed after iteration started are not iterated. + +Additions: +- `Array.isPlainArray` +- `Array.validArray` +- `Array.prototype.concat` (as updated with ES6) +- `Array.prototype.copyWithin` (as introduced with ES6) +- `Array.prototype.fill` (as introduced with ES6) +- `Array.prototype.filter` (as updated with ES6) +- `Array.prototype.findIndex` (as introduced with ES6) +- `Array.prototype.map` (as updated with ES6) +- `Array.prototype.separate` +- `Array.prototype.slice` (as updated with ES6) +- `Array.prototype.splice` (as updated with ES6) +- `Function.prototype.copy` +- `Math.acosh` (as introduced with ES6) +- `Math.atanh` (as introduced with ES6) +- `Math.cbrt` (as introduced with ES6) +- `Math.clz32` (as introduced with ES6) +- `Math.cosh` (as introduced with ES6) +- `Math.expm1` (as introduced with ES6) +- `Math.fround` (as introduced with ES6) +- `Math.hypot` (as introduced with ES6) +- `Math.imul` (as introduced with ES6) +- `Math.log2` (as introduced with ES6) +- `Math.log10` (as introduced with ES6) +- `Math.log1p` (as introduced with ES6) +- `Math.sinh` (as introduced with ES6) +- `Math.tanh` (as introduced with ES6) +- `Math.trunc` (as introduced with ES6) +- `Number.EPSILON` (as introduced with ES6) +- `Number.MIN_SAFE_INTEGER` (as introduced with ES6) +- `Number.MAX_SAFE_INTEGER` (as introduced with ES6) +- `Number.isFinite` (as introduced with ES6) +- `Number.isInteger` (as introduced with ES6) +- `Number.isSafeInteger` (as introduced with ES6) +- `Object.create` (with fix for V8 issue which disallows prototype turn of + objects derived from null +- `Object.eq` - Less restrictive version of `Object.is` based on SameValueZero + algorithm +- `Object.firstKey` +- `Object.keys` (as updated with ES6) +- `Object.mixinPrototypes` +- `Object.primitiveSet` +- `Object.setPrototypeOf` (as introduced with ES6) +- `Object.validObject` +- `RegExp.escape` +- `RegExp.prototype.match` (as introduced with ES6) +- `RegExp.prototype.replace` (as introduced with ES6) +- `RegExp.prototype.search` (as introduced with ES6) +- `RegExp.prototype.split` (as introduced with ES6) +- `RegExp.prototype.sticky` (as introduced with ES6) +- `RegExp.prototype.unicode` (as introduced with ES6) +- `String.fromCodePoint` (as introduced with ES6) +- `String.raw` (as introduced with ES6) +- `String.prototype.at` +- `String.prototype.codePointAt` (as introduced with ES6) +- `String.prototype.normalize` (as introduced with ES6) +- `String.prototype.plainReplaceAll` + +Removals: +- `reserved` set +- `Array.prototype.commonLeft` +- `Function.insert` +- `Function.remove` +- `Function.prototype.silent` +- `Function.prototype.wrap` +- `Object.descriptor` Move to external `d` project. + See: https://github.com/medikoo/d +- `Object.diff` +- `Object.extendDeep` +- `Object.reduce` +- `Object.values` +- `String.prototype.trimCommonLeft` + +Renames: +- `Function.i` into `Function.identity` +- `Function.k` into `Function.constant` +- `Number.toInt` into `Number.toInteger` +- `Number.toUint` into `Number.toPosInteger` +- `Object.extend` into `Object.assign` (as introduced in ES 6) +- `Object.extendProperties` into `Object.mixin`, with improved internal + handling, so it matches temporarily specified `Object.mixin` for ECMAScript 6 +- `Object.isList` into `Object.isArrayLike` +- `Object.mapToArray` into `Object.toArray` (with fixed function length) +- `Object.toPlainObject` into `Object.normalizeOptions` (as this is the real + use case where we use this function) +- `Function.prototype.chain` into `Function.prototype.compose` +- `Function.prototype.match` into `Function.prototype.spread` +- `String.prototype.format` into `String.formatMethod` + +Improvements & Fixes: +- Remove workaround for primitive values handling in object iterators +- `Array.from`: Update so it follows ES 6 spec +- `Array.prototype.compact`: filters just null and undefined values + (not all falsies) +- `Array.prototype.eIndexOf` and `Array.prototype.eLastIndexOf`: fix position + handling, improve internals +- `Array.prototype.find`: return undefined not null, in case of not found + (follow ES 6) +- `Array.prototype.remove` fix function length +- `Error.custom`: simplify, Custom class case is addressed by outer + `error-create` project -> https://github.com/medikoo/error-create +- `Error.isError` true only for Error instances (remove detection of host + Exception objects) +- `Number.prototype.pad`: Normalize negative pad +- `Object.clear`: Handle errors same way as in `Object.assign` +- `Object.compact`: filters just null and undefined values (not all falsies) +- `Object.compare`: Take into account NaN values +- `Object.copy`: Split into `Object.copy` and `Object.copyDeep` +- `Object.isCopy`: Separate into `Object.isCopy` and `Object.isCopyDeep`, where + `isCopyDeep` handles nested plain objects and plain arrays only +- `String.prototype.endsWith`: Adjust up to ES6 specification +- `String.prototype.repeat`: Adjust up to ES6 specification and improve algorithm +- `String.prototype.simpleReplace`: Rename into `String.prototype.plainReplace` +- `String.prototype.startsWith`: Adjust up to ES6 specification +- Update lint rules, and adjust code to that +- Update Travis CI configuration +- Remove Makefile (it's cross-env utility) + +v0.9.2 -- 2013.03.11 +Added: +* Array.prototype.isCopy +* Array.prototype.isUniq +* Error.CustomError +* Function.validFunction +* Object.extendDeep +* Object.descriptor.binder +* Object.safeTraverse +* RegExp.validRegExp +* String.prototype.capitalize +* String.prototype.simpleReplace + +Fixed: +* Fix Array.prototype.diff for sparse arrays +* Accept primitive objects as input values in Object iteration methods and + Object.clear, Object.count, Object.diff, Object.extend, + Object.getPropertyNames, Object.values +* Pass expected arguments to callbacks of Object.filter, Object.mapKeys, + Object.mapToArray, Object.map +* Improve callable callback support in Object.mapToArray + +v0.9.1 -- 2012.09.17 +* Object.reduce - reduce for hash-like collections +* Accapt any callable object as callback in Object.filter, mapKeys and map +* Convention cleanup + +v0.9.0 -- 2012.09.13 +We're getting to real solid API + +Removed: +* Function#memoize - it's grown up to be external package, to be soon published + as 'memoizee' +* String.guid - it doesn't fit es5-ext (extensions) concept, will be provided as + external package +# Function.arguments - obsolete +# Function.context - obsolete +# Function#flip - not readable when used, so it was never used +# Object.clone - obsolete and confusing + +Added: +* String#camelToHyphen - String format convertion + +Renamed: +* String#dashToCamelCase -> String#hyphenToCamel + +Fixes: +* Object.isObject - Quote names in literals that match reserved keywords + (older implementations crashed on that) +* String#repeat - Do not accept negative values (coerce them to 1) + +Improvements: +* Array#remove - Accepts many arguments, we can now remove many values at once +* Object iterators (forEach, map, some) - Compare function invoked with scope + object bound to this +* Function#curry - Algorithm cleanup +* Object.isCopy - Support for all types, not just plain objects +* Object.isPlainObject - Support for cross-frame objects +* Do not memoize any of the functions, it shouldn't be decided internally +* Remove Object.freeze calls in reserved, it's not up to convention +* Improved documentation +* Better linting (hard-core approach using both JSLint mod and JSHint) +* Optional arguments are now documented in funtions signature + +v0.8.2 -- 2012.06.22 +Fix errors in Array's intersection and exclusion methods, related to improper +usage of contains method + +v0.8.1 -- 2012.06.13 +Reorganized internal logic of Function.prototype.memoize. So it's more safe now +and clears cache properly. Additionally preventCache option was provided. + +v0.8.0 -- 2012.05.28 +Again, major overhaul. Probably last experimental stuff was trashed, all API +looks more like standard extensions now. + +Changes: +* Turn all Object.prototype extensions into functions and move them to Object +namespace. We learned that extending Object.prototype is bad idea in any case. +* Rename Function.prototype.curry into Function.prototype.partial. This function + is really doing partial application while currying is slightly different + concept. +* Convert Function.prototype.ncurry to new implementation of + Function.prototype.curry, it now serves real curry concept additionaly it + covers use cases for aritize and hold, which were removed. +* Rename Array's peek to last, and provide support for sparse arrays in it +* Rename Date's monthDaysCount into daysInMonth +* Simplify object iterators, now order of iteration can be configured with just + compareFn argument (no extra byKeys option) +* Rename Object.isDuplicate to Object.isCopy +* Rename Object.isEqual to Object.is which is compatible with future 'is' + keyword +* Function.memoize is now Function.prototype.memoize. Additionally clear cache + functionality is added, and access to original arguments object. +* Rename validation functions: assertNotNull to validValue, assertCallable to + validCallable. validValue was moved to Object namespace. On success they now + return validated value instead of true, it supports better composition. + Additionally created Date.validDate and Error.validError +* All documentation is now held in README.md not in code files. +* Move guid to String namespace. All guids now start with numbers. +* Array.generate: fill argument is now optional +* Object.toArray is now Array.from (as new ES6 specification draft suggests) +* All methods that rely on indexOf or lastIndexOf, now rely on egal (Object.is) + versions of them (eIndexOf, eLastIndexOf) +* Turn all get* functions that returned methods into actuall methods (get* + functionality can still be achieved with help of Function.prototype.partial). + So: Date.getFormat is now Date.prototype.format, + Number.getPad is now Number.prototype.pad, + String.getFormat is now String.prototype.format, + String.getIndent is now String.prototype.indent, + String.getPad is now String.prototype.pad +* Refactored Object.descriptor, it is now just two functions, main one and + main.gs, main is for describing values, and gs for describing getters and + setters. Configuration is passed with first argument as string e.g. 'ce' for + configurable and enumerable. If no configuration string is provided then by + default it returns configurable and writable but not enumerable for value or + configurable but not enumerable for getter/setter +* Function.prototype.silent now returns prepared function (it was + expected to be fixed for 0.7) +* Reserved keywords map (reserved) is now array not hash. +* Object.merge is now Object.extend (while former Object.extend was completely + removed) - 'extend' implies that we change object, not creating new one (as + 'merge' may imply). Similarily Object.mergeProperties was renamed to + Object.extendProperties +* Position argument support in Array.prototype.contains and + String.prototype.contains (so it follows ES6 specification draft) +* endPosition argument support in String.prototype.endsWith and fromPosition + argument support in String.prototype.startsWith (so it follows ES6 + specification draft) +* Better and cleaner String.prototype.indent implementation. No default value + for indent string argument, optional nest value (defaults to 1), remove + nostart argument +* Correct length values for most methods (so they reflect length of similar + methods in standard) +* Length argument is now optional in number and string pad methods. +* Improve arguments validation in general, so it adheres to standard conventions +* Fixed format of package.json + +Removed methods and functions: +* Object.prototype.slice - Object is not ordered collection, so slice doesn't + make sense. +* Function's rcurry, rncurry, s - too cumbersome for JS, not many use cases for + that +* Function.prototype.aritize and Function.prototype.hold - same functionality + can be achieved with new Function.prototype.curry +* Function.prototype.log - provided more generic Function.prototype.wrap for + same use case +* getNextIdGenerator - no use case for that (String.guid should be used if + needed) +* Object.toObject - Can be now acheived with Object(validValue(x)) +* Array.prototype.someValue - no real use case (personally used once and + case was already controversial) +* Date.prototype.duration - moved to external package +* Number.getAutoincrement - No real use case +* Object.prototype.extend, Object.prototype.override, + Object.prototype.plainCreate, Object.prototype.plainExtend - It was probably + too complex, same should be achieved just with Object.create, + Object.descriptor and by saving references to super methods in local scope. +* Object.getCompareBy - Functions should be created individually for each use + case +* Object.get, Object.getSet, Object.set, Object.unset - Not many use cases and + same can be easily achieved with simple inline function +* String.getPrefixWith - Not real use case for something that can be easily + achieved with '+' operator +* Object.isPrimitive - It's just negation of Object.isObject +* Number.prototype.isLess, Number.prototype.isLessOrEqual - they shouldn't be in + Number namespace and should rather be addressed with simple inline functions. +* Number.prototype.subtract - Should rather be addressed with simple inline + function + +New methods and functions: +* Array.prototype.lastIndex - Returns last declared index in array +* String.prototype.last - last for strings +* Function.prototype.wrap - Wrap function with other, it allows to specify + before and after behavior transform return value or prevent original function + from being called. +* Math.sign - Returns sign of a number (already in ES6 specification draft) +* Number.toInt - Converts value to integer (already in ES6 specification draft) +* Number.isNaN - Returns true if value is NaN (already in ES6 specification + draft) +* Number.toUint - Converts value to unsigned integer +* Number.toUint32 - Converts value to 32bit unsigned integer +* Array.prototype.eIndexOf, eLastIndexOf - Egal version (that uses Object.is) of + standard methods (all methods that were using native indexOf or lastIndexOf + now uses eIndexOf and elastIndexOf respectively) +* Array.of - as it's specified for ES6 + +Fixes: +* Fixed binarySearch so it always returns valid list index +* Object.isList - it failed on lists that are callable (e.g. NodeList in Nitro + engine) +* Object.map now supports third argument for callback + +v0.7.1 -- 2012.01.05 +New methods: +* Array.prototype.firstIndex - returns first valid index of array (for + sparse arrays it may not be '0' + +Improvements: +* Array.prototype.first - now returns value for index returned by firstIndex +* Object.prototype.mapToArray - can be called without callback, then array of + key-value pairs is returned + +Fixes +* Array.prototype.forEachRight, object's length read through UInt32 conversion + +v0.7.0 -- 2011.12.27 +Major update. +Stepped back from experimental ideas and introduced more standard approach +taking example from how ES5 methods and functions are designed. One exceptions +is that, we don’t refrain from declaring methods for Object.prototype - it’s up +to developer whether how he decides to use it in his context (as function or as +method). + +In general: +* Removed any method 'functionalization' and functionalize method itself. + es5-ext declares plain methods, which can be configured to work as functions + with call.bind(method) - see documentation. +* Removed separation of Object methods for ES5 (with descriptors) and + ES3 (plain) - we're following ES5 idea on that, some methods are intended just + for enumerable properties and some are for all properties, all are declared + for Object.prototype +* Removed separation of Array generic (collected in List folder) and not generic + methods (collected in Array folder). Now all methods are generic and are in + Array/prototype folder. This separation also meant, that methods in Array are + usually destructive. We don’t do that separation now, there’s generally no use + case for destructive iterators, we should be fine with one version of each + method, (same as ES5 is fine with e.g. one, non destructive 'filter' method) +* Folder structure resembles tree of native ES5 Objects +* All methods are written with ES5 conventions in mind, it means that most + methods are generic and can be run on any object. In more detail: + ** Array.prototype and Object.prototype methods can be run on any object (any + not null or undefined value), + ** Date.prototype methods should be called only on Date instances. + ** Function.prototype methods can be called on any callable objects (not + necessarily functions) + ** Number.prototype & String.prototype methods can be called on any value, in + case of Number it it’ll be degraded to number, in case of string it’ll be + degraded to string. +* Travis CI support (only for Node v0.6 branch, as v0.4 has buggy V8 version) + +Improvements for existing functions and methods: +* Function.memoize (was Function.cache) is now fully generic, can operate on any + type of arguments and it’s NaN safe (all NaN objects are considered equal) +* Method properties passed to Object.prototype.extend or + Object.prototype.override can aside of _super optionally take prototype object + via _proto argument +* Object iterators: forEach, mapToArray and every can now iterate in specified + order +* pluck, invoke and other functions that return reusable functions or methods + have now their results memoized. + +New methods: +* Global: assertNotNull, getNextIdGenerator, guid, isEqual, isPrimitive, + toObject +* Array: generate +* Array.prototype: binarySearch, clear, contains, diff, exclusion, find, first, + forEachRight, group, indexesOf, intersection, remove, someRight, someValue +* Boolean: isBoolean +* Date: isDate +* Function: arguments, context, insert, isArguments, remove +* Function.prototype: not, silent +* Number: getAutoincrement, isNumber +* Number.prototype: isLessOrEqual, isLess, subtract +* Object: assertCallable, descriptor (functions for clean descriptors), + getCompareBy, isCallable, isObject +* Object.prototype: clone (real clone), compact, count, diff, empty, + getPropertyNames, get, keyOf, mapKeys, override, plainCreate, plainExtend, + slice, some, unset +* RegExp: isRegExp +* String: getPrefixWith, isString +* String.prototype: caseInsensitiveCompare, contains, isNumeric + +Renamed methods: +* Date.clone -> Date.prototype.copy +* Date.format -> Date.getFormat +* Date/day/floor -> Date.prototype.floorDay +* Date/month/floor -> Date.prototype.floorMonth +* Date/month/year -> Date.prototype.floorYear +* Function.cache -> Function.memoize +* Function.getApplyArg -> Function.prototype.match +* Function.sequence -> Function.prototype.chain +* List.findSameStartLength -> Array.prototype.commonLeft +* Number.pad -> Number.getPad +* Object/plain/clone -> Object.prototype.copy +* Object/plain/elevate -> Object.prototype.flatten +* Object/plain/same -> Object.prototype.isDuplicate +* Object/plain/setValue -> Object.getSet +* String.format -> String.getFormat +* String.indent -> String.getIndent +* String.pad -> String.getPad +* String.trimLeftStr -> String.prototype.trimCommonLeft +* Object.merge -> Object.prototype.mergeProperties +* Object/plain/pluck -> Object.prototype.get +* Array.clone is now Array.prototype.copy and can be used also on any array-like + objects +* List.isList -> Object.isList +* List.toArray -> Object.prototype.toArray +* String/convert/dashToCamelCase -> String.prototype.dashToCamelCase + +Removed methods: +* Array.compact - removed destructive version (that operated on same array), we + have now non destructive version as Array.prototype.compact. +* Function.applyBind -> use apply.bind directly +* Function.bindBind -> use bind.bind directly +* Function.callBind -> use call.bind directly +* Fuction.clone -> no valid use case +* Function.dscope -> controversial approach, shouldn’t be considered seriously +* Function.functionalize -> It was experimental but standards are standards +* List/sort/length -> It can be easy obtained by Object.getCompareBy(‘length’) +* List.concat -> Concat’s for array-like’s makes no sense, just convert to array + first +* List.every -> Use Array.prototype.every directly +* List.filter -> Use Array.prototype.filter directly +* List.forEach -> User Array.prototype.forEach directly +* List.isListObject -> No valid use case, do: isList(list) && (typeof list === + 'object’) +* List.map -> Use Array.prototype.map directly +* List.reduce -> Use Array.prototype.reduce directly +* List.shiftSame -> Use Array.prototype.commonLeft and do slice +* List.slice -> Use Array.prototype.slice directly +* List.some -> Use Array.prototype.some directly +* Object.bindMethods -> it was version that considered descriptors, we have now + Object.prototype.bindMethods which operates only on enumerable properties +* Object.every -> version that considered all properties, we have now + Object.prototype.every which iterates only enumerables +* Object.invoke -> no use case +* Object.mergeDeep -> no use case +* Object.pluck -> no use case +* Object.same -> it considered descriptors, now there’s only Object.isDuplicate + which compares only enumerable properties +* Object.sameType -> no use case +* Object.toDescriptor and Object.toDescriptors -> replaced by much nicer + Object.descriptor functions +* Object/plain/link -> no use case (it was used internally only by + Object/plain/merge) +* Object/plain/setTrue -> now easily configurable by more universal + Object.getSet(true) +* String.trimRightStr -> Eventually String.prototype.trimCommonRight will be + added + +v0.6.3 -- 2011.12.12 +* Cleared npm warning for misnamed property in package.json + +v0.6.2 -- 2011.08.12 +* Calling String.indent without scope (global scope then) now treated as calling + it with null scope, it allows more direct invocations when using default nest + string: indent().call(str, nest) + +v0.6.1 -- 2011.08.08 +* Added TAD test suite to devDependencies, configured test commands. + Tests can be run with 'make test' or 'npm test' + +v0.6.0 -- 2011.08.07 +New methods: +* Array: clone, compact (in place) +* Date: format, duration, clone, monthDaysCount, day.floor, month.floor, + year.floor +* Function: getApplyArg, , ncurry, rncurry, hold, cache, log +* List: findSameStartLength, shiftSame, peek, isListObject +* Number: pad +* Object: sameType, toString, mapToArray, mergeDeep, toDescriptor, + toDescriptors, invoke +* String: startsWith, endsWith, indent, trimLeftStr, trimRightStr, pad, format + +Fixed: +* Object.extend does now prototypal extend as exptected +* Object.merge now tries to overwrite only configurable properties +* Function.flip + +Improved: +* Faster List.toArray +* Better global retrieval +* Functionalized all Function methods +* Renamed bindApply and bindCall to applyBind and callBind +* Removed Function.inherit (as it's unintuitive curry clone) +* Straightforward logic in Function.k +* Fixed naming of some tests files (letter case issue) +* Renamed Function.saturate into Function.lock +* String.dashToCamelCase digits support +* Strings now considered as List objects +* Improved List.compact +* Concise logic for List.concat +* Test wit TAD in clean ES5 context + +v0.5.1 -- 2011.07.11 +* Function's bindBind, bindCall and bindApply now more versatile + +v0.5.0 -- 2011.07.07 +* Removed Object.is and List.apply +* Renamed Object.plain.is to Object.plain.isPlainObject (keep naming convention + consistent) +* Improved documentation + +v0.4.0 -- 2011.07.05 +* Take most functions on Object to Object.plain to keep them away from object + descriptors +* Object functions with ES5 standard in mind (object descriptors) + +v0.3.0 -- 2011.06.24 +* New functions +* Consistent file naming (dash instead of camelCase) + +v0.2.1 -- 2011.05.28 +* Renamed Functions.K and Function.S to to lowercase versions (use consistent + naming) + +v0.2.0 -- 2011.05.28 +* Renamed Array folder to List (as its generic functions for array-like objects) +* Added Makefile +* Added various functions + +v0.1.0 -- 2011.05.24 +* Initial version diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/LICENSE new file mode 100644 index 00000000..de39071f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2011-2015 Mariusz Nowak (www.medikoo.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/README.md new file mode 100644 index 00000000..ad09fe23 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/README.md @@ -0,0 +1,993 @@ +# es5-ext +## ECMAScript 5 extensions +### (with respect to ECMAScript 6 standard) + +Shims for upcoming ES6 standard and other goodies implemented strictly with ECMAScript conventions in mind. + +It's designed to be used in compliant ECMAScript 5 or ECMAScript 6 environments. Older environments are not supported, although most of the features should work with correct ECMAScript 5 shim on board. + +When used in ECMAScript 6 environment, native implementation (if valid) takes precedence over shims. + +### Installation + + $ npm install es5-ext + +To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/) + +### Usage + +#### ECMAScript 6 features + +You can force ES6 features to be implemented in your environment, e.g. following will assign `from` function to `Array` (only if it's not implemented already). + +```javascript +require('es5-ext/array/from/implement'); +Array.from('foo'); // ['f', 'o', 'o'] +``` + +You can also access shims directly, without fixing native objects. Following will return native `Array.from` if it's available and fallback to shim if it's not. + +```javascript +var aFrom = require('es5-ext/array/from'); +aFrom('foo'); // ['f', 'o', 'o'] +``` + +If you want to use shim unconditionally (even if native implementation exists) do: + +```javascript +var aFrom = require('es5-ext/array/from/shim'); +aFrom('foo'); // ['f', 'o', 'o'] +``` + +##### List of ES6 shims + +It's about properties introduced with ES6 and those that have been updated in new spec. + +- `Array.from` -> `require('es5-ext/array/from')` +- `Array.of` -> `require('es5-ext/array/of')` +- `Array.prototype.concat` -> `require('es5-ext/array/#/concat')` +- `Array.prototype.copyWithin` -> `require('es5-ext/array/#/copy-within')` +- `Array.prototype.entries` -> `require('es5-ext/array/#/entries')` +- `Array.prototype.fill` -> `require('es5-ext/array/#/fill')` +- `Array.prototype.filter` -> `require('es5-ext/array/#/filter')` +- `Array.prototype.find` -> `require('es5-ext/array/#/find')` +- `Array.prototype.findIndex` -> `require('es5-ext/array/#/find-index')` +- `Array.prototype.keys` -> `require('es5-ext/array/#/keys')` +- `Array.prototype.map` -> `require('es5-ext/array/#/map')` +- `Array.prototype.slice` -> `require('es5-ext/array/#/slice')` +- `Array.prototype.splice` -> `require('es5-ext/array/#/splice')` +- `Array.prototype.values` -> `require('es5-ext/array/#/values')` +- `Array.prototype[@@iterator]` -> `require('es5-ext/array/#/@@iterator')` +- `Math.acosh` -> `require('es5-ext/math/acosh')` +- `Math.asinh` -> `require('es5-ext/math/asinh')` +- `Math.atanh` -> `require('es5-ext/math/atanh')` +- `Math.cbrt` -> `require('es5-ext/math/cbrt')` +- `Math.clz32` -> `require('es5-ext/math/clz32')` +- `Math.cosh` -> `require('es5-ext/math/cosh')` +- `Math.exmp1` -> `require('es5-ext/math/expm1')` +- `Math.fround` -> `require('es5-ext/math/fround')` +- `Math.hypot` -> `require('es5-ext/math/hypot')` +- `Math.imul` -> `require('es5-ext/math/imul')` +- `Math.log1p` -> `require('es5-ext/math/log1p')` +- `Math.log2` -> `require('es5-ext/math/log2')` +- `Math.log10` -> `require('es5-ext/math/log10')` +- `Math.sign` -> `require('es5-ext/math/sign')` +- `Math.signh` -> `require('es5-ext/math/signh')` +- `Math.tanh` -> `require('es5-ext/math/tanh')` +- `Math.trunc` -> `require('es5-ext/math/trunc')` +- `Number.EPSILON` -> `require('es5-ext/number/epsilon')` +- `Number.MAX_SAFE_INTEGER` -> `require('es5-ext/number/max-safe-integer')` +- `Number.MIN_SAFE_INTEGER` -> `require('es5-ext/number/min-safe-integer')` +- `Number.isFinite` -> `require('es5-ext/number/is-finite')` +- `Number.isInteger` -> `require('es5-ext/number/is-integer')` +- `Number.isNaN` -> `require('es5-ext/number/is-nan')` +- `Number.isSafeInteger` -> `require('es5-ext/number/is-safe-integer')` +- `Object.assign` -> `require('es5-ext/object/assign')` +- `Object.keys` -> `require('es5-ext/object/keys')` +- `Object.setPrototypeOf` -> `require('es5-ext/object/set-prototype-of')` +- `RegExp.prototype.match` -> `require('es5-ext/reg-exp/#/match')` +- `RegExp.prototype.replace` -> `require('es5-ext/reg-exp/#/replace')` +- `RegExp.prototype.search` -> `require('es5-ext/reg-exp/#/search')` +- `RegExp.prototype.split` -> `require('es5-ext/reg-exp/#/split')` +- `RegExp.prototype.sticky` -> Implement with `require('es5-ext/reg-exp/#/sticky/implement')`, use as function with `require('es5-ext/reg-exp/#/is-sticky')` +- `RegExp.prototype.unicode` -> Implement with `require('es5-ext/reg-exp/#/unicode/implement')`, use as function with `require('es5-ext/reg-exp/#/is-unicode')` +- `String.fromCodePoint` -> `require('es5-ext/string/from-code-point')` +- `String.raw` -> `require('es5-ext/string/raw')` +- `String.prototype.codePointAt` -> `require('es5-ext/string/#/code-point-at')` +- `String.prototype.contains` -> `require('es5-ext/string/#/contains')` +- `String.prototype.endsWith` -> `require('es5-ext/string/#/ends-with')` +- `String.prototype.normalize` -> `require('es5-ext/string/#/normalize')` +- `String.prototype.repeat` -> `require('es5-ext/string/#/repeat')` +- `String.prototype.startsWith` -> `require('es5-ext/string/#/starts-with')` +- `String.prototype[@@iterator]` -> `require('es5-ext/string/#/@@iterator')` + +#### Non ECMAScript standard features + +__es5-ext__ provides also other utils, and implements them as if they were proposed for a standard. It mostly offers methods (not functions) which can directly be assigned to native prototypes: + +```javascript +Object.defineProperty(Function.prototype, 'partial', { value: require('es5-ext/function/#/partial'), + configurable: true, enumerable: false, writable: true }); +Object.defineProperty(Array.prototype, 'flatten', { value: require('es5-ext/array/#/flatten'), + configurable: true, enumerable: false, writable: true }); +Object.defineProperty(String.prototype, 'capitalize', { value: require('es5-ext/string/#/capitalize'), + configurable: true, enumerable: false, writable: true }); +``` + +See [es5-extend](https://github.com/wookieb/es5-extend#es5-extend), a great utility that automatically will extend natives for you. + +__Important:__ Remember to __not__ extend natives in scope of generic reusable packages (e.g. ones you intend to publish to npm). Extending natives is fine __only__ if you're the _owner_ of the global scope, so e.g. in final project you lead development of. + +When you're in situation when native extensions are not good idea, then you should use methods indirectly: + + +```javascript +var flatten = require('es5-ext/array/#/flatten'); + +flatten.call([1, [2, [3, 4]]]); // [1, 2, 3, 4] +``` + +for better convenience you can turn methods into functions: + + +```javascript +var call = Function.prototype.call +var flatten = call.bind(require('es5-ext/array/#/flatten')); + +flatten([1, [2, [3, 4]]]); // [1, 2, 3, 4] +``` + +You can configure custom toolkit (like [underscorejs](http://underscorejs.org/)), and use it throughout your application + +```javascript +var util = {}; +util.partial = call.bind(require('es5-ext/function/#/partial')); +util.flatten = call.bind(require('es5-ext/array/#/flatten')); +util.startsWith = call.bind(require('es5-ext/string/#/starts-with')); + +util.flatten([1, [2, [3, 4]]]); // [1, 2, 3, 4] +``` + +As with native ones most methods are generic and can be run on any type of object. + +## API + +### Global extensions + +#### global _(es5-ext/global)_ + +Object that represents global scope + +### Array Constructor extensions + +#### from(arrayLike[, mapFn[, thisArg]]) _(es5-ext/array/from)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.from). +Returns array representation of _iterable_ or _arrayLike_. If _arrayLike_ is an instance of array, its copy is returned. + +#### generate([length[, …fill]]) _(es5-ext/array/generate)_ + +Generate an array of pre-given _length_ built of repeated arguments. + +#### isPlainArray(x) _(es5-ext/array/is-plain-array)_ + +Returns true if object is plain array (not instance of one of the Array's extensions). + +#### of([…items]) _(es5-ext/array/of)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.of). +Create an array from given arguments. + +#### toArray(obj) _(es5-ext/array/to-array)_ + +Returns array representation of `obj`. If `obj` is already an array, `obj` is returned back. + +#### validArray(obj) _(es5-ext/array/valid-array)_ + +Returns `obj` if it's an array, otherwise throws `TypeError` + +### Array Prototype extensions + +#### arr.binarySearch(compareFn) _(es5-ext/array/#/binary-search)_ + +In __sorted__ list search for index of item for which _compareFn_ returns value closest to _0_. +It's variant of binary search algorithm + +#### arr.clear() _(es5-ext/array/#/clear)_ + +Clears the array + +#### arr.compact() _(es5-ext/array/#/compact)_ + +Returns a copy of the context with all non-values (`null` or `undefined`) removed. + +#### arr.concat() _(es5-ext/array/#/concat)_ + +[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.concat). +ES6's version of `concat`. Supports `isConcatSpreadable` symbol, and returns array of same type as the context. + +#### arr.contains(searchElement[, position]) _(es5-ext/array/#/contains)_ + +Whether list contains the given value. + +#### arr.copyWithin(target, start[, end]) _(es5-ext/array/#/copy-within)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.copywithin). + +#### arr.diff(other) _(es5-ext/array/#/diff)_ + +Returns the array of elements that are present in context list but not present in other list. + +#### arr.eIndexOf(searchElement[, fromIndex]) _(es5-ext/array/#/e-index-of)_ + +_egal_ version of `indexOf` method. [_SameValueZero_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) logic is used for comparision + +#### arr.eLastIndexOf(searchElement[, fromIndex]) _(es5-ext/array/#/e-last-index-of)_ + +_egal_ version of `lastIndexOf` method. [_SameValueZero_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) logic is used for comparision + +#### arr.entries() _(es5-ext/array/#/entries)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.entries). +Returns iterator object, which traverses the array. Each value is represented with an array, where first value is an index and second is corresponding to index value. + +#### arr.exclusion([…lists]]) _(es5-ext/array/#/exclusion)_ + +Returns the array of elements that are found only in one of the lists (either context list or list provided in arguments). + +#### arr.fill(value[, start, end]) _(es5-ext/array/#/fill)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.fill). + +#### arr.filter(callback[, thisArg]) _(es5-ext/array/#/filter)_ + +[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.filter). +ES6's version of `filter`, returns array of same type as the context. + +#### arr.find(predicate[, thisArg]) _(es5-ext/array/#/find)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.find). +Return first element for which given function returns true + +#### arr.findIndex(predicate[, thisArg]) _(es5-ext/array/#/find-index)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.findindex). +Return first index for which given function returns true + +#### arr.first() _(es5-ext/array/#/first)_ + +Returns value for first defined index + +#### arr.firstIndex() _(es5-ext/array/#/first-index)_ + +Returns first declared index of the array + +#### arr.flatten() _(es5-ext/array/#/flatten)_ + +Returns flattened version of the array + +#### arr.forEachRight(cb[, thisArg]) _(es5-ext/array/#/for-each-right)_ + +`forEach` starting from last element + +#### arr.group(cb[, thisArg]) _(es5-ext/array/#/group)_ + +Group list elements by value returned by _cb_ function + +#### arr.indexesOf(searchElement[, fromIndex]) _(es5-ext/array/#/indexes-of)_ + +Returns array of all indexes of given value + +#### arr.intersection([…lists]) _(es5-ext/array/#/intersection)_ + +Computes the array of values that are the intersection of all lists (context list and lists given in arguments) + +#### arr.isCopy(other) _(es5-ext/array/#/is-copy)_ + +Returns true if both context and _other_ lists have same content + +#### arr.isUniq() _(es5-ext/array/#/is-uniq)_ + +Returns true if all values in array are unique + +#### arr.keys() _(es5-ext/array/#/keys)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.keys). +Returns iterator object, which traverses all array indexes. + +#### arr.last() _(es5-ext/array/#/last)_ + +Returns value of last defined index + +#### arr.lastIndex() _(es5-ext/array/#/last)_ + +Returns last defined index of the array + +#### arr.map(callback[, thisArg]) _(es5-ext/array/#/map)_ + +[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.map). +ES6's version of `map`, returns array of same type as the context. + +#### arr.remove(value[, …valuen]) _(es5-ext/array/#/remove)_ + +Remove values from the array + +#### arr.separate(sep) _(es5-ext/array/#/separate)_ + +Returns array with items separated with `sep` value + +#### arr.slice(callback[, thisArg]) _(es5-ext/array/#/slice)_ + +[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.slice). +ES6's version of `slice`, returns array of same type as the context. + +#### arr.someRight(cb[, thisArg]) _(es5-ext/array/#/someRight)_ + +`some` starting from last element + +#### arr.splice(callback[, thisArg]) _(es5-ext/array/#/splice)_ + +[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.splice). +ES6's version of `splice`, returns array of same type as the context. + +#### arr.uniq() _(es5-ext/array/#/uniq)_ + +Returns duplicate-free version of the array + +#### arr.values() _(es5-ext/array/#/values)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.values). +Returns iterator object which traverses all array values. + +#### arr[@@iterator] _(es5-ext/array/#/@@iterator)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype-@@iterator). +Returns iterator object which traverses all array values. + +### Boolean Constructor extensions + +#### isBoolean(x) _(es5-ext/boolean/is-boolean)_ + +Whether value is boolean + +### Date Constructor extensions + +#### isDate(x) _(es5-ext/date/is-date)_ + +Whether value is date instance + +#### validDate(x) _(es5-ext/date/valid-date)_ + +If given object is not date throw TypeError in other case return it. + +### Date Prototype extensions + +#### date.copy(date) _(es5-ext/date/#/copy)_ + +Returns a copy of the date object + +#### date.daysInMonth() _(es5-ext/date/#/days-in-month)_ + +Returns number of days of date's month + +#### date.floorDay() _(es5-ext/date/#/floor-day)_ + +Sets the date time to 00:00:00.000 + +#### date.floorMonth() _(es5-ext/date/#/floor-month)_ + +Sets date day to 1 and date time to 00:00:00.000 + +#### date.floorYear() _(es5-ext/date/#/floor-year)_ + +Sets date month to 0, day to 1 and date time to 00:00:00.000 + +#### date.format(pattern) _(es5-ext/date/#/format)_ + +Formats date up to given string. Supported patterns: + +* `%Y` - Year with century, 1999, 2003 +* `%y` - Year without century, 99, 03 +* `%m` - Month, 01..12 +* `%d` - Day of the month 01..31 +* `%H` - Hour (24-hour clock), 00..23 +* `%M` - Minute, 00..59 +* `%S` - Second, 00..59 +* `%L` - Milliseconds, 000..999 + +### Error Constructor extensions + +#### custom(message/*, code, ext*/) _(es5-ext/error/custom)_ + +Creates custom error object, optinally extended with `code` and other extension properties (provided with `ext` object) + +#### isError(x) _(es5-ext/error/is-error)_ + +Whether value is an error (instance of `Error`). + +#### validError(x) _(es5-ext/error/valid-error)_ + +If given object is not error throw TypeError in other case return it. + +### Error Prototype extensions + +#### err.throw() _(es5-ext/error/#/throw)_ + +Throws error + +### Function Constructor extensions + +Some of the functions were inspired by [Functional JavaScript](http://osteele.com/sources/javascript/functional/) project by Olivier Steele + +#### constant(x) _(es5-ext/function/constant)_ + +Returns a constant function that returns pregiven argument + +_k(x)(y) =def x_ + +#### identity(x) _(es5-ext/function/identity)_ + +Identity function. Returns first argument + +_i(x) =def x_ + +#### invoke(name[, …args]) _(es5-ext/function/invoke)_ + +Returns a function that takes an object as an argument, and applies object's +_name_ method to arguments. +_name_ can be name of the method or method itself. + +_invoke(name, …args)(object, …args2) =def object\[name\]\(…args, …args2\)_ + +#### isArguments(x) _(es5-ext/function/is-arguments)_ + +Whether value is arguments object + +#### isFunction(arg) _(es5-ext/function/is-function)_ + +Wether value is instance of function + +#### noop() _(es5-ext/function/noop)_ + +No operation function + +#### pluck(name) _(es5-ext/function/pluck)_ + +Returns a function that takes an object, and returns the value of its _name_ +property + +_pluck(name)(obj) =def obj[name]_ + +#### validFunction(arg) _(es5-ext/function/valid-function)_ + +If given object is not function throw TypeError in other case return it. + +### Function Prototype extensions + +Some of the methods were inspired by [Functional JavaScript](http://osteele.com/sources/javascript/functional/) project by Olivier Steele + +#### fn.compose([…fns]) _(es5-ext/function/#/compose)_ + +Applies the functions in reverse argument-list order. + +_f1.compose(f2, f3, f4)(…args) =def f1(f2(f3(f4(…arg))))_ + +#### fn.copy() _(es5-ext/function/#/copy)_ + +Produces copy of given function + +#### fn.curry([n]) _(es5-ext/function/#/curry)_ + +Invoking the function returned by this function only _n_ arguments are passed to the underlying function. If the underlying function is not saturated, the result is a function that passes all its arguments to the underlying function. +If _n_ is not provided then it defaults to context function length + +_f.curry(4)(arg1, arg2)(arg3)(arg4) =def f(arg1, args2, arg3, arg4)_ + +#### fn.lock([…args]) _(es5-ext/function/#/lock)_ + +Returns a function that applies the underlying function to _args_, and ignores its own arguments. + +_f.lock(…args)(…args2) =def f(…args)_ + +_Named after it's counterpart in Google Closure_ + +#### fn.not() _(es5-ext/function/#/not)_ + +Returns a function that returns boolean negation of value returned by underlying function. + +_f.not()(…args) =def !f(…args)_ + +#### fn.partial([…args]) _(es5-ext/function/#/partial)_ + +Returns a function that when called will behave like context function called with initially passed arguments. If more arguments are suplilied, they are appended to initial args. + +_f.partial(…args1)(…args2) =def f(…args1, …args2)_ + +#### fn.spread() _(es5-ext/function/#/spread)_ + +Returns a function that applies underlying function with first list argument + +_f.match()(args) =def f.apply(null, args)_ + +#### fn.toStringTokens() _(es5-ext/function/#/to-string-tokens)_ + +Serializes function into two (arguments and body) string tokens. Result is plain object with `args` and `body` properties. + +### Math extensions + +#### acosh(x) _(es5-ext/math/acosh)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.acosh). + +#### asinh(x) _(es5-ext/math/asinh)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.asinh). + +#### atanh(x) _(es5-ext/math/atanh)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.atanh). + +#### cbrt(x) _(es5-ext/math/cbrt)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.cbrt). + +#### clz32(x) _(es5-ext/math/clz32)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.clz32). + +#### cosh(x) _(es5-ext/math/cosh)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.cosh). + +#### expm1(x) _(es5-ext/math/expm1)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.expm1). + +#### fround(x) _(es5-ext/math/fround)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.fround). + +#### hypot([…values]) _(es5-ext/math/hypot)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.hypot). + +#### imul(x, y) _(es5-ext/math/imul)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.imul). + +#### log1p(x) _(es5-ext/math/log1p)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.log1p). + +#### log2(x) _(es5-ext/math/log2)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.log2). + +#### log10(x) _(es5-ext/math/log10)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.log10). + +#### sign(x) _(es5-ext/math/sign)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.sign). + +#### sinh(x) _(es5-ext/math/sinh)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.sinh). + +#### tanh(x) _(es5-ext/math/tanh)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.tanh). + +#### trunc(x) _(es5-ext/math/trunc)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.trunc). + +### Number Constructor extensions + +#### EPSILON _(es5-ext/number/epsilon)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.epsilon). + +The difference between 1 and the smallest value greater than 1 that is representable as a Number value, which is approximately 2.2204460492503130808472633361816 x 10-16. + +#### isFinite(x) _(es5-ext/number/is-finite)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isfinite). +Whether value is finite. Differs from global isNaN that it doesn't do type coercion. + +#### isInteger(x) _(es5-ext/number/is-integer)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isinteger). +Whether value is integer. + +#### isNaN(x) _(es5-ext/number/is-nan)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isnan). +Whether value is NaN. Differs from global isNaN that it doesn't do type coercion. + +#### isNumber(x) _(es5-ext/number/is-number)_ + +Whether given value is number + +#### isSafeInteger(x) _(es5-ext/number/is-safe-integer)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.issafeinteger). + +#### MAX_SAFE_INTEGER _(es5-ext/number/max-safe-integer)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.maxsafeinteger). +The value of Number.MAX_SAFE_INTEGER is 9007199254740991. + +#### MIN_SAFE_INTEGER _(es5-ext/number/min-safe-integer)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.minsafeinteger). +The value of Number.MIN_SAFE_INTEGER is -9007199254740991 (253-1). + +#### toInteger(x) _(es5-ext/number/to-integer)_ + +Converts value to integer + +#### toPosInteger(x) _(es5-ext/number/to-pos-integer)_ + +Converts value to positive integer. If provided value is less than 0, then 0 is returned + +#### toUint32(x) _(es5-ext/number/to-uint32)_ + +Converts value to unsigned 32 bit integer. This type is used for array lengths. +See: http://www.2ality.com/2012/02/js-integers.html + +### Number Prototype extensions + +#### num.pad(length[, precision]) _(es5-ext/number/#/pad)_ + +Pad given number with zeros. Returns string + +### Object Constructor extensions + +#### assign(target, source[, …sourcen]) _(es5-ext/object/assign)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign). +Extend _target_ by enumerable own properties of other objects. If properties are already set on target object, they will be overwritten. + +#### clear(obj) _(es5-ext/object/clear)_ + +Remove all enumerable own properties of the object + +#### compact(obj) _(es5-ext/object/compact)_ + +Returns copy of the object with all enumerable properties that have no falsy values + +#### compare(obj1, obj2) _(es5-ext/object/compare)_ + +Universal cross-type compare function. To be used for e.g. array sort. + +#### copy(obj) _(es5-ext/object/copy)_ + +Returns copy of the object with all enumerable properties. + +#### copyDeep(obj) _(es5-ext/object/copy-deep)_ + +Returns deep copy of the object with all enumerable properties. + +#### count(obj) _(es5-ext/object/count)_ + +Counts number of enumerable own properties on object + +#### create(obj[, properties]) _(es5-ext/object/create)_ + +`Object.create` alternative that provides workaround for [V8 issue](http://code.google.com/p/v8/issues/detail?id=2804). + +When `null` is provided as a prototype, it's substituted with specially prepared object that derives from Object.prototype but has all Object.prototype properties shadowed with undefined. + +It's quirky solution that allows us to have plain objects with no truthy properties but with turnable prototype. + +Use only for objects that you plan to switch prototypes of and be aware of limitations of this workaround. + +#### eq(x, y) _(es5-ext/object/eq)_ + +Whether two values are equal, using [_SameValueZero_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) algorithm. + +#### every(obj, cb[, thisArg[, compareFn]]) _(es5-ext/object/every)_ + +Analogous to Array.prototype.every. Returns true if every key-value pair in this object satisfies the provided testing function. +Optionally _compareFn_ can be provided which assures that keys are tested in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key). + +#### filter(obj, cb[, thisArg]) _(es5-ext/object/filter)_ + +Analogous to Array.prototype.filter. Returns new object with properites for which _cb_ function returned truthy value. + +#### firstKey(obj) _(es5-ext/object/first-key)_ + +Returns first enumerable key of the object, as keys are unordered by specification, it can be any key of an object. + +#### flatten(obj) _(es5-ext/object/flatten)_ + +Returns new object, with flatten properties of input object + +_flatten({ a: { b: 1 }, c: { d: 1 } }) =def { b: 1, d: 1 }_ + +#### forEach(obj, cb[, thisArg[, compareFn]]) _(es5-ext/object/for-each)_ + +Analogous to Array.prototype.forEach. Calls a function for each key-value pair found in object +Optionally _compareFn_ can be provided which assures that properties are iterated in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key). + +#### getPropertyNames() _(es5-ext/object/get-property-names)_ + +Get all (not just own) property names of the object + +#### is(x, y) _(es5-ext/object/is)_ + +Whether two values are equal, using [_SameValue_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) algorithm. + +#### isArrayLike(x) _(es5-ext/object/is-array-like)_ + +Whether object is array-like object + +#### isCopy(x, y) _(es5-ext/object/is-copy)_ + +Two values are considered a copy of same value when all of their own enumerable properties have same values. + +#### isCopyDeep(x, y) _(es5-ext/object/is-copy-deep)_ + +Deep comparision of objects + +#### isEmpty(obj) _(es5-ext/object/is-empty)_ + +True if object doesn't have any own enumerable property + +#### isObject(arg) _(es5-ext/object/is-object)_ + +Whether value is not primitive + +#### isPlainObject(arg) _(es5-ext/object/is-plain-object)_ + +Whether object is plain object, its protototype should be Object.prototype and it cannot be host object. + +#### keyOf(obj, searchValue) _(es5-ext/object/key-of)_ + +Search object for value + +#### keys(obj) _(es5-ext/object/keys)_ + +[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.keys). +ES6's version of `keys`, doesn't throw on primitive input + +#### map(obj, cb[, thisArg]) _(es5-ext/object/map)_ + +Analogous to Array.prototype.map. Creates a new object with properties which values are results of calling a provided function on every key-value pair in this object. + +#### mapKeys(obj, cb[, thisArg]) _(es5-ext/object/map-keys)_ + +Create new object with same values, but remapped keys + +#### mixin(target, source) _(es5-ext/object/mixin)_ + +Extend _target_ by all own properties of other objects. Properties found in both objects will be overwritten (unless they're not configurable and cannot be overwritten). +_It was for a moment part of ECMAScript 6 draft._ + +#### mixinPrototypes(target, …source]) _(es5-ext/object/mixin-prototypes)_ + +Extends _target_, with all source and source's prototype properties. +Useful as an alternative for `setPrototypeOf` in environments in which it cannot be shimmed (no `__proto__` support). + +#### normalizeOptions(options) _(es5-ext/object/normalize-options)_ + +Normalizes options object into flat plain object. + +Useful for functions in which we either need to keep options object for future reference or need to modify it for internal use. + +- It never returns input `options` object back (always a copy is created) +- `options` can be undefined in such case empty plain object is returned. +- Copies all enumerable properties found down prototype chain. + +#### primitiveSet([…names]) _(es5-ext/object/primitive-set)_ + +Creates `null` prototype based plain object, and sets on it all property names provided in arguments to true. + +#### safeTraverse(obj[, …names]) _(es5-ext/object/safe-traverse)_ + +Safe navigation of object properties. See http://wiki.ecmascript.org/doku.php?id=strawman:existential_operator + +#### serialize(value) _(es5-ext/object/serialize)_ + +Serialize value into string. Differs from [JSON.stringify](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) that it serializes also dates, functions and regular expresssions. + +#### setPrototypeOf(object, proto) _(es5-ext/object/set-prototype-of)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.setprototypeof). +If native version is not provided, it depends on existence of `__proto__` functionality, if it's missing, `null` instead of function is exposed. + +#### some(obj, cb[, thisArg[, compareFn]]) _(es5-ext/object/some)_ + +Analogous to Array.prototype.some Returns true if any key-value pair satisfies the provided +testing function. +Optionally _compareFn_ can be provided which assures that keys are tested in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key). + +#### toArray(obj[, cb[, thisArg[, compareFn]]]) _(es5-ext/object/to-array)_ + +Creates an array of results of calling a provided function on every key-value pair in this object. +Optionally _compareFn_ can be provided which assures that results are added in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key). + +#### unserialize(str) _(es5-ext/object/unserialize)_ + +Userializes value previously serialized with [serialize](#serializevalue-es5-extobjectserialize) + +#### validCallable(x) _(es5-ext/object/valid-callable)_ + +If given object is not callable throw TypeError in other case return it. + +#### validObject(x) _(es5-ext/object/valid-object)_ + +Throws error if given value is not an object, otherwise it is returned. + +#### validValue(x) _(es5-ext/object/valid-value)_ + +Throws error if given value is `null` or `undefined`, otherwise returns value. + +### RegExp Constructor extensions + +#### escape(str) _(es5-ext/reg-exp/escape)_ + +Escapes string to be used in regular expression + +#### isRegExp(x) _(es5-ext/reg-exp/is-reg-exp)_ + +Whether object is regular expression + +#### validRegExp(x) _(es5-ext/reg-exp/valid-reg-exp)_ + +If object is regular expression it is returned, otherwise TypeError is thrown. + +### RegExp Prototype extensions + +#### re.isSticky(x) _(es5-ext/reg-exp/#/is-sticky)_ + +Whether regular expression has `sticky` flag. + +It's to be used as counterpart to [regExp.sticky](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-get-regexp.prototype.sticky) if it's not implemented. + +#### re.isUnicode(x) _(es5-ext/reg-exp/#/is-unicode)_ + +Whether regular expression has `unicode` flag. + +It's to be used as counterpart to [regExp.unicode](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-get-regexp.prototype.unicode) if it's not implemented. + +#### re.match(string) _(es5-ext/reg-exp/#/match)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.match). + +#### re.replace(string, replaceValue) _(es5-ext/reg-exp/#/replace)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.replace). + +#### re.search(string) _(es5-ext/reg-exp/#/search)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.search). + +#### re.split(string) _(es5-ext/reg-exp/#/search)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.split). + +#### re.sticky _(es5-ext/reg-exp/#/sticky/implement)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.sticky). +It's a getter, so only `implement` and `is-implemented` modules are provided. + +#### re.unicode _(es5-ext/reg-exp/#/unicode/implement)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.unicode). +It's a getter, so only `implement` and `is-implemented` modules are provided. + +### String Constructor extensions + +#### formatMethod(fMap) _(es5-ext/string/format-method)_ + +Creates format method. It's used e.g. to create `Date.prototype.format` method + +#### fromCodePoint([…codePoints]) _(es5-ext/string/from-code-point)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.fromcodepoint) + +#### isString(x) _(es5-ext/string/is-string)_ + +Whether object is string + +#### randomUniq() _(es5-ext/string/random-uniq)_ + +Returns randomly generated id, with guarantee of local uniqueness (no same id will be returned twice) + +#### raw(callSite[, …substitutions]) _(es5-ext/string/raw)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.raw) + +### String Prototype extensions + +#### str.at(pos) _(es5-ext/string/#/at)_ + +_Proposed for ECMAScript 6/7 standard, but not (yet) in a draft_ + +Returns a string at given position in Unicode-safe manner. +Based on [implementation by Mathias Bynens](https://github.com/mathiasbynens/String.prototype.at). + +#### str.camelToHyphen() _(es5-ext/string/#/camel-to-hyphen)_ + +Convert camelCase string to hyphen separated, e.g. one-two-three -> oneTwoThree. +Useful when converting names from js property convention into filename convention. + +#### str.capitalize() _(es5-ext/string/#/capitalize)_ + +Capitalize first character of a string + +#### str.caseInsensitiveCompare(str) _(es5-ext/string/#/case-insensitive-compare)_ + +Case insensitive compare + +#### str.codePointAt(pos) _(es5-ext/string/#/code-point-at)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.codepointat) + +Based on [implementation by Mathias Bynens](https://github.com/mathiasbynens/String.prototype.codePointAt). + +#### str.contains(searchString[, position]) _(es5-ext/string/#/contains)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.contains) + +Whether string contains given string. + +#### str.endsWith(searchString[, endPosition]) _(es5-ext/string/#/ends-with)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.endswith). +Whether strings ends with given string + +#### str.hyphenToCamel() _(es5-ext/string/#/hyphen-to-camel)_ + +Convert hyphen separated string to camelCase, e.g. one-two-three -> oneTwoThree. +Useful when converting names from filename convention to js property name convention. + +#### str.indent(str[, count]) _(es5-ext/string/#/indent)_ + +Indents each line with provided _str_ (if _count_ given then _str_ is repeated _count_ times). + +#### str.last() _(es5-ext/string/#/last)_ + +Return last character + +#### str.normalize([form]) _(es5-ext/string/#/normalize)_ + +[_Introduced with ECMAScript 6_](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize). +Returns the Unicode Normalization Form of a given string. +Based on Matsuza's version. Code used for integrated shim can be found at [github.com/walling/unorm](https://github.com/walling/unorm/blob/master/lib/unorm.js) + +#### str.pad(fill[, length]) _(es5-ext/string/#/pad)_ + +Pad string with _fill_. +If _length_ si given than _fill_ is reapated _length_ times. +If _length_ is negative then pad is applied from right. + +#### str.repeat(n) _(es5-ext/string/#/repeat)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.repeat). +Repeat given string _n_ times + +#### str.plainReplace(search, replace) _(es5-ext/string/#/plain-replace)_ + +Simple `replace` version. Doesn't support regular expressions. Replaces just first occurrence of search string. Doesn't support insert patterns, therefore it is safe to replace text with text obtained programmatically (there's no need for additional _$_ characters escape in such case). + +#### str.plainReplaceAll(search, replace) _(es5-ext/string/#/plain-replace-all)_ + +Simple `replace` version. Doesn't support regular expressions. Replaces all occurrences of search string. Doesn't support insert patterns, therefore it is safe to replace text with text obtained programmatically (there's no need for additional _$_ characters escape in such case). + +#### str.startsWith(searchString[, position]) _(es5-ext/string/#/starts-with)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.startswith). +Whether strings starts with given string + +#### str[@@iterator] _(es5-ext/string/#/@@iterator)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype-@@iterator). +Returns iterator object which traverses all string characters (with respect to unicode symbols) + +### Tests [![Build Status](https://travis-ci.org/medikoo/es5-ext.png)](https://travis-ci.org/medikoo/es5-ext) + + $ npm test diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/@@iterator/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/@@iterator/implement.js new file mode 100644 index 00000000..0f714a1d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/@@iterator/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(Array.prototype, require('es6-symbol').iterator, { value: require('./shim'), + configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/@@iterator/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/@@iterator/index.js new file mode 100644 index 00000000..a6946265 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/@@iterator/index.js @@ -0,0 +1,4 @@ +'use strict'; + +module.exports = require('./is-implemented')() + ? Array.prototype[require('es6-symbol').iterator] : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/@@iterator/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/@@iterator/is-implemented.js new file mode 100644 index 00000000..72eb1f8a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/@@iterator/is-implemented.js @@ -0,0 +1,16 @@ +'use strict'; + +var iteratorSymbol = require('es6-symbol').iterator; + +module.exports = function () { + var arr = ['foo', 1], iterator, result; + if (typeof arr[iteratorSymbol] !== 'function') return false; + iterator = arr[iteratorSymbol](); + if (!iterator) return false; + if (typeof iterator.next !== 'function') return false; + result = iterator.next(); + if (!result) return false; + if (result.value !== 'foo') return false; + if (result.done !== false) return false; + return true; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/@@iterator/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/@@iterator/shim.js new file mode 100644 index 00000000..ff295df9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/@@iterator/shim.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('../values/shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/_compare-by-length.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/_compare-by-length.js new file mode 100644 index 00000000..d8343ce3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/_compare-by-length.js @@ -0,0 +1,9 @@ +// Used internally to sort array of lists by length + +'use strict'; + +var toPosInt = require('../../number/to-pos-integer'); + +module.exports = function (a, b) { + return toPosInt(a.length) - toPosInt(b.length); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/binary-search.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/binary-search.js new file mode 100644 index 00000000..8eb45675 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/binary-search.js @@ -0,0 +1,28 @@ +'use strict'; + +var toPosInt = require('../../number/to-pos-integer') + , callable = require('../../object/valid-callable') + , value = require('../../object/valid-value') + + , floor = Math.floor; + +module.exports = function (compareFn) { + var length, low, high, middle; + + value(this); + callable(compareFn); + + length = toPosInt(this.length); + low = 0; + high = length - 1; + + while (low <= high) { + middle = floor((low + high) / 2); + if (compareFn(this[middle]) < 0) high = middle - 1; + else low = middle + 1; + } + + if (high < 0) return 0; + if (high >= length) return length - 1; + return high; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/clear.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/clear.js new file mode 100644 index 00000000..3587bdf9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/clear.js @@ -0,0 +1,12 @@ +// Inspired by Google Closure: +// http://closure-library.googlecode.com/svn/docs/ +// closure_goog_array_array.js.html#goog.array.clear + +'use strict'; + +var value = require('../../object/valid-value'); + +module.exports = function () { + value(this).length = 0; + return this; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/compact.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/compact.js new file mode 100644 index 00000000..d529d5a2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/compact.js @@ -0,0 +1,9 @@ +// Inspired by: http://documentcloud.github.com/underscore/#compact + +'use strict'; + +var filter = Array.prototype.filter; + +module.exports = function () { + return filter.call(this, function (val) { return val != null; }); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/concat/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/concat/implement.js new file mode 100644 index 00000000..80c67cb4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/concat/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(Array.prototype, 'concat', { value: require('./shim'), + configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/concat/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/concat/index.js new file mode 100644 index 00000000..db205ea5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/concat/index.js @@ -0,0 +1,4 @@ +'use strict'; + +module.exports = require('./is-implemented')() ? + Array.prototype.concat : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/concat/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/concat/is-implemented.js new file mode 100644 index 00000000..cab8bc9e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/concat/is-implemented.js @@ -0,0 +1,7 @@ +'use strict'; + +var SubArray = require('../../_sub-array-dummy-safe'); + +module.exports = function () { + return (new SubArray()).concat('foo') instanceof SubArray; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/concat/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/concat/shim.js new file mode 100644 index 00000000..8b28e4ae --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/concat/shim.js @@ -0,0 +1,39 @@ +'use strict'; + +var isPlainArray = require('../../is-plain-array') + , toPosInt = require('../../../number/to-pos-integer') + , isObject = require('../../../object/is-object') + + , isArray = Array.isArray, concat = Array.prototype.concat + , forEach = Array.prototype.forEach + + , isSpreadable; + +isSpreadable = function (value) { + if (!value) return false; + if (!isObject(value)) return false; + if (value['@@isConcatSpreadable'] !== undefined) { + return Boolean(value['@@isConcatSpreadable']); + } + return isArray(value); +}; + +module.exports = function (item/*, …items*/) { + var result; + if (!this || !isArray(this) || isPlainArray(this)) { + return concat.apply(this, arguments); + } + result = new this.constructor(this.length); + forEach.call(this, function (val, i) { result[i] = val; }); + forEach.call(arguments, function (arg) { + var base; + if (isSpreadable(arg)) { + base = result.length; + result.length += toPosInt(arg.length); + forEach.call(arg, function (val, i) { result[base + i] = val; }); + return; + } + result.push(arg); + }); + return result; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/contains.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/contains.js new file mode 100644 index 00000000..4a2f9f67 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/contains.js @@ -0,0 +1,7 @@ +'use strict'; + +var indexOf = require('./e-index-of'); + +module.exports = function (searchElement/*, position*/) { + return indexOf.call(this, searchElement, arguments[1]) > -1; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/copy-within/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/copy-within/implement.js new file mode 100644 index 00000000..eedbad77 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/copy-within/implement.js @@ -0,0 +1,7 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(Array.prototype, 'copyWithin', + { value: require('./shim'), configurable: true, enumerable: false, + writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/copy-within/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/copy-within/index.js new file mode 100644 index 00000000..bb89d0b8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/copy-within/index.js @@ -0,0 +1,4 @@ +'use strict'; + +module.exports = require('./is-implemented')() ? + Array.prototype.copyWithin : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/copy-within/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/copy-within/is-implemented.js new file mode 100644 index 00000000..8f17e06d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/copy-within/is-implemented.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = function () { + var arr = [1, 2, 3, 4, 5]; + if (typeof arr.copyWithin !== 'function') return false; + return String(arr.copyWithin(1, 3)) === '1,4,5,4,5'; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/copy-within/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/copy-within/shim.js new file mode 100644 index 00000000..c0bfb8b0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/copy-within/shim.js @@ -0,0 +1,39 @@ +// Taken from: https://github.com/paulmillr/es6-shim/ + +'use strict'; + +var toInteger = require('../../../number/to-integer') + , toPosInt = require('../../../number/to-pos-integer') + , validValue = require('../../../object/valid-value') + + , hasOwnProperty = Object.prototype.hasOwnProperty + , max = Math.max, min = Math.min; + +module.exports = function (target, start/*, end*/) { + var o = validValue(this), end = arguments[2], l = toPosInt(o.length) + , to, from, fin, count, direction; + + target = toInteger(target); + start = toInteger(start); + end = (end === undefined) ? l : toInteger(end); + + to = target < 0 ? max(l + target, 0) : min(target, l); + from = start < 0 ? max(l + start, 0) : min(start, l); + fin = end < 0 ? max(l + end, 0) : min(end, l); + count = min(fin - from, l - to); + direction = 1; + + if ((from < to) && (to < (from + count))) { + direction = -1; + from += count - 1; + to += count - 1; + } + while (count > 0) { + if (hasOwnProperty.call(o, from)) o[to] = o[from]; + else delete o[from]; + from += direction; + to += direction; + count -= 1; + } + return o; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/diff.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/diff.js new file mode 100644 index 00000000..a1f95419 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/diff.js @@ -0,0 +1,13 @@ +'use strict'; + +var value = require('../../object/valid-value') + , contains = require('./contains') + + , filter = Array.prototype.filter; + +module.exports = function (other) { + (value(this) && value(other)); + return filter.call(this, function (item) { + return !contains.call(other, item); + }); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/e-index-of.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/e-index-of.js new file mode 100644 index 00000000..80864d06 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/e-index-of.js @@ -0,0 +1,29 @@ +'use strict'; + +var toPosInt = require('../../number/to-pos-integer') + , value = require('../../object/valid-value') + + , indexOf = Array.prototype.indexOf + , hasOwnProperty = Object.prototype.hasOwnProperty + , abs = Math.abs, floor = Math.floor; + +module.exports = function (searchElement/*, fromIndex*/) { + var i, l, fromIndex, val; + if (searchElement === searchElement) { //jslint: ignore + return indexOf.apply(this, arguments); + } + + l = toPosInt(value(this).length); + fromIndex = arguments[1]; + if (isNaN(fromIndex)) fromIndex = 0; + else if (fromIndex >= 0) fromIndex = floor(fromIndex); + else fromIndex = toPosInt(this.length) - floor(abs(fromIndex)); + + for (i = fromIndex; i < l; ++i) { + if (hasOwnProperty.call(this, i)) { + val = this[i]; + if (val !== val) return i; //jslint: ignore + } + } + return -1; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/e-last-index-of.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/e-last-index-of.js new file mode 100644 index 00000000..4fc536bd --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/e-last-index-of.js @@ -0,0 +1,29 @@ +'use strict'; + +var toPosInt = require('../../number/to-pos-integer') + , value = require('../../object/valid-value') + + , lastIndexOf = Array.prototype.lastIndexOf + , hasOwnProperty = Object.prototype.hasOwnProperty + , abs = Math.abs, floor = Math.floor; + +module.exports = function (searchElement/*, fromIndex*/) { + var i, fromIndex, val; + if (searchElement === searchElement) { //jslint: ignore + return lastIndexOf.apply(this, arguments); + } + + value(this); + fromIndex = arguments[1]; + if (isNaN(fromIndex)) fromIndex = (toPosInt(this.length) - 1); + else if (fromIndex >= 0) fromIndex = floor(fromIndex); + else fromIndex = toPosInt(this.length) - floor(abs(fromIndex)); + + for (i = fromIndex; i >= 0; --i) { + if (hasOwnProperty.call(this, i)) { + val = this[i]; + if (val !== val) return i; //jslint: ignore + } + } + return -1; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/entries/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/entries/implement.js new file mode 100644 index 00000000..490de60e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/entries/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(Array.prototype, 'entries', { value: require('./shim'), + configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/entries/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/entries/index.js new file mode 100644 index 00000000..292792cf --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/entries/index.js @@ -0,0 +1,4 @@ +'use strict'; + +module.exports = require('./is-implemented')() ? + Array.prototype.entries : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/entries/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/entries/is-implemented.js new file mode 100644 index 00000000..e186c172 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/entries/is-implemented.js @@ -0,0 +1,15 @@ +'use strict'; + +module.exports = function () { + var arr = [1, 'foo'], iterator, result; + if (typeof arr.entries !== 'function') return false; + iterator = arr.entries(); + if (!iterator) return false; + if (typeof iterator.next !== 'function') return false; + result = iterator.next(); + if (!result || !result.value) return false; + if (result.value[0] !== 0) return false; + if (result.value[1] !== 1) return false; + if (result.done !== false) return false; + return true; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/entries/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/entries/shim.js new file mode 100644 index 00000000..c052b53f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/entries/shim.js @@ -0,0 +1,4 @@ +'use strict'; + +var ArrayIterator = require('es6-iterator/array'); +module.exports = function () { return new ArrayIterator(this, 'key+value'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/exclusion.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/exclusion.js new file mode 100644 index 00000000..f08adc81 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/exclusion.js @@ -0,0 +1,27 @@ +'use strict'; + +var value = require('../../object/valid-value') + , aFrom = require('../from') + , toArray = require('../to-array') + , contains = require('./contains') + , byLength = require('./_compare-by-length') + + , filter = Array.prototype.filter, push = Array.prototype.push; + +module.exports = function (/*…lists*/) { + var lists, seen, result; + if (!arguments.length) return aFrom(this); + push.apply(lists = [this], arguments); + lists.forEach(value); + seen = []; + result = []; + lists.sort(byLength).forEach(function (list) { + result = result.filter(function (item) { + return !contains.call(list, item); + }).concat(filter.call(list, function (x) { + return !contains.call(seen, x); + })); + push.apply(seen, toArray(list)); + }); + return result; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/fill/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/fill/implement.js new file mode 100644 index 00000000..22511919 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/fill/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(Array.prototype, 'fill', { value: require('./shim'), + configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/fill/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/fill/index.js new file mode 100644 index 00000000..36c1f666 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/fill/index.js @@ -0,0 +1,4 @@ +'use strict'; + +module.exports = require('./is-implemented')() ? + Array.prototype.fill : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/fill/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/fill/is-implemented.js new file mode 100644 index 00000000..b8e54688 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/fill/is-implemented.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = function () { + var arr = [1, 2, 3, 4, 5, 6]; + if (typeof arr.fill !== 'function') return false; + return String(arr.fill(-1, -3)) === '1,2,3,-1,-1,-1'; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/fill/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/fill/shim.js new file mode 100644 index 00000000..45823be5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/fill/shim.js @@ -0,0 +1,21 @@ +// Taken from: https://github.com/paulmillr/es6-shim/ + +'use strict'; + +var toInteger = require('../../../number/to-integer') + , toPosInt = require('../../../number/to-pos-integer') + , validValue = require('../../../object/valid-value') + + , max = Math.max, min = Math.min; + +module.exports = function (value/*, start, end*/) { + var o = validValue(this), start = arguments[1], end = arguments[2] + , l = toPosInt(o.length), relativeStart, i; + + start = (start === undefined) ? 0 : toInteger(start); + end = (end === undefined) ? l : toInteger(end); + + relativeStart = start < 0 ? max(l + start, 0) : min(start, l); + for (i = relativeStart; i < l && i < end; ++i) o[i] = value; + return o; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/filter/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/filter/implement.js new file mode 100644 index 00000000..090c5f10 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/filter/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(Array.prototype, 'filter', { value: require('./shim'), + configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/filter/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/filter/index.js new file mode 100644 index 00000000..bcf0268d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/filter/index.js @@ -0,0 +1,4 @@ +'use strict'; + +module.exports = require('./is-implemented')() ? + Array.prototype.filter : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/filter/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/filter/is-implemented.js new file mode 100644 index 00000000..55772735 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/filter/is-implemented.js @@ -0,0 +1,9 @@ +'use strict'; + +var SubArray = require('../../_sub-array-dummy-safe') + + , pass = function () { return true; }; + +module.exports = function () { + return (new SubArray()).filter(pass) instanceof SubArray; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/filter/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/filter/shim.js new file mode 100644 index 00000000..b0116def --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/filter/shim.js @@ -0,0 +1,22 @@ +'use strict'; + +var isPlainArray = require('../../is-plain-array') + , callable = require('../../../object/valid-callable') + + , isArray = Array.isArray, filter = Array.prototype.filter + , forEach = Array.prototype.forEach, call = Function.prototype.call; + +module.exports = function (callbackFn/*, thisArg*/) { + var result, thisArg, i; + if (!this || !isArray(this) || isPlainArray(this)) { + return filter.apply(this, arguments); + } + callable(callbackFn); + thisArg = arguments[1]; + result = new this.constructor(); + i = 0; + forEach.call(this, function (val, j, self) { + if (call.call(callbackFn, thisArg, val, j, self)) result[i++] = val; + }); + return result; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/find-index/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/find-index/implement.js new file mode 100644 index 00000000..556cb846 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/find-index/implement.js @@ -0,0 +1,7 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(Array.prototype, 'findIndex', + { value: require('./shim'), + configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/find-index/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/find-index/index.js new file mode 100644 index 00000000..03a987e2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/find-index/index.js @@ -0,0 +1,4 @@ +'use strict'; + +module.exports = require('./is-implemented')() ? + Array.prototype.findIndex : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/find-index/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/find-index/is-implemented.js new file mode 100644 index 00000000..dbd3c814 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/find-index/is-implemented.js @@ -0,0 +1,9 @@ +'use strict'; + +var fn = function (x) { return x > 3; }; + +module.exports = function () { + var arr = [1, 2, 3, 4, 5, 6]; + if (typeof arr.findIndex !== 'function') return false; + return arr.findIndex(fn) === 3; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/find-index/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/find-index/shim.js new file mode 100644 index 00000000..957939f2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/find-index/shim.js @@ -0,0 +1,20 @@ +'use strict'; + +var callable = require('../../../object/valid-callable') + , value = require('../../../object/valid-value') + + , some = Array.prototype.some, apply = Function.prototype.apply; + +module.exports = function (predicate/*, thisArg*/) { + var k, self; + self = Object(value(this)); + callable(predicate); + + return some.call(self, function (value, index) { + if (apply.call(predicate, this, arguments)) { + k = index; + return true; + } + return false; + }, arguments[1]) ? k : -1; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/find/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/find/implement.js new file mode 100644 index 00000000..0f37104a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/find/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(Array.prototype, 'find', { value: require('./shim'), + configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/find/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/find/index.js new file mode 100644 index 00000000..96819d09 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/find/index.js @@ -0,0 +1,4 @@ +'use strict'; + +module.exports = require('./is-implemented')() ? + Array.prototype.find : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/find/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/find/is-implemented.js new file mode 100644 index 00000000..cc7ec774 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/find/is-implemented.js @@ -0,0 +1,9 @@ +'use strict'; + +var fn = function (x) { return x > 3; }; + +module.exports = function () { + var arr = [1, 2, 3, 4, 5, 6]; + if (typeof arr.find !== 'function') return false; + return arr.find(fn) === 4; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/find/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/find/shim.js new file mode 100644 index 00000000..c7ee9069 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/find/shim.js @@ -0,0 +1,8 @@ +'use strict'; + +var findIndex = require('../find-index/shim'); + +module.exports = function (predicate/*, thisArg*/) { + var index = findIndex.apply(this, arguments); + return (index === -1) ? undefined : this[index]; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/first-index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/first-index.js new file mode 100644 index 00000000..7a9e4c34 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/first-index.js @@ -0,0 +1,16 @@ +'use strict'; + +var toPosInt = require('../../number/to-pos-integer') + , value = require('../../object/valid-value') + + , hasOwnProperty = Object.prototype.hasOwnProperty; + +module.exports = function () { + var i, l; + if (!(l = toPosInt(value(this).length))) return null; + i = 0; + while (!hasOwnProperty.call(this, i)) { + if (++i === l) return null; + } + return i; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/first.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/first.js new file mode 100644 index 00000000..11df5717 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/first.js @@ -0,0 +1,9 @@ +'use strict'; + +var firstIndex = require('./first-index'); + +module.exports = function () { + var i; + if ((i = firstIndex.call(this)) !== null) return this[i]; + return undefined; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/flatten.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/flatten.js new file mode 100644 index 00000000..4bf267f2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/flatten.js @@ -0,0 +1,15 @@ +'use strict'; + +var isArray = Array.isArray, forEach = Array.prototype.forEach; + +module.exports = function flatten() { + var r = []; + forEach.call(this, function (x) { + if (isArray(x)) { + r = r.concat(flatten.call(x)); + } else { + r.push(x); + } + }); + return r; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/for-each-right.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/for-each-right.js new file mode 100644 index 00000000..1702bb16 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/for-each-right.js @@ -0,0 +1,20 @@ +'use strict'; + +var toPosInt = require('../../number/to-pos-integer') + , callable = require('../../object/valid-callable') + , value = require('../../object/valid-value') + + , hasOwnProperty = Object.prototype.hasOwnProperty + , call = Function.prototype.call; + +module.exports = function (cb/*, thisArg*/) { + var i, self, thisArg; + + self = Object(value(this)); + callable(cb); + thisArg = arguments[1]; + + for (i = (toPosInt(self.length) - 1); i >= 0; --i) { + if (hasOwnProperty.call(self, i)) call.call(cb, thisArg, self[i], i, self); + } +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/group.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/group.js new file mode 100644 index 00000000..fbb178c3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/group.js @@ -0,0 +1,23 @@ +// Inspired by Underscore's groupBy: +// http://documentcloud.github.com/underscore/#groupBy + +'use strict'; + +var callable = require('../../object/valid-callable') + , value = require('../../object/valid-value') + + , forEach = Array.prototype.forEach, apply = Function.prototype.apply; + +module.exports = function (cb/*, thisArg*/) { + var r; + + (value(this) && callable(cb)); + + r = {}; + forEach.call(this, function (v) { + var key = apply.call(cb, this, arguments); + if (!r.hasOwnProperty(key)) r[key] = []; + r[key].push(v); + }, arguments[1]); + return r; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/index.js new file mode 100644 index 00000000..97ef65cf --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/index.js @@ -0,0 +1,40 @@ +'use strict'; + +module.exports = { + '@@iterator': require('./@@iterator'), + binarySearch: require('./binary-search'), + clear: require('./clear'), + compact: require('./compact'), + concat: require('./concat'), + contains: require('./contains'), + copyWithin: require('./copy-within'), + diff: require('./diff'), + eIndexOf: require('./e-index-of'), + eLastIndexOf: require('./e-last-index-of'), + entries: require('./entries'), + exclusion: require('./exclusion'), + fill: require('./fill'), + filter: require('./filter'), + find: require('./find'), + findIndex: require('./find-index'), + first: require('./first'), + firstIndex: require('./first-index'), + flatten: require('./flatten'), + forEachRight: require('./for-each-right'), + keys: require('./keys'), + group: require('./group'), + indexesOf: require('./indexes-of'), + intersection: require('./intersection'), + isCopy: require('./is-copy'), + isUniq: require('./is-uniq'), + last: require('./last'), + lastIndex: require('./last-index'), + map: require('./map'), + remove: require('./remove'), + separate: require('./separate'), + slice: require('./slice'), + someRight: require('./some-right'), + splice: require('./splice'), + uniq: require('./uniq'), + values: require('./values') +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/indexes-of.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/indexes-of.js new file mode 100644 index 00000000..6b89157a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/indexes-of.js @@ -0,0 +1,12 @@ +'use strict'; + +var indexOf = require('./e-index-of'); + +module.exports = function (value/*, fromIndex*/) { + var r = [], i, fromIndex = arguments[1]; + while ((i = indexOf.call(this, value, fromIndex)) !== -1) { + r.push(i); + fromIndex = i + 1; + } + return r; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/intersection.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/intersection.js new file mode 100644 index 00000000..fadcb525 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/intersection.js @@ -0,0 +1,19 @@ +'use strict'; + +var value = require('../../object/valid-value') + , contains = require('./contains') + , byLength = require('./_compare-by-length') + + , filter = Array.prototype.filter, push = Array.prototype.push + , slice = Array.prototype.slice; + +module.exports = function (/*…list*/) { + var lists; + if (!arguments.length) slice.call(this); + push.apply(lists = [this], arguments); + lists.forEach(value); + lists.sort(byLength); + return lists.reduce(function (a, b) { + return filter.call(a, function (x) { return contains.call(b, x); }); + }); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/is-copy.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/is-copy.js new file mode 100644 index 00000000..ac7c79bc --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/is-copy.js @@ -0,0 +1,21 @@ +'use strict'; + +var toPosInt = require('../../number/to-pos-integer') + , eq = require('../../object/eq') + , value = require('../../object/valid-value') + + , hasOwnProperty = Object.prototype.hasOwnProperty; + +module.exports = function (other) { + var i, l; + (value(this) && value(other)); + l = toPosInt(this.length); + if (l !== toPosInt(other.length)) return false; + for (i = 0; i < l; ++i) { + if (hasOwnProperty.call(this, i) !== hasOwnProperty.call(other, i)) { + return false; + } + if (!eq(this[i], other[i])) return false; + } + return true; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/is-uniq.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/is-uniq.js new file mode 100644 index 00000000..b14f461d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/is-uniq.js @@ -0,0 +1,12 @@ +'use strict'; + +var indexOf = require('./e-index-of') + + , every = Array.prototype.every + , isFirst; + +isFirst = function (value, index) { + return indexOf.call(this, value) === index; +}; + +module.exports = function () { return every.call(this, isFirst, this); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/keys/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/keys/implement.js new file mode 100644 index 00000000..e18e6170 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/keys/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(Array.prototype, 'keys', { value: require('./shim'), + configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/keys/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/keys/index.js new file mode 100644 index 00000000..2f89cffe --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/keys/index.js @@ -0,0 +1,4 @@ +'use strict'; + +module.exports = require('./is-implemented')() ? + Array.prototype.keys : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/keys/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/keys/is-implemented.js new file mode 100644 index 00000000..06bd87bf --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/keys/is-implemented.js @@ -0,0 +1,14 @@ +'use strict'; + +module.exports = function () { + var arr = [1, 'foo'], iterator, result; + if (typeof arr.keys !== 'function') return false; + iterator = arr.keys(); + if (!iterator) return false; + if (typeof iterator.next !== 'function') return false; + result = iterator.next(); + if (!result) return false; + if (result.value !== 0) return false; + if (result.done !== false) return false; + return true; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/keys/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/keys/shim.js new file mode 100644 index 00000000..83773f6e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/keys/shim.js @@ -0,0 +1,4 @@ +'use strict'; + +var ArrayIterator = require('es6-iterator/array'); +module.exports = function () { return new ArrayIterator(this, 'key'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/last-index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/last-index.js new file mode 100644 index 00000000..a191d6e1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/last-index.js @@ -0,0 +1,16 @@ +'use strict'; + +var toPosInt = require('../../number/to-pos-integer') + , value = require('../../object/valid-value') + + , hasOwnProperty = Object.prototype.hasOwnProperty; + +module.exports = function () { + var i, l; + if (!(l = toPosInt(value(this).length))) return null; + i = l - 1; + while (!hasOwnProperty.call(this, i)) { + if (--i === -1) return null; + } + return i; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/last.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/last.js new file mode 100644 index 00000000..bf9d2f29 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/last.js @@ -0,0 +1,9 @@ +'use strict'; + +var lastIndex = require('./last-index'); + +module.exports = function () { + var i; + if ((i = lastIndex.call(this)) !== null) return this[i]; + return undefined; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/map/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/map/implement.js new file mode 100644 index 00000000..3aabb874 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/map/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(Array.prototype, 'map', { value: require('./shim'), + configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/map/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/map/index.js new file mode 100644 index 00000000..66f66607 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/map/index.js @@ -0,0 +1,4 @@ +'use strict'; + +module.exports = require('./is-implemented')() ? + Array.prototype.map : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/map/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/map/is-implemented.js new file mode 100644 index 00000000..c328b473 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/map/is-implemented.js @@ -0,0 +1,8 @@ +'use strict'; + +var identity = require('../../../function/identity') + , SubArray = require('../../_sub-array-dummy-safe'); + +module.exports = function () { + return (new SubArray()).map(identity) instanceof SubArray; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/map/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/map/shim.js new file mode 100644 index 00000000..2ee73134 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/map/shim.js @@ -0,0 +1,21 @@ +'use strict'; + +var isPlainArray = require('../../is-plain-array') + , callable = require('../../../object/valid-callable') + + , isArray = Array.isArray, map = Array.prototype.map + , forEach = Array.prototype.forEach, call = Function.prototype.call; + +module.exports = function (callbackFn/*, thisArg*/) { + var result, thisArg; + if (!this || !isArray(this) || isPlainArray(this)) { + return map.apply(this, arguments); + } + callable(callbackFn); + thisArg = arguments[1]; + result = new this.constructor(this.length); + forEach.call(this, function (val, i, self) { + result[i] = call.call(callbackFn, thisArg, val, i, self); + }); + return result; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/remove.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/remove.js new file mode 100644 index 00000000..dcf84331 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/remove.js @@ -0,0 +1,12 @@ +'use strict'; + +var indexOf = require('./e-index-of') + + , forEach = Array.prototype.forEach, splice = Array.prototype.splice; + +module.exports = function (item/*, …item*/) { + forEach.call(arguments, function (item) { + var index = indexOf.call(this, item); + if (index !== -1) splice.call(this, index, 1); + }, this); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/separate.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/separate.js new file mode 100644 index 00000000..dc974b83 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/separate.js @@ -0,0 +1,10 @@ +'use strict'; + +var forEach = Array.prototype.forEach; + +module.exports = function (sep) { + var result = []; + forEach.call(this, function (val, i) { result.push(val, sep); }); + result.pop(); + return result; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/slice/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/slice/implement.js new file mode 100644 index 00000000..cd488a06 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/slice/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(Array.prototype, 'slice', { value: require('./shim'), + configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/slice/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/slice/index.js new file mode 100644 index 00000000..72200ca9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/slice/index.js @@ -0,0 +1,4 @@ +'use strict'; + +module.exports = require('./is-implemented')() + ? Array.prototype.slice : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/slice/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/slice/is-implemented.js new file mode 100644 index 00000000..ec1985e7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/slice/is-implemented.js @@ -0,0 +1,7 @@ +'use strict'; + +var SubArray = require('../../_sub-array-dummy-safe'); + +module.exports = function () { + return (new SubArray()).slice() instanceof SubArray; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/slice/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/slice/shim.js new file mode 100644 index 00000000..2761a1aa --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/slice/shim.js @@ -0,0 +1,35 @@ +'use strict'; + +var toInteger = require('../../../number/to-integer') + , toPosInt = require('../../../number/to-pos-integer') + , isPlainArray = require('../../is-plain-array') + + , isArray = Array.isArray, slice = Array.prototype.slice + , hasOwnProperty = Object.prototype.hasOwnProperty, max = Math.max; + +module.exports = function (start, end) { + var length, result, i; + if (!this || !isArray(this) || isPlainArray(this)) { + return slice.apply(this, arguments); + } + length = toPosInt(this.length); + start = toInteger(start); + if (start < 0) start = max(length + start, 0); + else if (start > length) start = length; + if (end === undefined) { + end = length; + } else { + end = toInteger(end); + if (end < 0) end = max(length + end, 0); + else if (end > length) end = length; + } + if (start > end) start = end; + result = new this.constructor(end - start); + i = 0; + while (start !== end) { + if (hasOwnProperty.call(this, start)) result[i] = this[start]; + ++i; + ++start; + } + return result; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/some-right.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/some-right.js new file mode 100644 index 00000000..f54cf945 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/some-right.js @@ -0,0 +1,23 @@ +'use strict'; + +var toPosInt = require('../../number/to-pos-integer') + , callable = require('../../object/valid-callable') + , value = require('../../object/valid-value') + + , hasOwnProperty = Object.prototype.hasOwnProperty + , call = Function.prototype.call; + +module.exports = function (cb/*, thisArg*/) { + var i, self, thisArg; + self = Object(value(this)); + callable(cb); + thisArg = arguments[1]; + + for (i = (toPosInt(self.length) - 1); i >= 0; --i) { + if (hasOwnProperty.call(self, i) && + call.call(cb, thisArg, self[i], i, self)) { + return true; + } + } + return false; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/splice/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/splice/implement.js new file mode 100644 index 00000000..aab1f8ef --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/splice/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(Array.prototype, 'splice', { value: require('./shim'), + configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/splice/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/splice/index.js new file mode 100644 index 00000000..e8ecf3cf --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/splice/index.js @@ -0,0 +1,4 @@ +'use strict'; + +module.exports = require('./is-implemented')() + ? Array.prototype.splice : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/splice/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/splice/is-implemented.js new file mode 100644 index 00000000..ffddaa81 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/splice/is-implemented.js @@ -0,0 +1,7 @@ +'use strict'; + +var SubArray = require('../../_sub-array-dummy-safe'); + +module.exports = function () { + return (new SubArray()).splice(0) instanceof SubArray; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/splice/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/splice/shim.js new file mode 100644 index 00000000..a8505a2c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/splice/shim.js @@ -0,0 +1,14 @@ +'use strict'; + +var isPlainArray = require('../../is-plain-array') + + , isArray = Array.isArray, splice = Array.prototype.splice + , forEach = Array.prototype.forEach; + +module.exports = function (start, deleteCount/*, …items*/) { + var arr = splice.apply(this, arguments), result; + if (!this || !isArray(this) || isPlainArray(this)) return arr; + result = new this.constructor(arr.length); + forEach.call(arr, function (val, i) { result[i] = val; }); + return result; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/uniq.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/uniq.js new file mode 100644 index 00000000..db014655 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/uniq.js @@ -0,0 +1,13 @@ +'use strict'; + +var indexOf = require('./e-index-of') + + , filter = Array.prototype.filter + + , isFirst; + +isFirst = function (value, index) { + return indexOf.call(this, value) === index; +}; + +module.exports = function () { return filter.call(this, isFirst, this); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/values/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/values/implement.js new file mode 100644 index 00000000..237281fd --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/values/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(Array.prototype, 'values', { value: require('./shim'), + configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/values/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/values/index.js new file mode 100644 index 00000000..c0832c30 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/values/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./is-implemented')() ? Array.prototype.values : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/values/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/values/is-implemented.js new file mode 100644 index 00000000..cc0c6294 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/values/is-implemented.js @@ -0,0 +1,14 @@ +'use strict'; + +module.exports = function () { + var arr = ['foo', 1], iterator, result; + if (typeof arr.values !== 'function') return false; + iterator = arr.values(); + if (!iterator) return false; + if (typeof iterator.next !== 'function') return false; + result = iterator.next(); + if (!result) return false; + if (result.value !== 'foo') return false; + if (result.done !== false) return false; + return true; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/values/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/values/shim.js new file mode 100644 index 00000000..f6555fd8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/values/shim.js @@ -0,0 +1,4 @@ +'use strict'; + +var ArrayIterator = require('es6-iterator/array'); +module.exports = function () { return new ArrayIterator(this, 'value'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/_is-extensible.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/_is-extensible.js new file mode 100644 index 00000000..61232064 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/_is-extensible.js @@ -0,0 +1,13 @@ +'use strict'; + +module.exports = (function () { + var SubArray = require('./_sub-array-dummy'), arr; + + if (!SubArray) return false; + arr = new SubArray(); + if (!Array.isArray(arr)) return false; + if (!(arr instanceof SubArray)) return false; + + arr[34] = 'foo'; + return (arr.length === 35); +}()); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/_sub-array-dummy-safe.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/_sub-array-dummy-safe.js new file mode 100644 index 00000000..5baf8a8d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/_sub-array-dummy-safe.js @@ -0,0 +1,23 @@ +'use strict'; + +var setPrototypeOf = require('../object/set-prototype-of') + , isExtensible = require('./_is-extensible'); + +module.exports = (function () { + var SubArray; + + if (isExtensible) return require('./_sub-array-dummy'); + + if (!setPrototypeOf) return null; + SubArray = function () { + var arr = Array.apply(this, arguments); + setPrototypeOf(arr, SubArray.prototype); + return arr; + }; + setPrototypeOf(SubArray, Array); + SubArray.prototype = Object.create(Array.prototype, { + constructor: { value: SubArray, enumerable: false, writable: true, + configurable: true } + }); + return SubArray; +}()); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/_sub-array-dummy.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/_sub-array-dummy.js new file mode 100644 index 00000000..a926d1a3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/_sub-array-dummy.js @@ -0,0 +1,16 @@ +'use strict'; + +var setPrototypeOf = require('../object/set-prototype-of'); + +module.exports = (function () { + var SubArray; + + if (!setPrototypeOf) return null; + SubArray = function () { Array.apply(this, arguments); }; + setPrototypeOf(SubArray, Array); + SubArray.prototype = Object.create(Array.prototype, { + constructor: { value: SubArray, enumerable: false, writable: true, + configurable: true } + }); + return SubArray; +}()); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/from/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/from/implement.js new file mode 100644 index 00000000..f3411b13 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/from/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(Array, 'from', { value: require('./shim'), + configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/from/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/from/index.js new file mode 100644 index 00000000..3b99cda8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/from/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = require('./is-implemented')() + ? Array.from + : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/from/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/from/is-implemented.js new file mode 100644 index 00000000..63ff2a57 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/from/is-implemented.js @@ -0,0 +1,9 @@ +'use strict'; + +module.exports = function () { + var from = Array.from, arr, result; + if (typeof from !== 'function') return false; + arr = ['raz', 'dwa']; + result = from(arr); + return Boolean(result && (result !== arr) && (result[1] === 'dwa')); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/from/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/from/shim.js new file mode 100644 index 00000000..a90ba2f9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/from/shim.js @@ -0,0 +1,106 @@ +'use strict'; + +var iteratorSymbol = require('es6-symbol').iterator + , isArguments = require('../../function/is-arguments') + , isFunction = require('../../function/is-function') + , toPosInt = require('../../number/to-pos-integer') + , callable = require('../../object/valid-callable') + , validValue = require('../../object/valid-value') + , isString = require('../../string/is-string') + + , isArray = Array.isArray, call = Function.prototype.call + , desc = { configurable: true, enumerable: true, writable: true, value: null } + , defineProperty = Object.defineProperty; + +module.exports = function (arrayLike/*, mapFn, thisArg*/) { + var mapFn = arguments[1], thisArg = arguments[2], Constructor, i, j, arr, l, code, iterator + , result, getIterator, value; + + arrayLike = Object(validValue(arrayLike)); + + if (mapFn != null) callable(mapFn); + if (!this || (this === Array) || !isFunction(this)) { + // Result: Plain array + if (!mapFn) { + if (isArguments(arrayLike)) { + // Source: Arguments + l = arrayLike.length; + if (l !== 1) return Array.apply(null, arrayLike); + arr = new Array(1); + arr[0] = arrayLike[0]; + return arr; + } + if (isArray(arrayLike)) { + // Source: Array + arr = new Array(l = arrayLike.length); + for (i = 0; i < l; ++i) arr[i] = arrayLike[i]; + return arr; + } + } + arr = []; + } else { + // Result: Non plain array + Constructor = this; + } + + if (!isArray(arrayLike)) { + if ((getIterator = arrayLike[iteratorSymbol]) !== undefined) { + // Source: Iterator + iterator = callable(getIterator).call(arrayLike); + if (Constructor) arr = new Constructor(); + result = iterator.next(); + i = 0; + while (!result.done) { + value = mapFn ? call.call(mapFn, thisArg, result.value, i) : result.value; + if (!Constructor) { + arr[i] = value; + } else { + desc.value = value; + defineProperty(arr, i, desc); + } + result = iterator.next(); + ++i; + } + l = i; + } else if (isString(arrayLike)) { + // Source: String + l = arrayLike.length; + if (Constructor) arr = new Constructor(); + for (i = 0, j = 0; i < l; ++i) { + value = arrayLike[i]; + if ((i + 1) < l) { + code = value.charCodeAt(0); + if ((code >= 0xD800) && (code <= 0xDBFF)) value += arrayLike[++i]; + } + value = mapFn ? call.call(mapFn, thisArg, value, j) : value; + if (!Constructor) { + arr[j] = value; + } else { + desc.value = value; + defineProperty(arr, j, desc); + } + ++j; + } + l = j; + } + } + if (l === undefined) { + // Source: array or array-like + l = toPosInt(arrayLike.length); + if (Constructor) arr = new Constructor(l); + for (i = 0; i < l; ++i) { + value = mapFn ? call.call(mapFn, thisArg, arrayLike[i], i) : arrayLike[i]; + if (!Constructor) { + arr[i] = value; + } else { + desc.value = value; + defineProperty(arr, i, desc); + } + } + } + if (Constructor) { + desc.value = null; + arr.length = l; + } + return arr; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/generate.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/generate.js new file mode 100644 index 00000000..5e066750 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/generate.js @@ -0,0 +1,20 @@ +'use strict'; + +var toPosInt = require('../number/to-pos-integer') + , value = require('../object/valid-value') + + , slice = Array.prototype.slice; + +module.exports = function (length/*, …fill*/) { + var arr, l; + length = toPosInt(value(length)); + if (length === 0) return []; + + arr = (arguments.length < 2) ? [undefined] : + slice.call(arguments, 1, 1 + length); + + while ((l = arr.length) < length) { + arr = arr.concat(arr.slice(0, length - l)); + } + return arr; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/index.js new file mode 100644 index 00000000..7a686789 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/index.js @@ -0,0 +1,11 @@ +'use strict'; + +module.exports = { + '#': require('./#'), + from: require('./from'), + generate: require('./generate'), + isPlainArray: require('./is-plain-array'), + of: require('./of'), + toArray: require('./to-array'), + validArray: require('./valid-array') +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/is-plain-array.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/is-plain-array.js new file mode 100644 index 00000000..6b37e406 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/is-plain-array.js @@ -0,0 +1,11 @@ +'use strict'; + +var isArray = Array.isArray, getPrototypeOf = Object.getPrototypeOf; + +module.exports = function (obj) { + var proto; + if (!obj || !isArray(obj)) return false; + proto = getPrototypeOf(obj); + if (!isArray(proto)) return false; + return !isArray(getPrototypeOf(proto)); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/of/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/of/implement.js new file mode 100644 index 00000000..bf2a5a54 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/of/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(Array, 'of', { value: require('./shim'), + configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/of/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/of/index.js new file mode 100644 index 00000000..07ee54db --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/of/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = require('./is-implemented')() + ? Array.of + : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/of/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/of/is-implemented.js new file mode 100644 index 00000000..4390a108 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/of/is-implemented.js @@ -0,0 +1,8 @@ +'use strict'; + +module.exports = function () { + var of = Array.of, result; + if (typeof of !== 'function') return false; + result = of('foo', 'bar'); + return Boolean(result && (result[1] === 'bar')); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/of/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/of/shim.js new file mode 100644 index 00000000..de72bc92 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/of/shim.js @@ -0,0 +1,19 @@ +'use strict'; + +var isFunction = require('../../function/is-function') + + , slice = Array.prototype.slice, defineProperty = Object.defineProperty + , desc = { configurable: true, enumerable: true, writable: true, value: null }; + +module.exports = function (/*…items*/) { + var result, i, l; + if (!this || (this === Array) || !isFunction(this)) return slice.call(arguments); + result = new this(l = arguments.length); + for (i = 0; i < l; ++i) { + desc.value = arguments[i]; + defineProperty(result, i, desc); + } + desc.value = null; + result.length = l; + return result; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/to-array.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/to-array.js new file mode 100644 index 00000000..ce908dd9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/to-array.js @@ -0,0 +1,9 @@ +'use strict'; + +var from = require('./from') + + , isArray = Array.isArray; + +module.exports = function (arrayLike) { + return isArray(arrayLike) ? arrayLike : from(arrayLike); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/valid-array.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/valid-array.js new file mode 100644 index 00000000..d86a8f5f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/valid-array.js @@ -0,0 +1,8 @@ +'use strict'; + +var isArray = Array.isArray; + +module.exports = function (value) { + if (isArray(value)) return value; + throw new TypeError(value + " is not an array"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/boolean/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/boolean/index.js new file mode 100644 index 00000000..c193b948 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/boolean/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = { + isBoolean: require('./is-boolean') +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/boolean/is-boolean.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/boolean/is-boolean.js new file mode 100644 index 00000000..5d1a802e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/boolean/is-boolean.js @@ -0,0 +1,10 @@ +'use strict'; + +var toString = Object.prototype.toString + + , id = toString.call(true); + +module.exports = function (x) { + return (typeof x === 'boolean') || ((typeof x === 'object') && + ((x instanceof Boolean) || (toString.call(x) === id))); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/#/copy.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/#/copy.js new file mode 100644 index 00000000..69e2eb09 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/#/copy.js @@ -0,0 +1,5 @@ +'use strict'; + +var getTime = Date.prototype.getTime; + +module.exports = function () { return new Date(getTime.call(this)); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/#/days-in-month.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/#/days-in-month.js new file mode 100644 index 00000000..e780efe3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/#/days-in-month.js @@ -0,0 +1,17 @@ +'use strict'; + +var getMonth = Date.prototype.getMonth; + +module.exports = function () { + switch (getMonth.call(this)) { + case 1: + return this.getFullYear() % 4 ? 28 : 29; + case 3: + case 5: + case 8: + case 10: + return 30; + default: + return 31; + } +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/#/floor-day.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/#/floor-day.js new file mode 100644 index 00000000..0c9eb8b6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/#/floor-day.js @@ -0,0 +1,8 @@ +'use strict'; + +var setHours = Date.prototype.setHours; + +module.exports = function () { + setHours.call(this, 0, 0, 0, 0); + return this; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/#/floor-month.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/#/floor-month.js new file mode 100644 index 00000000..7328c250 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/#/floor-month.js @@ -0,0 +1,8 @@ +'use strict'; + +var floorDay = require('./floor-day'); + +module.exports = function () { + floorDay.call(this).setDate(1); + return this; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/#/floor-year.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/#/floor-year.js new file mode 100644 index 00000000..9c508538 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/#/floor-year.js @@ -0,0 +1,8 @@ +'use strict'; + +var floorMonth = require('./floor-month'); + +module.exports = function () { + floorMonth.call(this).setMonth(0); + return this; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/#/format.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/#/format.js new file mode 100644 index 00000000..15bd95f7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/#/format.js @@ -0,0 +1,21 @@ +'use strict'; + +var pad = require('../../number/#/pad') + , date = require('../valid-date') + + , format; + +format = require('../../string/format-method')({ + Y: function () { return String(this.getFullYear()); }, + y: function () { return String(this.getFullYear()).slice(-2); }, + m: function () { return pad.call(this.getMonth() + 1, 2); }, + d: function () { return pad.call(this.getDate(), 2); }, + H: function () { return pad.call(this.getHours(), 2); }, + M: function () { return pad.call(this.getMinutes(), 2); }, + S: function () { return pad.call(this.getSeconds(), 2); }, + L: function () { return pad.call(this.getMilliseconds(), 3); } +}); + +module.exports = function (pattern) { + return format.call(date(this), pattern); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/#/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/#/index.js new file mode 100644 index 00000000..f71b2950 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/#/index.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = { + copy: require('./copy'), + daysInMonth: require('./days-in-month'), + floorDay: require('./floor-day'), + floorMonth: require('./floor-month'), + floorYear: require('./floor-year'), + format: require('./format') +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/index.js new file mode 100644 index 00000000..eac33fbe --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/index.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = { + '#': require('./#'), + isDate: require('./is-date'), + validDate: require('./valid-date') +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/is-date.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/is-date.js new file mode 100644 index 00000000..6ba236ec --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/is-date.js @@ -0,0 +1,9 @@ +'use strict'; + +var toString = Object.prototype.toString + + , id = toString.call(new Date()); + +module.exports = function (x) { + return (x && ((x instanceof Date) || (toString.call(x) === id))) || false; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/valid-date.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/valid-date.js new file mode 100644 index 00000000..d0f1b6ce --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/valid-date.js @@ -0,0 +1,8 @@ +'use strict'; + +var isDate = require('./is-date'); + +module.exports = function (x) { + if (!isDate(x) || isNaN(x)) throw new TypeError(x + " is not valid Date object"); + return x; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/error/#/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/error/#/index.js new file mode 100644 index 00000000..b984aa91 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/error/#/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = { + throw: require('./throw') +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/error/#/throw.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/error/#/throw.js new file mode 100644 index 00000000..7e15ebd1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/error/#/throw.js @@ -0,0 +1,5 @@ +'use strict'; + +var error = require('../valid-error'); + +module.exports = function () { throw error(this); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/error/custom.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/error/custom.js new file mode 100644 index 00000000..bbc2dc20 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/error/custom.js @@ -0,0 +1,20 @@ +'use strict'; + +var assign = require('../object/assign') + + , captureStackTrace = Error.captureStackTrace; + +exports = module.exports = function (message/*, code, ext*/) { + var err = new Error(), code = arguments[1], ext = arguments[2]; + if (ext == null) { + if (code && (typeof code === 'object')) { + ext = code; + code = null; + } + } + if (ext != null) assign(err, ext); + err.message = String(message); + if (code != null) err.code = String(code); + if (captureStackTrace) captureStackTrace(err, exports); + return err; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/error/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/error/index.js new file mode 100644 index 00000000..62984b52 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/error/index.js @@ -0,0 +1,8 @@ +'use strict'; + +module.exports = { + '#': require('./#'), + custom: require('./custom'), + isError: require('./is-error'), + validError: require('./valid-error') +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/error/is-error.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/error/is-error.js new file mode 100644 index 00000000..422705fa --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/error/is-error.js @@ -0,0 +1,9 @@ +'use strict'; + +var toString = Object.prototype.toString + + , id = toString.call(new Error()); + +module.exports = function (x) { + return (x && ((x instanceof Error) || (toString.call(x)) === id)) || false; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/error/valid-error.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/error/valid-error.js new file mode 100644 index 00000000..0bef768a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/error/valid-error.js @@ -0,0 +1,8 @@ +'use strict'; + +var isError = require('./is-error'); + +module.exports = function (x) { + if (!isError(x)) throw new TypeError(x + " is not an Error object"); + return x; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/compose.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/compose.js new file mode 100644 index 00000000..1da5e011 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/compose.js @@ -0,0 +1,20 @@ +'use strict'; + +var callable = require('../../object/valid-callable') + , aFrom = require('../../array/from') + + , apply = Function.prototype.apply, call = Function.prototype.call + , callFn = function (arg, fn) { return call.call(fn, this, arg); }; + +module.exports = function (fn/*, …fnn*/) { + var fns, first; + if (!fn) callable(fn); + fns = [this].concat(aFrom(arguments)); + fns.forEach(callable); + fns = fns.reverse(); + first = fns[0]; + fns = fns.slice(1); + return function (arg) { + return fns.reduce(callFn, apply.call(first, this, arguments)); + }; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/copy.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/copy.js new file mode 100644 index 00000000..e1467f76 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/copy.js @@ -0,0 +1,15 @@ +'use strict'; + +var mixin = require('../../object/mixin') + , validFunction = require('../valid-function') + + , re = /^\s*function\s*([\0-'\)-\uffff]+)*\s*\(([\0-\(\*-\uffff]*)\)\s*\{/; + +module.exports = function () { + var match = String(validFunction(this)).match(re), fn; + + fn = new Function('fn', 'return function ' + match[1].trim() + '(' + + match[2] + ') { return fn.apply(this, arguments); };')(this); + try { mixin(fn, this); } catch (ignore) {} + return fn; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/curry.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/curry.js new file mode 100644 index 00000000..943d6faf --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/curry.js @@ -0,0 +1,24 @@ +'use strict'; + +var toPosInt = require('../../number/to-pos-integer') + , callable = require('../../object/valid-callable') + , defineLength = require('../_define-length') + + , slice = Array.prototype.slice, apply = Function.prototype.apply + , curry; + +curry = function self(fn, length, preArgs) { + return defineLength(function () { + var args = preArgs ? + preArgs.concat(slice.call(arguments, 0, length - preArgs.length)) : + slice.call(arguments, 0, length); + return (args.length === length) ? apply.call(fn, this, args) : + self(fn, length, args); + }, preArgs ? (length - preArgs.length) : length); +}; + +module.exports = function (/*length*/) { + var length = arguments[0]; + return curry(callable(this), + isNaN(length) ? toPosInt(this.length) : toPosInt(length)); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/index.js new file mode 100644 index 00000000..8d0da007 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/index.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports = { + compose: require('./compose'), + copy: require('./copy'), + curry: require('./curry'), + lock: require('./lock'), + not: require('./not'), + partial: require('./partial'), + spread: require('./spread'), + toStringTokens: require('./to-string-tokens') +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/lock.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/lock.js new file mode 100644 index 00000000..91e1a65c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/lock.js @@ -0,0 +1,12 @@ +'use strict'; + +var callable = require('../../object/valid-callable') + + , apply = Function.prototype.apply; + +module.exports = function (/*…args*/) { + var fn = callable(this) + , args = arguments; + + return function () { return apply.call(fn, this, args); }; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/not.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/not.js new file mode 100644 index 00000000..c6dbe97f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/not.js @@ -0,0 +1,14 @@ +'use strict'; + +var callable = require('../../object/valid-callable') + , defineLength = require('../_define-length') + + , apply = Function.prototype.apply; + +module.exports = function () { + var fn = callable(this); + + return defineLength(function () { + return !apply.call(fn, this, arguments); + }, fn.length); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/partial.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/partial.js new file mode 100644 index 00000000..bf31a357 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/partial.js @@ -0,0 +1,16 @@ +'use strict'; + +var callable = require('../../object/valid-callable') + , aFrom = require('../../array/from') + , defineLength = require('../_define-length') + + , apply = Function.prototype.apply; + +module.exports = function (/*…args*/) { + var fn = callable(this) + , args = aFrom(arguments); + + return defineLength(function () { + return apply.call(fn, this, args.concat(aFrom(arguments))); + }, fn.length - args.length); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/spread.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/spread.js new file mode 100644 index 00000000..d7c93b7e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/spread.js @@ -0,0 +1,10 @@ +'use strict'; + +var callable = require('../../object/valid-callable') + + , apply = Function.prototype.apply; + +module.exports = function () { + var fn = callable(this); + return function (args) { return apply.call(fn, this, args); }; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/to-string-tokens.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/to-string-tokens.js new file mode 100644 index 00000000..67afeae8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/to-string-tokens.js @@ -0,0 +1,11 @@ +'use strict'; + +var validFunction = require('../valid-function') + + , re = new RegExp('^\\s*function[\\0-\'\\)-\\uffff]*' + + '\\(([\\0-\\(\\*-\\uffff]*)\\)\\s*\\{([\\0-\\uffff]*)\\}\\s*$'); + +module.exports = function () { + var data = String(validFunction(this)).match(re); + return { args: data[1], body: data[2] }; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/_define-length.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/_define-length.js new file mode 100644 index 00000000..496ea62c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/_define-length.js @@ -0,0 +1,44 @@ +'use strict'; + +var toPosInt = require('../number/to-pos-integer') + + , test = function (a, b) {}, desc, defineProperty + , generate, mixin; + +try { + Object.defineProperty(test, 'length', { configurable: true, writable: false, + enumerable: false, value: 1 }); +} catch (ignore) {} + +if (test.length === 1) { + // ES6 + desc = { configurable: true, writable: false, enumerable: false }; + defineProperty = Object.defineProperty; + module.exports = function (fn, length) { + length = toPosInt(length); + if (fn.length === length) return fn; + desc.value = length; + return defineProperty(fn, 'length', desc); + }; +} else { + mixin = require('../object/mixin'); + generate = (function () { + var cache = []; + return function (l) { + var args, i = 0; + if (cache[l]) return cache[l]; + args = []; + while (l--) args.push('a' + (++i).toString(36)); + return new Function('fn', 'return function (' + args.join(', ') + + ') { return fn.apply(this, arguments); };'); + }; + }()); + module.exports = function (src, length) { + var target; + length = toPosInt(length); + if (src.length === length) return src; + target = generate(length)(src); + try { mixin(target, src); } catch (ignore) {} + return target; + }; +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/constant.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/constant.js new file mode 100644 index 00000000..10f1e203 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/constant.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function (x) { + return function () { return x; }; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/identity.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/identity.js new file mode 100644 index 00000000..a9289f0b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/identity.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (x) { return x; }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/index.js new file mode 100644 index 00000000..cfad3f3e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/index.js @@ -0,0 +1,15 @@ +// Export all modules. + +'use strict'; + +module.exports = { + '#': require('./#'), + constant: require('./constant'), + identity: require('./identity'), + invoke: require('./invoke'), + isArguments: require('./is-arguments'), + isFunction: require('./is-function'), + noop: require('./noop'), + pluck: require('./pluck'), + validFunction: require('./valid-function') +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/invoke.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/invoke.js new file mode 100644 index 00000000..9195afdd --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/invoke.js @@ -0,0 +1,15 @@ +'use strict'; + +var isCallable = require('../object/is-callable') + , value = require('../object/valid-value') + + , slice = Array.prototype.slice, apply = Function.prototype.apply; + +module.exports = function (name/*, …args*/) { + var args = slice.call(arguments, 1), isFn = isCallable(name); + return function (obj) { + value(obj); + return apply.call(isFn ? name : obj[name], obj, + args.concat(slice.call(arguments, 1))); + }; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/is-arguments.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/is-arguments.js new file mode 100644 index 00000000..9a29855f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/is-arguments.js @@ -0,0 +1,7 @@ +'use strict'; + +var toString = Object.prototype.toString + + , id = toString.call((function () { return arguments; }())); + +module.exports = function (x) { return (toString.call(x) === id); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/is-function.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/is-function.js new file mode 100644 index 00000000..ab4399ce --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/is-function.js @@ -0,0 +1,9 @@ +'use strict'; + +var toString = Object.prototype.toString + + , id = toString.call(require('./noop')); + +module.exports = function (f) { + return (typeof f === "function") && (toString.call(f) === id); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/noop.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/noop.js new file mode 100644 index 00000000..aa43baed --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/noop.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function () {}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/pluck.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/pluck.js new file mode 100644 index 00000000..7f70a30c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/pluck.js @@ -0,0 +1,7 @@ +'use strict'; + +var value = require('../object/valid-value'); + +module.exports = function (name) { + return function (o) { return value(o)[name]; }; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/valid-function.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/valid-function.js new file mode 100644 index 00000000..05fdee2c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/valid-function.js @@ -0,0 +1,8 @@ +'use strict'; + +var isFunction = require('./is-function'); + +module.exports = function (x) { + if (!isFunction(x)) throw new TypeError(x + " is not a function"); + return x; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/global.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/global.js new file mode 100644 index 00000000..872a40e8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/global.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = new Function("return this")(); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/index.js new file mode 100644 index 00000000..db9a7600 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/index.js @@ -0,0 +1,17 @@ +'use strict'; + +module.exports = { + global: require('./global'), + + array: require('./array'), + boolean: require('./boolean'), + date: require('./date'), + error: require('./error'), + function: require('./function'), + iterable: require('./iterable'), + math: require('./math'), + number: require('./number'), + object: require('./object'), + regExp: require('./reg-exp'), + string: require('./string') +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/iterable/for-each.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/iterable/for-each.js new file mode 100644 index 00000000..f1e20425 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/iterable/for-each.js @@ -0,0 +1,12 @@ +'use strict'; + +var forOf = require('es6-iterator/for-of') + , isIterable = require('es6-iterator/is-iterable') + , iterable = require('./validate') + + , forEach = Array.prototype.forEach; + +module.exports = function (target, cb/*, thisArg*/) { + if (isIterable(iterable(target))) forOf(target, cb, arguments[2]); + else forEach.call(target, cb, arguments[2]); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/iterable/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/iterable/index.js new file mode 100644 index 00000000..a3e16a5e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/iterable/index.js @@ -0,0 +1,8 @@ +'use strict'; + +module.exports = { + forEach: require('./for-each'), + is: require('./is'), + validate: require('./validate'), + validateObject: require('./validate-object') +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/iterable/is.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/iterable/is.js new file mode 100644 index 00000000..bb8bf287 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/iterable/is.js @@ -0,0 +1,10 @@ +'use strict'; + +var iteratorSymbol = require('es6-symbol').iterator + , isArrayLike = require('../object/is-array-like'); + +module.exports = function (x) { + if (x == null) return false; + if (typeof x[iteratorSymbol] === 'function') return true; + return isArrayLike(x); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/iterable/validate-object.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/iterable/validate-object.js new file mode 100644 index 00000000..988a6adb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/iterable/validate-object.js @@ -0,0 +1,9 @@ +'use strict'; + +var isObject = require('../object/is-object') + , is = require('./is'); + +module.exports = function (x) { + if (is(x) && isObject(x)) return x; + throw new TypeError(x + " is not an iterable or array-like object"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/iterable/validate.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/iterable/validate.js new file mode 100644 index 00000000..1be6d7fc --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/iterable/validate.js @@ -0,0 +1,8 @@ +'use strict'; + +var is = require('./is'); + +module.exports = function (x) { + if (is(x)) return x; + throw new TypeError(x + " is not an iterable or array-like"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/_pack-ieee754.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/_pack-ieee754.js new file mode 100644 index 00000000..eecda565 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/_pack-ieee754.js @@ -0,0 +1,82 @@ +// Credit: https://github.com/paulmillr/es6-shim/ + +'use strict'; + +var abs = Math.abs, floor = Math.floor, log = Math.log, min = Math.min + , pow = Math.pow, LN2 = Math.LN2 + , roundToEven; + +roundToEven = function (n) { + var w = floor(n), f = n - w; + if (f < 0.5) return w; + if (f > 0.5) return w + 1; + return w % 2 ? w + 1 : w; +}; + +module.exports = function (v, ebits, fbits) { + var bias = (1 << (ebits - 1)) - 1, s, e, f, i, bits, str, bytes; + + // Compute sign, exponent, fraction + if (isNaN(v)) { + // NaN + // http://dev.w3.org/2006/webapi/WebIDL/#es-type-mapping + e = (1 << ebits) - 1; + f = pow(2, fbits - 1); + s = 0; + } else if (v === Infinity || v === -Infinity) { + e = (1 << ebits) - 1; + f = 0; + s = (v < 0) ? 1 : 0; + } else if (v === 0) { + e = 0; + f = 0; + s = (1 / v === -Infinity) ? 1 : 0; + } else { + s = v < 0; + v = abs(v); + + if (v >= pow(2, 1 - bias)) { + e = min(floor(log(v) / LN2), 1023); + f = roundToEven(v / pow(2, e) * pow(2, fbits)); + if (f / pow(2, fbits) >= 2) { + e = e + 1; + f = 1; + } + if (e > bias) { + // Overflow + e = (1 << ebits) - 1; + f = 0; + } else { + // Normal + e = e + bias; + f = f - pow(2, fbits); + } + } else { + // Subnormal + e = 0; + f = roundToEven(v / pow(2, 1 - bias - fbits)); + } + } + + // Pack sign, exponent, fraction + bits = []; + for (i = fbits; i; i -= 1) { + bits.push(f % 2 ? 1 : 0); + f = floor(f / 2); + } + for (i = ebits; i; i -= 1) { + bits.push(e % 2 ? 1 : 0); + e = floor(e / 2); + } + bits.push(s ? 1 : 0); + bits.reverse(); + str = bits.join(''); + + // Bits to bytes + bytes = []; + while (str.length) { + bytes.push(parseInt(str.substring(0, 8), 2)); + str = str.substring(8); + } + return bytes; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/_unpack-ieee754.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/_unpack-ieee754.js new file mode 100644 index 00000000..c9f26f2b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/_unpack-ieee754.js @@ -0,0 +1,33 @@ +// Credit: https://github.com/paulmillr/es6-shim/ + +'use strict'; + +var pow = Math.pow; + +module.exports = function (bytes, ebits, fbits) { + // Bytes to bits + var bits = [], i, j, b, str, + bias, s, e, f; + + for (i = bytes.length; i; i -= 1) { + b = bytes[i - 1]; + for (j = 8; j; j -= 1) { + bits.push(b % 2 ? 1 : 0); + b = b >> 1; + } + } + bits.reverse(); + str = bits.join(''); + + // Unpack sign, exponent, fraction + bias = (1 << (ebits - 1)) - 1; + s = parseInt(str.substring(0, 1), 2) ? -1 : 1; + e = parseInt(str.substring(1, 1 + ebits), 2); + f = parseInt(str.substring(1 + ebits), 2); + + // Produce number + if (e === (1 << ebits) - 1) return f !== 0 ? NaN : s * Infinity; + if (e > 0) return s * pow(2, e - bias) * (1 + f / pow(2, fbits)); + if (f !== 0) return s * pow(2, -(bias - 1)) * (f / pow(2, fbits)); + return s < 0 ? -0 : 0; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/acosh/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/acosh/implement.js new file mode 100644 index 00000000..f48ad11d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/acosh/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(Math, 'acosh', { value: require('./shim'), + configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/acosh/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/acosh/index.js new file mode 100644 index 00000000..00ddea69 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/acosh/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = require('./is-implemented')() + ? Math.acosh + : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/acosh/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/acosh/is-implemented.js new file mode 100644 index 00000000..363f0d8b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/acosh/is-implemented.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = function () { + var acosh = Math.acosh; + if (typeof acosh !== 'function') return false; + return acosh(2) === 1.3169578969248166; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/acosh/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/acosh/shim.js new file mode 100644 index 00000000..89a24b5d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/acosh/shim.js @@ -0,0 +1,12 @@ +'use strict'; + +var log = Math.log, sqrt = Math.sqrt; + +module.exports = function (x) { + if (isNaN(x)) return NaN; + x = Number(x); + if (x < 1) return NaN; + if (x === 1) return 0; + if (x === Infinity) return x; + return log(x + sqrt(x * x - 1)); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/asinh/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/asinh/implement.js new file mode 100644 index 00000000..21f64d50 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/asinh/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(Math, 'asinh', { value: require('./shim'), + configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/asinh/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/asinh/index.js new file mode 100644 index 00000000..d415144e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/asinh/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = require('./is-implemented')() + ? Math.asinh + : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/asinh/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/asinh/is-implemented.js new file mode 100644 index 00000000..6c205f41 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/asinh/is-implemented.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = function () { + var asinh = Math.asinh; + if (typeof asinh !== 'function') return false; + return asinh(2) === 1.4436354751788103; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/asinh/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/asinh/shim.js new file mode 100644 index 00000000..42fbf145 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/asinh/shim.js @@ -0,0 +1,15 @@ +'use strict'; + +var log = Math.log, sqrt = Math.sqrt; + +module.exports = function (x) { + if (isNaN(x)) return NaN; + x = Number(x); + if (x === 0) return x; + if (!isFinite(x)) return x; + if (x < 0) { + x = -x; + return -log(x + sqrt(x * x + 1)); + } + return log(x + sqrt(x * x + 1)); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/atanh/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/atanh/implement.js new file mode 100644 index 00000000..1a485134 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/atanh/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(Math, 'atanh', { value: require('./shim'), + configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/atanh/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/atanh/index.js new file mode 100644 index 00000000..785b3deb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/atanh/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = require('./is-implemented')() + ? Math.atanh + : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/atanh/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/atanh/is-implemented.js new file mode 100644 index 00000000..dbaf18ec --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/atanh/is-implemented.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = function () { + var atanh = Math.atanh; + if (typeof atanh !== 'function') return false; + return atanh(0.5) === 0.5493061443340549; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/atanh/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/atanh/shim.js new file mode 100644 index 00000000..531e2891 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/atanh/shim.js @@ -0,0 +1,14 @@ +'use strict'; + +var log = Math.log; + +module.exports = function (x) { + if (isNaN(x)) return NaN; + x = Number(x); + if (x < -1) return NaN; + if (x > 1) return NaN; + if (x === -1) return -Infinity; + if (x === 1) return Infinity; + if (x === 0) return x; + return 0.5 * log((1 + x) / (1 - x)); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/cbrt/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/cbrt/implement.js new file mode 100644 index 00000000..3a12dde4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/cbrt/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(Math, 'cbrt', { value: require('./shim'), + configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/cbrt/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/cbrt/index.js new file mode 100644 index 00000000..89f966df --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/cbrt/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = require('./is-implemented')() + ? Math.cbrt + : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/cbrt/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/cbrt/is-implemented.js new file mode 100644 index 00000000..69809f3c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/cbrt/is-implemented.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = function () { + var cbrt = Math.cbrt; + if (typeof cbrt !== 'function') return false; + return cbrt(2) === 1.2599210498948732; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/cbrt/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/cbrt/shim.js new file mode 100644 index 00000000..bca19602 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/cbrt/shim.js @@ -0,0 +1,12 @@ +'use strict'; + +var pow = Math.pow; + +module.exports = function (x) { + if (isNaN(x)) return NaN; + x = Number(x); + if (x === 0) return x; + if (!isFinite(x)) return x; + if (x < 0) return -pow(-x, 1 / 3); + return pow(x, 1 / 3); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/clz32/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/clz32/implement.js new file mode 100644 index 00000000..339df33e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/clz32/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(Math, 'clz32', { value: require('./shim'), + configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/clz32/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/clz32/index.js new file mode 100644 index 00000000..1687b337 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/clz32/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = require('./is-implemented')() + ? Math.clz32 + : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/clz32/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/clz32/is-implemented.js new file mode 100644 index 00000000..ccc8f713 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/clz32/is-implemented.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = function () { + var clz32 = Math.clz32; + if (typeof clz32 !== 'function') return false; + return clz32(1000) === 22; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/clz32/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/clz32/shim.js new file mode 100644 index 00000000..2a582da3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/clz32/shim.js @@ -0,0 +1,6 @@ +'use strict'; + +module.exports = function (value) { + value = value >>> 0; + return value ? 32 - value.toString(2).length : 32; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/cosh/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/cosh/implement.js new file mode 100644 index 00000000..f90d8305 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/cosh/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(Math, 'cosh', { value: require('./shim'), + configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/cosh/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/cosh/index.js new file mode 100644 index 00000000..000636ab --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/cosh/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = require('./is-implemented')() + ? Math.cosh + : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/cosh/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/cosh/is-implemented.js new file mode 100644 index 00000000..c796bcbf --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/cosh/is-implemented.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = function () { + var cosh = Math.cosh; + if (typeof cosh !== 'function') return false; + return cosh(1) === 1.5430806348152437; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/cosh/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/cosh/shim.js new file mode 100644 index 00000000..f9062bd9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/cosh/shim.js @@ -0,0 +1,11 @@ +'use strict'; + +var exp = Math.exp; + +module.exports = function (x) { + if (isNaN(x)) return NaN; + x = Number(x); + if (x === 0) return 1; + if (!isFinite(x)) return Infinity; + return (exp(x) + exp(-x)) / 2; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/expm1/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/expm1/implement.js new file mode 100644 index 00000000..fc20c8cf --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/expm1/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(Math, 'expm1', { value: require('./shim'), + configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/expm1/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/expm1/index.js new file mode 100644 index 00000000..4c1bc77a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/expm1/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = require('./is-implemented')() + ? Math.expm1 + : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/expm1/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/expm1/is-implemented.js new file mode 100644 index 00000000..3b106d5d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/expm1/is-implemented.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = function () { + var expm1 = Math.expm1; + if (typeof expm1 !== 'function') return false; + return expm1(1).toFixed(15) === '1.718281828459045'; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/expm1/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/expm1/shim.js new file mode 100644 index 00000000..9c8c2360 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/expm1/shim.js @@ -0,0 +1,16 @@ +// Thanks: https://github.com/monolithed/ECMAScript-6 + +'use strict'; + +var exp = Math.exp; + +module.exports = function (x) { + if (isNaN(x)) return NaN; + x = Number(x); + if (x === 0) return x; + if (x === Infinity) return Infinity; + if (x === -Infinity) return -1; + + if ((x > -1.0e-6) && (x < 1.0e-6)) return x + x * x / 2; + return exp(x) - 1; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/fround/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/fround/implement.js new file mode 100644 index 00000000..c55b26c4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/fround/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(Math, 'fround', { value: require('./shim'), + configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/fround/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/fround/index.js new file mode 100644 index 00000000..a077ed0b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/fround/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = require('./is-implemented')() + ? Math.fround + : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/fround/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/fround/is-implemented.js new file mode 100644 index 00000000..ffbf094e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/fround/is-implemented.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = function () { + var fround = Math.fround; + if (typeof fround !== 'function') return false; + return fround(1.337) === 1.3370000123977661; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/fround/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/fround/shim.js new file mode 100644 index 00000000..f2c86e46 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/fround/shim.js @@ -0,0 +1,33 @@ +// Credit: https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js + +'use strict'; + +var toFloat32; + +if (typeof Float32Array !== 'undefined') { + toFloat32 = (function () { + var float32Array = new Float32Array(1); + return function (x) { + float32Array[0] = x; + return float32Array[0]; + }; + }()); +} else { + toFloat32 = (function () { + var pack = require('../_pack-ieee754') + , unpack = require('../_unpack-ieee754'); + + return function (x) { + return unpack(pack(x, 8, 23), 8, 23); + }; + }()); +} + +module.exports = function (x) { + if (isNaN(x)) return NaN; + x = Number(x); + if (x === 0) return x; + if (!isFinite(x)) return x; + + return toFloat32(x); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/hypot/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/hypot/implement.js new file mode 100644 index 00000000..b27fda7a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/hypot/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(Math, 'hypot', { value: require('./shim'), + configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/hypot/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/hypot/index.js new file mode 100644 index 00000000..334bc584 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/hypot/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = require('./is-implemented')() + ? Math.hypot + : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/hypot/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/hypot/is-implemented.js new file mode 100644 index 00000000..e75c5d36 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/hypot/is-implemented.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = function () { + var hypot = Math.hypot; + if (typeof hypot !== 'function') return false; + return hypot(3, 4) === 5; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/hypot/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/hypot/shim.js new file mode 100644 index 00000000..3d0988bc --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/hypot/shim.js @@ -0,0 +1,34 @@ +// Thanks for hints: https://github.com/paulmillr/es6-shim + +'use strict'; + +var some = Array.prototype.some, abs = Math.abs, sqrt = Math.sqrt + + , compare = function (a, b) { return b - a; } + , divide = function (x) { return x / this; } + , add = function (sum, number) { return sum + number * number; }; + +module.exports = function (val1, val2/*, …valn*/) { + var result, numbers; + if (!arguments.length) return 0; + some.call(arguments, function (val) { + if (isNaN(val)) { + result = NaN; + return; + } + if (!isFinite(val)) { + result = Infinity; + return true; + } + if (result !== undefined) return; + val = Number(val); + if (val === 0) return; + if (!numbers) numbers = [abs(val)]; + else numbers.push(abs(val)); + }); + if (result !== undefined) return result; + if (!numbers) return 0; + + numbers.sort(compare); + return numbers[0] * sqrt(numbers.map(divide, numbers[0]).reduce(add, 0)); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/imul/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/imul/implement.js new file mode 100644 index 00000000..ed207bd2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/imul/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(Math, 'imul', { value: require('./shim'), + configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/imul/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/imul/index.js new file mode 100644 index 00000000..41e5d5f0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/imul/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = require('./is-implemented')() + ? Math.imul + : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/imul/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/imul/is-implemented.js new file mode 100644 index 00000000..d8495dea --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/imul/is-implemented.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = function () { + var imul = Math.imul; + if (typeof imul !== 'function') return false; + return imul(-1, 8) === -8; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/imul/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/imul/shim.js new file mode 100644 index 00000000..8fd8a8d7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/imul/shim.js @@ -0,0 +1,13 @@ +// Thanks: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference +// /Global_Objects/Math/imul + +'use strict'; + +module.exports = function (x, y) { + var xh = (x >>> 16) & 0xffff, xl = x & 0xffff + , yh = (y >>> 16) & 0xffff, yl = y & 0xffff; + + // the shift by 0 fixes the sign on the high part + // the final |0 converts the unsigned value into a signed value + return ((xl * yl) + (((xh * yl + xl * yh) << 16) >>> 0) | 0); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/index.js new file mode 100644 index 00000000..d112d0bf --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/index.js @@ -0,0 +1,21 @@ +'use strict'; + +module.exports = { + acosh: require('./acosh'), + asinh: require('./asinh'), + atanh: require('./atanh'), + cbrt: require('./cbrt'), + clz32: require('./clz32'), + cosh: require('./cosh'), + expm1: require('./expm1'), + fround: require('./fround'), + hypot: require('./hypot'), + imul: require('./imul'), + log10: require('./log10'), + log2: require('./log2'), + log1p: require('./log1p'), + sign: require('./sign'), + sinh: require('./sinh'), + tanh: require('./tanh'), + trunc: require('./trunc') +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log10/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log10/implement.js new file mode 100644 index 00000000..dd96edd8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log10/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(Math, 'log10', { value: require('./shim'), + configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log10/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log10/index.js new file mode 100644 index 00000000..a9eee513 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log10/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = require('./is-implemented')() + ? Math.log10 + : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log10/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log10/is-implemented.js new file mode 100644 index 00000000..c7f40ee7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log10/is-implemented.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = function () { + var log10 = Math.log10; + if (typeof log10 !== 'function') return false; + return log10(2) === 0.3010299956639812; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log10/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log10/shim.js new file mode 100644 index 00000000..fc77287f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log10/shim.js @@ -0,0 +1,14 @@ +'use strict'; + +var log = Math.log, LOG10E = Math.LOG10E; + +module.exports = function (x) { + if (isNaN(x)) return NaN; + x = Number(x); + if (x < 0) return NaN; + if (x === 0) return -Infinity; + if (x === 1) return 0; + if (x === Infinity) return Infinity; + + return log(x) * LOG10E; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log1p/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log1p/implement.js new file mode 100644 index 00000000..f62f91f6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log1p/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(Math, 'log1p', { value: require('./shim'), + configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log1p/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log1p/index.js new file mode 100644 index 00000000..107b1147 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log1p/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = require('./is-implemented')() + ? Math.log1p + : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log1p/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log1p/is-implemented.js new file mode 100644 index 00000000..61e90974 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log1p/is-implemented.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = function () { + var log1p = Math.log1p; + if (typeof log1p !== 'function') return false; + return log1p(1) === 0.6931471805599453; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log1p/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log1p/shim.js new file mode 100644 index 00000000..10acebca --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log1p/shim.js @@ -0,0 +1,17 @@ +// Thanks: https://github.com/monolithed/ECMAScript-6/blob/master/ES6.js + +'use strict'; + +var log = Math.log; + +module.exports = function (x) { + if (isNaN(x)) return NaN; + x = Number(x); + if (x < -1) return NaN; + if (x === -1) return -Infinity; + if (x === 0) return x; + if (x === Infinity) return Infinity; + + if (x > -1.0e-8 && x < 1.0e-8) return (x - x * x / 2); + return log(1 + x); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log2/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log2/implement.js new file mode 100644 index 00000000..8483f095 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log2/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(Math, 'log2', { value: require('./shim'), + configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log2/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log2/index.js new file mode 100644 index 00000000..87e9050a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log2/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = require('./is-implemented')() + ? Math.log2 + : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log2/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log2/is-implemented.js new file mode 100644 index 00000000..802322fa --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log2/is-implemented.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = function () { + var log2 = Math.log2; + if (typeof log2 !== 'function') return false; + return log2(3).toFixed(15) === '1.584962500721156'; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log2/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log2/shim.js new file mode 100644 index 00000000..cd80994a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log2/shim.js @@ -0,0 +1,14 @@ +'use strict'; + +var log = Math.log, LOG2E = Math.LOG2E; + +module.exports = function (x) { + if (isNaN(x)) return NaN; + x = Number(x); + if (x < 0) return NaN; + if (x === 0) return -Infinity; + if (x === 1) return 0; + if (x === Infinity) return Infinity; + + return log(x) * LOG2E; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/sign/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/sign/implement.js new file mode 100644 index 00000000..b0db2f41 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/sign/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(Math, 'sign', { value: require('./shim'), + configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/sign/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/sign/index.js new file mode 100644 index 00000000..b2326333 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/sign/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = require('./is-implemented')() + ? Math.sign + : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/sign/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/sign/is-implemented.js new file mode 100644 index 00000000..6d0de475 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/sign/is-implemented.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = function () { + var sign = Math.sign; + if (typeof sign !== 'function') return false; + return ((sign(10) === 1) && (sign(-20) === -1)); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/sign/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/sign/shim.js new file mode 100644 index 00000000..4df9c95a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/sign/shim.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = function (value) { + value = Number(value); + if (isNaN(value) || (value === 0)) return value; + return (value > 0) ? 1 : -1; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/sinh/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/sinh/implement.js new file mode 100644 index 00000000..f259a631 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/sinh/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(Math, 'sinh', { value: require('./shim'), + configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/sinh/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/sinh/index.js new file mode 100644 index 00000000..e5bea572 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/sinh/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = require('./is-implemented')() + ? Math.sinh + : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/sinh/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/sinh/is-implemented.js new file mode 100644 index 00000000..888ec67a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/sinh/is-implemented.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = function () { + var sinh = Math.sinh; + if (typeof sinh !== 'function') return false; + return ((sinh(1) === 1.1752011936438014) && (sinh(Number.MIN_VALUE) === 5e-324)); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/sinh/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/sinh/shim.js new file mode 100644 index 00000000..5b725bed --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/sinh/shim.js @@ -0,0 +1,17 @@ +// Parts of implementation taken from es6-shim project +// See: https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js + +'use strict'; + +var expm1 = require('../expm1') + + , abs = Math.abs, exp = Math.exp, e = Math.E; + +module.exports = function (x) { + if (isNaN(x)) return NaN; + x = Number(x); + if (x === 0) return x; + if (!isFinite(x)) return x; + if (abs(x) < 1) return (expm1(x) - expm1(-x)) / 2; + return (exp(x - 1) - exp(-x - 1)) * e / 2; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/tanh/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/tanh/implement.js new file mode 100644 index 00000000..5199a029 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/tanh/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(Math, 'tanh', { value: require('./shim'), + configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/tanh/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/tanh/index.js new file mode 100644 index 00000000..6099c408 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/tanh/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = require('./is-implemented')() + ? Math.tanh + : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/tanh/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/tanh/is-implemented.js new file mode 100644 index 00000000..a7d22237 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/tanh/is-implemented.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = function () { + var tanh = Math.tanh; + if (typeof tanh !== 'function') return false; + return ((tanh(1) === 0.7615941559557649) && (tanh(Number.MAX_VALUE) === 1)); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/tanh/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/tanh/shim.js new file mode 100644 index 00000000..f6e948f2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/tanh/shim.js @@ -0,0 +1,17 @@ +'use strict'; + +var exp = Math.exp; + +module.exports = function (x) { + var a, b; + if (isNaN(x)) return NaN; + x = Number(x); + if (x === 0) return x; + if (x === Infinity) return 1; + if (x === -Infinity) return -1; + a = exp(x); + if (a === Infinity) return 1; + b = exp(-x); + if (b === Infinity) return -1; + return (a - b) / (a + b); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/trunc/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/trunc/implement.js new file mode 100644 index 00000000..3ee80ab2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/trunc/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(Math, 'trunc', { value: require('./shim'), + configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/trunc/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/trunc/index.js new file mode 100644 index 00000000..0b0f9b2a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/trunc/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = require('./is-implemented')() + ? Math.trunc + : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/trunc/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/trunc/is-implemented.js new file mode 100644 index 00000000..3e8cde1f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/trunc/is-implemented.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = function () { + var trunc = Math.trunc; + if (typeof trunc !== 'function') return false; + return (trunc(13.67) === 13) && (trunc(-13.67) === -13); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/trunc/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/trunc/shim.js new file mode 100644 index 00000000..02e2c2ad --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/trunc/shim.js @@ -0,0 +1,13 @@ +'use strict'; + +var floor = Math.floor; + +module.exports = function (x) { + if (isNaN(x)) return NaN; + x = Number(x); + if (x === 0) return x; + if (x === Infinity) return Infinity; + if (x === -Infinity) return -Infinity; + if (x > 0) return floor(x); + return -floor(-x); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/#/chain.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/#/chain.js new file mode 100644 index 00000000..6dc1543b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/#/chain.js @@ -0,0 +1,40 @@ +'use strict'; + +var setPrototypeOf = require('es5-ext/object/set-prototype-of') + , d = require('d') + , Iterator = require('../') + , validIterable = require('../valid-iterable') + + , push = Array.prototype.push + , defineProperties = Object.defineProperties + , IteratorChain; + +IteratorChain = function (iterators) { + defineProperties(this, { + __iterators__: d('', iterators), + __current__: d('w', iterators.shift()) + }); +}; +if (setPrototypeOf) setPrototypeOf(IteratorChain, Iterator); + +IteratorChain.prototype = Object.create(Iterator.prototype, { + constructor: d(IteratorChain), + next: d(function () { + var result; + if (!this.__current__) return { done: true, value: undefined }; + result = this.__current__.next(); + while (result.done) { + this.__current__ = this.__iterators__.shift(); + if (!this.__current__) return { done: true, value: undefined }; + result = this.__current__.next(); + } + return result; + }) +}); + +module.exports = function () { + var iterators = [this]; + push.apply(iterators, arguments); + iterators.forEach(validIterable); + return new IteratorChain(iterators); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/.lint b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/.lint new file mode 100644 index 00000000..cf54d815 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/.lint @@ -0,0 +1,11 @@ +@root + +module + +tabs +indent 2 +maxlen 100 + +ass +nomen +plusplus diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/.npmignore new file mode 100644 index 00000000..155e41f6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/.npmignore @@ -0,0 +1,4 @@ +.DS_Store +/node_modules +/npm-debug.log +/.lintcache diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/.travis.yml new file mode 100644 index 00000000..fc254110 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/.travis.yml @@ -0,0 +1,11 @@ +sudo: false # http://docs.travis-ci.com/user/workers/container-based-infrastructure/ +language: node_js +node_js: + - 0.12 + - 4 + +notifications: + email: + - medikoo+es6-iterator@medikoo.com + +script: "npm test && npm run lint" diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/CHANGES b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/CHANGES new file mode 100644 index 00000000..ce331809 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/CHANGES @@ -0,0 +1,35 @@ +v2.0.0 -- 2015.10.02 +* Use es6-symbol at v3 + +v1.0.0 -- 2015.06.23 +* Implement support for arguments object +* Drop support for v0.8 node ('^' in package.json dependencies) + +v0.1.3 -- 2015.02.02 +* Update dependencies +* Fix spelling of LICENSE + +v0.1.2 -- 2014.11.19 +* Optimise internal `_next` to not verify internal's list length at all times + (#2 thanks @RReverser) +* Fix documentation examples +* Configure lint scripts + +v0.1.1 -- 2014.04.29 +* Fix es6-symbol dependency version + +v0.1.0 -- 2014.04.29 +* Assure strictly npm hosted dependencies +* Remove sparse arrays dedicated handling (as per spec) +* Add: isIterable, validIterable and chain (method) +* Remove toArray, it's addressed by Array.from (polyfil can be found in es5-ext/array/from) +* Add break possiblity to 'forOf' via 'doBreak' function argument +* Provide dedicated iterator for array-likes (ArrayIterator) and for strings (StringIterator) +* Provide @@toStringTag symbol +* When available rely on @@iterator symbol +* Remove 32bit integer maximum list length restriction +* Improve Iterator internals +* Update to use latest version of dependencies + +v0.0.0 -- 2013.10.12 +Initial (dev version) \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/LICENSE new file mode 100644 index 00000000..04724a3a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2013-2015 Mariusz Nowak (www.medikoo.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/README.md new file mode 100644 index 00000000..30faa82b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/README.md @@ -0,0 +1,148 @@ +# es6-iterator +## ECMAScript 6 Iterator interface + +### Installation + + $ npm install es6-iterator + +To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/) + +## API + +### Constructors + +#### Iterator(list) _(es6-iterator)_ + +Abstract Iterator interface. Meant for extensions and not to be used on its own. + +Accepts any _list_ object (technically object with numeric _length_ property). + +_Mind it doesn't iterate strings properly, for that use dedicated [StringIterator](#string-iterator)_ + +```javascript +var Iterator = require('es6-iterator') +var iterator = new Iterator([1, 2, 3]); + +iterator.next(); // { value: 1, done: false } +iterator.next(); // { value: 2, done: false } +iterator.next(); // { value: 3, done: false } +iterator.next(); // { value: undefined, done: true } +``` + + +#### ArrayIterator(arrayLike[, kind]) _(es6-iterator/array)_ + +Dedicated for arrays and array-likes. Supports three iteration kinds: +* __value__ _(default)_ - Iterates values +* __key__ - Iterates indexes +* __key+value__ - Iterates keys and indexes, each iteration value is in _[key, value]_ form. + + +```javascript +var ArrayIterator = require('es6-iterator/array') +var iterator = new ArrayIterator([1, 2, 3], 'key+value'); + +iterator.next(); // { value: [0, 1], done: false } +iterator.next(); // { value: [1, 2], done: false } +iterator.next(); // { value: [2, 3], done: false } +iterator.next(); // { value: undefined, done: true } +``` + +May also be used for _arguments_ objects: + +```javascript +(function () { + var iterator = new ArrayIterator(arguments); + + iterator.next(); // { value: 1, done: false } + iterator.next(); // { value: 2, done: false } + iterator.next(); // { value: 3, done: false } + iterator.next(); // { value: undefined, done: true } +}(1, 2, 3)); +``` + +#### StringIterator(str) _(es6-iterator/string)_ + +Assures proper iteration over unicode symbols. +See: http://mathiasbynens.be/notes/javascript-unicode + +```javascript +var StringIterator = require('es6-iterator/string'); +var iterator = new StringIterator('f🙈o🙉o🙊'); + +iterator.next(); // { value: 'f', done: false } +iterator.next(); // { value: '🙈', done: false } +iterator.next(); // { value: 'o', done: false } +iterator.next(); // { value: '🙉', done: false } +iterator.next(); // { value: 'o', done: false } +iterator.next(); // { value: '🙊', done: false } +iterator.next(); // { value: undefined, done: true } +``` + +### Function utilities + +#### forOf(iterable, callback[, thisArg]) _(es6-iterator/for-of)_ + +Polyfill for ECMAScript 6 [`for...of`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of) statement. + +``` +var forOf = require('es6-iterator/for-of'); +var result = []; + +forOf('🙈🙉🙊', function (monkey) { result.push(monkey); }); +console.log(result); // ['🙈', '🙉', '🙊']; +``` + +Optionally you can break iteration at any point: + +```javascript +var result = []; + +forOf([1,2,3,4]', function (val, doBreak) { + result.push(monkey); + if (val >= 3) doBreak(); +}); +console.log(result); // [1, 2, 3]; +``` + +#### get(obj) _(es6-iterator/get)_ + +Return iterator for any iterable object. + +```javascript +var getIterator = require('es6-iterator/get'); +var iterator = get([1,2,3]); + +iterator.next(); // { value: 1, done: false } +iterator.next(); // { value: 2, done: false } +iterator.next(); // { value: 3, done: false } +iterator.next(); // { value: undefined, done: true } +``` + +#### isIterable(obj) _(es6-iterator/is-iterable)_ + +Whether _obj_ is iterable + +```javascript +var isIterable = require('es6-iterator/is-iterable'); + +isIterable(null); // false +isIterable(true); // false +isIterable('str'); // true +isIterable(['a', 'r', 'r']); // true +isIterable(new ArrayIterator([])); // true +``` + +#### validIterable(obj) _(es6-iterator/valid-iterable)_ + +If _obj_ is an iterable it is returned. Otherwise _TypeError_ is thrown. + +### Method extensions + +#### iterator.chain(iterator1[, …iteratorn]) _(es6-iterator/#/chain)_ + +Chain multiple iterators into one. + +### Tests [![Build Status](https://travis-ci.org/medikoo/es6-iterator.png)](https://travis-ci.org/medikoo/es6-iterator) + + $ npm test diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/array.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/array.js new file mode 100644 index 00000000..885ad0a4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/array.js @@ -0,0 +1,30 @@ +'use strict'; + +var setPrototypeOf = require('es5-ext/object/set-prototype-of') + , contains = require('es5-ext/string/#/contains') + , d = require('d') + , Iterator = require('./') + + , defineProperty = Object.defineProperty + , ArrayIterator; + +ArrayIterator = module.exports = function (arr, kind) { + if (!(this instanceof ArrayIterator)) return new ArrayIterator(arr, kind); + Iterator.call(this, arr); + if (!kind) kind = 'value'; + else if (contains.call(kind, 'key+value')) kind = 'key+value'; + else if (contains.call(kind, 'key')) kind = 'key'; + else kind = 'value'; + defineProperty(this, '__kind__', d('', kind)); +}; +if (setPrototypeOf) setPrototypeOf(ArrayIterator, Iterator); + +ArrayIterator.prototype = Object.create(Iterator.prototype, { + constructor: d(ArrayIterator), + _resolve: d(function (i) { + if (this.__kind__ === 'value') return this.__list__[i]; + if (this.__kind__ === 'key+value') return [i, this.__list__[i]]; + return i; + }), + toString: d(function () { return '[object Array Iterator]'; }) +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/for-of.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/for-of.js new file mode 100644 index 00000000..c7a28411 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/for-of.js @@ -0,0 +1,46 @@ +'use strict'; + +var isArguments = require('es5-ext/function/is-arguments') + , callable = require('es5-ext/object/valid-callable') + , isString = require('es5-ext/string/is-string') + , get = require('./get') + + , isArray = Array.isArray, call = Function.prototype.call + , some = Array.prototype.some; + +module.exports = function (iterable, cb/*, thisArg*/) { + var mode, thisArg = arguments[2], result, doBreak, broken, i, l, char, code; + if (isArray(iterable) || isArguments(iterable)) mode = 'array'; + else if (isString(iterable)) mode = 'string'; + else iterable = get(iterable); + + callable(cb); + doBreak = function () { broken = true; }; + if (mode === 'array') { + some.call(iterable, function (value) { + call.call(cb, thisArg, value, doBreak); + if (broken) return true; + }); + return; + } + if (mode === 'string') { + l = iterable.length; + for (i = 0; i < l; ++i) { + char = iterable[i]; + if ((i + 1) < l) { + code = char.charCodeAt(0); + if ((code >= 0xD800) && (code <= 0xDBFF)) char += iterable[++i]; + } + call.call(cb, thisArg, char, doBreak); + if (broken) break; + } + return; + } + result = iterable.next(); + + while (!result.done) { + call.call(cb, thisArg, result.value, doBreak); + if (broken) return; + result = iterable.next(); + } +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/get.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/get.js new file mode 100644 index 00000000..7c7e052b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/get.js @@ -0,0 +1,15 @@ +'use strict'; + +var isArguments = require('es5-ext/function/is-arguments') + , isString = require('es5-ext/string/is-string') + , ArrayIterator = require('./array') + , StringIterator = require('./string') + , iterable = require('./valid-iterable') + , iteratorSymbol = require('es6-symbol').iterator; + +module.exports = function (obj) { + if (typeof iterable(obj)[iteratorSymbol] === 'function') return obj[iteratorSymbol](); + if (isArguments(obj)) return new ArrayIterator(obj); + if (isString(obj)) return new StringIterator(obj); + return new ArrayIterator(obj); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/index.js new file mode 100644 index 00000000..10fd0895 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/index.js @@ -0,0 +1,90 @@ +'use strict'; + +var clear = require('es5-ext/array/#/clear') + , assign = require('es5-ext/object/assign') + , callable = require('es5-ext/object/valid-callable') + , value = require('es5-ext/object/valid-value') + , d = require('d') + , autoBind = require('d/auto-bind') + , Symbol = require('es6-symbol') + + , defineProperty = Object.defineProperty + , defineProperties = Object.defineProperties + , Iterator; + +module.exports = Iterator = function (list, context) { + if (!(this instanceof Iterator)) return new Iterator(list, context); + defineProperties(this, { + __list__: d('w', value(list)), + __context__: d('w', context), + __nextIndex__: d('w', 0) + }); + if (!context) return; + callable(context.on); + context.on('_add', this._onAdd); + context.on('_delete', this._onDelete); + context.on('_clear', this._onClear); +}; + +defineProperties(Iterator.prototype, assign({ + constructor: d(Iterator), + _next: d(function () { + var i; + if (!this.__list__) return; + if (this.__redo__) { + i = this.__redo__.shift(); + if (i !== undefined) return i; + } + if (this.__nextIndex__ < this.__list__.length) return this.__nextIndex__++; + this._unBind(); + }), + next: d(function () { return this._createResult(this._next()); }), + _createResult: d(function (i) { + if (i === undefined) return { done: true, value: undefined }; + return { done: false, value: this._resolve(i) }; + }), + _resolve: d(function (i) { return this.__list__[i]; }), + _unBind: d(function () { + this.__list__ = null; + delete this.__redo__; + if (!this.__context__) return; + this.__context__.off('_add', this._onAdd); + this.__context__.off('_delete', this._onDelete); + this.__context__.off('_clear', this._onClear); + this.__context__ = null; + }), + toString: d(function () { return '[object Iterator]'; }) +}, autoBind({ + _onAdd: d(function (index) { + if (index >= this.__nextIndex__) return; + ++this.__nextIndex__; + if (!this.__redo__) { + defineProperty(this, '__redo__', d('c', [index])); + return; + } + this.__redo__.forEach(function (redo, i) { + if (redo >= index) this.__redo__[i] = ++redo; + }, this); + this.__redo__.push(index); + }), + _onDelete: d(function (index) { + var i; + if (index >= this.__nextIndex__) return; + --this.__nextIndex__; + if (!this.__redo__) return; + i = this.__redo__.indexOf(index); + if (i !== -1) this.__redo__.splice(i, 1); + this.__redo__.forEach(function (redo, i) { + if (redo > index) this.__redo__[i] = --redo; + }, this); + }), + _onClear: d(function () { + if (this.__redo__) clear.call(this.__redo__); + this.__nextIndex__ = 0; + }) +}))); + +defineProperty(Iterator.prototype, Symbol.iterator, d(function () { + return this; +})); +defineProperty(Iterator.prototype, Symbol.toStringTag, d('', 'Iterator')); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/is-iterable.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/is-iterable.js new file mode 100644 index 00000000..2c6f496c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/is-iterable.js @@ -0,0 +1,15 @@ +'use strict'; + +var isArguments = require('es5-ext/function/is-arguments') + , isString = require('es5-ext/string/is-string') + , iteratorSymbol = require('es6-symbol').iterator + + , isArray = Array.isArray; + +module.exports = function (value) { + if (value == null) return false; + if (isArray(value)) return true; + if (isString(value)) return true; + if (isArguments(value)) return true; + return (typeof value[iteratorSymbol] === 'function'); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/package.json new file mode 100644 index 00000000..16a33fee --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/package.json @@ -0,0 +1,66 @@ +{ + "name": "es6-iterator", + "version": "2.0.0", + "description": "Iterator abstraction based on ES6 specification", + "author": { + "name": "Mariusz Nowak", + "email": "medyk@medikoo.com", + "url": "http://www.medikoo.com/" + }, + "keywords": [ + "iterator", + "array", + "list", + "set", + "map", + "generator" + ], + "repository": { + "type": "git", + "url": "git://github.com/medikoo/es6-iterator.git" + }, + "dependencies": { + "d": "^0.1.1", + "es5-ext": "^0.10.7", + "es6-symbol": "3" + }, + "devDependencies": { + "event-emitter": "^0.3.4", + "tad": "^0.2.3", + "xlint": "^0.2.2", + "xlint-jslint-medikoo": "^0.1.3" + }, + "scripts": { + "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream", + "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch", + "test": "node ./node_modules/tad/bin/tad" + }, + "license": "MIT", + "gitHead": "4d9445834e87780ab373b14d6791e860899e2d31", + "bugs": { + "url": "https://github.com/medikoo/es6-iterator/issues" + }, + "homepage": "https://github.com/medikoo/es6-iterator#readme", + "_id": "es6-iterator@2.0.0", + "_shasum": "bd968567d61635e33c0b80727613c9cb4b096bac", + "_from": "es6-iterator@>=2.0.0 <3.0.0", + "_npmVersion": "2.11.3", + "_nodeVersion": "0.12.7", + "_npmUser": { + "name": "medikoo", + "email": "medikoo+npm@medikoo.com" + }, + "dist": { + "shasum": "bd968567d61635e33c0b80727613c9cb4b096bac", + "tarball": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.0.tgz" + }, + "maintainers": [ + { + "name": "medikoo", + "email": "medikoo+npm@medikoo.com" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/string.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/string.js new file mode 100644 index 00000000..cdb39ea4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/string.js @@ -0,0 +1,37 @@ +// Thanks @mathiasbynens +// http://mathiasbynens.be/notes/javascript-unicode#iterating-over-symbols + +'use strict'; + +var setPrototypeOf = require('es5-ext/object/set-prototype-of') + , d = require('d') + , Iterator = require('./') + + , defineProperty = Object.defineProperty + , StringIterator; + +StringIterator = module.exports = function (str) { + if (!(this instanceof StringIterator)) return new StringIterator(str); + str = String(str); + Iterator.call(this, str); + defineProperty(this, '__length__', d('', str.length)); + +}; +if (setPrototypeOf) setPrototypeOf(StringIterator, Iterator); + +StringIterator.prototype = Object.create(Iterator.prototype, { + constructor: d(StringIterator), + _next: d(function () { + if (!this.__list__) return; + if (this.__nextIndex__ < this.__length__) return this.__nextIndex__++; + this._unBind(); + }), + _resolve: d(function (i) { + var char = this.__list__[i], code; + if (this.__nextIndex__ === this.__length__) return char; + code = char.charCodeAt(0); + if ((code >= 0xD800) && (code <= 0xDBFF)) return char + this.__list__[this.__nextIndex__++]; + return char; + }), + toString: d(function () { return '[object String Iterator]'; }) +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/#/chain.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/#/chain.js new file mode 100644 index 00000000..a414c66d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/#/chain.js @@ -0,0 +1,23 @@ +'use strict'; + +var Iterator = require('../../'); + +module.exports = function (t, a) { + var i1 = new Iterator(['raz', 'dwa', 'trzy']) + , i2 = new Iterator(['cztery', 'pięć', 'sześć']) + , i3 = new Iterator(['siedem', 'osiem', 'dziewięć']) + + , iterator = t.call(i1, i2, i3); + + a.deep(iterator.next(), { done: false, value: 'raz' }, "#1"); + a.deep(iterator.next(), { done: false, value: 'dwa' }, "#2"); + a.deep(iterator.next(), { done: false, value: 'trzy' }, "#3"); + a.deep(iterator.next(), { done: false, value: 'cztery' }, "#4"); + a.deep(iterator.next(), { done: false, value: 'pięć' }, "#5"); + a.deep(iterator.next(), { done: false, value: 'sześć' }, "#6"); + a.deep(iterator.next(), { done: false, value: 'siedem' }, "#7"); + a.deep(iterator.next(), { done: false, value: 'osiem' }, "#8"); + a.deep(iterator.next(), { done: false, value: 'dziewięć' }, "#9"); + a.deep(iterator.next(), { done: true, value: undefined }, "Done #1"); + a.deep(iterator.next(), { done: true, value: undefined }, "Done #2"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/array.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/array.js new file mode 100644 index 00000000..ae7c2199 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/array.js @@ -0,0 +1,67 @@ +'use strict'; + +var iteratorSymbol = require('es6-symbol').iterator; + +module.exports = function (T) { + return { + Values: function (a) { + var x = ['raz', 'dwa', 'trzy', 'cztery', 'pięć', 'sześć'], it; + + it = new T(x); + a(it[iteratorSymbol](), it, "@@iterator"); + a.deep(it.next(), { done: false, value: 'raz' }, "#1"); + a.deep(it.next(), { done: false, value: 'dwa' }, "#2"); + x.splice(1, 0, 'elo'); + a.deep(it.next(), { done: false, value: 'dwa' }, "Insert"); + a.deep(it.next(), { done: false, value: 'trzy' }, "#3"); + a.deep(it.next(), { done: false, value: 'cztery' }, "#4"); + x.pop(); + a.deep(it.next(), { done: false, value: 'pięć' }, "#5"); + a.deep(it.next(), { done: true, value: undefined }, "End"); + }, + "Keys & Values": function (a) { + var x = ['raz', 'dwa', 'trzy', 'cztery', 'pięć', 'sześć'], it; + + it = new T(x, 'key+value'); + a(it[iteratorSymbol](), it, "@@iterator"); + a.deep(it.next(), { done: false, value: [0, 'raz'] }, "#1"); + a.deep(it.next(), { done: false, value: [1, 'dwa'] }, "#2"); + x.splice(1, 0, 'elo'); + a.deep(it.next(), { done: false, value: [2, 'dwa'] }, "Insert"); + a.deep(it.next(), { done: false, value: [3, 'trzy'] }, "#3"); + a.deep(it.next(), { done: false, value: [4, 'cztery'] }, "#4"); + x.pop(); + a.deep(it.next(), { done: false, value: [5, 'pięć'] }, "#5"); + a.deep(it.next(), { done: true, value: undefined }, "End"); + }, + Keys: function (a) { + var x = ['raz', 'dwa', 'trzy', 'cztery', 'pięć', 'sześć'], it; + + it = new T(x, 'key'); + a(it[iteratorSymbol](), it, "@@iterator"); + a.deep(it.next(), { done: false, value: 0 }, "#1"); + a.deep(it.next(), { done: false, value: 1 }, "#2"); + x.splice(1, 0, 'elo'); + a.deep(it.next(), { done: false, value: 2 }, "Insert"); + a.deep(it.next(), { done: false, value: 3 }, "#3"); + a.deep(it.next(), { done: false, value: 4 }, "#4"); + x.pop(); + a.deep(it.next(), { done: false, value: 5 }, "#5"); + a.deep(it.next(), { done: true, value: undefined }, "End"); + }, + Sparse: function (a) { + var x = new Array(6), it; + + x[2] = 'raz'; + x[4] = 'dwa'; + it = new T(x); + a.deep(it.next(), { done: false, value: undefined }, "#1"); + a.deep(it.next(), { done: false, value: undefined }, "#2"); + a.deep(it.next(), { done: false, value: 'raz' }, "#3"); + a.deep(it.next(), { done: false, value: undefined }, "#4"); + a.deep(it.next(), { done: false, value: 'dwa' }, "#5"); + a.deep(it.next(), { done: false, value: undefined }, "#6"); + a.deep(it.next(), { done: true, value: undefined }, "End"); + } + }; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/for-of.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/for-of.js new file mode 100644 index 00000000..108df7d9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/for-of.js @@ -0,0 +1,40 @@ +'use strict'; + +var ArrayIterator = require('../array') + + , slice = Array.prototype.slice; + +module.exports = function (t, a) { + var i = 0, x = ['raz', 'dwa', 'trzy'], y = {}, called = 0; + t(x, function () { + a.deep(slice.call(arguments, 0, 1), [x[i]], "Array " + i + "#"); + a(this, y, "Array: context: " + (i++) + "#"); + }, y); + i = 0; + t((function () { return arguments; }('raz', 'dwa', 'trzy')), function () { + a.deep(slice.call(arguments, 0, 1), [x[i]], "Arguments" + i + "#"); + a(this, y, "Arguments: context: " + (i++) + "#"); + }, y); + i = 0; + t(x = 'foo', function () { + a.deep(slice.call(arguments, 0, 1), [x[i]], "String " + i + "#"); + a(this, y, "Regular String: context: " + (i++) + "#"); + }, y); + i = 0; + x = ['r', '💩', 'z']; + t('r💩z', function () { + a.deep(slice.call(arguments, 0, 1), [x[i]], "String " + i + "#"); + a(this, y, "Unicode String: context: " + (i++) + "#"); + }, y); + i = 0; + t(new ArrayIterator(x), function () { + a.deep(slice.call(arguments, 0, 1), [x[i]], "Iterator " + i + "#"); + a(this, y, "Iterator: context: " + (i++) + "#"); + }, y); + + t(x = ['raz', 'dwa', 'trzy'], function (value, doBreak) { + ++called; + return doBreak(); + }); + a(called, 1, "Break"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/get.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/get.js new file mode 100644 index 00000000..81ce6e6a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/get.js @@ -0,0 +1,17 @@ +'use strict'; + +var iteratorSymbol = require('es6-symbol').iterator + , Iterator = require('../'); + +module.exports = function (t, a) { + var iterator; + a.throws(function () { t(); }, TypeError, "Null"); + a.throws(function () { t({}); }, TypeError, "Plain object"); + a.throws(function () { t({ length: 0 }); }, TypeError, "Array-like"); + iterator = {}; + iterator[iteratorSymbol] = function () { return new Iterator([]); }; + a(t(iterator) instanceof Iterator, true, "Iterator"); + a(String(t([])), '[object Array Iterator]', " Array"); + a(String(t((function () { return arguments; }()))), '[object Array Iterator]', " Arguments"); + a(String(t('foo')), '[object String Iterator]', "String"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/index.js new file mode 100644 index 00000000..ea3621ad --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/index.js @@ -0,0 +1,99 @@ +'use strict'; + +var ee = require('event-emitter') + , iteratorSymbol = require('es6-symbol').iterator; + +module.exports = function (T) { + return { + "": function (a) { + var x = ['raz', 'dwa', 'trzy', 'cztery', 'pięć'], it, y, z; + + it = new T(x); + a(it[iteratorSymbol](), it, "@@iterator"); + y = it.next(); + a.deep(y, { done: false, value: 'raz' }, "#1"); + z = it.next(); + a.not(y, z, "Recreate result"); + a.deep(z, { done: false, value: 'dwa' }, "#2"); + a.deep(it.next(), { done: false, value: 'trzy' }, "#3"); + a.deep(it.next(), { done: false, value: 'cztery' }, "#4"); + a.deep(it.next(), { done: false, value: 'pięć' }, "#5"); + a.deep(y = it.next(), { done: true, value: undefined }, "End"); + a.not(y, it.next(), "Recreate result on dead"); + }, + Emited: function (a) { + var x = ['raz', 'dwa', 'trzy', 'cztery', 'pięć'], y, it; + + y = ee(); + it = new T(x, y); + a.deep(it.next(), { done: false, value: 'raz' }, "#1"); + a.deep(it.next(), { done: false, value: 'dwa' }, "#2"); + y.emit('_add', x.push('sześć') - 1); + a.deep(it.next(), { done: false, value: 'trzy' }, "#3"); + x.splice(1, 0, 'półtora'); + y.emit('_add', 1); + a.deep(it.next(), { done: false, value: 'półtora' }, "Insert"); + x.splice(5, 1); + y.emit('_delete', 5); + a.deep(it.next(), { done: false, value: 'cztery' }, "#4"); + a.deep(it.next(), { done: false, value: 'sześć' }, "#5"); + a.deep(it.next(), { done: true, value: undefined }, "End"); + }, + "Emited #2": function (a) { + var x = ['raz', 'dwa', 'trzy', 'cztery', 'pięć', 'sześć'], y, it; + + y = ee(); + it = new T(x, y); + a.deep(it.next(), { done: false, value: 'raz' }, "#1"); + a.deep(it.next(), { done: false, value: 'dwa' }, "#2"); + x.splice(1, 0, 'półtora'); + y.emit('_add', 1); + x.splice(1, 0, '1.25'); + y.emit('_add', 1); + x.splice(0, 1); + y.emit('_delete', 0); + a.deep(it.next(), { done: false, value: 'półtora' }, "Insert"); + a.deep(it.next(), { done: false, value: '1.25' }, "Insert #2"); + a.deep(it.next(), { done: false, value: 'trzy' }, "#3"); + a.deep(it.next(), { done: false, value: 'cztery' }, "#4"); + x.splice(5, 1); + y.emit('_delete', 5); + a.deep(it.next(), { done: false, value: 'sześć' }, "#5"); + a.deep(it.next(), { done: true, value: undefined }, "End"); + }, + "Emited: Clear #1": function (a) { + var x = ['raz', 'dwa', 'trzy', 'cztery', 'pięć', 'sześć'], y, it; + + y = ee(); + it = new T(x, y); + a.deep(it.next(), { done: false, value: 'raz' }, "#1"); + a.deep(it.next(), { done: false, value: 'dwa' }, "#2"); + x.length = 0; + y.emit('_clear'); + a.deep(it.next(), { done: true, value: undefined }, "End"); + }, + "Emited: Clear #2": function (a) { + var x = ['raz', 'dwa', 'trzy', 'cztery', 'pięć', 'sześć'], y, it; + + y = ee(); + it = new T(x, y); + a.deep(it.next(), { done: false, value: 'raz' }, "#1"); + a.deep(it.next(), { done: false, value: 'dwa' }, "#2"); + x.length = 0; + y.emit('_clear'); + x.push('foo'); + x.push('bar'); + a.deep(it.next(), { done: false, value: 'foo' }, "#3"); + a.deep(it.next(), { done: false, value: 'bar' }, "#4"); + x.splice(1, 0, 'półtora'); + y.emit('_add', 1); + x.splice(1, 0, '1.25'); + y.emit('_add', 1); + x.splice(0, 1); + y.emit('_delete', 0); + a.deep(it.next(), { done: false, value: 'półtora' }, "Insert"); + a.deep(it.next(), { done: false, value: '1.25' }, "Insert #2"); + a.deep(it.next(), { done: true, value: undefined }, "End"); + } + }; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/is-iterable.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/is-iterable.js new file mode 100644 index 00000000..438ad349 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/is-iterable.js @@ -0,0 +1,19 @@ +'use strict'; + +var iteratorSymbol = require('es6-symbol').iterator + , Iterator = require('../'); + +module.exports = function (t, a) { + var iterator; + a(t(), false, "Undefined"); + a(t(123), false, "Number"); + a(t({}), false, "Plain object"); + a(t({ length: 0 }), false, "Array-like"); + iterator = {}; + iterator[iteratorSymbol] = function () { return new Iterator([]); }; + a(t(iterator), true, "Iterator"); + a(t([]), true, "Array"); + a(t('foo'), true, "String"); + a(t(''), true, "Empty string"); + a(t((function () { return arguments; }())), true, "Arguments"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/string.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/string.js new file mode 100644 index 00000000..d11855f2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/string.js @@ -0,0 +1,23 @@ +'use strict'; + +var iteratorSymbol = require('es6-symbol').iterator; + +module.exports = function (T, a) { + var it = new T('foobar'); + + a(it[iteratorSymbol](), it, "@@iterator"); + a.deep(it.next(), { done: false, value: 'f' }, "#1"); + a.deep(it.next(), { done: false, value: 'o' }, "#2"); + a.deep(it.next(), { done: false, value: 'o' }, "#3"); + a.deep(it.next(), { done: false, value: 'b' }, "#4"); + a.deep(it.next(), { done: false, value: 'a' }, "#5"); + a.deep(it.next(), { done: false, value: 'r' }, "#6"); + a.deep(it.next(), { done: true, value: undefined }, "End"); + + a.h1("Outside of BMP"); + it = new T('r💩z'); + a.deep(it.next(), { done: false, value: 'r' }, "#1"); + a.deep(it.next(), { done: false, value: '💩' }, "#2"); + a.deep(it.next(), { done: false, value: 'z' }, "#3"); + a.deep(it.next(), { done: true, value: undefined }, "End"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/valid-iterable.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/valid-iterable.js new file mode 100644 index 00000000..a407f1a0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/valid-iterable.js @@ -0,0 +1,18 @@ +'use strict'; + +var iteratorSymbol = require('es6-symbol').iterator + , Iterator = require('../'); + +module.exports = function (t, a) { + var obj; + a.throws(function () { t(); }, TypeError, "Undefined"); + a.throws(function () { t({}); }, TypeError, "Plain object"); + a.throws(function () { t({ length: 0 }); }, TypeError, "Array-like"); + obj = {}; + obj[iteratorSymbol] = function () { return new Iterator([]); }; + a(t(obj), obj, "Iterator"); + obj = []; + a(t(obj), obj, 'Array'); + obj = (function () { return arguments; }()); + a(t(obj), obj, "Arguments"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/valid-iterable.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/valid-iterable.js new file mode 100644 index 00000000..d330997c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/valid-iterable.js @@ -0,0 +1,8 @@ +'use strict'; + +var isIterable = require('./is-iterable'); + +module.exports = function (value) { + if (!isIterable(value)) throw new TypeError(value + " is not iterable"); + return value; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/#/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/#/index.js new file mode 100644 index 00000000..32481170 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/#/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = { + pad: require('./pad') +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/#/pad.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/#/pad.js new file mode 100644 index 00000000..4478f6a1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/#/pad.js @@ -0,0 +1,15 @@ +'use strict'; + +var pad = require('../../string/#/pad') + , toPosInt = require('../to-pos-integer') + + , toFixed = Number.prototype.toFixed; + +module.exports = function (length/*, precision*/) { + var precision; + length = toPosInt(length); + precision = toPosInt(arguments[1]); + + return pad.call(precision ? toFixed.call(this, precision) : this, + '0', length + (precision ? (1 + precision) : 0)); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/epsilon/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/epsilon/implement.js new file mode 100644 index 00000000..f0a670ae --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/epsilon/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(Number, 'EPSILON', { value: require('./'), + configurable: false, enumerable: false, writable: false }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/epsilon/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/epsilon/index.js new file mode 100644 index 00000000..4e4b621b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/epsilon/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = 2.220446049250313e-16; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/epsilon/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/epsilon/is-implemented.js new file mode 100644 index 00000000..141f5d2f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/epsilon/is-implemented.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function () { + return (typeof Number.EPSILON === 'number'); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/index.js new file mode 100644 index 00000000..841b3612 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/index.js @@ -0,0 +1,17 @@ +'use strict'; + +module.exports = { + '#': require('./#'), + EPSILON: require('./epsilon'), + isFinite: require('./is-finite'), + isInteger: require('./is-integer'), + isNaN: require('./is-nan'), + isNatural: require('./is-natural'), + isNumber: require('./is-number'), + isSafeInteger: require('./is-safe-integer'), + MAX_SAFE_INTEGER: require('./max-safe-integer'), + MIN_SAFE_INTEGER: require('./min-safe-integer'), + toInteger: require('./to-integer'), + toPosInteger: require('./to-pos-integer'), + toUint32: require('./to-uint32') +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-finite/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-finite/implement.js new file mode 100644 index 00000000..51d7cac0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-finite/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(Number, 'isFinite', { value: require('./shim'), + configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-finite/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-finite/index.js new file mode 100644 index 00000000..15d5f405 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-finite/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = require('./is-implemented')() + ? Number.isFinite + : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-finite/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-finite/is-implemented.js new file mode 100644 index 00000000..556e396b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-finite/is-implemented.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = function () { + var isFinite = Number.isFinite; + if (typeof isFinite !== 'function') return false; + return !isFinite('23') && isFinite(34) && !isFinite(Infinity); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-finite/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-finite/shim.js new file mode 100644 index 00000000..e3aee551 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-finite/shim.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function (value) { + return (typeof value === 'number') && isFinite(value); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-integer/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-integer/implement.js new file mode 100644 index 00000000..fe53f281 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-integer/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(Number, 'isInteger', { value: require('./shim'), + configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-integer/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-integer/index.js new file mode 100644 index 00000000..55e039a9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-integer/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = require('./is-implemented')() + ? Number.isInteger + : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-integer/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-integer/is-implemented.js new file mode 100644 index 00000000..a0e573be --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-integer/is-implemented.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = function () { + var isInteger = Number.isInteger; + if (typeof isInteger !== 'function') return false; + return !isInteger('23') && isInteger(34) && !isInteger(32.34); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-integer/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-integer/shim.js new file mode 100644 index 00000000..54029398 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-integer/shim.js @@ -0,0 +1,8 @@ +// Credit: http://www.2ality.com/2014/05/is-integer.html + +'use strict'; + +module.exports = function (value) { + if (typeof value !== 'number') return false; + return (value % 1 === 0); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-nan/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-nan/implement.js new file mode 100644 index 00000000..e1c5deea --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-nan/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(Number, 'isNaN', { value: require('./shim'), + configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-nan/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-nan/index.js new file mode 100644 index 00000000..3b2c4ca6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-nan/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = require('./is-implemented')() + ? Number.isNaN + : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-nan/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-nan/is-implemented.js new file mode 100644 index 00000000..4cf27665 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-nan/is-implemented.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = function () { + var isNaN = Number.isNaN; + if (typeof isNaN !== 'function') return false; + return !isNaN({}) && isNaN(NaN) && !isNaN(34); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-nan/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-nan/shim.js new file mode 100644 index 00000000..070d96cd --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-nan/shim.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (value) { return (value !== value); } //jslint: ignore diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-natural.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-natural.js new file mode 100644 index 00000000..831090d2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-natural.js @@ -0,0 +1,5 @@ +'use strict'; + +var isInteger = require('./is-integer'); + +module.exports = function (num) { return isInteger(num) && (num >= 0); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-number.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-number.js new file mode 100644 index 00000000..19a99e4f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-number.js @@ -0,0 +1,11 @@ +'use strict'; + +var toString = Object.prototype.toString + + , id = toString.call(1); + +module.exports = function (x) { + return ((typeof x === 'number') || + ((x instanceof Number) || + ((typeof x === 'object') && (toString.call(x) === id)))); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-safe-integer/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-safe-integer/implement.js new file mode 100644 index 00000000..51cef960 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-safe-integer/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(Number, 'isSafeInteger', { value: require('./shim'), + configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-safe-integer/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-safe-integer/index.js new file mode 100644 index 00000000..49adeaaf --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-safe-integer/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = require('./is-implemented')() + ? Number.isSafeInteger + : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-safe-integer/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-safe-integer/is-implemented.js new file mode 100644 index 00000000..510b60e4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-safe-integer/is-implemented.js @@ -0,0 +1,8 @@ +'use strict'; + +module.exports = function () { + var isSafeInteger = Number.isSafeInteger; + if (typeof isSafeInteger !== 'function') return false; + return !isSafeInteger('23') && isSafeInteger(34232322323) && + !isSafeInteger(9007199254740992); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-safe-integer/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-safe-integer/shim.js new file mode 100644 index 00000000..692acdd6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-safe-integer/shim.js @@ -0,0 +1,11 @@ +'use strict'; + +var isInteger = require('../is-integer/shim') + , maxValue = require('../max-safe-integer') + + , abs = Math.abs; + +module.exports = function (value) { + if (!isInteger(value)) return false; + return abs(value) <= maxValue; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/max-safe-integer/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/max-safe-integer/implement.js new file mode 100644 index 00000000..4e0bb574 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/max-safe-integer/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(Number, 'MAX_SAFE_INTEGER', { value: require('./'), + configurable: false, enumerable: false, writable: false }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/max-safe-integer/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/max-safe-integer/index.js new file mode 100644 index 00000000..ed5d6a53 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/max-safe-integer/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = Math.pow(2, 53) - 1; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/max-safe-integer/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/max-safe-integer/is-implemented.js new file mode 100644 index 00000000..7bd08a9d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/max-safe-integer/is-implemented.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function () { + return (typeof Number.MAX_SAFE_INTEGER === 'number'); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/min-safe-integer/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/min-safe-integer/implement.js new file mode 100644 index 00000000..e3f110e4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/min-safe-integer/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(Number, 'MIN_SAFE_INTEGER', { value: require('./'), + configurable: false, enumerable: false, writable: false }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/min-safe-integer/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/min-safe-integer/index.js new file mode 100644 index 00000000..1c6cc274 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/min-safe-integer/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = -(Math.pow(2, 53) - 1); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/min-safe-integer/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/min-safe-integer/is-implemented.js new file mode 100644 index 00000000..efc9875f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/min-safe-integer/is-implemented.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function () { + return (typeof Number.MIN_SAFE_INTEGER === 'number'); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/to-integer.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/to-integer.js new file mode 100644 index 00000000..60e798c5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/to-integer.js @@ -0,0 +1,12 @@ +'use strict'; + +var sign = require('../math/sign') + + , abs = Math.abs, floor = Math.floor; + +module.exports = function (value) { + if (isNaN(value)) return 0; + value = Number(value); + if ((value === 0) || !isFinite(value)) return value; + return sign(value) * floor(abs(value)); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/to-pos-integer.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/to-pos-integer.js new file mode 100644 index 00000000..605a302c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/to-pos-integer.js @@ -0,0 +1,7 @@ +'use strict'; + +var toInteger = require('./to-integer') + + , max = Math.max; + +module.exports = function (value) { return max(0, toInteger(value)); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/to-uint32.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/to-uint32.js new file mode 100644 index 00000000..6263e85e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/to-uint32.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (value) { return value >>> 0; }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/_iterate.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/_iterate.js new file mode 100644 index 00000000..1ccbaf27 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/_iterate.js @@ -0,0 +1,29 @@ +// Internal method, used by iteration functions. +// Calls a function for each key-value pair found in object +// Optionally takes compareFn to iterate object in specific order + +'use strict'; + +var callable = require('./valid-callable') + , value = require('./valid-value') + + , bind = Function.prototype.bind, call = Function.prototype.call, keys = Object.keys + , propertyIsEnumerable = Object.prototype.propertyIsEnumerable; + +module.exports = function (method, defVal) { + return function (obj, cb/*, thisArg, compareFn*/) { + var list, thisArg = arguments[2], compareFn = arguments[3]; + obj = Object(value(obj)); + callable(cb); + + list = keys(obj); + if (compareFn) { + list.sort((typeof compareFn === 'function') ? bind.call(compareFn, obj) : undefined); + } + if (typeof method !== 'function') method = list[method]; + return call.call(method, list, function (key, index) { + if (!propertyIsEnumerable.call(obj, key)) return defVal; + return call.call(cb, thisArg, obj[key], key, obj, index); + }); + }; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/assign/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/assign/implement.js new file mode 100644 index 00000000..3bcc68e3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/assign/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(Object, 'assign', { value: require('./shim'), + configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/assign/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/assign/index.js new file mode 100644 index 00000000..ab0f9f24 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/assign/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = require('./is-implemented')() + ? Object.assign + : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/assign/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/assign/is-implemented.js new file mode 100644 index 00000000..579ad2dd --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/assign/is-implemented.js @@ -0,0 +1,9 @@ +'use strict'; + +module.exports = function () { + var assign = Object.assign, obj; + if (typeof assign !== 'function') return false; + obj = { foo: 'raz' }; + assign(obj, { bar: 'dwa' }, { trzy: 'trzy' }); + return (obj.foo + obj.bar + obj.trzy) === 'razdwatrzy'; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/assign/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/assign/shim.js new file mode 100644 index 00000000..74da11a8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/assign/shim.js @@ -0,0 +1,22 @@ +'use strict'; + +var keys = require('../keys') + , value = require('../valid-value') + + , max = Math.max; + +module.exports = function (dest, src/*, …srcn*/) { + var error, i, l = max(arguments.length, 2), assign; + dest = Object(value(dest)); + assign = function (key) { + try { dest[key] = src[key]; } catch (e) { + if (!error) error = e; + } + }; + for (i = 1; i < l; ++i) { + src = arguments[i]; + keys(src).forEach(assign); + } + if (error !== undefined) throw error; + return dest; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/clear.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/clear.js new file mode 100644 index 00000000..85e46372 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/clear.js @@ -0,0 +1,16 @@ +'use strict'; + +var keys = require('./keys'); + +module.exports = function (obj) { + var error; + keys(obj).forEach(function (key) { + try { + delete this[key]; + } catch (e) { + if (!error) error = e; + } + }, obj); + if (error !== undefined) throw error; + return obj; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/compact.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/compact.js new file mode 100644 index 00000000..d021da45 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/compact.js @@ -0,0 +1,7 @@ +'use strict'; + +var filter = require('./filter'); + +module.exports = function (obj) { + return filter(obj, function (val) { return val != null; }); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/compare.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/compare.js new file mode 100644 index 00000000..2ab11f1a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/compare.js @@ -0,0 +1,42 @@ +'use strict'; + +var strCompare = require('../string/#/case-insensitive-compare') + , isObject = require('./is-object') + + , resolve, typeMap; + +typeMap = { + undefined: 0, + object: 1, + boolean: 2, + string: 3, + number: 4 +}; + +resolve = function (a) { + if (isObject(a)) { + if (typeof a.valueOf !== 'function') return NaN; + a = a.valueOf(); + if (isObject(a)) { + if (typeof a.toString !== 'function') return NaN; + a = a.toString(); + if (typeof a !== 'string') return NaN; + } + } + return a; +}; + +module.exports = function (a, b) { + if (a === b) return 0; // Same + + a = resolve(a); + b = resolve(b); + if (a == b) return typeMap[typeof a] - typeMap[typeof b]; //jslint: ignore + if (a == null) return -1; + if (b == null) return 1; + if ((typeof a === 'string') || (typeof b === 'string')) { + return strCompare.call(a, b); + } + if ((a !== a) && (b !== b)) return 0; //jslint: ignore + return Number(a) - Number(b); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/copy-deep.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/copy-deep.js new file mode 100644 index 00000000..b203a7c6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/copy-deep.js @@ -0,0 +1,38 @@ +'use strict'; + +var forEach = require('./for-each') + , isPlainObject = require('./is-plain-object') + , value = require('./valid-value') + + , isArray = Array.isArray + , copy, copyItem; + +copyItem = function (value, key) { + var index; + if (!isPlainObject(value) && !isArray(value)) return value; + index = this[0].indexOf(value); + if (index === -1) return copy.call(this, value); + return this[1][index]; +}; + +copy = function (source) { + var target = isArray(source) ? [] : {}; + this[0].push(source); + this[1].push(target); + if (isArray(source)) { + source.forEach(function (value, key) { + target[key] = copyItem.call(this, value, key); + }, this); + } else { + forEach(source, function (value, key) { + target[key] = copyItem.call(this, value, key); + }, this); + } + return target; +}; + +module.exports = function (source) { + var obj = Object(value(source)); + if (obj !== source) return obj; + return copy.call([[], []], obj); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/copy.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/copy.js new file mode 100644 index 00000000..4d717728 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/copy.js @@ -0,0 +1,10 @@ +'use strict'; + +var assign = require('./assign') + , value = require('./valid-value'); + +module.exports = function (obj) { + var copy = Object(value(obj)); + if (copy !== obj) return copy; + return assign({}, obj); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/count.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/count.js new file mode 100644 index 00000000..29cfbb53 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/count.js @@ -0,0 +1,5 @@ +'use strict'; + +var keys = require('./keys'); + +module.exports = function (obj) { return keys(obj).length; }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/create.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/create.js new file mode 100644 index 00000000..f813b466 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/create.js @@ -0,0 +1,36 @@ +// Workaround for http://code.google.com/p/v8/issues/detail?id=2804 + +'use strict'; + +var create = Object.create, shim; + +if (!require('./set-prototype-of/is-implemented')()) { + shim = require('./set-prototype-of/shim'); +} + +module.exports = (function () { + var nullObject, props, desc; + if (!shim) return create; + if (shim.level !== 1) return create; + + nullObject = {}; + props = {}; + desc = { configurable: false, enumerable: false, writable: true, + value: undefined }; + Object.getOwnPropertyNames(Object.prototype).forEach(function (name) { + if (name === '__proto__') { + props[name] = { configurable: true, enumerable: false, writable: true, + value: undefined }; + return; + } + props[name] = desc; + }); + Object.defineProperties(nullObject, props); + + Object.defineProperty(shim, 'nullPolyfill', { configurable: false, + enumerable: false, writable: false, value: nullObject }); + + return function (prototype, props) { + return create((prototype === null) ? nullObject : prototype, props); + }; +}()); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/ensure-natural-number-value.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/ensure-natural-number-value.js new file mode 100644 index 00000000..f58fb4e4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/ensure-natural-number-value.js @@ -0,0 +1,8 @@ +'use strict'; + +var ensure = require('./ensure-natural-number'); + +module.exports = function (arg) { + if (arg == null) throw new TypeError(arg + " is not a natural number"); + return ensure(arg); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/ensure-natural-number.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/ensure-natural-number.js new file mode 100644 index 00000000..af9b4d77 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/ensure-natural-number.js @@ -0,0 +1,9 @@ +'use strict'; + +var isNatural = require('../number/is-natural'); + +module.exports = function (arg) { + var num = Number(arg); + if (!isNatural(num)) throw new TypeError(arg + " is not a natural number"); + return num; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/eq.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/eq.js new file mode 100644 index 00000000..037937ea --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/eq.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function (x, y) { + return ((x === y) || ((x !== x) && (y !== y))); //jslint: ignore +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/every.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/every.js new file mode 100644 index 00000000..1303db20 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/every.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./_iterate')('every', true); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/filter.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/filter.js new file mode 100644 index 00000000..e5edb49b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/filter.js @@ -0,0 +1,15 @@ +'use strict'; + +var callable = require('./valid-callable') + , forEach = require('./for-each') + + , call = Function.prototype.call; + +module.exports = function (obj, cb/*, thisArg*/) { + var o = {}, thisArg = arguments[2]; + callable(cb); + forEach(obj, function (value, key, obj, index) { + if (call.call(cb, thisArg, value, key, obj, index)) o[key] = obj[key]; + }); + return o; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/find-key.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/find-key.js new file mode 100644 index 00000000..5841fd70 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/find-key.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./_iterate')(require('../array/#/find'), false); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/find.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/find.js new file mode 100644 index 00000000..c94f643f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/find.js @@ -0,0 +1,8 @@ +'use strict'; + +var findKey = require('./find-key'); + +module.exports = function (obj, cb/*, thisArg, compareFn*/) { + var key = findKey.apply(this, arguments); + return (key == null) ? key : obj[key]; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/first-key.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/first-key.js new file mode 100644 index 00000000..7df10b2f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/first-key.js @@ -0,0 +1,14 @@ +'use strict'; + +var value = require('./valid-value') + + , propertyIsEnumerable = Object.prototype.propertyIsEnumerable; + +module.exports = function (obj) { + var i; + value(obj); + for (i in obj) { + if (propertyIsEnumerable.call(obj, i)) return i; + } + return null; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/flatten.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/flatten.js new file mode 100644 index 00000000..e8b40444 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/flatten.js @@ -0,0 +1,17 @@ +'use strict'; + +var isPlainObject = require('./is-plain-object') + , forEach = require('./for-each') + + , process; + +process = function self(value, key) { + if (isPlainObject(value)) forEach(value, self, this); + else this[key] = value; +}; + +module.exports = function (obj) { + var flattened = {}; + forEach(obj, process, flattened); + return flattened; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/for-each.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/for-each.js new file mode 100644 index 00000000..6674f8a6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/for-each.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./_iterate')('forEach'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/get-property-names.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/get-property-names.js new file mode 100644 index 00000000..54a01e50 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/get-property-names.js @@ -0,0 +1,18 @@ +'use strict'; + +var uniq = require('../array/#/uniq') + , value = require('./valid-value') + + , push = Array.prototype.push + , getOwnPropertyNames = Object.getOwnPropertyNames + , getPrototypeOf = Object.getPrototypeOf; + +module.exports = function (obj) { + var keys; + obj = Object(value(obj)); + keys = getOwnPropertyNames(obj); + while ((obj = getPrototypeOf(obj))) { + push.apply(keys, getOwnPropertyNames(obj)); + } + return uniq.call(keys); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/index.js new file mode 100644 index 00000000..77f5b6ae --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/index.js @@ -0,0 +1,53 @@ +'use strict'; + +module.exports = { + assign: require('./assign'), + clear: require('./clear'), + compact: require('./compact'), + compare: require('./compare'), + copy: require('./copy'), + copyDeep: require('./copy-deep'), + count: require('./count'), + create: require('./create'), + ensureNaturalNumber: require('./ensure-natural-number'), + ensureNaturalNumberValue: require('./ensure-natural-number-value'), + eq: require('./eq'), + every: require('./every'), + filter: require('./filter'), + find: require('./find'), + findKey: require('./find-key'), + firstKey: require('./first-key'), + flatten: require('./flatten'), + forEach: require('./for-each'), + getPropertyNames: require('./get-property-names'), + is: require('./is'), + isArrayLike: require('./is-array-like'), + isCallable: require('./is-callable'), + isCopy: require('./is-copy'), + isCopyDeep: require('./is-copy-deep'), + isEmpty: require('./is-empty'), + isNumberValue: require('./is-number-value'), + isObject: require('./is-object'), + isPlainObject: require('./is-plain-object'), + keyOf: require('./key-of'), + keys: require('./keys'), + map: require('./map'), + mapKeys: require('./map-keys'), + normalizeOptions: require('./normalize-options'), + mixin: require('./mixin'), + mixinPrototypes: require('./mixin-prototypes'), + primitiveSet: require('./primitive-set'), + safeTraverse: require('./safe-traverse'), + serialize: require('./serialize'), + setPrototypeOf: require('./set-prototype-of'), + some: require('./some'), + toArray: require('./to-array'), + unserialize: require('./unserialize'), + validateArrayLike: require('./validate-array-like'), + validateArrayLikeObject: require('./validate-array-like-object'), + validCallable: require('./valid-callable'), + validObject: require('./valid-object'), + validateStringifiable: require('./validate-stringifiable'), + validateStringifiableValue: require('./validate-stringifiable-value'), + validValue: require('./valid-value') +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is-array-like.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is-array-like.js new file mode 100644 index 00000000..b8beed22 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is-array-like.js @@ -0,0 +1,14 @@ +'use strict'; + +var isFunction = require('../function/is-function') + , isObject = require('./is-object'); + +module.exports = function (x) { + return ((x != null) && (typeof x.length === 'number') && + + // Just checking ((typeof x === 'object') && (typeof x !== 'function')) + // won't work right for some cases, e.g.: + // type of instance of NodeList in Safari is a 'function' + + ((isObject(x) && !isFunction(x)) || (typeof x === "string"))) || false; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is-callable.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is-callable.js new file mode 100644 index 00000000..5d5d4b31 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is-callable.js @@ -0,0 +1,5 @@ +// Deprecated + +'use strict'; + +module.exports = function (obj) { return typeof obj === 'function'; }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is-copy-deep.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is-copy-deep.js new file mode 100644 index 00000000..c4b2b42b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is-copy-deep.js @@ -0,0 +1,58 @@ +'use strict'; + +var eq = require('./eq') + , isPlainObject = require('./is-plain-object') + , value = require('./valid-value') + + , isArray = Array.isArray, keys = Object.keys + , propertyIsEnumerable = Object.prototype.propertyIsEnumerable + + , eqArr, eqVal, eqObj; + +eqArr = function (a, b, recMap) { + var i, l = a.length; + if (l !== b.length) return false; + for (i = 0; i < l; ++i) { + if (a.hasOwnProperty(i) !== b.hasOwnProperty(i)) return false; + if (!eqVal(a[i], b[i], recMap)) return false; + } + return true; +}; + +eqObj = function (a, b, recMap) { + var k1 = keys(a), k2 = keys(b); + if (k1.length !== k2.length) return false; + return k1.every(function (key) { + if (!propertyIsEnumerable.call(b, key)) return false; + return eqVal(a[key], b[key], recMap); + }); +}; + +eqVal = function (a, b, recMap) { + var i, eqX, c1, c2; + if (eq(a, b)) return true; + if (isPlainObject(a)) { + if (!isPlainObject(b)) return false; + eqX = eqObj; + } else if (isArray(a) && isArray(b)) { + eqX = eqArr; + } else { + return false; + } + c1 = recMap[0]; + c2 = recMap[1]; + i = c1.indexOf(a); + if (i !== -1) { + if (c2[i].indexOf(b) !== -1) return true; + } else { + i = c1.push(a) - 1; + c2[i] = []; + } + c2[i].push(b); + return eqX(a, b, recMap); +}; + +module.exports = function (a, b) { + if (eq(value(a), value(b))) return true; + return eqVal(Object(a), Object(b), [[], []]); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is-copy.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is-copy.js new file mode 100644 index 00000000..4fe639d4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is-copy.js @@ -0,0 +1,24 @@ +'use strict'; + +var eq = require('./eq') + , value = require('./valid-value') + + , keys = Object.keys + , propertyIsEnumerable = Object.prototype.propertyIsEnumerable; + +module.exports = function (a, b) { + var k1, k2; + + if (eq(value(a), value(b))) return true; + + a = Object(a); + b = Object(b); + + k1 = keys(a); + k2 = keys(b); + if (k1.length !== k2.length) return false; + return k1.every(function (key) { + if (!propertyIsEnumerable.call(b, key)) return false; + return eq(a[key], b[key]); + }); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is-empty.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is-empty.js new file mode 100644 index 00000000..7b51a87c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is-empty.js @@ -0,0 +1,14 @@ +'use strict'; + +var value = require('./valid-value') + + , propertyIsEnumerable = Object.prototype.propertyIsEnumerable; + +module.exports = function (obj) { + var i; + value(obj); + for (i in obj) { //jslint: ignore + if (propertyIsEnumerable.call(obj, i)) return false; + } + return true; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is-number-value.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is-number-value.js new file mode 100644 index 00000000..f6396f58 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is-number-value.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (value) { return (value != null) && !isNaN(value); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is-object.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is-object.js new file mode 100644 index 00000000..a86facf1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is-object.js @@ -0,0 +1,7 @@ +'use strict'; + +var map = { function: true, object: true }; + +module.exports = function (x) { + return ((x != null) && map[typeof x]) || false; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is-plain-object.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is-plain-object.js new file mode 100644 index 00000000..9a282319 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is-plain-object.js @@ -0,0 +1,20 @@ +'use strict'; + +var getPrototypeOf = Object.getPrototypeOf, prototype = Object.prototype + , toString = prototype.toString + + , id = Object().toString(); + +module.exports = function (value) { + var proto, constructor; + if (!value || (typeof value !== 'object') || (toString.call(value) !== id)) { + return false; + } + proto = getPrototypeOf(value); + if (proto === null) { + constructor = value.constructor; + if (typeof constructor !== 'function') return true; + return (constructor.prototype !== value); + } + return (proto === prototype) || (getPrototypeOf(proto) === null); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is.js new file mode 100644 index 00000000..5778b502 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is.js @@ -0,0 +1,10 @@ +// Implementation credits go to: +// http://wiki.ecmascript.org/doku.php?id=harmony:egal + +'use strict'; + +module.exports = function (x, y) { + return (x === y) ? + ((x !== 0) || ((1 / x) === (1 / y))) : + ((x !== x) && (y !== y)); //jslint: ignore +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/key-of.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/key-of.js new file mode 100644 index 00000000..8c44c8d8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/key-of.js @@ -0,0 +1,15 @@ +'use strict'; + +var eq = require('./eq') + , some = require('./some'); + +module.exports = function (obj, searchValue) { + var r; + return some(obj, function (value, name) { + if (eq(value, searchValue)) { + r = name; + return true; + } + return false; + }) ? r : null; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/keys/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/keys/implement.js new file mode 100644 index 00000000..c6872bd0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/keys/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(Object, 'keys', { value: require('./shim'), + configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/keys/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/keys/index.js new file mode 100644 index 00000000..5ef05223 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/keys/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = require('./is-implemented')() + ? Object.keys + : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/keys/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/keys/is-implemented.js new file mode 100644 index 00000000..40c32c33 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/keys/is-implemented.js @@ -0,0 +1,8 @@ +'use strict'; + +module.exports = function () { + try { + Object.keys('primitive'); + return true; + } catch (e) { return false; } +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/keys/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/keys/shim.js new file mode 100644 index 00000000..034b6b29 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/keys/shim.js @@ -0,0 +1,7 @@ +'use strict'; + +var keys = Object.keys; + +module.exports = function (object) { + return keys(object == null ? object : Object(object)); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/map-keys.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/map-keys.js new file mode 100644 index 00000000..26f0ecac --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/map-keys.js @@ -0,0 +1,15 @@ +'use strict'; + +var callable = require('./valid-callable') + , forEach = require('./for-each') + + , call = Function.prototype.call; + +module.exports = function (obj, cb/*, thisArg*/) { + var o = {}, thisArg = arguments[2]; + callable(cb); + forEach(obj, function (value, key, obj, index) { + o[call.call(cb, thisArg, key, value, this, index)] = value; + }, obj); + return o; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/map.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/map.js new file mode 100644 index 00000000..6b39d3c9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/map.js @@ -0,0 +1,15 @@ +'use strict'; + +var callable = require('./valid-callable') + , forEach = require('./for-each') + + , call = Function.prototype.call; + +module.exports = function (obj, cb/*, thisArg*/) { + var o = {}, thisArg = arguments[2]; + callable(cb); + forEach(obj, function (value, key, obj, index) { + o[key] = call.call(cb, thisArg, value, key, obj, index); + }); + return o; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/mixin-prototypes.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/mixin-prototypes.js new file mode 100644 index 00000000..1ef57564 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/mixin-prototypes.js @@ -0,0 +1,34 @@ +'use strict'; + +var value = require('./valid-value') + , mixin = require('./mixin') + + , defineProperty = Object.defineProperty + , getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor + , getOwnPropertyNames = Object.getOwnPropertyNames + , getPrototypeOf = Object.getPrototypeOf + , hasOwnProperty = Object.prototype.hasOwnProperty; + +module.exports = function (target, source) { + var error, end, define; + target = Object(value(target)); + source = Object(value(source)); + end = getPrototypeOf(target); + if (source === end) return target; + try { + mixin(target, source); + } catch (e) { error = e; } + source = getPrototypeOf(source); + define = function (name) { + if (hasOwnProperty.call(target, name)) return; + try { + defineProperty(target, name, getOwnPropertyDescriptor(source, name)); + } catch (e) { error = e; } + }; + while (source && (source !== end)) { + getOwnPropertyNames(source).forEach(define); + source = getPrototypeOf(source); + } + if (error) throw error; + return target; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/mixin.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/mixin.js new file mode 100644 index 00000000..488523ee --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/mixin.js @@ -0,0 +1,27 @@ +'use strict'; + +var value = require('./valid-value') + + , defineProperty = Object.defineProperty + , getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor + , getOwnPropertyNames = Object.getOwnPropertyNames + , getOwnPropertySymbols = Object.getOwnPropertySymbols; + +module.exports = function (target, source) { + var error, sourceObject = Object(value(source)); + target = Object(value(target)); + getOwnPropertyNames(sourceObject).forEach(function (name) { + try { + defineProperty(target, name, getOwnPropertyDescriptor(source, name)); + } catch (e) { error = e; } + }); + if (typeof getOwnPropertySymbols === 'function') { + getOwnPropertySymbols(sourceObject).forEach(function (symbol) { + try { + defineProperty(target, symbol, getOwnPropertyDescriptor(source, symbol)); + } catch (e) { error = e; } + }); + } + if (error !== undefined) throw error; + return target; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/normalize-options.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/normalize-options.js new file mode 100644 index 00000000..cf8ed8d3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/normalize-options.js @@ -0,0 +1,17 @@ +'use strict'; + +var forEach = Array.prototype.forEach, create = Object.create; + +var process = function (src, obj) { + var key; + for (key in src) obj[key] = src[key]; +}; + +module.exports = function (options/*, …options*/) { + var result = create(null); + forEach.call(arguments, function (options) { + if (options == null) return; + process(Object(options), result); + }); + return result; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/primitive-set.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/primitive-set.js new file mode 100644 index 00000000..ada10951 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/primitive-set.js @@ -0,0 +1,9 @@ +'use strict'; + +var forEach = Array.prototype.forEach, create = Object.create; + +module.exports = function (arg/*, …args*/) { + var set = create(null); + forEach.call(arguments, function (name) { set[name] = true; }); + return set; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/safe-traverse.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/safe-traverse.js new file mode 100644 index 00000000..7e1b5f41 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/safe-traverse.js @@ -0,0 +1,15 @@ +'use strict'; + +var value = require('./valid-value'); + +module.exports = function (obj/*, …names*/) { + var length, current = 1; + value(obj); + length = arguments.length - 1; + if (!length) return obj; + while (current < length) { + obj = obj[arguments[current++]]; + if (obj == null) return undefined; + } + return obj[arguments[current]]; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/serialize.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/serialize.js new file mode 100644 index 00000000..8113b680 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/serialize.js @@ -0,0 +1,36 @@ +'use strict'; + +var toArray = require('./to-array') + , isDate = require('../date/is-date') + , isRegExp = require('../reg-exp/is-reg-exp') + + , isArray = Array.isArray, stringify = JSON.stringify + , keyValueToString = function (value, key) { return stringify(key) + ':' + exports(value); }; + +var sparseMap = function (arr) { + var i, l = arr.length, result = new Array(l); + for (i = 0; i < l; ++i) { + if (!arr.hasOwnProperty(i)) continue; + result[i] = exports(arr[i]); + } + return result; +}; + +module.exports = exports = function (obj) { + if (obj == null) return String(obj); + switch (typeof obj) { + case 'string': + return stringify(obj); + case 'number': + case 'boolean': + case 'function': + return String(obj); + case 'object': + if (isArray(obj)) return '[' + sparseMap(obj) + ']'; + if (isRegExp(obj)) return String(obj); + if (isDate(obj)) return 'new Date(' + obj.valueOf() + ')'; + return '{' + toArray(obj, keyValueToString) + '}'; + default: + throw new TypeError("Serialization of " + String(obj) + "is unsupported"); + } +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/set-prototype-of/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/set-prototype-of/implement.js new file mode 100644 index 00000000..000e6bdb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/set-prototype-of/implement.js @@ -0,0 +1,8 @@ +'use strict'; + +var shim; + +if (!require('./is-implemented')() && (shim = require('./shim'))) { + Object.defineProperty(Object, 'setPrototypeOf', + { value: shim, configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/set-prototype-of/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/set-prototype-of/index.js new file mode 100644 index 00000000..ccc40995 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/set-prototype-of/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = require('./is-implemented')() + ? Object.setPrototypeOf + : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/set-prototype-of/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/set-prototype-of/is-implemented.js new file mode 100644 index 00000000..98d0c843 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/set-prototype-of/is-implemented.js @@ -0,0 +1,11 @@ +'use strict'; + +var create = Object.create, getPrototypeOf = Object.getPrototypeOf + , x = {}; + +module.exports = function (/*customCreate*/) { + var setPrototypeOf = Object.setPrototypeOf + , customCreate = arguments[0] || create; + if (typeof setPrototypeOf !== 'function') return false; + return getPrototypeOf(setPrototypeOf(customCreate(null), x)) === x; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/set-prototype-of/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/set-prototype-of/shim.js new file mode 100644 index 00000000..4ec94467 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/set-prototype-of/shim.js @@ -0,0 +1,73 @@ +// Big thanks to @WebReflection for sorting this out +// https://gist.github.com/WebReflection/5593554 + +'use strict'; + +var isObject = require('../is-object') + , value = require('../valid-value') + + , isPrototypeOf = Object.prototype.isPrototypeOf + , defineProperty = Object.defineProperty + , nullDesc = { configurable: true, enumerable: false, writable: true, + value: undefined } + , validate; + +validate = function (obj, prototype) { + value(obj); + if ((prototype === null) || isObject(prototype)) return obj; + throw new TypeError('Prototype must be null or an object'); +}; + +module.exports = (function (status) { + var fn, set; + if (!status) return null; + if (status.level === 2) { + if (status.set) { + set = status.set; + fn = function (obj, prototype) { + set.call(validate(obj, prototype), prototype); + return obj; + }; + } else { + fn = function (obj, prototype) { + validate(obj, prototype).__proto__ = prototype; + return obj; + }; + } + } else { + fn = function self(obj, prototype) { + var isNullBase; + validate(obj, prototype); + isNullBase = isPrototypeOf.call(self.nullPolyfill, obj); + if (isNullBase) delete self.nullPolyfill.__proto__; + if (prototype === null) prototype = self.nullPolyfill; + obj.__proto__ = prototype; + if (isNullBase) defineProperty(self.nullPolyfill, '__proto__', nullDesc); + return obj; + }; + } + return Object.defineProperty(fn, 'level', { configurable: false, + enumerable: false, writable: false, value: status.level }); +}((function () { + var x = Object.create(null), y = {}, set + , desc = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__'); + + if (desc) { + try { + set = desc.set; // Opera crashes at this point + set.call(x, y); + } catch (ignore) { } + if (Object.getPrototypeOf(x) === y) return { set: set, level: 2 }; + } + + x.__proto__ = y; + if (Object.getPrototypeOf(x) === y) return { level: 2 }; + + x = {}; + x.__proto__ = y; + if (Object.getPrototypeOf(x) === y) return { level: 1 }; + + return false; +}()))); + +require('../create'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/some.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/some.js new file mode 100644 index 00000000..cde5ddee --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/some.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./_iterate')('some', false); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/to-array.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/to-array.js new file mode 100644 index 00000000..a954abb2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/to-array.js @@ -0,0 +1,18 @@ +'use strict'; + +var callable = require('./valid-callable') + , forEach = require('./for-each') + + , call = Function.prototype.call + + , defaultCb = function (value, key) { return [key, value]; }; + +module.exports = function (obj/*, cb, thisArg, compareFn*/) { + var a = [], cb = arguments[1], thisArg = arguments[2]; + cb = (cb == null) ? defaultCb : callable(cb); + + forEach(obj, function (value, key, obj, index) { + a.push(call.call(cb, thisArg, value, key, this, index)); + }, obj, arguments[3]); + return a; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/unserialize.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/unserialize.js new file mode 100644 index 00000000..ce68e403 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/unserialize.js @@ -0,0 +1,7 @@ +'use strict'; + +var value = require('./valid-value'); + +module.exports = exports = function (code) { + return (new Function('return ' + value(code)))(); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/valid-callable.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/valid-callable.js new file mode 100644 index 00000000..c977527a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/valid-callable.js @@ -0,0 +1,6 @@ +'use strict'; + +module.exports = function (fn) { + if (typeof fn !== 'function') throw new TypeError(fn + " is not a function"); + return fn; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/valid-object.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/valid-object.js new file mode 100644 index 00000000..f82bd51e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/valid-object.js @@ -0,0 +1,8 @@ +'use strict'; + +var isObject = require('./is-object'); + +module.exports = function (value) { + if (!isObject(value)) throw new TypeError(value + " is not an Object"); + return value; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/valid-value.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/valid-value.js new file mode 100644 index 00000000..36c8ec31 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/valid-value.js @@ -0,0 +1,6 @@ +'use strict'; + +module.exports = function (value) { + if (value == null) throw new TypeError("Cannot use null or undefined"); + return value; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/validate-array-like-object.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/validate-array-like-object.js new file mode 100644 index 00000000..89e12c51 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/validate-array-like-object.js @@ -0,0 +1,9 @@ +'use strict'; + +var isArrayLike = require('./is-array-like') + , isObject = require('./is-object'); + +module.exports = function (obj) { + if (isObject(obj) && isArrayLike(obj)) return obj; + throw new TypeError(obj + " is not array-like object"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/validate-array-like.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/validate-array-like.js new file mode 100644 index 00000000..6a35b54a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/validate-array-like.js @@ -0,0 +1,8 @@ +'use strict'; + +var isArrayLike = require('./is-array-like'); + +module.exports = function (obj) { + if (isArrayLike(obj)) return obj; + throw new TypeError(obj + " is not array-like value"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/validate-stringifiable-value.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/validate-stringifiable-value.js new file mode 100644 index 00000000..9df3b668 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/validate-stringifiable-value.js @@ -0,0 +1,6 @@ +'use strict'; + +var value = require('./valid-value') + , stringifiable = require('./validate-stringifiable'); + +module.exports = function (x) { return stringifiable(value(x)); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/validate-stringifiable.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/validate-stringifiable.js new file mode 100644 index 00000000..eba7ce78 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/validate-stringifiable.js @@ -0,0 +1,9 @@ +'use strict'; + +module.exports = function (stringifiable) { + try { + return String(stringifiable); + } catch (e) { + throw new TypeError("Passed argument cannot be stringifed"); + } +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/package.json new file mode 100644 index 00000000..3bf60321 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/package.json @@ -0,0 +1,78 @@ +{ + "name": "es5-ext", + "version": "0.10.12", + "description": "ECMAScript extensions and shims", + "author": { + "name": "Mariusz Nowak", + "email": "medyk@medikoo.com", + "url": "http://www.medikoo.com/" + }, + "keywords": [ + "ecmascript", + "ecmascript5", + "ecmascript6", + "es5", + "es6", + "extensions", + "ext", + "addons", + "extras", + "harmony", + "javascript", + "polyfill", + "shim", + "util", + "utils", + "utilities" + ], + "repository": { + "type": "git", + "url": "git://github.com/medikoo/es5-ext.git" + }, + "dependencies": { + "es6-iterator": "2", + "es6-symbol": "~3.1" + }, + "devDependencies": { + "tad": "~0.2.4", + "xlint": "~0.2.2", + "xlint-jslint-medikoo": "~0.1.4" + }, + "scripts": { + "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream", + "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch", + "test": "node ./node_modules/tad/bin/tad" + }, + "license": "MIT", + "gitHead": "96fddc3a327b3a28b1653af9490e3b905f127fa8", + "bugs": { + "url": "https://github.com/medikoo/es5-ext/issues" + }, + "homepage": "https://github.com/medikoo/es5-ext#readme", + "_id": "es5-ext@0.10.12", + "_shasum": "aa84641d4db76b62abba5e45fd805ecbab140047", + "_from": "es5-ext@>=0.10.11 <0.11.0", + "_npmVersion": "2.15.5", + "_nodeVersion": "4.4.5", + "_npmUser": { + "name": "medikoo", + "email": "medikoo+npm@medikoo.com" + }, + "dist": { + "shasum": "aa84641d4db76b62abba5e45fd805ecbab140047", + "tarball": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.12.tgz" + }, + "maintainers": [ + { + "name": "medikoo", + "email": "medikoo+npm@medikoo.com" + } + ], + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/es5-ext-0.10.12.tgz_1467387765797_0.7073166444897652" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.12.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/index.js new file mode 100644 index 00000000..f7e7a58e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/index.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = { + isSticky: require('./is-sticky'), + isUnicode: require('./is-unicode'), + match: require('./match'), + replace: require('./replace'), + search: require('./search'), + split: require('./split') +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/is-sticky.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/is-sticky.js new file mode 100644 index 00000000..830a481f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/is-sticky.js @@ -0,0 +1,9 @@ +'use strict'; + +var validRegExp = require('../valid-reg-exp') + + , re = /\/[a-xz]*y[a-xz]*$/; + +module.exports = function () { + return Boolean(String(validRegExp(this)).match(re)); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/is-unicode.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/is-unicode.js new file mode 100644 index 00000000..b005f6d9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/is-unicode.js @@ -0,0 +1,9 @@ +'use strict'; + +var validRegExp = require('../valid-reg-exp') + + , re = /\/[a-xz]*u[a-xz]*$/; + +module.exports = function () { + return Boolean(String(validRegExp(this)).match(re)); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/match/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/match/implement.js new file mode 100644 index 00000000..921c9368 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/match/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(RegExp.prototype, 'match', { value: require('./shim'), + configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/match/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/match/index.js new file mode 100644 index 00000000..0534ac3b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/match/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = require('./is-implemented')() + ? RegExp.prototype.match + : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/match/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/match/is-implemented.js new file mode 100644 index 00000000..b7e99643 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/match/is-implemented.js @@ -0,0 +1,8 @@ +'use strict'; + +var re = /foo/; + +module.exports = function () { + if (typeof re.match !== 'function') return false; + return re.match('barfoobar') && !re.match('elo'); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/match/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/match/shim.js new file mode 100644 index 00000000..4f99cf4d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/match/shim.js @@ -0,0 +1,8 @@ +'use strict'; + +var validRegExp = require('../../valid-reg-exp'); + +module.exports = function (string) { + validRegExp(this); + return String(string).match(this); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/replace/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/replace/implement.js new file mode 100644 index 00000000..ad580de8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/replace/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(RegExp.prototype, 'replace', { value: require('./shim'), + configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/replace/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/replace/index.js new file mode 100644 index 00000000..5658177d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/replace/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = require('./is-implemented')() + ? RegExp.prototype.replace + : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/replace/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/replace/is-implemented.js new file mode 100644 index 00000000..1b42d252 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/replace/is-implemented.js @@ -0,0 +1,8 @@ +'use strict'; + +var re = /foo/; + +module.exports = function () { + if (typeof re.replace !== 'function') return false; + return re.replace('foobar', 'mar') === 'marbar'; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/replace/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/replace/shim.js new file mode 100644 index 00000000..c3e6aeba --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/replace/shim.js @@ -0,0 +1,8 @@ +'use strict'; + +var validRegExp = require('../../valid-reg-exp'); + +module.exports = function (string, replaceValue) { + validRegExp(this); + return String(string).replace(this, replaceValue); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/search/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/search/implement.js new file mode 100644 index 00000000..3804f4eb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/search/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(RegExp.prototype, 'search', { value: require('./shim'), + configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/search/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/search/index.js new file mode 100644 index 00000000..67995d4a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/search/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = require('./is-implemented')() + ? RegExp.prototype.search + : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/search/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/search/is-implemented.js new file mode 100644 index 00000000..efba889f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/search/is-implemented.js @@ -0,0 +1,8 @@ +'use strict'; + +var re = /foo/; + +module.exports = function () { + if (typeof re.search !== 'function') return false; + return re.search('barfoo') === 3; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/search/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/search/shim.js new file mode 100644 index 00000000..6d9dcaed --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/search/shim.js @@ -0,0 +1,8 @@ +'use strict'; + +var validRegExp = require('../../valid-reg-exp'); + +module.exports = function (string) { + validRegExp(this); + return String(string).search(this); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/split/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/split/implement.js new file mode 100644 index 00000000..50facb68 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/split/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(RegExp.prototype, 'split', { value: require('./shim'), + configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/split/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/split/index.js new file mode 100644 index 00000000..f101f5af --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/split/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = require('./is-implemented')() + ? RegExp.prototype.split + : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/split/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/split/is-implemented.js new file mode 100644 index 00000000..7244c998 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/split/is-implemented.js @@ -0,0 +1,8 @@ +'use strict'; + +var re = /\|/; + +module.exports = function () { + if (typeof re.split !== 'function') return false; + return re.split('bar|foo')[1] === 'foo'; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/split/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/split/shim.js new file mode 100644 index 00000000..76154e7e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/split/shim.js @@ -0,0 +1,8 @@ +'use strict'; + +var validRegExp = require('../../valid-reg-exp'); + +module.exports = function (string) { + validRegExp(this); + return String(string).split(this); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/sticky/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/sticky/implement.js new file mode 100644 index 00000000..7e8af1db --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/sticky/implement.js @@ -0,0 +1,8 @@ +'use strict'; + +var isSticky = require('../is-sticky'); + +if (!require('./is-implemented')()) { + Object.defineProperty(RegExp.prototype, 'sticky', { configurable: true, + enumerable: false, get: isSticky }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/sticky/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/sticky/is-implemented.js new file mode 100644 index 00000000..e4184ee4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/sticky/is-implemented.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = function () { + var dummyRegExp = /a/; + // We need to do check on instance and not on prototype due to how ES2015 spec evolved: + // https://github.com/tc39/ecma262/issues/262 + // https://github.com/tc39/ecma262/pull/263 + // https://bugs.chromium.org/p/v8/issues/detail?id=4617 + return 'sticky' in dummyRegExp; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/unicode/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/unicode/implement.js new file mode 100644 index 00000000..5a82a4d1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/unicode/implement.js @@ -0,0 +1,8 @@ +'use strict'; + +var isUnicode = require('../is-unicode'); + +if (!require('./is-implemented')()) { + Object.defineProperty(RegExp.prototype, 'unicode', { configurable: true, + enumerable: false, get: isUnicode }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/unicode/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/unicode/is-implemented.js new file mode 100644 index 00000000..3e3a54b6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/unicode/is-implemented.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = function () { + var dummyRegExp = /a/; + // We need to do check on instance and not on prototype due to how ES2015 spec evolved: + // https://github.com/tc39/ecma262/issues/262 + // https://github.com/tc39/ecma262/pull/263 + // https://bugs.chromium.org/p/v8/issues/detail?id=4617 + return 'unicode' in dummyRegExp; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/escape.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/escape.js new file mode 100644 index 00000000..a2363fcf --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/escape.js @@ -0,0 +1,9 @@ +// Thanks to Andrew Clover: +// http://stackoverflow.com/questions/3561493 +// /is-there-a-regexp-escape-function-in-javascript + +'use strict'; + +var re = /[\-\/\\\^$*+?.()|\[\]{}]/g; + +module.exports = function (str) { return String(str).replace(re, '\\$&'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/index.js new file mode 100644 index 00000000..75ea3135 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/index.js @@ -0,0 +1,8 @@ +'use strict'; + +module.exports = { + '#': require('./#'), + escape: require('./escape'), + isRegExp: require('./is-reg-exp'), + validRegExp: require('./valid-reg-exp') +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/is-reg-exp.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/is-reg-exp.js new file mode 100644 index 00000000..6eb12977 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/is-reg-exp.js @@ -0,0 +1,9 @@ +'use strict'; + +var toString = Object.prototype.toString + + , id = toString.call(/a/); + +module.exports = function (x) { + return (x && (x instanceof RegExp || (toString.call(x) === id))) || false; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/valid-reg-exp.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/valid-reg-exp.js new file mode 100644 index 00000000..d3a77641 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/valid-reg-exp.js @@ -0,0 +1,8 @@ +'use strict'; + +var isRegExp = require('./is-reg-exp'); + +module.exports = function (x) { + if (!isRegExp(x)) throw new TypeError(x + " is not a RegExp object"); + return x; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/@@iterator/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/@@iterator/implement.js new file mode 100644 index 00000000..4494d7b6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/@@iterator/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(String.prototype, require('es6-symbol').iterator, + { value: require('./shim'), configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/@@iterator/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/@@iterator/index.js new file mode 100644 index 00000000..22f15e69 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/@@iterator/index.js @@ -0,0 +1,4 @@ +'use strict'; + +module.exports = require('./is-implemented')() + ? String.prototype[require('es6-symbol').iterator] : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/@@iterator/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/@@iterator/is-implemented.js new file mode 100644 index 00000000..f5c462de --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/@@iterator/is-implemented.js @@ -0,0 +1,16 @@ +'use strict'; + +var iteratorSymbol = require('es6-symbol').iterator; + +module.exports = function () { + var str = '🙈f', iterator, result; + if (typeof str[iteratorSymbol] !== 'function') return false; + iterator = str[iteratorSymbol](); + if (!iterator) return false; + if (typeof iterator.next !== 'function') return false; + result = iterator.next(); + if (!result) return false; + if (result.value !== '🙈') return false; + if (result.done !== false) return false; + return true; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/@@iterator/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/@@iterator/shim.js new file mode 100644 index 00000000..0be30292 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/@@iterator/shim.js @@ -0,0 +1,6 @@ +'use strict'; + +var StringIterator = require('es6-iterator/string') + , value = require('../../../object/valid-value'); + +module.exports = function () { return new StringIterator(value(this)); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/at.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/at.js new file mode 100644 index 00000000..77bd251a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/at.js @@ -0,0 +1,33 @@ +// Based on: https://github.com/mathiasbynens/String.prototype.at +// Thanks @mathiasbynens ! + +'use strict'; + +var toInteger = require('../../number/to-integer') + , validValue = require('../../object/valid-value'); + +module.exports = function (pos) { + var str = String(validValue(this)), size = str.length + , cuFirst, cuSecond, nextPos, len; + pos = toInteger(pos); + + // Account for out-of-bounds indices + // The odd lower bound is because the ToInteger operation is + // going to round `n` to `0` for `-1 < n <= 0`. + if (pos <= -1 || pos >= size) return ''; + + // Second half of `ToInteger` + pos = pos | 0; + // Get the first code unit and code unit value + cuFirst = str.charCodeAt(pos); + nextPos = pos + 1; + len = 1; + if ( // check if it’s the start of a surrogate pair + (cuFirst >= 0xD800) && (cuFirst <= 0xDBFF) && // high surrogate + (size > nextPos) // there is a next code unit + ) { + cuSecond = str.charCodeAt(nextPos); + if (cuSecond >= 0xDC00 && cuSecond <= 0xDFFF) len = 2; // low surrogate + } + return str.slice(pos, pos + len); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/camel-to-hyphen.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/camel-to-hyphen.js new file mode 100644 index 00000000..1cb8d127 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/camel-to-hyphen.js @@ -0,0 +1,10 @@ +'use strict'; + +var replace = String.prototype.replace + , re = /([A-Z])/g; + +module.exports = function () { + var str = replace.call(this, re, "-$1").toLowerCase(); + if (str[0] === '-') str = str.slice(1); + return str; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/capitalize.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/capitalize.js new file mode 100644 index 00000000..ed768273 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/capitalize.js @@ -0,0 +1,8 @@ +'use strict'; + +var value = require('../../object/valid-value'); + +module.exports = function () { + var str = String(value(this)); + return str.charAt(0).toUpperCase() + str.slice(1); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/case-insensitive-compare.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/case-insensitive-compare.js new file mode 100644 index 00000000..599cb834 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/case-insensitive-compare.js @@ -0,0 +1,7 @@ +'use strict'; + +var toLowerCase = String.prototype.toLowerCase; + +module.exports = function (other) { + return toLowerCase.call(this).localeCompare(toLowerCase.call(String(other))); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/code-point-at/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/code-point-at/implement.js new file mode 100644 index 00000000..1e7a37bd --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/code-point-at/implement.js @@ -0,0 +1,7 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(String.prototype, 'codePointAt', + { value: require('./shim'), configurable: true, enumerable: false, + writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/code-point-at/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/code-point-at/index.js new file mode 100644 index 00000000..7e91d833 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/code-point-at/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = require('./is-implemented')() + ? String.prototype.codePointAt + : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/code-point-at/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/code-point-at/is-implemented.js new file mode 100644 index 00000000..b2715891 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/code-point-at/is-implemented.js @@ -0,0 +1,8 @@ +'use strict'; + +var str = 'abc\uD834\uDF06def'; + +module.exports = function () { + if (typeof str.codePointAt !== 'function') return false; + return str.codePointAt(3) === 0x1D306; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/code-point-at/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/code-point-at/shim.js new file mode 100644 index 00000000..1c9038b3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/code-point-at/shim.js @@ -0,0 +1,26 @@ +// Based on: https://github.com/mathiasbynens/String.prototype.codePointAt +// Thanks @mathiasbynens ! + +'use strict'; + +var toInteger = require('../../../number/to-integer') + , validValue = require('../../../object/valid-value'); + +module.exports = function (pos) { + var str = String(validValue(this)), l = str.length, first, second; + pos = toInteger(pos); + + // Account for out-of-bounds indices: + if (pos < 0 || pos >= l) return undefined; + + // Get the first code unit + first = str.charCodeAt(pos); + if ((first >= 0xD800) && (first <= 0xDBFF) && (l > pos + 1)) { + second = str.charCodeAt(pos + 1); + if (second >= 0xDC00 && second <= 0xDFFF) { + // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae + return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000; + } + } + return first; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/contains/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/contains/implement.js new file mode 100644 index 00000000..6b7a3c08 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/contains/implement.js @@ -0,0 +1,7 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(String.prototype, 'contains', + { value: require('./shim'), configurable: true, enumerable: false, + writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/contains/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/contains/index.js new file mode 100644 index 00000000..abb3e373 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/contains/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = require('./is-implemented')() + ? String.prototype.contains + : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/contains/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/contains/is-implemented.js new file mode 100644 index 00000000..6f7d4b71 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/contains/is-implemented.js @@ -0,0 +1,8 @@ +'use strict'; + +var str = 'razdwatrzy'; + +module.exports = function () { + if (typeof str.contains !== 'function') return false; + return ((str.contains('dwa') === true) && (str.contains('foo') === false)); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/contains/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/contains/shim.js new file mode 100644 index 00000000..89e39e79 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/contains/shim.js @@ -0,0 +1,7 @@ +'use strict'; + +var indexOf = String.prototype.indexOf; + +module.exports = function (searchString/*, position*/) { + return indexOf.call(this, searchString, arguments[1]) > -1; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/ends-with/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/ends-with/implement.js new file mode 100644 index 00000000..0b09025b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/ends-with/implement.js @@ -0,0 +1,7 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(String.prototype, 'endsWith', + { value: require('./shim'), configurable: true, enumerable: false, + writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/ends-with/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/ends-with/index.js new file mode 100644 index 00000000..d2d94848 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/ends-with/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = require('./is-implemented')() + ? String.prototype.endsWith + : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/ends-with/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/ends-with/is-implemented.js new file mode 100644 index 00000000..f3bb0088 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/ends-with/is-implemented.js @@ -0,0 +1,8 @@ +'use strict'; + +var str = 'razdwatrzy'; + +module.exports = function () { + if (typeof str.endsWith !== 'function') return false; + return ((str.endsWith('trzy') === true) && (str.endsWith('raz') === false)); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/ends-with/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/ends-with/shim.js new file mode 100644 index 00000000..26cbdb13 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/ends-with/shim.js @@ -0,0 +1,16 @@ +'use strict'; + +var toInteger = require('../../../number/to-integer') + , value = require('../../../object/valid-value') + + , min = Math.min, max = Math.max; + +module.exports = function (searchString/*, endPosition*/) { + var self, start, endPos; + self = String(value(this)); + searchString = String(searchString); + endPos = arguments[1]; + start = ((endPos == null) ? self.length : + min(max(toInteger(endPos), 0), self.length)) - searchString.length; + return (start < 0) ? false : (self.indexOf(searchString, start) === start); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/hyphen-to-camel.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/hyphen-to-camel.js new file mode 100644 index 00000000..8928b024 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/hyphen-to-camel.js @@ -0,0 +1,8 @@ +'use strict'; + +var replace = String.prototype.replace + + , re = /-([a-z0-9])/g + , toUpperCase = function (m, a) { return a.toUpperCase(); }; + +module.exports = function () { return replace.call(this, re, toUpperCase); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/indent.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/indent.js new file mode 100644 index 00000000..223bd82b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/indent.js @@ -0,0 +1,12 @@ +'use strict'; + +var repeat = require('./repeat') + + , replace = String.prototype.replace + , re = /(\r\n|[\n\r\u2028\u2029])([\u0000-\u0009\u000b-\uffff]+)/g; + +module.exports = function (indent/*, count*/) { + var count = arguments[1]; + indent = repeat.call(String(indent), (count == null) ? 1 : count); + return indent + replace.call(this, re, '$1' + indent + '$2'); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/index.js new file mode 100644 index 00000000..3efa01c0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/index.js @@ -0,0 +1,22 @@ +'use strict'; + +module.exports = { + '@@iterator': require('./@@iterator'), + at: require('./at'), + camelToHyphen: require('./camel-to-hyphen'), + capitalize: require('./capitalize'), + caseInsensitiveCompare: require('./case-insensitive-compare'), + codePointAt: require('./code-point-at'), + contains: require('./contains'), + hyphenToCamel: require('./hyphen-to-camel'), + endsWith: require('./ends-with'), + indent: require('./indent'), + last: require('./last'), + normalize: require('./normalize'), + pad: require('./pad'), + plainReplace: require('./plain-replace'), + plainReplaceAll: require('./plain-replace-all'), + repeat: require('./repeat'), + startsWith: require('./starts-with'), + uncapitalize: require('./uncapitalize') +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/last.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/last.js new file mode 100644 index 00000000..d5cf46ee --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/last.js @@ -0,0 +1,8 @@ +'use strict'; + +var value = require('../../object/valid-value'); + +module.exports = function () { + var self = String(value(this)), l = self.length; + return l ? self[l - 1] : null; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/normalize/_data.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/normalize/_data.js new file mode 100644 index 00000000..e4e00a32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/normalize/_data.js @@ -0,0 +1,69 @@ +'use strict'; + +module.exports = { 0:{60:[,,{824:8814}],61:[,,{824:8800}],62:[,,{824:8815}],65:[,,{768:192,769:193,770:194,771:195,772:256,774:258,775:550,776:196,777:7842,778:197,780:461,783:512,785:514,803:7840,805:7680,808:260}],66:[,,{775:7682,803:7684,817:7686}],67:[,,{769:262,770:264,775:266,780:268,807:199}],68:[,,{775:7690,780:270,803:7692,807:7696,813:7698,817:7694}],69:[,,{768:200,769:201,770:202,771:7868,772:274,774:276,775:278,776:203,777:7866,780:282,783:516,785:518,803:7864,807:552,808:280,813:7704,816:7706}],70:[,,{775:7710}],71:[,,{769:500,770:284,772:7712,774:286,775:288,780:486,807:290}],72:[,,{770:292,775:7714,776:7718,780:542,803:7716,807:7720,814:7722}],73:[,,{768:204,769:205,770:206,771:296,772:298,774:300,775:304,776:207,777:7880,780:463,783:520,785:522,803:7882,808:302,816:7724}],74:[,,{770:308}],75:[,,{769:7728,780:488,803:7730,807:310,817:7732}],76:[,,{769:313,780:317,803:7734,807:315,813:7740,817:7738}],77:[,,{769:7742,775:7744,803:7746}],78:[,,{768:504,769:323,771:209,775:7748,780:327,803:7750,807:325,813:7754,817:7752}],79:[,,{768:210,769:211,770:212,771:213,772:332,774:334,775:558,776:214,777:7886,779:336,780:465,783:524,785:526,795:416,803:7884,808:490}],80:[,,{769:7764,775:7766}],82:[,,{769:340,775:7768,780:344,783:528,785:530,803:7770,807:342,817:7774}],83:[,,{769:346,770:348,775:7776,780:352,803:7778,806:536,807:350}],84:[,,{775:7786,780:356,803:7788,806:538,807:354,813:7792,817:7790}],85:[,,{768:217,769:218,770:219,771:360,772:362,774:364,776:220,777:7910,778:366,779:368,780:467,783:532,785:534,795:431,803:7908,804:7794,808:370,813:7798,816:7796}],86:[,,{771:7804,803:7806}],87:[,,{768:7808,769:7810,770:372,775:7814,776:7812,803:7816}],88:[,,{775:7818,776:7820}],89:[,,{768:7922,769:221,770:374,771:7928,772:562,775:7822,776:376,777:7926,803:7924}],90:[,,{769:377,770:7824,775:379,780:381,803:7826,817:7828}],97:[,,{768:224,769:225,770:226,771:227,772:257,774:259,775:551,776:228,777:7843,778:229,780:462,783:513,785:515,803:7841,805:7681,808:261}],98:[,,{775:7683,803:7685,817:7687}],99:[,,{769:263,770:265,775:267,780:269,807:231}],100:[,,{775:7691,780:271,803:7693,807:7697,813:7699,817:7695}],101:[,,{768:232,769:233,770:234,771:7869,772:275,774:277,775:279,776:235,777:7867,780:283,783:517,785:519,803:7865,807:553,808:281,813:7705,816:7707}],102:[,,{775:7711}],103:[,,{769:501,770:285,772:7713,774:287,775:289,780:487,807:291}],104:[,,{770:293,775:7715,776:7719,780:543,803:7717,807:7721,814:7723,817:7830}],105:[,,{768:236,769:237,770:238,771:297,772:299,774:301,776:239,777:7881,780:464,783:521,785:523,803:7883,808:303,816:7725}],106:[,,{770:309,780:496}],107:[,,{769:7729,780:489,803:7731,807:311,817:7733}],108:[,,{769:314,780:318,803:7735,807:316,813:7741,817:7739}],109:[,,{769:7743,775:7745,803:7747}],110:[,,{768:505,769:324,771:241,775:7749,780:328,803:7751,807:326,813:7755,817:7753}],111:[,,{768:242,769:243,770:244,771:245,772:333,774:335,775:559,776:246,777:7887,779:337,780:466,783:525,785:527,795:417,803:7885,808:491}],112:[,,{769:7765,775:7767}],114:[,,{769:341,775:7769,780:345,783:529,785:531,803:7771,807:343,817:7775}],115:[,,{769:347,770:349,775:7777,780:353,803:7779,806:537,807:351}],116:[,,{775:7787,776:7831,780:357,803:7789,806:539,807:355,813:7793,817:7791}],117:[,,{768:249,769:250,770:251,771:361,772:363,774:365,776:252,777:7911,778:367,779:369,780:468,783:533,785:535,795:432,803:7909,804:7795,808:371,813:7799,816:7797}],118:[,,{771:7805,803:7807}],119:[,,{768:7809,769:7811,770:373,775:7815,776:7813,778:7832,803:7817}],120:[,,{775:7819,776:7821}],121:[,,{768:7923,769:253,770:375,771:7929,772:563,775:7823,776:255,777:7927,778:7833,803:7925}],122:[,,{769:378,770:7825,775:380,780:382,803:7827,817:7829}],160:[[32],256],168:[[32,776],256,{768:8173,769:901,834:8129}],170:[[97],256],175:[[32,772],256],178:[[50],256],179:[[51],256],180:[[32,769],256],181:[[956],256],184:[[32,807],256],185:[[49],256],186:[[111],256],188:[[49,8260,52],256],189:[[49,8260,50],256],190:[[51,8260,52],256],192:[[65,768]],193:[[65,769]],194:[[65,770],,{768:7846,769:7844,771:7850,777:7848}],195:[[65,771]],196:[[65,776],,{772:478}],197:[[65,778],,{769:506}],198:[,,{769:508,772:482}],199:[[67,807],,{769:7688}],200:[[69,768]],201:[[69,769]],202:[[69,770],,{768:7872,769:7870,771:7876,777:7874}],203:[[69,776]],204:[[73,768]],205:[[73,769]],206:[[73,770]],207:[[73,776],,{769:7726}],209:[[78,771]],210:[[79,768]],211:[[79,769]],212:[[79,770],,{768:7890,769:7888,771:7894,777:7892}],213:[[79,771],,{769:7756,772:556,776:7758}],214:[[79,776],,{772:554}],216:[,,{769:510}],217:[[85,768]],218:[[85,769]],219:[[85,770]],220:[[85,776],,{768:475,769:471,772:469,780:473}],221:[[89,769]],224:[[97,768]],225:[[97,769]],226:[[97,770],,{768:7847,769:7845,771:7851,777:7849}],227:[[97,771]],228:[[97,776],,{772:479}],229:[[97,778],,{769:507}],230:[,,{769:509,772:483}],231:[[99,807],,{769:7689}],232:[[101,768]],233:[[101,769]],234:[[101,770],,{768:7873,769:7871,771:7877,777:7875}],235:[[101,776]],236:[[105,768]],237:[[105,769]],238:[[105,770]],239:[[105,776],,{769:7727}],241:[[110,771]],242:[[111,768]],243:[[111,769]],244:[[111,770],,{768:7891,769:7889,771:7895,777:7893}],245:[[111,771],,{769:7757,772:557,776:7759}],246:[[111,776],,{772:555}],248:[,,{769:511}],249:[[117,768]],250:[[117,769]],251:[[117,770]],252:[[117,776],,{768:476,769:472,772:470,780:474}],253:[[121,769]],255:[[121,776]]}, + 256:{256:[[65,772]],257:[[97,772]],258:[[65,774],,{768:7856,769:7854,771:7860,777:7858}],259:[[97,774],,{768:7857,769:7855,771:7861,777:7859}],260:[[65,808]],261:[[97,808]],262:[[67,769]],263:[[99,769]],264:[[67,770]],265:[[99,770]],266:[[67,775]],267:[[99,775]],268:[[67,780]],269:[[99,780]],270:[[68,780]],271:[[100,780]],274:[[69,772],,{768:7700,769:7702}],275:[[101,772],,{768:7701,769:7703}],276:[[69,774]],277:[[101,774]],278:[[69,775]],279:[[101,775]],280:[[69,808]],281:[[101,808]],282:[[69,780]],283:[[101,780]],284:[[71,770]],285:[[103,770]],286:[[71,774]],287:[[103,774]],288:[[71,775]],289:[[103,775]],290:[[71,807]],291:[[103,807]],292:[[72,770]],293:[[104,770]],296:[[73,771]],297:[[105,771]],298:[[73,772]],299:[[105,772]],300:[[73,774]],301:[[105,774]],302:[[73,808]],303:[[105,808]],304:[[73,775]],306:[[73,74],256],307:[[105,106],256],308:[[74,770]],309:[[106,770]],310:[[75,807]],311:[[107,807]],313:[[76,769]],314:[[108,769]],315:[[76,807]],316:[[108,807]],317:[[76,780]],318:[[108,780]],319:[[76,183],256],320:[[108,183],256],323:[[78,769]],324:[[110,769]],325:[[78,807]],326:[[110,807]],327:[[78,780]],328:[[110,780]],329:[[700,110],256],332:[[79,772],,{768:7760,769:7762}],333:[[111,772],,{768:7761,769:7763}],334:[[79,774]],335:[[111,774]],336:[[79,779]],337:[[111,779]],340:[[82,769]],341:[[114,769]],342:[[82,807]],343:[[114,807]],344:[[82,780]],345:[[114,780]],346:[[83,769],,{775:7780}],347:[[115,769],,{775:7781}],348:[[83,770]],349:[[115,770]],350:[[83,807]],351:[[115,807]],352:[[83,780],,{775:7782}],353:[[115,780],,{775:7783}],354:[[84,807]],355:[[116,807]],356:[[84,780]],357:[[116,780]],360:[[85,771],,{769:7800}],361:[[117,771],,{769:7801}],362:[[85,772],,{776:7802}],363:[[117,772],,{776:7803}],364:[[85,774]],365:[[117,774]],366:[[85,778]],367:[[117,778]],368:[[85,779]],369:[[117,779]],370:[[85,808]],371:[[117,808]],372:[[87,770]],373:[[119,770]],374:[[89,770]],375:[[121,770]],376:[[89,776]],377:[[90,769]],378:[[122,769]],379:[[90,775]],380:[[122,775]],381:[[90,780]],382:[[122,780]],383:[[115],256,{775:7835}],416:[[79,795],,{768:7900,769:7898,771:7904,777:7902,803:7906}],417:[[111,795],,{768:7901,769:7899,771:7905,777:7903,803:7907}],431:[[85,795],,{768:7914,769:7912,771:7918,777:7916,803:7920}],432:[[117,795],,{768:7915,769:7913,771:7919,777:7917,803:7921}],439:[,,{780:494}],452:[[68,381],256],453:[[68,382],256],454:[[100,382],256],455:[[76,74],256],456:[[76,106],256],457:[[108,106],256],458:[[78,74],256],459:[[78,106],256],460:[[110,106],256],461:[[65,780]],462:[[97,780]],463:[[73,780]],464:[[105,780]],465:[[79,780]],466:[[111,780]],467:[[85,780]],468:[[117,780]],469:[[220,772]],470:[[252,772]],471:[[220,769]],472:[[252,769]],473:[[220,780]],474:[[252,780]],475:[[220,768]],476:[[252,768]],478:[[196,772]],479:[[228,772]],480:[[550,772]],481:[[551,772]],482:[[198,772]],483:[[230,772]],486:[[71,780]],487:[[103,780]],488:[[75,780]],489:[[107,780]],490:[[79,808],,{772:492}],491:[[111,808],,{772:493}],492:[[490,772]],493:[[491,772]],494:[[439,780]],495:[[658,780]],496:[[106,780]],497:[[68,90],256],498:[[68,122],256],499:[[100,122],256],500:[[71,769]],501:[[103,769]],504:[[78,768]],505:[[110,768]],506:[[197,769]],507:[[229,769]],508:[[198,769]],509:[[230,769]],510:[[216,769]],511:[[248,769]],66045:[,220]}, + 512:{512:[[65,783]],513:[[97,783]],514:[[65,785]],515:[[97,785]],516:[[69,783]],517:[[101,783]],518:[[69,785]],519:[[101,785]],520:[[73,783]],521:[[105,783]],522:[[73,785]],523:[[105,785]],524:[[79,783]],525:[[111,783]],526:[[79,785]],527:[[111,785]],528:[[82,783]],529:[[114,783]],530:[[82,785]],531:[[114,785]],532:[[85,783]],533:[[117,783]],534:[[85,785]],535:[[117,785]],536:[[83,806]],537:[[115,806]],538:[[84,806]],539:[[116,806]],542:[[72,780]],543:[[104,780]],550:[[65,775],,{772:480}],551:[[97,775],,{772:481}],552:[[69,807],,{774:7708}],553:[[101,807],,{774:7709}],554:[[214,772]],555:[[246,772]],556:[[213,772]],557:[[245,772]],558:[[79,775],,{772:560}],559:[[111,775],,{772:561}],560:[[558,772]],561:[[559,772]],562:[[89,772]],563:[[121,772]],658:[,,{780:495}],688:[[104],256],689:[[614],256],690:[[106],256],691:[[114],256],692:[[633],256],693:[[635],256],694:[[641],256],695:[[119],256],696:[[121],256],728:[[32,774],256],729:[[32,775],256],730:[[32,778],256],731:[[32,808],256],732:[[32,771],256],733:[[32,779],256],736:[[611],256],737:[[108],256],738:[[115],256],739:[[120],256],740:[[661],256]}, + 768:{768:[,230],769:[,230],770:[,230],771:[,230],772:[,230],773:[,230],774:[,230],775:[,230],776:[,230,{769:836}],777:[,230],778:[,230],779:[,230],780:[,230],781:[,230],782:[,230],783:[,230],784:[,230],785:[,230],786:[,230],787:[,230],788:[,230],789:[,232],790:[,220],791:[,220],792:[,220],793:[,220],794:[,232],795:[,216],796:[,220],797:[,220],798:[,220],799:[,220],800:[,220],801:[,202],802:[,202],803:[,220],804:[,220],805:[,220],806:[,220],807:[,202],808:[,202],809:[,220],810:[,220],811:[,220],812:[,220],813:[,220],814:[,220],815:[,220],816:[,220],817:[,220],818:[,220],819:[,220],820:[,1],821:[,1],822:[,1],823:[,1],824:[,1],825:[,220],826:[,220],827:[,220],828:[,220],829:[,230],830:[,230],831:[,230],832:[[768],230],833:[[769],230],834:[,230],835:[[787],230],836:[[776,769],230],837:[,240],838:[,230],839:[,220],840:[,220],841:[,220],842:[,230],843:[,230],844:[,230],845:[,220],846:[,220],848:[,230],849:[,230],850:[,230],851:[,220],852:[,220],853:[,220],854:[,220],855:[,230],856:[,232],857:[,220],858:[,220],859:[,230],860:[,233],861:[,234],862:[,234],863:[,233],864:[,234],865:[,234],866:[,233],867:[,230],868:[,230],869:[,230],870:[,230],871:[,230],872:[,230],873:[,230],874:[,230],875:[,230],876:[,230],877:[,230],878:[,230],879:[,230],884:[[697]],890:[[32,837],256],894:[[59]],900:[[32,769],256],901:[[168,769]],902:[[913,769]],903:[[183]],904:[[917,769]],905:[[919,769]],906:[[921,769]],908:[[927,769]],910:[[933,769]],911:[[937,769]],912:[[970,769]],913:[,,{768:8122,769:902,772:8121,774:8120,787:7944,788:7945,837:8124}],917:[,,{768:8136,769:904,787:7960,788:7961}],919:[,,{768:8138,769:905,787:7976,788:7977,837:8140}],921:[,,{768:8154,769:906,772:8153,774:8152,776:938,787:7992,788:7993}],927:[,,{768:8184,769:908,787:8008,788:8009}],929:[,,{788:8172}],933:[,,{768:8170,769:910,772:8169,774:8168,776:939,788:8025}],937:[,,{768:8186,769:911,787:8040,788:8041,837:8188}],938:[[921,776]],939:[[933,776]],940:[[945,769],,{837:8116}],941:[[949,769]],942:[[951,769],,{837:8132}],943:[[953,769]],944:[[971,769]],945:[,,{768:8048,769:940,772:8113,774:8112,787:7936,788:7937,834:8118,837:8115}],949:[,,{768:8050,769:941,787:7952,788:7953}],951:[,,{768:8052,769:942,787:7968,788:7969,834:8134,837:8131}],953:[,,{768:8054,769:943,772:8145,774:8144,776:970,787:7984,788:7985,834:8150}],959:[,,{768:8056,769:972,787:8000,788:8001}],961:[,,{787:8164,788:8165}],965:[,,{768:8058,769:973,772:8161,774:8160,776:971,787:8016,788:8017,834:8166}],969:[,,{768:8060,769:974,787:8032,788:8033,834:8182,837:8179}],970:[[953,776],,{768:8146,769:912,834:8151}],971:[[965,776],,{768:8162,769:944,834:8167}],972:[[959,769]],973:[[965,769]],974:[[969,769],,{837:8180}],976:[[946],256],977:[[952],256],978:[[933],256,{769:979,776:980}],979:[[978,769]],980:[[978,776]],981:[[966],256],982:[[960],256],1008:[[954],256],1009:[[961],256],1010:[[962],256],1012:[[920],256],1013:[[949],256],1017:[[931],256]}, + 1024:{1024:[[1045,768]],1025:[[1045,776]],1027:[[1043,769]],1030:[,,{776:1031}],1031:[[1030,776]],1036:[[1050,769]],1037:[[1048,768]],1038:[[1059,774]],1040:[,,{774:1232,776:1234}],1043:[,,{769:1027}],1045:[,,{768:1024,774:1238,776:1025}],1046:[,,{774:1217,776:1244}],1047:[,,{776:1246}],1048:[,,{768:1037,772:1250,774:1049,776:1252}],1049:[[1048,774]],1050:[,,{769:1036}],1054:[,,{776:1254}],1059:[,,{772:1262,774:1038,776:1264,779:1266}],1063:[,,{776:1268}],1067:[,,{776:1272}],1069:[,,{776:1260}],1072:[,,{774:1233,776:1235}],1075:[,,{769:1107}],1077:[,,{768:1104,774:1239,776:1105}],1078:[,,{774:1218,776:1245}],1079:[,,{776:1247}],1080:[,,{768:1117,772:1251,774:1081,776:1253}],1081:[[1080,774]],1082:[,,{769:1116}],1086:[,,{776:1255}],1091:[,,{772:1263,774:1118,776:1265,779:1267}],1095:[,,{776:1269}],1099:[,,{776:1273}],1101:[,,{776:1261}],1104:[[1077,768]],1105:[[1077,776]],1107:[[1075,769]],1110:[,,{776:1111}],1111:[[1110,776]],1116:[[1082,769]],1117:[[1080,768]],1118:[[1091,774]],1140:[,,{783:1142}],1141:[,,{783:1143}],1142:[[1140,783]],1143:[[1141,783]],1155:[,230],1156:[,230],1157:[,230],1158:[,230],1159:[,230],1217:[[1046,774]],1218:[[1078,774]],1232:[[1040,774]],1233:[[1072,774]],1234:[[1040,776]],1235:[[1072,776]],1238:[[1045,774]],1239:[[1077,774]],1240:[,,{776:1242}],1241:[,,{776:1243}],1242:[[1240,776]],1243:[[1241,776]],1244:[[1046,776]],1245:[[1078,776]],1246:[[1047,776]],1247:[[1079,776]],1250:[[1048,772]],1251:[[1080,772]],1252:[[1048,776]],1253:[[1080,776]],1254:[[1054,776]],1255:[[1086,776]],1256:[,,{776:1258}],1257:[,,{776:1259}],1258:[[1256,776]],1259:[[1257,776]],1260:[[1069,776]],1261:[[1101,776]],1262:[[1059,772]],1263:[[1091,772]],1264:[[1059,776]],1265:[[1091,776]],1266:[[1059,779]],1267:[[1091,779]],1268:[[1063,776]],1269:[[1095,776]],1272:[[1067,776]],1273:[[1099,776]]}, + 1280:{1415:[[1381,1410],256],1425:[,220],1426:[,230],1427:[,230],1428:[,230],1429:[,230],1430:[,220],1431:[,230],1432:[,230],1433:[,230],1434:[,222],1435:[,220],1436:[,230],1437:[,230],1438:[,230],1439:[,230],1440:[,230],1441:[,230],1442:[,220],1443:[,220],1444:[,220],1445:[,220],1446:[,220],1447:[,220],1448:[,230],1449:[,230],1450:[,220],1451:[,230],1452:[,230],1453:[,222],1454:[,228],1455:[,230],1456:[,10],1457:[,11],1458:[,12],1459:[,13],1460:[,14],1461:[,15],1462:[,16],1463:[,17],1464:[,18],1465:[,19],1466:[,19],1467:[,20],1468:[,21],1469:[,22],1471:[,23],1473:[,24],1474:[,25],1476:[,230],1477:[,220],1479:[,18]}, + 1536:{1552:[,230],1553:[,230],1554:[,230],1555:[,230],1556:[,230],1557:[,230],1558:[,230],1559:[,230],1560:[,30],1561:[,31],1562:[,32],1570:[[1575,1619]],1571:[[1575,1620]],1572:[[1608,1620]],1573:[[1575,1621]],1574:[[1610,1620]],1575:[,,{1619:1570,1620:1571,1621:1573}],1608:[,,{1620:1572}],1610:[,,{1620:1574}],1611:[,27],1612:[,28],1613:[,29],1614:[,30],1615:[,31],1616:[,32],1617:[,33],1618:[,34],1619:[,230],1620:[,230],1621:[,220],1622:[,220],1623:[,230],1624:[,230],1625:[,230],1626:[,230],1627:[,230],1628:[,220],1629:[,230],1630:[,230],1631:[,220],1648:[,35],1653:[[1575,1652],256],1654:[[1608,1652],256],1655:[[1735,1652],256],1656:[[1610,1652],256],1728:[[1749,1620]],1729:[,,{1620:1730}],1730:[[1729,1620]],1746:[,,{1620:1747}],1747:[[1746,1620]],1749:[,,{1620:1728}],1750:[,230],1751:[,230],1752:[,230],1753:[,230],1754:[,230],1755:[,230],1756:[,230],1759:[,230],1760:[,230],1761:[,230],1762:[,230],1763:[,220],1764:[,230],1767:[,230],1768:[,230],1770:[,220],1771:[,230],1772:[,230],1773:[,220]}, + 1792:{1809:[,36],1840:[,230],1841:[,220],1842:[,230],1843:[,230],1844:[,220],1845:[,230],1846:[,230],1847:[,220],1848:[,220],1849:[,220],1850:[,230],1851:[,220],1852:[,220],1853:[,230],1854:[,220],1855:[,230],1856:[,230],1857:[,230],1858:[,220],1859:[,230],1860:[,220],1861:[,230],1862:[,220],1863:[,230],1864:[,220],1865:[,230],1866:[,230],2027:[,230],2028:[,230],2029:[,230],2030:[,230],2031:[,230],2032:[,230],2033:[,230],2034:[,220],2035:[,230]}, + 2048:{2070:[,230],2071:[,230],2072:[,230],2073:[,230],2075:[,230],2076:[,230],2077:[,230],2078:[,230],2079:[,230],2080:[,230],2081:[,230],2082:[,230],2083:[,230],2085:[,230],2086:[,230],2087:[,230],2089:[,230],2090:[,230],2091:[,230],2092:[,230],2093:[,230],2137:[,220],2138:[,220],2139:[,220],2276:[,230],2277:[,230],2278:[,220],2279:[,230],2280:[,230],2281:[,220],2282:[,230],2283:[,230],2284:[,230],2285:[,220],2286:[,220],2287:[,220],2288:[,27],2289:[,28],2290:[,29],2291:[,230],2292:[,230],2293:[,230],2294:[,220],2295:[,230],2296:[,230],2297:[,220],2298:[,220],2299:[,230],2300:[,230],2301:[,230],2302:[,230]}, + 2304:{2344:[,,{2364:2345}],2345:[[2344,2364]],2352:[,,{2364:2353}],2353:[[2352,2364]],2355:[,,{2364:2356}],2356:[[2355,2364]],2364:[,7],2381:[,9],2385:[,230],2386:[,220],2387:[,230],2388:[,230],2392:[[2325,2364],512],2393:[[2326,2364],512],2394:[[2327,2364],512],2395:[[2332,2364],512],2396:[[2337,2364],512],2397:[[2338,2364],512],2398:[[2347,2364],512],2399:[[2351,2364],512],2492:[,7],2503:[,,{2494:2507,2519:2508}],2507:[[2503,2494]],2508:[[2503,2519]],2509:[,9],2524:[[2465,2492],512],2525:[[2466,2492],512],2527:[[2479,2492],512]}, + 2560:{2611:[[2610,2620],512],2614:[[2616,2620],512],2620:[,7],2637:[,9],2649:[[2582,2620],512],2650:[[2583,2620],512],2651:[[2588,2620],512],2654:[[2603,2620],512],2748:[,7],2765:[,9],68109:[,220],68111:[,230],68152:[,230],68153:[,1],68154:[,220],68159:[,9]}, + 2816:{2876:[,7],2887:[,,{2878:2891,2902:2888,2903:2892}],2888:[[2887,2902]],2891:[[2887,2878]],2892:[[2887,2903]],2893:[,9],2908:[[2849,2876],512],2909:[[2850,2876],512],2962:[,,{3031:2964}],2964:[[2962,3031]],3014:[,,{3006:3018,3031:3020}],3015:[,,{3006:3019}],3018:[[3014,3006]],3019:[[3015,3006]],3020:[[3014,3031]],3021:[,9]}, + 3072:{3142:[,,{3158:3144}],3144:[[3142,3158]],3149:[,9],3157:[,84],3158:[,91],3260:[,7],3263:[,,{3285:3264}],3264:[[3263,3285]],3270:[,,{3266:3274,3285:3271,3286:3272}],3271:[[3270,3285]],3272:[[3270,3286]],3274:[[3270,3266],,{3285:3275}],3275:[[3274,3285]],3277:[,9]}, + 3328:{3398:[,,{3390:3402,3415:3404}],3399:[,,{3390:3403}],3402:[[3398,3390]],3403:[[3399,3390]],3404:[[3398,3415]],3405:[,9],3530:[,9],3545:[,,{3530:3546,3535:3548,3551:3550}],3546:[[3545,3530]],3548:[[3545,3535],,{3530:3549}],3549:[[3548,3530]],3550:[[3545,3551]]}, + 3584:{3635:[[3661,3634],256],3640:[,103],3641:[,103],3642:[,9],3656:[,107],3657:[,107],3658:[,107],3659:[,107],3763:[[3789,3762],256],3768:[,118],3769:[,118],3784:[,122],3785:[,122],3786:[,122],3787:[,122],3804:[[3755,3737],256],3805:[[3755,3745],256]}, + 3840:{3852:[[3851],256],3864:[,220],3865:[,220],3893:[,220],3895:[,220],3897:[,216],3907:[[3906,4023],512],3917:[[3916,4023],512],3922:[[3921,4023],512],3927:[[3926,4023],512],3932:[[3931,4023],512],3945:[[3904,4021],512],3953:[,129],3954:[,130],3955:[[3953,3954],512],3956:[,132],3957:[[3953,3956],512],3958:[[4018,3968],512],3959:[[4018,3969],256],3960:[[4019,3968],512],3961:[[4019,3969],256],3962:[,130],3963:[,130],3964:[,130],3965:[,130],3968:[,130],3969:[[3953,3968],512],3970:[,230],3971:[,230],3972:[,9],3974:[,230],3975:[,230],3987:[[3986,4023],512],3997:[[3996,4023],512],4002:[[4001,4023],512],4007:[[4006,4023],512],4012:[[4011,4023],512],4025:[[3984,4021],512],4038:[,220]}, + 4096:{4133:[,,{4142:4134}],4134:[[4133,4142]],4151:[,7],4153:[,9],4154:[,9],4237:[,220],4348:[[4316],256],69702:[,9],69785:[,,{69818:69786}],69786:[[69785,69818]],69787:[,,{69818:69788}],69788:[[69787,69818]],69797:[,,{69818:69803}],69803:[[69797,69818]],69817:[,9],69818:[,7]}, + 4352:{69888:[,230],69889:[,230],69890:[,230],69934:[[69937,69927]],69935:[[69938,69927]],69937:[,,{69927:69934}],69938:[,,{69927:69935}],69939:[,9],69940:[,9],70080:[,9]}, + 4864:{4957:[,230],4958:[,230],4959:[,230]}, + 5632:{71350:[,9],71351:[,7]}, + 5888:{5908:[,9],5940:[,9],6098:[,9],6109:[,230]}, + 6144:{6313:[,228]}, + 6400:{6457:[,222],6458:[,230],6459:[,220]}, + 6656:{6679:[,230],6680:[,220],6752:[,9],6773:[,230],6774:[,230],6775:[,230],6776:[,230],6777:[,230],6778:[,230],6779:[,230],6780:[,230],6783:[,220]}, + 6912:{6917:[,,{6965:6918}],6918:[[6917,6965]],6919:[,,{6965:6920}],6920:[[6919,6965]],6921:[,,{6965:6922}],6922:[[6921,6965]],6923:[,,{6965:6924}],6924:[[6923,6965]],6925:[,,{6965:6926}],6926:[[6925,6965]],6929:[,,{6965:6930}],6930:[[6929,6965]],6964:[,7],6970:[,,{6965:6971}],6971:[[6970,6965]],6972:[,,{6965:6973}],6973:[[6972,6965]],6974:[,,{6965:6976}],6975:[,,{6965:6977}],6976:[[6974,6965]],6977:[[6975,6965]],6978:[,,{6965:6979}],6979:[[6978,6965]],6980:[,9],7019:[,230],7020:[,220],7021:[,230],7022:[,230],7023:[,230],7024:[,230],7025:[,230],7026:[,230],7027:[,230],7082:[,9],7083:[,9],7142:[,7],7154:[,9],7155:[,9]}, + 7168:{7223:[,7],7376:[,230],7377:[,230],7378:[,230],7380:[,1],7381:[,220],7382:[,220],7383:[,220],7384:[,220],7385:[,220],7386:[,230],7387:[,230],7388:[,220],7389:[,220],7390:[,220],7391:[,220],7392:[,230],7394:[,1],7395:[,1],7396:[,1],7397:[,1],7398:[,1],7399:[,1],7400:[,1],7405:[,220],7412:[,230]}, + 7424:{7468:[[65],256],7469:[[198],256],7470:[[66],256],7472:[[68],256],7473:[[69],256],7474:[[398],256],7475:[[71],256],7476:[[72],256],7477:[[73],256],7478:[[74],256],7479:[[75],256],7480:[[76],256],7481:[[77],256],7482:[[78],256],7484:[[79],256],7485:[[546],256],7486:[[80],256],7487:[[82],256],7488:[[84],256],7489:[[85],256],7490:[[87],256],7491:[[97],256],7492:[[592],256],7493:[[593],256],7494:[[7426],256],7495:[[98],256],7496:[[100],256],7497:[[101],256],7498:[[601],256],7499:[[603],256],7500:[[604],256],7501:[[103],256],7503:[[107],256],7504:[[109],256],7505:[[331],256],7506:[[111],256],7507:[[596],256],7508:[[7446],256],7509:[[7447],256],7510:[[112],256],7511:[[116],256],7512:[[117],256],7513:[[7453],256],7514:[[623],256],7515:[[118],256],7516:[[7461],256],7517:[[946],256],7518:[[947],256],7519:[[948],256],7520:[[966],256],7521:[[967],256],7522:[[105],256],7523:[[114],256],7524:[[117],256],7525:[[118],256],7526:[[946],256],7527:[[947],256],7528:[[961],256],7529:[[966],256],7530:[[967],256],7544:[[1085],256],7579:[[594],256],7580:[[99],256],7581:[[597],256],7582:[[240],256],7583:[[604],256],7584:[[102],256],7585:[[607],256],7586:[[609],256],7587:[[613],256],7588:[[616],256],7589:[[617],256],7590:[[618],256],7591:[[7547],256],7592:[[669],256],7593:[[621],256],7594:[[7557],256],7595:[[671],256],7596:[[625],256],7597:[[624],256],7598:[[626],256],7599:[[627],256],7600:[[628],256],7601:[[629],256],7602:[[632],256],7603:[[642],256],7604:[[643],256],7605:[[427],256],7606:[[649],256],7607:[[650],256],7608:[[7452],256],7609:[[651],256],7610:[[652],256],7611:[[122],256],7612:[[656],256],7613:[[657],256],7614:[[658],256],7615:[[952],256],7616:[,230],7617:[,230],7618:[,220],7619:[,230],7620:[,230],7621:[,230],7622:[,230],7623:[,230],7624:[,230],7625:[,230],7626:[,220],7627:[,230],7628:[,230],7629:[,234],7630:[,214],7631:[,220],7632:[,202],7633:[,230],7634:[,230],7635:[,230],7636:[,230],7637:[,230],7638:[,230],7639:[,230],7640:[,230],7641:[,230],7642:[,230],7643:[,230],7644:[,230],7645:[,230],7646:[,230],7647:[,230],7648:[,230],7649:[,230],7650:[,230],7651:[,230],7652:[,230],7653:[,230],7654:[,230],7676:[,233],7677:[,220],7678:[,230],7679:[,220]}, + 7680:{7680:[[65,805]],7681:[[97,805]],7682:[[66,775]],7683:[[98,775]],7684:[[66,803]],7685:[[98,803]],7686:[[66,817]],7687:[[98,817]],7688:[[199,769]],7689:[[231,769]],7690:[[68,775]],7691:[[100,775]],7692:[[68,803]],7693:[[100,803]],7694:[[68,817]],7695:[[100,817]],7696:[[68,807]],7697:[[100,807]],7698:[[68,813]],7699:[[100,813]],7700:[[274,768]],7701:[[275,768]],7702:[[274,769]],7703:[[275,769]],7704:[[69,813]],7705:[[101,813]],7706:[[69,816]],7707:[[101,816]],7708:[[552,774]],7709:[[553,774]],7710:[[70,775]],7711:[[102,775]],7712:[[71,772]],7713:[[103,772]],7714:[[72,775]],7715:[[104,775]],7716:[[72,803]],7717:[[104,803]],7718:[[72,776]],7719:[[104,776]],7720:[[72,807]],7721:[[104,807]],7722:[[72,814]],7723:[[104,814]],7724:[[73,816]],7725:[[105,816]],7726:[[207,769]],7727:[[239,769]],7728:[[75,769]],7729:[[107,769]],7730:[[75,803]],7731:[[107,803]],7732:[[75,817]],7733:[[107,817]],7734:[[76,803],,{772:7736}],7735:[[108,803],,{772:7737}],7736:[[7734,772]],7737:[[7735,772]],7738:[[76,817]],7739:[[108,817]],7740:[[76,813]],7741:[[108,813]],7742:[[77,769]],7743:[[109,769]],7744:[[77,775]],7745:[[109,775]],7746:[[77,803]],7747:[[109,803]],7748:[[78,775]],7749:[[110,775]],7750:[[78,803]],7751:[[110,803]],7752:[[78,817]],7753:[[110,817]],7754:[[78,813]],7755:[[110,813]],7756:[[213,769]],7757:[[245,769]],7758:[[213,776]],7759:[[245,776]],7760:[[332,768]],7761:[[333,768]],7762:[[332,769]],7763:[[333,769]],7764:[[80,769]],7765:[[112,769]],7766:[[80,775]],7767:[[112,775]],7768:[[82,775]],7769:[[114,775]],7770:[[82,803],,{772:7772}],7771:[[114,803],,{772:7773}],7772:[[7770,772]],7773:[[7771,772]],7774:[[82,817]],7775:[[114,817]],7776:[[83,775]],7777:[[115,775]],7778:[[83,803],,{775:7784}],7779:[[115,803],,{775:7785}],7780:[[346,775]],7781:[[347,775]],7782:[[352,775]],7783:[[353,775]],7784:[[7778,775]],7785:[[7779,775]],7786:[[84,775]],7787:[[116,775]],7788:[[84,803]],7789:[[116,803]],7790:[[84,817]],7791:[[116,817]],7792:[[84,813]],7793:[[116,813]],7794:[[85,804]],7795:[[117,804]],7796:[[85,816]],7797:[[117,816]],7798:[[85,813]],7799:[[117,813]],7800:[[360,769]],7801:[[361,769]],7802:[[362,776]],7803:[[363,776]],7804:[[86,771]],7805:[[118,771]],7806:[[86,803]],7807:[[118,803]],7808:[[87,768]],7809:[[119,768]],7810:[[87,769]],7811:[[119,769]],7812:[[87,776]],7813:[[119,776]],7814:[[87,775]],7815:[[119,775]],7816:[[87,803]],7817:[[119,803]],7818:[[88,775]],7819:[[120,775]],7820:[[88,776]],7821:[[120,776]],7822:[[89,775]],7823:[[121,775]],7824:[[90,770]],7825:[[122,770]],7826:[[90,803]],7827:[[122,803]],7828:[[90,817]],7829:[[122,817]],7830:[[104,817]],7831:[[116,776]],7832:[[119,778]],7833:[[121,778]],7834:[[97,702],256],7835:[[383,775]],7840:[[65,803],,{770:7852,774:7862}],7841:[[97,803],,{770:7853,774:7863}],7842:[[65,777]],7843:[[97,777]],7844:[[194,769]],7845:[[226,769]],7846:[[194,768]],7847:[[226,768]],7848:[[194,777]],7849:[[226,777]],7850:[[194,771]],7851:[[226,771]],7852:[[7840,770]],7853:[[7841,770]],7854:[[258,769]],7855:[[259,769]],7856:[[258,768]],7857:[[259,768]],7858:[[258,777]],7859:[[259,777]],7860:[[258,771]],7861:[[259,771]],7862:[[7840,774]],7863:[[7841,774]],7864:[[69,803],,{770:7878}],7865:[[101,803],,{770:7879}],7866:[[69,777]],7867:[[101,777]],7868:[[69,771]],7869:[[101,771]],7870:[[202,769]],7871:[[234,769]],7872:[[202,768]],7873:[[234,768]],7874:[[202,777]],7875:[[234,777]],7876:[[202,771]],7877:[[234,771]],7878:[[7864,770]],7879:[[7865,770]],7880:[[73,777]],7881:[[105,777]],7882:[[73,803]],7883:[[105,803]],7884:[[79,803],,{770:7896}],7885:[[111,803],,{770:7897}],7886:[[79,777]],7887:[[111,777]],7888:[[212,769]],7889:[[244,769]],7890:[[212,768]],7891:[[244,768]],7892:[[212,777]],7893:[[244,777]],7894:[[212,771]],7895:[[244,771]],7896:[[7884,770]],7897:[[7885,770]],7898:[[416,769]],7899:[[417,769]],7900:[[416,768]],7901:[[417,768]],7902:[[416,777]],7903:[[417,777]],7904:[[416,771]],7905:[[417,771]],7906:[[416,803]],7907:[[417,803]],7908:[[85,803]],7909:[[117,803]],7910:[[85,777]],7911:[[117,777]],7912:[[431,769]],7913:[[432,769]],7914:[[431,768]],7915:[[432,768]],7916:[[431,777]],7917:[[432,777]],7918:[[431,771]],7919:[[432,771]],7920:[[431,803]],7921:[[432,803]],7922:[[89,768]],7923:[[121,768]],7924:[[89,803]],7925:[[121,803]],7926:[[89,777]],7927:[[121,777]],7928:[[89,771]],7929:[[121,771]]}, + 7936:{7936:[[945,787],,{768:7938,769:7940,834:7942,837:8064}],7937:[[945,788],,{768:7939,769:7941,834:7943,837:8065}],7938:[[7936,768],,{837:8066}],7939:[[7937,768],,{837:8067}],7940:[[7936,769],,{837:8068}],7941:[[7937,769],,{837:8069}],7942:[[7936,834],,{837:8070}],7943:[[7937,834],,{837:8071}],7944:[[913,787],,{768:7946,769:7948,834:7950,837:8072}],7945:[[913,788],,{768:7947,769:7949,834:7951,837:8073}],7946:[[7944,768],,{837:8074}],7947:[[7945,768],,{837:8075}],7948:[[7944,769],,{837:8076}],7949:[[7945,769],,{837:8077}],7950:[[7944,834],,{837:8078}],7951:[[7945,834],,{837:8079}],7952:[[949,787],,{768:7954,769:7956}],7953:[[949,788],,{768:7955,769:7957}],7954:[[7952,768]],7955:[[7953,768]],7956:[[7952,769]],7957:[[7953,769]],7960:[[917,787],,{768:7962,769:7964}],7961:[[917,788],,{768:7963,769:7965}],7962:[[7960,768]],7963:[[7961,768]],7964:[[7960,769]],7965:[[7961,769]],7968:[[951,787],,{768:7970,769:7972,834:7974,837:8080}],7969:[[951,788],,{768:7971,769:7973,834:7975,837:8081}],7970:[[7968,768],,{837:8082}],7971:[[7969,768],,{837:8083}],7972:[[7968,769],,{837:8084}],7973:[[7969,769],,{837:8085}],7974:[[7968,834],,{837:8086}],7975:[[7969,834],,{837:8087}],7976:[[919,787],,{768:7978,769:7980,834:7982,837:8088}],7977:[[919,788],,{768:7979,769:7981,834:7983,837:8089}],7978:[[7976,768],,{837:8090}],7979:[[7977,768],,{837:8091}],7980:[[7976,769],,{837:8092}],7981:[[7977,769],,{837:8093}],7982:[[7976,834],,{837:8094}],7983:[[7977,834],,{837:8095}],7984:[[953,787],,{768:7986,769:7988,834:7990}],7985:[[953,788],,{768:7987,769:7989,834:7991}],7986:[[7984,768]],7987:[[7985,768]],7988:[[7984,769]],7989:[[7985,769]],7990:[[7984,834]],7991:[[7985,834]],7992:[[921,787],,{768:7994,769:7996,834:7998}],7993:[[921,788],,{768:7995,769:7997,834:7999}],7994:[[7992,768]],7995:[[7993,768]],7996:[[7992,769]],7997:[[7993,769]],7998:[[7992,834]],7999:[[7993,834]],8000:[[959,787],,{768:8002,769:8004}],8001:[[959,788],,{768:8003,769:8005}],8002:[[8000,768]],8003:[[8001,768]],8004:[[8000,769]],8005:[[8001,769]],8008:[[927,787],,{768:8010,769:8012}],8009:[[927,788],,{768:8011,769:8013}],8010:[[8008,768]],8011:[[8009,768]],8012:[[8008,769]],8013:[[8009,769]],8016:[[965,787],,{768:8018,769:8020,834:8022}],8017:[[965,788],,{768:8019,769:8021,834:8023}],8018:[[8016,768]],8019:[[8017,768]],8020:[[8016,769]],8021:[[8017,769]],8022:[[8016,834]],8023:[[8017,834]],8025:[[933,788],,{768:8027,769:8029,834:8031}],8027:[[8025,768]],8029:[[8025,769]],8031:[[8025,834]],8032:[[969,787],,{768:8034,769:8036,834:8038,837:8096}],8033:[[969,788],,{768:8035,769:8037,834:8039,837:8097}],8034:[[8032,768],,{837:8098}],8035:[[8033,768],,{837:8099}],8036:[[8032,769],,{837:8100}],8037:[[8033,769],,{837:8101}],8038:[[8032,834],,{837:8102}],8039:[[8033,834],,{837:8103}],8040:[[937,787],,{768:8042,769:8044,834:8046,837:8104}],8041:[[937,788],,{768:8043,769:8045,834:8047,837:8105}],8042:[[8040,768],,{837:8106}],8043:[[8041,768],,{837:8107}],8044:[[8040,769],,{837:8108}],8045:[[8041,769],,{837:8109}],8046:[[8040,834],,{837:8110}],8047:[[8041,834],,{837:8111}],8048:[[945,768],,{837:8114}],8049:[[940]],8050:[[949,768]],8051:[[941]],8052:[[951,768],,{837:8130}],8053:[[942]],8054:[[953,768]],8055:[[943]],8056:[[959,768]],8057:[[972]],8058:[[965,768]],8059:[[973]],8060:[[969,768],,{837:8178}],8061:[[974]],8064:[[7936,837]],8065:[[7937,837]],8066:[[7938,837]],8067:[[7939,837]],8068:[[7940,837]],8069:[[7941,837]],8070:[[7942,837]],8071:[[7943,837]],8072:[[7944,837]],8073:[[7945,837]],8074:[[7946,837]],8075:[[7947,837]],8076:[[7948,837]],8077:[[7949,837]],8078:[[7950,837]],8079:[[7951,837]],8080:[[7968,837]],8081:[[7969,837]],8082:[[7970,837]],8083:[[7971,837]],8084:[[7972,837]],8085:[[7973,837]],8086:[[7974,837]],8087:[[7975,837]],8088:[[7976,837]],8089:[[7977,837]],8090:[[7978,837]],8091:[[7979,837]],8092:[[7980,837]],8093:[[7981,837]],8094:[[7982,837]],8095:[[7983,837]],8096:[[8032,837]],8097:[[8033,837]],8098:[[8034,837]],8099:[[8035,837]],8100:[[8036,837]],8101:[[8037,837]],8102:[[8038,837]],8103:[[8039,837]],8104:[[8040,837]],8105:[[8041,837]],8106:[[8042,837]],8107:[[8043,837]],8108:[[8044,837]],8109:[[8045,837]],8110:[[8046,837]],8111:[[8047,837]],8112:[[945,774]],8113:[[945,772]],8114:[[8048,837]],8115:[[945,837]],8116:[[940,837]],8118:[[945,834],,{837:8119}],8119:[[8118,837]],8120:[[913,774]],8121:[[913,772]],8122:[[913,768]],8123:[[902]],8124:[[913,837]],8125:[[32,787],256],8126:[[953]],8127:[[32,787],256,{768:8141,769:8142,834:8143}],8128:[[32,834],256],8129:[[168,834]],8130:[[8052,837]],8131:[[951,837]],8132:[[942,837]],8134:[[951,834],,{837:8135}],8135:[[8134,837]],8136:[[917,768]],8137:[[904]],8138:[[919,768]],8139:[[905]],8140:[[919,837]],8141:[[8127,768]],8142:[[8127,769]],8143:[[8127,834]],8144:[[953,774]],8145:[[953,772]],8146:[[970,768]],8147:[[912]],8150:[[953,834]],8151:[[970,834]],8152:[[921,774]],8153:[[921,772]],8154:[[921,768]],8155:[[906]],8157:[[8190,768]],8158:[[8190,769]],8159:[[8190,834]],8160:[[965,774]],8161:[[965,772]],8162:[[971,768]],8163:[[944]],8164:[[961,787]],8165:[[961,788]],8166:[[965,834]],8167:[[971,834]],8168:[[933,774]],8169:[[933,772]],8170:[[933,768]],8171:[[910]],8172:[[929,788]],8173:[[168,768]],8174:[[901]],8175:[[96]],8178:[[8060,837]],8179:[[969,837]],8180:[[974,837]],8182:[[969,834],,{837:8183}],8183:[[8182,837]],8184:[[927,768]],8185:[[908]],8186:[[937,768]],8187:[[911]],8188:[[937,837]],8189:[[180]],8190:[[32,788],256,{768:8157,769:8158,834:8159}]}, + 8192:{8192:[[8194]],8193:[[8195]],8194:[[32],256],8195:[[32],256],8196:[[32],256],8197:[[32],256],8198:[[32],256],8199:[[32],256],8200:[[32],256],8201:[[32],256],8202:[[32],256],8209:[[8208],256],8215:[[32,819],256],8228:[[46],256],8229:[[46,46],256],8230:[[46,46,46],256],8239:[[32],256],8243:[[8242,8242],256],8244:[[8242,8242,8242],256],8246:[[8245,8245],256],8247:[[8245,8245,8245],256],8252:[[33,33],256],8254:[[32,773],256],8263:[[63,63],256],8264:[[63,33],256],8265:[[33,63],256],8279:[[8242,8242,8242,8242],256],8287:[[32],256],8304:[[48],256],8305:[[105],256],8308:[[52],256],8309:[[53],256],8310:[[54],256],8311:[[55],256],8312:[[56],256],8313:[[57],256],8314:[[43],256],8315:[[8722],256],8316:[[61],256],8317:[[40],256],8318:[[41],256],8319:[[110],256],8320:[[48],256],8321:[[49],256],8322:[[50],256],8323:[[51],256],8324:[[52],256],8325:[[53],256],8326:[[54],256],8327:[[55],256],8328:[[56],256],8329:[[57],256],8330:[[43],256],8331:[[8722],256],8332:[[61],256],8333:[[40],256],8334:[[41],256],8336:[[97],256],8337:[[101],256],8338:[[111],256],8339:[[120],256],8340:[[601],256],8341:[[104],256],8342:[[107],256],8343:[[108],256],8344:[[109],256],8345:[[110],256],8346:[[112],256],8347:[[115],256],8348:[[116],256],8360:[[82,115],256],8400:[,230],8401:[,230],8402:[,1],8403:[,1],8404:[,230],8405:[,230],8406:[,230],8407:[,230],8408:[,1],8409:[,1],8410:[,1],8411:[,230],8412:[,230],8417:[,230],8421:[,1],8422:[,1],8423:[,230],8424:[,220],8425:[,230],8426:[,1],8427:[,1],8428:[,220],8429:[,220],8430:[,220],8431:[,220],8432:[,230]}, + 8448:{8448:[[97,47,99],256],8449:[[97,47,115],256],8450:[[67],256],8451:[[176,67],256],8453:[[99,47,111],256],8454:[[99,47,117],256],8455:[[400],256],8457:[[176,70],256],8458:[[103],256],8459:[[72],256],8460:[[72],256],8461:[[72],256],8462:[[104],256],8463:[[295],256],8464:[[73],256],8465:[[73],256],8466:[[76],256],8467:[[108],256],8469:[[78],256],8470:[[78,111],256],8473:[[80],256],8474:[[81],256],8475:[[82],256],8476:[[82],256],8477:[[82],256],8480:[[83,77],256],8481:[[84,69,76],256],8482:[[84,77],256],8484:[[90],256],8486:[[937]],8488:[[90],256],8490:[[75]],8491:[[197]],8492:[[66],256],8493:[[67],256],8495:[[101],256],8496:[[69],256],8497:[[70],256],8499:[[77],256],8500:[[111],256],8501:[[1488],256],8502:[[1489],256],8503:[[1490],256],8504:[[1491],256],8505:[[105],256],8507:[[70,65,88],256],8508:[[960],256],8509:[[947],256],8510:[[915],256],8511:[[928],256],8512:[[8721],256],8517:[[68],256],8518:[[100],256],8519:[[101],256],8520:[[105],256],8521:[[106],256],8528:[[49,8260,55],256],8529:[[49,8260,57],256],8530:[[49,8260,49,48],256],8531:[[49,8260,51],256],8532:[[50,8260,51],256],8533:[[49,8260,53],256],8534:[[50,8260,53],256],8535:[[51,8260,53],256],8536:[[52,8260,53],256],8537:[[49,8260,54],256],8538:[[53,8260,54],256],8539:[[49,8260,56],256],8540:[[51,8260,56],256],8541:[[53,8260,56],256],8542:[[55,8260,56],256],8543:[[49,8260],256],8544:[[73],256],8545:[[73,73],256],8546:[[73,73,73],256],8547:[[73,86],256],8548:[[86],256],8549:[[86,73],256],8550:[[86,73,73],256],8551:[[86,73,73,73],256],8552:[[73,88],256],8553:[[88],256],8554:[[88,73],256],8555:[[88,73,73],256],8556:[[76],256],8557:[[67],256],8558:[[68],256],8559:[[77],256],8560:[[105],256],8561:[[105,105],256],8562:[[105,105,105],256],8563:[[105,118],256],8564:[[118],256],8565:[[118,105],256],8566:[[118,105,105],256],8567:[[118,105,105,105],256],8568:[[105,120],256],8569:[[120],256],8570:[[120,105],256],8571:[[120,105,105],256],8572:[[108],256],8573:[[99],256],8574:[[100],256],8575:[[109],256],8585:[[48,8260,51],256],8592:[,,{824:8602}],8594:[,,{824:8603}],8596:[,,{824:8622}],8602:[[8592,824]],8603:[[8594,824]],8622:[[8596,824]],8653:[[8656,824]],8654:[[8660,824]],8655:[[8658,824]],8656:[,,{824:8653}],8658:[,,{824:8655}],8660:[,,{824:8654}]}, + 8704:{8707:[,,{824:8708}],8708:[[8707,824]],8712:[,,{824:8713}],8713:[[8712,824]],8715:[,,{824:8716}],8716:[[8715,824]],8739:[,,{824:8740}],8740:[[8739,824]],8741:[,,{824:8742}],8742:[[8741,824]],8748:[[8747,8747],256],8749:[[8747,8747,8747],256],8751:[[8750,8750],256],8752:[[8750,8750,8750],256],8764:[,,{824:8769}],8769:[[8764,824]],8771:[,,{824:8772}],8772:[[8771,824]],8773:[,,{824:8775}],8775:[[8773,824]],8776:[,,{824:8777}],8777:[[8776,824]],8781:[,,{824:8813}],8800:[[61,824]],8801:[,,{824:8802}],8802:[[8801,824]],8804:[,,{824:8816}],8805:[,,{824:8817}],8813:[[8781,824]],8814:[[60,824]],8815:[[62,824]],8816:[[8804,824]],8817:[[8805,824]],8818:[,,{824:8820}],8819:[,,{824:8821}],8820:[[8818,824]],8821:[[8819,824]],8822:[,,{824:8824}],8823:[,,{824:8825}],8824:[[8822,824]],8825:[[8823,824]],8826:[,,{824:8832}],8827:[,,{824:8833}],8828:[,,{824:8928}],8829:[,,{824:8929}],8832:[[8826,824]],8833:[[8827,824]],8834:[,,{824:8836}],8835:[,,{824:8837}],8836:[[8834,824]],8837:[[8835,824]],8838:[,,{824:8840}],8839:[,,{824:8841}],8840:[[8838,824]],8841:[[8839,824]],8849:[,,{824:8930}],8850:[,,{824:8931}],8866:[,,{824:8876}],8872:[,,{824:8877}],8873:[,,{824:8878}],8875:[,,{824:8879}],8876:[[8866,824]],8877:[[8872,824]],8878:[[8873,824]],8879:[[8875,824]],8882:[,,{824:8938}],8883:[,,{824:8939}],8884:[,,{824:8940}],8885:[,,{824:8941}],8928:[[8828,824]],8929:[[8829,824]],8930:[[8849,824]],8931:[[8850,824]],8938:[[8882,824]],8939:[[8883,824]],8940:[[8884,824]],8941:[[8885,824]]}, + 8960:{9001:[[12296]],9002:[[12297]]}, + 9216:{9312:[[49],256],9313:[[50],256],9314:[[51],256],9315:[[52],256],9316:[[53],256],9317:[[54],256],9318:[[55],256],9319:[[56],256],9320:[[57],256],9321:[[49,48],256],9322:[[49,49],256],9323:[[49,50],256],9324:[[49,51],256],9325:[[49,52],256],9326:[[49,53],256],9327:[[49,54],256],9328:[[49,55],256],9329:[[49,56],256],9330:[[49,57],256],9331:[[50,48],256],9332:[[40,49,41],256],9333:[[40,50,41],256],9334:[[40,51,41],256],9335:[[40,52,41],256],9336:[[40,53,41],256],9337:[[40,54,41],256],9338:[[40,55,41],256],9339:[[40,56,41],256],9340:[[40,57,41],256],9341:[[40,49,48,41],256],9342:[[40,49,49,41],256],9343:[[40,49,50,41],256],9344:[[40,49,51,41],256],9345:[[40,49,52,41],256],9346:[[40,49,53,41],256],9347:[[40,49,54,41],256],9348:[[40,49,55,41],256],9349:[[40,49,56,41],256],9350:[[40,49,57,41],256],9351:[[40,50,48,41],256],9352:[[49,46],256],9353:[[50,46],256],9354:[[51,46],256],9355:[[52,46],256],9356:[[53,46],256],9357:[[54,46],256],9358:[[55,46],256],9359:[[56,46],256],9360:[[57,46],256],9361:[[49,48,46],256],9362:[[49,49,46],256],9363:[[49,50,46],256],9364:[[49,51,46],256],9365:[[49,52,46],256],9366:[[49,53,46],256],9367:[[49,54,46],256],9368:[[49,55,46],256],9369:[[49,56,46],256],9370:[[49,57,46],256],9371:[[50,48,46],256],9372:[[40,97,41],256],9373:[[40,98,41],256],9374:[[40,99,41],256],9375:[[40,100,41],256],9376:[[40,101,41],256],9377:[[40,102,41],256],9378:[[40,103,41],256],9379:[[40,104,41],256],9380:[[40,105,41],256],9381:[[40,106,41],256],9382:[[40,107,41],256],9383:[[40,108,41],256],9384:[[40,109,41],256],9385:[[40,110,41],256],9386:[[40,111,41],256],9387:[[40,112,41],256],9388:[[40,113,41],256],9389:[[40,114,41],256],9390:[[40,115,41],256],9391:[[40,116,41],256],9392:[[40,117,41],256],9393:[[40,118,41],256],9394:[[40,119,41],256],9395:[[40,120,41],256],9396:[[40,121,41],256],9397:[[40,122,41],256],9398:[[65],256],9399:[[66],256],9400:[[67],256],9401:[[68],256],9402:[[69],256],9403:[[70],256],9404:[[71],256],9405:[[72],256],9406:[[73],256],9407:[[74],256],9408:[[75],256],9409:[[76],256],9410:[[77],256],9411:[[78],256],9412:[[79],256],9413:[[80],256],9414:[[81],256],9415:[[82],256],9416:[[83],256],9417:[[84],256],9418:[[85],256],9419:[[86],256],9420:[[87],256],9421:[[88],256],9422:[[89],256],9423:[[90],256],9424:[[97],256],9425:[[98],256],9426:[[99],256],9427:[[100],256],9428:[[101],256],9429:[[102],256],9430:[[103],256],9431:[[104],256],9432:[[105],256],9433:[[106],256],9434:[[107],256],9435:[[108],256],9436:[[109],256],9437:[[110],256],9438:[[111],256],9439:[[112],256],9440:[[113],256],9441:[[114],256],9442:[[115],256],9443:[[116],256],9444:[[117],256],9445:[[118],256],9446:[[119],256],9447:[[120],256],9448:[[121],256],9449:[[122],256],9450:[[48],256]}, + 10752:{10764:[[8747,8747,8747,8747],256],10868:[[58,58,61],256],10869:[[61,61],256],10870:[[61,61,61],256],10972:[[10973,824],512]}, + 11264:{11388:[[106],256],11389:[[86],256],11503:[,230],11504:[,230],11505:[,230]}, + 11520:{11631:[[11617],256],11647:[,9],11744:[,230],11745:[,230],11746:[,230],11747:[,230],11748:[,230],11749:[,230],11750:[,230],11751:[,230],11752:[,230],11753:[,230],11754:[,230],11755:[,230],11756:[,230],11757:[,230],11758:[,230],11759:[,230],11760:[,230],11761:[,230],11762:[,230],11763:[,230],11764:[,230],11765:[,230],11766:[,230],11767:[,230],11768:[,230],11769:[,230],11770:[,230],11771:[,230],11772:[,230],11773:[,230],11774:[,230],11775:[,230]}, + 11776:{11935:[[27597],256],12019:[[40863],256]}, + 12032:{12032:[[19968],256],12033:[[20008],256],12034:[[20022],256],12035:[[20031],256],12036:[[20057],256],12037:[[20101],256],12038:[[20108],256],12039:[[20128],256],12040:[[20154],256],12041:[[20799],256],12042:[[20837],256],12043:[[20843],256],12044:[[20866],256],12045:[[20886],256],12046:[[20907],256],12047:[[20960],256],12048:[[20981],256],12049:[[20992],256],12050:[[21147],256],12051:[[21241],256],12052:[[21269],256],12053:[[21274],256],12054:[[21304],256],12055:[[21313],256],12056:[[21340],256],12057:[[21353],256],12058:[[21378],256],12059:[[21430],256],12060:[[21448],256],12061:[[21475],256],12062:[[22231],256],12063:[[22303],256],12064:[[22763],256],12065:[[22786],256],12066:[[22794],256],12067:[[22805],256],12068:[[22823],256],12069:[[22899],256],12070:[[23376],256],12071:[[23424],256],12072:[[23544],256],12073:[[23567],256],12074:[[23586],256],12075:[[23608],256],12076:[[23662],256],12077:[[23665],256],12078:[[24027],256],12079:[[24037],256],12080:[[24049],256],12081:[[24062],256],12082:[[24178],256],12083:[[24186],256],12084:[[24191],256],12085:[[24308],256],12086:[[24318],256],12087:[[24331],256],12088:[[24339],256],12089:[[24400],256],12090:[[24417],256],12091:[[24435],256],12092:[[24515],256],12093:[[25096],256],12094:[[25142],256],12095:[[25163],256],12096:[[25903],256],12097:[[25908],256],12098:[[25991],256],12099:[[26007],256],12100:[[26020],256],12101:[[26041],256],12102:[[26080],256],12103:[[26085],256],12104:[[26352],256],12105:[[26376],256],12106:[[26408],256],12107:[[27424],256],12108:[[27490],256],12109:[[27513],256],12110:[[27571],256],12111:[[27595],256],12112:[[27604],256],12113:[[27611],256],12114:[[27663],256],12115:[[27668],256],12116:[[27700],256],12117:[[28779],256],12118:[[29226],256],12119:[[29238],256],12120:[[29243],256],12121:[[29247],256],12122:[[29255],256],12123:[[29273],256],12124:[[29275],256],12125:[[29356],256],12126:[[29572],256],12127:[[29577],256],12128:[[29916],256],12129:[[29926],256],12130:[[29976],256],12131:[[29983],256],12132:[[29992],256],12133:[[30000],256],12134:[[30091],256],12135:[[30098],256],12136:[[30326],256],12137:[[30333],256],12138:[[30382],256],12139:[[30399],256],12140:[[30446],256],12141:[[30683],256],12142:[[30690],256],12143:[[30707],256],12144:[[31034],256],12145:[[31160],256],12146:[[31166],256],12147:[[31348],256],12148:[[31435],256],12149:[[31481],256],12150:[[31859],256],12151:[[31992],256],12152:[[32566],256],12153:[[32593],256],12154:[[32650],256],12155:[[32701],256],12156:[[32769],256],12157:[[32780],256],12158:[[32786],256],12159:[[32819],256],12160:[[32895],256],12161:[[32905],256],12162:[[33251],256],12163:[[33258],256],12164:[[33267],256],12165:[[33276],256],12166:[[33292],256],12167:[[33307],256],12168:[[33311],256],12169:[[33390],256],12170:[[33394],256],12171:[[33400],256],12172:[[34381],256],12173:[[34411],256],12174:[[34880],256],12175:[[34892],256],12176:[[34915],256],12177:[[35198],256],12178:[[35211],256],12179:[[35282],256],12180:[[35328],256],12181:[[35895],256],12182:[[35910],256],12183:[[35925],256],12184:[[35960],256],12185:[[35997],256],12186:[[36196],256],12187:[[36208],256],12188:[[36275],256],12189:[[36523],256],12190:[[36554],256],12191:[[36763],256],12192:[[36784],256],12193:[[36789],256],12194:[[37009],256],12195:[[37193],256],12196:[[37318],256],12197:[[37324],256],12198:[[37329],256],12199:[[38263],256],12200:[[38272],256],12201:[[38428],256],12202:[[38582],256],12203:[[38585],256],12204:[[38632],256],12205:[[38737],256],12206:[[38750],256],12207:[[38754],256],12208:[[38761],256],12209:[[38859],256],12210:[[38893],256],12211:[[38899],256],12212:[[38913],256],12213:[[39080],256],12214:[[39131],256],12215:[[39135],256],12216:[[39318],256],12217:[[39321],256],12218:[[39340],256],12219:[[39592],256],12220:[[39640],256],12221:[[39647],256],12222:[[39717],256],12223:[[39727],256],12224:[[39730],256],12225:[[39740],256],12226:[[39770],256],12227:[[40165],256],12228:[[40565],256],12229:[[40575],256],12230:[[40613],256],12231:[[40635],256],12232:[[40643],256],12233:[[40653],256],12234:[[40657],256],12235:[[40697],256],12236:[[40701],256],12237:[[40718],256],12238:[[40723],256],12239:[[40736],256],12240:[[40763],256],12241:[[40778],256],12242:[[40786],256],12243:[[40845],256],12244:[[40860],256],12245:[[40864],256]}, + 12288:{12288:[[32],256],12330:[,218],12331:[,228],12332:[,232],12333:[,222],12334:[,224],12335:[,224],12342:[[12306],256],12344:[[21313],256],12345:[[21316],256],12346:[[21317],256],12358:[,,{12441:12436}],12363:[,,{12441:12364}],12364:[[12363,12441]],12365:[,,{12441:12366}],12366:[[12365,12441]],12367:[,,{12441:12368}],12368:[[12367,12441]],12369:[,,{12441:12370}],12370:[[12369,12441]],12371:[,,{12441:12372}],12372:[[12371,12441]],12373:[,,{12441:12374}],12374:[[12373,12441]],12375:[,,{12441:12376}],12376:[[12375,12441]],12377:[,,{12441:12378}],12378:[[12377,12441]],12379:[,,{12441:12380}],12380:[[12379,12441]],12381:[,,{12441:12382}],12382:[[12381,12441]],12383:[,,{12441:12384}],12384:[[12383,12441]],12385:[,,{12441:12386}],12386:[[12385,12441]],12388:[,,{12441:12389}],12389:[[12388,12441]],12390:[,,{12441:12391}],12391:[[12390,12441]],12392:[,,{12441:12393}],12393:[[12392,12441]],12399:[,,{12441:12400,12442:12401}],12400:[[12399,12441]],12401:[[12399,12442]],12402:[,,{12441:12403,12442:12404}],12403:[[12402,12441]],12404:[[12402,12442]],12405:[,,{12441:12406,12442:12407}],12406:[[12405,12441]],12407:[[12405,12442]],12408:[,,{12441:12409,12442:12410}],12409:[[12408,12441]],12410:[[12408,12442]],12411:[,,{12441:12412,12442:12413}],12412:[[12411,12441]],12413:[[12411,12442]],12436:[[12358,12441]],12441:[,8],12442:[,8],12443:[[32,12441],256],12444:[[32,12442],256],12445:[,,{12441:12446}],12446:[[12445,12441]],12447:[[12424,12426],256],12454:[,,{12441:12532}],12459:[,,{12441:12460}],12460:[[12459,12441]],12461:[,,{12441:12462}],12462:[[12461,12441]],12463:[,,{12441:12464}],12464:[[12463,12441]],12465:[,,{12441:12466}],12466:[[12465,12441]],12467:[,,{12441:12468}],12468:[[12467,12441]],12469:[,,{12441:12470}],12470:[[12469,12441]],12471:[,,{12441:12472}],12472:[[12471,12441]],12473:[,,{12441:12474}],12474:[[12473,12441]],12475:[,,{12441:12476}],12476:[[12475,12441]],12477:[,,{12441:12478}],12478:[[12477,12441]],12479:[,,{12441:12480}],12480:[[12479,12441]],12481:[,,{12441:12482}],12482:[[12481,12441]],12484:[,,{12441:12485}],12485:[[12484,12441]],12486:[,,{12441:12487}],12487:[[12486,12441]],12488:[,,{12441:12489}],12489:[[12488,12441]],12495:[,,{12441:12496,12442:12497}],12496:[[12495,12441]],12497:[[12495,12442]],12498:[,,{12441:12499,12442:12500}],12499:[[12498,12441]],12500:[[12498,12442]],12501:[,,{12441:12502,12442:12503}],12502:[[12501,12441]],12503:[[12501,12442]],12504:[,,{12441:12505,12442:12506}],12505:[[12504,12441]],12506:[[12504,12442]],12507:[,,{12441:12508,12442:12509}],12508:[[12507,12441]],12509:[[12507,12442]],12527:[,,{12441:12535}],12528:[,,{12441:12536}],12529:[,,{12441:12537}],12530:[,,{12441:12538}],12532:[[12454,12441]],12535:[[12527,12441]],12536:[[12528,12441]],12537:[[12529,12441]],12538:[[12530,12441]],12541:[,,{12441:12542}],12542:[[12541,12441]],12543:[[12467,12488],256]}, + 12544:{12593:[[4352],256],12594:[[4353],256],12595:[[4522],256],12596:[[4354],256],12597:[[4524],256],12598:[[4525],256],12599:[[4355],256],12600:[[4356],256],12601:[[4357],256],12602:[[4528],256],12603:[[4529],256],12604:[[4530],256],12605:[[4531],256],12606:[[4532],256],12607:[[4533],256],12608:[[4378],256],12609:[[4358],256],12610:[[4359],256],12611:[[4360],256],12612:[[4385],256],12613:[[4361],256],12614:[[4362],256],12615:[[4363],256],12616:[[4364],256],12617:[[4365],256],12618:[[4366],256],12619:[[4367],256],12620:[[4368],256],12621:[[4369],256],12622:[[4370],256],12623:[[4449],256],12624:[[4450],256],12625:[[4451],256],12626:[[4452],256],12627:[[4453],256],12628:[[4454],256],12629:[[4455],256],12630:[[4456],256],12631:[[4457],256],12632:[[4458],256],12633:[[4459],256],12634:[[4460],256],12635:[[4461],256],12636:[[4462],256],12637:[[4463],256],12638:[[4464],256],12639:[[4465],256],12640:[[4466],256],12641:[[4467],256],12642:[[4468],256],12643:[[4469],256],12644:[[4448],256],12645:[[4372],256],12646:[[4373],256],12647:[[4551],256],12648:[[4552],256],12649:[[4556],256],12650:[[4558],256],12651:[[4563],256],12652:[[4567],256],12653:[[4569],256],12654:[[4380],256],12655:[[4573],256],12656:[[4575],256],12657:[[4381],256],12658:[[4382],256],12659:[[4384],256],12660:[[4386],256],12661:[[4387],256],12662:[[4391],256],12663:[[4393],256],12664:[[4395],256],12665:[[4396],256],12666:[[4397],256],12667:[[4398],256],12668:[[4399],256],12669:[[4402],256],12670:[[4406],256],12671:[[4416],256],12672:[[4423],256],12673:[[4428],256],12674:[[4593],256],12675:[[4594],256],12676:[[4439],256],12677:[[4440],256],12678:[[4441],256],12679:[[4484],256],12680:[[4485],256],12681:[[4488],256],12682:[[4497],256],12683:[[4498],256],12684:[[4500],256],12685:[[4510],256],12686:[[4513],256],12690:[[19968],256],12691:[[20108],256],12692:[[19977],256],12693:[[22235],256],12694:[[19978],256],12695:[[20013],256],12696:[[19979],256],12697:[[30002],256],12698:[[20057],256],12699:[[19993],256],12700:[[19969],256],12701:[[22825],256],12702:[[22320],256],12703:[[20154],256]}, + 12800:{12800:[[40,4352,41],256],12801:[[40,4354,41],256],12802:[[40,4355,41],256],12803:[[40,4357,41],256],12804:[[40,4358,41],256],12805:[[40,4359,41],256],12806:[[40,4361,41],256],12807:[[40,4363,41],256],12808:[[40,4364,41],256],12809:[[40,4366,41],256],12810:[[40,4367,41],256],12811:[[40,4368,41],256],12812:[[40,4369,41],256],12813:[[40,4370,41],256],12814:[[40,4352,4449,41],256],12815:[[40,4354,4449,41],256],12816:[[40,4355,4449,41],256],12817:[[40,4357,4449,41],256],12818:[[40,4358,4449,41],256],12819:[[40,4359,4449,41],256],12820:[[40,4361,4449,41],256],12821:[[40,4363,4449,41],256],12822:[[40,4364,4449,41],256],12823:[[40,4366,4449,41],256],12824:[[40,4367,4449,41],256],12825:[[40,4368,4449,41],256],12826:[[40,4369,4449,41],256],12827:[[40,4370,4449,41],256],12828:[[40,4364,4462,41],256],12829:[[40,4363,4457,4364,4453,4523,41],256],12830:[[40,4363,4457,4370,4462,41],256],12832:[[40,19968,41],256],12833:[[40,20108,41],256],12834:[[40,19977,41],256],12835:[[40,22235,41],256],12836:[[40,20116,41],256],12837:[[40,20845,41],256],12838:[[40,19971,41],256],12839:[[40,20843,41],256],12840:[[40,20061,41],256],12841:[[40,21313,41],256],12842:[[40,26376,41],256],12843:[[40,28779,41],256],12844:[[40,27700,41],256],12845:[[40,26408,41],256],12846:[[40,37329,41],256],12847:[[40,22303,41],256],12848:[[40,26085,41],256],12849:[[40,26666,41],256],12850:[[40,26377,41],256],12851:[[40,31038,41],256],12852:[[40,21517,41],256],12853:[[40,29305,41],256],12854:[[40,36001,41],256],12855:[[40,31069,41],256],12856:[[40,21172,41],256],12857:[[40,20195,41],256],12858:[[40,21628,41],256],12859:[[40,23398,41],256],12860:[[40,30435,41],256],12861:[[40,20225,41],256],12862:[[40,36039,41],256],12863:[[40,21332,41],256],12864:[[40,31085,41],256],12865:[[40,20241,41],256],12866:[[40,33258,41],256],12867:[[40,33267,41],256],12868:[[21839],256],12869:[[24188],256],12870:[[25991],256],12871:[[31631],256],12880:[[80,84,69],256],12881:[[50,49],256],12882:[[50,50],256],12883:[[50,51],256],12884:[[50,52],256],12885:[[50,53],256],12886:[[50,54],256],12887:[[50,55],256],12888:[[50,56],256],12889:[[50,57],256],12890:[[51,48],256],12891:[[51,49],256],12892:[[51,50],256],12893:[[51,51],256],12894:[[51,52],256],12895:[[51,53],256],12896:[[4352],256],12897:[[4354],256],12898:[[4355],256],12899:[[4357],256],12900:[[4358],256],12901:[[4359],256],12902:[[4361],256],12903:[[4363],256],12904:[[4364],256],12905:[[4366],256],12906:[[4367],256],12907:[[4368],256],12908:[[4369],256],12909:[[4370],256],12910:[[4352,4449],256],12911:[[4354,4449],256],12912:[[4355,4449],256],12913:[[4357,4449],256],12914:[[4358,4449],256],12915:[[4359,4449],256],12916:[[4361,4449],256],12917:[[4363,4449],256],12918:[[4364,4449],256],12919:[[4366,4449],256],12920:[[4367,4449],256],12921:[[4368,4449],256],12922:[[4369,4449],256],12923:[[4370,4449],256],12924:[[4366,4449,4535,4352,4457],256],12925:[[4364,4462,4363,4468],256],12926:[[4363,4462],256],12928:[[19968],256],12929:[[20108],256],12930:[[19977],256],12931:[[22235],256],12932:[[20116],256],12933:[[20845],256],12934:[[19971],256],12935:[[20843],256],12936:[[20061],256],12937:[[21313],256],12938:[[26376],256],12939:[[28779],256],12940:[[27700],256],12941:[[26408],256],12942:[[37329],256],12943:[[22303],256],12944:[[26085],256],12945:[[26666],256],12946:[[26377],256],12947:[[31038],256],12948:[[21517],256],12949:[[29305],256],12950:[[36001],256],12951:[[31069],256],12952:[[21172],256],12953:[[31192],256],12954:[[30007],256],12955:[[22899],256],12956:[[36969],256],12957:[[20778],256],12958:[[21360],256],12959:[[27880],256],12960:[[38917],256],12961:[[20241],256],12962:[[20889],256],12963:[[27491],256],12964:[[19978],256],12965:[[20013],256],12966:[[19979],256],12967:[[24038],256],12968:[[21491],256],12969:[[21307],256],12970:[[23447],256],12971:[[23398],256],12972:[[30435],256],12973:[[20225],256],12974:[[36039],256],12975:[[21332],256],12976:[[22812],256],12977:[[51,54],256],12978:[[51,55],256],12979:[[51,56],256],12980:[[51,57],256],12981:[[52,48],256],12982:[[52,49],256],12983:[[52,50],256],12984:[[52,51],256],12985:[[52,52],256],12986:[[52,53],256],12987:[[52,54],256],12988:[[52,55],256],12989:[[52,56],256],12990:[[52,57],256],12991:[[53,48],256],12992:[[49,26376],256],12993:[[50,26376],256],12994:[[51,26376],256],12995:[[52,26376],256],12996:[[53,26376],256],12997:[[54,26376],256],12998:[[55,26376],256],12999:[[56,26376],256],13000:[[57,26376],256],13001:[[49,48,26376],256],13002:[[49,49,26376],256],13003:[[49,50,26376],256],13004:[[72,103],256],13005:[[101,114,103],256],13006:[[101,86],256],13007:[[76,84,68],256],13008:[[12450],256],13009:[[12452],256],13010:[[12454],256],13011:[[12456],256],13012:[[12458],256],13013:[[12459],256],13014:[[12461],256],13015:[[12463],256],13016:[[12465],256],13017:[[12467],256],13018:[[12469],256],13019:[[12471],256],13020:[[12473],256],13021:[[12475],256],13022:[[12477],256],13023:[[12479],256],13024:[[12481],256],13025:[[12484],256],13026:[[12486],256],13027:[[12488],256],13028:[[12490],256],13029:[[12491],256],13030:[[12492],256],13031:[[12493],256],13032:[[12494],256],13033:[[12495],256],13034:[[12498],256],13035:[[12501],256],13036:[[12504],256],13037:[[12507],256],13038:[[12510],256],13039:[[12511],256],13040:[[12512],256],13041:[[12513],256],13042:[[12514],256],13043:[[12516],256],13044:[[12518],256],13045:[[12520],256],13046:[[12521],256],13047:[[12522],256],13048:[[12523],256],13049:[[12524],256],13050:[[12525],256],13051:[[12527],256],13052:[[12528],256],13053:[[12529],256],13054:[[12530],256]}, + 13056:{13056:[[12450,12497,12540,12488],256],13057:[[12450,12523,12501,12449],256],13058:[[12450,12531,12506,12450],256],13059:[[12450,12540,12523],256],13060:[[12452,12491,12531,12464],256],13061:[[12452,12531,12481],256],13062:[[12454,12457,12531],256],13063:[[12456,12473,12463,12540,12489],256],13064:[[12456,12540,12459,12540],256],13065:[[12458,12531,12473],256],13066:[[12458,12540,12512],256],13067:[[12459,12452,12522],256],13068:[[12459,12521,12483,12488],256],13069:[[12459,12525,12522,12540],256],13070:[[12460,12525,12531],256],13071:[[12460,12531,12510],256],13072:[[12462,12460],256],13073:[[12462,12491,12540],256],13074:[[12461,12517,12522,12540],256],13075:[[12462,12523,12480,12540],256],13076:[[12461,12525],256],13077:[[12461,12525,12464,12521,12512],256],13078:[[12461,12525,12513,12540,12488,12523],256],13079:[[12461,12525,12527,12483,12488],256],13080:[[12464,12521,12512],256],13081:[[12464,12521,12512,12488,12531],256],13082:[[12463,12523,12476,12452,12525],256],13083:[[12463,12525,12540,12493],256],13084:[[12465,12540,12473],256],13085:[[12467,12523,12490],256],13086:[[12467,12540,12509],256],13087:[[12469,12452,12463,12523],256],13088:[[12469,12531,12481,12540,12512],256],13089:[[12471,12522,12531,12464],256],13090:[[12475,12531,12481],256],13091:[[12475,12531,12488],256],13092:[[12480,12540,12473],256],13093:[[12487,12471],256],13094:[[12489,12523],256],13095:[[12488,12531],256],13096:[[12490,12494],256],13097:[[12494,12483,12488],256],13098:[[12495,12452,12484],256],13099:[[12497,12540,12475,12531,12488],256],13100:[[12497,12540,12484],256],13101:[[12496,12540,12524,12523],256],13102:[[12500,12450,12473,12488,12523],256],13103:[[12500,12463,12523],256],13104:[[12500,12467],256],13105:[[12499,12523],256],13106:[[12501,12449,12521,12483,12489],256],13107:[[12501,12451,12540,12488],256],13108:[[12502,12483,12471,12455,12523],256],13109:[[12501,12521,12531],256],13110:[[12504,12463,12479,12540,12523],256],13111:[[12506,12477],256],13112:[[12506,12491,12498],256],13113:[[12504,12523,12484],256],13114:[[12506,12531,12473],256],13115:[[12506,12540,12472],256],13116:[[12505,12540,12479],256],13117:[[12509,12452,12531,12488],256],13118:[[12508,12523,12488],256],13119:[[12507,12531],256],13120:[[12509,12531,12489],256],13121:[[12507,12540,12523],256],13122:[[12507,12540,12531],256],13123:[[12510,12452,12463,12525],256],13124:[[12510,12452,12523],256],13125:[[12510,12483,12495],256],13126:[[12510,12523,12463],256],13127:[[12510,12531,12471,12519,12531],256],13128:[[12511,12463,12525,12531],256],13129:[[12511,12522],256],13130:[[12511,12522,12496,12540,12523],256],13131:[[12513,12460],256],13132:[[12513,12460,12488,12531],256],13133:[[12513,12540,12488,12523],256],13134:[[12516,12540,12489],256],13135:[[12516,12540,12523],256],13136:[[12518,12450,12531],256],13137:[[12522,12483,12488,12523],256],13138:[[12522,12521],256],13139:[[12523,12500,12540],256],13140:[[12523,12540,12502,12523],256],13141:[[12524,12512],256],13142:[[12524,12531,12488,12466,12531],256],13143:[[12527,12483,12488],256],13144:[[48,28857],256],13145:[[49,28857],256],13146:[[50,28857],256],13147:[[51,28857],256],13148:[[52,28857],256],13149:[[53,28857],256],13150:[[54,28857],256],13151:[[55,28857],256],13152:[[56,28857],256],13153:[[57,28857],256],13154:[[49,48,28857],256],13155:[[49,49,28857],256],13156:[[49,50,28857],256],13157:[[49,51,28857],256],13158:[[49,52,28857],256],13159:[[49,53,28857],256],13160:[[49,54,28857],256],13161:[[49,55,28857],256],13162:[[49,56,28857],256],13163:[[49,57,28857],256],13164:[[50,48,28857],256],13165:[[50,49,28857],256],13166:[[50,50,28857],256],13167:[[50,51,28857],256],13168:[[50,52,28857],256],13169:[[104,80,97],256],13170:[[100,97],256],13171:[[65,85],256],13172:[[98,97,114],256],13173:[[111,86],256],13174:[[112,99],256],13175:[[100,109],256],13176:[[100,109,178],256],13177:[[100,109,179],256],13178:[[73,85],256],13179:[[24179,25104],256],13180:[[26157,21644],256],13181:[[22823,27491],256],13182:[[26126,27835],256],13183:[[26666,24335,20250,31038],256],13184:[[112,65],256],13185:[[110,65],256],13186:[[956,65],256],13187:[[109,65],256],13188:[[107,65],256],13189:[[75,66],256],13190:[[77,66],256],13191:[[71,66],256],13192:[[99,97,108],256],13193:[[107,99,97,108],256],13194:[[112,70],256],13195:[[110,70],256],13196:[[956,70],256],13197:[[956,103],256],13198:[[109,103],256],13199:[[107,103],256],13200:[[72,122],256],13201:[[107,72,122],256],13202:[[77,72,122],256],13203:[[71,72,122],256],13204:[[84,72,122],256],13205:[[956,8467],256],13206:[[109,8467],256],13207:[[100,8467],256],13208:[[107,8467],256],13209:[[102,109],256],13210:[[110,109],256],13211:[[956,109],256],13212:[[109,109],256],13213:[[99,109],256],13214:[[107,109],256],13215:[[109,109,178],256],13216:[[99,109,178],256],13217:[[109,178],256],13218:[[107,109,178],256],13219:[[109,109,179],256],13220:[[99,109,179],256],13221:[[109,179],256],13222:[[107,109,179],256],13223:[[109,8725,115],256],13224:[[109,8725,115,178],256],13225:[[80,97],256],13226:[[107,80,97],256],13227:[[77,80,97],256],13228:[[71,80,97],256],13229:[[114,97,100],256],13230:[[114,97,100,8725,115],256],13231:[[114,97,100,8725,115,178],256],13232:[[112,115],256],13233:[[110,115],256],13234:[[956,115],256],13235:[[109,115],256],13236:[[112,86],256],13237:[[110,86],256],13238:[[956,86],256],13239:[[109,86],256],13240:[[107,86],256],13241:[[77,86],256],13242:[[112,87],256],13243:[[110,87],256],13244:[[956,87],256],13245:[[109,87],256],13246:[[107,87],256],13247:[[77,87],256],13248:[[107,937],256],13249:[[77,937],256],13250:[[97,46,109,46],256],13251:[[66,113],256],13252:[[99,99],256],13253:[[99,100],256],13254:[[67,8725,107,103],256],13255:[[67,111,46],256],13256:[[100,66],256],13257:[[71,121],256],13258:[[104,97],256],13259:[[72,80],256],13260:[[105,110],256],13261:[[75,75],256],13262:[[75,77],256],13263:[[107,116],256],13264:[[108,109],256],13265:[[108,110],256],13266:[[108,111,103],256],13267:[[108,120],256],13268:[[109,98],256],13269:[[109,105,108],256],13270:[[109,111,108],256],13271:[[80,72],256],13272:[[112,46,109,46],256],13273:[[80,80,77],256],13274:[[80,82],256],13275:[[115,114],256],13276:[[83,118],256],13277:[[87,98],256],13278:[[86,8725,109],256],13279:[[65,8725,109],256],13280:[[49,26085],256],13281:[[50,26085],256],13282:[[51,26085],256],13283:[[52,26085],256],13284:[[53,26085],256],13285:[[54,26085],256],13286:[[55,26085],256],13287:[[56,26085],256],13288:[[57,26085],256],13289:[[49,48,26085],256],13290:[[49,49,26085],256],13291:[[49,50,26085],256],13292:[[49,51,26085],256],13293:[[49,52,26085],256],13294:[[49,53,26085],256],13295:[[49,54,26085],256],13296:[[49,55,26085],256],13297:[[49,56,26085],256],13298:[[49,57,26085],256],13299:[[50,48,26085],256],13300:[[50,49,26085],256],13301:[[50,50,26085],256],13302:[[50,51,26085],256],13303:[[50,52,26085],256],13304:[[50,53,26085],256],13305:[[50,54,26085],256],13306:[[50,55,26085],256],13307:[[50,56,26085],256],13308:[[50,57,26085],256],13309:[[51,48,26085],256],13310:[[51,49,26085],256],13311:[[103,97,108],256]}, + 42496:{42607:[,230],42612:[,230],42613:[,230],42614:[,230],42615:[,230],42616:[,230],42617:[,230],42618:[,230],42619:[,230],42620:[,230],42621:[,230],42655:[,230],42736:[,230],42737:[,230]}, + 42752:{42864:[[42863],256],43000:[[294],256],43001:[[339],256]}, + 43008:{43014:[,9],43204:[,9],43232:[,230],43233:[,230],43234:[,230],43235:[,230],43236:[,230],43237:[,230],43238:[,230],43239:[,230],43240:[,230],43241:[,230],43242:[,230],43243:[,230],43244:[,230],43245:[,230],43246:[,230],43247:[,230],43248:[,230],43249:[,230]}, + 43264:{43307:[,220],43308:[,220],43309:[,220],43347:[,9],43443:[,7],43456:[,9]}, + 43520:{43696:[,230],43698:[,230],43699:[,230],43700:[,220],43703:[,230],43704:[,230],43710:[,230],43711:[,230],43713:[,230],43766:[,9]}, + 43776:{44013:[,9]}, + 53504:{119134:[[119127,119141],512],119135:[[119128,119141],512],119136:[[119135,119150],512],119137:[[119135,119151],512],119138:[[119135,119152],512],119139:[[119135,119153],512],119140:[[119135,119154],512],119141:[,216],119142:[,216],119143:[,1],119144:[,1],119145:[,1],119149:[,226],119150:[,216],119151:[,216],119152:[,216],119153:[,216],119154:[,216],119163:[,220],119164:[,220],119165:[,220],119166:[,220],119167:[,220],119168:[,220],119169:[,220],119170:[,220],119173:[,230],119174:[,230],119175:[,230],119176:[,230],119177:[,230],119178:[,220],119179:[,220],119210:[,230],119211:[,230],119212:[,230],119213:[,230],119227:[[119225,119141],512],119228:[[119226,119141],512],119229:[[119227,119150],512],119230:[[119228,119150],512],119231:[[119227,119151],512],119232:[[119228,119151],512]}, + 53760:{119362:[,230],119363:[,230],119364:[,230]}, + 54272:{119808:[[65],256],119809:[[66],256],119810:[[67],256],119811:[[68],256],119812:[[69],256],119813:[[70],256],119814:[[71],256],119815:[[72],256],119816:[[73],256],119817:[[74],256],119818:[[75],256],119819:[[76],256],119820:[[77],256],119821:[[78],256],119822:[[79],256],119823:[[80],256],119824:[[81],256],119825:[[82],256],119826:[[83],256],119827:[[84],256],119828:[[85],256],119829:[[86],256],119830:[[87],256],119831:[[88],256],119832:[[89],256],119833:[[90],256],119834:[[97],256],119835:[[98],256],119836:[[99],256],119837:[[100],256],119838:[[101],256],119839:[[102],256],119840:[[103],256],119841:[[104],256],119842:[[105],256],119843:[[106],256],119844:[[107],256],119845:[[108],256],119846:[[109],256],119847:[[110],256],119848:[[111],256],119849:[[112],256],119850:[[113],256],119851:[[114],256],119852:[[115],256],119853:[[116],256],119854:[[117],256],119855:[[118],256],119856:[[119],256],119857:[[120],256],119858:[[121],256],119859:[[122],256],119860:[[65],256],119861:[[66],256],119862:[[67],256],119863:[[68],256],119864:[[69],256],119865:[[70],256],119866:[[71],256],119867:[[72],256],119868:[[73],256],119869:[[74],256],119870:[[75],256],119871:[[76],256],119872:[[77],256],119873:[[78],256],119874:[[79],256],119875:[[80],256],119876:[[81],256],119877:[[82],256],119878:[[83],256],119879:[[84],256],119880:[[85],256],119881:[[86],256],119882:[[87],256],119883:[[88],256],119884:[[89],256],119885:[[90],256],119886:[[97],256],119887:[[98],256],119888:[[99],256],119889:[[100],256],119890:[[101],256],119891:[[102],256],119892:[[103],256],119894:[[105],256],119895:[[106],256],119896:[[107],256],119897:[[108],256],119898:[[109],256],119899:[[110],256],119900:[[111],256],119901:[[112],256],119902:[[113],256],119903:[[114],256],119904:[[115],256],119905:[[116],256],119906:[[117],256],119907:[[118],256],119908:[[119],256],119909:[[120],256],119910:[[121],256],119911:[[122],256],119912:[[65],256],119913:[[66],256],119914:[[67],256],119915:[[68],256],119916:[[69],256],119917:[[70],256],119918:[[71],256],119919:[[72],256],119920:[[73],256],119921:[[74],256],119922:[[75],256],119923:[[76],256],119924:[[77],256],119925:[[78],256],119926:[[79],256],119927:[[80],256],119928:[[81],256],119929:[[82],256],119930:[[83],256],119931:[[84],256],119932:[[85],256],119933:[[86],256],119934:[[87],256],119935:[[88],256],119936:[[89],256],119937:[[90],256],119938:[[97],256],119939:[[98],256],119940:[[99],256],119941:[[100],256],119942:[[101],256],119943:[[102],256],119944:[[103],256],119945:[[104],256],119946:[[105],256],119947:[[106],256],119948:[[107],256],119949:[[108],256],119950:[[109],256],119951:[[110],256],119952:[[111],256],119953:[[112],256],119954:[[113],256],119955:[[114],256],119956:[[115],256],119957:[[116],256],119958:[[117],256],119959:[[118],256],119960:[[119],256],119961:[[120],256],119962:[[121],256],119963:[[122],256],119964:[[65],256],119966:[[67],256],119967:[[68],256],119970:[[71],256],119973:[[74],256],119974:[[75],256],119977:[[78],256],119978:[[79],256],119979:[[80],256],119980:[[81],256],119982:[[83],256],119983:[[84],256],119984:[[85],256],119985:[[86],256],119986:[[87],256],119987:[[88],256],119988:[[89],256],119989:[[90],256],119990:[[97],256],119991:[[98],256],119992:[[99],256],119993:[[100],256],119995:[[102],256],119997:[[104],256],119998:[[105],256],119999:[[106],256],120000:[[107],256],120001:[[108],256],120002:[[109],256],120003:[[110],256],120005:[[112],256],120006:[[113],256],120007:[[114],256],120008:[[115],256],120009:[[116],256],120010:[[117],256],120011:[[118],256],120012:[[119],256],120013:[[120],256],120014:[[121],256],120015:[[122],256],120016:[[65],256],120017:[[66],256],120018:[[67],256],120019:[[68],256],120020:[[69],256],120021:[[70],256],120022:[[71],256],120023:[[72],256],120024:[[73],256],120025:[[74],256],120026:[[75],256],120027:[[76],256],120028:[[77],256],120029:[[78],256],120030:[[79],256],120031:[[80],256],120032:[[81],256],120033:[[82],256],120034:[[83],256],120035:[[84],256],120036:[[85],256],120037:[[86],256],120038:[[87],256],120039:[[88],256],120040:[[89],256],120041:[[90],256],120042:[[97],256],120043:[[98],256],120044:[[99],256],120045:[[100],256],120046:[[101],256],120047:[[102],256],120048:[[103],256],120049:[[104],256],120050:[[105],256],120051:[[106],256],120052:[[107],256],120053:[[108],256],120054:[[109],256],120055:[[110],256],120056:[[111],256],120057:[[112],256],120058:[[113],256],120059:[[114],256],120060:[[115],256],120061:[[116],256],120062:[[117],256],120063:[[118],256]}, + 54528:{120064:[[119],256],120065:[[120],256],120066:[[121],256],120067:[[122],256],120068:[[65],256],120069:[[66],256],120071:[[68],256],120072:[[69],256],120073:[[70],256],120074:[[71],256],120077:[[74],256],120078:[[75],256],120079:[[76],256],120080:[[77],256],120081:[[78],256],120082:[[79],256],120083:[[80],256],120084:[[81],256],120086:[[83],256],120087:[[84],256],120088:[[85],256],120089:[[86],256],120090:[[87],256],120091:[[88],256],120092:[[89],256],120094:[[97],256],120095:[[98],256],120096:[[99],256],120097:[[100],256],120098:[[101],256],120099:[[102],256],120100:[[103],256],120101:[[104],256],120102:[[105],256],120103:[[106],256],120104:[[107],256],120105:[[108],256],120106:[[109],256],120107:[[110],256],120108:[[111],256],120109:[[112],256],120110:[[113],256],120111:[[114],256],120112:[[115],256],120113:[[116],256],120114:[[117],256],120115:[[118],256],120116:[[119],256],120117:[[120],256],120118:[[121],256],120119:[[122],256],120120:[[65],256],120121:[[66],256],120123:[[68],256],120124:[[69],256],120125:[[70],256],120126:[[71],256],120128:[[73],256],120129:[[74],256],120130:[[75],256],120131:[[76],256],120132:[[77],256],120134:[[79],256],120138:[[83],256],120139:[[84],256],120140:[[85],256],120141:[[86],256],120142:[[87],256],120143:[[88],256],120144:[[89],256],120146:[[97],256],120147:[[98],256],120148:[[99],256],120149:[[100],256],120150:[[101],256],120151:[[102],256],120152:[[103],256],120153:[[104],256],120154:[[105],256],120155:[[106],256],120156:[[107],256],120157:[[108],256],120158:[[109],256],120159:[[110],256],120160:[[111],256],120161:[[112],256],120162:[[113],256],120163:[[114],256],120164:[[115],256],120165:[[116],256],120166:[[117],256],120167:[[118],256],120168:[[119],256],120169:[[120],256],120170:[[121],256],120171:[[122],256],120172:[[65],256],120173:[[66],256],120174:[[67],256],120175:[[68],256],120176:[[69],256],120177:[[70],256],120178:[[71],256],120179:[[72],256],120180:[[73],256],120181:[[74],256],120182:[[75],256],120183:[[76],256],120184:[[77],256],120185:[[78],256],120186:[[79],256],120187:[[80],256],120188:[[81],256],120189:[[82],256],120190:[[83],256],120191:[[84],256],120192:[[85],256],120193:[[86],256],120194:[[87],256],120195:[[88],256],120196:[[89],256],120197:[[90],256],120198:[[97],256],120199:[[98],256],120200:[[99],256],120201:[[100],256],120202:[[101],256],120203:[[102],256],120204:[[103],256],120205:[[104],256],120206:[[105],256],120207:[[106],256],120208:[[107],256],120209:[[108],256],120210:[[109],256],120211:[[110],256],120212:[[111],256],120213:[[112],256],120214:[[113],256],120215:[[114],256],120216:[[115],256],120217:[[116],256],120218:[[117],256],120219:[[118],256],120220:[[119],256],120221:[[120],256],120222:[[121],256],120223:[[122],256],120224:[[65],256],120225:[[66],256],120226:[[67],256],120227:[[68],256],120228:[[69],256],120229:[[70],256],120230:[[71],256],120231:[[72],256],120232:[[73],256],120233:[[74],256],120234:[[75],256],120235:[[76],256],120236:[[77],256],120237:[[78],256],120238:[[79],256],120239:[[80],256],120240:[[81],256],120241:[[82],256],120242:[[83],256],120243:[[84],256],120244:[[85],256],120245:[[86],256],120246:[[87],256],120247:[[88],256],120248:[[89],256],120249:[[90],256],120250:[[97],256],120251:[[98],256],120252:[[99],256],120253:[[100],256],120254:[[101],256],120255:[[102],256],120256:[[103],256],120257:[[104],256],120258:[[105],256],120259:[[106],256],120260:[[107],256],120261:[[108],256],120262:[[109],256],120263:[[110],256],120264:[[111],256],120265:[[112],256],120266:[[113],256],120267:[[114],256],120268:[[115],256],120269:[[116],256],120270:[[117],256],120271:[[118],256],120272:[[119],256],120273:[[120],256],120274:[[121],256],120275:[[122],256],120276:[[65],256],120277:[[66],256],120278:[[67],256],120279:[[68],256],120280:[[69],256],120281:[[70],256],120282:[[71],256],120283:[[72],256],120284:[[73],256],120285:[[74],256],120286:[[75],256],120287:[[76],256],120288:[[77],256],120289:[[78],256],120290:[[79],256],120291:[[80],256],120292:[[81],256],120293:[[82],256],120294:[[83],256],120295:[[84],256],120296:[[85],256],120297:[[86],256],120298:[[87],256],120299:[[88],256],120300:[[89],256],120301:[[90],256],120302:[[97],256],120303:[[98],256],120304:[[99],256],120305:[[100],256],120306:[[101],256],120307:[[102],256],120308:[[103],256],120309:[[104],256],120310:[[105],256],120311:[[106],256],120312:[[107],256],120313:[[108],256],120314:[[109],256],120315:[[110],256],120316:[[111],256],120317:[[112],256],120318:[[113],256],120319:[[114],256]}, + 54784:{120320:[[115],256],120321:[[116],256],120322:[[117],256],120323:[[118],256],120324:[[119],256],120325:[[120],256],120326:[[121],256],120327:[[122],256],120328:[[65],256],120329:[[66],256],120330:[[67],256],120331:[[68],256],120332:[[69],256],120333:[[70],256],120334:[[71],256],120335:[[72],256],120336:[[73],256],120337:[[74],256],120338:[[75],256],120339:[[76],256],120340:[[77],256],120341:[[78],256],120342:[[79],256],120343:[[80],256],120344:[[81],256],120345:[[82],256],120346:[[83],256],120347:[[84],256],120348:[[85],256],120349:[[86],256],120350:[[87],256],120351:[[88],256],120352:[[89],256],120353:[[90],256],120354:[[97],256],120355:[[98],256],120356:[[99],256],120357:[[100],256],120358:[[101],256],120359:[[102],256],120360:[[103],256],120361:[[104],256],120362:[[105],256],120363:[[106],256],120364:[[107],256],120365:[[108],256],120366:[[109],256],120367:[[110],256],120368:[[111],256],120369:[[112],256],120370:[[113],256],120371:[[114],256],120372:[[115],256],120373:[[116],256],120374:[[117],256],120375:[[118],256],120376:[[119],256],120377:[[120],256],120378:[[121],256],120379:[[122],256],120380:[[65],256],120381:[[66],256],120382:[[67],256],120383:[[68],256],120384:[[69],256],120385:[[70],256],120386:[[71],256],120387:[[72],256],120388:[[73],256],120389:[[74],256],120390:[[75],256],120391:[[76],256],120392:[[77],256],120393:[[78],256],120394:[[79],256],120395:[[80],256],120396:[[81],256],120397:[[82],256],120398:[[83],256],120399:[[84],256],120400:[[85],256],120401:[[86],256],120402:[[87],256],120403:[[88],256],120404:[[89],256],120405:[[90],256],120406:[[97],256],120407:[[98],256],120408:[[99],256],120409:[[100],256],120410:[[101],256],120411:[[102],256],120412:[[103],256],120413:[[104],256],120414:[[105],256],120415:[[106],256],120416:[[107],256],120417:[[108],256],120418:[[109],256],120419:[[110],256],120420:[[111],256],120421:[[112],256],120422:[[113],256],120423:[[114],256],120424:[[115],256],120425:[[116],256],120426:[[117],256],120427:[[118],256],120428:[[119],256],120429:[[120],256],120430:[[121],256],120431:[[122],256],120432:[[65],256],120433:[[66],256],120434:[[67],256],120435:[[68],256],120436:[[69],256],120437:[[70],256],120438:[[71],256],120439:[[72],256],120440:[[73],256],120441:[[74],256],120442:[[75],256],120443:[[76],256],120444:[[77],256],120445:[[78],256],120446:[[79],256],120447:[[80],256],120448:[[81],256],120449:[[82],256],120450:[[83],256],120451:[[84],256],120452:[[85],256],120453:[[86],256],120454:[[87],256],120455:[[88],256],120456:[[89],256],120457:[[90],256],120458:[[97],256],120459:[[98],256],120460:[[99],256],120461:[[100],256],120462:[[101],256],120463:[[102],256],120464:[[103],256],120465:[[104],256],120466:[[105],256],120467:[[106],256],120468:[[107],256],120469:[[108],256],120470:[[109],256],120471:[[110],256],120472:[[111],256],120473:[[112],256],120474:[[113],256],120475:[[114],256],120476:[[115],256],120477:[[116],256],120478:[[117],256],120479:[[118],256],120480:[[119],256],120481:[[120],256],120482:[[121],256],120483:[[122],256],120484:[[305],256],120485:[[567],256],120488:[[913],256],120489:[[914],256],120490:[[915],256],120491:[[916],256],120492:[[917],256],120493:[[918],256],120494:[[919],256],120495:[[920],256],120496:[[921],256],120497:[[922],256],120498:[[923],256],120499:[[924],256],120500:[[925],256],120501:[[926],256],120502:[[927],256],120503:[[928],256],120504:[[929],256],120505:[[1012],256],120506:[[931],256],120507:[[932],256],120508:[[933],256],120509:[[934],256],120510:[[935],256],120511:[[936],256],120512:[[937],256],120513:[[8711],256],120514:[[945],256],120515:[[946],256],120516:[[947],256],120517:[[948],256],120518:[[949],256],120519:[[950],256],120520:[[951],256],120521:[[952],256],120522:[[953],256],120523:[[954],256],120524:[[955],256],120525:[[956],256],120526:[[957],256],120527:[[958],256],120528:[[959],256],120529:[[960],256],120530:[[961],256],120531:[[962],256],120532:[[963],256],120533:[[964],256],120534:[[965],256],120535:[[966],256],120536:[[967],256],120537:[[968],256],120538:[[969],256],120539:[[8706],256],120540:[[1013],256],120541:[[977],256],120542:[[1008],256],120543:[[981],256],120544:[[1009],256],120545:[[982],256],120546:[[913],256],120547:[[914],256],120548:[[915],256],120549:[[916],256],120550:[[917],256],120551:[[918],256],120552:[[919],256],120553:[[920],256],120554:[[921],256],120555:[[922],256],120556:[[923],256],120557:[[924],256],120558:[[925],256],120559:[[926],256],120560:[[927],256],120561:[[928],256],120562:[[929],256],120563:[[1012],256],120564:[[931],256],120565:[[932],256],120566:[[933],256],120567:[[934],256],120568:[[935],256],120569:[[936],256],120570:[[937],256],120571:[[8711],256],120572:[[945],256],120573:[[946],256],120574:[[947],256],120575:[[948],256]}, + 55040:{120576:[[949],256],120577:[[950],256],120578:[[951],256],120579:[[952],256],120580:[[953],256],120581:[[954],256],120582:[[955],256],120583:[[956],256],120584:[[957],256],120585:[[958],256],120586:[[959],256],120587:[[960],256],120588:[[961],256],120589:[[962],256],120590:[[963],256],120591:[[964],256],120592:[[965],256],120593:[[966],256],120594:[[967],256],120595:[[968],256],120596:[[969],256],120597:[[8706],256],120598:[[1013],256],120599:[[977],256],120600:[[1008],256],120601:[[981],256],120602:[[1009],256],120603:[[982],256],120604:[[913],256],120605:[[914],256],120606:[[915],256],120607:[[916],256],120608:[[917],256],120609:[[918],256],120610:[[919],256],120611:[[920],256],120612:[[921],256],120613:[[922],256],120614:[[923],256],120615:[[924],256],120616:[[925],256],120617:[[926],256],120618:[[927],256],120619:[[928],256],120620:[[929],256],120621:[[1012],256],120622:[[931],256],120623:[[932],256],120624:[[933],256],120625:[[934],256],120626:[[935],256],120627:[[936],256],120628:[[937],256],120629:[[8711],256],120630:[[945],256],120631:[[946],256],120632:[[947],256],120633:[[948],256],120634:[[949],256],120635:[[950],256],120636:[[951],256],120637:[[952],256],120638:[[953],256],120639:[[954],256],120640:[[955],256],120641:[[956],256],120642:[[957],256],120643:[[958],256],120644:[[959],256],120645:[[960],256],120646:[[961],256],120647:[[962],256],120648:[[963],256],120649:[[964],256],120650:[[965],256],120651:[[966],256],120652:[[967],256],120653:[[968],256],120654:[[969],256],120655:[[8706],256],120656:[[1013],256],120657:[[977],256],120658:[[1008],256],120659:[[981],256],120660:[[1009],256],120661:[[982],256],120662:[[913],256],120663:[[914],256],120664:[[915],256],120665:[[916],256],120666:[[917],256],120667:[[918],256],120668:[[919],256],120669:[[920],256],120670:[[921],256],120671:[[922],256],120672:[[923],256],120673:[[924],256],120674:[[925],256],120675:[[926],256],120676:[[927],256],120677:[[928],256],120678:[[929],256],120679:[[1012],256],120680:[[931],256],120681:[[932],256],120682:[[933],256],120683:[[934],256],120684:[[935],256],120685:[[936],256],120686:[[937],256],120687:[[8711],256],120688:[[945],256],120689:[[946],256],120690:[[947],256],120691:[[948],256],120692:[[949],256],120693:[[950],256],120694:[[951],256],120695:[[952],256],120696:[[953],256],120697:[[954],256],120698:[[955],256],120699:[[956],256],120700:[[957],256],120701:[[958],256],120702:[[959],256],120703:[[960],256],120704:[[961],256],120705:[[962],256],120706:[[963],256],120707:[[964],256],120708:[[965],256],120709:[[966],256],120710:[[967],256],120711:[[968],256],120712:[[969],256],120713:[[8706],256],120714:[[1013],256],120715:[[977],256],120716:[[1008],256],120717:[[981],256],120718:[[1009],256],120719:[[982],256],120720:[[913],256],120721:[[914],256],120722:[[915],256],120723:[[916],256],120724:[[917],256],120725:[[918],256],120726:[[919],256],120727:[[920],256],120728:[[921],256],120729:[[922],256],120730:[[923],256],120731:[[924],256],120732:[[925],256],120733:[[926],256],120734:[[927],256],120735:[[928],256],120736:[[929],256],120737:[[1012],256],120738:[[931],256],120739:[[932],256],120740:[[933],256],120741:[[934],256],120742:[[935],256],120743:[[936],256],120744:[[937],256],120745:[[8711],256],120746:[[945],256],120747:[[946],256],120748:[[947],256],120749:[[948],256],120750:[[949],256],120751:[[950],256],120752:[[951],256],120753:[[952],256],120754:[[953],256],120755:[[954],256],120756:[[955],256],120757:[[956],256],120758:[[957],256],120759:[[958],256],120760:[[959],256],120761:[[960],256],120762:[[961],256],120763:[[962],256],120764:[[963],256],120765:[[964],256],120766:[[965],256],120767:[[966],256],120768:[[967],256],120769:[[968],256],120770:[[969],256],120771:[[8706],256],120772:[[1013],256],120773:[[977],256],120774:[[1008],256],120775:[[981],256],120776:[[1009],256],120777:[[982],256],120778:[[988],256],120779:[[989],256],120782:[[48],256],120783:[[49],256],120784:[[50],256],120785:[[51],256],120786:[[52],256],120787:[[53],256],120788:[[54],256],120789:[[55],256],120790:[[56],256],120791:[[57],256],120792:[[48],256],120793:[[49],256],120794:[[50],256],120795:[[51],256],120796:[[52],256],120797:[[53],256],120798:[[54],256],120799:[[55],256],120800:[[56],256],120801:[[57],256],120802:[[48],256],120803:[[49],256],120804:[[50],256],120805:[[51],256],120806:[[52],256],120807:[[53],256],120808:[[54],256],120809:[[55],256],120810:[[56],256],120811:[[57],256],120812:[[48],256],120813:[[49],256],120814:[[50],256],120815:[[51],256],120816:[[52],256],120817:[[53],256],120818:[[54],256],120819:[[55],256],120820:[[56],256],120821:[[57],256],120822:[[48],256],120823:[[49],256],120824:[[50],256],120825:[[51],256],120826:[[52],256],120827:[[53],256],120828:[[54],256],120829:[[55],256],120830:[[56],256],120831:[[57],256]}, + 60928:{126464:[[1575],256],126465:[[1576],256],126466:[[1580],256],126467:[[1583],256],126469:[[1608],256],126470:[[1586],256],126471:[[1581],256],126472:[[1591],256],126473:[[1610],256],126474:[[1603],256],126475:[[1604],256],126476:[[1605],256],126477:[[1606],256],126478:[[1587],256],126479:[[1593],256],126480:[[1601],256],126481:[[1589],256],126482:[[1602],256],126483:[[1585],256],126484:[[1588],256],126485:[[1578],256],126486:[[1579],256],126487:[[1582],256],126488:[[1584],256],126489:[[1590],256],126490:[[1592],256],126491:[[1594],256],126492:[[1646],256],126493:[[1722],256],126494:[[1697],256],126495:[[1647],256],126497:[[1576],256],126498:[[1580],256],126500:[[1607],256],126503:[[1581],256],126505:[[1610],256],126506:[[1603],256],126507:[[1604],256],126508:[[1605],256],126509:[[1606],256],126510:[[1587],256],126511:[[1593],256],126512:[[1601],256],126513:[[1589],256],126514:[[1602],256],126516:[[1588],256],126517:[[1578],256],126518:[[1579],256],126519:[[1582],256],126521:[[1590],256],126523:[[1594],256],126530:[[1580],256],126535:[[1581],256],126537:[[1610],256],126539:[[1604],256],126541:[[1606],256],126542:[[1587],256],126543:[[1593],256],126545:[[1589],256],126546:[[1602],256],126548:[[1588],256],126551:[[1582],256],126553:[[1590],256],126555:[[1594],256],126557:[[1722],256],126559:[[1647],256],126561:[[1576],256],126562:[[1580],256],126564:[[1607],256],126567:[[1581],256],126568:[[1591],256],126569:[[1610],256],126570:[[1603],256],126572:[[1605],256],126573:[[1606],256],126574:[[1587],256],126575:[[1593],256],126576:[[1601],256],126577:[[1589],256],126578:[[1602],256],126580:[[1588],256],126581:[[1578],256],126582:[[1579],256],126583:[[1582],256],126585:[[1590],256],126586:[[1592],256],126587:[[1594],256],126588:[[1646],256],126590:[[1697],256],126592:[[1575],256],126593:[[1576],256],126594:[[1580],256],126595:[[1583],256],126596:[[1607],256],126597:[[1608],256],126598:[[1586],256],126599:[[1581],256],126600:[[1591],256],126601:[[1610],256],126603:[[1604],256],126604:[[1605],256],126605:[[1606],256],126606:[[1587],256],126607:[[1593],256],126608:[[1601],256],126609:[[1589],256],126610:[[1602],256],126611:[[1585],256],126612:[[1588],256],126613:[[1578],256],126614:[[1579],256],126615:[[1582],256],126616:[[1584],256],126617:[[1590],256],126618:[[1592],256],126619:[[1594],256],126625:[[1576],256],126626:[[1580],256],126627:[[1583],256],126629:[[1608],256],126630:[[1586],256],126631:[[1581],256],126632:[[1591],256],126633:[[1610],256],126635:[[1604],256],126636:[[1605],256],126637:[[1606],256],126638:[[1587],256],126639:[[1593],256],126640:[[1601],256],126641:[[1589],256],126642:[[1602],256],126643:[[1585],256],126644:[[1588],256],126645:[[1578],256],126646:[[1579],256],126647:[[1582],256],126648:[[1584],256],126649:[[1590],256],126650:[[1592],256],126651:[[1594],256]}, + 61696:{127232:[[48,46],256],127233:[[48,44],256],127234:[[49,44],256],127235:[[50,44],256],127236:[[51,44],256],127237:[[52,44],256],127238:[[53,44],256],127239:[[54,44],256],127240:[[55,44],256],127241:[[56,44],256],127242:[[57,44],256],127248:[[40,65,41],256],127249:[[40,66,41],256],127250:[[40,67,41],256],127251:[[40,68,41],256],127252:[[40,69,41],256],127253:[[40,70,41],256],127254:[[40,71,41],256],127255:[[40,72,41],256],127256:[[40,73,41],256],127257:[[40,74,41],256],127258:[[40,75,41],256],127259:[[40,76,41],256],127260:[[40,77,41],256],127261:[[40,78,41],256],127262:[[40,79,41],256],127263:[[40,80,41],256],127264:[[40,81,41],256],127265:[[40,82,41],256],127266:[[40,83,41],256],127267:[[40,84,41],256],127268:[[40,85,41],256],127269:[[40,86,41],256],127270:[[40,87,41],256],127271:[[40,88,41],256],127272:[[40,89,41],256],127273:[[40,90,41],256],127274:[[12308,83,12309],256],127275:[[67],256],127276:[[82],256],127277:[[67,68],256],127278:[[87,90],256],127280:[[65],256],127281:[[66],256],127282:[[67],256],127283:[[68],256],127284:[[69],256],127285:[[70],256],127286:[[71],256],127287:[[72],256],127288:[[73],256],127289:[[74],256],127290:[[75],256],127291:[[76],256],127292:[[77],256],127293:[[78],256],127294:[[79],256],127295:[[80],256],127296:[[81],256],127297:[[82],256],127298:[[83],256],127299:[[84],256],127300:[[85],256],127301:[[86],256],127302:[[87],256],127303:[[88],256],127304:[[89],256],127305:[[90],256],127306:[[72,86],256],127307:[[77,86],256],127308:[[83,68],256],127309:[[83,83],256],127310:[[80,80,86],256],127311:[[87,67],256],127338:[[77,67],256],127339:[[77,68],256],127376:[[68,74],256]}, + 61952:{127488:[[12411,12363],256],127489:[[12467,12467],256],127490:[[12469],256],127504:[[25163],256],127505:[[23383],256],127506:[[21452],256],127507:[[12487],256],127508:[[20108],256],127509:[[22810],256],127510:[[35299],256],127511:[[22825],256],127512:[[20132],256],127513:[[26144],256],127514:[[28961],256],127515:[[26009],256],127516:[[21069],256],127517:[[24460],256],127518:[[20877],256],127519:[[26032],256],127520:[[21021],256],127521:[[32066],256],127522:[[29983],256],127523:[[36009],256],127524:[[22768],256],127525:[[21561],256],127526:[[28436],256],127527:[[25237],256],127528:[[25429],256],127529:[[19968],256],127530:[[19977],256],127531:[[36938],256],127532:[[24038],256],127533:[[20013],256],127534:[[21491],256],127535:[[25351],256],127536:[[36208],256],127537:[[25171],256],127538:[[31105],256],127539:[[31354],256],127540:[[21512],256],127541:[[28288],256],127542:[[26377],256],127543:[[26376],256],127544:[[30003],256],127545:[[21106],256],127546:[[21942],256],127552:[[12308,26412,12309],256],127553:[[12308,19977,12309],256],127554:[[12308,20108,12309],256],127555:[[12308,23433,12309],256],127556:[[12308,28857,12309],256],127557:[[12308,25171,12309],256],127558:[[12308,30423,12309],256],127559:[[12308,21213,12309],256],127560:[[12308,25943,12309],256],127568:[[24471],256],127569:[[21487],256]}, + 63488:{194560:[[20029]],194561:[[20024]],194562:[[20033]],194563:[[131362]],194564:[[20320]],194565:[[20398]],194566:[[20411]],194567:[[20482]],194568:[[20602]],194569:[[20633]],194570:[[20711]],194571:[[20687]],194572:[[13470]],194573:[[132666]],194574:[[20813]],194575:[[20820]],194576:[[20836]],194577:[[20855]],194578:[[132380]],194579:[[13497]],194580:[[20839]],194581:[[20877]],194582:[[132427]],194583:[[20887]],194584:[[20900]],194585:[[20172]],194586:[[20908]],194587:[[20917]],194588:[[168415]],194589:[[20981]],194590:[[20995]],194591:[[13535]],194592:[[21051]],194593:[[21062]],194594:[[21106]],194595:[[21111]],194596:[[13589]],194597:[[21191]],194598:[[21193]],194599:[[21220]],194600:[[21242]],194601:[[21253]],194602:[[21254]],194603:[[21271]],194604:[[21321]],194605:[[21329]],194606:[[21338]],194607:[[21363]],194608:[[21373]],194609:[[21375]],194610:[[21375]],194611:[[21375]],194612:[[133676]],194613:[[28784]],194614:[[21450]],194615:[[21471]],194616:[[133987]],194617:[[21483]],194618:[[21489]],194619:[[21510]],194620:[[21662]],194621:[[21560]],194622:[[21576]],194623:[[21608]],194624:[[21666]],194625:[[21750]],194626:[[21776]],194627:[[21843]],194628:[[21859]],194629:[[21892]],194630:[[21892]],194631:[[21913]],194632:[[21931]],194633:[[21939]],194634:[[21954]],194635:[[22294]],194636:[[22022]],194637:[[22295]],194638:[[22097]],194639:[[22132]],194640:[[20999]],194641:[[22766]],194642:[[22478]],194643:[[22516]],194644:[[22541]],194645:[[22411]],194646:[[22578]],194647:[[22577]],194648:[[22700]],194649:[[136420]],194650:[[22770]],194651:[[22775]],194652:[[22790]],194653:[[22810]],194654:[[22818]],194655:[[22882]],194656:[[136872]],194657:[[136938]],194658:[[23020]],194659:[[23067]],194660:[[23079]],194661:[[23000]],194662:[[23142]],194663:[[14062]],194664:[[14076]],194665:[[23304]],194666:[[23358]],194667:[[23358]],194668:[[137672]],194669:[[23491]],194670:[[23512]],194671:[[23527]],194672:[[23539]],194673:[[138008]],194674:[[23551]],194675:[[23558]],194676:[[24403]],194677:[[23586]],194678:[[14209]],194679:[[23648]],194680:[[23662]],194681:[[23744]],194682:[[23693]],194683:[[138724]],194684:[[23875]],194685:[[138726]],194686:[[23918]],194687:[[23915]],194688:[[23932]],194689:[[24033]],194690:[[24034]],194691:[[14383]],194692:[[24061]],194693:[[24104]],194694:[[24125]],194695:[[24169]],194696:[[14434]],194697:[[139651]],194698:[[14460]],194699:[[24240]],194700:[[24243]],194701:[[24246]],194702:[[24266]],194703:[[172946]],194704:[[24318]],194705:[[140081]],194706:[[140081]],194707:[[33281]],194708:[[24354]],194709:[[24354]],194710:[[14535]],194711:[[144056]],194712:[[156122]],194713:[[24418]],194714:[[24427]],194715:[[14563]],194716:[[24474]],194717:[[24525]],194718:[[24535]],194719:[[24569]],194720:[[24705]],194721:[[14650]],194722:[[14620]],194723:[[24724]],194724:[[141012]],194725:[[24775]],194726:[[24904]],194727:[[24908]],194728:[[24910]],194729:[[24908]],194730:[[24954]],194731:[[24974]],194732:[[25010]],194733:[[24996]],194734:[[25007]],194735:[[25054]],194736:[[25074]],194737:[[25078]],194738:[[25104]],194739:[[25115]],194740:[[25181]],194741:[[25265]],194742:[[25300]],194743:[[25424]],194744:[[142092]],194745:[[25405]],194746:[[25340]],194747:[[25448]],194748:[[25475]],194749:[[25572]],194750:[[142321]],194751:[[25634]],194752:[[25541]],194753:[[25513]],194754:[[14894]],194755:[[25705]],194756:[[25726]],194757:[[25757]],194758:[[25719]],194759:[[14956]],194760:[[25935]],194761:[[25964]],194762:[[143370]],194763:[[26083]],194764:[[26360]],194765:[[26185]],194766:[[15129]],194767:[[26257]],194768:[[15112]],194769:[[15076]],194770:[[20882]],194771:[[20885]],194772:[[26368]],194773:[[26268]],194774:[[32941]],194775:[[17369]],194776:[[26391]],194777:[[26395]],194778:[[26401]],194779:[[26462]],194780:[[26451]],194781:[[144323]],194782:[[15177]],194783:[[26618]],194784:[[26501]],194785:[[26706]],194786:[[26757]],194787:[[144493]],194788:[[26766]],194789:[[26655]],194790:[[26900]],194791:[[15261]],194792:[[26946]],194793:[[27043]],194794:[[27114]],194795:[[27304]],194796:[[145059]],194797:[[27355]],194798:[[15384]],194799:[[27425]],194800:[[145575]],194801:[[27476]],194802:[[15438]],194803:[[27506]],194804:[[27551]],194805:[[27578]],194806:[[27579]],194807:[[146061]],194808:[[138507]],194809:[[146170]],194810:[[27726]],194811:[[146620]],194812:[[27839]],194813:[[27853]],194814:[[27751]],194815:[[27926]]}, + 63744:{63744:[[35912]],63745:[[26356]],63746:[[36554]],63747:[[36040]],63748:[[28369]],63749:[[20018]],63750:[[21477]],63751:[[40860]],63752:[[40860]],63753:[[22865]],63754:[[37329]],63755:[[21895]],63756:[[22856]],63757:[[25078]],63758:[[30313]],63759:[[32645]],63760:[[34367]],63761:[[34746]],63762:[[35064]],63763:[[37007]],63764:[[27138]],63765:[[27931]],63766:[[28889]],63767:[[29662]],63768:[[33853]],63769:[[37226]],63770:[[39409]],63771:[[20098]],63772:[[21365]],63773:[[27396]],63774:[[29211]],63775:[[34349]],63776:[[40478]],63777:[[23888]],63778:[[28651]],63779:[[34253]],63780:[[35172]],63781:[[25289]],63782:[[33240]],63783:[[34847]],63784:[[24266]],63785:[[26391]],63786:[[28010]],63787:[[29436]],63788:[[37070]],63789:[[20358]],63790:[[20919]],63791:[[21214]],63792:[[25796]],63793:[[27347]],63794:[[29200]],63795:[[30439]],63796:[[32769]],63797:[[34310]],63798:[[34396]],63799:[[36335]],63800:[[38706]],63801:[[39791]],63802:[[40442]],63803:[[30860]],63804:[[31103]],63805:[[32160]],63806:[[33737]],63807:[[37636]],63808:[[40575]],63809:[[35542]],63810:[[22751]],63811:[[24324]],63812:[[31840]],63813:[[32894]],63814:[[29282]],63815:[[30922]],63816:[[36034]],63817:[[38647]],63818:[[22744]],63819:[[23650]],63820:[[27155]],63821:[[28122]],63822:[[28431]],63823:[[32047]],63824:[[32311]],63825:[[38475]],63826:[[21202]],63827:[[32907]],63828:[[20956]],63829:[[20940]],63830:[[31260]],63831:[[32190]],63832:[[33777]],63833:[[38517]],63834:[[35712]],63835:[[25295]],63836:[[27138]],63837:[[35582]],63838:[[20025]],63839:[[23527]],63840:[[24594]],63841:[[29575]],63842:[[30064]],63843:[[21271]],63844:[[30971]],63845:[[20415]],63846:[[24489]],63847:[[19981]],63848:[[27852]],63849:[[25976]],63850:[[32034]],63851:[[21443]],63852:[[22622]],63853:[[30465]],63854:[[33865]],63855:[[35498]],63856:[[27578]],63857:[[36784]],63858:[[27784]],63859:[[25342]],63860:[[33509]],63861:[[25504]],63862:[[30053]],63863:[[20142]],63864:[[20841]],63865:[[20937]],63866:[[26753]],63867:[[31975]],63868:[[33391]],63869:[[35538]],63870:[[37327]],63871:[[21237]],63872:[[21570]],63873:[[22899]],63874:[[24300]],63875:[[26053]],63876:[[28670]],63877:[[31018]],63878:[[38317]],63879:[[39530]],63880:[[40599]],63881:[[40654]],63882:[[21147]],63883:[[26310]],63884:[[27511]],63885:[[36706]],63886:[[24180]],63887:[[24976]],63888:[[25088]],63889:[[25754]],63890:[[28451]],63891:[[29001]],63892:[[29833]],63893:[[31178]],63894:[[32244]],63895:[[32879]],63896:[[36646]],63897:[[34030]],63898:[[36899]],63899:[[37706]],63900:[[21015]],63901:[[21155]],63902:[[21693]],63903:[[28872]],63904:[[35010]],63905:[[35498]],63906:[[24265]],63907:[[24565]],63908:[[25467]],63909:[[27566]],63910:[[31806]],63911:[[29557]],63912:[[20196]],63913:[[22265]],63914:[[23527]],63915:[[23994]],63916:[[24604]],63917:[[29618]],63918:[[29801]],63919:[[32666]],63920:[[32838]],63921:[[37428]],63922:[[38646]],63923:[[38728]],63924:[[38936]],63925:[[20363]],63926:[[31150]],63927:[[37300]],63928:[[38584]],63929:[[24801]],63930:[[20102]],63931:[[20698]],63932:[[23534]],63933:[[23615]],63934:[[26009]],63935:[[27138]],63936:[[29134]],63937:[[30274]],63938:[[34044]],63939:[[36988]],63940:[[40845]],63941:[[26248]],63942:[[38446]],63943:[[21129]],63944:[[26491]],63945:[[26611]],63946:[[27969]],63947:[[28316]],63948:[[29705]],63949:[[30041]],63950:[[30827]],63951:[[32016]],63952:[[39006]],63953:[[20845]],63954:[[25134]],63955:[[38520]],63956:[[20523]],63957:[[23833]],63958:[[28138]],63959:[[36650]],63960:[[24459]],63961:[[24900]],63962:[[26647]],63963:[[29575]],63964:[[38534]],63965:[[21033]],63966:[[21519]],63967:[[23653]],63968:[[26131]],63969:[[26446]],63970:[[26792]],63971:[[27877]],63972:[[29702]],63973:[[30178]],63974:[[32633]],63975:[[35023]],63976:[[35041]],63977:[[37324]],63978:[[38626]],63979:[[21311]],63980:[[28346]],63981:[[21533]],63982:[[29136]],63983:[[29848]],63984:[[34298]],63985:[[38563]],63986:[[40023]],63987:[[40607]],63988:[[26519]],63989:[[28107]],63990:[[33256]],63991:[[31435]],63992:[[31520]],63993:[[31890]],63994:[[29376]],63995:[[28825]],63996:[[35672]],63997:[[20160]],63998:[[33590]],63999:[[21050]],194816:[[27966]],194817:[[28023]],194818:[[27969]],194819:[[28009]],194820:[[28024]],194821:[[28037]],194822:[[146718]],194823:[[27956]],194824:[[28207]],194825:[[28270]],194826:[[15667]],194827:[[28363]],194828:[[28359]],194829:[[147153]],194830:[[28153]],194831:[[28526]],194832:[[147294]],194833:[[147342]],194834:[[28614]],194835:[[28729]],194836:[[28702]],194837:[[28699]],194838:[[15766]],194839:[[28746]],194840:[[28797]],194841:[[28791]],194842:[[28845]],194843:[[132389]],194844:[[28997]],194845:[[148067]],194846:[[29084]],194847:[[148395]],194848:[[29224]],194849:[[29237]],194850:[[29264]],194851:[[149000]],194852:[[29312]],194853:[[29333]],194854:[[149301]],194855:[[149524]],194856:[[29562]],194857:[[29579]],194858:[[16044]],194859:[[29605]],194860:[[16056]],194861:[[16056]],194862:[[29767]],194863:[[29788]],194864:[[29809]],194865:[[29829]],194866:[[29898]],194867:[[16155]],194868:[[29988]],194869:[[150582]],194870:[[30014]],194871:[[150674]],194872:[[30064]],194873:[[139679]],194874:[[30224]],194875:[[151457]],194876:[[151480]],194877:[[151620]],194878:[[16380]],194879:[[16392]],194880:[[30452]],194881:[[151795]],194882:[[151794]],194883:[[151833]],194884:[[151859]],194885:[[30494]],194886:[[30495]],194887:[[30495]],194888:[[30538]],194889:[[16441]],194890:[[30603]],194891:[[16454]],194892:[[16534]],194893:[[152605]],194894:[[30798]],194895:[[30860]],194896:[[30924]],194897:[[16611]],194898:[[153126]],194899:[[31062]],194900:[[153242]],194901:[[153285]],194902:[[31119]],194903:[[31211]],194904:[[16687]],194905:[[31296]],194906:[[31306]],194907:[[31311]],194908:[[153980]],194909:[[154279]],194910:[[154279]],194911:[[31470]],194912:[[16898]],194913:[[154539]],194914:[[31686]],194915:[[31689]],194916:[[16935]],194917:[[154752]],194918:[[31954]],194919:[[17056]],194920:[[31976]],194921:[[31971]],194922:[[32000]],194923:[[155526]],194924:[[32099]],194925:[[17153]],194926:[[32199]],194927:[[32258]],194928:[[32325]],194929:[[17204]],194930:[[156200]],194931:[[156231]],194932:[[17241]],194933:[[156377]],194934:[[32634]],194935:[[156478]],194936:[[32661]],194937:[[32762]],194938:[[32773]],194939:[[156890]],194940:[[156963]],194941:[[32864]],194942:[[157096]],194943:[[32880]],194944:[[144223]],194945:[[17365]],194946:[[32946]],194947:[[33027]],194948:[[17419]],194949:[[33086]],194950:[[23221]],194951:[[157607]],194952:[[157621]],194953:[[144275]],194954:[[144284]],194955:[[33281]],194956:[[33284]],194957:[[36766]],194958:[[17515]],194959:[[33425]],194960:[[33419]],194961:[[33437]],194962:[[21171]],194963:[[33457]],194964:[[33459]],194965:[[33469]],194966:[[33510]],194967:[[158524]],194968:[[33509]],194969:[[33565]],194970:[[33635]],194971:[[33709]],194972:[[33571]],194973:[[33725]],194974:[[33767]],194975:[[33879]],194976:[[33619]],194977:[[33738]],194978:[[33740]],194979:[[33756]],194980:[[158774]],194981:[[159083]],194982:[[158933]],194983:[[17707]],194984:[[34033]],194985:[[34035]],194986:[[34070]],194987:[[160714]],194988:[[34148]],194989:[[159532]],194990:[[17757]],194991:[[17761]],194992:[[159665]],194993:[[159954]],194994:[[17771]],194995:[[34384]],194996:[[34396]],194997:[[34407]],194998:[[34409]],194999:[[34473]],195000:[[34440]],195001:[[34574]],195002:[[34530]],195003:[[34681]],195004:[[34600]],195005:[[34667]],195006:[[34694]],195007:[[17879]],195008:[[34785]],195009:[[34817]],195010:[[17913]],195011:[[34912]],195012:[[34915]],195013:[[161383]],195014:[[35031]],195015:[[35038]],195016:[[17973]],195017:[[35066]],195018:[[13499]],195019:[[161966]],195020:[[162150]],195021:[[18110]],195022:[[18119]],195023:[[35488]],195024:[[35565]],195025:[[35722]],195026:[[35925]],195027:[[162984]],195028:[[36011]],195029:[[36033]],195030:[[36123]],195031:[[36215]],195032:[[163631]],195033:[[133124]],195034:[[36299]],195035:[[36284]],195036:[[36336]],195037:[[133342]],195038:[[36564]],195039:[[36664]],195040:[[165330]],195041:[[165357]],195042:[[37012]],195043:[[37105]],195044:[[37137]],195045:[[165678]],195046:[[37147]],195047:[[37432]],195048:[[37591]],195049:[[37592]],195050:[[37500]],195051:[[37881]],195052:[[37909]],195053:[[166906]],195054:[[38283]],195055:[[18837]],195056:[[38327]],195057:[[167287]],195058:[[18918]],195059:[[38595]],195060:[[23986]],195061:[[38691]],195062:[[168261]],195063:[[168474]],195064:[[19054]],195065:[[19062]],195066:[[38880]],195067:[[168970]],195068:[[19122]],195069:[[169110]],195070:[[38923]],195071:[[38923]]}, + 64000:{64000:[[20999]],64001:[[24230]],64002:[[25299]],64003:[[31958]],64004:[[23429]],64005:[[27934]],64006:[[26292]],64007:[[36667]],64008:[[34892]],64009:[[38477]],64010:[[35211]],64011:[[24275]],64012:[[20800]],64013:[[21952]],64016:[[22618]],64018:[[26228]],64021:[[20958]],64022:[[29482]],64023:[[30410]],64024:[[31036]],64025:[[31070]],64026:[[31077]],64027:[[31119]],64028:[[38742]],64029:[[31934]],64030:[[32701]],64032:[[34322]],64034:[[35576]],64037:[[36920]],64038:[[37117]],64042:[[39151]],64043:[[39164]],64044:[[39208]],64045:[[40372]],64046:[[37086]],64047:[[38583]],64048:[[20398]],64049:[[20711]],64050:[[20813]],64051:[[21193]],64052:[[21220]],64053:[[21329]],64054:[[21917]],64055:[[22022]],64056:[[22120]],64057:[[22592]],64058:[[22696]],64059:[[23652]],64060:[[23662]],64061:[[24724]],64062:[[24936]],64063:[[24974]],64064:[[25074]],64065:[[25935]],64066:[[26082]],64067:[[26257]],64068:[[26757]],64069:[[28023]],64070:[[28186]],64071:[[28450]],64072:[[29038]],64073:[[29227]],64074:[[29730]],64075:[[30865]],64076:[[31038]],64077:[[31049]],64078:[[31048]],64079:[[31056]],64080:[[31062]],64081:[[31069]],64082:[[31117]],64083:[[31118]],64084:[[31296]],64085:[[31361]],64086:[[31680]],64087:[[32244]],64088:[[32265]],64089:[[32321]],64090:[[32626]],64091:[[32773]],64092:[[33261]],64093:[[33401]],64094:[[33401]],64095:[[33879]],64096:[[35088]],64097:[[35222]],64098:[[35585]],64099:[[35641]],64100:[[36051]],64101:[[36104]],64102:[[36790]],64103:[[36920]],64104:[[38627]],64105:[[38911]],64106:[[38971]],64107:[[24693]],64108:[[148206]],64109:[[33304]],64112:[[20006]],64113:[[20917]],64114:[[20840]],64115:[[20352]],64116:[[20805]],64117:[[20864]],64118:[[21191]],64119:[[21242]],64120:[[21917]],64121:[[21845]],64122:[[21913]],64123:[[21986]],64124:[[22618]],64125:[[22707]],64126:[[22852]],64127:[[22868]],64128:[[23138]],64129:[[23336]],64130:[[24274]],64131:[[24281]],64132:[[24425]],64133:[[24493]],64134:[[24792]],64135:[[24910]],64136:[[24840]],64137:[[24974]],64138:[[24928]],64139:[[25074]],64140:[[25140]],64141:[[25540]],64142:[[25628]],64143:[[25682]],64144:[[25942]],64145:[[26228]],64146:[[26391]],64147:[[26395]],64148:[[26454]],64149:[[27513]],64150:[[27578]],64151:[[27969]],64152:[[28379]],64153:[[28363]],64154:[[28450]],64155:[[28702]],64156:[[29038]],64157:[[30631]],64158:[[29237]],64159:[[29359]],64160:[[29482]],64161:[[29809]],64162:[[29958]],64163:[[30011]],64164:[[30237]],64165:[[30239]],64166:[[30410]],64167:[[30427]],64168:[[30452]],64169:[[30538]],64170:[[30528]],64171:[[30924]],64172:[[31409]],64173:[[31680]],64174:[[31867]],64175:[[32091]],64176:[[32244]],64177:[[32574]],64178:[[32773]],64179:[[33618]],64180:[[33775]],64181:[[34681]],64182:[[35137]],64183:[[35206]],64184:[[35222]],64185:[[35519]],64186:[[35576]],64187:[[35531]],64188:[[35585]],64189:[[35582]],64190:[[35565]],64191:[[35641]],64192:[[35722]],64193:[[36104]],64194:[[36664]],64195:[[36978]],64196:[[37273]],64197:[[37494]],64198:[[38524]],64199:[[38627]],64200:[[38742]],64201:[[38875]],64202:[[38911]],64203:[[38923]],64204:[[38971]],64205:[[39698]],64206:[[40860]],64207:[[141386]],64208:[[141380]],64209:[[144341]],64210:[[15261]],64211:[[16408]],64212:[[16441]],64213:[[152137]],64214:[[154832]],64215:[[163539]],64216:[[40771]],64217:[[40846]],195072:[[38953]],195073:[[169398]],195074:[[39138]],195075:[[19251]],195076:[[39209]],195077:[[39335]],195078:[[39362]],195079:[[39422]],195080:[[19406]],195081:[[170800]],195082:[[39698]],195083:[[40000]],195084:[[40189]],195085:[[19662]],195086:[[19693]],195087:[[40295]],195088:[[172238]],195089:[[19704]],195090:[[172293]],195091:[[172558]],195092:[[172689]],195093:[[40635]],195094:[[19798]],195095:[[40697]],195096:[[40702]],195097:[[40709]],195098:[[40719]],195099:[[40726]],195100:[[40763]],195101:[[173568]]}, + 64256:{64256:[[102,102],256],64257:[[102,105],256],64258:[[102,108],256],64259:[[102,102,105],256],64260:[[102,102,108],256],64261:[[383,116],256],64262:[[115,116],256],64275:[[1396,1398],256],64276:[[1396,1381],256],64277:[[1396,1387],256],64278:[[1406,1398],256],64279:[[1396,1389],256],64285:[[1497,1460],512],64286:[,26],64287:[[1522,1463],512],64288:[[1506],256],64289:[[1488],256],64290:[[1491],256],64291:[[1492],256],64292:[[1499],256],64293:[[1500],256],64294:[[1501],256],64295:[[1512],256],64296:[[1514],256],64297:[[43],256],64298:[[1513,1473],512],64299:[[1513,1474],512],64300:[[64329,1473],512],64301:[[64329,1474],512],64302:[[1488,1463],512],64303:[[1488,1464],512],64304:[[1488,1468],512],64305:[[1489,1468],512],64306:[[1490,1468],512],64307:[[1491,1468],512],64308:[[1492,1468],512],64309:[[1493,1468],512],64310:[[1494,1468],512],64312:[[1496,1468],512],64313:[[1497,1468],512],64314:[[1498,1468],512],64315:[[1499,1468],512],64316:[[1500,1468],512],64318:[[1502,1468],512],64320:[[1504,1468],512],64321:[[1505,1468],512],64323:[[1507,1468],512],64324:[[1508,1468],512],64326:[[1510,1468],512],64327:[[1511,1468],512],64328:[[1512,1468],512],64329:[[1513,1468],512],64330:[[1514,1468],512],64331:[[1493,1465],512],64332:[[1489,1471],512],64333:[[1499,1471],512],64334:[[1508,1471],512],64335:[[1488,1500],256],64336:[[1649],256],64337:[[1649],256],64338:[[1659],256],64339:[[1659],256],64340:[[1659],256],64341:[[1659],256],64342:[[1662],256],64343:[[1662],256],64344:[[1662],256],64345:[[1662],256],64346:[[1664],256],64347:[[1664],256],64348:[[1664],256],64349:[[1664],256],64350:[[1658],256],64351:[[1658],256],64352:[[1658],256],64353:[[1658],256],64354:[[1663],256],64355:[[1663],256],64356:[[1663],256],64357:[[1663],256],64358:[[1657],256],64359:[[1657],256],64360:[[1657],256],64361:[[1657],256],64362:[[1700],256],64363:[[1700],256],64364:[[1700],256],64365:[[1700],256],64366:[[1702],256],64367:[[1702],256],64368:[[1702],256],64369:[[1702],256],64370:[[1668],256],64371:[[1668],256],64372:[[1668],256],64373:[[1668],256],64374:[[1667],256],64375:[[1667],256],64376:[[1667],256],64377:[[1667],256],64378:[[1670],256],64379:[[1670],256],64380:[[1670],256],64381:[[1670],256],64382:[[1671],256],64383:[[1671],256],64384:[[1671],256],64385:[[1671],256],64386:[[1677],256],64387:[[1677],256],64388:[[1676],256],64389:[[1676],256],64390:[[1678],256],64391:[[1678],256],64392:[[1672],256],64393:[[1672],256],64394:[[1688],256],64395:[[1688],256],64396:[[1681],256],64397:[[1681],256],64398:[[1705],256],64399:[[1705],256],64400:[[1705],256],64401:[[1705],256],64402:[[1711],256],64403:[[1711],256],64404:[[1711],256],64405:[[1711],256],64406:[[1715],256],64407:[[1715],256],64408:[[1715],256],64409:[[1715],256],64410:[[1713],256],64411:[[1713],256],64412:[[1713],256],64413:[[1713],256],64414:[[1722],256],64415:[[1722],256],64416:[[1723],256],64417:[[1723],256],64418:[[1723],256],64419:[[1723],256],64420:[[1728],256],64421:[[1728],256],64422:[[1729],256],64423:[[1729],256],64424:[[1729],256],64425:[[1729],256],64426:[[1726],256],64427:[[1726],256],64428:[[1726],256],64429:[[1726],256],64430:[[1746],256],64431:[[1746],256],64432:[[1747],256],64433:[[1747],256],64467:[[1709],256],64468:[[1709],256],64469:[[1709],256],64470:[[1709],256],64471:[[1735],256],64472:[[1735],256],64473:[[1734],256],64474:[[1734],256],64475:[[1736],256],64476:[[1736],256],64477:[[1655],256],64478:[[1739],256],64479:[[1739],256],64480:[[1733],256],64481:[[1733],256],64482:[[1737],256],64483:[[1737],256],64484:[[1744],256],64485:[[1744],256],64486:[[1744],256],64487:[[1744],256],64488:[[1609],256],64489:[[1609],256],64490:[[1574,1575],256],64491:[[1574,1575],256],64492:[[1574,1749],256],64493:[[1574,1749],256],64494:[[1574,1608],256],64495:[[1574,1608],256],64496:[[1574,1735],256],64497:[[1574,1735],256],64498:[[1574,1734],256],64499:[[1574,1734],256],64500:[[1574,1736],256],64501:[[1574,1736],256],64502:[[1574,1744],256],64503:[[1574,1744],256],64504:[[1574,1744],256],64505:[[1574,1609],256],64506:[[1574,1609],256],64507:[[1574,1609],256],64508:[[1740],256],64509:[[1740],256],64510:[[1740],256],64511:[[1740],256]}, + 64512:{64512:[[1574,1580],256],64513:[[1574,1581],256],64514:[[1574,1605],256],64515:[[1574,1609],256],64516:[[1574,1610],256],64517:[[1576,1580],256],64518:[[1576,1581],256],64519:[[1576,1582],256],64520:[[1576,1605],256],64521:[[1576,1609],256],64522:[[1576,1610],256],64523:[[1578,1580],256],64524:[[1578,1581],256],64525:[[1578,1582],256],64526:[[1578,1605],256],64527:[[1578,1609],256],64528:[[1578,1610],256],64529:[[1579,1580],256],64530:[[1579,1605],256],64531:[[1579,1609],256],64532:[[1579,1610],256],64533:[[1580,1581],256],64534:[[1580,1605],256],64535:[[1581,1580],256],64536:[[1581,1605],256],64537:[[1582,1580],256],64538:[[1582,1581],256],64539:[[1582,1605],256],64540:[[1587,1580],256],64541:[[1587,1581],256],64542:[[1587,1582],256],64543:[[1587,1605],256],64544:[[1589,1581],256],64545:[[1589,1605],256],64546:[[1590,1580],256],64547:[[1590,1581],256],64548:[[1590,1582],256],64549:[[1590,1605],256],64550:[[1591,1581],256],64551:[[1591,1605],256],64552:[[1592,1605],256],64553:[[1593,1580],256],64554:[[1593,1605],256],64555:[[1594,1580],256],64556:[[1594,1605],256],64557:[[1601,1580],256],64558:[[1601,1581],256],64559:[[1601,1582],256],64560:[[1601,1605],256],64561:[[1601,1609],256],64562:[[1601,1610],256],64563:[[1602,1581],256],64564:[[1602,1605],256],64565:[[1602,1609],256],64566:[[1602,1610],256],64567:[[1603,1575],256],64568:[[1603,1580],256],64569:[[1603,1581],256],64570:[[1603,1582],256],64571:[[1603,1604],256],64572:[[1603,1605],256],64573:[[1603,1609],256],64574:[[1603,1610],256],64575:[[1604,1580],256],64576:[[1604,1581],256],64577:[[1604,1582],256],64578:[[1604,1605],256],64579:[[1604,1609],256],64580:[[1604,1610],256],64581:[[1605,1580],256],64582:[[1605,1581],256],64583:[[1605,1582],256],64584:[[1605,1605],256],64585:[[1605,1609],256],64586:[[1605,1610],256],64587:[[1606,1580],256],64588:[[1606,1581],256],64589:[[1606,1582],256],64590:[[1606,1605],256],64591:[[1606,1609],256],64592:[[1606,1610],256],64593:[[1607,1580],256],64594:[[1607,1605],256],64595:[[1607,1609],256],64596:[[1607,1610],256],64597:[[1610,1580],256],64598:[[1610,1581],256],64599:[[1610,1582],256],64600:[[1610,1605],256],64601:[[1610,1609],256],64602:[[1610,1610],256],64603:[[1584,1648],256],64604:[[1585,1648],256],64605:[[1609,1648],256],64606:[[32,1612,1617],256],64607:[[32,1613,1617],256],64608:[[32,1614,1617],256],64609:[[32,1615,1617],256],64610:[[32,1616,1617],256],64611:[[32,1617,1648],256],64612:[[1574,1585],256],64613:[[1574,1586],256],64614:[[1574,1605],256],64615:[[1574,1606],256],64616:[[1574,1609],256],64617:[[1574,1610],256],64618:[[1576,1585],256],64619:[[1576,1586],256],64620:[[1576,1605],256],64621:[[1576,1606],256],64622:[[1576,1609],256],64623:[[1576,1610],256],64624:[[1578,1585],256],64625:[[1578,1586],256],64626:[[1578,1605],256],64627:[[1578,1606],256],64628:[[1578,1609],256],64629:[[1578,1610],256],64630:[[1579,1585],256],64631:[[1579,1586],256],64632:[[1579,1605],256],64633:[[1579,1606],256],64634:[[1579,1609],256],64635:[[1579,1610],256],64636:[[1601,1609],256],64637:[[1601,1610],256],64638:[[1602,1609],256],64639:[[1602,1610],256],64640:[[1603,1575],256],64641:[[1603,1604],256],64642:[[1603,1605],256],64643:[[1603,1609],256],64644:[[1603,1610],256],64645:[[1604,1605],256],64646:[[1604,1609],256],64647:[[1604,1610],256],64648:[[1605,1575],256],64649:[[1605,1605],256],64650:[[1606,1585],256],64651:[[1606,1586],256],64652:[[1606,1605],256],64653:[[1606,1606],256],64654:[[1606,1609],256],64655:[[1606,1610],256],64656:[[1609,1648],256],64657:[[1610,1585],256],64658:[[1610,1586],256],64659:[[1610,1605],256],64660:[[1610,1606],256],64661:[[1610,1609],256],64662:[[1610,1610],256],64663:[[1574,1580],256],64664:[[1574,1581],256],64665:[[1574,1582],256],64666:[[1574,1605],256],64667:[[1574,1607],256],64668:[[1576,1580],256],64669:[[1576,1581],256],64670:[[1576,1582],256],64671:[[1576,1605],256],64672:[[1576,1607],256],64673:[[1578,1580],256],64674:[[1578,1581],256],64675:[[1578,1582],256],64676:[[1578,1605],256],64677:[[1578,1607],256],64678:[[1579,1605],256],64679:[[1580,1581],256],64680:[[1580,1605],256],64681:[[1581,1580],256],64682:[[1581,1605],256],64683:[[1582,1580],256],64684:[[1582,1605],256],64685:[[1587,1580],256],64686:[[1587,1581],256],64687:[[1587,1582],256],64688:[[1587,1605],256],64689:[[1589,1581],256],64690:[[1589,1582],256],64691:[[1589,1605],256],64692:[[1590,1580],256],64693:[[1590,1581],256],64694:[[1590,1582],256],64695:[[1590,1605],256],64696:[[1591,1581],256],64697:[[1592,1605],256],64698:[[1593,1580],256],64699:[[1593,1605],256],64700:[[1594,1580],256],64701:[[1594,1605],256],64702:[[1601,1580],256],64703:[[1601,1581],256],64704:[[1601,1582],256],64705:[[1601,1605],256],64706:[[1602,1581],256],64707:[[1602,1605],256],64708:[[1603,1580],256],64709:[[1603,1581],256],64710:[[1603,1582],256],64711:[[1603,1604],256],64712:[[1603,1605],256],64713:[[1604,1580],256],64714:[[1604,1581],256],64715:[[1604,1582],256],64716:[[1604,1605],256],64717:[[1604,1607],256],64718:[[1605,1580],256],64719:[[1605,1581],256],64720:[[1605,1582],256],64721:[[1605,1605],256],64722:[[1606,1580],256],64723:[[1606,1581],256],64724:[[1606,1582],256],64725:[[1606,1605],256],64726:[[1606,1607],256],64727:[[1607,1580],256],64728:[[1607,1605],256],64729:[[1607,1648],256],64730:[[1610,1580],256],64731:[[1610,1581],256],64732:[[1610,1582],256],64733:[[1610,1605],256],64734:[[1610,1607],256],64735:[[1574,1605],256],64736:[[1574,1607],256],64737:[[1576,1605],256],64738:[[1576,1607],256],64739:[[1578,1605],256],64740:[[1578,1607],256],64741:[[1579,1605],256],64742:[[1579,1607],256],64743:[[1587,1605],256],64744:[[1587,1607],256],64745:[[1588,1605],256],64746:[[1588,1607],256],64747:[[1603,1604],256],64748:[[1603,1605],256],64749:[[1604,1605],256],64750:[[1606,1605],256],64751:[[1606,1607],256],64752:[[1610,1605],256],64753:[[1610,1607],256],64754:[[1600,1614,1617],256],64755:[[1600,1615,1617],256],64756:[[1600,1616,1617],256],64757:[[1591,1609],256],64758:[[1591,1610],256],64759:[[1593,1609],256],64760:[[1593,1610],256],64761:[[1594,1609],256],64762:[[1594,1610],256],64763:[[1587,1609],256],64764:[[1587,1610],256],64765:[[1588,1609],256],64766:[[1588,1610],256],64767:[[1581,1609],256]}, + 64768:{64768:[[1581,1610],256],64769:[[1580,1609],256],64770:[[1580,1610],256],64771:[[1582,1609],256],64772:[[1582,1610],256],64773:[[1589,1609],256],64774:[[1589,1610],256],64775:[[1590,1609],256],64776:[[1590,1610],256],64777:[[1588,1580],256],64778:[[1588,1581],256],64779:[[1588,1582],256],64780:[[1588,1605],256],64781:[[1588,1585],256],64782:[[1587,1585],256],64783:[[1589,1585],256],64784:[[1590,1585],256],64785:[[1591,1609],256],64786:[[1591,1610],256],64787:[[1593,1609],256],64788:[[1593,1610],256],64789:[[1594,1609],256],64790:[[1594,1610],256],64791:[[1587,1609],256],64792:[[1587,1610],256],64793:[[1588,1609],256],64794:[[1588,1610],256],64795:[[1581,1609],256],64796:[[1581,1610],256],64797:[[1580,1609],256],64798:[[1580,1610],256],64799:[[1582,1609],256],64800:[[1582,1610],256],64801:[[1589,1609],256],64802:[[1589,1610],256],64803:[[1590,1609],256],64804:[[1590,1610],256],64805:[[1588,1580],256],64806:[[1588,1581],256],64807:[[1588,1582],256],64808:[[1588,1605],256],64809:[[1588,1585],256],64810:[[1587,1585],256],64811:[[1589,1585],256],64812:[[1590,1585],256],64813:[[1588,1580],256],64814:[[1588,1581],256],64815:[[1588,1582],256],64816:[[1588,1605],256],64817:[[1587,1607],256],64818:[[1588,1607],256],64819:[[1591,1605],256],64820:[[1587,1580],256],64821:[[1587,1581],256],64822:[[1587,1582],256],64823:[[1588,1580],256],64824:[[1588,1581],256],64825:[[1588,1582],256],64826:[[1591,1605],256],64827:[[1592,1605],256],64828:[[1575,1611],256],64829:[[1575,1611],256],64848:[[1578,1580,1605],256],64849:[[1578,1581,1580],256],64850:[[1578,1581,1580],256],64851:[[1578,1581,1605],256],64852:[[1578,1582,1605],256],64853:[[1578,1605,1580],256],64854:[[1578,1605,1581],256],64855:[[1578,1605,1582],256],64856:[[1580,1605,1581],256],64857:[[1580,1605,1581],256],64858:[[1581,1605,1610],256],64859:[[1581,1605,1609],256],64860:[[1587,1581,1580],256],64861:[[1587,1580,1581],256],64862:[[1587,1580,1609],256],64863:[[1587,1605,1581],256],64864:[[1587,1605,1581],256],64865:[[1587,1605,1580],256],64866:[[1587,1605,1605],256],64867:[[1587,1605,1605],256],64868:[[1589,1581,1581],256],64869:[[1589,1581,1581],256],64870:[[1589,1605,1605],256],64871:[[1588,1581,1605],256],64872:[[1588,1581,1605],256],64873:[[1588,1580,1610],256],64874:[[1588,1605,1582],256],64875:[[1588,1605,1582],256],64876:[[1588,1605,1605],256],64877:[[1588,1605,1605],256],64878:[[1590,1581,1609],256],64879:[[1590,1582,1605],256],64880:[[1590,1582,1605],256],64881:[[1591,1605,1581],256],64882:[[1591,1605,1581],256],64883:[[1591,1605,1605],256],64884:[[1591,1605,1610],256],64885:[[1593,1580,1605],256],64886:[[1593,1605,1605],256],64887:[[1593,1605,1605],256],64888:[[1593,1605,1609],256],64889:[[1594,1605,1605],256],64890:[[1594,1605,1610],256],64891:[[1594,1605,1609],256],64892:[[1601,1582,1605],256],64893:[[1601,1582,1605],256],64894:[[1602,1605,1581],256],64895:[[1602,1605,1605],256],64896:[[1604,1581,1605],256],64897:[[1604,1581,1610],256],64898:[[1604,1581,1609],256],64899:[[1604,1580,1580],256],64900:[[1604,1580,1580],256],64901:[[1604,1582,1605],256],64902:[[1604,1582,1605],256],64903:[[1604,1605,1581],256],64904:[[1604,1605,1581],256],64905:[[1605,1581,1580],256],64906:[[1605,1581,1605],256],64907:[[1605,1581,1610],256],64908:[[1605,1580,1581],256],64909:[[1605,1580,1605],256],64910:[[1605,1582,1580],256],64911:[[1605,1582,1605],256],64914:[[1605,1580,1582],256],64915:[[1607,1605,1580],256],64916:[[1607,1605,1605],256],64917:[[1606,1581,1605],256],64918:[[1606,1581,1609],256],64919:[[1606,1580,1605],256],64920:[[1606,1580,1605],256],64921:[[1606,1580,1609],256],64922:[[1606,1605,1610],256],64923:[[1606,1605,1609],256],64924:[[1610,1605,1605],256],64925:[[1610,1605,1605],256],64926:[[1576,1582,1610],256],64927:[[1578,1580,1610],256],64928:[[1578,1580,1609],256],64929:[[1578,1582,1610],256],64930:[[1578,1582,1609],256],64931:[[1578,1605,1610],256],64932:[[1578,1605,1609],256],64933:[[1580,1605,1610],256],64934:[[1580,1581,1609],256],64935:[[1580,1605,1609],256],64936:[[1587,1582,1609],256],64937:[[1589,1581,1610],256],64938:[[1588,1581,1610],256],64939:[[1590,1581,1610],256],64940:[[1604,1580,1610],256],64941:[[1604,1605,1610],256],64942:[[1610,1581,1610],256],64943:[[1610,1580,1610],256],64944:[[1610,1605,1610],256],64945:[[1605,1605,1610],256],64946:[[1602,1605,1610],256],64947:[[1606,1581,1610],256],64948:[[1602,1605,1581],256],64949:[[1604,1581,1605],256],64950:[[1593,1605,1610],256],64951:[[1603,1605,1610],256],64952:[[1606,1580,1581],256],64953:[[1605,1582,1610],256],64954:[[1604,1580,1605],256],64955:[[1603,1605,1605],256],64956:[[1604,1580,1605],256],64957:[[1606,1580,1581],256],64958:[[1580,1581,1610],256],64959:[[1581,1580,1610],256],64960:[[1605,1580,1610],256],64961:[[1601,1605,1610],256],64962:[[1576,1581,1610],256],64963:[[1603,1605,1605],256],64964:[[1593,1580,1605],256],64965:[[1589,1605,1605],256],64966:[[1587,1582,1610],256],64967:[[1606,1580,1610],256],65008:[[1589,1604,1746],256],65009:[[1602,1604,1746],256],65010:[[1575,1604,1604,1607],256],65011:[[1575,1603,1576,1585],256],65012:[[1605,1581,1605,1583],256],65013:[[1589,1604,1593,1605],256],65014:[[1585,1587,1608,1604],256],65015:[[1593,1604,1610,1607],256],65016:[[1608,1587,1604,1605],256],65017:[[1589,1604,1609],256],65018:[[1589,1604,1609,32,1575,1604,1604,1607,32,1593,1604,1610,1607,32,1608,1587,1604,1605],256],65019:[[1580,1604,32,1580,1604,1575,1604,1607],256],65020:[[1585,1740,1575,1604],256]}, + 65024:{65040:[[44],256],65041:[[12289],256],65042:[[12290],256],65043:[[58],256],65044:[[59],256],65045:[[33],256],65046:[[63],256],65047:[[12310],256],65048:[[12311],256],65049:[[8230],256],65056:[,230],65057:[,230],65058:[,230],65059:[,230],65060:[,230],65061:[,230],65062:[,230],65072:[[8229],256],65073:[[8212],256],65074:[[8211],256],65075:[[95],256],65076:[[95],256],65077:[[40],256],65078:[[41],256],65079:[[123],256],65080:[[125],256],65081:[[12308],256],65082:[[12309],256],65083:[[12304],256],65084:[[12305],256],65085:[[12298],256],65086:[[12299],256],65087:[[12296],256],65088:[[12297],256],65089:[[12300],256],65090:[[12301],256],65091:[[12302],256],65092:[[12303],256],65095:[[91],256],65096:[[93],256],65097:[[8254],256],65098:[[8254],256],65099:[[8254],256],65100:[[8254],256],65101:[[95],256],65102:[[95],256],65103:[[95],256],65104:[[44],256],65105:[[12289],256],65106:[[46],256],65108:[[59],256],65109:[[58],256],65110:[[63],256],65111:[[33],256],65112:[[8212],256],65113:[[40],256],65114:[[41],256],65115:[[123],256],65116:[[125],256],65117:[[12308],256],65118:[[12309],256],65119:[[35],256],65120:[[38],256],65121:[[42],256],65122:[[43],256],65123:[[45],256],65124:[[60],256],65125:[[62],256],65126:[[61],256],65128:[[92],256],65129:[[36],256],65130:[[37],256],65131:[[64],256],65136:[[32,1611],256],65137:[[1600,1611],256],65138:[[32,1612],256],65140:[[32,1613],256],65142:[[32,1614],256],65143:[[1600,1614],256],65144:[[32,1615],256],65145:[[1600,1615],256],65146:[[32,1616],256],65147:[[1600,1616],256],65148:[[32,1617],256],65149:[[1600,1617],256],65150:[[32,1618],256],65151:[[1600,1618],256],65152:[[1569],256],65153:[[1570],256],65154:[[1570],256],65155:[[1571],256],65156:[[1571],256],65157:[[1572],256],65158:[[1572],256],65159:[[1573],256],65160:[[1573],256],65161:[[1574],256],65162:[[1574],256],65163:[[1574],256],65164:[[1574],256],65165:[[1575],256],65166:[[1575],256],65167:[[1576],256],65168:[[1576],256],65169:[[1576],256],65170:[[1576],256],65171:[[1577],256],65172:[[1577],256],65173:[[1578],256],65174:[[1578],256],65175:[[1578],256],65176:[[1578],256],65177:[[1579],256],65178:[[1579],256],65179:[[1579],256],65180:[[1579],256],65181:[[1580],256],65182:[[1580],256],65183:[[1580],256],65184:[[1580],256],65185:[[1581],256],65186:[[1581],256],65187:[[1581],256],65188:[[1581],256],65189:[[1582],256],65190:[[1582],256],65191:[[1582],256],65192:[[1582],256],65193:[[1583],256],65194:[[1583],256],65195:[[1584],256],65196:[[1584],256],65197:[[1585],256],65198:[[1585],256],65199:[[1586],256],65200:[[1586],256],65201:[[1587],256],65202:[[1587],256],65203:[[1587],256],65204:[[1587],256],65205:[[1588],256],65206:[[1588],256],65207:[[1588],256],65208:[[1588],256],65209:[[1589],256],65210:[[1589],256],65211:[[1589],256],65212:[[1589],256],65213:[[1590],256],65214:[[1590],256],65215:[[1590],256],65216:[[1590],256],65217:[[1591],256],65218:[[1591],256],65219:[[1591],256],65220:[[1591],256],65221:[[1592],256],65222:[[1592],256],65223:[[1592],256],65224:[[1592],256],65225:[[1593],256],65226:[[1593],256],65227:[[1593],256],65228:[[1593],256],65229:[[1594],256],65230:[[1594],256],65231:[[1594],256],65232:[[1594],256],65233:[[1601],256],65234:[[1601],256],65235:[[1601],256],65236:[[1601],256],65237:[[1602],256],65238:[[1602],256],65239:[[1602],256],65240:[[1602],256],65241:[[1603],256],65242:[[1603],256],65243:[[1603],256],65244:[[1603],256],65245:[[1604],256],65246:[[1604],256],65247:[[1604],256],65248:[[1604],256],65249:[[1605],256],65250:[[1605],256],65251:[[1605],256],65252:[[1605],256],65253:[[1606],256],65254:[[1606],256],65255:[[1606],256],65256:[[1606],256],65257:[[1607],256],65258:[[1607],256],65259:[[1607],256],65260:[[1607],256],65261:[[1608],256],65262:[[1608],256],65263:[[1609],256],65264:[[1609],256],65265:[[1610],256],65266:[[1610],256],65267:[[1610],256],65268:[[1610],256],65269:[[1604,1570],256],65270:[[1604,1570],256],65271:[[1604,1571],256],65272:[[1604,1571],256],65273:[[1604,1573],256],65274:[[1604,1573],256],65275:[[1604,1575],256],65276:[[1604,1575],256]}, + 65280:{65281:[[33],256],65282:[[34],256],65283:[[35],256],65284:[[36],256],65285:[[37],256],65286:[[38],256],65287:[[39],256],65288:[[40],256],65289:[[41],256],65290:[[42],256],65291:[[43],256],65292:[[44],256],65293:[[45],256],65294:[[46],256],65295:[[47],256],65296:[[48],256],65297:[[49],256],65298:[[50],256],65299:[[51],256],65300:[[52],256],65301:[[53],256],65302:[[54],256],65303:[[55],256],65304:[[56],256],65305:[[57],256],65306:[[58],256],65307:[[59],256],65308:[[60],256],65309:[[61],256],65310:[[62],256],65311:[[63],256],65312:[[64],256],65313:[[65],256],65314:[[66],256],65315:[[67],256],65316:[[68],256],65317:[[69],256],65318:[[70],256],65319:[[71],256],65320:[[72],256],65321:[[73],256],65322:[[74],256],65323:[[75],256],65324:[[76],256],65325:[[77],256],65326:[[78],256],65327:[[79],256],65328:[[80],256],65329:[[81],256],65330:[[82],256],65331:[[83],256],65332:[[84],256],65333:[[85],256],65334:[[86],256],65335:[[87],256],65336:[[88],256],65337:[[89],256],65338:[[90],256],65339:[[91],256],65340:[[92],256],65341:[[93],256],65342:[[94],256],65343:[[95],256],65344:[[96],256],65345:[[97],256],65346:[[98],256],65347:[[99],256],65348:[[100],256],65349:[[101],256],65350:[[102],256],65351:[[103],256],65352:[[104],256],65353:[[105],256],65354:[[106],256],65355:[[107],256],65356:[[108],256],65357:[[109],256],65358:[[110],256],65359:[[111],256],65360:[[112],256],65361:[[113],256],65362:[[114],256],65363:[[115],256],65364:[[116],256],65365:[[117],256],65366:[[118],256],65367:[[119],256],65368:[[120],256],65369:[[121],256],65370:[[122],256],65371:[[123],256],65372:[[124],256],65373:[[125],256],65374:[[126],256],65375:[[10629],256],65376:[[10630],256],65377:[[12290],256],65378:[[12300],256],65379:[[12301],256],65380:[[12289],256],65381:[[12539],256],65382:[[12530],256],65383:[[12449],256],65384:[[12451],256],65385:[[12453],256],65386:[[12455],256],65387:[[12457],256],65388:[[12515],256],65389:[[12517],256],65390:[[12519],256],65391:[[12483],256],65392:[[12540],256],65393:[[12450],256],65394:[[12452],256],65395:[[12454],256],65396:[[12456],256],65397:[[12458],256],65398:[[12459],256],65399:[[12461],256],65400:[[12463],256],65401:[[12465],256],65402:[[12467],256],65403:[[12469],256],65404:[[12471],256],65405:[[12473],256],65406:[[12475],256],65407:[[12477],256],65408:[[12479],256],65409:[[12481],256],65410:[[12484],256],65411:[[12486],256],65412:[[12488],256],65413:[[12490],256],65414:[[12491],256],65415:[[12492],256],65416:[[12493],256],65417:[[12494],256],65418:[[12495],256],65419:[[12498],256],65420:[[12501],256],65421:[[12504],256],65422:[[12507],256],65423:[[12510],256],65424:[[12511],256],65425:[[12512],256],65426:[[12513],256],65427:[[12514],256],65428:[[12516],256],65429:[[12518],256],65430:[[12520],256],65431:[[12521],256],65432:[[12522],256],65433:[[12523],256],65434:[[12524],256],65435:[[12525],256],65436:[[12527],256],65437:[[12531],256],65438:[[12441],256],65439:[[12442],256],65440:[[12644],256],65441:[[12593],256],65442:[[12594],256],65443:[[12595],256],65444:[[12596],256],65445:[[12597],256],65446:[[12598],256],65447:[[12599],256],65448:[[12600],256],65449:[[12601],256],65450:[[12602],256],65451:[[12603],256],65452:[[12604],256],65453:[[12605],256],65454:[[12606],256],65455:[[12607],256],65456:[[12608],256],65457:[[12609],256],65458:[[12610],256],65459:[[12611],256],65460:[[12612],256],65461:[[12613],256],65462:[[12614],256],65463:[[12615],256],65464:[[12616],256],65465:[[12617],256],65466:[[12618],256],65467:[[12619],256],65468:[[12620],256],65469:[[12621],256],65470:[[12622],256],65474:[[12623],256],65475:[[12624],256],65476:[[12625],256],65477:[[12626],256],65478:[[12627],256],65479:[[12628],256],65482:[[12629],256],65483:[[12630],256],65484:[[12631],256],65485:[[12632],256],65486:[[12633],256],65487:[[12634],256],65490:[[12635],256],65491:[[12636],256],65492:[[12637],256],65493:[[12638],256],65494:[[12639],256],65495:[[12640],256],65498:[[12641],256],65499:[[12642],256],65500:[[12643],256],65504:[[162],256],65505:[[163],256],65506:[[172],256],65507:[[175],256],65508:[[166],256],65509:[[165],256],65510:[[8361],256],65512:[[9474],256],65513:[[8592],256],65514:[[8593],256],65515:[[8594],256],65516:[[8595],256],65517:[[9632],256],65518:[[9675],256]} +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/normalize/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/normalize/implement.js new file mode 100644 index 00000000..cfc710ea --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/normalize/implement.js @@ -0,0 +1,7 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(String.prototype, 'normalize', + { value: require('./shim'), configurable: true, enumerable: false, + writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/normalize/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/normalize/index.js new file mode 100644 index 00000000..619b0965 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/normalize/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = require('./is-implemented')() + ? String.prototype.normalize + : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/normalize/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/normalize/is-implemented.js new file mode 100644 index 00000000..67c8d8da --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/normalize/is-implemented.js @@ -0,0 +1,8 @@ +'use strict'; + +var str = 'æøåäüö'; + +module.exports = function () { + if (typeof str.normalize !== 'function') return false; + return str.normalize('NFKD') === 'æøåäüö'; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/normalize/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/normalize/shim.js new file mode 100644 index 00000000..a3799897 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/normalize/shim.js @@ -0,0 +1,289 @@ +// Taken from: https://github.com/walling/unorm/blob/master/lib/unorm.js + +/* + * UnicodeNormalizer 1.0.0 + * Copyright (c) 2008 Matsuza + * Dual licensed under the MIT (MIT-LICENSE.txt) and + * GPL (GPL-LICENSE.txt) licenses. + * $Date: 2008-06-05 16:44:17 +0200 (Thu, 05 Jun 2008) $ + * $Rev: 13309 $ +*/ + +'use strict'; + +var primitiveSet = require('../../../object/primitive-set') + , validValue = require('../../../object/valid-value') + , data = require('./_data') + + , floor = Math.floor + , forms = primitiveSet('NFC', 'NFD', 'NFKC', 'NFKD') + + , DEFAULT_FEATURE = [null, 0, {}], CACHE_THRESHOLD = 10, SBase = 0xAC00 + , LBase = 0x1100, VBase = 0x1161, TBase = 0x11A7, LCount = 19, VCount = 21 + , TCount = 28, NCount = VCount * TCount, SCount = LCount * NCount + , UChar, cache = {}, cacheCounter = [], i, fromCache, fromData, fromCpOnly + , fromRuleBasedJamo, fromCpFilter, strategies, UCharIterator + , RecursDecompIterator, DecompIterator, CompIterator, createIterator + , normalize; + +UChar = function (cp, feature) { + this.codepoint = cp; + this.feature = feature; +}; + +// Strategies +for (i = 0; i <= 0xFF; ++i) cacheCounter[i] = 0; + +fromCache = function (next, cp, needFeature) { + var ret = cache[cp]; + if (!ret) { + ret = next(cp, needFeature); + if (!!ret.feature && ++cacheCounter[(cp >> 8) & 0xFF] > CACHE_THRESHOLD) { + cache[cp] = ret; + } + } + return ret; +}; + +fromData = function (next, cp, needFeature) { + var hash = cp & 0xFF00, dunit = UChar.udata[hash] || {}, f = dunit[cp]; + return f ? new UChar(cp, f) : new UChar(cp, DEFAULT_FEATURE); +}; +fromCpOnly = function (next, cp, needFeature) { + return !!needFeature ? next(cp, needFeature) : new UChar(cp, null); +}; + +fromRuleBasedJamo = function (next, cp, needFeature) { + var c, base, i, arr, SIndex, TIndex, feature, j; + if (cp < LBase || (LBase + LCount <= cp && cp < SBase) || + (SBase + SCount < cp)) { + return next(cp, needFeature); + } + if (LBase <= cp && cp < LBase + LCount) { + c = {}; + base = (cp - LBase) * VCount; + for (i = 0; i < VCount; ++i) { + c[VBase + i] = SBase + TCount * (i + base); + } + arr = new Array(3); + arr[2] = c; + return new UChar(cp, arr); + } + + SIndex = cp - SBase; + TIndex = SIndex % TCount; + feature = []; + if (TIndex !== 0) { + feature[0] = [SBase + SIndex - TIndex, TBase + TIndex]; + } else { + feature[0] = [LBase + floor(SIndex / NCount), VBase + + floor((SIndex % NCount) / TCount)]; + feature[2] = {}; + for (j = 1; j < TCount; ++j) { + feature[2][TBase + j] = cp + j; + } + } + return new UChar(cp, feature); +}; + +fromCpFilter = function (next, cp, needFeature) { + return (cp < 60) || ((13311 < cp) && (cp < 42607)) + ? new UChar(cp, DEFAULT_FEATURE) : next(cp, needFeature); +}; + +strategies = [fromCpFilter, fromCache, fromCpOnly, fromRuleBasedJamo, fromData]; + +UChar.fromCharCode = strategies.reduceRight(function (next, strategy) { + return function (cp, needFeature) { return strategy(next, cp, needFeature); }; +}, null); + +UChar.isHighSurrogate = function (cp) { return cp >= 0xD800 && cp <= 0xDBFF; }; +UChar.isLowSurrogate = function (cp) { return cp >= 0xDC00 && cp <= 0xDFFF; }; + +UChar.prototype.prepFeature = function () { + if (!this.feature) { + this.feature = UChar.fromCharCode(this.codepoint, true).feature; + } +}; + +UChar.prototype.toString = function () { + var x; + if (this.codepoint < 0x10000) return String.fromCharCode(this.codepoint); + x = this.codepoint - 0x10000; + return String.fromCharCode(floor(x / 0x400) + 0xD800, x % 0x400 + 0xDC00); +}; + +UChar.prototype.getDecomp = function () { + this.prepFeature(); + return this.feature[0] || null; +}; + +UChar.prototype.isCompatibility = function () { + this.prepFeature(); + return !!this.feature[1] && (this.feature[1] & (1 << 8)); +}; +UChar.prototype.isExclude = function () { + this.prepFeature(); + return !!this.feature[1] && (this.feature[1] & (1 << 9)); +}; +UChar.prototype.getCanonicalClass = function () { + this.prepFeature(); + return !!this.feature[1] ? (this.feature[1] & 0xff) : 0; +}; +UChar.prototype.getComposite = function (following) { + var cp; + this.prepFeature(); + if (!this.feature[2]) return null; + cp = this.feature[2][following.codepoint]; + return cp ? UChar.fromCharCode(cp) : null; +}; + +UCharIterator = function (str) { + this.str = str; + this.cursor = 0; +}; +UCharIterator.prototype.next = function () { + if (!!this.str && this.cursor < this.str.length) { + var cp = this.str.charCodeAt(this.cursor++), d; + if (UChar.isHighSurrogate(cp) && this.cursor < this.str.length && + UChar.isLowSurrogate((d = this.str.charCodeAt(this.cursor)))) { + cp = (cp - 0xD800) * 0x400 + (d - 0xDC00) + 0x10000; + ++this.cursor; + } + return UChar.fromCharCode(cp); + } + this.str = null; + return null; +}; + +RecursDecompIterator = function (it, cano) { + this.it = it; + this.canonical = cano; + this.resBuf = []; +}; + +RecursDecompIterator.prototype.next = function () { + var recursiveDecomp, uchar; + recursiveDecomp = function (cano, uchar) { + var decomp = uchar.getDecomp(), ret, i, a, j; + if (!!decomp && !(cano && uchar.isCompatibility())) { + ret = []; + for (i = 0; i < decomp.length; ++i) { + a = recursiveDecomp(cano, UChar.fromCharCode(decomp[i])); + //ret.concat(a); //<-why does not this work? + //following block is a workaround. + for (j = 0; j < a.length; ++j) ret.push(a[j]); + } + return ret; + } + return [uchar]; + }; + if (this.resBuf.length === 0) { + uchar = this.it.next(); + if (!uchar) return null; + this.resBuf = recursiveDecomp(this.canonical, uchar); + } + return this.resBuf.shift(); +}; + +DecompIterator = function (it) { + this.it = it; + this.resBuf = []; +}; + +DecompIterator.prototype.next = function () { + var cc, uchar, inspt, uchar2, cc2; + if (this.resBuf.length === 0) { + do { + uchar = this.it.next(); + if (!uchar) break; + cc = uchar.getCanonicalClass(); + inspt = this.resBuf.length; + if (cc !== 0) { + for (inspt; inspt > 0; --inspt) { + uchar2 = this.resBuf[inspt - 1]; + cc2 = uchar2.getCanonicalClass(); + if (cc2 <= cc) break; + } + } + this.resBuf.splice(inspt, 0, uchar); + } while (cc !== 0); + } + return this.resBuf.shift(); +}; + +CompIterator = function (it) { + this.it = it; + this.procBuf = []; + this.resBuf = []; + this.lastClass = null; +}; + +CompIterator.prototype.next = function () { + var uchar, starter, composite, cc; + while (this.resBuf.length === 0) { + uchar = this.it.next(); + if (!uchar) { + this.resBuf = this.procBuf; + this.procBuf = []; + break; + } + if (this.procBuf.length === 0) { + this.lastClass = uchar.getCanonicalClass(); + this.procBuf.push(uchar); + } else { + starter = this.procBuf[0]; + composite = starter.getComposite(uchar); + cc = uchar.getCanonicalClass(); + if (!!composite && (this.lastClass < cc || this.lastClass === 0)) { + this.procBuf[0] = composite; + } else { + if (cc === 0) { + this.resBuf = this.procBuf; + this.procBuf = []; + } + this.lastClass = cc; + this.procBuf.push(uchar); + } + } + } + return this.resBuf.shift(); +}; + +createIterator = function (mode, str) { + switch (mode) { + case "NFD": + return new DecompIterator( + new RecursDecompIterator(new UCharIterator(str), true) + ); + case "NFKD": + return new DecompIterator( + new RecursDecompIterator(new UCharIterator(str), false) + ); + case "NFC": + return new CompIterator(new DecompIterator( + new RecursDecompIterator(new UCharIterator(str), true) + )); + case "NFKC": + return new CompIterator(new DecompIterator( + new RecursDecompIterator(new UCharIterator(str), false) + )); + } + throw mode + " is invalid"; +}; +normalize = function (mode, str) { + var it = createIterator(mode, str), ret = "", uchar; + while (!!(uchar = it.next())) ret += uchar.toString(); + return ret; +}; + +/* Unicode data */ +UChar.udata = data; + +module.exports = function (/*form*/) { + var str = String(validValue(this)), form = arguments[0]; + if (form === undefined) form = 'NFC'; + else form = String(form); + if (!forms[form]) throw new RangeError('Invalid normalization form: ' + form); + return normalize(form, str); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/pad.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/pad.js new file mode 100644 index 00000000..f227f239 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/pad.js @@ -0,0 +1,18 @@ +'use strict'; + +var toInteger = require('../../number/to-integer') + , value = require('../../object/valid-value') + , repeat = require('./repeat') + + , abs = Math.abs, max = Math.max; + +module.exports = function (fill/*, length*/) { + var self = String(value(this)) + , sLength = self.length + , length = arguments[1]; + + length = isNaN(length) ? 1 : toInteger(length); + fill = repeat.call(String(fill), abs(length)); + if (length >= 0) return fill.slice(0, max(0, length - sLength)) + self; + return self + (((sLength + length) >= 0) ? '' : fill.slice(length + sLength)); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/plain-replace-all.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/plain-replace-all.js new file mode 100644 index 00000000..678b1cbc --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/plain-replace-all.js @@ -0,0 +1,16 @@ +'use strict'; + +var value = require('../../object/valid-value'); + +module.exports = function (search, replace) { + var index, pos = 0, str = String(value(this)), sl, rl; + search = String(search); + replace = String(replace); + sl = search.length; + rl = replace.length; + while ((index = str.indexOf(search, pos)) !== -1) { + str = str.slice(0, index) + replace + str.slice(index + sl); + pos = index + rl; + } + return str; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/plain-replace.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/plain-replace.js new file mode 100644 index 00000000..24ce16d3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/plain-replace.js @@ -0,0 +1,10 @@ +'use strict'; + +var indexOf = String.prototype.indexOf, slice = String.prototype.slice; + +module.exports = function (search, replace) { + var index = indexOf.call(this, search); + if (index === -1) return String(this); + return slice.call(this, 0, index) + replace + + slice.call(this, index + String(search).length); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/repeat/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/repeat/implement.js new file mode 100644 index 00000000..4c39b9fb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/repeat/implement.js @@ -0,0 +1,7 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(String.prototype, 'repeat', + { value: require('./shim'), configurable: true, enumerable: false, + writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/repeat/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/repeat/index.js new file mode 100644 index 00000000..15a800e8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/repeat/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = require('./is-implemented')() + ? String.prototype.repeat + : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/repeat/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/repeat/is-implemented.js new file mode 100644 index 00000000..f7b8750f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/repeat/is-implemented.js @@ -0,0 +1,8 @@ +'use strict'; + +var str = 'foo'; + +module.exports = function () { + if (typeof str.repeat !== 'function') return false; + return (str.repeat(2) === 'foofoo'); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/repeat/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/repeat/shim.js new file mode 100644 index 00000000..0a3928b2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/repeat/shim.js @@ -0,0 +1,22 @@ +// Thanks: http://www.2ality.com/2014/01/efficient-string-repeat.html + +'use strict'; + +var value = require('../../../object/valid-value') + , toInteger = require('../../../number/to-integer'); + +module.exports = function (count) { + var str = String(value(this)), result; + count = toInteger(count); + if (count < 0) throw new RangeError("Count must be >= 0"); + if (!isFinite(count)) throw new RangeError("Count must be < ∞"); + result = ''; + if (!count) return result; + while (true) { + if (count & 1) result += str; + count >>>= 1; + if (count <= 0) break; + str += str; + } + return result; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/starts-with/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/starts-with/implement.js new file mode 100644 index 00000000..d4f1eaf5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/starts-with/implement.js @@ -0,0 +1,7 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(String.prototype, 'startsWith', + { value: require('./shim'), configurable: true, enumerable: false, + writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/starts-with/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/starts-with/index.js new file mode 100644 index 00000000..ec66a7c0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/starts-with/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = require('./is-implemented')() + ? String.prototype.startsWith + : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/starts-with/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/starts-with/is-implemented.js new file mode 100644 index 00000000..a0556f19 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/starts-with/is-implemented.js @@ -0,0 +1,9 @@ +'use strict'; + +var str = 'razdwatrzy'; + +module.exports = function () { + if (typeof str.startsWith !== 'function') return false; + return ((str.startsWith('trzy') === false) && + (str.startsWith('raz') === true)); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/starts-with/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/starts-with/shim.js new file mode 100644 index 00000000..aa5aaf41 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/starts-with/shim.js @@ -0,0 +1,12 @@ +'use strict'; + +var value = require('../../../object/valid-value') + , toInteger = require('../../../number/to-integer') + + , max = Math.max, min = Math.min; + +module.exports = function (searchString/*, position*/) { + var start, self = String(value(this)); + start = min(max(toInteger(arguments[1]), 0), self.length); + return (self.indexOf(searchString, start) === start); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/uncapitalize.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/uncapitalize.js new file mode 100644 index 00000000..bedd7e7b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/uncapitalize.js @@ -0,0 +1,8 @@ +'use strict'; + +var ensureStringifiable = require('../../object/validate-stringifiable-value'); + +module.exports = function () { + var str = ensureStringifiable(this); + return str.charAt(0).toLowerCase() + str.slice(1); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/format-method.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/format-method.js new file mode 100644 index 00000000..f1de1e30 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/format-method.js @@ -0,0 +1,24 @@ +'use strict'; + +var isCallable = require('../object/is-callable') + , value = require('../object/valid-value') + + , call = Function.prototype.call; + +module.exports = function (fmap) { + fmap = Object(value(fmap)); + return function (pattern) { + var context = value(this); + pattern = String(pattern); + return pattern.replace(/%([a-zA-Z]+)|\\([\u0000-\uffff])/g, + function (match, token, escape) { + var t, r; + if (escape) return escape; + t = token; + while (t && !(r = fmap[t])) t = t.slice(0, -1); + if (!r) return match; + if (isCallable(r)) r = call.call(r, context); + return r + token.slice(t.length); + }); + }; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/from-code-point/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/from-code-point/implement.js new file mode 100644 index 00000000..b062331c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/from-code-point/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(String, 'fromCodePoint', { value: require('./shim'), + configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/from-code-point/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/from-code-point/index.js new file mode 100644 index 00000000..3f3110b6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/from-code-point/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = require('./is-implemented')() + ? String.fromCodePoint + : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/from-code-point/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/from-code-point/is-implemented.js new file mode 100644 index 00000000..840a20e3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/from-code-point/is-implemented.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = function () { + var fromCodePoint = String.fromCodePoint; + if (typeof fromCodePoint !== 'function') return false; + return fromCodePoint(0x1D306, 0x61, 0x1D307) === '\ud834\udf06a\ud834\udf07'; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/from-code-point/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/from-code-point/shim.js new file mode 100644 index 00000000..41fd7378 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/from-code-point/shim.js @@ -0,0 +1,30 @@ +// Based on: +// http://norbertlindenberg.com/2012/05/ecmascript-supplementary-characters/ +// and: +// https://github.com/mathiasbynens/String.fromCodePoint/blob/master +// /fromcodepoint.js + +'use strict'; + +var floor = Math.floor, fromCharCode = String.fromCharCode; + +module.exports = function (codePoint/*, …codePoints*/) { + var chars = [], l = arguments.length, i, c, result = ''; + for (i = 0; i < l; ++i) { + c = Number(arguments[i]); + if (!isFinite(c) || c < 0 || c > 0x10FFFF || floor(c) !== c) { + throw new RangeError("Invalid code point " + c); + } + + if (c < 0x10000) { + chars.push(c); + } else { + c -= 0x10000; + chars.push((c >> 10) + 0xD800, (c % 0x400) + 0xDC00); + } + if (i + 1 !== l && chars.length <= 0x4000) continue; + result += fromCharCode.apply(null, chars); + chars.length = 0; + } + return result; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/index.js new file mode 100644 index 00000000..dbbcdf61 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/index.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = { + '#': require('./#'), + formatMethod: require('./format-method'), + fromCodePoint: require('./from-code-point'), + isString: require('./is-string'), + randomUniq: require('./random-uniq'), + raw: require('./raw') +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/is-string.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/is-string.js new file mode 100644 index 00000000..719aeec1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/is-string.js @@ -0,0 +1,10 @@ +'use strict'; + +var toString = Object.prototype.toString + + , id = toString.call(''); + +module.exports = function (x) { + return (typeof x === 'string') || (x && (typeof x === 'object') && + ((x instanceof String) || (toString.call(x) === id))) || false; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/random-uniq.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/random-uniq.js new file mode 100644 index 00000000..54ae6f8c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/random-uniq.js @@ -0,0 +1,11 @@ +'use strict'; + +var generated = Object.create(null) + + , random = Math.random; + +module.exports = function () { + var str; + do { str = random().toString(36).slice(2); } while (generated[str]); + return str; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/raw/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/raw/implement.js new file mode 100644 index 00000000..c417e659 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/raw/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +if (!require('./is-implemented')()) { + Object.defineProperty(String, 'raw', { value: require('./shim'), + configurable: true, enumerable: false, writable: true }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/raw/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/raw/index.js new file mode 100644 index 00000000..504a5de2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/raw/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = require('./is-implemented')() + ? String.raw + : require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/raw/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/raw/is-implemented.js new file mode 100644 index 00000000..d7204c0c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/raw/is-implemented.js @@ -0,0 +1,9 @@ +'use strict'; + +module.exports = function () { + var raw = String.raw, test; + if (typeof raw !== 'function') return false; + test = ['foo\nbar', 'marko\n']; + test.raw = ['foo\\nbar', 'marko\\n']; + return raw(test, 'INSE\nRT') === 'foo\\nbarINSE\nRTmarko\\n'; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/raw/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/raw/shim.js new file mode 100644 index 00000000..7096efbc --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/raw/shim.js @@ -0,0 +1,15 @@ +'use strict'; + +var toPosInt = require('../../number/to-pos-integer') + , validValue = require('../../object/valid-value') + + , reduce = Array.prototype.reduce; + +module.exports = function (callSite/*, …substitutions*/) { + var args, rawValue = Object(validValue(Object(validValue(callSite)).raw)); + if (!toPosInt(rawValue.length)) return ''; + args = arguments; + return reduce.call(rawValue, function (a, b, i) { + return a + String(args[i]) + b; + }); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/__tad.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/__tad.js new file mode 100644 index 00000000..88457788 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/__tad.js @@ -0,0 +1,3 @@ +'use strict'; + +exports.context = null; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/@@iterator/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/@@iterator/implement.js new file mode 100644 index 00000000..f0605399 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/@@iterator/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../../array/#/@@iterator/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/@@iterator/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/@@iterator/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/@@iterator/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/@@iterator/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/@@iterator/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/@@iterator/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/@@iterator/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/@@iterator/shim.js new file mode 100644 index 00000000..e590d8f2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/@@iterator/shim.js @@ -0,0 +1,9 @@ +'use strict'; + +exports.__generic = function (t, a) { + var iterator = t.call(this); + a.deep(iterator.next(), { value: '1', done: false }); + a.deep(iterator.next(), { value: '2', done: false }); + a.deep(iterator.next(), { value: '3', done: false }); + a.deep(iterator.next(), { value: undefined, done: true }); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/_compare-by-length.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/_compare-by-length.js new file mode 100644 index 00000000..e40c305b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/_compare-by-length.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = function (t, a) { + var x = [4, 5, 6], y = { length: 8 }, w = {}, z = { length: 1 }; + + a.deep([x, y, w, z].sort(t), [w, z, x, y]); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/binary-search.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/binary-search.js new file mode 100644 index 00000000..cf331737 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/binary-search.js @@ -0,0 +1,15 @@ +'use strict'; + +var compare = function (value) { return this - value; }; + +module.exports = function (t, a) { + var arr; + arr = [2, 5, 5, 8, 34, 67, 98, 345, 678]; + + // highest, equal match + a(t.call(arr, compare.bind(1)), 0, "All higher"); + a(t.call(arr, compare.bind(679)), arr.length - 1, "All lower"); + a(t.call(arr, compare.bind(4)), 0, "Mid"); + a(t.call(arr, compare.bind(5)), 2, "Match"); + a(t.call(arr, compare.bind(6)), 2, "Above"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/clear.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/clear.js new file mode 100644 index 00000000..a5b1c977 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/clear.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = function (t, a) { + var x = [1, 2, {}, 4]; + a(t.call(x), x, "Returns same array"); + a.deep(x, [], "Empties array"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/compact.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/compact.js new file mode 100644 index 00000000..6390eb26 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/compact.js @@ -0,0 +1,17 @@ +'use strict'; + +module.exports = { + __generic: function (t, a) { + a(t.call(this).length, 3); + }, + "": function (t, a) { + var o, x, y, z; + o = {}; + x = [0, 1, "", null, o, false, undefined, true]; + y = x.slice(0); + + a.not(z = t.call(x), x, "Returns different object"); + a.deep(x, y, "Origin not changed"); + a.deep(z, [0, 1, "", o, false, true], "Result"); + } +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/concat/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/concat/implement.js new file mode 100644 index 00000000..3bdbe868 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/concat/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../../array/#/concat/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/concat/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/concat/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/concat/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/concat/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/concat/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/concat/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/concat/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/concat/shim.js new file mode 100644 index 00000000..c30eb7ea --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/concat/shim.js @@ -0,0 +1,26 @@ +'use strict'; + +var SubArray = require('../../../../array/_sub-array-dummy-safe'); + +module.exports = function (t, a) { + var arr = [1, 3, 45], x = {}, subArr, subArr2, result; + + a.deep(t.call(arr, '2d', x, ['ere', 'fe', x], false, null), + [1, 3, 45, '2d', x, 'ere', 'fe', x, false, null], "Plain array"); + + subArr = new SubArray('lol', 'miszko'); + subArr2 = new SubArray('elo', 'fol'); + + result = t.call(subArr, 'df', arr, 'fef', subArr2, null); + a(result instanceof SubArray, true, "Instance of subclass"); + a.deep(result, ['lol', 'miszko', 'df', 1, 3, 45, 'fef', 'elo', 'fol', null], + "Spreable by default"); + + SubArray.prototype['@@isConcatSpreadable'] = false; + + result = t.call(subArr, 'df', arr, 'fef', subArr2, null); + a.deep(result, ['lol', 'miszko', 'df', 1, 3, 45, 'fef', subArr2, null], + "Non spreadable"); + + delete SubArray.prototype['@@isConcatSpreadable']; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/contains.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/contains.js new file mode 100644 index 00000000..21404a17 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/contains.js @@ -0,0 +1,21 @@ +'use strict'; + +module.exports = { + __generic: function (t, a) { + a(t.call(this, this[1]), true, "Contains"); + a(t.call(this, {}), false, "Does Not contain"); + }, + "": function (t, a) { + var o, x = {}, y = {}; + + o = [1, 'raz', x]; + + a(t.call(o, 1), true, "First"); + a(t.call(o, '1'), false, "Type coercion"); + a(t.call(o, 'raz'), true, "Primitive"); + a(t.call(o, 'foo'), false, "Primitive not found"); + a(t.call(o, x), true, "Object found"); + a(t.call(o, y), false, "Object not found"); + a(t.call(o, 1, 1), false, "Position"); + } +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/copy-within/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/copy-within/implement.js new file mode 100644 index 00000000..36070477 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/copy-within/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../../array/#/copy-within/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/copy-within/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/copy-within/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/copy-within/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/copy-within/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/copy-within/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/copy-within/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/copy-within/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/copy-within/shim.js new file mode 100644 index 00000000..93c85ea3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/copy-within/shim.js @@ -0,0 +1,29 @@ +'use strict'; + +module.exports = function (t, a) { + var args, x; + + a.h1("2 args"); + x = [1, 2, 3, 4, 5]; + t.call(x, 0, 3); + a.deep(x, [4, 5, 3, 4, 5]); + a.deep(t.call([1, 2, 3, 4, 5], 1, 3), [1, 4, 5, 4, 5]); + a.deep(t.call([1, 2, 3, 4, 5], 1, 2), [1, 3, 4, 5, 5]); + a.deep(t.call([1, 2, 3, 4, 5], 2, 2), [1, 2, 3, 4, 5]); + + a.h1("3 args"); + a.deep(t.call([1, 2, 3, 4, 5], 0, 3, 4), [4, 2, 3, 4, 5]); + a.deep(t.call([1, 2, 3, 4, 5], 1, 3, 4), [1, 4, 3, 4, 5]); + a.deep(t.call([1, 2, 3, 4, 5], 1, 2, 4), [1, 3, 4, 4, 5]); + + a.h1("Negative args"); + a.deep(t.call([1, 2, 3, 4, 5], 0, -2), [4, 5, 3, 4, 5]); + a.deep(t.call([1, 2, 3, 4, 5], 0, -2, -1), [4, 2, 3, 4, 5]); + a.deep(t.call([1, 2, 3, 4, 5], -4, -3, -2), [1, 3, 3, 4, 5]); + a.deep(t.call([1, 2, 3, 4, 5], -4, -3, -1), [1, 3, 4, 4, 5]); + a.deep(t.call([1, 2, 3, 4, 5], -4, -3), [1, 3, 4, 5, 5]); + + a.h1("Array-likes"); + args = { 0: 1, 1: 2, 2: 3, length: 3 }; + a.deep(t.call(args, -2, 0), { '0': 1, '1': 1, '2': 2, length: 3 }); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/diff.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/diff.js new file mode 100644 index 00000000..bcfa3a0b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/diff.js @@ -0,0 +1,17 @@ +'use strict'; + +module.exports = { + __generic: function (t, a) { + a.deep(t.call(this, this), []); + }, + "": function (t, a) { + var x = {}, y = {}; + + a.deep(t.call([1, 'raz', x, 2, 'trzy', y], [x, 2, 'trzy']), [1, 'raz', y], + "Scope longer"); + a.deep(t.call([1, 'raz', x], [x, 2, 'trzy', 1, y]), ['raz'], + "Arg longer"); + a.deep(t.call([1, 'raz', x], []), [1, 'raz', x], "Empty arg"); + a.deep(t.call([], [1, y, 'sdfs']), [], "Empty scope"); + } +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/e-index-of.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/e-index-of.js new file mode 100644 index 00000000..4cf6c635 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/e-index-of.js @@ -0,0 +1,13 @@ +'use strict'; + +module.exports = function (t, a) { + var x = {}; + a(t.call([3, 'raz', {}, x, {}], x), 3, "Regular"); + a(t.call([3, 'raz', NaN, {}, NaN], NaN), 2, "NaN"); + a(t.call([3, 'raz', 0, {}, -0], -0), 2, "-0"); + a(t.call([3, 'raz', -0, {}, 0], +0), 2, "+0"); + a(t.call([3, 'raz', NaN, {}, NaN], NaN, 3), 4, "fromIndex"); + a(t.call([3, 'raz', NaN, {}, NaN], NaN, -1), 4, "fromIndex negative #1"); + a(t.call([3, 'raz', NaN, {}, NaN], NaN, -2), 4, "fromIndex negative #2"); + a(t.call([3, 'raz', NaN, {}, NaN], NaN, -3), 2, "fromIndex negative #3"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/e-last-index-of.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/e-last-index-of.js new file mode 100644 index 00000000..ed4f7004 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/e-last-index-of.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports = function (t, a) { + var x = {}; + a(t.call([3, 'raz', {}, x, {}, x], x), 5, "Regular"); + a(t.call([3, 'raz', NaN, {}, x], NaN), 2, "NaN"); + a(t.call([3, 'raz', 0, {}, -0], -0), 4, "-0"); + a(t.call([3, 'raz', -0, {}, 0], +0), 4, "+0"); + a(t.call([3, 'raz', NaN, {}, NaN], NaN, 3), 2, "fromIndex"); + a(t.call([3, 'raz', NaN, 2, NaN], NaN, -1), 4, "Negative fromIndex #1"); + a(t.call([3, 'raz', NaN, 2, NaN], NaN, -2), 2, "Negative fromIndex #2"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/entries/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/entries/implement.js new file mode 100644 index 00000000..733209a1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/entries/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../../array/#/entries/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/entries/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/entries/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/entries/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/entries/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/entries/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/entries/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/entries/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/entries/shim.js new file mode 100644 index 00000000..bf40d310 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/entries/shim.js @@ -0,0 +1,9 @@ +'use strict'; + +exports.__generic = function (t, a) { + var iterator = t.call(this); + a.deep(iterator.next(), { value: [0, '1'], done: false }); + a.deep(iterator.next(), { value: [1, '2'], done: false }); + a.deep(iterator.next(), { value: [2, '3'], done: false }); + a.deep(iterator.next(), { value: undefined, done: true }); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/exclusion.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/exclusion.js new file mode 100644 index 00000000..07b32d8e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/exclusion.js @@ -0,0 +1,15 @@ +'use strict'; + +module.exports = { + __generic: function (t, a) { + var x = {}; + a.deep(t.call(this, this, [this[0], this[2], x]), [x]); + }, + "": function (t, a) { + var x = {}, y = {}; + + a.deep(t.call([x, y]), [x, y], "No arguments"); + a.deep(t.call([x, 1], [], []), [x, 1], "Empty arguments"); + a.deep(t.call([1, 'raz', x], [2, 'raz', y], [2, 'raz', x]), [1, y]); + } +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/fill/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/fill/implement.js new file mode 100644 index 00000000..2a01d285 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/fill/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../../array/#/fill/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/fill/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/fill/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/fill/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/fill/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/fill/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/fill/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/fill/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/fill/shim.js new file mode 100644 index 00000000..d67300fc --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/fill/shim.js @@ -0,0 +1,18 @@ +// Taken from https://github.com/paulmillr/es6-shim/blob/master/test/array.js + +'use strict'; + +module.exports = function (t, a) { + var x; + + x = [1, 2, 3, 4, 5, 6]; + a(t.call(x, -1), x, "Returns self object"); + a.deep(x, [-1, -1, -1, -1, -1, -1], "Value"); + + a.deep(t.call([1, 2, 3, 4, 5, 6], -1, 3), [1, 2, 3, -1, -1, -1], + "Positive start"); + a.deep(t.call([1, 2, 3, 4, 5, 6], -1, -3), [1, 2, 3, -1, -1, -1], + "Negative start"); + a.deep(t.call([1, 2, 3, 4, 5, 6], -1, 9), [1, 2, 3, 4, 5, 6], + "Large start"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/filter/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/filter/implement.js new file mode 100644 index 00000000..6d6b87cc --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/filter/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../../array/#/filter/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/filter/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/filter/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/filter/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/filter/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/filter/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/filter/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/filter/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/filter/shim.js new file mode 100644 index 00000000..e8b5c398 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/filter/shim.js @@ -0,0 +1,17 @@ +'use strict'; + +var SubArray = require('../../../../array/_sub-array-dummy-safe'); + +module.exports = function (t, a) { + var arr, x = {}, subArr, result; + + arr = ['foo', undefined, 0, '2d', false, x, null]; + + a.deep(t.call(arr, Boolean), ['foo', '2d', x], "Plain array"); + + subArr = new SubArray('foo', undefined, 0, '2d', false, x, null); + + result = t.call(subArr, Boolean); + a(result instanceof SubArray, true, "Instance of subclass"); + a.deep(result, ['foo', '2d', x], "Result of subclass"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/find-index/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/find-index/implement.js new file mode 100644 index 00000000..8d85e618 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/find-index/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../../array/#/find-index/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/find-index/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/find-index/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/find-index/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/find-index/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/find-index/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/find-index/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/find-index/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/find-index/shim.js new file mode 100644 index 00000000..b5fee463 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/find-index/shim.js @@ -0,0 +1,17 @@ +'use strict'; + +exports.__generic = function (t, a) { + var count = 0, o = {}, self = Object(this); + a(t.call(self, function (value, i, scope) { + a(value, this[i], "Value"); + a(i, count++, "Index"); + a(scope, this, "Scope"); + }, self), -1, "Falsy result"); + a(count, 3); + + count = -1; + a(t.call(this, function () { + return ++count ? o : null; + }, this), 1, "Truthy result"); + a(count, 1); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/find/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/find/implement.js new file mode 100644 index 00000000..29fac41e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/find/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../../array/#/find/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/find/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/find/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/find/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/find/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/find/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/find/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/find/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/find/shim.js new file mode 100644 index 00000000..ad2e6450 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/find/shim.js @@ -0,0 +1,17 @@ +'use strict'; + +exports.__generic = function (t, a) { + var count = 0, o = {}, self = Object(this); + a(t.call(self, function (value, i, scope) { + a(value, this[i], "Value"); + a(i, count++, "Index"); + a(scope, this, "Scope"); + }, self), undefined, "Falsy result"); + a(count, 3); + + count = -1; + a(t.call(this, function () { + return ++count ? o : null; + }, this), this[1], "Truthy result"); + a(count, 1); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/first-index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/first-index.js new file mode 100644 index 00000000..4aebad64 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/first-index.js @@ -0,0 +1,17 @@ +'use strict'; + +module.exports = function (t, a) { + var x; + a(t.call([]), null, "Empty"); + a(t.call([null]), 0, "One value"); + a(t.call([1, 2, 3]), 0, "Many values"); + a(t.call(new Array(1000)), null, "Sparse empty"); + x = []; + x[883] = undefined; + x[890] = null; + a(t.call(x), 883, "Manual sparse, distant value"); + x = new Array(1000); + x[657] = undefined; + x[700] = null; + a(t.call(x), 657, "Sparse, distant value"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/first.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/first.js new file mode 100644 index 00000000..87fde035 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/first.js @@ -0,0 +1,13 @@ +'use strict'; + +exports.__generic = function (t, a) { + a(t.call(this), this[0]); +}; +exports[''] = function (t, a) { + var x; + a(t.call([]), undefined, "Empty"); + a(t.call(new Array(234), undefined, "Sparse empty")); + x = new Array(2342); + x[434] = {}; + a(t.call(x), x[434], "Sparse"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/flatten.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/flatten.js new file mode 100644 index 00000000..65f1214b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/flatten.js @@ -0,0 +1,12 @@ +'use strict'; + +var o = [1, 2, [3, 4, [5, 6], 7, 8], 9, 10]; + +module.exports = { + __generic: function (t, a) { + a(t.call(this).length, 3); + }, + "Nested Arrays": function (t, a) { + a(t.call(o).length, 10); + } +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/for-each-right.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/for-each-right.js new file mode 100644 index 00000000..2d24569d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/for-each-right.js @@ -0,0 +1,36 @@ +'use strict'; + +module.exports = { + __generic: function (t, a) { + var count = 0, first, last, x, icount = this.length; + t.call(this, function (item, index, col) { + ++count; + if (!first) { + first = item; + } + last = item; + x = col; + a(index, --icount, "Index"); + }); + a(count, this.length, "Iterated"); + a(first, this[this.length - 1], "First is last"); + a(last, this[0], "Last is first"); + a.deep(x, Object(this), "Collection as third argument"); //jslint: skip + }, + "": function (t, a) { + var x = {}, y, count; + t.call([1], function () { y = this; }, x); + a(y, x, "Scope"); + y = 0; + t.call([3, 4, 4], function (a, i) { y += i; }); + a(y, 3, "Indexes"); + + x = [1, 3]; + x[5] = 'x'; + y = 0; + count = 0; + t.call(x, function (a, i) { ++count; y += i; }); + a(y, 6, "Misssing Indexes"); + a(count, 3, "Misssing Indexes, count"); + } +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/group.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/group.js new file mode 100644 index 00000000..32dc8c2d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/group.js @@ -0,0 +1,24 @@ +'use strict'; + +module.exports = { + __generic: function (t, a) { + var count = 0, self; + + self = Object(this); + a.deep(t.call(self, function (v, i, scope) { + a(v, this[i], "Value"); + a(i, count++, "Index"); + a(scope, this, "Scope"); + return i; + }, self), { 0: [this[0]], 1: [this[1]], 2: [this[2]] }); + }, + "": function (t, a) { + var r; + r = t.call([2, 3, 3, 4, 5, 6, 7, 7, 23, 45, 34, 56], + function (v) { + return v % 2 ? 'odd' : 'even'; + }); + a.deep(r.odd, [3, 3, 5, 7, 7, 23, 45]); + a.deep(r.even, [2, 4, 6, 34, 56]); + } +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/indexes-of.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/indexes-of.js new file mode 100644 index 00000000..3364170f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/indexes-of.js @@ -0,0 +1,14 @@ +'use strict'; + +module.exports = { + __generic: function (t, a) { + a.deep(t.call(this, this[1]), [1]); + }, + "": function (t, a) { + var x = {}; + a.deep(t.call([1, 3, 5, 3, 5], 6), [], "No result"); + a.deep(t.call([1, 3, 5, 1, 3, 5, 1], 1), [0, 3, 6], "Some results"); + a.deep(t.call([], x), [], "Empty array"); + a.deep(t.call([x, 3, {}, x, 3, 5, x], x), [0, 3, 6], "Search for object"); + } +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/intersection.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/intersection.js new file mode 100644 index 00000000..b72b2fb0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/intersection.js @@ -0,0 +1,24 @@ +'use strict'; + +var toArray = require('../../../array/to-array'); + +module.exports = { + __generic: function (t, a) { + a.deep(t.call(this, this, this), toArray(this)); + }, + "": function (t, a) { + var x = {}, y = {}, p, r; + a.deep(t.call([], [2, 3, 4]), [], "Empty #1"); + a.deep(t.call([2, 3, 4], []), [], "Empty #2"); + a.deep(t.call([2, 3, x], [y, 5, 7]), [], "Different"); + p = t.call([3, 5, 'raz', {}, 'dwa', x], [1, 3, 'raz', 'dwa', 'trzy', x, {}], + [3, 'raz', x, 65]); + r = [3, 'raz', x]; + p.sort(); + r.sort(); + a.deep(p, r, "Same parts"); + a.deep(t.call(r, r), r, "Same"); + a.deep(t.call([1, 2, x, 4, 5, y, 7], [7, y, 5, 4, x, 2, 1]), + [1, 2, x, 4, 5, y, 7], "Long reverse same"); + } +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/is-copy.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/is-copy.js new file mode 100644 index 00000000..e7f80e7a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/is-copy.js @@ -0,0 +1,13 @@ +'use strict'; + +module.exports = function (t, a) { + var x = {}; + a(t.call([], []), true, "Empty"); + a(t.call([], {}), true, "Empty lists"); + a(t.call([1, x, 'raz'], [1, x, 'raz']), true, "Same"); + a(t.call([1, x, 'raz'], { 0: 1, 1: x, 2: 'raz', length: 3 }), true, + "Same lists"); + a(t.call([1, x, 'raz'], [x, 1, 'raz']), false, "Diff order"); + a(t.call([1, x], [1, x, 'raz']), false, "Diff length #1"); + a(t.call([1, x, 'raz'], [1, x]), false, "Diff length #2"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/is-uniq.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/is-uniq.js new file mode 100644 index 00000000..7349ba33 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/is-uniq.js @@ -0,0 +1,11 @@ +'use strict'; + +module.exports = function (t, a) { + var x = {}; + a(t.call([]), true, "Empty"); + a(t.call({}), true, "Empty lists"); + a(t.call([1, x, 'raz']), true, "Uniq"); + a(t.call([1, x, 1, 'raz']), false, "Not Uniq: primitive"); + a(t.call([1, x, '1', 'raz']), true, "Uniq: primitive"); + a(t.call([1, x, 1, {}, 'raz']), false, "Not Uniq: Obj"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/keys/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/keys/implement.js new file mode 100644 index 00000000..b0c1aa07 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/keys/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../../array/#/keys/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/keys/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/keys/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/keys/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/keys/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/keys/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/keys/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/keys/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/keys/shim.js new file mode 100644 index 00000000..a43c04ca --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/keys/shim.js @@ -0,0 +1,9 @@ +'use strict'; + +exports.__generic = function (t, a) { + var iterator = t.call(this); + a.deep(iterator.next(), { value: 0, done: false }); + a.deep(iterator.next(), { value: 1, done: false }); + a.deep(iterator.next(), { value: 2, done: false }); + a.deep(iterator.next(), { value: undefined, done: true }); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/last-index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/last-index.js new file mode 100644 index 00000000..a1cac107 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/last-index.js @@ -0,0 +1,17 @@ +'use strict'; + +module.exports = function (t, a) { + var x; + a(t.call([]), null, "Empty"); + a(t.call([null]), 0, "One value"); + a(t.call([1, 2, 3]), 2, "Many values"); + a(t.call(new Array(1000)), null, "Sparse empty"); + x = []; + x[883] = null; + x[890] = undefined; + a(t.call(x), 890, "Manual sparse, distant value"); + x = new Array(1000); + x[657] = null; + x[700] = undefined; + a(t.call(x), 700, "Sparse, distant value"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/last.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/last.js new file mode 100644 index 00000000..8d051bc8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/last.js @@ -0,0 +1,15 @@ +'use strict'; + +exports.__generic = function (t, a) { + a(t.call(this), this[this.length - 1]); +}; + +exports[''] = function (t, a) { + var x; + a(t.call([]), undefined, "Empty"); + a(t.call(new Array(234), undefined, "Sparse empty")); + x = new Array(2342); + x[434] = {}; + x[450] = {}; + a(t.call(x), x[450], "Sparse"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/map/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/map/implement.js new file mode 100644 index 00000000..cdcbc8df --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/map/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../../array/#/map/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/map/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/map/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/map/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/map/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/map/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/map/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/map/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/map/shim.js new file mode 100644 index 00000000..bbfefe8e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/map/shim.js @@ -0,0 +1,19 @@ +'use strict'; + +var SubArray = require('../../../../array/_sub-array-dummy-safe'); + +module.exports = function (t, a) { + var arr, x = {}, subArr, result; + + arr = ['foo', undefined, 0, '2d', false, x, null]; + + a.deep(t.call(arr, Boolean), [true, false, false, true, false, true, false], + "Plain array"); + + subArr = new SubArray('foo', undefined, 0, '2d', false, x, null); + + result = t.call(subArr, Boolean); + a(result instanceof SubArray, true, "Instance of subclass"); + a.deep(result, [true, false, false, true, false, true, false], + "Result of subclass"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/remove.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/remove.js new file mode 100644 index 00000000..3ebdca2d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/remove.js @@ -0,0 +1,14 @@ +'use strict'; + +module.exports = function (t, a) { + var y = {}, z = {}, x = [9, z, 5, y, 'foo']; + t.call(x, y); + a.deep(x, [9, z, 5, 'foo']); + t.call(x, {}); + a.deep(x, [9, z, 5, 'foo'], "Not existing"); + t.call(x, 5); + a.deep(x, [9, z, 'foo'], "Primitive"); + x = [9, z, 5, y, 'foo']; + t.call(x, z, 5, 'foo'); + a.deep(x, [9, y], "More than one argument"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/separate.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/separate.js new file mode 100644 index 00000000..42918b59 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/separate.js @@ -0,0 +1,15 @@ +'use strict'; + +module.exports = function (t, a) { + var x = [], y = {}, z = {}; + a.deep(t.call(x, y), [], "Empty"); + a.not(t.call(x), x, "Returns copy"); + a.deep(t.call([1], y), [1], "One"); + a.deep(t.call([1, 'raz'], y), [1, y, 'raz'], "One"); + a.deep(t.call([1, 'raz', x], y), [1, y, 'raz', y, x], "More"); + x = new Array(1000); + x[23] = 2; + x[3453] = 'raz'; + x[500] = z; + a.deep(t.call(x, y), [2, y, z, y, 'raz'], "Sparse"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/slice/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/slice/implement.js new file mode 100644 index 00000000..855ae2fa --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/slice/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../../array/#/slice/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/slice/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/slice/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/slice/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/slice/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/slice/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/slice/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/slice/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/slice/shim.js new file mode 100644 index 00000000..f674f347 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/slice/shim.js @@ -0,0 +1,17 @@ +'use strict'; + +var SubArray = require('../../../../array/_sub-array-dummy-safe'); + +module.exports = function (t, a) { + var arr, x = {}, subArr, result; + + arr = ['foo', undefined, 0, '2d', false, x, null]; + + a.deep(t.call(arr, 2, 4), [0, '2d'], "Plain array: result"); + + subArr = new SubArray('foo', undefined, 0, '2d', false, x, null); + + result = t.call(subArr, 2, 4); + a(result instanceof SubArray, true, "Instance of subclass"); + a.deep(result, [0, '2d'], "Subclass: result"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/some-right.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/some-right.js new file mode 100644 index 00000000..900771a6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/some-right.js @@ -0,0 +1,43 @@ +'use strict'; + +module.exports = { + __generic: function (t, a) { + var count = 0, first, last, x, icount = this.length; + t.call(this, function (item, index, col) { + ++count; + if (!first) { + first = item; + } + last = item; + x = col; + a(index, --icount, "Index"); + }); + a(count, this.length, "Iterated"); + a(first, this[this.length - 1], "First is last"); + a(last, this[0], "Last is first"); + a.deep(x, Object(this), "Collection as third argument"); //jslint: skip + }, + "": function (t, a) { + var x = {}, y, count; + t.call([1], function () { y = this; }, x); + a(y, x, "Scope"); + y = 0; + t.call([3, 4, 4], function (a, i) { y += i; }); + a(y, 3, "Indexes"); + + x = [1, 3]; + x[5] = 'x'; + y = 0; + count = 0; + a(t.call(x, function (a, i) { ++count; y += i; }), false, "Return"); + a(y, 6, "Misssing Indexes"); + a(count, 3, "Misssing Indexes, count"); + + count = 0; + a(t.call([-2, -3, -4, 2, -5], function (item) { + ++count; + return item > 0; + }), true, "Return"); + a(count, 2, "Break after true is returned"); + } +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/splice/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/splice/implement.js new file mode 100644 index 00000000..0d9f4618 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/splice/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../../array/#/splice/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/splice/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/splice/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/splice/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/splice/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/splice/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/splice/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/splice/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/splice/shim.js new file mode 100644 index 00000000..2c751e67 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/splice/shim.js @@ -0,0 +1,19 @@ +'use strict'; + +var SubArray = require('../../../../array/_sub-array-dummy-safe'); + +module.exports = function (t, a) { + var arr, x = {}, subArr, result; + + arr = ['foo', undefined, 0, '2d', false, x, null]; + + a.deep(t.call(arr, 2, 2, 'bar'), [0, '2d'], "Plain array: result"); + a.deep(arr, ["foo", undefined, "bar", false, x, null], "Plain array: change"); + + subArr = new SubArray('foo', undefined, 0, '2d', false, x, null); + + result = t.call(subArr, 2, 2, 'bar'); + a(result instanceof SubArray, true, "Instance of subclass"); + a.deep(result, [0, '2d'], "Subclass: result"); + a.deep(subArr, ["foo", undefined, "bar", false, x, null], "Subclass: change"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/uniq.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/uniq.js new file mode 100644 index 00000000..2f7e6c4e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/uniq.js @@ -0,0 +1,14 @@ +'use strict'; + +module.exports = { + __generic: function (t, a) { + a(t.call(this).length, 3); + }, + "": function (t, a) { + var o, x = {}, y = {}, z = {}, w; + o = [1, 2, x, 3, 1, 'raz', '1', y, x, 'trzy', z, 'raz']; + + a.not(w = t.call(o), o, "Returns different object"); + a.deep(w, [1, 2, x, 3, 'raz', '1', y, 'trzy', z], "Result"); + } +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/values/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/values/implement.js new file mode 100644 index 00000000..9f40138c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/values/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../../array/#/values/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/values/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/values/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/values/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/values/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/values/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/values/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/values/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/values/shim.js new file mode 100644 index 00000000..e590d8f2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/values/shim.js @@ -0,0 +1,9 @@ +'use strict'; + +exports.__generic = function (t, a) { + var iterator = t.call(this); + a.deep(iterator.next(), { value: '1', done: false }); + a.deep(iterator.next(), { value: '2', done: false }); + a.deep(iterator.next(), { value: '3', done: false }); + a.deep(iterator.next(), { value: undefined, done: true }); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/__scopes.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/__scopes.js new file mode 100644 index 00000000..6bfdcbc9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/__scopes.js @@ -0,0 +1,11 @@ +'use strict'; + +exports.Array = ['1', '2', '3']; + +exports.Arguments = (function () { + return arguments; +}('1', '2', '3')); + +exports.String = "123"; + +exports.Object = { 0: '1', 1: '2', 2: '3', 3: '4', length: 3 }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/_is-extensible.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/_is-extensible.js new file mode 100644 index 00000000..d387126f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/_is-extensible.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function (t, a) { + a(typeof t, 'boolean'); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/_sub-array-dummy-safe.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/_sub-array-dummy-safe.js new file mode 100644 index 00000000..29d8699d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/_sub-array-dummy-safe.js @@ -0,0 +1,7 @@ +'use strict'; + +var isArray = Array.isArray; + +module.exports = function (t, a) { + t((t === null) || isArray(t.prototype), true); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/_sub-array-dummy.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/_sub-array-dummy.js new file mode 100644 index 00000000..29d8699d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/_sub-array-dummy.js @@ -0,0 +1,7 @@ +'use strict'; + +var isArray = Array.isArray; + +module.exports = function (t, a) { + t((t === null) || isArray(t.prototype), true); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/from/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/from/implement.js new file mode 100644 index 00000000..e0db846f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/from/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../array/from/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/from/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/from/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/from/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/from/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/from/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/from/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/from/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/from/shim.js new file mode 100644 index 00000000..310302ac --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/from/shim.js @@ -0,0 +1,60 @@ +// Some tests taken from: https://github.com/mathiasbynens/Array.from/blob/master/tests/tests.js + +'use strict'; + +module.exports = function (t, a) { + var o = [1, 2, 3], MyType; + a.not(t(o), o, "Array"); + a.deep(t(o), o, "Array: same content"); + a.deep(t('12r3v'), ['1', '2', 'r', '3', 'v'], "String"); + a.deep(t((function () { return arguments; }(3, o, 'raz'))), + [3, o, 'raz'], "Arguments"); + a.deep(t((function () { return arguments; }(3))), [3], + "Arguments with one numeric value"); + + a.deep(t({ 0: 'raz', 1: 'dwa', length: 2 }), ['raz', 'dwa'], "Other"); + + a.deep(t(o, function (val) { return (val + 2) * 10; }, 10), [30, 40, 50], + "Mapping"); + + a.throws(function () { t(); }, TypeError, "Undefined"); + a.deep(t(3), [], "Primitive"); + + a(t.length, 1, "Length"); + a.deep(t({ length: 0 }), [], "No values Array-like"); + a.deep(t({ length: -1 }), [], "Invalid length Array-like"); + a.deep(t({ length: -Infinity }), [], "Invalid length Array-like #2"); + a.throws(function () { t(undefined); }, TypeError, "Undefined"); + a.throws(function () { t(null); }, TypeError, "Null"); + a.deep(t(false), [], "Boolean"); + a.deep(t(-Infinity), [], "Inifity"); + a.deep(t(-0), [], "-0"); + a.deep(t(+0), [], "+0"); + a.deep(t(1), [], "1"); + a.deep(t(+Infinity), [], "+Infinity"); + a.deep(t({}), [], "Plain object"); + a.deep(t({ length: 1 }), [undefined], "Sparse array-like"); + a.deep(t({ '0': 'a', '1': 'b', length: 2 }, function (x) { return x + x; }), ['aa', 'bb'], + "Map"); + a.deep(t({ '0': 'a', '1': 'b', length: 2 }, function (x) { return String(this); }, undefined), + ['undefined', 'undefined'], "Map context"); + a.deep(t({ '0': 'a', '1': 'b', length: 2 }, function (x) { return String(this); }, 'x'), + ['x', 'x'], "Map primitive context"); + a.throws(function () { t({}, 'foo', 'x'); }, TypeError, "Non callable for map"); + + a.deep(t.call(null, { length: 1, '0': 'a' }), ['a'], "Null context"); + + a(t({ __proto__: { '0': 'abc', length: 1 } })[0], 'abc', "Values on prototype"); + + a.throws(function () { t.call(function () { return Object.freeze({}); }, {}); }, + TypeError, "Contructor producing freezed objects"); + + // Ensure no setters are called for the indexes + // Ensure no setters are called for the indexes + MyType = function () {}; + Object.defineProperty(MyType.prototype, '0', { + set: function (x) { throw new Error('Setter called: ' + x); } + }); + a.deep(t.call(MyType, { '0': 'abc', length: 1 }), { '0': 'abc', length: 1 }, + "Defined not set"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/generate.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/generate.js new file mode 100644 index 00000000..d72e0568 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/generate.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = function (t, a) { + var x = {}, y = {}; + a.deep(t(3), [undefined, undefined, undefined], "Just length"); + a.deep(t(0, 'x'), [], "No repeat"); + a.deep(t(1, x, y), [x], "Arguments length larger than repeat number"); + a.deep(t(3, x), [x, x, x], "Single argument"); + a.deep(t(5, x, y), [x, y, x, y, x], "Many arguments"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/is-plain-array.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/is-plain-array.js new file mode 100644 index 00000000..871a08ae --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/is-plain-array.js @@ -0,0 +1,18 @@ +'use strict'; + +var SubArray = require('../../array/_sub-array-dummy-safe'); + +module.exports = function (t, a) { + var arr = [1, 2, 3]; + a(t(arr), true, "Array"); + a(t(null), false, "Null"); + a(t(), false, "Undefined"); + a(t('234'), false, "String"); + a(t(23), false, "Number"); + a(t({}), false, "Plain object"); + a(t({ length: 1, 0: 'raz' }), false, "Array-like"); + a(t(Object.create(arr)), false, "Array extension"); + if (!SubArray) return; + a(t(new SubArray(23)), false, "Subclass instance"); + a(t(Array.prototype), false, "Array.prototype"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/of/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/of/implement.js new file mode 100644 index 00000000..30d53be2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/of/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../array/of/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/of/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/of/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/of/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/of/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/of/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/of/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/of/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/of/shim.js new file mode 100644 index 00000000..e6974420 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/of/shim.js @@ -0,0 +1,68 @@ +// Most tests taken from https://github.com/mathiasbynens/Array.of/blob/master/tests/tests.js +// Thanks @mathiasbynens + +'use strict'; + +var defineProperty = Object.defineProperty; + +module.exports = function (t, a) { + var x = {}, testObject, MyType; + + a.deep(t(), [], "No arguments"); + a.deep(t(3), [3], "One numeric argument"); + a.deep(t(3, 'raz', null, x, undefined), [3, 'raz', null, x, undefined], + "Many arguments"); + + a(t.length, 0, "Length"); + + a.deep(t('abc'), ['abc'], "String"); + a.deep(t(undefined), [undefined], "Undefined"); + a.deep(t(null), [null], "Null"); + a.deep(t(false), [false], "Boolean"); + a.deep(t(-Infinity), [-Infinity], "Infinity"); + a.deep(t(-0), [-0], "-0"); + a.deep(t(+0), [+0], "+0"); + a.deep(t(1), [1], "1"); + a.deep(t(1, 2, 3), [1, 2, 3], "Numeric args"); + a.deep(t(+Infinity), [+Infinity], "+Infinity"); + a.deep(t({ '0': 'a', '1': 'b', '2': 'c', length: 3 }), + [{ '0': 'a', '1': 'b', '2': 'c', length: 3 }], "Array like"); + a.deep(t(undefined, null, false, -Infinity, -0, +0, 1, 2, +Infinity), + [undefined, null, false, -Infinity, -0, +0, 1, 2, +Infinity], "Falsy arguments"); + + a.h1("Null context"); + a.deep(t.call(null, 'abc'), ['abc'], "String"); + a.deep(t.call(null, undefined), [undefined], "Undefined"); + a.deep(t.call(null, null), [null], "Null"); + a.deep(t.call(null, false), [false], "Boolean"); + a.deep(t.call(null, -Infinity), [-Infinity], "-Infinity"); + a.deep(t.call(null, -0), [-0], "-0"); + a.deep(t.call(null, +0), [+0], "+0"); + a.deep(t.call(null, 1), [1], "1"); + a.deep(t.call(null, 1, 2, 3), [1, 2, 3], "Numeric"); + a.deep(t.call(null, +Infinity), [+Infinity], "+Infinity"); + a.deep(t.call(null, { '0': 'a', '1': 'b', '2': 'c', length: 3 }), + [{ '0': 'a', '1': 'b', '2': 'c', length: 3 }], "Array-like"); + a.deep(t.call(null, undefined, null, false, -Infinity, -0, +0, 1, 2, +Infinity), + [undefined, null, false, -Infinity, -0, +0, 1, 2, +Infinity], "Falsy"); + + a.h1("Other constructor context"); + a.deep(t.call(Object, 1, 2, 3), { '0': 1, '1': 2, '2': 3, length: 3 }, "Many arguments"); + + testObject = Object(3); + testObject[0] = 1; + testObject[1] = 2; + testObject[2] = 3; + testObject.length = 3; + a.deep(t.call(Object, 1, 2, 3), testObject, "Test object"); + a(t.call(Object).length, 0, "No arguments"); + a.throws(function () { t.call(function () { return Object.freeze({}); }); }, TypeError, + "Frozen instance"); + + // Ensure no setters are called for the indexes + MyType = function () {}; + defineProperty(MyType.prototype, '0', { + set: function (x) { throw new Error('Setter called: ' + x); } + }); + a.deep(t.call(MyType, 'abc'), { '0': 'abc', length: 1 }, "Define, not set"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/to-array.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/to-array.js new file mode 100644 index 00000000..4985b5ea --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/to-array.js @@ -0,0 +1,13 @@ +'use strict'; + +module.exports = function (t, a) { + var o = [1, 2, 3]; + a(t(o), o, "Array"); + a.deep(t('12r3v'), ['1', '2', 'r', '3', 'v'], "String"); + a.deep(t((function () { return arguments; }(3, o, 'raz'))), + [3, o, 'raz'], "Arguments"); + a.deep(t((function () { return arguments; }(3))), [3], + "Arguments with one numeric value"); + + a.deep(t({ 0: 'raz', 1: 'dwa', length: 2 }), ['raz', 'dwa'], "Other"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/valid-array.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/valid-array.js new file mode 100644 index 00000000..3732192d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/valid-array.js @@ -0,0 +1,14 @@ +'use strict'; + +module.exports = function (t, a) { + var x; + a.throws(function () { t(); }, TypeError, "Undefined"); + a.throws(function () { t(null); }, TypeError, "Null"); + a.throws(function () { t(0); }, TypeError, "Number"); + a.throws(function () { t(true); }, TypeError, "Boolean"); + a.throws(function () { t('raz'); }, TypeError, "String"); + a.throws(function () { t(function () {}); }, TypeError, "Function"); + a.throws(function () { t({}); }, TypeError, "Object"); + a.throws(function () { t({ length: 0 }); }, TypeError, "Array-like"); + a(t(x = []), x, "Array"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/boolean/is-boolean.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/boolean/is-boolean.js new file mode 100644 index 00000000..4e6b3cb7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/boolean/is-boolean.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports = function (t, a) { + a(t('arar'), false, "String"); + a(t(12), false, "Number"); + a(t(false), true, "Boolean"); + a(t(new Boolean(false)), true, "Boolean object"); + a(t(new Date()), false, "Date"); + a(t(new String('raz')), false, "String object"); + a(t({}), false, "Plain object"); + a(t(/a/), false, "Regular expression"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/date/#/copy.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/date/#/copy.js new file mode 100644 index 00000000..767c5e16 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/date/#/copy.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = function (t, a) { + var o = new Date(), o2; + + o2 = t.call(o); + a.not(o, o2, "Different objects"); + a.ok(o2 instanceof Date, "Instance of Date"); + a(o.getTime(), o2.getTime(), "Same time"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/date/#/days-in-month.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/date/#/days-in-month.js new file mode 100644 index 00000000..9ddba55f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/date/#/days-in-month.js @@ -0,0 +1,17 @@ +'use strict'; + +module.exports = function (t, a) { + a(t.call(new Date(2001, 0, 1)), 31, "January"); + a(t.call(new Date(2001, 1, 1)), 28, "February"); + a(t.call(new Date(2000, 1, 1)), 29, "February (leap)"); + a(t.call(new Date(2001, 2, 1)), 31, "March"); + a(t.call(new Date(2001, 3, 1)), 30, "April"); + a(t.call(new Date(2001, 4, 1)), 31, "May"); + a(t.call(new Date(2001, 5, 1)), 30, "June"); + a(t.call(new Date(2001, 6, 1)), 31, "July"); + a(t.call(new Date(2001, 7, 1)), 31, "August"); + a(t.call(new Date(2001, 8, 1)), 30, "September"); + a(t.call(new Date(2001, 9, 1)), 31, "October"); + a(t.call(new Date(2001, 10, 1)), 30, "November"); + a(t.call(new Date(2001, 11, 1)), 31, "December"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/date/#/floor-day.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/date/#/floor-day.js new file mode 100644 index 00000000..d4f4a908 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/date/#/floor-day.js @@ -0,0 +1,6 @@ +'use strict'; + +module.exports = function (t, a) { + a(t.call(new Date(2000, 0, 1, 13, 32, 34, 234)).valueOf(), + new Date(2000, 0, 1).valueOf()); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/date/#/floor-month.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/date/#/floor-month.js new file mode 100644 index 00000000..b4a81bef --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/date/#/floor-month.js @@ -0,0 +1,6 @@ +'use strict'; + +module.exports = function (t, a) { + a(t.call(new Date(2000, 0, 15, 13, 32, 34, 234)).valueOf(), + new Date(2000, 0, 1).valueOf()); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/date/#/floor-year.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/date/#/floor-year.js new file mode 100644 index 00000000..aae117e7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/date/#/floor-year.js @@ -0,0 +1,6 @@ +'use strict'; + +module.exports = function (t, a) { + a(t.call(new Date(2000, 5, 13, 13, 32, 34, 234)).valueOf(), + new Date(2000, 0, 1).valueOf()); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/date/#/format.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/date/#/format.js new file mode 100644 index 00000000..e68e4bf7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/date/#/format.js @@ -0,0 +1,6 @@ +'use strict'; + +module.exports = function (t, a) { + var dt = new Date(2011, 2, 3, 3, 5, 5, 32); + a(t.call(dt, ' %Y.%y.%m.%d.%H.%M.%S.%L '), ' 2011.11.03.03.03.05.05.032 '); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/date/is-date.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/date/is-date.js new file mode 100644 index 00000000..109093df --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/date/is-date.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = function (t, a) { + a(t('arar'), false, "String"); + a(t(12), false, "Number"); + a(t(true), false, "Boolean"); + a(t(new Date()), true, "Date"); + a(t(new String('raz')), false, "String object"); + a(t({}), false, "Plain object"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/date/valid-date.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/date/valid-date.js new file mode 100644 index 00000000..98787e40 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/date/valid-date.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports = function (t, a) { + var d = new Date(); + a(t(d), d, "Date"); + a.throws(function () { + t({}); + }, "Object"); + a.throws(function () { + t({ valueOf: function () { return 20; } }); + }, "Number object"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/error/#/throw.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/error/#/throw.js new file mode 100644 index 00000000..1213cfc3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/error/#/throw.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = function (t, a) { + var e = new Error(); + try { + t.call(e); + } catch (e2) { + a(e2, e); + } +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/error/custom.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/error/custom.js new file mode 100644 index 00000000..d4ff500c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/error/custom.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports = function (t, a) { + var T = t, err = new T('My Error', 'MY_ERROR', { errno: 123 }); + a(err instanceof Error, true, "Instance of error"); + a(err.constructor, Error, "Constructor"); + a(err.name, 'Error', "Name"); + a(String(err), 'Error: My Error', "String representation"); + a(err.code, 'MY_ERROR', "Code"); + a(err.errno, 123, "Errno"); + a(typeof err.stack, 'string', "Stack trace"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/error/is-error.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/error/is-error.js new file mode 100644 index 00000000..f8b5e200 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/error/is-error.js @@ -0,0 +1,16 @@ +'use strict'; + +module.exports = function (t, a) { + a(t(), false, "Undefined"); + a(t(1), false, "Primitive"); + a(t({}), false, "Objectt"); + a(t({ toString: function () { return '[object Error]'; } }), false, + "Fake error"); + a(t(new Error()), true, "Error"); + a(t(new EvalError()), true, "EvalError"); + a(t(new RangeError()), true, "RangeError"); + a(t(new ReferenceError()), true, "ReferenceError"); + a(t(new SyntaxError()), true, "SyntaxError"); + a(t(new TypeError()), true, "TypeError"); + a(t(new URIError()), true, "URIError"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/error/valid-error.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/error/valid-error.js new file mode 100644 index 00000000..e04cdb33 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/error/valid-error.js @@ -0,0 +1,9 @@ +'use strict'; + +module.exports = function (t, a) { + var e = new Error(); + a(t(e), e, "Error"); + a.throws(function () { + t({}); + }, "Other"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/#/compose.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/#/compose.js new file mode 100644 index 00000000..83de5e84 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/#/compose.js @@ -0,0 +1,9 @@ +'use strict'; + +var f = function (a, b) { return ['a', arguments.length, a, b]; } + , g = function (a) { return ['b', arguments.length].concat(a); } + , h = function (a) { return ['c', arguments.length].concat(a); }; + +module.exports = function (t, a) { + a.deep(t.call(h, g, f)(1, 2), ['c', 1, 'b', 1, 'a', 2, 1, 2]); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/#/copy.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/#/copy.js new file mode 100644 index 00000000..7a22e2f2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/#/copy.js @@ -0,0 +1,19 @@ +'use strict'; + +module.exports = function (t, a) { + var foo = 'raz', bar = 'dwa' + , fn = function marko(a, b) { return this + a + b + foo + bar; } + , result, o = {}; + + fn.prototype = o; + + fn.foo = 'raz'; + + result = t.call(fn); + + a(result.length, fn.length, "Length"); + a(result.name, fn.name, "Length"); + a(result.call('marko', 'el', 'fe'), 'markoelferazdwa', "Body"); + a(result.prototype, fn.prototype, "Prototype"); + a(result.foo, fn.foo, "Custom property"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/#/curry.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/#/curry.js new file mode 100644 index 00000000..18fb0389 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/#/curry.js @@ -0,0 +1,18 @@ +'use strict'; + +var toArray = require('../../../array/to-array') + + , f = function () { return toArray(arguments); }; + +module.exports = function (t, a) { + var x, y = {}, z; + a.deep(t.call(f, 0, 1, 2)(3), [], "0 arguments"); + x = t.call(f, 5, {}); + a(x.length, 5, "Length #1"); + z = x(1, 2); + a(z.length, 3, "Length #2"); + z = z(3, 4); + a(z.length, 1, "Length #1"); + a.deep(z(5, 6), [1, 2, 3, 4, 5], "Many arguments"); + a.deep(x(8, 3)(y, 45)('raz', 6), [8, 3, y, 45, 'raz'], "Many arguments #2"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/#/lock.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/#/lock.js new file mode 100644 index 00000000..44a12d7b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/#/lock.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = function (t, a) { + a(t.call(function () { + return arguments.length; + })(1, 2, 3), 0); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/#/not.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/#/not.js new file mode 100644 index 00000000..c0f5e9d4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/#/not.js @@ -0,0 +1,11 @@ +'use strict'; + +var identity = require('../../../function/identity') + , noop = require('../../../function/noop'); + +module.exports = function (t, a) { + a(t.call(identity)(''), true, "Falsy"); + a(t.call(noop)(), true, "Undefined"); + a(t.call(identity)({}), false, "Any object"); + a(t.call(identity)(true), false, "True"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/#/partial.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/#/partial.js new file mode 100644 index 00000000..bd00ce75 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/#/partial.js @@ -0,0 +1,9 @@ +'use strict'; + +var toArray = require('../../../array/to-array') + + , f = function () { return toArray(arguments); }; + +module.exports = function (t, a) { + a.deep(t.call(f, 1)(2, 3), [1, 2, 3]); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/#/spread.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/#/spread.js new file mode 100644 index 00000000..b82dfecf --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/#/spread.js @@ -0,0 +1,8 @@ +'use strict'; + +var f = function (a, b) { return this[a] + this[b]; } + , o = { a: 3, b: 4 }; + +module.exports = function (t, a) { + a(t.call(f).call(o, ['a', 'b']), 7); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/#/to-string-tokens.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/#/to-string-tokens.js new file mode 100644 index 00000000..4c54d303 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/#/to-string-tokens.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports = function (t, a) { + a.deep(t.call(function (a, b) { return this[a] + this[b]; }), + { args: 'a, b', body: ' return this[a] + this[b]; ' }); + a.deep(t.call(function () {}), + { args: '', body: '' }); + a.deep(t.call(function (raz) {}), + { args: 'raz', body: '' }); + a.deep(t.call(function () { Object(); }), + { args: '', body: ' Object(); ' }); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/_define-length.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/_define-length.js new file mode 100644 index 00000000..8f037e85 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/_define-length.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports = function (t, a) { + var foo = 'raz', bar = 'dwa' + , fn = function (a, b) { return this + a + b + foo + bar; } + , result; + + result = t(fn, 3); + a(result.call('marko', 'el', 'fe'), 'markoelferazdwa', "Content"); + a(result.length, 3, "Length"); + a(result.prototype, fn.prototype, "Prototype"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/constant.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/constant.js new file mode 100644 index 00000000..fda52aa4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/constant.js @@ -0,0 +1,7 @@ +'use strict'; + +var o = {}; + +module.exports = function (t, a) { + a(t(o)(), o); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/identity.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/identity.js new file mode 100644 index 00000000..8013e2e5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/identity.js @@ -0,0 +1,7 @@ +'use strict'; + +var o = {}; + +module.exports = function (t, a) { + a(t(o), o); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/invoke.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/invoke.js new file mode 100644 index 00000000..fcce4aaa --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/invoke.js @@ -0,0 +1,9 @@ +'use strict'; + +var constant = require('../../function/constant') + + , o = { b: constant('c') }; + +module.exports = function (t, a) { + a(t('b')(o), 'c'); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/is-arguments.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/is-arguments.js new file mode 100644 index 00000000..f8de8812 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/is-arguments.js @@ -0,0 +1,11 @@ +'use strict'; + +module.exports = function (t, a) { + var args, dummy; + args = (function () { return arguments; }()); + dummy = { '0': 1, '1': 2 }; + Object.defineProperty(dummy, 'length', { value: 2 }); + a(t(args), true, "Arguments"); + a(t(dummy), false, "Dummy"); + a(t([]), false, "Array"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/is-function.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/is-function.js new file mode 100644 index 00000000..83acc42f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/is-function.js @@ -0,0 +1,8 @@ +'use strict'; + +var o = { call: Function.prototype.call, apply: Function.prototype.apply }; + +module.exports = function (t, a) { + a(t(function () {}), true, "Function is function"); + a(t(o), false, "Plain object is not function"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/noop.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/noop.js new file mode 100644 index 00000000..4305c6fc --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/noop.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function (t, a) { + a(typeof t(1, 2, 3), 'undefined'); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/pluck.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/pluck.js new file mode 100644 index 00000000..5bf9583a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/pluck.js @@ -0,0 +1,7 @@ +'use strict'; + +var o = { foo: 'bar' }; + +module.exports = function (t, a) { + a(t('foo')(o), o.foo); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/valid-function.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/valid-function.js new file mode 100644 index 00000000..59b16233 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/valid-function.js @@ -0,0 +1,17 @@ +'use strict'; + +module.exports = function (t, a) { + var f = function () {}; + a(t(f), f, "Function"); + f = new Function(); + a(t(f), f, "Function"); + a.throws(function () { + t({}); + }, "Object"); + a.throws(function () { + t(/re/); + }, "RegExp"); + a.throws(function () { + t({ call: function () { return 20; } }); + }, "Plain object"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/global.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/global.js new file mode 100644 index 00000000..1f452aef --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/global.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function (t, a) { + a.ok(t && typeof t === 'object'); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/iterable/for-each.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/iterable/for-each.js new file mode 100644 index 00000000..0fed8ad8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/iterable/for-each.js @@ -0,0 +1,40 @@ +'use strict'; + +var ArrayIterator = require('es6-iterator/array') + + , slice = Array.prototype.slice; + +module.exports = function (t, a) { + var i = 0, x = ['raz', 'dwa', 'trzy'], y = {}; + t(x, function () { + a.deep(slice.call(arguments, 0, 1), [x[i]], "Array " + i + "#"); + a(this, y, "Array: context: " + (i++) + "#"); + }, y); + i = 0; + t((function () { return arguments; }('raz', 'dwa', 'trzy')), function () { + a.deep(slice.call(arguments, 0, 1), [x[i]], "Arguments" + i + "#"); + a(this, y, "Arguments: context: " + (i++) + "#"); + }, y); + i = 0; + t({ 0: 'raz', 1: 'dwa', 2: 'trzy', length: 3 }, function () { + a.deep(slice.call(arguments, 0, 1), [x[i]], "Array-like" + i + "#"); + a(this, y, "Array-like: context: " + (i++) + "#"); + }, y); + i = 0; + t(x = 'foo', function () { + a.deep(slice.call(arguments, 0, 1), [x[i]], "String " + i + "#"); + a(this, y, "Regular String: context: " + (i++) + "#"); + }, y); + i = 0; + x = ['r', '💩', 'z']; + t('r💩z', function () { + a.deep(slice.call(arguments, 0, 1), [x[i]], "String " + i + "#"); + a(this, y, "Unicode String: context: " + (i++) + "#"); + }, y); + i = 0; + t(new ArrayIterator(x), function () { + a.deep(slice.call(arguments, 0, 1), [x[i]], "Iterator " + i + "#"); + a(this, y, "Iterator: context: " + (i++) + "#"); + }, y); + +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/iterable/is.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/iterable/is.js new file mode 100644 index 00000000..c0d2a43e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/iterable/is.js @@ -0,0 +1,20 @@ +'use strict'; + +var iteratorSymbol = require('es6-symbol').iterator; + +module.exports = function (t, a) { + var x; + a(t([]), true, "Array"); + a(t(""), true, "String"); + a(t((function () { return arguments; }())), true, "Arguments"); + a(t({ length: 0 }), true, "List object"); + a(t(function () {}), false, "Function"); + a(t({}), false, "Plain object"); + a(t(/raz/), false, "Regexp"); + a(t(), false, "No argument"); + a(t(null), false, "Null"); + a(t(undefined), false, "Undefined"); + x = {}; + x[iteratorSymbol] = function () {}; + a(t(x), true, "Iterable"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/iterable/validate-object.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/iterable/validate-object.js new file mode 100644 index 00000000..da12529b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/iterable/validate-object.js @@ -0,0 +1,20 @@ +'use strict'; + +var iteratorSymbol = require('es6-symbol').iterator; + +module.exports = function (t, a) { + var x; + a.throws(function () { t(0); }, TypeError, "0"); + a.throws(function () { t(false); }, TypeError, "false"); + a.throws(function () { t(''); }, TypeError, "String"); + a.throws(function () { t({}); }, TypeError, "Plain Object"); + a.throws(function () { t(function () {}); }, TypeError, "Function"); + a(t(x = new String('raz')), x, "String object"); //jslint: ignore + + a(t(x = { length: 1 }), x, "Array like"); + a.throws(function () { t(); }, TypeError, "Undefined"); + a.throws(function () { t(null); }, TypeError, "null"); + x = {}; + x[iteratorSymbol] = function () {}; + a(t(x), x, "Iterable"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/iterable/validate.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/iterable/validate.js new file mode 100644 index 00000000..bcc2ad3d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/iterable/validate.js @@ -0,0 +1,20 @@ +'use strict'; + +var iteratorSymbol = require('es6-symbol').iterator; + +module.exports = function (t, a) { + var x; + a.throws(function () { t(0); }, TypeError, "0"); + a.throws(function () { t(false); }, TypeError, "false"); + a(t(''), '', "''"); + a.throws(function () { t({}); }, TypeError, "Plain Object"); + a.throws(function () { t(function () {}); }, TypeError, "Function"); + a(t(x = new String('raz')), x, "String object"); //jslint: ignore + + a(t(x = { length: 1 }), x, "Array like"); + a.throws(function () { t(); }, TypeError, "Undefined"); + a.throws(function () { t(null); }, TypeError, "null"); + x = {}; + x[iteratorSymbol] = function () {}; + a(t(x), x, "Iterable"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/_pack-ieee754.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/_pack-ieee754.js new file mode 100644 index 00000000..9041431d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/_pack-ieee754.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function (t, a) { + a.deep(t(1.337, 8, 23), [63, 171, 34, 209]); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/_unpack-ieee754.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/_unpack-ieee754.js new file mode 100644 index 00000000..ca30b820 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/_unpack-ieee754.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function (t, a) { + a.deep(t([63, 171, 34, 209], 8, 23), 1.3370000123977661); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/acosh/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/acosh/implement.js new file mode 100644 index 00000000..01fb6d08 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/acosh/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../math/acosh/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/acosh/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/acosh/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/acosh/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/acosh/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/acosh/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/acosh/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/acosh/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/acosh/shim.js new file mode 100644 index 00000000..3d710c79 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/acosh/shim.js @@ -0,0 +1,11 @@ +'use strict'; + +module.exports = function (t, a) { + a(t({}), NaN, "NaN"); + a(t(-1), NaN, "Negative"); + a(t(0), NaN, "Zero"); + a(t(0.5), NaN, "Below 1"); + a(t(1), 0, "1"); + a(t(2), 1.3169578969248166, "Other"); + a(t(Infinity), Infinity, "Infinity"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/asinh/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/asinh/implement.js new file mode 100644 index 00000000..d1fcecee --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/asinh/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../math/asinh/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/asinh/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/asinh/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/asinh/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/asinh/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/asinh/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/asinh/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/asinh/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/asinh/shim.js new file mode 100644 index 00000000..d9fbe49e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/asinh/shim.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = function (t, a) { + a(t({}), NaN, "NaN"); + a(t(0), 0, "Zero"); + a(t(Infinity), Infinity, "Infinity"); + a(t(-Infinity), -Infinity, "-Infinity"); + a(t(-2), -1.4436354751788103, "Negative"); + a(t(2), 1.4436354751788103, "Positive"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/atanh/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/atanh/implement.js new file mode 100644 index 00000000..cba8fad8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/atanh/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../math/atanh/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/atanh/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/atanh/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/atanh/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/atanh/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/atanh/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/atanh/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/atanh/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/atanh/shim.js new file mode 100644 index 00000000..a857b496 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/atanh/shim.js @@ -0,0 +1,11 @@ +'use strict'; + +module.exports = function (t, a) { + a(t({}), NaN, "NaN"); + a(t(-2), NaN, "Less than -1"); + a(t(2), NaN, "Greater than 1"); + a(t(-1), -Infinity, "-1"); + a(t(1), Infinity, "1"); + a(t(0), 0, "Zero"); + a(t(0.5), 0.5493061443340549, "Ohter"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/cbrt/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/cbrt/implement.js new file mode 100644 index 00000000..374d4b38 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/cbrt/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../math/cbrt/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/cbrt/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/cbrt/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/cbrt/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/cbrt/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/cbrt/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/cbrt/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/cbrt/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/cbrt/shim.js new file mode 100644 index 00000000..43ab68b8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/cbrt/shim.js @@ -0,0 +1,11 @@ +'use strict'; + +module.exports = function (t, a) { + a(t({}), NaN, "NaN"); + a(t(0), 0, "Zero"); + a(t(Infinity), Infinity, "Infinity"); + a(t(-Infinity), -Infinity, "-Infinity"); + a(t(-1), -1, "-1"); + a(t(1), 1, "1"); + a(t(2), 1.2599210498948732, "Ohter"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/clz32/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/clz32/implement.js new file mode 100644 index 00000000..44f88155 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/clz32/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../math/clz32/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/clz32/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/clz32/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/clz32/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/clz32/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/clz32/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/clz32/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/clz32/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/clz32/shim.js new file mode 100644 index 00000000..a769b39b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/clz32/shim.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports = function (t, a) { + a(t(1), 31, "1"); + a(t(1000), 22, "1000"); + a(t(), 32, "No arguments"); + a(t(Infinity), 32, "Infinity"); + a(t(-Infinity), 32, "-Infinity"); + a(t("foo"), 32, "String"); + a(t(true), 31, "Boolean"); + a(t(3.5), 30, "Float"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/cosh/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/cosh/implement.js new file mode 100644 index 00000000..f3c712b1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/cosh/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../math/cosh/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/cosh/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/cosh/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/cosh/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/cosh/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/cosh/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/cosh/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/cosh/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/cosh/shim.js new file mode 100644 index 00000000..419c1236 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/cosh/shim.js @@ -0,0 +1,13 @@ +'use strict'; + +module.exports = function (t, a) { + a(t({}), NaN, "NaN"); + a(t(0), 1, "Zero"); + a(t(Infinity), Infinity, "Infinity"); + a(t(-Infinity), Infinity, "-Infinity"); + a(t(1), 1.5430806348152437, "1"); + a(t(Number.MAX_VALUE), Infinity); + a(t(-Number.MAX_VALUE), Infinity); + a(t(Number.MIN_VALUE), 1); + a(t(-Number.MIN_VALUE), 1); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/expm1/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/expm1/implement.js new file mode 100644 index 00000000..c2129672 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/expm1/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../math/expm1/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/expm1/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/expm1/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/expm1/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/expm1/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/expm1/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/expm1/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/expm1/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/expm1/shim.js new file mode 100644 index 00000000..15f0e796 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/expm1/shim.js @@ -0,0 +1,9 @@ +'use strict'; + +module.exports = function (t, a) { + a(t({}), NaN, "NaN"); + a(t(0), 0, "Zero"); + a(t(Infinity), Infinity, "Infinity"); + a(t(-Infinity), -1, "-Infinity"); + a(t(1).toFixed(15), '1.718281828459045', "1"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/fround/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/fround/implement.js new file mode 100644 index 00000000..c909af7c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/fround/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../math/fround/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/fround/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/fround/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/fround/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/fround/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/fround/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/fround/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/fround/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/fround/shim.js new file mode 100644 index 00000000..4ef6d4ea --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/fround/shim.js @@ -0,0 +1,9 @@ +'use strict'; + +module.exports = function (t, a) { + a(t({}), NaN, "NaN"); + a(t(0), 0, "Zero"); + a(t(Infinity), Infinity, "Infinity"); + a(t(-Infinity), -Infinity, "-Infinity"); + a(t(1.337), 1.3370000123977661, "1"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/hypot/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/hypot/implement.js new file mode 100644 index 00000000..99466464 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/hypot/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../math/hypot/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/hypot/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/hypot/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/hypot/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/hypot/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/hypot/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/hypot/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/hypot/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/hypot/shim.js new file mode 100644 index 00000000..91d950a5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/hypot/shim.js @@ -0,0 +1,11 @@ +'use strict'; + +module.exports = function (t, a) { + a(t(), 0, "No arguments"); + a(t(0, -0, 0), 0, "Zeros"); + a(t(4, NaN, Infinity), Infinity, "Infinity"); + a(t(4, NaN, -Infinity), Infinity, "Infinity"); + a(t(4, NaN, 34), NaN, "NaN"); + a(t(3, 4), 5, "#1"); + a(t(3, 4, 5), 7.0710678118654755, "#2"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/imul/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/imul/implement.js new file mode 100644 index 00000000..7b2a2a61 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/imul/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../math/imul/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/imul/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/imul/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/imul/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/imul/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/imul/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/imul/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/imul/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/imul/shim.js new file mode 100644 index 00000000..a2ca7fe7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/imul/shim.js @@ -0,0 +1,9 @@ +'use strict'; + +module.exports = function (t, a) { + a(t(), 0, "No arguments"); + a(t(0, 0), 0, "Zeros"); + a(t(2, 4), 8, "#1"); + a(t(-1, 8), -8, "#2"); + a(t(0xfffffffe, 5), -10, "#3"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log10/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log10/implement.js new file mode 100644 index 00000000..4b3b4a45 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log10/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../math/log10/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log10/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log10/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log10/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log10/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log10/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log10/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log10/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log10/shim.js new file mode 100644 index 00000000..5fa0d5be --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log10/shim.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = function (t, a) { + a(t({}), NaN, "NaN"); + a(t(-0.5), NaN, "Less than 0"); + a(t(0), -Infinity, "0"); + a(t(1), 0, "1"); + a(t(Infinity), Infinity, "Infinity"); + a(t(2), 0.3010299956639812, "Other"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log1p/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log1p/implement.js new file mode 100644 index 00000000..5d269bd3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log1p/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../math/log1p/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log1p/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log1p/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log1p/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log1p/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log1p/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log1p/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log1p/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log1p/shim.js new file mode 100644 index 00000000..d495ce04 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log1p/shim.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = function (t, a) { + a(t({}), NaN, "NaN"); + a(t(-1.5), NaN, "Less than -1"); + a(t(-1), -Infinity, "-1"); + a(t(0), 0, "0"); + a(t(Infinity), Infinity, "Infinity"); + a(t(1), 0.6931471805599453, "Other"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log2/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log2/implement.js new file mode 100644 index 00000000..92b501ac --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log2/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../math/log2/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log2/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log2/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log2/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log2/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log2/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log2/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log2/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log2/shim.js new file mode 100644 index 00000000..faa9c32a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log2/shim.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = function (t, a) { + a(t({}), NaN, "NaN"); + a(t(-0.5), NaN, "Less than 0"); + a(t(0), -Infinity, "0"); + a(t(1), 0, "1"); + a(t(Infinity), Infinity, "Infinity"); + a(t(3).toFixed(15), '1.584962500721156', "Other"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/sign/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/sign/implement.js new file mode 100644 index 00000000..5875c42d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/sign/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../math/sign/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/sign/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/sign/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/sign/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/sign/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/sign/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/sign/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/sign/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/sign/shim.js new file mode 100644 index 00000000..b6b89c15 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/sign/shim.js @@ -0,0 +1,11 @@ +'use strict'; + +var is = require('../../../object/is'); + +module.exports = function (t, a) { + a(is(t(0), +0), true, "+0"); + a(is(t(-0), -0), true, "-0"); + a(t({}), NaN, true, "NaN"); + a(t(-234234234), -1, "Negative"); + a(t(234234234), 1, "Positive"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/sinh/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/sinh/implement.js new file mode 100644 index 00000000..e52089e4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/sinh/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../math/sinh/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/sinh/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/sinh/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/sinh/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/sinh/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/sinh/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/sinh/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/sinh/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/sinh/shim.js new file mode 100644 index 00000000..4f63b59e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/sinh/shim.js @@ -0,0 +1,13 @@ +'use strict'; + +module.exports = function (t, a) { + a(t({}), NaN, "NaN"); + a(t(0), 0, "Zero"); + a(t(Infinity), Infinity, "Infinity"); + a(t(-Infinity), -Infinity, "-Infinity"); + a(t(1), 1.1752011936438014, "1"); + a(t(Number.MAX_VALUE), Infinity); + a(t(-Number.MAX_VALUE), -Infinity); + a(t(Number.MIN_VALUE), 5e-324); + a(t(-Number.MIN_VALUE), -5e-324); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/tanh/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/tanh/implement.js new file mode 100644 index 00000000..a96bf193 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/tanh/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../math/tanh/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/tanh/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/tanh/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/tanh/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/tanh/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/tanh/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/tanh/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/tanh/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/tanh/shim.js new file mode 100644 index 00000000..2c67aaf4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/tanh/shim.js @@ -0,0 +1,11 @@ +'use strict'; + +module.exports = function (t, a) { + a(t({}), NaN, "NaN"); + a(t(0), 0, "Zero"); + a(t(Infinity), 1, "Infinity"); + a(t(-Infinity), -1, "-Infinity"); + a(t(1), 0.7615941559557649, "1"); + a(t(Number.MAX_VALUE), 1); + a(t(-Number.MAX_VALUE), -1); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/trunc/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/trunc/implement.js new file mode 100644 index 00000000..1830e61f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/trunc/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../math/trunc/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/trunc/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/trunc/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/trunc/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/trunc/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/trunc/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/trunc/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/trunc/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/trunc/shim.js new file mode 100644 index 00000000..9e5eed79 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/trunc/shim.js @@ -0,0 +1,16 @@ +'use strict'; + +var is = require('../../../object/is'); + +module.exports = function (t, a) { + a(t({}), NaN, "NaN"); + a(t(0), 0, "Zero"); + a(t(Infinity), Infinity, "Infinity"); + a(t(-Infinity), -Infinity, "-Infinity"); + a(is(t(0.234), 0), true, "0"); + a(is(t(-0.234), -0), true, "-0"); + a(t(13.7), 13, "Positive #1"); + a(t(12.3), 12, "Positive #2"); + a(t(-12.3), -12, "Negative #1"); + a(t(-14.7), -14, "Negative #2"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/#/pad.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/#/pad.js new file mode 100644 index 00000000..e0208235 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/#/pad.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = function (t, a) { + a(t.call(78, 4), '0078'); + a(t.call(65.12323, 4, 3), '0065.123', "Precision"); + a(t.call(65, 4, 3), '0065.000', "Precision integer"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/epsilon/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/epsilon/implement.js new file mode 100644 index 00000000..574da75d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/epsilon/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../number/epsilon/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/epsilon/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/epsilon/index.js new file mode 100644 index 00000000..c892fd47 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/epsilon/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function (t, a) { + a(typeof t, 'number'); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/epsilon/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/epsilon/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/epsilon/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-finite/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-finite/implement.js new file mode 100644 index 00000000..b35345fa --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-finite/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../number/is-finite/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-finite/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-finite/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-finite/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-finite/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-finite/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-finite/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-finite/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-finite/shim.js new file mode 100644 index 00000000..5205d1c2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-finite/shim.js @@ -0,0 +1,8 @@ +'use strict'; + +module.exports = function (t, a) { + a(t(2), true, "Number"); + a(t('23'), false, "Not numeric"); + a(t(NaN), false, "NaN"); + a(t(Infinity), false, "Infinity"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-integer/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-integer/implement.js new file mode 100644 index 00000000..127149ce --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-integer/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../number/is-integer/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-integer/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-integer/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-integer/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-integer/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-integer/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-integer/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-integer/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-integer/shim.js new file mode 100644 index 00000000..3f3985c3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-integer/shim.js @@ -0,0 +1,9 @@ +'use strict'; + +module.exports = function (t, a) { + a(t(2), true, "Number"); + a(t(2.34), false, "Float"); + a(t('23'), false, "Not numeric"); + a(t(NaN), false, "NaN"); + a(t(Infinity), false, "Infinity"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-nan/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-nan/implement.js new file mode 100644 index 00000000..2f01d6d3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-nan/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../number/is-nan/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-nan/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-nan/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-nan/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-nan/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-nan/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-nan/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-nan/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-nan/shim.js new file mode 100644 index 00000000..425723e7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-nan/shim.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = function (t, a) { + a(t(2), false, "Number"); + a(t({}), false, "Not numeric"); + a(t(NaN), true, "NaN"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-natural.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-natural.js new file mode 100644 index 00000000..d56f1204 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-natural.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = function (t, a) { + a(t(2), true, "Number"); + a(t(-2), false, "Negative"); + a(t(2.34), false, "Float"); + a(t('23'), false, "Not numeric"); + a(t(NaN), false, "NaN"); + a(t(Infinity), false, "Infinity"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-number.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-number.js new file mode 100644 index 00000000..27513347 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-number.js @@ -0,0 +1,13 @@ +'use strict'; + +module.exports = function (t, a) { + a(t(0), true, "Zero"); + a(t(NaN), true, "NaN"); + a(t(Infinity), true, "Infinity"); + a(t(12), true, "Number"); + a(t(false), false, "Boolean"); + a(t(new Date()), false, "Date"); + a(t(new Number(2)), true, "Number object"); + a(t('asdfaf'), false, "String"); + a(t(''), false, "Empty String"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-safe-integer/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-safe-integer/implement.js new file mode 100644 index 00000000..33667e2e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-safe-integer/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../number/is-safe-integer/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-safe-integer/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-safe-integer/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-safe-integer/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-safe-integer/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-safe-integer/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-safe-integer/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-safe-integer/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-safe-integer/shim.js new file mode 100644 index 00000000..77e06674 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-safe-integer/shim.js @@ -0,0 +1,11 @@ +'use strict'; + +module.exports = function (t, a) { + a(t(2), true, "Number"); + a(t(2.34), false, "Float"); + a(t(Math.pow(2, 53)), false, "Too large"); + a(t(Math.pow(2, 53) - 1), true, "Maximum"); + a(t('23'), false, "Not numeric"); + a(t(NaN), false, "NaN"); + a(t(Infinity), false, "Infinity"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/max-safe-integer/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/max-safe-integer/implement.js new file mode 100644 index 00000000..bef00ca4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/max-safe-integer/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../number/max-safe-integer/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/max-safe-integer/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/max-safe-integer/index.js new file mode 100644 index 00000000..c892fd47 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/max-safe-integer/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function (t, a) { + a(typeof t, 'number'); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/max-safe-integer/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/max-safe-integer/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/max-safe-integer/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/min-safe-integer/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/min-safe-integer/implement.js new file mode 100644 index 00000000..fa440248 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/min-safe-integer/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../number/min-safe-integer/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/min-safe-integer/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/min-safe-integer/index.js new file mode 100644 index 00000000..c892fd47 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/min-safe-integer/index.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function (t, a) { + a(typeof t, 'number'); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/min-safe-integer/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/min-safe-integer/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/min-safe-integer/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/to-integer.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/to-integer.js new file mode 100644 index 00000000..ff326ba7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/to-integer.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = function (t, a) { + a(t({}), 0, "NaN"); + a(t(20), 20, "Positive integer"); + a(t('-20'), -20, "String negative integer"); + a(t(Infinity), Infinity, "Infinity"); + a(t(15.343), 15, "Float"); + a(t(-15.343), -15, "Negative float"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/to-pos-integer.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/to-pos-integer.js new file mode 100644 index 00000000..2f3b4e67 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/to-pos-integer.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = function (t, a) { + a(t({}), 0, "NaN"); + a(t(20), 20, "Positive integer"); + a(t(-20), 0, "Negative integer"); + a(t(Infinity), Infinity, "Infinity"); + a(t(15.343), 15, "Float"); + a(t(-15.343), 0, "Negative float"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/to-uint32.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/to-uint32.js new file mode 100644 index 00000000..00d05bdf --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/to-uint32.js @@ -0,0 +1,8 @@ +'use strict'; + +module.exports = function (t, a) { + a(t({}), 0, "Not numeric"); + a(t(-4), 4294967292, "Negative"); + a(t(133432), 133432, "Positive"); + a(t(8589934592), 0, "Greater than maximum"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/_iterate.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/_iterate.js new file mode 100644 index 00000000..179afed8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/_iterate.js @@ -0,0 +1,30 @@ +'use strict'; + +module.exports = function (t, a) { + var o = { raz: 1, dwa: 2, trzy: 3 } + , o2 = {}, o3 = {}, arr, i = -1; + + t = t('forEach'); + t(o, function (value, name, self, index) { + o2[name] = value; + a(index, ++i, "Index"); + a(self, o, "Self"); + a(this, o3, "Scope"); + }, o3); + a.deep(o2, o); + + arr = []; + o2 = {}; + i = -1; + t(o, function (value, name, self, index) { + arr.push(value); + o2[name] = value; + a(index, ++i, "Index"); + a(self, o, "Self"); + a(this, o3, "Scope"); + }, o3, function (a, b) { + return o[b] - o[a]; + }); + a.deep(o2, o, "Sort by Values: Content"); + a.deep(arr, [3, 2, 1], "Sort by Values: Order"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/assign/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/assign/implement.js new file mode 100644 index 00000000..40065594 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/assign/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../object/assign/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/assign/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/assign/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/assign/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/assign/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/assign/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/assign/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/assign/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/assign/shim.js new file mode 100644 index 00000000..9afe5f65 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/assign/shim.js @@ -0,0 +1,11 @@ +'use strict'; + +module.exports = function (t, a) { + var o1 = { a: 1, b: 2 } + , o2 = { b: 3, c: 4 }; + + a(t(o1, o2), o1, "Returns self"); + a.deep(o1, { a: 1, b: 3, c: 4 }, "Single: content"); + + a.deep(t({}, o1, o2), { a: 1, b: 3, c: 4 }, "Multi argument"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/clear.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/clear.js new file mode 100644 index 00000000..bfc08cc2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/clear.js @@ -0,0 +1,13 @@ +'use strict'; + +var isEmpty = require('../../object/is-empty'); + +module.exports = function (t, a) { + var x = {}; + a(t(x), x, "Empty: Returns same object"); + a(isEmpty(x), true, "Empty: Not changed"); + x.foo = 'raz'; + x.bar = 'dwa'; + a(t(x), x, "Same object"); + a(isEmpty(x), true, "Emptied"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/compact.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/compact.js new file mode 100644 index 00000000..9c9064c7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/compact.js @@ -0,0 +1,14 @@ +'use strict'; + +module.exports = function (t, a) { + var x = {}, y = {}, z; + z = t(x); + a.not(z, x, "Returns different object"); + a.deep(z, {}, "Empty on empty"); + + x = { foo: 'bar', a: 0, b: false, c: '', d: '0', e: null, bar: y, + elo: undefined }; + z = t(x); + a.deep(z, { foo: 'bar', a: 0, b: false, c: '', d: '0', bar: y }, + "Cleared null values"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/compare.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/compare.js new file mode 100644 index 00000000..cb942410 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/compare.js @@ -0,0 +1,13 @@ +'use strict'; + +module.exports = function (t, a) { + var d = new Date(); + + a.ok(t(12, 3) > 0, "Numbers"); + a.ok(t(2, 13) < 0, "Numbers #2"); + a.ok(t("aaa", "aa") > 0, "Strings"); + a.ok(t("aa", "ab") < 0, "Strings #2"); + a(t("aa", "aa"), 0, "Strings same"); + a(t(d, new Date(d.getTime())), 0, "Same date"); + a.ok(t(d, new Date(d.getTime() + 1)) < 0, "Different date"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/copy-deep.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/copy-deep.js new file mode 100644 index 00000000..79e02be4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/copy-deep.js @@ -0,0 +1,28 @@ +'use strict'; + +var stringify = JSON.stringify; + +module.exports = function (t, a) { + var o = { 1: 'raz', 2: 'dwa', 3: 'trzy' } + , no = t(o); + + a.not(no, o, "Return different object"); + a(stringify(no), stringify(o), "Match properties and values"); + + o = { foo: 'bar', raz: { dwa: 'dwa', + trzy: { cztery: 'pięć', 'sześć': 'siedem' }, osiem: {}, + 'dziewięć': function () { } }, + 'dziesięć': 10, "jedenaście": ['raz', ['dwa', 'trzy', { elo: "true" }]] }; + o.raz.rec = o; + + no = t(o); + a.not(o.raz, no.raz, "Deep"); + a.not(o.raz.trzy, no.raz.trzy, "Deep #2"); + a(stringify(o.raz.trzy), stringify(no.raz.trzy), "Deep content"); + a(no.raz.rec, no, "Recursive"); + a.not(o.raz.osiem, no.raz.osiem, "Empty object"); + a(o.raz['dziewięć'], no.raz['dziewięć'], "Function"); + a.not(o['jedenaście'], no['jedenaście']); + a.not(o['jedenaście'][1], no['jedenaście'][1]); + a.not(o['jedenaście'][1][2], no['jedenaście'][1][2]); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/copy.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/copy.js new file mode 100644 index 00000000..2f222ef8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/copy.js @@ -0,0 +1,19 @@ +'use strict'; + +var stringify = JSON.stringify; + +module.exports = function (t, a) { + var o = { 1: 'raz', 2: 'dwa', 3: 'trzy' } + , no = t(o); + + a.not(no, o, "Return different object"); + a(stringify(no), stringify(o), "Match properties and values"); + + o = { foo: 'bar', raz: { dwa: 'dwa', + trzy: { cztery: 'pięć', 'sześć': 'siedem' }, osiem: {}, + 'dziewięć': function () { } }, 'dziesięć': 10 }; + o.raz.rec = o; + + no = t(o); + a(o.raz, no.raz, "Shallow"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/count.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/count.js new file mode 100644 index 00000000..494f4f16 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/count.js @@ -0,0 +1,11 @@ +'use strict'; + +module.exports = function (t, a) { + a(t({}), 0, "Empty"); + a(t({ raz: 1, dwa: null, trzy: undefined, cztery: 0 }), 4, + "Some properties"); + a(t(Object.defineProperties({}, { + raz: { value: 'raz' }, + dwa: { value: 'dwa', enumerable: true } + })), 1, "Some properties hidden"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/create.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/create.js new file mode 100644 index 00000000..8b7be214 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/create.js @@ -0,0 +1,22 @@ +'use strict'; + +var setPrototypeOf = require('../../object/set-prototype-of') + + , getPrototypeOf = Object.getPrototypeOf; + +module.exports = function (t, a) { + var x = {}, obj; + + a(getPrototypeOf(t(x)), x, "Normal object"); + a(getPrototypeOf(t(null)), + (setPrototypeOf && setPrototypeOf.nullPolyfill) || null, "Null"); + + a.h1("Properties"); + a.h2("Normal object"); + a(getPrototypeOf(obj = t(x, { foo: { value: 'bar' } })), x, "Prototype"); + a(obj.foo, 'bar', "Property"); + a.h2("Null"); + a(getPrototypeOf(obj = t(null, { foo: { value: 'bar2' } })), + (setPrototypeOf && setPrototypeOf.nullPolyfill) || null, "Prototype"); + a(obj.foo, 'bar2', "Property"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/ensure-natural-number-value.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/ensure-natural-number-value.js new file mode 100644 index 00000000..dde23986 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/ensure-natural-number-value.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports = function (t, a) { + a.throws(function () { t(undefined); }, TypeError, "Undefined"); + a.throws(function () { t(null); }, TypeError, "Null"); + a(t(2), 2, "Number"); + a.throws(function () { t(-2); }, TypeError, "Negative"); + a.throws(function () { t(2.34); }, TypeError, "Float"); + a(t('23'), 23, "Numeric string"); + a.throws(function () { t(NaN); }, TypeError, "NaN"); + a.throws(function () { t(Infinity); }, TypeError, "Infinity"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/ensure-natural-number.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/ensure-natural-number.js new file mode 100644 index 00000000..5ebed1e5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/ensure-natural-number.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports = function (t, a) { + a.throws(function () { t(undefined); }, TypeError, "Undefined"); + a(t(null), 0, "Null"); + a(t(2), 2, "Number"); + a.throws(function () { t(-2); }, TypeError, "Negative"); + a.throws(function () { t(2.34); }, TypeError, "Float"); + a(t('23'), 23, "Numeric string"); + a.throws(function () { t(NaN); }, TypeError, "NaN"); + a.throws(function () { t(Infinity); }, TypeError, "Infinity"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/eq.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/eq.js new file mode 100644 index 00000000..02b3f002 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/eq.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports = function (t, a) { + var o = {}; + a(t(o, {}), false, "Different objects"); + a(t(o, o), true, "Same objects"); + a(t('1', '1'), true, "Same primitive"); + a(t('1', 1), false, "Different primitive types"); + a(t(NaN, NaN), true, "NaN"); + a(t(0, 0), true, "0,0"); + a(t(0, -0), true, "0,-0"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/every.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/every.js new file mode 100644 index 00000000..07d5bbbd --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/every.js @@ -0,0 +1,21 @@ +'use strict'; + +var o = { 1: 1, 2: 2, 3: 3 }; + +module.exports = function (t, a) { + var o2 = {}; + t(o, function (value, name) { + o2[name] = value; + return true; + }); + a(JSON.stringify(o2), JSON.stringify(o), "Iterates"); + + a(t(o, function () { + return true; + }), true, "Succeeds"); + + a(t(o, function () { + return false; + }), false, "Fails"); + +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/filter.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/filter.js new file mode 100644 index 00000000..7307da86 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/filter.js @@ -0,0 +1,6 @@ +'use strict'; + +module.exports = function (t, a) { + a.deep(t({ 1: 1, 2: 2, 3: 3, 4: 4 }, + function (value) { return Boolean(value % 2); }), { 1: 1, 3: 3 }); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/find-key.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/find-key.js new file mode 100644 index 00000000..cca834d9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/find-key.js @@ -0,0 +1,23 @@ +'use strict'; + +var o = { 1: 1, 2: 2, 3: 3 }; + +module.exports = function (t, a) { + var o2 = {}, i = 0; + t(o, function (value, name) { + o2[name] = value; + return false; + }); + a(JSON.stringify(o2), JSON.stringify(o), "Iterates"); + + a(t(o, function () { + ++i; + return true; + }), '1', "Finds"); + a(i, 1, "Stops iteration after condition is met"); + + a(t(o, function () { + return false; + }), undefined, "Fails"); + +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/find.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/find.js new file mode 100644 index 00000000..b6ad60a5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/find.js @@ -0,0 +1,23 @@ +'use strict'; + +var o = { 1: 1, 2: 2, 3: 3 }; + +module.exports = function (t, a) { + var o2 = {}, i = 0; + t(o, function (value, name) { + o2[name] = value; + return false; + }); + a(JSON.stringify(o2), JSON.stringify(o), "Iterates"); + + a(t(o, function () { + ++i; + return true; + }), 1, "Finds"); + a(i, 1, "Stops iteration after condition is met"); + + a(t(o, function () { + return false; + }), undefined, "Fails"); + +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/first-key.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/first-key.js new file mode 100644 index 00000000..8169cd23 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/first-key.js @@ -0,0 +1,13 @@ +'use strict'; + +module.exports = function (t, a) { + var x = {}, y = Object.create(null); + a(t(x), null, "Normal: Empty"); + a(t(y), null, "Null extension: Empty"); + x.foo = 'raz'; + x.bar = 343; + a(['foo', 'bar'].indexOf(t(x)) !== -1, true, "Normal"); + y.elo = 'foo'; + y.mar = 'wew'; + a(['elo', 'mar'].indexOf(t(y)) !== -1, true, "Null extension"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/flatten.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/flatten.js new file mode 100644 index 00000000..ca342eab --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/flatten.js @@ -0,0 +1,6 @@ +'use strict'; + +module.exports = function (t, a) { + a.deep(t({ a: { aa: 1, ab: 2 }, b: { ba: 3, bb: 4 } }), + { aa: 1, ab: 2, ba: 3, bb: 4 }); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/for-each.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/for-each.js new file mode 100644 index 00000000..8690d1e8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/for-each.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = function (t, a) { + var o = { raz: 1, dwa: 2, trzy: 3 } + , o2 = {}; + a(t(o, function (value, name) { + o2[name] = value; + }), undefined, "Return"); + a.deep(o2, o); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/get-property-names.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/get-property-names.js new file mode 100644 index 00000000..b91c3dd5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/get-property-names.js @@ -0,0 +1,18 @@ +'use strict'; + +module.exports = function (t, a) { + var o = { first: 1, second: 4 }, r1, r2; + o = Object.create(o, { + third: { value: null } + }); + o.first = 2; + o = Object.create(o); + o.fourth = 3; + + r1 = t(o); + r1.sort(); + r2 = ['first', 'second', 'third', 'fourth'] + .concat(Object.getOwnPropertyNames(Object.prototype)); + r2.sort(); + a.deep(r1, r2); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is-array-like.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is-array-like.js new file mode 100644 index 00000000..6295973c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is-array-like.js @@ -0,0 +1,14 @@ +'use strict'; + +module.exports = function (t, a) { + a(t([]), true, "Array"); + a(t(""), true, "String"); + a(t((function () { return arguments; }())), true, "Arguments"); + a(t({ length: 0 }), true, "List object"); + a(t(function () {}), false, "Function"); + a(t({}), false, "Plain object"); + a(t(/raz/), false, "Regexp"); + a(t(), false, "No argument"); + a(t(null), false, "Null"); + a(t(undefined), false, "Undefined"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is-callable.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is-callable.js new file mode 100644 index 00000000..625e221d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is-callable.js @@ -0,0 +1,8 @@ +'use strict'; + +module.exports = function (t, a) { + a(t(function () {}), true, "Function"); + a(t({}), false, "Object"); + a(t(), false, "Undefined"); + a(t(null), false, "Null"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is-copy-deep.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is-copy-deep.js new file mode 100644 index 00000000..4f14cbbe --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is-copy-deep.js @@ -0,0 +1,46 @@ +'use strict'; + +module.exports = function (t, a) { + var x, y; + + a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2, 3: 3 }), true, "Same"); + a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2, 3: 4 }), false, + "Different property value"); + a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2 }), false, + "Property only in source"); + a(t({ 1: 1, 2: 2 }, { 1: 1, 2: 2, 3: 4 }), false, + "Property only in target"); + + a(t("raz", "dwa"), false, "String: diff"); + a(t("raz", "raz"), true, "String: same"); + a(t("32", 32), false, "String & Number"); + + a(t([1, 'raz', true], [1, 'raz', true]), true, "Array: same"); + a(t([1, 'raz', undefined], [1, 'raz']), false, "Array: diff"); + a(t(['foo'], ['one']), false, "Array: One value comparision"); + + x = { foo: { bar: { mar: {} } } }; + y = { foo: { bar: { mar: {} } } }; + a(t(x, y), true, "Deep"); + + a(t({ foo: { bar: { mar: 'foo' } } }, { foo: { bar: { mar: {} } } }), + false, "Deep: false"); + + x = { foo: { bar: { mar: {} } } }; + x.rec = { foo: x }; + + y = { foo: { bar: { mar: {} } } }; + y.rec = { foo: x }; + + a(t(x, y), true, "Object: Infinite Recursion: Same #1"); + + x.rec.foo = y; + a(t(x, y), true, "Object: Infinite Recursion: Same #2"); + + x.rec.foo = x; + y.rec.foo = y; + a(t(x, y), true, "Object: Infinite Recursion: Same #3"); + + y.foo.bar.mar = 'raz'; + a(t(x, y), false, "Object: Infinite Recursion: Diff"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is-copy.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is-copy.js new file mode 100644 index 00000000..394e2ed9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is-copy.js @@ -0,0 +1,18 @@ +'use strict'; + +module.exports = function (t, a) { + a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2, 3: 3 }), true, "Same"); + a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2, 3: 4 }), false, + "Different property value"); + a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2 }), false, + "Property only in source"); + a(t({ 1: 1, 2: 2 }, { 1: 1, 2: 2, 3: 4 }), false, + "Property only in target"); + + a(t("raz", "dwa"), false, "String: diff"); + a(t("raz", "raz"), true, "String: same"); + a(t("32", 32), false, "String & Number"); + + a(t([1, 'raz', true], [1, 'raz', true]), true, "Array: same"); + a(t([1, 'raz', undefined], [1, 'raz']), false, "Array: diff"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is-empty.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is-empty.js new file mode 100644 index 00000000..b560c2c3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is-empty.js @@ -0,0 +1,6 @@ +'use strict'; + +module.exports = function (t, a) { + a(t({}), true, "Empty"); + a(t({ 1: 1 }), false, "Not empty"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is-number-value.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is-number-value.js new file mode 100644 index 00000000..21b6b620 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is-number-value.js @@ -0,0 +1,15 @@ +'use strict'; + +module.exports = function (t, a) { + a(t(undefined), false, "Undefined"); + a(t(null), false, "Null"); + a(t(0), true, "Zero"); + a(t(NaN), false, "NaN"); + a(t(Infinity), true, "Infinity"); + a(t(12), true, "Number"); + a(t(false), true, "Boolean"); + a(t(new Date()), true, "Date"); + a(t(new Number(2)), true, "Number object"); + a(t('asdfaf'), false, "String"); + a(t(''), true, "Empty String"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is-object.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is-object.js new file mode 100644 index 00000000..72c8aa6d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is-object.js @@ -0,0 +1,13 @@ +'use strict'; + +module.exports = function (t, a) { + a(t('arar'), false, "String"); + a(t(12), false, "Number"); + a(t(true), false, "Boolean"); + a(t(null), false, "Null"); + a(t(new Date()), true, "Date"); + a(t(new String('raz')), true, "String object"); + a(t({}), true, "Plain object"); + a(t(/a/), true, "Regular expression"); + a(t(function () {}), true, "Function"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is-plain-object.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is-plain-object.js new file mode 100644 index 00000000..e988829d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is-plain-object.js @@ -0,0 +1,18 @@ +'use strict'; + +module.exports = function (t, a) { + a(t({}), true, "Empty {} is plain object"); + a(t({ a: true }), true, "{} with property is plain object"); + a(t({ prototype: 1, constructor: 2, __proto__: 3 }), true, + "{} with any property keys is plain object"); + a(t(null), false, "Null is not plain object"); + a(t('string'), false, "Primitive is not plain object"); + a(t(function () {}), false, "Function is not plain object"); + a(t(Object.create({})), false, + "Object whose prototype is not Object.prototype is not plain object"); + a(t(Object.create(Object.prototype)), true, + "Object whose prototype is Object.prototype is plain object"); + a(t(Object.create(null)), true, + "Object whose prototype is null is plain object"); + a(t(Object.prototype), false, "Object.prototype"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is.js new file mode 100644 index 00000000..4f8948cb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports = function (t, a) { + var o = {}; + a(t(o, {}), false, "Different objects"); + a(t(o, o), true, "Same objects"); + a(t('1', '1'), true, "Same primitive"); + a(t('1', 1), false, "Different primitive types"); + a(t(NaN, NaN), true, "NaN"); + a(t(0, 0), true, "0,0"); + a(t(0, -0), false, "0,-0"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/key-of.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/key-of.js new file mode 100644 index 00000000..a9225a04 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/key-of.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports = function (t, a) { + var x = {}, y = {} + , o = { foo: 'bar', raz: x, trzy: 'cztery', five: '6' }; + + a(t(o, 'bar'), 'foo', "First property"); + a(t(o, 6), null, "Primitive that's not there"); + a(t(o, x), 'raz', "Object"); + a(t(o, y), null, "Object that's not there"); + a(t(o, '6'), 'five', "Last property"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/keys/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/keys/implement.js new file mode 100644 index 00000000..179e1e56 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/keys/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../object/keys/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/keys/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/keys/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/keys/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/keys/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/keys/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/keys/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/keys/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/keys/shim.js new file mode 100644 index 00000000..ed29eebc --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/keys/shim.js @@ -0,0 +1,8 @@ +'use strict'; + +module.exports = function (t, a) { + a.deep(t({ foo: 'bar' }), ['foo'], "Object"); + a.deep(t('raz'), ['0', '1', '2'], "Primitive"); + a.throws(function () { t(); }, TypeError, "Undefined"); + a.throws(function () { t(null); }, TypeError, "Undefined"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/map-keys.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/map-keys.js new file mode 100644 index 00000000..be84825b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/map-keys.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = function (t, a) { + a.deep(t({ 1: 1, 2: 2, 3: 3 }, function (key, value) { + return 'x' + (key + value); + }), { x11: 1, x22: 2, x33: 3 }); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/map.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/map.js new file mode 100644 index 00000000..f9cc09c0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/map.js @@ -0,0 +1,9 @@ +'use strict'; + +module.exports = function (t, a) { + var obj = { 1: 1, 2: 2, 3: 3 }; + a.deep(t(obj, function (value, key, context) { + a(context, obj, "Context argument"); + return (value + 1) + key; + }), { 1: '21', 2: '32', 3: '43' }); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/mixin-prototypes.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/mixin-prototypes.js new file mode 100644 index 00000000..d1c727a9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/mixin-prototypes.js @@ -0,0 +1,67 @@ +'use strict'; + +module.exports = function (t, a) { + var o, o1, o2, x, y = {}, z = {}; + o = { inherited: true, visible: 23 }; + o1 = Object.create(o); + o1.visible = z; + o1.nonremovable = 'raz'; + Object.defineProperty(o1, 'hidden', { value: 'hidden' }); + + o2 = Object.defineProperties({}, { nonremovable: { value: y } }); + o2.other = 'other'; + + try { t(o2, o1); } catch (ignore) {} + + a(o2.visible, z, "Enumerable"); + a(o1.hidden, 'hidden', "Not Enumerable"); + a(o2.propertyIsEnumerable('visible'), true, "Enumerable is enumerable"); + a(o2.propertyIsEnumerable('hidden'), false, + "Not enumerable is not enumerable"); + + a(o2.inherited, true, "Extend deep"); + + a(o2.nonremovable, y, "Do not overwrite non configurable"); + a(o2.other, 'other', "Own kept"); + + x = {}; + t(x, o2); + try { t(x, o1); } catch (ignore) {} + + a(x.visible, z, "Enumerable"); + a(x.hidden, 'hidden', "Not Enumerable"); + a(x.propertyIsEnumerable('visible'), true, "Enumerable is enumerable"); + a(x.propertyIsEnumerable('hidden'), false, + "Not enumerable is not enumerable"); + + a(x.inherited, true, "Extend deep"); + + a(x.nonremovable, y, "Ignored non configurable"); + a(x.other, 'other', "Other"); + + x.visible = 3; + a(x.visible, 3, "Writable is writable"); + + x = {}; + t(x, o1); + a.throws(function () { + x.hidden = 3; + }, "Not writable is not writable"); + + x = {}; + t(x, o1); + delete x.visible; + a.ok(!x.hasOwnProperty('visible'), "Configurable is configurable"); + + x = {}; + t(x, o1); + a.throws(function () { + delete x.hidden; + }, "Not configurable is not configurable"); + + x = Object.defineProperty({}, 'foo', + { configurable: false, writable: true, enumerable: false, value: 'bar' }); + + try { t(x, { foo: 'lorem' }); } catch (ignore) {} + a(x.foo, 'bar', "Writable, not enumerable"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/mixin.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/mixin.js new file mode 100644 index 00000000..866005b0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/mixin.js @@ -0,0 +1,69 @@ +'use strict'; + +module.exports = function (t, a) { + var o, o1, o2, x, y = {}, z = {}; + o = { inherited: true }; + o1 = Object.create(o); + o1.visible = z; + o1.nonremovable = 'raz'; + Object.defineProperty(o1, 'hidden', { value: 'hidden' }); + + o2 = Object.defineProperties({}, { nonremovable: { value: y } }); + o2.other = 'other'; + + try { t(o2, o1); } catch (ignore) {} + + a(o2.visible, z, "Enumerable"); + a(o1.hidden, 'hidden', "Not Enumerable"); + a(o2.propertyIsEnumerable('visible'), true, "Enumerable is enumerable"); + a(o2.propertyIsEnumerable('hidden'), false, + "Not enumerable is not enumerable"); + + a(o2.hasOwnProperty('inherited'), false, "Extend only own"); + a(o2.inherited, undefined, "Extend ony own: value"); + + a(o2.nonremovable, y, "Do not overwrite non configurable"); + a(o2.other, 'other', "Own kept"); + + x = {}; + t(x, o2); + try { t(x, o1); } catch (ignore) {} + + a(x.visible, z, "Enumerable"); + a(x.hidden, 'hidden', "Not Enumerable"); + a(x.propertyIsEnumerable('visible'), true, "Enumerable is enumerable"); + a(x.propertyIsEnumerable('hidden'), false, + "Not enumerable is not enumerable"); + + a(x.hasOwnProperty('inherited'), false, "Extend only own"); + a(x.inherited, undefined, "Extend ony own: value"); + + a(x.nonremovable, y, "Ignored non configurable"); + a(x.other, 'other', "Other"); + + x.visible = 3; + a(x.visible, 3, "Writable is writable"); + + x = {}; + t(x, o1); + a.throws(function () { + x.hidden = 3; + }, "Not writable is not writable"); + + x = {}; + t(x, o1); + delete x.visible; + a.ok(!x.hasOwnProperty('visible'), "Configurable is configurable"); + + x = {}; + t(x, o1); + a.throws(function () { + delete x.hidden; + }, "Not configurable is not configurable"); + + x = Object.defineProperty({}, 'foo', + { configurable: false, writable: true, enumerable: false, value: 'bar' }); + + try { t(x, { foo: 'lorem' }); } catch (ignore) {} + a(x.foo, 'bar', "Writable, not enumerable"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/normalize-options.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/normalize-options.js new file mode 100644 index 00000000..0d2d4da0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/normalize-options.js @@ -0,0 +1,32 @@ +'use strict'; + +var create = Object.create, defineProperty = Object.defineProperty; + +module.exports = function (t, a) { + var x = { foo: 'raz', bar: 'dwa' }, y; + y = t(x); + a.not(y, x, "Returns copy"); + a.deep(y, x, "Plain"); + + x = { raz: 'one', dwa: 'two' }; + defineProperty(x, 'get', { + configurable: true, + enumerable: true, + get: function () { return this.dwa; } + }); + x = create(x); + x.trzy = 'three'; + x.cztery = 'four'; + x = create(x); + x.dwa = 'two!'; + x.trzy = 'three!'; + x.piec = 'five'; + x.szesc = 'six'; + + a.deep(t(x), { raz: 'one', dwa: 'two!', trzy: 'three!', cztery: 'four', + piec: 'five', szesc: 'six', get: 'two!' }, "Deep object"); + + a.deep(t({ marko: 'raz', raz: 'foo' }, x, { szesc: 'elo', siedem: 'bibg' }), + { marko: 'raz', raz: 'one', dwa: 'two!', trzy: 'three!', cztery: 'four', + piec: 'five', szesc: 'elo', siedem: 'bibg', get: 'two!' }, "Multiple options"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/primitive-set.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/primitive-set.js new file mode 100644 index 00000000..839857ea --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/primitive-set.js @@ -0,0 +1,15 @@ +'use strict'; + +var getPropertyNames = require('../../object/get-property-names') + , isPlainObject = require('../../object/is-plain-object'); + +module.exports = function (t, a) { + var x = t(); + a(isPlainObject(x), true, "Plain object"); + a.deep(getPropertyNames(x), [], "No properties"); + x.foo = 'bar'; + a.deep(getPropertyNames(x), ['foo'], "Extensible"); + + a.deep(t('raz', 'dwa', 3), { raz: true, dwa: true, 3: true }, + "Arguments handling"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/safe-traverse.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/safe-traverse.js new file mode 100644 index 00000000..d30cdefe --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/safe-traverse.js @@ -0,0 +1,15 @@ +'use strict'; + +module.exports = function (t, a) { + var obj = { foo: { bar: { lorem: 12 } } }; + a(t(obj), obj, "No props"); + a(t(obj, 'foo'), obj.foo, "One"); + a(t(obj, 'raz'), undefined, "One: Fail"); + a(t(obj, 'foo', 'bar'), obj.foo.bar, "Two"); + a(t(obj, 'dsd', 'raz'), undefined, "Two: Fail #1"); + a(t(obj, 'foo', 'raz'), undefined, "Two: Fail #2"); + a(t(obj, 'foo', 'bar', 'lorem'), obj.foo.bar.lorem, "Three"); + a(t(obj, 'dsd', 'raz', 'fef'), undefined, "Three: Fail #1"); + a(t(obj, 'foo', 'raz', 'asdf'), undefined, "Three: Fail #2"); + a(t(obj, 'foo', 'bar', 'asd'), undefined, "Three: Fail #3"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/serialize.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/serialize.js new file mode 100644 index 00000000..43eed6a8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/serialize.js @@ -0,0 +1,25 @@ +'use strict'; + +module.exports = function (t, a) { + var fn = function (raz, dwa) { return raz + dwa; }; + a(t(), 'undefined', "Undefined"); + a(t(null), 'null', "Null"); + a(t(null), 'null', "Null"); + a(t('raz'), '"raz"', "String"); + a(t('raz"ddwa\ntrzy'), '"raz\\"ddwa\\ntrzy"', "String with escape"); + a(t(false), 'false', "Booelean"); + a(t(fn), String(fn), "Function"); + + a(t(/raz-dwa/g), '/raz-dwa/g', "RegExp"); + a(t(new Date(1234567)), 'new Date(1234567)', "Date"); + a(t([]), '[]', "Empty array"); + a(t([undefined, false, null, 'raz"ddwa\ntrzy', fn, /raz/g, new Date(1234567), ['foo']]), + '[undefined,false,null,"raz\\"ddwa\\ntrzy",' + String(fn) + + ',/raz/g,new Date(1234567),["foo"]]', "Rich Array"); + a(t({}), '{}', "Empty object"); + a(t({ raz: undefined, dwa: false, trzy: null, cztery: 'raz"ddwa\ntrzy', piec: fn, szesc: /raz/g, + siedem: new Date(1234567), osiem: ['foo', 32], dziewiec: { foo: 'bar', dwa: 343 } }), + '{"raz":undefined,"dwa":false,"trzy":null,"cztery":"raz\\"ddwa\\ntrzy","piec":' + String(fn) + + ',"szesc":/raz/g,"siedem":new Date(1234567),"osiem":["foo",32],' + + '"dziewiec":{"foo":"bar","dwa":343}}', "Rich object"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/set-prototype-of/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/set-prototype-of/implement.js new file mode 100644 index 00000000..30b2ac4b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/set-prototype-of/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +var create = require('../../../object/create') + , isImplemented = require('../../../object/set-prototype-of/is-implemented'); + +module.exports = function (a) { a(isImplemented(create), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/set-prototype-of/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/set-prototype-of/index.js new file mode 100644 index 00000000..aec2605c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/set-prototype-of/index.js @@ -0,0 +1,23 @@ +'use strict'; + +var create = require('../../../object/create') + + , getPrototypeOf = Object.getPrototypeOf; + +module.exports = function (t, a) { + var x = {}, y = {}; + + if (t === null) return; + a(t(x, y), x, "Return self object"); + a(getPrototypeOf(x), y, "Object"); + a.throws(function () { t(x); }, TypeError, "Undefined"); + a.throws(function () { t('foo'); }, TypeError, "Primitive"); + a(getPrototypeOf(t(x, null)), t.nullPolyfill || null, "Null"); + x = create(null); + a.h1("Change null prototype"); + a(t(x, y), x, "Result"); + a(getPrototypeOf(x), y, "Prototype"); + a.h1("Set null prototype"); + a(t(y, null), y, "Result"); + a(getPrototypeOf(y), t.nullPolyfill || null, "Prototype"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/set-prototype-of/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/set-prototype-of/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/set-prototype-of/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/set-prototype-of/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/set-prototype-of/shim.js new file mode 100644 index 00000000..aec2605c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/set-prototype-of/shim.js @@ -0,0 +1,23 @@ +'use strict'; + +var create = require('../../../object/create') + + , getPrototypeOf = Object.getPrototypeOf; + +module.exports = function (t, a) { + var x = {}, y = {}; + + if (t === null) return; + a(t(x, y), x, "Return self object"); + a(getPrototypeOf(x), y, "Object"); + a.throws(function () { t(x); }, TypeError, "Undefined"); + a.throws(function () { t('foo'); }, TypeError, "Primitive"); + a(getPrototypeOf(t(x, null)), t.nullPolyfill || null, "Null"); + x = create(null); + a.h1("Change null prototype"); + a(t(x, y), x, "Result"); + a(getPrototypeOf(x), y, "Prototype"); + a.h1("Set null prototype"); + a(t(y, null), y, "Result"); + a(getPrototypeOf(y), t.nullPolyfill || null, "Prototype"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/some.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/some.js new file mode 100644 index 00000000..490431e7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/some.js @@ -0,0 +1,23 @@ +'use strict'; + +var o = { 1: 1, 2: 2, 3: 3 }; + +module.exports = function (t, a) { + var o2 = {}, i = 0; + t(o, function (value, name) { + o2[name] = value; + return false; + }); + a(JSON.stringify(o2), JSON.stringify(o), "Iterates"); + + a(t(o, function () { + ++i; + return true; + }), true, "Succeeds"); + a(i, 1, "Stops iteration after condition is met"); + + a(t(o, function () { + return false; + }), false, "Fails"); + +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/to-array.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/to-array.js new file mode 100644 index 00000000..1f4beef7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/to-array.js @@ -0,0 +1,15 @@ +'use strict'; + +module.exports = function (t, a) { + var o = { 1: 1, 2: 2, 3: 3 }, o1 = {} + , o2 = t(o, function (value, name, self) { + a(self, o, "Self"); + a(this, o1, "Scope"); + return value + Number(name); + }, o1); + a.deep(o2, [2, 4, 6]); + + t(o).sort().forEach(function (item) { + a.deep(item, [item[0], o[item[0]]], "Default"); + }); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/unserialize.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/unserialize.js new file mode 100644 index 00000000..405eef11 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/unserialize.js @@ -0,0 +1,24 @@ +'use strict'; + +module.exports = function (t, a) { + var fn = function (raz, dwa) { return raz + dwa; }; + a(t('undefined'), undefined, "Undefined"); + a(t('null'), null, "Null"); + a(t('"raz"'), 'raz', "String"); + a(t('"raz\\"ddwa\\ntrzy"'), 'raz"ddwa\ntrzy', "String with escape"); + a(t('false'), false, "Booelean"); + a(String(t(String(fn))), String(fn), "Function"); + + a.deep(t('/raz-dwa/g'), /raz-dwa/g, "RegExp"); + a.deep(t('new Date(1234567)'), new Date(1234567), "Date"); + a.deep(t('[]'), [], "Empty array"); + a.deep(t('[undefined,false,null,"raz\\"ddwa\\ntrzy",/raz/g,new Date(1234567),["foo"]]'), + [undefined, false, null, 'raz"ddwa\ntrzy', /raz/g, new Date(1234567), ['foo']], "Rich Array"); + a.deep(t('{}'), {}, "Empty object"); + a.deep(t('{"raz":undefined,"dwa":false,"trzy":null,"cztery":"raz\\"ddwa\\ntrzy",' + + '"szesc":/raz/g,"siedem":new Date(1234567),"osiem":["foo",32],' + + '"dziewiec":{"foo":"bar","dwa":343}}'), + { raz: undefined, dwa: false, trzy: null, cztery: 'raz"ddwa\ntrzy', szesc: /raz/g, + siedem: new Date(1234567), osiem: ['foo', 32], dziewiec: { foo: 'bar', dwa: 343 } }, + "Rich object"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/valid-callable.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/valid-callable.js new file mode 100644 index 00000000..b40540b6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/valid-callable.js @@ -0,0 +1,9 @@ +'use strict'; + +module.exports = function (t, a) { + var f = function () {}; + a(t(f), f, "Function"); + a.throws(function () { + t({}); + }, "Not Function"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/valid-object.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/valid-object.js new file mode 100644 index 00000000..eaa8e7bc --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/valid-object.js @@ -0,0 +1,15 @@ +'use strict'; + +module.exports = function (t, a) { + var x; + a.throws(function () { t(0); }, TypeError, "0"); + a.throws(function () { t(false); }, TypeError, "false"); + a.throws(function () { t(''); }, TypeError, "''"); + a(t(x = {}), x, "Object"); + a(t(x = function () {}), x, "Function"); + a(t(x = new String('raz')), x, "String object"); //jslint: ignore + a(t(x = new Date()), x, "Date"); + + a.throws(function () { t(); }, TypeError, "Undefined"); + a.throws(function () { t(null); }, TypeError, "null"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/valid-value.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/valid-value.js new file mode 100644 index 00000000..f1eeafa9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/valid-value.js @@ -0,0 +1,19 @@ +'use strict'; + +var numIsNaN = require('../../number/is-nan'); + +module.exports = function (t, a) { + var x; + a(t(0), 0, "0"); + a(t(false), false, "false"); + a(t(''), '', "''"); + a(numIsNaN(t(NaN)), true, "NaN"); + a(t(x = {}), x, "{}"); + + a.throws(function () { + t(); + }, "Undefined"); + a.throws(function () { + t(null); + }, "null"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/validate-array-like-object.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/validate-array-like-object.js new file mode 100644 index 00000000..2f3e31b4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/validate-array-like-object.js @@ -0,0 +1,15 @@ +'use strict'; + +module.exports = function (t, a) { + var x; + a.throws(function () { t(0); }, TypeError, "0"); + a.throws(function () { t(false); }, TypeError, "false"); + a.throws(function () { t(''); }, TypeError, "String"); + a.throws(function () { t({}); }, TypeError, "Plain Object"); + a.throws(function () { t(function () {}); }, TypeError, "Function"); + a(t(x = new String('raz')), x, "String object"); //jslint: ignore + + a(t(x = { length: 1 }), x, "Array like"); + a.throws(function () { t(); }, TypeError, "Undefined"); + a.throws(function () { t(null); }, TypeError, "null"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/validate-array-like.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/validate-array-like.js new file mode 100644 index 00000000..53bd1124 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/validate-array-like.js @@ -0,0 +1,15 @@ +'use strict'; + +module.exports = function (t, a) { + var x; + a.throws(function () { t(0); }, TypeError, "0"); + a.throws(function () { t(false); }, TypeError, "false"); + a(t(''), '', "''"); + a.throws(function () { t({}); }, TypeError, "Plain Object"); + a.throws(function () { t(function () {}); }, TypeError, "Function"); + a(t(x = new String('raz')), x, "String object"); //jslint: ignore + + a(t(x = { length: 1 }), x, "Array like"); + a.throws(function () { t(); }, TypeError, "Undefined"); + a.throws(function () { t(null); }, TypeError, "null"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/validate-stringifiable-value.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/validate-stringifiable-value.js new file mode 100644 index 00000000..ae9bd17a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/validate-stringifiable-value.js @@ -0,0 +1,16 @@ +'use strict'; + +module.exports = function (t, a) { + var x; + a.throws(function () { t(); }, TypeError, "Undefined"); + a.throws(function () { t(null); }, TypeError, "Null"); + a(t(0), "0"); + a(t(false), "false"); + a(t(''), ""); + a(t({}), String({}), "Object"); + a(t(x = function () {}), String(x), "Function"); + a(t(x = new String('raz')), String(x), "String object"); //jslint: ignore + a(t(x = new Date()), String(x), "Date"); + + a.throws(function () { t(Object.create(null)); }, TypeError, "Null prototype object"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/validate-stringifiable.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/validate-stringifiable.js new file mode 100644 index 00000000..4a46bb52 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/validate-stringifiable.js @@ -0,0 +1,16 @@ +'use strict'; + +module.exports = function (t, a) { + var x; + a(t(), 'undefined', "Undefined"); + a(t(null), 'null', "Null"); + a(t(0), "0"); + a(t(false), "false"); + a(t(''), ""); + a(t({}), String({}), "Object"); + a(t(x = function () {}), String(x), "Function"); + a(t(x = new String('raz')), String(x), "String object"); //jslint: ignore + a(t(x = new Date()), String(x), "Date"); + + a.throws(function () { t(Object.create(null)); }, TypeError, "Null prototype object"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/index.js new file mode 100644 index 00000000..ca2bd650 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/index.js @@ -0,0 +1,12 @@ +'use strict'; + +var indexTest = require('tad/lib/utils/index-test') + + , path = require('path').resolve(__dirname, '../../../reg-exp/#'); + +module.exports = function (t, a, d) { + indexTest(indexTest.readDir(path).aside(function (data) { + delete data.sticky; + delete data.unicode; + }))(t, a, d); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/is-sticky.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/is-sticky.js new file mode 100644 index 00000000..e154ac29 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/is-sticky.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = function (t, a) { + var re; + a(t.call(/raz/), false, "Normal"); + a(t.call(/raz/g), false, "Global"); + try { re = new RegExp('raz', 'y'); } catch (ignore) {} + if (!re) return; + a(t.call(re), true, "Sticky"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/is-unicode.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/is-unicode.js new file mode 100644 index 00000000..2ffb9e86 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/is-unicode.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = function (t, a) { + var re; + a(t.call(/raz/), false, "Normal"); + a(t.call(/raz/g), false, "Global"); + try { re = new RegExp('raz', 'u'); } catch (ignore) {} + if (!re) return; + a(t.call(re), true, "Unicode"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/match/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/match/implement.js new file mode 100644 index 00000000..89825a45 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/match/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../../reg-exp/#/match/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/match/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/match/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/match/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/match/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/match/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/match/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/match/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/match/shim.js new file mode 100644 index 00000000..5249139f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/match/shim.js @@ -0,0 +1,8 @@ +'use strict'; + +module.exports = function (t, a) { + var result = ['foo']; + result.index = 0; + result.input = 'foobar'; + a.deep(t.call(/foo/, 'foobar'), result); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/replace/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/replace/implement.js new file mode 100644 index 00000000..c32b23a6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/replace/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../../reg-exp/#/replace/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/replace/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/replace/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/replace/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/replace/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/replace/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/replace/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/replace/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/replace/shim.js new file mode 100644 index 00000000..2b378fd5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/replace/shim.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function (t, a) { + a(t.call(/foo/, 'foobar', 'mar'), 'marbar'); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/search/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/search/implement.js new file mode 100644 index 00000000..ff1b8087 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/search/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../../reg-exp/#/search/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/search/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/search/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/search/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/search/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/search/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/search/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/search/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/search/shim.js new file mode 100644 index 00000000..596bcdb9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/search/shim.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function (t, a) { + a(t.call(/foo/, 'barfoo'), 3); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/split/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/split/implement.js new file mode 100644 index 00000000..1cee4418 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/split/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../../reg-exp/#/split/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/split/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/split/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/split/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/split/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/split/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/split/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/split/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/split/shim.js new file mode 100644 index 00000000..6a95cd03 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/split/shim.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function (t, a) { + a.deep(t.call(/\|/, 'bar|foo'), ['bar', 'foo']); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/sticky/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/sticky/implement.js new file mode 100644 index 00000000..d94e7b98 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/sticky/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../../reg-exp/#/sticky/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/sticky/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/sticky/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/sticky/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/unicode/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/unicode/implement.js new file mode 100644 index 00000000..9b1aa0f2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/unicode/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../../reg-exp/#/unicode/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/unicode/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/unicode/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/unicode/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/escape.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/escape.js new file mode 100644 index 00000000..5b00f67f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/escape.js @@ -0,0 +1,6 @@ +'use strict'; + +module.exports = function (t, a) { + var str = "(?:^te|er)s{2}t\\[raz]+$"; + a(RegExp('^' + t(str) + '$').test(str), true); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/is-reg-exp.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/is-reg-exp.js new file mode 100644 index 00000000..785ca28c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/is-reg-exp.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports = function (t, a) { + a(t('arar'), false, "String"); + a(t(12), false, "Number"); + a(t(true), false, "Boolean"); + a(t(new Date()), false, "Date"); + a(t(new String('raz')), false, "String object"); + a(t({}), false, "Plain object"); + a(t(/a/), true, "Regular expression"); + a(t(new RegExp('a')), true, "Regular expression via constructor"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/valid-reg-exp.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/valid-reg-exp.js new file mode 100644 index 00000000..cd12cf12 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/valid-reg-exp.js @@ -0,0 +1,17 @@ +'use strict'; + +module.exports = function (t, a) { + var r = /raz/; + a(t(r), r, "Direct"); + r = new RegExp('foo'); + a(t(r), r, "Constructor"); + a.throws(function () { + t({}); + }, "Object"); + a.throws(function () { + t(function () {}); + }, "Function"); + a.throws(function () { + t({ exec: function () { return 20; } }); + }, "Plain object"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/@@iterator/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/@@iterator/implement.js new file mode 100644 index 00000000..09bf3361 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/@@iterator/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../../string/#/@@iterator/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/@@iterator/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/@@iterator/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/@@iterator/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/@@iterator/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/@@iterator/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/@@iterator/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/@@iterator/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/@@iterator/shim.js new file mode 100644 index 00000000..3b0e0b75 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/@@iterator/shim.js @@ -0,0 +1,9 @@ +'use strict'; + +module.exports = function (t, a) { + var it = t.call('r💩z'); + a.deep(it.next(), { done: false, value: 'r' }, "#1"); + a.deep(it.next(), { done: false, value: '💩' }, "#2"); + a.deep(it.next(), { done: false, value: 'z' }, "#3"); + a.deep(it.next(), { done: true, value: undefined }, "End"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/at.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/at.js new file mode 100644 index 00000000..2447a9f6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/at.js @@ -0,0 +1,97 @@ +// See tests at https://github.com/mathiasbynens/String.prototype.at + +'use strict'; + +module.exports = function (t, a) { + a(t.length, 1, "Length"); + + a.h1("BMP"); + a(t.call('abc\uD834\uDF06def', -Infinity), '', "-Infinity"); + a(t.call('abc\uD834\uDF06def', -1), '', "-1"); + a(t.call('abc\uD834\uDF06def', -0), 'a', "-0"); + a(t.call('abc\uD834\uDF06def', +0), 'a', "+0"); + a(t.call('abc\uD834\uDF06def', 1), 'b', "1"); + a(t.call('abc\uD834\uDF06def', 3), '\uD834\uDF06', "3"); + a(t.call('abc\uD834\uDF06def', 4), '\uDF06', "4"); + a(t.call('abc\uD834\uDF06def', 5), 'd', "5"); + a(t.call('abc\uD834\uDF06def', 42), '', "42"); + a(t.call('abc\uD834\uDF06def', +Infinity), '', "+Infinity"); + a(t.call('abc\uD834\uDF06def', null), 'a', "null"); + a(t.call('abc\uD834\uDF06def', undefined), 'a', "undefined"); + a(t.call('abc\uD834\uDF06def'), 'a', "No argument"); + a(t.call('abc\uD834\uDF06def', false), 'a', "false"); + a(t.call('abc\uD834\uDF06def', NaN), 'a', "NaN"); + a(t.call('abc\uD834\uDF06def', ''), 'a', "Empty string"); + a(t.call('abc\uD834\uDF06def', '_'), 'a', "_"); + a(t.call('abc\uD834\uDF06def', '1'), 'b', "'1'"); + a(t.call('abc\uD834\uDF06def', []), 'a', "[]"); + a(t.call('abc\uD834\uDF06def', {}), 'a', "{}"); + a(t.call('abc\uD834\uDF06def', -0.9), 'a', "-0.9"); + a(t.call('abc\uD834\uDF06def', 1.9), 'b', "1.9"); + a(t.call('abc\uD834\uDF06def', 7.9), 'f', "7.9"); + a(t.call('abc\uD834\uDF06def', Math.pow(2, 32)), '', "Big number"); + + a.h1("Astral symbol"); + a(t.call('\uD834\uDF06def', -Infinity), '', "-Infinity"); + a(t.call('\uD834\uDF06def', -1), '', "-1"); + a(t.call('\uD834\uDF06def', -0), '\uD834\uDF06', "-0"); + a(t.call('\uD834\uDF06def', +0), '\uD834\uDF06', "+0"); + a(t.call('\uD834\uDF06def', 1), '\uDF06', "1"); + a(t.call('\uD834\uDF06def', 2), 'd', "2"); + a(t.call('\uD834\uDF06def', 3), 'e', "3"); + a(t.call('\uD834\uDF06def', 4), 'f', "4"); + a(t.call('\uD834\uDF06def', 42), '', "42"); + a(t.call('\uD834\uDF06def', +Infinity), '', "+Infinity"); + a(t.call('\uD834\uDF06def', null), '\uD834\uDF06', "null"); + a(t.call('\uD834\uDF06def', undefined), '\uD834\uDF06', "undefined"); + a(t.call('\uD834\uDF06def'), '\uD834\uDF06', "No arguments"); + a(t.call('\uD834\uDF06def', false), '\uD834\uDF06', "false"); + a(t.call('\uD834\uDF06def', NaN), '\uD834\uDF06', "NaN"); + a(t.call('\uD834\uDF06def', ''), '\uD834\uDF06', "Empty string"); + a(t.call('\uD834\uDF06def', '_'), '\uD834\uDF06', "_"); + a(t.call('\uD834\uDF06def', '1'), '\uDF06', "'1'"); + + a.h1("Lone high surrogates"); + a(t.call('\uD834abc', -Infinity), '', "-Infinity"); + a(t.call('\uD834abc', -1), '', "-1"); + a(t.call('\uD834abc', -0), '\uD834', "-0"); + a(t.call('\uD834abc', +0), '\uD834', "+0"); + a(t.call('\uD834abc', 1), 'a', "1"); + a(t.call('\uD834abc', 42), '', "42"); + a(t.call('\uD834abc', +Infinity), '', "Infinity"); + a(t.call('\uD834abc', null), '\uD834', "null"); + a(t.call('\uD834abc', undefined), '\uD834', "undefined"); + a(t.call('\uD834abc'), '\uD834', "No arguments"); + a(t.call('\uD834abc', false), '\uD834', "false"); + a(t.call('\uD834abc', NaN), '\uD834', "NaN"); + a(t.call('\uD834abc', ''), '\uD834', "Empty string"); + a(t.call('\uD834abc', '_'), '\uD834', "_"); + a(t.call('\uD834abc', '1'), 'a', "'a'"); + + a.h1("Lone low surrogates"); + a(t.call('\uDF06abc', -Infinity), '', "-Infinity"); + a(t.call('\uDF06abc', -1), '', "-1"); + a(t.call('\uDF06abc', -0), '\uDF06', "-0"); + a(t.call('\uDF06abc', +0), '\uDF06', "+0"); + a(t.call('\uDF06abc', 1), 'a', "1"); + a(t.call('\uDF06abc', 42), '', "42"); + a(t.call('\uDF06abc', +Infinity), '', "+Infinity"); + a(t.call('\uDF06abc', null), '\uDF06', "null"); + a(t.call('\uDF06abc', undefined), '\uDF06', "undefined"); + a(t.call('\uDF06abc'), '\uDF06', "No arguments"); + a(t.call('\uDF06abc', false), '\uDF06', "false"); + a(t.call('\uDF06abc', NaN), '\uDF06', "NaN"); + a(t.call('\uDF06abc', ''), '\uDF06', "Empty string"); + a(t.call('\uDF06abc', '_'), '\uDF06', "_"); + a(t.call('\uDF06abc', '1'), 'a', "'1'"); + + a.h1("Context"); + a.throws(function () { t.call(undefined); }, TypeError, "Undefined"); + a.throws(function () { t.call(undefined, 4); }, TypeError, + "Undefined + argument"); + a.throws(function () { t.call(null); }, TypeError, "Null"); + a.throws(function () { t.call(null, 4); }, TypeError, "Null + argument"); + a(t.call(42, 0), '4', "Number #1"); + a(t.call(42, 1), '2', "Number #2"); + a(t.call({ toString: function () { return 'abc'; } }, 2), 'c', "Object"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/camel-to-hyphen.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/camel-to-hyphen.js new file mode 100644 index 00000000..64e35c03 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/camel-to-hyphen.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = function (t, a) { + a(t.call('razDwaTRzy4yFoo45My'), 'raz-dwa-t-rzy4y-foo45-my'); + a(t.call('razDwaTRzy4yFoo45My-'), 'raz-dwa-t-rzy4y-foo45-my-'); + a(t.call('razDwaTRzy4yFoo45My--'), 'raz-dwa-t-rzy4y-foo45-my--'); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/capitalize.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/capitalize.js new file mode 100644 index 00000000..fa11ff8e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/capitalize.js @@ -0,0 +1,9 @@ +'use strict'; + +module.exports = function (t, a) { + a(t.call('raz'), 'Raz', "Word"); + a(t.call('BLA'), 'BLA', "Uppercase"); + a(t.call(''), '', "Empty"); + a(t.call('a'), 'A', "One letter"); + a(t.call('this is a test'), 'This is a test', "Sentence"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/case-insensitive-compare.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/case-insensitive-compare.js new file mode 100644 index 00000000..01a90c39 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/case-insensitive-compare.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = function (t, a) { + a(t.call("AA", "aa"), 0, "Same"); + a.ok(t.call("Amber", "zebra") < 0, "Less"); + a.ok(t.call("Zebra", "amber") > 0, "Greater"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/code-point-at/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/code-point-at/implement.js new file mode 100644 index 00000000..5e33cd71 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/code-point-at/implement.js @@ -0,0 +1,6 @@ +'use strict'; + +var isImplemented = + require('../../../../string/#/code-point-at/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/code-point-at/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/code-point-at/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/code-point-at/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/code-point-at/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/code-point-at/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/code-point-at/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/code-point-at/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/code-point-at/shim.js new file mode 100644 index 00000000..0df4751c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/code-point-at/shim.js @@ -0,0 +1,81 @@ +// Taken from: https://github.com/mathiasbynens/String.prototype.codePointAt +// /blob/master/tests/tests.js + +'use strict'; + +module.exports = function (t, a) { + a(t.length, 1, "Length"); + + // String that starts with a BMP symbol + a(t.call('abc\uD834\uDF06def', ''), 0x61); + a(t.call('abc\uD834\uDF06def', '_'), 0x61); + a(t.call('abc\uD834\uDF06def'), 0x61); + a(t.call('abc\uD834\uDF06def', -Infinity), undefined); + a(t.call('abc\uD834\uDF06def', -1), undefined); + a(t.call('abc\uD834\uDF06def', -0), 0x61); + a(t.call('abc\uD834\uDF06def', 0), 0x61); + a(t.call('abc\uD834\uDF06def', 3), 0x1D306); + a(t.call('abc\uD834\uDF06def', 4), 0xDF06); + a(t.call('abc\uD834\uDF06def', 5), 0x64); + a(t.call('abc\uD834\uDF06def', 42), undefined); + a(t.call('abc\uD834\uDF06def', Infinity), undefined); + a(t.call('abc\uD834\uDF06def', Infinity), undefined); + a(t.call('abc\uD834\uDF06def', NaN), 0x61); + a(t.call('abc\uD834\uDF06def', false), 0x61); + a(t.call('abc\uD834\uDF06def', null), 0x61); + a(t.call('abc\uD834\uDF06def', undefined), 0x61); + + // String that starts with an astral symbol + a(t.call('\uD834\uDF06def', ''), 0x1D306); + a(t.call('\uD834\uDF06def', '1'), 0xDF06); + a(t.call('\uD834\uDF06def', '_'), 0x1D306); + a(t.call('\uD834\uDF06def'), 0x1D306); + a(t.call('\uD834\uDF06def', -1), undefined); + a(t.call('\uD834\uDF06def', -0), 0x1D306); + a(t.call('\uD834\uDF06def', 0), 0x1D306); + a(t.call('\uD834\uDF06def', 1), 0xDF06); + a(t.call('\uD834\uDF06def', 42), undefined); + a(t.call('\uD834\uDF06def', false), 0x1D306); + a(t.call('\uD834\uDF06def', null), 0x1D306); + a(t.call('\uD834\uDF06def', undefined), 0x1D306); + + // Lone high surrogates + a(t.call('\uD834abc', ''), 0xD834); + a(t.call('\uD834abc', '_'), 0xD834); + a(t.call('\uD834abc'), 0xD834); + a(t.call('\uD834abc', -1), undefined); + a(t.call('\uD834abc', -0), 0xD834); + a(t.call('\uD834abc', 0), 0xD834); + a(t.call('\uD834abc', false), 0xD834); + a(t.call('\uD834abc', NaN), 0xD834); + a(t.call('\uD834abc', null), 0xD834); + a(t.call('\uD834abc', undefined), 0xD834); + + // Lone low surrogates + a(t.call('\uDF06abc', ''), 0xDF06); + a(t.call('\uDF06abc', '_'), 0xDF06); + a(t.call('\uDF06abc'), 0xDF06); + a(t.call('\uDF06abc', -1), undefined); + a(t.call('\uDF06abc', -0), 0xDF06); + a(t.call('\uDF06abc', 0), 0xDF06); + a(t.call('\uDF06abc', false), 0xDF06); + a(t.call('\uDF06abc', NaN), 0xDF06); + a(t.call('\uDF06abc', null), 0xDF06); + a(t.call('\uDF06abc', undefined), 0xDF06); + + a.throws(function () { t.call(undefined); }, TypeError); + a.throws(function () { t.call(undefined, 4); }, TypeError); + a.throws(function () { t.call(null); }, TypeError); + a.throws(function () { t.call(null, 4); }, TypeError); + a(t.call(42, 0), 0x34); + a(t.call(42, 1), 0x32); + a(t.call({ toString: function () { return 'abc'; } }, 2), 0x63); + + a.throws(function () { t.apply(undefined); }, TypeError); + a.throws(function () { t.apply(undefined, [4]); }, TypeError); + a.throws(function () { t.apply(null); }, TypeError); + a.throws(function () { t.apply(null, [4]); }, TypeError); + a(t.apply(42, [0]), 0x34); + a(t.apply(42, [1]), 0x32); + a(t.apply({ toString: function () { return 'abc'; } }, [2]), 0x63); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/contains/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/contains/implement.js new file mode 100644 index 00000000..220f50d4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/contains/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../../string/#/contains/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/contains/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/contains/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/contains/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/contains/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/contains/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/contains/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/contains/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/contains/shim.js new file mode 100644 index 00000000..a0ea4db2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/contains/shim.js @@ -0,0 +1,14 @@ +'use strict'; + +module.exports = function (t, a) { + a(t.call('raz', ''), true, "Empty"); + a(t.call('', ''), true, "Both Empty"); + a(t.call('raz', 'raz'), true, "Same"); + a(t.call('razdwa', 'raz'), true, "Starts with"); + a(t.call('razdwa', 'dwa'), true, "Ends with"); + a(t.call('razdwa', 'zdw'), true, "In middle"); + a(t.call('', 'raz'), false, "Something in empty"); + a(t.call('az', 'raz'), false, "Longer"); + a(t.call('azasdfasdf', 'azff'), false, "Not found"); + a(t.call('razdwa', 'raz', 1), false, "Position"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/ends-with/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/ends-with/implement.js new file mode 100644 index 00000000..93bd2ddc --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/ends-with/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../../string/#/ends-with/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/ends-with/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/ends-with/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/ends-with/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/ends-with/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/ends-with/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/ends-with/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/ends-with/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/ends-with/shim.js new file mode 100644 index 00000000..e4b93c40 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/ends-with/shim.js @@ -0,0 +1,16 @@ +// In some parts copied from: +// http://closure-library.googlecode.com/svn/trunk/closure/goog/ +// string/string_test.html + +'use strict'; + +module.exports = function (t, a) { + a(t.call('abc', ''), true, "Empty needle"); + a(t.call('abcd', 'cd'), true, "Ends with needle"); + a(t.call('abcd', 'abcd'), true, "Needle equals haystack"); + a(t.call('abcd', 'ab'), false, "Doesn't end with needle"); + a(t.call('abc', 'defg'), false, "Length trick"); + a(t.call('razdwa', 'zd', 3), false, "Position: false"); + a(t.call('razdwa', 'zd', 4), true, "Position: true"); + a(t.call('razdwa', 'zd', 5), false, "Position: false #2"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/hyphen-to-camel.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/hyphen-to-camel.js new file mode 100644 index 00000000..0118dd81 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/hyphen-to-camel.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = function (t, a) { + a(t.call('raz-dwa-t-rzy-4y-rtr4-tiu-45-pa'), 'razDwaTRzy4yRtr4Tiu45Pa'); + a(t.call('raz-dwa-t-rzy-4y-rtr4-tiu-45-pa-'), 'razDwaTRzy4yRtr4Tiu45Pa-'); + a(t.call('raz-dwa-t-rzy-4y-rtr4-tiu-45-pa--'), 'razDwaTRzy4yRtr4Tiu45Pa--'); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/indent.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/indent.js new file mode 100644 index 00000000..eb92b36f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/indent.js @@ -0,0 +1,9 @@ +'use strict'; + +module.exports = function (t, a) { + a(t.call('ra\nzz', ''), 'ra\nzz', "Empty"); + a(t.call('ra\nzz', '\t', 3), '\t\t\tra\n\t\t\tzz', "String repeat"); + a(t.call('ra\nzz\nsss\nfff\n', '\t'), '\tra\n\tzz\n\tsss\n\tfff\n', + "Multi-line"); + a(t.call('ra\n\nzz\n', '\t'), '\tra\n\n\tzz\n', "Don't touch empty lines"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/last.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/last.js new file mode 100644 index 00000000..ad36a213 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/last.js @@ -0,0 +1,6 @@ +'use strict'; + +module.exports = function (t, a) { + a(t.call(''), null, "Null"); + a(t.call('abcdef'), 'f', "String"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/normalize/_data.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/normalize/_data.js new file mode 100644 index 00000000..c741addb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/normalize/_data.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t[0], 'object'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/normalize/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/normalize/implement.js new file mode 100644 index 00000000..4886c9b8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/normalize/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../../string/#/normalize/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/normalize/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/normalize/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/normalize/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/normalize/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/normalize/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/normalize/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/normalize/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/normalize/shim.js new file mode 100644 index 00000000..28e27f59 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/normalize/shim.js @@ -0,0 +1,13 @@ +// Taken from: https://github.com/walling/unorm/blob/master/test/es6-shim.js + +'use strict'; + +var str = 'äiti'; + +module.exports = function (t, a) { + a(t.call(str), "\u00e4iti"); + a(t.call(str, "NFC"), "\u00e4iti"); + a(t.call(str, "NFD"), "a\u0308iti"); + a(t.call(str, "NFKC"), "\u00e4iti"); + a(t.call(str, "NFKD"), "a\u0308iti"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/pad.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/pad.js new file mode 100644 index 00000000..28c3fcaa --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/pad.js @@ -0,0 +1,24 @@ +'use strict'; + +var partial = require('../../../function/#/partial'); + +module.exports = { + Left: function (t, a) { + t = partial.call(t, 'x', 5); + + a(t.call('yy'), 'xxxyy'); + a(t.call(''), 'xxxxx', "Empty string"); + + a(t.call('yyyyy'), 'yyyyy', 'Equal length'); + a(t.call('yyyyyyy'), 'yyyyyyy', 'Longer'); + }, + Right: function (t, a) { + t = partial.call(t, 'x', -5); + + a(t.call('yy'), 'yyxxx'); + a(t.call(''), 'xxxxx', "Empty string"); + + a(t.call('yyyyy'), 'yyyyy', 'Equal length'); + a(t.call('yyyyyyy'), 'yyyyyyy', 'Longer'); + } +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/plain-replace-all.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/plain-replace-all.js new file mode 100644 index 00000000..a425c87a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/plain-replace-all.js @@ -0,0 +1,11 @@ +'use strict'; + +module.exports = function (t, a) { + a(t.call('razdwatrzy', 'dwa', 'olera'), 'razoleratrzy', "Basic"); + a(t.call('razdwatrzy', 'dwa', 'ole$&a'), 'razole$&atrzy', "Inserts"); + a(t.call('razdwa', 'ola', 'sdfs'), 'razdwa', "No replace"); + + a(t.call('$raz$$dwa$trzy$', '$', '&&'), '&&raz&&&&dwa&&trzy&&', "Multi"); + a(t.call('$raz$$dwa$$$$trzy$', '$$', '&'), '$raz&dwa&&trzy$', + "Multi many chars"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/plain-replace.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/plain-replace.js new file mode 100644 index 00000000..54522ed7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/plain-replace.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = function (t, a) { + a(t.call('razdwatrzy', 'dwa', 'olera'), 'razoleratrzy', "Basic"); + a(t.call('razdwatrzy', 'dwa', 'ole$&a'), 'razole$&atrzy', "Inserts"); + a(t.call('razdwa', 'ola', 'sdfs'), 'razdwa', "No replace"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/repeat/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/repeat/implement.js new file mode 100644 index 00000000..7ff65a81 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/repeat/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../../string/#/repeat/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/repeat/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/repeat/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/repeat/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/repeat/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/repeat/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/repeat/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/repeat/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/repeat/shim.js new file mode 100644 index 00000000..7e0d077e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/repeat/shim.js @@ -0,0 +1,8 @@ +'use strict'; + +module.exports = function (t, a) { + a(t.call('a', 0), '', "Empty"); + a(t.call('a', 1), 'a', "1"); + a(t.call('\t', 5), '\t\t\t\t\t', "Whitespace"); + a(t.call('raz', 3), 'razrazraz', "Many chars"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/starts-with/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/starts-with/implement.js new file mode 100644 index 00000000..fc8490fc --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/starts-with/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../../string/#/starts-with/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/starts-with/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/starts-with/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/starts-with/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/starts-with/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/starts-with/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/starts-with/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/starts-with/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/starts-with/shim.js new file mode 100644 index 00000000..e0e123b3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/starts-with/shim.js @@ -0,0 +1,14 @@ +// Inspired and in some parts copied from: +// http://closure-library.googlecode.com/svn/trunk/closure/goog +// /string/string_test.html + +'use strict'; + +module.exports = function (t, a) { + a(t.call('abc', ''), true, "Empty needle"); + a(t.call('abcd', 'ab'), true, "Starts with needle"); + a(t.call('abcd', 'abcd'), true, "Needle equals haystack"); + a(t.call('abcd', 'bcde', 1), false, "Needle larger than haystack"); + a(!t.call('abcd', 'cd'), true, "Doesn't start with needle"); + a(t.call('abcd', 'bc', 1), true, "Position"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/uncapitalize.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/uncapitalize.js new file mode 100644 index 00000000..50f35f1f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/uncapitalize.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = function (t, a) { + a(t.call('raz'), 'raz', "Word"); + a(t.call('BLA'), 'bLA', "Uppercase"); + a(t.call(''), '', "Empty"); + a(t.call('a'), 'a', "One letter"); + a(t.call('this is a test'), 'this is a test', "Sentence"); + a(t.call('This is a test'), 'this is a test', "Capitalized sentence"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/format-method.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/format-method.js new file mode 100644 index 00000000..bb5561ee --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/format-method.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = function (t, a) { + t = t({ a: 'A', aa: 'B', ab: 'C', b: 'D', + c: function () { return ++this.a; } }); + a(t.call({ a: 0 }, ' %a%aab%abb%b\\%aa%ab%c%c '), ' ABbCbD%aaC12 '); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/from-code-point/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/from-code-point/implement.js new file mode 100644 index 00000000..0aceb97e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/from-code-point/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../string/from-code-point/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/from-code-point/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/from-code-point/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/from-code-point/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/from-code-point/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/from-code-point/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/from-code-point/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/from-code-point/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/from-code-point/shim.js new file mode 100644 index 00000000..88cda3d6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/from-code-point/shim.js @@ -0,0 +1,47 @@ +// Taken from: https://github.com/mathiasbynens/String.fromCodePoint/blob/master +// /tests/tests.js + +'use strict'; + +var pow = Math.pow; + +module.exports = function (t, a) { + var counter, result; + + a(t.length, 1, "Length"); + a(String.propertyIsEnumerable('fromCodePoint'), false, "Not enumerable"); + + a(t(''), '\0', "Empty string"); + a(t(), '', "No arguments"); + a(t(-0), '\0', "-0"); + a(t(0), '\0', "0"); + a(t(0x1D306), '\uD834\uDF06', "Unicode"); + a(t(0x1D306, 0x61, 0x1D307), '\uD834\uDF06a\uD834\uDF07', "Complex unicode"); + a(t(0x61, 0x62, 0x1D307), 'ab\uD834\uDF07', "Complex"); + a(t(false), '\0', "false"); + a(t(null), '\0', "null"); + + a.throws(function () { t('_'); }, RangeError, "_"); + a.throws(function () { t(Infinity); }, RangeError, "Infinity"); + a.throws(function () { t(-Infinity); }, RangeError, "-Infinity"); + a.throws(function () { t(-1); }, RangeError, "-1"); + a.throws(function () { t(0x10FFFF + 1); }, RangeError, "Range error #1"); + a.throws(function () { t(3.14); }, RangeError, "Range error #2"); + a.throws(function () { t(3e-2); }, RangeError, "Range error #3"); + a.throws(function () { t(-Infinity); }, RangeError, "Range error #4"); + a.throws(function () { t(+Infinity); }, RangeError, "Range error #5"); + a.throws(function () { t(NaN); }, RangeError, "Range error #6"); + a.throws(function () { t(undefined); }, RangeError, "Range error #7"); + a.throws(function () { t({}); }, RangeError, "Range error #8"); + a.throws(function () { t(/re/); }, RangeError, "Range error #9"); + + counter = pow(2, 15) * 3 / 2; + result = []; + while (--counter >= 0) result.push(0); // one code unit per symbol + t.apply(null, result); // must not throw + + counter = pow(2, 15) * 3 / 2; + result = []; + while (--counter >= 0) result.push(0xFFFF + 1); // two code units per symbol + t.apply(null, result); // must not throw +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/is-string.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/is-string.js new file mode 100644 index 00000000..32f59582 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/is-string.js @@ -0,0 +1,11 @@ +'use strict'; + +module.exports = function (t, a) { + a(t(null), false, "Null"); + a(t(''), true, "Empty string"); + a(t(12), false, "Number"); + a(t(false), false, "Boolean"); + a(t(new Date()), false, "Date"); + a(t(new String('raz')), true, "String object"); + a(t('asdfaf'), true, "String"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/random-uniq.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/random-uniq.js new file mode 100644 index 00000000..6791ac26 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/random-uniq.js @@ -0,0 +1,14 @@ +'use strict'; + +var isValidFormat = RegExp.prototype.test.bind(/^[a-z0-9]+$/); + +module.exports = function (t, a) { + a(typeof t(), 'string'); + a.ok(t().length > 7); + a.not(t(), t()); + a.ok(isValidFormat(t())); + a.ok(isValidFormat(t())); + a.ok(isValidFormat(t())); + a.ok(isValidFormat(t())); + a.ok(isValidFormat(t())); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/raw/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/raw/implement.js new file mode 100644 index 00000000..59416de3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/raw/implement.js @@ -0,0 +1,5 @@ +'use strict'; + +var isImplemented = require('../../../string/raw/is-implemented'); + +module.exports = function (a) { a(isImplemented(), true); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/raw/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/raw/index.js new file mode 100644 index 00000000..2e0bfa32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/raw/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./shim'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/raw/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/raw/is-implemented.js new file mode 100644 index 00000000..1a883288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/raw/is-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t(), 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/raw/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/raw/shim.js new file mode 100644 index 00000000..025ed780 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/raw/shim.js @@ -0,0 +1,15 @@ +// Partially taken from: +// https://github.com/paulmillr/es6-shim/blob/master/test/string.js + +'use strict'; + +module.exports = function (t, a) { + var callSite = []; + + callSite.raw = ["The total is ", " ($", " with tax)"]; + a(t(callSite, '{total}', '{total * 1.01}'), + 'The total is {total} (${total * 1.01} with tax)'); + + callSite.raw = []; + a(t(callSite, '{total}', '{total * 1.01}'), ''); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/package.json new file mode 100644 index 00000000..6b99c4c3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/package.json @@ -0,0 +1,70 @@ +{ + "name": "es6-symbol", + "version": "3.1.0", + "description": "ECMAScript 6 Symbol polyfill", + "author": { + "name": "Mariusz Nowak", + "email": "medyk@medikoo.com", + "url": "http://www.medikoo.com/" + }, + "keywords": [ + "symbol", + "private", + "property", + "es6", + "ecmascript", + "harmony", + "ponyfill", + "polyfill" + ], + "repository": { + "type": "git", + "url": "git://github.com/medikoo/es6-symbol.git" + }, + "dependencies": { + "d": "~0.1.1", + "es5-ext": "~0.10.11" + }, + "devDependencies": { + "tad": "~0.2.4", + "xlint": "~0.2.2", + "xlint-jslint-medikoo": "~0.1.4" + }, + "scripts": { + "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream", + "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch", + "test": "node ./node_modules/tad/bin/tad" + }, + "license": "MIT", + "gitHead": "f84175053e9cad6a1230f3b7cc13e078c3fcc12f", + "bugs": { + "url": "https://github.com/medikoo/es6-symbol/issues" + }, + "homepage": "https://github.com/medikoo/es6-symbol#readme", + "_id": "es6-symbol@3.1.0", + "_shasum": "94481c655e7a7cad82eba832d97d5433496d7ffa", + "_from": "es6-symbol@>=3.0.2 <4.0.0", + "_npmVersion": "2.15.5", + "_nodeVersion": "4.4.5", + "_npmUser": { + "name": "medikoo", + "email": "medikoo+npm@medikoo.com" + }, + "dist": { + "shasum": "94481c655e7a7cad82eba832d97d5433496d7ffa", + "tarball": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.0.tgz" + }, + "maintainers": [ + { + "name": "medikoo", + "email": "medikoo+npm@medikoo.com" + } + ], + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/es6-symbol-3.1.0.tgz_1464960261964_0.3645231726113707" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/polyfill.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/polyfill.js new file mode 100644 index 00000000..48832a5f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/polyfill.js @@ -0,0 +1,118 @@ +// ES2015 Symbol polyfill for environments that do not support it (or partially support it) + +'use strict'; + +var d = require('d') + , validateSymbol = require('./validate-symbol') + + , create = Object.create, defineProperties = Object.defineProperties + , defineProperty = Object.defineProperty, objPrototype = Object.prototype + , NativeSymbol, SymbolPolyfill, HiddenSymbol, globalSymbols = create(null) + , isNativeSafe; + +if (typeof Symbol === 'function') { + NativeSymbol = Symbol; + try { + String(NativeSymbol()); + isNativeSafe = true; + } catch (ignore) {} +} + +var generateName = (function () { + var created = create(null); + return function (desc) { + var postfix = 0, name, ie11BugWorkaround; + while (created[desc + (postfix || '')]) ++postfix; + desc += (postfix || ''); + created[desc] = true; + name = '@@' + desc; + defineProperty(objPrototype, name, d.gs(null, function (value) { + // For IE11 issue see: + // https://connect.microsoft.com/IE/feedbackdetail/view/1928508/ + // ie11-broken-getters-on-dom-objects + // https://github.com/medikoo/es6-symbol/issues/12 + if (ie11BugWorkaround) return; + ie11BugWorkaround = true; + defineProperty(this, name, d(value)); + ie11BugWorkaround = false; + })); + return name; + }; +}()); + +// Internal constructor (not one exposed) for creating Symbol instances. +// This one is used to ensure that `someSymbol instanceof Symbol` always return false +HiddenSymbol = function Symbol(description) { + if (this instanceof HiddenSymbol) throw new TypeError('TypeError: Symbol is not a constructor'); + return SymbolPolyfill(description); +}; + +// Exposed `Symbol` constructor +// (returns instances of HiddenSymbol) +module.exports = SymbolPolyfill = function Symbol(description) { + var symbol; + if (this instanceof Symbol) throw new TypeError('TypeError: Symbol is not a constructor'); + if (isNativeSafe) return NativeSymbol(description); + symbol = create(HiddenSymbol.prototype); + description = (description === undefined ? '' : String(description)); + return defineProperties(symbol, { + __description__: d('', description), + __name__: d('', generateName(description)) + }); +}; +defineProperties(SymbolPolyfill, { + for: d(function (key) { + if (globalSymbols[key]) return globalSymbols[key]; + return (globalSymbols[key] = SymbolPolyfill(String(key))); + }), + keyFor: d(function (s) { + var key; + validateSymbol(s); + for (key in globalSymbols) if (globalSymbols[key] === s) return key; + }), + + // If there's native implementation of given symbol, let's fallback to it + // to ensure proper interoperability with other native functions e.g. Array.from + hasInstance: d('', (NativeSymbol && NativeSymbol.hasInstance) || SymbolPolyfill('hasInstance')), + isConcatSpreadable: d('', (NativeSymbol && NativeSymbol.isConcatSpreadable) || + SymbolPolyfill('isConcatSpreadable')), + iterator: d('', (NativeSymbol && NativeSymbol.iterator) || SymbolPolyfill('iterator')), + match: d('', (NativeSymbol && NativeSymbol.match) || SymbolPolyfill('match')), + replace: d('', (NativeSymbol && NativeSymbol.replace) || SymbolPolyfill('replace')), + search: d('', (NativeSymbol && NativeSymbol.search) || SymbolPolyfill('search')), + species: d('', (NativeSymbol && NativeSymbol.species) || SymbolPolyfill('species')), + split: d('', (NativeSymbol && NativeSymbol.split) || SymbolPolyfill('split')), + toPrimitive: d('', (NativeSymbol && NativeSymbol.toPrimitive) || SymbolPolyfill('toPrimitive')), + toStringTag: d('', (NativeSymbol && NativeSymbol.toStringTag) || SymbolPolyfill('toStringTag')), + unscopables: d('', (NativeSymbol && NativeSymbol.unscopables) || SymbolPolyfill('unscopables')) +}); + +// Internal tweaks for real symbol producer +defineProperties(HiddenSymbol.prototype, { + constructor: d(SymbolPolyfill), + toString: d('', function () { return this.__name__; }) +}); + +// Proper implementation of methods exposed on Symbol.prototype +// They won't be accessible on produced symbol instances as they derive from HiddenSymbol.prototype +defineProperties(SymbolPolyfill.prototype, { + toString: d(function () { return 'Symbol (' + validateSymbol(this).__description__ + ')'; }), + valueOf: d(function () { return validateSymbol(this); }) +}); +defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toPrimitive, d('', function () { + var symbol = validateSymbol(this); + if (typeof symbol === 'symbol') return symbol; + return symbol.toString(); +})); +defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toStringTag, d('c', 'Symbol')); + +// Proper implementaton of toPrimitive and toStringTag for returned symbol instances +defineProperty(HiddenSymbol.prototype, SymbolPolyfill.toStringTag, + d('c', SymbolPolyfill.prototype[SymbolPolyfill.toStringTag])); + +// Note: It's important to define `toPrimitive` as last one, as some implementations +// implement `toPrimitive` natively without implementing `toStringTag` (or other specified symbols) +// And that may invoke error in definition flow: +// See: https://github.com/medikoo/es6-symbol/issues/13#issuecomment-164146149 +defineProperty(HiddenSymbol.prototype, SymbolPolyfill.toPrimitive, + d('c', SymbolPolyfill.prototype[SymbolPolyfill.toPrimitive])); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/test/implement.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/test/implement.js new file mode 100644 index 00000000..eb35c301 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/test/implement.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof Symbol, 'function'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/test/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/test/index.js new file mode 100644 index 00000000..62b3296d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/test/index.js @@ -0,0 +1,12 @@ +'use strict'; + +var d = require('d') + + , defineProperty = Object.defineProperty; + +module.exports = function (T, a) { + var symbol = T('test'), x = {}; + defineProperty(x, symbol, d('foo')); + a(x.test, undefined, "Name"); + a(x[symbol], 'foo', "Get"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/test/is-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/test/is-implemented.js new file mode 100644 index 00000000..bb0d6453 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/test/is-implemented.js @@ -0,0 +1,14 @@ +'use strict'; + +var global = require('es5-ext/global') + , polyfill = require('../polyfill'); + +module.exports = function (t, a) { + var cache; + a(typeof t(), 'boolean'); + cache = global.Symbol; + global.Symbol = polyfill; + a(t(), true); + if (cache === undefined) delete global.Symbol; + else global.Symbol = cache; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/test/is-native-implemented.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/test/is-native-implemented.js new file mode 100644 index 00000000..df8ba032 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/test/is-native-implemented.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (t, a) { a(typeof t, 'boolean'); }; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/test/is-symbol.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/test/is-symbol.js new file mode 100644 index 00000000..ac24b9ab --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/test/is-symbol.js @@ -0,0 +1,16 @@ +'use strict'; + +var SymbolPoly = require('../polyfill'); + +module.exports = function (t, a) { + a(t(undefined), false, "Undefined"); + a(t(null), false, "Null"); + a(t(true), false, "Primitive"); + a(t('raz'), false, "String"); + a(t({}), false, "Object"); + a(t([]), false, "Array"); + if (typeof Symbol !== 'undefined') { + a(t(Symbol()), true, "Native"); + } + a(t(SymbolPoly()), true, "Polyfill"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/test/polyfill.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/test/polyfill.js new file mode 100644 index 00000000..8b657905 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/test/polyfill.js @@ -0,0 +1,29 @@ +'use strict'; + +var d = require('d') + , isSymbol = require('../is-symbol') + + , defineProperty = Object.defineProperty; + +module.exports = function (T, a) { + var symbol = T('test'), x = {}; + defineProperty(x, symbol, d('foo')); + a(x.test, undefined, "Name"); + a(x[symbol], 'foo', "Get"); + a(x instanceof T, false); + + a(isSymbol(symbol), true, "Symbol"); + a(isSymbol(T.iterator), true, "iterator"); + a(isSymbol(T.toStringTag), true, "toStringTag"); + + x = {}; + x[symbol] = 'foo'; + if (typeof symbol !== 'symbol') { + a.deep(Object.getOwnPropertyDescriptor(x, symbol), { configurable: true, enumerable: false, + value: 'foo', writable: true }); + } + symbol = T.for('marko'); + a(isSymbol(symbol), true); + a(T.for('marko'), symbol); + a(T.keyFor(symbol), 'marko'); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/test/validate-symbol.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/test/validate-symbol.js new file mode 100644 index 00000000..2c8f84c8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/test/validate-symbol.js @@ -0,0 +1,19 @@ +'use strict'; + +var SymbolPoly = require('../polyfill'); + +module.exports = function (t, a) { + var symbol; + a.throws(function () { t(undefined); }, TypeError, "Undefined"); + a.throws(function () { t(null); }, TypeError, "Null"); + a.throws(function () { t(true); }, TypeError, "Primitive"); + a.throws(function () { t('raz'); }, TypeError, "String"); + a.throws(function () { t({}); }, TypeError, "Object"); + a.throws(function () { t([]); }, TypeError, "Array"); + if (typeof Symbol !== 'undefined') { + symbol = Symbol(); + a(t(symbol), symbol, "Native"); + } + symbol = SymbolPoly(); + a(t(symbol), symbol, "Polyfill"); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/validate-symbol.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/validate-symbol.js new file mode 100644 index 00000000..42750043 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/validate-symbol.js @@ -0,0 +1,8 @@ +'use strict'; + +var isSymbol = require('./is-symbol'); + +module.exports = function (value) { + if (!isSymbol(value)) throw new TypeError(value + " is not a symbol"); + return value; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/package.json new file mode 100644 index 00000000..7ee8a118 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/package.json @@ -0,0 +1,60 @@ +{ + "name": "array-index", + "description": "Invoke getter/setter functions on array-like objects", + "keywords": [ + "index", + "array", + "getter", + "setter", + "proxy" + ], + "version": "1.0.0", + "license": "MIT", + "author": { + "name": "Nathan Rajlich", + "email": "nathan@tootallnate.net", + "url": "http://tootallnate.net" + }, + "repository": { + "type": "git", + "url": "git://github.com/TooTallNate/array-index.git" + }, + "main": "index.js", + "scripts": { + "test": "node test" + }, + "dependencies": { + "debug": "^2.2.0", + "es6-symbol": "^3.0.2" + }, + "engines": { + "node": "*" + }, + "gitHead": "4b3cc059c70eefd8ef2a0d4213d681b671eb3d11", + "bugs": { + "url": "https://github.com/TooTallNate/array-index/issues" + }, + "homepage": "https://github.com/TooTallNate/array-index#readme", + "_id": "array-index@1.0.0", + "_shasum": "ec56a749ee103e4e08c790b9c353df16055b97f9", + "_from": "array-index@>=1.0.0 <2.0.0", + "_npmVersion": "3.3.12", + "_nodeVersion": "5.3.0", + "_npmUser": { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + }, + "maintainers": [ + { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + } + ], + "dist": { + "shasum": "ec56a749ee103e4e08c790b9c353df16055b97f9", + "tarball": "https://registry.npmjs.org/array-index/-/array-index-1.0.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/array-index/-/array-index-1.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/test.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/test.js new file mode 100644 index 00000000..65ff607f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/test.js @@ -0,0 +1,110 @@ +var ArrayIndex = require('./') +var inherits = require('util').inherits +var assert = require('assert') + + +/** + * Create a "subclass". + */ + +function Arrayish (length) { + ArrayIndex.call(this, length) + this.sets = Object.create(null) +} + +// inherit from `ArrayIndex` +inherits(Arrayish, ArrayIndex) + + +// create an instance and run some tests +var a = new Arrayish(11) +assert.equal(a.length, 11); + +assert.throws(function () { + a[0] +}, /you must implement the `ArrayIndex.get` Symbol/) + +assert.throws(function () { + a[0] = 0 +}, /you must implement the `ArrayIndex.set` Symbol/) + + +/** + * This "getter" function checks if the index has previosly been "set", and if so + * returns the index * the value previously set. If the index hasn't been set, + * return the index as-is. + */ + +Arrayish.prototype[ArrayIndex.get] = function get (index) { + if (index in this.sets) { + return +this.sets[index] * index + } else { + return index + } +} + +/** + * Store the last value set for this index. + */ + +Arrayish.prototype[ArrayIndex.set] = function set (index, value) { + this.sets[index] = value +} + + +// test getters without being "set" +assert.equal(0, a[0]) +assert.equal(1, a[1]) +assert.equal(2, a[2]) +assert.equal(3, a[3]) +assert.equal(4, a[4]) + +// test setters, followed by getters +a[10] = 1 +assert.equal(10, a[10]) +a[10] = 2 +assert.equal(20, a[10]) +a[10] = 3 +assert.equal(30, a[10]) + +// test "length" +assert.equal(11, a.length) + +a[4] = 20 +a[6] = 5.55432 +var b = [0, 1, 2, 3, 80, 5, 33.325919999999996, 7, 8, 9, 30] +assert.equal(JSON.stringify(b), JSON.stringify(a)) + + +/** + * It should work when invoking as a Mixin. + */ + +function Foo () { + ArrayIndex.call(this, 5); +} +var f = new Foo(); + +// these throw because there's no __get__ and __set__ function defined +assert.throws(function () { + f[0]; +}); +assert.throws(function () { + f[0] = 0 +}); + +f[ArrayIndex.get] = function (index) { + return index * 2; +}; + +assert.equal(f[0], 0); +assert.equal(f[1], 2); +assert.equal(f[2], 4); +assert.equal(f[3], 6); + +f[ArrayIndex.set] = function (index, value) { + this['foo' + index] = value; +}; + +f[1] = 'bar'; +assert.equal(f.foo1, 'bar'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/package.json new file mode 100644 index 00000000..27de24ba --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/package.json @@ -0,0 +1,57 @@ +{ + "name": "path-array", + "version": "1.0.1", + "description": "Treat your $PATH like a JavaScript Array", + "main": "index.js", + "scripts": { + "test": "mocha --reporter spec" + }, + "repository": { + "type": "git", + "url": "git://github.com/TooTallNate/node-path-array.git" + }, + "keywords": [ + "PATH", + "env", + "array" + ], + "author": { + "name": "Nathan Rajlich", + "email": "nathan@tootallnate.net", + "url": "http://n8.io/" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/TooTallNate/node-path-array/issues" + }, + "homepage": "https://github.com/TooTallNate/node-path-array", + "dependencies": { + "array-index": "^1.0.0" + }, + "devDependencies": { + "mocha": "~1.16.1" + }, + "gitHead": "d249bd897661ca60720218edabbfeaa73c67778a", + "_id": "path-array@1.0.1", + "_shasum": "7e2f0f35f07a2015122b868b7eac0eb2c4fec271", + "_from": "path-array@>=1.0.0 <2.0.0", + "_npmVersion": "3.3.12", + "_nodeVersion": "5.3.0", + "_npmUser": { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + }, + "maintainers": [ + { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + } + ], + "dist": { + "shasum": "7e2f0f35f07a2015122b868b7eac0eb2c4fec271", + "tarball": "https://registry.npmjs.org/path-array/-/path-array-1.0.1.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/path-array/-/path-array-1.0.1.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/test/test.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/test/test.js new file mode 100644 index 00000000..fc1f3736 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/test/test.js @@ -0,0 +1,68 @@ + +/** + * Module dependencies. + */ + +var assert = require('assert'); +var PathArray = require('../'); +var delimiter = require('path').delimiter || ':'; + +describe('PathArray', function () { + it('should use `process.env` by default', function () { + var p = new PathArray(); + assert.equal(p._env, process.env); + }); + it('should return the $PATH string for .toString()', function () { + var p = new PathArray(); + assert.equal(p.toString(), process.env.PATH); + }); + it('should accept an arbitrary `env` object', function () { + var env = { PATH: '/foo' + delimiter + '/bar' }; + var p = new PathArray(env); + assert.equal(p.toString(), env.PATH); + }); + it('should work for [n] getter syntax', function () { + var env = { PATH: '/foo' + delimiter + '/bar' }; + var p = new PathArray(env); + assert.equal('/foo', p[0]); + assert.equal('/bar', p[1]); + }); + it('should work for [n]= setter syntax', function () { + var env = { PATH: '/foo' + delimiter + '/bar' }; + var p = new PathArray(env); + p[0] = '/baz'; + assert.equal('/baz' + delimiter + '/bar', env.PATH); + }); + it('should work with .push()', function () { + var env = { PATH: '/foo' + delimiter + '/bar' }; + var p = new PathArray(env); + p.push('/baz'); + assert.equal('/foo' + delimiter + '/bar' + delimiter + '/baz', env.PATH); + }); + it('should work with .shift()', function () { + var env = { PATH: '/foo' + delimiter + '/bar' }; + var p = new PathArray(env); + assert.equal('/foo', p.shift()); + assert.equal('/bar', env.PATH); + }); + it('should work with .pop()', function () { + var env = { PATH: '/foo' + delimiter + '/bar' }; + var p = new PathArray(env); + assert.equal('/bar', p.pop()); + assert.equal('/foo', env.PATH); + }); + it('should work with .unshift()', function () { + var env = { PATH: '/foo' + delimiter + '/bar' }; + var p = new PathArray(env); + p.unshift('/baz'); + assert.equal('/baz' + delimiter + '/foo' + delimiter + '/bar', env.PATH); + }); + it('should be able to specify property name to use with second argument', function () { + var env = { PYTHONPATH: '/foo' }; + var p = new PathArray(env, 'PYTHONPATH'); + assert.equal(1, p.length); + p.push('/baz'); + assert.equal(2, p.length); + assert.equal('/foo' + delimiter + '/baz', env.PYTHONPATH); + }); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/package.json new file mode 100644 index 00000000..c4fb21f7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/package.json @@ -0,0 +1,109 @@ +{ + "name": "node-gyp", + "description": "Node.js native addon build tool", + "license": "MIT", + "keywords": [ + "native", + "addon", + "module", + "c", + "c++", + "bindings", + "gyp" + ], + "version": "3.4.0", + "installVersion": 9, + "author": { + "name": "Nathan Rajlich", + "email": "nathan@tootallnate.net", + "url": "http://tootallnate.net" + }, + "repository": { + "type": "git", + "url": "git://github.com/nodejs/node-gyp.git" + }, + "preferGlobal": true, + "bin": { + "node-gyp": "./bin/node-gyp.js" + }, + "main": "./lib/node-gyp.js", + "dependencies": { + "fstream": "^1.0.0", + "glob": "^7.0.3", + "graceful-fs": "^4.1.2", + "minimatch": "^3.0.2", + "mkdirp": "^0.5.0", + "nopt": "2 || 3", + "npmlog": "0 || 1 || 2 || 3", + "osenv": "0", + "path-array": "^1.0.0", + "request": "2", + "rimraf": "2", + "semver": "2.x || 3.x || 4 || 5", + "tar": "^2.0.0", + "which": "1" + }, + "engines": { + "node": ">= 0.8.0" + }, + "devDependencies": { + "tape": "~4.2.0", + "bindings": "~1.2.1", + "nan": "^2.0.0", + "require-inject": "~1.3.0" + }, + "scripts": { + "test": "tape test/test-*" + }, + "gitHead": "d460084b241c427655497a1de4ed351a13ffb47f", + "bugs": { + "url": "https://github.com/nodejs/node-gyp/issues" + }, + "homepage": "https://github.com/nodejs/node-gyp#readme", + "_id": "node-gyp@3.4.0", + "_shasum": "dda558393b3ecbbe24c9e6b8703c71194c63fa36", + "_from": "node-gyp@3.4.0", + "_npmVersion": "3.9.3", + "_nodeVersion": "6.2.1", + "_npmUser": { + "name": "rvagg", + "email": "rod@vagg.org" + }, + "maintainers": [ + { + "name": "TooTallNate", + "email": "nathan@tootallnate.net" + }, + { + "name": "bnoordhuis", + "email": "info@bnoordhuis.nl" + }, + { + "name": "fishrock123", + "email": "fishrock123@rocketmail.com" + }, + { + "name": "isaacs", + "email": "i@izs.me" + }, + { + "name": "rvagg", + "email": "rod@vagg.org" + }, + { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + } + ], + "dist": { + "shasum": "dda558393b3ecbbe24c9e6b8703c71194c63fa36", + "tarball": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.4.0.tgz" + }, + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/node-gyp-3.4.0.tgz_1467079381888_0.1804589256644249" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.4.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/src/win_delay_load_hook.cc b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/src/win_delay_load_hook.cc new file mode 100644 index 00000000..e75954b6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/src/win_delay_load_hook.cc @@ -0,0 +1,36 @@ +/* + * When this file is linked to a DLL, it sets up a delay-load hook that + * intervenes when the DLL is trying to load 'node.exe' or 'iojs.exe' + * dynamically. Instead of trying to locate the .exe file it'll just return + * a handle to the process image. + * + * This allows compiled addons to work when node.exe or iojs.exe is renamed. + */ + +#ifdef _MSC_VER + +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif + +#include + +#include +#include + +static FARPROC WINAPI load_exe_hook(unsigned int event, DelayLoadInfo* info) { + HMODULE m; + if (event != dliNotePreLoadLibrary) + return NULL; + + if (_stricmp(info->szDll, "iojs.exe") != 0 && + _stricmp(info->szDll, "node.exe") != 0) + return NULL; + + m = GetModuleHandle(NULL); + return (FARPROC) m; +} + +decltype(__pfnDliNotifyHook2) __pfnDliNotifyHook2 = load_exe_hook; + +#endif diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/test/docker.sh b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/test/docker.sh new file mode 100644 index 00000000..ac21aa8d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/test/docker.sh @@ -0,0 +1,164 @@ +#!/bin/bash + +#set -e + +test_node_versions="0.8.28 0.10.40 0.12.7 4.3.0 5.6.0" +test_iojs_versions="1.8.4 2.4.0 3.3.0" + +myuid=$(id -u) +mygid=$(id -g) +__dirname="$(CDPATH= cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +dot_node_gyp=${__dirname}/.node-gyp/ + +# borrows from https://github.com/rvagg/dnt/ + +# Simple setup function for a container: +# setup_container(image id, base image, commands to run to set up) +setup_container() { + local container_id="$1" + local base_container="$2" + local run_cmd="$3" + + # Does this image exist? If yes, ignore + docker inspect "$container_id" &> /dev/null + if [[ $? -eq 0 ]]; then + echo "Found existing container [$container_id]" + else + # No such image, so make it + echo "Did not find container [$container_id], creating..." + docker run -i $base_container /bin/bash -c "$run_cmd" + sleep 2 + docker commit $(docker ps -l -q) $container_id + fi +} + +# Run tests inside each of the versioned containers, copy cwd into npm's copy of node-gyp +# so it'll be invoked by npm when a compile is needed +# run_tests(version, test-commands) +run_tests() { + local version="$1" + local run_cmd="$2" + + run_cmd="rsync -aAXx --delete --exclude .git --exclude build /node-gyp-src/ /usr/lib/node_modules/npm/node_modules/node-gyp/; + /bin/su -s /bin/bash node-gyp -c 'cd && ${run_cmd}'" + + rm -rf $dot_node_gyp + mkdir $dot_node_gyp + + docker run \ + --rm -i \ + -v ~/.npm/:/node-gyp/.npm/ \ + -v ${dot_node_gyp}:/node-gyp/.node-gyp/ \ + -v $(pwd):/node-gyp-src/:ro \ + node-gyp-test/${version} /bin/bash -c "${run_cmd}" +} + +# A base image with build tools and a user account +setup_container "node-gyp-test/base" "ubuntu:14.04" " + adduser --gecos node-gyp --home /node-gyp/ --disabled-login node-gyp --uid $myuid && + echo "node-gyp:node-gyp" | chpasswd && + apt-get update && + apt-get install -y build-essential python git rsync curl +" + +# An image on top of the base containing clones of repos we want to use for testing +setup_container "node-gyp-test/clones" "node-gyp-test/base" " + cd /node-gyp/ && git clone https://github.com/justmoon/node-bignum.git && + cd /node-gyp/ && git clone https://github.com/bnoordhuis/node-buffertools.git && + chown -R node-gyp.node-gyp /node-gyp/ +" + +# An image for each of the node versions we want to test with that version installed and the latest npm +for v in $test_node_versions; do + setup_container "node-gyp-test/${v}" "node-gyp-test/clones" " + curl -sL https://nodejs.org/dist/v${v}/node-v${v}-linux-x64.tar.gz | tar -zxv --strip-components=1 -C /usr/ && + npm install npm@latest -g && + node -v && npm -v + " +done + +# An image for each of the io.js versions we want to test with that version installed and the latest npm +for v in $test_iojs_versions; do + setup_container "node-gyp-test/${v}" "node-gyp-test/clones" " + curl -sL https://iojs.org/dist/v${v}/iojs-v${v}-linux-x64.tar.gz | tar -zxv --strip-components=1 -C /usr/ && + npm install npm@latest -g && + node -v && npm -v + " +done + +# Run the tests for all of the test images we've created, +# we should see node-gyp doing its download, configure and run thing +# _NOTE: bignum doesn't compile on 0.8 currently so it'll fail for that version only_ +for v in $test_node_versions $test_iojs_versions; do + run_tests $v " + cd node-buffertools && npm install --loglevel=info && npm test && cd + " + # removed for now, too noisy: cd node-bignum && npm install --loglevel=info && npm test +done + +# Test use of --target=x.y.z to compile against alternate versions +test_download_node_version() { + local run_with_ver="$1" + local expected_dir="$2" + local expected_ver="$3" + run_tests $run_with_ver "cd node-buffertools && npm install --loglevel=info --target=${expected_ver}" + local node_ver=$(cat "${dot_node_gyp}${expected_dir}/node_version.h" | grep '#define NODE_\w*_VERSION [0-9]*$') + node_ver=$(echo $node_ver | sed 's/#define NODE_[A-Z]*_VERSION //g' | sed 's/ /./g') + if [ "X$(echo $node_ver)" != "X${expected_ver}" ]; then + echo "Did not download v${expected_ver} using --target, instead got: $(echo $node_ver)" + exit 1 + fi + echo "Verified correct download of [v${node_ver}]" +} + +test_download_node_version "0.12.7" "0.10.30/src" "0.10.30" +test_download_node_version "3.3.0" "iojs-1.8.4/src" "1.8.4" +# should download the headers file +test_download_node_version "3.3.0" "iojs-3.3.0/include/node" "3.3.0" +test_download_node_version "4.3.0" "4.3.0/include/node" "4.3.0" +test_download_node_version "5.6.0" "5.6.0/include/node" "5.6.0" + +# TODO: test --dist-url by starting up a localhost server and serving up tarballs + +# testing --dist-url, using simple-proxy.js to make localhost work as a distribution +# point for tarballs +# we can test whether it uses the proxy because after 2 connections the proxy will +# die and therefore should not be running at the end of the test, `nc` can tell us this +run_tests "3.3.0" " + (node /node-gyp-src/test/simple-proxy.js 8080 /foobar/ https://iojs.org/dist/ &) && + cd node-buffertools && + /node-gyp-src/bin/node-gyp.js --loglevel=info --dist-url=http://localhost:8080/foobar/ rebuild && + nc -z localhost 8080 && echo -e \"\\n\\n\\033[31mFAILED TO USE LOCAL PROXY\\033[39m\\n\\n\" +" + +# REMOVE after next semver-major +run_tests "3.3.0" " + (node /node-gyp-src/test/simple-proxy.js 8080 /doobar/ https://iojs.org/dist/ &) && + cd node-buffertools && + NVM_IOJS_ORG_MIRROR=http://localhost:8080/doobar/ /node-gyp-src/bin/node-gyp.js --loglevel=info rebuild && + nc -z localhost 8080 && echo -e \"\\n\\n\\033[31mFAILED TO USE LOCAL PROXY\\033[39m\\n\\n\" +" + +# REMOVE after next semver-major +run_tests "0.12.7" " + (node /node-gyp-src/test/simple-proxy.js 8080 /boombar/ https://nodejs.org/dist/ &) && + cd node-buffertools && + NVM_NODEJS_ORG_MIRROR=http://localhost:8080/boombar/ /node-gyp-src/bin/node-gyp.js --loglevel=info rebuild && + nc -z localhost 8080 && echo -e \"\\n\\n\\033[31mFAILED TO USE LOCAL PROXY\\033[39m\\n\\n\" +" + +run_tests "3.3.0" " + (node /node-gyp-src/test/simple-proxy.js 8080 /doobar/ https://iojs.org/dist/ &) && + cd node-buffertools && + IOJS_ORG_MIRROR=http://localhost:8080/doobar/ /node-gyp-src/bin/node-gyp.js --loglevel=info rebuild && + nc -z localhost 8080 && echo -e \"\\n\\n\\033[31mFAILED TO USE LOCAL PROXY\\033[39m\\n\\n\" +" + +run_tests "0.12.7" " + (node /node-gyp-src/test/simple-proxy.js 8080 /boombar/ https://nodejs.org/dist/ &) && + cd node-buffertools && + NODEJS_ORG_MIRROR=http://localhost:8080/boombar/ /node-gyp-src/bin/node-gyp.js --loglevel=info rebuild && + nc -z localhost 8080 && echo -e \"\\n\\n\\033[31mFAILED TO USE LOCAL PROXY\\033[39m\\n\\n\" +" + +rm -rf $dot_node_gyp diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/test/fixtures/ca-bundle.crt b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/test/fixtures/ca-bundle.crt new file mode 100644 index 00000000..fb1dea98 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/test/fixtures/ca-bundle.crt @@ -0,0 +1,40 @@ +-----BEGIN CERTIFICATE----- +MIIDJjCCAg4CAhnOMA0GCSqGSIb3DQEBBQUAMH0xCzAJBgNVBAYTAlVTMQswCQYD +VQQIDAJDQTEWMBQGA1UEBwwNU2FuIEZyYW5jaXNjbzEZMBcGA1UECgwQU3Ryb25n +TG9vcCwgSW5jLjESMBAGA1UECwwJU3Ryb25nT3BzMRowGAYDVQQDDBFjYS5zdHJv +bmdsb29wLmNvbTAeFw0xNTEyMDgyMzM1MzNaFw00MzA0MjQyMzM1MzNaMBkxFzAV +BgNVBAMMDnN0cm9uZ2xvb3AuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB +CgKCAQEAwOYI7OZ2FX/YjRgLZoDQlbPc5UZXU/j0e1wwiJNPtPEax9Y5Uoza0Pnt +Ikzkc2SfvQ+IJrhXo385tI0W5juuqbHnE7UrjUuPjUX6NHevkxcs/flmjan5wnZM +cPsGhH71WDuUEEflvZihf2Se2x+xgZtMhc5XGmVmRuZFYKvkgUhA2/w8/QrK+jPT +n9QRJxZjWNh2RBdC1B7u4jffSmOSUljYFH1I2eTeY+Rdi6YUIYSU9gEoZxsv3Tia +SomfMF5jt2Mouo6MzA+IhLvvFjcrcph1Qxgi9RkfdCMMd+Ipm9YWELkyG1bDRpQy +0iyHD4gvVsAqz1Y2KdRSdc3Kt+nTqwIDAQABoxkwFzAVBgNVHREEDjAMhwQAAAAA +hwR/AAABMA0GCSqGSIb3DQEBBQUAA4IBAQAhy4J0hML3NgmDRHdL5/iTucBe22Mf +jJjg2aifD1S187dHm+Il4qZNO2plWwAhN0h704f+8wpsaALxUvBIu6nvlvcMP5PH +jGN5JLe2Km3UaPvYOQU2SgacLilu+uBcIo2JSHLV6O7ziqUj5Gior6YxDLCtEZie +Ea8aX5/YjuACtEMJ1JjRqjgkM66XAoUe0E8onOK3FgTIO3tGoTJwRp0zS50pFuP0 +PsZtT04ck6mmXEXXknNoAyBCvPypfms9OHqcUIW9fiQnrGbS/Ri4QSQYj0DtFk/1 +na4fY1gf3zTHxH8259b/TOOaPfTnCEsOQtjUrWNR4xhmVZ+HJy4yytUW +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDbzCCAlcCAmm6MA0GCSqGSIb3DQEBCwUAMH0xCzAJBgNVBAYTAlVTMQswCQYD +VQQIDAJDQTEWMBQGA1UEBwwNU2FuIEZyYW5jaXNjbzEZMBcGA1UECgwQU3Ryb25n +TG9vcCwgSW5jLjESMBAGA1UECwwJU3Ryb25nT3BzMRowGAYDVQQDDBFjYS5zdHJv +bmdsb29wLmNvbTAeFw0xNTEyMDgyMzM1MzNaFw00MzA0MjQyMzM1MzNaMH0xCzAJ +BgNVBAYTAlVTMQswCQYDVQQIDAJDQTEWMBQGA1UEBwwNU2FuIEZyYW5jaXNjbzEZ +MBcGA1UECgwQU3Ryb25nTG9vcCwgSW5jLjESMBAGA1UECwwJU3Ryb25nT3BzMRow +GAYDVQQDDBFjYS5zdHJvbmdsb29wLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEP +ADCCAQoCggEBANfj86jkvvYDjHBgiqWhk9Cj+bqiMq3MqnV0CBO4iuK33Fo6XssE +H+yVdXlIBFbFe6t655MdBVOR2Sfj7WqNh96vhu6PyDHiwcQlTaiLU6nhIed1J4Wv +lvnJHFmp8Wbtx5AgLT4UYu03ftvXEl2DLi3vhSL2tRM1ebXHB/KPbRWkb25DPX0P +foOHot3f2dgNe2x6kponf7E/QDmAu3s7Nlkfh+ryDhgGU7wocXEhXbprNqRqOGNo +xbXgUI+/9XDxYT/7Gn5LF/fPjtN+aB0SKMnTsDhprVlZie83mlqJ46fOOrR+vrsQ +mi/1m/TadrARtZoIExC/cQRdVM05EK4tUa8CAwEAATANBgkqhkiG9w0BAQsFAAOC +AQEAQ7k5WhyhDTIGYCNzRnrMHWSzGqa1y4tJMW06wafJNRqTm1cthq1ibc6Hfq5a +K10K0qMcgauRTfQ1MWrVCTW/KnJ1vkhiTOH+RvxapGn84gSaRmV6KZen0+gMsgae +KEGe/3Hn+PmDVV+PTamHgPACfpTww38WHIe/7Ce9gHfG7MZ8cKHNZhDy0IAYPln+ +YRwMLd7JNQffHAbWb2CE1mcea4H/12U8JZW5tHCF6y9V+7IuDzqwIrLKcW3lG17n +VUG6ODF/Ryqn3V5X+TL91YyXi6c34y34IpC7MQDV/67U7+5Bp5CfeDPWW2wVSrW+ +uGZtfEvhbNm6m2i4UNmpCXxUZQ== +-----END CERTIFICATE----- diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/test/fixtures/ca.crt b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/test/fixtures/ca.crt new file mode 100644 index 00000000..9d2755a7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/test/fixtures/ca.crt @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MIIDbzCCAlcCAmm6MA0GCSqGSIb3DQEBCwUAMH0xCzAJBgNVBAYTAlVTMQswCQYD +VQQIDAJDQTEWMBQGA1UEBwwNU2FuIEZyYW5jaXNjbzEZMBcGA1UECgwQU3Ryb25n +TG9vcCwgSW5jLjESMBAGA1UECwwJU3Ryb25nT3BzMRowGAYDVQQDDBFjYS5zdHJv +bmdsb29wLmNvbTAeFw0xNTEyMDgyMzM1MzNaFw00MzA0MjQyMzM1MzNaMH0xCzAJ +BgNVBAYTAlVTMQswCQYDVQQIDAJDQTEWMBQGA1UEBwwNU2FuIEZyYW5jaXNjbzEZ +MBcGA1UECgwQU3Ryb25nTG9vcCwgSW5jLjESMBAGA1UECwwJU3Ryb25nT3BzMRow +GAYDVQQDDBFjYS5zdHJvbmdsb29wLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEP +ADCCAQoCggEBANfj86jkvvYDjHBgiqWhk9Cj+bqiMq3MqnV0CBO4iuK33Fo6XssE +H+yVdXlIBFbFe6t655MdBVOR2Sfj7WqNh96vhu6PyDHiwcQlTaiLU6nhIed1J4Wv +lvnJHFmp8Wbtx5AgLT4UYu03ftvXEl2DLi3vhSL2tRM1ebXHB/KPbRWkb25DPX0P +foOHot3f2dgNe2x6kponf7E/QDmAu3s7Nlkfh+ryDhgGU7wocXEhXbprNqRqOGNo +xbXgUI+/9XDxYT/7Gn5LF/fPjtN+aB0SKMnTsDhprVlZie83mlqJ46fOOrR+vrsQ +mi/1m/TadrARtZoIExC/cQRdVM05EK4tUa8CAwEAATANBgkqhkiG9w0BAQsFAAOC +AQEAQ7k5WhyhDTIGYCNzRnrMHWSzGqa1y4tJMW06wafJNRqTm1cthq1ibc6Hfq5a +K10K0qMcgauRTfQ1MWrVCTW/KnJ1vkhiTOH+RvxapGn84gSaRmV6KZen0+gMsgae +KEGe/3Hn+PmDVV+PTamHgPACfpTww38WHIe/7Ce9gHfG7MZ8cKHNZhDy0IAYPln+ +YRwMLd7JNQffHAbWb2CE1mcea4H/12U8JZW5tHCF6y9V+7IuDzqwIrLKcW3lG17n +VUG6ODF/Ryqn3V5X+TL91YyXi6c34y34IpC7MQDV/67U7+5Bp5CfeDPWW2wVSrW+ +uGZtfEvhbNm6m2i4UNmpCXxUZQ== +-----END CERTIFICATE----- diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/test/fixtures/server.crt b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/test/fixtures/server.crt new file mode 100644 index 00000000..fe13bb96 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/test/fixtures/server.crt @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDJjCCAg4CAhnOMA0GCSqGSIb3DQEBBQUAMH0xCzAJBgNVBAYTAlVTMQswCQYD +VQQIDAJDQTEWMBQGA1UEBwwNU2FuIEZyYW5jaXNjbzEZMBcGA1UECgwQU3Ryb25n +TG9vcCwgSW5jLjESMBAGA1UECwwJU3Ryb25nT3BzMRowGAYDVQQDDBFjYS5zdHJv +bmdsb29wLmNvbTAeFw0xNTEyMDgyMzM1MzNaFw00MzA0MjQyMzM1MzNaMBkxFzAV +BgNVBAMMDnN0cm9uZ2xvb3AuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB +CgKCAQEAwOYI7OZ2FX/YjRgLZoDQlbPc5UZXU/j0e1wwiJNPtPEax9Y5Uoza0Pnt +Ikzkc2SfvQ+IJrhXo385tI0W5juuqbHnE7UrjUuPjUX6NHevkxcs/flmjan5wnZM +cPsGhH71WDuUEEflvZihf2Se2x+xgZtMhc5XGmVmRuZFYKvkgUhA2/w8/QrK+jPT +n9QRJxZjWNh2RBdC1B7u4jffSmOSUljYFH1I2eTeY+Rdi6YUIYSU9gEoZxsv3Tia +SomfMF5jt2Mouo6MzA+IhLvvFjcrcph1Qxgi9RkfdCMMd+Ipm9YWELkyG1bDRpQy +0iyHD4gvVsAqz1Y2KdRSdc3Kt+nTqwIDAQABoxkwFzAVBgNVHREEDjAMhwQAAAAA +hwR/AAABMA0GCSqGSIb3DQEBBQUAA4IBAQAhy4J0hML3NgmDRHdL5/iTucBe22Mf +jJjg2aifD1S187dHm+Il4qZNO2plWwAhN0h704f+8wpsaALxUvBIu6nvlvcMP5PH +jGN5JLe2Km3UaPvYOQU2SgacLilu+uBcIo2JSHLV6O7ziqUj5Gior6YxDLCtEZie +Ea8aX5/YjuACtEMJ1JjRqjgkM66XAoUe0E8onOK3FgTIO3tGoTJwRp0zS50pFuP0 +PsZtT04ck6mmXEXXknNoAyBCvPypfms9OHqcUIW9fiQnrGbS/Ri4QSQYj0DtFk/1 +na4fY1gf3zTHxH8259b/TOOaPfTnCEsOQtjUrWNR4xhmVZ+HJy4yytUW +-----END CERTIFICATE----- diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/test/fixtures/server.key b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/test/fixtures/server.key new file mode 100644 index 00000000..f8227f4c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/test/fixtures/server.key @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDA5gjs5nYVf9iN +GAtmgNCVs9zlRldT+PR7XDCIk0+08RrH1jlSjNrQ+e0iTORzZJ+9D4gmuFejfzm0 +jRbmO66psecTtSuNS4+NRfo0d6+TFyz9+WaNqfnCdkxw+waEfvVYO5QQR+W9mKF/ +ZJ7bH7GBm0yFzlcaZWZG5kVgq+SBSEDb/Dz9Csr6M9Of1BEnFmNY2HZEF0LUHu7i +N99KY5JSWNgUfUjZ5N5j5F2LphQhhJT2AShnGy/dOJpKiZ8wXmO3Yyi6jozMD4iE +u+8WNytymHVDGCL1GR90Iwx34imb1hYQuTIbVsNGlDLSLIcPiC9WwCrPVjYp1FJ1 +zcq36dOrAgMBAAECggEACg60Xm2xsHNG/ixHw+NpfLSxCr89JGKxlJD88tIDcOK1 +S8AOoxA3BHhTddteeenALmJV7fbkkuC6SICmtgBcnfppmuxyRd6vsGT6o6ut2tR1 +gxRy1WYMYKg8WhOshlH8RspscODeyKDhorvDUJd5cNGBDuTwQ68PwxiUe3La6iac +EVQoKohg9EmRIhMF1i8I00zXE8p3XENrlTc491ipc+gLPIP5vtqHyQztEUkZHkWd +dXbs+n1hGCr+4FxrphGYEW80HINzmume7dGChr8nvF4ZZcuWW13DJuNim6pQno1i +hM8VdXm8XphLh0XEGI5OCfu/CetkBILZRXKltZk6AQKBgQDoBqJzRlp7regYNU4q +usfS+43tPNaJ0o4DIzcLawqpmK/B/cZStzHl14Sm62BVkKV6cnWAJPeLkENPMFoV +7Q7wLZBJxpPzqXkpeiDkKN4Wovca891Rffne5Sz6IDB5mOxMjfKIEPd5RkmB5Lkp +qQLwm3YJ2AJcLagG/Gi1DFDRAQKBgQDU1G9T43Mjke6TXG0u7gCSb+VwyDRsrvJA +u2vy6+MANRc1EEF31YLmTKOU5XxUmhtIu7TUbgPoNi0HuRFXx4Zul3BPlAosLMJv +kNQbA/9d0YQAfSgTsploN5CX65dLZ4ejIzVgDZREzpIBWTze6YZTA2DT5iOIet84 +DD5DujY4qwKBgG0PuUo/9oYOD3tZiv1wwD5+uY6auykbTF9TLStzzBY9y9d+hrsY +mx6zOAoRtz1g+TdeF7b9KVJzo//T9XQ68nuYnyreaWrt7SK+4jj8sK+pOEd1+0Cz +20CXLpX/jWmKpP+y9R5aA0kA7cpdjV90rwoTuN8Vpr5XQ5TNDhaTzGUBAoGABYig +fGXlkH8y3NICZL37ddNC+/O4qTrDQbudyusnM9ItkEuj6CG9DY/gkPaGjQyUuQdo +ZD2YDGmcMh81vDqL3ERDv03yFcP0KkJxwWIRObdA32JhsGFsa7FGKS0O+f7vH+bC +dITl3gQg97gCRSl9PJtR4TCSq/HF7Acld01YK5ECgYEAwLFB5JIuxrowJe74cCMP +n5Rwuc8vWdOsg+ytvQTv0/hVCdzcaLet6YvagnWTWaU7PUwTFxZs/mLQ9CAWVutK +IRzs/GWxGFjH5xotDaJdDDzSdQye4tUqvUVxv7zzzsVycCPBYFkyRQ8Tmr5FLtUJ +Cl48TZ6J8Rx5avjdtOw3QC8= +-----END PRIVATE KEY----- diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/test/simple-proxy.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/test/simple-proxy.js new file mode 100644 index 00000000..e55330c4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/test/simple-proxy.js @@ -0,0 +1,24 @@ +var http = require('http') + , https = require('https') + , server = http.createServer(handler) + , port = +process.argv[2] + , prefix = process.argv[3] + , upstream = process.argv[4] + , calls = 0 + +server.listen(port) + +function handler (req, res) { + if (req.url.indexOf(prefix) != 0) + throw new Error('request url [' + req.url + '] does not start with [' + prefix + ']') + + var upstreamUrl = upstream + req.url.substring(prefix.length) + console.log(req.url + ' -> ' + upstreamUrl) + https.get(upstreamUrl, function (ures) { + ures.on('end', function () { + if (++calls == 2) + server.close() + }) + ures.pipe(res) + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/test/test-addon.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/test/test-addon.js new file mode 100644 index 00000000..c2a71f44 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/test/test-addon.js @@ -0,0 +1,28 @@ +'use strict' + +var test = require('tape') +var execFile = require('child_process').execFile +var path = require('path') +var addonPath = path.resolve(__dirname, 'node_modules', 'hello_world') +var nodeGyp = path.resolve(__dirname, '..', 'bin', 'node-gyp.js') + +test('build simple addon', function (t) { + t.plan(3) + + // Set the loglevel otherwise the output disappears when run via 'npm test' + var cmd = [nodeGyp, 'rebuild', '-C', addonPath, '--loglevel=verbose'] + var proc = execFile(process.execPath, cmd, function (err, stdout, stderr) { + var logLines = stderr.toString().trim().split(/\r?\n/) + var lastLine = logLines[logLines.length-1] + t.strictEqual(err, null) + t.strictEqual(lastLine, 'gyp info ok', 'should end in ok') + try { + var binding = require('hello_world') + t.strictEqual(binding.hello(), 'world') + } catch (error) { + t.error(error, 'load module') + } + }) + proc.stdout.setEncoding('utf-8') + proc.stderr.setEncoding('utf-8') +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/test/test-download.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/test/test-download.js new file mode 100644 index 00000000..6e6f64f0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/test/test-download.js @@ -0,0 +1,102 @@ +'use strict' + +var fs = require('fs') +var http = require('http') +var https = require('https') +var test = require('tape') +var install = require('../lib/install') + +test('download over http', function (t) { + t.plan(2) + + var server = http.createServer(function (req, res) { + t.strictEqual(req.headers['user-agent'], + 'node-gyp v42 (node ' + process.version + ')') + res.end('ok') + server.close() + }) + + var host = '127.0.0.1' + server.listen(0, host, function () { + var port = this.address().port + var gyp = { + opts: {}, + version: '42', + } + var url = 'http://' + host + ':' + port + var req = install.test.download(gyp, {}, url) + req.on('response', function (res) { + var body = '' + res.setEncoding('utf8') + res.on('data', function(data) { + body += data + }) + res.on('end', function() { + t.strictEqual(body, 'ok') + }) + }) + }) +}) + +test('download over https with custom ca', function (t) { + t.plan(3) + + var cert = fs.readFileSync(__dirname + '/fixtures/server.crt', 'utf8') + var key = fs.readFileSync(__dirname + '/fixtures/server.key', 'utf8') + + var cafile = __dirname + '/fixtures/ca.crt' + var ca = install.test.readCAFile(cafile) + t.strictEqual(ca.length, 1) + + var options = { ca: ca, cert: cert, key: key } + var server = https.createServer(options, function (req, res) { + t.strictEqual(req.headers['user-agent'], + 'node-gyp v42 (node ' + process.version + ')') + res.end('ok') + server.close() + }) + + server.on('clientError', function (err) { + throw err + }) + + var host = '127.0.0.1' + server.listen(8000, host, function () { + var port = this.address().port + var gyp = { + opts: { cafile: cafile }, + version: '42', + } + var url = 'https://' + host + ':' + port + var req = install.test.download(gyp, {}, url) + req.on('response', function (res) { + var body = '' + res.setEncoding('utf8') + res.on('data', function(data) { + body += data + }) + res.on('end', function() { + t.strictEqual(body, 'ok') + }) + }) + }) +}) + +test('download with missing cafile', function (t) { + t.plan(1) + var gyp = { + opts: { cafile: 'no.such.file' }, + } + try { + install.test.download(gyp, {}, 'http://bad/') + } catch (e) { + t.ok(/no.such.file/.test(e.message)) + } +}) + +test('check certificate splitting', function (t) { + var cas = install.test.readCAFile(__dirname + '/fixtures/ca-bundle.crt') + t.plan(2) + t.strictEqual(cas.length, 2) + t.notStrictEqual(cas[0], cas[1]) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/test/test-find-accessible-sync.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/test/test-find-accessible-sync.js new file mode 100644 index 00000000..d336243d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/test/test-find-accessible-sync.js @@ -0,0 +1,86 @@ +'use strict' + +var test = require('tape') +var path = require('path') +var requireInject = require('require-inject') +var configure = requireInject('../lib/configure', { + 'graceful-fs': { + 'closeSync': function (fd) { return undefined }, + 'openSync': function (path) { + if (readableFiles.some(function (f) { return f === path} )) { + return 0 + } else { + var error = new Error('ENOENT - not found') + throw error + } + } + } +}) + +var dir = path.sep + 'testdir' +var readableFile = 'readable_file' +var anotherReadableFile = 'another_readable_file' +var readableFileInDir = 'somedir' + path.sep + readableFile +var readableFiles = [ + path.resolve(dir, readableFile), + path.resolve(dir, anotherReadableFile), + path.resolve(dir, readableFileInDir) +] + +test('find accessible - empty array', function (t) { + t.plan(1) + + var candidates = [] + var found = configure.test.findAccessibleSync('test', dir, candidates) + t.strictEqual(found, undefined) +}) + +test('find accessible - single item array, readable', function (t) { + t.plan(1) + + var candidates = [ readableFile ] + var found = configure.test.findAccessibleSync('test', dir, candidates) + t.strictEqual(found, path.resolve(dir, readableFile)) +}) + +test('find accessible - single item array, readable in subdir', function (t) { + t.plan(1) + + var candidates = [ readableFileInDir ] + var found = configure.test.findAccessibleSync('test', dir, candidates) + t.strictEqual(found, path.resolve(dir, readableFileInDir)) +}) + +test('find accessible - single item array, unreadable', function (t) { + t.plan(1) + + var candidates = [ 'unreadable_file' ] + var found = configure.test.findAccessibleSync('test', dir, candidates) + t.strictEqual(found, undefined) +}) + + +test('find accessible - multi item array, no matches', function (t) { + t.plan(1) + + var candidates = [ 'non_existent_file', 'unreadable_file' ] + var found = configure.test.findAccessibleSync('test', dir, candidates) + t.strictEqual(found, undefined) +}) + + +test('find accessible - multi item array, single match', function (t) { + t.plan(1) + + var candidates = [ 'non_existent_file', readableFile ] + var found = configure.test.findAccessibleSync('test', dir, candidates) + t.strictEqual(found, path.resolve(dir, readableFile)) +}) + +test('find accessible - multi item array, return first match', function (t) { + t.plan(1) + + var candidates = [ 'non_existent_file', anotherReadableFile, readableFile ] + var found = configure.test.findAccessibleSync('test', dir, candidates) + t.strictEqual(found, path.resolve(dir, anotherReadableFile)) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/test/test-find-node-directory.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/test/test-find-node-directory.js new file mode 100644 index 00000000..46659d0c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/test/test-find-node-directory.js @@ -0,0 +1,115 @@ +var test = require('tape') +var path = require('path') +var findNodeDirectory = require('../lib/find-node-directory') + +var platforms = ['darwin', 'freebsd', 'linux', 'sunos', 'win32', 'aix'] + +// we should find the directory based on the directory +// the script is running in and it should match the layout +// in a build tree where npm is installed in +// .... /deps/npm +test('test find-node-directory - node install', function (t) { + t.plan(platforms.length) + for (var next = 0; next < platforms.length; next++) { + var processObj = {execPath: '/x/y/bin/node', platform: platforms[next]} + t.equal( + findNodeDirectory('/x/deps/npm/node_modules/node-gyp/lib', processObj), + path.join('/x')) + } +}) + +// we should find the directory based on the directory +// the script is running in and it should match the layout +// in an installed tree where npm is installed in +// .... /lib/node_modules/npm or .../node_modules/npm +// depending on the patform +test('test find-node-directory - node build', function (t) { + t.plan(platforms.length) + for (var next = 0; next < platforms.length; next++) { + var processObj = {execPath: '/x/y/bin/node', platform: platforms[next]} + if (platforms[next] === 'win32') { + t.equal( + findNodeDirectory('/y/node_modules/npm/node_modules/node-gyp/lib', + processObj), path.join('/y')) + } else { + t.equal( + findNodeDirectory('/y/lib/node_modules/npm/node_modules/node-gyp/lib', + processObj), path.join('/y')) + } + } +}) + +// we should find the directory based on the execPath +// for node and match because it was in the bin directory +test('test find-node-directory - node in bin directory', function (t) { + t.plan(platforms.length) + for (var next = 0; next < platforms.length; next++) { + var processObj = {execPath: '/x/y/bin/node', platform: platforms[next]} + t.equal( + findNodeDirectory('/nothere/npm/node_modules/node-gyp/lib', processObj), + path.join('/x/y')) + } +}) + +// we should find the directory based on the execPath +// for node and match because it was in the Release directory +test('test find-node-directory - node in build release dir', function (t) { + t.plan(platforms.length) + for (var next = 0; next < platforms.length; next++) { + var processObj + if (platforms[next] === 'win32') { + processObj = {execPath: '/x/y/Release/node', platform: platforms[next]} + } else { + processObj = {execPath: '/x/y/out/Release/node', + platform: platforms[next]} + } + + t.equal( + findNodeDirectory('/nothere/npm/node_modules/node-gyp/lib', processObj), + path.join('/x/y')) + } +}) + +// we should find the directory based on the execPath +// for node and match because it was in the Debug directory +test('test find-node-directory - node in Debug release dir', function (t) { + t.plan(platforms.length) + for (var next = 0; next < platforms.length; next++) { + var processObj + if (platforms[next] === 'win32') { + processObj = {execPath: '/a/b/Debug/node', platform: platforms[next]} + } else { + processObj = {execPath: '/a/b/out/Debug/node', platform: platforms[next]} + } + + t.equal( + findNodeDirectory('/nothere/npm/node_modules/node-gyp/lib', processObj), + path.join('/a/b')) + } +}) + +// we should not find it as it will not match based on the execPath nor +// the directory from which the script is running +test('test find-node-directory - not found', function (t) { + t.plan(platforms.length) + for (var next = 0; next < platforms.length; next++) { + var processObj = {execPath: '/x/y/z/y', platform:next} + t.equal(findNodeDirectory('/a/b/c/d', processObj), '') + } +}) + +// we should find the directory based on the directory +// the script is running in and it should match the layout +// in a build tree where npm is installed in +// .... /deps/npm +// same test as above but make sure additional directory entries +// don't cause an issue +test('test find-node-directory - node install', function (t) { + t.plan(platforms.length) + for (var next = 0; next < platforms.length; next++) { + var processObj = {execPath: '/x/y/bin/node', platform: platforms[next]} + t.equal( + findNodeDirectory('/x/y/z/a/b/c/deps/npm/node_modules/node-gyp/lib', + processObj), path.join('/x/y/z/a/b/c')) + } +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/test/test-find-python.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/test/test-find-python.js new file mode 100644 index 00000000..7f5c3946 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/test/test-find-python.js @@ -0,0 +1,20 @@ +'use strict' + +var test = require('tape') +var configure = require('../lib/configure') +var execFile = require('child_process').execFile + +test('find python executable', function (t) { + t.plan(4) + + configure.test.findPython('python', function (err, found) { + t.strictEqual(err, null) + var proc = execFile(found, ['-V'], function (err, stdout, stderr) { + t.strictEqual(err, null) + t.strictEqual(stdout, '') + t.ok(/Python 2/.test(stderr)) + }) + proc.stdout.setEncoding('utf-8') + proc.stderr.setEncoding('utf-8') + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/test/test-options.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/test/test-options.js new file mode 100644 index 00000000..d097f81b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/test/test-options.js @@ -0,0 +1,25 @@ +'use strict'; + +var test = require('tape') +var gyp = require('../lib/node-gyp') + +test('options in environment', function (t) { + t.plan(1) + + // `npm test` dumps a ton of npm_config_* variables in the environment. + Object.keys(process.env) + .filter(function(key) { return /^npm_config_/.test(key) }) + .forEach(function(key) { delete process.env[key] }) + + // Zero-length keys should get filtered out. + process.env.npm_config_ = '42' + // Other keys should get added. + process.env.npm_config_x = '42' + // Except loglevel. + process.env.npm_config_loglevel = 'debug' + + var g = gyp(); + g.parseArgv(['rebuild']) // Also sets opts.argv. + + t.deepEqual(Object.keys(g.opts).sort(), ['argv', 'x']) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/test/test-process-release.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/test/test-process-release.js new file mode 100644 index 00000000..48411ae0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/test/test-process-release.js @@ -0,0 +1,637 @@ +var test = require('tape') +var processRelease = require('../lib/process-release') + +test('test process release - process.version = 0.8.20', function (t) { + t.plan(2) + + var release = processRelease([], { opts: {} }, 'v0.8.20', null) + + t.equal(release.semver.version, '0.8.20') + delete release.semver + + t.deepEqual(release, { + version: '0.8.20', + name: 'node', + baseUrl: 'https://nodejs.org/dist/v0.8.20/', + tarballUrl: 'https://nodejs.org/dist/v0.8.20/node-v0.8.20.tar.gz', + shasumsUrl: 'https://nodejs.org/dist/v0.8.20/SHASUMS256.txt', + versionDir: '0.8.20', + libUrl32: 'https://nodejs.org/dist/v0.8.20/node.lib', + libUrl64: 'https://nodejs.org/dist/v0.8.20/x64/node.lib', + libPath32: 'node.lib', + libPath64: 'x64/node.lib' + }) +}) + +test('test process release - process.version = 0.10.21', function (t) { + t.plan(2) + + var release = processRelease([], { opts: {} }, 'v0.10.21', null) + + t.equal(release.semver.version, '0.10.21') + delete release.semver + + t.deepEqual(release, { + version: '0.10.21', + name: 'node', + baseUrl: 'https://nodejs.org/dist/v0.10.21/', + tarballUrl: 'https://nodejs.org/dist/v0.10.21/node-v0.10.21.tar.gz', + shasumsUrl: 'https://nodejs.org/dist/v0.10.21/SHASUMS256.txt', + versionDir: '0.10.21', + libUrl32: 'https://nodejs.org/dist/v0.10.21/node.lib', + libUrl64: 'https://nodejs.org/dist/v0.10.21/x64/node.lib', + libPath32: 'node.lib', + libPath64: 'x64/node.lib' + }) +}) + +// prior to -headers.tar.gz +test('test process release - process.version = 0.12.9', function (t) { + t.plan(2) + + var release = processRelease([], { opts: {} }, 'v0.12.9', null) + + t.equal(release.semver.version, '0.12.9') + delete release.semver + + t.deepEqual(release, { + version: '0.12.9', + name: 'node', + baseUrl: 'https://nodejs.org/dist/v0.12.9/', + tarballUrl: 'https://nodejs.org/dist/v0.12.9/node-v0.12.9.tar.gz', + shasumsUrl: 'https://nodejs.org/dist/v0.12.9/SHASUMS256.txt', + versionDir: '0.12.9', + libUrl32: 'https://nodejs.org/dist/v0.12.9/node.lib', + libUrl64: 'https://nodejs.org/dist/v0.12.9/x64/node.lib', + libPath32: 'node.lib', + libPath64: 'x64/node.lib' + }) +}) + +// prior to -headers.tar.gz +test('test process release - process.version = 0.10.41', function (t) { + t.plan(2) + + var release = processRelease([], { opts: {} }, 'v0.10.41', null) + + t.equal(release.semver.version, '0.10.41') + delete release.semver + + t.deepEqual(release, { + version: '0.10.41', + name: 'node', + baseUrl: 'https://nodejs.org/dist/v0.10.41/', + tarballUrl: 'https://nodejs.org/dist/v0.10.41/node-v0.10.41.tar.gz', + shasumsUrl: 'https://nodejs.org/dist/v0.10.41/SHASUMS256.txt', + versionDir: '0.10.41', + libUrl32: 'https://nodejs.org/dist/v0.10.41/node.lib', + libUrl64: 'https://nodejs.org/dist/v0.10.41/x64/node.lib', + libPath32: 'node.lib', + libPath64: 'x64/node.lib' + }) +}) + +// has -headers.tar.gz +test('test process release - process.release ~ node@0.10.42', function (t) { + t.plan(2) + + var release = processRelease([], { opts: {} }, 'v0.10.42', null) + + t.equal(release.semver.version, '0.10.42') + delete release.semver + + t.deepEqual(release, { + version: '0.10.42', + name: 'node', + baseUrl: 'https://nodejs.org/dist/v0.10.42/', + tarballUrl: 'https://nodejs.org/dist/v0.10.42/node-v0.10.42-headers.tar.gz', + shasumsUrl: 'https://nodejs.org/dist/v0.10.42/SHASUMS256.txt', + versionDir: '0.10.42', + libUrl32: 'https://nodejs.org/dist/v0.10.42/node.lib', + libUrl64: 'https://nodejs.org/dist/v0.10.42/x64/node.lib', + libPath32: 'node.lib', + libPath64: 'x64/node.lib' + }) +}) + +// has -headers.tar.gz +test('test process release - process.release ~ node@0.12.10', function (t) { + t.plan(2) + + var release = processRelease([], { opts: {} }, 'v0.12.10', null) + + t.equal(release.semver.version, '0.12.10') + delete release.semver + + t.deepEqual(release, { + version: '0.12.10', + name: 'node', + baseUrl: 'https://nodejs.org/dist/v0.12.10/', + tarballUrl: 'https://nodejs.org/dist/v0.12.10/node-v0.12.10-headers.tar.gz', + shasumsUrl: 'https://nodejs.org/dist/v0.12.10/SHASUMS256.txt', + versionDir: '0.12.10', + libUrl32: 'https://nodejs.org/dist/v0.12.10/node.lib', + libUrl64: 'https://nodejs.org/dist/v0.12.10/x64/node.lib', + libPath32: 'node.lib', + libPath64: 'x64/node.lib' + }) +}) + +test('test process release - process.release ~ node@4.1.23', function (t) { + t.plan(2) + + var release = processRelease([], { opts: {} }, 'v4.1.23', { + name: 'node', + headersUrl: 'https://nodejs.org/dist/v4.1.23/node-v4.1.23-headers.tar.gz' + }) + + t.equal(release.semver.version, '4.1.23') + delete release.semver + + t.deepEqual(release, { + version: '4.1.23', + name: 'node', + baseUrl: 'https://nodejs.org/dist/v4.1.23/', + tarballUrl: 'https://nodejs.org/dist/v4.1.23/node-v4.1.23-headers.tar.gz', + shasumsUrl: 'https://nodejs.org/dist/v4.1.23/SHASUMS256.txt', + versionDir: '4.1.23', + libUrl32: 'https://nodejs.org/dist/v4.1.23/win-x86/node.lib', + libUrl64: 'https://nodejs.org/dist/v4.1.23/win-x64/node.lib', + libPath32: 'win-x86/node.lib', + libPath64: 'win-x64/node.lib' + }) +}) + +test('test process release - process.release ~ node@4.1.23 / corp build', function (t) { + t.plan(2) + + var release = processRelease([], { opts: {} }, 'v4.1.23', { + name: 'node', + headersUrl: 'https://some.custom.location/node-v4.1.23-headers.tar.gz' + }) + + t.equal(release.semver.version, '4.1.23') + delete release.semver + + t.deepEqual(release, { + version: '4.1.23', + name: 'node', + baseUrl: 'https://some.custom.location/', + tarballUrl: 'https://some.custom.location/node-v4.1.23-headers.tar.gz', + shasumsUrl: 'https://some.custom.location/SHASUMS256.txt', + versionDir: '4.1.23', + libUrl32: 'https://some.custom.location/win-x86/node.lib', + libUrl64: 'https://some.custom.location/win-x64/node.lib', + libPath32: 'win-x86/node.lib', + libPath64: 'win-x64/node.lib' + }) +}) + +test('test process release - process.version = 1.8.4', function (t) { + t.plan(2) + + var release = processRelease([], { opts: {} }, 'v1.8.4', null) + + t.equal(release.semver.version, '1.8.4') + delete release.semver + + t.deepEqual(release, { + version: '1.8.4', + name: 'iojs', + baseUrl: 'https://iojs.org/download/release/v1.8.4/', + tarballUrl: 'https://iojs.org/download/release/v1.8.4/iojs-v1.8.4.tar.gz', + shasumsUrl: 'https://iojs.org/download/release/v1.8.4/SHASUMS256.txt', + versionDir: 'iojs-1.8.4', + libUrl32: 'https://iojs.org/download/release/v1.8.4/win-x86/iojs.lib', + libUrl64: 'https://iojs.org/download/release/v1.8.4/win-x64/iojs.lib', + libPath32: 'win-x86/iojs.lib', + libPath64: 'win-x64/iojs.lib' + }) +}) + +test('test process release - process.release ~ iojs@3.2.24', function (t) { + t.plan(2) + + var release = processRelease([], { opts: {} }, 'v3.2.24', { + name: 'io.js', + headersUrl: 'https://iojs.org/download/release/v3.2.24/iojs-v3.2.24-headers.tar.gz' + }) + + t.equal(release.semver.version, '3.2.24') + delete release.semver + + t.deepEqual(release, { + version: '3.2.24', + name: 'iojs', + baseUrl: 'https://iojs.org/download/release/v3.2.24/', + tarballUrl: 'https://iojs.org/download/release/v3.2.24/iojs-v3.2.24-headers.tar.gz', + shasumsUrl: 'https://iojs.org/download/release/v3.2.24/SHASUMS256.txt', + versionDir: 'iojs-3.2.24', + libUrl32: 'https://iojs.org/download/release/v3.2.24/win-x86/iojs.lib', + libUrl64: 'https://iojs.org/download/release/v3.2.24/win-x64/iojs.lib', + libPath32: 'win-x86/iojs.lib', + libPath64: 'win-x64/iojs.lib' + }) +}) + +test('test process release - process.release ~ iojs@3.2.11 +libUrl32', function (t) { + t.plan(2) + + var release = processRelease([], { opts: {} }, 'v3.2.11', { + name: 'io.js', + headersUrl: 'https://iojs.org/download/release/v3.2.11/iojs-v3.2.11-headers.tar.gz', + libUrl: 'https://iojs.org/download/release/v3.2.11/win-x86/iojs.lib' // custom + }) + + t.equal(release.semver.version, '3.2.11') + delete release.semver + + t.deepEqual(release, { + version: '3.2.11', + name: 'iojs', + baseUrl: 'https://iojs.org/download/release/v3.2.11/', + tarballUrl: 'https://iojs.org/download/release/v3.2.11/iojs-v3.2.11-headers.tar.gz', + shasumsUrl: 'https://iojs.org/download/release/v3.2.11/SHASUMS256.txt', + versionDir: 'iojs-3.2.11', + libUrl32: 'https://iojs.org/download/release/v3.2.11/win-x86/iojs.lib', + libUrl64: 'https://iojs.org/download/release/v3.2.11/win-x64/iojs.lib', + libPath32: 'win-x86/iojs.lib', + libPath64: 'win-x64/iojs.lib' + }) +}) + +test('test process release - process.release ~ iojs@3.2.101 +libUrl64', function (t) { + t.plan(2) + + var release = processRelease([], { opts: {} }, 'v3.2.101', { + name: 'io.js', + headersUrl: 'https://iojs.org/download/release/v3.2.101/iojs-v3.2.101-headers.tar.gz', + libUrl: 'https://iojs.org/download/release/v3.2.101/win-x64/iojs.lib' // custom + }) + + t.equal(release.semver.version, '3.2.101') + delete release.semver + + t.deepEqual(release, { + version: '3.2.101', + name: 'iojs', + baseUrl: 'https://iojs.org/download/release/v3.2.101/', + tarballUrl: 'https://iojs.org/download/release/v3.2.101/iojs-v3.2.101-headers.tar.gz', + shasumsUrl: 'https://iojs.org/download/release/v3.2.101/SHASUMS256.txt', + versionDir: 'iojs-3.2.101', + libUrl32: 'https://iojs.org/download/release/v3.2.101/win-x86/iojs.lib', + libUrl64: 'https://iojs.org/download/release/v3.2.101/win-x64/iojs.lib', + libPath32: 'win-x86/iojs.lib', + libPath64: 'win-x64/iojs.lib' + }) +}) + +test('test process release - process.release ~ iojs@3.3.0 - borked win-ia32', function (t) { + t.plan(2) + + var release = processRelease([], { opts: {} }, 'v3.2.101', { + name: 'io.js', + headersUrl: 'https://iojs.org/download/release/v3.2.101/iojs-v3.2.101-headers.tar.gz', + libUrl: 'https://iojs.org/download/release/v3.2.101/win-ia32/iojs.lib' // custom + }) + + t.equal(release.semver.version, '3.2.101') + delete release.semver + + t.deepEqual(release, { + version: '3.2.101', + name: 'iojs', + baseUrl: 'https://iojs.org/download/release/v3.2.101/', + tarballUrl: 'https://iojs.org/download/release/v3.2.101/iojs-v3.2.101-headers.tar.gz', + shasumsUrl: 'https://iojs.org/download/release/v3.2.101/SHASUMS256.txt', + versionDir: 'iojs-3.2.101', + libUrl32: 'https://iojs.org/download/release/v3.2.101/win-x86/iojs.lib', + libUrl64: 'https://iojs.org/download/release/v3.2.101/win-x64/iojs.lib', + libPath32: 'win-x86/iojs.lib', + libPath64: 'win-x64/iojs.lib' + }) +}) + +test('test process release - process.release ~ node@4.1.23 --target=0.10.40', function (t) { + t.plan(2) + + var release = processRelease([], { opts: { target: '0.10.40' } }, 'v4.1.23', { + name: 'node', + headersUrl: 'https://nodejs.org/dist/v4.1.23/node-v4.1.23-headers.tar.gz' + }) + + t.equal(release.semver.version, '0.10.40') + delete release.semver + + t.deepEqual(release, { + version: '0.10.40', + name: 'node', + baseUrl: 'https://nodejs.org/dist/v0.10.40/', + tarballUrl: 'https://nodejs.org/dist/v0.10.40/node-v0.10.40.tar.gz', + shasumsUrl: 'https://nodejs.org/dist/v0.10.40/SHASUMS256.txt', + versionDir: '0.10.40', + libUrl32: 'https://nodejs.org/dist/v0.10.40/node.lib', + libUrl64: 'https://nodejs.org/dist/v0.10.40/x64/node.lib', + libPath32: 'node.lib', + libPath64: 'x64/node.lib' + }) +}) + +test('test process release - process.release ~ node@4.1.23 --target=1.8.4', function (t) { + t.plan(2) + + var release = processRelease([], { opts: { target: '1.8.4' } }, 'v4.1.23', { + name: 'node', + headersUrl: 'https://nodejs.org/dist/v4.1.23/node-v4.1.23-headers.tar.gz' + }) + + t.equal(release.semver.version, '1.8.4') + delete release.semver + + t.deepEqual(release, { + version: '1.8.4', + name: 'iojs', + baseUrl: 'https://iojs.org/download/release/v1.8.4/', + tarballUrl: 'https://iojs.org/download/release/v1.8.4/iojs-v1.8.4.tar.gz', + shasumsUrl: 'https://iojs.org/download/release/v1.8.4/SHASUMS256.txt', + versionDir: 'iojs-1.8.4', + libUrl32: 'https://iojs.org/download/release/v1.8.4/win-x86/iojs.lib', + libUrl64: 'https://iojs.org/download/release/v1.8.4/win-x64/iojs.lib', + libPath32: 'win-x86/iojs.lib', + libPath64: 'win-x64/iojs.lib' + }) +}) + +test('test process release - process.release ~ node@4.1.23 --dist-url=https://foo.bar/baz', function (t) { + t.plan(2) + + var release = processRelease([], { opts: { 'dist-url': 'https://foo.bar/baz' } }, 'v4.1.23', { + name: 'node', + headersUrl: 'https://nodejs.org/dist/v4.1.23/node-v4.1.23-headers.tar.gz' + }) + + t.equal(release.semver.version, '4.1.23') + delete release.semver + + t.deepEqual(release, { + version: '4.1.23', + name: 'node', + baseUrl: 'https://foo.bar/baz/v4.1.23/', + tarballUrl: 'https://foo.bar/baz/v4.1.23/node-v4.1.23-headers.tar.gz', + shasumsUrl: 'https://foo.bar/baz/v4.1.23/SHASUMS256.txt', + versionDir: '4.1.23', + libUrl32: 'https://foo.bar/baz/v4.1.23/win-x86/node.lib', + libUrl64: 'https://foo.bar/baz/v4.1.23/win-x64/node.lib', + libPath32: 'win-x86/node.lib', + libPath64: 'win-x64/node.lib' + }) +}) + +test('test process release - process.release ~ frankenstein@4.1.23', function (t) { + t.plan(2) + + var release = processRelease([], { opts: {} }, 'v4.1.23', { + name: 'frankenstein', + headersUrl: 'https://frankensteinjs.org/dist/v4.1.23/frankenstein-v4.1.23-headers.tar.gz' + }) + + t.equal(release.semver.version, '4.1.23') + delete release.semver + + t.deepEqual(release, { + version: '4.1.23', + name: 'frankenstein', + baseUrl: 'https://frankensteinjs.org/dist/v4.1.23/', + tarballUrl: 'https://frankensteinjs.org/dist/v4.1.23/frankenstein-v4.1.23-headers.tar.gz', + shasumsUrl: 'https://frankensteinjs.org/dist/v4.1.23/SHASUMS256.txt', + versionDir: 'frankenstein-4.1.23', + libUrl32: 'https://frankensteinjs.org/dist/v4.1.23/win-x86/frankenstein.lib', + libUrl64: 'https://frankensteinjs.org/dist/v4.1.23/win-x64/frankenstein.lib', + libPath32: 'win-x86/frankenstein.lib', + libPath64: 'win-x64/frankenstein.lib' + }) +}) + + +test('test process release - process.release ~ frankenstein@4.1.23 --dist-url=http://foo.bar/baz/', function (t) { + t.plan(2) + + var release = processRelease([], { opts: { 'dist-url': 'http://foo.bar/baz/' } }, 'v4.1.23', { + name: 'frankenstein', + headersUrl: 'https://frankensteinjs.org/dist/v4.1.23/frankenstein-v4.1.23.tar.gz' + }) + + t.equal(release.semver.version, '4.1.23') + delete release.semver + + t.deepEqual(release, { + version: '4.1.23', + name: 'frankenstein', + baseUrl: 'http://foo.bar/baz/v4.1.23/', + tarballUrl: 'http://foo.bar/baz/v4.1.23/frankenstein-v4.1.23-headers.tar.gz', + shasumsUrl: 'http://foo.bar/baz/v4.1.23/SHASUMS256.txt', + versionDir: 'frankenstein-4.1.23', + libUrl32: 'http://foo.bar/baz/v4.1.23/win-x86/frankenstein.lib', + libUrl64: 'http://foo.bar/baz/v4.1.23/win-x64/frankenstein.lib', + libPath32: 'win-x86/frankenstein.lib', + libPath64: 'win-x64/frankenstein.lib' + }) +}) + +test('test process release - process.release ~ node@4.0.0-rc.4', function (t) { + t.plan(2) + + var release = processRelease([], { opts: {} }, 'v4.0.0-rc.4', { + name: 'node', + headersUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/node-v4.0.0-rc.4-headers.tar.gz' + }) + + t.equal(release.semver.version, '4.0.0-rc.4') + delete release.semver + + t.deepEqual(release, { + version: '4.0.0-rc.4', + name: 'node', + baseUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/', + tarballUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/node-v4.0.0-rc.4-headers.tar.gz', + shasumsUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/SHASUMS256.txt', + versionDir: '4.0.0-rc.4', + libUrl32: 'https://nodejs.org/download/rc/v4.0.0-rc.4/win-x86/node.lib', + libUrl64: 'https://nodejs.org/download/rc/v4.0.0-rc.4/win-x64/node.lib', + libPath32: 'win-x86/node.lib', + libPath64: 'win-x64/node.lib' + }) +}) + + +test('test process release - process.release ~ node@4.0.0-rc.4 passed as argv[0]', function (t) { + t.plan(2) + + // note the missing 'v' on the arg, it should normalise when checking + // whether we're on the default or not + var release = processRelease([ '4.0.0-rc.4' ], { opts: {} }, 'v4.0.0-rc.4', { + name: 'node', + headersUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/node-v4.0.0-rc.4-headers.tar.gz' + }) + + t.equal(release.semver.version, '4.0.0-rc.4') + delete release.semver + + t.deepEqual(release, { + version: '4.0.0-rc.4', + name: 'node', + baseUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/', + tarballUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/node-v4.0.0-rc.4-headers.tar.gz', + shasumsUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/SHASUMS256.txt', + versionDir: '4.0.0-rc.4', + libUrl32: 'https://nodejs.org/download/rc/v4.0.0-rc.4/win-x86/node.lib', + libUrl64: 'https://nodejs.org/download/rc/v4.0.0-rc.4/win-x64/node.lib', + libPath32: 'win-x86/node.lib', + libPath64: 'win-x64/node.lib' + }) +}) + + +test('test process release - process.release ~ node@4.0.0-rc.4 - bogus string passed as argv[0]', function (t) { + t.plan(2) + + // additional arguments can be passed in on the commandline that should be ignored if they + // are not specifying a valid version @ position 0 + var release = processRelease([ 'this is no version!' ], { opts: {} }, 'v4.0.0-rc.4', { + name: 'node', + headersUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/node-v4.0.0-rc.4-headers.tar.gz' + }) + + t.equal(release.semver.version, '4.0.0-rc.4') + delete release.semver + + t.deepEqual(release, { + version: '4.0.0-rc.4', + name: 'node', + baseUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/', + tarballUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/node-v4.0.0-rc.4-headers.tar.gz', + shasumsUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/SHASUMS256.txt', + versionDir: '4.0.0-rc.4', + libUrl32: 'https://nodejs.org/download/rc/v4.0.0-rc.4/win-x86/node.lib', + libUrl64: 'https://nodejs.org/download/rc/v4.0.0-rc.4/win-x64/node.lib', + libPath32: 'win-x86/node.lib', + libPath64: 'win-x64/node.lib' + }) +}) + +test('test process release - NODEJS_ORG_MIRROR', function (t) { + t.plan(2) + + process.env.NODEJS_ORG_MIRROR = 'http://foo.bar' + + var release = processRelease([], { opts: {} }, 'v4.1.23', { + name: 'node', + headersUrl: 'https://nodejs.org/dist/v4.1.23/node-v4.1.23-headers.tar.gz' + }) + + t.equal(release.semver.version, '4.1.23') + delete release.semver + + t.deepEqual(release, { + version: '4.1.23', + name: 'node', + baseUrl: 'http://foo.bar/v4.1.23/', + tarballUrl: 'http://foo.bar/v4.1.23/node-v4.1.23-headers.tar.gz', + shasumsUrl: 'http://foo.bar/v4.1.23/SHASUMS256.txt', + versionDir: '4.1.23', + libUrl32: 'http://foo.bar/v4.1.23/win-x86/node.lib', + libUrl64: 'http://foo.bar/v4.1.23/win-x64/node.lib', + libPath32: 'win-x86/node.lib', + libPath64: 'win-x64/node.lib' + }) + + delete process.env.NODEJS_ORG_MIRROR +}) + +test('test process release - NVM_NODEJS_ORG_MIRROR', function (t) { + t.plan(2) + + process.env.NVM_NODEJS_ORG_MIRROR = 'http://foo.bar' + + var release = processRelease([], { opts: {} }, 'v4.1.23', { + name: 'node', + headersUrl: 'https://nodejs.org/dist/v4.1.23/node-v4.1.23-headers.tar.gz' + }) + + t.equal(release.semver.version, '4.1.23') + delete release.semver + + t.deepEqual(release, { + version: '4.1.23', + name: 'node', + baseUrl: 'http://foo.bar/v4.1.23/', + tarballUrl: 'http://foo.bar/v4.1.23/node-v4.1.23-headers.tar.gz', + shasumsUrl: 'http://foo.bar/v4.1.23/SHASUMS256.txt', + versionDir: '4.1.23', + libUrl32: 'http://foo.bar/v4.1.23/win-x86/node.lib', + libUrl64: 'http://foo.bar/v4.1.23/win-x64/node.lib', + libPath32: 'win-x86/node.lib', + libPath64: 'win-x64/node.lib' + }) + + delete process.env.NVM_NODEJS_ORG_MIRROR +}) + +test('test process release - IOJS_ORG_MIRROR', function (t) { + t.plan(2) + + process.env.IOJS_ORG_MIRROR = 'http://foo.bar' + + var release = processRelease([], { opts: {} }, 'v3.2.24', { + name: 'io.js', + headersUrl: 'https://iojs.org/download/release/v3.2.24/iojs-v3.2.24-headers.tar.gz' + }) + + t.equal(release.semver.version, '3.2.24') + delete release.semver + + t.deepEqual(release, { + version: '3.2.24', + name: 'iojs', + baseUrl: 'http://foo.bar/v3.2.24/', + tarballUrl: 'http://foo.bar/v3.2.24/iojs-v3.2.24-headers.tar.gz', + shasumsUrl: 'http://foo.bar/v3.2.24/SHASUMS256.txt', + versionDir: 'iojs-3.2.24', + libUrl32: 'http://foo.bar/v3.2.24/win-x86/iojs.lib', + libUrl64: 'http://foo.bar/v3.2.24/win-x64/iojs.lib', + libPath32: 'win-x86/iojs.lib', + libPath64: 'win-x64/iojs.lib' + }) + + delete process.env.IOJS_ORG_MIRROR +}) + + +test('test process release - NVM_IOJS_ORG_MIRROR', function (t) { + t.plan(2) + + process.env.NVM_IOJS_ORG_MIRROR = 'http://foo.bar' + + var release = processRelease([], { opts: {} }, 'v3.2.24', { + name: 'io.js', + headersUrl: 'https://iojs.org/download/release/v3.2.24/iojs-v3.2.24-headers.tar.gz' + }) + + t.equal(release.semver.version, '3.2.24') + delete release.semver + + t.deepEqual(release, { + version: '3.2.24', + name: 'iojs', + baseUrl: 'http://foo.bar/v3.2.24/', + tarballUrl: 'http://foo.bar/v3.2.24/iojs-v3.2.24-headers.tar.gz', + shasumsUrl: 'http://foo.bar/v3.2.24/SHASUMS256.txt', + versionDir: 'iojs-3.2.24', + libUrl32: 'http://foo.bar/v3.2.24/win-x86/iojs.lib', + libUrl64: 'http://foo.bar/v3.2.24/win-x64/iojs.lib', + libPath32: 'win-x86/iojs.lib', + libPath64: 'win-x64/iojs.lib' + }) + + delete process.env.NVM_IOJS_ORG_MIRROR +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/nopt/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/nopt/.npmignore new file mode 100644 index 00000000..3c3629e6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/nopt/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/nopt/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/nopt/.travis.yml new file mode 100644 index 00000000..99f2bbf5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/nopt/.travis.yml @@ -0,0 +1,9 @@ +language: node_js +language: node_js +node_js: + - '0.8' + - '0.10' + - '0.12' + - 'iojs' +before_install: + - npm install -g npm@latest diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/nopt/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/nopt/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/nopt/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/nopt/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/nopt/README.md new file mode 100644 index 00000000..f21a4b31 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/nopt/README.md @@ -0,0 +1,211 @@ +If you want to write an option parser, and have it be good, there are +two ways to do it. The Right Way, and the Wrong Way. + +The Wrong Way is to sit down and write an option parser. We've all done +that. + +The Right Way is to write some complex configurable program with so many +options that you hit the limit of your frustration just trying to +manage them all, and defer it with duct-tape solutions until you see +exactly to the core of the problem, and finally snap and write an +awesome option parser. + +If you want to write an option parser, don't write an option parser. +Write a package manager, or a source control system, or a service +restarter, or an operating system. You probably won't end up with a +good one of those, but if you don't give up, and you are relentless and +diligent enough in your procrastination, you may just end up with a very +nice option parser. + +## USAGE + + // my-program.js + var nopt = require("nopt") + , Stream = require("stream").Stream + , path = require("path") + , knownOpts = { "foo" : [String, null] + , "bar" : [Stream, Number] + , "baz" : path + , "bloo" : [ "big", "medium", "small" ] + , "flag" : Boolean + , "pick" : Boolean + , "many1" : [String, Array] + , "many2" : [path] + } + , shortHands = { "foofoo" : ["--foo", "Mr. Foo"] + , "b7" : ["--bar", "7"] + , "m" : ["--bloo", "medium"] + , "p" : ["--pick"] + , "f" : ["--flag"] + } + // everything is optional. + // knownOpts and shorthands default to {} + // arg list defaults to process.argv + // slice defaults to 2 + , parsed = nopt(knownOpts, shortHands, process.argv, 2) + console.log(parsed) + +This would give you support for any of the following: + +```bash +$ node my-program.js --foo "blerp" --no-flag +{ "foo" : "blerp", "flag" : false } + +$ node my-program.js ---bar 7 --foo "Mr. Hand" --flag +{ bar: 7, foo: "Mr. Hand", flag: true } + +$ node my-program.js --foo "blerp" -f -----p +{ foo: "blerp", flag: true, pick: true } + +$ node my-program.js -fp --foofoo +{ foo: "Mr. Foo", flag: true, pick: true } + +$ node my-program.js --foofoo -- -fp # -- stops the flag parsing. +{ foo: "Mr. Foo", argv: { remain: ["-fp"] } } + +$ node my-program.js --blatzk -fp # unknown opts are ok. +{ blatzk: true, flag: true, pick: true } + +$ node my-program.js --blatzk=1000 -fp # but you need to use = if they have a value +{ blatzk: 1000, flag: true, pick: true } + +$ node my-program.js --no-blatzk -fp # unless they start with "no-" +{ blatzk: false, flag: true, pick: true } + +$ node my-program.js --baz b/a/z # known paths are resolved. +{ baz: "/Users/isaacs/b/a/z" } + +# if Array is one of the types, then it can take many +# values, and will always be an array. The other types provided +# specify what types are allowed in the list. + +$ node my-program.js --many1 5 --many1 null --many1 foo +{ many1: ["5", "null", "foo"] } + +$ node my-program.js --many2 foo --many2 bar +{ many2: ["/path/to/foo", "path/to/bar"] } +``` + +Read the tests at the bottom of `lib/nopt.js` for more examples of +what this puppy can do. + +## Types + +The following types are supported, and defined on `nopt.typeDefs` + +* String: A normal string. No parsing is done. +* path: A file system path. Gets resolved against cwd if not absolute. +* url: A url. If it doesn't parse, it isn't accepted. +* Number: Must be numeric. +* Date: Must parse as a date. If it does, and `Date` is one of the options, + then it will return a Date object, not a string. +* Boolean: Must be either `true` or `false`. If an option is a boolean, + then it does not need a value, and its presence will imply `true` as + the value. To negate boolean flags, do `--no-whatever` or `--whatever + false` +* NaN: Means that the option is strictly not allowed. Any value will + fail. +* Stream: An object matching the "Stream" class in node. Valuable + for use when validating programmatically. (npm uses this to let you + supply any WriteStream on the `outfd` and `logfd` config options.) +* Array: If `Array` is specified as one of the types, then the value + will be parsed as a list of options. This means that multiple values + can be specified, and that the value will always be an array. + +If a type is an array of values not on this list, then those are +considered valid values. For instance, in the example above, the +`--bloo` option can only be one of `"big"`, `"medium"`, or `"small"`, +and any other value will be rejected. + +When parsing unknown fields, `"true"`, `"false"`, and `"null"` will be +interpreted as their JavaScript equivalents. + +You can also mix types and values, or multiple types, in a list. For +instance `{ blah: [Number, null] }` would allow a value to be set to +either a Number or null. When types are ordered, this implies a +preference, and the first type that can be used to properly interpret +the value will be used. + +To define a new type, add it to `nopt.typeDefs`. Each item in that +hash is an object with a `type` member and a `validate` method. The +`type` member is an object that matches what goes in the type list. The +`validate` method is a function that gets called with `validate(data, +key, val)`. Validate methods should assign `data[key]` to the valid +value of `val` if it can be handled properly, or return boolean +`false` if it cannot. + +You can also call `nopt.clean(data, types, typeDefs)` to clean up a +config object and remove its invalid properties. + +## Error Handling + +By default, nopt outputs a warning to standard error when invalid values for +known options are found. You can change this behavior by assigning a method +to `nopt.invalidHandler`. This method will be called with +the offending `nopt.invalidHandler(key, val, types)`. + +If no `nopt.invalidHandler` is assigned, then it will console.error +its whining. If it is assigned to boolean `false` then the warning is +suppressed. + +## Abbreviations + +Yes, they are supported. If you define options like this: + +```javascript +{ "foolhardyelephants" : Boolean +, "pileofmonkeys" : Boolean } +``` + +Then this will work: + +```bash +node program.js --foolhar --pil +node program.js --no-f --pileofmon +# etc. +``` + +## Shorthands + +Shorthands are a hash of shorter option names to a snippet of args that +they expand to. + +If multiple one-character shorthands are all combined, and the +combination does not unambiguously match any other option or shorthand, +then they will be broken up into their constituent parts. For example: + +```json +{ "s" : ["--loglevel", "silent"] +, "g" : "--global" +, "f" : "--force" +, "p" : "--parseable" +, "l" : "--long" +} +``` + +```bash +npm ls -sgflp +# just like doing this: +npm ls --loglevel silent --global --force --long --parseable +``` + +## The Rest of the args + +The config object returned by nopt is given a special member called +`argv`, which is an object with the following fields: + +* `remain`: The remaining args after all the parsing has occurred. +* `original`: The args as they originally appeared. +* `cooked`: The args after flags and shorthands are expanded. + +## Slicing + +Node programs are called with more or less the exact argv as it appears +in C land, after the v8 and node-specific options have been plucked off. +As such, `argv[0]` is always `node` and `argv[1]` is always the +JavaScript program being run. + +That's usually not very useful to you. So they're sliced off by +default. If you want them, then you can pass in `0` as the last +argument, or any other number that you'd like to slice off the start of +the list. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/nopt/examples/my-program.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/nopt/examples/my-program.js new file mode 100644 index 00000000..142447e1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/nopt/examples/my-program.js @@ -0,0 +1,30 @@ +#!/usr/bin/env node + +//process.env.DEBUG_NOPT = 1 + +// my-program.js +var nopt = require("../lib/nopt") + , Stream = require("stream").Stream + , path = require("path") + , knownOpts = { "foo" : [String, null] + , "bar" : [Stream, Number] + , "baz" : path + , "bloo" : [ "big", "medium", "small" ] + , "flag" : Boolean + , "pick" : Boolean + } + , shortHands = { "foofoo" : ["--foo", "Mr. Foo"] + , "b7" : ["--bar", "7"] + , "m" : ["--bloo", "medium"] + , "p" : ["--pick"] + , "f" : ["--flag", "true"] + , "g" : ["--flag"] + , "s" : "--flag" + } + // everything is optional. + // knownOpts and shorthands default to {} + // arg list defaults to process.argv + // slice defaults to 2 + , parsed = nopt(knownOpts, shortHands, process.argv, 2) + +console.log("parsed =\n"+ require("util").inspect(parsed)) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/nopt/lib/nopt.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/nopt/lib/nopt.js new file mode 100644 index 00000000..97707e78 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/nopt/lib/nopt.js @@ -0,0 +1,415 @@ +// info about each config option. + +var debug = process.env.DEBUG_NOPT || process.env.NOPT_DEBUG + ? function () { console.error.apply(console, arguments) } + : function () {} + +var url = require("url") + , path = require("path") + , Stream = require("stream").Stream + , abbrev = require("abbrev") + +module.exports = exports = nopt +exports.clean = clean + +exports.typeDefs = + { String : { type: String, validate: validateString } + , Boolean : { type: Boolean, validate: validateBoolean } + , url : { type: url, validate: validateUrl } + , Number : { type: Number, validate: validateNumber } + , path : { type: path, validate: validatePath } + , Stream : { type: Stream, validate: validateStream } + , Date : { type: Date, validate: validateDate } + } + +function nopt (types, shorthands, args, slice) { + args = args || process.argv + types = types || {} + shorthands = shorthands || {} + if (typeof slice !== "number") slice = 2 + + debug(types, shorthands, args, slice) + + args = args.slice(slice) + var data = {} + , key + , remain = [] + , cooked = args + , original = args.slice(0) + + parse(args, data, remain, types, shorthands) + // now data is full + clean(data, types, exports.typeDefs) + data.argv = {remain:remain,cooked:cooked,original:original} + Object.defineProperty(data.argv, 'toString', { value: function () { + return this.original.map(JSON.stringify).join(" ") + }, enumerable: false }) + return data +} + +function clean (data, types, typeDefs) { + typeDefs = typeDefs || exports.typeDefs + var remove = {} + , typeDefault = [false, true, null, String, Array] + + Object.keys(data).forEach(function (k) { + if (k === "argv") return + var val = data[k] + , isArray = Array.isArray(val) + , type = types[k] + if (!isArray) val = [val] + if (!type) type = typeDefault + if (type === Array) type = typeDefault.concat(Array) + if (!Array.isArray(type)) type = [type] + + debug("val=%j", val) + debug("types=", type) + val = val.map(function (val) { + // if it's an unknown value, then parse false/true/null/numbers/dates + if (typeof val === "string") { + debug("string %j", val) + val = val.trim() + if ((val === "null" && ~type.indexOf(null)) + || (val === "true" && + (~type.indexOf(true) || ~type.indexOf(Boolean))) + || (val === "false" && + (~type.indexOf(false) || ~type.indexOf(Boolean)))) { + val = JSON.parse(val) + debug("jsonable %j", val) + } else if (~type.indexOf(Number) && !isNaN(val)) { + debug("convert to number", val) + val = +val + } else if (~type.indexOf(Date) && !isNaN(Date.parse(val))) { + debug("convert to date", val) + val = new Date(val) + } + } + + if (!types.hasOwnProperty(k)) { + return val + } + + // allow `--no-blah` to set 'blah' to null if null is allowed + if (val === false && ~type.indexOf(null) && + !(~type.indexOf(false) || ~type.indexOf(Boolean))) { + val = null + } + + var d = {} + d[k] = val + debug("prevalidated val", d, val, types[k]) + if (!validate(d, k, val, types[k], typeDefs)) { + if (exports.invalidHandler) { + exports.invalidHandler(k, val, types[k], data) + } else if (exports.invalidHandler !== false) { + debug("invalid: "+k+"="+val, types[k]) + } + return remove + } + debug("validated val", d, val, types[k]) + return d[k] + }).filter(function (val) { return val !== remove }) + + if (!val.length) delete data[k] + else if (isArray) { + debug(isArray, data[k], val) + data[k] = val + } else data[k] = val[0] + + debug("k=%s val=%j", k, val, data[k]) + }) +} + +function validateString (data, k, val) { + data[k] = String(val) +} + +function validatePath (data, k, val) { + if (val === true) return false + if (val === null) return true + + val = String(val) + var homePattern = process.platform === 'win32' ? /^~(\/|\\)/ : /^~\// + if (val.match(homePattern) && process.env.HOME) { + val = path.resolve(process.env.HOME, val.substr(2)) + } + data[k] = path.resolve(String(val)) + return true +} + +function validateNumber (data, k, val) { + debug("validate Number %j %j %j", k, val, isNaN(val)) + if (isNaN(val)) return false + data[k] = +val +} + +function validateDate (data, k, val) { + debug("validate Date %j %j %j", k, val, Date.parse(val)) + var s = Date.parse(val) + if (isNaN(s)) return false + data[k] = new Date(val) +} + +function validateBoolean (data, k, val) { + if (val instanceof Boolean) val = val.valueOf() + else if (typeof val === "string") { + if (!isNaN(val)) val = !!(+val) + else if (val === "null" || val === "false") val = false + else val = true + } else val = !!val + data[k] = val +} + +function validateUrl (data, k, val) { + val = url.parse(String(val)) + if (!val.host) return false + data[k] = val.href +} + +function validateStream (data, k, val) { + if (!(val instanceof Stream)) return false + data[k] = val +} + +function validate (data, k, val, type, typeDefs) { + // arrays are lists of types. + if (Array.isArray(type)) { + for (var i = 0, l = type.length; i < l; i ++) { + if (type[i] === Array) continue + if (validate(data, k, val, type[i], typeDefs)) return true + } + delete data[k] + return false + } + + // an array of anything? + if (type === Array) return true + + // NaN is poisonous. Means that something is not allowed. + if (type !== type) { + debug("Poison NaN", k, val, type) + delete data[k] + return false + } + + // explicit list of values + if (val === type) { + debug("Explicitly allowed %j", val) + // if (isArray) (data[k] = data[k] || []).push(val) + // else data[k] = val + data[k] = val + return true + } + + // now go through the list of typeDefs, validate against each one. + var ok = false + , types = Object.keys(typeDefs) + for (var i = 0, l = types.length; i < l; i ++) { + debug("test type %j %j %j", k, val, types[i]) + var t = typeDefs[types[i]] + if (t && + ((type && type.name && t.type && t.type.name) ? (type.name === t.type.name) : (type === t.type))) { + var d = {} + ok = false !== t.validate(d, k, val) + val = d[k] + if (ok) { + // if (isArray) (data[k] = data[k] || []).push(val) + // else data[k] = val + data[k] = val + break + } + } + } + debug("OK? %j (%j %j %j)", ok, k, val, types[i]) + + if (!ok) delete data[k] + return ok +} + +function parse (args, data, remain, types, shorthands) { + debug("parse", args, data, remain) + + var key = null + , abbrevs = abbrev(Object.keys(types)) + , shortAbbr = abbrev(Object.keys(shorthands)) + + for (var i = 0; i < args.length; i ++) { + var arg = args[i] + debug("arg", arg) + + if (arg.match(/^-{2,}$/)) { + // done with keys. + // the rest are args. + remain.push.apply(remain, args.slice(i + 1)) + args[i] = "--" + break + } + var hadEq = false + if (arg.charAt(0) === "-" && arg.length > 1) { + if (arg.indexOf("=") !== -1) { + hadEq = true + var v = arg.split("=") + arg = v.shift() + v = v.join("=") + args.splice.apply(args, [i, 1].concat([arg, v])) + } + + // see if it's a shorthand + // if so, splice and back up to re-parse it. + var shRes = resolveShort(arg, shorthands, shortAbbr, abbrevs) + debug("arg=%j shRes=%j", arg, shRes) + if (shRes) { + debug(arg, shRes) + args.splice.apply(args, [i, 1].concat(shRes)) + if (arg !== shRes[0]) { + i -- + continue + } + } + arg = arg.replace(/^-+/, "") + var no = null + while (arg.toLowerCase().indexOf("no-") === 0) { + no = !no + arg = arg.substr(3) + } + + if (abbrevs[arg]) arg = abbrevs[arg] + + var isArray = types[arg] === Array || + Array.isArray(types[arg]) && types[arg].indexOf(Array) !== -1 + + // allow unknown things to be arrays if specified multiple times. + if (!types.hasOwnProperty(arg) && data.hasOwnProperty(arg)) { + if (!Array.isArray(data[arg])) + data[arg] = [data[arg]] + isArray = true + } + + var val + , la = args[i + 1] + + var isBool = typeof no === 'boolean' || + types[arg] === Boolean || + Array.isArray(types[arg]) && types[arg].indexOf(Boolean) !== -1 || + (typeof types[arg] === 'undefined' && !hadEq) || + (la === "false" && + (types[arg] === null || + Array.isArray(types[arg]) && ~types[arg].indexOf(null))) + + if (isBool) { + // just set and move along + val = !no + // however, also support --bool true or --bool false + if (la === "true" || la === "false") { + val = JSON.parse(la) + la = null + if (no) val = !val + i ++ + } + + // also support "foo":[Boolean, "bar"] and "--foo bar" + if (Array.isArray(types[arg]) && la) { + if (~types[arg].indexOf(la)) { + // an explicit type + val = la + i ++ + } else if ( la === "null" && ~types[arg].indexOf(null) ) { + // null allowed + val = null + i ++ + } else if ( !la.match(/^-{2,}[^-]/) && + !isNaN(la) && + ~types[arg].indexOf(Number) ) { + // number + val = +la + i ++ + } else if ( !la.match(/^-[^-]/) && ~types[arg].indexOf(String) ) { + // string + val = la + i ++ + } + } + + if (isArray) (data[arg] = data[arg] || []).push(val) + else data[arg] = val + + continue + } + + if (types[arg] === String && la === undefined) + la = "" + + if (la && la.match(/^-{2,}$/)) { + la = undefined + i -- + } + + val = la === undefined ? true : la + if (isArray) (data[arg] = data[arg] || []).push(val) + else data[arg] = val + + i ++ + continue + } + remain.push(arg) + } +} + +function resolveShort (arg, shorthands, shortAbbr, abbrevs) { + // handle single-char shorthands glommed together, like + // npm ls -glp, but only if there is one dash, and only if + // all of the chars are single-char shorthands, and it's + // not a match to some other abbrev. + arg = arg.replace(/^-+/, '') + + // if it's an exact known option, then don't go any further + if (abbrevs[arg] === arg) + return null + + // if it's an exact known shortopt, same deal + if (shorthands[arg]) { + // make it an array, if it's a list of words + if (shorthands[arg] && !Array.isArray(shorthands[arg])) + shorthands[arg] = shorthands[arg].split(/\s+/) + + return shorthands[arg] + } + + // first check to see if this arg is a set of single-char shorthands + var singles = shorthands.___singles + if (!singles) { + singles = Object.keys(shorthands).filter(function (s) { + return s.length === 1 + }).reduce(function (l,r) { + l[r] = true + return l + }, {}) + shorthands.___singles = singles + debug('shorthand singles', singles) + } + + var chrs = arg.split("").filter(function (c) { + return singles[c] + }) + + if (chrs.join("") === arg) return chrs.map(function (c) { + return shorthands[c] + }).reduce(function (l, r) { + return l.concat(r) + }, []) + + + // if it's an arg abbrev, and not a literal shorthand, then prefer the arg + if (abbrevs[arg] && !shorthands[arg]) + return null + + // if it's an abbr for a shorthand, then use that + if (shortAbbr[arg]) + arg = shortAbbr[arg] + + // make it an array, if it's a list of words + if (shorthands[arg] && !Array.isArray(shorthands[arg])) + shorthands[arg] = shorthands[arg].split(/\s+/) + + return shorthands[arg] +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/nopt/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/nopt/package.json new file mode 100644 index 00000000..f9ff8d88 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/nopt/package.json @@ -0,0 +1,38 @@ +{ + "name": "nopt", + "version": "3.0.6", + "description": "Option parsing for Node, supporting types, shorthands, etc. Used by npm.", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "main": "lib/nopt.js", + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/nopt.git" + }, + "bin": { + "nopt": "./bin/nopt.js" + }, + "license": "ISC", + "dependencies": { + "abbrev": "1" + }, + "devDependencies": { + "tap": "^1.2.0" + }, + "readme": "If you want to write an option parser, and have it be good, there are\ntwo ways to do it. The Right Way, and the Wrong Way.\n\nThe Wrong Way is to sit down and write an option parser. We've all done\nthat.\n\nThe Right Way is to write some complex configurable program with so many\noptions that you hit the limit of your frustration just trying to\nmanage them all, and defer it with duct-tape solutions until you see\nexactly to the core of the problem, and finally snap and write an\nawesome option parser.\n\nIf you want to write an option parser, don't write an option parser.\nWrite a package manager, or a source control system, or a service\nrestarter, or an operating system. You probably won't end up with a\ngood one of those, but if you don't give up, and you are relentless and\ndiligent enough in your procrastination, you may just end up with a very\nnice option parser.\n\n## USAGE\n\n // my-program.js\n var nopt = require(\"nopt\")\n , Stream = require(\"stream\").Stream\n , path = require(\"path\")\n , knownOpts = { \"foo\" : [String, null]\n , \"bar\" : [Stream, Number]\n , \"baz\" : path\n , \"bloo\" : [ \"big\", \"medium\", \"small\" ]\n , \"flag\" : Boolean\n , \"pick\" : Boolean\n , \"many1\" : [String, Array]\n , \"many2\" : [path]\n }\n , shortHands = { \"foofoo\" : [\"--foo\", \"Mr. Foo\"]\n , \"b7\" : [\"--bar\", \"7\"]\n , \"m\" : [\"--bloo\", \"medium\"]\n , \"p\" : [\"--pick\"]\n , \"f\" : [\"--flag\"]\n }\n // everything is optional.\n // knownOpts and shorthands default to {}\n // arg list defaults to process.argv\n // slice defaults to 2\n , parsed = nopt(knownOpts, shortHands, process.argv, 2)\n console.log(parsed)\n\nThis would give you support for any of the following:\n\n```bash\n$ node my-program.js --foo \"blerp\" --no-flag\n{ \"foo\" : \"blerp\", \"flag\" : false }\n\n$ node my-program.js ---bar 7 --foo \"Mr. Hand\" --flag\n{ bar: 7, foo: \"Mr. Hand\", flag: true }\n\n$ node my-program.js --foo \"blerp\" -f -----p\n{ foo: \"blerp\", flag: true, pick: true }\n\n$ node my-program.js -fp --foofoo\n{ foo: \"Mr. Foo\", flag: true, pick: true }\n\n$ node my-program.js --foofoo -- -fp # -- stops the flag parsing.\n{ foo: \"Mr. Foo\", argv: { remain: [\"-fp\"] } }\n\n$ node my-program.js --blatzk -fp # unknown opts are ok.\n{ blatzk: true, flag: true, pick: true }\n\n$ node my-program.js --blatzk=1000 -fp # but you need to use = if they have a value\n{ blatzk: 1000, flag: true, pick: true }\n\n$ node my-program.js --no-blatzk -fp # unless they start with \"no-\"\n{ blatzk: false, flag: true, pick: true }\n\n$ node my-program.js --baz b/a/z # known paths are resolved.\n{ baz: \"/Users/isaacs/b/a/z\" }\n\n# if Array is one of the types, then it can take many\n# values, and will always be an array. The other types provided\n# specify what types are allowed in the list.\n\n$ node my-program.js --many1 5 --many1 null --many1 foo\n{ many1: [\"5\", \"null\", \"foo\"] }\n\n$ node my-program.js --many2 foo --many2 bar\n{ many2: [\"/path/to/foo\", \"path/to/bar\"] }\n```\n\nRead the tests at the bottom of `lib/nopt.js` for more examples of\nwhat this puppy can do.\n\n## Types\n\nThe following types are supported, and defined on `nopt.typeDefs`\n\n* String: A normal string. No parsing is done.\n* path: A file system path. Gets resolved against cwd if not absolute.\n* url: A url. If it doesn't parse, it isn't accepted.\n* Number: Must be numeric.\n* Date: Must parse as a date. If it does, and `Date` is one of the options,\n then it will return a Date object, not a string.\n* Boolean: Must be either `true` or `false`. If an option is a boolean,\n then it does not need a value, and its presence will imply `true` as\n the value. To negate boolean flags, do `--no-whatever` or `--whatever\n false`\n* NaN: Means that the option is strictly not allowed. Any value will\n fail.\n* Stream: An object matching the \"Stream\" class in node. Valuable\n for use when validating programmatically. (npm uses this to let you\n supply any WriteStream on the `outfd` and `logfd` config options.)\n* Array: If `Array` is specified as one of the types, then the value\n will be parsed as a list of options. This means that multiple values\n can be specified, and that the value will always be an array.\n\nIf a type is an array of values not on this list, then those are\nconsidered valid values. For instance, in the example above, the\n`--bloo` option can only be one of `\"big\"`, `\"medium\"`, or `\"small\"`,\nand any other value will be rejected.\n\nWhen parsing unknown fields, `\"true\"`, `\"false\"`, and `\"null\"` will be\ninterpreted as their JavaScript equivalents.\n\nYou can also mix types and values, or multiple types, in a list. For\ninstance `{ blah: [Number, null] }` would allow a value to be set to\neither a Number or null. When types are ordered, this implies a\npreference, and the first type that can be used to properly interpret\nthe value will be used.\n\nTo define a new type, add it to `nopt.typeDefs`. Each item in that\nhash is an object with a `type` member and a `validate` method. The\n`type` member is an object that matches what goes in the type list. The\n`validate` method is a function that gets called with `validate(data,\nkey, val)`. Validate methods should assign `data[key]` to the valid\nvalue of `val` if it can be handled properly, or return boolean\n`false` if it cannot.\n\nYou can also call `nopt.clean(data, types, typeDefs)` to clean up a\nconfig object and remove its invalid properties.\n\n## Error Handling\n\nBy default, nopt outputs a warning to standard error when invalid values for\nknown options are found. You can change this behavior by assigning a method\nto `nopt.invalidHandler`. This method will be called with\nthe offending `nopt.invalidHandler(key, val, types)`.\n\nIf no `nopt.invalidHandler` is assigned, then it will console.error\nits whining. If it is assigned to boolean `false` then the warning is\nsuppressed.\n\n## Abbreviations\n\nYes, they are supported. If you define options like this:\n\n```javascript\n{ \"foolhardyelephants\" : Boolean\n, \"pileofmonkeys\" : Boolean }\n```\n\nThen this will work:\n\n```bash\nnode program.js --foolhar --pil\nnode program.js --no-f --pileofmon\n# etc.\n```\n\n## Shorthands\n\nShorthands are a hash of shorter option names to a snippet of args that\nthey expand to.\n\nIf multiple one-character shorthands are all combined, and the\ncombination does not unambiguously match any other option or shorthand,\nthen they will be broken up into their constituent parts. For example:\n\n```json\n{ \"s\" : [\"--loglevel\", \"silent\"]\n, \"g\" : \"--global\"\n, \"f\" : \"--force\"\n, \"p\" : \"--parseable\"\n, \"l\" : \"--long\"\n}\n```\n\n```bash\nnpm ls -sgflp\n# just like doing this:\nnpm ls --loglevel silent --global --force --long --parseable\n```\n\n## The Rest of the args\n\nThe config object returned by nopt is given a special member called\n`argv`, which is an object with the following fields:\n\n* `remain`: The remaining args after all the parsing has occurred.\n* `original`: The args as they originally appeared.\n* `cooked`: The args after flags and shorthands are expanded.\n\n## Slicing\n\nNode programs are called with more or less the exact argv as it appears\nin C land, after the v8 and node-specific options have been plucked off.\nAs such, `argv[0]` is always `node` and `argv[1]` is always the\nJavaScript program being run.\n\nThat's usually not very useful to you. So they're sliced off by\ndefault. If you want them, then you can pass in `0` as the last\nargument, or any other number that you'd like to slice off the start of\nthe list.\n", + "readmeFilename": "README.md", + "gitHead": "10a750c9bb99c1950160353459e733ac2aa18cb6", + "bugs": { + "url": "https://github.com/npm/nopt/issues" + }, + "homepage": "https://github.com/npm/nopt#readme", + "_id": "nopt@3.0.6", + "_shasum": "c6465dbf08abcd4db359317f79ac68a646b28ff9", + "_from": "nopt@>=3.0.6 <3.1.0" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/nopt/test/basic.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/nopt/test/basic.js new file mode 100644 index 00000000..d399de92 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/nopt/test/basic.js @@ -0,0 +1,273 @@ +var nopt = require("../") + , test = require('tap').test + + +test("passing a string results in a string", function (t) { + var parsed = nopt({ key: String }, {}, ["--key", "myvalue"], 0) + t.same(parsed.key, "myvalue") + t.end() +}) + +// https://github.com/npm/nopt/issues/31 +test("Empty String results in empty string, not true", function (t) { + var parsed = nopt({ empty: String }, {}, ["--empty"], 0) + t.same(parsed.empty, "") + t.end() +}) + +test("~ path is resolved to $HOME", function (t) { + var path = require("path") + if (!process.env.HOME) process.env.HOME = "/tmp" + var parsed = nopt({key: path}, {}, ["--key=~/val"], 0) + t.same(parsed.key, path.resolve(process.env.HOME, "val")) + t.end() +}) + +// https://github.com/npm/nopt/issues/24 +test("Unknown options are not parsed as numbers", function (t) { + var parsed = nopt({"parse-me": Number}, null, ['--leave-as-is=1.20', '--parse-me=1.20'], 0) + t.equal(parsed['leave-as-is'], '1.20') + t.equal(parsed['parse-me'], 1.2) + t.end() +}); + +// https://github.com/npm/nopt/issues/48 +test("Check types based on name of type", function (t) { + var parsed = nopt({"parse-me": {name: "Number"}}, null, ['--parse-me=1.20'], 0) + t.equal(parsed['parse-me'], 1.2) + t.end() +}) + + +test("Missing types are not parsed", function (t) { + var parsed = nopt({"parse-me": {}}, null, ['--parse-me=1.20'], 0) + //should only contain argv + t.equal(Object.keys(parsed).length, 1) + t.end() +}) + +test("Types passed without a name are not parsed", function (t) { + var parsed = nopt({"parse-me": {}}, {}, ['--parse-me=1.20'], 0) + //should only contain argv + t.equal(Object.keys(parsed).length, 1) + t.end() +}) + +test("other tests", function (t) { + + var util = require("util") + , Stream = require("stream") + , path = require("path") + , url = require("url") + + , shorthands = + { s : ["--loglevel", "silent"] + , d : ["--loglevel", "info"] + , dd : ["--loglevel", "verbose"] + , ddd : ["--loglevel", "silly"] + , noreg : ["--no-registry"] + , reg : ["--registry"] + , "no-reg" : ["--no-registry"] + , silent : ["--loglevel", "silent"] + , verbose : ["--loglevel", "verbose"] + , h : ["--usage"] + , H : ["--usage"] + , "?" : ["--usage"] + , help : ["--usage"] + , v : ["--version"] + , f : ["--force"] + , desc : ["--description"] + , "no-desc" : ["--no-description"] + , "local" : ["--no-global"] + , l : ["--long"] + , p : ["--parseable"] + , porcelain : ["--parseable"] + , g : ["--global"] + } + + , types = + { aoa: Array + , nullstream: [null, Stream] + , date: Date + , str: String + , browser : String + , cache : path + , color : ["always", Boolean] + , depth : Number + , description : Boolean + , dev : Boolean + , editor : path + , force : Boolean + , global : Boolean + , globalconfig : path + , group : [String, Number] + , gzipbin : String + , logfd : [Number, Stream] + , loglevel : ["silent","win","error","warn","info","verbose","silly"] + , long : Boolean + , "node-version" : [false, String] + , npaturl : url + , npat : Boolean + , "onload-script" : [false, String] + , outfd : [Number, Stream] + , parseable : Boolean + , pre: Boolean + , prefix: path + , proxy : url + , "rebuild-bundle" : Boolean + , registry : url + , searchopts : String + , searchexclude: [null, String] + , shell : path + , t: [Array, String] + , tag : String + , tar : String + , tmp : path + , "unsafe-perm" : Boolean + , usage : Boolean + , user : String + , username : String + , userconfig : path + , version : Boolean + , viewer: path + , _exit : Boolean + , path: path + } + + ; [["-v", {version:true}, []] + ,["---v", {version:true}, []] + ,["ls -s --no-reg connect -d", + {loglevel:"info",registry:null},["ls","connect"]] + ,["ls ---s foo",{loglevel:"silent"},["ls","foo"]] + ,["ls --registry blargle", {}, ["ls"]] + ,["--no-registry", {registry:null}, []] + ,["--no-color true", {color:false}, []] + ,["--no-color false", {color:true}, []] + ,["--no-color", {color:false}, []] + ,["--color false", {color:false}, []] + ,["--color --logfd 7", {logfd:7,color:true}, []] + ,["--color=true", {color:true}, []] + ,["--logfd=10", {logfd:10}, []] + ,["--tmp=/tmp -tar=gtar",{tmp:"/tmp",tar:"gtar"},[]] + ,["--tmp=tmp -tar=gtar", + {tmp:path.resolve(process.cwd(), "tmp"),tar:"gtar"},[]] + ,["--logfd x", {}, []] + ,["a -true -- -no-false", {true:true},["a","-no-false"]] + ,["a -no-false", {false:false},["a"]] + ,["a -no-no-true", {true:true}, ["a"]] + ,["a -no-no-no-false", {false:false}, ["a"]] + ,["---NO-no-No-no-no-no-nO-no-no"+ + "-No-no-no-no-no-no-no-no-no"+ + "-no-no-no-no-NO-NO-no-no-no-no-no-no"+ + "-no-body-can-do-the-boogaloo-like-I-do" + ,{"body-can-do-the-boogaloo-like-I-do":false}, []] + ,["we are -no-strangers-to-love "+ + "--you-know=the-rules --and=so-do-i "+ + "---im-thinking-of=a-full-commitment "+ + "--no-you-would-get-this-from-any-other-guy "+ + "--no-gonna-give-you-up "+ + "-no-gonna-let-you-down=true "+ + "--no-no-gonna-run-around false "+ + "--desert-you=false "+ + "--make-you-cry false "+ + "--no-tell-a-lie "+ + "--no-no-and-hurt-you false" + ,{"strangers-to-love":false + ,"you-know":"the-rules" + ,"and":"so-do-i" + ,"you-would-get-this-from-any-other-guy":false + ,"gonna-give-you-up":false + ,"gonna-let-you-down":false + ,"gonna-run-around":false + ,"desert-you":false + ,"make-you-cry":false + ,"tell-a-lie":false + ,"and-hurt-you":false + },["we", "are"]] + ,["-t one -t two -t three" + ,{t: ["one", "two", "three"]} + ,[]] + ,["-t one -t null -t three four five null" + ,{t: ["one", "null", "three"]} + ,["four", "five", "null"]] + ,["-t foo" + ,{t:["foo"]} + ,[]] + ,["--no-t" + ,{t:["false"]} + ,[]] + ,["-no-no-t" + ,{t:["true"]} + ,[]] + ,["-aoa one -aoa null -aoa 100" + ,{aoa:["one", null, '100']} + ,[]] + ,["-str 100" + ,{str:"100"} + ,[]] + ,["--color always" + ,{color:"always"} + ,[]] + ,["--no-nullstream" + ,{nullstream:null} + ,[]] + ,["--nullstream false" + ,{nullstream:null} + ,[]] + ,["--notadate=2011-01-25" + ,{notadate: "2011-01-25"} + ,[]] + ,["--date 2011-01-25" + ,{date: new Date("2011-01-25")} + ,[]] + ,["-cl 1" + ,{config: true, length: 1} + ,[] + ,{config: Boolean, length: Number, clear: Boolean} + ,{c: "--config", l: "--length"}] + ,["--acount bla" + ,{"acount":true} + ,["bla"] + ,{account: Boolean, credentials: Boolean, options: String} + ,{a:"--account", c:"--credentials",o:"--options"}] + ,["--clear" + ,{clear:true} + ,[] + ,{clear:Boolean,con:Boolean,len:Boolean,exp:Boolean,add:Boolean,rep:Boolean} + ,{c:"--con",l:"--len",e:"--exp",a:"--add",r:"--rep"}] + ,["--file -" + ,{"file":"-"} + ,[] + ,{file:String} + ,{}] + ,["--file -" + ,{"file":true} + ,["-"] + ,{file:Boolean} + ,{}] + ,["--path" + ,{"path":null} + ,[]] + ,["--path ." + ,{"path":process.cwd()} + ,[]] + ].forEach(function (test) { + var argv = test[0].split(/\s+/) + , opts = test[1] + , rem = test[2] + , actual = nopt(test[3] || types, test[4] || shorthands, argv, 0) + , parsed = actual.argv + delete actual.argv + for (var i in opts) { + var e = JSON.stringify(opts[i]) + , a = JSON.stringify(actual[i] === undefined ? null : actual[i]) + if (e && typeof e === "object") { + t.deepEqual(e, a) + } else { + t.equal(e, a) + } + } + t.deepEqual(rem, parsed.remain) + }) + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-git-url/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-git-url/.npmignore new file mode 100644 index 00000000..c2658d7d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-git-url/.npmignore @@ -0,0 +1 @@ +node_modules/ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-git-url/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-git-url/.travis.yml new file mode 100644 index 00000000..ab9182bf --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-git-url/.travis.yml @@ -0,0 +1,10 @@ +language: node_js +node_js: + - "5" + - "4" + - iojs + - "0.12" + - "0.10" + - "0.8" +sudo: false +script: "npm test" diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-git-url/CHANGELOG.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-git-url/CHANGELOG.md new file mode 100644 index 00000000..f2d2b94b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-git-url/CHANGELOG.md @@ -0,0 +1,5 @@ +### 1.0.0 (2014-12-25): + +* [`8b3d874`](https://github.com/npm/normalize-git-url/commit/8b3d874afd14f4cdde65d418e0a35a615c746bba) + Initial version, with simple tests. + ([@othiym23](https://github.com/othiym23)) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-git-url/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-git-url/LICENSE new file mode 100644 index 00000000..d21147bf --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-git-url/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2014-2015, Forrest L Norvell + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-git-url/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-git-url/README.md new file mode 100644 index 00000000..da3d78ed --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-git-url/README.md @@ -0,0 +1,40 @@ +# normalize-git-url + +You have a bunch of Git URLs. You want to convert them to a canonical +representation, probably for use inside npm so that it doesn't end up creating +a bunch of superfluous cached origins. You use this package. + +## Usage + +```javascript +var ngu = require('normalize-git-url'); +var normalized = ngu("git+ssh://git@github.com:organization/repo.git#hashbrowns") +// get back: +// { +// url : "ssh://git@github.com/organization/repo.git", +// branch : "hashbrowns" // did u know hashbrowns are delicious? +// } +``` + +## API + +There's just the one function, and all it takes is a single parameter, a non-normalized Git URL. + +### normalizeGitUrl(url) + +* `url` {String} The Git URL (very loosely speaking) to be normalized. + +Returns an object with the following format: + +* `url` {String} The normalized URL. +* `branch` {String} The treeish to be checked out once the repo at `url` is + cloned. It doesn't have to be a branch, but it's a lot easier to intuit what + the output is for with that name. + +## Limitations + +Right now this doesn't try to special-case GitHub too much -- it doesn't ensure +that `.git` is added to the end of URLs, it doesn't prefer `https:` over +`http:` or `ssh:`, it doesn't deal with redirects, and it doesn't try to +resolve symbolic names to treeish hashcodes. For now, it just tries to account +for minor differences in representation. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-git-url/normalize-git-url.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-git-url/normalize-git-url.js new file mode 100644 index 00000000..bb691e11 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-git-url/normalize-git-url.js @@ -0,0 +1,40 @@ +var url = require('url') + +module.exports = function normalize (u) { + var parsed = url.parse(u) + // If parsing actually alters the URL, it is almost certainly an + // scp-style URL, or an invalid one. + var altered = u !== url.format(parsed) + + // git is so tricky! + // if the path is like ssh://foo:22/some/path then it works, but + // it needs the ssh:// + // If the path is like ssh://foo:some/path then it works, but + // only if you remove the ssh:// + if (parsed.protocol) { + parsed.protocol = parsed.protocol.replace(/^git\+/, '') + } + + // figure out what we should check out. + var checkout = parsed.hash && parsed.hash.substr(1) || 'master' + parsed.hash = '' + + var returnedUrl + if (altered) { + if (u.match(/^git\+https?/) && parsed.pathname.match(/\/?:[^0-9]/)) { + returnedUrl = u.replace(/^git\+(.*:[^:]+):(.*)/, '$1/$2') + } else if (u.match(/^git\+file/)) { + returnedUrl = u.replace(/^git\+/, '') + } else { + returnedUrl = u.replace(/^(?:git\+)?ssh:\/\//, '') + } + returnedUrl = returnedUrl.replace(/#[^#]*$/, '') + } else { + returnedUrl = url.format(parsed) + } + + return { + url: returnedUrl, + branch: checkout + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-git-url/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-git-url/package.json new file mode 100644 index 00000000..8dfe6760 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-git-url/package.json @@ -0,0 +1,69 @@ +{ + "name": "normalize-git-url", + "version": "3.0.2", + "description": "Normalizes Git URLs. For npm, but you can use it too.", + "main": "normalize-git-url.js", + "directories": { + "test": "test" + }, + "dependencies": {}, + "devDependencies": { + "tap": "^1.1.0" + }, + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/normalize-git-url.git" + }, + "keywords": [ + "git", + "github", + "url", + "normalize", + "npm" + ], + "author": { + "name": "Forrest L Norvell", + "email": "ogd@aoaioxxysz.net" + }, + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/normalize-git-url/issues" + }, + "homepage": "https://github.com/npm/normalize-git-url", + "gitHead": "59553801a9f389857b48e71e9ab54592815f7d15", + "_id": "normalize-git-url@3.0.2", + "_shasum": "8e5f14be0bdaedb73e07200310aa416c27350fc4", + "_from": "normalize-git-url@3.0.2", + "_npmVersion": "3.8.7", + "_nodeVersion": "4.4.0", + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "dist": { + "shasum": "8e5f14be0bdaedb73e07200310aa416c27350fc4", + "tarball": "https://registry.npmjs.org/normalize-git-url/-/normalize-git-url-3.0.2.tgz" + }, + "maintainers": [ + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "iarna", + "email": "me@re-becca.org" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" + } + ], + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/normalize-git-url-3.0.2.tgz_1460155404934_0.9728229902684689" + }, + "_resolved": "https://registry.npmjs.org/normalize-git-url/-/normalize-git-url-3.0.2.tgz" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-git-url/test/basic.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-git-url/test/basic.js new file mode 100644 index 00000000..4b513a58 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-git-url/test/basic.js @@ -0,0 +1,71 @@ +var test = require('tap').test + +var normalize = require('../normalize-git-url.js') + +test('basic normalization tests', function (t) { + t.same( + normalize('git+ssh://user@hostname:project.git#commit-ish'), + { url: 'user@hostname:project.git', branch: 'commit-ish' } + ) + t.same( + normalize('git+http://user@hostname/project/blah.git#commit-ish'), + { url: 'http://user@hostname/project/blah.git', branch: 'commit-ish' } + ) + t.same( + normalize('git+https://user@hostname/project/blah.git#commit-ish'), + { url: 'https://user@hostname/project/blah.git', branch: 'commit-ish' } + ) + t.same( + normalize('git+https://user@hostname:project/blah.git#commit-ish'), + { url: 'https://user@hostname/project/blah.git', branch: 'commit-ish' } + ) + t.same( + normalize('git+ssh://git@github.com:npm/npm.git#v1.0.27'), + { url: 'git@github.com:npm/npm.git', branch: 'v1.0.27' } + ) + t.same( + normalize('git+ssh://git@github.com:/npm/npm.git#v1.0.28'), + { url: 'git@github.com:/npm/npm.git', branch: 'v1.0.28' } + ) + t.same( + normalize('git+ssh://git@github.com:org/repo#dev'), + { url: 'git@github.com:org/repo', branch: 'dev' } + ) + t.same( + normalize('git+ssh://git@github.com/org/repo#dev'), + { url: 'ssh://git@github.com/org/repo', branch: 'dev' } + ) + t.same( + normalize('git+ssh://foo:22/some/path'), + { url: 'ssh://foo:22/some/path', branch: 'master' } + ) + t.same( + normalize('git@github.com:org/repo#dev'), + { url: 'git@github.com:org/repo', branch: 'dev' } + ) + t.same( + normalize('git+https://github.com/KenanY/node-uuid'), + { url: 'https://github.com/KenanY/node-uuid', branch: 'master' } + ) + t.same( + normalize('git+https://github.com/KenanY/node-uuid#7a018f2d075b03a73409e8356f9b29c9ad4ea2c5'), + { url: 'https://github.com/KenanY/node-uuid', branch: '7a018f2d075b03a73409e8356f9b29c9ad4ea2c5' } + ) + t.same( + normalize('git+ssh://git@git.example.com:b/b.git#v1.0.0'), + { url: 'git@git.example.com:b/b.git', branch: 'v1.0.0' } + ) + t.same( + normalize('git+ssh://git@github.com:npm/npm-proto.git#othiym23/organized'), + { url: 'git@github.com:npm/npm-proto.git', branch: 'othiym23/organized' } + ) + t.same( + normalize('git+file:///foo/bar.git'), + { url: 'file:///foo/bar.git', branch: 'master' } + ) + t.same( + normalize('git+file://C:\\Users\\hello\\testing.git#zkat/windows-files'), + { url: 'file://C:\\Users\\hello\\testing.git', branch: 'zkat/windows-files'} + ) + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/.npmignore new file mode 100644 index 00000000..096746c1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/.npmignore @@ -0,0 +1 @@ +/node_modules/ \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/.travis.yml new file mode 100644 index 00000000..6e5919de --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/.travis.yml @@ -0,0 +1,3 @@ +language: node_js +node_js: + - "0.10" diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/AUTHORS b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/AUTHORS new file mode 100644 index 00000000..10860f72 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/AUTHORS @@ -0,0 +1,4 @@ +# Names sorted by how much code was originally theirs. +Isaac Z. Schlueter +Meryn Stol +Robert Kowalski \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/LICENSE new file mode 100644 index 00000000..9cea2e3c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/LICENSE @@ -0,0 +1,30 @@ +This package contains code originally written by Isaac Z. Schlueter. +Used with permission. + +Copyright (c) Meryn Stol ("Author") +All rights reserved. + +The BSD License + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/README.md new file mode 100644 index 00000000..526745ef --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/README.md @@ -0,0 +1,107 @@ +# normalize-package-data [![Build Status](https://travis-ci.org/npm/normalize-package-data.png?branch=master)](https://travis-ci.org/npm/normalize-package-data) + +normalize-package data exports a function that normalizes package metadata. This data is typically found in a package.json file, but in principle could come from any source - for example the npm registry. + +normalize-package-data is used by [read-package-json](https://npmjs.org/package/read-package-json) to normalize the data it reads from a package.json file. In turn, read-package-json is used by [npm](https://npmjs.org/package/npm) and various npm-related tools. + +## Installation + +``` +npm install normalize-package-data +``` + +## Usage + +Basic usage is really simple. You call the function that normalize-package-data exports. Let's call it `normalizeData`. + +```javascript +normalizeData = require('normalize-package-data') +packageData = fs.readFileSync("package.json") +normalizeData(packageData) +// packageData is now normalized +``` + +#### Strict mode + +You may activate strict validation by passing true as the second argument. + +```javascript +normalizeData = require('normalize-package-data') +packageData = fs.readFileSync("package.json") +warnFn = function(msg) { console.error(msg) } +normalizeData(packageData, true) +// packageData is now normalized +``` + +If strict mode is activated, only Semver 2.0 version strings are accepted. Otherwise, Semver 1.0 strings are accepted as well. Packages must have a name, and the name field must not have contain leading or trailing whitespace. + +#### Warnings + +Optionally, you may pass a "warning" function. It gets called whenever the `normalizeData` function encounters something that doesn't look right. It indicates less than perfect input data. + +```javascript +normalizeData = require('normalize-package-data') +packageData = fs.readFileSync("package.json") +warnFn = function(msg) { console.error(msg) } +normalizeData(packageData, warnFn) +// packageData is now normalized. Any number of warnings may have been logged. +``` + +You may combine strict validation with warnings by passing `true` as the second argument, and `warnFn` as third. + +When `private` field is set to `true`, warnings will be suppressed. + +### Potential exceptions + +If the supplied data has an invalid name or version vield, `normalizeData` will throw an error. Depending on where you call `normalizeData`, you may want to catch these errors so can pass them to a callback. + +## What normalization (currently) entails + +* The value of `name` field gets trimmed (unless in strict mode). +* The value of the `version` field gets cleaned by `semver.clean`. See [documentation for the semver module](https://github.com/isaacs/node-semver). +* If `name` and/or `version` fields are missing, they are set to empty strings. +* If `files` field is not an array, it will be removed. +* If `bin` field is a string, then `bin` field will become an object with `name` set to the value of the `name` field, and `bin` set to the original string value. +* If `man` field is a string, it will become an array with the original string as its sole member. +* If `keywords` field is string, it is considered to be a list of keywords separated by one or more white-space characters. It gets converted to an array by splitting on `\s+`. +* All people fields (`author`, `maintainers`, `contributors`) get converted into objects with name, email and url properties. +* If `bundledDependencies` field (a typo) exists and `bundleDependencies` field does not, `bundledDependencies` will get renamed to `bundleDependencies`. +* If the value of any of the dependencies fields (`dependencies`, `devDependencies`, `optionalDependencies`) is a string, it gets converted into an object with familiar `name=>value` pairs. +* The values in `optionalDependencies` get added to `dependencies`. The `optionalDependencies` array is left untouched. +* As of v2: Dependencies that point at known hosted git providers (currently: github, bitbucket, gitlab) will have their URLs canonicalized, but protocols will be preserved. +* As of v2: Dependencies that use shortcuts for hosted git providers (`org/proj`, `github:org/proj`, `bitbucket:org/proj`, `gitlab:org/proj`, `gist:docid`) will have the shortcut left in place. (In the case of github, the `org/proj` form will be expanded to `github:org/proj`.) THIS MARKS A BREAKING CHANGE FROM V1, where the shorcut was previously expanded to a URL. +* If `description` field does not exist, but `readme` field does, then (more or less) the first paragraph of text that's found in the readme is taken as value for `description`. +* If `repository` field is a string, it will become an object with `url` set to the original string value, and `type` set to `"git"`. +* If `repository.url` is not a valid url, but in the style of "[owner-name]/[repo-name]", `repository.url` will be set to git+https://github.com/[owner-name]/[repo-name].git +* If `bugs` field is a string, the value of `bugs` field is changed into an object with `url` set to the original string value. +* If `bugs` field does not exist, but `repository` field points to a repository hosted on GitHub, the value of the `bugs` field gets set to an url in the form of https://github.com/[owner-name]/[repo-name]/issues . If the repository field points to a GitHub Gist repo url, the associated http url is chosen. +* If `bugs` field is an object, the resulting value only has email and url properties. If email and url properties are not strings, they are ignored. If no valid values for either email or url is found, bugs field will be removed. +* If `homepage` field is not a string, it will be removed. +* If the url in the `homepage` field does not specify a protocol, then http is assumed. For example, `myproject.org` will be changed to `http://myproject.org`. +* If `homepage` field does not exist, but `repository` field points to a repository hosted on GitHub, the value of the `homepage` field gets set to an url in the form of https://github.com/[owner-name]/[repo-name]/ . If the repository field points to a GitHub Gist repo url, the associated http url is chosen. + +### Rules for name field + +If `name` field is given, the value of the name field must be a string. The string may not: + +* start with a period. +* contain the following characters: `/@\s+%` +* contain and characters that would need to be encoded for use in urls. +* resemble the word `node_modules` or `favicon.ico` (case doesn't matter). + +### Rules for version field + +If `version` field is given, the value of the version field must be a valid *semver* string, as determined by the `semver.valid` method. See [documentation for the semver module](https://github.com/isaacs/node-semver). + +### Rules for license field + +The `license` field should be a valid *SPDX license expression* or one of the special values allowed by [validate-npm-package-license](https://npmjs.com/packages/validate-npm-package-license). See [documentation for the license field in package.json](https://docs.npmjs.com/files/package.json#license). + +## Credits + +This package contains code based on read-package-json written by Isaac Z. Schlueter. Used with permisson. + +## License + +normalize-package-data is released under the [BSD 2-Clause License](http://opensource.org/licenses/MIT). +Copyright (c) 2013 Meryn Stol diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/lib/extract_description.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/lib/extract_description.js new file mode 100644 index 00000000..83f10aa0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/lib/extract_description.js @@ -0,0 +1,14 @@ +module.exports = extractDescription + +// Extracts description from contents of a readme file in markdown format +function extractDescription (d) { + if (!d) return; + if (d === "ERROR: No README data found!") return; + // the first block of text before the first heading + // that isn't the first line heading + d = d.trim().split('\n') + for (var s = 0; d[s] && d[s].trim().match(/^(#|$)/); s ++); + var l = d.length + for (var e = s + 1; e < l && d[e].trim(); e ++); + return d.slice(s, e).join(' ').trim() +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/lib/fixer.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/lib/fixer.js new file mode 100644 index 00000000..1409c69c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/lib/fixer.js @@ -0,0 +1,418 @@ +var semver = require("semver") +var validateLicense = require('validate-npm-package-license'); +var hostedGitInfo = require("hosted-git-info") +var isBuiltinModule = require("is-builtin-module") +var depTypes = ["dependencies","devDependencies","optionalDependencies"] +var extractDescription = require("./extract_description") +var url = require("url") +var typos = require("./typos") + +var fixer = module.exports = { + // default warning function + warn: function() {}, + + fixRepositoryField: function(data) { + if (data.repositories) { + this.warn("repositories"); + data.repository = data.repositories[0] + } + if (!data.repository) return this.warn("missingRepository") + if (typeof data.repository === "string") { + data.repository = { + type: "git", + url: data.repository + } + } + var r = data.repository.url || "" + if (r) { + var hosted = hostedGitInfo.fromUrl(r) + if (hosted) { + r = data.repository.url + = hosted.getDefaultRepresentation() == "shortcut" ? hosted.https() : hosted.toString() + } + } + + if (r.match(/github.com\/[^\/]+\/[^\/]+\.git\.git$/)) { + this.warn("brokenGitUrl", r) + } + } + +, fixTypos: function(data) { + Object.keys(typos.topLevel).forEach(function (d) { + if (data.hasOwnProperty(d)) { + this.warn("typo", d, typos.topLevel[d]) + } + }, this) + } + +, fixScriptsField: function(data) { + if (!data.scripts) return + if (typeof data.scripts !== "object") { + this.warn("nonObjectScripts") + delete data.scripts + return + } + Object.keys(data.scripts).forEach(function (k) { + if (typeof data.scripts[k] !== "string") { + this.warn("nonStringScript") + delete data.scripts[k] + } else if (typos.script[k] && !data.scripts[typos.script[k]]) { + this.warn("typo", k, typos.script[k], "scripts") + } + }, this) + } + +, fixFilesField: function(data) { + var files = data.files + if (files && !Array.isArray(files)) { + this.warn("nonArrayFiles") + delete data.files + } else if (data.files) { + data.files = data.files.filter(function(file) { + if (!file || typeof file !== "string") { + this.warn("invalidFilename", file) + return false + } else { + return true + } + }, this) + } + } + +, fixBinField: function(data) { + if (!data.bin) return; + if (typeof data.bin === "string") { + var b = {} + var match + if (match = data.name.match(/^@[^/]+[/](.*)$/)) { + b[match[1]] = data.bin + } else { + b[data.name] = data.bin + } + data.bin = b + } + } + +, fixManField: function(data) { + if (!data.man) return; + if (typeof data.man === "string") { + data.man = [ data.man ] + } + } +, fixBundleDependenciesField: function(data) { + var bdd = "bundledDependencies" + var bd = "bundleDependencies" + if (data[bdd] && !data[bd]) { + data[bd] = data[bdd] + delete data[bdd] + } + if (data[bd] && !Array.isArray(data[bd])) { + this.warn("nonArrayBundleDependencies") + delete data[bd] + } else if (data[bd]) { + data[bd] = data[bd].filter(function(bd) { + if (!bd || typeof bd !== 'string') { + this.warn("nonStringBundleDependency", bd) + return false + } else { + if (!data.dependencies) { + data.dependencies = {} + } + if (!data.dependencies.hasOwnProperty(bd)) { + this.warn("nonDependencyBundleDependency", bd) + data.dependencies[bd] = "*" + } + return true + } + }, this) + } + } + +, fixDependencies: function(data, strict) { + var loose = !strict + objectifyDeps(data, this.warn) + addOptionalDepsToDeps(data, this.warn) + this.fixBundleDependenciesField(data) + + ;['dependencies','devDependencies'].forEach(function(deps) { + if (!(deps in data)) return + if (!data[deps] || typeof data[deps] !== "object") { + this.warn("nonObjectDependencies", deps) + delete data[deps] + return + } + Object.keys(data[deps]).forEach(function (d) { + var r = data[deps][d] + if (typeof r !== 'string') { + this.warn("nonStringDependency", d, JSON.stringify(r)) + delete data[deps][d] + } + var hosted = hostedGitInfo.fromUrl(data[deps][d]) + if (hosted) data[deps][d] = hosted.toString() + }, this) + }, this) + } + +, fixModulesField: function (data) { + if (data.modules) { + this.warn("deprecatedModules") + delete data.modules + } + } + +, fixKeywordsField: function (data) { + if (typeof data.keywords === "string") { + data.keywords = data.keywords.split(/,\s+/) + } + if (data.keywords && !Array.isArray(data.keywords)) { + delete data.keywords + this.warn("nonArrayKeywords") + } else if (data.keywords) { + data.keywords = data.keywords.filter(function(kw) { + if (typeof kw !== "string" || !kw) { + this.warn("nonStringKeyword"); + return false + } else { + return true + } + }, this) + } + } + +, fixVersionField: function(data, strict) { + // allow "loose" semver 1.0 versions in non-strict mode + // enforce strict semver 2.0 compliance in strict mode + var loose = !strict + if (!data.version) { + data.version = "" + return true + } + if (!semver.valid(data.version, loose)) { + throw new Error('Invalid version: "'+ data.version + '"') + } + data.version = semver.clean(data.version, loose) + return true + } + +, fixPeople: function(data) { + modifyPeople(data, unParsePerson) + modifyPeople(data, parsePerson) + } + +, fixNameField: function(data, options) { + if (typeof options === "boolean") options = {strict: options} + else if (typeof options === "undefined") options = {} + var strict = options.strict + if (!data.name && !strict) { + data.name = "" + return + } + if (typeof data.name !== "string") { + throw new Error("name field must be a string.") + } + if (!strict) + data.name = data.name.trim() + ensureValidName(data.name, strict, options.allowLegacyCase) + if (isBuiltinModule(data.name)) + this.warn("conflictingName", data.name) + } + + +, fixDescriptionField: function (data) { + if (data.description && typeof data.description !== 'string') { + this.warn("nonStringDescription") + delete data.description + } + if (data.readme && !data.description) + data.description = extractDescription(data.readme) + if(data.description === undefined) delete data.description; + if (!data.description) this.warn("missingDescription") + } + +, fixReadmeField: function (data) { + if (!data.readme) { + this.warn("missingReadme") + data.readme = "ERROR: No README data found!" + } + } + +, fixBugsField: function(data) { + if (!data.bugs && data.repository && data.repository.url) { + var hosted = hostedGitInfo.fromUrl(data.repository.url) + if(hosted && hosted.bugs()) { + data.bugs = {url: hosted.bugs()} + } + } + else if(data.bugs) { + var emailRe = /^.+@.*\..+$/ + if(typeof data.bugs == "string") { + if(emailRe.test(data.bugs)) + data.bugs = {email:data.bugs} + else if(url.parse(data.bugs).protocol) + data.bugs = {url: data.bugs} + else + this.warn("nonEmailUrlBugsString") + } + else { + bugsTypos(data.bugs, this.warn) + var oldBugs = data.bugs + data.bugs = {} + if(oldBugs.url) { + if(typeof(oldBugs.url) == "string" && url.parse(oldBugs.url).protocol) + data.bugs.url = oldBugs.url + else + this.warn("nonUrlBugsUrlField") + } + if(oldBugs.email) { + if(typeof(oldBugs.email) == "string" && emailRe.test(oldBugs.email)) + data.bugs.email = oldBugs.email + else + this.warn("nonEmailBugsEmailField") + } + } + if(!data.bugs.email && !data.bugs.url) { + delete data.bugs + this.warn("emptyNormalizedBugs") + } + } + } + +, fixHomepageField: function(data) { + if (!data.homepage && data.repository && data.repository.url) { + var hosted = hostedGitInfo.fromUrl(data.repository.url) + if (hosted && hosted.docs()) data.homepage = hosted.docs() + } + if (!data.homepage) return + + if(typeof data.homepage !== "string") { + this.warn("nonUrlHomepage") + return delete data.homepage + } + if(!url.parse(data.homepage).protocol) { + this.warn("missingProtocolHomepage") + data.homepage = "http://" + data.homepage + } + } + +, fixLicenseField: function(data) { + if (!data.license) { + return this.warn("missingLicense") + } else{ + if ( + typeof(data.license) !== 'string' || + data.license.length < 1 + ) { + this.warn("invalidLicense") + } else { + if (!validateLicense(data.license).validForNewPackages) + this.warn("invalidLicense") + } + } + } +} + +function isValidScopedPackageName(spec) { + if (spec.charAt(0) !== '@') return false + + var rest = spec.slice(1).split('/') + if (rest.length !== 2) return false + + return rest[0] && rest[1] && + rest[0] === encodeURIComponent(rest[0]) && + rest[1] === encodeURIComponent(rest[1]) +} + +function isCorrectlyEncodedName(spec) { + return !spec.match(/[\/@\s\+%:]/) && + spec === encodeURIComponent(spec) +} + +function ensureValidName (name, strict, allowLegacyCase) { + if (name.charAt(0) === "." || + !(isValidScopedPackageName(name) || isCorrectlyEncodedName(name)) || + (strict && (!allowLegacyCase) && name !== name.toLowerCase()) || + name.toLowerCase() === "node_modules" || + name.toLowerCase() === "favicon.ico") { + throw new Error("Invalid name: " + JSON.stringify(name)) + } +} + +function modifyPeople (data, fn) { + if (data.author) data.author = fn(data.author) + ;["maintainers", "contributors"].forEach(function (set) { + if (!Array.isArray(data[set])) return; + data[set] = data[set].map(fn) + }) + return data +} + +function unParsePerson (person) { + if (typeof person === "string") return person + var name = person.name || "" + var u = person.url || person.web + var url = u ? (" ("+u+")") : "" + var e = person.email || person.mail + var email = e ? (" <"+e+">") : "" + return name+email+url +} + +function parsePerson (person) { + if (typeof person !== "string") return person + var name = person.match(/^([^\(<]+)/) + var url = person.match(/\(([^\)]+)\)/) + var email = person.match(/<([^>]+)>/) + var obj = {} + if (name && name[0].trim()) obj.name = name[0].trim() + if (email) obj.email = email[1]; + if (url) obj.url = url[1]; + return obj +} + +function addOptionalDepsToDeps (data, warn) { + var o = data.optionalDependencies + if (!o) return; + var d = data.dependencies || {} + Object.keys(o).forEach(function (k) { + d[k] = o[k] + }) + data.dependencies = d +} + +function depObjectify (deps, type, warn) { + if (!deps) return {} + if (typeof deps === "string") { + deps = deps.trim().split(/[\n\r\s\t ,]+/) + } + if (!Array.isArray(deps)) return deps + warn("deprecatedArrayDependencies", type) + var o = {} + deps.filter(function (d) { + return typeof d === "string" + }).forEach(function(d) { + d = d.trim().split(/(:?[@\s><=])/) + var dn = d.shift() + var dv = d.join("") + dv = dv.trim() + dv = dv.replace(/^@/, "") + o[dn] = dv + }) + return o +} + +function objectifyDeps (data, warn) { + depTypes.forEach(function (type) { + if (!data[type]) return; + data[type] = depObjectify(data[type], type, warn) + }) +} + +function bugsTypos(bugs, warn) { + if (!bugs) return + Object.keys(bugs).forEach(function (k) { + if (typos.bugs[k]) { + warn("typo", k, typos.bugs[k], "bugs") + bugs[typos.bugs[k]] = bugs[k] + delete bugs[k] + } + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/lib/make_warning.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/lib/make_warning.js new file mode 100644 index 00000000..0f3aad5f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/lib/make_warning.js @@ -0,0 +1,23 @@ +var util = require("util") +var messages = require("./warning_messages.json") + +module.exports = function() { + var args = Array.prototype.slice.call(arguments, 0) + var warningName = args.shift() + if (warningName == "typo") { + return makeTypoWarning.apply(null,args) + } + else { + var msgTemplate = messages[warningName] ? messages[warningName] : warningName + ": '%s'" + args.unshift(msgTemplate) + return util.format.apply(null, args) + } +} + +function makeTypoWarning (providedName, probableName, field) { + if (field) { + providedName = field + "['" + providedName + "']" + probableName = field + "['" + probableName + "']" + } + return util.format(messages.typo, providedName, probableName) +} \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/lib/normalize.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/lib/normalize.js new file mode 100644 index 00000000..7e68c69a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/lib/normalize.js @@ -0,0 +1,39 @@ +module.exports = normalize + +var fixer = require("./fixer") +normalize.fixer = fixer + +var makeWarning = require("./make_warning") + +var fieldsToFix = ['name','version','description','repository','modules','scripts' + ,'files','bin','man','bugs','keywords','readme','homepage','license'] +var otherThingsToFix = ['dependencies','people', 'typos'] + +var thingsToFix = fieldsToFix.map(function(fieldName) { + return ucFirst(fieldName) + "Field" +}) +// two ways to do this in CoffeeScript on only one line, sub-70 chars: +// thingsToFix = fieldsToFix.map (name) -> ucFirst(name) + "Field" +// thingsToFix = (ucFirst(name) + "Field" for name in fieldsToFix) +thingsToFix = thingsToFix.concat(otherThingsToFix) + +function normalize (data, warn, strict) { + if(warn === true) warn = null, strict = true + if(!strict) strict = false + if(!warn || data.private) warn = function(msg) { /* noop */ } + + if (data.scripts && + data.scripts.install === "node-gyp rebuild" && + !data.scripts.preinstall) { + data.gypfile = true + } + fixer.warn = function() { warn(makeWarning.apply(null, arguments)) } + thingsToFix.forEach(function(thingName) { + fixer["fix" + ucFirst(thingName)](data, strict) + }) + data._id = data.name + "@" + data.version +} + +function ucFirst (string) { + return string.charAt(0).toUpperCase() + string.slice(1); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/lib/safe_format.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/lib/safe_format.js new file mode 100644 index 00000000..08517f14 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/lib/safe_format.js @@ -0,0 +1,9 @@ +var util = require('util') + +module.exports = function() { + var args = Array.prototype.slice.call(arguments, 0) + args.forEach(function(arg) { + if (!arg) throw new TypeError('Bad arguments.') + }) + return util.format.apply(null, arguments) +} \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/lib/typos.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/lib/typos.json new file mode 100644 index 00000000..73590c0a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/lib/typos.json @@ -0,0 +1,25 @@ +{ + "topLevel": { + "dependancies": "dependencies" + ,"dependecies": "dependencies" + ,"depdenencies": "dependencies" + ,"devEependencies": "devDependencies" + ,"depends": "dependencies" + ,"dev-dependencies": "devDependencies" + ,"devDependences": "devDependencies" + ,"devDepenencies": "devDependencies" + ,"devdependencies": "devDependencies" + ,"repostitory": "repository" + ,"repo": "repository" + ,"prefereGlobal": "preferGlobal" + ,"hompage": "homepage" + ,"hampage": "homepage" + ,"autohr": "author" + ,"autor": "author" + ,"contributers": "contributors" + ,"publicationConfig": "publishConfig" + ,"script": "scripts" + }, + "bugs": { "web": "url", "name": "url" }, + "script": { "server": "start", "tests": "test" } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/lib/warning_messages.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/lib/warning_messages.json new file mode 100644 index 00000000..5fd19f32 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/lib/warning_messages.json @@ -0,0 +1,31 @@ +{ + "repositories": "'repositories' (plural) Not supported. Please pick one as the 'repository' field" + ,"missingRepository": "No repository field." + ,"brokenGitUrl": "Probably broken git url: %s" + ,"nonObjectScripts": "scripts must be an object" + ,"nonStringScript": "script values must be string commands" + ,"nonArrayFiles": "Invalid 'files' member" + ,"invalidFilename": "Invalid filename in 'files' list: %s" + ,"nonArrayBundleDependencies": "Invalid 'bundleDependencies' list. Must be array of package names" + ,"nonStringBundleDependency": "Invalid bundleDependencies member: %s" + ,"nonDependencyBundleDependency": "Non-dependency in bundleDependencies: %s" + ,"nonObjectDependencies": "%s field must be an object" + ,"nonStringDependency": "Invalid dependency: %s %s" + ,"deprecatedArrayDependencies": "specifying %s as array is deprecated" + ,"deprecatedModules": "modules field is deprecated" + ,"nonArrayKeywords": "keywords should be an array of strings" + ,"nonStringKeyword": "keywords should be an array of strings" + ,"conflictingName": "%s is also the name of a node core module." + ,"nonStringDescription": "'description' field should be a string" + ,"missingDescription": "No description" + ,"missingReadme": "No README data" + ,"missingLicense": "No license field." + ,"nonEmailUrlBugsString": "Bug string field must be url, email, or {email,url}" + ,"nonUrlBugsUrlField": "bugs.url field must be a string url. Deleted." + ,"nonEmailBugsEmailField": "bugs.email field must be a string email. Deleted." + ,"emptyNormalizedBugs": "Normalized value of bugs field is an empty object. Deleted." + ,"nonUrlHomepage": "homepage field must be a string url. Deleted." + ,"invalidLicense": "license should be a valid SPDX license expression" + ,"missingProtocolHomepage": "homepage field must start with a protocol." + ,"typo": "%s should probably be %s." +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/index.js new file mode 100644 index 00000000..b6cfa616 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/index.js @@ -0,0 +1,10 @@ +'use strict'; +var builtinModules = require('builtin-modules'); + +module.exports = function (str) { + if (typeof str !== 'string') { + throw new TypeError('Expected a string'); + } + + return builtinModules.indexOf(str) !== -1; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/license b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/node_modules/builtin-modules/builtin-modules.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/node_modules/builtin-modules/builtin-modules.json new file mode 100644 index 00000000..72670f6b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/node_modules/builtin-modules/builtin-modules.json @@ -0,0 +1,35 @@ +[ + "assert", + "buffer", + "child_process", + "cluster", + "console", + "constants", + "crypto", + "dgram", + "dns", + "domain", + "events", + "fs", + "http", + "https", + "module", + "net", + "os", + "path", + "process", + "punycode", + "querystring", + "readline", + "repl", + "stream", + "string_decoder", + "timers", + "tls", + "tty", + "url", + "util", + "v8", + "vm", + "zlib" +] diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/node_modules/builtin-modules/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/node_modules/builtin-modules/index.js new file mode 100644 index 00000000..df3474a1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/node_modules/builtin-modules/index.js @@ -0,0 +1,10 @@ +'use strict'; + +var blacklist = [ + 'freelist', + 'sys' +]; + +module.exports = Object.keys(process.binding('natives')).filter(function (el) { + return !/^_|^internal/.test(el) && blacklist.indexOf(el) === -1; +}).sort(); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/node_modules/builtin-modules/license b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/node_modules/builtin-modules/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/node_modules/builtin-modules/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/node_modules/builtin-modules/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/node_modules/builtin-modules/package.json new file mode 100644 index 00000000..453d1632 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/node_modules/builtin-modules/package.json @@ -0,0 +1,70 @@ +{ + "name": "builtin-modules", + "version": "1.1.0", + "description": "List of the Node.js builtin modules", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/builtin-modules.git" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "xo && ava", + "make": "node make.js" + }, + "files": [ + "index.js", + "static.js", + "builtin-modules.json" + ], + "keywords": [ + "builtin", + "built-in", + "builtins", + "node", + "modules", + "core", + "bundled", + "list", + "array", + "names" + ], + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "gitHead": "d317be16fab701f2ac73bc9aa771f60ec052ed66", + "bugs": { + "url": "https://github.com/sindresorhus/builtin-modules/issues" + }, + "homepage": "https://github.com/sindresorhus/builtin-modules#readme", + "_id": "builtin-modules@1.1.0", + "_shasum": "1053955fd994a5746e525e4ac717b81caf07491c", + "_from": "builtin-modules@>=1.0.0 <2.0.0", + "_npmVersion": "2.13.3", + "_nodeVersion": "3.0.0", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "dist": { + "shasum": "1053955fd994a5746e525e4ac717b81caf07491c", + "tarball": "http://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.0.tgz" + }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/node_modules/builtin-modules/readme.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/node_modules/builtin-modules/readme.md new file mode 100644 index 00000000..f1894b18 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/node_modules/builtin-modules/readme.md @@ -0,0 +1,41 @@ +# builtin-modules [![Build Status](https://travis-ci.org/sindresorhus/builtin-modules.svg?branch=master)](https://travis-ci.org/sindresorhus/builtin-modules) + +> List of the Node.js builtin modules + +The list is just a [JSON file](builtin-modules.json) and can be used wherever. + + +## Install + +``` +$ npm install --save builtin-modules +``` + + +## Usage + +```js +var builtinModules = require('builtin-modules'); + +console.log(builinModules); +//=> ['assert', 'buffer', ...] +``` + + +## API + +Returns an array of builtin modules fetched from the running Node.js version. + +### Static list + +This module also comes bundled with a static array of builtin modules generated from the latest Node.js version. You can get it with `require('builtin-modules/static');` + + +## Related + +- [is-builtin-module](https://github.com/sindresorhus/is-builtin-module) - Check if a string matches the name of a Node.js builtin module + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/node_modules/builtin-modules/static.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/node_modules/builtin-modules/static.js new file mode 100644 index 00000000..9508f8f4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/node_modules/builtin-modules/static.js @@ -0,0 +1,2 @@ +'use strict'; +module.exports = require('./builtin-modules.json'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/package.json new file mode 100644 index 00000000..3e0bf21f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/package.json @@ -0,0 +1,73 @@ +{ + "name": "is-builtin-module", + "version": "1.0.0", + "description": "Check if a string matches the name of a Node.js builtin module", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/is-builtin-module.git" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "node test.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "builtin", + "built-in", + "builtins", + "node", + "modules", + "core", + "bundled", + "list", + "array", + "names", + "is", + "detect", + "check", + "match" + ], + "dependencies": { + "builtin-modules": "^1.0.0" + }, + "devDependencies": { + "ava": "0.0.4" + }, + "gitHead": "da55ebf031f3864c5d309e25e49ed816957d70a2", + "bugs": { + "url": "https://github.com/sindresorhus/is-builtin-module/issues" + }, + "homepage": "https://github.com/sindresorhus/is-builtin-module", + "_id": "is-builtin-module@1.0.0", + "_shasum": "540572d34f7ac3119f8f76c30cbc1b1e037affbe", + "_from": "is-builtin-module@>=1.0.0 <2.0.0", + "_npmVersion": "2.7.4", + "_nodeVersion": "0.12.2", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "dist": { + "shasum": "540572d34f7ac3119f8f76c30cbc1b1e037affbe", + "tarball": "http://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz" + }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/readme.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/readme.md new file mode 100644 index 00000000..798dcf43 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/readme.md @@ -0,0 +1,33 @@ +# is-builtin-module [![Build Status](https://travis-ci.org/sindresorhus/is-builtin-module.svg?branch=master)](https://travis-ci.org/sindresorhus/is-builtin-module) + +> Check if a string matches the name of a Node.js builtin module + + +## Install + +``` +$ npm install --save is-builtin-module +``` + + +## Usage + +```js +var isBuiltinModule = require('is-builtin-module'); + +isBuiltinModule('fs'); +//=> true + +isBuiltinModule('unicorn'); +//=> false :( +``` + + +## Related + +- [builtin-modules](https://github.com/sindresorhus/builtin-modules) - List of the Node.js builtin modules + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/package.json new file mode 100644 index 00000000..f8c8aa90 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/package.json @@ -0,0 +1,86 @@ +{ + "name": "normalize-package-data", + "version": "2.3.5", + "author": { + "name": "Meryn Stol", + "email": "merynstol@gmail.com" + }, + "description": "Normalizes data that can be found in package.json files.", + "license": "BSD-2-Clause", + "repository": { + "type": "git", + "url": "git://github.com/npm/normalize-package-data.git" + }, + "main": "lib/normalize.js", + "scripts": { + "test": "tap test/*.js" + }, + "dependencies": { + "hosted-git-info": "^2.1.4", + "is-builtin-module": "^1.0.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + }, + "devDependencies": { + "async": "^1.5.0", + "tap": "^2.2.0", + "underscore": "^1.8.3" + }, + "contributors": [ + { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me" + }, + { + "name": "Meryn Stol", + "email": "merynstol@gmail.com" + }, + { + "name": "Robert Kowalski", + "email": "rok@kowalski.gd" + } + ], + "gitHead": "3dc7756af20b3b1b24c6d75302448ca3659e0a65", + "bugs": { + "url": "https://github.com/npm/normalize-package-data/issues" + }, + "homepage": "https://github.com/npm/normalize-package-data#readme", + "_id": "normalize-package-data@2.3.5", + "_shasum": "8d924f142960e1777e7ffe170543631cc7cb02df", + "_from": "normalize-package-data@>=2.3.5 <2.4.0", + "_npmVersion": "3.3.6", + "_nodeVersion": "5.0.0", + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "dist": { + "shasum": "8d924f142960e1777e7ffe170543631cc7cb02df", + "tarball": "http://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.3.5.tgz" + }, + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + }, + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + { + "name": "meryn", + "email": "merynstol@gmail.com" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.3.5.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/basic.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/basic.js new file mode 100644 index 00000000..12c403ec --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/basic.js @@ -0,0 +1,34 @@ +var tap = require("tap") +var normalize = require("../lib/normalize") +var path = require("path") +var fs = require("fs") + +tap.test("basic test", function (t) { + var p = path.resolve(__dirname, "./fixtures/read-package-json.json") + fs.readFile (p, function (err, contents) { + if (err) throw err; + var originalData = JSON.parse(contents.toString()) + var data = JSON.parse(contents.toString()) + normalize(data) + t.ok(data) + verifyFields(t, data, originalData) + t.end() + }) +}) + +function verifyFields (t, normalized, original) { + t.equal(normalized.version, original.version, "Version field stays same") + t.equal(normalized._id, normalized.name + "@" + normalized.version, "It gets good id.") + t.equal(normalized.name, original.name, "Name stays the same.") + t.type(normalized.author, "object", "author field becomes object") + t.deepEqual(normalized.scripts, original.scripts, "scripts field (object) stays same") + t.equal(normalized.main, original.main) + // optional deps are folded in. + t.deepEqual(normalized.optionalDependencies, + original.optionalDependencies) + t.has(normalized.dependencies, original.optionalDependencies, "opt depedencies are copied into dependencies") + t.has(normalized.dependencies, original.dependencies, "regular depedencies stay in place") + t.deepEqual(normalized.devDependencies, original.devDependencies) + t.type(normalized.bugs, "object", "bugs should become object") + t.equal(normalized.bugs.url, "https://github.com/isaacs/read-package-json/issues") +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/consistency.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/consistency.js new file mode 100644 index 00000000..4082be25 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/consistency.js @@ -0,0 +1,36 @@ +var tap = require("tap") +var normalize = require("../lib/normalize") +var path = require("path") +var fs = require("fs") +var _ = require("underscore") +var async = require("async") + +var data, clonedData +var warn + +tap.test("consistent normalization", function(t) { + path.resolve(__dirname, "./fixtures/read-package-json.json") + fs.readdir (__dirname + "/fixtures", function (err, entries) { + // entries = ['coffee-script.json'] // uncomment to limit to a specific file + verifyConsistency = function(entryName, next) { + warn = function(msg) { + // t.equal("",msg) // uncomment to have some kind of logging of warnings + } + filename = __dirname + "/fixtures/" + entryName + fs.readFile(filename, function(err, contents) { + if (err) return next(err) + data = JSON.parse(contents.toString()) + normalize(data, warn) + clonedData = _.clone(data) + normalize(data, warn) + t.deepEqual(clonedData, data, + "Normalization of " + entryName + " is consistent.") + next(null) + }) // fs.readFile + } // verifyConsistency + async.forEach(entries, verifyConsistency, function(err) { + if (err) throw err + t.end() + }) + }) // fs.readdir +}) // tap.test \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/dependencies.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/dependencies.js new file mode 100644 index 00000000..3e493ab0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/dependencies.js @@ -0,0 +1,44 @@ +var tap = require("tap") +var normalize = require("../lib/normalize") + +var warningMessages = require("../lib/warning_messages.json") +var safeFormat = require("../lib/safe_format") + +tap.test("warn if dependency contains anything else but a string", function(t) { + var a + var warnings = [] + function warn(w) { + warnings.push(w) + } + normalize(a={ + dependencies: { "a": 123}, + devDependencies: { "b": 456}, + optionalDependencies: { "c": 789} + }, warn) + + var wanted1 = safeFormat(warningMessages.nonStringDependency, "a", 123) + var wanted2 = safeFormat(warningMessages.nonStringDependency, "b", 456) + var wanted3 = safeFormat(warningMessages.nonStringDependency, "c", 789) + t.ok(~warnings.indexOf(wanted1), wanted1) + t.ok(~warnings.indexOf(wanted2), wanted2) + t.ok(~warnings.indexOf(wanted3), wanted3) + t.end() +}) + +tap.test("warn if bundleDependencies array contains anything else but strings", function(t) { + var a + var warnings = [] + function warn(w) { + warnings.push(w) + } + normalize(a={ + bundleDependencies: ["abc", 123, {foo:"bar"}] + }, warn) + + var wanted1 = safeFormat(warningMessages.nonStringBundleDependency, 123) + var wanted2 = safeFormat(warningMessages.nonStringBundleDependency, {foo:"bar"}) + var wanted2 = safeFormat(warningMessages.nonDependencyBundleDependency, "abc") + t.ok(~warnings.indexOf(wanted1), wanted1) + t.ok(~warnings.indexOf(wanted2), wanted2) + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/fixtures/async.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/fixtures/async.json new file mode 100644 index 00000000..5e652a6c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/fixtures/async.json @@ -0,0 +1,36 @@ +{ + "name": "async", + "description": "Higher-order functions and common patterns for asynchronous code", + "main": "./lib/async", + "author": "Caolan McMahon", + "version": "0.2.6", + "repository" : { + "type" : "git", + "url" : "http://github.com/caolan/async.git" + }, + "bugs" : { + "url" : "http://github.com/caolan/async/issues" + }, + "licenses" : [ + { + "type" : "MIT", + "url" : "http://github.com/caolan/async/raw/master/LICENSE" + } + ], + "devDependencies": { + "nodeunit": ">0.0.0", + "uglify-js": "1.2.x", + "nodelint": ">0.0.0" + }, + "jam": { + "main": "lib/async.js", + "include": [ + "lib/async.js", + "README.md", + "LICENSE" + ] + }, + "scripts": { + "test": "nodeunit test/test-async.js" + } +} \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/fixtures/badscripts.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/fixtures/badscripts.json new file mode 100644 index 00000000..25feb4c8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/fixtures/badscripts.json @@ -0,0 +1,5 @@ +{ + "name": "bad-scripts-package", + "version": "0.0.1", + "scripts": "foo" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/fixtures/bcrypt.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/fixtures/bcrypt.json new file mode 100644 index 00000000..56e6d81b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/fixtures/bcrypt.json @@ -0,0 +1,56 @@ +{ + "name": "bcrypt", + "description": "A bcrypt library for NodeJS.", + "keywords": [ + "bcrypt", + "password", + "auth", + "authentication", + "encryption", + "crypt", + "crypto" + ], + "main": "./bcrypt", + "version": "0.7.5", + "author": "Nick Campbell (http://github.com/ncb000gt)", + "engines": { + "node": ">= 0.6.0" + }, + "repository": { + "type": "git", + "url": "http://github.com/ncb000gt/node.bcrypt.js.git" + }, + "licenses": [ + { + "type": "MIT" + } + ], + "bugs": { + "url": "http://github.com/ncb000gt/node.bcrypt.js/issues" + }, + "scripts": { + "test": "node-gyp configure build && nodeunit test" + }, + "dependencies": { + "bindings": "1.0.0" + }, + "devDependencies": { + "nodeunit": ">=0.6.4" + }, + "contributors": [ + "Antonio Salazar Cardozo (https://github.com/Shadowfiend)", + "Van Nguyen (https://github.com/thegoleffect)", + "David Trejo (https://github.com/dtrejo)", + "Ben Glow (https://github.com/pixelglow)", + "NewITFarmer.com <> (https://github.com/newitfarmer)", + "Alfred Westerveld (https://github.com/alfredwesterveld)", + "Vincent Côté-Roy (https://github.com/vincentcr)", + "Lloyd Hilaiel (https://github.com/lloyd)", + "Roman Shtylman (https://github.com/shtylman)", + "Vadim Graboys (https://github.com/vadimg)", + "Ben Noorduis <> (https://github.com/bnoordhuis)", + "Nate Rajlich (https://github.com/tootallnate)", + "Sean McArthur (https://github.com/seanmonstar)", + "Fanie Oosthuysen (https://github.com/weareu)" + ] +} \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/fixtures/coffee-script.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/fixtures/coffee-script.json new file mode 100644 index 00000000..a0b60a9d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/fixtures/coffee-script.json @@ -0,0 +1,35 @@ +{ + "name": "coffee-script", + "description": "Unfancy JavaScript", + "keywords": ["javascript", "language", "coffeescript", "compiler"], + "author": "Jeremy Ashkenas", + "version": "1.6.2", + "licenses": [{ + "type": "MIT", + "url": "https://raw.github.com/jashkenas/coffee-script/master/LICENSE" + }], + "engines": { + "node": ">=0.8.0" + }, + "directories" : { + "lib" : "./lib/coffee-script" + }, + "main" : "./lib/coffee-script/coffee-script", + "bin": { + "coffee": "./bin/coffee", + "cake": "./bin/cake" + }, + "scripts": { + "test": "node ./bin/cake test" + }, + "homepage": "http://coffeescript.org", + "bugs": "https://github.com/jashkenas/coffee-script/issues", + "repository": { + "type": "git", + "url": "git://github.com/jashkenas/coffee-script.git" + }, + "devDependencies": { + "uglify-js": "~2.2", + "jison": ">=0.2.0" + } +} \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/fixtures/http-server.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/fixtures/http-server.json new file mode 100644 index 00000000..90c28863 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/fixtures/http-server.json @@ -0,0 +1,53 @@ +{ + "name": "http-server", + "preferGlobal": true, + "version": "0.3.0", + "author": "Nodejitsu ", + "description": "a simple zero-configuration command-line http server", + "contributors": [ + { + "name": "Marak Squires", + "email": "marak@nodejitsu.com" + } + ], + "bin": { + "http-server": "./bin/http-server" + }, + "scripts": { + "start": "node ./bin/http-server", + "test": "vows --spec --isolate", + "predeploy": "echo This will be run before deploying the app", + "postdeploy": "echo This will be run after deploying the app" + }, + "main": "./lib/http-server", + "repository": { + "type": "git", + "url": "https://github.com/nodejitsu/http-server.git" + }, + "keywords": [ + "cli", + "http", + "server" + ], + "dependencies" : { + "colors" : "*", + "flatiron" : "0.1.x", + "optimist" : "0.2.x", + "union" : "0.1.x", + "ecstatic" : "0.1.x", + "plates" : "https://github.com/flatiron/plates/tarball/master" + }, + "analyze": false, + "devDependencies": { + "vows" : "0.5.x", + "request" : "2.1.x" + }, + "bundledDependencies": [ + "union", + "ecstatic" + ], + "license": "MIT", + "engines": { + "node": ">=0.6" + } +} \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/fixtures/movefile.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/fixtures/movefile.json new file mode 100644 index 00000000..59338757 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/fixtures/movefile.json @@ -0,0 +1,21 @@ +{ + "name": "movefile", + "description": "rename implementation working over devices", + "version": "0.2.0", + "author": "yazgazan ", + "main": "./build/Release/movefile", + "keywords": ["move", "file", "rename"], + "repository": "git://github.com/yazgazan/movefile.git", + "directories": { + "lib": "./build/Release/" + }, + "scripts": { + "install": "./node_modules/node-gyp/bin/node-gyp.js configure && ./node_modules/node-gyp/bin/node-gyp.js build" + }, + "engines": { + "node": "*" + }, + "dependencies": { + "node-gyp": "~0.9.1" + } +} \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/fixtures/no-description.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/fixtures/no-description.json new file mode 100644 index 00000000..9ea70b6b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/fixtures/no-description.json @@ -0,0 +1,4 @@ +{ + "name": "foo-bar-package", + "version": "0.0.1" +} \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/fixtures/node-module_exist.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/fixtures/node-module_exist.json new file mode 100644 index 00000000..acc05382 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/fixtures/node-module_exist.json @@ -0,0 +1,26 @@ +{ + "name": "node-module_exist", + "description": "Find if a NodeJS module is available to require or not", + "version": "0.0.1", + "main": "module_exist.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git@gist.github.com:3135914.git" + }, + "homepage": "https://github.com/FGRibreau", + "author": { + "name": "Francois-Guillaume Ribreau", + "url": "http://fgribreau.com.com/" + }, + "devDependencies": { + "nodeunit": "~0.7.4" + }, + "keywords": [ + "core", + "modules" + ], + "license": "MIT" +} \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/fixtures/npm.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/fixtures/npm.json new file mode 100644 index 00000000..2262b313 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/fixtures/npm.json @@ -0,0 +1,135 @@ +{ + "version": "1.2.17", + "name": "npm", + "publishConfig": { + "proprietary-attribs": false + }, + "description": "A package manager for node", + "keywords": [ + "package manager", + "modules", + "install", + "package.json" + ], + "preferGlobal": true, + "config": { + "publishtest": false + }, + "homepage": "https://npmjs.org/doc/", + "author": "Isaac Z. Schlueter (http://blog.izs.me)", + "repository": { + "type": "git", + "url": "https://github.com/isaacs/npm" + }, + "bugs": { + "email": "npm-@googlegroups.com", + "url": "http://github.com/isaacs/npm/issues" + }, + "directories": { + "doc": "./doc", + "man": "./man", + "lib": "./lib", + "bin": "./bin" + }, + "main": "./lib/npm.js", + "bin": "./bin/npm-cli.js", + "dependencies": { + "semver": "~1.1.2", + "ini": "~1.1.0", + "slide": "1", + "abbrev": "~1.0.4", + "graceful-fs": "~1.2.0", + "minimatch": "~0.2.11", + "nopt": "~2.1.1", + "rimraf": "2", + "request": "~2.9", + "which": "1", + "tar": "~0.1.17", + "fstream": "~0.1.22", + "block-stream": "*", + "inherits": "1", + "mkdirp": "~0.3.3", + "read": "~1.0.4", + "lru-cache": "~2.3.0", + "node-gyp": "~0.9.3", + "fstream-npm": "~0.1.3", + "uid-number": "0", + "archy": "0", + "chownr": "0", + "npmlog": "0", + "ansi": "~0.1.2", + "npm-registry-client": "~0.2.18", + "read-package-json": "~0.3.0", + "read-installed": "0", + "glob": "~3.1.21", + "init-package-json": "0.0.6", + "osenv": "0", + "lockfile": "~0.3.0", + "retry": "~0.6.0", + "once": "~1.1.1", + "npmconf": "0", + "opener": "~1.3.0", + "chmodr": "~0.1.0", + "cmd-shim": "~1.1.0" + }, + "bundleDependencies": [ + "semver", + "ini", + "slide", + "abbrev", + "graceful-fs", + "minimatch", + "nopt", + "rimraf", + "request", + "which", + "tar", + "fstream", + "block-stream", + "inherits", + "mkdirp", + "read", + "lru-cache", + "node-gyp", + "fstream-npm", + "uid-number", + "archy", + "chownr", + "npmlog", + "ansi", + "npm-registry-client", + "read-package-json", + "read-installed", + "glob", + "init-package-json", + "osenv", + "lockfile", + "retry", + "once", + "npmconf", + "opener", + "chmodr", + "cmd-shim" + ], + "devDependencies": { + "ronn": "~0.3.6", + "tap": "~0.4.0" + }, + "engines": { + "node": ">=0.6", + "npm": "1" + }, + "scripts": { + "test": "node ./test/run.js && tap test/tap/*.js", + "tap": "tap test/tap/*.js", + "prepublish": "node bin/npm-cli.js prune ; rm -rf test/*/*/node_modules ; make -j4 doc", + "dumpconf": "env | grep npm | sort | uniq", + "echo": "node bin/npm-cli.js" + }, + "licenses": [ + { + "type": "MIT +no-false-attribs", + "url": "https://github.com/isaacs/npm/raw/master/LICENSE" + } + ] +} \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/fixtures/read-package-json.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/fixtures/read-package-json.json new file mode 100644 index 00000000..7d0dae1d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/fixtures/read-package-json.json @@ -0,0 +1,28 @@ +{ + "name": "read-package-json", + "version": "0.1.1", + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "description": "The thing npm uses to read package.json files with semantics and defaults and validation", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/read-package-json.git" + }, + "license": "MIT", + "main": "read-json.js", + "scripts": { + "test": "tap test/*.js" + }, + "dependencies": { + "glob": "~3.1.9", + "lru-cache": "~1.1.0", + "semver": "~1.0.14", + "slide": "~1.1.3" + }, + "devDependencies": { + "tap": "~0.2.5" + }, + "optionalDependencies": { + "npmlog": "0", + "graceful-fs": "~1.1.8" + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/fixtures/request.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/fixtures/request.json new file mode 100644 index 00000000..24189a55 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/fixtures/request.json @@ -0,0 +1,39 @@ +{ + "name": "request", + "description": "Simplified HTTP request client.", + "tags": [ + "http", + "simple", + "util", + "utility" + ], + "version": "2.16.7", + "author": "Mikeal Rogers ", + "repository": { + "type": "git", + "url": "http://github.com/mikeal/request.git" + }, + "bugs": { + "url": "http://github.com/mikeal/request/issues" + }, + "engines": [ + "node >= 0.8.0" + ], + "main": "index.js", + "dependencies": { + "form-data": "~0.0.3", + "mime": "~1.2.7", + "hawk": "~0.10.2", + "node-uuid": "~1.4.0", + "cookie-jar": "~0.2.0", + "aws-sign": "~0.2.0", + "oauth-sign": "~0.2.0", + "forever-agent": "~0.2.0", + "tunnel-agent": "~0.2.0", + "json-stringify-safe": "~3.0.0", + "qs": "~0.5.4" + }, + "scripts": { + "test": "node tests/run.js" + } +} \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/fixtures/underscore.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/fixtures/underscore.json new file mode 100644 index 00000000..bfc8b3d2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/fixtures/underscore.json @@ -0,0 +1,17 @@ +{ + "name" : "underscore", + "description" : "JavaScript's functional programming helper library.", + "homepage" : "http://underscorejs.org", + "keywords" : ["util", "functional", "server", "client", "browser"], + "author" : "Jeremy Ashkenas ", + "repository" : {"type": "git", "url": "git://github.com/documentcloud/underscore.git"}, + "main" : "underscore.js", + "version" : "1.4.4", + "devDependencies": { + "phantomjs": "1.9.0-1" + }, + "scripts": { + "test": "phantomjs test/vendor/runner.js test/index.html?noglobals=true" + }, + "license" : "MIT" +} \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/github-urls.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/github-urls.js new file mode 100644 index 00000000..da78160a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/github-urls.js @@ -0,0 +1,44 @@ +var tap = require("tap") +var normalize = require("../lib/normalize") +var fs = require("fs") +var async = require("async") + +var data +var warn + +tap.test("consistent normalization", function(t) { + var entries = [ + 'read-package-json.json', + 'http-server.json', + "movefile.json", + "node-module_exist.json" + ] + var verifyConsistency = function(entryName, next) { + warn = function(msg) { + // t.equal("",msg) // uncomment to have some kind of logging of warnings + } + var filename = __dirname + "/fixtures/" + entryName + fs.readFile(filename, function(err, contents) { + if (err) return next(err) + data = JSON.parse(contents.toString()) + normalize(data, warn) + if(data.name == "node-module_exist") { + t.same(data.bugs.url, "https://gist.github.com/3135914") + } + if(data.name == "read-package-json") { + t.same(data.bugs.url, "https://github.com/isaacs/read-package-json/issues") + } + if(data.name == "http-server") { + t.same(data.bugs.url, "https://github.com/nodejitsu/http-server/issues") + } + if(data.name == "movefile") { + t.same(data.bugs.url, "https://github.com/yazgazan/movefile/issues") + } + next(null) + }) // fs.readFile + } // verifyConsistency + async.forEach(entries, verifyConsistency, function(err) { + if (err) throw err + t.end() + }) +}) // tap.test diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/mixedcase-names.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/mixedcase-names.js new file mode 100644 index 00000000..a62b6993 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/mixedcase-names.js @@ -0,0 +1,32 @@ +var test = require('tap').test + +var normalize = require('../') +var fixer = normalize.fixer + +test('mixedcase', function (t) { + t.doesNotThrow(function () { + fixer.fixNameField({name: 'foo'}, true) + }) + + t.doesNotThrow(function () { + fixer.fixNameField({name: 'foo'}, false) + }) + + t.doesNotThrow(function () { + fixer.fixNameField({name: 'foo'}) + }) + + t.throws(function () { + fixer.fixNameField({name: 'Foo'}, true) + }, new Error('Invalid name: "Foo"'), 'should throw an error') + + t.throws(function () { + fixer.fixNameField({name: 'Foo'}, {strict: true}) + }, new Error('Invalid name: "Foo"'), 'should throw an error') + + t.doesNotThrow(function () { + fixer.fixNameField({name: 'Foo'}, {strict: true, allowLegacyCase: true}) + }) + + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/normalize.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/normalize.js new file mode 100644 index 00000000..3926938b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/normalize.js @@ -0,0 +1,246 @@ +var tap = require("tap") +var fs = require("fs") +var path = require("path") + +var normalize = require("../lib/normalize") +var warningMessages = require("../lib/warning_messages.json") +var safeFormat = require("../lib/safe_format") + +var rpjPath = path.resolve(__dirname,"./fixtures/read-package-json.json") + +tap.test("normalize some package data", function(t) { + var packageData = require(rpjPath) + var warnings = [] + normalize(packageData, function(warning) { + warnings.push(warning) + }) + // there's no readme data in this particular object + t.equal( warnings.length, 1, "There's exactly one warning.") + fs.readFile(rpjPath, function(err, data) { + if(err) throw err + // Various changes have been made + t.notEqual(packageData, JSON.parse(data), "Output is different from input.") + t.end() + }) +}) + +tap.test("runs without passing warning function", function(t) { + var packageData = require(rpjPath) + fs.readFile(rpjPath, function(err, data) { + if(err) throw err + normalize(JSON.parse(data)) + t.ok(true, "If you read this, this means I'm still alive.") + t.end() + }) +}) + +tap.test("empty object", function(t) { + var packageData = {} + var expect = + { name: '', + version: '', + readme: 'ERROR: No README data found!', + _id: '@' } + + var warnings = [] + function warn(m) { + warnings.push(m) + } + normalize(packageData, warn) + t.same(packageData, expect) + t.same(warnings, [ + warningMessages.missingDescription, + warningMessages.missingRepository, + warningMessages.missingReadme, + warningMessages.missingLicense + ]) + t.end() +}) + +tap.test("core module name", function(t) { + var warnings = [] + function warn(m) { + warnings.push(m) + } + var a + normalize(a={ + name: "http", + readme: "read yourself how about", + homepage: 123, + bugs: "what is this i don't even", + repository: "Hello." + }, warn) + + var expect = [ + safeFormat(warningMessages.conflictingName, 'http'), + warningMessages.nonEmailUrlBugsString, + warningMessages.emptyNormalizedBugs, + warningMessages.nonUrlHomepage, + warningMessages.missingLicense + ] + t.same(warnings, expect) + t.end() +}) + +tap.test("urls required", function(t) { + var warnings = [] + function warn(w) { + warnings.push(w) + } + normalize({ + bugs: { + url: "/1", + email: "not an email address" + } + }, warn) + var a + normalize(a={ + readme: "read yourself how about", + homepage: 123, + bugs: "what is this i don't even", + repository: "Hello." + }, warn) + + console.error(a) + + var expect = + [ warningMessages.missingDescription, + warningMessages.missingRepository, + warningMessages.nonUrlBugsUrlField, + warningMessages.nonEmailBugsEmailField, + warningMessages.emptyNormalizedBugs, + warningMessages.missingReadme, + warningMessages.missingLicense, + warningMessages.nonEmailUrlBugsString, + warningMessages.emptyNormalizedBugs, + warningMessages.nonUrlHomepage, + warningMessages.missingLicense] + t.same(warnings, expect) + t.end() +}) + +tap.test("homepage field must start with a protocol.", function(t) { + var warnings = [] + function warn(w) { + warnings.push(w) + } + var a + normalize(a={ + homepage: 'example.org' + }, warn) + + console.error(a) + + var expect = + [ warningMessages.missingDescription, + warningMessages.missingRepository, + warningMessages.missingReadme, + warningMessages.missingProtocolHomepage, + warningMessages.missingLicense] + t.same(warnings, expect) + t.same(a.homepage, 'http://example.org') + t.end() +}) + +tap.test("license field should be a valid SPDX expression", function(t) { + var warnings = [] + function warn(w) { + warnings.push(w) + } + var a + normalize(a={ + license: 'Apache 2' + }, warn) + + console.error(a) + + var expect = + [ warningMessages.missingDescription, + warningMessages.missingRepository, + warningMessages.missingReadme, + warningMessages.invalidLicense] + t.same(warnings, expect) + t.end() +}) + +tap.test("gist bugs url", function(t) { + var d = { + repository: "git@gist.github.com:123456.git" + } + normalize(d) + t.same(d.repository, { type: 'git', url: 'git+ssh://git@gist.github.com/123456.git' }) + t.same(d.bugs, { url: 'https://gist.github.com/123456' }) + t.end(); +}); + +tap.test("singularize repositories", function(t) { + var d = {repositories:["git@gist.github.com:123456.git"]} + normalize(d) + t.same(d.repository, { type: 'git', url: 'git+ssh://git@gist.github.com/123456.git' }) + t.end() +}); + +tap.test("treat visionmedia/express as github repo", function(t) { + var d = {repository: {type: "git", url: "visionmedia/express"}} + normalize(d) + t.same(d.repository, { type: "git", url: "git+https://github.com/visionmedia/express.git" }) + t.end() +}); + +tap.test("treat isaacs/node-graceful-fs as github repo", function(t) { + var d = {repository: {type: "git", url: "isaacs/node-graceful-fs"}} + normalize(d) + t.same(d.repository, { type: "git", url: "git+https://github.com/isaacs/node-graceful-fs.git" }) + t.end() +}); + +tap.test("homepage field will set to github url if repository is a github repo", function(t) { + var a + normalize(a={ + repository: { type: "git", url: "https://github.com/isaacs/node-graceful-fs" } + }) + t.same(a.homepage, 'https://github.com/isaacs/node-graceful-fs#readme') + t.end() +}) + +tap.test("homepage field will set to github gist url if repository is a gist", function(t) { + var a + normalize(a={ + repository: { type: "git", url: "git@gist.github.com:123456.git" } + }) + t.same(a.homepage, 'https://gist.github.com/123456') + t.end() +}) + +tap.test("homepage field will set to github gist url if repository is a shorthand reference", function(t) { + var a + normalize(a={ + repository: { type: "git", url: "sindresorhus/chalk" } + }) + t.same(a.homepage, 'https://github.com/sindresorhus/chalk#readme') + t.end() +}) + +tap.test("don't mangle github shortcuts in dependencies", function(t) { + var d = {dependencies: {"node-graceful-fs": "isaacs/node-graceful-fs"}} + normalize(d) + t.same(d.dependencies, {"node-graceful-fs": "github:isaacs/node-graceful-fs" }) + t.end() +}); + +tap.test("deprecation warning for array in dependencies fields", function(t) { + var a + var warnings = [] + function warn(w) { + warnings.push(w) + } + normalize(a={ + dependencies: [], + devDependencies: [], + optionalDependencies: [] + }, warn) + t.ok(~warnings.indexOf(safeFormat(warningMessages.deprecatedArrayDependencies, 'dependencies')), "deprecation warning") + t.ok(~warnings.indexOf(safeFormat(warningMessages.deprecatedArrayDependencies, 'devDependencies')), "deprecation warning") + t.ok(~warnings.indexOf(safeFormat(warningMessages.deprecatedArrayDependencies, 'optionalDependencies')), "deprecation warning") + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/scoped.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/scoped.js new file mode 100644 index 00000000..82d2a543 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/scoped.js @@ -0,0 +1,59 @@ +var test = require("tap").test + +var fixNameField = require("../lib/fixer.js").fixNameField +var fixBinField = require("../lib/fixer.js").fixBinField + +test("a simple scoped module has a valid name", function (t) { + var data = {name : "@org/package"} + fixNameField(data, false) + t.equal(data.name, "@org/package", "name was unchanged") + + t.end() +}) + +test("'org@package' is not a valid name", function (t) { + t.throws(function () { + fixNameField({name : "org@package"}, false) + }, "blows up as expected") + + t.end() +}) + +test("'org=package' is not a valid name", function (t) { + t.throws(function () { + fixNameField({name : "org=package"}, false) + }, "blows up as expected") + + t.end() +}) + +test("'@org=sub/package' is not a valid name", function (t) { + t.throws(function () { + fixNameField({name : "@org=sub/package"}, false) + }, "blows up as expected") + + t.end() +}) + +test("'@org/' is not a valid name", function (t) { + t.throws(function () { + fixNameField({name : "@org/"}, false) + }, "blows up as expected") + + t.end() +}) + +test("'@/package' is not a valid name", function (t) { + t.throws(function () { + fixNameField({name : "@/package"}, false) + }, "blows up as expected") + + t.end() +}) + +test("name='@org/package', bin='bin.js' is bin={package:'bin.js'}", function (t) { + var obj = {name : "@org/package", bin: "bin.js"} + fixBinField(obj) + t.isDeeply(obj.bin, {package: 'bin.js'}) + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/scripts.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/scripts.js new file mode 100644 index 00000000..473596ee --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/scripts.js @@ -0,0 +1,24 @@ +var tap = require("tap") +var normalize = require("../lib/normalize") +var path = require("path") +var fs = require("fs") + +tap.test("bad scripts", function (t) { + var p = path.resolve(__dirname, "./fixtures/badscripts.json") + fs.readFile (p, function (err, contents) { + if (err) throw err + var originalData = JSON.parse(contents.toString()) + var data = JSON.parse(contents.toString()) + normalize(data) + t.ok(data) + verifyFields(t, data, originalData) + t.end() + }) +}) + +function verifyFields (t, normalized, original) { + t.equal(normalized.version, original.version, "Version field stays same") + t.equal(normalized.name, original.name, "Name stays the same.") + // scripts is not an object, so it should be deleted + t.notOk(normalized.scripts) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/strict.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/strict.js new file mode 100644 index 00000000..40e09dcf --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/strict.js @@ -0,0 +1,54 @@ +var test = require("tap").test + +var normalize = require("../") + +test("strict", function(t) { + var threw + + try { + threw = false + normalize({name: "X"}, true) + } catch (er) { + threw = true + t.equal(er.message, 'Invalid name: "X"') + } finally { + t.equal(threw, true) + } + + try { + threw = false + normalize({name:" x "}, true) + } catch (er) { + threw = true + t.equal(er.message, 'Invalid name: " x "') + } finally { + t.equal(threw, true) + } + + try { + threw = false + normalize({name:"x",version:"01.02.03"}, true) + } catch (er) { + threw = true + t.equal(er.message, 'Invalid version: "01.02.03"') + } finally { + t.equal(threw, true) + } + + // these should not throw + var slob = {name:" X ",version:"01.02.03",dependencies:{ + y:">01.02.03", + z:"! 99 $$ASFJ(Aawenf90awenf as;naw.3j3qnraw || an elephant" + }} + normalize(slob, false) + t.same(slob, + { name: 'X', + version: '1.2.3', + dependencies: + { y: '>01.02.03', + z: '! 99 $$ASFJ(Aawenf90awenf as;naw.3j3qnraw || an elephant' }, + readme: 'ERROR: No README data found!', + _id: 'X@1.2.3' }) + + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/typo.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/typo.js new file mode 100644 index 00000000..0cd3eb49 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/normalize-package-data/test/typo.js @@ -0,0 +1,133 @@ +var test = require('tap').test + +var normalize = require('../') +var typos = require('../lib/typos.json') +var warningMessages = require("../lib/warning_messages.json") +var safeFormat = require("../lib/safe_format") + +test('typos', function(t) { + var warnings = [] + function warn(m) { + warnings.push(m) + } + + var typoMessage = safeFormat.bind(undefined, warningMessages.typo) + + var expect = + [ warningMessages.missingRepository, + warningMessages.missingLicense, + typoMessage('dependancies', 'dependencies'), + typoMessage('dependecies', 'dependencies'), + typoMessage('depdenencies', 'dependencies'), + typoMessage('devEependencies', 'devDependencies'), + typoMessage('depends', 'dependencies'), + typoMessage('dev-dependencies', 'devDependencies'), + typoMessage('devDependences', 'devDependencies'), + typoMessage('devDepenencies', 'devDependencies'), + typoMessage('devdependencies', 'devDependencies'), + typoMessage('repostitory', 'repository'), + typoMessage('repo', 'repository'), + typoMessage('prefereGlobal', 'preferGlobal'), + typoMessage('hompage', 'homepage'), + typoMessage('hampage', 'homepage'), + typoMessage('autohr', 'author'), + typoMessage('autor', 'author'), + typoMessage('contributers', 'contributors'), + typoMessage('publicationConfig', 'publishConfig') ] + + normalize({"dependancies": "dependencies" + ,"dependecies": "dependencies" + ,"depdenencies": "dependencies" + ,"devEependencies": "devDependencies" + ,"depends": "dependencies" + ,"dev-dependencies": "devDependencies" + ,"devDependences": "devDependencies" + ,"devDepenencies": "devDependencies" + ,"devdependencies": "devDependencies" + ,"repostitory": "repository" + ,"repo": "repository" + ,"prefereGlobal": "preferGlobal" + ,"hompage": "homepage" + ,"hampage": "homepage" + ,"autohr": "author" + ,"autor": "author" + ,"contributers": "contributors" + ,"publicationConfig": "publishConfig" + ,readme:"asdf" + ,name:"name" + ,version:"1.2.5"}, warn) + + t.same(warnings, expect) + + warnings.length = 0 + var expect = + [ warningMessages.missingDescription, + warningMessages.missingRepository, + typoMessage("bugs['web']", "bugs['url']"), + typoMessage("bugs['name']", "bugs['url']"), + warningMessages.nonUrlBugsUrlField, + warningMessages.emptyNormalizedBugs, + warningMessages.missingReadme, + warningMessages.missingLicense] + + normalize({name:"name" + ,version:"1.2.5" + ,bugs:{web:"url",name:"url"}}, warn) + + t.same(warnings, expect) + + warnings.length = 0 + var expect = + [ warningMessages.missingDescription, + warningMessages.missingRepository, + warningMessages.missingReadme, + warningMessages.missingLicense, + typoMessage('script', 'scripts') ] + + normalize({name:"name" + ,version:"1.2.5" + ,script:{server:"start",tests:"test"}}, warn) + + t.same(warnings, expect) + + warnings.length = 0 + expect = + [ warningMessages.missingDescription, + warningMessages.missingRepository, + typoMessage("scripts['server']", "scripts['start']"), + typoMessage("scripts['tests']", "scripts['test']"), + warningMessages.missingReadme, + warningMessages.missingLicense] + + normalize({name:"name" + ,version:"1.2.5" + ,scripts:{server:"start",tests:"test"}}, warn) + + t.same(warnings, expect) + + warnings.length = 0 + expect = + [ warningMessages.missingDescription, + warningMessages.missingRepository, + warningMessages.missingReadme, + warningMessages.missingLicense] + + normalize({name:"name" + ,version:"1.2.5" + ,scripts:{server:"start",tests:"test" + ,start:"start",test:"test"}}, warn) + + t.same(warnings, expect) + + warnings.length = 0 + expect = [] + + normalize({private: true + ,name:"name" + ,version:"1.2.5" + ,scripts:{server:"start",tests:"test"}}, warn) + + t.same(warnings, expect) + + t.end(); +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-cache-filename/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-cache-filename/LICENSE new file mode 100644 index 00000000..20a47625 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-cache-filename/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) npm, Inc. and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-cache-filename/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-cache-filename/README.md new file mode 100644 index 00000000..47bd08a4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-cache-filename/README.md @@ -0,0 +1,21 @@ +# npm-cache-filename + +Given a cache folder and url, return the appropriate cache folder. + +## USAGE + +```javascript +var cf = require('npm-cache-filename'); +console.log(cf('/tmp/cache', 'https://registry.npmjs.org:1234/foo/bar')); +// outputs: /tmp/cache/registry.npmjs.org_1234/foo/bar +``` + +As a bonus, you can also bind it to a specific root path: + +```javascript +var cf = require('npm-cache-filename'); +var getFile = cf('/tmp/cache'); + +console.log(getFile('https://registry.npmjs.org:1234/foo/bar')); +// outputs: /tmp/cache/registry.npmjs.org_1234/foo/bar +``` diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-cache-filename/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-cache-filename/index.js new file mode 100644 index 00000000..50d21792 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-cache-filename/index.js @@ -0,0 +1,24 @@ +var url = require('url');; +var path = require('path');; + +module.exports = cf;; + +function cf(root, u) { + if (!u) + return cf.bind(null, root);; + + u = url.parse(u);; + var h = u.host.replace(/:/g, '_');; + // Strip off any /-rev/... or ?rev=... bits + var revre = /(\?rev=|\?.*?&rev=|\/-rev\/).*$/;; + var parts = u.path.replace(revre, '').split('/').slice(1);; + // Make sure different git references get different folders + if (u.hash && u.hash.length > 1) { + parts.push(u.hash.slice(1));; + };; + var p = [root, h].concat(parts.map(function(part) { + return encodeURIComponent(part).replace(/%/g, '_');; + }));; + + return path.join.apply(path, p);; +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-cache-filename/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-cache-filename/package.json new file mode 100644 index 00000000..b2431b96 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-cache-filename/package.json @@ -0,0 +1,57 @@ +{ + "name": "npm-cache-filename", + "version": "1.0.2", + "description": "Given a cache folder and url, return the appropriate cache folder.", + "main": "index.js", + "dependencies": {}, + "devDependencies": { + "tap": "^1.2.0" + }, + "scripts": { + "test": "tap test.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/npm/npm-cache-filename.git" + }, + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/npm-cache-filename/issues" + }, + "homepage": "https://github.com/npm/npm-cache-filename", + "gitHead": "b7eef12919fdf544a3b83bba73093f7268c40c1e", + "_id": "npm-cache-filename@1.0.2", + "_shasum": "ded306c5b0bfc870a9e9faf823bc5f283e05ae11", + "_from": "npm-cache-filename@1.0.2", + "_npmVersion": "2.12.1", + "_nodeVersion": "2.2.2", + "_npmUser": { + "name": "zkat", + "email": "kat@sykosomatic.org" + }, + "dist": { + "shasum": "ded306c5b0bfc870a9e9faf823bc5f283e05ae11", + "tarball": "http://registry.npmjs.org/npm-cache-filename/-/npm-cache-filename-1.0.2.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + { + "name": "kat", + "email": "kat@lua.cz" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/npm-cache-filename/-/npm-cache-filename-1.0.2.tgz" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-cache-filename/test.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-cache-filename/test.js new file mode 100644 index 00000000..bdca80b5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-cache-filename/test.js @@ -0,0 +1,23 @@ +var test = require('tap').test;; +test('it does the thing it says it does', function(t) { + var cf = require('./');; + + t.equal(cf('/tmp/cache', 'https://foo:134/xyz?adf=foo:bar/baz'), + '/tmp/cache/foo_134/xyz_3Fadf_3Dfoo_3Abar/baz');; + + var getFile = cf('/tmp/cache');; + t.equal(getFile('https://foo:134/xyz?adf=foo:bar/baz'), + '/tmp/cache/foo_134/xyz_3Fadf_3Dfoo_3Abar/baz');; + + t.equal(cf("/tmp", "https://foo:134/xyz/-rev/baz"), + '/tmp/foo_134/xyz') + t.equal(cf("/tmp", "https://foo:134/xyz/?rev=baz"), + '/tmp/foo_134/xyz') + t.equal(cf("/tmp", "https://foo:134/xyz/?foo&rev=baz"), + '/tmp/foo_134/xyz') + t.equal(cf("/tmp", "https://foo:134/xyz-rev/baz"), + '/tmp/foo_134/xyz-rev/baz') + t.equal(cf("/tmp", "git://foo:134/xyz-rev/baz.git#master"), + '/tmp/foo_134/xyz-rev/baz.git/master') + t.end(); +});; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-install-checks/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-install-checks/LICENSE new file mode 100644 index 00000000..3bed8320 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-install-checks/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) Robert Kowalski and Isaac Z. Schlueter ("Authors") +All rights reserved. + +The BSD License + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-install-checks/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-install-checks/README.md new file mode 100644 index 00000000..7da4af14 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-install-checks/README.md @@ -0,0 +1,25 @@ +# npm-install-checks + +A package that contains checks that npm runs during the installation. + +## API + +### .checkEngine(target, npmVer, nodeVer, force, strict, cb) +Check if node/npm version is supported by the package. + +Error type: `ENOTSUP` + +### .checkPlatform(target, force, cb) +Check if OS/Arch is supported by the package. + +Error type: `EBADPLATFORM` + +### .checkCycle(target, ancestors, cb) +Check for cyclic dependencies. + +Error type: `ECYCLE` + +### .checkGit(folder, cb) +Check if a folder is a .git folder. + +Error type: `EISGIT` diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-install-checks/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-install-checks/index.js new file mode 100644 index 00000000..10f214fa --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-install-checks/index.js @@ -0,0 +1,146 @@ +var fs = require("fs") +var path = require("path") +var log = require("npmlog") +var semver = require("semver") + +exports.checkEngine = checkEngine +function checkEngine (target, npmVer, nodeVer, force, strict, cb) { + var nodev = force ? null : nodeVer + , strict = strict || target.engineStrict + , eng = target.engines + if (!eng) return cb() + if (nodev && eng.node && !semver.satisfies(nodev, eng.node) + || eng.npm && !semver.satisfies(npmVer, eng.npm)) { + + if (strict) { + var er = new Error("Unsupported") + er.code = "ENOTSUP" + er.required = eng + er.pkgid = target._id + return cb(er) + } else { + log.warn( "engine", "%s: wanted: %j (current: %j)" + , target._id, eng, {node: nodev, npm: npmVer} ) + } + } + return cb() +} + +exports.checkPlatform = checkPlatform +function checkPlatform (target, force, cb) { + var platform = process.platform + , arch = process.arch + , osOk = true + , cpuOk = true + + if (force) { + return cb() + } + + if (target.os) { + osOk = checkList(platform, target.os) + } + if (target.cpu) { + cpuOk = checkList(arch, target.cpu) + } + if (!osOk || !cpuOk) { + var er = new Error("Unsupported") + er.code = "EBADPLATFORM" + er.os = target.os || ['any'] + er.cpu = target.cpu || ['any'] + er.pkgid = target._id + return cb(er) + } + return cb() +} + +function checkList (value, list) { + var tmp + , match = false + , blc = 0 + if (typeof list === "string") { + list = [list] + } + if (list.length === 1 && list[0] === "any") { + return true + } + for (var i = 0; i < list.length; ++i) { + tmp = list[i] + if (tmp[0] === '!') { + tmp = tmp.slice(1) + if (tmp === value) { + return false + } + ++blc + } else { + match = match || tmp === value + } + } + return match || blc === list.length +} + +exports.checkCycle = checkCycle +function checkCycle (target, ancestors, cb) { + // there are some very rare and pathological edge-cases where + // a cycle can cause npm to try to install a never-ending tree + // of stuff. + // Simplest: + // + // A -> B -> A' -> B' -> A -> B -> A' -> B' -> A -> ... + // + // Solution: Simply flat-out refuse to install any name@version + // that is already in the prototype tree of the ancestors object. + // A more correct, but more complex, solution would be to symlink + // the deeper thing into the new location. + // Will do that if anyone whines about this irl. + // + // Note: `npm install foo` inside of the `foo` package will abort + // earlier if `--force` is not set. However, if it IS set, then + // we need to still fail here, but just skip the first level. Of + // course, it'll still fail eventually if it's a true cycle, and + // leave things in an undefined state, but that's what is to be + // expected when `--force` is used. That is why getPrototypeOf + // is used *twice* here: to skip the first level of repetition. + + var p = Object.getPrototypeOf(Object.getPrototypeOf(ancestors)) + , name = target.name + , version = target.version + while (p && p !== Object.prototype && p[name] !== version) { + p = Object.getPrototypeOf(p) + } + if (p[name] !== version) return cb() + + var er = new Error("Unresolvable cycle detected") + var tree = [target._id, JSON.parse(JSON.stringify(ancestors))] + , t = Object.getPrototypeOf(ancestors) + while (t && t !== Object.prototype) { + if (t === p) t.THIS_IS_P = true + tree.push(JSON.parse(JSON.stringify(t))) + t = Object.getPrototypeOf(t) + } + log.verbose("unresolvable dependency tree", tree) + er.pkgid = target._id + er.code = "ECYCLE" + return cb(er) +} + +exports.checkGit = checkGit +function checkGit (folder, cb) { + // if it's a git repo then don't touch it! + fs.lstat(folder, function (er, s) { + if (er || !s.isDirectory()) return cb() + else checkGit_(folder, cb) + }) +} + +function checkGit_ (folder, cb) { + fs.stat(path.resolve(folder, ".git"), function (er, s) { + if (!er && s.isDirectory()) { + var e = new Error("Appears to be a git repo or submodule.") + e.path = folder + e.code = "EISGIT" + return cb(e) + } + cb() + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-install-checks/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-install-checks/package.json new file mode 100644 index 00000000..9ebfc027 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-install-checks/package.json @@ -0,0 +1,77 @@ +{ + "name": "npm-install-checks", + "version": "1.0.7", + "description": "checks that npm runs during the installation of a module", + "main": "index.js", + "dependencies": { + "npmlog": "0.1 || 1 || 2", + "semver": "^2.3.0 || 3.x || 4 || 5" + }, + "devDependencies": { + "mkdirp": "~0.3.5", + "rimraf": "~2.2.5", + "tap": "^1.2.0" + }, + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/npm/npm-install-checks.git" + }, + "homepage": "https://github.com/npm/npm-install-checks", + "keywords": [ + "npm,", + "install" + ], + "author": { + "name": "Robert Kowalski", + "email": "rok@kowalski.gd" + }, + "license": "BSD-2-Clause", + "bugs": { + "url": "https://github.com/npm/npm-install-checks/issues" + }, + "gitHead": "4882a47d954ceeec567db87219bbc31f64af191e", + "_id": "npm-install-checks@1.0.7", + "_shasum": "6d91aeda0ac96801f1ed7aadee116a6c0a086a57", + "_from": "npm-install-checks@1.0.7", + "_npmVersion": "2.14.19", + "_nodeVersion": "4.2.4", + "_npmUser": { + "name": "zkat", + "email": "kat@sykosomatic.org" + }, + "dist": { + "shasum": "6d91aeda0ac96801f1ed7aadee116a6c0a086a57", + "tarball": "http://registry.npmjs.org/npm-install-checks/-/npm-install-checks-1.0.7.tgz" + }, + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + }, + { + "name": "isaacs", + "email": "i@izs.me" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "robertkowalski", + "email": "rok@kowalski.gd" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" + } + ], + "_npmOperationalInternal": { + "host": "packages-6-west.internal.npmjs.com", + "tmp": "tmp/npm-install-checks-1.0.7.tgz_1455329001145_0.8577833492308855" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-1.0.7.tgz" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-install-checks/test/check-engine.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-install-checks/test/check-engine.js new file mode 100644 index 00000000..a16b13d7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-install-checks/test/check-engine.js @@ -0,0 +1,35 @@ +var test = require("tap").test +var c = require("../index.js").checkEngine + +test("no engine defined", function (t) { + c({ engines: {}}, "1.1.2", "0.2.1", false, true, function (err) { + t.notOk(err, "no error present") + t.end() + }) +}) + +test("node version too old", function (t) { + var target = { engines: { node: "0.10.24" }} + c(target, "1.1.2", "0.10.18", false, true, function (err) { + t.ok(err, "returns an error") + t.equals(err.required.node, "0.10.24") + t.end() + }) +}) + +test("npm version too old", function (t) { + var target = { engines: { npm: "1.3.6" }} + c(target, "1.4.2", "0.2.1", false, true, function (err) { + t.ok(err, "returns an error") + t.equals(err.required.npm, "1.3.6") + t.end() + }) +}) + +test("strict=false does not return an error", function (t) { + var target = { engines: { npm: "1.3.6" }} + c(target, "1.4.2", "0.2.1", false, false, function (err) { + t.notOk(err, "returns no error") + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-install-checks/test/check-git.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-install-checks/test/check-git.js new file mode 100644 index 00000000..d09d0b51 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-install-checks/test/check-git.js @@ -0,0 +1,31 @@ +var test = require("tap").test +var c = require("../index.js").checkGit +var fs = require("fs") +var rimraf = require("rimraf") +var mkdirp = require("mkdirp") +var path = require("path") +var gitFixturePath = path.resolve(__dirname, "out") + +test("is .git repo", function (t) { + mkdirp(gitFixturePath + "/.git", function () { + c(gitFixturePath, function (err) { + t.ok(err, "error present") + t.equal(err.code, "EISGIT") + t.end() + }) + }) +}) + +test("is not a .git repo", function (t) { + c(__dirname, function (err) { + t.notOk(err, "error not present") + t.end() + }) +}) + +test("cleanup", function (t) { + rimraf(gitFixturePath, function () { + t.pass("cleanup") + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-install-checks/test/check-platform.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-install-checks/test/check-platform.js new file mode 100644 index 00000000..eeeb1bce --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-install-checks/test/check-platform.js @@ -0,0 +1,44 @@ +var test = require("tap").test +var c = require("../index.js").checkPlatform + +test("target cpu wrong", function (t) { + var target = {} + target.cpu = "enten-cpu" + target.os = "any" + c(target, false, function (err) { + t.ok(err, "error present") + t.equal(err.code, "EBADPLATFORM") + t.end() + }) +}) + +test("os wrong", function (t) { + var target = {} + target.cpu = "any" + target.os = "enten-os" + c(target, false, function (err) { + t.ok(err, "error present") + t.equal(err.code, "EBADPLATFORM") + t.end() + }) +}) + +test("nothing wrong", function (t) { + var target = {} + target.cpu = "any" + target.os = "any" + c(target, false, function (err) { + t.notOk(err, "no error present") + t.end() + }) +}) + +test("force", function (t) { + var target = {} + target.cpu = "enten-cpu" + target.os = "any" + c(target, true, function (err) { + t.notOk(err, "no error present") + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-package-arg/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-package-arg/LICENSE new file mode 100644 index 00000000..05eeeb88 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-package-arg/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-package-arg/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-package-arg/README.md new file mode 100644 index 00000000..82968a4b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-package-arg/README.md @@ -0,0 +1,105 @@ +# npm-package-arg + +Parse package name and specifier passed to commands like `npm install` or +`npm cache add`. This just parses the text given-- it's worth noting that +`npm` has further logic it applies by looking at your disk to figure out +what ambiguous specifiers are. If you want that logic, please see +[realize-package-specifier]. + +[realize-package-specifier]: https://www.npmjs.org/package/realize-package-specifier + +Arguments look like: `foo@1.2`, `@bar/foo@1.2`, `foo@user/foo`, `http://x.com/foo.tgz`, +`git+https://github.com/user/foo`, `bitbucket:user/foo`, `foo.tar.gz` or `bar` + +## EXAMPLES + +```javascript +var assert = require("assert") +var npa = require("npm-package-arg") + +// Pass in the descriptor, and it'll return an object +var parsed = npa("@bar/foo@1.2") + +// Returns an object like: +{ + raw: '@bar/foo@1.2', // what was passed in + name: "@bar/foo", // the name of the package + scope: "@bar", // the private scope of the package, or null + type: "range", // the type of specifier this is + spec: ">=1.2.0 <1.3.0" // the expanded specifier + rawSpec: "1.2" // the specifier as passed in + } + +// Parsing urls pointing at hosted git services produces a variation: +var parsed = npa("git+https://github.com/user/foo") + +// Returns an object like: +{ + raw: 'git+https://github.com/user/foo', + scope: null, + name: null, + rawSpec: 'git+https://github.com/user/foo', + spec: 'user/foo', + type: 'hosted', + hosted: { + type: 'github', + ssh: 'git@github.com:user/foo.git', + sshurl: 'git+ssh://git@github.com/user/foo.git', + https: 'https://github.com/user/foo.git', + directUrl: 'https://raw.githubusercontent.com/user/foo/master/package.json' + } +} + +// Completely unreasonable invalid garbage throws an error +// Make sure you wrap this in a try/catch if you have not +// already sanitized the inputs! +assert.throws(function() { + npa("this is not \0 a valid package name or url") +}) +``` + +## USING + +`var npa = require('npm-package-arg')` + +* var result = npa(*arg*) + +Parses *arg* and returns a result object detailing what *arg* is. + +*arg* -- a package descriptor, like: `foo@1.2`, or `foo@user/foo`, or +`http://x.com/foo.tgz`, or `git+https://github.com/user/foo` + +## RESULT OBJECT + +The objects that are returned by npm-package-arg contain the following +keys: + +* `name` - If known, the `name` field expected in the resulting pkg. +* `type` - One of the following strings: + * `git` - A git repo + * `hosted` - A hosted project, from github, bitbucket or gitlab. Originally + either a full url pointing at one of these services or a shorthand like + `user/project` or `github:user/project` for github or `bitbucket:user/project` + for bitbucket. + * `tag` - A tagged version, like `"foo@latest"` + * `version` - A specific version number, like `"foo@1.2.3"` + * `range` - A version range, like `"foo@2.x"` + * `local` - A local file or folder path + * `remote` - An http url (presumably to a tgz) +* `spec` - The "thing". URL, the range, git repo, etc. +* `hosted` - If type=hosted this will be an object with the following keys: + * `type` - github, bitbucket or gitlab + * `ssh` - The ssh path for this git repo + * `sshUrl` - The ssh URL for this git repo + * `httpsUrl` - The HTTPS URL for this git repo + * `directUrl` - The URL for the package.json in this git repo +* `raw` - The original un-modified string that was provided. +* `rawSpec` - The part after the `name@...`, as it was originally + provided. +* `scope` - If a name is something like `@org/module` then the `scope` + field will be set to `org`. If it doesn't have a scoped name, then + scope is `null`. + +If you only include a name and no specifier part, eg, `foo` or `foo@` then +a default of `latest` will be used (as of 4.1.0). This is contrast with +previous behavior where `*` was used. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-package-arg/npa.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-package-arg/npa.js new file mode 100644 index 00000000..8989049e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-package-arg/npa.js @@ -0,0 +1,184 @@ +var url = require("url") +var assert = require("assert") +var util = require("util") +var semver = require("semver") +var path = require("path") +var HostedGit = require("hosted-git-info") + +module.exports = npa + +var isWindows = process.platform === "win32" || global.FAKE_WINDOWS +var slashRe = isWindows ? /\\|[/]/ : /[/]/ + +var parseName = /^(?:@([^/]+?)[/])?([^/]+?)$/ +var nameAt = /^(@([^/]+?)[/])?([^/]+?)@/ +var debug = util.debuglog ? util.debuglog("npa") + : /\bnpa\b/i.test(process.env.NODE_DEBUG || "") + ? function () { + console.error("NPA: " + util.format.apply(util, arguments).split("\n").join("\nNPA: ")) + } : function () {} + +function validName (name) { + if (!name) { + debug("not a name %j", name) + return false + } + var n = name.trim() + if (!n || n.charAt(0) === "." + || !n.match(/^[a-zA-Z0-9]/) + || n.match(/[/()&?#|<>@:%\s\\*'"!~`]/) + || n.toLowerCase() === "node_modules" + || n !== encodeURIComponent(n) + || n.toLowerCase() === "favicon.ico") { + debug("not a valid name %j", name) + return false + } + return n +} + +function npa (arg) { + assert.equal(typeof arg, "string") + arg = arg.trim() + + var res = new Result + res.raw = arg + res.scope = null + + // See if it's something like foo@... + var nameparse = arg.match(nameAt) + debug("nameparse", nameparse) + if (nameparse && validName(nameparse[3]) && + (!nameparse[2] || validName(nameparse[2]))) { + res.name = (nameparse[1] || "") + nameparse[3] + if (nameparse[2]) + res.scope = "@" + nameparse[2] + arg = arg.substr(nameparse[0].length) + } else { + res.name = null + } + + res.rawSpec = arg + res.spec = arg + + var urlparse = url.parse(arg) + debug("urlparse", urlparse) + + // windows paths look like urls + // don't be fooled! + if (isWindows && urlparse && urlparse.protocol && + urlparse.protocol.match(/^[a-zA-Z]:$/)) { + debug("windows url-ish local path", urlparse) + urlparse = {} + } + + if (urlparse.protocol || HostedGit.fromUrl(arg)) { + return parseUrl(res, arg, urlparse) + } + + // at this point, it's not a url, and not hosted + // If it's a valid name, and doesn't already have a name, then assume + // $name@"" range + // + // if it's got / chars in it, then assume that it's local. + + if (res.name) { + if (arg == '') arg = 'latest' + var version = semver.valid(arg, true) + var range = semver.validRange(arg, true) + // foo@... + if (version) { + res.spec = version + res.type = "version" + } else if (range) { + res.spec = range + res.type = "range" + } else if (slashRe.test(arg)) { + parseLocal(res, arg) + } else { + res.type = "tag" + res.spec = arg + } + } else { + var p = arg.match(parseName) + if (p && validName(p[2]) && + (!p[1] || validName(p[1]))) { + res.type = "tag" + res.spec = "latest" + res.rawSpec = "" + res.name = arg + if (p[1]) + res.scope = "@" + p[1] + } else { + parseLocal(res, arg) + } + } + + return res +} + +function parseLocal (res, arg) { + // turns out nearly every character is allowed in fs paths + if (/\0/.test(arg)) { + throw new Error("Invalid Path: " + JSON.stringify(arg)) + } + res.type = "local" + res.spec = path.resolve(arg) +} + +function parseUrl (res, arg, urlparse) { + var gitHost = HostedGit.fromUrl(arg) + if (gitHost) { + res.type = "hosted" + res.spec = gitHost.toString(), + res.hosted = { + type: gitHost.type, + ssh: gitHost.ssh(), + sshUrl: gitHost.sshurl(), + httpsUrl: gitHost.https(), + gitUrl: gitHost.git(), + shortcut: gitHost.shortcut(), + directUrl: gitHost.file("package.json") + } + return res + } + // check the protocol, and then see if it's git or not + switch (urlparse.protocol) { + case "git:": + case "git+http:": + case "git+https:": + case "git+rsync:": + case "git+ftp:": + case "git+ssh:": + case "git+file:": + res.type = "git" + res.spec = arg.replace(/^git[+]/, "") + break + + case "http:": + case "https:": + res.type = "remote" + res.spec = arg + break + + case "file:": + res.type = "local" + res.spec = urlparse.pathname + break + + default: + throw new Error("Unsupported URL Type: " + arg) + break + } + + return res +} + + +function Result () { + if (!(this instanceof Result)) return new Result +} +Result.prototype.name = null +Result.prototype.type = null +Result.prototype.spec = null +Result.prototype.raw = null +Result.prototype.hosted = null diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-package-arg/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-package-arg/package.json new file mode 100644 index 00000000..2a57f73b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-package-arg/package.json @@ -0,0 +1,62 @@ +{ + "name": "npm-package-arg", + "version": "4.1.0", + "description": "Parse the things that can be arguments to `npm install`", + "main": "npa.js", + "directories": { + "test": "test" + }, + "dependencies": { + "hosted-git-info": "^2.1.4", + "semver": "4 || 5" + }, + "devDependencies": { + "tap": "^1.2.0" + }, + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/npm-package-arg.git" + }, + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/npm-package-arg/issues" + }, + "homepage": "https://github.com/npm/npm-package-arg", + "gitHead": "383b4783a076b825815be51eb1ab2e4bb8a1e1fc", + "_id": "npm-package-arg@4.1.0", + "_shasum": "2e015f8ac00737cb97f997c9cbf059f42a74527d", + "_from": "npm-package-arg@>=4.1.0 <4.2.0", + "_npmVersion": "3.4.0", + "_nodeVersion": "4.2.1", + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "dist": { + "shasum": "2e015f8ac00737cb97f997c9cbf059f42a74527d", + "tarball": "http://registry.npmjs.org/npm-package-arg/-/npm-package-arg-4.1.0.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "iarna", + "email": "me@re-becca.org" + } + ], + "_resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-4.1.0.tgz" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-package-arg/test/basic.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-package-arg/test/basic.js new file mode 100644 index 00000000..b72826b9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-package-arg/test/basic.js @@ -0,0 +1,168 @@ +var npa = require("../npa.js") +var path = require("path") + +require("tap").test("basic", function (t) { + t.setMaxListeners(999) + + var tests = { + "foo@1.2": { + name: "foo", + type: "range", + spec: ">=1.2.0 <1.3.0", + raw: "foo@1.2", + rawSpec: "1.2" + }, + + "@foo/bar": { + raw: "@foo/bar", + name: "@foo/bar", + scope: "@foo", + rawSpec: "", + spec: "latest", + type: "tag" + }, + + "@foo/bar@": { + raw: "@foo/bar@", + name: "@foo/bar", + scope: "@foo", + rawSpec: "", + spec: "latest", + type: "tag" + }, + + "@foo/bar@baz": { + raw: "@foo/bar@baz", + name: "@foo/bar", + scope: "@foo", + rawSpec: "baz", + spec: "baz", + type: "tag" + }, + + "@f fo o al/ a d s ;f ": { + raw: "@f fo o al/ a d s ;f", + name: null, + rawSpec: "@f fo o al/ a d s ;f", + spec: path.resolve("@f fo o al/ a d s ;f"), + type: "local" + }, + + "foo@1.2.3": { + name: "foo", + type: "version", + spec: "1.2.3", + raw: "foo@1.2.3" + }, + + "foo@=v1.2.3": { + name: "foo", + type: "version", + spec: "1.2.3", + raw: "foo@=v1.2.3", + rawSpec: "=v1.2.3" + }, + + "git+ssh://git@notgithub.com/user/foo#1.2.3": { + name: null, + type: "git", + spec: "ssh://git@notgithub.com/user/foo#1.2.3", + raw: "git+ssh://git@notgithub.com/user/foo#1.2.3" + }, + + "git+file://path/to/repo#1.2.3": { + name: null, + type: "git", + spec: "file://path/to/repo#1.2.3", + raw: "git+file://path/to/repo#1.2.3" + }, + + "git://notgithub.com/user/foo": { + name: null, + type: "git", + spec: "git://notgithub.com/user/foo", + raw: "git://notgithub.com/user/foo" + }, + + "@foo/bar@git+ssh://notgithub.com/user/foo": { + name: "@foo/bar", + scope: "@foo", + spec: "ssh://notgithub.com/user/foo", + rawSpec: "git+ssh://notgithub.com/user/foo", + raw: "@foo/bar@git+ssh://notgithub.com/user/foo" + }, + + "/path/to/foo": { + name: null, + type: "local", + spec: path.resolve(__dirname, "/path/to/foo"), + raw: "/path/to/foo" + }, + + "file:path/to/foo": { + name: null, + type: "local", + spec: "path/to/foo", + raw: "file:path/to/foo" + }, + + "file:~/path/to/foo": { + name: null, + type: "local", + spec: "~/path/to/foo", + raw: "file:~/path/to/foo" + }, + + "file:../path/to/foo": { + name: null, + type: "local", + spec: "../path/to/foo", + raw: "file:../path/to/foo" + }, + + "file:///path/to/foo": { + name: null, + type: "local", + spec: "/path/to/foo", + raw: "file:///path/to/foo" + }, + + "https://server.com/foo.tgz": { + name: null, + type: "remote", + spec: "https://server.com/foo.tgz", + raw: "https://server.com/foo.tgz" + }, + + "foo@latest": { + name: "foo", + type: "tag", + spec: "latest", + raw: "foo@latest" + }, + + "foo": { + name: "foo", + type: "tag", + spec: "latest", + raw: "foo" + } + } + + Object.keys(tests).forEach(function (arg) { + var res = npa(arg) + t.type(res, "Result", arg + " is result") + t.has(res, tests[arg], arg + " matches expectations") + }) + + // Completely unreasonable invalid garbage throws an error + t.throws(function() { + npa("this is not a \0 valid package name or url") + }) + + t.throws(function() { + npa("gopher://yea right") + }, "Unsupported URL Type: gopher://yea right") + + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-package-arg/test/bitbucket.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-package-arg/test/bitbucket.js new file mode 100644 index 00000000..1dff34ff --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-package-arg/test/bitbucket.js @@ -0,0 +1,82 @@ +var npa = require("../npa.js") +var path = require("path") + +require("tap").test("basic", function (t) { + t.setMaxListeners(999) + + var tests = { + "bitbucket:user/foo-js": { + name: null, + type: "hosted", + hosted: { type: "bitbucket" }, + spec: "bitbucket:user/foo-js", + raw: "bitbucket:user/foo-js" + }, + + "bitbucket:user/foo-js#bar/baz": { + name: null, + type: "hosted", + hosted: { type: "bitbucket" }, + spec: "bitbucket:user/foo-js#bar/baz", + raw: "bitbucket:user/foo-js#bar/baz" + }, + + "bitbucket:user..blerg--/..foo-js# . . . . . some . tags / / /": { + name: null, + type: "hosted", + hosted: { type: "bitbucket" }, + spec: "bitbucket:user..blerg--/..foo-js# . . . . . some . tags / / /", + raw: "bitbucket:user..blerg--/..foo-js# . . . . . some . tags / / /" + }, + + "bitbucket:user/foo-js#bar/baz/bin": { + name: null, + type: "hosted", + hosted: { type: "bitbucket" }, + spec: "bitbucket:user/foo-js#bar/baz/bin", + raw: "bitbucket:user/foo-js#bar/baz/bin" + }, + + "foo@bitbucket:user/foo-js": { + name: "foo", + type: "hosted", + hosted: { type: "bitbucket" }, + spec: "bitbucket:user/foo-js", + raw: "foo@bitbucket:user/foo-js" + }, + + "git+ssh://git@bitbucket.org/user/foo#1.2.3": { + name: null, + type: "hosted", + hosted: { type: "bitbucket" }, + spec: "git+ssh://git@bitbucket.org/user/foo.git#1.2.3", + raw: "git+ssh://git@bitbucket.org/user/foo#1.2.3" + }, + + "https://bitbucket.org/user/foo.git": { + name: null, + type: "hosted", + hosted: { type: "bitbucket" }, + spec: "git+https://bitbucket.org/user/foo.git", + raw: "https://bitbucket.org/user/foo.git" + }, + + "@foo/bar@git+ssh://bitbucket.org/user/foo": { + name: "@foo/bar", + scope: "@foo", + type: "hosted", + hosted: { type: "bitbucket" }, + spec: "git+ssh://git@bitbucket.org/user/foo.git", + rawSpec: "git+ssh://bitbucket.org/user/foo", + raw: "@foo/bar@git+ssh://bitbucket.org/user/foo" + } + } + + Object.keys(tests).forEach(function (arg) { + var res = npa(arg) + t.type(res, "Result", arg + " is a result") + t.has(res, tests[arg], arg + " matches expectations") + }) + + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-package-arg/test/github.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-package-arg/test/github.js new file mode 100644 index 00000000..a2c14600 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-package-arg/test/github.js @@ -0,0 +1,106 @@ +var npa = require("../npa.js") +var path = require("path") + +require("tap").test("basic", function (t) { + t.setMaxListeners(999) + + var tests = { + "user/foo-js": { + name: null, + type: "hosted", + hosted: { type: "github" }, + spec: "github:user/foo-js", + raw: "user/foo-js" + }, + + "user/foo-js#bar/baz": { + name: null, + type: "hosted", + hosted: { type: "github" }, + spec: "github:user/foo-js#bar/baz", + raw: "user/foo-js#bar/baz" + }, + + "user..blerg--/..foo-js# . . . . . some . tags / / /": { + name: null, + type: "hosted", + hosted: { type: "github" }, + spec: "github:user..blerg--/..foo-js# . . . . . some . tags / / /", + raw: "user..blerg--/..foo-js# . . . . . some . tags / / /" + }, + + "user/foo-js#bar/baz/bin": { + name: null, + type: "hosted", + hosted: { type: "github" }, + raw: "github:user/foo-js#bar/baz/bin", + raw: "user/foo-js#bar/baz/bin" + }, + + "foo@user/foo-js": { + name: "foo", + type: "hosted", + hosted: { type: "github" }, + spec: "github:user/foo-js", + raw: "foo@user/foo-js" + }, + + "github:user/foo-js": { + name: null, + type: "hosted", + hosted: { type: "github" }, + spec: "github:user/foo-js", + raw: "github:user/foo-js" + }, + + "git+ssh://git@github.com/user/foo#1.2.3": { + name: null, + type: "hosted", + hosted: { type: "github" }, + spec: "git+ssh://git@github.com/user/foo.git#1.2.3", + raw: "git+ssh://git@github.com/user/foo#1.2.3" + }, + + "git://github.com/user/foo": { + name: null, + type: "hosted", + hosted: { type: "github" }, + spec: "git://github.com/user/foo.git", + raw: "git://github.com/user/foo" + }, + + "https://github.com/user/foo.git": { + name: null, + type: "hosted", + hosted: { type: "github" }, + spec: "git+https://github.com/user/foo.git", + raw: "https://github.com/user/foo.git" + }, + + "@foo/bar@git+ssh://github.com/user/foo": { + name: "@foo/bar", + scope: "@foo", + type: "hosted", + hosted: { type: "github" }, + spec: "git+ssh://git@github.com/user/foo.git", + rawSpec: "git+ssh://github.com/user/foo", + raw: "@foo/bar@git+ssh://github.com/user/foo" + }, + + "foo@bar/foo": { + name: "foo", + type: "hosted", + hosted: { type: "github" }, + spec: "github:bar/foo", + raw: "foo@bar/foo" + } + } + + Object.keys(tests).forEach(function (arg) { + var res = npa(arg) + t.type(res, "Result", arg + " is a result") + t.has(res, tests[arg], arg + " matches expectations") + }) + + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-package-arg/test/gitlab.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-package-arg/test/gitlab.js new file mode 100644 index 00000000..c9a8ef9f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-package-arg/test/gitlab.js @@ -0,0 +1,82 @@ +var npa = require("../npa.js") +var path = require("path") + +require("tap").test("basic", function (t) { + t.setMaxListeners(999) + + var tests = { + "gitlab:user/foo-js": { + name: null, + type: "hosted", + hosted: { type: "gitlab" }, + raw: "gitlab:user/foo-js", + raw: "gitlab:user/foo-js" + }, + + "gitlab:user/foo-js#bar/baz": { + name: null, + type: "hosted", + hosted: { type: "gitlab" }, + raw: "gitlab:user/foo-js#bar/baz", + raw: "gitlab:user/foo-js#bar/baz" + }, + + "gitlab:user..blerg--/..foo-js# . . . . . some . tags / / /": { + name: null, + type: "hosted", + hosted: { type: "gitlab" }, + spec: "gitlab:user..blerg--/..foo-js# . . . . . some . tags / / /", + raw: "gitlab:user..blerg--/..foo-js# . . . . . some . tags / / /" + }, + + "gitlab:user/foo-js#bar/baz/bin": { + name: null, + type: "hosted", + hosted: { type: "gitlab" }, + spec: "gitlab:user/foo-js#bar/baz/bin", + raw: "gitlab:user/foo-js#bar/baz/bin" + }, + + "foo@gitlab:user/foo-js": { + name: "foo", + type: "hosted", + hosted: { type: "gitlab" }, + spec: "gitlab:user/foo-js", + raw: "foo@gitlab:user/foo-js" + }, + + "git+ssh://git@gitlab.com/user/foo#1.2.3": { + name: null, + type: "hosted", + hosted: { type: "gitlab" }, + spec: "git+ssh://git@gitlab.com/user/foo.git#1.2.3", + raw: "git+ssh://git@gitlab.com/user/foo#1.2.3" + }, + + "https://gitlab.com/user/foo.git": { + name: null, + type: "hosted", + hosted: { type: "gitlab" }, + spec: "git+https://gitlab.com/user/foo.git", + raw: "https://gitlab.com/user/foo.git" + }, + + "@foo/bar@git+ssh://gitlab.com/user/foo": { + name: "@foo/bar", + scope: "@foo", + type: "hosted", + hosted: { type: "gitlab" }, + spec: "git+ssh://git@gitlab.com/user/foo.git", + rawSpec: "git+ssh://gitlab.com/user/foo", + raw: "@foo/bar@git+ssh://gitlab.com/user/foo" + } + } + + Object.keys(tests).forEach(function (arg) { + var res = npa(arg) + t.type(res, "Result", arg + " is a result") + t.has(res, tests[arg], arg + " matches expectations") + }) + + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-package-arg/test/windows.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-package-arg/test/windows.js new file mode 100644 index 00000000..e3c8ba6b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-package-arg/test/windows.js @@ -0,0 +1,41 @@ +global.FAKE_WINDOWS = true + +var npa = require("../npa.js") +var test = require("tap").test +var path = require("path") + +var cases = { + "C:\\x\\y\\z": { + raw: "C:\\x\\y\\z", + scope: null, + name: null, + rawSpec: "C:\\x\\y\\z", + spec: path.resolve("C:\\x\\y\\z"), + type: "local" + }, + "foo@C:\\x\\y\\z": { + raw: "foo@C:\\x\\y\\z", + scope: null, + name: "foo", + rawSpec: "C:\\x\\y\\z", + spec: path.resolve("C:\\x\\y\\z"), + type: "local" + }, + "foo@/foo/bar/baz": { + raw: "foo@/foo/bar/baz", + scope: null, + name: "foo", + rawSpec: "/foo/bar/baz", + spec: path.resolve("/foo/bar/baz"), + type: "local" + } +} + +test("parse a windows path", function (t) { + Object.keys(cases).forEach(function (c) { + var expect = cases[c] + var actual = npa(c) + t.same(actual, expect, c) + }) + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/.npmignore new file mode 100644 index 00000000..bea2db62 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/.npmignore @@ -0,0 +1,5 @@ +test/fixtures/cache +node_modules +npm-debug.log +.eslintrc +.jshintrc diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/.travis.yml new file mode 100644 index 00000000..2993ae58 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/.travis.yml @@ -0,0 +1,12 @@ +language: node_js +node_js: + - "4" + - "6" + - "0.10" + - "0.12" +script: "npm test" +sudo: false +before_install: + - "npm install -g npm@latest" +notifications: + slack: npm-inc:kRqQjto7YbINqHPb1X6nS3g8 diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/README.md new file mode 100644 index 00000000..9d81f4df --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/README.md @@ -0,0 +1,320 @@ +# npm-registry-client + +The code that npm uses to talk to the registry. + +It handles all the caching and HTTP calls. + +## Usage + +```javascript +var RegClient = require('npm-registry-client') +var client = new RegClient(config) +var uri = "https://registry.npmjs.org/npm" +var params = {timeout: 1000} + +client.get(uri, params, function (error, data, raw, res) { + // error is an error if there was a problem. + // data is the parsed data object + // raw is the json string + // res is the response from couch +}) +``` + +# Registry URLs + +The registry calls take either a full URL pointing to a resource in the +registry, or a base URL for the registry as a whole (including the registry +path – but be sure to terminate the path with `/`). `http` and `https` URLs are +the only ones supported. + +## Using the client + +Every call to the client follows the same pattern: + +* `uri` {String} The *fully-qualified* URI of the registry API method being + invoked. +* `params` {Object} Per-request parameters. +* `callback` {Function} Callback to be invoked when the call is complete. + +### Credentials + +Many requests to the registry can by authenticated, and require credentials +for authorization. These credentials always look the same: + +* `username` {String} +* `password` {String} +* `email` {String} +* `alwaysAuth` {Boolean} Whether calls to the target registry are always + authed. + +**or** + +* `token` {String} +* `alwaysAuth` {Boolean} Whether calls to the target registry are always + authed. + +## API + +### client.access(uri, params, cb) + +* `uri` {String} Registry URL for the package's access API endpoint. + Looks like `/-/package//access`. +* `params` {Object} Object containing per-request properties. + * `access` {String} New access level for the package. Can be either + `public` or `restricted`. Registry will raise an error if trying + to change the access level of an unscoped package. + * `auth` {Credentials} + +Set the access level for scoped packages. For now, there are only two +access levels: "public" and "restricted". + +### client.adduser(uri, params, cb) + +* `uri` {String} Base registry URL. +* `params` {Object} Object containing per-request properties. + * `auth` {Credentials} +* `cb` {Function} + * `error` {Error | null} + * `data` {Object} the parsed data object + * `raw` {String} the json + * `res` {Response Object} response from couch + +Add a user account to the registry, or verify the credentials. + +### client.deprecate(uri, params, cb) + +* `uri` {String} Full registry URI for the deprecated package. +* `params` {Object} Object containing per-request properties. + * `version` {String} Semver version range. + * `message` {String} The message to use as a deprecation warning. + * `auth` {Credentials} +* `cb` {Function} + +Deprecate a version of a package in the registry. + +### client.distTags.fetch(uri, params, cb) + +* `uri` {String} Base URL for the registry. +* `params` {Object} Object containing per-request properties. + * `package` {String} Name of the package. + * `auth` {Credentials} +* `cb` {Function} + +Fetch all of the `dist-tags` for the named package. + +### client.distTags.add(uri, params, cb) + +* `uri` {String} Base URL for the registry. +* `params` {Object} Object containing per-request properties. + * `package` {String} Name of the package. + * `distTag` {String} Name of the new `dist-tag`. + * `version` {String} Exact version to be mapped to the `dist-tag`. + * `auth` {Credentials} +* `cb` {Function} + +Add (or replace) a single dist-tag onto the named package. + +### client.distTags.set(uri, params, cb) + +* `uri` {String} Base URL for the registry. +* `params` {Object} Object containing per-request properties. + * `package` {String} Name of the package. + * `distTags` {Object} Object containing a map from tag names to package + versions. + * `auth` {Credentials} +* `cb` {Function} + +Set all of the `dist-tags` for the named package at once, creating any +`dist-tags` that do not already exit. Any `dist-tags` not included in the +`distTags` map will be removed. + +### client.distTags.update(uri, params, cb) + +* `uri` {String} Base URL for the registry. +* `params` {Object} Object containing per-request properties. + * `package` {String} Name of the package. + * `distTags` {Object} Object containing a map from tag names to package + versions. + * `auth` {Credentials} +* `cb` {Function} + +Update the values of multiple `dist-tags`, creating any `dist-tags` that do +not already exist. Any pre-existing `dist-tags` not included in the `distTags` +map will be left alone. + +### client.distTags.rm(uri, params, cb) + +* `uri` {String} Base URL for the registry. +* `params` {Object} Object containing per-request properties. + * `package` {String} Name of the package. + * `distTag` {String} Name of the new `dist-tag`. + * `auth` {Credentials} +* `cb` {Function} + +Remove a single `dist-tag` from the named package. + +### client.get(uri, params, cb) + +* `uri` {String} The complete registry URI to fetch +* `params` {Object} Object containing per-request properties. + * `timeout` {Number} Duration before the request times out. Optional + (default: never). + * `follow` {Boolean} Follow 302/301 responses. Optional (default: true). + * `staleOk` {Boolean} If there's cached data available, then return that to + the callback quickly, and update the cache the background. Optional + (default: false). + * `auth` {Credentials} Optional. +* `cb` {Function} + +Fetches data from the registry via a GET request, saving it in the cache folder +with the ETag or the "Last Modified" timestamp. + +### client.publish(uri, params, cb) + +* `uri` {String} The registry URI for the package to publish. +* `params` {Object} Object containing per-request properties. + * `metadata` {Object} Package metadata. + * `access` {String} Access for the package. Can be `public` or `restricted` (no default). + * `body` {Stream} Stream of the package body / tarball. + * `auth` {Credentials} +* `cb` {Function} + +Publish a package to the registry. + +Note that this does not create the tarball from a folder. + +### client.star(uri, params, cb) + +* `uri` {String} The complete registry URI for the package to star. +* `params` {Object} Object containing per-request properties. + * `starred` {Boolean} True to star the package, false to unstar it. Optional + (default: false). + * `auth` {Credentials} +* `cb` {Function} + +Star or unstar a package. + +Note that the user does not have to be the package owner to star or unstar a +package, though other writes do require that the user be the package owner. + +### client.stars(uri, params, cb) + +* `uri` {String} The base URL for the registry. +* `params` {Object} Object containing per-request properties. + * `username` {String} Name of user to fetch starred packages for. Optional + (default: user in `auth`). + * `auth` {Credentials} Optional (required if `username` is omitted). +* `cb` {Function} + +View your own or another user's starred packages. + +### client.tag(uri, params, cb) + +* `uri` {String} The complete registry URI to tag +* `params` {Object} Object containing per-request properties. + * `version` {String} Version to tag. + * `tag` {String} Tag name to apply. + * `auth` {Credentials} +* `cb` {Function} + +Mark a version in the `dist-tags` hash, so that `pkg@tag` will fetch the +specified version. + +### client.unpublish(uri, params, cb) + +* `uri` {String} The complete registry URI of the package to unpublish. +* `params` {Object} Object containing per-request properties. + * `version` {String} version to unpublish. Optional – omit to unpublish all + versions. + * `auth` {Credentials} +* `cb` {Function} + +Remove a version of a package (or all versions) from the registry. When the +last version us unpublished, the entire document is removed from the database. + +### client.whoami(uri, params, cb) + +* `uri` {String} The base registry for the URI. +* `params` {Object} Object containing per-request properties. + * `auth` {Credentials} +* `cb` {Function} + +Simple call to see who the registry thinks you are. Especially useful with +token-based auth. + + +## PLUMBING + +The below are primarily intended for use by the rest of the API, or by the npm +caching logic directly. + +### client.request(uri, params, cb) + +* `uri` {String} URI pointing to the resource to request. +* `params` {Object} Object containing per-request properties. + * `method` {String} HTTP method. Optional (default: "GET"). + * `body` {Stream | Buffer | String | Object} The request body. Objects + that are not Buffers or Streams are encoded as JSON. Optional – body + only used for write operations. + * `etag` {String} The cached ETag. Optional. + * `lastModified` {String} The cached Last-Modified timestamp. Optional. + * `follow` {Boolean} Follow 302/301 responses. Optional (default: true). + * `streaming` {Boolean} Stream the request body as it comes, handling error + responses in a non-streaming way. + * `auth` {Credentials} Optional. +* `cb` {Function} + * `error` {Error | null} + * `data` {Object} the parsed data object + * `raw` {String} the json + * `res` {Response Object} response from couch + +Make a generic request to the registry. All the other methods are wrappers +around `client.request`. + +### client.fetch(uri, params, cb) + +* `uri` {String} The complete registry URI to upload to +* `params` {Object} Object containing per-request properties. + * `headers` {Stream} HTTP headers to be included with the request. Optional. + * `auth` {Credentials} Optional. +* `cb` {Function} + +Fetch a package from a URL, with auth set appropriately if included. Used to +cache remote tarballs as well as request package tarballs from the registry. + +# Configuration + +The client uses its own configuration, which is just passed in as a simple +nested object. The following are the supported values (with their defaults, if +any): + +* `proxy.http` {URL} The URL to proxy HTTP requests through. +* `proxy.https` {URL} The URL to proxy HTTPS requests through. Defaults to be + the same as `proxy.http` if unset. +* `proxy.localAddress` {IP} The local address to use on multi-homed systems. +* `ssl.ca` {String} Certificate signing authority certificates to trust. +* `ssl.certificate` {String} Client certificate (PEM encoded). Enable access + to servers that require client certificates. +* `ssl.key` {String} Private key (PEM encoded) for client certificate. +* `ssl.strict` {Boolean} Whether or not to be strict with SSL certificates. + Default = `true` +* `retry.count` {Number} Number of times to retry on GET failures. Default = 2. +* `retry.factor` {Number} `factor` setting for `node-retry`. Default = 10. +* `retry.minTimeout` {Number} `minTimeout` setting for `node-retry`. + Default = 10000 (10 seconds) +* `retry.maxTimeout` {Number} `maxTimeout` setting for `node-retry`. + Default = 60000 (60 seconds) +* `userAgent` {String} User agent header to send. Default = + `"node/{process.version}"` +* `log` {Object} The logger to use. Defaults to `require("npmlog")` if + that works, otherwise logs are disabled. +* `defaultTag` {String} The default tag to use when publishing new packages. + Default = `"latest"` +* `couchToken` {Object} A token for use with + [couch-login](https://npmjs.org/package/couch-login). +* `sessionToken` {String} A random identifier for this set of client requests. + Default = 8 random hexadecimal bytes. +* `maxSockets` {Number} The maximum number of connections that will be open per + origin (unique combination of protocol:host:port). Passed to the + [httpAgent](https://nodejs.org/api/http.html#http_agent_maxsockets). + Default = 50 diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/index.js new file mode 100644 index 00000000..a199801f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/index.js @@ -0,0 +1,79 @@ +// utilities for working with the js-registry site. + +module.exports = RegClient + +var join = require('path').join +var fs = require('graceful-fs') + +var npmlog +try { + npmlog = require('npmlog') +} catch (er) { + npmlog = { + error: noop, + warn: noop, + info: noop, + verbose: noop, + silly: noop, + http: noop, + pause: noop, + resume: noop + } +} + +function noop () {} + +function RegClient (config) { + this.config = Object.create(config || {}) + + this.config.proxy = this.config.proxy || {} + if (!this.config.proxy.https && this.config.proxy.http) { + this.config.proxy.https = this.config.proxy.http + } + + this.config.ssl = this.config.ssl || {} + if (this.config.ssl.strict === undefined) this.config.ssl.strict = true + + this.config.retry = this.config.retry || {} + if (typeof this.config.retry.retries !== 'number') this.config.retry.retries = 2 + if (typeof this.config.retry.factor !== 'number') this.config.retry.factor = 10 + if (typeof this.config.retry.minTimeout !== 'number') this.config.retry.minTimeout = 10000 + if (typeof this.config.retry.maxTimeout !== 'number') this.config.retry.maxTimeout = 60000 + if (typeof this.config.maxSockets !== 'number') this.config.maxSockets = 50 + + this.config.userAgent = this.config.userAgent || 'node/' + process.version + this.config.defaultTag = this.config.defaultTag || 'latest' + + this.log = this.config.log || npmlog + delete this.config.log + + var client = this + fs.readdirSync(join(__dirname, 'lib')).forEach(function (f) { + var entry = join(__dirname, 'lib', f) + + // lib/group-name/operation.js -> client.groupName.operation + var stat = fs.statSync(entry) + if (stat.isDirectory()) { + var groupName = f.replace(/-([a-z])/, dashToCamel) + fs.readdirSync(entry).forEach(function (f) { + if (!f.match(/\.js$/)) return + + if (!client[groupName]) { + // keep client.groupName.operation from stomping client.operation + client[groupName] = Object.create(client) + } + var name = f.replace(/\.js$/, '').replace(/-([a-z])/, dashToCamel) + client[groupName][name] = require(join(entry, f)) + }) + return + } + + if (!f.match(/\.js$/)) return + var name = f.replace(/\.js$/, '').replace(/-([a-z])/, dashToCamel) + client[name] = require(entry) + }) +} + +function dashToCamel (_, l) { + return l.toUpperCase() +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/access.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/access.js new file mode 100644 index 00000000..ff01e95e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/access.js @@ -0,0 +1,153 @@ +module.exports = access + +var assert = require('assert') +var url = require('url') +var npa = require('npm-package-arg') +var subcommands = {} + +function access (sub, uri, params, cb) { + accessAssertions(sub, uri, params, cb) + return subcommands[sub].call(this, uri, params, cb) +} + +subcommands.public = function (uri, params, cb) { + return setAccess.call(this, 'public', uri, params, cb) +} +subcommands.restricted = function (uri, params, cb) { + return setAccess.call(this, 'restricted', uri, params, cb) +} + +function setAccess (access, uri, params, cb) { + return this.request(apiUri(uri, 'package', params.package, 'access'), { + method: 'POST', + auth: params.auth, + body: JSON.stringify({ access: access }) + }, cb) +} + +subcommands.grant = function (uri, params, cb) { + var reqUri = apiUri(uri, 'team', params.scope, params.team, 'package') + return this.request(reqUri, { + method: 'PUT', + auth: params.auth, + body: JSON.stringify({ + permissions: params.permissions, + package: params.package + }) + }, cb) +} + +subcommands.revoke = function (uri, params, cb) { + var reqUri = apiUri(uri, 'team', params.scope, params.team, 'package') + return this.request(reqUri, { + method: 'DELETE', + auth: params.auth, + body: JSON.stringify({ + package: params.package + }) + }, cb) +} + +subcommands['ls-packages'] = function (uri, params, cb, type) { + type = type || (params.team ? 'team' : 'org') + var client = this + var uriParams = '?format=cli' + var reqUri = apiUri(uri, type, params.scope, params.team, 'package') + return client.request(reqUri + uriParams, { + method: 'GET', + auth: params.auth + }, function (err, perms) { + if (err && err.statusCode === 404 && type === 'org') { + subcommands['ls-packages'].call(client, uri, params, cb, 'user') + } else { + cb(err, perms && translatePermissions(perms)) + } + }) +} + +subcommands['ls-collaborators'] = function (uri, params, cb) { + var uriParams = '?format=cli' + if (params.user) { + uriParams += ('&user=' + encodeURIComponent(params.user)) + } + var reqUri = apiUri(uri, 'package', params.package, 'collaborators') + return this.request(reqUri + uriParams, { + method: 'GET', + auth: params.auth + }, function (err, perms) { + cb(err, perms && translatePermissions(perms)) + }) +} + +subcommands.edit = function () { + throw new Error('edit subcommand is not implemented yet') +} + +function apiUri (registryUri) { + var path = Array.prototype.slice.call(arguments, 1) + .filter(function (x) { return x }) + .map(encodeURIComponent) + .join('/') + return url.resolve(registryUri, '-/' + path) +} + +function accessAssertions (subcommand, uri, params, cb) { + assert(subcommands.hasOwnProperty(subcommand), + 'access subcommand must be one of ' + + Object.keys(subcommands).join(', ')) + typeChecks({ + 'uri': [uri, 'string'], + 'params': [params, 'object'], + 'auth': [params.auth, 'object'], + 'callback': [cb, 'function'] + }) + if (contains([ + 'public', 'restricted' + ], subcommand)) { + typeChecks({ 'package': [params.package, 'string'] }) + assert(!!npa(params.package).scope, + 'access commands are only accessible for scoped packages') + } + if (contains(['grant', 'revoke', 'ls-packages'], subcommand)) { + typeChecks({ 'scope': [params.scope, 'string'] }) + } + if (contains(['grant', 'revoke'], subcommand)) { + typeChecks({ 'team': [params.team, 'string'] }) + } + if (subcommand === 'grant') { + typeChecks({ 'permissions': [params.permissions, 'string'] }) + assert(params.permissions === 'read-only' || + params.permissions === 'read-write', + 'permissions must be either read-only or read-write') + } +} + +function typeChecks (specs) { + Object.keys(specs).forEach(function (key) { + var checks = specs[key] + assert(typeof checks[0] === checks[1], + key + ' is required and must be of type ' + checks[1]) + }) +} + +function contains (arr, item) { + return arr.indexOf(item) !== -1 +} + +function translatePermissions (perms) { + var newPerms = {} + for (var key in perms) { + if (perms.hasOwnProperty(key)) { + if (perms[key] === 'read') { + newPerms[key] = 'read-only' + } else if (perms[key] === 'write') { + newPerms[key] = 'read-write' + } else { + // This shouldn't happen, but let's not break things + // if the API starts returning different things. + newPerms[key] = perms[key] + } + } + } + return newPerms +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/adduser.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/adduser.js new file mode 100644 index 00000000..a6a779d8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/adduser.js @@ -0,0 +1,128 @@ +module.exports = adduser + +var url = require('url') +var assert = require('assert') + +function adduser (uri, params, cb) { + assert(typeof uri === 'string', 'must pass registry URI to adduser') + assert( + params && typeof params === 'object', + 'must pass params to adduser' + ) + assert(typeof cb === 'function', 'must pass callback to adduser') + + assert(params.auth && typeof params.auth, 'must pass auth to adduser') + var auth = params.auth + assert(typeof auth.username === 'string', 'must include username in auth') + assert(typeof auth.password === 'string', 'must include password in auth') + assert(typeof auth.email === 'string', 'must include email in auth') + + // normalize registry URL + if (uri.slice(-1) !== '/') uri += '/' + + var username = auth.username.trim() + var password = auth.password.trim() + var email = auth.email.trim() + + // validation + if (!username) return cb(new Error('No username supplied.')) + if (!password) return cb(new Error('No password supplied.')) + if (!email) return cb(new Error('No email address supplied.')) + if (!email.match(/^[^@]+@[^\.]+\.[^\.]+/)) { + return cb(new Error('Please use a real email address.')) + } + + var userobj = { + _id: 'org.couchdb.user:' + username, + name: username, + password: password, + email: email, + type: 'user', + roles: [], + date: new Date().toISOString() + } + + var token = this.config.couchToken + if (this.couchLogin) this.couchLogin.token = null + + cb = done.call(this, token, cb) + + var logObj = Object.keys(userobj).map(function (k) { + if (k === 'password') return [k, 'XXXXX'] + return [k, userobj[k]] + }).reduce(function (s, kv) { + s[kv[0]] = kv[1] + return s + }, {}) + + this.log.verbose('adduser', 'before first PUT', logObj) + + var client = this + + uri = url.resolve(uri, '-/user/org.couchdb.user:' + encodeURIComponent(username)) + var options = { + method: 'PUT', + body: userobj, + auth: auth + } + this.request( + uri, + options, + function (error, data, json, response) { + if (!error || !response || response.statusCode !== 409) { + return cb(error, data, json, response) + } + + client.log.verbose('adduser', 'update existing user') + return client.request( + uri + '?write=true', + { auth: auth }, + function (er, data, json, response) { + if (er || data.error) { + return cb(er, data, json, response) + } + Object.keys(data).forEach(function (k) { + if (!userobj[k] || k === 'roles') { + userobj[k] = data[k] + } + }) + client.log.verbose('adduser', 'userobj', logObj) + client.request(uri + '/-rev/' + userobj._rev, options, cb) + } + ) + } + ) + + function done (token, cb) { + return function (error, data, json, response) { + if (!error && (!response || response.statusCode === 201)) { + return cb(error, data, json, response) + } + + // there was some kind of error, reinstate previous auth/token/etc. + if (client.couchLogin) { + client.couchLogin.token = token + if (client.couchLogin.tokenSet) { + client.couchLogin.tokenSet(token) + } + } + + client.log.verbose('adduser', 'back', [error, data, json]) + if (!error) { + error = new Error( + (response && response.statusCode || '') + ' ' + + 'Could not create user\n' + JSON.stringify(data) + ) + } + + if (response && (response.statusCode === 401 || response.statusCode === 403)) { + client.log.warn('adduser', 'Incorrect username or password\n' + + 'You can reset your account by visiting:\n' + + '\n' + + ' https://npmjs.org/forgot\n') + } + + return cb(error) + } + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/attempt.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/attempt.js new file mode 100644 index 00000000..d41bbc4f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/attempt.js @@ -0,0 +1,20 @@ +var retry = require('retry') + +module.exports = attempt + +function attempt (cb) { + // Tuned to spread 3 attempts over about a minute. + // See formula at . + var operation = retry.operation(this.config.retry) + + var client = this + operation.attempt(function (currentAttempt) { + client.log.info( + 'attempt', + 'registry request try #' + currentAttempt + + ' at ' + (new Date()).toLocaleTimeString() + ) + + cb(operation) + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/authify.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/authify.js new file mode 100644 index 00000000..0a259757 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/authify.js @@ -0,0 +1,22 @@ +module.exports = authify + +function authify (authed, parsed, headers, credentials) { + if (credentials && credentials.token) { + this.log.verbose('request', 'using bearer token for auth') + headers.authorization = 'Bearer ' + credentials.token + + return null + } + + if (authed) { + if (credentials && credentials.username && credentials.password) { + var username = encodeURIComponent(credentials.username) + var password = encodeURIComponent(credentials.password) + parsed.auth = username + ':' + password + } else { + return new Error( + 'This request requires auth credentials. Run `npm login` and repeat the request.' + ) + } + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/deprecate.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/deprecate.js new file mode 100644 index 00000000..5ff3a889 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/deprecate.js @@ -0,0 +1,42 @@ +module.exports = deprecate + +var assert = require('assert') +var semver = require('semver') + +function deprecate (uri, params, cb) { + assert(typeof uri === 'string', 'must pass registry URI to deprecate') + assert(params && typeof params === 'object', 'must pass params to deprecate') + assert(typeof cb === 'function', 'must pass callback to deprecate') + + assert(typeof params.version === 'string', 'must pass version to deprecate') + assert(typeof params.message === 'string', 'must pass message to deprecate') + assert( + params.auth && typeof params.auth === 'object', + 'must pass auth to deprecate' + ) + + var version = params.version + var message = params.message + var auth = params.auth + + if (semver.validRange(version) === null) { + return cb(new Error('invalid version range: ' + version)) + } + + this.get(uri + '?write=true', { auth: auth }, function (er, data) { + if (er) return cb(er) + // filter all the versions that match + Object.keys(data.versions).filter(function (v) { + return semver.satisfies(v, version) + }).forEach(function (v) { + data.versions[v].deprecated = message + }) + // now update the doc on the registry + var options = { + method: 'PUT', + body: data, + auth: auth + } + this.request(uri, options, cb) + }.bind(this)) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/dist-tags/add.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/dist-tags/add.js new file mode 100644 index 00000000..924199ad --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/dist-tags/add.js @@ -0,0 +1,43 @@ +module.exports = add + +var assert = require('assert') +var url = require('url') + +var npa = require('npm-package-arg') + +function add (uri, params, cb) { + assert(typeof uri === 'string', 'must pass registry URI to distTags.add') + assert( + params && typeof params === 'object', + 'must pass params to distTags.add' + ) + assert(typeof cb === 'function', 'muss pass callback to distTags.add') + + assert( + typeof params.package === 'string', + 'must pass package name to distTags.add' + ) + assert( + typeof params.distTag === 'string', + 'must pass package distTag name to distTags.add' + ) + assert( + typeof params.version === 'string', + 'must pass version to be mapped to distTag to distTags.add' + ) + assert( + params.auth && typeof params.auth === 'object', + 'must pass auth to distTags.add' + ) + + var p = npa(params.package) + var pkg = p.scope ? params.package.replace('/', '%2f') : params.package + var rest = '-/package/' + pkg + '/dist-tags/' + params.distTag + + var options = { + method: 'PUT', + body: JSON.stringify(params.version), + auth: params.auth + } + this.request(url.resolve(uri, rest), options, cb) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/dist-tags/fetch.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/dist-tags/fetch.js new file mode 100644 index 00000000..558e2cf8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/dist-tags/fetch.js @@ -0,0 +1,37 @@ +module.exports = fetch + +var assert = require('assert') +var url = require('url') + +var npa = require('npm-package-arg') + +function fetch (uri, params, cb) { + assert(typeof uri === 'string', 'must pass registry URI to distTags.fetch') + assert( + params && typeof params === 'object', + 'must pass params to distTags.fetch' + ) + assert(typeof cb === 'function', 'muss pass callback to distTags.fetch') + + assert( + typeof params.package === 'string', + 'must pass package name to distTags.fetch' + ) + assert( + params.auth && typeof params.auth === 'object', + 'must pass auth to distTags.fetch' + ) + + var p = npa(params.package) + var pkg = p.scope ? params.package.replace('/', '%2f') : params.package + var rest = '-/package/' + pkg + '/dist-tags' + + var options = { + method: 'GET', + auth: params.auth + } + this.request(url.resolve(uri, rest), options, function (er, data) { + if (data && typeof data === 'object') delete data._etag + cb(er, data) + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/dist-tags/rm.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/dist-tags/rm.js new file mode 100644 index 00000000..d2bdda05 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/dist-tags/rm.js @@ -0,0 +1,38 @@ +module.exports = rm + +var assert = require('assert') +var url = require('url') + +var npa = require('npm-package-arg') + +function rm (uri, params, cb) { + assert(typeof uri === 'string', 'must pass registry URI to distTags.rm') + assert( + params && typeof params === 'object', + 'must pass params to distTags.rm' + ) + assert(typeof cb === 'function', 'muss pass callback to distTags.rm') + + assert( + typeof params.package === 'string', + 'must pass package name to distTags.rm' + ) + assert( + typeof params.distTag === 'string', + 'must pass package distTag name to distTags.rm' + ) + assert( + params.auth && typeof params.auth === 'object', + 'must pass auth to distTags.rm' + ) + + var p = npa(params.package) + var pkg = p.scope ? params.package.replace('/', '%2f') : params.package + var rest = '-/package/' + pkg + '/dist-tags/' + params.distTag + + var options = { + method: 'DELETE', + auth: params.auth + } + this.request(url.resolve(uri, rest), options, cb) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/dist-tags/set.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/dist-tags/set.js new file mode 100644 index 00000000..7af351d6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/dist-tags/set.js @@ -0,0 +1,39 @@ +module.exports = set + +var assert = require('assert') +var url = require('url') + +var npa = require('npm-package-arg') + +function set (uri, params, cb) { + assert(typeof uri === 'string', 'must pass registry URI to distTags.set') + assert( + params && typeof params === 'object', + 'must pass params to distTags.set' + ) + assert(typeof cb === 'function', 'muss pass callback to distTags.set') + + assert( + typeof params.package === 'string', + 'must pass package name to distTags.set' + ) + assert( + params.distTags && typeof params.distTags === 'object', + 'must pass distTags map to distTags.set' + ) + assert( + params.auth && typeof params.auth === 'object', + 'must pass auth to distTags.set' + ) + + var p = npa(params.package) + var pkg = p.scope ? params.package.replace('/', '%2f') : params.package + var rest = '-/package/' + pkg + '/dist-tags' + + var options = { + method: 'PUT', + body: JSON.stringify(params.distTags), + auth: params.auth + } + this.request(url.resolve(uri, rest), options, cb) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/dist-tags/update.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/dist-tags/update.js new file mode 100644 index 00000000..07ec3e5e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/dist-tags/update.js @@ -0,0 +1,39 @@ +module.exports = update + +var assert = require('assert') +var url = require('url') + +var npa = require('npm-package-arg') + +function update (uri, params, cb) { + assert(typeof uri === 'string', 'must pass registry URI to distTags.update') + assert( + params && typeof params === 'object', + 'must pass params to distTags.update' + ) + assert(typeof cb === 'function', 'muss pass callback to distTags.update') + + assert( + typeof params.package === 'string', + 'must pass package name to distTags.update' + ) + assert( + params.distTags && typeof params.distTags === 'object', + 'must pass distTags map to distTags.update' + ) + assert( + params.auth && typeof params.auth === 'object', + 'must pass auth to distTags.update' + ) + + var p = npa(params.package) + var pkg = p.scope ? params.package.replace('/', '%2f') : params.package + var rest = '-/package/' + pkg + '/dist-tags' + + var options = { + method: 'POST', + body: JSON.stringify(params.distTags), + auth: params.auth + } + this.request(url.resolve(uri, rest), options, cb) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/fetch.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/fetch.js new file mode 100644 index 00000000..e931d371 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/fetch.js @@ -0,0 +1,91 @@ +var assert = require('assert') +var url = require('url') + +var request = require('request') +var once = require('once') + +module.exports = fetch + +function fetch (uri, params, cb) { + assert(typeof uri === 'string', 'must pass uri to request') + assert(params && typeof params === 'object', 'must pass params to request') + assert(typeof cb === 'function', 'must pass callback to request') + + cb = once(cb) + + var client = this + this.attempt(function (operation) { + makeRequest.call(client, uri, params, function (er, req) { + if (er) return cb(er) + + req.on('error', function (er) { + if (operation.retry(er)) { + client.log.info('retry', 'will retry, error on last attempt: ' + er) + } else { + cb(er) + } + }) + + req.on('response', function (res) { + client.log.http('fetch', '' + res.statusCode, uri) + + var er + var statusCode = res && res.statusCode + if (statusCode === 200) { + // Work around bug in node v0.10.0 where the CryptoStream + // gets stuck and never starts reading again. + res.resume() + if (process.version === 'v0.10.0') unstick(res) + + return cb(null, res) + // Only retry on 408, 5xx or no `response`. + } else if (statusCode === 408) { + er = new Error('request timed out') + } else if (statusCode >= 500) { + er = new Error('server error ' + statusCode) + } + + if (er && operation.retry(er)) { + client.log.info('retry', 'will retry, error on last attempt: ' + er) + } else { + cb(new Error('fetch failed with status code ' + statusCode)) + } + }) + }) + }) +} + +function unstick (response) { + response.resume = (function (orig) { + return function () { + var ret = orig.apply(response, arguments) + if (response.socket.encrypted) response.socket.encrypted.read(0) + return ret + } + })(response.resume) +} + +function makeRequest (remote, params, cb) { + var parsed = url.parse(remote) + this.log.http('fetch', 'GET', parsed.href) + + var headers = params.headers || {} + var er = this.authify( + params.auth && params.auth.alwaysAuth, + parsed, + headers, + params.auth + ) + if (er) return cb(er) + + var opts = this.initialize( + parsed, + 'GET', + 'application/x-tar, application/vnd.github+json; q=0.1', + headers + ) + // always want to follow redirects for fetch + opts.followRedirect = true + + cb(null, request(opts)) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/get.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/get.js new file mode 100644 index 00000000..ab0eae10 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/get.js @@ -0,0 +1,22 @@ +module.exports = get + +var assert = require('assert') +var url = require('url') + +/* + * This is meant to be overridden in specific implementations if you + * want specialized behavior for metadata (i.e. caching). + */ +function get (uri, params, cb) { + assert(typeof uri === 'string', 'must pass registry URI to get') + assert(params && typeof params === 'object', 'must pass params to get') + assert(typeof cb === 'function', 'must pass callback to get') + + var parsed = url.parse(uri) + assert( + parsed.protocol === 'http:' || parsed.protocol === 'https:', + 'must have a URL that starts with http: or https:' + ) + + this.request(uri, params, cb) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/initialize.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/initialize.js new file mode 100644 index 00000000..3c12697f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/initialize.js @@ -0,0 +1,81 @@ +var crypto = require('crypto') +var HttpAgent = require('http').Agent +var HttpsAgent = require('https').Agent + +var pkg = require('../package.json') + +module.exports = initialize + +function initialize (uri, method, accept, headers) { + if (!this.config.sessionToken) { + this.config.sessionToken = crypto.randomBytes(8).toString('hex') + this.log.verbose('request id', this.config.sessionToken) + } + + var opts = { + url: uri, + method: method, + headers: headers, + localAddress: this.config.proxy.localAddress, + strictSSL: this.config.ssl.strict, + cert: this.config.ssl.certificate, + key: this.config.ssl.key, + ca: this.config.ssl.ca, + agent: getAgent.call(this, uri.protocol) + } + + // allow explicit disabling of proxy in environment via CLI + // + // how false gets here is the CLI's problem (it's gross) + if (this.config.proxy.http === false) { + opts.proxy = null + } else { + // request will not pay attention to the NOPROXY environment variable if a + // config value named proxy is passed in, even if it's set to null. + var proxy + if (uri.protocol === 'https:') { + proxy = this.config.proxy.https + } else { + proxy = this.config.proxy.http + } + if (typeof proxy === 'string') opts.proxy = proxy + } + + headers.version = this.version || pkg.version + headers.accept = accept + + if (this.refer) headers.referer = this.refer + + headers['npm-session'] = this.config.sessionToken + headers['user-agent'] = this.config.userAgent + + return opts +} + +function getAgent (protocol) { + if (protocol === 'https:') { + if (!this.httpsAgent) { + this.httpsAgent = new HttpsAgent({ + keepAlive: true, + maxSockets: this.config.maxSockets, + localAddress: this.config.proxy.localAddress, + rejectUnauthorized: this.config.ssl.strict, + ca: this.config.ssl.ca, + cert: this.config.ssl.certificate, + key: this.config.ssl.key + }) + } + + return this.httpsAgent + } else { + if (!this.httpAgent) { + this.httpAgent = new HttpAgent({ + keepAlive: true, + maxSockets: this.config.maxSockets, + localAddress: this.config.proxy.localAddress + }) + } + + return this.httpAgent + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/logout.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/logout.js new file mode 100644 index 00000000..e66e9b78 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/logout.js @@ -0,0 +1,23 @@ +module.exports = logout + +var assert = require('assert') +var url = require('url') + +function logout (uri, params, cb) { + assert(typeof uri === 'string', 'must pass registry URI to logout') + assert(params && typeof params === 'object', 'must pass params to logout') + assert(typeof cb === 'function', 'must pass callback to star') + + var auth = params.auth + assert(auth && typeof auth === 'object', 'must pass auth to logout') + assert(typeof auth.token === 'string', 'can only log out for token auth') + + uri = url.resolve(uri, '-/user/token/' + auth.token) + var options = { + method: 'DELETE', + auth: auth + } + + this.log.verbose('logout', 'invalidating session token for user') + this.request(uri, options, cb) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/ping.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/ping.js new file mode 100644 index 00000000..b90f99d1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/ping.js @@ -0,0 +1,23 @@ +module.exports = ping + +var url = require('url') +var assert = require('assert') + +function ping (uri, params, cb) { + assert(typeof uri === 'string', 'must pass registry URI to ping') + assert(params && typeof params === 'object', 'must pass params to ping') + assert(typeof cb === 'function', 'must pass callback to ping') + + var auth = params.auth + assert(auth && typeof auth === 'object', 'must pass auth to ping') + + this.request(url.resolve(uri, '-/ping?write=true'), { auth: auth }, function (er, fullData) { + if (er) { + cb(er) + } else if (fullData) { + cb(null, fullData) + } else { + cb(new Error('No data received')) + } + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/publish.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/publish.js new file mode 100644 index 00000000..9bf1c306 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/publish.js @@ -0,0 +1,188 @@ +module.exports = publish + +var url = require('url') +var semver = require('semver') +var crypto = require('crypto') +var Stream = require('stream').Stream +var assert = require('assert') +var fixer = require('normalize-package-data').fixer +var concat = require('concat-stream') + +function escaped (name) { + return name.replace('/', '%2f') +} + +function publish (uri, params, cb) { + assert(typeof uri === 'string', 'must pass registry URI to publish') + assert(params && typeof params === 'object', 'must pass params to publish') + assert(typeof cb === 'function', 'must pass callback to publish') + + var access = params.access + assert( + (!access) || ['public', 'restricted'].indexOf(access) !== -1, + "if present, access level must be either 'public' or 'restricted'" + ) + + var auth = params.auth + assert(auth && typeof auth === 'object', 'must pass auth to publish') + if (!(auth.token || + (auth.password && auth.username && auth.email))) { + var er = new Error('auth required for publishing') + er.code = 'ENEEDAUTH' + return cb(er) + } + + var metadata = params.metadata + assert( + metadata && typeof metadata === 'object', + 'must pass package metadata to publish' + ) + try { + fixer.fixNameField(metadata, {strict: true, allowLegacyCase: true}) + } catch (er) { + return cb(er) + } + var version = semver.clean(metadata.version) + if (!version) return cb(new Error('invalid semver: ' + metadata.version)) + metadata.version = version + + var body = params.body + assert(body, 'must pass package body to publish') + assert(body instanceof Stream, 'package body passed to publish must be a stream') + var client = this + var sink = concat(function (tarbuffer) { + putFirst.call(client, uri, metadata, tarbuffer, access, auth, cb) + }) + sink.on('error', cb) + body.pipe(sink) +} + +function putFirst (registry, data, tarbuffer, access, auth, cb) { + // optimistically try to PUT all in one single atomic thing. + // If 409, then GET and merge, try again. + // If other error, then fail. + + var root = { + _id: data.name, + name: data.name, + description: data.description, + 'dist-tags': {}, + versions: {}, + readme: data.readme || '' + } + + if (access) root.access = access + + if (!auth.token) { + root.maintainers = [{ name: auth.username, email: auth.email }] + data.maintainers = JSON.parse(JSON.stringify(root.maintainers)) + } + + root.versions[ data.version ] = data + var tag = data.tag || this.config.defaultTag + root['dist-tags'][tag] = data.version + + var tbName = data.name + '-' + data.version + '.tgz' + var tbURI = data.name + '/-/' + tbName + + data._id = data.name + '@' + data.version + data.dist = data.dist || {} + data.dist.shasum = crypto.createHash('sha1').update(tarbuffer).digest('hex') + data.dist.tarball = url.resolve(registry, tbURI) + .replace(/^https:\/\//, 'http://') + + root._attachments = {} + root._attachments[ tbName ] = { + 'content_type': 'application/octet-stream', + 'data': tarbuffer.toString('base64'), + 'length': tarbuffer.length + } + + var fixed = url.resolve(registry, escaped(data.name)) + var client = this + var options = { + method: 'PUT', + body: root, + auth: auth + } + this.request(fixed, options, function (er, parsed, json, res) { + var r409 = 'must supply latest _rev to update existing package' + var r409b = 'Document update conflict.' + var conflict = res && res.statusCode === 409 + if (parsed && (parsed.reason === r409 || parsed.reason === r409b)) { + conflict = true + } + + // a 409 is typical here. GET the data and merge in. + if (er && !conflict) { + client.log.error('publish', 'Failed PUT ' + (res && res.statusCode)) + return cb(er) + } + + if (!er && !conflict) return cb(er, parsed, json, res) + + // let's see what versions are already published. + client.request(fixed + '?write=true', { auth: auth }, function (er, current) { + if (er) return cb(er) + + putNext.call(client, registry, data.version, root, current, auth, cb) + }) + }) +} + +function putNext (registry, newVersion, root, current, auth, cb) { + // already have the tardata on the root object + // just merge in existing stuff + var curVers = Object.keys(current.versions || {}).map(function (v) { + return semver.clean(v, true) + }).concat(Object.keys(current.time || {}).map(function (v) { + if (semver.valid(v, true)) return semver.clean(v, true) + }).filter(function (v) { + return v + })) + + if (curVers.indexOf(newVersion) !== -1) { + return cb(conflictError(root.name, newVersion)) + } + + current.versions[newVersion] = root.versions[newVersion] + current._attachments = current._attachments || {} + for (var i in root) { + switch (i) { + // objects that copy over the new stuffs + case 'dist-tags': + case 'versions': + case '_attachments': + for (var j in root[i]) { + current[i][j] = root[i][j] + } + break + + // ignore these + case 'maintainers': + break + + // copy + default: + current[i] = root[i] + } + } + var maint = JSON.parse(JSON.stringify(root.maintainers)) + root.versions[newVersion].maintainers = maint + + var uri = url.resolve(registry, escaped(root.name)) + var options = { + method: 'PUT', + body: current, + auth: auth + } + this.request(uri, options, cb) +} + +function conflictError (pkgid, version) { + var e = new Error('cannot modify pre-existing version') + e.code = 'EPUBLISHCONFLICT' + e.pkgid = pkgid + e.version = version + return e +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/request.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/request.js new file mode 100644 index 00000000..04be044d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/request.js @@ -0,0 +1,309 @@ +module.exports = regRequest + +// npm: means +// 1. https +// 2. send authorization +// 3. content-type is 'application/json' -- metadata +// +var assert = require('assert') +var url = require('url') +var zlib = require('zlib') +var Stream = require('stream').Stream +var STATUS_CODES = require('http').STATUS_CODES + +var request = require('request') +var once = require('once') + +function regRequest (uri, params, cb_) { + assert(typeof uri === 'string', 'must pass uri to request') + assert(params && typeof params === 'object', 'must pass params to request') + assert(typeof cb_ === 'function', 'must pass callback to request') + + params.method = params.method || 'GET' + this.log.verbose('request', 'uri', uri) + + // Since there are multiple places where an error could occur, + // don't let the cb be called more than once. + var cb = once(cb_) + + if (uri.match(/^\/?favicon.ico/)) { + return cb(new Error("favicon.ico isn't a package, it's a picture.")) + } + + var adduserChange = /\/?-\/user\/org\.couchdb\.user:([^/]+)\/-rev/ + var isUserChange = uri.match(adduserChange) + var adduserNew = /\/?-\/user\/org\.couchdb\.user:([^/?]+)$/ + var isNewUser = uri.match(adduserNew) + var alwaysAuth = params.auth && params.auth.alwaysAuth + var isDelete = params.method === 'DELETE' + var isWrite = params.body || isDelete + + if (isUserChange && !isWrite) { + return cb(new Error('trying to change user document without writing(?!)')) + } + + // new users can *not* use auth, because they don't *have* auth yet + if (isUserChange) { + this.log.verbose('request', 'updating existing user; sending authorization') + params.authed = true + } else if (isNewUser) { + this.log.verbose('request', "new user, so can't send auth") + params.authed = false + } else if (alwaysAuth) { + this.log.verbose('request', 'always-auth set; sending authorization') + params.authed = true + } else if (isWrite) { + this.log.verbose('request', 'sending authorization for write operation') + params.authed = true + } else { + // most of the time we don't want to auth + this.log.verbose('request', 'no auth needed') + params.authed = false + } + + var self = this + this.attempt(function (operation) { + makeRequest.call(self, uri, params, function (er, parsed, raw, response) { + if (response) { + self.log.verbose('headers', response.headers) + if (response.headers['npm-notice']) { + self.log.warn('notice', response.headers['npm-notice']) + } + } + + if (!er || (er.message && er.message.match(/^SSL Error/))) { + if (er) er.code = 'ESSL' + return cb(er, parsed, raw, response) + } + + // Only retry on 408, 5xx or no `response`. + var statusCode = response && response.statusCode + + var timeout = statusCode === 408 + var serverError = statusCode >= 500 + var statusRetry = !statusCode || timeout || serverError + if (er && statusRetry && operation.retry(er)) { + self.log.info('retry', 'will retry, error on last attempt: ' + er) + return undefined + } + cb.apply(null, arguments) + }) + }) +} + +function makeRequest (uri, params, cb_) { + var socket + var cb = once(function (er, parsed, raw, response) { + if (socket) { + // The socket might be returned to a pool for re-use, so don’t keep + // the 'error' listener from here attached. + socket.removeListener('error', cb) + } + + return cb_(er, parsed, raw, response) + }) + + var parsed = url.parse(uri) + var headers = {} + + // metadata should be compressed + headers['accept-encoding'] = 'gzip' + + var er = this.authify(params.authed, parsed, headers, params.auth) + if (er) return cb_(er) + + var opts = this.initialize( + parsed, + params.method, + 'application/json', + headers + ) + + opts.followRedirect = (typeof params.follow === 'boolean' ? params.follow : true) + opts.encoding = null // tell request let body be Buffer instance + + if (params.etag) { + this.log.verbose('etag', params.etag) + headers[params.method === 'GET' ? 'if-none-match' : 'if-match'] = params.etag + } + + if (params.lastModified && params.method === 'GET') { + this.log.verbose('lastModified', params.lastModified) + headers['if-modified-since'] = params.lastModified + } + + // figure out wth body is + if (params.body) { + if (Buffer.isBuffer(params.body)) { + opts.body = params.body + headers['content-type'] = 'application/json' + headers['content-length'] = params.body.length + } else if (typeof params.body === 'string') { + opts.body = params.body + headers['content-type'] = 'application/json' + headers['content-length'] = Buffer.byteLength(params.body) + } else if (params.body instanceof Stream) { + headers['content-type'] = 'application/octet-stream' + if (params.body.size) headers['content-length'] = params.body.size + } else { + delete params.body._etag + delete params.body._lastModified + opts.json = params.body + } + } + + this.log.http('request', params.method, parsed.href || '/') + + var done = requestDone.call(this, params.method, uri, cb) + var req = request(opts, params.streaming ? undefined : decodeResponseBody(done)) + + req.on('error', cb) + + // This should not be necessary, as the HTTP implementation in Node + // passes errors occurring on the socket to the request itself. Being overly + // cautious comes at a low cost, though. + req.on('socket', function (s) { + socket = s + socket.on('error', cb) + }) + + if (params.streaming) { + req.on('response', function (response) { + if (response.statusCode >= 400) { + var parts = [] + response.on('data', function (data) { + parts.push(data) + }) + response.on('end', function () { + decodeResponseBody(done)(null, response, Buffer.concat(parts)) + }) + } else { + response.on('end', function () { + // don't ever re-use connections that had server errors. + // those sockets connect to the Bad Place! + if (response.socket && response.statusCode > 500) { + response.socket.destroy() + } + }) + + return cb(null, response) + } + }) + } + + if (params.body && (params.body instanceof Stream)) { + params.body.pipe(req) + } +} + +function decodeResponseBody (cb) { + return function (er, response, data) { + if (er) return cb(er, response, data) + + // don't ever re-use connections that had server errors. + // those sockets connect to the Bad Place! + if (response.socket && response.statusCode > 500) { + response.socket.destroy() + } + + if (response.headers['content-encoding'] !== 'gzip') { + return cb(er, response, data) + } + + zlib.gunzip(data, function (er, buf) { + if (er) return cb(er, response, data) + + cb(null, response, buf) + }) + } +} + +// cb(er, parsed, raw, response) +function requestDone (method, where, cb) { + return function (er, response, data) { + if (er) return cb(er) + + var urlObj = url.parse(where) + if (urlObj.auth) urlObj.auth = '***' + this.log.http(response.statusCode, url.format(urlObj)) + + if (Buffer.isBuffer(data)) { + data = data.toString() + } + + var parsed + if (data && typeof data === 'string' && response.statusCode !== 304) { + try { + parsed = JSON.parse(data) + } catch (ex) { + ex.message += '\n' + data + this.log.verbose('bad json', data) + this.log.error('registry', 'error parsing json') + return cb(ex, null, data, response) + } + } else if (data) { + parsed = data + data = JSON.stringify(parsed) + } + + // expect data with any error codes + if (!data && response.statusCode >= 400) { + var code = response.statusCode + return cb( + makeError(code + ' ' + STATUS_CODES[code], null, code), + null, + data, + response + ) + } + + er = null + if (parsed && response.headers.etag) { + parsed._etag = response.headers.etag + } + + if (parsed && response.headers['last-modified']) { + parsed._lastModified = response.headers['last-modified'] + } + + // for the search endpoint, the 'error' property can be an object + if (parsed && parsed.error && typeof parsed.error !== 'object' || + response.statusCode >= 400) { + var w = url.parse(where).pathname.substr(1) + var name + if (!w.match(/^-/)) { + w = w.split('/') + name = decodeURIComponent(w[w.indexOf('_rewrite') + 1]) + } + + if (!parsed.error) { + er = makeError( + 'Registry returned ' + response.statusCode + + ' for ' + method + + ' on ' + where, + name, + response.statusCode + ) + } else if (name && parsed.error === 'not_found') { + er = makeError('404 Not Found: ' + name, name, response.statusCode) + } else { + er = makeError( + parsed.error + ' ' + (parsed.reason || '') + ': ' + (name || w), + name, + response.statusCode + ) + } + } + return cb(er, parsed, data, response) + }.bind(this) +} + +function makeError (message, name, code) { + var er = new Error(message) + if (name) er.pkgid = name + if (code) { + er.statusCode = code + er.code = 'E' + code + } + return er +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/star.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/star.js new file mode 100644 index 00000000..5c9224ea --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/star.js @@ -0,0 +1,51 @@ +module.exports = star + +var assert = require('assert') + +function star (uri, params, cb) { + assert(typeof uri === 'string', 'must pass registry URI to star') + assert(params && typeof params === 'object', 'must pass params to star') + assert(typeof cb === 'function', 'must pass callback to star') + + var starred = !!params.starred + + var auth = params.auth + assert(auth && typeof auth === 'object', 'must pass auth to star') + if (!(auth.token || (auth.password && auth.username && auth.email))) { + var er = new Error('Must be logged in to star/unstar packages') + er.code = 'ENEEDAUTH' + return cb(er) + } + + var client = this + this.request(uri + '?write=true', { auth: auth }, function (er, fullData) { + if (er) return cb(er) + + client.whoami(uri, params, function (er, username) { + if (er) return cb(er) + + var data = { + _id: fullData._id, + _rev: fullData._rev, + users: fullData.users || {} + } + + if (starred) { + client.log.info('starring', data._id) + data.users[username] = true + client.log.verbose('starring', data) + } else { + delete data.users[username] + client.log.info('unstarring', data._id) + client.log.verbose('unstarring', data) + } + + var options = { + method: 'PUT', + body: data, + auth: auth + } + return client.request(uri, options, cb) + }) + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/stars.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/stars.js new file mode 100644 index 00000000..ba47f2c1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/stars.js @@ -0,0 +1,18 @@ +module.exports = stars + +var assert = require('assert') +var url = require('url') + +function stars (uri, params, cb) { + assert(typeof uri === 'string', 'must pass registry URI to stars') + assert(params && typeof params === 'object', 'must pass params to stars') + assert(typeof cb === 'function', 'must pass callback to stars') + + var auth = params.auth + var name = params.username || (auth && auth.username) + if (!name) return cb(new Error('must pass either username or auth to stars')) + var encoded = encodeURIComponent(name) + var path = '-/_view/starredByUser?key="' + encoded + '"' + + this.request(url.resolve(uri, path), { auth: auth }, cb) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/tag.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/tag.js new file mode 100644 index 00000000..3b6dad1d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/tag.js @@ -0,0 +1,23 @@ +module.exports = tag + +var assert = require('assert') + +function tag (uri, params, cb) { + assert(typeof uri === 'string', 'must pass registry URI to tag') + assert(params && typeof params === 'object', 'must pass params to tag') + assert(typeof cb === 'function', 'must pass callback to tag') + + assert(typeof params.version === 'string', 'must pass version to tag') + assert(typeof params.tag === 'string', 'must pass tag name to tag') + assert( + params.auth && typeof params.auth === 'object', + 'must pass auth to tag' + ) + + var options = { + method: 'PUT', + body: JSON.stringify(params.version), + auth: params.auth + } + this.request(uri + '/' + params.tag, options, cb) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/team.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/team.js new file mode 100644 index 00000000..3e3794e0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/team.js @@ -0,0 +1,105 @@ +module.exports = team + +var assert = require('assert') +var url = require('url') + +var subcommands = {} + +function team (sub, uri, params, cb) { + teamAssertions(sub, uri, params, cb) + return subcommands[sub].call(this, uri, params, cb) +} + +subcommands.create = function (uri, params, cb) { + return this.request(apiUri(uri, 'org', params.scope, 'team'), { + method: 'PUT', + auth: params.auth, + body: JSON.stringify({ + name: params.team + }) + }, cb) +} + +subcommands.destroy = function (uri, params, cb) { + return this.request(apiUri(uri, 'team', params.scope, params.team), { + method: 'DELETE', + auth: params.auth + }, cb) +} + +subcommands.add = function (uri, params, cb) { + return this.request(apiUri(uri, 'team', params.scope, params.team, 'user'), { + method: 'PUT', + auth: params.auth, + body: JSON.stringify({ + user: params.user + }) + }, cb) +} + +subcommands.rm = function (uri, params, cb) { + return this.request(apiUri(uri, 'team', params.scope, params.team, 'user'), { + method: 'DELETE', + auth: params.auth, + body: JSON.stringify({ + user: params.user + }) + }, cb) +} + +subcommands.ls = function (uri, params, cb) { + var uriParams = '?format=cli' + if (params.team) { + var reqUri = apiUri( + uri, 'team', params.scope, params.team, 'user') + uriParams + return this.request(reqUri, { + method: 'GET', + auth: params.auth + }, cb) + } else { + return this.request(apiUri(uri, 'org', params.scope, 'team') + uriParams, { + method: 'GET', + auth: params.auth + }, cb) + } +} + +// TODO - we punted this to v2 +// subcommands.edit = function (uri, params, cb) { +// return this.request(apiUri(uri, 'team', params.scope, params.team, 'user'), { +// method: 'POST', +// auth: params.auth, +// body: JSON.stringify({ +// users: params.users +// }) +// }, cb) +// } + +function apiUri (registryUri) { + var path = Array.prototype.slice.call(arguments, 1) + .map(encodeURIComponent) + .join('/') + return url.resolve(registryUri, '-/' + path) +} + +function teamAssertions (subcommand, uri, params, cb) { + assert(subcommand, 'subcommand is required') + assert(subcommands.hasOwnProperty(subcommand), + 'team subcommand must be one of ' + Object.keys(subcommands)) + assert(typeof uri === 'string', 'registry URI is required') + assert(typeof params === 'object', 'params are required') + assert(typeof params.auth === 'object', 'auth is required') + assert(typeof params.scope === 'string', 'scope is required') + assert(!cb || typeof cb === 'function', 'callback must be a function') + if (subcommand !== 'ls') { + assert(typeof params.team === 'string', 'team name is required') + } + if (subcommand === 'rm' || subcommand === 'add') { + assert(typeof params.user === 'string', 'user is required') + } + if (subcommand === 'edit') { + assert(typeof params.users === 'object' && + params.users.length != null, + 'users is required') + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/unpublish.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/unpublish.js new file mode 100644 index 00000000..05c5a4b6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/unpublish.js @@ -0,0 +1,120 @@ +module.exports = unpublish + +// fetch the data +// modify to remove the version in question +// If no versions remaining, then DELETE +// else, PUT the modified data +// delete the tarball + +var semver = require('semver') +var url = require('url') +var chain = require('slide').chain +var assert = require('assert') + +function unpublish (uri, params, cb) { + assert(typeof uri === 'string', 'must pass registry URI to unpublish') + assert(params && typeof params === 'object', 'must pass params to unpublish') + assert(typeof cb === 'function', 'must pass callback to unpublish') + + var ver = params.version + var auth = params.auth + assert(auth && typeof auth === 'object', 'must pass auth to unpublish') + + var options = { + timeout: -1, + follow: false, + auth: auth + } + this.get(uri + '?write=true', options, function (er, data) { + if (er) { + this.log.info('unpublish', uri + ' not published') + return cb() + } + // remove all if no version specified + if (!ver) { + this.log.info('unpublish', 'No version specified, removing all') + return this.request(uri + '/-rev/' + data._rev, { method: 'DELETE', auth: auth }, cb) + } + + var versions = data.versions || {} + var versionPublic = versions.hasOwnProperty(ver) + + var dist + if (!versionPublic) { + this.log.info('unpublish', uri + '@' + ver + ' not published') + } else { + dist = versions[ver].dist + this.log.verbose('unpublish', 'removing attachments', dist) + } + + delete versions[ver] + // if it was the only version, then delete the whole package. + if (!Object.keys(versions).length) { + this.log.info('unpublish', 'No versions remain, removing entire package') + return this.request(uri + '/-rev/' + data._rev, { method: 'DELETE', auth: auth }, cb) + } + + if (!versionPublic) return cb() + + var latestVer = data['dist-tags'].latest + for (var tag in data['dist-tags']) { + if (data['dist-tags'][tag] === ver) delete data['dist-tags'][tag] + } + + if (latestVer === ver) { + data['dist-tags'].latest = + Object.getOwnPropertyNames(versions).sort(semver.compareLoose).pop() + } + + var rev = data._rev + delete data._revisions + delete data._attachments + var cb_ = detacher.call(this, uri, data, dist, auth, cb) + + this.request(uri + '/-rev/' + rev, { method: 'PUT', body: data, auth: auth }, function (er) { + if (er) { + this.log.error('unpublish', 'Failed to update data') + } + cb_(er) + }.bind(this)) + }.bind(this)) +} + +function detacher (uri, data, dist, credentials, cb) { + return function (er) { + if (er) return cb(er) + this.get(escape(uri, data.name), { auth: credentials }, function (er, data) { + if (er) return cb(er) + + var tb = url.parse(dist.tarball) + + detach.call(this, uri, data, tb.pathname, data._rev, credentials, function (er) { + if (er || !dist.bin) return cb(er) + chain(Object.keys(dist.bin).map(function (bt) { + return function (cb) { + var d = dist.bin[bt] + detach.call(this, uri, data, url.parse(d.tarball).pathname, null, credentials, cb) + }.bind(this) + }, this), cb) + }.bind(this)) + }.bind(this)) + }.bind(this) +} + +function detach (uri, data, path, rev, credentials, cb) { + if (rev) { + path += '/-rev/' + rev + this.log.info('detach', path) + return this.request(url.resolve(uri, path), { method: 'DELETE', auth: credentials }, cb) + } + this.get(escape(uri, data.name), { auth: credentials }, function (er, data) { + rev = data._rev + if (!rev) return cb(new Error('No _rev found in ' + data._id)) + detach.call(this, data, path, rev, cb) + }.bind(this)) +} + +function escape (base, name) { + var escaped = name.replace(/\//, '%2f') + return url.resolve(base, escaped) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/whoami.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/whoami.js new file mode 100644 index 00000000..68db49e5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/lib/whoami.js @@ -0,0 +1,21 @@ +module.exports = whoami + +var url = require('url') +var assert = require('assert') + +function whoami (uri, params, cb) { + assert(typeof uri === 'string', 'must pass registry URI to whoami') + assert(params && typeof params === 'object', 'must pass params to whoami') + assert(typeof cb === 'function', 'must pass callback to whoami') + + var auth = params.auth + assert(auth && typeof auth === 'object', 'must pass auth to whoami') + + if (auth.username) return process.nextTick(cb.bind(this, null, auth.username)) + + this.request(url.resolve(uri, '-/whoami'), { auth: auth }, function (er, userdata) { + if (er) return cb(er) + + cb(null, userdata.username) + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/LICENSE new file mode 100644 index 00000000..99c130e1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/LICENSE @@ -0,0 +1,24 @@ +The MIT License + +Copyright (c) 2013 Max Ogden + +Permission is hereby granted, free of charge, +to any person obtaining a copy of this software and +associated documentation files (the "Software"), to +deal in the Software without restriction, including +without limitation the rights to use, copy, modify, +merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom +the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/index.js new file mode 100644 index 00000000..b16ad134 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/index.js @@ -0,0 +1,143 @@ +var Writable = require('readable-stream').Writable +var inherits = require('inherits') + +if (typeof Uint8Array === 'undefined') { + var U8 = require('typedarray').Uint8Array +} else { + var U8 = Uint8Array +} + +function ConcatStream(opts, cb) { + if (!(this instanceof ConcatStream)) return new ConcatStream(opts, cb) + + if (typeof opts === 'function') { + cb = opts + opts = {} + } + if (!opts) opts = {} + + var encoding = opts.encoding + var shouldInferEncoding = false + + if (!encoding) { + shouldInferEncoding = true + } else { + encoding = String(encoding).toLowerCase() + if (encoding === 'u8' || encoding === 'uint8') { + encoding = 'uint8array' + } + } + + Writable.call(this, { objectMode: true }) + + this.encoding = encoding + this.shouldInferEncoding = shouldInferEncoding + + if (cb) this.on('finish', function () { cb(this.getBody()) }) + this.body = [] +} + +module.exports = ConcatStream +inherits(ConcatStream, Writable) + +ConcatStream.prototype._write = function(chunk, enc, next) { + this.body.push(chunk) + next() +} + +ConcatStream.prototype.inferEncoding = function (buff) { + var firstBuffer = buff === undefined ? this.body[0] : buff; + if (Buffer.isBuffer(firstBuffer)) return 'buffer' + if (typeof Uint8Array !== 'undefined' && firstBuffer instanceof Uint8Array) return 'uint8array' + if (Array.isArray(firstBuffer)) return 'array' + if (typeof firstBuffer === 'string') return 'string' + if (Object.prototype.toString.call(firstBuffer) === "[object Object]") return 'object' + return 'buffer' +} + +ConcatStream.prototype.getBody = function () { + if (!this.encoding && this.body.length === 0) return [] + if (this.shouldInferEncoding) this.encoding = this.inferEncoding() + if (this.encoding === 'array') return arrayConcat(this.body) + if (this.encoding === 'string') return stringConcat(this.body) + if (this.encoding === 'buffer') return bufferConcat(this.body) + if (this.encoding === 'uint8array') return u8Concat(this.body) + return this.body +} + +var isArray = Array.isArray || function (arr) { + return Object.prototype.toString.call(arr) == '[object Array]' +} + +function isArrayish (arr) { + return /Array\]$/.test(Object.prototype.toString.call(arr)) +} + +function isBufferish (p) { + return typeof p === 'string' || isArrayish(p) || (p && typeof p.subarray === 'function') +} + +function stringConcat (parts) { + var strings = [] + var needsToString = false + for (var i = 0; i < parts.length; i++) { + var p = parts[i] + if (typeof p === 'string') { + strings.push(p) + } else if (Buffer.isBuffer(p)) { + strings.push(p) + } else if (isBufferish(p)) { + strings.push(new Buffer(p)) + } else { + strings.push(new Buffer(String(p))) + } + } + if (Buffer.isBuffer(parts[0])) { + strings = Buffer.concat(strings) + strings = strings.toString('utf8') + } else { + strings = strings.join('') + } + return strings +} + +function bufferConcat (parts) { + var bufs = [] + for (var i = 0; i < parts.length; i++) { + var p = parts[i] + if (Buffer.isBuffer(p)) { + bufs.push(p) + } else if (isBufferish(p)) { + bufs.push(new Buffer(p)) + } else { + bufs.push(new Buffer(String(p))) + } + } + return Buffer.concat(bufs) +} + +function arrayConcat (parts) { + var res = [] + for (var i = 0; i < parts.length; i++) { + res.push.apply(res, parts[i]) + } + return res +} + +function u8Concat (parts) { + var len = 0 + for (var i = 0; i < parts.length; i++) { + if (typeof parts[i] === 'string') { + parts[i] = new Buffer(parts[i]) + } + len += parts[i].length + } + var u8 = new U8(len) + for (var i = 0, offset = 0; i < parts.length; i++) { + var part = parts[i] + for (var j = 0; j < part.length; j++) { + u8[offset++] = part[j] + } + } + return u8 +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/.npmignore new file mode 100644 index 00000000..38344f87 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/.npmignore @@ -0,0 +1,5 @@ +build/ +test/ +examples/ +fs.js +zlib.js \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/.travis.yml new file mode 100644 index 00000000..1b821184 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/.travis.yml @@ -0,0 +1,52 @@ +sudo: false +language: node_js +before_install: + - npm install -g npm@2 + - npm install -g npm +notifications: + email: false +matrix: + fast_finish: true + allow_failures: + - env: TASK=browser BROWSER_NAME=ipad BROWSER_VERSION="6.0..latest" + - env: TASK=browser BROWSER_NAME=iphone BROWSER_VERSION="6.0..latest" + include: + - node_js: '0.8' + env: TASK=test + - node_js: '0.10' + env: TASK=test + - node_js: '0.11' + env: TASK=test + - node_js: '0.12' + env: TASK=test + - node_js: 1 + env: TASK=test + - node_js: 2 + env: TASK=test + - node_js: 3 + env: TASK=test + - node_js: 4 + env: TASK=test + - node_js: 5 + env: TASK=test + - node_js: 5 + env: TASK=browser BROWSER_NAME=android BROWSER_VERSION="4.0..latest" + - node_js: 5 + env: TASK=browser BROWSER_NAME=ie BROWSER_VERSION="9..latest" + - node_js: 5 + env: TASK=browser BROWSER_NAME=opera BROWSER_VERSION="11..latest" + - node_js: 5 + env: TASK=browser BROWSER_NAME=chrome BROWSER_VERSION="-3..latest" + - node_js: 5 + env: TASK=browser BROWSER_NAME=firefox BROWSER_VERSION="-3..latest" + - node_js: 5 + env: TASK=browser BROWSER_NAME=ipad BROWSER_VERSION="6.0..latest" + - node_js: 5 + env: TASK=browser BROWSER_NAME=iphone BROWSER_VERSION="6.0..latest" + - node_js: 5 + env: TASK=browser BROWSER_NAME=safari BROWSER_VERSION="5..latest" +script: "npm run $TASK" +env: + global: + - secure: rE2Vvo7vnjabYNULNyLFxOyt98BoJexDqsiOnfiD6kLYYsiQGfr/sbZkPMOFm9qfQG7pjqx+zZWZjGSswhTt+626C0t/njXqug7Yps4c3dFblzGfreQHp7wNX5TFsvrxd6dAowVasMp61sJcRnB2w8cUzoe3RAYUDHyiHktwqMc= + - secure: g9YINaKAdMatsJ28G9jCGbSaguXCyxSTy+pBO6Ch0Cf57ZLOTka3HqDj8p3nV28LUIHZ3ut5WO43CeYKwt4AUtLpBS3a0dndHdY6D83uY6b2qh5hXlrcbeQTq2cvw2y95F7hm4D1kwrgZ7ViqaKggRcEupAL69YbJnxeUDKWEdI= diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/.zuul.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/.zuul.yml new file mode 100644 index 00000000..96d9cfbd --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/.zuul.yml @@ -0,0 +1 @@ +ui: tape diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/LICENSE new file mode 100644 index 00000000..e3d4e695 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/LICENSE @@ -0,0 +1,18 @@ +Copyright Joyent, Inc. and other Node contributors. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/README.md new file mode 100644 index 00000000..1a67c48c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/README.md @@ -0,0 +1,36 @@ +# readable-stream + +***Node-core v5.8.0 streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream) + + +[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/) +[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/) + + +[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream) + +```bash +npm install --save readable-stream +``` + +***Node-core streams for userland*** + +This package is a mirror of the Streams2 and Streams3 implementations in +Node-core, including [documentation](doc/stream.markdown). + +If you want to guarantee a stable streams base, regardless of what version of +Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html). + +As of version 2.0.0 **readable-stream** uses semantic versioning. + +# Streams WG Team Members + +* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) <christopher.s.dickinson@gmail.com> + - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B +* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com> + - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242 +* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) <rod@vagg.org> + - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D +* **Sam Newman** ([@sonewman](https://github.com/sonewman)) <newmansam@outlook.com> +* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com> +* **Domenic Denicola** ([@domenic](https://github.com/domenic)) <d@domenic.me> diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/doc/stream.markdown b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/doc/stream.markdown new file mode 100644 index 00000000..0bc3819e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/doc/stream.markdown @@ -0,0 +1,1760 @@ +# Stream + + Stability: 2 - Stable + +A stream is an abstract interface implemented by various objects in +Node.js. For example a [request to an HTTP server][http-incoming-message] is a +stream, as is [`process.stdout`][]. Streams are readable, writable, or both. All +streams are instances of [`EventEmitter`][]. + +You can load the Stream base classes by doing `require('stream')`. +There are base classes provided for [Readable][] streams, [Writable][] +streams, [Duplex][] streams, and [Transform][] streams. + +This document is split up into 3 sections: + +1. The first section explains the parts of the API that you need to be + aware of to use streams in your programs. +2. The second section explains the parts of the API that you need to + use if you implement your own custom streams yourself. The API is designed to + make this easy for you to do. +3. The third section goes into more depth about how streams work, + including some of the internal mechanisms and functions that you + should probably not modify unless you definitely know what you are + doing. + + +## API for Stream Consumers + + + +Streams can be either [Readable][], [Writable][], or both ([Duplex][]). + +All streams are EventEmitters, but they also have other custom methods +and properties depending on whether they are Readable, Writable, or +Duplex. + +If a stream is both Readable and Writable, then it implements all of +the methods and events. So, a [Duplex][] or [Transform][] stream is +fully described by this API, though their implementation may be +somewhat different. + +It is not necessary to implement Stream interfaces in order to consume +streams in your programs. If you **are** implementing streaming +interfaces in your own program, please also refer to +[API for Stream Implementors][]. + +Almost all Node.js programs, no matter how simple, use Streams in some +way. Here is an example of using Streams in an Node.js program: + +```js +const http = require('http'); + +var server = http.createServer( (req, res) => { + // req is an http.IncomingMessage, which is a Readable Stream + // res is an http.ServerResponse, which is a Writable Stream + + var body = ''; + // we want to get the data as utf8 strings + // If you don't set an encoding, then you'll get Buffer objects + req.setEncoding('utf8'); + + // Readable streams emit 'data' events once a listener is added + req.on('data', (chunk) => { + body += chunk; + }); + + // the end event tells you that you have entire body + req.on('end', () => { + try { + var data = JSON.parse(body); + } catch (er) { + // uh oh! bad json! + res.statusCode = 400; + return res.end(`error: ${er.message}`); + } + + // write back something interesting to the user: + res.write(typeof data); + res.end(); + }); +}); + +server.listen(1337); + +// $ curl localhost:1337 -d '{}' +// object +// $ curl localhost:1337 -d '"foo"' +// string +// $ curl localhost:1337 -d 'not json' +// error: Unexpected token o +``` + +### Class: stream.Duplex + +Duplex streams are streams that implement both the [Readable][] and +[Writable][] interfaces. + +Examples of Duplex streams include: + +* [TCP sockets][] +* [zlib streams][zlib] +* [crypto streams][crypto] + +### Class: stream.Readable + + + +The Readable stream interface is the abstraction for a *source* of +data that you are reading from. In other words, data comes *out* of a +Readable stream. + +A Readable stream will not start emitting data until you indicate that +you are ready to receive it. + +Readable streams have two "modes": a **flowing mode** and a **paused +mode**. When in flowing mode, data is read from the underlying system +and provided to your program as fast as possible. In paused mode, you +must explicitly call [`stream.read()`][stream-read] to get chunks of data out. +Streams start out in paused mode. + +**Note**: If no data event handlers are attached, and there are no +[`stream.pipe()`][] destinations, and the stream is switched into flowing +mode, then data will be lost. + +You can switch to flowing mode by doing any of the following: + +* Adding a [`'data'`][] event handler to listen for data. +* Calling the [`stream.resume()`][stream-resume] method to explicitly open the + flow. +* Calling the [`stream.pipe()`][] method to send the data to a [Writable][]. + +You can switch back to paused mode by doing either of the following: + +* If there are no pipe destinations, by calling the + [`stream.pause()`][stream-pause] method. +* If there are pipe destinations, by removing any [`'data'`][] event + handlers, and removing all pipe destinations by calling the + [`stream.unpipe()`][] method. + +Note that, for backwards compatibility reasons, removing [`'data'`][] +event handlers will **not** automatically pause the stream. Also, if +there are piped destinations, then calling [`stream.pause()`][stream-pause] will +not guarantee that the stream will *remain* paused once those +destinations drain and ask for more data. + +Examples of readable streams include: + +* [HTTP responses, on the client][http-incoming-message] +* [HTTP requests, on the server][http-incoming-message] +* [fs read streams][] +* [zlib streams][zlib] +* [crypto streams][crypto] +* [TCP sockets][] +* [child process stdout and stderr][] +* [`process.stdin`][] + +#### Event: 'close' + +Emitted when the stream and any of its underlying resources (a file +descriptor, for example) have been closed. The event indicates that +no more events will be emitted, and no further computation will occur. + +Not all streams will emit the `'close'` event. + +#### Event: 'data' + +* `chunk` {Buffer|String} The chunk of data. + +Attaching a `'data'` event listener to a stream that has not been +explicitly paused will switch the stream into flowing mode. Data will +then be passed as soon as it is available. + +If you just want to get all the data out of the stream as fast as +possible, this is the best way to do so. + +```js +var readable = getReadableStreamSomehow(); +readable.on('data', (chunk) => { + console.log('got %d bytes of data', chunk.length); +}); +``` + +#### Event: 'end' + +This event fires when there will be no more data to read. + +Note that the `'end'` event **will not fire** unless the data is +completely consumed. This can be done by switching into flowing mode, +or by calling [`stream.read()`][stream-read] repeatedly until you get to the +end. + +```js +var readable = getReadableStreamSomehow(); +readable.on('data', (chunk) => { + console.log('got %d bytes of data', chunk.length); +}); +readable.on('end', () => { + console.log('there will be no more data.'); +}); +``` + +#### Event: 'error' + +* {Error Object} + +Emitted if there was an error receiving data. + +#### Event: 'readable' + +When a chunk of data can be read from the stream, it will emit a +`'readable'` event. + +In some cases, listening for a `'readable'` event will cause some data +to be read into the internal buffer from the underlying system, if it +hadn't already. + +```javascript +var readable = getReadableStreamSomehow(); +readable.on('readable', () => { + // there is some data to read now +}); +``` + +Once the internal buffer is drained, a `'readable'` event will fire +again when more data is available. + +The `'readable'` event is not emitted in the "flowing" mode with the +sole exception of the last one, on end-of-stream. + +The `'readable'` event indicates that the stream has new information: +either new data is available or the end of the stream has been reached. +In the former case, [`stream.read()`][stream-read] will return that data. In the +latter case, [`stream.read()`][stream-read] will return null. For instance, in +the following example, `foo.txt` is an empty file: + +```js +const fs = require('fs'); +var rr = fs.createReadStream('foo.txt'); +rr.on('readable', () => { + console.log('readable:', rr.read()); +}); +rr.on('end', () => { + console.log('end'); +}); +``` + +The output of running this script is: + +``` +$ node test.js +readable: null +end +``` + +#### readable.isPaused() + +* Return: {Boolean} + +This method returns whether or not the `readable` has been **explicitly** +paused by client code (using [`stream.pause()`][stream-pause] without a +corresponding [`stream.resume()`][stream-resume]). + +```js +var readable = new stream.Readable + +readable.isPaused() // === false +readable.pause() +readable.isPaused() // === true +readable.resume() +readable.isPaused() // === false +``` + +#### readable.pause() + +* Return: `this` + +This method will cause a stream in flowing mode to stop emitting +[`'data'`][] events, switching out of flowing mode. Any data that becomes +available will remain in the internal buffer. + +```js +var readable = getReadableStreamSomehow(); +readable.on('data', (chunk) => { + console.log('got %d bytes of data', chunk.length); + readable.pause(); + console.log('there will be no more data for 1 second'); + setTimeout(() => { + console.log('now data will start flowing again'); + readable.resume(); + }, 1000); +}); +``` + +#### readable.pipe(destination[, options]) + +* `destination` {stream.Writable} The destination for writing data +* `options` {Object} Pipe options + * `end` {Boolean} End the writer when the reader ends. Default = `true` + +This method pulls all the data out of a readable stream, and writes it +to the supplied destination, automatically managing the flow so that +the destination is not overwhelmed by a fast readable stream. + +Multiple destinations can be piped to safely. + +```js +var readable = getReadableStreamSomehow(); +var writable = fs.createWriteStream('file.txt'); +// All the data from readable goes into 'file.txt' +readable.pipe(writable); +``` + +This function returns the destination stream, so you can set up pipe +chains like so: + +```js +var r = fs.createReadStream('file.txt'); +var z = zlib.createGzip(); +var w = fs.createWriteStream('file.txt.gz'); +r.pipe(z).pipe(w); +``` + +For example, emulating the Unix `cat` command: + +```js +process.stdin.pipe(process.stdout); +``` + +By default [`stream.end()`][stream-end] is called on the destination when the +source stream emits [`'end'`][], so that `destination` is no longer writable. +Pass `{ end: false }` as `options` to keep the destination stream open. + +This keeps `writer` open so that "Goodbye" can be written at the +end. + +```js +reader.pipe(writer, { end: false }); +reader.on('end', () => { + writer.end('Goodbye\n'); +}); +``` + +Note that [`process.stderr`][] and [`process.stdout`][] are never closed until +the process exits, regardless of the specified options. + +#### readable.read([size]) + +* `size` {Number} Optional argument to specify how much data to read. +* Return {String|Buffer|Null} + +The `read()` method pulls some data out of the internal buffer and +returns it. If there is no data available, then it will return +`null`. + +If you pass in a `size` argument, then it will return that many +bytes. If `size` bytes are not available, then it will return `null`, +unless we've ended, in which case it will return the data remaining +in the buffer. + +If you do not specify a `size` argument, then it will return all the +data in the internal buffer. + +This method should only be called in paused mode. In flowing mode, +this method is called automatically until the internal buffer is +drained. + +```js +var readable = getReadableStreamSomehow(); +readable.on('readable', () => { + var chunk; + while (null !== (chunk = readable.read())) { + console.log('got %d bytes of data', chunk.length); + } +}); +``` + +If this method returns a data chunk, then it will also trigger the +emission of a [`'data'`][] event. + +Note that calling [`stream.read([size])`][stream-read] after the [`'end'`][] +event has been triggered will return `null`. No runtime error will be raised. + +#### readable.resume() + +* Return: `this` + +This method will cause the readable stream to resume emitting [`'data'`][] +events. + +This method will switch the stream into flowing mode. If you do *not* +want to consume the data from a stream, but you *do* want to get to +its [`'end'`][] event, you can call [`stream.resume()`][stream-resume] to open +the flow of data. + +```js +var readable = getReadableStreamSomehow(); +readable.resume(); +readable.on('end', () => { + console.log('got to the end, but did not read anything'); +}); +``` + +#### readable.setEncoding(encoding) + +* `encoding` {String} The encoding to use. +* Return: `this` + +Call this function to cause the stream to return strings of the specified +encoding instead of Buffer objects. For example, if you do +`readable.setEncoding('utf8')`, then the output data will be interpreted as +UTF-8 data, and returned as strings. If you do `readable.setEncoding('hex')`, +then the data will be encoded in hexadecimal string format. + +This properly handles multi-byte characters that would otherwise be +potentially mangled if you simply pulled the Buffers directly and +called [`buf.toString(encoding)`][] on them. If you want to read the data +as strings, always use this method. + +Also you can disable any encoding at all with `readable.setEncoding(null)`. +This approach is very useful if you deal with binary data or with large +multi-byte strings spread out over multiple chunks. + +```js +var readable = getReadableStreamSomehow(); +readable.setEncoding('utf8'); +readable.on('data', (chunk) => { + assert.equal(typeof chunk, 'string'); + console.log('got %d characters of string data', chunk.length); +}); +``` + +#### readable.unpipe([destination]) + +* `destination` {stream.Writable} Optional specific stream to unpipe + +This method will remove the hooks set up for a previous [`stream.pipe()`][] +call. + +If the destination is not specified, then all pipes are removed. + +If the destination is specified, but no pipe is set up for it, then +this is a no-op. + +```js +var readable = getReadableStreamSomehow(); +var writable = fs.createWriteStream('file.txt'); +// All the data from readable goes into 'file.txt', +// but only for the first second +readable.pipe(writable); +setTimeout(() => { + console.log('stop writing to file.txt'); + readable.unpipe(writable); + console.log('manually close the file stream'); + writable.end(); +}, 1000); +``` + +#### readable.unshift(chunk) + +* `chunk` {Buffer|String} Chunk of data to unshift onto the read queue + +This is useful in certain cases where a stream is being consumed by a +parser, which needs to "un-consume" some data that it has +optimistically pulled out of the source, so that the stream can be +passed on to some other party. + +Note that `stream.unshift(chunk)` cannot be called after the [`'end'`][] event +has been triggered; a runtime error will be raised. + +If you find that you must often call `stream.unshift(chunk)` in your +programs, consider implementing a [Transform][] stream instead. (See [API +for Stream Implementors][].) + +```js +// Pull off a header delimited by \n\n +// use unshift() if we get too much +// Call the callback with (error, header, stream) +const StringDecoder = require('string_decoder').StringDecoder; +function parseHeader(stream, callback) { + stream.on('error', callback); + stream.on('readable', onReadable); + var decoder = new StringDecoder('utf8'); + var header = ''; + function onReadable() { + var chunk; + while (null !== (chunk = stream.read())) { + var str = decoder.write(chunk); + if (str.match(/\n\n/)) { + // found the header boundary + var split = str.split(/\n\n/); + header += split.shift(); + var remaining = split.join('\n\n'); + var buf = new Buffer(remaining, 'utf8'); + if (buf.length) + stream.unshift(buf); + stream.removeListener('error', callback); + stream.removeListener('readable', onReadable); + // now the body of the message can be read from the stream. + callback(null, header, stream); + } else { + // still reading the header. + header += str; + } + } + } +} +``` + +Note that, unlike [`stream.push(chunk)`][stream-push], `stream.unshift(chunk)` +will not end the reading process by resetting the internal reading state of the +stream. This can cause unexpected results if `unshift()` is called during a +read (i.e. from within a [`stream._read()`][stream-_read] implementation on a +custom stream). Following the call to `unshift()` with an immediate +[`stream.push('')`][stream-push] will reset the reading state appropriately, +however it is best to simply avoid calling `unshift()` while in the process of +performing a read. + +#### readable.wrap(stream) + +* `stream` {Stream} An "old style" readable stream + +Versions of Node.js prior to v0.10 had streams that did not implement the +entire Streams API as it is today. (See [Compatibility][] for +more information.) + +If you are using an older Node.js library that emits [`'data'`][] events and +has a [`stream.pause()`][stream-pause] method that is advisory only, then you +can use the `wrap()` method to create a [Readable][] stream that uses the old +stream as its data source. + +You will very rarely ever need to call this function, but it exists +as a convenience for interacting with old Node.js programs and libraries. + +For example: + +```js +const OldReader = require('./old-api-module.js').OldReader; +const Readable = require('stream').Readable; +const oreader = new OldReader; +const myReader = new Readable().wrap(oreader); + +myReader.on('readable', () => { + myReader.read(); // etc. +}); +``` + +### Class: stream.Transform + +Transform streams are [Duplex][] streams where the output is in some way +computed from the input. They implement both the [Readable][] and +[Writable][] interfaces. + +Examples of Transform streams include: + +* [zlib streams][zlib] +* [crypto streams][crypto] + +### Class: stream.Writable + + + +The Writable stream interface is an abstraction for a *destination* +that you are writing data *to*. + +Examples of writable streams include: + +* [HTTP requests, on the client][] +* [HTTP responses, on the server][] +* [fs write streams][] +* [zlib streams][zlib] +* [crypto streams][crypto] +* [TCP sockets][] +* [child process stdin][] +* [`process.stdout`][], [`process.stderr`][] + +#### Event: 'drain' + +If a [`stream.write(chunk)`][stream-write] call returns `false`, then the +`'drain'` event will indicate when it is appropriate to begin writing more data +to the stream. + +```js +// Write the data to the supplied writable stream one million times. +// Be attentive to back-pressure. +function writeOneMillionTimes(writer, data, encoding, callback) { + var i = 1000000; + write(); + function write() { + var ok = true; + do { + i -= 1; + if (i === 0) { + // last time! + writer.write(data, encoding, callback); + } else { + // see if we should continue, or wait + // don't pass the callback, because we're not done yet. + ok = writer.write(data, encoding); + } + } while (i > 0 && ok); + if (i > 0) { + // had to stop early! + // write some more once it drains + writer.once('drain', write); + } + } +} +``` + +#### Event: 'error' + +* {Error} + +Emitted if there was an error when writing or piping data. + +#### Event: 'finish' + +When the [`stream.end()`][stream-end] method has been called, and all data has +been flushed to the underlying system, this event is emitted. + +```javascript +var writer = getWritableStreamSomehow(); +for (var i = 0; i < 100; i ++) { + writer.write('hello, #${i}!\n'); +} +writer.end('this is the end\n'); +writer.on('finish', () => { + console.error('all writes are now complete.'); +}); +``` + +#### Event: 'pipe' + +* `src` {stream.Readable} source stream that is piping to this writable + +This is emitted whenever the [`stream.pipe()`][] method is called on a readable +stream, adding this writable to its set of destinations. + +```js +var writer = getWritableStreamSomehow(); +var reader = getReadableStreamSomehow(); +writer.on('pipe', (src) => { + console.error('something is piping into the writer'); + assert.equal(src, reader); +}); +reader.pipe(writer); +``` + +#### Event: 'unpipe' + +* `src` {[Readable][] Stream} The source stream that + [unpiped][`stream.unpipe()`] this writable + +This is emitted whenever the [`stream.unpipe()`][] method is called on a +readable stream, removing this writable from its set of destinations. + +```js +var writer = getWritableStreamSomehow(); +var reader = getReadableStreamSomehow(); +writer.on('unpipe', (src) => { + console.error('something has stopped piping into the writer'); + assert.equal(src, reader); +}); +reader.pipe(writer); +reader.unpipe(writer); +``` + +#### writable.cork() + +Forces buffering of all writes. + +Buffered data will be flushed either at [`stream.uncork()`][] or at +[`stream.end()`][stream-end] call. + +#### writable.end([chunk][, encoding][, callback]) + +* `chunk` {String|Buffer} Optional data to write +* `encoding` {String} The encoding, if `chunk` is a String +* `callback` {Function} Optional callback for when the stream is finished + +Call this method when no more data will be written to the stream. If supplied, +the callback is attached as a listener on the [`'finish'`][] event. + +Calling [`stream.write()`][stream-write] after calling +[`stream.end()`][stream-end] will raise an error. + +```js +// write 'hello, ' and then end with 'world!' +var file = fs.createWriteStream('example.txt'); +file.write('hello, '); +file.end('world!'); +// writing more now is not allowed! +``` + +#### writable.setDefaultEncoding(encoding) + +* `encoding` {String} The new default encoding + +Sets the default encoding for a writable stream. + +#### writable.uncork() + +Flush all data, buffered since [`stream.cork()`][] call. + +#### writable.write(chunk[, encoding][, callback]) + +* `chunk` {String|Buffer} The data to write +* `encoding` {String} The encoding, if `chunk` is a String +* `callback` {Function} Callback for when this chunk of data is flushed +* Returns: {Boolean} `true` if the data was handled completely. + +This method writes some data to the underlying system, and calls the +supplied callback once the data has been fully handled. + +The return value indicates if you should continue writing right now. +If the data had to be buffered internally, then it will return +`false`. Otherwise, it will return `true`. + +This return value is strictly advisory. You MAY continue to write, +even if it returns `false`. However, writes will be buffered in +memory, so it is best not to do this excessively. Instead, wait for +the [`'drain'`][] event before writing more data. + + +## API for Stream Implementors + + + +To implement any sort of stream, the pattern is the same: + +1. Extend the appropriate parent class in your own subclass. (The + [`util.inherits()`][] method is particularly helpful for this.) +2. Call the appropriate parent class constructor in your constructor, + to be sure that the internal mechanisms are set up properly. +3. Implement one or more specific methods, as detailed below. + +The class to extend and the method(s) to implement depend on the sort +of stream class you are writing: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      +

      Use-case

      +
      +

      Class

      +
      +

      Method(s) to implement

      +
      +

      Reading only

      +
      +

      [Readable](#stream_class_stream_readable_1)

      +
      +

      [_read][stream-_read]

      +
      +

      Writing only

      +
      +

      [Writable](#stream_class_stream_writable_1)

      +
      +

      [_write][stream-_write], [_writev][stream-_writev]

      +
      +

      Reading and writing

      +
      +

      [Duplex](#stream_class_stream_duplex_1)

      +
      +

      [_read][stream-_read], [_write][stream-_write], [_writev][stream-_writev]

      +
      +

      Operate on written data, then read the result

      +
      +

      [Transform](#stream_class_stream_transform_1)

      +
      +

      [_transform][stream-_transform], [_flush][stream-_flush]

      +
      + +In your implementation code, it is very important to never call the methods +described in [API for Stream Consumers][]. Otherwise, you can potentially cause +adverse side effects in programs that consume your streaming interfaces. + +### Class: stream.Duplex + + + +A "duplex" stream is one that is both Readable and Writable, such as a TCP +socket connection. + +Note that `stream.Duplex` is an abstract class designed to be extended +with an underlying implementation of the [`stream._read(size)`][stream-_read] +and [`stream._write(chunk, encoding, callback)`][stream-_write] methods as you +would with a Readable or Writable stream class. + +Since JavaScript doesn't have multiple prototypal inheritance, this class +prototypally inherits from Readable, and then parasitically from Writable. It is +thus up to the user to implement both the low-level +[`stream._read(n)`][stream-_read] method as well as the low-level +[`stream._write(chunk, encoding, callback)`][stream-_write] method on extension +duplex classes. + +#### new stream.Duplex(options) + +* `options` {Object} Passed to both Writable and Readable + constructors. Also has the following fields: + * `allowHalfOpen` {Boolean} Default = `true`. If set to `false`, then + the stream will automatically end the readable side when the + writable side ends and vice versa. + * `readableObjectMode` {Boolean} Default = `false`. Sets `objectMode` + for readable side of the stream. Has no effect if `objectMode` + is `true`. + * `writableObjectMode` {Boolean} Default = `false`. Sets `objectMode` + for writable side of the stream. Has no effect if `objectMode` + is `true`. + +In classes that extend the Duplex class, make sure to call the +constructor so that the buffering settings can be properly +initialized. + +### Class: stream.PassThrough + +This is a trivial implementation of a [Transform][] stream that simply +passes the input bytes across to the output. Its purpose is mainly +for examples and testing, but there are occasionally use cases where +it can come in handy as a building block for novel sorts of streams. + +### Class: stream.Readable + + + +`stream.Readable` is an abstract class designed to be extended with an +underlying implementation of the [`stream._read(size)`][stream-_read] method. + +Please see [API for Stream Consumers][] for how to consume +streams in your programs. What follows is an explanation of how to +implement Readable streams in your programs. + +#### new stream.Readable([options]) + +* `options` {Object} + * `highWaterMark` {Number} The maximum number of bytes to store in + the internal buffer before ceasing to read from the underlying + resource. Default = `16384` (16kb), or `16` for `objectMode` streams + * `encoding` {String} If specified, then buffers will be decoded to + strings using the specified encoding. Default = `null` + * `objectMode` {Boolean} Whether this stream should behave + as a stream of objects. Meaning that [`stream.read(n)`][stream-read] returns + a single value instead of a Buffer of size n. Default = `false` + * `read` {Function} Implementation for the [`stream._read()`][stream-_read] + method. + +In classes that extend the Readable class, make sure to call the +Readable constructor so that the buffering settings can be properly +initialized. + +#### readable.\_read(size) + +* `size` {Number} Number of bytes to read asynchronously + +Note: **Implement this method, but do NOT call it directly.** + +This method is prefixed with an underscore because it is internal to the +class that defines it and should only be called by the internal Readable +class methods. All Readable stream implementations must provide a \_read +method to fetch data from the underlying resource. + +When `_read()` is called, if data is available from the resource, the `_read()` +implementation should start pushing that data into the read queue by calling +[`this.push(dataChunk)`][stream-push]. `_read()` should continue reading from +the resource and pushing data until push returns `false`, at which point it +should stop reading from the resource. Only when `_read()` is called again after +it has stopped should it start reading more data from the resource and pushing +that data onto the queue. + +Note: once the `_read()` method is called, it will not be called again until +the [`stream.push()`][stream-push] method is called. + +The `size` argument is advisory. Implementations where a "read" is a +single call that returns data can use this to know how much data to +fetch. Implementations where that is not relevant, such as TCP or +TLS, may ignore this argument, and simply provide data whenever it +becomes available. There is no need, for example to "wait" until +`size` bytes are available before calling [`stream.push(chunk)`][stream-push]. + +#### readable.push(chunk[, encoding]) + + +* `chunk` {Buffer|Null|String} Chunk of data to push into the read queue +* `encoding` {String} Encoding of String chunks. Must be a valid + Buffer encoding, such as `'utf8'` or `'ascii'` +* return {Boolean} Whether or not more pushes should be performed + +Note: **This method should be called by Readable implementors, NOT +by consumers of Readable streams.** + +If a value other than null is passed, The `push()` method adds a chunk of data +into the queue for subsequent stream processors to consume. If `null` is +passed, it signals the end of the stream (EOF), after which no more data +can be written. + +The data added with `push()` can be pulled out by calling the +[`stream.read()`][stream-read] method when the [`'readable'`][] event fires. + +This API is designed to be as flexible as possible. For example, +you may be wrapping a lower-level source which has some sort of +pause/resume mechanism, and a data callback. In those cases, you +could wrap the low-level source object by doing something like this: + +```js +// source is an object with readStop() and readStart() methods, +// and an `ondata` member that gets called when it has data, and +// an `onend` member that gets called when the data is over. + +util.inherits(SourceWrapper, Readable); + +function SourceWrapper(options) { + Readable.call(this, options); + + this._source = getLowlevelSourceObject(); + + // Every time there's data, we push it into the internal buffer. + this._source.ondata = (chunk) => { + // if push() returns false, then we need to stop reading from source + if (!this.push(chunk)) + this._source.readStop(); + }; + + // When the source ends, we push the EOF-signaling `null` chunk + this._source.onend = () => { + this.push(null); + }; +} + +// _read will be called when the stream wants to pull more data in +// the advisory size argument is ignored in this case. +SourceWrapper.prototype._read = function(size) { + this._source.readStart(); +}; +``` + +#### Example: A Counting Stream + + + +This is a basic example of a Readable stream. It emits the numerals +from 1 to 1,000,000 in ascending order, and then ends. + +```js +const Readable = require('stream').Readable; +const util = require('util'); +util.inherits(Counter, Readable); + +function Counter(opt) { + Readable.call(this, opt); + this._max = 1000000; + this._index = 1; +} + +Counter.prototype._read = function() { + var i = this._index++; + if (i > this._max) + this.push(null); + else { + var str = '' + i; + var buf = new Buffer(str, 'ascii'); + this.push(buf); + } +}; +``` + +#### Example: SimpleProtocol v1 (Sub-optimal) + +This is similar to the `parseHeader` function described +[here](#stream_readable_unshift_chunk), but implemented as a custom stream. +Also, note that this implementation does not convert the incoming data to a +string. + +However, this would be better implemented as a [Transform][] stream. See +[SimpleProtocol v2][] for a better implementation. + +```js +// A parser for a simple data protocol. +// The "header" is a JSON object, followed by 2 \n characters, and +// then a message body. +// +// NOTE: This can be done more simply as a Transform stream! +// Using Readable directly for this is sub-optimal. See the +// alternative example below under the Transform section. + +const Readable = require('stream').Readable; +const util = require('util'); + +util.inherits(SimpleProtocol, Readable); + +function SimpleProtocol(source, options) { + if (!(this instanceof SimpleProtocol)) + return new SimpleProtocol(source, options); + + Readable.call(this, options); + this._inBody = false; + this._sawFirstCr = false; + + // source is a readable stream, such as a socket or file + this._source = source; + + var self = this; + source.on('end', () => { + self.push(null); + }); + + // give it a kick whenever the source is readable + // read(0) will not consume any bytes + source.on('readable', () => { + self.read(0); + }); + + this._rawHeader = []; + this.header = null; +} + +SimpleProtocol.prototype._read = function(n) { + if (!this._inBody) { + var chunk = this._source.read(); + + // if the source doesn't have data, we don't have data yet. + if (chunk === null) + return this.push(''); + + // check if the chunk has a \n\n + var split = -1; + for (var i = 0; i < chunk.length; i++) { + if (chunk[i] === 10) { // '\n' + if (this._sawFirstCr) { + split = i; + break; + } else { + this._sawFirstCr = true; + } + } else { + this._sawFirstCr = false; + } + } + + if (split === -1) { + // still waiting for the \n\n + // stash the chunk, and try again. + this._rawHeader.push(chunk); + this.push(''); + } else { + this._inBody = true; + var h = chunk.slice(0, split); + this._rawHeader.push(h); + var header = Buffer.concat(this._rawHeader).toString(); + try { + this.header = JSON.parse(header); + } catch (er) { + this.emit('error', new Error('invalid simple protocol data')); + return; + } + // now, because we got some extra data, unshift the rest + // back into the read queue so that our consumer will see it. + var b = chunk.slice(split); + this.unshift(b); + // calling unshift by itself does not reset the reading state + // of the stream; since we're inside _read, doing an additional + // push('') will reset the state appropriately. + this.push(''); + + // and let them know that we are done parsing the header. + this.emit('header', this.header); + } + } else { + // from there on, just provide the data to our consumer. + // careful not to push(null), since that would indicate EOF. + var chunk = this._source.read(); + if (chunk) this.push(chunk); + } +}; + +// Usage: +// var parser = new SimpleProtocol(source); +// Now parser is a readable stream that will emit 'header' +// with the parsed header data. +``` + +### Class: stream.Transform + +A "transform" stream is a duplex stream where the output is causally +connected in some way to the input, such as a [zlib][] stream or a +[crypto][] stream. + +There is no requirement that the output be the same size as the input, +the same number of chunks, or arrive at the same time. For example, a +Hash stream will only ever have a single chunk of output which is +provided when the input is ended. A zlib stream will produce output +that is either much smaller or much larger than its input. + +Rather than implement the [`stream._read()`][stream-_read] and +[`stream._write()`][stream-_write] methods, Transform classes must implement the +[`stream._transform()`][stream-_transform] method, and may optionally +also implement the [`stream._flush()`][stream-_flush] method. (See below.) + +#### new stream.Transform([options]) + +* `options` {Object} Passed to both Writable and Readable + constructors. Also has the following fields: + * `transform` {Function} Implementation for the + [`stream._transform()`][stream-_transform] method. + * `flush` {Function} Implementation for the [`stream._flush()`][stream-_flush] + method. + +In classes that extend the Transform class, make sure to call the +constructor so that the buffering settings can be properly +initialized. + +#### Events: 'finish' and 'end' + +The [`'finish'`][] and [`'end'`][] events are from the parent Writable +and Readable classes respectively. The `'finish'` event is fired after +[`stream.end()`][stream-end] is called and all chunks have been processed by +[`stream._transform()`][stream-_transform], `'end'` is fired after all data has +been output which is after the callback in [`stream._flush()`][stream-_flush] +has been called. + +#### transform.\_flush(callback) + +* `callback` {Function} Call this function (optionally with an error + argument) when you are done flushing any remaining data. + +Note: **This function MUST NOT be called directly.** It MAY be implemented +by child classes, and if so, will be called by the internal Transform +class methods only. + +In some cases, your transform operation may need to emit a bit more +data at the end of the stream. For example, a `Zlib` compression +stream will store up some internal state so that it can optimally +compress the output. At the end, however, it needs to do the best it +can with what is left, so that the data will be complete. + +In those cases, you can implement a `_flush()` method, which will be +called at the very end, after all the written data is consumed, but +before emitting [`'end'`][] to signal the end of the readable side. Just +like with [`stream._transform()`][stream-_transform], call +`transform.push(chunk)` zero or more times, as appropriate, and call `callback` +when the flush operation is complete. + +This method is prefixed with an underscore because it is internal to +the class that defines it, and should not be called directly by user +programs. However, you **are** expected to override this method in +your own extension classes. + +#### transform.\_transform(chunk, encoding, callback) + +* `chunk` {Buffer|String} The chunk to be transformed. Will **always** + be a buffer unless the `decodeStrings` option was set to `false`. +* `encoding` {String} If the chunk is a string, then this is the + encoding type. If chunk is a buffer, then this is the special + value - 'buffer', ignore it in this case. +* `callback` {Function} Call this function (optionally with an error + argument and data) when you are done processing the supplied chunk. + +Note: **This function MUST NOT be called directly.** It should be +implemented by child classes, and called by the internal Transform +class methods only. + +All Transform stream implementations must provide a `_transform()` +method to accept input and produce output. + +`_transform()` should do whatever has to be done in this specific +Transform class, to handle the bytes being written, and pass them off +to the readable portion of the interface. Do asynchronous I/O, +process things, and so on. + +Call `transform.push(outputChunk)` 0 or more times to generate output +from this input chunk, depending on how much data you want to output +as a result of this chunk. + +Call the callback function only when the current chunk is completely +consumed. Note that there may or may not be output as a result of any +particular input chunk. If you supply a second argument to the callback +it will be passed to the push method. In other words the following are +equivalent: + +```js +transform.prototype._transform = function (data, encoding, callback) { + this.push(data); + callback(); +}; + +transform.prototype._transform = function (data, encoding, callback) { + callback(null, data); +}; +``` + +This method is prefixed with an underscore because it is internal to +the class that defines it, and should not be called directly by user +programs. However, you **are** expected to override this method in +your own extension classes. + +#### Example: `SimpleProtocol` parser v2 + +The example [here](#stream_example_simpleprotocol_v1_sub_optimal) of a simple +protocol parser can be implemented simply by using the higher level +[Transform][] stream class, similar to the `parseHeader` and `SimpleProtocol +v1` examples. + +In this example, rather than providing the input as an argument, it +would be piped into the parser, which is a more idiomatic Node.js stream +approach. + +```javascript +const util = require('util'); +const Transform = require('stream').Transform; +util.inherits(SimpleProtocol, Transform); + +function SimpleProtocol(options) { + if (!(this instanceof SimpleProtocol)) + return new SimpleProtocol(options); + + Transform.call(this, options); + this._inBody = false; + this._sawFirstCr = false; + this._rawHeader = []; + this.header = null; +} + +SimpleProtocol.prototype._transform = function(chunk, encoding, done) { + if (!this._inBody) { + // check if the chunk has a \n\n + var split = -1; + for (var i = 0; i < chunk.length; i++) { + if (chunk[i] === 10) { // '\n' + if (this._sawFirstCr) { + split = i; + break; + } else { + this._sawFirstCr = true; + } + } else { + this._sawFirstCr = false; + } + } + + if (split === -1) { + // still waiting for the \n\n + // stash the chunk, and try again. + this._rawHeader.push(chunk); + } else { + this._inBody = true; + var h = chunk.slice(0, split); + this._rawHeader.push(h); + var header = Buffer.concat(this._rawHeader).toString(); + try { + this.header = JSON.parse(header); + } catch (er) { + this.emit('error', new Error('invalid simple protocol data')); + return; + } + // and let them know that we are done parsing the header. + this.emit('header', this.header); + + // now, because we got some extra data, emit this first. + this.push(chunk.slice(split)); + } + } else { + // from there on, just provide the data to our consumer as-is. + this.push(chunk); + } + done(); +}; + +// Usage: +// var parser = new SimpleProtocol(); +// source.pipe(parser) +// Now parser is a readable stream that will emit 'header' +// with the parsed header data. +``` + +### Class: stream.Writable + + + +`stream.Writable` is an abstract class designed to be extended with an +underlying implementation of the +[`stream._write(chunk, encoding, callback)`][stream-_write] method. + +Please see [API for Stream Consumers][] for how to consume +writable streams in your programs. What follows is an explanation of +how to implement Writable streams in your programs. + +#### new stream.Writable([options]) + +* `options` {Object} + * `highWaterMark` {Number} Buffer level when + [`stream.write()`][stream-write] starts returning `false`. Default = `16384` + (16kb), or `16` for `objectMode` streams. + * `decodeStrings` {Boolean} Whether or not to decode strings into + Buffers before passing them to [`stream._write()`][stream-_write]. + Default = `true` + * `objectMode` {Boolean} Whether or not the + [`stream.write(anyObj)`][stream-write] is a valid operation. If set you can + write arbitrary data instead of only `Buffer` / `String` data. + Default = `false` + * `write` {Function} Implementation for the + [`stream._write()`][stream-_write] method. + * `writev` {Function} Implementation for the + [`stream._writev()`][stream-_writev] method. + +In classes that extend the Writable class, make sure to call the +constructor so that the buffering settings can be properly +initialized. + +#### writable.\_write(chunk, encoding, callback) + +* `chunk` {Buffer|String} The chunk to be written. Will **always** + be a buffer unless the `decodeStrings` option was set to `false`. +* `encoding` {String} If the chunk is a string, then this is the + encoding type. If chunk is a buffer, then this is the special + value - 'buffer', ignore it in this case. +* `callback` {Function} Call this function (optionally with an error + argument) when you are done processing the supplied chunk. + +All Writable stream implementations must provide a +[`stream._write()`][stream-_write] method to send data to the underlying +resource. + +Note: **This function MUST NOT be called directly.** It should be +implemented by child classes, and called by the internal Writable +class methods only. + +Call the callback using the standard `callback(error)` pattern to +signal that the write completed successfully or with an error. + +If the `decodeStrings` flag is set in the constructor options, then +`chunk` may be a string rather than a Buffer, and `encoding` will +indicate the sort of string that it is. This is to support +implementations that have an optimized handling for certain string +data encodings. If you do not explicitly set the `decodeStrings` +option to `false`, then you can safely ignore the `encoding` argument, +and assume that `chunk` will always be a Buffer. + +This method is prefixed with an underscore because it is internal to +the class that defines it, and should not be called directly by user +programs. However, you **are** expected to override this method in +your own extension classes. + +#### writable.\_writev(chunks, callback) + +* `chunks` {Array} The chunks to be written. Each chunk has following + format: `{ chunk: ..., encoding: ... }`. +* `callback` {Function} Call this function (optionally with an error + argument) when you are done processing the supplied chunks. + +Note: **This function MUST NOT be called directly.** It may be +implemented by child classes, and called by the internal Writable +class methods only. + +This function is completely optional to implement. In most cases it is +unnecessary. If implemented, it will be called with all the chunks +that are buffered in the write queue. + + +## Simplified Constructor API + + + +In simple cases there is now the added benefit of being able to construct a +stream without inheritance. + +This can be done by passing the appropriate methods as constructor options: + +Examples: + +### Duplex + +```js +var duplex = new stream.Duplex({ + read: function(n) { + // sets this._read under the hood + + // push data onto the read queue, passing null + // will signal the end of the stream (EOF) + this.push(chunk); + }, + write: function(chunk, encoding, next) { + // sets this._write under the hood + + // An optional error can be passed as the first argument + next() + } +}); + +// or + +var duplex = new stream.Duplex({ + read: function(n) { + // sets this._read under the hood + + // push data onto the read queue, passing null + // will signal the end of the stream (EOF) + this.push(chunk); + }, + writev: function(chunks, next) { + // sets this._writev under the hood + + // An optional error can be passed as the first argument + next() + } +}); +``` + +### Readable + +```js +var readable = new stream.Readable({ + read: function(n) { + // sets this._read under the hood + + // push data onto the read queue, passing null + // will signal the end of the stream (EOF) + this.push(chunk); + } +}); +``` + +### Transform + +```js +var transform = new stream.Transform({ + transform: function(chunk, encoding, next) { + // sets this._transform under the hood + + // generate output as many times as needed + // this.push(chunk); + + // call when the current chunk is consumed + next(); + }, + flush: function(done) { + // sets this._flush under the hood + + // generate output as many times as needed + // this.push(chunk); + + done(); + } +}); +``` + +### Writable + +```js +var writable = new stream.Writable({ + write: function(chunk, encoding, next) { + // sets this._write under the hood + + // An optional error can be passed as the first argument + next() + } +}); + +// or + +var writable = new stream.Writable({ + writev: function(chunks, next) { + // sets this._writev under the hood + + // An optional error can be passed as the first argument + next() + } +}); +``` + +## Streams: Under the Hood + + + +### Buffering + + + +Both Writable and Readable streams will buffer data on an internal +object which can be retrieved from `_writableState.getBuffer()` or +`_readableState.buffer`, respectively. + +The amount of data that will potentially be buffered depends on the +`highWaterMark` option which is passed into the constructor. + +Buffering in Readable streams happens when the implementation calls +[`stream.push(chunk)`][stream-push]. If the consumer of the Stream does not +call [`stream.read()`][stream-read], then the data will sit in the internal +queue until it is consumed. + +Buffering in Writable streams happens when the user calls +[`stream.write(chunk)`][stream-write] repeatedly, even when it returns `false`. + +The purpose of streams, especially with the [`stream.pipe()`][] method, is to +limit the buffering of data to acceptable levels, so that sources and +destinations of varying speed will not overwhelm the available memory. + +### Compatibility with Older Node.js Versions + + + +In versions of Node.js prior to v0.10, the Readable stream interface was +simpler, but also less powerful and less useful. + +* Rather than waiting for you to call the [`stream.read()`][stream-read] method, + [`'data'`][] events would start emitting immediately. If you needed to do + some I/O to decide how to handle data, then you had to store the chunks + in some kind of buffer so that they would not be lost. +* The [`stream.pause()`][stream-pause] method was advisory, rather than + guaranteed. This meant that you still had to be prepared to receive + [`'data'`][] events even when the stream was in a paused state. + +In Node.js v0.10, the [Readable][] class was added. +For backwards compatibility with older Node.js programs, Readable streams +switch into "flowing mode" when a [`'data'`][] event handler is added, or +when the [`stream.resume()`][stream-resume] method is called. The effect is +that, even if you are not using the new [`stream.read()`][stream-read] method +and [`'readable'`][] event, you no longer have to worry about losing +[`'data'`][] chunks. + +Most programs will continue to function normally. However, this +introduces an edge case in the following conditions: + +* No [`'data'`][] event handler is added. +* The [`stream.resume()`][stream-resume] method is never called. +* The stream is not piped to any writable destination. + +For example, consider the following code: + +```js +// WARNING! BROKEN! +net.createServer((socket) => { + + // we add an 'end' method, but never consume the data + socket.on('end', () => { + // It will never get here. + socket.end('I got your message (but didnt read it)\n'); + }); + +}).listen(1337); +``` + +In versions of Node.js prior to v0.10, the incoming message data would be +simply discarded. However, in Node.js v0.10 and beyond, +the socket will remain paused forever. + +The workaround in this situation is to call the +[`stream.resume()`][stream-resume] method to start the flow of data: + +```js +// Workaround +net.createServer((socket) => { + + socket.on('end', () => { + socket.end('I got your message (but didnt read it)\n'); + }); + + // start the flow of data, discarding it. + socket.resume(); + +}).listen(1337); +``` + +In addition to new Readable streams switching into flowing mode, +pre-v0.10 style streams can be wrapped in a Readable class using the +[`stream.wrap()`][] method. + + +### Object Mode + + + +Normally, Streams operate on Strings and Buffers exclusively. + +Streams that are in **object mode** can emit generic JavaScript values +other than Buffers and Strings. + +A Readable stream in object mode will always return a single item from +a call to [`stream.read(size)`][stream-read], regardless of what the size +argument is. + +A Writable stream in object mode will always ignore the `encoding` +argument to [`stream.write(data, encoding)`][stream-write]. + +The special value `null` still retains its special value for object +mode streams. That is, for object mode readable streams, `null` as a +return value from [`stream.read()`][stream-read] indicates that there is no more +data, and [`stream.push(null)`][stream-push] will signal the end of stream data +(`EOF`). + +No streams in Node.js core are object mode streams. This pattern is only +used by userland streaming libraries. + +You should set `objectMode` in your stream child class constructor on +the options object. Setting `objectMode` mid-stream is not safe. + +For Duplex streams `objectMode` can be set exclusively for readable or +writable side with `readableObjectMode` and `writableObjectMode` +respectively. These options can be used to implement parsers and +serializers with Transform streams. + +```js +const util = require('util'); +const StringDecoder = require('string_decoder').StringDecoder; +const Transform = require('stream').Transform; +util.inherits(JSONParseStream, Transform); + +// Gets \n-delimited JSON string data, and emits the parsed objects +function JSONParseStream() { + if (!(this instanceof JSONParseStream)) + return new JSONParseStream(); + + Transform.call(this, { readableObjectMode : true }); + + this._buffer = ''; + this._decoder = new StringDecoder('utf8'); +} + +JSONParseStream.prototype._transform = function(chunk, encoding, cb) { + this._buffer += this._decoder.write(chunk); + // split on newlines + var lines = this._buffer.split(/\r?\n/); + // keep the last partial line buffered + this._buffer = lines.pop(); + for (var l = 0; l < lines.length; l++) { + var line = lines[l]; + try { + var obj = JSON.parse(line); + } catch (er) { + this.emit('error', er); + return; + } + // push the parsed object out to the readable consumer + this.push(obj); + } + cb(); +}; + +JSONParseStream.prototype._flush = function(cb) { + // Just handle any leftover + var rem = this._buffer.trim(); + if (rem) { + try { + var obj = JSON.parse(rem); + } catch (er) { + this.emit('error', er); + return; + } + // push the parsed object out to the readable consumer + this.push(obj); + } + cb(); +}; +``` + +### `stream.read(0)` + +There are some cases where you want to trigger a refresh of the +underlying readable stream mechanisms, without actually consuming any +data. In that case, you can call `stream.read(0)`, which will always +return null. + +If the internal read buffer is below the `highWaterMark`, and the +stream is not currently reading, then calling `stream.read(0)` will trigger +a low-level [`stream._read()`][stream-_read] call. + +There is almost never a need to do this. However, you will see some +cases in Node.js's internals where this is done, particularly in the +Readable stream class internals. + +### `stream.push('')` + +Pushing a zero-byte string or Buffer (when not in [Object mode][]) has an +interesting side effect. Because it *is* a call to +[`stream.push()`][stream-push], it will end the `reading` process. However, it +does *not* add any data to the readable buffer, so there's nothing for +a user to consume. + +Very rarely, there are cases where you have no data to provide now, +but the consumer of your stream (or, perhaps, another bit of your own +code) will know when to check again, by calling [`stream.read(0)`][stream-read]. +In those cases, you *may* call `stream.push('')`. + +So far, the only use case for this functionality is in the +[`tls.CryptoStream`][] class, which is deprecated in Node.js/io.js v1.0. If you +find that you have to use `stream.push('')`, please consider another +approach, because it almost certainly indicates that something is +horribly wrong. + +[`'data'`]: #stream_event_data +[`'drain'`]: #stream_event_drain +[`'end'`]: #stream_event_end +[`'finish'`]: #stream_event_finish +[`'readable'`]: #stream_event_readable +[`buf.toString(encoding)`]: https://nodejs.org/docs/v5.8.0/api/buffer.html#buffer_buf_tostring_encoding_start_end +[`EventEmitter`]: https://nodejs.org/docs/v5.8.0/api/events.html#events_class_eventemitter +[`process.stderr`]: https://nodejs.org/docs/v5.8.0/api/process.html#process_process_stderr +[`process.stdin`]: https://nodejs.org/docs/v5.8.0/api/process.html#process_process_stdin +[`process.stdout`]: https://nodejs.org/docs/v5.8.0/api/process.html#process_process_stdout +[`stream.cork()`]: #stream_writable_cork +[`stream.pipe()`]: #stream_readable_pipe_destination_options +[`stream.uncork()`]: #stream_writable_uncork +[`stream.unpipe()`]: #stream_readable_unpipe_destination +[`stream.wrap()`]: #stream_readable_wrap_stream +[`tls.CryptoStream`]: https://nodejs.org/docs/v5.8.0/api/tls.html#tls_class_cryptostream +[`util.inherits()`]: https://nodejs.org/docs/v5.8.0/api/util.html#util_util_inherits_constructor_superconstructor +[API for Stream Consumers]: #stream_api_for_stream_consumers +[API for Stream Implementors]: #stream_api_for_stream_implementors +[child process stdin]: https://nodejs.org/docs/v5.8.0/api/child_process.html#child_process_child_stdin +[child process stdout and stderr]: https://nodejs.org/docs/v5.8.0/api/child_process.html#child_process_child_stdout +[Compatibility]: #stream_compatibility_with_older_node_js_versions +[crypto]: crypto.html +[Duplex]: #stream_class_stream_duplex +[fs read streams]: https://nodejs.org/docs/v5.8.0/api/fs.html#fs_class_fs_readstream +[fs write streams]: https://nodejs.org/docs/v5.8.0/api/fs.html#fs_class_fs_writestream +[HTTP requests, on the client]: https://nodejs.org/docs/v5.8.0/api/http.html#http_class_http_clientrequest +[HTTP responses, on the server]: https://nodejs.org/docs/v5.8.0/api/http.html#http_class_http_serverresponse +[http-incoming-message]: https://nodejs.org/docs/v5.8.0/api/http.html#http_class_http_incomingmessage +[Object mode]: #stream_object_mode +[Readable]: #stream_class_stream_readable +[SimpleProtocol v2]: #stream_example_simpleprotocol_parser_v2 +[stream-_flush]: #stream_transform_flush_callback +[stream-_read]: #stream_readable_read_size_1 +[stream-_transform]: #stream_transform_transform_chunk_encoding_callback +[stream-_write]: #stream_writable_write_chunk_encoding_callback_1 +[stream-_writev]: #stream_writable_writev_chunks_callback +[stream-end]: #stream_writable_end_chunk_encoding_callback +[stream-pause]: #stream_readable_pause +[stream-push]: #stream_readable_push_chunk_encoding +[stream-read]: #stream_readable_read_size +[stream-resume]: #stream_readable_resume +[stream-write]: #stream_writable_write_chunk_encoding_callback +[TCP sockets]: https://nodejs.org/docs/v5.8.0/api/net.html#net_class_net_socket +[Transform]: #stream_class_stream_transform +[Writable]: #stream_class_stream_writable +[zlib]: zlib.html diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md new file mode 100644 index 00000000..c141a99c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md @@ -0,0 +1,58 @@ +# streams WG Meeting 2015-01-30 + +## Links + +* **Google Hangouts Video**: http://www.youtube.com/watch?v=I9nDOSGfwZg +* **GitHub Issue**: https://github.com/iojs/readable-stream/issues/106 +* **Original Minutes Google Doc**: https://docs.google.com/document/d/17aTgLnjMXIrfjgNaTUnHQO7m3xgzHR2VXBTmi03Qii4/ + +## Agenda + +Extracted from https://github.com/iojs/readable-stream/labels/wg-agenda prior to meeting. + +* adopt a charter [#105](https://github.com/iojs/readable-stream/issues/105) +* release and versioning strategy [#101](https://github.com/iojs/readable-stream/issues/101) +* simpler stream creation [#102](https://github.com/iojs/readable-stream/issues/102) +* proposal: deprecate implicit flowing of streams [#99](https://github.com/iojs/readable-stream/issues/99) + +## Minutes + +### adopt a charter + +* group: +1's all around + +### What versioning scheme should be adopted? +* group: +1’s 3.0.0 +* domenic+group: pulling in patches from other sources where appropriate +* mikeal: version independently, suggesting versions for io.js +* mikeal+domenic: work with TC to notify in advance of changes +simpler stream creation + +### streamline creation of streams +* sam: streamline creation of streams +* domenic: nice simple solution posted + but, we lose the opportunity to change the model + may not be backwards incompatible (double check keys) + + **action item:** domenic will check + +### remove implicit flowing of streams on(‘data’) +* add isFlowing / isPaused +* mikeal: worrying that we’re documenting polyfill methods – confuses users +* domenic: more reflective API is probably good, with warning labels for users +* new section for mad scientists (reflective stream access) +* calvin: name the “third state” +* mikeal: maybe borrow the name from whatwg? +* domenic: we’re missing the “third state” +* consensus: kind of difficult to name the third state +* mikeal: figure out differences in states / compat +* mathias: always flow on data – eliminates third state + * explore what it breaks + +**action items:** +* ask isaac for ability to list packages by what public io.js APIs they use (esp. Stream) +* ask rod/build for infrastructure +* **chris**: explore the “flow on data” approach +* add isPaused/isFlowing +* add new docs section +* move isPaused to that section diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/duplex.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/duplex.js new file mode 100644 index 00000000..ca807af8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/duplex.js @@ -0,0 +1 @@ +module.exports = require("./lib/_stream_duplex.js") diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_duplex.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_duplex.js new file mode 100644 index 00000000..736693b8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_duplex.js @@ -0,0 +1,75 @@ +// a duplex stream is just a stream that is both readable and writable. +// Since JS doesn't have multiple prototypal inheritance, this class +// prototypally inherits from Readable, and then parasitically from +// Writable. + +'use strict'; + +/**/ + +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) { + keys.push(key); + }return keys; +}; +/**/ + +module.exports = Duplex; + +/**/ +var processNextTick = require('process-nextick-args'); +/**/ + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +var Readable = require('./_stream_readable'); +var Writable = require('./_stream_writable'); + +util.inherits(Duplex, Readable); + +var keys = objectKeys(Writable.prototype); +for (var v = 0; v < keys.length; v++) { + var method = keys[v]; + if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; +} + +function Duplex(options) { + if (!(this instanceof Duplex)) return new Duplex(options); + + Readable.call(this, options); + Writable.call(this, options); + + if (options && options.readable === false) this.readable = false; + + if (options && options.writable === false) this.writable = false; + + this.allowHalfOpen = true; + if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; + + this.once('end', onend); +} + +// the no-half-open enforcer +function onend() { + // if we allow half-open state, or if the writable side ended, + // then we're ok. + if (this.allowHalfOpen || this._writableState.ended) return; + + // no more data can be written. + // But allow more writes to happen in this tick. + processNextTick(onEndNT, this); +} + +function onEndNT(self) { + self.end(); +} + +function forEach(xs, f) { + for (var i = 0, l = xs.length; i < l; i++) { + f(xs[i], i); + } +} \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_passthrough.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_passthrough.js new file mode 100644 index 00000000..d06f71f1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_passthrough.js @@ -0,0 +1,26 @@ +// a passthrough stream. +// basically just the most minimal sort of Transform stream. +// Every written chunk gets output as-is. + +'use strict'; + +module.exports = PassThrough; + +var Transform = require('./_stream_transform'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +util.inherits(PassThrough, Transform); + +function PassThrough(options) { + if (!(this instanceof PassThrough)) return new PassThrough(options); + + Transform.call(this, options); +} + +PassThrough.prototype._transform = function (chunk, encoding, cb) { + cb(null, chunk); +}; \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_readable.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_readable.js new file mode 100644 index 00000000..54a9d5c5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_readable.js @@ -0,0 +1,880 @@ +'use strict'; + +module.exports = Readable; + +/**/ +var processNextTick = require('process-nextick-args'); +/**/ + +/**/ +var isArray = require('isarray'); +/**/ + +/**/ +var Buffer = require('buffer').Buffer; +/**/ + +Readable.ReadableState = ReadableState; + +var EE = require('events'); + +/**/ +var EElistenerCount = function (emitter, type) { + return emitter.listeners(type).length; +}; +/**/ + +/**/ +var Stream; +(function () { + try { + Stream = require('st' + 'ream'); + } catch (_) {} finally { + if (!Stream) Stream = require('events').EventEmitter; + } +})(); +/**/ + +var Buffer = require('buffer').Buffer; + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +/**/ +var debugUtil = require('util'); +var debug = undefined; +if (debugUtil && debugUtil.debuglog) { + debug = debugUtil.debuglog('stream'); +} else { + debug = function () {}; +} +/**/ + +var StringDecoder; + +util.inherits(Readable, Stream); + +var Duplex; +function ReadableState(options, stream) { + Duplex = Duplex || require('./_stream_duplex'); + + options = options || {}; + + // object stream flag. Used to make read(n) ignore n and to + // make all the buffer merging and length checks go away + this.objectMode = !!options.objectMode; + + if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode; + + // the point at which it stops calling _read() to fill the buffer + // Note: 0 is a valid value, means "don't call _read preemptively ever" + var hwm = options.highWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; + + // cast to ints. + this.highWaterMark = ~ ~this.highWaterMark; + + this.buffer = []; + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = null; + this.ended = false; + this.endEmitted = false; + this.reading = false; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // whenever we return null, then we set a flag to say + // that we're awaiting a 'readable' event emission. + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + this.resumeScheduled = false; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // when piping, we only care about 'readable' events that happen + // after read()ing all the bytes and not getting any pushback. + this.ranOut = false; + + // the number of writers that are awaiting a drain event in .pipe()s + this.awaitDrain = 0; + + // if true, a maybeReadMore has been scheduled + this.readingMore = false; + + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; + } +} + +var Duplex; +function Readable(options) { + Duplex = Duplex || require('./_stream_duplex'); + + if (!(this instanceof Readable)) return new Readable(options); + + this._readableState = new ReadableState(options, this); + + // legacy + this.readable = true; + + if (options && typeof options.read === 'function') this._read = options.read; + + Stream.call(this); +} + +// Manually shove something into the read() buffer. +// This returns true if the highWaterMark has not been hit yet, +// similar to how Writable.write() returns true if you should +// write() some more. +Readable.prototype.push = function (chunk, encoding) { + var state = this._readableState; + + if (!state.objectMode && typeof chunk === 'string') { + encoding = encoding || state.defaultEncoding; + if (encoding !== state.encoding) { + chunk = new Buffer(chunk, encoding); + encoding = ''; + } + } + + return readableAddChunk(this, state, chunk, encoding, false); +}; + +// Unshift should *always* be something directly out of read() +Readable.prototype.unshift = function (chunk) { + var state = this._readableState; + return readableAddChunk(this, state, chunk, '', true); +}; + +Readable.prototype.isPaused = function () { + return this._readableState.flowing === false; +}; + +function readableAddChunk(stream, state, chunk, encoding, addToFront) { + var er = chunkInvalid(state, chunk); + if (er) { + stream.emit('error', er); + } else if (chunk === null) { + state.reading = false; + onEofChunk(stream, state); + } else if (state.objectMode || chunk && chunk.length > 0) { + if (state.ended && !addToFront) { + var e = new Error('stream.push() after EOF'); + stream.emit('error', e); + } else if (state.endEmitted && addToFront) { + var e = new Error('stream.unshift() after end event'); + stream.emit('error', e); + } else { + var skipAdd; + if (state.decoder && !addToFront && !encoding) { + chunk = state.decoder.write(chunk); + skipAdd = !state.objectMode && chunk.length === 0; + } + + if (!addToFront) state.reading = false; + + // Don't add to the buffer if we've decoded to an empty string chunk and + // we're not in object mode + if (!skipAdd) { + // if we want the data now, just emit it. + if (state.flowing && state.length === 0 && !state.sync) { + stream.emit('data', chunk); + stream.read(0); + } else { + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); + + if (state.needReadable) emitReadable(stream); + } + } + + maybeReadMore(stream, state); + } + } else if (!addToFront) { + state.reading = false; + } + + return needMoreData(state); +} + +// if it's past the high water mark, we can push in some more. +// Also, if we have no data yet, we can stand some +// more bytes. This is to work around cases where hwm=0, +// such as the repl. Also, if the push() triggered a +// readable event, and the user called read(largeNumber) such that +// needReadable was set, then we ought to push more, so that another +// 'readable' event will be triggered. +function needMoreData(state) { + return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); +} + +// backwards compatibility. +Readable.prototype.setEncoding = function (enc) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + this._readableState.decoder = new StringDecoder(enc); + this._readableState.encoding = enc; + return this; +}; + +// Don't raise the hwm > 8MB +var MAX_HWM = 0x800000; +function computeNewHighWaterMark(n) { + if (n >= MAX_HWM) { + n = MAX_HWM; + } else { + // Get the next highest power of 2 + n--; + n |= n >>> 1; + n |= n >>> 2; + n |= n >>> 4; + n |= n >>> 8; + n |= n >>> 16; + n++; + } + return n; +} + +function howMuchToRead(n, state) { + if (state.length === 0 && state.ended) return 0; + + if (state.objectMode) return n === 0 ? 0 : 1; + + if (n === null || isNaN(n)) { + // only flow one buffer at a time + if (state.flowing && state.buffer.length) return state.buffer[0].length;else return state.length; + } + + if (n <= 0) return 0; + + // If we're asking for more than the target buffer level, + // then raise the water mark. Bump up to the next highest + // power of 2, to prevent increasing it excessively in tiny + // amounts. + if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); + + // don't have that much. return null, unless we've ended. + if (n > state.length) { + if (!state.ended) { + state.needReadable = true; + return 0; + } else { + return state.length; + } + } + + return n; +} + +// you can override either this method, or the async _read(n) below. +Readable.prototype.read = function (n) { + debug('read', n); + var state = this._readableState; + var nOrig = n; + + if (typeof n !== 'number' || n > 0) state.emittedReadable = false; + + // if we're doing read(0) to trigger a readable event, but we + // already have a bunch of data in the buffer, then just trigger + // the 'readable' event and move on. + if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { + debug('read: emitReadable', state.length, state.ended); + if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); + return null; + } + + n = howMuchToRead(n, state); + + // if we've ended, and we're now clear, then finish it up. + if (n === 0 && state.ended) { + if (state.length === 0) endReadable(this); + return null; + } + + // All the actual chunk generation logic needs to be + // *below* the call to _read. The reason is that in certain + // synthetic stream cases, such as passthrough streams, _read + // may be a completely synchronous operation which may change + // the state of the read buffer, providing enough data when + // before there was *not* enough. + // + // So, the steps are: + // 1. Figure out what the state of things will be after we do + // a read from the buffer. + // + // 2. If that resulting state will trigger a _read, then call _read. + // Note that this may be asynchronous, or synchronous. Yes, it is + // deeply ugly to write APIs this way, but that still doesn't mean + // that the Readable class should behave improperly, as streams are + // designed to be sync/async agnostic. + // Take note if the _read call is sync or async (ie, if the read call + // has returned yet), so that we know whether or not it's safe to emit + // 'readable' etc. + // + // 3. Actually pull the requested chunks out of the buffer and return. + + // if we need a readable event, then we need to do some reading. + var doRead = state.needReadable; + debug('need readable', doRead); + + // if we currently have less than the highWaterMark, then also read some + if (state.length === 0 || state.length - n < state.highWaterMark) { + doRead = true; + debug('length less than watermark', doRead); + } + + // however, if we've ended, then there's no point, and if we're already + // reading, then it's unnecessary. + if (state.ended || state.reading) { + doRead = false; + debug('reading or ended', doRead); + } + + if (doRead) { + debug('do read'); + state.reading = true; + state.sync = true; + // if the length is currently zero, then we *need* a readable event. + if (state.length === 0) state.needReadable = true; + // call internal read method + this._read(state.highWaterMark); + state.sync = false; + } + + // If _read pushed data synchronously, then `reading` will be false, + // and we need to re-evaluate how much data we can return to the user. + if (doRead && !state.reading) n = howMuchToRead(nOrig, state); + + var ret; + if (n > 0) ret = fromList(n, state);else ret = null; + + if (ret === null) { + state.needReadable = true; + n = 0; + } + + state.length -= n; + + // If we have nothing in the buffer, then we want to know + // as soon as we *do* get something into the buffer. + if (state.length === 0 && !state.ended) state.needReadable = true; + + // If we tried to read() past the EOF, then emit end on the next tick. + if (nOrig !== n && state.ended && state.length === 0) endReadable(this); + + if (ret !== null) this.emit('data', ret); + + return ret; +}; + +function chunkInvalid(state, chunk) { + var er = null; + if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + return er; +} + +function onEofChunk(stream, state) { + if (state.ended) return; + if (state.decoder) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) { + state.buffer.push(chunk); + state.length += state.objectMode ? 1 : chunk.length; + } + } + state.ended = true; + + // emit 'readable' now to make sure it gets picked up. + emitReadable(stream); +} + +// Don't emit readable right away in sync mode, because this can trigger +// another read() call => stack overflow. This way, it might trigger +// a nextTick recursion warning, but that's not so bad. +function emitReadable(stream) { + var state = stream._readableState; + state.needReadable = false; + if (!state.emittedReadable) { + debug('emitReadable', state.flowing); + state.emittedReadable = true; + if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream); + } +} + +function emitReadable_(stream) { + debug('emit readable'); + stream.emit('readable'); + flow(stream); +} + +// at this point, the user has presumably seen the 'readable' event, +// and called read() to consume some data. that may have triggered +// in turn another _read(n) call, in which case reading = true if +// it's in progress. +// However, if we're not ended, or reading, and the length < hwm, +// then go ahead and try to read some more preemptively. +function maybeReadMore(stream, state) { + if (!state.readingMore) { + state.readingMore = true; + processNextTick(maybeReadMore_, stream, state); + } +} + +function maybeReadMore_(stream, state) { + var len = state.length; + while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { + debug('maybeReadMore read 0'); + stream.read(0); + if (len === state.length) + // didn't get any data, stop spinning. + break;else len = state.length; + } + state.readingMore = false; +} + +// abstract method. to be overridden in specific implementation classes. +// call cb(er, data) where data is <= n in length. +// for virtual (non-string, non-buffer) streams, "length" is somewhat +// arbitrary, and perhaps not very meaningful. +Readable.prototype._read = function (n) { + this.emit('error', new Error('not implemented')); +}; + +Readable.prototype.pipe = function (dest, pipeOpts) { + var src = this; + var state = this._readableState; + + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; + case 1: + state.pipes = [state.pipes, dest]; + break; + default: + state.pipes.push(dest); + break; + } + state.pipesCount += 1; + debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); + + var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; + + var endFn = doEnd ? onend : cleanup; + if (state.endEmitted) processNextTick(endFn);else src.once('end', endFn); + + dest.on('unpipe', onunpipe); + function onunpipe(readable) { + debug('onunpipe'); + if (readable === src) { + cleanup(); + } + } + + function onend() { + debug('onend'); + dest.end(); + } + + // when the dest drains, it reduces the awaitDrain counter + // on the source. This would be more elegant with a .once() + // handler in flow(), but adding and removing repeatedly is + // too slow. + var ondrain = pipeOnDrain(src); + dest.on('drain', ondrain); + + var cleanedUp = false; + function cleanup() { + debug('cleanup'); + // cleanup event handlers once the pipe is broken + dest.removeListener('close', onclose); + dest.removeListener('finish', onfinish); + dest.removeListener('drain', ondrain); + dest.removeListener('error', onerror); + dest.removeListener('unpipe', onunpipe); + src.removeListener('end', onend); + src.removeListener('end', cleanup); + src.removeListener('data', ondata); + + cleanedUp = true; + + // if the reader is waiting for a drain event from this + // specific writer, then it would cause it to never start + // flowing again. + // So, if this is awaiting a drain, then we just call it now. + // If we don't know, then assume that we are waiting for one. + if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); + } + + src.on('data', ondata); + function ondata(chunk) { + debug('ondata'); + var ret = dest.write(chunk); + if (false === ret) { + // If the user unpiped during `dest.write()`, it is possible + // to get stuck in a permanently paused state if that write + // also returned false. + if (state.pipesCount === 1 && state.pipes[0] === dest && src.listenerCount('data') === 1 && !cleanedUp) { + debug('false write response, pause', src._readableState.awaitDrain); + src._readableState.awaitDrain++; + } + src.pause(); + } + } + + // if the dest has an error, then stop piping into it. + // however, don't suppress the throwing behavior for this. + function onerror(er) { + debug('onerror', er); + unpipe(); + dest.removeListener('error', onerror); + if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); + } + // This is a brutally ugly hack to make sure that our error handler + // is attached before any userland ones. NEVER DO THIS. + if (!dest._events || !dest._events.error) dest.on('error', onerror);else if (isArray(dest._events.error)) dest._events.error.unshift(onerror);else dest._events.error = [onerror, dest._events.error]; + + // Both close and finish should trigger unpipe, but only once. + function onclose() { + dest.removeListener('finish', onfinish); + unpipe(); + } + dest.once('close', onclose); + function onfinish() { + debug('onfinish'); + dest.removeListener('close', onclose); + unpipe(); + } + dest.once('finish', onfinish); + + function unpipe() { + debug('unpipe'); + src.unpipe(dest); + } + + // tell the dest that it's being piped to + dest.emit('pipe', src); + + // start the flow if it hasn't been started already. + if (!state.flowing) { + debug('pipe resume'); + src.resume(); + } + + return dest; +}; + +function pipeOnDrain(src) { + return function () { + var state = src._readableState; + debug('pipeOnDrain', state.awaitDrain); + if (state.awaitDrain) state.awaitDrain--; + if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { + state.flowing = true; + flow(src); + } + }; +} + +Readable.prototype.unpipe = function (dest) { + var state = this._readableState; + + // if we're not piping anywhere, then do nothing. + if (state.pipesCount === 0) return this; + + // just one destination. most common case. + if (state.pipesCount === 1) { + // passed in one, but it's not the right one. + if (dest && dest !== state.pipes) return this; + + if (!dest) dest = state.pipes; + + // got a match. + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + if (dest) dest.emit('unpipe', this); + return this; + } + + // slow case. multiple pipe destinations. + + if (!dest) { + // remove all. + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + + for (var _i = 0; _i < len; _i++) { + dests[_i].emit('unpipe', this); + }return this; + } + + // try to find the right one. + var i = indexOf(state.pipes, dest); + if (i === -1) return this; + + state.pipes.splice(i, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) state.pipes = state.pipes[0]; + + dest.emit('unpipe', this); + + return this; +}; + +// set up data events if they are asked for +// Ensure readable listeners eventually get something +Readable.prototype.on = function (ev, fn) { + var res = Stream.prototype.on.call(this, ev, fn); + + // If listening to data, and it has not explicitly been paused, + // then call resume to start the flow of data on the next tick. + if (ev === 'data' && false !== this._readableState.flowing) { + this.resume(); + } + + if (ev === 'readable' && !this._readableState.endEmitted) { + var state = this._readableState; + if (!state.readableListening) { + state.readableListening = true; + state.emittedReadable = false; + state.needReadable = true; + if (!state.reading) { + processNextTick(nReadingNextTick, this); + } else if (state.length) { + emitReadable(this, state); + } + } + } + + return res; +}; +Readable.prototype.addListener = Readable.prototype.on; + +function nReadingNextTick(self) { + debug('readable nexttick read 0'); + self.read(0); +} + +// pause() and resume() are remnants of the legacy readable stream API +// If the user uses them, then switch into old mode. +Readable.prototype.resume = function () { + var state = this._readableState; + if (!state.flowing) { + debug('resume'); + state.flowing = true; + resume(this, state); + } + return this; +}; + +function resume(stream, state) { + if (!state.resumeScheduled) { + state.resumeScheduled = true; + processNextTick(resume_, stream, state); + } +} + +function resume_(stream, state) { + if (!state.reading) { + debug('resume read 0'); + stream.read(0); + } + + state.resumeScheduled = false; + stream.emit('resume'); + flow(stream); + if (state.flowing && !state.reading) stream.read(0); +} + +Readable.prototype.pause = function () { + debug('call pause flowing=%j', this._readableState.flowing); + if (false !== this._readableState.flowing) { + debug('pause'); + this._readableState.flowing = false; + this.emit('pause'); + } + return this; +}; + +function flow(stream) { + var state = stream._readableState; + debug('flow', state.flowing); + if (state.flowing) { + do { + var chunk = stream.read(); + } while (null !== chunk && state.flowing); + } +} + +// wrap an old-style stream as the async data source. +// This is *not* part of the readable stream interface. +// It is an ugly unfortunate mess of history. +Readable.prototype.wrap = function (stream) { + var state = this._readableState; + var paused = false; + + var self = this; + stream.on('end', function () { + debug('wrapped end'); + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) self.push(chunk); + } + + self.push(null); + }); + + stream.on('data', function (chunk) { + debug('wrapped data'); + if (state.decoder) chunk = state.decoder.write(chunk); + + // don't skip over falsy values in objectMode + if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; + + var ret = self.push(chunk); + if (!ret) { + paused = true; + stream.pause(); + } + }); + + // proxy all the other methods. + // important when wrapping filters and duplexes. + for (var i in stream) { + if (this[i] === undefined && typeof stream[i] === 'function') { + this[i] = function (method) { + return function () { + return stream[method].apply(stream, arguments); + }; + }(i); + } + } + + // proxy certain important events. + var events = ['error', 'close', 'destroy', 'pause', 'resume']; + forEach(events, function (ev) { + stream.on(ev, self.emit.bind(self, ev)); + }); + + // when we try to consume some more bytes, simply unpause the + // underlying stream. + self._read = function (n) { + debug('wrapped _read', n); + if (paused) { + paused = false; + stream.resume(); + } + }; + + return self; +}; + +// exposed for testing purposes only. +Readable._fromList = fromList; + +// Pluck off n bytes from an array of buffers. +// Length is the combined lengths of all the buffers in the list. +function fromList(n, state) { + var list = state.buffer; + var length = state.length; + var stringMode = !!state.decoder; + var objectMode = !!state.objectMode; + var ret; + + // nothing in the list, definitely empty. + if (list.length === 0) return null; + + if (length === 0) ret = null;else if (objectMode) ret = list.shift();else if (!n || n >= length) { + // read it all, truncate the array. + if (stringMode) ret = list.join('');else if (list.length === 1) ret = list[0];else ret = Buffer.concat(list, length); + list.length = 0; + } else { + // read just some of it. + if (n < list[0].length) { + // just take a part of the first list item. + // slice is the same for buffers and strings. + var buf = list[0]; + ret = buf.slice(0, n); + list[0] = buf.slice(n); + } else if (n === list[0].length) { + // first list is a perfect match + ret = list.shift(); + } else { + // complex case. + // we have enough to cover it, but it spans past the first buffer. + if (stringMode) ret = '';else ret = new Buffer(n); + + var c = 0; + for (var i = 0, l = list.length; i < l && c < n; i++) { + var buf = list[0]; + var cpy = Math.min(n - c, buf.length); + + if (stringMode) ret += buf.slice(0, cpy);else buf.copy(ret, c, 0, cpy); + + if (cpy < buf.length) list[0] = buf.slice(cpy);else list.shift(); + + c += cpy; + } + } + } + + return ret; +} + +function endReadable(stream) { + var state = stream._readableState; + + // If we get here before consuming all the bytes, then that is a + // bug in node. Should never happen. + if (state.length > 0) throw new Error('endReadable called on non-empty stream'); + + if (!state.endEmitted) { + state.ended = true; + processNextTick(endReadableNT, state, stream); + } +} + +function endReadableNT(state, stream) { + // Check that we didn't get one last unshift. + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit('end'); + } +} + +function forEach(xs, f) { + for (var i = 0, l = xs.length; i < l; i++) { + f(xs[i], i); + } +} + +function indexOf(xs, x) { + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + return -1; +} \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_transform.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_transform.js new file mode 100644 index 00000000..625cdc17 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_transform.js @@ -0,0 +1,180 @@ +// a transform stream is a readable/writable stream where you do +// something with the data. Sometimes it's called a "filter", +// but that's not a great name for it, since that implies a thing where +// some bits pass through, and others are simply ignored. (That would +// be a valid example of a transform, of course.) +// +// While the output is causally related to the input, it's not a +// necessarily symmetric or synchronous transformation. For example, +// a zlib stream might take multiple plain-text writes(), and then +// emit a single compressed chunk some time in the future. +// +// Here's how this works: +// +// The Transform stream has all the aspects of the readable and writable +// stream classes. When you write(chunk), that calls _write(chunk,cb) +// internally, and returns false if there's a lot of pending writes +// buffered up. When you call read(), that calls _read(n) until +// there's enough pending readable data buffered up. +// +// In a transform stream, the written data is placed in a buffer. When +// _read(n) is called, it transforms the queued up data, calling the +// buffered _write cb's as it consumes chunks. If consuming a single +// written chunk would result in multiple output chunks, then the first +// outputted bit calls the readcb, and subsequent chunks just go into +// the read buffer, and will cause it to emit 'readable' if necessary. +// +// This way, back-pressure is actually determined by the reading side, +// since _read has to be called to start processing a new chunk. However, +// a pathological inflate type of transform can cause excessive buffering +// here. For example, imagine a stream where every byte of input is +// interpreted as an integer from 0-255, and then results in that many +// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in +// 1kb of data being output. In this case, you could write a very small +// amount of input, and end up with a very large amount of output. In +// such a pathological inflating mechanism, there'd be no way to tell +// the system to stop doing the transform. A single 4MB write could +// cause the system to run out of memory. +// +// However, even in such a pathological case, only a single written chunk +// would be consumed, and then the rest would wait (un-transformed) until +// the results of the previous transformed chunk were consumed. + +'use strict'; + +module.exports = Transform; + +var Duplex = require('./_stream_duplex'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +util.inherits(Transform, Duplex); + +function TransformState(stream) { + this.afterTransform = function (er, data) { + return afterTransform(stream, er, data); + }; + + this.needTransform = false; + this.transforming = false; + this.writecb = null; + this.writechunk = null; + this.writeencoding = null; +} + +function afterTransform(stream, er, data) { + var ts = stream._transformState; + ts.transforming = false; + + var cb = ts.writecb; + + if (!cb) return stream.emit('error', new Error('no writecb in Transform class')); + + ts.writechunk = null; + ts.writecb = null; + + if (data !== null && data !== undefined) stream.push(data); + + cb(er); + + var rs = stream._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + stream._read(rs.highWaterMark); + } +} + +function Transform(options) { + if (!(this instanceof Transform)) return new Transform(options); + + Duplex.call(this, options); + + this._transformState = new TransformState(this); + + // when the writable side finishes, then flush out anything remaining. + var stream = this; + + // start out asking for a readable event once data is transformed. + this._readableState.needReadable = true; + + // we have implemented the _read method, and done the other things + // that Readable wants before the first _read call, so unset the + // sync guard flag. + this._readableState.sync = false; + + if (options) { + if (typeof options.transform === 'function') this._transform = options.transform; + + if (typeof options.flush === 'function') this._flush = options.flush; + } + + this.once('prefinish', function () { + if (typeof this._flush === 'function') this._flush(function (er) { + done(stream, er); + });else done(stream); + }); +} + +Transform.prototype.push = function (chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); +}; + +// This is the part where you do stuff! +// override this function in implementation classes. +// 'chunk' is an input chunk. +// +// Call `push(newChunk)` to pass along transformed output +// to the readable side. You may call 'push' zero or more times. +// +// Call `cb(err)` when you are done with this chunk. If you pass +// an error, then that'll put the hurt on the whole operation. If you +// never call cb(), then you'll never get another chunk. +Transform.prototype._transform = function (chunk, encoding, cb) { + throw new Error('not implemented'); +}; + +Transform.prototype._write = function (chunk, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk; + ts.writeencoding = encoding; + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); + } +}; + +// Doesn't matter what the args are here. +// _transform does all the work. +// That we got here means that the readable side wants more data. +Transform.prototype._read = function (n) { + var ts = this._transformState; + + if (ts.writechunk !== null && ts.writecb && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + // mark that we need a transform, so that any data that comes in + // will get processed, now that we've asked for it. + ts.needTransform = true; + } +}; + +function done(stream, er) { + if (er) return stream.emit('error', er); + + // if there's nothing in the write buffer, then that means + // that nothing more will ever be provided + var ws = stream._writableState; + var ts = stream._transformState; + + if (ws.length) throw new Error('calling transform done when ws.length != 0'); + + if (ts.transforming) throw new Error('calling transform done when still transforming'); + + return stream.push(null); +} \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js new file mode 100644 index 00000000..95916c99 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js @@ -0,0 +1,516 @@ +// A bit simpler than readable streams. +// Implement an async ._write(chunk, encoding, cb), and it'll handle all +// the drain event emission and buffering. + +'use strict'; + +module.exports = Writable; + +/**/ +var processNextTick = require('process-nextick-args'); +/**/ + +/**/ +var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick; +/**/ + +/**/ +var Buffer = require('buffer').Buffer; +/**/ + +Writable.WritableState = WritableState; + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +/**/ +var internalUtil = { + deprecate: require('util-deprecate') +}; +/**/ + +/**/ +var Stream; +(function () { + try { + Stream = require('st' + 'ream'); + } catch (_) {} finally { + if (!Stream) Stream = require('events').EventEmitter; + } +})(); +/**/ + +var Buffer = require('buffer').Buffer; + +util.inherits(Writable, Stream); + +function nop() {} + +function WriteReq(chunk, encoding, cb) { + this.chunk = chunk; + this.encoding = encoding; + this.callback = cb; + this.next = null; +} + +var Duplex; +function WritableState(options, stream) { + Duplex = Duplex || require('./_stream_duplex'); + + options = options || {}; + + // object stream flag to indicate whether or not this stream + // contains buffers or objects. + this.objectMode = !!options.objectMode; + + if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.writableObjectMode; + + // the point at which write() starts returning false + // Note: 0 is a valid value, means that we always return false if + // the entire buffer is not flushed immediately on write() + var hwm = options.highWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; + + // cast to ints. + this.highWaterMark = ~ ~this.highWaterMark; + + this.needDrain = false; + // at the start of calling end() + this.ending = false; + // when end() has been called, and returned + this.ended = false; + // when 'finish' is emitted + this.finished = false; + + // should we decode strings into buffers before passing to _write? + // this is here so that some node-core streams can optimize string + // handling at a lower level. + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // not an actual buffer we keep track of, but a measurement + // of how much we're waiting to get pushed to some underlying + // socket or file. + this.length = 0; + + // a flag to see when we're in the middle of a write. + this.writing = false; + + // when true all writes will be buffered until .uncork() call + this.corked = 0; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // a flag to know if we're processing previously buffered items, which + // may call the _write() callback in the same tick, so that we don't + // end up in an overlapped onwrite situation. + this.bufferProcessing = false; + + // the callback that's passed to _write(chunk,cb) + this.onwrite = function (er) { + onwrite(stream, er); + }; + + // the callback that the user supplies to write(chunk,encoding,cb) + this.writecb = null; + + // the amount that is being written when _write is called. + this.writelen = 0; + + this.bufferedRequest = null; + this.lastBufferedRequest = null; + + // number of pending user-supplied write callbacks + // this must be 0 before 'finish' can be emitted + this.pendingcb = 0; + + // emit prefinish if the only thing we're waiting for is _write cbs + // This is relevant for synchronous Transform streams + this.prefinished = false; + + // True if the error was already emitted and should not be thrown again + this.errorEmitted = false; + + // count buffered requests + this.bufferedRequestCount = 0; + + // create the two objects needed to store the corked requests + // they are not a linked list, as no new elements are inserted in there + this.corkedRequestsFree = new CorkedRequest(this); + this.corkedRequestsFree.next = new CorkedRequest(this); +} + +WritableState.prototype.getBuffer = function writableStateGetBuffer() { + var current = this.bufferedRequest; + var out = []; + while (current) { + out.push(current); + current = current.next; + } + return out; +}; + +(function () { + try { + Object.defineProperty(WritableState.prototype, 'buffer', { + get: internalUtil.deprecate(function () { + return this.getBuffer(); + }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.') + }); + } catch (_) {} +})(); + +var Duplex; +function Writable(options) { + Duplex = Duplex || require('./_stream_duplex'); + + // Writable ctor is applied to Duplexes, though they're not + // instanceof Writable, they're instanceof Readable. + if (!(this instanceof Writable) && !(this instanceof Duplex)) return new Writable(options); + + this._writableState = new WritableState(options, this); + + // legacy. + this.writable = true; + + if (options) { + if (typeof options.write === 'function') this._write = options.write; + + if (typeof options.writev === 'function') this._writev = options.writev; + } + + Stream.call(this); +} + +// Otherwise people can pipe Writable streams, which is just wrong. +Writable.prototype.pipe = function () { + this.emit('error', new Error('Cannot pipe. Not readable.')); +}; + +function writeAfterEnd(stream, cb) { + var er = new Error('write after end'); + // TODO: defer error events consistently everywhere, not just the cb + stream.emit('error', er); + processNextTick(cb, er); +} + +// If we get something that is not a buffer, string, null, or undefined, +// and we're not in objectMode, then that's an error. +// Otherwise stream chunks are all considered to be of length=1, and the +// watermarks determine how many objects to keep in the buffer, rather than +// how many bytes or characters. +function validChunk(stream, state, chunk, cb) { + var valid = true; + + if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) { + var er = new TypeError('Invalid non-string/buffer chunk'); + stream.emit('error', er); + processNextTick(cb, er); + valid = false; + } + return valid; +} + +Writable.prototype.write = function (chunk, encoding, cb) { + var state = this._writableState; + var ret = false; + + if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (Buffer.isBuffer(chunk)) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; + + if (typeof cb !== 'function') cb = nop; + + if (state.ended) writeAfterEnd(this, cb);else if (validChunk(this, state, chunk, cb)) { + state.pendingcb++; + ret = writeOrBuffer(this, state, chunk, encoding, cb); + } + + return ret; +}; + +Writable.prototype.cork = function () { + var state = this._writableState; + + state.corked++; +}; + +Writable.prototype.uncork = function () { + var state = this._writableState; + + if (state.corked) { + state.corked--; + + if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); + } +}; + +Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + // node::ParseEncoding() requires lower case. + if (typeof encoding === 'string') encoding = encoding.toLowerCase(); + if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); + this._writableState.defaultEncoding = encoding; +}; + +function decodeChunk(state, chunk, encoding) { + if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { + chunk = new Buffer(chunk, encoding); + } + return chunk; +} + +// if we're already writing something, then just put this +// in the queue, and wait our turn. Otherwise, call _write +// If we return false, then we need a drain event, so set that flag. +function writeOrBuffer(stream, state, chunk, encoding, cb) { + chunk = decodeChunk(state, chunk, encoding); + + if (Buffer.isBuffer(chunk)) encoding = 'buffer'; + var len = state.objectMode ? 1 : chunk.length; + + state.length += len; + + var ret = state.length < state.highWaterMark; + // we must ensure that previous needDrain will not be reset to false. + if (!ret) state.needDrain = true; + + if (state.writing || state.corked) { + var last = state.lastBufferedRequest; + state.lastBufferedRequest = new WriteReq(chunk, encoding, cb); + if (last) { + last.next = state.lastBufferedRequest; + } else { + state.bufferedRequest = state.lastBufferedRequest; + } + state.bufferedRequestCount += 1; + } else { + doWrite(stream, state, false, len, chunk, encoding, cb); + } + + return ret; +} + +function doWrite(stream, state, writev, len, chunk, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); + state.sync = false; +} + +function onwriteError(stream, state, sync, er, cb) { + --state.pendingcb; + if (sync) processNextTick(cb, er);else cb(er); + + stream._writableState.errorEmitted = true; + stream.emit('error', er); +} + +function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; +} + +function onwrite(stream, er) { + var state = stream._writableState; + var sync = state.sync; + var cb = state.writecb; + + onwriteStateUpdate(state); + + if (er) onwriteError(stream, state, sync, er, cb);else { + // Check if we're actually ready to finish, but don't emit yet + var finished = needFinish(state); + + if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { + clearBuffer(stream, state); + } + + if (sync) { + /**/ + asyncWrite(afterWrite, stream, state, finished, cb); + /**/ + } else { + afterWrite(stream, state, finished, cb); + } + } +} + +function afterWrite(stream, state, finished, cb) { + if (!finished) onwriteDrain(stream, state); + state.pendingcb--; + cb(); + finishMaybe(stream, state); +} + +// Must force callback to be called on nextTick, so that we don't +// emit 'drain' before the write() consumer gets the 'false' return +// value, and has a chance to attach a 'drain' listener. +function onwriteDrain(stream, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream.emit('drain'); + } +} + +// if there's something in the buffer waiting, then process it +function clearBuffer(stream, state) { + state.bufferProcessing = true; + var entry = state.bufferedRequest; + + if (stream._writev && entry && entry.next) { + // Fast case, write everything using _writev() + var l = state.bufferedRequestCount; + var buffer = new Array(l); + var holder = state.corkedRequestsFree; + holder.entry = entry; + + var count = 0; + while (entry) { + buffer[count] = entry; + entry = entry.next; + count += 1; + } + + doWrite(stream, state, true, state.length, buffer, '', holder.finish); + + // doWrite is always async, defer these to save a bit of time + // as the hot path ends with doWrite + state.pendingcb++; + state.lastBufferedRequest = null; + state.corkedRequestsFree = holder.next; + holder.next = null; + } else { + // Slow case, write chunks one-by-one + while (entry) { + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk.length; + + doWrite(stream, state, false, len, chunk, encoding, cb); + entry = entry.next; + // if we didn't call the onwrite immediately, then + // it means that we need to wait until it does. + // also, that means that the chunk and cb are currently + // being processed, so move the buffer counter past them. + if (state.writing) { + break; + } + } + + if (entry === null) state.lastBufferedRequest = null; + } + + state.bufferedRequestCount = 0; + state.bufferedRequest = entry; + state.bufferProcessing = false; +} + +Writable.prototype._write = function (chunk, encoding, cb) { + cb(new Error('not implemented')); +}; + +Writable.prototype._writev = null; + +Writable.prototype.end = function (chunk, encoding, cb) { + var state = this._writableState; + + if (typeof chunk === 'function') { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); + + // .end() fully uncorks + if (state.corked) { + state.corked = 1; + this.uncork(); + } + + // ignore unnecessary end() calls. + if (!state.ending && !state.finished) endWritable(this, state, cb); +}; + +function needFinish(state) { + return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; +} + +function prefinish(stream, state) { + if (!state.prefinished) { + state.prefinished = true; + stream.emit('prefinish'); + } +} + +function finishMaybe(stream, state) { + var need = needFinish(state); + if (need) { + if (state.pendingcb === 0) { + prefinish(stream, state); + state.finished = true; + stream.emit('finish'); + } else { + prefinish(stream, state); + } + } + return need; +} + +function endWritable(stream, state, cb) { + state.ending = true; + finishMaybe(stream, state); + if (cb) { + if (state.finished) processNextTick(cb);else stream.once('finish', cb); + } + state.ended = true; + stream.writable = false; +} + +// It seems a linked list but it is not +// there will be only 2 of these for each stream +function CorkedRequest(state) { + var _this = this; + + this.next = null; + this.entry = null; + + this.finish = function (err) { + var entry = _this.entry; + _this.entry = null; + while (entry) { + var cb = entry.callback; + state.pendingcb--; + cb(err); + entry = entry.next; + } + if (state.corkedRequestsFree) { + state.corkedRequestsFree.next = _this; + } else { + state.corkedRequestsFree = _this; + } + }; +} \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/LICENSE new file mode 100644 index 00000000..d8d7f943 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/LICENSE @@ -0,0 +1,19 @@ +Copyright Node.js contributors. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/README.md new file mode 100644 index 00000000..5a76b414 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/README.md @@ -0,0 +1,3 @@ +# core-util-is + +The `util.is*` functions introduced in Node v0.12. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/float.patch b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/float.patch new file mode 100644 index 00000000..a06d5c05 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/float.patch @@ -0,0 +1,604 @@ +diff --git a/lib/util.js b/lib/util.js +index a03e874..9074e8e 100644 +--- a/lib/util.js ++++ b/lib/util.js +@@ -19,430 +19,6 @@ + // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + // USE OR OTHER DEALINGS IN THE SOFTWARE. + +-var formatRegExp = /%[sdj%]/g; +-exports.format = function(f) { +- if (!isString(f)) { +- var objects = []; +- for (var i = 0; i < arguments.length; i++) { +- objects.push(inspect(arguments[i])); +- } +- return objects.join(' '); +- } +- +- var i = 1; +- var args = arguments; +- var len = args.length; +- var str = String(f).replace(formatRegExp, function(x) { +- if (x === '%%') return '%'; +- if (i >= len) return x; +- switch (x) { +- case '%s': return String(args[i++]); +- case '%d': return Number(args[i++]); +- case '%j': +- try { +- return JSON.stringify(args[i++]); +- } catch (_) { +- return '[Circular]'; +- } +- default: +- return x; +- } +- }); +- for (var x = args[i]; i < len; x = args[++i]) { +- if (isNull(x) || !isObject(x)) { +- str += ' ' + x; +- } else { +- str += ' ' + inspect(x); +- } +- } +- return str; +-}; +- +- +-// Mark that a method should not be used. +-// Returns a modified function which warns once by default. +-// If --no-deprecation is set, then it is a no-op. +-exports.deprecate = function(fn, msg) { +- // Allow for deprecating things in the process of starting up. +- if (isUndefined(global.process)) { +- return function() { +- return exports.deprecate(fn, msg).apply(this, arguments); +- }; +- } +- +- if (process.noDeprecation === true) { +- return fn; +- } +- +- var warned = false; +- function deprecated() { +- if (!warned) { +- if (process.throwDeprecation) { +- throw new Error(msg); +- } else if (process.traceDeprecation) { +- console.trace(msg); +- } else { +- console.error(msg); +- } +- warned = true; +- } +- return fn.apply(this, arguments); +- } +- +- return deprecated; +-}; +- +- +-var debugs = {}; +-var debugEnviron; +-exports.debuglog = function(set) { +- if (isUndefined(debugEnviron)) +- debugEnviron = process.env.NODE_DEBUG || ''; +- set = set.toUpperCase(); +- if (!debugs[set]) { +- if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { +- var pid = process.pid; +- debugs[set] = function() { +- var msg = exports.format.apply(exports, arguments); +- console.error('%s %d: %s', set, pid, msg); +- }; +- } else { +- debugs[set] = function() {}; +- } +- } +- return debugs[set]; +-}; +- +- +-/** +- * Echos the value of a value. Trys to print the value out +- * in the best way possible given the different types. +- * +- * @param {Object} obj The object to print out. +- * @param {Object} opts Optional options object that alters the output. +- */ +-/* legacy: obj, showHidden, depth, colors*/ +-function inspect(obj, opts) { +- // default options +- var ctx = { +- seen: [], +- stylize: stylizeNoColor +- }; +- // legacy... +- if (arguments.length >= 3) ctx.depth = arguments[2]; +- if (arguments.length >= 4) ctx.colors = arguments[3]; +- if (isBoolean(opts)) { +- // legacy... +- ctx.showHidden = opts; +- } else if (opts) { +- // got an "options" object +- exports._extend(ctx, opts); +- } +- // set default options +- if (isUndefined(ctx.showHidden)) ctx.showHidden = false; +- if (isUndefined(ctx.depth)) ctx.depth = 2; +- if (isUndefined(ctx.colors)) ctx.colors = false; +- if (isUndefined(ctx.customInspect)) ctx.customInspect = true; +- if (ctx.colors) ctx.stylize = stylizeWithColor; +- return formatValue(ctx, obj, ctx.depth); +-} +-exports.inspect = inspect; +- +- +-// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics +-inspect.colors = { +- 'bold' : [1, 22], +- 'italic' : [3, 23], +- 'underline' : [4, 24], +- 'inverse' : [7, 27], +- 'white' : [37, 39], +- 'grey' : [90, 39], +- 'black' : [30, 39], +- 'blue' : [34, 39], +- 'cyan' : [36, 39], +- 'green' : [32, 39], +- 'magenta' : [35, 39], +- 'red' : [31, 39], +- 'yellow' : [33, 39] +-}; +- +-// Don't use 'blue' not visible on cmd.exe +-inspect.styles = { +- 'special': 'cyan', +- 'number': 'yellow', +- 'boolean': 'yellow', +- 'undefined': 'grey', +- 'null': 'bold', +- 'string': 'green', +- 'date': 'magenta', +- // "name": intentionally not styling +- 'regexp': 'red' +-}; +- +- +-function stylizeWithColor(str, styleType) { +- var style = inspect.styles[styleType]; +- +- if (style) { +- return '\u001b[' + inspect.colors[style][0] + 'm' + str + +- '\u001b[' + inspect.colors[style][1] + 'm'; +- } else { +- return str; +- } +-} +- +- +-function stylizeNoColor(str, styleType) { +- return str; +-} +- +- +-function arrayToHash(array) { +- var hash = {}; +- +- array.forEach(function(val, idx) { +- hash[val] = true; +- }); +- +- return hash; +-} +- +- +-function formatValue(ctx, value, recurseTimes) { +- // Provide a hook for user-specified inspect functions. +- // Check that value is an object with an inspect function on it +- if (ctx.customInspect && +- value && +- isFunction(value.inspect) && +- // Filter out the util module, it's inspect function is special +- value.inspect !== exports.inspect && +- // Also filter out any prototype objects using the circular check. +- !(value.constructor && value.constructor.prototype === value)) { +- var ret = value.inspect(recurseTimes, ctx); +- if (!isString(ret)) { +- ret = formatValue(ctx, ret, recurseTimes); +- } +- return ret; +- } +- +- // Primitive types cannot have properties +- var primitive = formatPrimitive(ctx, value); +- if (primitive) { +- return primitive; +- } +- +- // Look up the keys of the object. +- var keys = Object.keys(value); +- var visibleKeys = arrayToHash(keys); +- +- if (ctx.showHidden) { +- keys = Object.getOwnPropertyNames(value); +- } +- +- // Some type of object without properties can be shortcutted. +- if (keys.length === 0) { +- if (isFunction(value)) { +- var name = value.name ? ': ' + value.name : ''; +- return ctx.stylize('[Function' + name + ']', 'special'); +- } +- if (isRegExp(value)) { +- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); +- } +- if (isDate(value)) { +- return ctx.stylize(Date.prototype.toString.call(value), 'date'); +- } +- if (isError(value)) { +- return formatError(value); +- } +- } +- +- var base = '', array = false, braces = ['{', '}']; +- +- // Make Array say that they are Array +- if (isArray(value)) { +- array = true; +- braces = ['[', ']']; +- } +- +- // Make functions say that they are functions +- if (isFunction(value)) { +- var n = value.name ? ': ' + value.name : ''; +- base = ' [Function' + n + ']'; +- } +- +- // Make RegExps say that they are RegExps +- if (isRegExp(value)) { +- base = ' ' + RegExp.prototype.toString.call(value); +- } +- +- // Make dates with properties first say the date +- if (isDate(value)) { +- base = ' ' + Date.prototype.toUTCString.call(value); +- } +- +- // Make error with message first say the error +- if (isError(value)) { +- base = ' ' + formatError(value); +- } +- +- if (keys.length === 0 && (!array || value.length == 0)) { +- return braces[0] + base + braces[1]; +- } +- +- if (recurseTimes < 0) { +- if (isRegExp(value)) { +- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); +- } else { +- return ctx.stylize('[Object]', 'special'); +- } +- } +- +- ctx.seen.push(value); +- +- var output; +- if (array) { +- output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); +- } else { +- output = keys.map(function(key) { +- return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); +- }); +- } +- +- ctx.seen.pop(); +- +- return reduceToSingleString(output, base, braces); +-} +- +- +-function formatPrimitive(ctx, value) { +- if (isUndefined(value)) +- return ctx.stylize('undefined', 'undefined'); +- if (isString(value)) { +- var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') +- .replace(/'/g, "\\'") +- .replace(/\\"/g, '"') + '\''; +- return ctx.stylize(simple, 'string'); +- } +- if (isNumber(value)) { +- // Format -0 as '-0'. Strict equality won't distinguish 0 from -0, +- // so instead we use the fact that 1 / -0 < 0 whereas 1 / 0 > 0 . +- if (value === 0 && 1 / value < 0) +- return ctx.stylize('-0', 'number'); +- return ctx.stylize('' + value, 'number'); +- } +- if (isBoolean(value)) +- return ctx.stylize('' + value, 'boolean'); +- // For some reason typeof null is "object", so special case here. +- if (isNull(value)) +- return ctx.stylize('null', 'null'); +-} +- +- +-function formatError(value) { +- return '[' + Error.prototype.toString.call(value) + ']'; +-} +- +- +-function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { +- var output = []; +- for (var i = 0, l = value.length; i < l; ++i) { +- if (hasOwnProperty(value, String(i))) { +- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, +- String(i), true)); +- } else { +- output.push(''); +- } +- } +- keys.forEach(function(key) { +- if (!key.match(/^\d+$/)) { +- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, +- key, true)); +- } +- }); +- return output; +-} +- +- +-function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { +- var name, str, desc; +- desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; +- if (desc.get) { +- if (desc.set) { +- str = ctx.stylize('[Getter/Setter]', 'special'); +- } else { +- str = ctx.stylize('[Getter]', 'special'); +- } +- } else { +- if (desc.set) { +- str = ctx.stylize('[Setter]', 'special'); +- } +- } +- if (!hasOwnProperty(visibleKeys, key)) { +- name = '[' + key + ']'; +- } +- if (!str) { +- if (ctx.seen.indexOf(desc.value) < 0) { +- if (isNull(recurseTimes)) { +- str = formatValue(ctx, desc.value, null); +- } else { +- str = formatValue(ctx, desc.value, recurseTimes - 1); +- } +- if (str.indexOf('\n') > -1) { +- if (array) { +- str = str.split('\n').map(function(line) { +- return ' ' + line; +- }).join('\n').substr(2); +- } else { +- str = '\n' + str.split('\n').map(function(line) { +- return ' ' + line; +- }).join('\n'); +- } +- } +- } else { +- str = ctx.stylize('[Circular]', 'special'); +- } +- } +- if (isUndefined(name)) { +- if (array && key.match(/^\d+$/)) { +- return str; +- } +- name = JSON.stringify('' + key); +- if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { +- name = name.substr(1, name.length - 2); +- name = ctx.stylize(name, 'name'); +- } else { +- name = name.replace(/'/g, "\\'") +- .replace(/\\"/g, '"') +- .replace(/(^"|"$)/g, "'"); +- name = ctx.stylize(name, 'string'); +- } +- } +- +- return name + ': ' + str; +-} +- +- +-function reduceToSingleString(output, base, braces) { +- var numLinesEst = 0; +- var length = output.reduce(function(prev, cur) { +- numLinesEst++; +- if (cur.indexOf('\n') >= 0) numLinesEst++; +- return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; +- }, 0); +- +- if (length > 60) { +- return braces[0] + +- (base === '' ? '' : base + '\n ') + +- ' ' + +- output.join(',\n ') + +- ' ' + +- braces[1]; +- } +- +- return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; +-} +- +- + // NOTE: These type checking functions intentionally don't use `instanceof` + // because it is fragile and can be easily faked with `Object.create()`. + function isArray(ar) { +@@ -522,166 +98,10 @@ function isPrimitive(arg) { + exports.isPrimitive = isPrimitive; + + function isBuffer(arg) { +- return arg instanceof Buffer; ++ return Buffer.isBuffer(arg); + } + exports.isBuffer = isBuffer; + + function objectToString(o) { + return Object.prototype.toString.call(o); +-} +- +- +-function pad(n) { +- return n < 10 ? '0' + n.toString(10) : n.toString(10); +-} +- +- +-var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', +- 'Oct', 'Nov', 'Dec']; +- +-// 26 Feb 16:19:34 +-function timestamp() { +- var d = new Date(); +- var time = [pad(d.getHours()), +- pad(d.getMinutes()), +- pad(d.getSeconds())].join(':'); +- return [d.getDate(), months[d.getMonth()], time].join(' '); +-} +- +- +-// log is just a thin wrapper to console.log that prepends a timestamp +-exports.log = function() { +- console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); +-}; +- +- +-/** +- * Inherit the prototype methods from one constructor into another. +- * +- * The Function.prototype.inherits from lang.js rewritten as a standalone +- * function (not on Function.prototype). NOTE: If this file is to be loaded +- * during bootstrapping this function needs to be rewritten using some native +- * functions as prototype setup using normal JavaScript does not work as +- * expected during bootstrapping (see mirror.js in r114903). +- * +- * @param {function} ctor Constructor function which needs to inherit the +- * prototype. +- * @param {function} superCtor Constructor function to inherit prototype from. +- */ +-exports.inherits = function(ctor, superCtor) { +- ctor.super_ = superCtor; +- ctor.prototype = Object.create(superCtor.prototype, { +- constructor: { +- value: ctor, +- enumerable: false, +- writable: true, +- configurable: true +- } +- }); +-}; +- +-exports._extend = function(origin, add) { +- // Don't do anything if add isn't an object +- if (!add || !isObject(add)) return origin; +- +- var keys = Object.keys(add); +- var i = keys.length; +- while (i--) { +- origin[keys[i]] = add[keys[i]]; +- } +- return origin; +-}; +- +-function hasOwnProperty(obj, prop) { +- return Object.prototype.hasOwnProperty.call(obj, prop); +-} +- +- +-// Deprecated old stuff. +- +-exports.p = exports.deprecate(function() { +- for (var i = 0, len = arguments.length; i < len; ++i) { +- console.error(exports.inspect(arguments[i])); +- } +-}, 'util.p: Use console.error() instead'); +- +- +-exports.exec = exports.deprecate(function() { +- return require('child_process').exec.apply(this, arguments); +-}, 'util.exec is now called `child_process.exec`.'); +- +- +-exports.print = exports.deprecate(function() { +- for (var i = 0, len = arguments.length; i < len; ++i) { +- process.stdout.write(String(arguments[i])); +- } +-}, 'util.print: Use console.log instead'); +- +- +-exports.puts = exports.deprecate(function() { +- for (var i = 0, len = arguments.length; i < len; ++i) { +- process.stdout.write(arguments[i] + '\n'); +- } +-}, 'util.puts: Use console.log instead'); +- +- +-exports.debug = exports.deprecate(function(x) { +- process.stderr.write('DEBUG: ' + x + '\n'); +-}, 'util.debug: Use console.error instead'); +- +- +-exports.error = exports.deprecate(function(x) { +- for (var i = 0, len = arguments.length; i < len; ++i) { +- process.stderr.write(arguments[i] + '\n'); +- } +-}, 'util.error: Use console.error instead'); +- +- +-exports.pump = exports.deprecate(function(readStream, writeStream, callback) { +- var callbackCalled = false; +- +- function call(a, b, c) { +- if (callback && !callbackCalled) { +- callback(a, b, c); +- callbackCalled = true; +- } +- } +- +- readStream.addListener('data', function(chunk) { +- if (writeStream.write(chunk) === false) readStream.pause(); +- }); +- +- writeStream.addListener('drain', function() { +- readStream.resume(); +- }); +- +- readStream.addListener('end', function() { +- writeStream.end(); +- }); +- +- readStream.addListener('close', function() { +- call(); +- }); +- +- readStream.addListener('error', function(err) { +- writeStream.end(); +- call(err); +- }); +- +- writeStream.addListener('error', function(err) { +- readStream.destroy(); +- call(err); +- }); +-}, 'util.pump(): Use readableStream.pipe() instead'); +- +- +-var uv; +-exports._errnoException = function(err, syscall) { +- if (isUndefined(uv)) uv = process.binding('uv'); +- var errname = uv.errname(err); +- var e = new Error(syscall + ' ' + errname); +- e.code = errname; +- e.errno = errname; +- e.syscall = syscall; +- return e; +-}; ++} \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/lib/util.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/lib/util.js new file mode 100644 index 00000000..ff4c851c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/lib/util.js @@ -0,0 +1,107 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. + +function isArray(arg) { + if (Array.isArray) { + return Array.isArray(arg); + } + return objectToString(arg) === '[object Array]'; +} +exports.isArray = isArray; + +function isBoolean(arg) { + return typeof arg === 'boolean'; +} +exports.isBoolean = isBoolean; + +function isNull(arg) { + return arg === null; +} +exports.isNull = isNull; + +function isNullOrUndefined(arg) { + return arg == null; +} +exports.isNullOrUndefined = isNullOrUndefined; + +function isNumber(arg) { + return typeof arg === 'number'; +} +exports.isNumber = isNumber; + +function isString(arg) { + return typeof arg === 'string'; +} +exports.isString = isString; + +function isSymbol(arg) { + return typeof arg === 'symbol'; +} +exports.isSymbol = isSymbol; + +function isUndefined(arg) { + return arg === void 0; +} +exports.isUndefined = isUndefined; + +function isRegExp(re) { + return objectToString(re) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} +exports.isObject = isObject; + +function isDate(d) { + return objectToString(d) === '[object Date]'; +} +exports.isDate = isDate; + +function isError(e) { + return (objectToString(e) === '[object Error]' || e instanceof Error); +} +exports.isError = isError; + +function isFunction(arg) { + return typeof arg === 'function'; +} +exports.isFunction = isFunction; + +function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; +} +exports.isPrimitive = isPrimitive; + +exports.isBuffer = Buffer.isBuffer; + +function objectToString(o) { + return Object.prototype.toString.call(o); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/package.json new file mode 100644 index 00000000..19fb8592 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/package.json @@ -0,0 +1,60 @@ +{ + "name": "core-util-is", + "version": "1.0.2", + "description": "The `util.is*` functions introduced in Node v0.12.", + "main": "lib/util.js", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/core-util-is.git" + }, + "keywords": [ + "util", + "isBuffer", + "isArray", + "isNumber", + "isString", + "isRegExp", + "isThis", + "isThat", + "polyfill" + ], + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/isaacs/core-util-is/issues" + }, + "scripts": { + "test": "tap test.js" + }, + "devDependencies": { + "tap": "^2.3.0" + }, + "gitHead": "a177da234df5638b363ddc15fa324619a38577c8", + "homepage": "https://github.com/isaacs/core-util-is#readme", + "_id": "core-util-is@1.0.2", + "_shasum": "b5fd54220aa2bc5ab57aab7140c940754503c1a7", + "_from": "core-util-is@>=1.0.0 <1.1.0", + "_npmVersion": "3.3.2", + "_nodeVersion": "4.0.0", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "dist": { + "shasum": "b5fd54220aa2bc5ab57aab7140c940754503c1a7", + "tarball": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/test.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/test.js new file mode 100644 index 00000000..1a490c65 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/test.js @@ -0,0 +1,68 @@ +var assert = require('tap'); + +var t = require('./lib/util'); + +assert.equal(t.isArray([]), true); +assert.equal(t.isArray({}), false); + +assert.equal(t.isBoolean(null), false); +assert.equal(t.isBoolean(true), true); +assert.equal(t.isBoolean(false), true); + +assert.equal(t.isNull(null), true); +assert.equal(t.isNull(undefined), false); +assert.equal(t.isNull(false), false); +assert.equal(t.isNull(), false); + +assert.equal(t.isNullOrUndefined(null), true); +assert.equal(t.isNullOrUndefined(undefined), true); +assert.equal(t.isNullOrUndefined(false), false); +assert.equal(t.isNullOrUndefined(), true); + +assert.equal(t.isNumber(null), false); +assert.equal(t.isNumber('1'), false); +assert.equal(t.isNumber(1), true); + +assert.equal(t.isString(null), false); +assert.equal(t.isString('1'), true); +assert.equal(t.isString(1), false); + +assert.equal(t.isSymbol(null), false); +assert.equal(t.isSymbol('1'), false); +assert.equal(t.isSymbol(1), false); +assert.equal(t.isSymbol(Symbol()), true); + +assert.equal(t.isUndefined(null), false); +assert.equal(t.isUndefined(undefined), true); +assert.equal(t.isUndefined(false), false); +assert.equal(t.isUndefined(), true); + +assert.equal(t.isRegExp(null), false); +assert.equal(t.isRegExp('1'), false); +assert.equal(t.isRegExp(new RegExp()), true); + +assert.equal(t.isObject({}), true); +assert.equal(t.isObject([]), true); +assert.equal(t.isObject(new RegExp()), true); +assert.equal(t.isObject(new Date()), true); + +assert.equal(t.isDate(null), false); +assert.equal(t.isDate('1'), false); +assert.equal(t.isDate(new Date()), true); + +assert.equal(t.isError(null), false); +assert.equal(t.isError({ err: true }), false); +assert.equal(t.isError(new Error()), true); + +assert.equal(t.isFunction(null), false); +assert.equal(t.isFunction({ }), false); +assert.equal(t.isFunction(function() {}), true); + +assert.equal(t.isPrimitive(null), true); +assert.equal(t.isPrimitive(''), true); +assert.equal(t.isPrimitive(0), true); +assert.equal(t.isPrimitive(new Date()), false); + +assert.equal(t.isBuffer(null), false); +assert.equal(t.isBuffer({}), false); +assert.equal(t.isBuffer(new Buffer(0)), true); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/.npmignore new file mode 100644 index 00000000..3c3629e6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/.travis.yml new file mode 100644 index 00000000..cc4dba29 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.8" + - "0.10" diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/Makefile b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/Makefile new file mode 100644 index 00000000..0ecc29c4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/Makefile @@ -0,0 +1,5 @@ + +test: + @node_modules/.bin/tape test.js + +.PHONY: test diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/README.md new file mode 100644 index 00000000..16d2c59c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/README.md @@ -0,0 +1,60 @@ + +# isarray + +`Array#isArray` for older browsers. + +[![build status](https://secure.travis-ci.org/juliangruber/isarray.svg)](http://travis-ci.org/juliangruber/isarray) +[![downloads](https://img.shields.io/npm/dm/isarray.svg)](https://www.npmjs.org/package/isarray) + +[![browser support](https://ci.testling.com/juliangruber/isarray.png) +](https://ci.testling.com/juliangruber/isarray) + +## Usage + +```js +var isArray = require('isarray'); + +console.log(isArray([])); // => true +console.log(isArray({})); // => false +``` + +## Installation + +With [npm](http://npmjs.org) do + +```bash +$ npm install isarray +``` + +Then bundle for the browser with +[browserify](https://github.com/substack/browserify). + +With [component](http://component.io) do + +```bash +$ component install juliangruber/isarray +``` + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/component.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/component.json new file mode 100644 index 00000000..9e31b683 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/component.json @@ -0,0 +1,19 @@ +{ + "name" : "isarray", + "description" : "Array#isArray for older browsers", + "version" : "0.0.1", + "repository" : "juliangruber/isarray", + "homepage": "https://github.com/juliangruber/isarray", + "main" : "index.js", + "scripts" : [ + "index.js" + ], + "dependencies" : {}, + "keywords": ["browser","isarray","array"], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/index.js new file mode 100644 index 00000000..a57f6349 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/index.js @@ -0,0 +1,5 @@ +var toString = {}.toString; + +module.exports = Array.isArray || function (arr) { + return toString.call(arr) == '[object Array]'; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/package.json new file mode 100644 index 00000000..e86d232e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/package.json @@ -0,0 +1,71 @@ +{ + "name": "isarray", + "description": "Array#isArray for older browsers", + "version": "1.0.0", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/isarray.git" + }, + "homepage": "https://github.com/juliangruber/isarray", + "main": "index.js", + "dependencies": {}, + "devDependencies": { + "tape": "~2.13.4" + }, + "keywords": [ + "browser", + "isarray", + "array" + ], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT", + "testling": { + "files": "test.js", + "browsers": [ + "ie/8..latest", + "firefox/17..latest", + "firefox/nightly", + "chrome/22..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "scripts": { + "test": "tape test.js" + }, + "gitHead": "2a23a281f369e9ae06394c0fb4d2381355a6ba33", + "bugs": { + "url": "https://github.com/juliangruber/isarray/issues" + }, + "_id": "isarray@1.0.0", + "_shasum": "bb935d48582cba168c06834957a54a3e07124f11", + "_from": "isarray@>=1.0.0 <1.1.0", + "_npmVersion": "3.3.12", + "_nodeVersion": "5.1.0", + "_npmUser": { + "name": "juliangruber", + "email": "julian@juliangruber.com" + }, + "dist": { + "shasum": "bb935d48582cba168c06834957a54a3e07124f11", + "tarball": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" + }, + "maintainers": [ + { + "name": "juliangruber", + "email": "julian@juliangruber.com" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/test.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/test.js new file mode 100644 index 00000000..f7f7bcd1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/test.js @@ -0,0 +1,19 @@ +var isArray = require('./'); +var test = require('tape'); + +test('is array', function(t){ + t.ok(isArray([])); + t.notOk(isArray({})); + t.notOk(isArray(null)); + t.notOk(isArray(false)); + + var obj = {}; + obj[0] = true; + t.notOk(isArray(obj)); + + var arr = []; + arr.foo = 'bar'; + t.ok(isArray(arr)); + + t.end(); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml new file mode 100644 index 00000000..36201b10 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml @@ -0,0 +1,12 @@ +language: node_js +node_js: + - "0.8" + - "0.10" + - "0.11" + - "0.12" + - "1.7.1" + - 1 + - 2 + - 3 + - 4 + - 5 diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/index.js new file mode 100644 index 00000000..a4f40f84 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/index.js @@ -0,0 +1,43 @@ +'use strict'; + +if (!process.version || + process.version.indexOf('v0.') === 0 || + process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) { + module.exports = nextTick; +} else { + module.exports = process.nextTick; +} + +function nextTick(fn, arg1, arg2, arg3) { + if (typeof fn !== 'function') { + throw new TypeError('"callback" argument must be a function'); + } + var len = arguments.length; + var args, i; + switch (len) { + case 0: + case 1: + return process.nextTick(fn); + case 2: + return process.nextTick(function afterTickOne() { + fn.call(null, arg1); + }); + case 3: + return process.nextTick(function afterTickTwo() { + fn.call(null, arg1, arg2); + }); + case 4: + return process.nextTick(function afterTickThree() { + fn.call(null, arg1, arg2, arg3); + }); + default: + args = new Array(len - 1); + i = 0; + while (i < args.length) { + args[i++] = arguments[i]; + } + return process.nextTick(function afterTick() { + fn.apply(null, args); + }); + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/license.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/license.md new file mode 100644 index 00000000..c67e3532 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/license.md @@ -0,0 +1,19 @@ +# Copyright (c) 2015 Calvin Metcalf + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +**THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.** diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/package.json new file mode 100644 index 00000000..211b098d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/package.json @@ -0,0 +1,49 @@ +{ + "name": "process-nextick-args", + "version": "1.0.7", + "description": "process.nextTick but always with args", + "main": "index.js", + "scripts": { + "test": "node test.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/calvinmetcalf/process-nextick-args.git" + }, + "author": "", + "license": "MIT", + "bugs": { + "url": "https://github.com/calvinmetcalf/process-nextick-args/issues" + }, + "homepage": "https://github.com/calvinmetcalf/process-nextick-args", + "devDependencies": { + "tap": "~0.2.6" + }, + "gitHead": "5c00899ab01dd32f93ad4b5743da33da91404f39", + "_id": "process-nextick-args@1.0.7", + "_shasum": "150e20b756590ad3f91093f25a4f2ad8bff30ba3", + "_from": "process-nextick-args@>=1.0.6 <1.1.0", + "_npmVersion": "3.8.6", + "_nodeVersion": "5.11.0", + "_npmUser": { + "name": "cwmma", + "email": "calvin.metcalf@gmail.com" + }, + "dist": { + "shasum": "150e20b756590ad3f91093f25a4f2ad8bff30ba3", + "tarball": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz" + }, + "maintainers": [ + { + "name": "cwmma", + "email": "calvin.metcalf@gmail.com" + } + ], + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/process-nextick-args-1.0.7.tgz_1462394251778_0.36989671061746776" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/readme.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/readme.md new file mode 100644 index 00000000..78e7cfae --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/readme.md @@ -0,0 +1,18 @@ +process-nextick-args +===== + +[![Build Status](https://travis-ci.org/calvinmetcalf/process-nextick-args.svg?branch=master)](https://travis-ci.org/calvinmetcalf/process-nextick-args) + +```bash +npm install --save process-nextick-args +``` + +Always be able to pass arguments to process.nextTick, no matter the platform + +```js +var nextTick = require('process-nextick-args'); + +nextTick(function (a, b, c) { + console.log(a, b, c); +}, 'step', 3, 'profit'); +``` diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/test.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/test.js new file mode 100644 index 00000000..ef157215 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/test.js @@ -0,0 +1,24 @@ +var test = require("tap").test; +var nextTick = require('./'); + +test('should work', function (t) { + t.plan(5); + nextTick(function (a) { + t.ok(a); + nextTick(function (thing) { + t.equals(thing, 7); + }, 7); + }, true); + nextTick(function (a, b, c) { + t.equals(a, 'step'); + t.equals(b, 3); + t.equals(c, 'profit'); + }, 'step', 3, 'profit'); +}); + +test('correct number of arguments', function (t) { + t.plan(1); + nextTick(function () { + t.equals(2, arguments.length, 'correct number'); + }, 1, 2); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/.npmignore new file mode 100644 index 00000000..206320cc --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/.npmignore @@ -0,0 +1,2 @@ +build +test diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/LICENSE new file mode 100644 index 00000000..6de584a4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/LICENSE @@ -0,0 +1,20 @@ +Copyright Joyent, Inc. and other Node contributors. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to permit +persons to whom the Software is furnished to do so, subject to the +following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/README.md new file mode 100644 index 00000000..4d2aa001 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/README.md @@ -0,0 +1,7 @@ +**string_decoder.js** (`require('string_decoder')`) from Node.js core + +Copyright Joyent, Inc. and other Node contributors. See LICENCE file for details. + +Version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. **Prefer the stable version over the unstable.** + +The *build/* directory contains a build script that will scrape the source from the [joyent/node](https://github.com/joyent/node) repo given a specific Node version. \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/index.js new file mode 100644 index 00000000..b00e54fb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/index.js @@ -0,0 +1,221 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var Buffer = require('buffer').Buffer; + +var isBufferEncoding = Buffer.isEncoding + || function(encoding) { + switch (encoding && encoding.toLowerCase()) { + case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true; + default: return false; + } + } + + +function assertEncoding(encoding) { + if (encoding && !isBufferEncoding(encoding)) { + throw new Error('Unknown encoding: ' + encoding); + } +} + +// StringDecoder provides an interface for efficiently splitting a series of +// buffers into a series of JS strings without breaking apart multi-byte +// characters. CESU-8 is handled as part of the UTF-8 encoding. +// +// @TODO Handling all encodings inside a single object makes it very difficult +// to reason about this code, so it should be split up in the future. +// @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code +// points as used by CESU-8. +var StringDecoder = exports.StringDecoder = function(encoding) { + this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, ''); + assertEncoding(encoding); + switch (this.encoding) { + case 'utf8': + // CESU-8 represents each of Surrogate Pair by 3-bytes + this.surrogateSize = 3; + break; + case 'ucs2': + case 'utf16le': + // UTF-16 represents each of Surrogate Pair by 2-bytes + this.surrogateSize = 2; + this.detectIncompleteChar = utf16DetectIncompleteChar; + break; + case 'base64': + // Base-64 stores 3 bytes in 4 chars, and pads the remainder. + this.surrogateSize = 3; + this.detectIncompleteChar = base64DetectIncompleteChar; + break; + default: + this.write = passThroughWrite; + return; + } + + // Enough space to store all bytes of a single character. UTF-8 needs 4 + // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate). + this.charBuffer = new Buffer(6); + // Number of bytes received for the current incomplete multi-byte character. + this.charReceived = 0; + // Number of bytes expected for the current incomplete multi-byte character. + this.charLength = 0; +}; + + +// write decodes the given buffer and returns it as JS string that is +// guaranteed to not contain any partial multi-byte characters. Any partial +// character found at the end of the buffer is buffered up, and will be +// returned when calling write again with the remaining bytes. +// +// Note: Converting a Buffer containing an orphan surrogate to a String +// currently works, but converting a String to a Buffer (via `new Buffer`, or +// Buffer#write) will replace incomplete surrogates with the unicode +// replacement character. See https://codereview.chromium.org/121173009/ . +StringDecoder.prototype.write = function(buffer) { + var charStr = ''; + // if our last write ended with an incomplete multibyte character + while (this.charLength) { + // determine how many remaining bytes this buffer has to offer for this char + var available = (buffer.length >= this.charLength - this.charReceived) ? + this.charLength - this.charReceived : + buffer.length; + + // add the new bytes to the char buffer + buffer.copy(this.charBuffer, this.charReceived, 0, available); + this.charReceived += available; + + if (this.charReceived < this.charLength) { + // still not enough chars in this buffer? wait for more ... + return ''; + } + + // remove bytes belonging to the current character from the buffer + buffer = buffer.slice(available, buffer.length); + + // get the character that was split + charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding); + + // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character + var charCode = charStr.charCodeAt(charStr.length - 1); + if (charCode >= 0xD800 && charCode <= 0xDBFF) { + this.charLength += this.surrogateSize; + charStr = ''; + continue; + } + this.charReceived = this.charLength = 0; + + // if there are no more bytes in this buffer, just emit our char + if (buffer.length === 0) { + return charStr; + } + break; + } + + // determine and set charLength / charReceived + this.detectIncompleteChar(buffer); + + var end = buffer.length; + if (this.charLength) { + // buffer the incomplete character bytes we got + buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end); + end -= this.charReceived; + } + + charStr += buffer.toString(this.encoding, 0, end); + + var end = charStr.length - 1; + var charCode = charStr.charCodeAt(end); + // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character + if (charCode >= 0xD800 && charCode <= 0xDBFF) { + var size = this.surrogateSize; + this.charLength += size; + this.charReceived += size; + this.charBuffer.copy(this.charBuffer, size, 0, size); + buffer.copy(this.charBuffer, 0, 0, size); + return charStr.substring(0, end); + } + + // or just emit the charStr + return charStr; +}; + +// detectIncompleteChar determines if there is an incomplete UTF-8 character at +// the end of the given buffer. If so, it sets this.charLength to the byte +// length that character, and sets this.charReceived to the number of bytes +// that are available for this character. +StringDecoder.prototype.detectIncompleteChar = function(buffer) { + // determine how many bytes we have to check at the end of this buffer + var i = (buffer.length >= 3) ? 3 : buffer.length; + + // Figure out if one of the last i bytes of our buffer announces an + // incomplete char. + for (; i > 0; i--) { + var c = buffer[buffer.length - i]; + + // See http://en.wikipedia.org/wiki/UTF-8#Description + + // 110XXXXX + if (i == 1 && c >> 5 == 0x06) { + this.charLength = 2; + break; + } + + // 1110XXXX + if (i <= 2 && c >> 4 == 0x0E) { + this.charLength = 3; + break; + } + + // 11110XXX + if (i <= 3 && c >> 3 == 0x1E) { + this.charLength = 4; + break; + } + } + this.charReceived = i; +}; + +StringDecoder.prototype.end = function(buffer) { + var res = ''; + if (buffer && buffer.length) + res = this.write(buffer); + + if (this.charReceived) { + var cr = this.charReceived; + var buf = this.charBuffer; + var enc = this.encoding; + res += buf.slice(0, cr).toString(enc); + } + + return res; +}; + +function passThroughWrite(buffer) { + return buffer.toString(this.encoding); +} + +function utf16DetectIncompleteChar(buffer) { + this.charReceived = buffer.length % 2; + this.charLength = this.charReceived ? 2 : 0; +} + +function base64DetectIncompleteChar(buffer) { + this.charReceived = buffer.length % 3; + this.charLength = this.charReceived ? 3 : 0; +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/package.json new file mode 100644 index 00000000..8e8b77db --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/package.json @@ -0,0 +1,54 @@ +{ + "name": "string_decoder", + "version": "0.10.31", + "description": "The string_decoder module from Node core", + "main": "index.js", + "dependencies": {}, + "devDependencies": { + "tap": "~0.4.8" + }, + "scripts": { + "test": "tap test/simple/*.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/rvagg/string_decoder.git" + }, + "homepage": "https://github.com/rvagg/string_decoder", + "keywords": [ + "string", + "decoder", + "browser", + "browserify" + ], + "license": "MIT", + "gitHead": "d46d4fd87cf1d06e031c23f1ba170ca7d4ade9a0", + "bugs": { + "url": "https://github.com/rvagg/string_decoder/issues" + }, + "_id": "string_decoder@0.10.31", + "_shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", + "_from": "string_decoder@>=0.10.0 <0.11.0", + "_npmVersion": "1.4.23", + "_npmUser": { + "name": "rvagg", + "email": "rod@vagg.org" + }, + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + }, + { + "name": "rvagg", + "email": "rod@vagg.org" + } + ], + "dist": { + "shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", + "tarball": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/History.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/History.md new file mode 100644 index 00000000..acc86753 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/History.md @@ -0,0 +1,16 @@ + +1.0.2 / 2015-10-07 +================== + + * use try/catch when checking `localStorage` (#3, @kumavis) + +1.0.1 / 2014-11-25 +================== + + * browser: use `console.warn()` for deprecation calls + * browser: more jsdocs + +1.0.0 / 2014-04-30 +================== + + * initial commit diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/LICENSE new file mode 100644 index 00000000..6a60e8c2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/LICENSE @@ -0,0 +1,24 @@ +(The MIT License) + +Copyright (c) 2014 Nathan Rajlich + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/README.md new file mode 100644 index 00000000..75622fa7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/README.md @@ -0,0 +1,53 @@ +util-deprecate +============== +### The Node.js `util.deprecate()` function with browser support + +In Node.js, this module simply re-exports the `util.deprecate()` function. + +In the web browser (i.e. via browserify), a browser-specific implementation +of the `util.deprecate()` function is used. + + +## API + +A `deprecate()` function is the only thing exposed by this module. + +``` javascript +// setup: +exports.foo = deprecate(foo, 'foo() is deprecated, use bar() instead'); + + +// users see: +foo(); +// foo() is deprecated, use bar() instead +foo(); +foo(); +``` + + +## License + +(The MIT License) + +Copyright (c) 2014 Nathan Rajlich + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/browser.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/browser.js new file mode 100644 index 00000000..549ae2f0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/browser.js @@ -0,0 +1,67 @@ + +/** + * Module exports. + */ + +module.exports = deprecate; + +/** + * Mark that a method should not be used. + * Returns a modified function which warns once by default. + * + * If `localStorage.noDeprecation = true` is set, then it is a no-op. + * + * If `localStorage.throwDeprecation = true` is set, then deprecated functions + * will throw an Error when invoked. + * + * If `localStorage.traceDeprecation = true` is set, then deprecated functions + * will invoke `console.trace()` instead of `console.error()`. + * + * @param {Function} fn - the function to deprecate + * @param {String} msg - the string to print to the console when `fn` is invoked + * @returns {Function} a new "deprecated" version of `fn` + * @api public + */ + +function deprecate (fn, msg) { + if (config('noDeprecation')) { + return fn; + } + + var warned = false; + function deprecated() { + if (!warned) { + if (config('throwDeprecation')) { + throw new Error(msg); + } else if (config('traceDeprecation')) { + console.trace(msg); + } else { + console.warn(msg); + } + warned = true; + } + return fn.apply(this, arguments); + } + + return deprecated; +} + +/** + * Checks `localStorage` for boolean values for the given `name`. + * + * @param {String} name + * @returns {Boolean} + * @api private + */ + +function config (name) { + // accessing global.localStorage can trigger a DOMException in sandboxed iframes + try { + if (!global.localStorage) return false; + } catch (_) { + return false; + } + var val = global.localStorage[name]; + if (null == val) return false; + return String(val).toLowerCase() === 'true'; +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/node.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/node.js new file mode 100644 index 00000000..5e6fcff5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/node.js @@ -0,0 +1,6 @@ + +/** + * For Node.js, simply re-export the core `util.deprecate` function. + */ + +module.exports = require('util').deprecate; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/package.json new file mode 100644 index 00000000..a0181354 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/package.json @@ -0,0 +1,54 @@ +{ + "name": "util-deprecate", + "version": "1.0.2", + "description": "The Node.js `util.deprecate()` function with browser support", + "main": "node.js", + "browser": "browser.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git://github.com/TooTallNate/util-deprecate.git" + }, + "keywords": [ + "util", + "deprecate", + "browserify", + "browser", + "node" + ], + "author": { + "name": "Nathan Rajlich", + "email": "nathan@tootallnate.net", + "url": "http://n8.io/" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/TooTallNate/util-deprecate/issues" + }, + "homepage": "https://github.com/TooTallNate/util-deprecate", + "gitHead": "475fb6857cd23fafff20c1be846c1350abf8e6d4", + "_id": "util-deprecate@1.0.2", + "_shasum": "450d4dc9fa70de732762fbd2d4a28981419a0ccf", + "_from": "util-deprecate@>=1.0.1 <1.1.0", + "_npmVersion": "2.14.4", + "_nodeVersion": "4.1.2", + "_npmUser": { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + }, + "maintainers": [ + { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + } + ], + "dist": { + "shasum": "450d4dc9fa70de732762fbd2d4a28981419a0ccf", + "tarball": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/package.json new file mode 100644 index 00000000..db3b47ae --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/package.json @@ -0,0 +1,80 @@ +{ + "name": "readable-stream", + "version": "2.0.6", + "description": "Streams3, a user-land copy of the stream library from Node.js", + "main": "readable.js", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "~1.0.0", + "process-nextick-args": "~1.0.6", + "string_decoder": "~0.10.x", + "util-deprecate": "~1.0.1" + }, + "devDependencies": { + "tap": "~0.2.6", + "tape": "~4.5.1", + "zuul": "~3.9.0" + }, + "scripts": { + "test": "tap test/parallel/*.js test/ours/*.js", + "browser": "npm run write-zuul && zuul -- test/browser.js", + "write-zuul": "printf \"ui: tape\nbrowsers:\n - name: $BROWSER_NAME\n version: $BROWSER_VERSION\n\">.zuul.yml" + }, + "repository": { + "type": "git", + "url": "git://github.com/nodejs/readable-stream.git" + }, + "keywords": [ + "readable", + "stream", + "pipe" + ], + "browser": { + "util": false + }, + "license": "MIT", + "gitHead": "01fb5608a970b42c900b96746cadc13d27dd9d7e", + "bugs": { + "url": "https://github.com/nodejs/readable-stream/issues" + }, + "homepage": "https://github.com/nodejs/readable-stream#readme", + "_id": "readable-stream@2.0.6", + "_shasum": "8f90341e68a53ccc928788dacfcd11b36eb9b78e", + "_from": "readable-stream@>=2.0.0 <2.1.0", + "_npmVersion": "3.6.0", + "_nodeVersion": "5.7.0", + "_npmUser": { + "name": "cwmma", + "email": "calvin.metcalf@gmail.com" + }, + "dist": { + "shasum": "8f90341e68a53ccc928788dacfcd11b36eb9b78e", + "tarball": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + }, + { + "name": "rvagg", + "email": "rod@vagg.org" + }, + { + "name": "cwmma", + "email": "calvin.metcalf@gmail.com" + } + ], + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/readable-stream-2.0.6.tgz_1457893507709_0.369257491780445" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/passthrough.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/passthrough.js new file mode 100644 index 00000000..27e8d8a5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/passthrough.js @@ -0,0 +1 @@ +module.exports = require("./lib/_stream_passthrough.js") diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/readable.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/readable.js new file mode 100644 index 00000000..6222a579 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/readable.js @@ -0,0 +1,12 @@ +var Stream = (function (){ + try { + return require('st' + 'ream'); // hack to fix a circular dependency issue when used with browserify + } catch(_){} +}()); +exports = module.exports = require('./lib/_stream_readable.js'); +exports.Stream = Stream || exports; +exports.Readable = exports; +exports.Writable = require('./lib/_stream_writable.js'); +exports.Duplex = require('./lib/_stream_duplex.js'); +exports.Transform = require('./lib/_stream_transform.js'); +exports.PassThrough = require('./lib/_stream_passthrough.js'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/transform.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/transform.js new file mode 100644 index 00000000..5d482f07 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/transform.js @@ -0,0 +1 @@ +module.exports = require("./lib/_stream_transform.js") diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/writable.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/writable.js new file mode 100644 index 00000000..e1e9efdf --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/writable.js @@ -0,0 +1 @@ +module.exports = require("./lib/_stream_writable.js") diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/.travis.yml new file mode 100644 index 00000000..cc4dba29 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.8" + - "0.10" diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/LICENSE new file mode 100644 index 00000000..11adfaec --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/LICENSE @@ -0,0 +1,35 @@ +/* + Copyright (c) 2010, Linden Research, Inc. + Copyright (c) 2012, Joshua Bell + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + $/LicenseInfo$ + */ + +// Original can be found at: +// https://bitbucket.org/lindenlab/llsd +// Modifications by Joshua Bell inexorabletash@gmail.com +// https://github.com/inexorabletash/polyfill + +// ES3/ES5 implementation of the Krhonos Typed Array Specification +// Ref: http://www.khronos.org/registry/typedarray/specs/latest/ +// Date: 2011-02-01 +// +// Variations: +// * Allows typed_array.get/set() as alias for subscripts (typed_array[]) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/example/tarray.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/example/tarray.js new file mode 100644 index 00000000..8423d7c9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/example/tarray.js @@ -0,0 +1,4 @@ +var Uint8Array = require('../').Uint8Array; +var ua = new Uint8Array(5); +ua[1] = 256 + 55; +console.log(ua[1]); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/index.js new file mode 100644 index 00000000..5e540841 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/index.js @@ -0,0 +1,630 @@ +var undefined = (void 0); // Paranoia + +// Beyond this value, index getters/setters (i.e. array[0], array[1]) are so slow to +// create, and consume so much memory, that the browser appears frozen. +var MAX_ARRAY_LENGTH = 1e5; + +// Approximations of internal ECMAScript conversion functions +var ECMAScript = (function() { + // Stash a copy in case other scripts modify these + var opts = Object.prototype.toString, + ophop = Object.prototype.hasOwnProperty; + + return { + // Class returns internal [[Class]] property, used to avoid cross-frame instanceof issues: + Class: function(v) { return opts.call(v).replace(/^\[object *|\]$/g, ''); }, + HasProperty: function(o, p) { return p in o; }, + HasOwnProperty: function(o, p) { return ophop.call(o, p); }, + IsCallable: function(o) { return typeof o === 'function'; }, + ToInt32: function(v) { return v >> 0; }, + ToUint32: function(v) { return v >>> 0; } + }; +}()); + +// Snapshot intrinsics +var LN2 = Math.LN2, + abs = Math.abs, + floor = Math.floor, + log = Math.log, + min = Math.min, + pow = Math.pow, + round = Math.round; + +// ES5: lock down object properties +function configureProperties(obj) { + if (getOwnPropNames && defineProp) { + var props = getOwnPropNames(obj), i; + for (i = 0; i < props.length; i += 1) { + defineProp(obj, props[i], { + value: obj[props[i]], + writable: false, + enumerable: false, + configurable: false + }); + } + } +} + +// emulate ES5 getter/setter API using legacy APIs +// http://blogs.msdn.com/b/ie/archive/2010/09/07/transitioning-existing-code-to-the-es5-getter-setter-apis.aspx +// (second clause tests for Object.defineProperty() in IE<9 that only supports extending DOM prototypes, but +// note that IE<9 does not support __defineGetter__ or __defineSetter__ so it just renders the method harmless) +var defineProp +if (Object.defineProperty && (function() { + try { + Object.defineProperty({}, 'x', {}); + return true; + } catch (e) { + return false; + } + })()) { + defineProp = Object.defineProperty; +} else { + defineProp = function(o, p, desc) { + if (!o === Object(o)) throw new TypeError("Object.defineProperty called on non-object"); + if (ECMAScript.HasProperty(desc, 'get') && Object.prototype.__defineGetter__) { Object.prototype.__defineGetter__.call(o, p, desc.get); } + if (ECMAScript.HasProperty(desc, 'set') && Object.prototype.__defineSetter__) { Object.prototype.__defineSetter__.call(o, p, desc.set); } + if (ECMAScript.HasProperty(desc, 'value')) { o[p] = desc.value; } + return o; + }; +} + +var getOwnPropNames = Object.getOwnPropertyNames || function (o) { + if (o !== Object(o)) throw new TypeError("Object.getOwnPropertyNames called on non-object"); + var props = [], p; + for (p in o) { + if (ECMAScript.HasOwnProperty(o, p)) { + props.push(p); + } + } + return props; +}; + +// ES5: Make obj[index] an alias for obj._getter(index)/obj._setter(index, value) +// for index in 0 ... obj.length +function makeArrayAccessors(obj) { + if (!defineProp) { return; } + + if (obj.length > MAX_ARRAY_LENGTH) throw new RangeError("Array too large for polyfill"); + + function makeArrayAccessor(index) { + defineProp(obj, index, { + 'get': function() { return obj._getter(index); }, + 'set': function(v) { obj._setter(index, v); }, + enumerable: true, + configurable: false + }); + } + + var i; + for (i = 0; i < obj.length; i += 1) { + makeArrayAccessor(i); + } +} + +// Internal conversion functions: +// pack() - take a number (interpreted as Type), output a byte array +// unpack() - take a byte array, output a Type-like number + +function as_signed(value, bits) { var s = 32 - bits; return (value << s) >> s; } +function as_unsigned(value, bits) { var s = 32 - bits; return (value << s) >>> s; } + +function packI8(n) { return [n & 0xff]; } +function unpackI8(bytes) { return as_signed(bytes[0], 8); } + +function packU8(n) { return [n & 0xff]; } +function unpackU8(bytes) { return as_unsigned(bytes[0], 8); } + +function packU8Clamped(n) { n = round(Number(n)); return [n < 0 ? 0 : n > 0xff ? 0xff : n & 0xff]; } + +function packI16(n) { return [(n >> 8) & 0xff, n & 0xff]; } +function unpackI16(bytes) { return as_signed(bytes[0] << 8 | bytes[1], 16); } + +function packU16(n) { return [(n >> 8) & 0xff, n & 0xff]; } +function unpackU16(bytes) { return as_unsigned(bytes[0] << 8 | bytes[1], 16); } + +function packI32(n) { return [(n >> 24) & 0xff, (n >> 16) & 0xff, (n >> 8) & 0xff, n & 0xff]; } +function unpackI32(bytes) { return as_signed(bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], 32); } + +function packU32(n) { return [(n >> 24) & 0xff, (n >> 16) & 0xff, (n >> 8) & 0xff, n & 0xff]; } +function unpackU32(bytes) { return as_unsigned(bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], 32); } + +function packIEEE754(v, ebits, fbits) { + + var bias = (1 << (ebits - 1)) - 1, + s, e, f, ln, + i, bits, str, bytes; + + function roundToEven(n) { + var w = floor(n), f = n - w; + if (f < 0.5) + return w; + if (f > 0.5) + return w + 1; + return w % 2 ? w + 1 : w; + } + + // Compute sign, exponent, fraction + if (v !== v) { + // NaN + // http://dev.w3.org/2006/webapi/WebIDL/#es-type-mapping + e = (1 << ebits) - 1; f = pow(2, fbits - 1); s = 0; + } else if (v === Infinity || v === -Infinity) { + e = (1 << ebits) - 1; f = 0; s = (v < 0) ? 1 : 0; + } else if (v === 0) { + e = 0; f = 0; s = (1 / v === -Infinity) ? 1 : 0; + } else { + s = v < 0; + v = abs(v); + + if (v >= pow(2, 1 - bias)) { + e = min(floor(log(v) / LN2), 1023); + f = roundToEven(v / pow(2, e) * pow(2, fbits)); + if (f / pow(2, fbits) >= 2) { + e = e + 1; + f = 1; + } + if (e > bias) { + // Overflow + e = (1 << ebits) - 1; + f = 0; + } else { + // Normalized + e = e + bias; + f = f - pow(2, fbits); + } + } else { + // Denormalized + e = 0; + f = roundToEven(v / pow(2, 1 - bias - fbits)); + } + } + + // Pack sign, exponent, fraction + bits = []; + for (i = fbits; i; i -= 1) { bits.push(f % 2 ? 1 : 0); f = floor(f / 2); } + for (i = ebits; i; i -= 1) { bits.push(e % 2 ? 1 : 0); e = floor(e / 2); } + bits.push(s ? 1 : 0); + bits.reverse(); + str = bits.join(''); + + // Bits to bytes + bytes = []; + while (str.length) { + bytes.push(parseInt(str.substring(0, 8), 2)); + str = str.substring(8); + } + return bytes; +} + +function unpackIEEE754(bytes, ebits, fbits) { + + // Bytes to bits + var bits = [], i, j, b, str, + bias, s, e, f; + + for (i = bytes.length; i; i -= 1) { + b = bytes[i - 1]; + for (j = 8; j; j -= 1) { + bits.push(b % 2 ? 1 : 0); b = b >> 1; + } + } + bits.reverse(); + str = bits.join(''); + + // Unpack sign, exponent, fraction + bias = (1 << (ebits - 1)) - 1; + s = parseInt(str.substring(0, 1), 2) ? -1 : 1; + e = parseInt(str.substring(1, 1 + ebits), 2); + f = parseInt(str.substring(1 + ebits), 2); + + // Produce number + if (e === (1 << ebits) - 1) { + return f !== 0 ? NaN : s * Infinity; + } else if (e > 0) { + // Normalized + return s * pow(2, e - bias) * (1 + f / pow(2, fbits)); + } else if (f !== 0) { + // Denormalized + return s * pow(2, -(bias - 1)) * (f / pow(2, fbits)); + } else { + return s < 0 ? -0 : 0; + } +} + +function unpackF64(b) { return unpackIEEE754(b, 11, 52); } +function packF64(v) { return packIEEE754(v, 11, 52); } +function unpackF32(b) { return unpackIEEE754(b, 8, 23); } +function packF32(v) { return packIEEE754(v, 8, 23); } + + +// +// 3 The ArrayBuffer Type +// + +(function() { + + /** @constructor */ + var ArrayBuffer = function ArrayBuffer(length) { + length = ECMAScript.ToInt32(length); + if (length < 0) throw new RangeError('ArrayBuffer size is not a small enough positive integer'); + + this.byteLength = length; + this._bytes = []; + this._bytes.length = length; + + var i; + for (i = 0; i < this.byteLength; i += 1) { + this._bytes[i] = 0; + } + + configureProperties(this); + }; + + exports.ArrayBuffer = exports.ArrayBuffer || ArrayBuffer; + + // + // 4 The ArrayBufferView Type + // + + // NOTE: this constructor is not exported + /** @constructor */ + var ArrayBufferView = function ArrayBufferView() { + //this.buffer = null; + //this.byteOffset = 0; + //this.byteLength = 0; + }; + + // + // 5 The Typed Array View Types + // + + function makeConstructor(bytesPerElement, pack, unpack) { + // Each TypedArray type requires a distinct constructor instance with + // identical logic, which this produces. + + var ctor; + ctor = function(buffer, byteOffset, length) { + var array, sequence, i, s; + + if (!arguments.length || typeof arguments[0] === 'number') { + // Constructor(unsigned long length) + this.length = ECMAScript.ToInt32(arguments[0]); + if (length < 0) throw new RangeError('ArrayBufferView size is not a small enough positive integer'); + + this.byteLength = this.length * this.BYTES_PER_ELEMENT; + this.buffer = new ArrayBuffer(this.byteLength); + this.byteOffset = 0; + } else if (typeof arguments[0] === 'object' && arguments[0].constructor === ctor) { + // Constructor(TypedArray array) + array = arguments[0]; + + this.length = array.length; + this.byteLength = this.length * this.BYTES_PER_ELEMENT; + this.buffer = new ArrayBuffer(this.byteLength); + this.byteOffset = 0; + + for (i = 0; i < this.length; i += 1) { + this._setter(i, array._getter(i)); + } + } else if (typeof arguments[0] === 'object' && + !(arguments[0] instanceof ArrayBuffer || ECMAScript.Class(arguments[0]) === 'ArrayBuffer')) { + // Constructor(sequence array) + sequence = arguments[0]; + + this.length = ECMAScript.ToUint32(sequence.length); + this.byteLength = this.length * this.BYTES_PER_ELEMENT; + this.buffer = new ArrayBuffer(this.byteLength); + this.byteOffset = 0; + + for (i = 0; i < this.length; i += 1) { + s = sequence[i]; + this._setter(i, Number(s)); + } + } else if (typeof arguments[0] === 'object' && + (arguments[0] instanceof ArrayBuffer || ECMAScript.Class(arguments[0]) === 'ArrayBuffer')) { + // Constructor(ArrayBuffer buffer, + // optional unsigned long byteOffset, optional unsigned long length) + this.buffer = buffer; + + this.byteOffset = ECMAScript.ToUint32(byteOffset); + if (this.byteOffset > this.buffer.byteLength) { + throw new RangeError("byteOffset out of range"); + } + + if (this.byteOffset % this.BYTES_PER_ELEMENT) { + // The given byteOffset must be a multiple of the element + // size of the specific type, otherwise an exception is raised. + throw new RangeError("ArrayBuffer length minus the byteOffset is not a multiple of the element size."); + } + + if (arguments.length < 3) { + this.byteLength = this.buffer.byteLength - this.byteOffset; + + if (this.byteLength % this.BYTES_PER_ELEMENT) { + throw new RangeError("length of buffer minus byteOffset not a multiple of the element size"); + } + this.length = this.byteLength / this.BYTES_PER_ELEMENT; + } else { + this.length = ECMAScript.ToUint32(length); + this.byteLength = this.length * this.BYTES_PER_ELEMENT; + } + + if ((this.byteOffset + this.byteLength) > this.buffer.byteLength) { + throw new RangeError("byteOffset and length reference an area beyond the end of the buffer"); + } + } else { + throw new TypeError("Unexpected argument type(s)"); + } + + this.constructor = ctor; + + configureProperties(this); + makeArrayAccessors(this); + }; + + ctor.prototype = new ArrayBufferView(); + ctor.prototype.BYTES_PER_ELEMENT = bytesPerElement; + ctor.prototype._pack = pack; + ctor.prototype._unpack = unpack; + ctor.BYTES_PER_ELEMENT = bytesPerElement; + + // getter type (unsigned long index); + ctor.prototype._getter = function(index) { + if (arguments.length < 1) throw new SyntaxError("Not enough arguments"); + + index = ECMAScript.ToUint32(index); + if (index >= this.length) { + return undefined; + } + + var bytes = [], i, o; + for (i = 0, o = this.byteOffset + index * this.BYTES_PER_ELEMENT; + i < this.BYTES_PER_ELEMENT; + i += 1, o += 1) { + bytes.push(this.buffer._bytes[o]); + } + return this._unpack(bytes); + }; + + // NONSTANDARD: convenience alias for getter: type get(unsigned long index); + ctor.prototype.get = ctor.prototype._getter; + + // setter void (unsigned long index, type value); + ctor.prototype._setter = function(index, value) { + if (arguments.length < 2) throw new SyntaxError("Not enough arguments"); + + index = ECMAScript.ToUint32(index); + if (index >= this.length) { + return undefined; + } + + var bytes = this._pack(value), i, o; + for (i = 0, o = this.byteOffset + index * this.BYTES_PER_ELEMENT; + i < this.BYTES_PER_ELEMENT; + i += 1, o += 1) { + this.buffer._bytes[o] = bytes[i]; + } + }; + + // void set(TypedArray array, optional unsigned long offset); + // void set(sequence array, optional unsigned long offset); + ctor.prototype.set = function(index, value) { + if (arguments.length < 1) throw new SyntaxError("Not enough arguments"); + var array, sequence, offset, len, + i, s, d, + byteOffset, byteLength, tmp; + + if (typeof arguments[0] === 'object' && arguments[0].constructor === this.constructor) { + // void set(TypedArray array, optional unsigned long offset); + array = arguments[0]; + offset = ECMAScript.ToUint32(arguments[1]); + + if (offset + array.length > this.length) { + throw new RangeError("Offset plus length of array is out of range"); + } + + byteOffset = this.byteOffset + offset * this.BYTES_PER_ELEMENT; + byteLength = array.length * this.BYTES_PER_ELEMENT; + + if (array.buffer === this.buffer) { + tmp = []; + for (i = 0, s = array.byteOffset; i < byteLength; i += 1, s += 1) { + tmp[i] = array.buffer._bytes[s]; + } + for (i = 0, d = byteOffset; i < byteLength; i += 1, d += 1) { + this.buffer._bytes[d] = tmp[i]; + } + } else { + for (i = 0, s = array.byteOffset, d = byteOffset; + i < byteLength; i += 1, s += 1, d += 1) { + this.buffer._bytes[d] = array.buffer._bytes[s]; + } + } + } else if (typeof arguments[0] === 'object' && typeof arguments[0].length !== 'undefined') { + // void set(sequence array, optional unsigned long offset); + sequence = arguments[0]; + len = ECMAScript.ToUint32(sequence.length); + offset = ECMAScript.ToUint32(arguments[1]); + + if (offset + len > this.length) { + throw new RangeError("Offset plus length of array is out of range"); + } + + for (i = 0; i < len; i += 1) { + s = sequence[i]; + this._setter(offset + i, Number(s)); + } + } else { + throw new TypeError("Unexpected argument type(s)"); + } + }; + + // TypedArray subarray(long begin, optional long end); + ctor.prototype.subarray = function(start, end) { + function clamp(v, min, max) { return v < min ? min : v > max ? max : v; } + + start = ECMAScript.ToInt32(start); + end = ECMAScript.ToInt32(end); + + if (arguments.length < 1) { start = 0; } + if (arguments.length < 2) { end = this.length; } + + if (start < 0) { start = this.length + start; } + if (end < 0) { end = this.length + end; } + + start = clamp(start, 0, this.length); + end = clamp(end, 0, this.length); + + var len = end - start; + if (len < 0) { + len = 0; + } + + return new this.constructor( + this.buffer, this.byteOffset + start * this.BYTES_PER_ELEMENT, len); + }; + + return ctor; + } + + var Int8Array = makeConstructor(1, packI8, unpackI8); + var Uint8Array = makeConstructor(1, packU8, unpackU8); + var Uint8ClampedArray = makeConstructor(1, packU8Clamped, unpackU8); + var Int16Array = makeConstructor(2, packI16, unpackI16); + var Uint16Array = makeConstructor(2, packU16, unpackU16); + var Int32Array = makeConstructor(4, packI32, unpackI32); + var Uint32Array = makeConstructor(4, packU32, unpackU32); + var Float32Array = makeConstructor(4, packF32, unpackF32); + var Float64Array = makeConstructor(8, packF64, unpackF64); + + exports.Int8Array = exports.Int8Array || Int8Array; + exports.Uint8Array = exports.Uint8Array || Uint8Array; + exports.Uint8ClampedArray = exports.Uint8ClampedArray || Uint8ClampedArray; + exports.Int16Array = exports.Int16Array || Int16Array; + exports.Uint16Array = exports.Uint16Array || Uint16Array; + exports.Int32Array = exports.Int32Array || Int32Array; + exports.Uint32Array = exports.Uint32Array || Uint32Array; + exports.Float32Array = exports.Float32Array || Float32Array; + exports.Float64Array = exports.Float64Array || Float64Array; +}()); + +// +// 6 The DataView View Type +// + +(function() { + function r(array, index) { + return ECMAScript.IsCallable(array.get) ? array.get(index) : array[index]; + } + + var IS_BIG_ENDIAN = (function() { + var u16array = new(exports.Uint16Array)([0x1234]), + u8array = new(exports.Uint8Array)(u16array.buffer); + return r(u8array, 0) === 0x12; + }()); + + // Constructor(ArrayBuffer buffer, + // optional unsigned long byteOffset, + // optional unsigned long byteLength) + /** @constructor */ + var DataView = function DataView(buffer, byteOffset, byteLength) { + if (arguments.length === 0) { + buffer = new exports.ArrayBuffer(0); + } else if (!(buffer instanceof exports.ArrayBuffer || ECMAScript.Class(buffer) === 'ArrayBuffer')) { + throw new TypeError("TypeError"); + } + + this.buffer = buffer || new exports.ArrayBuffer(0); + + this.byteOffset = ECMAScript.ToUint32(byteOffset); + if (this.byteOffset > this.buffer.byteLength) { + throw new RangeError("byteOffset out of range"); + } + + if (arguments.length < 3) { + this.byteLength = this.buffer.byteLength - this.byteOffset; + } else { + this.byteLength = ECMAScript.ToUint32(byteLength); + } + + if ((this.byteOffset + this.byteLength) > this.buffer.byteLength) { + throw new RangeError("byteOffset and length reference an area beyond the end of the buffer"); + } + + configureProperties(this); + }; + + function makeGetter(arrayType) { + return function(byteOffset, littleEndian) { + + byteOffset = ECMAScript.ToUint32(byteOffset); + + if (byteOffset + arrayType.BYTES_PER_ELEMENT > this.byteLength) { + throw new RangeError("Array index out of range"); + } + byteOffset += this.byteOffset; + + var uint8Array = new exports.Uint8Array(this.buffer, byteOffset, arrayType.BYTES_PER_ELEMENT), + bytes = [], i; + for (i = 0; i < arrayType.BYTES_PER_ELEMENT; i += 1) { + bytes.push(r(uint8Array, i)); + } + + if (Boolean(littleEndian) === Boolean(IS_BIG_ENDIAN)) { + bytes.reverse(); + } + + return r(new arrayType(new exports.Uint8Array(bytes).buffer), 0); + }; + } + + DataView.prototype.getUint8 = makeGetter(exports.Uint8Array); + DataView.prototype.getInt8 = makeGetter(exports.Int8Array); + DataView.prototype.getUint16 = makeGetter(exports.Uint16Array); + DataView.prototype.getInt16 = makeGetter(exports.Int16Array); + DataView.prototype.getUint32 = makeGetter(exports.Uint32Array); + DataView.prototype.getInt32 = makeGetter(exports.Int32Array); + DataView.prototype.getFloat32 = makeGetter(exports.Float32Array); + DataView.prototype.getFloat64 = makeGetter(exports.Float64Array); + + function makeSetter(arrayType) { + return function(byteOffset, value, littleEndian) { + + byteOffset = ECMAScript.ToUint32(byteOffset); + if (byteOffset + arrayType.BYTES_PER_ELEMENT > this.byteLength) { + throw new RangeError("Array index out of range"); + } + + // Get bytes + var typeArray = new arrayType([value]), + byteArray = new exports.Uint8Array(typeArray.buffer), + bytes = [], i, byteView; + + for (i = 0; i < arrayType.BYTES_PER_ELEMENT; i += 1) { + bytes.push(r(byteArray, i)); + } + + // Flip if necessary + if (Boolean(littleEndian) === Boolean(IS_BIG_ENDIAN)) { + bytes.reverse(); + } + + // Write them + byteView = new exports.Uint8Array(this.buffer, byteOffset, arrayType.BYTES_PER_ELEMENT); + byteView.set(bytes); + }; + } + + DataView.prototype.setUint8 = makeSetter(exports.Uint8Array); + DataView.prototype.setInt8 = makeSetter(exports.Int8Array); + DataView.prototype.setUint16 = makeSetter(exports.Uint16Array); + DataView.prototype.setInt16 = makeSetter(exports.Int16Array); + DataView.prototype.setUint32 = makeSetter(exports.Uint32Array); + DataView.prototype.setInt32 = makeSetter(exports.Int32Array); + DataView.prototype.setFloat32 = makeSetter(exports.Float32Array); + DataView.prototype.setFloat64 = makeSetter(exports.Float64Array); + + exports.DataView = exports.DataView || DataView; + +}()); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/package.json new file mode 100644 index 00000000..d9df64d8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/package.json @@ -0,0 +1,79 @@ +{ + "name": "typedarray", + "version": "0.0.6", + "description": "TypedArray polyfill for old browsers", + "main": "index.js", + "devDependencies": { + "tape": "~2.3.2" + }, + "scripts": { + "test": "tape test/*.js test/server/*.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/substack/typedarray.git" + }, + "homepage": "https://github.com/substack/typedarray", + "keywords": [ + "ArrayBuffer", + "DataView", + "Float32Array", + "Float64Array", + "Int8Array", + "Int16Array", + "Int32Array", + "Uint8Array", + "Uint8ClampedArray", + "Uint16Array", + "Uint32Array", + "typed", + "array", + "polyfill" + ], + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "license": "MIT", + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/6..latest", + "firefox/16..latest", + "firefox/nightly", + "chrome/22..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "bugs": { + "url": "https://github.com/substack/typedarray/issues" + }, + "_id": "typedarray@0.0.6", + "dist": { + "shasum": "867ac74e3864187b1d3d47d996a78ec5c8830777", + "tarball": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz" + }, + "_from": "typedarray@>=0.0.5 <0.1.0", + "_npmVersion": "1.4.3", + "_npmUser": { + "name": "substack", + "email": "mail@substack.net" + }, + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + } + ], + "directories": {}, + "_shasum": "867ac74e3864187b1d3d47d996a78ec5c8830777", + "_resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/readme.markdown b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/readme.markdown new file mode 100644 index 00000000..d18f6f71 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/readme.markdown @@ -0,0 +1,61 @@ +# typedarray + +TypedArray polyfill ripped from [this +module](https://raw.github.com/inexorabletash/polyfill). + +[![build status](https://secure.travis-ci.org/substack/typedarray.png)](http://travis-ci.org/substack/typedarray) + +[![testling badge](https://ci.testling.com/substack/typedarray.png)](https://ci.testling.com/substack/typedarray) + +# example + +``` js +var Uint8Array = require('typedarray').Uint8Array; +var ua = new Uint8Array(5); +ua[1] = 256 + 55; +console.log(ua[1]); +``` + +output: + +``` +55 +``` + +# methods + +``` js +var TA = require('typedarray') +``` + +The `TA` object has the following constructors: + +* TA.ArrayBuffer +* TA.DataView +* TA.Float32Array +* TA.Float64Array +* TA.Int8Array +* TA.Int16Array +* TA.Int32Array +* TA.Uint8Array +* TA.Uint8ClampedArray +* TA.Uint16Array +* TA.Uint32Array + +# install + +With [npm](https://npmjs.org) do: + +``` +npm install typedarray +``` + +To use this module in the browser, compile with +[browserify](http://browserify.org) +or download a UMD build from browserify CDN: + +http://wzrd.in/standalone/typedarray@latest + +# license + +MIT diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/test/server/undef_globals.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/test/server/undef_globals.js new file mode 100644 index 00000000..425950f9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/test/server/undef_globals.js @@ -0,0 +1,19 @@ +var test = require('tape'); +var vm = require('vm'); +var fs = require('fs'); +var src = fs.readFileSync(__dirname + '/../../index.js', 'utf8'); + +test('u8a without globals', function (t) { + var c = { + module: { exports: {} }, + }; + c.exports = c.module.exports; + vm.runInNewContext(src, c); + var TA = c.module.exports; + var ua = new(TA.Uint8Array)(5); + + t.equal(ua.length, 5); + ua[1] = 256 + 55; + t.equal(ua[1], 55); + t.end(); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/test/tarray.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/test/tarray.js new file mode 100644 index 00000000..df596a34 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/test/tarray.js @@ -0,0 +1,10 @@ +var TA = require('../'); +var test = require('tape'); + +test('tiny u8a test', function (t) { + var ua = new(TA.Uint8Array)(5); + t.equal(ua.length, 5); + ua[1] = 256 + 55; + t.equal(ua[1], 55); + t.end(); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/package.json new file mode 100644 index 00000000..24d17ce3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/package.json @@ -0,0 +1,89 @@ +{ + "name": "concat-stream", + "version": "1.5.2", + "description": "writable stream that concatenates strings or binary data and calls a callback with the result", + "tags": [ + "stream", + "simple", + "util", + "utility" + ], + "author": { + "name": "Max Ogden", + "email": "max@maxogden.com" + }, + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/maxogden/concat-stream.git" + }, + "bugs": { + "url": "http://github.com/maxogden/concat-stream/issues" + }, + "engines": [ + "node >= 0.8" + ], + "main": "index.js", + "files": [ + "index.js" + ], + "scripts": { + "test": "tape test/*.js test/server/*.js" + }, + "license": "MIT", + "dependencies": { + "inherits": "~2.0.1", + "typedarray": "~0.0.5", + "readable-stream": "~2.0.0" + }, + "devDependencies": { + "tape": "~2.3.2" + }, + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/8..latest", + "firefox/17..latest", + "firefox/nightly", + "chrome/22..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "gitHead": "731fedd137eae89d066c249fdca070f8f16afbb8", + "homepage": "https://github.com/maxogden/concat-stream#readme", + "_id": "concat-stream@1.5.2", + "_shasum": "708978624d856af41a5a741defdd261da752c266", + "_from": "concat-stream@>=1.5.2 <2.0.0", + "_npmVersion": "2.15.9", + "_nodeVersion": "4.4.3", + "_npmUser": { + "name": "mafintosh", + "email": "mathiasbuus@gmail.com" + }, + "dist": { + "shasum": "708978624d856af41a5a741defdd261da752c266", + "tarball": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz" + }, + "maintainers": [ + { + "name": "mafintosh", + "email": "mathiasbuus@gmail.com" + }, + { + "name": "maxogden", + "email": "max@maxogden.com" + } + ], + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/concat-stream-1.5.2.tgz_1472715196934_0.010375389130786061" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/readme.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/readme.md new file mode 100644 index 00000000..8ad4197c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/readme.md @@ -0,0 +1,102 @@ +# concat-stream + +Writable stream that concatenates all the data from a stream and calls a callback with the result. Use this when you want to collect all the data from a stream into a single buffer. + +[![Build Status](https://travis-ci.org/maxogden/concat-stream.svg?branch=master)](https://travis-ci.org/maxogden/concat-stream) + +[![NPM](https://nodei.co/npm/concat-stream.png)](https://nodei.co/npm/concat-stream/) + +### description + +Streams emit many buffers. If you want to collect all of the buffers, and when the stream ends concatenate all of the buffers together and receive a single buffer then this is the module for you. + +Only use this if you know you can fit all of the output of your stream into a single Buffer (e.g. in RAM). + +There are also `objectMode` streams that emit things other than Buffers, and you can concatenate these too. See below for details. + +## Related + +`stream-each` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one. + +### examples + +#### Buffers + +```js +var fs = require('fs') +var concat = require('concat-stream') + +var readStream = fs.createReadStream('cat.png') +var concatStream = concat(gotPicture) + +readStream.on('error', handleError) +readStream.pipe(concatStream) + +function gotPicture(imageBuffer) { + // imageBuffer is all of `cat.png` as a node.js Buffer +} + +function handleError(err) { + // handle your error appropriately here, e.g.: + console.error(err) // print the error to STDERR + process.exit(1) // exit program with non-zero exit code +} + +``` + +#### Arrays + +```js +var write = concat(function(data) {}) +write.write([1,2,3]) +write.write([4,5,6]) +write.end() +// data will be [1,2,3,4,5,6] in the above callback +``` + +#### Uint8Arrays + +```js +var write = concat(function(data) {}) +var a = new Uint8Array(3) +a[0] = 97; a[1] = 98; a[2] = 99 +write.write(a) +write.write('!') +write.end(Buffer('!!1')) +``` + +See `test/` for more examples + +# methods + +```js +var concat = require('concat-stream') +``` + +## var writable = concat(opts={}, cb) + +Return a `writable` stream that will fire `cb(data)` with all of the data that +was written to the stream. Data can be written to `writable` as strings, +Buffers, arrays of byte integers, and Uint8Arrays. + +By default `concat-stream` will give you back the same data type as the type of the first buffer written to the stream. Use `opts.encoding` to set what format `data` should be returned as, e.g. if you if you don't want to rely on the built-in type checking or for some other reason. + +* `string` - get a string +* `buffer` - get back a Buffer +* `array` - get an array of byte integers +* `uint8array`, `u8`, `uint8` - get back a Uint8Array +* `object`, get back an array of Objects + +If you don't specify an encoding, and the types can't be inferred (e.g. you write things that aren't in the list above), it will try to convert concat them into a `Buffer`. + +If nothing is written to `writable` then `data` will be an empty array `[]`. + +# error handling + +`concat-stream` does not handle errors for you, so you must handle errors on whatever streams you pipe into `concat-stream`. This is a general rule when programming with node.js streams: always handle errors on each and every stream. Since `concat-stream` is not itself a stream it does not emit errors. + +We recommend using [`end-of-stream`](https://npmjs.org/end-of-stream) or [`pump`](https://npmjs.org/pump) for writing error tolerant stream code. + +# license + +MIT LICENSE diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/.npmignore new file mode 100644 index 00000000..e7726a07 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/.npmignore @@ -0,0 +1,2 @@ +/node_modules/* +npm-debug.log diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/License b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/License new file mode 100644 index 00000000..0b58de37 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/License @@ -0,0 +1,21 @@ +Copyright (c) 2011: +Tim Koschützki (tim@debuggable.com) +Felix Geisendörfer (felix@debuggable.com) + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/Makefile b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/Makefile new file mode 100644 index 00000000..98e7167b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/Makefile @@ -0,0 +1,21 @@ +SHELL := /bin/bash + +test: + @node test/runner.js + +release-major: test + npm version major -m "Release %s" + git push + npm publish + +release-minor: test + npm version minor -m "Release %s" + git push + npm publish + +release-patch: test + npm version patch -m "Release %s" + git push + npm publish + +.PHONY: test diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/README.md new file mode 100644 index 00000000..eee05f7b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/README.md @@ -0,0 +1,215 @@ +# retry + +Abstraction for exponential and custom retry strategies for failed operations. + +## Installation + + npm install retry + +## Current Status + +This module has been tested and is ready to be used. + +## Tutorial + +The example below will retry a potentially failing `dns.resolve` operation +`10` times using an exponential backoff strategy. With the default settings, this +means the last attempt is made after `17 minutes and 3 seconds`. + +``` javascript +var dns = require('dns'); +var retry = require('retry'); + +function faultTolerantResolve(address, cb) { + var operation = retry.operation(); + + operation.attempt(function(currentAttempt) { + dns.resolve(address, function(err, addresses) { + if (operation.retry(err)) { + return; + } + + cb(err ? operation.mainError() : null, addresses); + }); + }); +} + +faultTolerantResolve('nodejs.org', function(err, addresses) { + console.log(err, addresses); +}); +``` + +Of course you can also configure the factors that go into the exponential +backoff. See the API documentation below for all available settings. +currentAttempt is an int representing the number of attempts so far. + +``` javascript +var operation = retry.operation({ + retries: 5, + factor: 3, + minTimeout: 1 * 1000, + maxTimeout: 60 * 1000, + randomize: true, +}); +``` + +## API + +### retry.operation([options]) + +Creates a new `RetryOperation` object. `options` is the same as `retry.timeouts()`'s `options`, with two additions: + +* `forever`: Whether to retry forever, defaults to `false`. +* `unref`: Wether to [unref](https://nodejs.org/api/timers.html#timers_unref) the setTimeout's, defaults to `false`. + +### retry.timeouts([options]) + +Returns an array of timeouts. All time `options` and return values are in +milliseconds. If `options` is an array, a copy of that array is returned. + +`options` is a JS object that can contain any of the following keys: + +* `retries`: The maximum amount of times to retry the operation. Default is `10`. +* `factor`: The exponential factor to use. Default is `2`. +* `minTimeout`: The number of milliseconds before starting the first retry. Default is `1000`. +* `maxTimeout`: The maximum number of milliseconds between two retries. Default is `Infinity`. +* `randomize`: Randomizes the timeouts by multiplying with a factor between `1` to `2`. Default is `false`. + +The formula used to calculate the individual timeouts is: + +``` +Math.min(random * minTimeout * Math.pow(factor, attempt), maxTimeout) +``` + +Have a look at [this article][article] for a better explanation of approach. + +If you want to tune your `factor` / `times` settings to attempt the last retry +after a certain amount of time, you can use wolfram alpha. For example in order +to tune for `10` attempts in `5 minutes`, you can use this equation: + +![screenshot](https://github.com/tim-kos/node-retry/raw/master/equation.gif) + +Explaining the various values from left to right: + +* `k = 0 ... 9`: The `retries` value (10) +* `1000`: The `minTimeout` value in ms (1000) +* `x^k`: No need to change this, `x` will be your resulting factor +* `5 * 60 * 1000`: The desired total amount of time for retrying in ms (5 minutes) + +To make this a little easier for you, use wolfram alpha to do the calculations: + + + +[article]: http://dthain.blogspot.com/2009/02/exponential-backoff-in-distributed.html + +### retry.createTimeout(attempt, opts) + +Returns a new `timeout` (integer in milliseconds) based on the given parameters. + +`attempt` is an integer representing for which retry the timeout should be calculated. If your retry operation was executed 4 times you had one attempt and 3 retries. If you then want to calculate a new timeout, you should set `attempt` to 4 (attempts are zero-indexed). + +`opts` can include `factor`, `minTimeout`, `randomize` (boolean) and `maxTimeout`. They are documented above. + +`retry.createTimeout()` is used internally by `retry.timeouts()` and is public for you to be able to create your own timeouts for reinserting an item, see [issue #13](https://github.com/tim-kos/node-retry/issues/13). + +### retry.wrap(obj, [options], [methodNames]) + +Wrap all functions of the `obj` with retry. Optionally you can pass operation options and +an array of method names which need to be wrapped. + +``` +retry.wrap(obj) + +retry.wrap(obj, ['method1', 'method2']) + +retry.wrap(obj, {retries: 3}) + +retry.wrap(obj, {retries: 3}, ['method1', 'method2']) +``` +The `options` object can take any options that the usual call to `retry.operation` can take. + +### new RetryOperation(timeouts, [options]) + +Creates a new `RetryOperation` where `timeouts` is an array where each value is +a timeout given in milliseconds. + +Available options: +* `forever`: Whether to retry forever, defaults to `false`. +* `unref`: Wether to [unref](https://nodejs.org/api/timers.html#timers_unref) the setTimeout's, defaults to `false`. + +If `forever` is true, the following changes happen: +* `RetryOperation.errors()` will only output an array of one item: the last error. +* `RetryOperation` will repeatedly use the `timeouts` array. Once all of its timeouts have been used up, it restarts with the first timeout, then uses the second and so on. + +#### retryOperation.errors() + +Returns an array of all errors that have been passed to +`retryOperation.retry()` so far. + +#### retryOperation.mainError() + +A reference to the error object that occured most frequently. Errors are +compared using the `error.message` property. + +If multiple error messages occured the same amount of time, the last error +object with that message is returned. + +If no errors occured so far, the value is `null`. + +#### retryOperation.attempt(fn, timeoutOps) + +Defines the function `fn` that is to be retried and executes it for the first +time right away. The `fn` function can receive an optional `currentAttempt` callback that represents the number of attempts to execute `fn` so far. + +Optionally defines `timeoutOps` which is an object having a property `timeout` in miliseconds and a property `cb` callback function. +Whenever your retry operation takes longer than `timeout` to execute, the timeout callback function `cb` is called. + + +#### retryOperation.try(fn) + +This is an alias for `retryOperation.attempt(fn)`. This is deprecated. Please use `retryOperation.attempt(fn)` instead. + +#### retryOperation.start(fn) + +This is an alias for `retryOperation.attempt(fn)`. This is deprecated. Please use `retryOperation.attempt(fn)` instead. + +#### retryOperation.retry(error) + +Returns `false` when no `error` value is given, or the maximum amount of retries +has been reached. + +Otherwise it returns `true`, and retries the operation after the timeout for +the current attempt number. + +#### retryOperation.stop() + +Allows you to stop the operation being retried. Useful for aborting the operation on a fatal error etc. + +#### retryOperation.attempts() + +Returns an int representing the number of attempts it took to call `fn` before it was successful. + +## License + +retry is licensed under the MIT license. + + +# Changelog + +0.10.0 Adding `stop` functionality, thanks to @maxnachlinger. + +0.9.0 Adding `unref` functionality, thanks to @satazor. + +0.8.0 Implementing retry.wrap. + +0.7.0 Some bug fixes and made retry.createTimeout() public. Fixed issues [#10](https://github.com/tim-kos/node-retry/issues/10), [#12](https://github.com/tim-kos/node-retry/issues/12), and [#13](https://github.com/tim-kos/node-retry/issues/13). + +0.6.0 Introduced optional timeOps parameter for the attempt() function which is an object having a property timeout in milliseconds and a property cb callback function. Whenever your retry operation takes longer than timeout to execute, the timeout callback function cb is called. + +0.5.0 Some minor refactoring. + +0.4.0 Changed retryOperation.try() to retryOperation.attempt(). Deprecated the aliases start() and try() for it. + +0.3.0 Added retryOperation.start() which is an alias for retryOperation.try(). + +0.2.0 Added attempts() function and parameter to retryOperation.try() representing the number of attempts it took to call fn(). diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/equation.gif b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/equation.gif new file mode 100644 index 00000000..97107237 Binary files /dev/null and b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/equation.gif differ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/example/dns.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/example/dns.js new file mode 100644 index 00000000..446729b6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/example/dns.js @@ -0,0 +1,31 @@ +var dns = require('dns'); +var retry = require('../lib/retry'); + +function faultTolerantResolve(address, cb) { + var opts = { + retries: 2, + factor: 2, + minTimeout: 1 * 1000, + maxTimeout: 2 * 1000, + randomize: true + }; + var operation = retry.operation(opts); + + operation.attempt(function(currentAttempt) { + dns.resolve(address, function(err, addresses) { + if (operation.retry(err)) { + return; + } + + cb(operation.mainError(), operation.errors(), addresses); + }); + }); +} + +faultTolerantResolve('nodejs.org', function(err, errors, addresses) { + console.warn('err:'); + console.log(err); + + console.warn('addresses:'); + console.log(addresses); +}); \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/example/stop.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/example/stop.js new file mode 100644 index 00000000..e1ceafee --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/example/stop.js @@ -0,0 +1,40 @@ +var retry = require('../lib/retry'); + +function attemptAsyncOperation(someInput, cb) { + var opts = { + retries: 2, + factor: 2, + minTimeout: 1 * 1000, + maxTimeout: 2 * 1000, + randomize: true + }; + var operation = retry.operation(opts); + + operation.attempt(function(currentAttempt) { + failingAsyncOperation(someInput, function(err, result) { + + if (err && err.message === 'A fatal error') { + operation.stop(); + return cb(err); + } + + if (operation.retry(err)) { + return; + } + + cb(operation.mainError(), operation.errors(), result); + }); + }); +} + +attemptAsyncOperation('test input', function(err, errors, result) { + console.warn('err:'); + console.log(err); + + console.warn('result:'); + console.log(result); +}); + +function failingAsyncOperation(input, cb) { + return setImmediate(cb.bind(null, new Error('A fatal error'))); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/index.js new file mode 100644 index 00000000..ee62f3a1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/index.js @@ -0,0 +1 @@ +module.exports = require('./lib/retry'); \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry.js new file mode 100644 index 00000000..77428cfd --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry.js @@ -0,0 +1,99 @@ +var RetryOperation = require('./retry_operation'); + +exports.operation = function(options) { + var timeouts = exports.timeouts(options); + return new RetryOperation(timeouts, { + forever: options && options.forever, + unref: options && options.unref + }); +}; + +exports.timeouts = function(options) { + if (options instanceof Array) { + return [].concat(options); + } + + var opts = { + retries: 10, + factor: 2, + minTimeout: 1 * 1000, + maxTimeout: Infinity, + randomize: false + }; + for (var key in options) { + opts[key] = options[key]; + } + + if (opts.minTimeout > opts.maxTimeout) { + throw new Error('minTimeout is greater than maxTimeout'); + } + + var timeouts = []; + for (var i = 0; i < opts.retries; i++) { + timeouts.push(this.createTimeout(i, opts)); + } + + if (options && options.forever && !timeouts.length) { + timeouts.push(this.createTimeout(i, opts)); + } + + // sort the array numerically ascending + timeouts.sort(function(a,b) { + return a - b; + }); + + return timeouts; +}; + +exports.createTimeout = function(attempt, opts) { + var random = (opts.randomize) + ? (Math.random() + 1) + : 1; + + var timeout = Math.round(random * opts.minTimeout * Math.pow(opts.factor, attempt)); + timeout = Math.min(timeout, opts.maxTimeout); + + return timeout; +}; + +exports.wrap = function(obj, options, methods) { + if (options instanceof Array) { + methods = options; + options = null; + } + + if (!methods) { + methods = []; + for (var key in obj) { + if (typeof obj[key] === 'function') { + methods.push(key); + } + } + } + + for (var i = 0; i < methods.length; i++) { + var method = methods[i]; + var original = obj[method]; + + obj[method] = function retryWrapper() { + var op = exports.operation(options); + var args = Array.prototype.slice.call(arguments); + var callback = args.pop(); + + args.push(function(err) { + if (op.retry(err)) { + return; + } + if (err) { + arguments[0] = op.mainError(); + } + callback.apply(this, arguments); + }); + + op.attempt(function() { + original.apply(obj, args); + }); + }; + obj[method].options = options; + } +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry_operation.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry_operation.js new file mode 100644 index 00000000..2b3db8e1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry_operation.js @@ -0,0 +1,143 @@ +function RetryOperation(timeouts, options) { + // Compatibility for the old (timeouts, retryForever) signature + if (typeof options === 'boolean') { + options = { forever: options }; + } + + this._timeouts = timeouts; + this._options = options || {}; + this._fn = null; + this._errors = []; + this._attempts = 1; + this._operationTimeout = null; + this._operationTimeoutCb = null; + this._timeout = null; + + if (this._options.forever) { + this._cachedTimeouts = this._timeouts.slice(0); + } +} +module.exports = RetryOperation; + +RetryOperation.prototype.stop = function() { + if (this._timeout) { + clearTimeout(this._timeout); + } + + this._timeouts = []; + this._cachedTimeouts = null; +}; + +RetryOperation.prototype.retry = function(err) { + if (this._timeout) { + clearTimeout(this._timeout); + } + + if (!err) { + return false; + } + + this._errors.push(err); + + var timeout = this._timeouts.shift(); + if (timeout === undefined) { + if (this._cachedTimeouts) { + // retry forever, only keep last error + this._errors.splice(this._errors.length - 1, this._errors.length); + this._timeouts = this._cachedTimeouts.slice(0); + timeout = this._timeouts.shift(); + } else { + return false; + } + } + + var self = this; + var timer = setTimeout(function() { + self._attempts++; + + if (self._operationTimeoutCb) { + self._timeout = setTimeout(function() { + self._operationTimeoutCb(self._attempts); + }, self._operationTimeout); + + if (this._options.unref) { + self._timeout.unref(); + } + } + + self._fn(self._attempts); + }, timeout); + + if (this._options.unref) { + timer.unref(); + } + + return true; +}; + +RetryOperation.prototype.attempt = function(fn, timeoutOps) { + this._fn = fn; + + if (timeoutOps) { + if (timeoutOps.timeout) { + this._operationTimeout = timeoutOps.timeout; + } + if (timeoutOps.cb) { + this._operationTimeoutCb = timeoutOps.cb; + } + } + + var self = this; + if (this._operationTimeoutCb) { + this._timeout = setTimeout(function() { + self._operationTimeoutCb(); + }, self._operationTimeout); + } + + this._fn(this._attempts); +}; + +RetryOperation.prototype.try = function(fn) { + console.log('Using RetryOperation.try() is deprecated'); + this.attempt(fn); +}; + +RetryOperation.prototype.start = function(fn) { + console.log('Using RetryOperation.start() is deprecated'); + this.attempt(fn); +}; + +RetryOperation.prototype.start = RetryOperation.prototype.try; + +RetryOperation.prototype.errors = function() { + return this._errors; +}; + +RetryOperation.prototype.attempts = function() { + return this._attempts; +}; + +RetryOperation.prototype.mainError = function() { + if (this._errors.length === 0) { + return null; + } + + var counts = {}; + var mainError = null; + var mainErrorCount = 0; + + for (var i = 0; i < this._errors.length; i++) { + var error = this._errors[i]; + var message = error.message; + var count = (counts[message] || 0) + 1; + + counts[message] = count; + + if (count >= mainErrorCount) { + mainError = error; + mainErrorCount = count; + } + } + + return mainError; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/package.json new file mode 100644 index 00000000..28fc1296 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/package.json @@ -0,0 +1,58 @@ +{ + "author": { + "name": "Tim Koschützki", + "email": "tim@debuggable.com", + "url": "http://debuggable.com/" + }, + "name": "retry", + "description": "Abstraction for exponential and custom retry strategies for failed operations.", + "license": "MIT", + "version": "0.10.0", + "homepage": "https://github.com/tim-kos/node-retry", + "repository": { + "type": "git", + "url": "git://github.com/tim-kos/node-retry.git" + }, + "directories": { + "lib": "./lib" + }, + "main": "index", + "engines": { + "node": "*" + }, + "dependencies": {}, + "devDependencies": { + "fake": "0.2.0", + "far": "0.0.1" + }, + "gitHead": "0616e6a6ebc49b5a36b619c8f7c414ced8c3813b", + "bugs": { + "url": "https://github.com/tim-kos/node-retry/issues" + }, + "_id": "retry@0.10.0", + "scripts": {}, + "_shasum": "649e15ca408422d98318161935e7f7d652d435dd", + "_from": "retry@>=0.10.0 <0.11.0", + "_npmVersion": "2.1.7", + "_nodeVersion": "4.2.1", + "_npmUser": { + "name": "tim-kos", + "email": "tim@debuggable.com" + }, + "maintainers": [ + { + "name": "tim-kos", + "email": "tim@debuggable.com" + } + ], + "dist": { + "shasum": "649e15ca408422d98318161935e7f7d652d435dd", + "tarball": "https://registry.npmjs.org/retry/-/retry-0.10.0.tgz" + }, + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/retry-0.10.0.tgz_1471682099847_0.5031970851123333" + }, + "_resolved": "https://registry.npmjs.org/retry/-/retry-0.10.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/test/common.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/test/common.js new file mode 100644 index 00000000..22472069 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/test/common.js @@ -0,0 +1,10 @@ +var common = module.exports; +var path = require('path'); + +var rootDir = path.join(__dirname, '..'); +common.dir = { + lib: rootDir + '/lib' +}; + +common.assert = require('assert'); +common.fake = require('fake'); \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-forever.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-forever.js new file mode 100644 index 00000000..b41307cb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-forever.js @@ -0,0 +1,24 @@ +var common = require('../common'); +var assert = common.assert; +var retry = require(common.dir.lib + '/retry'); + +(function testForeverUsesFirstTimeout() { + var operation = retry.operation({ + retries: 0, + minTimeout: 100, + maxTimeout: 100, + forever: true + }); + + operation.attempt(function(numAttempt) { + console.log('>numAttempt', numAttempt); + var err = new Error("foo"); + if (numAttempt == 10) { + operation.stop(); + } + + if (operation.retry(err)) { + return; + } + }); +})(); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-operation.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-operation.js new file mode 100644 index 00000000..91693642 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-operation.js @@ -0,0 +1,176 @@ +var common = require('../common'); +var assert = common.assert; +var fake = common.fake.create(); +var retry = require(common.dir.lib + '/retry'); + +(function testErrors() { + var operation = retry.operation(); + + var error = new Error('some error'); + var error2 = new Error('some other error'); + operation._errors.push(error); + operation._errors.push(error2); + + assert.deepEqual(operation.errors(), [error, error2]); +})(); + +(function testMainErrorReturnsMostFrequentError() { + var operation = retry.operation(); + var error = new Error('some error'); + var error2 = new Error('some other error'); + + operation._errors.push(error); + operation._errors.push(error2); + operation._errors.push(error); + + assert.strictEqual(operation.mainError(), error); +})(); + +(function testMainErrorReturnsLastErrorOnEqualCount() { + var operation = retry.operation(); + var error = new Error('some error'); + var error2 = new Error('some other error'); + + operation._errors.push(error); + operation._errors.push(error2); + + assert.strictEqual(operation.mainError(), error2); +})(); + +(function testAttempt() { + var operation = retry.operation(); + var fn = new Function(); + + var timeoutOpts = { + timeout: 1, + cb: function() {} + }; + operation.attempt(fn, timeoutOpts); + + assert.strictEqual(fn, operation._fn); + assert.strictEqual(timeoutOpts.timeout, operation._operationTimeout); + assert.strictEqual(timeoutOpts.cb, operation._operationTimeoutCb); +})(); + +(function testRetry() { + var times = 3; + var error = new Error('some error'); + var operation = retry.operation([1, 2, 3]); + var attempts = 0; + + var finalCallback = fake.callback('finalCallback'); + fake.expectAnytime(finalCallback); + + var fn = function() { + operation.attempt(function(currentAttempt) { + attempts++; + assert.equal(currentAttempt, attempts); + if (operation.retry(error)) { + return; + } + + assert.strictEqual(attempts, 4); + assert.strictEqual(operation.attempts(), attempts); + assert.strictEqual(operation.mainError(), error); + finalCallback(); + }); + }; + + fn(); +})(); + +(function testRetryForever() { + var error = new Error('some error'); + var operation = retry.operation({ retries: 3, forever: true }); + var attempts = 0; + + var finalCallback = fake.callback('finalCallback'); + fake.expectAnytime(finalCallback); + + var fn = function() { + operation.attempt(function(currentAttempt) { + attempts++; + assert.equal(currentAttempt, attempts); + if (attempts !== 6 && operation.retry(error)) { + return; + } + + assert.strictEqual(attempts, 6); + assert.strictEqual(operation.attempts(), attempts); + assert.strictEqual(operation.mainError(), error); + finalCallback(); + }); + }; + + fn(); +})(); + +(function testRetryForeverNoRetries() { + var error = new Error('some error'); + var delay = 50 + var operation = retry.operation({ + retries: null, + forever: true, + minTimeout: delay, + maxTimeout: delay + }); + + var attempts = 0; + var startTime = new Date().getTime(); + + var finalCallback = fake.callback('finalCallback'); + fake.expectAnytime(finalCallback); + + var fn = function() { + operation.attempt(function(currentAttempt) { + attempts++; + assert.equal(currentAttempt, attempts); + if (attempts !== 4 && operation.retry(error)) { + return; + } + + var endTime = new Date().getTime(); + var minTime = startTime + (delay * 3); + var maxTime = minTime + 20 // add a little headroom for code execution time + assert(endTime > minTime) + assert(endTime < maxTime) + assert.strictEqual(attempts, 4); + assert.strictEqual(operation.attempts(), attempts); + assert.strictEqual(operation.mainError(), error); + finalCallback(); + }); + }; + + fn(); +})(); + +(function testStop() { + var error = new Error('some error'); + var operation = retry.operation([1, 2, 3]); + var attempts = 0; + + var finalCallback = fake.callback('finalCallback'); + fake.expectAnytime(finalCallback); + + var fn = function() { + operation.attempt(function(currentAttempt) { + attempts++; + assert.equal(currentAttempt, attempts); + + if (attempts === 2) { + operation.stop(); + + assert.strictEqual(attempts, 2); + assert.strictEqual(operation.attempts(), attempts); + assert.strictEqual(operation.mainError(), error); + finalCallback(); + } + + if (operation.retry(error)) { + return; + } + }); + }; + + fn(); +})(); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-wrap.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-wrap.js new file mode 100644 index 00000000..7ca8bc7e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-wrap.js @@ -0,0 +1,77 @@ +var common = require('../common'); +var assert = common.assert; +var fake = common.fake.create(); +var retry = require(common.dir.lib + '/retry'); + +function getLib() { + return { + fn1: function() {}, + fn2: function() {}, + fn3: function() {} + }; +} + +(function wrapAll() { + var lib = getLib(); + retry.wrap(lib); + assert.equal(lib.fn1.name, 'retryWrapper'); + assert.equal(lib.fn2.name, 'retryWrapper'); + assert.equal(lib.fn3.name, 'retryWrapper'); +}()); + +(function wrapAllPassOptions() { + var lib = getLib(); + retry.wrap(lib, {retries: 2}); + assert.equal(lib.fn1.name, 'retryWrapper'); + assert.equal(lib.fn2.name, 'retryWrapper'); + assert.equal(lib.fn3.name, 'retryWrapper'); + assert.equal(lib.fn1.options.retries, 2); + assert.equal(lib.fn2.options.retries, 2); + assert.equal(lib.fn3.options.retries, 2); +}()); + +(function wrapDefined() { + var lib = getLib(); + retry.wrap(lib, ['fn2', 'fn3']); + assert.notEqual(lib.fn1.name, 'retryWrapper'); + assert.equal(lib.fn2.name, 'retryWrapper'); + assert.equal(lib.fn3.name, 'retryWrapper'); +}()); + +(function wrapDefinedAndPassOptions() { + var lib = getLib(); + retry.wrap(lib, {retries: 2}, ['fn2', 'fn3']); + assert.notEqual(lib.fn1.name, 'retryWrapper'); + assert.equal(lib.fn2.name, 'retryWrapper'); + assert.equal(lib.fn3.name, 'retryWrapper'); + assert.equal(lib.fn2.options.retries, 2); + assert.equal(lib.fn3.options.retries, 2); +}()); + +(function runWrappedWithoutError() { + var callbackCalled; + var lib = {method: function(a, b, callback) { + assert.equal(a, 1); + assert.equal(b, 2); + assert.equal(typeof callback, 'function'); + callback(); + }}; + retry.wrap(lib); + lib.method(1, 2, function() { + callbackCalled = true; + }); + assert.ok(callbackCalled); +}()); + +(function runWrappedWithError() { + var callbackCalled; + var lib = {method: function(callback) { + callback(new Error('Some error')); + }}; + retry.wrap(lib, {retries: 1}); + lib.method(function(err) { + callbackCalled = true; + assert.ok(err instanceof Error); + }); + assert.ok(!callbackCalled); +}()); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-timeouts.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-timeouts.js new file mode 100644 index 00000000..7206b0fb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-timeouts.js @@ -0,0 +1,69 @@ +var common = require('../common'); +var assert = common.assert; +var retry = require(common.dir.lib + '/retry'); + +(function testDefaultValues() { + var timeouts = retry.timeouts(); + + assert.equal(timeouts.length, 10); + assert.equal(timeouts[0], 1000); + assert.equal(timeouts[1], 2000); + assert.equal(timeouts[2], 4000); +})(); + +(function testDefaultValuesWithRandomize() { + var minTimeout = 5000; + var timeouts = retry.timeouts({ + minTimeout: minTimeout, + randomize: true + }); + + assert.equal(timeouts.length, 10); + assert.ok(timeouts[0] > minTimeout); + assert.ok(timeouts[1] > timeouts[0]); + assert.ok(timeouts[2] > timeouts[1]); +})(); + +(function testPassedTimeoutsAreUsed() { + var timeoutsArray = [1000, 2000, 3000]; + var timeouts = retry.timeouts(timeoutsArray); + assert.deepEqual(timeouts, timeoutsArray); + assert.notStrictEqual(timeouts, timeoutsArray); +})(); + +(function testTimeoutsAreWithinBoundaries() { + var minTimeout = 1000; + var maxTimeout = 10000; + var timeouts = retry.timeouts({ + minTimeout: minTimeout, + maxTimeout: maxTimeout + }); + for (var i = 0; i < timeouts; i++) { + assert.ok(timeouts[i] >= minTimeout); + assert.ok(timeouts[i] <= maxTimeout); + } +})(); + +(function testTimeoutsAreIncremental() { + var timeouts = retry.timeouts(); + var lastTimeout = timeouts[0]; + for (var i = 0; i < timeouts; i++) { + assert.ok(timeouts[i] > lastTimeout); + lastTimeout = timeouts[i]; + } +})(); + +(function testTimeoutsAreIncrementalForFactorsLessThanOne() { + var timeouts = retry.timeouts({ + retries: 3, + factor: 0.5 + }); + + var expected = [250, 500, 1000]; + assert.deepEqual(expected, timeouts); +})(); + +(function testRetries() { + var timeouts = retry.timeouts({retries: 2}); + assert.strictEqual(timeouts.length, 2); +})(); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/test/runner.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/test/runner.js new file mode 100644 index 00000000..e0ee2f57 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/node_modules/retry/test/runner.js @@ -0,0 +1,5 @@ +var far = require('far').create(); + +far.add(__dirname); +far.include(/\/test-.*\.js$/); +far.execute(); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/package.json new file mode 100644 index 00000000..3a4ea770 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/package.json @@ -0,0 +1,84 @@ +{ + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "name": "npm-registry-client", + "description": "Client for the npm registry", + "version": "7.2.1", + "repository": { + "url": "git+https://github.com/npm/npm-registry-client.git" + }, + "main": "index.js", + "scripts": { + "test": "standard && tap test/*.js" + }, + "dependencies": { + "concat-stream": "^1.5.2", + "graceful-fs": "^4.1.6", + "normalize-package-data": "~1.0.1 || ^2.0.0", + "npm-package-arg": "^3.0.0 || ^4.0.0", + "once": "^1.3.3", + "request": "^2.74.0", + "retry": "^0.10.0", + "semver": "2 >=2.2.1 || 3.x || 4 || 5", + "slide": "^1.1.3", + "npmlog": "~2.0.0 || ~3.1.0" + }, + "devDependencies": { + "negotiator": "^0.6.1", + "nock": "^8.0.0", + "readable-stream": "^2.1.5", + "rimraf": "^2.5.4", + "standard": "^8.0.0", + "tap": "^7.0.0" + }, + "optionalDependencies": { + "npmlog": "~2.0.0 || ~3.1.0" + }, + "license": "ISC", + "gitHead": "debec76884db8092c2c7a21ab5b4ed083f8ce2c9", + "bugs": { + "url": "https://github.com/npm/npm-registry-client/issues" + }, + "homepage": "https://github.com/npm/npm-registry-client#readme", + "_id": "npm-registry-client@7.2.1", + "_shasum": "c792266b088cc313f8525e7e35248626c723db75", + "_from": "npm-registry-client@7.2.1", + "_npmVersion": "3.10.7", + "_nodeVersion": "6.3.1", + "_npmUser": { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + "dist": { + "shasum": "c792266b088cc313f8525e7e35248626c723db75", + "tarball": "https://registry.npmjs.org/npm-registry-client/-/npm-registry-client-7.2.1.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "iarna", + "email": "me@re-becca.org" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" + } + ], + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/npm-registry-client-7.2.1.tgz_1472871043942_0.2117650501895696" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/npm-registry-client/-/npm-registry-client-7.2.1.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/00-setup.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/00-setup.js new file mode 100644 index 00000000..fb9585a4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/00-setup.js @@ -0,0 +1,11 @@ +var join = require('path').join +var rimraf = require('rimraf') +var tap = require('tap') + +tap.test('setup', function (t) { + rimraf(join(__dirname, 'fixtures', 'cache'), function (er) { + if (er) throw er + t.pass('cache cleaned') + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/access.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/access.js new file mode 100644 index 00000000..78b00017 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/access.js @@ -0,0 +1,370 @@ +var test = require('tap').test + +var server = require('./lib/server.js') +var common = require('./lib/common.js') +var client = common.freshClient() + +function nop () {} + +var URI = 'http://localhost:1337' +var PARAMS = { + auth: { token: 'foo' }, + scope: 'myorg', + team: 'myteam', + package: '@foo/bar', + permissions: 'read-write' +} +var UNSCOPED = { + auth: { token: 'foo' }, + scope: 'myorg', + team: 'myteam', + package: 'bar', + permissions: 'read-write' +} + +var commands = [ + 'public', 'restricted', 'grant', 'revoke', 'ls-packages', 'ls-collaborators' +] + +test('access public', function (t) { + server.expect('POST', '/-/package/%40foo%2Fbar/access', function (req, res) { + t.equal(req.method, 'POST') + onJsonReq(req, function (json) { + t.deepEqual(json, { access: 'public' }) + res.statusCode = 200 + res.json({ accessChanged: true }) + }) + }) + var params = Object.create(PARAMS) + params.package = '@foo/bar' + client.access('public', URI, params, function (error, data) { + t.ifError(error, 'no errors') + t.ok(data.accessChanged, 'access level set') + t.end() + }) +}) + +test('access restricted', function (t) { + server.expect('POST', '/-/package/%40foo%2Fbar/access', function (req, res) { + t.equal(req.method, 'POST') + onJsonReq(req, function (json) { + t.deepEqual(json, { access: 'restricted' }) + res.statusCode = 200 + res.json({ accessChanged: true }) + }) + }) + client.access('restricted', URI, PARAMS, function (error, data) { + t.ifError(error, 'no errors') + t.ok(data.accessChanged, 'access level set') + t.end() + }) +}) + +test('access grant basic', function (t) { + server.expect('PUT', '/-/team/myorg/myteam/package', function (req, res) { + t.equal(req.method, 'PUT') + onJsonReq(req, function (json) { + t.deepEqual(json, { + permissions: PARAMS.permissions, + package: PARAMS.package + }) + res.statusCode = 201 + res.json({ accessChanged: true }) + }) + }) + client.access('grant', URI, PARAMS, function (error, data) { + t.ifError(error, 'no errors') + t.ok(data.accessChanged, 'access level set') + t.end() + }) +}) + +test('access grant basic unscoped', function (t) { + server.expect('PUT', '/-/team/myorg/myteam/package', function (req, res) { + t.equal(req.method, 'PUT') + onJsonReq(req, function (json) { + t.deepEqual(json, { + permissions: UNSCOPED.permissions, + package: UNSCOPED.package + }) + res.statusCode = 201 + res.json({ accessChanged: true }) + }) + }) + client.access('grant', URI, UNSCOPED, function (error, data) { + t.ifError(error, 'no errors') + t.ok(data.accessChanged, 'access level set') + t.end() + }) +}) + +test('access revoke basic', function (t) { + server.expect('DELETE', '/-/team/myorg/myteam/package', function (req, res) { + t.equal(req.method, 'DELETE') + onJsonReq(req, function (json) { + t.deepEqual(json, { + package: PARAMS.package + }) + res.statusCode = 200 + res.json({ accessChanged: true }) + }) + }) + client.access('revoke', URI, PARAMS, function (error, data) { + t.ifError(error, 'no errors') + t.ok(data.accessChanged, 'access level set') + t.end() + }) +}) + +test('access revoke basic unscoped', function (t) { + server.expect('DELETE', '/-/team/myorg/myteam/package', function (req, res) { + t.equal(req.method, 'DELETE') + onJsonReq(req, function (json) { + t.deepEqual(json, { + package: UNSCOPED.package + }) + res.statusCode = 200 + res.json({ accessChanged: true }) + }) + }) + client.access('revoke', URI, UNSCOPED, function (error, data) { + t.ifError(error, 'no errors') + t.ok(data.accessChanged, 'access level set') + t.end() + }) +}) + +test('ls-packages on team', function (t) { + var serverPackages = { + '@foo/bar': 'write', + '@foo/util': 'read' + } + var clientPackages = { + '@foo/bar': 'read-write', + '@foo/util': 'read-only' + } + var uri = '/-/team/myorg/myteam/package?format=cli' + server.expect('GET', uri, function (req, res) { + t.equal(req.method, 'GET') + res.statusCode = 200 + res.json(serverPackages) + }) + client.access('ls-packages', URI, PARAMS, function (error, data) { + t.ifError(error, 'no errors') + t.same(data, clientPackages) + t.end() + }) +}) + +test('ls-packages on org', function (t) { + var serverPackages = { + '@foo/bar': 'write', + '@foo/util': 'read' + } + var clientPackages = { + '@foo/bar': 'read-write', + '@foo/util': 'read-only' + } + var uri = '/-/org/myorg/package?format=cli' + server.expect('GET', uri, function (req, res) { + t.equal(req.method, 'GET') + res.statusCode = 200 + res.json(serverPackages) + }) + var params = Object.create(PARAMS) + params.team = null + client.access('ls-packages', URI, params, function (error, data) { + t.ifError(error, 'no errors') + t.same(data, clientPackages) + t.end() + }) +}) + +test('ls-packages on user', function (t) { + var serverPackages = { + '@foo/bar': 'write', + '@foo/util': 'read' + } + var clientPackages = { + '@foo/bar': 'read-write', + '@foo/util': 'read-only' + } + var firstUri = '/-/org/myorg/package?format=cli' + server.expect('GET', firstUri, function (req, res) { + t.equal(req.method, 'GET') + res.statusCode = 404 + res.json({error: 'not found'}) + }) + var secondUri = '/-/user/myorg/package?format=cli' + server.expect('GET', secondUri, function (req, res) { + t.equal(req.method, 'GET') + res.statusCode = 200 + res.json(serverPackages) + }) + var params = Object.create(PARAMS) + params.team = null + client.access('ls-packages', URI, params, function (error, data) { + t.ifError(error, 'no errors') + t.same(data, clientPackages) + t.end() + }) +}) + +test('ls-collaborators', function (t) { + var serverCollaborators = { + 'myorg:myteam': 'write', + 'myorg:anotherteam': 'read' + } + var clientCollaborators = { + 'myorg:myteam': 'read-write', + 'myorg:anotherteam': 'read-only' + } + var uri = '/-/package/%40foo%2Fbar/collaborators?format=cli' + server.expect('GET', uri, function (req, res) { + t.equal(req.method, 'GET') + res.statusCode = 200 + res.json(serverCollaborators) + }) + client.access('ls-collaborators', URI, PARAMS, function (error, data) { + t.ifError(error, 'no errors') + t.same(data, clientCollaborators) + t.end() + }) +}) + +test('ls-collaborators w/scope', function (t) { + var serverCollaborators = { + 'myorg:myteam': 'write', + 'myorg:anotherteam': 'read' + } + var clientCollaborators = { + 'myorg:myteam': 'read-write', + 'myorg:anotherteam': 'read-only' + } + var uri = '/-/package/%40foo%2Fbar/collaborators?format=cli&user=zkat' + server.expect('GET', uri, function (req, res) { + t.equal(req.method, 'GET') + res.statusCode = 200 + res.json(serverCollaborators) + }) + var params = Object.create(PARAMS) + params.user = 'zkat' + client.access('ls-collaborators', URI, params, function (error, data) { + t.ifError(error, 'no errors') + t.same(data, clientCollaborators) + t.end() + }) +}) + +test('ls-collaborators w/o scope', function (t) { + var serverCollaborators = { + 'myorg:myteam': 'write', + 'myorg:anotherteam': 'read' + } + var clientCollaborators = { + 'myorg:myteam': 'read-write', + 'myorg:anotherteam': 'read-only' + } + var uri = '/-/package/bar/collaborators?format=cli&user=zkat' + server.expect('GET', uri, function (req, res) { + t.equal(req.method, 'GET') + res.statusCode = 200 + res.json(serverCollaborators) + }) + var params = Object.create(UNSCOPED) + params.user = 'zkat' + client.access('ls-collaborators', URI, params, function (error, data) { + t.ifError(error, 'no errors') + t.same(data, clientCollaborators) + t.end() + }) +}) + +test('access command base validation', function (t) { + t.throws(function () { + client.access(undefined, URI, PARAMS, nop) + }, 'command is required') + t.throws(function () { + client.access('whoops', URI, PARAMS, nop) + }, 'command must be a valid subcommand') + commands.forEach(function (cmd) { + t.throws(function () { + client.access(cmd, undefined, PARAMS, nop) + }, 'registry URI is required') + t.throws(function () { + client.access(cmd, URI, undefined, nop) + }, 'params is required') + t.throws(function () { + client.access(cmd, URI, '', nop) + }, 'params must be an object') + t.throws(function () { + client.access(cmd, URI, {scope: 'o', team: 't'}, nop) + }, 'auth is required') + t.throws(function () { + client.access(cmd, URI, {auth: 5, scope: 'o', team: 't'}, nop) + }, 'auth must be an object') + t.throws(function () { + client.access(cmd, URI, PARAMS, {}) + }, 'callback must be a function') + t.throws(function () { + client.access(cmd, URI, PARAMS, undefined) + }, 'callback is required') + if (contains([ + 'public', 'restricted' + ], cmd)) { + t.throws(function () { + var params = Object.create(PARAMS) + params.package = null + client.access(cmd, URI, params, nop) + }, 'package is required') + t.throws(function () { + var params = Object.create(PARAMS) + params.package = 'underscore' + client.access(cmd, URI, params, nop) + }, 'only scoped packages are allowed') + } + if (contains(['grant', 'revoke', 'ls-packages'], cmd)) { + t.throws(function () { + var params = Object.create(PARAMS) + params.scope = null + client.access(cmd, URI, params, nop) + }, 'scope is required') + } + if (contains(['grant', 'revoke'], cmd)) { + t.throws(function () { + var params = Object.create(PARAMS) + params.team = null + client.access(cmd, URI, params, nop) + }, 'team is required') + } + if (cmd === 'grant') { + t.throws(function () { + var params = Object.create(PARAMS) + params.permissions = null + client.access(cmd, URI, params, nop) + }, 'permissions are required') + t.throws(function () { + var params = Object.create(PARAMS) + params.permissions = 'idkwhat' + client.access(cmd, URI, params, nop) + }, 'permissions must be either read-only or read-write') + } + }) + t.end() +}) + +test('cleanup', function (t) { + server.close() + t.end() +}) + +function onJsonReq (req, cb) { + var buffer = '' + req.setEncoding('utf8') + req.on('data', function (data) { buffer += data }) + req.on('end', function () { cb(buffer ? JSON.parse(buffer) : undefined) }) +} + +function contains (arr, item) { + return arr.indexOf(item) !== -1 +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/adduser-new.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/adduser-new.js new file mode 100644 index 00000000..a834841d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/adduser-new.js @@ -0,0 +1,58 @@ +var tap = require('tap') + +var server = require('./lib/server.js') +var common = require('./lib/common.js') +var client = common.freshClient() + +var password = '%1234@asdf%' +var username = 'username' +var email = 'i@izs.me' +var userdata = { + name: username, + email: email, + _id: 'org.couchdb.user:username', + type: 'user', + roles: [], + date: '2012-06-07T04:11:21.591Z' +} + +var SD = require('string_decoder').StringDecoder +var decoder = new SD() + +tap.test('create new user account', function (t) { + var auth = { + username: username, + password: password, + email: email + } + var params = { auth: auth } + + server.expect('/registry/_design/app/_rewrite/-/user/org.couchdb.user:username', function (req, res) { + t.equal(req.method, 'PUT') + var b = '' + req.on('data', function (d) { + b += decoder.write(d) + }) + + req.on('end', function () { + var o = JSON.parse(b) + userdata.password = password + userdata.date = o.date + t.deepEqual(o, userdata) + + res.statusCode = 201 + res.json(auth) + }) + }) + + client.adduser( + 'http://localhost:1337/registry/_design/app/_rewrite', + params, + function (er, data) { + if (er) throw er + t.deepEqual(data, auth, 'received expected auth data') + server.close() + t.end() + } + ) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/adduser-update.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/adduser-update.js new file mode 100644 index 00000000..03d5f468 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/adduser-update.js @@ -0,0 +1,68 @@ +var tap = require('tap') + +var server = require('./lib/server.js') +var common = require('./lib/common.js') +var client = common.freshClient() + +var password = '%1234@asdf%' +var username = 'username' +var email = 'i@izs.me' +var userdata = { + name: username, + email: email, + _id: 'org.couchdb.user:username', + type: 'user', + roles: [], + date: '2012-06-07T04:11:21.591Z' } +var SD = require('string_decoder').StringDecoder +var decoder = new SD() + +tap.test('update a user acct', function (t) { + var auth = { + username: username, + password: password, + email: email + } + var params = { auth: auth } + + server.expect('PUT', '/-/user/org.couchdb.user:username', function (req, res) { + t.equal(req.method, 'PUT') + res.statusCode = 409 + res.json({error: 'conflict'}) + }) + + server.expect('GET', '/-/user/org.couchdb.user:username?write=true', function (req, res) { + t.equal(req.method, 'GET') + res.json(userdata) + }) + + server.expect('PUT', '/-/user/org.couchdb.user:username/-rev/' + userdata._rev, function (req, res) { + t.equal(req.method, 'PUT') + + var b = '' + req.on('data', function (d) { + b += decoder.write(d) + }) + + req.on('end', function () { + var o = JSON.parse(b) + userdata.password = password + userdata.date = o.date + t.deepEqual(o, userdata) + + res.statusCode = 201 + res.json(auth) + }) + }) + + client.adduser( + 'http://localhost:1337/', + params, + function (er, data) { + if (er) throw er + t.deepEqual(data, auth, 'got expected auth data') + server.close() + t.end() + } + ) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/adduser.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/adduser.js new file mode 100644 index 00000000..10816ebf --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/adduser.js @@ -0,0 +1,162 @@ +var test = require('tap').test + +var server = require('./lib/server.js') +var common = require('./lib/common.js') +var client = common.freshClient() + +function nop () {} + +var URI = 'https://npm.registry:8043/rewrite' +var USERNAME = 'username' +var PASSWORD = 'password' +var EMAIL = 'n@p.m' +var AUTH = { + auth: { + username: USERNAME, + password: PASSWORD, + email: EMAIL + } +} + +test('adduser call contract', function (t) { + t.throws(function () { + client.adduser(undefined, AUTH, nop) + }, 'requires a URI') + + t.throws(function () { + client.adduser([], AUTH, nop) + }, 'requires URI to be a string') + + t.throws(function () { + client.adduser(URI, undefined, nop) + }, 'requires params object') + + t.throws(function () { + client.adduser(URI, '', nop) + }, 'params must be object') + + t.throws(function () { + client.adduser(URI, AUTH, undefined) + }, 'requires callback') + + t.throws(function () { + client.adduser(URI, AUTH, 'callback') + }, 'callback must be function') + + t.throws( + function () { + var params = { + auth: { + password: PASSWORD, + email: EMAIL + } + } + client.adduser(URI, params, nop) + }, + { name: 'AssertionError', message: 'must include username in auth' }, + 'auth must include username' + ) + + t.throws( + function () { + var params = { + auth: { + username: USERNAME, + email: EMAIL + } + } + client.adduser(URI, params, nop) + }, + { name: 'AssertionError', message: 'must include password in auth' }, + 'auth must include password' + ) + + t.throws( + function () { + var params = { + auth: { + username: USERNAME, + password: PASSWORD + } + } + client.adduser(URI, params, nop) + }, + { name: 'AssertionError', message: 'must include email in auth' }, + 'auth must include email' + ) + + t.test('username missing', function (t) { + var params = { + auth: { + username: '', + password: PASSWORD, + email: EMAIL + } + } + client.adduser(URI, params, function (err) { + t.equal(err && err.message, 'No username supplied.', 'username must not be empty') + t.end() + }) + }) + + t.test('password missing', function (t) { + var params = { + auth: { + username: USERNAME, + password: '', + email: EMAIL + } + } + client.adduser(URI, params, function (err) { + t.equal( + err && err.message, + 'No password supplied.', + 'password must not be empty' + ) + t.end() + }) + }) + + t.test('email missing', function (t) { + var params = { + auth: { + username: USERNAME, + password: PASSWORD, + email: '' + } + } + client.adduser(URI, params, function (err) { + t.equal( + err && err.message, + 'No email address supplied.', + 'email must not be empty' + ) + t.end() + }) + }) + + t.test('email malformed', function (t) { + var params = { + auth: { + username: USERNAME, + password: PASSWORD, + email: 'lolbutts' + } + } + client.adduser(URI, params, function (err) { + t.equal( + err && err.message, + 'Please use a real email address.', + 'email must look like email' + ) + t.end() + }) + }) + + t.end() +}) + +test('cleanup', function (t) { + server.close() + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/config-defaults.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/config-defaults.js new file mode 100644 index 00000000..ca6983a1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/config-defaults.js @@ -0,0 +1,42 @@ +var test = require('tap').test + +require('./lib/server.js').close() +var common = require('./lib/common.js') + +test('config defaults', function (t) { + var client = common.freshClient() + + var proxy = client.config.proxy + t.notOk(proxy.http, 'no default value for HTTP proxy') + t.notOk(proxy.https, 'no default value for HTTPS proxy') + t.notOk(proxy.localAddress, 'no default value for local address') + + var ssl = client.config.ssl + t.notOk(ssl.ca, 'no default value for SSL certificate authority bundle') + t.notOk(ssl.certificate, 'no default value for SSL client certificate') + t.notOk(ssl.key, 'no default value for SSL client certificate key') + t.equal(ssl.strict, true, 'SSL is strict by default') + + var retry = client.config.retry + t.equal(retry.retries, 2, 'default retry count is 2') + t.equal(retry.factor, 10, 'default retry factor is 10') + t.equal(retry.minTimeout, 10000, 'retry minimum timeout is 10000 (10 seconds)') + t.equal(retry.maxTimeout, 60000, 'retry maximum timeout is 60000 (60 seconds)') + + t.equal(client.config.userAgent, 'node/' + process.version, 'default userAgent') + t.ok(client.log.info, "there's a default logger") + t.equal(client.config.defaultTag, 'latest', 'default tag is "latest"') + t.notOk(client.config.couchToken, 'no couchToken by default') + t.notOk(client.config.sessionToken, 'no sessionToken by default') + + t.end() +}) + +test('missing HTTPS proxy defaults to HTTP proxy', function (t) { + var client = common.freshClient({ proxy: { http: 'http://proxy.npm:8088/' } }) + + t.equal(client.config.proxy.http, 'http://proxy.npm:8088/', 'HTTP proxy set') + t.equal(client.config.proxy.http, client.config.proxy.https, 'HTTP === HTTPS') + + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/config-override.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/config-override.js new file mode 100644 index 00000000..026cb199 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/config-override.js @@ -0,0 +1,57 @@ +var test = require('tap').test + +require('./lib/server.js').close() +var common = require('./lib/common.js') +var config = { + proxy: { + http: 'http://proxy.npm:8088/', + https: 'https://proxy.npm:8043/', + localAddress: 'localhost.localdomain' + }, + ssl: { + ca: 'not including a PEM', + certificate: 'still not including a PEM', + key: 'nope', + strict: false + }, + retry: { + count: 1, + factor: 9001, + minTimeout: -1, + maxTimeout: Infinity + }, + userAgent: 'npm-awesome/4 (Mozilla 5.0)', + log: { fake: function () {} }, + defaultTag: 'next', + couchToken: { object: true }, + sessionToken: 'hamchunx' +} + +test('config defaults', function (t) { + var client = common.freshClient(config) + + var proxy = client.config.proxy + t.equal(proxy.http, 'http://proxy.npm:8088/') + t.equal(proxy.https, 'https://proxy.npm:8043/') + t.equal(proxy.localAddress, 'localhost.localdomain') + + var ssl = client.config.ssl + t.equal(ssl.ca, 'not including a PEM') + t.equal(ssl.certificate, 'still not including a PEM') + t.equal(ssl.key, 'nope') + t.equal(ssl.strict, false) + + var retry = client.config.retry + t.equal(retry.count, 1) + t.equal(retry.factor, 9001) + t.equal(retry.minTimeout, -1) + t.equal(retry.maxTimeout, Infinity) + + t.equal(client.config.userAgent, 'npm-awesome/4 (Mozilla 5.0)') + t.ok(client.log.fake) + t.equal(client.config.defaultTag, 'next') + t.ok(client.config.couchToken.object) + t.equal(client.config.sessionToken, 'hamchunx') + + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/deprecate.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/deprecate.js new file mode 100644 index 00000000..4407d7c9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/deprecate.js @@ -0,0 +1,216 @@ +var test = require('tap').test + +var server = require('./lib/server.js') +var common = require('./lib/common.js') +var cache = require('./fixtures/underscore/cache.json') + +var client = common.freshClient() + +function nop () {} + +var URI = 'https://npm.registry:8043/rewrite' +var VERSION = '1.3.2' +var MESSAGE = 'uhhh' +var TOKEN = 'lolbutts' +var AUTH = { + token: TOKEN +} +var PARAMS = { + version: VERSION, + message: MESSAGE, + auth: AUTH +} + +test('deprecate call contract', function (t) { + t.throws(function () { + client.deprecate(undefined, PARAMS, nop) + }, 'requires a URI') + + t.throws(function () { + client.deprecate([], PARAMS, nop) + }, 'requires URI to be a string') + + t.throws(function () { + client.deprecate(URI, undefined, nop) + }, 'requires params object') + + t.throws(function () { + client.deprecate(URI, '', nop) + }, 'params must be object') + + t.throws(function () { + client.deprecate(URI, PARAMS, undefined) + }, 'requires callback') + + t.throws(function () { + client.deprecate(URI, PARAMS, 'callback') + }, 'callback must be function') + + t.throws( + function () { + var params = { + message: MESSAGE, + auth: AUTH + } + client.deprecate(URI, params, nop) + }, + { name: 'AssertionError', message: 'must pass version to deprecate' }, + 'params must include version to deprecate' + ) + + t.throws( + function () { + var params = { + version: VERSION, + auth: AUTH + } + client.deprecate(URI, params, nop) + }, + { name: 'AssertionError', message: 'must pass message to deprecate' }, + 'params must include deprecation message' + ) + + t.throws( + function () { + var params = { + version: VERSION, + message: MESSAGE + } + client.deprecate(URI, params, nop) + }, + { name: 'AssertionError', message: 'must pass auth to deprecate' }, + 'params must include auth' + ) + + t.test('malformed semver in deprecation', function (t) { + var params = { + version: '-9001', + message: MESSAGE, + auth: AUTH + } + client.deprecate(URI, params, function (err) { + t.equal( + err && err.message, + 'invalid version range: -9001', + 'got expected semver validation failure' + ) + t.end() + }) + }) + + t.end() +}) + +test('deprecate a package', function (t) { + server.expect('GET', '/underscore?write=true', function (req, res) { + t.equal(req.method, 'GET') + + res.json(cache) + }) + + server.expect('PUT', '/underscore', function (req, res) { + t.equal(req.method, 'PUT') + + var b = '' + req.setEncoding('utf8') + req.on('data', function (d) { + b += d + }) + + req.on('end', function () { + var updated = JSON.parse(b) + + var undeprecated = [ + '1.0.3', '1.0.4', '1.1.0', '1.1.1', '1.1.2', '1.1.3', '1.1.4', '1.1.5', '1.1.6', + '1.1.7', '1.2.0', '1.2.1', '1.2.2', '1.2.3', '1.2.4', '1.3.0', '1.3.1', '1.3.3' + ] + for (var i = 0; i < undeprecated.length; i++) { + var current = undeprecated[i] + t.notEqual( + updated.versions[current].deprecated, + MESSAGE, + current + ' not deprecated' + ) + } + + t.equal( + updated.versions[VERSION].deprecated, + MESSAGE, + VERSION + ' deprecated' + ) + res.statusCode = 201 + res.json({ deprecated: true }) + }) + }) + + client.deprecate( + common.registry + '/underscore', + PARAMS, + function (er, data) { + t.ifError(er) + t.ok(data.deprecated, 'was deprecated') + + t.end() + } + ) +}) + +test('deprecate a scoped package', function (t) { + server.expect('GET', '/@test%2funderscore?write=true', function (req, res) { + t.equal(req.method, 'GET') + + res.json(cache) + }) + + server.expect('PUT', '/@test%2funderscore', function (req, res) { + t.equal(req.method, 'PUT') + + var b = '' + req.setEncoding('utf8') + req.on('data', function (d) { + b += d + }) + + req.on('end', function () { + var updated = JSON.parse(b) + + var undeprecated = [ + '1.0.3', '1.0.4', '1.1.0', '1.1.1', '1.1.2', '1.1.3', '1.1.4', '1.1.5', '1.1.6', + '1.1.7', '1.2.0', '1.2.1', '1.2.2', '1.2.3', '1.2.4', '1.3.0', '1.3.1', '1.3.3' + ] + for (var i = 0; i < undeprecated.length; i++) { + var current = undeprecated[i] + t.notEqual( + updated.versions[current].deprecated, + MESSAGE, + current + ' not deprecated' + ) + } + + t.equal( + updated.versions[VERSION].deprecated, + MESSAGE, + VERSION + ' deprecated' + ) + res.statusCode = 201 + res.json({ deprecated: true }) + }) + }) + + client.deprecate( + common.registry + '/@test%2funderscore', + PARAMS, + function (er, data) { + t.ifError(er) + t.ok(data.deprecated, 'was deprecated') + + t.end() + } + ) +}) + +test('cleanup', function (t) { + server.close() + t.ok(true) + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/dist-tags-add.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/dist-tags-add.js new file mode 100644 index 00000000..00f43b0f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/dist-tags-add.js @@ -0,0 +1,142 @@ +var test = require('tap').test + +var server = require('./lib/server.js') +var common = require('./lib/common.js') +var client = common.freshClient() + +function nop () {} + +var BASE_URL = 'http://localhost:1337/' +var URI = '/-/package/underscore/dist-tags/test' +var TOKEN = 'foo' +var AUTH = { + token: TOKEN +} +var PACKAGE = 'underscore' +var DIST_TAG = 'test' +var VERSION = '3.1.3' +var PARAMS = { + 'package': PACKAGE, + distTag: DIST_TAG, + version: VERSION, + auth: AUTH +} + +test('distTags.add call contract', function (t) { + t.throws(function () { + client.distTags.add(undefined, AUTH, nop) + }, 'requires a URI') + + t.throws(function () { + client.distTags.add([], PARAMS, nop) + }, 'requires URI to be a string') + + t.throws(function () { + client.distTags.add(BASE_URL, undefined, nop) + }, 'requires params object') + + t.throws(function () { + client.distTags.add(BASE_URL, '', nop) + }, 'params must be object') + + t.throws(function () { + client.distTags.add(BASE_URL, PARAMS, undefined) + }, 'requires callback') + + t.throws(function () { + client.distTags.add(BASE_URL, PARAMS, 'callback') + }, 'callback must be function') + + t.throws( + function () { + var params = { + distTag: DIST_TAG, + version: VERSION, + auth: AUTH + } + client.distTags.add(BASE_URL, params, nop) + }, + { + name: 'AssertionError', + message: 'must pass package name to distTags.add' + }, + 'distTags.add must include package name' + ) + + t.throws( + function () { + var params = { + 'package': PACKAGE, + version: VERSION, + auth: AUTH + } + client.distTags.add(BASE_URL, params, nop) + }, + { + name: 'AssertionError', + message: 'must pass package distTag name to distTags.add' + }, + 'distTags.add must include dist-tag' + ) + + t.throws( + function () { + var params = { + 'package': PACKAGE, + distTag: DIST_TAG, + auth: AUTH + } + client.distTags.add(BASE_URL, params, nop) + }, + { + name: 'AssertionError', + message: 'must pass version to be mapped to distTag to distTags.add' + }, + 'distTags.add must include version' + ) + + t.throws( + function () { + var params = { + 'package': PACKAGE, + distTag: DIST_TAG, + version: VERSION + } + client.distTags.add(BASE_URL, params, nop) + }, + { name: 'AssertionError', message: 'must pass auth to distTags.add' }, + 'distTags.add must include auth' + ) + + t.end() +}) + +test('add a new dist-tag to a package', function (t) { + server.expect('PUT', URI, function (req, res) { + t.equal(req.method, 'PUT') + + var b = '' + req.setEncoding('utf8') + req.on('data', function (d) { + b += d + }) + + req.on('end', function () { + t.doesNotThrow(function () { + var parsed = JSON.parse(b) + t.deepEqual(parsed, VERSION) + + res.statusCode = 200 + res.json({ test: VERSION }) + }, 'got valid JSON from client') + }) + }) + + client.distTags.add(BASE_URL, PARAMS, function (error, data) { + t.ifError(error, 'no errors') + t.ok(data.test, 'dist-tag added') + + server.close() + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/dist-tags-fetch.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/dist-tags-fetch.js new file mode 100644 index 00000000..cde338cf --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/dist-tags-fetch.js @@ -0,0 +1,99 @@ +var test = require('tap').test + +var server = require('./lib/server.js') +var common = require('./lib/common.js') +var client = common.freshClient() + +function nop () {} + +var BASE_URL = 'http://localhost:1337/' +var URI = '/-/package/underscore/dist-tags' +var TOKEN = 'foo' +var AUTH = { + token: TOKEN +} +var PACKAGE = 'underscore' +var PARAMS = { + 'package': PACKAGE, + auth: AUTH +} + +test('distTags.fetch call contract', function (t) { + t.throws(function () { + client.distTags.fetch(undefined, AUTH, nop) + }, 'requires a URI') + + t.throws(function () { + client.distTags.fetch([], PARAMS, nop) + }, 'requires URI to be a string') + + t.throws(function () { + client.distTags.fetch(BASE_URL, undefined, nop) + }, 'requires params object') + + t.throws(function () { + client.distTags.fetch(BASE_URL, '', nop) + }, 'params must be object') + + t.throws(function () { + client.distTags.fetch(BASE_URL, PARAMS, undefined) + }, 'requires callback') + + t.throws(function () { + client.distTags.fetch(BASE_URL, PARAMS, 'callback') + }, 'callback must be function') + + t.throws( + function () { + var params = { + auth: AUTH + } + client.distTags.fetch(BASE_URL, params, nop) + }, + { + name: 'AssertionError', + message: 'must pass package name to distTags.fetch' + }, + 'distTags.fetch must include package name' + ) + + t.throws( + function () { + var params = { + 'package': PACKAGE + } + client.distTags.fetch(BASE_URL, params, nop) + }, + { name: 'AssertionError', message: 'must pass auth to distTags.fetch' }, + 'distTags.fetch must include auth' + ) + + t.end() +}) + +test('fetch dist-tags for a package', function (t) { + server.expect('GET', URI, function (req, res) { + t.equal(req.method, 'GET') + + var b = '' + req.setEncoding('utf8') + req.on('data', function (d) { + b += d + }) + + req.on('end', function () { + t.notOk(b, 'no request body') + + res.statusCode = 200 + res.json({ a: '1.0.0', b: '2.0.0', _etag: 'xxx' }) + }) + }) + + client.distTags.fetch(BASE_URL, PARAMS, function (error, data) { + t.ifError(error, 'no errors') + t.same(data, { a: '1.0.0', b: '2.0.0' }, 'etag filtered from response') + + server.close() + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/dist-tags-rm.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/dist-tags-rm.js new file mode 100644 index 00000000..2076eb93 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/dist-tags-rm.js @@ -0,0 +1,118 @@ +var test = require('tap').test + +var server = require('./lib/server.js') +var common = require('./lib/common.js') +var client = common.freshClient() + +function nop () {} + +var BASE_URL = 'http://localhost:1337/' +var URI = '/-/package/underscore/dist-tags/test' +var TOKEN = 'foo' +var AUTH = { + token: TOKEN +} +var PACKAGE = 'underscore' +var DIST_TAG = 'test' +var PARAMS = { + 'package': PACKAGE, + distTag: DIST_TAG, + auth: AUTH +} + +test('distTags.rm call contract', function (t) { + t.throws(function () { + client.distTags.rm(undefined, AUTH, nop) + }, 'requires a URI') + + t.throws(function () { + client.distTags.rm([], PARAMS, nop) + }, 'requires URI to be a string') + + t.throws(function () { + client.distTags.rm(BASE_URL, undefined, nop) + }, 'requires params object') + + t.throws(function () { + client.distTags.rm(BASE_URL, '', nop) + }, 'params must be object') + + t.throws(function () { + client.distTags.rm(BASE_URL, PARAMS, undefined) + }, 'requires callback') + + t.throws(function () { + client.distTags.rm(BASE_URL, PARAMS, 'callback') + }, 'callback must be function') + + t.throws( + function () { + var params = { + distTag: DIST_TAG, + auth: AUTH + } + client.distTags.rm(BASE_URL, params, nop) + }, + { + name: 'AssertionError', + message: 'must pass package name to distTags.rm' + }, + 'distTags.rm must include package name' + ) + + t.throws( + function () { + var params = { + 'package': PACKAGE, + auth: AUTH + } + client.distTags.rm(BASE_URL, params, nop) + }, + { + name: 'AssertionError', + message: 'must pass package distTag name to distTags.rm' + }, + 'distTags.rm must include dist-tag' + ) + + t.throws( + function () { + var params = { + 'package': PACKAGE, + distTag: DIST_TAG + } + client.distTags.rm(BASE_URL, params, nop) + }, + { name: 'AssertionError', message: 'must pass auth to distTags.rm' }, + 'distTags.rm must include auth' + ) + + t.end() +}) + +test('remove a dist-tag from a package', function (t) { + server.expect('DELETE', URI, function (req, res) { + t.equal(req.method, 'DELETE') + + var b = '' + req.setEncoding('utf8') + req.on('data', function (d) { + b += d + }) + + req.on('end', function () { + t.notOk(b, 'got no message body') + + res.statusCode = 200 + res.json({}) + }) + }) + + client.distTags.rm(BASE_URL, PARAMS, function (error, data) { + t.ifError(error, 'no errors') + t.notOk(data.test, 'dist-tag removed') + + server.close() + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/dist-tags-set.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/dist-tags-set.js new file mode 100644 index 00000000..cb595f6d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/dist-tags-set.js @@ -0,0 +1,122 @@ +var test = require('tap').test + +var server = require('./lib/server.js') +var common = require('./lib/common.js') +var client = common.freshClient() + +function nop () {} + +var BASE_URL = 'http://localhost:1337/' +var URI = '/-/package/underscore/dist-tags' +var TOKEN = 'foo' +var AUTH = { + token: TOKEN +} +var PACKAGE = 'underscore' +var DIST_TAGS = { + 'a': '8.0.8', + 'b': '3.0.3' +} +var PARAMS = { + 'package': PACKAGE, + distTags: DIST_TAGS, + auth: AUTH +} + +test('distTags.set call contract', function (t) { + t.throws(function () { + client.distTags.set(undefined, AUTH, nop) + }, 'requires a URI') + + t.throws(function () { + client.distTags.set([], PARAMS, nop) + }, 'requires URI to be a string') + + t.throws(function () { + client.distTags.set(BASE_URL, undefined, nop) + }, 'requires params object') + + t.throws(function () { + client.distTags.set(BASE_URL, '', nop) + }, 'params must be object') + + t.throws(function () { + client.distTags.set(BASE_URL, PARAMS, undefined) + }, 'requires callback') + + t.throws(function () { + client.distTags.set(BASE_URL, PARAMS, 'callback') + }, 'callback must be function') + + t.throws( + function () { + var params = { + distTags: DIST_TAGS, + auth: AUTH + } + client.distTags.set(BASE_URL, params, nop) + }, + { + name: 'AssertionError', + message: 'must pass package name to distTags.set' + }, + 'distTags.set must include package name' + ) + + t.throws( + function () { + var params = { + 'package': PACKAGE, + auth: AUTH + } + client.distTags.set(BASE_URL, params, nop) + }, + { + name: 'AssertionError', + message: 'must pass distTags map to distTags.set' + }, + 'distTags.set must include dist-tags' + ) + + t.throws( + function () { + var params = { + 'package': PACKAGE, + distTags: DIST_TAGS + } + client.distTags.set(BASE_URL, params, nop) + }, + { name: 'AssertionError', message: 'must pass auth to distTags.set' }, + 'distTags.set must include auth' + ) + + t.end() +}) + +test('set dist-tags for a package', function (t) { + server.expect('PUT', URI, function (req, res) { + t.equal(req.method, 'PUT') + + var b = '' + req.setEncoding('utf8') + req.on('data', function (d) { + b += d + }) + + req.on('end', function () { + var d = JSON.parse(b) + t.deepEqual(d, DIST_TAGS, 'got back tags') + + res.statusCode = 200 + res.json(DIST_TAGS) + }) + }) + + client.distTags.set(BASE_URL, PARAMS, function (error, data) { + t.ifError(error, 'no errors') + t.ok(data.a && data.b, 'dist-tags set') + + server.close() + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/dist-tags-update.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/dist-tags-update.js new file mode 100644 index 00000000..37508fc0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/dist-tags-update.js @@ -0,0 +1,113 @@ +var test = require('tap').test + +var server = require('./lib/server.js') +var common = require('./lib/common.js') +var client = common.freshClient() + +function nop () {} + +var BASE_URL = 'http://localhost:1337/' +var URI = '/-/package/underscore/dist-tags' +var TOKEN = 'foo' +var AUTH = { + token: TOKEN +} +var PACKAGE = 'underscore' +var DIST_TAGS = { + 'a': '8.0.8', + 'b': '3.0.3' +} +var PARAMS = { + 'package': PACKAGE, + distTags: DIST_TAGS, + auth: AUTH +} + +test('distTags.update call contract', function (t) { + t.throws(function () { + client.distTags.update(undefined, AUTH, nop) + }, 'requires a URI') + + t.throws(function () { + client.distTags.update([], PARAMS, nop) + }, 'requires URI to be a string') + + t.throws(function () { + client.distTags.update(BASE_URL, undefined, nop) + }, 'requires params object') + + t.throws(function () { + client.distTags.update(BASE_URL, '', nop) + }, 'params must be object') + + t.throws(function () { + client.distTags.update(BASE_URL, PARAMS, undefined) + }, 'requires callback') + + t.throws(function () { + client.distTags.update(BASE_URL, PARAMS, 'callback') + }, 'callback must be function') + + t.throws( + function () { + var params = { distTags: DIST_TAGS, auth: AUTH } + client.distTags.update(BASE_URL, params, nop) + }, + { + name: 'AssertionError', + message: 'must pass package name to distTags.update' + }, + 'distTags.update must include package name' + ) + + t.throws( + function () { + var params = { 'package': PACKAGE, auth: AUTH } + client.distTags.update(BASE_URL, params, nop) + }, + { + name: 'AssertionError', + message: 'must pass distTags map to distTags.update' + }, + 'distTags.update must include dist-tags' + ) + + t.throws( + function () { + var params = { 'package': PACKAGE, distTags: DIST_TAGS } + client.distTags.update(BASE_URL, params, nop) + }, + { name: 'AssertionError', message: 'must pass auth to distTags.update' }, + 'distTags.update must include auth' + ) + + t.end() +}) + +test('update dist-tags for a package', function (t) { + server.expect('POST', URI, function (req, res) { + t.equal(req.method, 'POST') + + var b = '' + req.setEncoding('utf8') + req.on('data', function (d) { + b += d + }) + + req.on('end', function () { + var d = JSON.parse(b) + t.deepEqual(d, DIST_TAGS, 'got back tags') + + res.statusCode = 200 + res.json(DIST_TAGS) + }) + }) + + client.distTags.update(BASE_URL, PARAMS, function (error, data) { + t.ifError(error, 'no errors') + t.ok(data.a && data.b, 'dist-tags set') + + server.close() + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/fetch-404.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/fetch-404.js new file mode 100644 index 00000000..fa400cd5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/fetch-404.js @@ -0,0 +1,35 @@ +var resolve = require('path').resolve +var createReadStream = require('graceful-fs').createReadStream + +var tap = require('tap') + +var server = require('./lib/server.js') +var common = require('./lib/common.js') + +var tgz = resolve(__dirname, './fixtures/underscore/1.3.3/package.tgz') + +tap.test('fetch with a 404 response', function (t) { + server.expect('/underscore/-/underscore-1.3.3.tgz', function (req, res) { + t.equal(req.method, 'GET', 'got expected method') + + res.writeHead(404) + + createReadStream(tgz).pipe(res) + }) + + var client = common.freshClient() + var defaulted = {} + client.fetch( + 'http://localhost:1337/underscore/-/underscore-1.3.3.tgz', + defaulted, + function (err, res) { + t.equal( + err.message, + 'fetch failed with status code 404', + 'got expected error message' + ) + server.close() + t.end() + } + ) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/fetch-408.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/fetch-408.js new file mode 100644 index 00000000..422376ef --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/fetch-408.js @@ -0,0 +1,54 @@ +var resolve = require('path').resolve +var createReadStream = require('graceful-fs').createReadStream +var readFileSync = require('graceful-fs').readFileSync + +var tap = require('tap') +var cat = require('concat-stream') + +var server = require('./lib/server.js') +var common = require('./lib/common.js') + +var tgz = resolve(__dirname, './fixtures/underscore/1.3.3/package.tgz') + +tap.test('fetch with retry on timeout', function (t) { + server.expect('/underscore/-/underscore-1.3.3.tgz', function (req, res) { + t.equal(req.method, 'GET', 'got expected method') + + res.writeHead(408) + res.end() + }) + + server.expect('/underscore/-/underscore-1.3.3.tgz', function (req, res) { + t.equal(req.method, 'GET', 'got expected method') + + res.writeHead(200, { + 'content-type': 'application/x-tar', + 'content-encoding': 'gzip' + }) + + createReadStream(tgz).pipe(res) + }) + + var client = common.freshClient() + var defaulted = {} + client.config.retry.minTimeout = 100 + client.fetch( + 'http://localhost:1337/underscore/-/underscore-1.3.3.tgz', + defaulted, + function (er, res) { + t.ifError(er, 'loaded successfully') + + var sink = cat(function (data) { + t.deepEqual(data, readFileSync(tgz)) + server.close() + t.end() + }) + + res.on('error', function (error) { + t.ifError(error, 'no errors on stream') + }) + + res.pipe(sink) + } + ) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/fetch-503.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/fetch-503.js new file mode 100644 index 00000000..6dff1155 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/fetch-503.js @@ -0,0 +1,54 @@ +var resolve = require('path').resolve +var createReadStream = require('graceful-fs').createReadStream +var readFileSync = require('graceful-fs').readFileSync + +var tap = require('tap') +var cat = require('concat-stream') + +var server = require('./lib/server.js') +var common = require('./lib/common.js') + +var tgz = resolve(__dirname, './fixtures/underscore/1.3.3/package.tgz') + +tap.test('fetch with retry on server error', function (t) { + server.expect('/underscore/-/underscore-1.3.3.tgz', function (req, res) { + t.equal(req.method, 'GET', 'got expected method') + + res.writeHead(503) + res.end() + }) + + server.expect('/underscore/-/underscore-1.3.3.tgz', function (req, res) { + t.equal(req.method, 'GET', 'got expected method') + + res.writeHead(200, { + 'content-type': 'application/x-tar', + 'content-encoding': 'gzip' + }) + + createReadStream(tgz).pipe(res) + }) + + var client = common.freshClient() + var defaulted = {} + client.config.retry.minTimeout = 100 + client.fetch( + 'http://localhost:1337/underscore/-/underscore-1.3.3.tgz', + defaulted, + function (er, res) { + t.ifError(er, 'loaded successfully') + + var sink = cat(function (data) { + t.deepEqual(data, readFileSync(tgz)) + server.close() + t.end() + }) + + res.on('error', function (error) { + t.ifError(error, 'no errors on stream') + }) + + res.pipe(sink) + } + ) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/fetch-authed.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/fetch-authed.js new file mode 100644 index 00000000..d516deb3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/fetch-authed.js @@ -0,0 +1,58 @@ +var resolve = require('path').resolve +var createReadStream = require('graceful-fs').createReadStream +var readFileSync = require('graceful-fs').readFileSync + +var tap = require('tap') +var cat = require('concat-stream') + +var server = require('./lib/server.js') +var common = require('./lib/common.js') + +var tgz = resolve(__dirname, './fixtures/underscore/1.3.3/package.tgz') + +tap.test('basic fetch with scoped always-auth enabled', function (t) { + server.expect('/underscore/-/underscore-1.3.3.tgz', function (req, res) { + t.equal(req.method, 'GET', 'got expected method') + t.equal( + req.headers.authorization, + 'Basic dXNlcm5hbWU6JTEyMzRAYXNkZiU=', + 'got expected auth header' + ) + + res.writeHead(200, { + 'content-type': 'application/x-tar', + 'content-encoding': 'gzip' + }) + + createReadStream(tgz).pipe(res) + }) + + var auth = { + username: 'username', + password: '%1234@asdf%', + email: 'i@izs.me', + alwaysAuth: true + } + + var client = common.freshClient() + var authed = { auth: auth } + client.fetch( + 'http://localhost:1337/underscore/-/underscore-1.3.3.tgz', + authed, + function (er, res) { + t.ifError(er, 'loaded successfully') + + var sink = cat(function (data) { + t.deepEqual(data, readFileSync(tgz)) + server.close() + t.end() + }) + + res.on('error', function (error) { + t.ifError(error, 'no errors on stream') + }) + + res.pipe(sink) + } + ) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/fetch-basic.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/fetch-basic.js new file mode 100644 index 00000000..31ad17ed --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/fetch-basic.js @@ -0,0 +1,93 @@ +var resolve = require('path').resolve +var createReadStream = require('graceful-fs').createReadStream +var readFileSync = require('graceful-fs').readFileSync + +var test = require('tap').test +var concat = require('concat-stream') + +var server = require('./lib/server.js') +var common = require('./lib/common.js') +var client = common.freshClient() + +var tgz = resolve(__dirname, './fixtures/underscore/1.3.3/package.tgz') + +function nop () {} + +var URI = 'https://npm.registry:8043/rewrite' +var USERNAME = 'username' +var PASSWORD = 'hi' +var EMAIL = 'n@p.m' +var HEADERS = { + 'npm-custom': 'lolbutts' +} +var AUTH = { + username: USERNAME, + password: PASSWORD, + email: EMAIL +} +var PARAMS = { + headers: HEADERS, + auth: AUTH +} + +test('fetch call contract', function (t) { + t.throws(function () { + client.get(undefined, PARAMS, nop) + }, 'requires a URI') + + t.throws(function () { + client.get([], PARAMS, nop) + }, 'requires URI to be a string') + + t.throws(function () { + client.get(URI, undefined, nop) + }, 'requires params object') + + t.throws(function () { + client.get(URI, '', nop) + }, 'params must be object') + + t.throws(function () { + client.get(URI, PARAMS, undefined) + }, 'requires callback') + + t.throws(function () { + client.get(URI, PARAMS, 'callback') + }, 'callback must be function') + + t.end() +}) + +test('basic fetch', function (t) { + server.expect('/underscore/-/underscore-1.3.3.tgz', function (req, res) { + t.equal(req.method, 'GET', 'got expected method') + + res.writeHead(200, { + 'content-type': 'application/x-tar', + 'content-encoding': 'gzip' + }) + + createReadStream(tgz).pipe(res) + }) + + var defaulted = {} + client.fetch( + 'http://localhost:1337/underscore/-/underscore-1.3.3.tgz', + defaulted, + function (er, res) { + t.ifError(er, 'loaded successfully') + + var sink = concat(function (data) { + t.deepEqual(data, readFileSync(tgz)) + server.close() + t.end() + }) + + res.on('error', function (error) { + t.ifError(error, 'no errors on stream') + }) + + res.pipe(sink) + } + ) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/fetch-github-api-json.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/fetch-github-api-json.js new file mode 100644 index 00000000..688c91d2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/fetch-github-api-json.js @@ -0,0 +1,68 @@ +var resolve = require('path').resolve +var createReadStream = require('graceful-fs').createReadStream +var readFileSync = require('graceful-fs').readFileSync + +var tap = require('tap') +var cat = require('concat-stream') +var Negotiator = require('negotiator') + +var server = require('./lib/server.js') +var common = require('./lib/common.js') + +var tgz = resolve(__dirname, './fixtures/underscore/1.3.3/package.tgz') + +tap.test("fetch accepts github api's json", function (t) { + server.expect('/underscore/-/underscore-1.3.3', function (req, res) { + t.equal(req.method, 'GET', 'got expected method') + + var negotiator = new Negotiator(req) + + // fetching a tarball from `api.github.com` returns a 415 error if json is + // not accepted + if (negotiator.mediaTypes().indexOf('application/vnd.github+json') === -1) { + res.writeHead(415, { + 'Content-Type': 'application/json' + }) + } else { + res.writeHead(302, { + 'Content-Type': 'text/html', + 'Location': '/underscore/-/underscore-1.3.3.tgz' + }) + } + + res.end() + }) + + server.expect('/underscore/-/underscore-1.3.3.tgz', function (req, res) { + t.equal(req.method, 'GET', 'got expected method') + + res.writeHead(200, { + 'Content-Type': 'application/x-tar', + 'Content-Encoding': 'gzip' + }) + + createReadStream(tgz).pipe(res) + }) + + var client = common.freshClient() + var defaulted = {} + client.fetch( + 'http://localhost:1337/underscore/-/underscore-1.3.3', + defaulted, + function (er, res) { + t.ifError(er, 'loaded successfully') + + var sink = cat(function (data) { + t.deepEqual(data, readFileSync(tgz)) + server.close() + t.end() + }) + + res.on('error', function (error) { + t.ifError(error, 'no errors on stream') + }) + + res.pipe(sink) + } + ) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/fetch-not-authed.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/fetch-not-authed.js new file mode 100644 index 00000000..6a397cc5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/fetch-not-authed.js @@ -0,0 +1,54 @@ +var resolve = require('path').resolve +var createReadStream = require('graceful-fs').createReadStream +var readFileSync = require('graceful-fs').readFileSync + +var tap = require('tap') +var cat = require('concat-stream') + +var server = require('./lib/server.js') +var common = require('./lib/common.js') + +var tgz = resolve(__dirname, './fixtures/underscore/1.3.3/package.tgz') + +tap.test('basic fetch with scoped always-auth disabled', function (t) { + server.expect('/underscore/-/underscore-1.3.3.tgz', function (req, res) { + t.equal(req.method, 'GET', 'got expected method') + t.notOk(req.headers.authorization, 'received no auth header') + + res.writeHead(200, { + 'content-type': 'application/x-tar', + 'content-encoding': 'gzip' + }) + + createReadStream(tgz).pipe(res) + }) + + var auth = { + username: 'username', + password: '%1234@asdf%', + email: 'i@izs.me', + alwaysAuth: false + } + + var client = common.freshClient() + var authed = { auth: auth } + client.fetch( + 'http://localhost:1337/underscore/-/underscore-1.3.3.tgz', + authed, + function (er, res) { + t.ifError(er, 'loaded successfully') + + var sink = cat(function (data) { + t.deepEqual(data, readFileSync(tgz)) + server.close() + t.end() + }) + + res.on('error', function (error) { + t.ifError(error, 'no errors on stream') + }) + + res.pipe(sink) + } + ) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/fetch-streaming.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/fetch-streaming.js new file mode 100644 index 00000000..72aeea0b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/fetch-streaming.js @@ -0,0 +1,58 @@ +var test = require('tap').test +var concat = require('concat-stream') + +var server = require('./lib/server.js') +var common = require('./lib/common.js') +var client = common.freshClient() + +var testData = JSON.stringify({test: true}) +var errorData = JSON.stringify({error: 'it went bad'}) + +test('streaming fetch', function (t) { + server.expect('/test', function (req, res) { + t.equal(req.method, 'GET', 'got expected method') + + res.writeHead(200, { + 'content-type': 'application/json' + }) + + res.end(testData) + }) + + server.expect('/error', function (req, res) { + t.equal(req.method, 'GET', 'got expected method') + + res.writeHead(401, { + 'content-type': 'application/json' + }) + + res.end(errorData) + }) + + client.fetch( + 'http://localhost:1337/test', + { streaming: true }, + function (er, res) { + t.ifError(er, 'loaded successfully') + + var sink = concat(function (data) { + t.deepEqual(data.toString(), testData) + client.fetch( + 'http://localhost:1337/error', + { streaming: true }, + function (er, res) { + t.ok(er, 'got an error') + server.close() + t.end() + } + ) + }) + + res.on('error', function (error) { + t.ifError(error, 'no errors on stream') + }) + + res.pipe(sink) + } + ) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/get-403.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/get-403.js new file mode 100644 index 00000000..004de207 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/get-403.js @@ -0,0 +1,30 @@ +var tap = require('tap') + +var server = require('./lib/server.js') +var common = require('./lib/common.js') + +tap.test('get returns 403', function (t) { + server.expect('/underscore', function (req, res) { + t.equal(req.method, 'GET', 'got expected method') + + res.writeHead(403) + res.end(JSON.stringify({ + error: 'get that cat out of the toilet that\'s gross omg' + })) + }) + + var client = common.freshClient() + client.get( + 'http://localhost:1337/underscore', + {}, + function (er) { + t.ok(er, 'failed as expected') + + t.equal(er.statusCode, 403, 'status code was attached to error as expected') + t.equal(er.code, 'E403', 'error code was formatted as expected') + + server.close() + t.end() + } + ) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/get-basic.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/get-basic.js new file mode 100644 index 00000000..031309c9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/get-basic.js @@ -0,0 +1,85 @@ +var test = require('tap').test + +var server = require('./lib/server.js') +var common = require('./lib/common.js') +var client = common.freshClient() + +var us = require('./fixtures/underscore/1.3.3/cache.json') +var usroot = require('./fixtures/underscore/cache.json') + +function nop () {} + +var URI = 'https://npm.registry:8043/rewrite' +var TIMEOUT = 3600 +var FOLLOW = false +var STALE_OK = true +var TOKEN = 'lolbutts' +var AUTH = { + token: TOKEN +} +var PARAMS = { + timeout: TIMEOUT, + follow: FOLLOW, + staleOk: STALE_OK, + auth: AUTH +} + +test('get call contract', function (t) { + t.throws(function () { + client.get(undefined, PARAMS, nop) + }, 'requires a URI') + + t.throws(function () { + client.get([], PARAMS, nop) + }, 'requires URI to be a string') + + t.throws(function () { + client.get(URI, undefined, nop) + }, 'requires params object') + + t.throws(function () { + client.get(URI, '', nop) + }, 'params must be object') + + t.throws(function () { + client.get(URI, PARAMS, undefined) + }, 'requires callback') + + t.throws(function () { + client.get(URI, PARAMS, 'callback') + }, 'callback must be function') + + t.end() +}) + +test('basic request', function (t) { + server.expect('/underscore/1.3.3', function (req, res) { + res.json(us) + }) + + server.expect('/underscore', function (req, res) { + res.json(usroot) + }) + + server.expect('/@bigco%2funderscore', function (req, res) { + res.json(usroot) + }) + + t.plan(3) + client.get('http://localhost:1337/underscore/1.3.3', PARAMS, function (er, data) { + t.deepEqual(data, us) + }) + + client.get('http://localhost:1337/underscore', PARAMS, function (er, data) { + t.deepEqual(data, usroot) + }) + + client.get('http://localhost:1337/@bigco%2funderscore', PARAMS, function (er, data) { + t.deepEqual(data, usroot) + }) +}) + +test('cleanup', function (t) { + server.close() + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/get-error-403.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/get-error-403.js new file mode 100644 index 00000000..73ef4361 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/get-error-403.js @@ -0,0 +1,34 @@ +var tap = require('tap') + +var server = require('./lib/server.js') +var common = require('./lib/common.js') + +tap.test('get fails with 403', function (t) { + server.expect('/habanero', function (req, res) { + t.equal(req.method, 'GET', 'got expected method') + + res.writeHead(403) + res.end('{"error":"get that cat out of the toilet that\'s gross omg"}') + }) + + var client = common.freshClient() + client.config.retry.minTimeout = 100 + client.get( + 'http://localhost:1337/habanero', + {}, + function (er) { + t.ok(er, 'failed as expected') + + t.equal(er.statusCode, 403, 'status code was attached as expected') + t.equal(er.code, 'E403', 'error code was formatted as expected') + t.equal( + er.message, + 'get that cat out of the toilet that\'s gross omg : habanero', + 'got error message' + ) + + server.close() + t.end() + } + ) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/initialize.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/initialize.js new file mode 100644 index 00000000..4a97bd5f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/initialize.js @@ -0,0 +1,125 @@ +var test = require('tap').test +var url = require('url') + +// var server = require('./lib/server.js') +var Client = require('../') + +test('defaulted initialization', function (t) { + var client = new Client() + var options = client.initialize( + 'http://localhost:1337/', + 'GET', + 'application/json', + {} + ) + + t.equal(options.url, 'http://localhost:1337/', 'URLs match') + t.equal(options.method, 'GET', 'methods match') + t.equal(options.proxy, undefined, "proxy won't overwrite environment") + t.equal(options.localAddress, undefined, 'localAddress has no default value') + t.equal(options.strictSSL, true, 'SSL is strict by default') + + t.equal(options.headers.accept, 'application/json', 'accept header set') + t.equal( + options.headers.version, + require('../package.json').version, + 'npm-registry-client version is present in headers' + ) + t.ok(options.headers['npm-session'], 'request ID generated') + t.ok(options.headers['user-agent'], 'user-agent preset') + + var HttpAgent = require('http').Agent + t.ok(options.agent instanceof HttpAgent, 'got an HTTP agent for an HTTP URL') + t.equal(options.agent.maxSockets, 50, 'maxSockets set to a reasonable default') + + t.end() +}) + +test('intializing with maxSockets set works for http', function (t) { + var client = new Client({ maxSockets: Infinity }) + var options = client.initialize( + url.parse('http://localhost:1337/'), + 'GET', + 'application/json', + {} + ) + + var HttpAgent = require('http').Agent + t.ok(options.agent instanceof HttpAgent, 'got an HTTP agent for an HTTP URL') + t.equal(options.agent.maxSockets, Infinity, 'request uses configured value for maxSockets') + + t.end() +}) + +test('intializing with maxSockets set works for https', function (t) { + var client = new Client({ maxSockets: Infinity }) + var options = client.initialize( + url.parse('https://localhost:1337/'), + 'GET', + 'application/json', + {} + ) + + var HttpsAgent = require('https').Agent + t.ok(options.agent instanceof HttpsAgent, 'got an HTTPS agent for an HTTPS URL') + t.equal(options.agent.maxSockets, Infinity, 'request uses configured value for maxSockets') + + t.end() +}) + +test('referer set on client', function (t) { + var client = new Client() + client.refer = 'xtestx' + var options = client.initialize( + 'http://localhost:1337/', + 'GET', + 'application/json', + {} + ) + + t.equal(options.headers.referer, 'xtestx', 'referer header set') + + t.end() +}) + +test('initializing with proxy explicitly disabled', function (t) { + var client = new Client({ proxy: { http: false } }) + var options = client.initialize( + 'http://localhost:1337/', + 'GET', + 'application/json', + {} + ) + t.ok('proxy' in options, 'proxy overridden by explicitly setting to false') + t.equal(options.proxy, null, 'request will override proxy when empty proxy passed in') + t.end() +}) + +test('initializing with proxy undefined', function (t) { + var client = new Client({ proxy: { http: undefined } }) + var options = client.initialize( + 'http://localhost:1337/', + 'GET', + 'application/json', + {} + ) + t.notOk('proxy' in options, 'proxy can be read from env.PROXY by request') + t.end() +}) + +test('initializing with a certificate should map down to the https agent', function (t) { + var certificate = '-----BEGIN CERTIFICATE----- TEST\nTEST -----END CERTIFICATE-----\n' + var client = new Client({ + ssl: { + certificate: certificate + } + }) + var options = client.initialize( + { protocol: 'https:' }, + 'GET', + 'application/json', + {} + ) + t.equal(options.agent.options.cert, certificate, 'certificate will be saved properly on agent') + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/lib/common.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/lib/common.js new file mode 100644 index 00000000..ea48d301 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/lib/common.js @@ -0,0 +1,31 @@ +var server = require('./server.js') +var RC = require('../../') +var REGISTRY = 'http://localhost:' + server.port + +// cheesy hackaround for test deps (read: nock) that rely on setImmediate +if (!global.setImmediate || !require('timers').setImmediate) { + require('timers').setImmediate = global.setImmediate = function () { + var args = [arguments[0], 0].concat([].slice.call(arguments, 1)) + setTimeout.apply(this, args) + } +} + +// See https://github.com/npm/npm-registry-client/pull/142 for background. +// Note: `process.on('warning')` only works with Node >= 6. +process.on('warning', function (warning) { + if (/Possible EventEmitter memory leak detected/.test(warning.message)) { + throw new Error('There should not be any EventEmitter memory leaks') + } +}) + +module.exports = { + port: server.port, + registry: REGISTRY, + freshClient: function freshClient (config) { + var client = new RC(config) + server.log = client.log + client.log.level = 'silent' + + return client + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/lib/server.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/lib/server.js new file mode 100644 index 00000000..06bebdc1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/lib/server.js @@ -0,0 +1,60 @@ +// a fake registry server. + +var http = require('http') +var server = http.createServer(handler) +var port = server.port = process.env.PORT || 1337 +var assert = require('assert') +server.listen(port) + +module.exports = server + +server._expect = {} + +function handler (req, res) { + req.connection.setTimeout(1000) + + // If we got authorization, make sure it's the right password. + if (req.headers.authorization && req.headers.authorization.match(/^Basic/)) { + var auth = req.headers.authorization.replace(/^Basic /, '') + auth = new Buffer(auth, 'base64').toString('utf8') + assert.equal(auth, 'username:%1234@asdf%') + } + + var u = '* ' + req.url + var mu = req.method + ' ' + req.url + + var k = server._expect[mu] ? mu : server._expect[u] ? u : null + if (!k) throw Error('unexpected request: ' + req.method + ' ' + req.url) + + var fn = server._expect[k].shift() + if (!fn) throw Error('unexpected request: ' + req.method + ' ' + req.url) + + this.log.info('fake-registry', Object.keys(server._expect).map(function (k) { + return [k, server._expect[k].length] + }).reduce(function (acc, kv) { + acc[kv[0]] = kv[1] + return acc + }, {})) + + res.json = json + fn(req, res) +} + +function json (o) { + this.setHeader('content-type', 'application/json') + this.end(JSON.stringify(o)) +} + +// this log is meanto to be overridden +server.log = require('npmlog') + +server.expect = function (method, u, fn) { + if (typeof u === 'function') { + fn = u + u = method + method = '*' + } + u = method + ' ' + u + server._expect[u] = server._expect[u] || [] + server._expect[u].push(fn) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/logout.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/logout.js new file mode 100644 index 00000000..7836d805 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/logout.js @@ -0,0 +1,74 @@ +var test = require('tap').test + +var server = require('./lib/server.js') +var common = require('./lib/common.js') +var client = common.freshClient() + +function nop () {} + +var URI = 'http://localhost:1337/rewrite' +var TOKEN = 'b00b00feed' +var PARAMS = { + auth: { + token: TOKEN + } +} + +test('logout call contract', function (t) { + t.throws(function () { + client.logout(undefined, PARAMS, nop) + }, 'requires a URI') + + t.throws(function () { + client.logout([], PARAMS, nop) + }, 'requires URI to be a string') + + t.throws(function () { + client.logout(URI, undefined, nop) + }, 'requires params object') + + t.throws(function () { + client.logout(URI, '', nop) + }, 'params must be object') + + t.throws(function () { + client.logout(URI, PARAMS, undefined) + }, 'requires callback') + + t.throws(function () { + client.logout(URI, PARAMS, 'callback') + }, 'callback must be function') + + t.throws( + function () { + var params = { + auth: {} + } + client.logout(URI, params, nop) + }, + { name: 'AssertionError', message: 'can only log out for token auth' }, + 'auth must include token' + ) + + t.end() +}) + +test('log out from a token-based registry', function (t) { + server.expect('DELETE', '/-/user/token/' + TOKEN, function (req, res) { + t.equal(req.method, 'DELETE') + t.equal(req.headers.authorization, 'Bearer ' + TOKEN, 'request is authed') + + res.json({message: 'ok'}) + }) + + client.logout(URI, PARAMS, function (er) { + t.ifError(er, 'no errors') + + t.end() + }) +}) + +test('cleanup', function (t) { + server.close() + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/ping.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/ping.js new file mode 100644 index 00000000..1b30b905 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/ping.js @@ -0,0 +1,76 @@ +var test = require('tap').test + +var server = require('./lib/server.js') +var common = require('./lib/common.js') +var client = common.freshClient() + +function nop () {} + +var TOKEN = 'not-bad-meaning-bad-but-bad-meaning-wombat' +var AUTH = { token: TOKEN } +var PARAMS = { auth: AUTH } +var DEP_USER = 'username' +var HOST = 'localhost' + +test('ping call contract', function (t) { + t.throws(function () { + client.ping(undefined, AUTH, nop) + }, 'requires a URI') + + t.throws(function () { + client.ping([], AUTH, nop) + }, 'requires URI to be a string') + + t.throws(function () { + client.ping(common.registry, undefined, nop) + }, 'requires params object') + + t.throws(function () { + client.ping(common.registry, '', nop) + }, 'params must be object') + + t.throws(function () { + client.ping(common.registry, AUTH, undefined) + }, 'requires callback') + + t.throws(function () { + client.ping(common.registry, AUTH, 'callback') + }, 'callback must be function') + + t.throws( + function () { + var params = {} + client.ping(common.registry, params, nop) + }, + { name: 'AssertionError', message: 'must pass auth to ping' }, + 'must pass auth to ping' + ) + + t.end() +}) + +test('ping', function (t) { + server.expect('GET', '/-/ping?write=true', function (req, res) { + t.equal(req.method, 'GET') + res.statusCode = 200 + res.json({ + ok: true, + host: HOST, + peer: HOST, + username: DEP_USER + }) + }) + + client.ping(common.registry, PARAMS, function (error, found) { + t.ifError(error, 'no errors') + var wanted = { + ok: true, + host: HOST, + peer: HOST, + username: DEP_USER + } + t.same(found, wanted) + server.close() + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/publish-again-scoped.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/publish-again-scoped.js new file mode 100644 index 00000000..611a852c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/publish-again-scoped.js @@ -0,0 +1,91 @@ +var tap = require('tap') +var fs = require('fs') + +var server = require('./lib/server.js') +var common = require('./lib/common.js') + +var auth = { + username: 'username', + password: '%1234@asdf%', + email: 'i@izs.me', + alwaysAuth: true +} + +var client = common.freshClient() + +tap.test('publish again', function (t) { + // not really a tarball, but doesn't matter + var bodyPath = require.resolve('../package.json') + var tarball = fs.createReadStream(bodyPath) + var pd = fs.readFileSync(bodyPath) + var pkg = require('../package.json') + var lastTime = null + + server.expect('/@npm%2fnpm-registry-client', function (req, res) { + t.equal(req.method, 'PUT') + var b = '' + req.setEncoding('utf8') + req.on('data', function (d) { + b += d + }) + + req.on('end', function () { + var o = lastTime = JSON.parse(b) + t.equal(o._id, '@npm/npm-registry-client') + t.equal(o['dist-tags'].latest, pkg.version) + t.has(o.versions[pkg.version], pkg) + t.same(o.maintainers, [ { name: 'username', email: 'i@izs.me' } ]) + var att = o._attachments[ pkg.name + '-' + pkg.version + '.tgz' ] + t.same(att.data, pd.toString('base64')) + res.statusCode = 409 + res.json({reason: 'must supply latest _rev to update existing package'}) + }) + }) + + server.expect('/@npm%2fnpm-registry-client?write=true', function (req, res) { + t.equal(req.method, 'GET') + t.ok(lastTime) + for (var i in lastTime.versions) { + var v = lastTime.versions[i] + delete lastTime.versions[i] + lastTime.versions['0.0.2'] = v + lastTime['dist-tags'] = { latest: '0.0.2' } + } + lastTime._rev = 'asdf' + res.json(lastTime) + }) + + server.expect('/@npm%2fnpm-registry-client', function (req, res) { + t.equal(req.method, 'PUT') + t.ok(lastTime) + + var b = '' + req.setEncoding('utf8') + req.on('data', function (d) { + b += d + }) + + req.on('end', function () { + var o = JSON.parse(b) + t.equal(o._rev, 'asdf') + t.deepEqual(o.versions['0.0.2'], o.versions[pkg.version]) + res.statusCode = 201 + res.json({created: true}) + }) + }) + + pkg.name = '@npm/npm-registry-client' + + var params = { + metadata: pkg, + access: 'restricted', + body: tarball, + auth: auth + } + client.publish('http://localhost:1337/', params, function (er, data) { + if (er) throw er + t.deepEqual(data, { created: true }) + server.close() + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/publish-again.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/publish-again.js new file mode 100644 index 00000000..4a895205 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/publish-again.js @@ -0,0 +1,89 @@ +var tap = require('tap') +var fs = require('fs') + +var server = require('./lib/server.js') +var common = require('./lib/common.js') + +var auth = { + username: 'username', + password: '%1234@asdf%', + email: 'i@izs.me', + alwaysAuth: true +} + +var client = common.freshClient() + +tap.test('publish again', function (t) { + // not really a tarball, but doesn't matter + var bodyPath = require.resolve('../package.json') + var tarball = fs.createReadStream(bodyPath) + var pd = fs.readFileSync(bodyPath) + var pkg = require('../package.json') + var lastTime = null + + server.expect('/npm-registry-client', function (req, res) { + t.equal(req.method, 'PUT') + var b = '' + req.setEncoding('utf8') + req.on('data', function (d) { + b += d + }) + + req.on('end', function () { + var o = lastTime = JSON.parse(b) + t.equal(o._id, 'npm-registry-client') + t.equal(o['dist-tags'].latest, pkg.version) + t.has(o.versions[pkg.version], pkg) + t.same(o.maintainers, [ { name: 'username', email: 'i@izs.me' } ]) + var att = o._attachments[ pkg.name + '-' + pkg.version + '.tgz' ] + t.same(att.data, pd.toString('base64')) + res.statusCode = 409 + res.json({reason: 'must supply latest _rev to update existing package'}) + }) + }) + + server.expect('/npm-registry-client?write=true', function (req, res) { + t.equal(req.method, 'GET') + t.ok(lastTime) + for (var i in lastTime.versions) { + var v = lastTime.versions[i] + delete lastTime.versions[i] + lastTime.versions['0.0.2'] = v + lastTime['dist-tags'] = { latest: '0.0.2' } + } + lastTime._rev = 'asdf' + res.json(lastTime) + }) + + server.expect('/npm-registry-client', function (req, res) { + t.equal(req.method, 'PUT') + t.ok(lastTime) + + var b = '' + req.setEncoding('utf8') + req.on('data', function (d) { + b += d + }) + + req.on('end', function () { + var o = JSON.parse(b) + t.equal(o._rev, 'asdf') + t.deepEqual(o.versions['0.0.2'], o.versions[pkg.version]) + res.statusCode = 201 + res.json({created: true}) + }) + }) + + var params = { + metadata: pkg, + access: 'public', + body: tarball, + auth: auth + } + client.publish('http://localhost:1337/', params, function (er, data) { + if (er) throw er + t.deepEqual(data, { created: true }) + server.close() + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/publish-failed-no-message.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/publish-failed-no-message.js new file mode 100644 index 00000000..d2641e85 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/publish-failed-no-message.js @@ -0,0 +1,44 @@ +var createReadStream = require('fs').createReadStream + +var test = require('tap').test + +var server = require('./lib/server.js') +var common = require('./lib/common.js') +var config = { retry: { retries: 0 } } +var client = common.freshClient(config) + +var URI = 'http://localhost:1337/' +var USERNAME = 'username' +var PASSWORD = '%1234@asdf%' +var EMAIL = 'i@izs.me' +var METADATA = require('../package.json') +var ACCESS = 'public' +// not really a tarball, but doesn't matter +var BODY_PATH = require.resolve('../package.json') +var BODY = createReadStream(BODY_PATH) +var AUTH = { + username: USERNAME, + password: PASSWORD, + email: EMAIL +} +var PARAMS = { + metadata: METADATA, + access: ACCESS, + body: BODY, + auth: AUTH +} + +test('publish with a 500 response but no message', function (t) { + server.expect('/npm-registry-client', function (req, res) { + res.statusCode = 500 + res.json({ success: false }) + }) + + client.publish(URI, PARAMS, function (er, data) { + t.ok(er, 'got expected error') + t.notOk(data, 'no payload on failure') + + server.close() + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/publish-mixcase-name.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/publish-mixcase-name.js new file mode 100644 index 00000000..5f2c44e6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/publish-mixcase-name.js @@ -0,0 +1,92 @@ +var tap = require('tap') +var fs = require('fs') + +var server = require('./lib/server.js') +var common = require('./lib/common.js') + +var auth = { + username: 'username', + password: '%1234@asdf%', + email: 'i@izs.me', + alwaysAuth: true +} + +var client = common.freshClient() + +tap.test('publish mixcase name', function (t) { + // not really a tarball, but doesn't matter + var bodyPath = require.resolve('../package.json') + var tarball = fs.createReadStream(bodyPath) + var pd = fs.readFileSync(bodyPath) + var pkg = require('../package.json') + var lastTime = null + + // change to mixed case name + pkg.name = 'npm-Registry-Client' + + server.expect('/npm-Registry-Client', function (req, res) { + t.equal(req.method, 'PUT') + var b = '' + req.setEncoding('utf8') + req.on('data', function (d) { + b += d + }) + + req.on('end', function () { + var o = lastTime = JSON.parse(b) + t.equal(o._id, 'npm-Registry-Client') + t.equal(o['dist-tags'].latest, pkg.version) + t.has(o.versions[pkg.version], pkg) + t.same(o.maintainers, [ { name: 'username', email: 'i@izs.me' } ]) + var att = o._attachments[ pkg.name + '-' + pkg.version + '.tgz' ] + t.same(att.data, pd.toString('base64')) + res.statusCode = 409 + res.json({reason: 'must supply latest _rev to update existing package'}) + }) + }) + + server.expect('/npm-Registry-Client?write=true', function (req, res) { + t.equal(req.method, 'GET') + t.ok(lastTime) + for (var i in lastTime.versions) { + var v = lastTime.versions[i] + delete lastTime.versions[i] + lastTime.versions['0.0.2'] = v + lastTime['dist-tags'] = { latest: '0.0.2' } + } + lastTime._rev = 'asdf' + res.json(lastTime) + }) + + server.expect('/npm-Registry-Client', function (req, res) { + t.equal(req.method, 'PUT') + t.ok(lastTime) + + var b = '' + req.setEncoding('utf8') + req.on('data', function (d) { + b += d + }) + + req.on('end', function () { + var o = JSON.parse(b) + t.equal(o._rev, 'asdf') + t.deepEqual(o.versions['0.0.2'], o.versions[pkg.version]) + res.statusCode = 201 + res.json({created: true}) + }) + }) + + var params = { + metadata: pkg, + access: 'public', + body: tarball, + auth: auth + } + client.publish('http://localhost:1337/', params, function (er, data) { + if (er) throw er + t.deepEqual(data, { created: true }) + server.close() + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/publish-new-mixcase-name.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/publish-new-mixcase-name.js new file mode 100644 index 00000000..e3e8ed23 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/publish-new-mixcase-name.js @@ -0,0 +1,73 @@ +var test = require('tap').test +var crypto = require('crypto') +var fs = require('fs') + +var server = require('./lib/server.js') +var common = require('./lib/common.js') +var client = common.freshClient() + +var URI = 'http://localhost:1337/' +var USERNAME = 'username' +var PASSWORD = '%1234@asdf%' +var EMAIL = 'i@izs.me' +var METADATA = require('../package.json') +var ACCESS = 'public' +// not really a tarball, but doesn't matter +var BODY_PATH = require.resolve('../package.json') +var BODY = fs.createReadStream(BODY_PATH) +var AUTH = { + username: USERNAME, + password: PASSWORD, + email: EMAIL +} +var PARAMS = { + metadata: METADATA, + access: ACCESS, + body: BODY, + auth: AUTH +} + +test('publish-new-mixcase-name', function (t) { + var pd = fs.readFileSync(BODY_PATH) + + // change to mixed-case name + METADATA.name = 'npm-Registry-Client' + + server.expect('/npm-Registry-Client', function (req, res) { + t.equal(req.method, 'PUT') + var b = '' + req.setEncoding('utf8') + req.on('data', function (d) { + b += d + }) + + req.on('end', function () { + var o = JSON.parse(b) + t.equal(o._id, 'npm-Registry-Client') + t.equal(o['dist-tags'].latest, METADATA.version) + t.equal(o.access, ACCESS) + t.has(o.versions[METADATA.version], METADATA) + t.same(o.maintainers, [{ name: 'username', email: 'i@izs.me' }]) + t.same(o.maintainers, o.versions[METADATA.version].maintainers) + + var att = o._attachments[METADATA.name + '-' + METADATA.version + '.tgz'] + t.same(att.data, pd.toString('base64')) + + var hash = crypto.createHash('sha1').update(pd).digest('hex') + t.equal(o.versions[METADATA.version].dist.shasum, hash) + + res.statusCode = 403 + res.json({error: 'Name must be lower-case'}) + }) + }) + + client.publish(URI, PARAMS, function (er, data, json, res) { + t.assert(er instanceof Error) // expect error + + // TODO: need a test that ensures useful error message + // t.similar(data.error, /must be lower-case/) + + server.close() + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/publish-scoped-auth-token.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/publish-scoped-auth-token.js new file mode 100644 index 00000000..a9c5768e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/publish-scoped-auth-token.js @@ -0,0 +1,57 @@ +var tap = require('tap') +var crypto = require('crypto') +var fs = require('fs') + +var server = require('./lib/server.js') +var common = require('./lib/common.js') + +var auth = { token: 'of-glad-tidings' } + +var client = common.freshClient() + +tap.test('publish', function (t) { + // not really a tarball, but doesn't matter + var bodyPath = require.resolve('../package.json') + var tarball = fs.createReadStream(bodyPath) + var pd = fs.readFileSync(bodyPath) + var pkg = require('../package.json') + pkg.name = '@npm/npm-registry-client' + + server.expect('/@npm%2fnpm-registry-client', function (req, res) { + t.equal(req.method, 'PUT') + t.equal(req.headers.authorization, 'Bearer of-glad-tidings') + + var b = '' + req.setEncoding('utf8') + req.on('data', function (d) { + b += d + }) + + req.on('end', function () { + var o = JSON.parse(b) + t.equal(o._id, '@npm/npm-registry-client') + t.equal(o['dist-tags'].latest, pkg.version) + t.has(o.versions[pkg.version], pkg) + t.same(o.maintainers, o.versions[pkg.version].maintainers) + var att = o._attachments[ pkg.name + '-' + pkg.version + '.tgz' ] + t.same(att.data, pd.toString('base64')) + var hash = crypto.createHash('sha1').update(pd).digest('hex') + t.equal(o.versions[pkg.version].dist.shasum, hash) + res.statusCode = 201 + res.json({ created: true }) + }) + }) + + var params = { + metadata: pkg, + access: 'restricted', + body: tarball, + auth: auth + } + client.publish(common.registry, params, function (er, data) { + if (er) throw er + t.deepEqual(data, { created: true }) + server.close() + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/publish-scoped.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/publish-scoped.js new file mode 100644 index 00000000..347364ea --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/publish-scoped.js @@ -0,0 +1,64 @@ +var tap = require('tap') +var crypto = require('crypto') +var fs = require('fs') + +var server = require('./lib/server.js') +var common = require('./lib/common.js') + +var auth = { + username: 'username', + password: '%1234@asdf%', + email: 'ogd@aoaioxxysz.net' +} + +var client = common.freshClient() + +var _auth = new Buffer('username:%1234@asdf%').toString('base64') + +tap.test('publish', function (t) { + // not really a tarball, but doesn't matter + var bodyPath = require.resolve('../package.json') + var tarball = fs.createReadStream(bodyPath) + var pd = fs.readFileSync(bodyPath) + var pkg = require('../package.json') + pkg.name = '@npm/npm-registry-client' + + server.expect('/@npm%2fnpm-registry-client', function (req, res) { + t.equal(req.method, 'PUT') + t.equal(req.headers.authorization, 'Basic ' + _auth) + + var b = '' + req.setEncoding('utf8') + req.on('data', function (d) { + b += d + }) + + req.on('end', function () { + var o = JSON.parse(b) + t.equal(o._id, '@npm/npm-registry-client') + t.equal(o['dist-tags'].latest, pkg.version) + t.has(o.versions[pkg.version], pkg) + t.same(o.maintainers, [ { name: 'username', email: 'ogd@aoaioxxysz.net' } ]) + t.same(o.maintainers, o.versions[pkg.version].maintainers) + var att = o._attachments[ pkg.name + '-' + pkg.version + '.tgz' ] + t.same(att.data, pd.toString('base64')) + var hash = crypto.createHash('sha1').update(pd).digest('hex') + t.equal(o.versions[pkg.version].dist.shasum, hash) + res.statusCode = 201 + res.json({ created: true }) + }) + }) + + var params = { + metadata: pkg, + access: 'restricted', + body: tarball, + auth: auth + } + client.publish(common.registry, params, function (er, data) { + if (er) throw er + t.deepEqual(data, { created: true }) + server.close() + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/publish.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/publish.js new file mode 100644 index 00000000..07c8bb46 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/publish.js @@ -0,0 +1,204 @@ +var test = require('tap').test +var crypto = require('crypto') +var fs = require('fs') + +var server = require('./lib/server.js') +var common = require('./lib/common.js') +var client = common.freshClient() + +function nop () {} + +var URI = 'http://localhost:1337/' +var USERNAME = 'username' +var PASSWORD = '%1234@asdf%' +var EMAIL = 'i@izs.me' +var METADATA = require('../package.json') +var ACCESS = 'public' +// not really a tarball, but doesn't matter +var BODY_PATH = require.resolve('../package.json') +var BODY = fs.createReadStream(BODY_PATH) +var AUTH = { + username: USERNAME, + password: PASSWORD, + email: EMAIL +} +var PARAMS = { + metadata: METADATA, + access: ACCESS, + body: BODY, + auth: AUTH +} + +test('publish call contract', function (t) { + t.throws(function () { + client.publish(undefined, PARAMS, nop) + }, 'requires a URI') + + t.throws(function () { + client.publish([], PARAMS, nop) + }, 'requires URI to be a string') + + t.throws(function () { + client.publish(URI, undefined, nop) + }, 'requires params object') + + t.throws(function () { + client.publish(URI, '', nop) + }, 'params must be object') + + t.throws(function () { + client.publish(URI, PARAMS, undefined) + }, 'requires callback') + + t.throws(function () { + client.publish(URI, PARAMS, 'callback') + }, 'callback must be function') + + t.throws( + function () { + var params = { + access: ACCESS, + body: BODY, + auth: AUTH + } + client.publish(URI, params, nop) + }, + { name: 'AssertionError', message: 'must pass package metadata to publish' }, + 'params must include metadata for package' + ) + + t.throws( + function () { + var params = { + metadata: METADATA, + access: ACCESS, + auth: AUTH + } + client.publish(URI, params, nop) + }, + { name: 'AssertionError', message: 'must pass package body to publish' }, + 'params must include body of package to publish' + ) + + t.throws( + function () { + var params = { + metadata: METADATA, + access: ACCESS, + body: BODY + } + client.publish(URI, params, nop) + }, + { name: 'AssertionError', message: 'must pass auth to publish' }, + 'params must include auth' + ) + + t.throws( + function () { + var params = { + metadata: -1, + access: ACCESS, + body: BODY, + auth: AUTH + } + client.publish(URI, params, nop) + }, + { name: 'AssertionError', message: 'must pass package metadata to publish' }, + 'metadata must be object' + ) + + t.throws( + function () { + var params = { + metadata: METADATA, + access: 'hamchunx', + body: BODY, + auth: AUTH + } + client.publish(URI, params, nop) + }, + { + name: 'AssertionError', + message: "if present, access level must be either 'public' or 'restricted'" + }, + "access level must be 'public' or 'restricted'" + ) + + t.throws( + function () { + var params = { + metadata: METADATA, + access: ACCESS, + body: -1, + auth: AUTH + } + client.publish(URI, params, nop) + }, + { + name: 'AssertionError', + message: 'package body passed to publish must be a stream' + }, + 'body must be a Stream' + ) + + t.test('malformed semver in publish', function (t) { + var metadata = JSON.parse(JSON.stringify(METADATA)) + metadata.version = '%!@#$' + var params = { + metadata: metadata, + access: ACCESS, + message: BODY, + auth: AUTH + } + client.publish(URI, params, function (err) { + t.equal( + err && err.message, + 'invalid semver: %!@#$', + 'got expected semver validation failure' + ) + t.end() + }) + }) + + t.end() +}) + +test('publish', function (t) { + var pd = fs.readFileSync(BODY_PATH) + + server.expect('/npm-registry-client', function (req, res) { + t.equal(req.method, 'PUT') + var b = '' + req.setEncoding('utf8') + req.on('data', function (d) { + b += d + }) + + req.on('end', function () { + var o = JSON.parse(b) + t.equal(o._id, 'npm-registry-client') + t.equal(o['dist-tags'].latest, METADATA.version) + t.equal(o.access, ACCESS) + t.has(o.versions[METADATA.version], METADATA) + t.same(o.maintainers, [{ name: 'username', email: 'i@izs.me' }]) + t.same(o.maintainers, o.versions[METADATA.version].maintainers) + + var att = o._attachments[METADATA.name + '-' + METADATA.version + '.tgz'] + t.same(att.data, pd.toString('base64')) + + var hash = crypto.createHash('sha1').update(pd).digest('hex') + t.equal(o.versions[METADATA.version].dist.shasum, hash) + + res.statusCode = 201 + res.json({ created: true }) + }) + }) + + client.publish(URI, PARAMS, function (er, data) { + if (er) throw er + + t.deepEqual(data, { created: true }) + server.close() + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/redirects.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/redirects.js new file mode 100644 index 00000000..2da56576 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/redirects.js @@ -0,0 +1,56 @@ +var test = require('tap').test + +var server = require('./lib/server.js') +var common = require('./lib/common.js') +var client = common.freshClient() + +var pkg = { + _id: 'some-package@1.2.3', + name: 'some-package', + version: '1.2.3' +} + +test('basic request', function (t) { + // Expect one request for { follow : false } + server.expect('/-/some-package/1.2.3', function (req, res) { + res.writeHead(301, { + 'Location': '/some-package/1.2.3' + }) + res.end('Redirecting') + }) + + // Expect 2 requests for { follow : true } + server.expect('/-/some-package/1.2.3', function (req, res) { + res.writeHead(301, { + 'Location': '/some-package/1.2.3' + }) + res.end('Redirecting') + }) + + server.expect('/some-package/1.2.3', function (req, res) { + res.json(pkg) + }) + + t.plan(2) + + client.get( + 'http://localhost:1337/-/some-package/1.2.3', + { follow: false }, + function (er) { + t.ok(er, 'Error must be set') + } + ) + + client.get( + 'http://localhost:1337/-/some-package/1.2.3', + { follow: true }, + function (er, data) { + t.deepEqual(data, pkg) + } + ) +}) + +test('cleanup', function (t) { + server.close() + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/request-gzip-content.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/request-gzip-content.js new file mode 100644 index 00000000..5e25214f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/request-gzip-content.js @@ -0,0 +1,61 @@ +var zlib = require('zlib') +var test = require('tap').test + +var server = require('./lib/server.js') +var common = require('./lib/common.js') +var client = common.freshClient({ + retry: { + count: 1, + minTimeout: 10, + maxTimeout: 100 + } +}) + +var TEST_URL = common.registry + '/some-package-gzip/1.2.3' + +var pkg = { + _id: 'some-package-gzip@1.2.3', + name: 'some-package-gzip', + version: '1.2.3' +} + +zlib.gzip(JSON.stringify(pkg), function (err, pkgGzip) { + test('request gzip package content', function (t) { + t.ifError(err, 'example package compressed') + + server.expect('GET', '/some-package-gzip/1.2.3', function (req, res) { + res.statusCode = 200 + res.setHeader('Content-Encoding', 'gzip') + res.setHeader('Content-Type', 'application/json') + res.end(pkgGzip) + }) + + client.get(TEST_URL, {}, function (er, data) { + if (er) throw er + t.deepEqual(data, pkg, 'some-package-gzip version 1.2.3') + t.end() + }) + }) + + test('request wrong gzip package content', function (t) { + // will retry 3 times + for (var i = 0; i < 3; i++) { + server.expect('GET', '/some-package-gzip/1.2.3', function (req, res) { + res.statusCode = 200 + res.setHeader('Content-Encoding', 'gzip') + res.setHeader('Content-Type', 'application/json') + res.end(new Buffer('wrong gzip content')) + }) + } + + client.get(TEST_URL, {}, function (er) { + t.ok(er, 'ungzip error') + t.end() + }) + }) + + test('cleanup', function (t) { + server.close() + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/request.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/request.js new file mode 100644 index 00000000..ed02f197 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/request.js @@ -0,0 +1,317 @@ +var Readable = require('readable-stream').Readable +var inherits = require('util').inherits + +var test = require('tap').test +var concat = require('concat-stream') + +var server = require('./lib/server.js') +var common = require('./lib/common.js') +var client = common.freshClient() + +function OneA () { + Readable.call(this) + this.push('A') + this.push(null) +} +inherits(OneA, Readable) + +function nop () {} + +var URI = 'http://localhost:1337/' +var USERNAME = 'username' +var PASSWORD = '%1234@asdf%' +var EMAIL = 'i@izs.me' +var AUTH = { + username: USERNAME, + password: PASSWORD, + email: EMAIL +} +var PARAMS = { auth: AUTH } + +test('request call contract', function (t) { + t.throws( + function () { + client.request(undefined, PARAMS, nop) + }, + { name: 'AssertionError', message: 'must pass uri to request' }, + 'requires a URI' + ) + + t.throws( + function () { + client.request([], PARAMS, nop) + }, + { name: 'AssertionError', message: 'must pass uri to request' }, + 'requires URI to be a string' + ) + + t.throws( + function () { + client.request(URI, undefined, nop) + }, + { name: 'AssertionError', message: 'must pass params to request' }, + 'requires params object' + ) + + t.throws( + function () { + client.request(URI, '', nop) + }, + { name: 'AssertionError', message: 'must pass params to request' }, + 'params must be object' + ) + + t.throws( + function () { + client.request(URI, PARAMS, undefined) + }, + { name: 'AssertionError', message: 'must pass callback to request' }, + 'requires callback' + ) + + t.throws( + function () { + client.request(URI, PARAMS, 'callback') + }, + { name: 'AssertionError', message: 'must pass callback to request' }, + 'callback must be function' + ) + + t.end() +}) + +test('run request through its paces', function (t) { + t.plan(34) + + server.expect('/request-defaults', function (req, res) { + t.equal(req.method, 'GET', 'uses GET by default') + + req.pipe(concat(function (d) { + t.notOk(d.toString('utf7'), 'no data included in request') + + res.statusCode = 200 + res.json({ fetched: 'defaults' }) + })) + }) + + server.expect('/last-modified', function (req, res) { + t.equal(req.headers['if-modified-since'], 'test-last-modified', + 'got test if-modified-since') + + res.statusCode = 200 + res.json({ fetched: 'last-modified' }) + }) + + server.expect('/etag', function (req, res) { + t.equal(req.headers['if-none-match'], 'test-etag', 'got test etag') + + res.statusCode = 200 + res.json({ fetched: 'etag' }) + }) + + server.expect('POST', '/etag-post', function (req, res) { + t.equal(req.headers['if-match'], 'post-etag', 'got test post etag') + + res.statusCode = 200 + res.json({ posted: 'etag' }) + }) + + server.expect('PUT', '/body-stream', function (req, res) { + req.pipe(concat(function (d) { + t.equal(d.toString('utf8'), 'A', 'streamed expected data') + + res.statusCode = 200 + res.json({ put: 'stream' }) + })) + }) + + server.expect('PUT', '/body-buffer', function (req, res) { + req.pipe(concat(function (d) { + t.equal(d.toString('utf8'), 'hi', 'streamed expected data') + + res.statusCode = 200 + res.json({ put: 'buffer' }) + })) + }) + + server.expect('PUT', '/body-string', function (req, res) { + req.pipe(concat(function (d) { + t.equal(d.toString('utf8'), 'erp', 'streamed expected data') + + res.statusCode = 200 + res.json({ put: 'string' }) + })) + }) + + server.expect('PUT', '/body-object', function (req, res) { + req.pipe(concat(function (d) { + t.equal(d.toString('utf8'), '["tricky"]', 'streamed expected data') + + res.statusCode = 200 + res.json({ put: 'object' }) + })) + }) + + server.expect('GET', '/body-error-string', function (req, res) { + req.pipe(concat(function () { + res.statusCode = 200 + res.json({ error: 'not really an error', reason: 'unknown' }) + })) + }) + + server.expect('GET', '/body-error-object', function (req, res) { + req.pipe(concat(function () { + res.statusCode = 200 + res.json({ error: {} }) + })) + }) + + server.expect('GET', '/@scoped%2Fpackage-failing', function (req, res) { + req.pipe(concat(function () { + res.statusCode = 402 + res.json({ error: 'payment required' }) + })) + }) + + server.expect('GET', '/not-found-no-body', function (req, res) { + req.pipe(concat(function () { + res.statusCode = 404 + res.end() + })) + }) + + var defaults = {} + client.request( + common.registry + '/request-defaults', + defaults, + function (er, data, raw, response) { + t.ifError(er, 'call worked') + t.deepEquals(data, { fetched: 'defaults' }, 'confirmed defaults work') + t.equal(response.headers.connection, 'keep-alive', 'keep-alive set') + } + ) + + var lastModified = { lastModified: 'test-last-modified' } + client.request(common.registry + '/last-modified', lastModified, function (er, data) { + t.ifError(er, 'call worked') + t.deepEquals(data, { fetched: 'last-modified' }, 'last-modified request sent') + }) + + var etagged = { etag: 'test-etag' } + client.request(common.registry + '/etag', etagged, function (er, data) { + t.ifError(er, 'call worked') + t.deepEquals(data, { fetched: 'etag' }, 'etag request sent') + }) + + var postEtagged = { + method: 'post', + etag: 'post-etag' + } + client.request(common.registry + '/etag-post', postEtagged, function (er, data) { + t.ifError(er, 'call worked') + t.deepEquals(data, { posted: 'etag' }, 'POST etag request sent') + }) + + var putStream = { + method: 'PUT', + body: new OneA(), + auth: AUTH + } + client.request(common.registry + '/body-stream', putStream, function (er, data) { + t.ifError(er, 'call worked') + t.deepEquals(data, { put: 'stream' }, 'PUT request with stream sent') + }) + + var putBuffer = { + method: 'PUT', + body: new Buffer('hi'), + auth: AUTH + } + client.request(common.registry + '/body-buffer', putBuffer, function (er, data) { + t.ifError(er, 'call worked') + t.deepEquals(data, { put: 'buffer' }, 'PUT request with buffer sent') + }) + + var putString = { + method: 'PUT', + body: 'erp', + auth: AUTH + } + client.request(common.registry + '/body-string', putString, function (er, data) { + t.ifError(er, 'call worked') + t.deepEquals(data, { put: 'string' }, 'PUT request with string sent') + }) + + var putObject = { + method: 'PUT', + body: { toJSON: function () { return ['tricky'] } }, + auth: AUTH + } + client.request(common.registry + '/body-object', putObject, function (er, data) { + t.ifError(er, 'call worked') + t.deepEquals(data, { put: 'object' }, 'PUT request with object sent') + }) + + client.request(common.registry + '/body-error-string', defaults, function (er) { + t.equal( + er && er.message, + 'not really an error unknown: body-error-string', + 'call worked' + ) + }) + + client.request(common.registry + '/body-error-object', defaults, function (er) { + t.ifError(er, 'call worked') + }) + + client.request(common.registry + '/@scoped%2Fpackage-failing', defaults, function (er) { + t.equals(er.message, 'payment required : @scoped/package-failing') + }) + + client.request(common.registry + '/not-found-no-body', defaults, function (er) { + t.equals(er.message, '404 Not Found') + t.equals(er.statusCode, 404, 'got back 404 as .statusCode') + t.equals(er.code, 'E404', 'got back expected string code') + t.notOk(er.pkgid, "no package name returned when there's no body on response") + t.ok(typeof er !== 'string', "Error shouldn't be returned as string.") + }) +}) + +test('outputs notice if npm-notice header is set', function (t) { + var client = common.freshClient({ + log: { + error: noop, + warn: function (prefix, msg) { + warnings.push(msg) + }, + info: noop, + verbose: noop, + silly: noop, + http: noop, + pause: noop, + resume: noop + } + }) + var message = 'notice me!' + var warnings = [] + + function noop () {} + + server.expect('GET', '/npm-notice', function (req, res) { + req.pipe(concat(function () { + res.statusCode = 200 + res.setHeader('npm-notice', message) + res.end() + })) + }) + + client.request(common.registry + '/npm-notice', {}, function (er) { + t.notEqual(warnings.indexOf(message), -1, 'notice not printed') + t.end() + }) +}) + +test('cleanup', function (t) { + server.close() + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/retries.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/retries.js new file mode 100644 index 00000000..a75cbf7e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/retries.js @@ -0,0 +1,52 @@ +var tap = require('tap') + +var server = require('./lib/server.js') +var common = require('./lib/common.js') +var client = common.freshClient({ + retry: { + retries: 6, + minTimeout: 10, + maxTimeout: 100 + } +}) + +var pkg = { + _id: 'some-package@1.2.3', + name: 'some-package', + version: '1.2.3' +} + +tap.test('create new user account', function (t) { + // first time, return a 408 + server.expect('GET', '/some-package/1.2.3', function (req, res) { + res.statusCode = 408 + res.end('Timeout') + }) + // then, slam the door in their face + server.expect('GET', '/some-package/1.2.3', function (req, res) { + res.destroy() + }) + // then, blame someone else + server.expect('GET', '/some-package/1.2.3', function (req, res) { + res.statusCode = 502 + res.end('Gateway Timeout') + }) + // 'No one's home right now, come back later' + server.expect('GET', '/some-package/1.2.3', function (req, res) { + res.statusCode = 503 + res.setHeader('retry-after', '10') + res.end('Come back later') + }) + // finally, you may enter. + server.expect('GET', '/some-package/1.2.3', function (req, res) { + res.statusCode = 200 + res.json(pkg) + }) + + client.get('http://localhost:1337/some-package/1.2.3', {}, function (er, data) { + if (er) throw er + t.deepEqual(data, pkg) + server.close() + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/star.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/star.js new file mode 100644 index 00000000..e9e60266 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/star.js @@ -0,0 +1,176 @@ +var test = require('tap').test +var server = require('./lib/server.js') +var common = require('./lib/common.js') +var client = common.freshClient() +var cache = require('./fixtures/underscore/cache.json') +var nock = require('nock') + +function nop () {} + +var URI = 'https://npm.registry:8043/rewrite' +var STARRED = true +var USERNAME = 'username' +var PASSWORD = '%1234@asdf%' +var EMAIL = 'i@izs.me' +var AUTH = { + username: USERNAME, + password: PASSWORD, + email: EMAIL +} +var PARAMS = { + starred: STARRED, + auth: AUTH +} + +test('star call contract', function (t) { + t.throws(function () { + client.star(undefined, PARAMS, nop) + }, 'requires a URI') + + t.throws(function () { + client.star([], PARAMS, nop) + }, 'requires URI to be a string') + + t.throws(function () { + client.star(URI, undefined, nop) + }, 'requires params object') + + t.throws(function () { + client.star(URI, '', nop) + }, 'params must be object') + + t.throws(function () { + client.star(URI, PARAMS, undefined) + }, 'requires callback') + + t.throws(function () { + client.star(URI, PARAMS, 'callback') + }, 'callback must be function') + + t.throws( + function () { + var params = { starred: STARRED } + client.star(URI, params, nop) + }, + { name: 'AssertionError', message: 'must pass auth to star' }, + 'params must include auth' + ) + + t.end() +}) + +test('star a package', function (t) { + server.expect('GET', '/underscore?write=true', function (req, res) { + t.equal(req.method, 'GET') + + res.json(cache) + }) + + server.expect('PUT', '/underscore', function (req, res) { + t.equal(req.method, 'PUT') + + var b = '' + req.setEncoding('utf8') + req.on('data', function (d) { + b += d + }) + + req.on('end', function () { + var updated = JSON.parse(b) + + var already = [ + 'vesln', 'mvolkmann', 'lancehunt', 'mikl', 'linus', 'vasc', 'bat', + 'dmalam', 'mbrevoort', 'danielr', 'rsimoes', 'thlorenz' + ] + for (var i = 0; i < already.length; i++) { + var current = already[i] + t.ok( + updated.users[current], + current + ' still likes this package' + ) + } + t.ok(updated.users[USERNAME], 'user is in the starred list') + + res.statusCode = 201 + res.json({ starred: true }) + }) + }) + + var params = { starred: STARRED, auth: AUTH } + + client.star('http://localhost:1337/underscore', params, function (er, data) { + t.ifError(er, 'no errors') + t.ok(data.starred, 'was starred') + + t.end() + }) +}) + +test('if password auth, only sets authorization on put', function (t) { + var starGet = nock('http://localhost:1010') + .get('/underscore?write=true') + .reply(200, {}) + + var starPut = nock('http://localhost:1010', { + reqheaders: { + authorization: 'Basic ' + new Buffer(AUTH.username + ':' + + AUTH.password).toString('base64') + } + }) + .put('/underscore') + .reply(200) + + var params = { starred: STARRED, auth: AUTH } + + client.star('http://localhost:1010/underscore', params, function (er) { + t.ifError(er, 'starred without issues') + starGet.done() + starPut.done() + t.end() + }) +}) + +test('if token auth, sets bearer on get and put', function (t) { + var starGet = nock('http://localhost:1010', { + reqheaders: { + authorization: 'Bearer foo' + } + }) + .get('/underscore?write=true') + .reply(200, {}) + + var getUser = nock('http://localhost:1010', { + reqheaders: { + authorization: 'Bearer foo' + } + }) + .get('/-/whoami') + .reply(200, { username: 'bcoe' }) + + var starPut = nock('http://localhost:1010', { + reqheaders: { + authorization: 'Bearer foo' + } + }) + .put('/underscore') + .reply(200) + + var params = { + starred: STARRED, + auth: { + token: 'foo' + } + } + client.star('http://localhost:1010/underscore', params, function (er) { + t.ifError(er, 'starred without error') + starGet.done() + starPut.done() + getUser.done() + t.end() + }) +}) + +test('cleanup', function (t) { + server.close() + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/stars.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/stars.js new file mode 100644 index 00000000..a5e713c5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/stars.js @@ -0,0 +1,81 @@ +var test = require('tap').test + +var server = require('./lib/server.js') +var common = require('./lib/common.js') +var client = common.freshClient() + +function nop () {} + +var URI = 'https://npm.registry:8043/rewrite' +var USERNAME = 'sample' +var PASSWORD = '%1234@asdf%' +var EMAIL = 'i@izs.me' +var AUTH = { + username: USERNAME, + password: PASSWORD, + email: EMAIL +} +var PARAMS = { + username: USERNAME, + auth: AUTH +} +var USERS = [ + 'benjamincoe', + 'seldo', + 'ceejbot' +] + +test('stars call contract', function (t) { + t.throws(function () { + client.stars(undefined, PARAMS, nop) + }, 'requires a URI') + + t.throws(function () { + client.stars([], PARAMS, nop) + }, 'requires URI to be a string') + + t.throws(function () { + client.stars(URI, undefined, nop) + }, 'requires params object') + + t.throws(function () { + client.stars(URI, '', nop) + }, 'params must be object') + + t.throws(function () { + client.stars(URI, PARAMS, undefined) + }, 'requires callback') + + t.throws(function () { + client.stars(URI, PARAMS, 'callback') + }, 'callback must be function') + + t.test('no username anywhere', function (t) { + var params = {} + client.stars(URI, params, function (err) { + t.equal( + err && err.message, + 'must pass either username or auth to stars', + 'username must not be empty') + t.end() + }) + }) + + t.end() +}) + +test('get the stars for a package', function (t) { + server.expect('GET', '/-/_view/starredByUser?key=%22sample%22', function (req, res) { + t.equal(req.method, 'GET') + + res.json(USERS) + }) + + client.stars('http://localhost:1337/', PARAMS, function (er, info) { + t.ifError(er, 'no errors') + t.deepEqual(info, USERS, 'got the list of users') + + server.close() + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/tag.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/tag.js new file mode 100644 index 00000000..e10490ee --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/tag.js @@ -0,0 +1,108 @@ +var test = require('tap').test + +var server = require('./lib/server.js') +var common = require('./lib/common.js') +var client = common.freshClient() + +function nop () {} + +var URI = 'http://localhost:1337/underscore' +var USERNAME = 'username' +var PASSWORD = '%1234@asdf%' +var EMAIL = 'i@izs.me' +var VERSION = '1.3.2' +var TAG = 'not-lodash' +var AUTH = { + username: USERNAME, + password: PASSWORD, + email: EMAIL +} +var PARAMS = { + tag: TAG, + version: VERSION, + auth: AUTH +} + +test('tag call contract', function (t) { + t.throws(function () { + client.tag(undefined, AUTH, nop) + }, 'requires a URI') + + t.throws(function () { + client.tag([], AUTH, nop) + }, 'requires URI to be a string') + + t.throws(function () { + client.tag(URI, undefined, nop) + }, 'requires params object') + + t.throws(function () { + client.tag(URI, '', nop) + }, 'params must be object') + + t.throws(function () { + client.tag(URI, AUTH, undefined) + }, 'requires callback') + + t.throws(function () { + client.tag(URI, AUTH, 'callback') + }, 'callback must be function') + + t.throws( + function () { + var params = { tag: TAG, auth: AUTH } + client.tag(URI, params, nop) + }, + { name: 'AssertionError', message: 'must pass version to tag' }, + 'tag must include version' + ) + + t.throws( + function () { + var params = { version: VERSION, auth: AUTH } + client.tag(URI, params, nop) + }, + { name: 'AssertionError', message: 'must pass tag name to tag' }, + 'tag must include name' + ) + + t.throws( + function () { + var params = { version: VERSION, tag: TAG } + client.tag(URI, params, nop) + }, + { name: 'AssertionError', message: 'must pass auth to tag' }, + 'params must include auth' + ) + + t.end() +}) + +test('tag a package', function (t) { + server.expect('PUT', '/underscore/not-lodash', function (req, res) { + t.equal(req.method, 'PUT') + + var b = '' + req.setEncoding('utf8') + req.on('data', function (d) { + b += d + }) + + req.on('end', function () { + var updated = JSON.parse(b) + + t.deepEqual(updated, '1.3.2') + + res.statusCode = 201 + res.json({ tagged: true }) + }) + }) + + client.tag(URI, PARAMS, function (error, data) { + t.ifError(error, 'no errors') + t.ok(data.tagged, 'was tagged') + + server.close() + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/team.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/team.js new file mode 100644 index 00000000..ffbd18fc --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/team.js @@ -0,0 +1,215 @@ +var test = require('tap').test + +var server = require('./lib/server.js') +var common = require('./lib/common.js') +var client = common.freshClient() + +function nop () {} + +var URI = 'http://localhost:1337' +var PARAMS = { + auth: { + token: 'foo' + }, + scope: 'myorg', + team: 'myteam' +} + +var commands = ['create', 'destroy', 'add', 'rm', 'ls'] + +test('team create basic', function (t) { + var teamData = { + name: PARAMS.team, + scope_id: 1234, + created: '2015-07-23T18:07:49.959Z', + updated: '2015-07-23T18:07:49.959Z', + deleted: null + } + server.expect('PUT', '/-/org/myorg/team', function (req, res) { + t.equal(req.method, 'PUT') + onJsonReq(req, function (json) { + t.same(json, { name: PARAMS.team }) + res.statusCode = 200 + res.json(teamData) + }) + }) + client.team('create', URI, PARAMS, function (err, data) { + t.ifError(err, 'no errors') + t.same(data, teamData) + t.end() + }) +}) + +test('team destroy', function (t) { + var teamData = { + name: 'myteam', + scope_id: 1234, + created: '2015-07-23T18:07:49.959Z', + updated: '2015-07-23T18:07:49.959Z', + deleted: '2015-07-23T18:27:27.178Z' + } + server.expect('DELETE', '/-/team/myorg/myteam', function (req, res) { + t.equal(req.method, 'DELETE') + onJsonReq(req, function (json) { + t.same(json, undefined) + res.statusCode = 200 + res.json(teamData) + }) + }) + client.team('destroy', URI, PARAMS, function (err, data) { + t.ifError(err, 'no errors') + t.same(data, teamData) + t.end() + }) +}) + +test('team add basic', function (t) { + var params = Object.create(PARAMS) + params.user = 'zkat' + server.expect('PUT', '/-/team/myorg/myteam/user', function (req, res) { + t.equal(req.method, 'PUT') + onJsonReq(req, function (json) { + t.same(json, { user: params.user }) + res.statusCode = 200 + res.json(undefined) + }) + }) + client.team('add', URI, params, function (err, data) { + t.ifError(err, 'no errors') + t.same(data, undefined) + t.end() + }) +}) + +test('team add user not in org', function (t) { + var params = Object.create(PARAMS) + params.user = 'zkat' + var errMsg = 'user is already in team' + server.expect('PUT', '/-/team/myorg/myteam/user', function (req, res) { + t.equal(req.method, 'PUT') + res.statusCode = 400 + res.json({ + error: errMsg + }) + }) + client.team('add', URI, params, function (err, data) { + t.equal(err.message, errMsg + ' : ' + '-/team/myorg/myteam/user') + t.same(data, {error: errMsg}) + t.end() + }) +}) + +test('team rm basic', function (t) { + var params = Object.create(PARAMS) + params.user = 'bcoe' + server.expect('DELETE', '/-/team/myorg/myteam/user', function (req, res) { + t.equal(req.method, 'DELETE') + onJsonReq(req, function (json) { + t.same(json, params) + res.statusCode = 200 + res.json(undefined) + }) + }) + client.team('rm', URI, params, function (err, data) { + t.ifError(err, 'no errors') + t.same(data, undefined) + t.end() + }) +}) + +test('team ls (on org)', function (t) { + var params = Object.create(PARAMS) + params.team = null + var teams = ['myorg:team1', 'myorg:team2', 'myorg:team3'] + server.expect('GET', '/-/org/myorg/team?format=cli', function (req, res) { + t.equal(req.method, 'GET') + onJsonReq(req, function (json) { + t.same(json, undefined) + res.statusCode = 200 + res.json(teams) + }) + }) + client.team('ls', URI, params, function (err, data) { + t.ifError(err, 'no errors') + t.same(data, teams) + t.end() + }) +}) + +test('team ls (on team)', function (t) { + var uri = '/-/team/myorg/myteam/user?format=cli' + var users = ['zkat', 'bcoe'] + server.expect('GET', uri, function (req, res) { + t.equal(req.method, 'GET') + onJsonReq(req, function (json) { + t.same(json, undefined) + res.statusCode = 200 + res.json(users) + }) + }) + client.team('ls', URI, PARAMS, function (err, data) { + t.ifError(err, 'no errors') + t.same(data, users) + t.end() + }) +}) + +// test('team edit', function (t) { +// server.expect('PUT', '/-/org/myorg/team', function (req, res) { +// t.equal(req.method, 'PUT') +// res.statusCode = 201 +// res.json({}) +// }) +// client.team('create', URI, PARAMS, function (err, data) { +// t.ifError(err, 'no errors') +// t.end() +// }) +// }) + +test('team command base validation', function (t) { + t.throws(function () { + client.team(undefined, URI, PARAMS, nop) + }, 'command is required') + commands.forEach(function (cmd) { + t.throws(function () { + client.team(cmd, undefined, PARAMS, nop) + }, 'registry URI is required') + t.throws(function () { + client.team(cmd, URI, undefined, nop) + }, 'params is required') + t.throws(function () { + client.team(cmd, URI, {scope: 'o', team: 't'}, nop) + }, 'auth is required') + t.throws(function () { + client.team(cmd, URI, {auth: {token: 'f'}, team: 't'}, nop) + }, 'scope is required') + t.throws(function () { + client.team(cmd, URI, PARAMS, {}) + }, 'callback must be a function') + if (cmd !== 'ls') { + t.throws(function () { + client.team( + cmd, URI, {auth: {token: 'f'}, scope: 'o'}, nop) + }, 'team name is required') + } + if (cmd === 'add' || cmd === 'rm') { + t.throws(function () { + client.team( + cmd, URI, PARAMS, nop) + }, 'user is required') + } + }) + t.end() +}) + +test('cleanup', function (t) { + server.close() + t.end() +}) + +function onJsonReq (req, cb) { + var buffer = '' + req.setEncoding('utf8') + req.on('data', function (data) { buffer += data }) + req.on('end', function () { cb(buffer ? JSON.parse(buffer) : undefined) }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/unpublish-scoped.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/unpublish-scoped.js new file mode 100644 index 00000000..26d4ac7b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/unpublish-scoped.js @@ -0,0 +1,68 @@ +var test = require('tap').test + +var server = require('./lib/server.js') +var common = require('./lib/common.js') +var client = common.freshClient() + +var cache = require('./fixtures/@npm/npm-registry-client/cache.json') + +var REV = '/-rev/213-0a1049cf56172b7d9a1184742c6477b9' +var PACKAGE = '/@npm%2fnpm-registry-client' +var URI = common.registry + PACKAGE +var TOKEN = 'of-glad-tidings' +var VERSION = '3.0.6' +var AUTH = { + token: TOKEN +} +var PARAMS = { + version: VERSION, + auth: AUTH +} + +test('unpublish a package', function (t) { + server.expect('GET', '/@npm%2fnpm-registry-client?write=true', function (req, res) { + t.equal(req.method, 'GET') + + res.json(cache) + }) + + server.expect('PUT', '/@npm%2fnpm-registry-client' + REV, function (req, res) { + t.equal(req.method, 'PUT') + + var b = '' + req.setEncoding('utf-8') + req.on('data', function (d) { + b += d + }) + + req.on('end', function () { + var updated = JSON.parse(b) + t.notOk(updated.versions[VERSION]) + }) + + res.json(cache) + }) + + server.expect('GET', PACKAGE, function (req, res) { + t.equal(req.method, 'GET') + + res.json(cache) + }) + + server.expect( + 'DELETE', + PACKAGE + '/-' + PACKAGE + '-' + VERSION + '.tgz' + REV, + function (req, res) { + t.equal(req.method, 'DELETE') + + res.json({ unpublished: true }) + } + ) + + client.unpublish(URI, PARAMS, function (er) { + t.ifError(er, 'no errors') + + server.close() + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/unpublish.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/unpublish.js new file mode 100644 index 00000000..8a114c89 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/unpublish.js @@ -0,0 +1,104 @@ +var test = require('tap').test + +var server = require('./lib/server.js') +var common = require('./lib/common.js') +var client = common.freshClient() + +var cache = require('./fixtures/underscore/cache.json') + +function nop () {} + +var REV = '/-rev/72-47f2986bfd8e8b55068b204588bbf484' +var URI = 'http://localhost:1337/underscore' +var TOKEN = 'of-glad-tidings' +var VERSION = '1.3.2' +var AUTH = { + token: TOKEN +} +var PARAMS = { + version: VERSION, + auth: AUTH +} + +test('unpublish call contract', function (t) { + t.throws(function () { + client.unpublish(undefined, AUTH, nop) + }, 'requires a URI') + + t.throws(function () { + client.unpublish([], AUTH, nop) + }, 'requires URI to be a string') + + t.throws(function () { + client.unpublish(URI, undefined, nop) + }, 'requires params object') + + t.throws(function () { + client.unpublish(URI, '', nop) + }, 'params must be object') + + t.throws(function () { + client.unpublish(URI, AUTH, undefined) + }, 'requires callback') + + t.throws(function () { + client.unpublish(URI, AUTH, 'callback') + }, 'callback must be function') + + t.throws( + function () { + var params = { + version: VERSION + } + client.unpublish(URI, params, nop) + }, + { name: 'AssertionError', message: 'must pass auth to unpublish' }, + 'must pass auth to unpublish' + ) + + t.end() +}) + +test('unpublish a package', function (t) { + server.expect('GET', '/underscore?write=true', function (req, res) { + t.equal(req.method, 'GET') + + res.json(cache) + }) + + server.expect('PUT', '/underscore' + REV, function (req, res) { + t.equal(req.method, 'PUT') + + var b = '' + req.setEncoding('utf-8') + req.on('data', function (d) { + b += d + }) + + req.on('end', function () { + var updated = JSON.parse(b) + t.notOk(updated.versions[VERSION]) + }) + + res.json(cache) + }) + + server.expect('GET', '/underscore', function (req, res) { + t.equal(req.method, 'GET') + + res.json(cache) + }) + + server.expect('DELETE', '/underscore/-/underscore-1.3.2.tgz' + REV, function (req, res) { + t.equal(req.method, 'DELETE') + + res.json({ unpublished: true }) + }) + + client.unpublish(URI, PARAMS, function (error) { + t.ifError(error, 'no errors') + + server.close() + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/whoami.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/whoami.js new file mode 100644 index 00000000..80979ee9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/whoami.js @@ -0,0 +1,70 @@ +var test = require('tap').test + +var server = require('./lib/server.js') +var common = require('./lib/common.js') +var client = common.freshClient() + +function nop () {} + +var WHOIAM = 'wombat' +var TOKEN = 'not-bad-meaning-bad-but-bad-meaning-wombat' +var AUTH = { token: TOKEN } +var PARAMS = { auth: AUTH } + +test('whoami call contract', function (t) { + t.throws(function () { + client.whoami(undefined, AUTH, nop) + }, 'requires a URI') + + t.throws(function () { + client.whoami([], AUTH, nop) + }, 'requires URI to be a string') + + t.throws(function () { + client.whoami(common.registry, undefined, nop) + }, 'requires params object') + + t.throws(function () { + client.whoami(common.registry, '', nop) + }, 'params must be object') + + t.throws(function () { + client.whoami(common.registry, AUTH, undefined) + }, 'requires callback') + + t.throws(function () { + client.whoami(common.registry, AUTH, 'callback') + }, 'callback must be function') + + t.throws( + function () { + var params = {} + client.whoami(common.registry, params, nop) + }, + { name: 'AssertionError', message: 'must pass auth to whoami' }, + 'must pass auth to whoami' + ) + + t.end() +}) + +test('whoami', function (t) { + server.expect('GET', '/-/whoami', function (req, res) { + t.equal(req.method, 'GET') + // only available for token-based auth for now + t.equal( + req.headers.authorization, + 'Bearer not-bad-meaning-bad-but-bad-meaning-wombat' + ) + + res.json({ username: WHOIAM }) + }) + + client.whoami(common.registry, PARAMS, function (error, wombat) { + t.ifError(error, 'no errors') + t.equal(wombat, WHOIAM, 'im a wombat') + + server.close() + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/zz-cleanup.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/zz-cleanup.js new file mode 100644 index 00000000..16e4ee8a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-registry-client/test/zz-cleanup.js @@ -0,0 +1,11 @@ +var join = require('path').join +var rimraf = require('rimraf') +var tap = require('tap') + +tap.test('teardown', function (t) { + rimraf(join(__dirname, 'fixtures', 'cache'), function (er) { + if (er) throw er + t.pass('cache cleaned') + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-user-validate/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-user-validate/.npmignore new file mode 100644 index 00000000..39747c08 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-user-validate/.npmignore @@ -0,0 +1,13 @@ +*.swp +.*.swp + +.DS_Store +*~ +.project +.settings +npm-debug.log +coverage.html +.idea +lib-cov + +node_modules \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-user-validate/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-user-validate/.travis.yml new file mode 100644 index 00000000..6ff074b7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-user-validate/.travis.yml @@ -0,0 +1,7 @@ +language: node_js +before_install: +- npm install -g npm@latest +sudo: false +node_js: + - "0.8" + - "0.10" diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-user-validate/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-user-validate/LICENSE new file mode 100644 index 00000000..79128b23 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-user-validate/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) Robert Kowalski +All rights reserved. + +The BSD License + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-user-validate/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-user-validate/README.md new file mode 100644 index 00000000..53bdae5a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-user-validate/README.md @@ -0,0 +1,6 @@ +[![Build Status](https://travis-ci.org/npm/npm-user-validate.png?branch=master)](https://travis-ci.org/npm/npm-user-validate) +[![devDependency Status](https://david-dm.org/npm/npm-user-validate/dev-status.png)](https://david-dm.org/npm/npm-user-validate#info=devDependencies) + +# npm-user-validate + +Validation for the npm client and npm-www (and probably other npm projects) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-user-validate/npm-user-validate.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-user-validate/npm-user-validate.js new file mode 100644 index 00000000..3a645ec9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-user-validate/npm-user-validate.js @@ -0,0 +1,48 @@ +exports.email = email +exports.pw = pw +exports.username = username + +var requirements = exports.requirements = { + username: { + length: 'Name length must be less than or equal to 214 characters long', + lowerCase: 'Name must be lowercase', + urlSafe: 'Name may not contain non-url-safe chars', + dot: 'Name may not start with "."' + }, + password: {}, + email: { + valid: 'Email must be an email address' + } +}; + +function username (un) { + if (un !== un.toLowerCase()) { + return new Error(requirements.username.lowerCase) + } + + if (un !== encodeURIComponent(un)) { + return new Error(requirements.username.urlSafe) + } + + if (un.charAt(0) === '.') { + return new Error(requirements.username.dot) + } + + if (un.length > 214) { + return new Error(requirements.username.length) + } + + return null +} + +function email (em) { + if (!em.match(/^.+@.+\..+$/)) { + return new Error(requirements.email.valid) + } + + return null +} + +function pw (pw) { + return null +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-user-validate/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-user-validate/package.json new file mode 100644 index 00000000..1b355564 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-user-validate/package.json @@ -0,0 +1,65 @@ +{ + "name": "npm-user-validate", + "version": "0.1.5", + "description": "User validations for npm", + "main": "npm-user-validate.js", + "devDependencies": { + "tap": "^1.2.0" + }, + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/npm/npm-user-validate.git" + }, + "keywords": [ + "npm", + "validation", + "registry" + ], + "author": { + "name": "Robert Kowalski", + "email": "rok@kowalski.gd" + }, + "license": "BSD-2-Clause", + "gitHead": "688552a47e6c22cd07206894dcd21b9d7a37ee56", + "bugs": { + "url": "https://github.com/npm/npm-user-validate/issues" + }, + "homepage": "https://github.com/npm/npm-user-validate#readme", + "_id": "npm-user-validate@0.1.5", + "_shasum": "52465d50c2d20294a57125b996baedbf56c5004b", + "_from": "npm-user-validate@0.1.5", + "_npmVersion": "3.10.1", + "_nodeVersion": "5.11.0", + "_npmUser": { + "name": "aredridel", + "email": "aria@npmjs.com" + }, + "dist": { + "shasum": "52465d50c2d20294a57125b996baedbf56c5004b", + "tarball": "https://registry.npmjs.org/npm-user-validate/-/npm-user-validate-0.1.5.tgz" + }, + "maintainers": [ + { + "name": "aredridel", + "email": "aria@npmjs.com" + }, + { + "name": "isaacs", + "email": "i@izs.me" + }, + { + "name": "robertkowalski", + "email": "rok@kowalski.gd" + } + ], + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/npm-user-validate-0.1.5.tgz_1466436459441_0.15483755711466074" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/npm-user-validate/-/npm-user-validate-0.1.5.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-user-validate/test/email.test.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-user-validate/test/email.test.js new file mode 100644 index 00000000..1060a935 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-user-validate/test/email.test.js @@ -0,0 +1,26 @@ +var test = require('tap').test +var v = require('../npm-user-validate.js').email + +test('email misses an @', function (t) { + err = v('namedomain') + t.type(err, 'object') + t.end() +}) + +test('email misses a dot', function (t) { + err = v('name@domain') + t.type(err, 'object') + t.end() +}) + +test('email misses a string before the @', function (t) { + err = v('@domain') + t.type(err, 'object') + t.end() +}) + +test('email is ok', function (t) { + err = v('name@domain.com') + t.type(err, 'null') + t.end() +}) \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-user-validate/test/pw.test.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-user-validate/test/pw.test.js new file mode 100644 index 00000000..d57401da --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-user-validate/test/pw.test.js @@ -0,0 +1,32 @@ +var test = require('tap').test +var v = require('../npm-user-validate.js').pw + +test('pw contains a \'', function (t) { + err = v('\'') + t.type(err, 'null') + t.end() +}) + +test('pw contains a :', function (t) { + err = v(':') + t.type(err, 'null') + t.end() +}) + +test('pw contains a @', function (t) { + err = v('@') + t.notOk(err, 'null') + t.end() +}) + +test('pw contains a "', function (t) { + err = v('"') + t.type(err, 'null') + t.end() +}) + +test('pw is ok', function (t) { + err = v('duck') + t.type(err, 'null') + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-user-validate/test/username.test.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-user-validate/test/username.test.js new file mode 100644 index 00000000..aa0e6b33 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npm-user-validate/test/username.test.js @@ -0,0 +1,42 @@ +var test = require('tap').test +var v = require('../npm-user-validate.js').username + +test('username must be lowercase', function (t) { + var err = v('ERRR') + t.type(err, 'object') + t.match(err.message, /lowercase/) + t.end() +}) + +test('username may not contain non-url-safe chars', function (t) { + var err = v('f ') + t.type(err, 'object') + t.match(err.message, /url-safe/) + t.end() +}) + +test('username may not start with "."', function (t) { + var err = v('.username') + t.type(err, 'object') + t.match(err.message, /start with.*\./) + t.end() +}) + +test('username may not be longer than 214 characters', function (t) { + var err = v('bacon-ipsum-dolor-amet-tongue-short-loin-landjaeger-tenderloin-ball-tip-pork-loin-porchetta-pig-pork-chop-beef-ribs-pork-belly--shankle-t-bone-turducken-tongue-landjaeger-pork-loin-beef-chicken-short-loin-and-pickle') + t.type(err, 'object') + t.match(err.message, /less than or equal to 214/) + t.end() +}); + +test('username may be as long as 214 characters', function (t) { + var err = v('bacon-ipsum-dolor-amet-tongue-short-loin-landjaeger-tenderloin-ball-tip-pork-loin-porchetta-pig-pork-chop-beef-ribs-pork-belly--shankle-t-bone-turducken-tongue-landjaeger-pork-loin-beef-chicken-short-loin-porchetta') + t.type(err, 'null') + t.end() +}); + +test('username is ok', function (t) { + var err = v('ente') + t.type(err, 'null') + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/README.md new file mode 100644 index 00000000..a57cf429 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/README.md @@ -0,0 +1,195 @@ +# npmlog + +The logger util that npm uses. + +This logger is very basic. It does the logging for npm. It supports +custom levels and colored output. + +By default, logs are written to stderr. If you want to send log messages +to outputs other than streams, then you can change the `log.stream` +member, or you can just listen to the events that it emits, and do +whatever you want with them. + +# Basic Usage + +``` +var log = require('npmlog') + +// additional stuff ---------------------------+ +// message ----------+ | +// prefix ----+ | | +// level -+ | | | +// v v v v + log.info('fyi', 'I have a kitty cat: %j', myKittyCat) +``` + +## log.level + +* {String} + +The level to display logs at. Any logs at or above this level will be +displayed. The special level `silent` will prevent anything from being +displayed ever. + +## log.record + +* {Array} + +An array of all the log messages that have been entered. + +## log.maxRecordSize + +* {Number} + +The maximum number of records to keep. If log.record gets bigger than +10% over this value, then it is sliced down to 90% of this value. + +The reason for the 10% window is so that it doesn't have to resize a +large array on every log entry. + +## log.prefixStyle + +* {Object} + +A style object that specifies how prefixes are styled. (See below) + +## log.headingStyle + +* {Object} + +A style object that specifies how the heading is styled. (See below) + +## log.heading + +* {String} Default: "" + +If set, a heading that is printed at the start of every line. + +## log.stream + +* {Stream} Default: `process.stderr` + +The stream where output is written. + +## log.enableColor() + +Force colors to be used on all messages, regardless of the output +stream. + +## log.disableColor() + +Disable colors on all messages. + +## log.enableProgress() + +Enable the display of log activity spinner and progress bar + +## log.disableProgress() + +Disable the display of a progress bar + +## log.enableUnicode() + +Force the unicode theme to be used for the progress bar. + +## log.disableUnicode() + +Disable the use of unicode in the progress bar. + +## log.setGaugeTemplate(template) + +Overrides the default gauge template. + +## log.pause() + +Stop emitting messages to the stream, but do not drop them. + +## log.resume() + +Emit all buffered messages that were written while paused. + +## log.log(level, prefix, message, ...) + +* `level` {String} The level to emit the message at +* `prefix` {String} A string prefix. Set to "" to skip. +* `message...` Arguments to `util.format` + +Emit a log message at the specified level. + +## log\[level](prefix, message, ...) + +For example, + +* log.silly(prefix, message, ...) +* log.verbose(prefix, message, ...) +* log.info(prefix, message, ...) +* log.http(prefix, message, ...) +* log.warn(prefix, message, ...) +* log.error(prefix, message, ...) + +Like `log.log(level, prefix, message, ...)`. In this way, each level is +given a shorthand, so you can do `log.info(prefix, message)`. + +## log.addLevel(level, n, style, disp) + +* `level` {String} Level indicator +* `n` {Number} The numeric level +* `style` {Object} Object with fg, bg, inverse, etc. +* `disp` {String} Optional replacement for `level` in the output. + +Sets up a new level with a shorthand function and so forth. + +Note that if the number is `Infinity`, then setting the level to that +will cause all log messages to be suppressed. If the number is +`-Infinity`, then the only way to show it is to enable all log messages. + +## log.newItem(name, todo, weight) + +* `name` {String} Optional; progress item name. +* `todo` {Number} Optional; total amount of work to be done. Default 0. +* `weight` {Number} Optional; the weight of this item relative to others. Default 1. + +This adds a new `are-we-there-yet` item tracker to the progress tracker. The +object returned has the `log[level]` methods but is otherwise an +`are-we-there-yet` `Tracker` object. + +## log.newStream(name, todo, weight) + +This adds a new `are-we-there-yet` stream tracker to the progress tracker. The +object returned has the `log[level]` methods but is otherwise an +`are-we-there-yet` `TrackerStream` object. + +## log.newGroup(name, weight) + +This adds a new `are-we-there-yet` tracker group to the progress tracker. The +object returned has the `log[level]` methods but is otherwise an +`are-we-there-yet` `TrackerGroup` object. + +# Events + +Events are all emitted with the message object. + +* `log` Emitted for all messages +* `log.` Emitted for all messages with the `` level. +* `` Messages with prefixes also emit their prefix as an event. + +# Style Objects + +Style objects can have the following fields: + +* `fg` {String} Color for the foreground text +* `bg` {String} Color for the background +* `bold`, `inverse`, `underline` {Boolean} Set the associated property +* `bell` {Boolean} Make a noise (This is pretty annoying, probably.) + +# Message Objects + +Every log event is emitted with a message object, and the `log.record` +list contains all of them that have been created. They have the +following fields: + +* `id` {Number} +* `level` {String} +* `prefix` {String} +* `message` {String} Result of `util.format()` +* `messageRaw` {Array} Arguments to `util.format()` diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/log.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/log.js new file mode 100644 index 00000000..8d781f17 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/log.js @@ -0,0 +1,251 @@ +'use strict' +var Progress = require('are-we-there-yet') +var Gauge = require('gauge') +var EE = require('events').EventEmitter +var log = exports = module.exports = new EE +var util = require('util') + +var ansi = require('ansi') +log.cursor = ansi(process.stderr) +log.stream = process.stderr + +// by default, let ansi decide based on tty-ness. +var colorEnabled = undefined +log.enableColor = function () { + colorEnabled = true + this.cursor.enabled = true +} +log.disableColor = function () { + colorEnabled = false + this.cursor.enabled = false +} + +// default level +log.level = 'info' + +log.gauge = new Gauge(log.cursor) +log.tracker = new Progress.TrackerGroup() + +// no progress bars unless asked +log.progressEnabled = false + +var gaugeTheme = undefined + +log.enableUnicode = function () { + gaugeTheme = Gauge.unicode + log.gauge.setTheme(gaugeTheme) +} + +log.disableUnicode = function () { + gaugeTheme = Gauge.ascii + log.gauge.setTheme(gaugeTheme) +} + +var gaugeTemplate = undefined +log.setGaugeTemplate = function (template) { + gaugeTemplate = template + log.gauge.setTemplate(gaugeTemplate) +} + +log.enableProgress = function () { + if (this.progressEnabled) return + this.progressEnabled = true + if (this._pause) return + this.tracker.on('change', this.showProgress) + this.gauge.enable() + this.showProgress() +} + +log.disableProgress = function () { + if (!this.progressEnabled) return + this.clearProgress() + this.progressEnabled = false + this.tracker.removeListener('change', this.showProgress) + this.gauge.disable() +} + +var trackerConstructors = ['newGroup', 'newItem', 'newStream'] + +var mixinLog = function (tracker) { + // mixin the public methods from log into the tracker + // (except: conflicts and one's we handle specially) + Object.keys(log).forEach(function (P) { + if (P[0] === '_') return + if (trackerConstructors.filter(function (C) { return C === P }).length) return + if (tracker[P]) return + if (typeof log[P] !== 'function') return + var func = log[P] + tracker[P] = function () { + return func.apply(log, arguments) + } + }) + // if the new tracker is a group, make sure any subtrackers get + // mixed in too + if (tracker instanceof Progress.TrackerGroup) { + trackerConstructors.forEach(function (C) { + var func = tracker[C] + tracker[C] = function () { return mixinLog(func.apply(tracker, arguments)) } + }) + } + return tracker +} + +// Add tracker constructors to the top level log object +trackerConstructors.forEach(function (C) { + log[C] = function () { return mixinLog(this.tracker[C].apply(this.tracker, arguments)) } +}) + +log.clearProgress = function () { + if (!this.progressEnabled) return + this.gauge.hide() +} + +log.showProgress = function (name, completed) { + if (!this.progressEnabled) return + if (completed == null) completed = this.tracker.completed() + this.gauge.show(name, completed) +}.bind(log) // bind for use in tracker's on-change listener + +// temporarily stop emitting, but don't drop +log.pause = function () { + this._paused = true +} + +log.resume = function () { + if (!this._paused) return + this._paused = false + + var b = this._buffer + this._buffer = [] + b.forEach(function (m) { + this.emitLog(m) + }, this) + if (this.progressEnabled) this.enableProgress() +} + +log._buffer = [] + +var id = 0 +log.record = [] +log.maxRecordSize = 10000 +log.log = function (lvl, prefix, message) { + var l = this.levels[lvl] + if (l === undefined) { + return this.emit('error', new Error(util.format( + 'Undefined log level: %j', lvl))) + } + + var a = new Array(arguments.length - 2) + var stack = null + for (var i = 2; i < arguments.length; i ++) { + var arg = a[i-2] = arguments[i] + + // resolve stack traces to a plain string. + if (typeof arg === 'object' && arg && + (arg instanceof Error) && arg.stack) { + arg.stack = stack = arg.stack + '' + } + } + if (stack) a.unshift(stack + '\n') + message = util.format.apply(util, a) + + var m = { id: id++, + level: lvl, + prefix: String(prefix || ''), + message: message, + messageRaw: a } + + this.emit('log', m) + this.emit('log.' + lvl, m) + if (m.prefix) this.emit(m.prefix, m) + + this.record.push(m) + var mrs = this.maxRecordSize + var n = this.record.length - mrs + if (n > mrs / 10) { + var newSize = Math.floor(mrs * 0.9) + this.record = this.record.slice(-1 * newSize) + } + + this.emitLog(m) +}.bind(log) + +log.emitLog = function (m) { + if (this._paused) { + this._buffer.push(m) + return + } + if (this.progressEnabled) this.gauge.pulse(m.prefix) + var l = this.levels[m.level] + if (l === undefined) return + if (l < this.levels[this.level]) return + if (l > 0 && !isFinite(l)) return + + var style = log.style[m.level] + var disp = log.disp[m.level] || m.level + this.clearProgress() + m.message.split(/\r?\n/).forEach(function (line) { + if (this.heading) { + this.write(this.heading, this.headingStyle) + this.write(' ') + } + this.write(disp, log.style[m.level]) + var p = m.prefix || '' + if (p) this.write(' ') + this.write(p, this.prefixStyle) + this.write(' ' + line + '\n') + }, this) + this.showProgress() +} + +log.write = function (msg, style) { + if (!this.cursor) return + if (this.stream !== this.cursor.stream) { + this.cursor = ansi(this.stream, { enabled: colorEnabled }) + var options = {} + if (gaugeTheme != null) options.theme = gaugeTheme + if (gaugeTemplate != null) options.template = gaugeTemplate + this.gauge = new Gauge(options, this.cursor) + } + + style = style || {} + if (style.fg) this.cursor.fg[style.fg]() + if (style.bg) this.cursor.bg[style.bg]() + if (style.bold) this.cursor.bold() + if (style.underline) this.cursor.underline() + if (style.inverse) this.cursor.inverse() + if (style.beep) this.cursor.beep() + this.cursor.write(msg).reset() +} + +log.addLevel = function (lvl, n, style, disp) { + if (!disp) disp = lvl + this.levels[lvl] = n + this.style[lvl] = style + if (!this[lvl]) this[lvl] = function () { + var a = new Array(arguments.length + 1) + a[0] = lvl + for (var i = 0; i < arguments.length; i ++) { + a[i + 1] = arguments[i] + } + return this.log.apply(this, a) + }.bind(this) + this.disp[lvl] = disp +} + +log.prefixStyle = { fg: 'magenta' } +log.headingStyle = { fg: 'white', bg: 'black' } + +log.style = {} +log.levels = {} +log.disp = {} +log.addLevel('silly', -Infinity, { inverse: true }, 'sill') +log.addLevel('verbose', 1000, { fg: 'blue', bg: 'black' }, 'verb') +log.addLevel('info', 2000, { fg: 'green' }) +log.addLevel('http', 3000, { fg: 'green', bg: 'black' }) +log.addLevel('warn', 4000, { fg: 'black', bg: 'yellow' }, 'WARN') +log.addLevel('error', 5000, { fg: 'red', bg: 'black' }, 'ERR!') +log.addLevel('silent', Infinity) + +// allow 'error' prefix +log.on('error', function(){}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/.npmignore new file mode 100644 index 00000000..bc818974 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/.npmignore @@ -0,0 +1,5 @@ +*~ +.#* +node_modules +coverage +.nyc_output diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/CHANGES.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/CHANGES.md new file mode 100644 index 00000000..e990b86d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/CHANGES.md @@ -0,0 +1,19 @@ +Hi, figured we could actually use a changelog now: + +## 1.1.1 2016-01-29 + +* Fix a typo in stream completion tracker + +## 1.1.0 2016-01-29 + +* Rewrote completion percent computation to be low impact– no more walking a + tree of completion groups every time we need this info. Previously, with + medium sized tree of completion groups, even a relatively modest number of + calls to the top level `completed()` method would result in absurd numbers + of calls overall as it walked down the tree. We now, instead, keep track as + we bubble up changes, so the computation is limited to when data changes and + to the depth of that one branch, instead of _every_ node. (Plus, we were already + incurring _this_ cost, since we already bubbled out changes.) +* Moved different tracker types out to their own files. +* Made tests test for TOO MANY events too. +* Standarized the source code formatting diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/LICENSE new file mode 100644 index 00000000..af458806 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/LICENSE @@ -0,0 +1,5 @@ +Copyright (c) 2015, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/README.md new file mode 100644 index 00000000..c41d3922 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/README.md @@ -0,0 +1,194 @@ +are-we-there-yet +---------------- + +Track complex hiearchies of asynchronous task completion statuses. This is +intended to give you a way of recording and reporting the progress of the big +recursive fan-out and gather type workflows that are so common in async. + +What you do with this completion data is up to you, but the most common use case is to +feed it to one of the many progress bar modules. + +Most progress bar modules include a rudamentary version of this, but my +needs were more complex. + +Usage +===== + +```javascript +var TrackerGroup = require("are-we-there-yet").TrackerGroup + +var top = new TrackerGroup("program") + +var single = top.newItem("one thing", 100) +single.completeWork(20) + +console.log(top.completed()) // 0.2 + +fs.stat("file", function(er, stat) { + if (er) throw er + var stream = top.newStream("file", stat.size) + console.log(top.completed()) // now 0.1 as single is 50% of the job and is 20% complete + // and 50% * 20% == 10% + fs.createReadStream("file").pipe(stream).on("data", function (chunk) { + // do stuff with chunk + }) + top.on("change", function (name) { + // called each time a chunk is read from "file" + // top.completed() will start at 0.1 and fill up to 0.6 as the file is read + }) +}) +``` + +Shared Methods +============== + +All tracker objects described below have the following methods, they, along +with the event comprise the interface for consumers of tracker objects. + +* var completed = tracker.completed() + +Returns the ratio of completed work to work to be done. Range of 0 to 1. + +* tracker.finish() + +Marks the tracker as completed. With a TrackerGroup this marks all of its +components as completed. + +Marks all of the components of this tracker as finished, which in turn means +that `tracker.completed()` for this will now be 1. + +This will result in one or more `change` events being emitted. + +Events +====== + +All tracker objects emit `change` events with the following arguments: + +``` +function (name, completed, tracker) +``` + +`name` is the name of the tracker that originally emitted the event, +or if it didn't have one, the first containing tracker group that had one. + +`completed` is the percent complete (as returned by `tracker.completed()` method). + +`tracker` is the tracker object that you are listening for events on. + +TrackerGroup +============ + +* var tracker = new TrackerGroup(**name**) + + * **name** *(optional)* - The name of this tracker group, used in change + notifications if the component updating didn't have a name. Defaults to undefined. + +Creates a new empty tracker aggregation group. These are trackers whose +completion status is determined by the completion status of other trackers. + +* tracker.addUnit(**otherTracker**, **weight**) + + * **otherTracker** - Any of the other are-we-there-yet tracker objects + * **weight** *(optional)* - The weight to give the tracker, defaults to 1. + +Adds the **otherTracker** to this aggregation group. The weight determines +how long you expect this tracker to take to complete in proportion to other +units. So for instance, if you add one tracker with a weight of 1 and +another with a weight of 2, you're saying the second will take twice as long +to complete as the first. As such, the first will account for 33% of the +completion of this tracker and the second will account for the other 67%. + +Returns **otherTracker**. + +* var subGroup = tracker.newGroup(**name**, **weight**) + +The above is exactly equivalent to: + +```javascript + var subGroup = tracker.addUnit(new TrackerGroup(name), weight) +``` + +* var subItem = tracker.newItem(**name**, **todo**, **weight**) + +The above is exactly equivalent to: + +```javascript + var subItem = tracker.addUnit(new Tracker(name, todo), weight) +``` + +* var subStream = tracker.newStream(**name**, **todo**, **weight**) + +The above is exactly equivalent to: + +```javascript + var subStream = tracker.addUnit(new TrackerStream(name, todo), weight) +``` + +* console.log( tracker.debug() ) + +Returns a tree showing the completion of this tracker group and all of its +children, including recursively entering all of the children. + +Tracker +======= + +* var tracker = new Tracker(**name**, **todo**) + + * **name** *(optional)* The name of this counter to report in change + events. Defaults to undefined. + * **todo** *(optional)* The amount of work todo (a number). Defaults to 0. + +Ordinarily these are constructed as a part of a tracker group (via +`newItem`). + +* var completed = tracker.completed() + +Returns the ratio of completed work to work to be done. Range of 0 to 1. If +total work to be done is 0 then it will return 0. + +* tracker.addWork(**todo**) + + * **todo** A number to add to the amount of work to be done. + +Increases the amount of work to be done, thus decreasing the completion +percentage. Triggers a `change` event. + +* tracker.completeWork(**completed**) + + * **completed** A number to add to the work complete + +Increase the amount of work complete, thus increasing the completion percentage. +Will never increase the work completed past the amount of work todo. That is, +percentages > 100% are not allowed. Triggers a `change` event. + +* tracker.finish() + +Marks this tracker as finished, tracker.completed() will now be 1. Triggers +a `change` event. + +TrackerStream +============= + +* var tracker = new TrackerStream(**name**, **size**, **options**) + + * **name** *(optional)* The name of this counter to report in change + events. Defaults to undefined. + * **size** *(optional)* The number of bytes being sent through this stream. + * **options** *(optional)* A hash of stream options + +The tracker stream object is a pass through stream that updates an internal +tracker object each time a block passes through. It's intended to track +downloads, file extraction and other related activities. You use it by piping +your data source into it and then using it as your data source. + +If your data has a length attribute then that's used as the amount of work +completed when the chunk is passed through. If it does not (eg, object +streams) then each chunk counts as completing 1 unit of work, so your size +should be the total number of objects being streamed. + +* tracker.addWork(**todo**) + + * **todo** Increase the expected overall size by **todo** bytes. + +Increases the amount of work to be done, thus decreasing the completion +percentage. Triggers a `change` event. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/index.js new file mode 100644 index 00000000..57d8743f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/index.js @@ -0,0 +1,4 @@ +'use strict' +exports.TrackerGroup = require('./tracker-group.js') +exports.Tracker = require('./tracker.js') +exports.TrackerStream = require('./tracker-stream.js') diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/.npmignore new file mode 100644 index 00000000..c2658d7d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/.npmignore @@ -0,0 +1 @@ +node_modules/ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/History.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/History.md new file mode 100644 index 00000000..25959eab --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/History.md @@ -0,0 +1,22 @@ + +1.0.0 / 2015-12-14 +================== + + * Merge pull request #12 from kasicka/master + * Add license text + +0.1.0 / 2014-10-17 +================== + + * adds `.fluent()` to api + +0.0.3 / 2014-01-13 +================== + + * fix receiver for .method() + +0.0.2 / 2014-01-13 +================== + + * Object.defineProperty() sucks + * Initial commit diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/License b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/License new file mode 100644 index 00000000..60de60ad --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/License @@ -0,0 +1,20 @@ +Copyright (c) 2015 TJ Holowaychuk + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/Makefile b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/Makefile new file mode 100644 index 00000000..a9dcfd50 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/Makefile @@ -0,0 +1,8 @@ + +test: + @./node_modules/.bin/mocha \ + --require should \ + --reporter spec \ + --bail + +.PHONY: test \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/Readme.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/Readme.md new file mode 100644 index 00000000..ab8cf4ac --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/Readme.md @@ -0,0 +1,94 @@ + +# delegates + + Node method and accessor delegation utilty. + +## Installation + +``` +$ npm install delegates +``` + +## Example + +```js +var delegate = require('delegates'); + +... + +delegate(proto, 'request') + .method('acceptsLanguages') + .method('acceptsEncodings') + .method('acceptsCharsets') + .method('accepts') + .method('is') + .access('querystring') + .access('idempotent') + .access('socket') + .access('length') + .access('query') + .access('search') + .access('status') + .access('method') + .access('path') + .access('body') + .access('host') + .access('url') + .getter('subdomains') + .getter('protocol') + .getter('header') + .getter('stale') + .getter('fresh') + .getter('secure') + .getter('ips') + .getter('ip') +``` + +# API + +## Delegate(proto, prop) + +Creates a delegator instance used to configure using the `prop` on the given +`proto` object. (which is usually a prototype) + +## Delegate#method(name) + +Allows the given method `name` to be accessed on the host. + +## Delegate#getter(name) + +Creates a "getter" for the property with the given `name` on the delegated +object. + +## Delegate#setter(name) + +Creates a "setter" for the property with the given `name` on the delegated +object. + +## Delegate#access(name) + +Creates an "accessor" (ie: both getter *and* setter) for the property with the +given `name` on the delegated object. + +## Delegate#fluent(name) + +A unique type of "accessor" that works for a "fluent" API. When called as a +getter, the method returns the expected value. However, if the method is called +with a value, it will return itself so it can be chained. For example: + +```js +delegate(proto, 'request') + .fluent('query') + +// getter +var q = request.query(); + +// setter (chainable) +request + .query({ a: 1 }) + .query({ b: 2 }); +``` + +# License + + MIT diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/index.js new file mode 100644 index 00000000..17c222d5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/index.js @@ -0,0 +1,121 @@ + +/** + * Expose `Delegator`. + */ + +module.exports = Delegator; + +/** + * Initialize a delegator. + * + * @param {Object} proto + * @param {String} target + * @api public + */ + +function Delegator(proto, target) { + if (!(this instanceof Delegator)) return new Delegator(proto, target); + this.proto = proto; + this.target = target; + this.methods = []; + this.getters = []; + this.setters = []; + this.fluents = []; +} + +/** + * Delegate method `name`. + * + * @param {String} name + * @return {Delegator} self + * @api public + */ + +Delegator.prototype.method = function(name){ + var proto = this.proto; + var target = this.target; + this.methods.push(name); + + proto[name] = function(){ + return this[target][name].apply(this[target], arguments); + }; + + return this; +}; + +/** + * Delegator accessor `name`. + * + * @param {String} name + * @return {Delegator} self + * @api public + */ + +Delegator.prototype.access = function(name){ + return this.getter(name).setter(name); +}; + +/** + * Delegator getter `name`. + * + * @param {String} name + * @return {Delegator} self + * @api public + */ + +Delegator.prototype.getter = function(name){ + var proto = this.proto; + var target = this.target; + this.getters.push(name); + + proto.__defineGetter__(name, function(){ + return this[target][name]; + }); + + return this; +}; + +/** + * Delegator setter `name`. + * + * @param {String} name + * @return {Delegator} self + * @api public + */ + +Delegator.prototype.setter = function(name){ + var proto = this.proto; + var target = this.target; + this.setters.push(name); + + proto.__defineSetter__(name, function(val){ + return this[target][name] = val; + }); + + return this; +}; + +/** + * Delegator fluent accessor + * + * @param {String} name + * @return {Delegator} self + * @api public + */ + +Delegator.prototype.fluent = function (name) { + var proto = this.proto; + var target = this.target; + this.fluents.push(name); + + proto[name] = function(val){ + if ('undefined' != typeof val) { + this[target][name] = val; + return this; + } else { + return this[target][name]; + } + }; + + return this; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/package.json new file mode 100644 index 00000000..353a46db --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/package.json @@ -0,0 +1,51 @@ +{ + "name": "delegates", + "version": "1.0.0", + "repository": { + "type": "git", + "url": "git+https://github.com/visionmedia/node-delegates.git" + }, + "description": "delegate methods and accessors to another property", + "keywords": [ + "delegate", + "delegation" + ], + "dependencies": {}, + "devDependencies": { + "mocha": "*", + "should": "*" + }, + "license": "MIT", + "gitHead": "c4dc07ef1ed51c2b2a63f3585e5ef949ee577a49", + "bugs": { + "url": "https://github.com/visionmedia/node-delegates/issues" + }, + "homepage": "https://github.com/visionmedia/node-delegates#readme", + "_id": "delegates@1.0.0", + "scripts": {}, + "_shasum": "84c6e159b81904fdca59a0ef44cd870d31250f9a", + "_from": "delegates@>=1.0.0 <2.0.0", + "_npmVersion": "3.3.12", + "_nodeVersion": "4.2.1", + "_npmUser": { + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" + }, + "maintainers": [ + { + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" + }, + { + "name": "dominicbarnes", + "email": "dominic@dbarnes.info" + } + ], + "dist": { + "shasum": "84c6e159b81904fdca59a0ef44cd870d31250f9a", + "tarball": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/test/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/test/index.js new file mode 100644 index 00000000..7b6e3d4d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/test/index.js @@ -0,0 +1,94 @@ + +var assert = require('assert'); +var delegate = require('..'); + +describe('.method(name)', function(){ + it('should delegate methods', function(){ + var obj = {}; + + obj.request = { + foo: function(bar){ + assert(this == obj.request); + return bar; + } + }; + + delegate(obj, 'request').method('foo'); + + obj.foo('something').should.equal('something'); + }) +}) + +describe('.getter(name)', function(){ + it('should delegate getters', function(){ + var obj = {}; + + obj.request = { + get type() { + return 'text/html'; + } + } + + delegate(obj, 'request').getter('type'); + + obj.type.should.equal('text/html'); + }) +}) + +describe('.setter(name)', function(){ + it('should delegate setters', function(){ + var obj = {}; + + obj.request = { + get type() { + return this._type.toUpperCase(); + }, + + set type(val) { + this._type = val; + } + } + + delegate(obj, 'request').setter('type'); + + obj.type = 'hey'; + obj.request.type.should.equal('HEY'); + }) +}) + +describe('.access(name)', function(){ + it('should delegate getters and setters', function(){ + var obj = {}; + + obj.request = { + get type() { + return this._type.toUpperCase(); + }, + + set type(val) { + this._type = val; + } + } + + delegate(obj, 'request').access('type'); + + obj.type = 'hey'; + obj.type.should.equal('HEY'); + }) +}) + +describe('.fluent(name)', function () { + it('should delegate in a fluent fashion', function () { + var obj = { + settings: { + env: 'development' + } + }; + + delegate(obj, 'settings').fluent('env'); + + obj.env().should.equal('development'); + obj.env('production').should.equal(obj); + obj.settings.env.should.equal('production'); + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/package.json new file mode 100644 index 00000000..af6ea5e3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/package.json @@ -0,0 +1,57 @@ +{ + "name": "are-we-there-yet", + "version": "1.1.2", + "description": "Keep track of the overall completion of many dispirate processes", + "main": "index.js", + "scripts": { + "test": "standard && tap test/*.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/are-we-there-yet.git" + }, + "author": { + "name": "Rebecca Turner", + "url": "http://re-becca.org" + }, + "license": "ISC", + "bugs": { + "url": "https://github.com/iarna/are-we-there-yet/issues" + }, + "homepage": "https://github.com/iarna/are-we-there-yet", + "devDependencies": { + "standard": "^6.0.8", + "tap": "^5.7.0" + }, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.0 || ^1.1.13" + }, + "gitHead": "dd5706e2204cb681e78031d0ffe156ed4cc75823", + "_id": "are-we-there-yet@1.1.2", + "_shasum": "80e470e95a084794fe1899262c5667c6e88de1b3", + "_from": "are-we-there-yet@>=1.1.2 <1.2.0", + "_npmVersion": "3.8.1", + "_nodeVersion": "4.2.2", + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "dist": { + "shasum": "80e470e95a084794fe1899262c5667c6e88de1b3", + "tarball": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.2.tgz" + }, + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + } + ], + "_npmOperationalInternal": { + "host": "packages-13-west.internal.npmjs.com", + "tmp": "tmp/are-we-there-yet-1.1.2.tgz_1458084397358_0.15847722673788667" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.2.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/test/lib/test-event.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/test/lib/test-event.js new file mode 100644 index 00000000..2aa7c05c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/test/lib/test-event.js @@ -0,0 +1,29 @@ +'use strict' +var util = require('util') + +module.exports = function (obj, event, next) { + var timeout = setTimeout(gotTimeout, 10) + obj.once(event, gotResult) + + function gotTimeout () { + obj.removeListener(event, gotResult) + next(new Error('Timeout listening for ' + event)) + } + var result = [] + function gotResult () { + result = Array.prototype.slice.call(arguments) + clearTimeout(timeout) + timeout = setTimeout(gotNoMoreResults, 10) + obj.once(event, gotTooManyResults) + } + function gotNoMoreResults () { + obj.removeListener(event, gotTooManyResults) + var args = [null].concat(result) + next.apply(null, args) + } + function gotTooManyResults () { + var secondResult = Array.prototype.slice.call(arguments) + clearTimeout(timeout) + next(new Error('Got too many results, first ' + util.inspect(result) + ' and then ' + util.inspect(secondResult))) + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/test/tracker.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/test/tracker.js new file mode 100644 index 00000000..374c7739 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/test/tracker.js @@ -0,0 +1,57 @@ +'use strict' +var test = require('tap').test +var Tracker = require('../index.js').Tracker + +var testEvent = require('./lib/test-event.js') + +var name = 'test' + +test('initialization', function (t) { + var simple = new Tracker(name) + + t.is(simple.completed(), 0, 'Nothing todo is 0 completion') + t.done() +}) + +var track +var todo = 100 +test('completion', function (t) { + track = new Tracker(name, todo) + t.is(track.completed(), 0, 'Nothing done is 0 completion') + + testEvent(track, 'change', afterCompleteWork) + + track.completeWork(todo) + t.is(track.completed(), 1, 'completeWork: 100% completed') + + function afterCompleteWork (er, onChangeName) { + t.is(er, null, 'completeWork: on change event fired') + t.is(onChangeName, name, 'completeWork: on change emits the correct name') + t.done() + } +}) + +test('add more work', function (t) { + testEvent(track, 'change', afterAddWork) + track.addWork(todo) + t.is(track.completed(), 0.5, 'addWork: 50% completed') + function afterAddWork (er, onChangeName) { + t.is(er, null, 'addWork: on change event fired') + t.is(onChangeName, name, 'addWork: on change emits the correct name') + t.done() + } +}) + +test('complete more work', function (t) { + track.completeWork(200) + t.is(track.completed(), 1, 'completeWork: Over completion is still only 100% complete') + t.done() +}) + +test('finish is always 100%', function (t) { + var finishtest = new Tracker(name, todo) + finishtest.completeWork(50) + finishtest.finish() + t.is(finishtest.completed(), 1, 'finish: Explicitly finishing moves to 100%') + t.done() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/test/trackergroup.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/test/trackergroup.js new file mode 100644 index 00000000..799a7670 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/test/trackergroup.js @@ -0,0 +1,96 @@ +'use strict' +var test = require('tap').test +var TrackerGroup = require('../index.js').TrackerGroup +var testEvent = require('./lib/test-event.js') + +test('TrackerGroup', function (t) { + var name = 'test' + + var track = new TrackerGroup(name) + t.is(track.completed(), 0, 'Nothing todo is 0 completion') + testEvent(track, 'change', afterFinishEmpty) + track.finish() + var a, b + function afterFinishEmpty (er, onChangeName, completion) { + t.is(er, null, 'finishEmpty: on change event fired') + t.is(onChangeName, name, 'finishEmpty: on change emits the correct name') + t.is(completion, 1, 'finishEmpty: passed through completion was correct') + t.is(track.completed(), 1, 'finishEmpty: Finishing an empty group actually finishes it') + + track = new TrackerGroup(name) + a = track.newItem('a', 10, 1) + b = track.newItem('b', 10, 1) + t.is(track.completed(), 0, 'Initially empty') + testEvent(track, 'change', afterCompleteWork) + a.completeWork(5) + } + function afterCompleteWork (er, onChangeName, completion) { + t.is(er, null, 'on change event fired') + t.is(onChangeName, 'a', 'on change emits the correct name') + t.is(completion, 0.25, 'Complete half of one is a quarter overall') + t.is(track.completed(), 0.25, 'Complete half of one is a quarter overall') + testEvent(track, 'change', afterFinishAll) + track.finish() + } + function afterFinishAll (er, onChangeName, completion) { + t.is(er, null, 'finishAll: on change event fired') + t.is(onChangeName, name, 'finishAll: on change emits the correct name') + t.is(completion, 1, 'Finishing everything ') + t.is(track.completed(), 1, 'Finishing everything ') + + track = new TrackerGroup(name) + a = track.newItem('a', 10, 2) + b = track.newItem('b', 10, 1) + t.is(track.completed(), 0, 'weighted: Initially empty') + testEvent(track, 'change', afterWeightedCompleteWork) + a.completeWork(5) + } + function afterWeightedCompleteWork (er, onChangeName, completion) { + t.is(er, null, 'weighted: on change event fired') + t.is(onChangeName, 'a', 'weighted: on change emits the correct name') + t.is(Math.floor(completion * 100), 33, 'weighted: Complete half of double weighted') + t.is(Math.floor(track.completed() * 100), 33, 'weighted: Complete half of double weighted') + testEvent(track, 'change', afterWeightedFinishAll) + track.finish() + } + function afterWeightedFinishAll (er, onChangeName, completion) { + t.is(er, null, 'weightedFinishAll: on change event fired') + t.is(onChangeName, name, 'weightedFinishAll: on change emits the correct name') + t.is(completion, 1, 'weightedFinishaAll: Finishing everything ') + t.is(track.completed(), 1, 'weightedFinishaAll: Finishing everything ') + + track = new TrackerGroup(name) + a = track.newGroup('a', 10) + b = track.newGroup('b', 10) + var a1 = a.newItem('a.1', 10) + a1.completeWork(5) + t.is(track.completed(), 0.25, 'nested: Initially quarter done') + testEvent(track, 'change', afterNestedComplete) + b.finish() + } + function afterNestedComplete (er, onChangeName, completion) { + t.is(er, null, 'nestedComplete: on change event fired') + t.is(onChangeName, 'b', 'nestedComplete: on change emits the correct name') + t.is(completion, 0.75, 'nestedComplete: Finishing everything ') + t.is(track.completed(), 0.75, 'nestedComplete: Finishing everything ') + t.end() + } +}) + +test('cycles', function (t) { + var track = new TrackerGroup('top') + testCycle(track, track) + var layer1 = track.newGroup('layer1') + testCycle(layer1, track) + t.end() + + function testCycle (addTo, toAdd) { + try { + addTo.addUnit(toAdd) + t.fail(toAdd.name) + } catch (ex) { + console.log(ex) + t.pass(toAdd.name) + } + } +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/test/trackerstream.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/test/trackerstream.js new file mode 100644 index 00000000..65f04b03 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/test/trackerstream.js @@ -0,0 +1,51 @@ +'use strict' +var test = require('tap').test +var util = require('util') +var stream = require('readable-stream') +var TrackerStream = require('../index.js').TrackerStream +var testEvent = require('./lib/test-event.js') + +var Sink = function () { + stream.Writable.apply(this, arguments) +} +util.inherits(Sink, stream.Writable) +Sink.prototype._write = function (data, encoding, cb) { + cb() +} + +test('TrackerStream', function (t) { + t.plan(9) + + var name = 'test' + var track = new TrackerStream(name) + + t.is(track.completed(), 0, 'Nothing todo is 0 completion') + + var todo = 10 + track = new TrackerStream(name, todo) + t.is(track.completed(), 0, 'Nothing done is 0 completion') + + track.pipe(new Sink()) + + testEvent(track, 'change', afterCompleteWork) + track.write('0123456789') + function afterCompleteWork (er, onChangeName) { + t.is(er, null, 'write: on change event fired') + t.is(onChangeName, name, 'write: on change emits the correct name') + t.is(track.completed(), 1, 'write: 100% completed') + + testEvent(track, 'change', afterAddWork) + track.addWork(10) + } + function afterAddWork (er, onChangeName) { + t.is(er, null, 'addWork: on change event fired') + t.is(track.completed(), 0.5, 'addWork: 50% completed') + + testEvent(track, 'change', afterAllWork) + track.write('ABCDEFGHIJKLMNOPQRST') + } + function afterAllWork (er) { + t.is(er, null, 'allWork: on change event fired') + t.is(track.completed(), 1, 'allWork: 100% completed') + } +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/tracker-base.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/tracker-base.js new file mode 100644 index 00000000..6f436875 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/tracker-base.js @@ -0,0 +1,11 @@ +'use strict' +var EventEmitter = require('events').EventEmitter +var util = require('util') + +var trackerId = 0 +var TrackerBase = module.exports = function (name) { + EventEmitter.call(this) + this.id = ++trackerId + this.name = name +} +util.inherits(TrackerBase, EventEmitter) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/tracker-group.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/tracker-group.js new file mode 100644 index 00000000..9759e122 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/tracker-group.js @@ -0,0 +1,107 @@ +'use strict' +var util = require('util') +var TrackerBase = require('./tracker-base.js') +var Tracker = require('./tracker.js') +var TrackerStream = require('./tracker-stream.js') + +var TrackerGroup = module.exports = function (name) { + TrackerBase.call(this, name) + this.parentGroup = null + this.trackers = [] + this.completion = {} + this.weight = {} + this.totalWeight = 0 + this.finished = false + this.bubbleChange = bubbleChange(this) +} +util.inherits(TrackerGroup, TrackerBase) + +function bubbleChange (trackerGroup) { + return function (name, completed, tracker) { + trackerGroup.completion[tracker.id] = completed + if (trackerGroup.finished) return + trackerGroup.emit('change', name || trackerGroup.name, trackerGroup.completed(), trackerGroup) + } +} + +TrackerGroup.prototype.nameInTree = function () { + var names = [] + var from = this + while (from) { + names.unshift(from.name) + from = from.parentGroup + } + return names.join('/') +} + +TrackerGroup.prototype.addUnit = function (unit, weight) { + if (unit.addUnit) { + var toTest = this + while (toTest) { + if (unit === toTest) { + throw new Error( + 'Attempted to add tracker group ' + + unit.name + ' to tree that already includes it ' + + this.nameInTree(this)) + } + toTest = toTest.parentGroup + } + unit.parentGroup = this + } + this.weight[unit.id] = weight || 1 + this.totalWeight += this.weight[unit.id] + this.trackers.push(unit) + this.completion[unit.id] = unit.completed() + unit.on('change', this.bubbleChange) + if (!this.finished) this.emit('change', unit.name, this.completion[unit.id], unit) + return unit +} + +TrackerGroup.prototype.completed = function () { + if (this.trackers.length === 0) return 0 + var valPerWeight = 1 / this.totalWeight + var completed = 0 + for (var ii = 0; ii < this.trackers.length; ii++) { + var trackerId = this.trackers[ii].id + completed += valPerWeight * this.weight[trackerId] * this.completion[trackerId] + } + return completed +} + +TrackerGroup.prototype.newGroup = function (name, weight) { + return this.addUnit(new TrackerGroup(name), weight) +} + +TrackerGroup.prototype.newItem = function (name, todo, weight) { + return this.addUnit(new Tracker(name, todo), weight) +} + +TrackerGroup.prototype.newStream = function (name, todo, weight) { + return this.addUnit(new TrackerStream(name, todo), weight) +} + +TrackerGroup.prototype.finish = function () { + this.finished = true + if (!this.trackers.length) this.addUnit(new Tracker(), 1, true) + for (var ii = 0; ii < this.trackers.length; ii++) { + var tracker = this.trackers[ii] + tracker.finish() + tracker.removeListener('change', this.bubbleChange) + } + this.emit('change', this.name, 1, this) +} + +var buffer = ' ' +TrackerGroup.prototype.debug = function (depth) { + depth = depth || 0 + var indent = depth ? buffer.substr(0, depth) : '' + var output = indent + (this.name || 'top') + ': ' + this.completed() + '\n' + this.trackers.forEach(function (tracker) { + if (tracker instanceof TrackerGroup) { + output += tracker.debug(depth + 1) + } else { + output += indent + ' ' + tracker.name + ': ' + tracker.completed() + '\n' + } + }) + return output +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/tracker-stream.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/tracker-stream.js new file mode 100644 index 00000000..fb9598ed --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/tracker-stream.js @@ -0,0 +1,35 @@ +'use strict' +var util = require('util') +var stream = require('readable-stream') +var delegate = require('delegates') +var Tracker = require('./tracker.js') + +var TrackerStream = module.exports = function (name, size, options) { + stream.Transform.call(this, options) + this.tracker = new Tracker(name, size) + this.name = name + this.id = this.tracker.id + this.tracker.on('change', delegateChange(this)) +} +util.inherits(TrackerStream, stream.Transform) + +function delegateChange (trackerStream) { + return function (name, completion, tracker) { + trackerStream.emit('change', name, completion, trackerStream) + } +} + +TrackerStream.prototype._transform = function (data, encoding, cb) { + this.tracker.completeWork(data.length ? data.length : 1) + this.push(data) + cb() +} + +TrackerStream.prototype._flush = function (cb) { + this.tracker.finish() + cb() +} + +delegate(TrackerStream.prototype, 'tracker') + .method('completed') + .method('addWork') diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/tracker.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/tracker.js new file mode 100644 index 00000000..68c2339b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/are-we-there-yet/tracker.js @@ -0,0 +1,30 @@ +'use strict' +var util = require('util') +var TrackerBase = require('./tracker-base.js') + +var Tracker = module.exports = function (name, todo) { + TrackerBase.call(this, name) + this.workDone = 0 + this.workTodo = todo || 0 +} +util.inherits(Tracker, TrackerBase) + +Tracker.prototype.completed = function () { + return this.workTodo === 0 ? 0 : this.workDone / this.workTodo +} + +Tracker.prototype.addWork = function (work) { + this.workTodo += work + this.emit('change', this.name, this.completed(), this) +} + +Tracker.prototype.completeWork = function (work) { + this.workDone += work + if (this.workDone > this.workTodo) this.workDone = this.workTodo + this.emit('change', this.name, this.completed(), this) +} + +Tracker.prototype.finish = function () { + this.workTodo = this.workDone = 1 + this.emit('change', this.name, 1, this) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/.npmignore new file mode 100644 index 00000000..df22a16c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/.npmignore @@ -0,0 +1,32 @@ +# Logs +logs +*.log + +# Runtime data +pids +*.pid +*.seed + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directory +# Commenting this out is preferred by some people, see +# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- +node_modules + +# Users Environment Variables +.lock-wscript + +# Editor cruft +*~ +.#* diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/LICENSE new file mode 100644 index 00000000..e7560529 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2014, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/README.md new file mode 100644 index 00000000..337dc9d8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/README.md @@ -0,0 +1,166 @@ +gauge +===== + +A nearly stateless terminal based horizontal gauge / progress bar. + +```javascript +var Gauge = require("gauge") + +var gauge = new Gauge() + +gauge.show("test", 0.20) + +gauge.pulse("this") + +gauge.hide() +``` + +![](example.png) + + +### `var gauge = new Gauge([options], [ansiStream])` + +* **options** – *(optional)* An option object. (See [below] for details.) +* **ansiStream** – *(optional)* A stream that's been blessed by the [ansi] + module to include various commands for controlling the cursor in a terminal. + +[ansi]: https://www.npmjs.com/package/ansi +[below]: #theme-objects + +Constructs a new gauge. Gauges are drawn on a single line, and are not drawn +if the current terminal isn't a tty. + +If you resize your terminal in a way that can be detected then the gauge +will be drawn at the new size. As a general rule, growing your terminal will +be clean, but shrinking your terminal will result in cruft as we don't have +enough information to know where what we wrote previously is now located. + +The **options** object can have the following properties, all of which are +optional: + +* maxUpdateFrequency: defaults to 50 msec, the gauge will not be drawn more + than once in this period of time. This applies to `show` and `pulse` + calls, but if you `hide` and then `show` the gauge it will draw it + regardless of time since last draw. +* theme: defaults to Gauge.unicode` if the terminal supports + unicode according to [has-unicode], otherwise it defaults to `Gauge.ascii`. + Details on the [theme object](#theme-objects) are documented elsewhere. +* template: see [documentation elsewhere](#template-objects) for + defaults and details. + +[has-unicode]: https://www.npmjs.com/package/has-unicode + +If **ansiStream** isn't passed in, then one will be constructed from stderr +with `ansi(process.stderr)`. + +### `gauge.show([name, [completed]])` + +* **name** – *(optional)* The name of the current thing contributing to progress. Defaults to the last value used, or "". +* **completed** – *(optional)* The portion completed as a value between 0 and 1. Defaults to the last value used, or 0. + +If `process.stdout.isTTY` is false then this does nothing. If completed is 0 +and `gauge.pulse` has never been called, then similarly nothing will be printed. + +If `maxUpdateFrequency` msec haven't passed since the last call to `show` or +`pulse` then similarly, nothing will be printed. (Actually, the update is +deferred until `maxUpdateFrequency` msec have passed and if nothing else has +happened, the gauge update will happen.) + +### `gauge.hide()` + +Removes the gauge from the terminal. + +### `gauge.pulse([name])` + +* **name** – *(optional)* The specific thing that triggered this pulse + +Spins the spinner in the gauge to show output. If **name** is included then +it will be combined with the last name passed to `gauge.show` using the +subsection property of the theme (typically a right facing arrow). + +### `gauge.disable()` + +Hides the gauge and ignores further calls to `show` or `pulse`. + +### `gauge.enable()` + +Shows the gauge and resumes updating when `show` or `pulse` is called. + +### `gauge.setTheme(theme)` + +Change the active theme, will be displayed with the next show or pulse + +### `gauge.setTemplate(template)` + +Change the active template, will be displayed with the next show or pulse + +### Theme Objects + +There are two theme objects available as a part of the module, `Gauge.unicode` and `Gauge.ascii`. +Theme objects have the follow properties: + +| Property | Unicode | ASCII | +| ---------- | ------- | ----- | +| startgroup | ╢ | \| | +| endgroup | ╟ | \| | +| complete | █ | # | +| incomplete | ░ | - | +| spinner | ▀▐▄▌ | -\\\|/ | +| subsection | → | -> | + +*startgroup*, *endgroup* and *subsection* can be as many characters as you want. + +*complete* and *incomplete* should be a single character width each. + +*spinner* is a list of characters to use in turn when displaying an activity +spinner. The Gauge will spin as many characters as you give here. + +### Template Objects + +A template is an array of objects and strings that, after being evaluated, +will be turned into the gauge line. The default template is: + +```javascript +[ + {type: "name", separated: true, maxLength: 25, minLength: 25, align: "left"}, + {type: "spinner", separated: true}, + {type: "startgroup"}, + {type: "completionbar"}, + {type: "endgroup"} +] +``` + +The various template elements can either be **plain strings**, in which case they will +be be included verbatum in the output. + +If the template element is an object, it can have the following keys: + +* *type* can be: + * `name` – The most recent name passed to `show`; if this is in response to a + `pulse` then the name passed to `pulse` will be appended along with the + subsection property from the theme. + * `spinner` – If you've ever called `pulse` this will be one of the characters + from the spinner property of the theme. + * `startgroup` – The `startgroup` property from the theme. + * `completionbar` – This progress bar itself + * `endgroup` – The `endgroup` property from the theme. +* *separated* – If true, the element will be separated with spaces from things on + either side (and margins count as space, so it won't be indented), but only + if its included. +* *maxLength* – The maximum length for this element. If its value is longer it + will be truncated. +* *minLength* – The minimum length for this element. If its value is shorter it + will be padded according to the *align* value. +* *align* – (Default: left) Possible values "left", "right" and "center". Works + as you'd expect from word processors. +* *length* – Provides a single value for both *minLength* and *maxLength*. If both + *length* and *minLength or *maxLength* are specifed then the latter take precedence. + +### Tracking Completion + +If you have more than one thing going on that you want to track completion +of, you may find the related [are-we-there-yet] helpful. It's `change` +event can be wired up to the `show` method to get a more traditional +progress bar interface. + +[are-we-there-yet]: https://www.npmjs.com/package/are-we-there-yet diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/example.png b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/example.png new file mode 100644 index 00000000..2667cac4 Binary files /dev/null and b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/example.png differ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/.npmignore new file mode 100644 index 00000000..7e17cf19 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/.npmignore @@ -0,0 +1,32 @@ +# Logs +logs +*.log + +# Runtime data +pids +*.pid +*.seed + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directory +# Commenting this out is preferred by some people, see +# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- +node_modules + +# Users Environment Variables +.lock-wscript + +# Editor temp files +*~ +.#* diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/LICENSE new file mode 100644 index 00000000..d42e25e9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/LICENSE @@ -0,0 +1,14 @@ +Copyright (c) 2014, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/README.md new file mode 100644 index 00000000..5a03e599 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/README.md @@ -0,0 +1,43 @@ +has-unicode +=========== + +Try to guess if your terminal supports unicode + +```javascript +var hasUnicode = require("has-unicode") + +if (hasUnicode()) { + // the terminal probably has unicode support +} +``` +```javascript +var hasUnicode = require("has-unicode").tryHarder +hasUnicode(function(unicodeSupported) { + if (unicodeSupported) { + // the terminal probably has unicode support + } +}) +``` + +## Detecting Unicode + +What we actually detect is UTF-8 support, as that's what Node itself supports. +If you have a UTF-16 locale then you won't be detected as unicode capable. + +### Windows + +Since at least Windows 7, `cmd` and `powershell` have been unicode capable, +but unfortunately even then it's not guaranteed. In many localizations it +still uses legacy code pages and there's no facility short of running +programs or linking C++ that will let us detect this. As such, we +report any Windows installation as NOT unicode capable, and recommend +that you encourage your users to override this via config. + +### Unix Like Operating Systems + +We look at the environment variables `LC_ALL`, `LC_CTYPE`, and `LANG` in +that order. For `LC_ALL` and `LANG`, it looks for `.UTF-8` in the value. +For `LC_CTYPE` it looks to see if the value is `UTF-8`. This is sufficient +for most POSIX systems. While locale data can be put in `/etc/locale.conf` +as well, AFAIK it's always copied into the environment. + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/index.js new file mode 100644 index 00000000..9bf537b1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/index.js @@ -0,0 +1,21 @@ +"use strict" +var os = require("os") + +var hasUnicode = module.exports = function () { + // Recent Win32 platforms (>XP) CAN support unicode in the console but + // don't have to, and in non-english locales often use traditional local + // code pages. There's no way, short of windows system calls or execing + // the chcp command line program to figure this out. As such, we default + // this to false and encourage your users to override it via config if + // appropriate. + if (os.type() == "Windows_NT") { return false } + + var isUTF8 = /[.]UTF-8/ + if (isUTF8.test(process.env.LC_ALL) + || process.env.LC_CTYPE == 'UTF-8' + || isUTF8.test(process.env.LANG)) { + return true + } + + return false +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/package.json new file mode 100644 index 00000000..39d090bb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/package.json @@ -0,0 +1,53 @@ +{ + "name": "has-unicode", + "version": "2.0.0", + "description": "Try to guess if your terminal supports unicode", + "main": "index.js", + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/has-unicode.git" + }, + "keywords": [ + "unicode", + "terminal" + ], + "author": { + "name": "Rebecca Turner", + "email": "me@re-becca.org" + }, + "license": "ISC", + "bugs": { + "url": "https://github.com/iarna/has-unicode/issues" + }, + "homepage": "https://github.com/iarna/has-unicode", + "devDependencies": { + "require-inject": "^1.3.0", + "tap": "^2.3.1" + }, + "gitHead": "fdd5de141a5564bdb5bc991d951209da40f6a598", + "_id": "has-unicode@2.0.0", + "_shasum": "a3cd96c307ba41d559c5a2ee408c12a11c4c2ec3", + "_from": "has-unicode@>=2.0.0 <3.0.0", + "_npmVersion": "2.14.7", + "_nodeVersion": "4.2.2", + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "dist": { + "shasum": "a3cd96c307ba41d559c5a2ee408c12a11c4c2ec3", + "tarball": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.0.tgz" + }, + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/test/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/test/index.js new file mode 100644 index 00000000..cbdfda33 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/test/index.js @@ -0,0 +1,26 @@ +"use strict" +var test = require("tap").test +var requireInject = require("require-inject") + +test("Windows", function (t) { + t.plan(1) + var hasUnicode = requireInject("../index.js", { + os: { type: function () { return "Windows_NT" } } + }) + t.is(hasUnicode(), false, "Windows is assumed NOT to be unicode aware") +}) +test("Unix Env", function (t) { + t.plan(3) + var hasUnicode = requireInject("../index.js", { + os: { type: function () { return "Linux" } }, + child_process: { exec: function (cmd,cb) { cb(new Error("not available")) } } + }) + process.env.LANG = "en_US.UTF-8" + process.env.LC_ALL = null + t.is(hasUnicode(), true, "Linux with a UTF8 language") + process.env.LANG = null + process.env.LC_ALL = "en_US.UTF-8" + t.is(hasUnicode(), true, "Linux with UTF8 locale") + process.env.LC_ALL = null + t.is(hasUnicode(), false, "Linux without UTF8 language or locale") +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._baseslice/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._baseslice/LICENSE new file mode 100644 index 00000000..b054ca5a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._baseslice/LICENSE @@ -0,0 +1,22 @@ +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._baseslice/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._baseslice/README.md new file mode 100644 index 00000000..8cd4181c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._baseslice/README.md @@ -0,0 +1,18 @@ +# lodash._baseslice v4.0.0 + +The internal [lodash](https://lodash.com/) function `baseSlice` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash._baseslice +``` + +In Node.js: +```js +var baseSlice = require('lodash._baseslice'); +``` + +See the [package source](https://github.com/lodash/lodash/blob/4.0.0-npm-packages/lodash._baseslice) for more details. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._baseslice/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._baseslice/index.js new file mode 100644 index 00000000..59293c3d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._baseslice/index.js @@ -0,0 +1,40 @@ +/** + * lodash 4.0.0 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ +function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; +} + +module.exports = baseSlice; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._baseslice/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._baseslice/package.json new file mode 100644 index 00000000..46ff731b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._baseslice/package.json @@ -0,0 +1,70 @@ +{ + "name": "lodash._baseslice", + "version": "4.0.0", + "description": "The internal lodash function `baseSlice` exported as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "https://github.com/phated" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "_id": "lodash._baseslice@4.0.0", + "_shasum": "f5ce1df982948ecaff63f223853415b7b9763704", + "_from": "lodash._baseslice@4.0.0", + "_npmVersion": "2.14.15", + "_nodeVersion": "5.4.0", + "_npmUser": { + "name": "jdalton", + "email": "john.david.dalton@gmail.com" + }, + "dist": { + "shasum": "f5ce1df982948ecaff63f223853415b7b9763704", + "tarball": "https://registry.npmjs.org/lodash._baseslice/-/lodash._baseslice-4.0.0.tgz" + }, + "maintainers": [ + { + "name": "jdalton", + "email": "john.david.dalton@gmail.com" + }, + { + "name": "mathias", + "email": "mathias@qiwi.be" + }, + { + "name": "phated", + "email": "blaine@iceddev.com" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/lodash._baseslice/-/lodash._baseslice-4.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/LICENSE new file mode 100644 index 00000000..e0c69d56 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/LICENSE @@ -0,0 +1,47 @@ +Copyright jQuery Foundation and other contributors + +Based on Underscore.js, copyright Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/lodash/lodash + +The following license applies to all parts of this software except as +documented below: + +==== + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +==== + +Copyright and related rights for sample code are waived via CC0. Sample +code is defined as all source code displayed within the prose of the +documentation. + +CC0: http://creativecommons.org/publicdomain/zero/1.0/ + +==== + +Files located in the node_modules and vendor directories are externally +maintained libraries used by this software which have their own +licenses; we recommend you read them, as their terms may differ from the +terms above. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/README.md new file mode 100644 index 00000000..ba060c94 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/README.md @@ -0,0 +1,18 @@ +# lodash._basetostring v4.12.0 + +The internal [lodash](https://lodash.com/) function `baseToString` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash._basetostring +``` + +In Node.js: +```js +var baseToString = require('lodash._basetostring'); +``` + +See the [package source](https://github.com/lodash/lodash/blob/4.12.0-npm-packages/lodash._basetostring) for more details. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/index.js new file mode 100644 index 00000000..d5848107 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/index.js @@ -0,0 +1,153 @@ +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; + +/** Used to determine if values are of the language type `Object`. */ +var objectTypes = { + 'function': true, + 'object': true +}; + +/** Detect free variable `exports`. */ +var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) + ? exports + : undefined; + +/** Detect free variable `module`. */ +var freeModule = (objectTypes[typeof module] && module && !module.nodeType) + ? module + : undefined; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); + +/** Detect free variable `self`. */ +var freeSelf = checkGlobal(objectTypes[typeof self] && self); + +/** Detect free variable `window`. */ +var freeWindow = checkGlobal(objectTypes[typeof window] && window); + +/** Detect `this` as the global object. */ +var thisGlobal = checkGlobal(objectTypes[typeof this] && this); + +/** + * Used as a reference to the global object. + * + * The `this` value is used if it's the global object to avoid Greasemonkey's + * restricted `window` object, otherwise the `window` object is used. + */ +var root = freeGlobal || + ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || + freeSelf || thisGlobal || Function('return this')(); + +/** + * Checks if `value` is a global object. + * + * @private + * @param {*} value The value to check. + * @returns {null|Object} Returns `value` if it's a global object, else `null`. + */ +function checkGlobal(value) { + return (value && value.Object === Object) ? value : null; +} + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Built-in value references. */ +var Symbol = root.Symbol; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + +/** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); +} + +module.exports = baseToString; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/package.json new file mode 100644 index 00000000..241f9871 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/package.json @@ -0,0 +1,74 @@ +{ + "name": "lodash._basetostring", + "version": "4.12.0", + "description": "The internal lodash function `baseToString` exported as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine.bublitz@gmail.com", + "url": "https://github.com/phated" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "_id": "lodash._basetostring@4.12.0", + "_shasum": "9327c9dc5158866b7fa4b9d42f4638e5766dd9df", + "_from": "lodash._basetostring@4.12.0", + "_npmVersion": "2.15.5", + "_nodeVersion": "5.5.0", + "_npmUser": { + "name": "jdalton", + "email": "john.david.dalton@gmail.com" + }, + "dist": { + "shasum": "9327c9dc5158866b7fa4b9d42f4638e5766dd9df", + "tarball": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-4.12.0.tgz" + }, + "maintainers": [ + { + "name": "jdalton", + "email": "john.david.dalton@gmail.com" + }, + { + "name": "mathias", + "email": "mathias@qiwi.be" + }, + { + "name": "phated", + "email": "blaine@iceddev.com" + } + ], + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/lodash._basetostring-4.12.0.tgz_1463062033665_0.6722894972190261" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-4.12.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/LICENSE new file mode 100644 index 00000000..e0c69d56 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/LICENSE @@ -0,0 +1,47 @@ +Copyright jQuery Foundation and other contributors + +Based on Underscore.js, copyright Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/lodash/lodash + +The following license applies to all parts of this software except as +documented below: + +==== + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +==== + +Copyright and related rights for sample code are waived via CC0. Sample +code is defined as all source code displayed within the prose of the +documentation. + +CC0: http://creativecommons.org/publicdomain/zero/1.0/ + +==== + +Files located in the node_modules and vendor directories are externally +maintained libraries used by this software which have their own +licenses; we recommend you read them, as their terms may differ from the +terms above. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/README.md new file mode 100644 index 00000000..57fb5859 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/README.md @@ -0,0 +1,18 @@ +# lodash.pad v4.4.0 + +The [lodash](https://lodash.com/) method `_.pad` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.pad +``` + +In Node.js: +```js +var pad = require('lodash.pad'); +``` + +See the [documentation](https://lodash.com/docs#pad) or [package source](https://github.com/lodash/lodash/blob/4.4.0-npm-packages/lodash.pad) for more details. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/index.js new file mode 100644 index 00000000..876fbb96 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/index.js @@ -0,0 +1,434 @@ +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ +var baseSlice = require('lodash._baseslice'), + baseToString = require('lodash._basetostring'), + toString = require('lodash.tostring'); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991, + MAX_INTEGER = 1.7976931348623157e+308, + NAN = 0 / 0; + +/** `Object#toString` result references. */ +var funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + symbolTag = '[object Symbol]'; + +/** Used to match leading and trailing whitespace. */ +var reTrim = /^\s+|\s+$/g; + +/** Used to detect bad signed hexadecimal string values. */ +var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + +/** Used to detect binary string values. */ +var reIsBinary = /^0b[01]+$/i; + +/** Used to detect octal string values. */ +var reIsOctal = /^0o[0-7]+$/i; + +/** Used to compose unicode character classes. */ +var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', + rsComboSymbolsRange = '\\u20d0-\\u20f0', + rsVarRange = '\\ufe0e\\ufe0f'; + +/** Used to compose unicode capture groups. */ +var rsAstral = '[' + rsAstralRange + ']', + rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsZWJ = '\\u200d'; + +/** Used to compose unicode regexes. */ +var reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + +/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ +var reComplexSymbol = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + +/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ +var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); + +/** Built-in method references without a dependency on `root`. */ +var freeParseInt = parseInt; + +/** + * Gets the number of symbols in `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the string size. + */ +function stringSize(string) { + if (!(string && reHasComplexSymbol.test(string))) { + return string.length; + } + var result = reComplexSymbol.lastIndex = 0; + while (reComplexSymbol.test(string)) { + result++; + } + return result; +} + +/** + * Converts `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function stringToArray(string) { + return string.match(reComplexSymbol); +} + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeCeil = Math.ceil, + nativeFloor = Math.floor; + +/** + * The base implementation of `_.repeat` which doesn't coerce arguments. + * + * @private + * @param {string} string The string to repeat. + * @param {number} n The number of times to repeat the string. + * @returns {string} Returns the repeated string. + */ +function baseRepeat(string, n) { + var result = ''; + if (!string || n < 1 || n > MAX_SAFE_INTEGER) { + return result; + } + // Leverage the exponentiation by squaring algorithm for a faster repeat. + // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. + do { + if (n % 2) { + result += string; + } + n = nativeFloor(n / 2); + if (n) { + string += string; + } + } while (n); + + return result; +} + +/** + * Casts `array` to a slice if it's needed. + * + * @private + * @param {Array} array The array to inspect. + * @param {number} start The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the cast slice. + */ +function castSlice(array, start, end) { + var length = array.length; + end = end === undefined ? length : end; + return (!start && end >= length) ? array : baseSlice(array, start, end); +} + +/** + * Creates the padding for `string` based on `length`. The `chars` string + * is truncated if the number of characters exceeds `length`. + * + * @private + * @param {number} length The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padding for `string`. + */ +function createPadding(length, chars) { + chars = chars === undefined ? ' ' : baseToString(chars); + + var charsLength = chars.length; + if (charsLength < 2) { + return charsLength ? baseRepeat(chars, length) : chars; + } + var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); + return reHasComplexSymbol.test(chars) + ? castSlice(stringToArray(result), 0, length).join('') + : result.slice(0, length); +} + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8 which returns 'object' for typed array and weak map constructors, + // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); +} + +/** + * Converts `value` to a finite number. + * + * @static + * @memberOf _ + * @since 4.12.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted number. + * @example + * + * _.toFinite(3.2); + * // => 3.2 + * + * _.toFinite(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toFinite(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toFinite('3.2'); + * // => 3.2 + */ +function toFinite(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = (value < 0 ? -1 : 1); + return sign * MAX_INTEGER; + } + return value === value ? value : 0; +} + +/** + * Converts `value` to an integer. + * + * **Note:** This function is loosely based on + * [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3.2); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3.2'); + * // => 3 + */ +function toInteger(value) { + var result = toFinite(value), + remainder = result % 1; + + return result === result ? (remainder ? result - remainder : result) : 0; +} + +/** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 + */ +function toNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject(value)) { + var other = isFunction(value.valueOf) ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); +} + +/** + * Pads `string` on the left and right sides if it's shorter than `length`. + * Padding characters are truncated if they can't be evenly divided by `length`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.pad('abc', 8); + * // => ' abc ' + * + * _.pad('abc', 8, '_-'); + * // => '_-abc_-_' + * + * _.pad('abc', 3); + * // => 'abc' + */ +function pad(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + if (!length || strLength >= length) { + return string; + } + var mid = (length - strLength) / 2; + return ( + createPadding(nativeFloor(mid), chars) + + string + + createPadding(nativeCeil(mid), chars) + ); +} + +module.exports = pad; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/package.json new file mode 100644 index 00000000..cf622e87 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/package.json @@ -0,0 +1,83 @@ +{ + "name": "lodash.pad", + "version": "4.4.0", + "description": "The lodash method `_.pad` exported as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "keywords": [ + "lodash-modularized", + "pad" + ], + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine.bublitz@gmail.com", + "url": "https://github.com/phated" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "dependencies": { + "lodash._baseslice": "~4.0.0", + "lodash._basetostring": "~4.12.0", + "lodash.tostring": "^4.0.0" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "_id": "lodash.pad@4.4.0", + "_shasum": "faa38df26c0a69ec5086a82246c958e150dcb1ab", + "_from": "lodash.pad@>=4.1.0 <5.0.0", + "_npmVersion": "2.15.5", + "_nodeVersion": "5.5.0", + "_npmUser": { + "name": "jdalton", + "email": "john.david.dalton@gmail.com" + }, + "dist": { + "shasum": "faa38df26c0a69ec5086a82246c958e150dcb1ab", + "tarball": "https://registry.npmjs.org/lodash.pad/-/lodash.pad-4.4.0.tgz" + }, + "maintainers": [ + { + "name": "jdalton", + "email": "john.david.dalton@gmail.com" + }, + { + "name": "mathias", + "email": "mathias@qiwi.be" + }, + { + "name": "phated", + "email": "blaine@iceddev.com" + } + ], + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/lodash.pad-4.4.0.tgz_1463062450475_0.3613762252498418" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/lodash.pad/-/lodash.pad-4.4.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/LICENSE new file mode 100644 index 00000000..e0c69d56 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/LICENSE @@ -0,0 +1,47 @@ +Copyright jQuery Foundation and other contributors + +Based on Underscore.js, copyright Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/lodash/lodash + +The following license applies to all parts of this software except as +documented below: + +==== + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +==== + +Copyright and related rights for sample code are waived via CC0. Sample +code is defined as all source code displayed within the prose of the +documentation. + +CC0: http://creativecommons.org/publicdomain/zero/1.0/ + +==== + +Files located in the node_modules and vendor directories are externally +maintained libraries used by this software which have their own +licenses; we recommend you read them, as their terms may differ from the +terms above. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/README.md new file mode 100644 index 00000000..909eef8f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/README.md @@ -0,0 +1,18 @@ +# lodash.padend v4.5.0 + +The [lodash](https://lodash.com/) method `_.padEnd` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.padend +``` + +In Node.js: +```js +var padEnd = require('lodash.padend'); +``` + +See the [documentation](https://lodash.com/docs#padEnd) or [package source](https://github.com/lodash/lodash/blob/4.5.0-npm-packages/lodash.padend) for more details. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/index.js new file mode 100644 index 00000000..5af50372 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/index.js @@ -0,0 +1,428 @@ +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ +var baseSlice = require('lodash._baseslice'), + baseToString = require('lodash._basetostring'), + toString = require('lodash.tostring'); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991, + MAX_INTEGER = 1.7976931348623157e+308, + NAN = 0 / 0; + +/** `Object#toString` result references. */ +var funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + symbolTag = '[object Symbol]'; + +/** Used to match leading and trailing whitespace. */ +var reTrim = /^\s+|\s+$/g; + +/** Used to detect bad signed hexadecimal string values. */ +var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + +/** Used to detect binary string values. */ +var reIsBinary = /^0b[01]+$/i; + +/** Used to detect octal string values. */ +var reIsOctal = /^0o[0-7]+$/i; + +/** Used to compose unicode character classes. */ +var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', + rsComboSymbolsRange = '\\u20d0-\\u20f0', + rsVarRange = '\\ufe0e\\ufe0f'; + +/** Used to compose unicode capture groups. */ +var rsAstral = '[' + rsAstralRange + ']', + rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsZWJ = '\\u200d'; + +/** Used to compose unicode regexes. */ +var reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + +/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ +var reComplexSymbol = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + +/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ +var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); + +/** Built-in method references without a dependency on `root`. */ +var freeParseInt = parseInt; + +/** + * Gets the number of symbols in `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the string size. + */ +function stringSize(string) { + if (!(string && reHasComplexSymbol.test(string))) { + return string.length; + } + var result = reComplexSymbol.lastIndex = 0; + while (reComplexSymbol.test(string)) { + result++; + } + return result; +} + +/** + * Converts `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function stringToArray(string) { + return string.match(reComplexSymbol); +} + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeCeil = Math.ceil, + nativeFloor = Math.floor; + +/** + * The base implementation of `_.repeat` which doesn't coerce arguments. + * + * @private + * @param {string} string The string to repeat. + * @param {number} n The number of times to repeat the string. + * @returns {string} Returns the repeated string. + */ +function baseRepeat(string, n) { + var result = ''; + if (!string || n < 1 || n > MAX_SAFE_INTEGER) { + return result; + } + // Leverage the exponentiation by squaring algorithm for a faster repeat. + // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. + do { + if (n % 2) { + result += string; + } + n = nativeFloor(n / 2); + if (n) { + string += string; + } + } while (n); + + return result; +} + +/** + * Casts `array` to a slice if it's needed. + * + * @private + * @param {Array} array The array to inspect. + * @param {number} start The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the cast slice. + */ +function castSlice(array, start, end) { + var length = array.length; + end = end === undefined ? length : end; + return (!start && end >= length) ? array : baseSlice(array, start, end); +} + +/** + * Creates the padding for `string` based on `length`. The `chars` string + * is truncated if the number of characters exceeds `length`. + * + * @private + * @param {number} length The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padding for `string`. + */ +function createPadding(length, chars) { + chars = chars === undefined ? ' ' : baseToString(chars); + + var charsLength = chars.length; + if (charsLength < 2) { + return charsLength ? baseRepeat(chars, length) : chars; + } + var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); + return reHasComplexSymbol.test(chars) + ? castSlice(stringToArray(result), 0, length).join('') + : result.slice(0, length); +} + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8 which returns 'object' for typed array and weak map constructors, + // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); +} + +/** + * Converts `value` to a finite number. + * + * @static + * @memberOf _ + * @since 4.12.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted number. + * @example + * + * _.toFinite(3.2); + * // => 3.2 + * + * _.toFinite(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toFinite(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toFinite('3.2'); + * // => 3.2 + */ +function toFinite(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = (value < 0 ? -1 : 1); + return sign * MAX_INTEGER; + } + return value === value ? value : 0; +} + +/** + * Converts `value` to an integer. + * + * **Note:** This function is loosely based on + * [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3.2); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3.2'); + * // => 3 + */ +function toInteger(value) { + var result = toFinite(value), + remainder = result % 1; + + return result === result ? (remainder ? result - remainder : result) : 0; +} + +/** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 + */ +function toNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject(value)) { + var other = isFunction(value.valueOf) ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); +} + +/** + * Pads `string` on the right side if it's shorter than `length`. Padding + * characters are truncated if they exceed `length`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.padEnd('abc', 6); + * // => 'abc ' + * + * _.padEnd('abc', 6, '_-'); + * // => 'abc_-_' + * + * _.padEnd('abc', 3); + * // => 'abc' + */ +function padEnd(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + return (length && strLength < length) + ? (string + createPadding(length - strLength, chars)) + : string; +} + +module.exports = padEnd; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/package.json new file mode 100644 index 00000000..c5573d0f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/package.json @@ -0,0 +1,83 @@ +{ + "name": "lodash.padend", + "version": "4.5.0", + "description": "The lodash method `_.padEnd` exported as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "keywords": [ + "lodash-modularized", + "padend" + ], + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine.bublitz@gmail.com", + "url": "https://github.com/phated" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "dependencies": { + "lodash._baseslice": "~4.0.0", + "lodash._basetostring": "~4.12.0", + "lodash.tostring": "^4.0.0" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "_id": "lodash.padend@4.5.0", + "_shasum": "a289e9377ee2e6de8ba7f11f3a8eb326070b7619", + "_from": "lodash.padend@>=4.1.0 <5.0.0", + "_npmVersion": "2.15.5", + "_nodeVersion": "5.5.0", + "_npmUser": { + "name": "jdalton", + "email": "john.david.dalton@gmail.com" + }, + "dist": { + "shasum": "a289e9377ee2e6de8ba7f11f3a8eb326070b7619", + "tarball": "https://registry.npmjs.org/lodash.padend/-/lodash.padend-4.5.0.tgz" + }, + "maintainers": [ + { + "name": "jdalton", + "email": "john.david.dalton@gmail.com" + }, + { + "name": "mathias", + "email": "mathias@qiwi.be" + }, + { + "name": "phated", + "email": "blaine.bublitz@gmail.com" + } + ], + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/lodash.padend-4.5.0.tgz_1463062451966_0.5034168094862252" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/lodash.padend/-/lodash.padend-4.5.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/LICENSE new file mode 100644 index 00000000..e0c69d56 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/LICENSE @@ -0,0 +1,47 @@ +Copyright jQuery Foundation and other contributors + +Based on Underscore.js, copyright Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/lodash/lodash + +The following license applies to all parts of this software except as +documented below: + +==== + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +==== + +Copyright and related rights for sample code are waived via CC0. Sample +code is defined as all source code displayed within the prose of the +documentation. + +CC0: http://creativecommons.org/publicdomain/zero/1.0/ + +==== + +Files located in the node_modules and vendor directories are externally +maintained libraries used by this software which have their own +licenses; we recommend you read them, as their terms may differ from the +terms above. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/README.md new file mode 100644 index 00000000..bcc1c5aa --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/README.md @@ -0,0 +1,18 @@ +# lodash.padstart v4.5.0 + +The [lodash](https://lodash.com/) method `_.padStart` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.padstart +``` + +In Node.js: +```js +var padStart = require('lodash.padstart'); +``` + +See the [documentation](https://lodash.com/docs#padStart) or [package source](https://github.com/lodash/lodash/blob/4.5.0-npm-packages/lodash.padstart) for more details. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/index.js new file mode 100644 index 00000000..45688953 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/index.js @@ -0,0 +1,428 @@ +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ +var baseSlice = require('lodash._baseslice'), + baseToString = require('lodash._basetostring'), + toString = require('lodash.tostring'); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991, + MAX_INTEGER = 1.7976931348623157e+308, + NAN = 0 / 0; + +/** `Object#toString` result references. */ +var funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + symbolTag = '[object Symbol]'; + +/** Used to match leading and trailing whitespace. */ +var reTrim = /^\s+|\s+$/g; + +/** Used to detect bad signed hexadecimal string values. */ +var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + +/** Used to detect binary string values. */ +var reIsBinary = /^0b[01]+$/i; + +/** Used to detect octal string values. */ +var reIsOctal = /^0o[0-7]+$/i; + +/** Used to compose unicode character classes. */ +var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', + rsComboSymbolsRange = '\\u20d0-\\u20f0', + rsVarRange = '\\ufe0e\\ufe0f'; + +/** Used to compose unicode capture groups. */ +var rsAstral = '[' + rsAstralRange + ']', + rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsZWJ = '\\u200d'; + +/** Used to compose unicode regexes. */ +var reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + +/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ +var reComplexSymbol = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + +/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ +var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); + +/** Built-in method references without a dependency on `root`. */ +var freeParseInt = parseInt; + +/** + * Gets the number of symbols in `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the string size. + */ +function stringSize(string) { + if (!(string && reHasComplexSymbol.test(string))) { + return string.length; + } + var result = reComplexSymbol.lastIndex = 0; + while (reComplexSymbol.test(string)) { + result++; + } + return result; +} + +/** + * Converts `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function stringToArray(string) { + return string.match(reComplexSymbol); +} + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeCeil = Math.ceil, + nativeFloor = Math.floor; + +/** + * The base implementation of `_.repeat` which doesn't coerce arguments. + * + * @private + * @param {string} string The string to repeat. + * @param {number} n The number of times to repeat the string. + * @returns {string} Returns the repeated string. + */ +function baseRepeat(string, n) { + var result = ''; + if (!string || n < 1 || n > MAX_SAFE_INTEGER) { + return result; + } + // Leverage the exponentiation by squaring algorithm for a faster repeat. + // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. + do { + if (n % 2) { + result += string; + } + n = nativeFloor(n / 2); + if (n) { + string += string; + } + } while (n); + + return result; +} + +/** + * Casts `array` to a slice if it's needed. + * + * @private + * @param {Array} array The array to inspect. + * @param {number} start The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the cast slice. + */ +function castSlice(array, start, end) { + var length = array.length; + end = end === undefined ? length : end; + return (!start && end >= length) ? array : baseSlice(array, start, end); +} + +/** + * Creates the padding for `string` based on `length`. The `chars` string + * is truncated if the number of characters exceeds `length`. + * + * @private + * @param {number} length The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padding for `string`. + */ +function createPadding(length, chars) { + chars = chars === undefined ? ' ' : baseToString(chars); + + var charsLength = chars.length; + if (charsLength < 2) { + return charsLength ? baseRepeat(chars, length) : chars; + } + var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); + return reHasComplexSymbol.test(chars) + ? castSlice(stringToArray(result), 0, length).join('') + : result.slice(0, length); +} + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8 which returns 'object' for typed array and weak map constructors, + // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); +} + +/** + * Converts `value` to a finite number. + * + * @static + * @memberOf _ + * @since 4.12.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted number. + * @example + * + * _.toFinite(3.2); + * // => 3.2 + * + * _.toFinite(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toFinite(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toFinite('3.2'); + * // => 3.2 + */ +function toFinite(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = (value < 0 ? -1 : 1); + return sign * MAX_INTEGER; + } + return value === value ? value : 0; +} + +/** + * Converts `value` to an integer. + * + * **Note:** This function is loosely based on + * [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3.2); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3.2'); + * // => 3 + */ +function toInteger(value) { + var result = toFinite(value), + remainder = result % 1; + + return result === result ? (remainder ? result - remainder : result) : 0; +} + +/** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 + */ +function toNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject(value)) { + var other = isFunction(value.valueOf) ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); +} + +/** + * Pads `string` on the left side if it's shorter than `length`. Padding + * characters are truncated if they exceed `length`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.padStart('abc', 6); + * // => ' abc' + * + * _.padStart('abc', 6, '_-'); + * // => '_-_abc' + * + * _.padStart('abc', 3); + * // => 'abc' + */ +function padStart(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + return (length && strLength < length) + ? (createPadding(length - strLength, chars) + string) + : string; +} + +module.exports = padStart; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/package.json new file mode 100644 index 00000000..560c4eb3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/package.json @@ -0,0 +1,83 @@ +{ + "name": "lodash.padstart", + "version": "4.5.0", + "description": "The lodash method `_.padStart` exported as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "keywords": [ + "lodash-modularized", + "padstart" + ], + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine.bublitz@gmail.com", + "url": "https://github.com/phated" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "dependencies": { + "lodash._baseslice": "~4.0.0", + "lodash._basetostring": "~4.12.0", + "lodash.tostring": "^4.0.0" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "_id": "lodash.padstart@4.5.0", + "_shasum": "3ea190f6734841c3364d279d11e056726b60a79a", + "_from": "lodash.padstart@>=4.1.0 <5.0.0", + "_npmVersion": "2.15.5", + "_nodeVersion": "5.5.0", + "_npmUser": { + "name": "jdalton", + "email": "john.david.dalton@gmail.com" + }, + "dist": { + "shasum": "3ea190f6734841c3364d279d11e056726b60a79a", + "tarball": "https://registry.npmjs.org/lodash.padstart/-/lodash.padstart-4.5.0.tgz" + }, + "maintainers": [ + { + "name": "jdalton", + "email": "john.david.dalton@gmail.com" + }, + { + "name": "mathias", + "email": "mathias@qiwi.be" + }, + { + "name": "phated", + "email": "blaine.bublitz@gmail.com" + } + ], + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/lodash.padstart-4.5.0.tgz_1463062453524_0.18468116875737906" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/lodash.padstart/-/lodash.padstart-4.5.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.tostring/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.tostring/LICENSE new file mode 100644 index 00000000..e0c69d56 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.tostring/LICENSE @@ -0,0 +1,47 @@ +Copyright jQuery Foundation and other contributors + +Based on Underscore.js, copyright Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/lodash/lodash + +The following license applies to all parts of this software except as +documented below: + +==== + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +==== + +Copyright and related rights for sample code are waived via CC0. Sample +code is defined as all source code displayed within the prose of the +documentation. + +CC0: http://creativecommons.org/publicdomain/zero/1.0/ + +==== + +Files located in the node_modules and vendor directories are externally +maintained libraries used by this software which have their own +licenses; we recommend you read them, as their terms may differ from the +terms above. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.tostring/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.tostring/README.md new file mode 100644 index 00000000..95f165b0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.tostring/README.md @@ -0,0 +1,18 @@ +# lodash.tostring v4.1.4 + +The [lodash](https://lodash.com/) method `_.toString` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.tostring +``` + +In Node.js: +```js +var toString = require('lodash.tostring'); +``` + +See the [documentation](https://lodash.com/docs#toString) or [package source](https://github.com/lodash/lodash/blob/4.1.4-npm-packages/lodash.tostring) for more details. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.tostring/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.tostring/index.js new file mode 100644 index 00000000..3dab2b4b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.tostring/index.js @@ -0,0 +1,137 @@ +/** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Built-in value references. */ +var Symbol = root.Symbol; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + +/** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); +} + +/** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + return value == null ? '' : baseToString(value); +} + +module.exports = toString; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.tostring/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.tostring/package.json new file mode 100644 index 00000000..2c171d14 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.tostring/package.json @@ -0,0 +1,77 @@ +{ + "name": "lodash.tostring", + "version": "4.1.4", + "description": "The lodash method `_.toString` exported as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "keywords": [ + "lodash-modularized", + "tostring" + ], + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine.bublitz@gmail.com", + "url": "https://github.com/phated" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "_id": "lodash.tostring@4.1.4", + "_shasum": "560c27d1f8eadde03c2cce198fef5c031d8298fb", + "_from": "lodash.tostring@4.1.4", + "_npmVersion": "2.15.9", + "_nodeVersion": "4.2.4", + "_npmUser": { + "name": "jdalton", + "email": "john.david.dalton@gmail.com" + }, + "dist": { + "shasum": "560c27d1f8eadde03c2cce198fef5c031d8298fb", + "tarball": "https://registry.npmjs.org/lodash.tostring/-/lodash.tostring-4.1.4.tgz" + }, + "maintainers": [ + { + "name": "jdalton", + "email": "john.david.dalton@gmail.com" + }, + { + "name": "mathias", + "email": "mathias@qiwi.be" + }, + { + "name": "phated", + "email": "blaine.bublitz@gmail.com" + } + ], + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/lodash.tostring-4.1.4.tgz_1469458352677_0.677248232299462" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/lodash.tostring/-/lodash.tostring-4.1.4.tgz" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/package.json new file mode 100644 index 00000000..57652359 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/package.json @@ -0,0 +1,64 @@ +{ + "name": "gauge", + "version": "1.2.7", + "description": "A terminal based horizontal guage", + "main": "progress-bar.js", + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/gauge.git" + }, + "keywords": [ + "progressbar", + "progress", + "gauge" + ], + "author": { + "name": "Rebecca Turner", + "email": "me@re-becca.org" + }, + "license": "ISC", + "bugs": { + "url": "https://github.com/iarna/gauge/issues" + }, + "homepage": "https://github.com/iarna/gauge", + "dependencies": { + "ansi": "^0.3.0", + "has-unicode": "^2.0.0", + "lodash.pad": "^4.1.0", + "lodash.padend": "^4.1.0", + "lodash.padstart": "^4.1.0" + }, + "devDependencies": { + "tap": "^5.6.0" + }, + "gitHead": "75a7d0a4ed67489ac992ed3d211bed60376ca7c1", + "_id": "gauge@1.2.7", + "_shasum": "e9cec5483d3d4ee0ef44b60a7d99e4935e136d93", + "_from": "gauge@>=1.2.5 <1.3.0", + "_npmVersion": "3.7.2", + "_nodeVersion": "4.2.2", + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "dist": { + "shasum": "e9cec5483d3d4ee0ef44b60a7d99e4935e136d93", + "tarball": "https://registry.npmjs.org/gauge/-/gauge-1.2.7.tgz" + }, + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + } + ], + "_npmOperationalInternal": { + "host": "packages-9-west.internal.npmjs.com", + "tmp": "tmp/gauge-1.2.7.tgz_1455835409513_0.6293477965518832" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/gauge/-/gauge-1.2.7.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/progress-bar.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/progress-bar.js new file mode 100644 index 00000000..ddfc4a44 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/node_modules/gauge/progress-bar.js @@ -0,0 +1,225 @@ +"use strict" +var hasUnicode = require("has-unicode") +var ansi = require("ansi") +var align = { + center: require("lodash.pad"), + left: require("lodash.padend"), + right: require("lodash.padstart") +} +var defaultStream = process.stderr +function isTTY() { + return process.stderr.isTTY +} +function getWritableTTYColumns() { + // Writing to the final column wraps the line + // We have to use stdout here, because Node's magic SIGWINCH handler only + // updates process.stdout, not process.stderr + return process.stdout.columns - 1 +} + +var ProgressBar = module.exports = function (options, cursor) { + if (! options) options = {} + if (! cursor && options.write) { + cursor = options + options = {} + } + if (! cursor) { + cursor = ansi(defaultStream) + } + this.cursor = cursor + this.showing = false + this.theme = options.theme || (hasUnicode() ? ProgressBar.unicode : ProgressBar.ascii) + this.template = options.template || [ + {type: "name", separated: true, length: 25}, + {type: "spinner", separated: true}, + {type: "startgroup"}, + {type: "completionbar"}, + {type: "endgroup"} + ] + this.updatefreq = options.maxUpdateFrequency == null ? 50 : options.maxUpdateFrequency + this.lastName = "" + this.lastCompleted = 0 + this.spun = 0 + this.last = new Date(0) + + var self = this + this._handleSizeChange = function () { + if (!self.showing) return + self.hide() + self.show() + } +} +ProgressBar.prototype = {} + +ProgressBar.unicode = { + startgroup: "╢", + endgroup: "╟", + complete: "█", + incomplete: "░", + spinner: "▀▐▄▌", + subsection: "→" +} + +ProgressBar.ascii = { + startgroup: "|", + endgroup: "|", + complete: "#", + incomplete: "-", + spinner: "-\\|/", + subsection: "->" +} + +ProgressBar.prototype.setTheme = function(theme) { + this.theme = theme +} + +ProgressBar.prototype.setTemplate = function(template) { + this.template = template +} + +ProgressBar.prototype._enableResizeEvents = function() { + process.stdout.on('resize', this._handleSizeChange) +} + +ProgressBar.prototype._disableResizeEvents = function() { + process.stdout.removeListener('resize', this._handleSizeChange) +} + +ProgressBar.prototype.disable = function() { + this.hide() + this.disabled = true +} + +ProgressBar.prototype.enable = function() { + this.disabled = false + this.show() +} + +ProgressBar.prototype.hide = function() { + if (!isTTY()) return + if (this.disabled) return + this.cursor.show() + if (this.showing) this.cursor.up(1) + this.cursor.horizontalAbsolute(0).eraseLine() + this.showing = false +} + +var repeat = function (str, count) { + var out = "" + for (var ii=0; ii P | |----|\n' ], + [ 'show' ] ]) +}) + +test("window resizing", function (t) { + t.plan(16) + process.stderr.isTTY = true + process.stdout.columns = 32 + bar.show("NAME", 0.1) + cursor = [] + bar.last = new Date(0) + bar.pulse() + isOutput(t, "32 columns", + [ [ 'up', 1 ], + [ 'hide' ], + [ 'horizontalAbsolute', 0 ], + [ 'write', 'NAME / |##------------------|\n' ], + [ 'show' ] ]) + + process.stdout.columns = 16 + bar.show("NAME", 0.5) + cursor = [] + bar.last = new Date(0) + bar.pulse() + isOutput(t, "16 columns", + [ [ 'up', 1 ], + [ 'hide' ], + [ 'horizontalAbsolute', 0 ], + [ 'write', 'NAME - |##--|\n' ], + [ 'show' ] ]); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/package.json new file mode 100644 index 00000000..271d21e4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/npmlog/package.json @@ -0,0 +1,73 @@ +{ + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "name": "npmlog", + "description": "logger for npm", + "version": "2.0.4", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/npmlog.git" + }, + "main": "log.js", + "files": [ + "log.js" + ], + "scripts": { + "test": "tap test/*.js" + }, + "dependencies": { + "ansi": "~0.3.1", + "are-we-there-yet": "~1.1.2", + "gauge": "~1.2.5" + }, + "devDependencies": { + "tap": "~5.7.0" + }, + "license": "ISC", + "gitHead": "3732fd4ba1ca2d47c6102343e6c3fb7e66df7fe5", + "bugs": { + "url": "https://github.com/npm/npmlog/issues" + }, + "homepage": "https://github.com/npm/npmlog#readme", + "_id": "npmlog@2.0.4", + "_shasum": "98b52530f2514ca90d09ec5b22c8846722375692", + "_from": "npmlog@>=2.0.4 <2.1.0", + "_npmVersion": "3.9.1", + "_nodeVersion": "5.10.1", + "_npmUser": { + "name": "zkat", + "email": "kat@sykosomatic.org" + }, + "dist": { + "shasum": "98b52530f2514ca90d09ec5b22c8846722375692", + "tarball": "https://registry.npmjs.org/npmlog/-/npmlog-2.0.4.tgz" + }, + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + }, + { + "name": "isaacs", + "email": "i@izs.me" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" + } + ], + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/npmlog-2.0.4.tgz_1463616637725_0.461703865788877" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/npmlog/-/npmlog-2.0.4.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/once/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/once/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/once/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/once/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/once/README.md new file mode 100644 index 00000000..1f1ffca9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/once/README.md @@ -0,0 +1,79 @@ +# once + +Only call a function once. + +## usage + +```javascript +var once = require('once') + +function load (file, cb) { + cb = once(cb) + loader.load('file') + loader.once('load', cb) + loader.once('error', cb) +} +``` + +Or add to the Function.prototype in a responsible way: + +```javascript +// only has to be done once +require('once').proto() + +function load (file, cb) { + cb = cb.once() + loader.load('file') + loader.once('load', cb) + loader.once('error', cb) +} +``` + +Ironically, the prototype feature makes this module twice as +complicated as necessary. + +To check whether you function has been called, use `fn.called`. Once the +function is called for the first time the return value of the original +function is saved in `fn.value` and subsequent calls will continue to +return this value. + +```javascript +var once = require('once') + +function load (cb) { + cb = once(cb) + var stream = createStream() + stream.once('data', cb) + stream.once('end', function () { + if (!cb.called) cb(new Error('not found')) + }) +} +``` + +## `once.strict(func)` + +Throw an error if the function is called twice. + +Some functions are expected to be called only once. Using `once` for them would +potentially hide logical errors. + +In the example below, the `greet` function has to call the callback only once: + +```javascript +function greet (name, cb) { + // return is missing from the if statement + // when no name is passed, the callback is called twice + if (!name) cb('Hello anonymous') + cb('Hello ' + name) +} + +function log (msg) { + console.log(msg) +} + +// this will print 'Hello anonymous' but the logical error will be missed +greet(null, once(msg)) + +// once.strict will print 'Hello anonymous' and throw an error when the callback will be called the second time +greet(null, once.strict(msg)) +``` diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/once/once.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/once/once.js new file mode 100644 index 00000000..23540673 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/once/once.js @@ -0,0 +1,42 @@ +var wrappy = require('wrappy') +module.exports = wrappy(once) +module.exports.strict = wrappy(onceStrict) + +once.proto = once(function () { + Object.defineProperty(Function.prototype, 'once', { + value: function () { + return once(this) + }, + configurable: true + }) + + Object.defineProperty(Function.prototype, 'onceStrict', { + value: function () { + return onceStrict(this) + }, + configurable: true + }) +}) + +function once (fn) { + var f = function () { + if (f.called) return f.value + f.called = true + return f.value = fn.apply(this, arguments) + } + f.called = false + return f +} + +function onceStrict (fn) { + var f = function () { + if (f.called) + throw new Error(f.onceError) + f.called = true + return f.value = fn.apply(this, arguments) + } + var name = fn.name || 'Function wrapped with `once`' + f.onceError = name + " shouldn't be called more than once" + f.called = false + return f +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/once/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/once/package.json new file mode 100644 index 00000000..1e957cff --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/once/package.json @@ -0,0 +1,67 @@ +{ + "name": "once", + "version": "1.4.0", + "description": "Run a function exactly one time", + "main": "once.js", + "directories": { + "test": "test" + }, + "dependencies": { + "wrappy": "1" + }, + "devDependencies": { + "tap": "^7.0.1" + }, + "scripts": { + "test": "tap test/*.js" + }, + "files": [ + "once.js" + ], + "repository": { + "type": "git", + "url": "git://github.com/isaacs/once.git" + }, + "keywords": [ + "once", + "function", + "one", + "single" + ], + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "ISC", + "gitHead": "0e614d9f5a7e6f0305c625f6b581f6d80b33b8a6", + "bugs": { + "url": "https://github.com/isaacs/once/issues" + }, + "homepage": "https://github.com/isaacs/once#readme", + "_id": "once@1.4.0", + "_shasum": "583b1aa775961d4b113ac17d9c50baef9dd76bd1", + "_from": "once@1.4.0", + "_npmVersion": "3.10.7", + "_nodeVersion": "6.5.0", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "dist": { + "shasum": "583b1aa775961d4b113ac17d9c50baef9dd76bd1", + "tarball": "https://registry.npmjs.org/once/-/once-1.4.0.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/once-1.4.0.tgz_1473196269128_0.537820661207661" + }, + "_resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/opener/LICENSE.txt b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/opener/LICENSE.txt new file mode 100644 index 00000000..f580e3d3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/opener/LICENSE.txt @@ -0,0 +1,19 @@ +Copyright © 2012–2015 Domenic Denicola + +This work is free. You can redistribute it and/or modify it under the +terms of the Do What The Fuck You Want To Public License, Version 2, +as published by Sam Hocevar. See below for more details. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 + + Copyright (C) 2004 Sam Hocevar + + Everyone is permitted to copy and distribute verbatim or modified + copies of this license document, and changing it is allowed as long + as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/opener/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/opener/README.md new file mode 100644 index 00000000..8a803f33 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/opener/README.md @@ -0,0 +1,57 @@ +# It Opens Stuff + +That is, in your desktop environment. This will make *actual windows pop up*, with stuff in them: + +```bash +npm install opener -g + +opener http://google.com +opener ./my-file.txt +opener firefox +opener npm run lint +``` + +Also if you want to use it programmatically you can do that too: + +```js +var opener = require("opener"); + +opener("http://google.com"); +opener("./my-file.txt"); +opener("firefox"); +opener("npm run lint"); +``` + +Plus, it returns the child process created, so you can do things like let your script exit while the window stays open: + +```js +var editor = opener("documentation.odt"); +editor.unref(); +// These other unrefs may be necessary if your OS's opener process +// exits before the process it started is complete. +editor.stdin.unref(); +editor.stdout.unref(); +editor.stderr.unref(); +``` + + +## Use It for Good + +Like opening the user's browser with a test harness in your package's test script: + +```json +{ + "scripts": { + "test": "opener ./test/runner.html" + }, + "devDependencies": { + "opener": "*" + } +} +``` + +## Why + +Because Windows has `start`, Macs have `open`, and *nix has `xdg-open`. At least +[according to some guy on StackOverflow](http://stackoverflow.com/q/1480971/3191). And I like things that work on all +three. Like Node.js. And Opener. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/opener/opener.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/opener/opener.js new file mode 100644 index 00000000..8951fa2d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/opener/opener.js @@ -0,0 +1,60 @@ +#!/usr/bin/env node + +"use strict"; + +var childProcess = require("child_process"); + +function opener(args, options, callback) { + // http://stackoverflow.com/q/1480971/3191, but see below for Windows. + var command = process.platform === "win32" ? "cmd" : + process.platform === "darwin" ? "open" : + "xdg-open"; + + if (typeof args === "string") { + args = [args]; + } + + if (typeof options === "function") { + callback = options; + options = {}; + } + + if (options && typeof options === "object" && options.command) { + if (process.platform === "win32") { + // *always* use cmd on windows + args = [options.command].concat(args); + } else { + command = options.command; + } + } + + if (process.platform === "win32") { + // On Windows, we really want to use the "start" command. But, the rules regarding arguments with spaces, and + // escaping them with quotes, can get really arcane. So the easiest way to deal with this is to pass off the + // responsibility to "cmd /c", which has that logic built in. + // + // Furthermore, if "cmd /c" double-quoted the first parameter, then "start" will interpret it as a window title, + // so we need to add a dummy empty-string window title: http://stackoverflow.com/a/154090/3191 + // + // Additionally, on Windows ampersand needs to be escaped when passed to "start" + args = args.map(function(value) { + return value.replace(/&/g, '^&'); + }); + args = ["/c", "start", '""'].concat(args); + } + + return childProcess.execFile(command, args, options, callback); +} + +// Export `opener` for programmatic access. +// You might use this to e.g. open a website: `opener("http://google.com")` +module.exports = opener; + +// If we're being called from the command line, just execute, using the command-line arguments. +if (require.main && require.main.id === module.id) { + opener(process.argv.slice(2), function (error) { + if (error) { + throw error; + } + }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/opener/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/opener/package.json new file mode 100644 index 00000000..aab02afc --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/opener/package.json @@ -0,0 +1,54 @@ +{ + "name": "opener", + "description": "Opens stuff, like webpages and files and executables, cross-platform", + "version": "1.4.1", + "author": { + "name": "Domenic Denicola", + "email": "d@domenic.me", + "url": "https://domenic.me/" + }, + "license": "WTFPL", + "repository": { + "type": "git", + "url": "https://github.com/domenic/opener" + }, + "main": "opener.js", + "bin": { + "opener": "opener.js" + }, + "files": [ + "opener.js" + ], + "scripts": { + "lint": "jshint opener.js" + }, + "devDependencies": { + "jshint": "^2.6.3" + }, + "gitHead": "d0ee95b19951703462fa593baa16e81fdff7827c", + "bugs": { + "url": "https://github.com/domenic/opener/issues" + }, + "homepage": "https://github.com/domenic/opener", + "_id": "opener@1.4.1", + "_shasum": "897590acd1aed3311b703b58bccb4d43f56f2895", + "_from": "opener@>=1.4.1 <1.5.0", + "_npmVersion": "2.7.0", + "_nodeVersion": "1.5.1", + "_npmUser": { + "name": "domenic", + "email": "d@domenic.me" + }, + "maintainers": [ + { + "name": "domenic", + "email": "domenic@domenicdenicola.com" + } + ], + "dist": { + "shasum": "897590acd1aed3311b703b58bccb4d43f56f2895", + "tarball": "http://registry.npmjs.org/opener/-/opener-1.4.1.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/opener/-/opener-1.4.1.tgz" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/.npmignore new file mode 100644 index 00000000..8c23deeb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/.npmignore @@ -0,0 +1,13 @@ +*.swp +.*.swp + +.DS_Store +*~ +.project +.settings +npm-debug.log +coverage.html +.idea +lib-cov + +node_modules diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/.travis.yml new file mode 100644 index 00000000..99f2bbf5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/.travis.yml @@ -0,0 +1,9 @@ +language: node_js +language: node_js +node_js: + - '0.8' + - '0.10' + - '0.12' + - 'iojs' +before_install: + - npm install -g npm@latest diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/README.md new file mode 100644 index 00000000..08fd9002 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/README.md @@ -0,0 +1,63 @@ +# osenv + +Look up environment settings specific to different operating systems. + +## Usage + +```javascript +var osenv = require('osenv') +var path = osenv.path() +var user = osenv.user() +// etc. + +// Some things are not reliably in the env, and have a fallback command: +var h = osenv.hostname(function (er, hostname) { + h = hostname +}) +// This will still cause it to be memoized, so calling osenv.hostname() +// is now an immediate operation. + +// You can always send a cb, which will get called in the nextTick +// if it's been memoized, or wait for the fallback data if it wasn't +// found in the environment. +osenv.hostname(function (er, hostname) { + if (er) console.error('error looking up hostname') + else console.log('this machine calls itself %s', hostname) +}) +``` + +## osenv.hostname() + +The machine name. Calls `hostname` if not found. + +## osenv.user() + +The currently logged-in user. Calls `whoami` if not found. + +## osenv.prompt() + +Either PS1 on unix, or PROMPT on Windows. + +## osenv.tmpdir() + +The place where temporary files should be created. + +## osenv.home() + +No place like it. + +## osenv.path() + +An array of the places that the operating system will search for +executables. + +## osenv.editor() + +Return the executable name of the editor program. This uses the EDITOR +and VISUAL environment variables, and falls back to `vi` on Unix, or +`notepad.exe` on Windows. + +## osenv.shell() + +The SHELL on Unix, which Windows calls the ComSpec. Defaults to 'bash' +or 'cmd'. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/node_modules/os-homedir/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/node_modules/os-homedir/index.js new file mode 100644 index 00000000..758ff653 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/node_modules/os-homedir/index.js @@ -0,0 +1,24 @@ +'use strict'; +var os = require('os'); + +function homedir() { + var env = process.env; + var home = env.HOME; + var user = env.LOGNAME || env.USER || env.LNAME || env.USERNAME; + + if (process.platform === 'win32') { + return env.USERPROFILE || env.HOMEDRIVE + env.HOMEPATH || home || null; + } + + if (process.platform === 'darwin') { + return home || (user ? '/Users/' + user : null); + } + + if (process.platform === 'linux') { + return home || (user ? (process.getuid() === 0 ? '/root' : '/home/' + user) : null); + } + + return home || null; +} + +module.exports = typeof os.homedir === 'function' ? os.homedir : homedir; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/node_modules/os-homedir/license b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/node_modules/os-homedir/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/node_modules/os-homedir/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/node_modules/os-homedir/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/node_modules/os-homedir/package.json new file mode 100644 index 00000000..c9a3b650 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/node_modules/os-homedir/package.json @@ -0,0 +1,70 @@ +{ + "name": "os-homedir", + "version": "1.0.0", + "description": "io.js 2.3.0 os.homedir() ponyfill", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/os-homedir.git" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "node test.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "built-in", + "core", + "ponyfill", + "polyfill", + "shim", + "os", + "homedir", + "home", + "dir", + "directory", + "folder", + "user", + "path" + ], + "devDependencies": { + "ava": "0.0.4", + "path-exists": "^1.0.0" + }, + "gitHead": "7e39e2e049de404f06233fa617ecf46fed997a78", + "bugs": { + "url": "https://github.com/sindresorhus/os-homedir/issues" + }, + "homepage": "https://github.com/sindresorhus/os-homedir", + "_id": "os-homedir@1.0.0", + "_shasum": "e37078bc61b5869063053897257e39ec1261b702", + "_from": "os-homedir@>=1.0.0 <2.0.0", + "_npmVersion": "2.11.1", + "_nodeVersion": "2.3.0", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "dist": { + "shasum": "e37078bc61b5869063053897257e39ec1261b702", + "tarball": "http://registry.npmjs.org/os-homedir/-/os-homedir-1.0.0.tgz" + }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/node_modules/os-homedir/readme.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/node_modules/os-homedir/readme.md new file mode 100644 index 00000000..4851f104 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/node_modules/os-homedir/readme.md @@ -0,0 +1,33 @@ +# os-homedir [![Build Status](https://travis-ci.org/sindresorhus/os-homedir.svg?branch=master)](https://travis-ci.org/sindresorhus/os-homedir) + +> io.js 2.3.0 [`os.homedir()`](https://iojs.org/api/os.html#os_os_homedir) ponyfill + +> Ponyfill: A polyfill that doesn't overwrite the native method + + +## Install + +``` +$ npm install --save os-homedir +``` + + +## Usage + +```js +var osHomedir = require('os-homedir'); + +console.log(osHomedir()); +//=> /Users/sindresorhus +``` + + +## Related + +- [user-home](https://github.com/sindresorhus/user-home) - Same as this module but caches the result +- [home-or-tmp](https://github.com/sindresorhus/home-or-tmp) - Get the user home directory with fallback to the system temp directory + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/node_modules/os-tmpdir/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/node_modules/os-tmpdir/index.js new file mode 100644 index 00000000..52d90bf2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/node_modules/os-tmpdir/index.js @@ -0,0 +1,25 @@ +'use strict'; +var isWindows = process.platform === 'win32'; +var trailingSlashRe = isWindows ? /[^:]\\$/ : /.\/$/; + +// https://github.com/nodejs/io.js/blob/3e7a14381497a3b73dda68d05b5130563cdab420/lib/os.js#L25-L43 +module.exports = function () { + var path; + + if (isWindows) { + path = process.env.TEMP || + process.env.TMP || + (process.env.SystemRoot || process.env.windir) + '\\temp'; + } else { + path = process.env.TMPDIR || + process.env.TMP || + process.env.TEMP || + '/tmp'; + } + + if (trailingSlashRe.test(path)) { + path = path.slice(0, -1); + } + + return path; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/node_modules/os-tmpdir/license b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/node_modules/os-tmpdir/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/node_modules/os-tmpdir/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/node_modules/os-tmpdir/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/node_modules/os-tmpdir/package.json new file mode 100644 index 00000000..f8b2682b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/node_modules/os-tmpdir/package.json @@ -0,0 +1,69 @@ +{ + "name": "os-tmpdir", + "version": "1.0.1", + "description": "Node.js os.tmpdir() ponyfill", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/sindresorhus/os-tmpdir" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "node test.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "built-in", + "core", + "ponyfill", + "polyfill", + "shim", + "os", + "tmpdir", + "tempdir", + "tmp", + "temp", + "dir", + "directory", + "env", + "environment" + ], + "devDependencies": { + "ava": "0.0.4" + }, + "gitHead": "5c5d355f81378980db629d60128ad03e02b1c1e5", + "bugs": { + "url": "https://github.com/sindresorhus/os-tmpdir/issues" + }, + "homepage": "https://github.com/sindresorhus/os-tmpdir", + "_id": "os-tmpdir@1.0.1", + "_shasum": "e9b423a1edaf479882562e92ed71d7743a071b6e", + "_from": "os-tmpdir@>=1.0.0 <2.0.0", + "_npmVersion": "2.9.1", + "_nodeVersion": "0.12.3", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "dist": { + "shasum": "e9b423a1edaf479882562e92ed71d7743a071b6e", + "tarball": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.1.tgz" + }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.1.tgz" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/node_modules/os-tmpdir/readme.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/node_modules/os-tmpdir/readme.md new file mode 100644 index 00000000..54d4c6ec --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/node_modules/os-tmpdir/readme.md @@ -0,0 +1,36 @@ +# os-tmpdir [![Build Status](https://travis-ci.org/sindresorhus/os-tmpdir.svg?branch=master)](https://travis-ci.org/sindresorhus/os-tmpdir) + +> Node.js [`os.tmpdir()`](https://nodejs.org/api/os.html#os_os_tmpdir) ponyfill + +> Ponyfill: A polyfill that doesn't overwrite the native method + +Use this instead of `require('os').tmpdir()` to get a consistent behaviour on different Node.js versions (even 0.8). + +*This is actually taken from io.js 2.0.2 as it contains some fixes that haven't bubbled up to Node.js yet.* + + +## Install + +``` +$ npm install --save os-tmpdir +``` + + +## Usage + +```js +var osTmpdir = require('os-tmpdir'); + +osTmpdir(); +//=> /var/folders/m3/5574nnhn0yj488ccryqr7tc80000gn/T +``` + + +## API + +See the [`os.tmpdir()` docs](https://nodejs.org/api/os.html#os_os_tmpdir). + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/osenv.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/osenv.js new file mode 100644 index 00000000..702a95b9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/osenv.js @@ -0,0 +1,72 @@ +var isWindows = process.platform === 'win32' +var path = require('path') +var exec = require('child_process').exec +var osTmpdir = require('os-tmpdir') +var osHomedir = require('os-homedir') + +// looking up envs is a bit costly. +// Also, sometimes we want to have a fallback +// Pass in a callback to wait for the fallback on failures +// After the first lookup, always returns the same thing. +function memo (key, lookup, fallback) { + var fell = false + var falling = false + exports[key] = function (cb) { + var val = lookup() + if (!val && !fell && !falling && fallback) { + fell = true + falling = true + exec(fallback, function (er, output, stderr) { + falling = false + if (er) return // oh well, we tried + val = output.trim() + }) + } + exports[key] = function (cb) { + if (cb) process.nextTick(cb.bind(null, null, val)) + return val + } + if (cb && !falling) process.nextTick(cb.bind(null, null, val)) + return val + } +} + +memo('user', function () { + return ( isWindows + ? process.env.USERDOMAIN + '\\' + process.env.USERNAME + : process.env.USER + ) +}, 'whoami') + +memo('prompt', function () { + return isWindows ? process.env.PROMPT : process.env.PS1 +}) + +memo('hostname', function () { + return isWindows ? process.env.COMPUTERNAME : process.env.HOSTNAME +}, 'hostname') + +memo('tmpdir', function () { + return osTmpdir() +}) + +memo('home', function () { + return osHomedir() +}) + +memo('path', function () { + return (process.env.PATH || + process.env.Path || + process.env.path).split(isWindows ? ';' : ':') +}) + +memo('editor', function () { + return process.env.EDITOR || + process.env.VISUAL || + (isWindows ? 'notepad.exe' : 'vi') +}) + +memo('shell', function () { + return isWindows ? process.env.ComSpec || 'cmd' + : process.env.SHELL || 'bash' +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/package.json new file mode 100644 index 00000000..d5718bdb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/package.json @@ -0,0 +1,75 @@ +{ + "name": "osenv", + "version": "0.1.3", + "main": "osenv.js", + "directories": { + "test": "test" + }, + "dependencies": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + }, + "devDependencies": { + "tap": "^1.2.0" + }, + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/osenv.git" + }, + "keywords": [ + "environment", + "variable", + "home", + "tmpdir", + "path", + "prompt", + "ps1" + ], + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "ISC", + "description": "Look up environment settings specific to different operating systems", + "gitHead": "f746b3405d8f9e28054d11b97e1436f6a15016c4", + "bugs": { + "url": "https://github.com/npm/osenv/issues" + }, + "homepage": "https://github.com/npm/osenv#readme", + "_id": "osenv@0.1.3", + "_shasum": "83cf05c6d6458fc4d5ac6362ea325d92f2754217", + "_from": "osenv@0.1.3", + "_npmVersion": "3.0.0", + "_nodeVersion": "2.2.1", + "_npmUser": { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + "dist": { + "shasum": "83cf05c6d6458fc4d5ac6362ea325d92f2754217", + "tarball": "http://registry.npmjs.org/osenv/-/osenv-0.1.3.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + }, + { + "name": "robertkowalski", + "email": "rok@kowalski.gd" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "iarna", + "email": "me@re-becca.org" + } + ], + "_resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.3.tgz" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/test/unix.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/test/unix.js new file mode 100644 index 00000000..f87cbfb3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/test/unix.js @@ -0,0 +1,71 @@ +// only run this test on windows +// pretending to be another platform is too hacky, since it breaks +// how the underlying system looks up module paths and runs +// child processes, and all that stuff is cached. +if (process.platform === 'win32') { + console.log('TAP Version 13\n' + + '1..0\n' + + '# Skip unix tests, this is not unix\n') + return +} +var tap = require('tap') + +// like unix, but funny +process.env.USER = 'sirUser' +process.env.HOME = '/home/sirUser' +process.env.HOSTNAME = 'my-machine' +process.env.TMPDIR = '/tmpdir' +process.env.TMP = '/tmp' +process.env.TEMP = '/temp' +process.env.PATH = '/opt/local/bin:/usr/local/bin:/usr/bin/:bin' +process.env.PS1 = '(o_o) $ ' +process.env.EDITOR = 'edit' +process.env.VISUAL = 'visualedit' +process.env.SHELL = 'zsh' + +tap.test('basic unix sanity test', function (t) { + var osenv = require('../osenv.js') + + t.equal(osenv.user(), process.env.USER) + t.equal(osenv.home(), process.env.HOME) + t.equal(osenv.hostname(), process.env.HOSTNAME) + t.same(osenv.path(), process.env.PATH.split(':')) + t.equal(osenv.prompt(), process.env.PS1) + t.equal(osenv.tmpdir(), process.env.TMPDIR) + + // mildly evil, but it's for a test. + process.env.TMPDIR = '' + delete require.cache[require.resolve('../osenv.js')] + var osenv = require('../osenv.js') + t.equal(osenv.tmpdir(), process.env.TMP) + + process.env.TMP = '' + delete require.cache[require.resolve('../osenv.js')] + var osenv = require('../osenv.js') + t.equal(osenv.tmpdir(), process.env.TEMP) + + process.env.TEMP = '' + delete require.cache[require.resolve('../osenv.js')] + var osenv = require('../osenv.js') + osenv.home = function () { return null } + t.equal(osenv.tmpdir(), '/tmp') + + t.equal(osenv.editor(), 'edit') + process.env.EDITOR = '' + delete require.cache[require.resolve('../osenv.js')] + var osenv = require('../osenv.js') + t.equal(osenv.editor(), 'visualedit') + + process.env.VISUAL = '' + delete require.cache[require.resolve('../osenv.js')] + var osenv = require('../osenv.js') + t.equal(osenv.editor(), 'vi') + + t.equal(osenv.shell(), 'zsh') + process.env.SHELL = '' + delete require.cache[require.resolve('../osenv.js')] + var osenv = require('../osenv.js') + t.equal(osenv.shell(), 'bash') + + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/test/windows.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/test/windows.js new file mode 100644 index 00000000..c9d837a3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/test/windows.js @@ -0,0 +1,74 @@ +// only run this test on windows +// pretending to be another platform is too hacky, since it breaks +// how the underlying system looks up module paths and runs +// child processes, and all that stuff is cached. +if (process.platform !== 'win32') { + console.log('TAP version 13\n' + + '1..0 # Skip windows tests, this is not windows\n') + return +} + +// load this before clubbing the platform name. +var tap = require('tap') + +process.env.windir = 'c:\\windows' +process.env.USERDOMAIN = 'some-domain' +process.env.USERNAME = 'sirUser' +process.env.USERPROFILE = 'C:\\Users\\sirUser' +process.env.COMPUTERNAME = 'my-machine' +process.env.TMPDIR = 'C:\\tmpdir' +process.env.TMP = 'C:\\tmp' +process.env.TEMP = 'C:\\temp' +process.env.Path = 'C:\\Program Files\\;C:\\Binary Stuff\\bin' +process.env.PROMPT = '(o_o) $ ' +process.env.EDITOR = 'edit' +process.env.VISUAL = 'visualedit' +process.env.ComSpec = 'some-com' + +tap.test('basic windows sanity test', function (t) { + var osenv = require('../osenv.js') + + t.equal(osenv.user(), + process.env.USERDOMAIN + '\\' + process.env.USERNAME) + t.equal(osenv.home(), process.env.USERPROFILE) + t.equal(osenv.hostname(), process.env.COMPUTERNAME) + t.same(osenv.path(), process.env.Path.split(';')) + t.equal(osenv.prompt(), process.env.PROMPT) + t.equal(osenv.tmpdir(), process.env.TMPDIR) + + // mildly evil, but it's for a test. + process.env.TMPDIR = '' + delete require.cache[require.resolve('../osenv.js')] + var osenv = require('../osenv.js') + t.equal(osenv.tmpdir(), process.env.TMP) + + process.env.TMP = '' + delete require.cache[require.resolve('../osenv.js')] + var osenv = require('../osenv.js') + t.equal(osenv.tmpdir(), process.env.TEMP) + + process.env.TEMP = '' + delete require.cache[require.resolve('../osenv.js')] + var osenv = require('../osenv.js') + osenv.home = function () { return null } + t.equal(osenv.tmpdir(), 'c:\\windows\\temp') + + t.equal(osenv.editor(), 'edit') + process.env.EDITOR = '' + delete require.cache[require.resolve('../osenv.js')] + var osenv = require('../osenv.js') + t.equal(osenv.editor(), 'visualedit') + + process.env.VISUAL = '' + delete require.cache[require.resolve('../osenv.js')] + var osenv = require('../osenv.js') + t.equal(osenv.editor(), 'notepad.exe') + + t.equal(osenv.shell(), 'some-com') + process.env.ComSpec = '' + delete require.cache[require.resolve('../osenv.js')] + var osenv = require('../osenv.js') + t.equal(osenv.shell(), 'cmd') + + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/x.tap b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/x.tap new file mode 100644 index 00000000..90d84720 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/osenv/x.tap @@ -0,0 +1,39 @@ +TAP version 13 + # Subtest: test/unix.js + TAP version 13 + # Subtest: basic unix sanity test + ok 1 - should be equal + ok 2 - should be equal + ok 3 - should be equal + ok 4 - should be equivalent + ok 5 - should be equal + ok 6 - should be equal + ok 7 - should be equal + ok 8 - should be equal + ok 9 - should be equal + ok 10 - should be equal + ok 11 - should be equal + ok 12 - should be equal + ok 13 - should be equal + ok 14 - should be equal + 1..14 + ok 1 - basic unix sanity test # time=10.712ms + + 1..1 + # time=18.422ms +ok 1 - test/unix.js # time=169.827ms + + # Subtest: test/windows.js + TAP version 13 + 1..0 # Skip windows tests, this is not windows + +ok 2 - test/windows.js # SKIP Skip windows tests, this is not windows + + # Subtest: test/nada.js + TAP version 13 + 1..0 + +ok 2 - test/nada.js + +1..3 +# time=274.247ms diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/path-is-inside/LICENSE.txt b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/path-is-inside/LICENSE.txt new file mode 100644 index 00000000..ae20051f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/path-is-inside/LICENSE.txt @@ -0,0 +1,19 @@ +Copyright © 2013–2014 Domenic Denicola + +This work is free. You can redistribute it and/or modify it under the +terms of the Do What The Fuck You Want To Public License, Version 2, +as published by Sam Hocevar. See below for more details. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 + + Copyright (C) 2004 Sam Hocevar + + Everyone is permitted to copy and distribute verbatim or modified + copies of this license document, and changing it is allowed as long + as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/path-is-inside/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/path-is-inside/README.md new file mode 100644 index 00000000..d42e6aa7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/path-is-inside/README.md @@ -0,0 +1,35 @@ +# Is This Path Inside This Other Path? + +It turns out this question isn't trivial to answer using Node's built-in path APIs. A naive `indexOf`-based solution will fail sometimes on Windows, which is case-insensitive (see e.g. [isaacs/npm#4214][]). You might then think to be clever with `path.resolve`, but you have to be careful to account for situations whether the paths have different drive letters, or else you'll cause bugs like [isaacs/npm#4313][]. And let's not even get started on trailing slashes. + +The **path-is-inside** package will give you a robust, cross-platform way of detecting whether a given path is inside another path. + +## Usage + +Pretty simple. First the path being tested; then the potential parent. Like so: + +```js +var pathIsInside = require("path-is-inside"); + +pathIsInside("/x/y/z", "/x/y") // true +pathIsInside("/x/y", "/x/y/z") // false +``` + +## OS-Specific Behavior + +Like Node's built-in path module, path-is-inside treats all file paths on Windows as case-insensitive, whereas it treats all file paths on *-nix operating systems as case-sensitive. Keep this in mind especially when working on a Mac, where, despite Node's defaults, the OS usually treats paths case-insensitively. + +In practice, this means: + +```js +// On Windows + +pathIsInside("C:\\X\\Y\\Z", "C:\\x\\y") // true + +// On *-nix, including Mac OS X + +pathIsInside("/X/Y/Z", "/x/y") // false +``` + +[isaacs/npm#4214]: https://github.com/isaacs/npm/pull/4214 +[isaacs/npm#4313]: https://github.com/isaacs/npm/issues/4313 diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/path-is-inside/lib/path-is-inside.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/path-is-inside/lib/path-is-inside.js new file mode 100644 index 00000000..596dfd3b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/path-is-inside/lib/path-is-inside.js @@ -0,0 +1,28 @@ +"use strict"; + +var path = require("path"); + +module.exports = function (thePath, potentialParent) { + // For inside-directory checking, we want to allow trailing slashes, so normalize. + thePath = stripTrailingSep(thePath); + potentialParent = stripTrailingSep(potentialParent); + + // Node treats only Windows as case-insensitive in its path module; we follow those conventions. + if (process.platform === "win32") { + thePath = thePath.toLowerCase(); + potentialParent = potentialParent.toLowerCase(); + } + + return thePath.lastIndexOf(potentialParent, 0) === 0 && + ( + thePath[potentialParent.length] === path.sep || + thePath[potentialParent.length] === undefined + ); +}; + +function stripTrailingSep(thePath) { + if (thePath[thePath.length - 1] === path.sep) { + return thePath.slice(0, -1); + } + return thePath; +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/path-is-inside/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/path-is-inside/package.json new file mode 100644 index 00000000..b96d6fea --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/path-is-inside/package.json @@ -0,0 +1,43 @@ +{ + "name": "path-is-inside", + "description": "Tests whether one path is inside another path", + "keywords": [ + "path", + "directory", + "folder", + "inside", + "relative" + ], + "version": "1.0.1", + "author": { + "name": "Domenic Denicola", + "email": "domenic@domenicdenicola.com", + "url": "http://domenic.me" + }, + "license": "WTFPL", + "repository": { + "type": "git", + "url": "git://github.com/domenic/path-is-inside.git" + }, + "bugs": { + "url": "http://github.com/domenic/path-is-inside/issues" + }, + "main": "lib/path-is-inside.js", + "scripts": { + "test": "mocha", + "lint": "jshint lib" + }, + "devDependencies": { + "jshint": "~2.3.0", + "mocha": "~1.15.1" + }, + "readme": "# Is This Path Inside This Other Path?\n\nIt turns out this question isn't trivial to answer using Node's built-in path APIs. A naive `indexOf`-based solution will fail sometimes on Windows, which is case-insensitive (see e.g. [isaacs/npm#4214][]). You might then think to be clever with `path.resolve`, but you have to be careful to account for situations whether the paths have different drive letters, or else you'll cause bugs like [isaacs/npm#4313][]. And let's not even get started on trailing slashes.\n\nThe **path-is-inside** package will give you a robust, cross-platform way of detecting whether a given path is inside another path.\n\n## Usage\n\nPretty simple. First the path being tested; then the potential parent. Like so:\n\n```js\nvar pathIsInside = require(\"path-is-inside\");\n\npathIsInside(\"/x/y/z\", \"/x/y\") // true\npathIsInside(\"/x/y\", \"/x/y/z\") // false\n```\n\n## OS-Specific Behavior\n\nLike Node's built-in path module, path-is-inside treats all file paths on Windows as case-insensitive, whereas it treats all file paths on *-nix operating systems as case-sensitive. Keep this in mind especially when working on a Mac, where, despite Node's defaults, the OS usually treats paths case-insensitively.\n\nIn practice, this means:\n\n```js\n// On Windows\n\npathIsInside(\"C:\\\\X\\\\Y\\\\Z\", \"C:\\\\x\\\\y\") // true\n\n// On *-nix, including Mac OS X\n\npathIsInside(\"/X/Y/Z\", \"/x/y\") // false\n```\n\n[isaacs/npm#4214]: https://github.com/isaacs/npm/pull/4214\n[isaacs/npm#4313]: https://github.com/isaacs/npm/issues/4313\n", + "readmeFilename": "README.md", + "homepage": "https://github.com/domenic/path-is-inside", + "_id": "path-is-inside@1.0.1", + "dist": { + "shasum": "c5e6c4764c4cd41f2ac839c53be5621d085726b3" + }, + "_from": "path-is-inside@1.0.1", + "_resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.1.tgz" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/.npmignore new file mode 100644 index 00000000..8c23deeb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/.npmignore @@ -0,0 +1,13 @@ +*.swp +.*.swp + +.DS_Store +*~ +.project +.settings +npm-debug.log +coverage.html +.idea +lib-cov + +node_modules diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/.travis.yml new file mode 100644 index 00000000..848ffd1c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/.travis.yml @@ -0,0 +1,9 @@ +language: node_js +before_install: + - '[ "${TRAVIS_NODE_VERSION}" != "0.8" ] || npm install -g npm@1.4.28' + - npm install -g npm@latest +node_js: + - '0.8' + - '0.10' + - '0.12' + - 'iojs' diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/LICENSE new file mode 100644 index 00000000..dea3013d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/LICENSE @@ -0,0 +1,16 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/README.md new file mode 100644 index 00000000..312153b4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/README.md @@ -0,0 +1,27 @@ +# read-installed + +Read all the installed packages in a folder, and return a tree +structure with all the data. + +npm uses this. + +## 2.0.0 + +Breaking changes in `2.0.0`: + +The second argument is now an `Object` that contains the following keys: + + * `depth` optional, defaults to Infinity + * `log` optional log Function + * `dev` optional, default false, set to true to include devDependencies + +## Usage + +```javascript +var readInstalled = require("read-installed") +// optional options +var options = { dev: false, log: fn, depth: 2 } +readInstalled(folder, options, function (er, data) { + ... +}) +``` diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/debuglog/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/debuglog/LICENSE new file mode 100644 index 00000000..a3187cc1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/debuglog/LICENSE @@ -0,0 +1,19 @@ +Copyright Joyent, Inc. and other Node contributors. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/debuglog/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/debuglog/README.md new file mode 100644 index 00000000..dc6fccec --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/debuglog/README.md @@ -0,0 +1,40 @@ +# debuglog - backport of util.debuglog() from node v0.11 + +To facilitate using the `util.debuglog()` function that will be available when +node v0.12 is released now, this is a copy extracted from the source. + +## require('debuglog') + +Return `util.debuglog`, if it exists, otherwise it will return an internal copy +of the implementation from node v0.11. + +## debuglog(section) + +* `section` {String} The section of the program to be debugged +* Returns: {Function} The logging function + +This is used to create a function which conditionally writes to stderr +based on the existence of a `NODE_DEBUG` environment variable. If the +`section` name appears in that environment variable, then the returned +function will be similar to `console.error()`. If not, then the +returned function is a no-op. + +For example: + +```javascript +var debuglog = util.debuglog('foo'); + +var bar = 123; +debuglog('hello from foo [%d]', bar); +``` + +If this program is run with `NODE_DEBUG=foo` in the environment, then +it will output something like: + + FOO 3245: hello from foo [123] + +where `3245` is the process id. If it is not run with that +environment variable set, then it will not print anything. + +You may separate multiple `NODE_DEBUG` environment variables with a +comma. For example, `NODE_DEBUG=fs,net,tls`. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/debuglog/debuglog.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/debuglog/debuglog.js new file mode 100644 index 00000000..748fd72a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/debuglog/debuglog.js @@ -0,0 +1,22 @@ +var util = require('util'); + +module.exports = (util && util.debuglog) || debuglog; + +var debugs = {}; +var debugEnviron = process.env.NODE_DEBUG || ''; + +function debuglog(set) { + set = set.toUpperCase(); + if (!debugs[set]) { + if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { + var pid = process.pid; + debugs[set] = function() { + var msg = util.format.apply(exports, arguments); + console.error('%s %d: %s', set, pid, msg); + }; + } else { + debugs[set] = function() {}; + } + } + return debugs[set]; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/debuglog/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/debuglog/package.json new file mode 100644 index 00000000..39fac076 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/debuglog/package.json @@ -0,0 +1,45 @@ +{ + "name": "debuglog", + "version": "1.0.1", + "description": "backport of util.debuglog from node v0.11", + "license": "MIT", + "main": "debuglog.js", + "repository": { + "type": "git", + "url": "https://github.com/sam-github/node-debuglog.git" + }, + "author": { + "name": "Sam Roberts", + "email": "sam@strongloop.com" + }, + "engines": { + "node": "*" + }, + "browser": { + "util": false + }, + "bugs": { + "url": "https://github.com/sam-github/node-debuglog/issues" + }, + "homepage": "https://github.com/sam-github/node-debuglog", + "_id": "debuglog@1.0.1", + "dist": { + "shasum": "aa24ffb9ac3df9a2351837cfb2d279360cd78492", + "tarball": "http://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz" + }, + "_from": "debuglog@>=1.0.1 <2.0.0", + "_npmVersion": "1.4.3", + "_npmUser": { + "name": "octet", + "email": "sam@strongloop.com" + }, + "maintainers": [ + { + "name": "octet", + "email": "sam@strongloop.com" + } + ], + "directories": {}, + "_shasum": "aa24ffb9ac3df9a2351837cfb2d279360cd78492", + "_resolved": "https://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/.travis.yml new file mode 100644 index 00000000..e1bcee1a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/.travis.yml @@ -0,0 +1,7 @@ +language: node_js +before_script: npm install -g npm@latest +node_js: + - '0.8' + - '0.10' + - '0.12' + - 'iojs' diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/README.md new file mode 100644 index 00000000..ade57a18 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/README.md @@ -0,0 +1,17 @@ +# readdir-scoped-modules + +Like `fs.readdir` but handling `@org/module` dirs as if they were +a single entry. + +Used by npm. + +## USAGE + +```javascript +var readdir = require('readdir-scoped-modules') + +readdir('node_modules', function (er, entries) { + // entries will be something like + // ['a', '@org/foo', '@org/bar'] +}) +``` diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/package.json new file mode 100644 index 00000000..d9c7b715 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/package.json @@ -0,0 +1,41 @@ +{ + "name": "readdir-scoped-modules", + "version": "1.0.2", + "description": "Like `fs.readdir` but handling `@org/module` dirs as if they were a single entry.", + "main": "readdir.js", + "directories": { + "test": "test" + }, + "dependencies": { + "debuglog": "^1.0.1", + "dezalgo": "^1.0.0", + "graceful-fs": "^4.1.2", + "once": "^1.3.0" + }, + "devDependencies": { + "tap": "^1.2.0" + }, + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/readdir-scoped-modules.git" + }, + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/readdir-scoped-modules/issues" + }, + "homepage": "https://github.com/npm/readdir-scoped-modules", + "readme": "# readdir-scoped-modules\n\nLike `fs.readdir` but handling `@org/module` dirs as if they were\na single entry.\n\nUsed by npm.\n\n## USAGE\n\n```javascript\nvar readdir = require('readdir-scoped-modules')\n\nreaddir('node_modules', function (er, entries) {\n // entries will be something like\n // ['a', '@org/foo', '@org/bar']\n})\n```\n", + "readmeFilename": "README.md", + "gitHead": "d41d5de877cb4e9e3f14b92913132680af73d1b4", + "_id": "readdir-scoped-modules@1.0.2", + "_shasum": "9fafa37d286be5d92cbaebdee030dc9b5f406747", + "_from": "readdir-scoped-modules@>=1.0.0 <2.0.0" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/readdir.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/readdir.js new file mode 100644 index 00000000..efbe5526 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/readdir.js @@ -0,0 +1,71 @@ +var fs = require ('graceful-fs') +var dz = require ('dezalgo') +var once = require ('once') +var path = require ('path') +var debug = require ('debuglog') ('rds') + +module . exports = readdir + +function readdir (dir, cb) { + fs . readdir (dir, function (er, kids) { + if (er) + return cb (er) + + debug ('dir=%j, kids=%j', dir, kids) + readScopes (dir, kids, function (er, data) { + if (er) + return cb (er) + + // Sort for bonus consistency points + data = data . sort (function (a, b) { + return a > b ? 1 : -1 + }) + + return cb (null, data) + }) + }) +} + +// Turn [ 'a', '@scope' ] into +// ['a', '@scope/foo', '@scope/bar'] +function readScopes (root, kids, cb) { + var scopes = kids . filter (function (kid) { + return kid . charAt (0) === '@' + }) + + kids = kids . filter (function (kid) { + return kid . charAt (0) !== '@' + }) + + debug ('scopes=%j', scopes) + + if (scopes . length === 0) + dz (cb) (null, kids) // prevent maybe-sync zalgo release + + cb = once (cb) + var l = scopes . length + scopes . forEach (function (scope) { + var scopedir = path . resolve (root, scope) + debug ('root=%j scope=%j scopedir=%j', root, scope, scopedir) + fs . readdir (scopedir, then . bind (null, scope)) + }) + + function then (scope, er, scopekids) { + if (er) + return cb (er) + + // XXX: Not sure how old this node bug is. Maybe superstition? + scopekids = scopekids . filter (function (scopekid) { + return !(scopekid === '.' || scopekid === '..' || !scopekid) + }) + + kids . push . apply (kids, scopekids . map (function (scopekid) { + return scope + '/' + scopekid + })) + + debug ('scope=%j scopekids=%j kids=%j', scope, scopekids, kids) + + if (--l === 0) + cb (null, kids) + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/basic.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/basic.js new file mode 100644 index 00000000..715c40d5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/basic.js @@ -0,0 +1,14 @@ +var test = require ('tap') . test +var readdir = require ('../readdir.js') + +test ('basic', function (t) { + // should not get {a,b}/{x,y}, but SHOULD get @org/ and @scope children + var expect = [ '@org/x', '@org/y', '@scope/x', '@scope/y', 'a', 'b' ] + + readdir (__dirname + '/fixtures', function (er, kids) { + if (er) + throw er + t.same(kids, expect) + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/@org/x/.keep b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/@org/x/.keep new file mode 100644 index 00000000..e69de29b diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/@org/y/.keep b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/@org/y/.keep new file mode 100644 index 00000000..e69de29b diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/@scope/x/.keep b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/@scope/x/.keep new file mode 100644 index 00000000..e69de29b diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/@scope/y/.keep b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/@scope/y/.keep new file mode 100644 index 00000000..e69de29b diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/a/x/.keep b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/a/x/.keep new file mode 100644 index 00000000..e69de29b diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/a/y/.keep b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/a/y/.keep new file mode 100644 index 00000000..e69de29b diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/b/x/.keep b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/b/x/.keep new file mode 100644 index 00000000..e69de29b diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/b/y/.keep b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/b/y/.keep new file mode 100644 index 00000000..e69de29b diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/util-extend/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/util-extend/README.md new file mode 100644 index 00000000..be03922a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/util-extend/README.md @@ -0,0 +1,13 @@ +# util-extend + +The Node object extending function that Node uses for Node! + +## Usage + +```js +var extend = require('util-extend'); +function functionThatTakesOptions(options) { + var options = extend(defaults, options); + // now any unset options are set to the defaults. +} +``` diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/util-extend/extend.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/util-extend/extend.js new file mode 100644 index 00000000..de9fcf47 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/util-extend/extend.js @@ -0,0 +1,33 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +module.exports = extend; +function extend(origin, add) { + // Don't do anything if add isn't an object + if (!add || typeof add !== 'object') return origin; + + var keys = Object.keys(add); + var i = keys.length; + while (i--) { + origin[keys[i]] = add[keys[i]]; + } + return origin; +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/util-extend/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/util-extend/package.json new file mode 100644 index 00000000..259d6c10 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/util-extend/package.json @@ -0,0 +1,41 @@ +{ + "name": "util-extend", + "version": "1.0.1", + "description": "Node's internal object extension function", + "main": "extend.js", + "scripts": { + "test": "node test.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/isaacs/util-extend.git" + }, + "author": "", + "license": "MIT", + "readmeFilename": "README.md", + "readme": "# util-extend\n\nThe Node object extending function that Node uses for Node!\n\n## Usage\n\n```js\nvar extend = require('util-extend');\nfunction functionThatTakesOptions(options) {\n var options = extend(defaults, options);\n // now any unset options are set to the defaults.\n}\n```\n", + "bugs": { + "url": "https://github.com/isaacs/util-extend/issues" + }, + "_id": "util-extend@1.0.1", + "dist": { + "shasum": "bb703b79480293ddcdcfb3c6a9fea20f483415bc", + "tarball": "http://registry.npmjs.org/util-extend/-/util-extend-1.0.1.tgz" + }, + "_from": "util-extend@>=1.0.1 <2.0.0", + "_npmVersion": "1.3.4", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "directories": {}, + "_shasum": "bb703b79480293ddcdcfb3c6a9fea20f483415bc", + "_resolved": "https://registry.npmjs.org/util-extend/-/util-extend-1.0.1.tgz", + "homepage": "https://github.com/isaacs/util-extend#readme" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/util-extend/test.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/util-extend/test.js new file mode 100644 index 00000000..fbee2b1e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/node_modules/util-extend/test.js @@ -0,0 +1,10 @@ +var assert = require('assert'); +var extend = require('./'); +assert.deepEqual(extend({a:1}), {a:1}); +assert.deepEqual(extend({a:1}, []), {a:1}); +assert.deepEqual(extend({a:1}, null), {a:1}); +assert.deepEqual(extend({a:1}, true), {a:1}); +assert.deepEqual(extend({a:1}, false), {a:1}); +assert.deepEqual(extend({a:1}, {b:2}), {a:1, b:2}); +assert.deepEqual(extend({a:1, b:2}, {b:3}), {a:1, b:3}); +console.log('ok'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/package.json new file mode 100644 index 00000000..b1b3c5fa --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/package.json @@ -0,0 +1,46 @@ +{ + "name": "read-installed", + "description": "Read all the installed packages in a folder, and return a tree structure with all the data.", + "version": "4.0.3", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/read-installed.git" + }, + "main": "read-installed.js", + "scripts": { + "test": "tap ./test/*.js" + }, + "dependencies": { + "debuglog": "^1.0.1", + "read-package-json": "^2.0.0", + "readdir-scoped-modules": "^1.0.0", + "semver": "2 || 3 || 4 || 5", + "slide": "~1.1.3", + "util-extend": "^1.0.1", + "graceful-fs": "^4.1.2" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.2" + }, + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "ISC", + "devDependencies": { + "mkdirp": "^0.5.0", + "rimraf": "^2.2.8", + "tap": "^1.2.0" + }, + "readme": "# read-installed\n\nRead all the installed packages in a folder, and return a tree\nstructure with all the data.\n\nnpm uses this.\n\n## 2.0.0\n\nBreaking changes in `2.0.0`:\n\nThe second argument is now an `Object` that contains the following keys:\n\n * `depth` optional, defaults to Infinity\n * `log` optional log Function\n * `dev` optional, default false, set to true to include devDependencies\n\n## Usage\n\n```javascript\nvar readInstalled = require(\"read-installed\")\n// optional options\nvar options = { dev: false, log: fn, depth: 2 }\nreadInstalled(folder, options, function (er, data) {\n ...\n})\n```\n", + "readmeFilename": "README.md", + "gitHead": "da02df6acdb5f5ee31d8c637ef31fb50efb455c1", + "bugs": { + "url": "https://github.com/isaacs/read-installed/issues" + }, + "homepage": "https://github.com/isaacs/read-installed#readme", + "_id": "read-installed@4.0.3", + "_shasum": "ff9b8b67f187d1e4c29b9feb31f6b223acd19067", + "_from": "read-installed@4.0.3" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/read-installed.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/read-installed.js new file mode 100644 index 00000000..19e77be9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/read-installed.js @@ -0,0 +1,407 @@ + +// Walk through the file-system "database" of installed +// packages, and create a data object related to the +// installed versions of each package. + +/* +This will traverse through all node_modules folders, +resolving the dependencies object to the object corresponding to +the package that meets that dep, or just the version/range if +unmet. + +Assuming that you had this folder structure: + +/path/to ++-- package.json { name = "root" } +`-- node_modules + +-- foo {bar, baz, asdf} + | +-- node_modules + | +-- bar { baz } + | `-- baz + `-- asdf + +where "foo" depends on bar, baz, and asdf, bar depends on baz, +and bar and baz are bundled with foo, whereas "asdf" is at +the higher level (sibling to foo), you'd get this object structure: + +{ +, path: "/path/to" +, parent: null +, dependencies: + { foo : + { version: "1.2.3" + , path: "/path/to/node_modules/foo" + , parent: + , dependencies: + { bar: + { parent: + , path: "/path/to/node_modules/foo/node_modules/bar" + , version: "2.3.4" + , dependencies: { baz: } + } + , baz: { ... } + , asdf: + } + } + , asdf: { ... } + } +} + +Unmet deps are left as strings. +Extraneous deps are marked with extraneous:true +deps that don't meet a requirement are marked with invalid:true +deps that don't meet a peer requirement are marked with peerInvalid:true + +to READ(packagefolder, parentobj, name, reqver) +obj = read package.json +installed = ./node_modules/* +if parentobj is null, and no package.json + obj = {dependencies:{:ANY}} +deps = Object.keys(obj.dependencies) +obj.path = packagefolder +obj.parent = parentobj +if name, && obj.name !== name, obj.invalid = true +if reqver, && obj.version !satisfies reqver, obj.invalid = true +if !reqver && parentobj, obj.extraneous = true +for each folder in installed + obj.dependencies[folder] = READ(packagefolder+node_modules+folder, + obj, folder, obj.dependencies[folder]) +# walk tree to find unmet deps +for each dep in obj.dependencies not in installed + r = obj.parent + while r + if r.dependencies[dep] + if r.dependencies[dep].verion !satisfies obj.dependencies[dep] + WARN + r.dependencies[dep].invalid = true + obj.dependencies[dep] = r.dependencies[dep] + r = null + else r = r.parent +return obj + + +TODO: +1. Find unmet deps in parent directories, searching as node does up +as far as the left-most node_modules folder. +2. Ignore anything in node_modules that isn't a package folder. + +*/ + +try { + var fs = require("graceful-fs") +} catch (er) { + var fs = require("fs") +} + +var path = require("path") +var asyncMap = require("slide").asyncMap +var semver = require("semver") +var readJson = require("read-package-json") +var url = require("url") +var util = require("util") +var extend = require("util-extend") + +var debug = require("debuglog")("read-installed") + +var readdir = require("readdir-scoped-modules") + +// Sentinel catch-all version constraint used when a dependency is not +// listed in the package.json file. +var ANY = {} + +module.exports = readInstalled + +function readInstalled (folder, opts, cb) { + if (typeof opts === 'function') { + cb = opts + opts = {} + } else { + opts = extend({}, opts) + } + + if (typeof opts.depth !== 'number') + opts.depth = Infinity + + opts.depth = Math.max(0, opts.depth) + + if (typeof opts.log !== 'function') + opts.log = function () {} + + opts.dev = !!opts.dev + opts.realpathSeen = {} + opts.findUnmetSeen = [] + + + readInstalled_(folder, null, null, null, 0, opts, function (er, obj) { + if (er) return cb(er) + // now obj has all the installed things, where they're installed + // figure out the inheritance links, now that the object is built. + resolveInheritance(obj, opts) + obj.root = true + unmarkExtraneous(obj, opts) + cb(null, obj) + }) +} + +function readInstalled_ (folder, parent, name, reqver, depth, opts, cb) { + var installed + , obj + , real + , link + , realpathSeen = opts.realpathSeen + + readdir(path.resolve(folder, "node_modules"), function (er, i) { + // error indicates that nothing is installed here + if (er) i = [] + installed = i.filter(function (f) { return f.charAt(0) !== "." }) + next() + }) + + readJson(path.resolve(folder, "package.json"), function (er, data) { + obj = copy(data) + + if (!parent) { + obj = obj || true + er = null + } + return next(er) + }) + + fs.lstat(folder, function (er, st) { + if (er) { + if (!parent) real = true + return next(er) + } + fs.realpath(folder, function (er, rp) { + debug("realpath(%j) = %j", folder, rp) + real = rp + if (st.isSymbolicLink()) link = rp + next(er) + }) + }) + + var errState = null + , called = false + function next (er) { + if (errState) return + if (er) { + errState = er + return cb(null, []) + } + debug('next', installed, obj && typeof obj, name, real) + if (!installed || !obj || !real || called) return + called = true + if (realpathSeen[real]) return cb(null, realpathSeen[real]) + if (obj === true) { + obj = {dependencies:{}, path:folder} + installed.forEach(function (i) { obj.dependencies[i] = ANY }) + } + if (name && obj.name !== name) obj.invalid = true + obj.realName = name || obj.name + obj.dependencies = obj.dependencies || {} + + // At this point, figure out what dependencies we NEED to get met + obj._dependencies = copy(obj.dependencies) + + if (reqver === ANY) { + // We were unable to determine the required version of this + // dependency from the package.json file, but we now know its actual + // version, so treat that version as the required version to avoid + // marking the dependency as invalid below. See #40. + reqver = obj.version; + } + + // "foo":"http://blah" and "foo":"latest" are always presumed valid + if (reqver + && semver.validRange(reqver, true) + && !semver.satisfies(obj.version, reqver, true)) { + obj.invalid = true + } + + // Mark as extraneous at this point. + // This will be un-marked in unmarkExtraneous, where we mark as + // not-extraneous everything that is required in some way from + // the root object. + obj.extraneous = true + + obj.path = obj.path || folder + obj.realPath = real + obj.link = link + if (parent && !obj.link) obj.parent = parent + realpathSeen[real] = obj + obj.depth = depth + //if (depth >= opts.depth) return cb(null, obj) + asyncMap(installed, function (pkg, cb) { + var rv = obj.dependencies[pkg] + if (!rv && obj.devDependencies && opts.dev) + rv = obj.devDependencies[pkg] + + if (depth > opts.depth) { + obj.dependencies = {} + return cb(null, obj) + } + + readInstalled_( path.resolve(folder, "node_modules/"+pkg) + , obj, pkg, obj.dependencies[pkg], depth + 1, opts + , cb ) + + }, function (er, installedData) { + if (er) return cb(er) + installedData.forEach(function (dep) { + obj.dependencies[dep.realName] = dep + }) + + // any strings here are unmet things. however, if it's + // optional, then that's fine, so just delete it. + if (obj.optionalDependencies) { + Object.keys(obj.optionalDependencies).forEach(function (dep) { + if (typeof obj.dependencies[dep] === "string") { + delete obj.dependencies[dep] + } + }) + } + return cb(null, obj) + }) + } +} + +// starting from a root object, call findUnmet on each layer of children +var riSeen = [] +function resolveInheritance (obj, opts) { + if (typeof obj !== "object") return + if (riSeen.indexOf(obj) !== -1) return + riSeen.push(obj) + if (typeof obj.dependencies !== "object") { + obj.dependencies = {} + } + Object.keys(obj.dependencies).forEach(function (dep) { + findUnmet(obj.dependencies[dep], opts) + }) + Object.keys(obj.dependencies).forEach(function (dep) { + if (typeof obj.dependencies[dep] === "object") { + resolveInheritance(obj.dependencies[dep], opts) + } else { + debug("unmet dep! %s %s@%s", obj.name, dep, obj.dependencies[dep]) + } + }) + findUnmet(obj, opts) +} + +// find unmet deps by walking up the tree object. +// No I/O +function findUnmet (obj, opts) { + var findUnmetSeen = opts.findUnmetSeen + if (findUnmetSeen.indexOf(obj) !== -1) return + findUnmetSeen.push(obj) + debug("find unmet parent=%s obj=", obj.parent && obj.parent.name, obj.name || obj) + var deps = obj.dependencies = obj.dependencies || {} + + debug(deps) + Object.keys(deps) + .filter(function (d) { return typeof deps[d] === "string" }) + .forEach(function (d) { + var found = findDep(obj, d) + debug("finding dep %j", d, found && found.name || found) + // "foo":"http://blah" and "foo":"latest" are always presumed valid + if (typeof deps[d] === "string" && + semver.validRange(deps[d], true) && + found && + !semver.satisfies(found.version, deps[d], true)) { + // the bad thing will happen + opts.log( "unmet dependency" + , obj.path + " requires "+d+"@'"+deps[d] + + "' but will load\n" + + found.path+",\nwhich is version "+found.version ) + found.invalid = true + } + if (found) { + deps[d] = found + } + }) + + var peerDeps = obj.peerDependencies = obj.peerDependencies || {} + Object.keys(peerDeps).forEach(function (d) { + var dependency + + if (!obj.parent) { + dependency = obj.dependencies[d] + + // read it as a missing dep + if (!dependency) { + obj.dependencies[d] = peerDeps[d] + } + } else { + var r = obj.parent + while (r && !dependency) { + dependency = r.dependencies && r.dependencies[d] + r = r.link ? null : r.parent + } + } + + if (!dependency) { + // mark as a missing dep! + obj.dependencies[d] = peerDeps[d] + } else if (!semver.satisfies(dependency.version, peerDeps[d], true)) { + dependency.peerInvalid = true + } + }) + + return obj +} + +function unmarkExtraneous (obj, opts) { + // Mark all non-required deps as extraneous. + // start from the root object and mark as non-extraneous all modules + // that haven't been previously flagged as extraneous then propagate + // to all their dependencies + + obj.extraneous = false + + var deps = obj._dependencies || [] + if (opts.dev && obj.devDependencies && (obj.root || obj.link)) { + Object.keys(obj.devDependencies).forEach(function (k) { + deps[k] = obj.devDependencies[k] + }) + } + + if (obj.peerDependencies) { + Object.keys(obj.peerDependencies).forEach(function (k) { + deps[k] = obj.peerDependencies[k] + }) + } + + debug("not extraneous", obj._id, deps) + Object.keys(deps).forEach(function (d) { + var dep = findDep(obj, d) + if (dep && dep.extraneous) { + unmarkExtraneous(dep, opts) + } + }) +} + +// Find the one that will actually be loaded by require() +// so we can make sure it's valid etc. +function findDep (obj, d) { + var r = obj + , found = null + while (r && !found) { + // if r is a valid choice, then use that. + // kinda weird if a pkg depends on itself, but after the first + // iteration of this loop, it indicates a dep cycle. + if (typeof r.dependencies[d] === "object") { + found = r.dependencies[d] + } + if (!found && r.realName === d) found = r + r = r.link ? null : r.parent + } + return found +} + +function copy (obj) { + if (!obj || typeof obj !== 'object') return obj + if (Array.isArray(obj)) return obj.map(copy) + + var o = {} + for (var i in obj) o[i] = copy(obj[i]) + return o +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/basic.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/basic.js new file mode 100644 index 00000000..f4978488 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/basic.js @@ -0,0 +1,46 @@ +var readInstalled = require("../read-installed.js") +var json = require("../package.json") +var d = Object.keys(json.dependencies) +var dd = Object.keys(json.devDependencies) +var od = Object.keys(json.optionalDependencies) +var known = d.concat(dd).concat(od).sort() +var test = require("tap").test +var path = require("path") + +test("make sure that it works", function (t) { + readInstalled(path.join(__dirname, "../"), { + dev: true, + log: console.error + }, function (er, map) { + t.notOk(er, "er should be bull") + t.ok(map, "map should be data") + if (er) return console.error(er.stack || er.message) + cleanup(map) + var deps = Object.keys(map.dependencies).sort() + t.equal(known.length, deps.length, "array lengths are equal") + t.deepEqual(known, deps, "arrays should be equal") + t.notOk(map.dependencies.tap.extraneous, 'extraneous not set on devDep') + t.end() + }) +}) + +var seen = [] +function cleanup (map) { + if (seen.indexOf(map) !== -1) return + seen.push(map) + for (var i in map) switch (i) { + case "_id": + case "path": + case "extraneous": case "invalid": + case "dependencies": case "name": + continue + default: delete map[i] + } + var dep = map.dependencies + if (dep) { + for (var i in dep) if (typeof dep[i] === "object") { + cleanup(dep[i]) + } + } + return map +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/cyclic-extraneous-peer-deps.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/cyclic-extraneous-peer-deps.js new file mode 100644 index 00000000..58bf6a64 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/cyclic-extraneous-peer-deps.js @@ -0,0 +1,81 @@ +var test = require("tap").test +var mkdirp = require("mkdirp") +var rimraf = require("rimraf") +var fs = require("fs") +var path = require("path") +var readInstalled = require("../read-installed.js") + +var parent = { + name: "parent", + version: "1.2.3", + dependencies: {}, + devDependencies: { + "child1":"*" + }, + readme:"." +} + +var child1 = { + name: "child1", + version: "1.2.3", + peerDependencies: { + child2: "*" + }, + readme:"." +} + +var child2 = { + name: "child2", + version: "1.2.3", + peerDependencies: { + child1: "*" + }, + readme:"." +} + + +var root = path.resolve(__dirname, "cyclic-extraneous-peer-deps") +var parentjson = path.resolve(root, "package.json") +var child1root = path.resolve(root, "node_modules/child1") +var child1json = path.resolve(child1root, "package.json") +var child2root = path.resolve(root, "node_modules/child2") +var child2json = path.resolve(child2root, "package.json") + +test("setup", function (t) { + rimraf.sync(root) + mkdirp.sync(child1root) + mkdirp.sync(child2root) + fs.writeFileSync(parentjson, JSON.stringify(parent, null, 2) + "\n", "utf8") + fs.writeFileSync(child1json, JSON.stringify(child1, null, 2) + "\n", "utf8") + fs.writeFileSync(child2json, JSON.stringify(child2, null, 2) + "\n", "utf8") + t.pass("setup done") + t.end() +}) + +test("dev mode", function (t) { + // peer dev deps should both be not extraneous. + readInstalled(root, { dev: true }, function (er, data) { + if (er) + throw er + t.notOk(data.dependencies.child1.extraneous, "c1 not extra") + t.notOk(data.dependencies.child2.extraneous, "c2 not extra") + t.end() + }) +}) + +test("prod mode", function (t) { + readInstalled(root, { dev: false }, function (er, data) { + if (er) + throw er + t.ok(data.dependencies.child1.extraneous, "c1 extra") + t.ok(data.dependencies.child2.extraneous, "c2 extra") + t.end() + }) +}) + + +test("cleanup", function (t) { + rimraf.sync(root) + t.pass("cleanup done") + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/depth-0.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/depth-0.js new file mode 100644 index 00000000..459df8a7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/depth-0.js @@ -0,0 +1,27 @@ +var readInstalled = require("../read-installed.js") +var test = require("tap").test +var json = require("../package.json") +var path = require("path") +var known = [].concat(Object.keys(json.dependencies) + , Object.keys(json.optionalDependencies) + , Object.keys(json.devDependencies)).sort() + +test("make sure that it works with depth=0", function (t) { + readInstalled(path.join(__dirname, "../"), { + depth: 0 + }, function (er, map) { + t.notOk(er, "er should be bull") + t.ok(map, "map should be data") + if (er) return console.error(er.stack || er.message) + // Exclude self from dependencies when depth = 0 + delete map.dependencies[json.name] + var subdeps = Object.keys(map.dependencies).reduce(function(acc, dep) { + // Exclude self from dependencies when depth = current depth + delete map.dependencies[dep].dependencies[dep] + acc += Object.keys(map.dependencies[dep].dependencies).length; + return acc; + }, 0); + t.equal(subdeps, 0, "there should be no sub dependencies") + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/depth-1.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/depth-1.js new file mode 100644 index 00000000..977c9276 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/depth-1.js @@ -0,0 +1,23 @@ +var readInstalled = require("../read-installed.js") +var test = require("tap").test +var json = require("../package.json") +var path = require("path") +var known = [].concat(Object.keys(json.dependencies) + , Object.keys(json.optionalDependencies) + , Object.keys(json.devDependencies)).sort() + +test("make sure that it works with depth=1", function (t) { + readInstalled(path.join(__dirname, "../"), { + depth: 1 + }, function (er, map) { + t.notOk(er, "er should be bull") + t.ok(map, "map should be data") + if (er) return console.error(er.stack || er.message) + var subdeps = Object.keys(map.dependencies).reduce(function(acc, dep) { + acc += Object.keys(map.dependencies[dep].dependencies).length; + return acc; + }, 0); + t.notEqual(subdeps, 0, "there should some sub dependencies") + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/dev.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/dev.js new file mode 100644 index 00000000..5e5a994a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/dev.js @@ -0,0 +1,23 @@ +var readInstalled = require("../read-installed.js") +var test = require("tap").test +var json = require("../package.json") +var path = require("path") +var known = [].concat(Object.keys(json.dependencies) + , Object.keys(json.optionalDependencies) + , Object.keys(json.devDependencies)).sort() + +test("make sure that it works without dev deps", function (t) { + readInstalled(path.join(__dirname, "../"), { + log: console.error, + dev: false + }, function (er, map) { + t.notOk(er, "er should be bull") + t.ok(map, "map should be data") + if (er) return console.error(er.stack || er.message) + var deps = Object.keys(map.dependencies).sort() + t.equal(deps.length, known.length, "array lengths are equal") + t.deepEqual(deps, known, "arrays should be equal") + t.ok(map.dependencies.tap.extraneous, "extraneous is set on devDep") + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/empty.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/empty.js new file mode 100644 index 00000000..09ace074 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/empty.js @@ -0,0 +1,16 @@ +var readInstalled = require("../read-installed.js"); +var test = require("tap").test; +var path = require("path"); + +test("Handle bad path", function (t) { + readInstalled(path.join(__dirname, "../unknown"), { + dev: true, + log: console.error + }, function (er, map) { + t.notOk(er, "er should be null"); + t.ok(map, "map should be data"); + t.equal(Object.keys(map.dependencies).length, 0, "Dependencies should have no keys"); + if (er) return console.error(er.stack || er.message); + t.end(); + }); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/extraneous-dev.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/extraneous-dev.js new file mode 100644 index 00000000..2f9012d5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/extraneous-dev.js @@ -0,0 +1,20 @@ +var readInstalled = require("../read-installed.js") +var test = require("tap").test +var path = require("path") + +test("extraneous detected", function(t) { + // This test verifies read-installed#16 + readInstalled( + path.join(__dirname, "fixtures/extraneous-dev-dep"), + { + log: console.error, + dev: true + }, + function (err, map) { + t.ifError(err, "read-installed made it") + + t.notOk(map.dependencies.d.extraneous, "d is not extraneous, it's required by root") + t.ok(map.dependencies.x.extraneous, "x is extraneous, it's only a dev dep of d") + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/extraneous.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/extraneous.js new file mode 100644 index 00000000..e999c9b4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/extraneous.js @@ -0,0 +1,17 @@ +var readInstalled = require('../read-installed.js') +var test = require('tap').test +var path = require('path') + +test('extraneous detected', function(t) { + // This test verifies read-installed#16 + readInstalled( + path.join(__dirname, 'fixtures/extraneous-detected'), + { log: console.error }, + function(err, map) { + t.ok(map.dependencies.foo.extraneous, 'foo is extraneous, it\'s not required by any module') + t.ok(map.dependencies.bar.extraneous, 'bar is extraneous, it\'s not required by any module') + t.notOk(map.dependencies.asdf.extraneous, 'asdf is not extraneous, it\'s required by ghjk') + t.notOk(map.dependencies.ghjk.extraneous, 'ghjk is not extraneous, it\'s required by our root module') + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/fixtures/extraneous-detected/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/fixtures/extraneous-detected/package.json new file mode 100644 index 00000000..f6153155 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/fixtures/extraneous-detected/package.json @@ -0,0 +1,7 @@ +{ + "name": "extraneous-detected", + "version": "0.0.0", + "dependencies": { + "ghjk": "0.0.0" + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/fixtures/extraneous-dev-dep/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/fixtures/extraneous-dev-dep/package.json new file mode 100644 index 00000000..9bfa7ce8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/fixtures/extraneous-dev-dep/package.json @@ -0,0 +1,7 @@ +{ + "name": "extraneous-dev-dep", + "version": "0.0.0", + "dependencies": { + "d": "1.0.0" + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/fixtures/grandparent-peer-dev/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/fixtures/grandparent-peer-dev/package.json new file mode 100644 index 00000000..1a229c1c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/fixtures/grandparent-peer-dev/package.json @@ -0,0 +1,8 @@ +{ + "name": "example", + "version": "0.0.0", + "devDependencies": { + "plugin-wrapper": "0.0.0", + "framework": "0.0.0" + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/fixtures/grandparent-peer/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/fixtures/grandparent-peer/package.json new file mode 100644 index 00000000..51c12935 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/fixtures/grandparent-peer/package.json @@ -0,0 +1,8 @@ +{ + "name": "example", + "version": "0.0.0", + "dependencies": { + "plugin-wrapper": "0.0.0", + "framework": "0.0.0" + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/fixtures/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/fixtures/package.json new file mode 100644 index 00000000..8f4f1191 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/fixtures/package.json @@ -0,0 +1,27 @@ +{ + "name": "read-installed", + "description": "Read all the installed packages in a folder, and return a tree structure with all the data.", + "version": "1.0.0", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/read-installed" + }, + "main": "read-installed.js", + "scripts": { + "test": "tap ./test/" + }, + "dependencies": { + "semver": "2", + "slide": "~1.1.3", + "read-package-json": "1", + "util-extend":"1" + }, + "optionalDependencies": { + "graceful-fs": "~2" + }, + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC", + "devDependencies": { + "tap": "~0.4.8" + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/grandparent-peer-dev.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/grandparent-peer-dev.js new file mode 100644 index 00000000..fd7c2d2b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/grandparent-peer-dev.js @@ -0,0 +1,20 @@ +var readInstalled = require('../read-installed.js') +var test = require('tap').test +var path = require('path'); + +function allValid(t, map) { + var deps = Object.keys(map.dependencies || {}) + deps.forEach(function (dep) { + t.ok(map.dependencies[dep].extraneous, 'dependency ' + dep + ' of ' + map.name + ' is extraneous') + }) +} + +test('grandparent dev peer dependencies should be extraneous', function(t) { + readInstalled( + path.join(__dirname, 'fixtures/grandparent-peer-dev'), + { log: console.error }, + function(err, map) { + allValid(t, map) + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/grandparent-peer.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/grandparent-peer.js new file mode 100644 index 00000000..8b51a098 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/grandparent-peer.js @@ -0,0 +1,24 @@ +var readInstalled = require('../read-installed.js') +var test = require('tap').test +var path = require('path'); + +function allValid(t, map) { + var deps = Object.keys(map.dependencies || {}) + deps.forEach(function (dep) { + t.notOk(map.dependencies[dep].invalid, 'dependency ' + dep + ' of ' + map.name + ' is not invalid') + t.notOk(typeof map.dependencies[dep] === 'string', 'dependency ' + dep + ' of ' + map.name + ' is not missing') + }) + deps.forEach(function (dep) { + allValid(t, map.dependencies[dep]) + }) +} + +test('grandparent can satisfy peer dependencies', function(t) { + readInstalled( + path.join(__dirname, 'fixtures/grandparent-peer'), + { log: console.error }, + function(err, map) { + allValid(t, map) + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/issue-40.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/issue-40.js new file mode 100644 index 00000000..3105fe24 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/issue-40.js @@ -0,0 +1,15 @@ +var readInstalled = require('../read-installed.js'); +var test = require('tap').test; +var path = require('path'); + +test('prerelease packages should not be marked invalid', function(t) { + readInstalled( + path.join(__dirname, 'fixtures/issue-40'), + { log: console.error }, + function(err, map) { + t.strictEqual(map.dependencies.fake.version, '0.1.0-2'); + t.notOk(map.dependencies.fake.invalid); + t.end(); + } + ); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/linked-dep-dev-deps-extraneous.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/linked-dep-dev-deps-extraneous.js new file mode 100644 index 00000000..65605133 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/linked-dep-dev-deps-extraneous.js @@ -0,0 +1,59 @@ +var test = require('tap').test +var path = require('path') +var fs = require('fs') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var readInstalled = require('../') + +var root = path.resolve(__dirname, 'root') +var pkg = path.resolve(root, 'pkg') +var pkgnm = path.resolve(pkg, 'node_modules') +var linkdepSrc = path.resolve(root, 'linkdep') +var linkdepLink = path.resolve(pkgnm, 'linkdep') +var devdep = path.resolve(linkdepSrc, 'node_modules', 'devdep') + +function pjson (dir, data) { + mkdirp.sync(dir) + var d = path.resolve(dir, 'package.json') + fs.writeFileSync(d, JSON.stringify(data)) +} + +test('setup', function (t) { + rimraf.sync(root) + pjson(pkg, { + name: 'root', + version: '1.2.3', + dependencies: { + linkdep: '' + } + }) + pjson(linkdepSrc, { + name: 'linkdep', + version: '1.2.3', + devDependencies: { + devdep: '' + } + }) + pjson(devdep, { + name: 'devdep', + version: '1.2.3' + }) + + mkdirp.sync(pkgnm) + fs.symlinkSync(linkdepSrc, linkdepLink, 'dir') + + t.end() +}) + +test('basic', function (t) { + readInstalled(pkg, { dev: true }, function (er, data) { + var dd = data.dependencies.linkdep.dependencies.devdep + t.notOk(dd.extraneous, 'linked dev dep should not be extraneous') + t.end() + }) +}) + +test('cleanup', function (t) { + rimraf.sync(root) + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/noargs.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/noargs.js new file mode 100644 index 00000000..66fabeb7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/noargs.js @@ -0,0 +1,21 @@ +var readInstalled = require("../read-installed.js") +var test = require("tap").test +var json = require("../package.json") +var path = require("path") +var known = [].concat(Object.keys(json.dependencies) + , Object.keys(json.optionalDependencies) + , Object.keys(json.devDependencies)).sort() + +test("make sure that it works without dev deps", function (t) { + readInstalled(path.join(__dirname, "../"), function (er, map) { + t.notOk(er, "er should be bull") + t.ok(map, "map should be data") + if (er) return console.error(er.stack || er.message) + var deps = Object.keys(map.dependencies).sort() + t.equal(deps.length, known.length, "array lengths are equal") + t.deepEqual(deps, known, "arrays should be equal") + t.ok(map.dependencies.tap.extraneous, 'extraneous is set on devDep') + t.end() + }) +}) + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/peer-dep-at-latest.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/peer-dep-at-latest.js new file mode 100644 index 00000000..8f2436fa --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-installed/test/peer-dep-at-latest.js @@ -0,0 +1,14 @@ +var readInstalled = require('../read-installed.js') +var test = require('tap').test +var path = require('path'); + +test('"latest" version is valid', function(t) { + // This test verifies npm#3860 + readInstalled( + path.join(__dirname, 'fixtures/peer-at-latest'), + { log: console.error }, + function(err, map) { + t.notOk(map.dependencies.debug.invalid, 'debug@latest is satisfied by a peer') + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/.npmignore new file mode 100644 index 00000000..8c23deeb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/.npmignore @@ -0,0 +1,13 @@ +*.swp +.*.swp + +.DS_Store +*~ +.project +.settings +npm-debug.log +coverage.html +.idea +lib-cov + +node_modules diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/.travis.yml new file mode 100644 index 00000000..f84676a9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/.travis.yml @@ -0,0 +1,9 @@ +language: node_js +node_js: + - '0.8' + - '0.10' + - '0.12' + - 'iojs' +sudo: false +before_install: + - npm install -g npm@latest diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/LICENSE new file mode 100644 index 00000000..052085c4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/README.md new file mode 100644 index 00000000..05ba112c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/README.md @@ -0,0 +1,157 @@ +# read-package-json + +This is the thing that npm uses to read package.json files. It +validates some stuff, and loads some default things. + +It keeps a cache of the files you've read, so that you don't end +up reading the same package.json file multiple times. + +Note that if you just want to see what's literally in the package.json +file, you can usually do `var data = require('some-module/package.json')`. + +This module is basically only needed by npm, but it's handy to see what +npm will see when it looks at your package. + +## Usage + +```javascript +var readJson = require('read-package-json') + +// readJson(filename, [logFunction=noop], [strict=false], cb) +readJson('/path/to/package.json', console.error, false, function (er, data) { + if (er) { + console.error("There was an error reading the file") + return + } + + console.error('the package data is', data) +}); +``` + +## readJson(file, [logFn = noop], [strict = false], cb) + +* `file` {String} The path to the package.json file +* `logFn` {Function} Function to handle logging. Defaults to a noop. +* `strict` {Boolean} True to enforce SemVer 2.0 version strings, and + other strict requirements. +* `cb` {Function} Gets called with `(er, data)`, as is The Node Way. + +Reads the JSON file and does the things. + +## `package.json` Fields + +See `man 5 package.json` or `npm help json`. + +## readJson.log + +By default this is a reference to the `npmlog` module. But if that +module can't be found, then it'll be set to just a dummy thing that does +nothing. + +Replace with your own `{log,warn,error}` object for fun loggy time. + +## readJson.extras(file, data, cb) + +Run all the extra stuff relative to the file, with the parsed data. + +Modifies the data as it does stuff. Calls the cb when it's done. + +## readJson.extraSet = [fn, fn, ...] + +Array of functions that are called by `extras`. Each one receives the +arguments `fn(file, data, cb)` and is expected to call `cb(er, data)` +when done or when an error occurs. + +Order is indeterminate, so each function should be completely +independent. + +Mix and match! + +## readJson.cache + +The `lru-cache` object that readJson uses to not read the same file over +and over again. See +[lru-cache](https://github.com/isaacs/node-lru-cache) for details. + +## Other Relevant Files Besides `package.json` + +Some other files have an effect on the resulting data object, in the +following ways: + +### `README?(.*)` + +If there is a `README` or `README.*` file present, then npm will attach +a `readme` field to the data with the contents of this file. + +Owing to the fact that roughly 100% of existing node modules have +Markdown README files, it will generally be assumed to be Markdown, +regardless of the extension. Please plan accordingly. + +### `server.js` + +If there is a `server.js` file, and there is not already a +`scripts.start` field, then `scripts.start` will be set to `node +server.js`. + +### `AUTHORS` + +If there is not already a `contributors` field, then the `contributors` +field will be set to the contents of the `AUTHORS` file, split by lines, +and parsed. + +### `bindings.gyp` + +If a bindings.gyp file exists, and there is not already a +`scripts.install` field, then the `scripts.install` field will be set to +`node-gyp rebuild`. + +### `index.js` + +If the json file does not exist, but there is a `index.js` file +present instead, and that file has a package comment, then it will try +to parse the package comment, and use that as the data instead. + +A package comment looks like this: + +```javascript +/**package + * { "name": "my-bare-module" + * , "version": "1.2.3" + * , "description": "etc...." } + **/ + +// or... + +/**package +{ "name": "my-bare-module" +, "version": "1.2.3" +, "description": "etc...." } +**/ +``` + +The important thing is that it starts with `/**package`, and ends with +`**/`. If the package.json file exists, then the index.js is not +parsed. + +### `{directories.man}/*.[0-9]` + +If there is not already a `man` field defined as an array of files or a +single file, and +there is a `directories.man` field defined, then that directory will +be searched for manpages. + +Any valid manpages found in that directory will be assigned to the `man` +array, and installed in the appropriate man directory at package install +time, when installed globally on a Unix system. + +### `{directories.bin}/*` + +If there is not already a `bin` field defined as a string filename or a +hash of ` : ` pairs, then the `directories.bin` +directory will be searched and all the files within it will be linked as +executables at install time. + +When installing locally, npm links bins into `node_modules/.bin`, which +is in the `PATH` environ when npm runs scripts. When +installing globally, they are linked into `{prefix}/bin`, which is +presumably in the `PATH` environment variable. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/glob/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/glob/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/glob/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/glob/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/glob/README.md new file mode 100644 index 00000000..6960483b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/glob/README.md @@ -0,0 +1,359 @@ +# Glob + +Match files using the patterns the shell uses, like stars and stuff. + +[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master) + +This is a glob implementation in JavaScript. It uses the `minimatch` +library to do its matching. + +![](oh-my-glob.gif) + +## Usage + +```javascript +var glob = require("glob") + +// options is optional +glob("**/*.js", options, function (er, files) { + // files is an array of filenames. + // If the `nonull` option is set, and nothing + // was found, then files is ["**/*.js"] + // er is an error object or null. +}) +``` + +## Glob Primer + +"Globs" are the patterns you type when you do stuff like `ls *.js` on +the command line, or put `build/*` in a `.gitignore` file. + +Before parsing the path part patterns, braced sections are expanded +into a set. Braced sections start with `{` and end with `}`, with any +number of comma-delimited sections within. Braced sections may contain +slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`. + +The following characters have special magic meaning when used in a +path portion: + +* `*` Matches 0 or more characters in a single path portion +* `?` Matches 1 character +* `[...]` Matches a range of characters, similar to a RegExp range. + If the first character of the range is `!` or `^` then it matches + any character not in the range. +* `!(pattern|pattern|pattern)` Matches anything that does not match + any of the patterns provided. +* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the + patterns provided. +* `+(pattern|pattern|pattern)` Matches one or more occurrences of the + patterns provided. +* `*(a|b|c)` Matches zero or more occurrences of the patterns provided +* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns + provided +* `**` If a "globstar" is alone in a path portion, then it matches + zero or more directories and subdirectories searching for matches. + It does not crawl symlinked directories. + +### Dots + +If a file or directory path portion has a `.` as the first character, +then it will not match any glob pattern unless that pattern's +corresponding path part also has a `.` as its first character. + +For example, the pattern `a/.*/c` would match the file at `a/.b/c`. +However the pattern `a/*/c` would not, because `*` does not start with +a dot character. + +You can make glob treat dots as normal characters by setting +`dot:true` in the options. + +### Basename Matching + +If you set `matchBase:true` in the options, and the pattern has no +slashes in it, then it will seek for any file anywhere in the tree +with a matching basename. For example, `*.js` would match +`test/simple/basic.js`. + +### Empty Sets + +If no matching files are found, then an empty array is returned. This +differs from the shell, where the pattern itself is returned. For +example: + + $ echo a*s*d*f + a*s*d*f + +To get the bash-style behavior, set the `nonull:true` in the options. + +### See Also: + +* `man sh` +* `man bash` (Search for "Pattern Matching") +* `man 3 fnmatch` +* `man 5 gitignore` +* [minimatch documentation](https://github.com/isaacs/minimatch) + +## glob.hasMagic(pattern, [options]) + +Returns `true` if there are any special characters in the pattern, and +`false` otherwise. + +Note that the options affect the results. If `noext:true` is set in +the options object, then `+(a|b)` will not be considered a magic +pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}` +then that is considered magical, unless `nobrace:true` is set in the +options. + +## glob(pattern, [options], cb) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* `cb` `{Function}` + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Perform an asynchronous glob search. + +## glob.sync(pattern, [options]) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* return: `{Array}` filenames found matching the pattern + +Perform a synchronous glob search. + +## Class: glob.Glob + +Create a Glob object by instantiating the `glob.Glob` class. + +```javascript +var Glob = require("glob").Glob +var mg = new Glob(pattern, options, cb) +``` + +It's an EventEmitter, and starts walking the filesystem to find matches +immediately. + +### new glob.Glob(pattern, [options], [cb]) + +* `pattern` `{String}` pattern to search for +* `options` `{Object}` +* `cb` `{Function}` Called when an error occurs, or matches are found + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Note that if the `sync` flag is set in the options, then matches will +be immediately available on the `g.found` member. + +### Properties + +* `minimatch` The minimatch object that the glob uses. +* `options` The options object passed in. +* `aborted` Boolean which is set to true when calling `abort()`. There + is no way at this time to continue a glob search after aborting, but + you can re-use the statCache to avoid having to duplicate syscalls. +* `cache` Convenience object. Each field has the following possible + values: + * `false` - Path does not exist + * `true` - Path exists + * `'FILE'` - Path exists, and is not a directory + * `'DIR'` - Path exists, and is a directory + * `[file, entries, ...]` - Path exists, is a directory, and the + array value is the results of `fs.readdir` +* `statCache` Cache of `fs.stat` results, to prevent statting the same + path multiple times. +* `symlinks` A record of which paths are symbolic links, which is + relevant in resolving `**` patterns. +* `realpathCache` An optional object which is passed to `fs.realpath` + to minimize unnecessary syscalls. It is stored on the instantiated + Glob object, and may be re-used. + +### Events + +* `end` When the matching is finished, this is emitted with all the + matches found. If the `nonull` option is set, and no match was found, + then the `matches` list contains the original pattern. The matches + are sorted, unless the `nosort` flag is set. +* `match` Every time a match is found, this is emitted with the specific + thing that matched. It is not deduplicated or resolved to a realpath. +* `error` Emitted when an unexpected error is encountered, or whenever + any fs error occurs if `options.strict` is set. +* `abort` When `abort()` is called, this event is raised. + +### Methods + +* `pause` Temporarily stop the search +* `resume` Resume the search +* `abort` Stop the search forever + +### Options + +All the options that can be passed to Minimatch can also be passed to +Glob to change pattern matching behavior. Also, some have been added, +or have glob-specific ramifications. + +All options are false by default, unless otherwise noted. + +All options are added to the Glob object, as well. + +If you are running many `glob` operations, you can pass a Glob object +as the `options` argument to a subsequent operation to shortcut some +`stat` and `readdir` calls. At the very least, you may pass in shared +`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that +parallel glob operations will be sped up by sharing information about +the filesystem. + +* `cwd` The current working directory in which to search. Defaults + to `process.cwd()`. +* `root` The place where patterns starting with `/` will be mounted + onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix + systems, and `C:\` or some such on Windows.) +* `dot` Include `.dot` files in normal matches and `globstar` matches. + Note that an explicit dot in a portion of the pattern will always + match dot files. +* `nomount` By default, a pattern starting with a forward-slash will be + "mounted" onto the root setting, so that a valid filesystem path is + returned. Set this flag to disable that behavior. +* `mark` Add a `/` character to directory matches. Note that this + requires additional stat calls. +* `nosort` Don't sort the results. +* `stat` Set to true to stat *all* results. This reduces performance + somewhat, and is completely unnecessary, unless `readdir` is presumed + to be an untrustworthy indicator of file existence. +* `silent` When an unusual error is encountered when attempting to + read a directory, a warning will be printed to stderr. Set the + `silent` option to true to suppress these warnings. +* `strict` When an unusual error is encountered when attempting to + read a directory, the process will just continue on in search of + other matches. Set the `strict` option to raise an error in these + cases. +* `cache` See `cache` property above. Pass in a previously generated + cache object to save some fs calls. +* `statCache` A cache of results of filesystem information, to prevent + unnecessary stat calls. While it should not normally be necessary + to set this, you may pass the statCache from one glob() call to the + options object of another, if you know that the filesystem will not + change between calls. (See "Race Conditions" below.) +* `symlinks` A cache of known symbolic links. You may pass in a + previously generated `symlinks` object to save `lstat` calls when + resolving `**` matches. +* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead. +* `nounique` In some cases, brace-expanded patterns can result in the + same file showing up multiple times in the result set. By default, + this implementation prevents duplicates in the result set. Set this + flag to disable that behavior. +* `nonull` Set to never return an empty set, instead returning a set + containing the pattern itself. This is the default in glob(3). +* `debug` Set to enable debug logging in minimatch and glob. +* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets. +* `noglobstar` Do not match `**` against multiple filenames. (Ie, + treat it as a normal `*` instead.) +* `noext` Do not match `+(a|b)` "extglob" patterns. +* `nocase` Perform a case-insensitive match. Note: on + case-insensitive filesystems, non-magic patterns will match by + default, since `stat` and `readdir` will not raise errors. +* `matchBase` Perform a basename-only match if the pattern does not + contain any slash characters. That is, `*.js` would be treated as + equivalent to `**/*.js`, matching all js files in all directories. +* `nodir` Do not match directories, only files. (Note: to match + *only* directories, simply put a `/` at the end of the pattern.) +* `ignore` Add a pattern or an array of glob patterns to exclude matches. + Note: `ignore` patterns are *always* in `dot:true` mode, regardless + of any other settings. +* `follow` Follow symlinked directories when expanding `**` patterns. + Note that this can result in a lot of duplicate references in the + presence of cyclic links. +* `realpath` Set to true to call `fs.realpath` on all of the results. + In the case of a symlink that cannot be resolved, the full absolute + path to the matched entry is returned (though it will usually be a + broken symlink) + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between node-glob and other +implementations, and are intentional. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.3, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +Note that symlinked directories are not crawled as part of a `**`, +though their contents may match against subsequent portions of the +pattern. This prevents infinite loops and duplicates and the like. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then glob returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. + +### Comments and Negation + +Previously, this module let you mark a pattern as a "comment" if it +started with a `#` character, or a "negated" pattern if it started +with a `!` character. + +These options were deprecated in version 5, and removed in version 6. + +To specify things that should not match, use the `ignore` option. + +## Windows + +**Please only use forward-slashes in glob expressions.** + +Though windows uses either `/` or `\` as its path separator, only `/` +characters are used by this glob implementation. You must use +forward-slashes **only** in glob expressions. Back-slashes will always +be interpreted as escape characters, not path separators. + +Results from absolute patterns such as `/foo/*` are mounted onto the +root setting using `path.join`. On windows, this will by default result +in `/foo/*` matching `C:\foo\bar.txt`. + +## Race Conditions + +Glob searching, by its very nature, is susceptible to race conditions, +since it relies on directory walking and such. + +As a result, it is possible that a file that exists when glob looks for +it may have been deleted or modified by the time it returns the result. + +As part of its internal implementation, this program caches all stat +and readdir calls that it makes, in order to cut down on system +overhead. However, this also makes it even more susceptible to races, +especially if the cache or statCache objects are reused between glob +calls. + +Users are thus advised not to use a glob result as a guarantee of +filesystem state in the face of rapid changes. For the vast majority +of operations, this is never a problem. + +## Contributing + +Any change to behavior (including bugfixes) must come with a test. + +Patches that fail tests or reduce performance will be rejected. + +``` +# to run tests +npm test + +# to re-generate test fixtures +npm run test-regen + +# to benchmark against bash/zsh +npm run bench + +# to profile javascript +npm run prof +``` diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/glob/common.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/glob/common.js new file mode 100644 index 00000000..c9127eb3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/glob/common.js @@ -0,0 +1,226 @@ +exports.alphasort = alphasort +exports.alphasorti = alphasorti +exports.setopts = setopts +exports.ownProp = ownProp +exports.makeAbs = makeAbs +exports.finish = finish +exports.mark = mark +exports.isIgnored = isIgnored +exports.childrenIgnored = childrenIgnored + +function ownProp (obj, field) { + return Object.prototype.hasOwnProperty.call(obj, field) +} + +var path = require("path") +var minimatch = require("minimatch") +var isAbsolute = require("path-is-absolute") +var Minimatch = minimatch.Minimatch + +function alphasorti (a, b) { + return a.toLowerCase().localeCompare(b.toLowerCase()) +} + +function alphasort (a, b) { + return a.localeCompare(b) +} + +function setupIgnores (self, options) { + self.ignore = options.ignore || [] + + if (!Array.isArray(self.ignore)) + self.ignore = [self.ignore] + + if (self.ignore.length) { + self.ignore = self.ignore.map(ignoreMap) + } +} + +// ignore patterns are always in dot:true mode. +function ignoreMap (pattern) { + var gmatcher = null + if (pattern.slice(-3) === '/**') { + var gpattern = pattern.replace(/(\/\*\*)+$/, '') + gmatcher = new Minimatch(gpattern, { dot: true }) + } + + return { + matcher: new Minimatch(pattern, { dot: true }), + gmatcher: gmatcher + } +} + +function setopts (self, pattern, options) { + if (!options) + options = {} + + // base-matching: just use globstar for that. + if (options.matchBase && -1 === pattern.indexOf("/")) { + if (options.noglobstar) { + throw new Error("base matching requires globstar") + } + pattern = "**/" + pattern + } + + self.silent = !!options.silent + self.pattern = pattern + self.strict = options.strict !== false + self.realpath = !!options.realpath + self.realpathCache = options.realpathCache || Object.create(null) + self.follow = !!options.follow + self.dot = !!options.dot + self.mark = !!options.mark + self.nodir = !!options.nodir + if (self.nodir) + self.mark = true + self.sync = !!options.sync + self.nounique = !!options.nounique + self.nonull = !!options.nonull + self.nosort = !!options.nosort + self.nocase = !!options.nocase + self.stat = !!options.stat + self.noprocess = !!options.noprocess + + self.maxLength = options.maxLength || Infinity + self.cache = options.cache || Object.create(null) + self.statCache = options.statCache || Object.create(null) + self.symlinks = options.symlinks || Object.create(null) + + setupIgnores(self, options) + + self.changedCwd = false + var cwd = process.cwd() + if (!ownProp(options, "cwd")) + self.cwd = cwd + else { + self.cwd = options.cwd + self.changedCwd = path.resolve(options.cwd) !== cwd + } + + self.root = options.root || path.resolve(self.cwd, "/") + self.root = path.resolve(self.root) + if (process.platform === "win32") + self.root = self.root.replace(/\\/g, "/") + + self.nomount = !!options.nomount + + // disable comments and negation in Minimatch. + // Note that they are not supported in Glob itself anyway. + options.nonegate = true + options.nocomment = true + + self.minimatch = new Minimatch(pattern, options) + self.options = self.minimatch.options +} + +function finish (self) { + var nou = self.nounique + var all = nou ? [] : Object.create(null) + + for (var i = 0, l = self.matches.length; i < l; i ++) { + var matches = self.matches[i] + if (!matches || Object.keys(matches).length === 0) { + if (self.nonull) { + // do like the shell, and spit out the literal glob + var literal = self.minimatch.globSet[i] + if (nou) + all.push(literal) + else + all[literal] = true + } + } else { + // had matches + var m = Object.keys(matches) + if (nou) + all.push.apply(all, m) + else + m.forEach(function (m) { + all[m] = true + }) + } + } + + if (!nou) + all = Object.keys(all) + + if (!self.nosort) + all = all.sort(self.nocase ? alphasorti : alphasort) + + // at *some* point we statted all of these + if (self.mark) { + for (var i = 0; i < all.length; i++) { + all[i] = self._mark(all[i]) + } + if (self.nodir) { + all = all.filter(function (e) { + return !(/\/$/.test(e)) + }) + } + } + + if (self.ignore.length) + all = all.filter(function(m) { + return !isIgnored(self, m) + }) + + self.found = all +} + +function mark (self, p) { + var abs = makeAbs(self, p) + var c = self.cache[abs] + var m = p + if (c) { + var isDir = c === 'DIR' || Array.isArray(c) + var slash = p.slice(-1) === '/' + + if (isDir && !slash) + m += '/' + else if (!isDir && slash) + m = m.slice(0, -1) + + if (m !== p) { + var mabs = makeAbs(self, m) + self.statCache[mabs] = self.statCache[abs] + self.cache[mabs] = self.cache[abs] + } + } + + return m +} + +// lotta situps... +function makeAbs (self, f) { + var abs = f + if (f.charAt(0) === '/') { + abs = path.join(self.root, f) + } else if (isAbsolute(f) || f === '') { + abs = f + } else if (self.changedCwd) { + abs = path.resolve(self.cwd, f) + } else { + abs = path.resolve(f) + } + return abs +} + + +// Return true, if pattern ends with globstar '**', for the accompanying parent directory. +// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents +function isIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) + }) +} + +function childrenIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return !!(item.gmatcher && item.gmatcher.match(path)) + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/glob/glob.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/glob/glob.js new file mode 100644 index 00000000..a62da27e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/glob/glob.js @@ -0,0 +1,765 @@ +// Approach: +// +// 1. Get the minimatch set +// 2. For each pattern in the set, PROCESS(pattern, false) +// 3. Store matches per-set, then uniq them +// +// PROCESS(pattern, inGlobStar) +// Get the first [n] items from pattern that are all strings +// Join these together. This is PREFIX. +// If there is no more remaining, then stat(PREFIX) and +// add to matches if it succeeds. END. +// +// If inGlobStar and PREFIX is symlink and points to dir +// set ENTRIES = [] +// else readdir(PREFIX) as ENTRIES +// If fail, END +// +// with ENTRIES +// If pattern[n] is GLOBSTAR +// // handle the case where the globstar match is empty +// // by pruning it out, and testing the resulting pattern +// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) +// // handle other cases. +// for ENTRY in ENTRIES (not dotfiles) +// // attach globstar + tail onto the entry +// // Mark that this entry is a globstar match +// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) +// +// else // not globstar +// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) +// Test ENTRY against pattern[n] +// If fails, continue +// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) +// +// Caveat: +// Cache all stats and readdirs results to minimize syscall. Since all +// we ever care about is existence and directory-ness, we can just keep +// `true` for files, and [children,...] for directories, or `false` for +// things that don't exist. + +module.exports = glob + +var fs = require('fs') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var inherits = require('inherits') +var EE = require('events').EventEmitter +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var globSync = require('./sync.js') +var common = require('./common.js') +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var inflight = require('inflight') +var util = require('util') +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored + +var once = require('once') + +function glob (pattern, options, cb) { + if (typeof options === 'function') cb = options, options = {} + if (!options) options = {} + + if (options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return globSync(pattern, options) + } + + return new Glob(pattern, options, cb) +} + +glob.sync = globSync +var GlobSync = glob.GlobSync = globSync.GlobSync + +// old api surface +glob.glob = glob + +function extend (origin, add) { + if (add === null || typeof add !== 'object') { + return origin + } + + var keys = Object.keys(add) + var i = keys.length + while (i--) { + origin[keys[i]] = add[keys[i]] + } + return origin +} + +glob.hasMagic = function (pattern, options_) { + var options = extend({}, options_) + options.noprocess = true + + var g = new Glob(pattern, options) + var set = g.minimatch.set + if (set.length > 1) + return true + + for (var j = 0; j < set[0].length; j++) { + if (typeof set[0][j] !== 'string') + return true + } + + return false +} + +glob.Glob = Glob +inherits(Glob, EE) +function Glob (pattern, options, cb) { + if (typeof options === 'function') { + cb = options + options = null + } + + if (options && options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return new GlobSync(pattern, options) + } + + if (!(this instanceof Glob)) + return new Glob(pattern, options, cb) + + setopts(this, pattern, options) + this._didRealPath = false + + // process each pattern in the minimatch set + var n = this.minimatch.set.length + + // The matches are stored as {: true,...} so that + // duplicates are automagically pruned. + // Later, we do an Object.keys() on these. + // Keep them as a list so we can fill in when nonull is set. + this.matches = new Array(n) + + if (typeof cb === 'function') { + cb = once(cb) + this.on('error', cb) + this.on('end', function (matches) { + cb(null, matches) + }) + } + + var self = this + var n = this.minimatch.set.length + this._processing = 0 + this.matches = new Array(n) + + this._emitQueue = [] + this._processQueue = [] + this.paused = false + + if (this.noprocess) + return this + + if (n === 0) + return done() + + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false, done) + } + + function done () { + --self._processing + if (self._processing <= 0) + self._finish() + } +} + +Glob.prototype._finish = function () { + assert(this instanceof Glob) + if (this.aborted) + return + + if (this.realpath && !this._didRealpath) + return this._realpath() + + common.finish(this) + this.emit('end', this.found) +} + +Glob.prototype._realpath = function () { + if (this._didRealpath) + return + + this._didRealpath = true + + var n = this.matches.length + if (n === 0) + return this._finish() + + var self = this + for (var i = 0; i < this.matches.length; i++) + this._realpathSet(i, next) + + function next () { + if (--n === 0) + self._finish() + } +} + +Glob.prototype._realpathSet = function (index, cb) { + var matchset = this.matches[index] + if (!matchset) + return cb() + + var found = Object.keys(matchset) + var self = this + var n = found.length + + if (n === 0) + return cb() + + var set = this.matches[index] = Object.create(null) + found.forEach(function (p, i) { + // If there's a problem with the stat, then it means that + // one or more of the links in the realpath couldn't be + // resolved. just return the abs value in that case. + p = self._makeAbs(p) + fs.realpath(p, self.realpathCache, function (er, real) { + if (!er) + set[real] = true + else if (er.syscall === 'stat') + set[p] = true + else + self.emit('error', er) // srsly wtf right here + + if (--n === 0) { + self.matches[index] = set + cb() + } + }) + }) +} + +Glob.prototype._mark = function (p) { + return common.mark(this, p) +} + +Glob.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} + +Glob.prototype.abort = function () { + this.aborted = true + this.emit('abort') +} + +Glob.prototype.pause = function () { + if (!this.paused) { + this.paused = true + this.emit('pause') + } +} + +Glob.prototype.resume = function () { + if (this.paused) { + this.emit('resume') + this.paused = false + if (this._emitQueue.length) { + var eq = this._emitQueue.slice(0) + this._emitQueue.length = 0 + for (var i = 0; i < eq.length; i ++) { + var e = eq[i] + this._emitMatch(e[0], e[1]) + } + } + if (this._processQueue.length) { + var pq = this._processQueue.slice(0) + this._processQueue.length = 0 + for (var i = 0; i < pq.length; i ++) { + var p = pq[i] + this._processing-- + this._process(p[0], p[1], p[2], p[3]) + } + } + } +} + +Glob.prototype._process = function (pattern, index, inGlobStar, cb) { + assert(this instanceof Glob) + assert(typeof cb === 'function') + + if (this.aborted) + return + + this._processing++ + if (this.paused) { + this._processQueue.push([pattern, index, inGlobStar, cb]) + return + } + + //console.error('PROCESS %d', this._processing, pattern) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // see if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index, cb) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip _processing + if (childrenIgnored(this, read)) + return cb() + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) +} + +Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + +Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return cb() + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return cb() + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return cb() + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + this._process([e].concat(remain), index, inGlobStar, cb) + } + cb() +} + +Glob.prototype._emitMatch = function (index, e) { + if (this.aborted) + return + + if (this.matches[index][e]) + return + + if (isIgnored(this, e)) + return + + if (this.paused) { + this._emitQueue.push([index, e]) + return + } + + var abs = this._makeAbs(e) + + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } + + if (this.mark) + e = this._mark(e) + + this.matches[index][e] = true + + var st = this.statCache[abs] + if (st) + this.emit('stat', e, st) + + this.emit('match', e) +} + +Glob.prototype._readdirInGlobStar = function (abs, cb) { + if (this.aborted) + return + + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false, cb) + + var lstatkey = 'lstat\0' + abs + var self = this + var lstatcb = inflight(lstatkey, lstatcb_) + + if (lstatcb) + fs.lstat(abs, lstatcb) + + function lstatcb_ (er, lstat) { + if (er) + return cb() + + var isSym = lstat.isSymbolicLink() + self.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && !lstat.isDirectory()) { + self.cache[abs] = 'FILE' + cb() + } else + self._readdir(abs, false, cb) + } +} + +Glob.prototype._readdir = function (abs, inGlobStar, cb) { + if (this.aborted) + return + + cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) + if (!cb) + return + + //console.error('RD %j %j', +inGlobStar, abs) + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs, cb) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return cb() + + if (Array.isArray(c)) + return cb(null, c) + } + + var self = this + fs.readdir(abs, readdirCb(this, abs, cb)) +} + +function readdirCb (self, abs, cb) { + return function (er, entries) { + if (er) + self._readdirError(abs, er, cb) + else + self._readdirEntries(abs, entries, cb) + } +} + +Glob.prototype._readdirEntries = function (abs, entries, cb) { + if (this.aborted) + return + + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + return cb(null, entries) +} + +Glob.prototype._readdirError = function (f, er, cb) { + if (this.aborted) + return + + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + this.cache[this._makeAbs(f)] = 'FILE' + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) { + this.emit('error', er) + // If the error is handled, then we abort + // if not, we threw out of here + this.abort() + } + if (!this.silent) + console.error('glob error', er) + break + } + + return cb() +} + +Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + + +Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + //console.error('pgs2', prefix, remain[0], entries) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return cb() + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false, cb) + + var isSym = this.symlinks[abs] + var len = entries.length + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return cb() + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true, cb) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true, cb) + } + + cb() +} + +Glob.prototype._processSimple = function (prefix, index, cb) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var self = this + this._stat(prefix, function (er, exists) { + self._processSimple2(prefix, index, er, exists, cb) + }) +} +Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { + + //console.error('ps2', prefix, exists) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return cb() + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this._emitMatch(index, prefix) + cb() +} + +// Returns either 'DIR', 'FILE', or false +Glob.prototype._stat = function (f, cb) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return cb() + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return cb(null, c) + + if (needDir && c === 'FILE') + return cb() + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (stat !== undefined) { + if (stat === false) + return cb(null, stat) + else { + var type = stat.isDirectory() ? 'DIR' : 'FILE' + if (needDir && type === 'FILE') + return cb() + else + return cb(null, type, stat) + } + } + + var self = this + var statcb = inflight('stat\0' + abs, lstatcb_) + if (statcb) + fs.lstat(abs, statcb) + + function lstatcb_ (er, lstat) { + if (lstat && lstat.isSymbolicLink()) { + // If it's a symlink, then treat it as the target, unless + // the target does not exist, then treat it as a file. + return fs.stat(abs, function (er, stat) { + if (er) + self._stat2(f, abs, null, lstat, cb) + else + self._stat2(f, abs, er, stat, cb) + }) + } else { + self._stat2(f, abs, er, lstat, cb) + } + } +} + +Glob.prototype._stat2 = function (f, abs, er, stat, cb) { + if (er) { + this.statCache[abs] = false + return cb() + } + + var needDir = f.slice(-1) === '/' + this.statCache[abs] = stat + + if (abs.slice(-1) === '/' && !stat.isDirectory()) + return cb(null, false, stat) + + var c = stat.isDirectory() ? 'DIR' : 'FILE' + this.cache[abs] = this.cache[abs] || c + + if (needDir && c !== 'DIR') + return cb() + + return cb(null, c, stat) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/index.js new file mode 100644 index 00000000..19f103f9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/index.js @@ -0,0 +1,20 @@ +'use strict'; + +function posix(path) { + return path.charAt(0) === '/'; +}; + +function win32(path) { + // https://github.com/joyent/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56 + var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; + var result = splitDeviceRe.exec(path); + var device = result[1] || ''; + var isUnc = !!device && device.charAt(1) !== ':'; + + // UNC paths are always absolute + return !!result[2] || isUnc; +}; + +module.exports = process.platform === 'win32' ? win32 : posix; +module.exports.posix = posix; +module.exports.win32 = win32; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/license b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/package.json new file mode 100644 index 00000000..39372636 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/package.json @@ -0,0 +1,70 @@ +{ + "name": "path-is-absolute", + "version": "1.0.0", + "description": "Node.js 0.12 path.isAbsolute() ponyfill", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/path-is-absolute.git" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "node test.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "path", + "paths", + "file", + "dir", + "absolute", + "isabsolute", + "is-absolute", + "built-in", + "util", + "utils", + "core", + "ponyfill", + "polyfill", + "shim", + "is", + "detect", + "check" + ], + "gitHead": "7a76a0c9f2263192beedbe0a820e4d0baee5b7a1", + "bugs": { + "url": "https://github.com/sindresorhus/path-is-absolute/issues" + }, + "homepage": "https://github.com/sindresorhus/path-is-absolute", + "_id": "path-is-absolute@1.0.0", + "_shasum": "263dada66ab3f2fb10bf7f9d24dd8f3e570ef912", + "_from": "path-is-absolute@>=1.0.0 <2.0.0", + "_npmVersion": "2.5.1", + "_nodeVersion": "0.12.0", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "dist": { + "shasum": "263dada66ab3f2fb10bf7f9d24dd8f3e570ef912", + "tarball": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/readme.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/readme.md new file mode 100644 index 00000000..cdf94f43 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/readme.md @@ -0,0 +1,51 @@ +# path-is-absolute [![Build Status](https://travis-ci.org/sindresorhus/path-is-absolute.svg?branch=master)](https://travis-ci.org/sindresorhus/path-is-absolute) + +> Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) ponyfill + +> Ponyfill: A polyfill that doesn't overwrite the native method + + +## Install + +``` +$ npm install --save path-is-absolute +``` + + +## Usage + +```js +var pathIsAbsolute = require('path-is-absolute'); + +// Linux +pathIsAbsolute('/home/foo'); +//=> true + +// Windows +pathIsAbsolute('C:/Users/'); +//=> true + +// Any OS +pathIsAbsolute.posix('/home/foo'); +//=> true +``` + + +## API + +See the [`path.isAbsolute()` docs](http://nodejs.org/api/path.html#path_path_isabsolute_path). + +### pathIsAbsolute(path) + +### pathIsAbsolute.posix(path) + +The Posix specific version. + +### pathIsAbsolute.win32(path) + +The Windows specific version. + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/glob/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/glob/package.json new file mode 100644 index 00000000..d6cebb41 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/glob/package.json @@ -0,0 +1,73 @@ +{ + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "name": "glob", + "description": "a little globber", + "version": "6.0.4", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-glob.git" + }, + "main": "glob.js", + "files": [ + "glob.js", + "sync.js", + "common.js" + ], + "engines": { + "node": "*" + }, + "dependencies": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "devDependencies": { + "mkdirp": "0", + "rimraf": "^2.2.8", + "tap": "^5.0.0", + "tick": "0.0.6" + }, + "scripts": { + "prepublish": "npm run benchclean", + "profclean": "rm -f v8.log profile.txt", + "test": "tap test/*.js --cov", + "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js", + "bench": "bash benchmark.sh", + "prof": "bash prof.sh && cat profile.txt", + "benchclean": "node benchclean.js" + }, + "license": "ISC", + "gitHead": "3bd419c538737e56fda7e21c21ff52ca0c198df6", + "bugs": { + "url": "https://github.com/isaacs/node-glob/issues" + }, + "homepage": "https://github.com/isaacs/node-glob#readme", + "_id": "glob@6.0.4", + "_shasum": "0f08860f6a155127b2fadd4f9ce24b1aab6e4d22", + "_from": "glob@>=6.0.0 <7.0.0", + "_npmVersion": "2.14.15", + "_nodeVersion": "4.0.0", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "dist": { + "shasum": "0f08860f6a155127b2fadd4f9ce24b1aab6e4d22", + "tarball": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/glob/sync.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/glob/sync.js new file mode 100644 index 00000000..09883d2c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/glob/sync.js @@ -0,0 +1,460 @@ +module.exports = globSync +globSync.GlobSync = GlobSync + +var fs = require('fs') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var Glob = require('./glob.js').Glob +var util = require('util') +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var common = require('./common.js') +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var childrenIgnored = common.childrenIgnored + +function globSync (pattern, options) { + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + return new GlobSync(pattern, options).found +} + +function GlobSync (pattern, options) { + if (!pattern) + throw new Error('must provide pattern') + + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + if (!(this instanceof GlobSync)) + return new GlobSync(pattern, options) + + setopts(this, pattern, options) + + if (this.noprocess) + return this + + var n = this.minimatch.set.length + this.matches = new Array(n) + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false) + } + this._finish() +} + +GlobSync.prototype._finish = function () { + assert(this instanceof GlobSync) + if (this.realpath) { + var self = this + this.matches.forEach(function (matchset, index) { + var set = self.matches[index] = Object.create(null) + for (var p in matchset) { + try { + p = self._makeAbs(p) + var real = fs.realpathSync(p, self.realpathCache) + set[real] = true + } catch (er) { + if (er.syscall === 'stat') + set[self._makeAbs(p)] = true + else + throw er + } + } + }) + } + common.finish(this) +} + + +GlobSync.prototype._process = function (pattern, index, inGlobStar) { + assert(this instanceof GlobSync) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // See if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip processing + if (childrenIgnored(this, read)) + return + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar) +} + + +GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { + var entries = this._readdir(abs, inGlobStar) + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix.slice(-1) !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this.matches[index][e] = true + } + // This was the last one, and no stats were needed + return + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) + newPattern = [prefix, e] + else + newPattern = [e] + this._process(newPattern.concat(remain), index, inGlobStar) + } +} + + +GlobSync.prototype._emitMatch = function (index, e) { + var abs = this._makeAbs(e) + if (this.mark) + e = this._mark(e) + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[this._makeAbs(e)] + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true + if (this.stat) + this._stat(e) +} + + +GlobSync.prototype._readdirInGlobStar = function (abs) { + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false) + + var entries + var lstat + var stat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + // lstat failed, doesn't exist + return null + } + + var isSym = lstat.isSymbolicLink() + this.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && !lstat.isDirectory()) + this.cache[abs] = 'FILE' + else + entries = this._readdir(abs, false) + + return entries +} + +GlobSync.prototype._readdir = function (abs, inGlobStar) { + var entries + + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return null + + if (Array.isArray(c)) + return c + } + + try { + return this._readdirEntries(abs, fs.readdirSync(abs)) + } catch (er) { + this._readdirError(abs, er) + return null + } +} + +GlobSync.prototype._readdirEntries = function (abs, entries) { + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + + // mark and cache dir-ness + return entries +} + +GlobSync.prototype._readdirError = function (f, er) { + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + this.cache[this._makeAbs(f)] = 'FILE' + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) + throw er + if (!this.silent) + console.error('glob error', er) + break + } +} + +GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { + + var entries = this._readdir(abs, inGlobStar) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false) + + var len = entries.length + var isSym = this.symlinks[abs] + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true) + } +} + +GlobSync.prototype._processSimple = function (prefix, index) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var exists = this._stat(prefix) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this.matches[index][prefix] = true +} + +// Returns either 'DIR', 'FILE', or false +GlobSync.prototype._stat = function (f) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return false + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return c + + if (needDir && c === 'FILE') + return false + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (!stat) { + var lstat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + return false + } + + if (lstat.isSymbolicLink()) { + try { + stat = fs.statSync(abs) + } catch (er) { + stat = lstat + } + } else { + stat = lstat + } + } + + this.statCache[abs] = stat + + var c = stat.isDirectory() ? 'DIR' : 'FILE' + this.cache[abs] = this.cache[abs] || c + + if (needDir && c !== 'DIR') + return false + + return c +} + +GlobSync.prototype._mark = function (p) { + return common.mark(this, p) +} + +GlobSync.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/.editorconfig b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/.editorconfig new file mode 100644 index 00000000..fb7f73a8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/.editorconfig @@ -0,0 +1,14 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.js, **/*.js] +indent_size = 4 +indent_style = space + +[{package.json,.travis.yml}] +indent_size = 2 +indent_style = space diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/.npmignore new file mode 100644 index 00000000..59d842ba --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/.npmignore @@ -0,0 +1,28 @@ +# Logs +logs +*.log + +# Runtime data +pids +*.pid +*.seed + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directory +# Commenting this out is preferred by some people, see +# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- +node_modules + +# Users Environment Variables +.lock-wscript diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/LICENSE new file mode 100644 index 00000000..e637724b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Sam Mikes + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/README.md new file mode 100644 index 00000000..ffad9358 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/README.md @@ -0,0 +1,29 @@ +# json-parse-helpfulerror + +A drop-in replacement for `JSON.parse` that uses + to provide more useful error messages in the +event of a parse error. + +# Example + +## Installation + +``` +npm i -S json-parse-helpfulerror +``` + +## Use + +```js +var jph = require('json-parse-helpfulerror'); + +var notJSON = "{'foo': 3}"; // keys must be double-quoted in JSON + +JSON.parse(notJSON); // throws unhelpful error + +jph.parse("{'foo': 3}") // throws more helpful error: "Unexpected token '\''..." +``` + +# License + +MIT \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/index.js new file mode 100644 index 00000000..15648b01 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/index.js @@ -0,0 +1,21 @@ +'use strict'; + +var jju = require('jju'); + +function parse(text, reviver) { + try { + return JSON.parse(text, reviver); + } catch (err) { + // we expect this to throw with a more informative message + jju.parse(text, { + mode: 'json', + reviver: reviver + }); + + // backup if jju is not as strict as JSON.parse; re-throw error + // data-dependent code path, I do not know how to cover it + throw err; + } +} + +exports.parse = parse; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/.npmignore new file mode 100644 index 00000000..5ae40150 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/.npmignore @@ -0,0 +1,9 @@ +package.json +node_modules +test +benchmark +docs +examples +/.editorconfig +/.eslint* +/.travis.yml diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/LICENSE new file mode 100644 index 00000000..5c93f456 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/LICENSE @@ -0,0 +1,13 @@ + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 + + Copyright (C) 2004 Sam Hocevar + + Everyone is permitted to copy and distribute verbatim or modified + copies of this license document, and changing it is allowed as long + as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/README.md new file mode 100644 index 00000000..85d52a2d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/README.md @@ -0,0 +1,243 @@ +`jju` - a set of utilities to work with JSON / JSON5 documents + +[![npm version badge](https://img.shields.io/npm/v/jju.svg)](https://www.npmjs.org/package/jju) +[![travis badge](http://img.shields.io/travis/rlidwka/jju.svg)](https://travis-ci.org/rlidwka/jju) +[![downloads badge](http://img.shields.io/npm/dm/jju.svg)](https://www.npmjs.org/package/jju) + +## Installation + +``` +npm install jju +``` + +## Usage + +This module provides following functions: + +1. [jju.parse()](#jjuparse-function) parses json/json5 text and returns a javascript value it corresponds to +2. [jju.stringify()](#jjustringify-function) converts javascript value to an appropriate json/json5 text +3. [jju.tokenize()](#jjutokenize-function) parses json/json5 text and returns an array of tokens it consists of ([see demo](http://rlidwka.github.io/jju/tokenizer.html)) +4. [jju.analyze()](#jjuanalyze-function) parses json/json5 text and tries to guess indentation, quoting style, etc. +5. [jju.update()](#jjuupdate-function) changes json/json5 text, preserving original formatting as much as possible ([see demo](http://rlidwka.github.io/jju/editor.html)) + +All functions are able to work with a standard JSON documents. `jju.parse()` and `jju.stringify()` are better in some cases, but slower than native `JSON.parse()` and `JSON.stringify()` versions. Detailed description see below. + +### jju.parse() function + +```javascript +/* + * Main syntax: + * + * `text` - text to parse, type: String + * `options` - parser options, type: Object + */ +jju.parse(text[, options]) + +// compatibility syntax +jju.parse(text[, reviver]) +``` + +Options: + + - reserved\_keys - what to do with reserved keys (String, default="ignore") + - "ignore" - ignore reserved keys + - "throw" - throw SyntaxError in case of reserved keys + - "replace" - replace reserved keys, this is the default JSON.parse behaviour, unsafe + + Reserved keys are keys that exist in an empty object (`hasOwnProperty`, `__proto__`, etc.). + +```javascript +// 'ignore' will cause reserved keys to be ignored: +parse('{hasOwnProperty: 1}', {reserved_keys: 'ignore'}) == {} +parse('{hasOwnProperty: 1, x: 2}', {reserved_keys: 'ignore'}).hasOwnProperty('x') == true + +// 'throw' will cause SyntaxError in these cases: +parse('{hasOwnProperty: 1}', {reserved_keys: 'throw'}) == SyntaxError + +// 'replace' will replace reserved keys with new ones: +parse('{hasOwnProperty: 1}', {reserved_keys: 'throw'}) == {hasOwnProperty: 1} +parse('{hasOwnProperty: 1, x: 2}', {reserved_keys: 'ignore'}).hasOwnProperty('x') == TypeError +``` + + + - null\_prototype - create object as Object.create(null) instead of '{}' (Boolean) + + if `reserved_keys != 'replace'`, default is **false** + + if `reserved_keys == 'replace'`, default is **true** + + It is usually unsafe and not recommended to change this option to false in the last case. + + - reviver - reviver function - Function + + This function should follow JSON specification + + - mode - operation mode, set it to 'json' if you want to throw on non-strict json files (String) + +### jju.stringify() function + +```javascript +/* + * Main syntax: + * + * `value` - value to serialize, type: * + * `options` - serializer options, type: Object + */ +jju.stringify(value[, options]) + +// compatibility syntax +jju.stringify(value[, replacer [, indent]) +``` + +Options: + + - ascii - output ascii only (Boolean, default=false) + If this option is enabled, output will not have any characters except of 0x20-0x7f. + + - indent - indentation (String, Number or Boolean, default='\t') + This option follows JSON specification. + + - quote - enquoting char (String, "'" or '"', default="'") + - quote\_keys - whether keys quoting in objects is required or not (String, default=false) + If you want `{"q": 1}` instead of `{q: 1}`, set it to true. + + - sort\_keys - sort all keys while stringifying (Boolean or Function, default=false) + By default sort order will depend on implementation, with v8 it's insertion order. If set to `true`, all keys (but not arrays) will be sorted alphabetically. You can provide your own sorting function as well. + + - replacer - replacer function or array (Function or Array) + This option follows JSON specification. + + - no\_trailing\_comma = don't output trailing comma (Boolean, default=false) + If this option is set, arrays like this `[1,2,3,]` will never be generated. Otherwise they may be generated for pretty printing. + + - mode - operation mode, set it to 'json' if you want correct json in the output (String) + + Currently it's either 'json' or something else. If it is 'json', following options are implied: + + - options.quote = '"' + - options.no\_trailing\_comma = true + - options.quote\_keys = true + - '\x' literals are not used + +### jju.tokenize() function + +```javascript +/* + * Main syntax: + * + * `text` - text to tokenize, type: String + * `options` - parser options, type: Object + */ +jju.tokenize(text[, options]) +``` + +Options are the same as for the `jju.parse` function. + +Return value is an array of tokens, where each token is an object: + + - raw (String) - raw text of this token, if you join all raw's, you will get the original document + - type (String) - type of the token, can be `whitespace`, `comment`, `key`, `literal`, `separator` or `newline` + - stack (Array) - path to the current token in the syntax tree + - value - value of the token if token is a `key` or `literal` + +You can check tokenizer for yourself using [this demo](http://rlidwka.github.io/jju/tokenizer.html). + +### jju.analyze() function + +```javascript +/* + * Main syntax: + * + * `text` - text to analyze, type: String + * `options` - parser options, type: Object + */ +jju.analyze(text[, options]) +``` + +Options are the same as for the `jju.parse` function. + +Return value is an object defining a programming style in which the document was written. + + - indent (String) - preferred indentation + - newline (String) - preferred newline + - quote (String) - `"` or `'` depending on which quote is preferred + - quote\_keys (Boolean) - `true` if unquoted keys were used at least once + - has\_whitespace (Boolean) - `true` if input has a whitespace token + - has\_comments (Boolean) - `true` if input has a comment token + - has\_newlines (Boolean) - `true` if input has a newline token + - has\_trailing\_comma (Boolean) - `true` if input has at least one trailing comma + +### jju.update() function + +```javascript +/* + * Main syntax: + * + * `text` - original text, type: String + * `new_value` - new value you want to set + * `options` - parser or stringifier options, type: Object + */ +jju.update(text, new_value[, options]) +``` + +If you want to update a JSON document, here is the general approach: + +```javascript +// here is your original JSON document: +var input = '{"foo": "bar", "baz": 123}' + +// you need to parse it first: +var json = jju.parse(input, {mode: 'json'}) +// json is { foo: 'bar', baz: 123 } + +// then you can change it as you like: +json.foo = 'quux' +json.hello = 'world' + +// then you run an update function to change the original json: +var output = jju.update(input, json, {mode: 'json'}) +// output is '{"foo": "quux", "baz": 123, "hello": "world"}' +``` + +Look at [this demo](http://rlidwka.github.io/jju/editor.html) to test various types of json. + +## Advantages over existing JSON libraries + +In a few cases it makes sense to use this module instead of built-in JSON methods. + +Parser: + - better error reporting with source code and line numbers + +In case of syntax error, JSON.parse does not return any good information to the user. This module does: + +``` +$ node -e 'require("jju").parse("[1,1,1,1,invalid]")' + +SyntaxError: Unexpected token 'i' at 0:9 +[1,1,1,1,invalid] + ^ +``` + +This module is about 5 times slower, so if user experience matters to you more than performance, use this module. If you're working with a lot of machine-generated data, use JSON.parse instead. + +Stringifier: + - util.inspect-like pretty printing + +This module behaves more smart when dealing with object and arrays, and does not always print newlines in them: + +``` +$ node -e 'console.log(require("./").stringify([[,,,],,,[,,,,]], {mode:"json"}))' +[ + [null, null, null], + null, + null, + [null, null, null, null] +] +``` + +JSON.stringify will split this into 15 lines, and it's hard to read. + +Yet again, this feature comes with a performance hit, so if user experience matters to you more than performance, use this module. If your JSON will be consumed by machines, use JSON.stringify instead. + +As a rule of thumb, if you use "space" argument to indent your JSON, you'd better use this module instead. + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/index.js new file mode 100644 index 00000000..50f16249 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/index.js @@ -0,0 +1,32 @@ + +module.exports.__defineGetter__('parse', function() { + return require('./lib/parse').parse +}) + +module.exports.__defineGetter__('stringify', function() { + return require('./lib/stringify').stringify +}) + +module.exports.__defineGetter__('tokenize', function() { + return require('./lib/parse').tokenize +}) + +module.exports.__defineGetter__('update', function() { + return require('./lib/document').update +}) + +module.exports.__defineGetter__('analyze', function() { + return require('./lib/analyze').analyze +}) + +module.exports.__defineGetter__('utils', function() { + return require('./lib/utils') +}) + +/**package +{ "name": "jju", + "version": "0.0.0", + "dependencies": {"js-yaml": "*"}, + "scripts": {"postinstall": "js-yaml package.yaml > package.json ; npm install"} +} +**/ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/analyze.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/analyze.js new file mode 100644 index 00000000..9b0f9af0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/analyze.js @@ -0,0 +1,92 @@ +/* + * Author: Alex Kocharin + * GIT: https://github.com/rlidwka/jju + * License: WTFPL, grab your copy here: http://www.wtfpl.net/txt/copying/ + */ + +var tokenize = require('./parse').tokenize + +module.exports.analyze = function analyzeJSON(input, options) { + if (options == null) options = {} + + if (!Array.isArray(input)) { + input = tokenize(input, options) + } + + var result = { + has_whitespace: false, + has_comments: false, + has_newlines: false, + has_trailing_comma: false, + indent: '', + newline: '\n', + quote: '"', + quote_keys: true, + } + + var stats = { + indent: {}, + newline: {}, + quote: {}, + } + + for (var i=0; i stats[k][b] ? a : b + }) + } + } + + return result +} + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/document.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/document.js new file mode 100644 index 00000000..cfab8691 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/document.js @@ -0,0 +1,485 @@ +/* + * Author: Alex Kocharin + * GIT: https://github.com/rlidwka/jju + * License: WTFPL, grab your copy here: http://www.wtfpl.net/txt/copying/ + */ + +var assert = require('assert') +var tokenize = require('./parse').tokenize +var stringify = require('./stringify').stringify +var analyze = require('./analyze').analyze + +function isObject(x) { + return typeof(x) === 'object' && x !== null +} + +function value_to_tokenlist(value, stack, options, is_key, indent) { + options = Object.create(options) + options._stringify_key = !!is_key + + if (indent) { + options._prefix = indent.prefix.map(function(x) { + return x.raw + }).join('') + } + + if (options._splitMin == null) options._splitMin = 0 + if (options._splitMax == null) options._splitMax = 0 + + var stringified = stringify(value, options) + + if (is_key) { + return [ { raw: stringified, type: 'key', stack: stack, value: value } ] + } + + options._addstack = stack + var result = tokenize(stringified, { + _addstack: stack, + }) + result.data = null + return result +} + +// '1.2.3' -> ['1','2','3'] +function arg_to_path(path) { + // array indexes + if (typeof(path) === 'number') path = String(path) + + if (path === '') path = [] + if (typeof(path) === 'string') path = path.split('.') + + if (!Array.isArray(path)) throw Error('Invalid path type, string or array expected') + return path +} + +// returns new [begin, end] or false if not found +// +// {x:3, xxx: 111, y: [111, {q: 1, e: 2} ,333] } +// f('y',0) returns this B^^^^^^^^^^^^^^^^^^^^^^^^E +// then f('1',1) would reduce it to B^^^^^^^^^^E +function find_element_in_tokenlist(element, lvl, tokens, begin, end) { + while(tokens[begin].stack[lvl] != element) { + if (begin++ >= end) return false + } + while(tokens[end].stack[lvl] != element) { + if (end-- < begin) return false + } + return [begin, end] +} + +function is_whitespace(token_type) { + return token_type === 'whitespace' + || token_type === 'newline' + || token_type === 'comment' +} + +function find_first_non_ws_token(tokens, begin, end) { + while(is_whitespace(tokens[begin].type)) { + if (begin++ >= end) return false + } + return begin +} + +function find_last_non_ws_token(tokens, begin, end) { + while(is_whitespace(tokens[end].type)) { + if (end-- < begin) return false + } + return end +} + +/* + * when appending a new element of an object/array, we are trying to + * figure out the style used on the previous element + * + * return {prefix, sep1, sep2, suffix} + * + * ' "key" : "element" \r\n' + * prefix^^^^ sep1^ ^^sep2 ^^^^^^^^suffix + * + * begin - the beginning of the object/array + * end - last token of the last element (value or comma usually) + */ +function detect_indent_style(tokens, is_array, begin, end, level) { + var result = { + sep1: [], + sep2: [], + suffix: [], + prefix: [], + newline: [], + } + + if (tokens[end].type === 'separator' && tokens[end].stack.length !== level+1 && tokens[end].raw !== ',') { + // either a beginning of the array (no last element) or other weird situation + // + // just return defaults + return result + } + + // ' "key" : "value" ,' + // skipping last separator, we're now here ^^ + if (tokens[end].type === 'separator') + end = find_last_non_ws_token(tokens, begin, end - 1) + if (end === false) return result + + // ' "key" : "value" ,' + // skipping value ^^^^^^^ + while(tokens[end].stack.length > level) end-- + + if (!is_array) { + while(is_whitespace(tokens[end].type)) { + if (end < begin) return result + if (tokens[end].type === 'whitespace') { + result.sep2.unshift(tokens[end]) + } else { + // newline, comment or other unrecognized codestyle + return result + } + end-- + } + + // ' "key" : "value" ,' + // skipping separator ^ + assert.equal(tokens[end].type, 'separator') + assert.equal(tokens[end].raw, ':') + while(is_whitespace(tokens[--end].type)) { + if (end < begin) return result + if (tokens[end].type === 'whitespace') { + result.sep1.unshift(tokens[end]) + } else { + // newline, comment or other unrecognized codestyle + return result + } + } + + assert.equal(tokens[end].type, 'key') + end-- + } + + // ' "key" : "value" ,' + // skipping key ^^^^^ + while(is_whitespace(tokens[end].type)) { + if (end < begin) return result + if (tokens[end].type === 'whitespace') { + result.prefix.unshift(tokens[end]) + } else if (tokens[end].type === 'newline') { + result.newline.unshift(tokens[end]) + return result + } else { + // comment or other unrecognized codestyle + return result + } + end-- + } + + return result +} + +function Document(text, options) { + var self = Object.create(Document.prototype) + + if (options == null) options = {} + //options._structure = true + var tokens = self._tokens = tokenize(text, options) + self._data = tokens.data + tokens.data = null + self._options = options + + var stats = analyze(text, options) + if (options.indent == null) { + options.indent = stats.indent + } + if (options.quote == null) { + options.quote = stats.quote + } + if (options.quote_keys == null) { + options.quote_keys = stats.quote_keys + } + if (options.no_trailing_comma == null) { + options.no_trailing_comma = !stats.has_trailing_comma + } + return self +} + +// return true if it's a proper object +// throw otherwise +function check_if_can_be_placed(key, object, is_unset) { + //if (object == null) return false + function error(add) { + return Error("You can't " + (is_unset ? 'unset' : 'set') + " key '" + key + "'" + add) + } + + if (!isObject(object)) { + throw error(' of an non-object') + } + if (Array.isArray(object)) { + // array, check boundary + if (String(key).match(/^\d+$/)) { + key = Number(String(key)) + if (object.length < key || (is_unset && object.length === key)) { + throw error(', out of bounds') + } else if (is_unset && object.length !== key+1) { + throw error(' in the middle of an array') + } else { + return true + } + } else { + throw error(' of an array') + } + } else { + // object + return true + } +} + +// usage: document.set('path.to.something', 'value') +// or: document.set(['path','to','something'], 'value') +Document.prototype.set = function(path, value) { + path = arg_to_path(path) + + // updating this._data and check for errors + if (path.length === 0) { + if (value === undefined) throw Error("can't remove root document") + this._data = value + var new_key = false + + } else { + var data = this._data + + for (var i=0; i {x:1}` + // removing sep, literal and optional sep + // ':' + var pos2 = find_last_non_ws_token(this._tokens, pos_old[0], position[0] - 1) + assert.equal(this._tokens[pos2].type, 'separator') + assert.equal(this._tokens[pos2].raw, ':') + position[0] = pos2 + + // key + var pos2 = find_last_non_ws_token(this._tokens, pos_old[0], position[0] - 1) + assert.equal(this._tokens[pos2].type, 'key') + assert.equal(this._tokens[pos2].value, path[path.length-1]) + position[0] = pos2 + } + + // removing comma in arrays and objects + var pos2 = find_last_non_ws_token(this._tokens, pos_old[0], position[0] - 1) + assert.equal(this._tokens[pos2].type, 'separator') + if (this._tokens[pos2].raw === ',') { + position[0] = pos2 + } else { + // beginning of the array/object, so we should remove trailing comma instead + pos2 = find_first_non_ws_token(this._tokens, position[1] + 1, pos_old[1]) + assert.equal(this._tokens[pos2].type, 'separator') + if (this._tokens[pos2].raw === ',') { + position[1] = pos2 + } + } + + } else { + var indent = pos2 !== false + ? detect_indent_style(this._tokens, Array.isArray(data), pos_old[0], position[1] - 1, i) + : {} + var newtokens = value_to_tokenlist(value, path, this._options, false, indent) + } + + } else { + // insert new key, that's tricky + var path_1 = path.slice(0, i) + + // find a last separator after which we're inserting it + var pos2 = find_last_non_ws_token(this._tokens, position[0] + 1, position[1] - 1) + assert(pos2 !== false) + + var indent = pos2 !== false + ? detect_indent_style(this._tokens, Array.isArray(data), position[0] + 1, pos2, i) + : {} + + var newtokens = value_to_tokenlist(value, path, this._options, false, indent) + + // adding leading whitespaces according to detected codestyle + var prefix = [] + if (indent.newline && indent.newline.length) + prefix = prefix.concat(indent.newline) + if (indent.prefix && indent.prefix.length) + prefix = prefix.concat(indent.prefix) + + // adding '"key":' (as in "key":"value") to object values + if (!Array.isArray(data)) { + prefix = prefix.concat(value_to_tokenlist(path[path.length-1], path_1, this._options, true)) + if (indent.sep1 && indent.sep1.length) + prefix = prefix.concat(indent.sep1) + prefix.push({raw: ':', type: 'separator', stack: path_1}) + if (indent.sep2 && indent.sep2.length) + prefix = prefix.concat(indent.sep2) + } + + newtokens.unshift.apply(newtokens, prefix) + + // check if prev token is a separator AND they're at the same level + if (this._tokens[pos2].type === 'separator' && this._tokens[pos2].stack.length === path.length-1) { + // previous token is either , or [ or { + if (this._tokens[pos2].raw === ',') { + // restore ending comma + newtokens.push({raw: ',', type: 'separator', stack: path_1}) + } + } else { + // previous token isn't a separator, so need to insert one + newtokens.unshift({raw: ',', type: 'separator', stack: path_1}) + } + + if (indent.suffix && indent.suffix.length) + newtokens.push.apply(newtokens, indent.suffix) + + assert.equal(this._tokens[position[1]].type, 'separator') + position[0] = pos2+1 + position[1] = pos2 + } + + newtokens.unshift(position[1] - position[0] + 1) + newtokens.unshift(position[0]) + this._tokens.splice.apply(this._tokens, newtokens) + + return this +} + +// convenience method +Document.prototype.unset = function(path) { + return this.set(path, undefined) +} + +Document.prototype.get = function(path) { + path = arg_to_path(path) + + var data = this._data + for (var i=0; i old_data.length) { + // adding new elements, so going forward + for (var i=0; i=0; i--) { + path.push(String(i)) + change(path, old_data[i], new_data[i]) + path.pop() + } + } + + } else { + // both values are objects here + for (var i in new_data) { + path.push(String(i)) + change(path, old_data[i], new_data[i]) + path.pop() + } + + for (var i in old_data) { + if (i in new_data) continue + path.push(String(i)) + change(path, old_data[i], new_data[i]) + path.pop() + } + } + } +} + +Document.prototype.toString = function() { + return this._tokens.map(function(x) { + return x.raw + }).join('') +} + +module.exports.Document = Document + +module.exports.update = function updateJSON(source, new_value, options) { + return Document(source, options).update(new_value).toString() +} + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/parse.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/parse.js new file mode 100644 index 00000000..0c9fbe68 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/parse.js @@ -0,0 +1,765 @@ +/* + * Author: Alex Kocharin + * GIT: https://github.com/rlidwka/jju + * License: WTFPL, grab your copy here: http://www.wtfpl.net/txt/copying/ + */ + +// RTFM: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf + +var Uni = require('./unicode') + +function isHexDigit(x) { + return (x >= '0' && x <= '9') + || (x >= 'A' && x <= 'F') + || (x >= 'a' && x <= 'f') +} + +function isOctDigit(x) { + return x >= '0' && x <= '7' +} + +function isDecDigit(x) { + return x >= '0' && x <= '9' +} + +var unescapeMap = { + '\'': '\'', + '"' : '"', + '\\': '\\', + 'b' : '\b', + 'f' : '\f', + 'n' : '\n', + 'r' : '\r', + 't' : '\t', + 'v' : '\v', + '/' : '/', +} + +function formatError(input, msg, position, lineno, column, json5) { + var result = msg + ' at ' + (lineno + 1) + ':' + (column + 1) + , tmppos = position - column - 1 + , srcline = '' + , underline = '' + + var isLineTerminator = json5 ? Uni.isLineTerminator : Uni.isLineTerminatorJSON + + // output no more than 70 characters before the wrong ones + if (tmppos < position - 70) { + tmppos = position - 70 + } + + while (1) { + var chr = input[++tmppos] + + if (isLineTerminator(chr) || tmppos === input.length) { + if (position >= tmppos) { + // ending line error, so show it after the last char + underline += '^' + } + break + } + srcline += chr + + if (position === tmppos) { + underline += '^' + } else if (position > tmppos) { + underline += input[tmppos] === '\t' ? '\t' : ' ' + } + + // output no more than 78 characters on the string + if (srcline.length > 78) break + } + + return result + '\n' + srcline + '\n' + underline +} + +function parse(input, options) { + // parse as a standard JSON mode + var json5 = false; + var cjson = false; + + if (options.legacy || options.mode === 'json') { + // use json + } else if (options.mode === 'cjson') { + cjson = true; + } else if (options.mode === 'json5') { + json5 = true; + } else { + // use it by default + json5 = true; + } + + var isLineTerminator = json5 ? Uni.isLineTerminator : Uni.isLineTerminatorJSON + var isWhiteSpace = json5 ? Uni.isWhiteSpace : Uni.isWhiteSpaceJSON + + var length = input.length + , lineno = 0 + , linestart = 0 + , position = 0 + , stack = [] + + var tokenStart = function() {} + var tokenEnd = function(v) {return v} + + /* tokenize({ + raw: '...', + type: 'whitespace'|'comment'|'key'|'literal'|'separator'|'newline', + value: 'number'|'string'|'whatever', + path: [...], + }) + */ + if (options._tokenize) { + ;(function() { + var start = null + tokenStart = function() { + if (start !== null) throw Error('internal error, token overlap') + start = position + } + + tokenEnd = function(v, type) { + if (start != position) { + var hash = { + raw: input.substr(start, position-start), + type: type, + stack: stack.slice(0), + } + if (v !== undefined) hash.value = v + options._tokenize.call(null, hash) + } + start = null + return v + } + })() + } + + function fail(msg) { + var column = position - linestart + + if (!msg) { + if (position < length) { + var token = '\'' + + JSON + .stringify(input[position]) + .replace(/^"|"$/g, '') + .replace(/'/g, "\\'") + .replace(/\\"/g, '"') + + '\'' + + if (!msg) msg = 'Unexpected token ' + token + } else { + if (!msg) msg = 'Unexpected end of input' + } + } + + var error = SyntaxError(formatError(input, msg, position, lineno, column, json5)) + error.row = lineno + 1 + error.column = column + 1 + throw error + } + + function newline(chr) { + // account for + if (chr === '\r' && input[position] === '\n') position++ + linestart = position + lineno++ + } + + function parseGeneric() { + var result + + while (position < length) { + tokenStart() + var chr = input[position++] + + if (chr === '"' || (chr === '\'' && json5)) { + return tokenEnd(parseString(chr), 'literal') + + } else if (chr === '{') { + tokenEnd(undefined, 'separator') + return parseObject() + + } else if (chr === '[') { + tokenEnd(undefined, 'separator') + return parseArray() + + } else if (chr === '-' + || chr === '.' + || isDecDigit(chr) + // + number Infinity NaN + || (json5 && (chr === '+' || chr === 'I' || chr === 'N')) + ) { + return tokenEnd(parseNumber(), 'literal') + + } else if (chr === 'n') { + parseKeyword('null') + return tokenEnd(null, 'literal') + + } else if (chr === 't') { + parseKeyword('true') + return tokenEnd(true, 'literal') + + } else if (chr === 'f') { + parseKeyword('false') + return tokenEnd(false, 'literal') + + } else { + position-- + return tokenEnd(undefined) + } + } + } + + function parseKey() { + var result + + while (position < length) { + tokenStart() + var chr = input[position++] + + if (chr === '"' || (chr === '\'' && json5)) { + return tokenEnd(parseString(chr), 'key') + + } else if (chr === '{') { + tokenEnd(undefined, 'separator') + return parseObject() + + } else if (chr === '[') { + tokenEnd(undefined, 'separator') + return parseArray() + + } else if (chr === '.' + || isDecDigit(chr) + ) { + return tokenEnd(parseNumber(true), 'key') + + } else if (json5 + && Uni.isIdentifierStart(chr) || (chr === '\\' && input[position] === 'u')) { + // unicode char or a unicode sequence + var rollback = position - 1 + var result = parseIdentifier() + + if (result === undefined) { + position = rollback + return tokenEnd(undefined) + } else { + return tokenEnd(result, 'key') + } + + } else { + position-- + return tokenEnd(undefined) + } + } + } + + function skipWhiteSpace() { + tokenStart() + while (position < length) { + var chr = input[position++] + + if (isLineTerminator(chr)) { + position-- + tokenEnd(undefined, 'whitespace') + tokenStart() + position++ + newline(chr) + tokenEnd(undefined, 'newline') + tokenStart() + + } else if (isWhiteSpace(chr)) { + // nothing + + } else if (chr === '/' + && (json5 || cjson) + && (input[position] === '/' || input[position] === '*') + ) { + position-- + tokenEnd(undefined, 'whitespace') + tokenStart() + position++ + skipComment(input[position++] === '*') + tokenEnd(undefined, 'comment') + tokenStart() + + } else { + position-- + break + } + } + return tokenEnd(undefined, 'whitespace') + } + + function skipComment(multi) { + while (position < length) { + var chr = input[position++] + + if (isLineTerminator(chr)) { + // LineTerminator is an end of singleline comment + if (!multi) { + // let parent function deal with newline + position-- + return + } + + newline(chr) + + } else if (chr === '*' && multi) { + // end of multiline comment + if (input[position] === '/') { + position++ + return + } + + } else { + // nothing + } + } + + if (multi) { + fail('Unclosed multiline comment') + } + } + + function parseKeyword(keyword) { + // keyword[0] is not checked because it should've checked earlier + var _pos = position + var len = keyword.length + for (var i=1; i= length || keyword[i] != input[position]) { + position = _pos-1 + fail() + } + position++ + } + } + + function parseObject() { + var result = options.null_prototype ? Object.create(null) : {} + , empty_object = {} + , is_non_empty = false + + while (position < length) { + skipWhiteSpace() + var item1 = parseKey() + skipWhiteSpace() + tokenStart() + var chr = input[position++] + tokenEnd(undefined, 'separator') + + if (chr === '}' && item1 === undefined) { + if (!json5 && is_non_empty) { + position-- + fail('Trailing comma in object') + } + return result + + } else if (chr === ':' && item1 !== undefined) { + skipWhiteSpace() + stack.push(item1) + var item2 = parseGeneric() + stack.pop() + + if (item2 === undefined) fail('No value found for key ' + item1) + if (typeof(item1) !== 'string') { + if (!json5 || typeof(item1) !== 'number') { + fail('Wrong key type: ' + item1) + } + } + + if ((item1 in empty_object || empty_object[item1] != null) && options.reserved_keys !== 'replace') { + if (options.reserved_keys === 'throw') { + fail('Reserved key: ' + item1) + } else { + // silently ignore it + } + } else { + if (typeof(options.reviver) === 'function') { + item2 = options.reviver.call(null, item1, item2) + } + + if (item2 !== undefined) { + is_non_empty = true + Object.defineProperty(result, item1, { + value: item2, + enumerable: true, + configurable: true, + writable: true, + }) + } + } + + skipWhiteSpace() + + tokenStart() + var chr = input[position++] + tokenEnd(undefined, 'separator') + + if (chr === ',') { + continue + + } else if (chr === '}') { + return result + + } else { + fail() + } + + } else { + position-- + fail() + } + } + + fail() + } + + function parseArray() { + var result = [] + + while (position < length) { + skipWhiteSpace() + stack.push(result.length) + var item = parseGeneric() + stack.pop() + skipWhiteSpace() + tokenStart() + var chr = input[position++] + tokenEnd(undefined, 'separator') + + if (item !== undefined) { + if (typeof(options.reviver) === 'function') { + item = options.reviver.call(null, String(result.length), item) + } + if (item === undefined) { + result.length++ + item = true // hack for check below, not included into result + } else { + result.push(item) + } + } + + if (chr === ',') { + if (item === undefined) { + fail('Elisions are not supported') + } + + } else if (chr === ']') { + if (!json5 && item === undefined && result.length) { + position-- + fail('Trailing comma in array') + } + return result + + } else { + position-- + fail() + } + } + } + + function parseNumber() { + // rewind because we don't know first char + position-- + + var start = position + , chr = input[position++] + , t + + var to_num = function(is_octal) { + var str = input.substr(start, position - start) + + if (is_octal) { + var result = parseInt(str.replace(/^0o?/, ''), 8) + } else { + var result = Number(str) + } + + if (Number.isNaN(result)) { + position-- + fail('Bad numeric literal - "' + input.substr(start, position - start + 1) + '"') + } else if (!json5 && !str.match(/^-?(0|[1-9][0-9]*)(\.[0-9]+)?(e[+-]?[0-9]+)?$/i)) { + // additional restrictions imposed by json + position-- + fail('Non-json numeric literal - "' + input.substr(start, position - start + 1) + '"') + } else { + return result + } + } + + // ex: -5982475.249875e+29384 + // ^ skipping this + if (chr === '-' || (chr === '+' && json5)) chr = input[position++] + + if (chr === 'N' && json5) { + parseKeyword('NaN') + return NaN + } + + if (chr === 'I' && json5) { + parseKeyword('Infinity') + + // returning +inf or -inf + return to_num() + } + + if (chr >= '1' && chr <= '9') { + // ex: -5982475.249875e+29384 + // ^^^ skipping these + while (position < length && isDecDigit(input[position])) position++ + chr = input[position++] + } + + // special case for leading zero: 0.123456 + if (chr === '0') { + chr = input[position++] + + // new syntax, "0o777" old syntax, "0777" + var is_octal = chr === 'o' || chr === 'O' || isOctDigit(chr) + var is_hex = chr === 'x' || chr === 'X' + + if (json5 && (is_octal || is_hex)) { + while (position < length + && (is_hex ? isHexDigit : isOctDigit)( input[position] ) + ) position++ + + var sign = 1 + if (input[start] === '-') { + sign = -1 + start++ + } else if (input[start] === '+') { + start++ + } + + return sign * to_num(is_octal) + } + } + + if (chr === '.') { + // ex: -5982475.249875e+29384 + // ^^^ skipping these + while (position < length && isDecDigit(input[position])) position++ + chr = input[position++] + } + + if (chr === 'e' || chr === 'E') { + chr = input[position++] + if (chr === '-' || chr === '+') position++ + // ex: -5982475.249875e+29384 + // ^^^ skipping these + while (position < length && isDecDigit(input[position])) position++ + chr = input[position++] + } + + // we have char in the buffer, so count for it + position-- + return to_num() + } + + function parseIdentifier() { + // rewind because we don't know first char + position-- + + var result = '' + + while (position < length) { + var chr = input[position++] + + if (chr === '\\' + && input[position] === 'u' + && isHexDigit(input[position+1]) + && isHexDigit(input[position+2]) + && isHexDigit(input[position+3]) + && isHexDigit(input[position+4]) + ) { + // UnicodeEscapeSequence + chr = String.fromCharCode(parseInt(input.substr(position+1, 4), 16)) + position += 5 + } + + if (result.length) { + // identifier started + if (Uni.isIdentifierPart(chr)) { + result += chr + } else { + position-- + return result + } + + } else { + if (Uni.isIdentifierStart(chr)) { + result += chr + } else { + return undefined + } + } + } + + fail() + } + + function parseString(endChar) { + // 7.8.4 of ES262 spec + var result = '' + + while (position < length) { + var chr = input[position++] + + if (chr === endChar) { + return result + + } else if (chr === '\\') { + if (position >= length) fail() + chr = input[position++] + + if (unescapeMap[chr] && (json5 || (chr != 'v' && chr != "'"))) { + result += unescapeMap[chr] + + } else if (json5 && isLineTerminator(chr)) { + // line continuation + newline(chr) + + } else if (chr === 'u' || (chr === 'x' && json5)) { + // unicode/character escape sequence + var off = chr === 'u' ? 4 : 2 + + // validation for \uXXXX + for (var i=0; i= length) fail() + if (!isHexDigit(input[position])) fail('Bad escape sequence') + position++ + } + + result += String.fromCharCode(parseInt(input.substr(position-off, off), 16)) + } else if (json5 && isOctDigit(chr)) { + if (chr < '4' && isOctDigit(input[position]) && isOctDigit(input[position+1])) { + // three-digit octal + var digits = 3 + } else if (isOctDigit(input[position])) { + // two-digit octal + var digits = 2 + } else { + var digits = 1 + } + position += digits - 1 + result += String.fromCharCode(parseInt(input.substr(position-digits, digits), 8)) + /*if (!isOctDigit(input[position])) { + // \0 is allowed still + result += '\0' + } else { + fail('Octal literals are not supported') + }*/ + + } else if (json5) { + // \X -> x + result += chr + + } else { + position-- + fail() + } + + } else if (isLineTerminator(chr)) { + fail() + + } else { + if (!json5 && chr.charCodeAt(0) < 32) { + position-- + fail('Unexpected control character') + } + + // SourceCharacter but not one of " or \ or LineTerminator + result += chr + } + } + + fail() + } + + skipWhiteSpace() + var return_value = parseGeneric() + if (return_value !== undefined || position < length) { + skipWhiteSpace() + + if (position >= length) { + if (typeof(options.reviver) === 'function') { + return_value = options.reviver.call(null, '', return_value) + } + return return_value + } else { + fail() + } + + } else { + if (position) { + fail('No data, only a whitespace') + } else { + fail('No data, empty input') + } + } +} + +/* + * parse(text, options) + * or + * parse(text, reviver) + * + * where: + * text - string + * options - object + * reviver - function + */ +module.exports.parse = function parseJSON(input, options) { + // support legacy functions + if (typeof(options) === 'function') { + options = { + reviver: options + } + } + + if (input === undefined) { + // parse(stringify(x)) should be equal x + // with JSON functions it is not 'cause of undefined + // so we're fixing it + return undefined + } + + // JSON.parse compat + if (typeof(input) !== 'string') input = String(input) + if (options == null) options = {} + if (options.reserved_keys == null) options.reserved_keys = 'ignore' + + if (options.reserved_keys === 'throw' || options.reserved_keys === 'ignore') { + if (options.null_prototype == null) { + options.null_prototype = true + } + } + + try { + return parse(input, options) + } catch(err) { + // jju is a recursive parser, so JSON.parse("{{{{{{{") could blow up the stack + // + // this catch is used to skip all those internal calls + if (err instanceof SyntaxError && err.row != null && err.column != null) { + var old_err = err + err = SyntaxError(old_err.message) + err.column = old_err.column + err.row = old_err.row + } + throw err + } +} + +module.exports.tokenize = function tokenizeJSON(input, options) { + if (options == null) options = {} + + options._tokenize = function(smth) { + if (options._addstack) smth.stack.unshift.apply(smth.stack, options._addstack) + tokens.push(smth) + } + + var tokens = [] + tokens.data = module.exports.parse(input, options) + return tokens +} + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/stringify.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/stringify.js new file mode 100644 index 00000000..232229ec --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/stringify.js @@ -0,0 +1,383 @@ +/* + * Author: Alex Kocharin + * GIT: https://github.com/rlidwka/jju + * License: WTFPL, grab your copy here: http://www.wtfpl.net/txt/copying/ + */ + +var Uni = require('./unicode') + +// Fix Function#name on browsers that do not support it (IE) +// http://stackoverflow.com/questions/6903762/function-name-not-supported-in-ie +if (!(function f(){}).name) { + Object.defineProperty((function(){}).constructor.prototype, 'name', { + get: function() { + var name = this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1] + // For better performance only parse once, and then cache the + // result through a new accessor for repeated access. + Object.defineProperty(this, 'name', { value: name }) + return name + } + }) +} + +var special_chars = { + 0: '\\0', // this is not an octal literal + 8: '\\b', + 9: '\\t', + 10: '\\n', + 11: '\\v', + 12: '\\f', + 13: '\\r', + 92: '\\\\', +} + +// for oddballs +var hasOwnProperty = Object.prototype.hasOwnProperty + +// some people escape those, so I'd copy this to be safe +var escapable = /[\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/ + +function _stringify(object, options, recursiveLvl, currentKey) { + var json5 = (options.mode === 'json5' || !options.mode) + /* + * Opinionated decision warning: + * + * Objects are serialized in the following form: + * { type: 'Class', data: DATA } + * + * Class is supposed to be a function, and new Class(DATA) is + * supposed to be equivalent to the original value + */ + /*function custom_type() { + return stringify({ + type: object.constructor.name, + data: object.toString() + }) + }*/ + + // if add, it's an internal indentation, so we add 1 level and a eol + // if !add, it's an ending indentation, so we just indent + function indent(str, add) { + var prefix = options._prefix ? options._prefix : '' + if (!options.indent) return prefix + str + var result = '' + var count = recursiveLvl + (add || 0) + for (var i=0; i 0) { + if (!Uni.isIdentifierPart(key[i])) + return _stringify_str(key) + + } else { + if (!Uni.isIdentifierStart(key[i])) + return _stringify_str(key) + } + + var chr = key.charCodeAt(i) + + if (options.ascii) { + if (chr < 0x80) { + result += key[i] + + } else { + result += '\\u' + ('0000' + chr.toString(16)).slice(-4) + } + + } else { + if (escapable.exec(key[i])) { + result += '\\u' + ('0000' + chr.toString(16)).slice(-4) + + } else { + result += key[i] + } + } + } + + return result + } + + function _stringify_str(key) { + var quote = options.quote + var quoteChr = quote.charCodeAt(0) + + var result = '' + for (var i=0; i= 8 && chr <= 13 && (json5 || chr !== 11)) { + result += special_chars[chr] + } else if (json5) { + result += '\\x0' + chr.toString(16) + } else { + result += '\\u000' + chr.toString(16) + } + + } else if (chr < 0x20) { + if (json5) { + result += '\\x' + chr.toString(16) + } else { + result += '\\u00' + chr.toString(16) + } + + } else if (chr >= 0x20 && chr < 0x80) { + // ascii range + if (chr === 47 && i && key[i-1] === '<') { + // escaping slashes in + result += '\\' + key[i] + + } else if (chr === 92) { + result += '\\\\' + + } else if (chr === quoteChr) { + result += '\\' + quote + + } else { + result += key[i] + } + + } else if (options.ascii || Uni.isLineTerminator(key[i]) || escapable.exec(key[i])) { + if (chr < 0x100) { + if (json5) { + result += '\\x' + chr.toString(16) + } else { + result += '\\u00' + chr.toString(16) + } + + } else if (chr < 0x1000) { + result += '\\u0' + chr.toString(16) + + } else if (chr < 0x10000) { + result += '\\u' + chr.toString(16) + + } else { + throw Error('weird codepoint') + } + } else { + result += key[i] + } + } + return quote + result + quote + } + + function _stringify_object() { + if (object === null) return 'null' + var result = [] + , len = 0 + , braces + + if (Array.isArray(object)) { + braces = '[]' + for (var i=0; i options._splitMax - recursiveLvl * options.indent.length || len > options._splitMin) ) { + // remove trailing comma in multiline if asked to + if (options.no_trailing_comma && result.length) { + result[result.length-1] = result[result.length-1].substring(0, result[result.length-1].length-1) + } + + var innerStuff = result.map(function(x) {return indent(x, 1)}).join('') + return braces[0] + + (options.indent ? '\n' : '') + + innerStuff + + indent(braces[1]) + } else { + // always remove trailing comma in one-lined arrays + if (result.length) { + result[result.length-1] = result[result.length-1].substring(0, result[result.length-1].length-1) + } + + var innerStuff = result.join(options.indent ? ' ' : '') + return braces[0] + + innerStuff + + braces[1] + } + } + + function _stringify_nonobject(object) { + if (typeof(options.replacer) === 'function') { + object = options.replacer.call(null, currentKey, object) + } + + switch(typeof(object)) { + case 'string': + return _stringify_str(object) + + case 'number': + if (object === 0 && 1/object < 0) { + // Opinionated decision warning: + // + // I want cross-platform negative zero in all js engines + // I know they're equal, but why lose that tiny bit of + // information needlessly? + return '-0' + } + if (!json5 && !Number.isFinite(object)) { + // json don't support infinity (= sucks) + return 'null' + } + return object.toString() + + case 'boolean': + return object.toString() + + case 'undefined': + return undefined + + case 'function': +// return custom_type() + + default: + // fallback for something weird + return JSON.stringify(object) + } + } + + if (options._stringify_key) { + return _stringify_key(object) + } + + if (typeof(object) === 'object') { + if (object === null) return 'null' + + var str + if (typeof(str = object.toJSON5) === 'function' && options.mode !== 'json') { + object = str.call(object, currentKey) + + } else if (typeof(str = object.toJSON) === 'function') { + object = str.call(object, currentKey) + } + + if (object === null) return 'null' + if (typeof(object) !== 'object') return _stringify_nonobject(object) + + if (object.constructor === Number || object.constructor === Boolean || object.constructor === String) { + object = object.valueOf() + return _stringify_nonobject(object) + + } else if (object.constructor === Date) { + // only until we can't do better + return _stringify_nonobject(object.toISOString()) + + } else { + if (typeof(options.replacer) === 'function') { + object = options.replacer.call(null, currentKey, object) + if (typeof(object) !== 'object') return _stringify_nonobject(object) + } + + return _stringify_object(object) + } + } else { + return _stringify_nonobject(object) + } +} + +/* + * stringify(value, options) + * or + * stringify(value, replacer, space) + * + * where: + * value - anything + * options - object + * replacer - function or array + * space - boolean or number or string + */ +module.exports.stringify = function stringifyJSON(object, options, _space) { + // support legacy syntax + if (typeof(options) === 'function' || Array.isArray(options)) { + options = { + replacer: options + } + } else if (typeof(options) === 'object' && options !== null) { + // nothing to do + } else { + options = {} + } + if (_space != null) options.indent = _space + + if (options.indent == null) options.indent = '\t' + if (options.quote == null) options.quote = "'" + if (options.ascii == null) options.ascii = false + if (options.mode == null) options.mode = 'json5' + + if (options.mode === 'json' || options.mode === 'cjson') { + // json only supports double quotes (= sucks) + options.quote = '"' + + // json don't support trailing commas (= sucks) + options.no_trailing_comma = true + + // json don't support unquoted property names (= sucks) + options.quote_keys = true + } + + // why would anyone use such objects? + if (typeof(options.indent) === 'object') { + if (options.indent.constructor === Number + || options.indent.constructor === Boolean + || options.indent.constructor === String) + options.indent = options.indent.valueOf() + } + + // gap is capped at 10 characters + if (typeof(options.indent) === 'number') { + if (options.indent >= 0) { + options.indent = Array(Math.min(~~options.indent, 10) + 1).join(' ') + } else { + options.indent = false + } + } else if (typeof(options.indent) === 'string') { + options.indent = options.indent.substr(0, 10) + } + + if (options._splitMin == null) options._splitMin = 50 + if (options._splitMax == null) options._splitMax = 70 + + return _stringify(object, options, 0, '') +} + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/unicode.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/unicode.js new file mode 100644 index 00000000..1a29143c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/unicode.js @@ -0,0 +1,71 @@ + +// This is autogenerated with esprima tools, see: +// https://github.com/ariya/esprima/blob/master/esprima.js +// +// PS: oh God, I hate Unicode + +// ECMAScript 5.1/Unicode v6.3.0 NonAsciiIdentifierStart: + +var Uni = module.exports + +module.exports.isWhiteSpace = function isWhiteSpace(x) { + // section 7.2, table 2 + return x === '\u0020' + || x === '\u00A0' + || x === '\uFEFF' // <-- this is not a Unicode WS, only a JS one + || (x >= '\u0009' && x <= '\u000D') // 9 A B C D + + // + whitespace characters from unicode, category Zs + || x === '\u1680' + || x === '\u180E' + || (x >= '\u2000' && x <= '\u200A') // 0 1 2 3 4 5 6 7 8 9 A + || x === '\u2028' + || x === '\u2029' + || x === '\u202F' + || x === '\u205F' + || x === '\u3000' +} + +module.exports.isWhiteSpaceJSON = function isWhiteSpaceJSON(x) { + return x === '\u0020' + || x === '\u0009' + || x === '\u000A' + || x === '\u000D' +} + +module.exports.isLineTerminator = function isLineTerminator(x) { + // ok, here is the part when JSON is wrong + // section 7.3, table 3 + return x === '\u000A' + || x === '\u000D' + || x === '\u2028' + || x === '\u2029' +} + +module.exports.isLineTerminatorJSON = function isLineTerminatorJSON(x) { + return x === '\u000A' + || x === '\u000D' +} + +module.exports.isIdentifierStart = function isIdentifierStart(x) { + return x === '$' + || x === '_' + || (x >= 'A' && x <= 'Z') + || (x >= 'a' && x <= 'z') + || (x >= '\u0080' && Uni.NonAsciiIdentifierStart.test(x)) +} + +module.exports.isIdentifierPart = function isIdentifierPart(x) { + return x === '$' + || x === '_' + || (x >= 'A' && x <= 'Z') + || (x >= 'a' && x <= 'z') + || (x >= '0' && x <= '9') // <-- addition to Start + || (x >= '\u0080' && Uni.NonAsciiIdentifierPart.test(x)) +} + +module.exports.NonAsciiIdentifierStart = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F0\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/ + +// ECMAScript 5.1/Unicode v6.3.0 NonAsciiIdentifierPart: + +module.exports.NonAsciiIdentifierPart = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0\u08A2-\u08AC\u08E4-\u08FE\u0900-\u0963\u0966-\u096F\u0971-\u0977\u0979-\u097F\u0981-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C82\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D02\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F0\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191C\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1D00-\u1DE6\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA697\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7B\uAA80-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE26\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/utils.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/utils.js new file mode 100644 index 00000000..a8476b6c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/utils.js @@ -0,0 +1,46 @@ +var FS = require('fs') +var jju = require('../') + +// this function registers json5 extension, so you +// can do `require("./config.json5")` kind of thing +module.exports.register = function() { + var r = require, e = 'extensions' + r[e]['.json5'] = function(m, f) { + /*eslint no-sync:0*/ + m.exports = jju.parse(FS.readFileSync(f, 'utf8')) + } +} + +// this function monkey-patches JSON.parse, so it +// will return an exact position of error in case +// of parse failure +module.exports.patch_JSON_parse = function() { + var _parse = JSON.parse + JSON.parse = function(text, rev) { + try { + return _parse(text, rev) + } catch(err) { + // this call should always throw + require('jju').parse(text, { + mode: 'json', + legacy: true, + reviver: rev, + reserved_keys: 'replace', + null_prototype: false, + }) + + // if it didn't throw, but original parser did, + // this is an error in this library and should be reported + throw err + } + } +} + +// this function is an express/connect middleware +// that accepts uploads in application/json5 format +module.exports.middleware = function() { + return function(req, res, next) { + throw Error('this function is removed, use express-json5 instead') + } +} + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/package.json new file mode 100644 index 00000000..1edba5ef --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/package.json @@ -0,0 +1,67 @@ +{ + "name": "jju", + "version": "1.3.0", + "description": "a set of utilities to work with JSON / JSON5 documents", + "author": { + "name": "Alex Kocharin", + "email": "alex@kocharin.ru" + }, + "repository": { + "type": "git", + "url": "git://github.com/rlidwka/jju.git" + }, + "bugs": { + "url": "https://github.com/rlidwka/jju/issues" + }, + "homepage": "http://rlidwka.github.io/jju/", + "devDependencies": { + "mocha": ">=1.21.0", + "js-yaml": ">=3.1.0", + "eslint": "~0.4.2" + }, + "scripts": { + "test": "mocha test/*.js", + "lint": "eslint -c ./.eslint.yaml ./lib" + }, + "keywords": [ + "json", + "json5", + "parser", + "serializer", + "data" + ], + "publishConfig": { + "registry": "https://registry.npmjs.org/" + }, + "license": { + "type": "WTFPL", + "url": "http://www.wtfpl.net/txt/copying/" + }, + "gitHead": "6a1248fc29abb3f418fa143e31ee548cd5a2477c", + "_id": "jju@1.3.0", + "_shasum": "dadd9ef01924bc728b03f2f7979bdbd62f7a2aaa", + "_from": "jju@>=1.1.0 <2.0.0", + "_npmVersion": "2.0.1", + "_nodeVersion": "2.2.1", + "_npmUser": { + "name": "rlidwka", + "email": "alex@kocharin.ru" + }, + "maintainers": [ + { + "name": "rlidwka", + "email": "alex@kocharin.ru" + } + ], + "dist": { + "shasum": "dadd9ef01924bc728b03f2f7979bdbd62f7a2aaa", + "tarball": "https://registry.npmjs.org/jju/-/jju-1.3.0.tgz" + }, + "_npmOperationalInternal": { + "host": "packages-6-west.internal.npmjs.com", + "tmp": "tmp/jju-1.3.0.tgz_1455989902144_0.8787874563131481" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/jju/-/jju-1.3.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/package.yaml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/package.yaml new file mode 100644 index 00000000..fdbb5372 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/package.yaml @@ -0,0 +1,46 @@ +# use "yapm install ." if you're installing this from git repository + +# "jju" stands for "json/json5 utils" +name: jju + +version: 1.3.0 +description: a set of utilities to work with JSON / JSON5 documents + +author: + name: Alex Kocharin + email: alex@kocharin.ru + +repository: + type: git + url: git://github.com/rlidwka/jju + +bugs: + url: https://github.com/rlidwka/jju/issues + +homepage: http://rlidwka.github.io/jju/ + +devDependencies: + mocha: '>=1.21.0' + js-yaml: '>=3.1.0' + + # linting tools + eslint: '~0.4.2' + +scripts: + test: 'mocha test/*.js' + lint: 'eslint -c ./.eslint.yaml ./lib' + +keywords: + - json + - json5 + - parser + - serializer + - data + +publishConfig: + registry: https://registry.npmjs.org/ + +license: + type: WTFPL + url: http://www.wtfpl.net/txt/copying/ + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/package.json new file mode 100644 index 00000000..3bfae8da --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/package.json @@ -0,0 +1,61 @@ +{ + "name": "json-parse-helpfulerror", + "version": "1.0.3", + "description": "A drop-in replacement for JSON.parse that uses `jju` to give helpful errors", + "main": "index.js", + "scripts": { + "test": "lab -c", + "lint": "jslint --edition=latest --terse *.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/smikes/json-parse-helpfulerror.git" + }, + "keywords": [ + "json", + "parse", + "line", + "doublequote", + "error" + ], + "author": { + "name": "Sam Mikes", + "email": "smikes@cubane.com" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/smikes/json-parse-helpfulerror/issues" + }, + "homepage": "https://github.com/smikes/json-parse-helpfulerror", + "devDependencies": { + "code": "^1.2.1", + "jslint": "^0.7.1", + "lab": "^5.1.1" + }, + "dependencies": { + "jju": "^1.1.0" + }, + "gitHead": "eedb116ec96b5c479be3919b526d6de0a521be5e", + "_id": "json-parse-helpfulerror@1.0.3", + "_shasum": "13f14ce02eed4e981297b64eb9e3b932e2dd13dc", + "_from": "json-parse-helpfulerror@>=1.0.2 <2.0.0", + "_npmVersion": "2.1.16", + "_nodeVersion": "0.10.35", + "_npmUser": { + "name": "smikes", + "email": "smikes@cubane.com" + }, + "maintainers": [ + { + "name": "smikes", + "email": "smikes@cubane.com" + } + ], + "dist": { + "shasum": "13f14ce02eed4e981297b64eb9e3b932e2dd13dc", + "tarball": "https://registry.npmjs.org/json-parse-helpfulerror/-/json-parse-helpfulerror-1.0.3.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/json-parse-helpfulerror/-/json-parse-helpfulerror-1.0.3.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/test/test.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/test/test.js new file mode 100644 index 00000000..fca458ac --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/test/test.js @@ -0,0 +1,32 @@ +var Code = require('code'), + Lab = require('lab'), + lab = Lab.script(), + jph = require('..'); // 'json-parse-helpfulerror' + +exports.lab = lab; + +lab.test('can parse', function (done) { + var o = jph.parse('{"foo": "bar"}'); + + Code.expect(o.foo).to.equal('bar'); + done(); +}); + +lab.test('helpful error for bad JSON', function (done) { + + var bad = "{'foo': 'bar'}"; + + Code.expect(function () { JSON.parse(bad) }).to.throw(); + + Code.expect(function () { jph.parse(bad) }).to.throw(SyntaxError, "Unexpected token '\\'' at 1:2\n" + bad + '\n ^'); + + done(); +}); + +lab.test('fails if reviver throws', function (done) { + function badReviver() { throw new ReferenceError('silly'); } + + Code.expect(function () { jph.parse('3', badReviver) }).to.throw(ReferenceError, 'silly'); + + done(); +}); \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/package.json new file mode 100644 index 00000000..a64f7b2b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/package.json @@ -0,0 +1,75 @@ +{ + "name": "read-package-json", + "version": "2.0.4", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "description": "The thing npm uses to read package.json files with semantics and defaults and validation", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/read-package-json.git" + }, + "main": "read-json.js", + "scripts": { + "test": "standard && tap test/*.js" + }, + "dependencies": { + "glob": "^6.0.0", + "json-parse-helpfulerror": "^1.0.2", + "normalize-package-data": "^2.0.0", + "graceful-fs": "^4.1.2" + }, + "devDependencies": { + "standard": "^5.3.1", + "tap": "^1.2.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.2" + }, + "license": "ISC", + "gitHead": "de5172a8ada18a2a906294216e22206bfa13321d", + "bugs": { + "url": "https://github.com/npm/read-package-json/issues" + }, + "homepage": "https://github.com/npm/read-package-json#readme", + "_id": "read-package-json@2.0.4", + "_shasum": "61ed1b2256ea438d8008895090be84b8e799c853", + "_from": "read-package-json@2.0.4", + "_npmVersion": "3.8.7", + "_nodeVersion": "5.6.0", + "_npmUser": { + "name": "zkat", + "email": "kat@sykosomatic.org" + }, + "dist": { + "shasum": "61ed1b2256ea438d8008895090be84b8e799c853", + "tarball": "https://registry.npmjs.org/read-package-json/-/read-package-json-2.0.4.tgz" + }, + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + }, + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" + } + ], + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/read-package-json-2.0.4.tgz_1461711438155_0.03128739935345948" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-2.0.4.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/read-json.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/read-json.js new file mode 100644 index 00000000..b1888956 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/read-json.js @@ -0,0 +1,394 @@ +var fs +try { + fs = require('graceful-fs') +} catch (er) { + fs = require('fs') +} + +var path = require('path') + +var glob = require('glob') +var normalizeData = require('normalize-package-data') +var safeJSON = require('json-parse-helpfulerror') + +module.exports = readJson + +// put more stuff on here to customize. +readJson.extraSet = [ + gypfile, + serverjs, + scriptpath, + authors, + readme, + mans, + bins, + githead +] + +var typoWarned = {} + +function readJson (file, log_, strict_, cb_) { + var log, strict, cb + for (var i = 1; i < arguments.length - 1; i++) { + if (typeof arguments[i] === 'boolean') { + strict = arguments[i] + } else if (typeof arguments[i] === 'function') { + log = arguments[i] + } + } + + if (!log) log = function () {} + cb = arguments[ arguments.length - 1 ] + + readJson_(file, log, strict, cb) +} + +function readJson_ (file, log, strict, cb) { + fs.readFile(file, 'utf8', function (er, d) { + parseJson(file, er, d, log, strict, cb) + }) +} + +function stripBOM (content) { + // Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) + // because the buffer-to-string conversion in `fs.readFileSync()` + // translates it to FEFF, the UTF-16 BOM. + if (content.charCodeAt(0) === 0xFEFF) content = content.slice(1) + return content +} + +function parseJson (file, er, d, log, strict, cb) { + if (er && er.code === 'ENOENT') { + return fs.stat(path.dirname(file), function (err, stat) { + if (!err && stat && !stat.isDirectory()) { + // ENOTDIR isn't used on Windows, but npm expects it. + er = Object.create(er) + er.code = 'ENOTDIR' + return cb(er) + } else { + return indexjs(file, er, log, strict, cb) + } + }) + } + if (er) return cb(er) + + try { + d = safeJSON.parse(stripBOM(d)) + } catch (er) { + d = parseIndex(d) + if (!d) return cb(parseError(er, file)) + } + + extras(file, d, log, strict, cb) +} + +function indexjs (file, er, log, strict, cb) { + if (path.basename(file) === 'index.js') return cb(er) + + var index = path.resolve(path.dirname(file), 'index.js') + fs.readFile(index, 'utf8', function (er2, d) { + if (er2) return cb(er) + + d = parseIndex(d) + if (!d) return cb(er) + + extras(file, d, log, strict, cb) + }) +} + +readJson.extras = extras +function extras (file, data, log_, strict_, cb_) { + var log, strict, cb + for (var i = 2; i < arguments.length - 1; i++) { + if (typeof arguments[i] === 'boolean') { + strict = arguments[i] + } else if (typeof arguments[i] === 'function') { + log = arguments[i] + } + } + + if (!log) log = function () {} + cb = arguments[i] + + var set = readJson.extraSet + var n = set.length + var errState = null + set.forEach(function (fn) { + fn(file, data, then) + }) + + function then (er) { + if (errState) return + if (er) return cb(errState = er) + if (--n > 0) return + final(file, data, log, strict, cb) + } +} + +function scriptpath (file, data, cb) { + if (!data.scripts) return cb(null, data) + var k = Object.keys(data.scripts) + k.forEach(scriptpath_, data.scripts) + cb(null, data) +} + +function scriptpath_ (key) { + var s = this[key] + // This is never allowed, and only causes problems + if (typeof s !== 'string') return delete this[key] + + var spre = /^(\.[\/\\])?node_modules[\/\\].bin[\\\/]/ + if (s.match(spre)) { + this[key] = this[key].replace(spre, '') + } +} + +function gypfile (file, data, cb) { + var dir = path.dirname(file) + var s = data.scripts || {} + if (s.install || s.preinstall) return cb(null, data) + + glob('*.gyp', { cwd: dir }, function (er, files) { + if (er) return cb(er) + gypfile_(file, data, files, cb) + }) +} + +function gypfile_ (file, data, files, cb) { + if (!files.length) return cb(null, data) + var s = data.scripts || {} + s.install = 'node-gyp rebuild' + data.scripts = s + data.gypfile = true + return cb(null, data) +} + +function serverjs (file, data, cb) { + var dir = path.dirname(file) + var s = data.scripts || {} + if (s.start) return cb(null, data) + glob('server.js', { cwd: dir }, function (er, files) { + if (er) return cb(er) + serverjs_(file, data, files, cb) + }) +} + +function serverjs_ (file, data, files, cb) { + if (!files.length) return cb(null, data) + var s = data.scripts || {} + s.start = 'node server.js' + data.scripts = s + return cb(null, data) +} + +function authors (file, data, cb) { + if (data.contributors) return cb(null, data) + var af = path.resolve(path.dirname(file), 'AUTHORS') + fs.readFile(af, 'utf8', function (er, ad) { + // ignore error. just checking it. + if (er) return cb(null, data) + authors_(file, data, ad, cb) + }) +} + +function authors_ (file, data, ad, cb) { + ad = ad.split(/\r?\n/g).map(function (line) { + return line.replace(/^\s*#.*$/, '').trim() + }).filter(function (line) { + return line + }) + data.contributors = ad + return cb(null, data) +} + +function readme (file, data, cb) { + if (data.readme) return cb(null, data) + var dir = path.dirname(file) + var globOpts = { cwd: dir, nocase: true, mark: true } + glob('{README,README.*}', globOpts, function (er, files) { + if (er) return cb(er) + // don't accept directories. + files = files.filter(function (file) { + return !file.match(/\/$/) + }) + if (!files.length) return cb() + var fn = preferMarkdownReadme(files) + var rm = path.resolve(dir, fn) + readme_(file, data, rm, cb) + }) +} + +function preferMarkdownReadme (files) { + var fallback = 0 + var re = /\.m?a?r?k?d?o?w?n?$/i + for (var i = 0; i < files.length; i++) { + if (files[i].match(re)) { + return files[i] + } else if (files[i].match(/README$/)) { + fallback = i + } + } + // prefer README.md, followed by README; otherwise, return + // the first filename (which could be README) + return files[fallback] +} + +function readme_ (file, data, rm, cb) { + var rmfn = path.basename(rm) + fs.readFile(rm, 'utf8', function (er, rm) { + // maybe not readable, or something. + if (er) return cb() + data.readme = rm + data.readmeFilename = rmfn + return cb(er, data) + }) +} + +function mans (file, data, cb) { + var m = data.directories && data.directories.man + if (data.man || !m) return cb(null, data) + m = path.resolve(path.dirname(file), m) + glob('**/*.[0-9]', { cwd: m }, function (er, mans) { + if (er) return cb(er) + mans_(file, data, mans, cb) + }) +} + +function mans_ (file, data, mans, cb) { + var m = data.directories && data.directories.man + data.man = mans.map(function (mf) { + return path.resolve(path.dirname(file), m, mf) + }) + return cb(null, data) +} + +function bins (file, data, cb) { + if (Array.isArray(data.bin)) return bins_(file, data, data.bin, cb) + + var m = data.directories && data.directories.bin + if (data.bin || !m) return cb(null, data) + + m = path.resolve(path.dirname(file), m) + glob('**', { cwd: m }, function (er, bins) { + if (er) return cb(er) + bins_(file, data, bins, cb) + }) +} + +function bins_ (file, data, bins, cb) { + var m = data.directories && data.directories.bin || '.' + data.bin = bins.reduce(function (acc, mf) { + if (mf && mf.charAt(0) !== '.') { + var f = path.basename(mf) + acc[f] = path.join(m, mf) + } + return acc + }, {}) + return cb(null, data) +} + +function githead (file, data, cb) { + if (data.gitHead) return cb(null, data) + var dir = path.dirname(file) + var head = path.resolve(dir, '.git/HEAD') + fs.readFile(head, 'utf8', function (er, head) { + if (er) return cb(null, data) + githead_(file, data, dir, head, cb) + }) +} + +function githead_ (file, data, dir, head, cb) { + if (!head.match(/^ref: /)) { + data.gitHead = head.trim() + return cb(null, data) + } + var headFile = head.replace(/^ref: /, '').trim() + headFile = path.resolve(dir, '.git', headFile) + fs.readFile(headFile, 'utf8', function (er, head) { + if (er || !head) return cb(null, data) + head = head.replace(/^ref: /, '').trim() + data.gitHead = head + return cb(null, data) + }) +} + +/** + * Warn if the bin references don't point to anything. This might be better in + * normalize-package-data if it had access to the file path. + */ +function checkBinReferences_ (file, data, warn, cb) { + if (!(data.bin instanceof Object)) return cb() + + var keys = Object.keys(data.bin) + var keysLeft = keys.length + if (!keysLeft) return cb() + + function handleExists (relName, result) { + keysLeft-- + if (!result) warn('No bin file found at ' + relName) + if (!keysLeft) cb() + } + + keys.forEach(function (key) { + var dirName = path.dirname(file) + var relName = data.bin[key] + var binPath = path.resolve(dirName, relName) + fs.exists(binPath, handleExists.bind(null, relName)) + }) +} + +function final (file, data, log, strict, cb) { + var pId = makePackageId(data) + + function warn (msg) { + if (typoWarned[pId]) return + if (log) log('package.json', pId, msg) + } + + try { + normalizeData(data, warn, strict) + } catch (error) { + return cb(error) + } + + checkBinReferences_(file, data, warn, function () { + typoWarned[pId] = true + cb(null, data) + }) +} + +function makePackageId (data) { + var name = cleanString(data.name) + var ver = cleanString(data.version) + return name + '@' + ver +} + +function cleanString (str) { + return (!str || typeof (str) !== 'string') ? '' : str.trim() +} + +// /**package { "name": "foo", "version": "1.2.3", ... } **/ +function parseIndex (data) { + data = data.split(/^\/\*\*package(?:\s|$)/m) + + if (data.length < 2) return null + data = data[1] + data = data.split(/\*\*\/$/m) + + if (data.length < 2) return null + data = data[0] + data = data.replace(/^\s*\*/mg, '') + + try { + return safeJSON.parse(data) + } catch (er) { + return null + } +} + +function parseError (ex, file) { + var e = new Error('Failed to parse json\n' + ex.message) + e.code = 'EJSONPARSE' + e.file = file + return e +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/basic.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/basic.js new file mode 100644 index 00000000..5996c8e4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/basic.js @@ -0,0 +1,46 @@ +var fs = require('fs') +var path = require('path') + +var tap = require('tap') + +var readJson = require('../') + +var readme = fs.readFileSync(path.resolve(__dirname, '../README.md'), 'utf8') +var pkg = require('../package.json') +var isGit +try { + fs.readFileSync(path.resolve(__dirname, '../.git/HEAD')) + isGit = true +} catch (e) { + isGit = false +} + +tap.test('basic test', function (t) { + var p = path.resolve(__dirname, '../package.json') + readJson(p, function (er, data) { + if (er) throw er + basic_(t, data) + }) +}) + +function basic_ (t, data) { + t.ok(data) + t.equal(data.version, pkg.version) + t.equal(data._id, data.name + '@' + data.version) + t.equal(data.name, pkg.name) + t.type(data.author, 'object') + t.equal(data.readme, readme) + t.deepEqual(data.scripts, pkg.scripts) + t.equal(data.main, pkg.main) + t.equal(data.readmeFilename, 'README.md') + + if (isGit) t.similar(data.gitHead, /^[a-f0-9]{40}$/) + + // optional deps are folded in. + t.deepEqual(data.optionalDependencies, pkg.optionalDependencies) + t.has(data.dependencies, pkg.optionalDependencies) + t.has(data.dependencies, pkg.dependencies) + + t.deepEqual(data.devDependencies, pkg.devDependencies) + t.end() +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/bin.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/bin.js new file mode 100644 index 00000000..3e0e0e9b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/bin.js @@ -0,0 +1,43 @@ +var path = require('path') + +var tap = require('tap') + +var readJson = require('../') + +var createWarningCollector = function () { + var warn = function (msg) { + warn.warnings.push(arguments) + } + warn.warnings = [] + return warn +} + +tap.test('Bin test', function (t) { + var p = path.resolve(__dirname, 'fixtures/bin.json') + var warn = createWarningCollector() + readJson(p, warn, function (er, data) { + t.equals(warn.warnings.length, 0) + t.deepEqual(data.bin, {'bin-test': './bin/echo'}) + t.end() + }) +}) + +tap.test('Bad bin test', function (t) { + var p = path.resolve(__dirname, 'fixtures/badbin.json') + var warn = createWarningCollector() + readJson(p, warn, function (er, data) { + t.equals(warn.warnings.length, 1) + t.equals(warn.warnings[0][2], 'No bin file found at ./bin/typo') + t.end() + }) +}) + +tap.test('Empty bin test', function (t) { + var p = path.resolve(__dirname, 'fixtures/emptybin.json') + var warn = createWarningCollector() + readJson(p, warn, function (er, data) { + t.equals(warn.warnings.length, 0) + t.same(data.bin, {}, 'no mapping to bin because object was empty') + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/bom.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/bom.js new file mode 100644 index 00000000..372a4f4a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/bom.js @@ -0,0 +1,16 @@ +var tap = require('tap') +var readJson = require('../') +var path = require('path') + +tap.test('BOM test', function (t) { + var p = path.resolve(__dirname, 'fixtures/bom.json') + readJson(p, function (er, data) { + if (er) throw er + p = path.resolve(__dirname, 'fixtures/nobom.json') + readJson(p, function (er, data2) { + if (er) throw er + t.deepEqual(data, data2) + t.end() + }) + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/fixtures/badbin.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/fixtures/badbin.json new file mode 100644 index 00000000..3eb58d9c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/fixtures/badbin.json @@ -0,0 +1,12 @@ +{ + "name": "badbin-test", + "description": "my desc", + "repository": { + "type": "git", + "url": "git://github.com/npm/read-package-json.git" + }, + "version": "0.0.1", + "readme": "hello world", + "bin": "./bin/typo", + "license": "ISC" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/fixtures/bin.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/fixtures/bin.json new file mode 100644 index 00000000..70a26eec --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/fixtures/bin.json @@ -0,0 +1,12 @@ +{ + "name": "bin-test", + "description": "my desc", + "repository": { + "type": "git", + "url": "git://github.com/npm/read-package-json.git" + }, + "version": "0.0.1", + "readme": "hello world", + "bin": "./bin/echo", + "license": "ISC" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/fixtures/bom.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/fixtures/bom.json new file mode 100644 index 00000000..1beddca2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/fixtures/bom.json @@ -0,0 +1,6 @@ +{ + "name": "this", + "description": "file", + "author": "has ", + "version" : "0.0.1" +} \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/fixtures/emptybin.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/fixtures/emptybin.json new file mode 100644 index 00000000..4fbf4007 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/fixtures/emptybin.json @@ -0,0 +1,12 @@ +{ + "name": "emptybin-test", + "description": "my desc", + "repository": { + "type": "git", + "url": "git://github.com/npm/read-package-json.git" + }, + "version": "0.0.1", + "readme": "hello world", + "bin": {}, + "license": "ISC" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/fixtures/erroneous.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/fixtures/erroneous.json new file mode 100644 index 00000000..212e37ec --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/fixtures/erroneous.json @@ -0,0 +1,4 @@ +{ + 'wrong': 'kind', + 'of': 'quotes' +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/fixtures/nobom.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/fixtures/nobom.json new file mode 100644 index 00000000..f0ea8978 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/fixtures/nobom.json @@ -0,0 +1,6 @@ +{ + "name": "this", + "description": "file", + "author": "has ", + "version" : "0.0.1" +} \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/fixtures/not-json.css b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/fixtures/not-json.css new file mode 100644 index 00000000..41c91e96 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/fixtures/not-json.css @@ -0,0 +1,37 @@ +body { + height: yo mama +} + +/**package +{ + "name": "read-package-json", + "version": "0.1.1", + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "description": "The thing npm uses to read package.json files with semantics and defaults and validation", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/read-package-json.git" + }, + "main": "read-json.js", + "scripts": { + "test": "./node_modules/.bin/tap test/*.js" + }, + "dependencies": { + "glob": "~3.1.9", + "lru-cache": "~1.1.0", + "semver": "~1.0.14", + "slide": "~1.1.3" + }, + "devDependencies": { + "tap": "~0.2.5" + }, + "optionalDependencies": { + "npmlog": "0", + "graceful-fs": "~1.1.8" + } +} +**/ + +html { + width: so fat +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/fixtures/readmes/README b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/fixtures/readmes/README new file mode 100644 index 00000000..257cc564 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/fixtures/readmes/README @@ -0,0 +1 @@ +foo diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/fixtures/readmes/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/fixtures/readmes/README.md new file mode 100644 index 00000000..e444c2f0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/fixtures/readmes/README.md @@ -0,0 +1 @@ +*markdown* diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/fixtures/readmes/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/fixtures/readmes/package.json new file mode 100644 index 00000000..b0c1a318 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/fixtures/readmes/package.json @@ -0,0 +1 @@ +{"name":"readmes", "version":"99.999.999999999"} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/fixtures/readmes/readmexxx.yz b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/fixtures/readmes/readmexxx.yz new file mode 100644 index 00000000..662da912 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/fixtures/readmes/readmexxx.yz @@ -0,0 +1 @@ +extra noise diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/helpful.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/helpful.js new file mode 100644 index 00000000..84f53136 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/helpful.js @@ -0,0 +1,20 @@ +var tap = require('tap') +var readJson = require('../') +var path = require('path') +var p = path.resolve(__dirname, 'fixtures/erroneous.json') + +tap.test('erroneous package data', function (t) { + readJson(p, function (er, data) { + t.ok(er instanceof Error) + t.ok(er.message.match(/Unexpected token '\\''/)) + t.end() + }) +}) + +tap.test('ENOTDIR for non-directory packages', function (t) { + readJson(path.resolve(__filename, 'package.json'), function (er, data) { + t.ok(er) + t.equal(er.code, 'ENOTDIR') + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/non-json.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/non-json.js new file mode 100644 index 00000000..85186320 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/non-json.js @@ -0,0 +1,83 @@ +var path = require('path') + +var tap = require('tap') + +var readJson = require('../') + +var expect = { + name: 'read-package-json', + version: '0.1.1', + author: { + name: 'Isaac Z. Schlueter', + email: 'i@izs.me', + url: 'http://blog.izs.me/' + }, + description: 'The thing npm uses to read package.json files with semantics and defaults and validation', + repository: { + type: 'git', + url: 'git://github.com/isaacs/read-package-json.git' + }, + bugs: { + url: 'https://github.com/isaacs/read-package-json/issues' + }, + main: 'read-json.js', + scripts: { test: 'tap test/*.js' }, + dependencies: { + glob: '~3.1.9', + 'lru-cache': '~1.1.0', + semver: '~1.0.14', + slide: '~1.1.3', + npmlog: '0', + 'graceful-fs': '~1.1.8' + }, + devDependencies: { tap: '~0.2.5' }, + homepage: 'https://github.com/isaacs/read-package-json#readme', + optionalDependencies: { npmlog: '0', 'graceful-fs': '~1.1.8' }, + _id: 'read-package-json@0.1.1', + readme: 'ERROR: No README data found!' +} + +tap.test('from css', function (t) { + var c = path.join(__dirname, 'fixtures', 'not-json.css') + readJson(c, function (er, d) { + t.same(d, expect) + t.end() + }) +}) + +tap.test('from js', function (t) { + readJson(__filename, function (er, d) { + t.same(d, expect) + t.end() + }) +}) + +/**package +{ + "name": "read-package-json", + "version": "0.1.1", + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "description": "The thing npm uses to read package.json files with semantics and defaults and validation", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/read-package-json.git" + }, + "main": "read-json.js", + "scripts": { + "test": "tap test/*.js" + }, + "dependencies": { + "glob": "~3.1.9", + "lru-cache": "~1.1.0", + "semver": "~1.0.14", + "slide": "~1.1.3" + }, + "devDependencies": { + "tap": "~0.2.5" + }, + "optionalDependencies": { + "npmlog": "0", + "graceful-fs": "~1.1.8" + } +} +**/ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/readmes.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/readmes.js new file mode 100644 index 00000000..bd891772 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read-package-json/test/readmes.js @@ -0,0 +1,27 @@ +var path = require('path') + +var tap = require('tap') +var p = path.resolve(__dirname, 'fixtures/readmes/package.json') + +var readJson = require('../') + +var expect = { + 'name': 'readmes', + 'version': '99.999.999999999', + 'readme': '*markdown*\n', + 'readmeFilename': 'README.md', + 'description': '*markdown*', + '_id': 'readmes@99.999.999999999' +} + +tap.test('readme test', function (t) { + readJson(p, function (er, data) { + t.ifError(er, 'read README without error') + test(t, data) + }) +}) + +function test (t, data) { + t.deepEqual(data, expect) + t.end() +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read/README.md new file mode 100644 index 00000000..5967fad1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read/README.md @@ -0,0 +1,53 @@ +## read + +For reading user input from stdin. + +Similar to the `readline` builtin's `question()` method, but with a +few more features. + +## USAGE + +```javascript +var read = require("read") +read(options, callback) +``` + +The callback gets called with either the user input, or the default +specified, or an error, as `callback(error, result, isDefault)` +node style. + +## OPTIONS + +Every option is optional. + +* `prompt` What to write to stdout before reading input. +* `silent` Don't echo the output as the user types it. +* `replace` Replace silenced characters with the supplied character value. +* `timeout` Number of ms to wait for user input before giving up. +* `default` The default value if the user enters nothing. +* `edit` Allow the user to edit the default value. +* `terminal` Treat the output as a TTY, whether it is or not. +* `input` Readable stream to get input data from. (default `process.stdin`) +* `output` Writeable stream to write prompts to. (default: `process.stdout`) + +If silent is true, and the input is a TTY, then read will set raw +mode, and read character by character. + +## COMPATIBILITY + +This module works sort of with node 0.6. It does not work with node +versions less than 0.6. It is best on node 0.8. + +On node version 0.6, it will remove all listeners on the input +stream's `data` and `keypress` events, because the readline module did +not fully clean up after itself in that version of node, and did not +make it possible to clean up after it in a way that has no potential +for side effects. + +Additionally, some of the readline options (like `terminal`) will not +function in versions of node before 0.8, because they were not +implemented in the builtin readline module. + +## CONTRIBUTING + +Patches welcome. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read/lib/read.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read/lib/read.js new file mode 100644 index 00000000..a93d1b3b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/read/lib/read.js @@ -0,0 +1,113 @@ + +module.exports = read + +var readline = require('readline') +var Mute = require('mute-stream') + +function read (opts, cb) { + if (opts.num) { + throw new Error('read() no longer accepts a char number limit') + } + + if (typeof opts.default !== 'undefined' && + typeof opts.default !== 'string' && + typeof opts.default !== 'number') { + throw new Error('default value must be string or number') + } + + var input = opts.input || process.stdin + var output = opts.output || process.stdout + var prompt = (opts.prompt || '').trim() + ' ' + var silent = opts.silent + var editDef = false + var timeout = opts.timeout + + var def = opts.default || '' + if (def) { + if (silent) { + prompt += '(
      new BufferList([ callback ]) + * bl.length + * bl.append(buffer) + * bl.get(index) + * bl.slice([ start[, end ] ]) + * bl.copy(dest, [ destStart, [ srcStart [, srcEnd ] ] ]) + * bl.duplicate() + * bl.consume(bytes) + * bl.toString([encoding, [ start, [ end ]]]) + * bl.readDoubleBE(), bl.readDoubleLE(), bl.readFloatBE(), bl.readFloatLE(), bl.readInt32BE(), bl.readInt32LE(), bl.readUInt32BE(), bl.readUInt32LE(), bl.readInt16BE(), bl.readInt16LE(), bl.readUInt16BE(), bl.readUInt16LE(), bl.readInt8(), bl.readUInt8() + * Streams + +-------------------------------------------------------- + +### new BufferList([ callback | Buffer | Buffer array | BufferList | BufferList array | String ]) +The constructor takes an optional callback, if supplied, the callback will be called with an error argument followed by a reference to the **bl** instance, when `bl.end()` is called (i.e. from a piped stream). This is a convenient method of collecting the entire contents of a stream, particularly when the stream is *chunky*, such as a network stream. + +Normally, no arguments are required for the constructor, but you can initialise the list by passing in a single `Buffer` object or an array of `Buffer` object. + +`new` is not strictly required, if you don't instantiate a new object, it will be done automatically for you so you can create a new instance simply with: + +```js +var bl = require('bl') +var myinstance = bl() + +// equivilant to: + +var BufferList = require('bl') +var myinstance = new BufferList() +``` + +-------------------------------------------------------- + +### bl.length +Get the length of the list in bytes. This is the sum of the lengths of all of the buffers contained in the list, minus any initial offset for a semi-consumed buffer at the beginning. Should accurately represent the total number of bytes that can be read from the list. + +-------------------------------------------------------- + +### bl.append(Buffer | Buffer array | BufferList | BufferList array | String) +`append(buffer)` adds an additional buffer or BufferList to the internal list. `this` is returned so it can be chained. + +-------------------------------------------------------- + +### bl.get(index) +`get()` will return the byte at the specified index. + +-------------------------------------------------------- + +### bl.slice([ start, [ end ] ]) +`slice()` returns a new `Buffer` object containing the bytes within the range specified. Both `start` and `end` are optional and will default to the beginning and end of the list respectively. + +If the requested range spans a single internal buffer then a slice of that buffer will be returned which shares the original memory range of that Buffer. If the range spans multiple buffers then copy operations will likely occur to give you a uniform Buffer. + +-------------------------------------------------------- + +### bl.copy(dest, [ destStart, [ srcStart [, srcEnd ] ] ]) +`copy()` copies the content of the list in the `dest` buffer, starting from `destStart` and containing the bytes within the range specified with `srcStart` to `srcEnd`. `destStart`, `start` and `end` are optional and will default to the beginning of the `dest` buffer, and the beginning and end of the list respectively. + +-------------------------------------------------------- + +### bl.duplicate() +`duplicate()` performs a **shallow-copy** of the list. The internal Buffers remains the same, so if you change the underlying Buffers, the change will be reflected in both the original and the duplicate. This method is needed if you want to call `consume()` or `pipe()` and still keep the original list.Example: + +```js +var bl = new BufferList() + +bl.append('hello') +bl.append(' world') +bl.append('\n') + +bl.duplicate().pipe(process.stdout, { end: false }) + +console.log(bl.toString()) +``` + +-------------------------------------------------------- + +### bl.consume(bytes) +`consume()` will shift bytes *off the start of the list*. The number of bytes consumed don't need to line up with the sizes of the internal Buffers—initial offsets will be calculated accordingly in order to give you a consistent view of the data. + +-------------------------------------------------------- + +### bl.toString([encoding, [ start, [ end ]]]) +`toString()` will return a string representation of the buffer. The optional `start` and `end` arguments are passed on to `slice()`, while the `encoding` is passed on to `toString()` of the resulting Buffer. See the [Buffer#toString()](http://nodejs.org/docs/latest/api/buffer.html#buffer_buf_tostring_encoding_start_end) documentation for more information. + +-------------------------------------------------------- + +### bl.readDoubleBE(), bl.readDoubleLE(), bl.readFloatBE(), bl.readFloatLE(), bl.readInt32BE(), bl.readInt32LE(), bl.readUInt32BE(), bl.readUInt32LE(), bl.readInt16BE(), bl.readInt16LE(), bl.readUInt16BE(), bl.readUInt16LE(), bl.readInt8(), bl.readUInt8() + +All of the standard byte-reading methods of the `Buffer` interface are implemented and will operate across internal Buffer boundaries transparently. + +See the [Buffer](http://nodejs.org/docs/latest/api/buffer.html) documentation for how these work. + +-------------------------------------------------------- + +### Streams +**bl** is a Node **[Duplex Stream](http://nodejs.org/docs/latest/api/stream.html#stream_class_stream_duplex)**, so it can be read from and written to like a standard Node stream. You can also `pipe()` to and from a **bl** instance. + +-------------------------------------------------------- + +## Contributors + +**bl** is brought to you by the following hackers: + + * [Rod Vagg](https://github.com/rvagg) + * [Matteo Collina](https://github.com/mcollina) + * [Jarett Cruger](https://github.com/jcrugzz) + +======= + + +## License & copyright + +Copyright (c) 2013-2014 bl contributors (listed above). + +bl is licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/bl.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/bl.js new file mode 100644 index 00000000..f585df17 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/bl.js @@ -0,0 +1,243 @@ +var DuplexStream = require('readable-stream/duplex') + , util = require('util') + + +function BufferList (callback) { + if (!(this instanceof BufferList)) + return new BufferList(callback) + + this._bufs = [] + this.length = 0 + + if (typeof callback == 'function') { + this._callback = callback + + var piper = function piper (err) { + if (this._callback) { + this._callback(err) + this._callback = null + } + }.bind(this) + + this.on('pipe', function onPipe (src) { + src.on('error', piper) + }) + this.on('unpipe', function onUnpipe (src) { + src.removeListener('error', piper) + }) + } else { + this.append(callback) + } + + DuplexStream.call(this) +} + + +util.inherits(BufferList, DuplexStream) + + +BufferList.prototype._offset = function _offset (offset) { + var tot = 0, i = 0, _t + for (; i < this._bufs.length; i++) { + _t = tot + this._bufs[i].length + if (offset < _t) + return [ i, offset - tot ] + tot = _t + } +} + + +BufferList.prototype.append = function append (buf) { + var i = 0 + , newBuf + + if (Array.isArray(buf)) { + for (; i < buf.length; i++) + this.append(buf[i]) + } else if (buf instanceof BufferList) { + // unwrap argument into individual BufferLists + for (; i < buf._bufs.length; i++) + this.append(buf._bufs[i]) + } else if (buf != null) { + // coerce number arguments to strings, since Buffer(number) does + // uninitialized memory allocation + if (typeof buf == 'number') + buf = buf.toString() + + newBuf = Buffer.isBuffer(buf) ? buf : new Buffer(buf) + this._bufs.push(newBuf) + this.length += newBuf.length + } + + return this +} + + +BufferList.prototype._write = function _write (buf, encoding, callback) { + this.append(buf) + + if (typeof callback == 'function') + callback() +} + + +BufferList.prototype._read = function _read (size) { + if (!this.length) + return this.push(null) + + size = Math.min(size, this.length) + this.push(this.slice(0, size)) + this.consume(size) +} + + +BufferList.prototype.end = function end (chunk) { + DuplexStream.prototype.end.call(this, chunk) + + if (this._callback) { + this._callback(null, this.slice()) + this._callback = null + } +} + + +BufferList.prototype.get = function get (index) { + return this.slice(index, index + 1)[0] +} + + +BufferList.prototype.slice = function slice (start, end) { + return this.copy(null, 0, start, end) +} + + +BufferList.prototype.copy = function copy (dst, dstStart, srcStart, srcEnd) { + if (typeof srcStart != 'number' || srcStart < 0) + srcStart = 0 + if (typeof srcEnd != 'number' || srcEnd > this.length) + srcEnd = this.length + if (srcStart >= this.length) + return dst || new Buffer(0) + if (srcEnd <= 0) + return dst || new Buffer(0) + + var copy = !!dst + , off = this._offset(srcStart) + , len = srcEnd - srcStart + , bytes = len + , bufoff = (copy && dstStart) || 0 + , start = off[1] + , l + , i + + // copy/slice everything + if (srcStart === 0 && srcEnd == this.length) { + if (!copy) // slice, just return a full concat + return Buffer.concat(this._bufs) + + // copy, need to copy individual buffers + for (i = 0; i < this._bufs.length; i++) { + this._bufs[i].copy(dst, bufoff) + bufoff += this._bufs[i].length + } + + return dst + } + + // easy, cheap case where it's a subset of one of the buffers + if (bytes <= this._bufs[off[0]].length - start) { + return copy + ? this._bufs[off[0]].copy(dst, dstStart, start, start + bytes) + : this._bufs[off[0]].slice(start, start + bytes) + } + + if (!copy) // a slice, we need something to copy in to + dst = new Buffer(len) + + for (i = off[0]; i < this._bufs.length; i++) { + l = this._bufs[i].length - start + + if (bytes > l) { + this._bufs[i].copy(dst, bufoff, start) + } else { + this._bufs[i].copy(dst, bufoff, start, start + bytes) + break + } + + bufoff += l + bytes -= l + + if (start) + start = 0 + } + + return dst +} + +BufferList.prototype.toString = function toString (encoding, start, end) { + return this.slice(start, end).toString(encoding) +} + +BufferList.prototype.consume = function consume (bytes) { + while (this._bufs.length) { + if (bytes >= this._bufs[0].length) { + bytes -= this._bufs[0].length + this.length -= this._bufs[0].length + this._bufs.shift() + } else { + this._bufs[0] = this._bufs[0].slice(bytes) + this.length -= bytes + break + } + } + return this +} + + +BufferList.prototype.duplicate = function duplicate () { + var i = 0 + , copy = new BufferList() + + for (; i < this._bufs.length; i++) + copy.append(this._bufs[i]) + + return copy +} + + +BufferList.prototype.destroy = function destroy () { + this._bufs.length = 0 + this.length = 0 + this.push(null) +} + + +;(function () { + var methods = { + 'readDoubleBE' : 8 + , 'readDoubleLE' : 8 + , 'readFloatBE' : 4 + , 'readFloatLE' : 4 + , 'readInt32BE' : 4 + , 'readInt32LE' : 4 + , 'readUInt32BE' : 4 + , 'readUInt32LE' : 4 + , 'readInt16BE' : 2 + , 'readInt16LE' : 2 + , 'readUInt16BE' : 2 + , 'readUInt16LE' : 2 + , 'readInt8' : 1 + , 'readUInt8' : 1 + } + + for (var m in methods) { + (function (m) { + BufferList.prototype[m] = function (offset) { + return this.slice(offset, offset + methods[m])[m](0) + } + }(m)) + } +}()) + + +module.exports = BufferList diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/.npmignore new file mode 100644 index 00000000..38344f87 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/.npmignore @@ -0,0 +1,5 @@ +build/ +test/ +examples/ +fs.js +zlib.js \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/.travis.yml new file mode 100644 index 00000000..1b821184 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/.travis.yml @@ -0,0 +1,52 @@ +sudo: false +language: node_js +before_install: + - npm install -g npm@2 + - npm install -g npm +notifications: + email: false +matrix: + fast_finish: true + allow_failures: + - env: TASK=browser BROWSER_NAME=ipad BROWSER_VERSION="6.0..latest" + - env: TASK=browser BROWSER_NAME=iphone BROWSER_VERSION="6.0..latest" + include: + - node_js: '0.8' + env: TASK=test + - node_js: '0.10' + env: TASK=test + - node_js: '0.11' + env: TASK=test + - node_js: '0.12' + env: TASK=test + - node_js: 1 + env: TASK=test + - node_js: 2 + env: TASK=test + - node_js: 3 + env: TASK=test + - node_js: 4 + env: TASK=test + - node_js: 5 + env: TASK=test + - node_js: 5 + env: TASK=browser BROWSER_NAME=android BROWSER_VERSION="4.0..latest" + - node_js: 5 + env: TASK=browser BROWSER_NAME=ie BROWSER_VERSION="9..latest" + - node_js: 5 + env: TASK=browser BROWSER_NAME=opera BROWSER_VERSION="11..latest" + - node_js: 5 + env: TASK=browser BROWSER_NAME=chrome BROWSER_VERSION="-3..latest" + - node_js: 5 + env: TASK=browser BROWSER_NAME=firefox BROWSER_VERSION="-3..latest" + - node_js: 5 + env: TASK=browser BROWSER_NAME=ipad BROWSER_VERSION="6.0..latest" + - node_js: 5 + env: TASK=browser BROWSER_NAME=iphone BROWSER_VERSION="6.0..latest" + - node_js: 5 + env: TASK=browser BROWSER_NAME=safari BROWSER_VERSION="5..latest" +script: "npm run $TASK" +env: + global: + - secure: rE2Vvo7vnjabYNULNyLFxOyt98BoJexDqsiOnfiD6kLYYsiQGfr/sbZkPMOFm9qfQG7pjqx+zZWZjGSswhTt+626C0t/njXqug7Yps4c3dFblzGfreQHp7wNX5TFsvrxd6dAowVasMp61sJcRnB2w8cUzoe3RAYUDHyiHktwqMc= + - secure: g9YINaKAdMatsJ28G9jCGbSaguXCyxSTy+pBO6Ch0Cf57ZLOTka3HqDj8p3nV28LUIHZ3ut5WO43CeYKwt4AUtLpBS3a0dndHdY6D83uY6b2qh5hXlrcbeQTq2cvw2y95F7hm4D1kwrgZ7ViqaKggRcEupAL69YbJnxeUDKWEdI= diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/.zuul.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/.zuul.yml new file mode 100644 index 00000000..96d9cfbd --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/.zuul.yml @@ -0,0 +1 @@ +ui: tape diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/LICENSE new file mode 100644 index 00000000..e3d4e695 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/LICENSE @@ -0,0 +1,18 @@ +Copyright Joyent, Inc. and other Node contributors. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/README.md new file mode 100644 index 00000000..1a67c48c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/README.md @@ -0,0 +1,36 @@ +# readable-stream + +***Node-core v5.8.0 streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream) + + +[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/) +[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/) + + +[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream) + +```bash +npm install --save readable-stream +``` + +***Node-core streams for userland*** + +This package is a mirror of the Streams2 and Streams3 implementations in +Node-core, including [documentation](doc/stream.markdown). + +If you want to guarantee a stable streams base, regardless of what version of +Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html). + +As of version 2.0.0 **readable-stream** uses semantic versioning. + +# Streams WG Team Members + +* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) <christopher.s.dickinson@gmail.com> + - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B +* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com> + - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242 +* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) <rod@vagg.org> + - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D +* **Sam Newman** ([@sonewman](https://github.com/sonewman)) <newmansam@outlook.com> +* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com> +* **Domenic Denicola** ([@domenic](https://github.com/domenic)) <d@domenic.me> diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/stream.markdown b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/stream.markdown new file mode 100644 index 00000000..0bc3819e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/stream.markdown @@ -0,0 +1,1760 @@ +# Stream + + Stability: 2 - Stable + +A stream is an abstract interface implemented by various objects in +Node.js. For example a [request to an HTTP server][http-incoming-message] is a +stream, as is [`process.stdout`][]. Streams are readable, writable, or both. All +streams are instances of [`EventEmitter`][]. + +You can load the Stream base classes by doing `require('stream')`. +There are base classes provided for [Readable][] streams, [Writable][] +streams, [Duplex][] streams, and [Transform][] streams. + +This document is split up into 3 sections: + +1. The first section explains the parts of the API that you need to be + aware of to use streams in your programs. +2. The second section explains the parts of the API that you need to + use if you implement your own custom streams yourself. The API is designed to + make this easy for you to do. +3. The third section goes into more depth about how streams work, + including some of the internal mechanisms and functions that you + should probably not modify unless you definitely know what you are + doing. + + +## API for Stream Consumers + + + +Streams can be either [Readable][], [Writable][], or both ([Duplex][]). + +All streams are EventEmitters, but they also have other custom methods +and properties depending on whether they are Readable, Writable, or +Duplex. + +If a stream is both Readable and Writable, then it implements all of +the methods and events. So, a [Duplex][] or [Transform][] stream is +fully described by this API, though their implementation may be +somewhat different. + +It is not necessary to implement Stream interfaces in order to consume +streams in your programs. If you **are** implementing streaming +interfaces in your own program, please also refer to +[API for Stream Implementors][]. + +Almost all Node.js programs, no matter how simple, use Streams in some +way. Here is an example of using Streams in an Node.js program: + +```js +const http = require('http'); + +var server = http.createServer( (req, res) => { + // req is an http.IncomingMessage, which is a Readable Stream + // res is an http.ServerResponse, which is a Writable Stream + + var body = ''; + // we want to get the data as utf8 strings + // If you don't set an encoding, then you'll get Buffer objects + req.setEncoding('utf8'); + + // Readable streams emit 'data' events once a listener is added + req.on('data', (chunk) => { + body += chunk; + }); + + // the end event tells you that you have entire body + req.on('end', () => { + try { + var data = JSON.parse(body); + } catch (er) { + // uh oh! bad json! + res.statusCode = 400; + return res.end(`error: ${er.message}`); + } + + // write back something interesting to the user: + res.write(typeof data); + res.end(); + }); +}); + +server.listen(1337); + +// $ curl localhost:1337 -d '{}' +// object +// $ curl localhost:1337 -d '"foo"' +// string +// $ curl localhost:1337 -d 'not json' +// error: Unexpected token o +``` + +### Class: stream.Duplex + +Duplex streams are streams that implement both the [Readable][] and +[Writable][] interfaces. + +Examples of Duplex streams include: + +* [TCP sockets][] +* [zlib streams][zlib] +* [crypto streams][crypto] + +### Class: stream.Readable + + + +The Readable stream interface is the abstraction for a *source* of +data that you are reading from. In other words, data comes *out* of a +Readable stream. + +A Readable stream will not start emitting data until you indicate that +you are ready to receive it. + +Readable streams have two "modes": a **flowing mode** and a **paused +mode**. When in flowing mode, data is read from the underlying system +and provided to your program as fast as possible. In paused mode, you +must explicitly call [`stream.read()`][stream-read] to get chunks of data out. +Streams start out in paused mode. + +**Note**: If no data event handlers are attached, and there are no +[`stream.pipe()`][] destinations, and the stream is switched into flowing +mode, then data will be lost. + +You can switch to flowing mode by doing any of the following: + +* Adding a [`'data'`][] event handler to listen for data. +* Calling the [`stream.resume()`][stream-resume] method to explicitly open the + flow. +* Calling the [`stream.pipe()`][] method to send the data to a [Writable][]. + +You can switch back to paused mode by doing either of the following: + +* If there are no pipe destinations, by calling the + [`stream.pause()`][stream-pause] method. +* If there are pipe destinations, by removing any [`'data'`][] event + handlers, and removing all pipe destinations by calling the + [`stream.unpipe()`][] method. + +Note that, for backwards compatibility reasons, removing [`'data'`][] +event handlers will **not** automatically pause the stream. Also, if +there are piped destinations, then calling [`stream.pause()`][stream-pause] will +not guarantee that the stream will *remain* paused once those +destinations drain and ask for more data. + +Examples of readable streams include: + +* [HTTP responses, on the client][http-incoming-message] +* [HTTP requests, on the server][http-incoming-message] +* [fs read streams][] +* [zlib streams][zlib] +* [crypto streams][crypto] +* [TCP sockets][] +* [child process stdout and stderr][] +* [`process.stdin`][] + +#### Event: 'close' + +Emitted when the stream and any of its underlying resources (a file +descriptor, for example) have been closed. The event indicates that +no more events will be emitted, and no further computation will occur. + +Not all streams will emit the `'close'` event. + +#### Event: 'data' + +* `chunk` {Buffer|String} The chunk of data. + +Attaching a `'data'` event listener to a stream that has not been +explicitly paused will switch the stream into flowing mode. Data will +then be passed as soon as it is available. + +If you just want to get all the data out of the stream as fast as +possible, this is the best way to do so. + +```js +var readable = getReadableStreamSomehow(); +readable.on('data', (chunk) => { + console.log('got %d bytes of data', chunk.length); +}); +``` + +#### Event: 'end' + +This event fires when there will be no more data to read. + +Note that the `'end'` event **will not fire** unless the data is +completely consumed. This can be done by switching into flowing mode, +or by calling [`stream.read()`][stream-read] repeatedly until you get to the +end. + +```js +var readable = getReadableStreamSomehow(); +readable.on('data', (chunk) => { + console.log('got %d bytes of data', chunk.length); +}); +readable.on('end', () => { + console.log('there will be no more data.'); +}); +``` + +#### Event: 'error' + +* {Error Object} + +Emitted if there was an error receiving data. + +#### Event: 'readable' + +When a chunk of data can be read from the stream, it will emit a +`'readable'` event. + +In some cases, listening for a `'readable'` event will cause some data +to be read into the internal buffer from the underlying system, if it +hadn't already. + +```javascript +var readable = getReadableStreamSomehow(); +readable.on('readable', () => { + // there is some data to read now +}); +``` + +Once the internal buffer is drained, a `'readable'` event will fire +again when more data is available. + +The `'readable'` event is not emitted in the "flowing" mode with the +sole exception of the last one, on end-of-stream. + +The `'readable'` event indicates that the stream has new information: +either new data is available or the end of the stream has been reached. +In the former case, [`stream.read()`][stream-read] will return that data. In the +latter case, [`stream.read()`][stream-read] will return null. For instance, in +the following example, `foo.txt` is an empty file: + +```js +const fs = require('fs'); +var rr = fs.createReadStream('foo.txt'); +rr.on('readable', () => { + console.log('readable:', rr.read()); +}); +rr.on('end', () => { + console.log('end'); +}); +``` + +The output of running this script is: + +``` +$ node test.js +readable: null +end +``` + +#### readable.isPaused() + +* Return: {Boolean} + +This method returns whether or not the `readable` has been **explicitly** +paused by client code (using [`stream.pause()`][stream-pause] without a +corresponding [`stream.resume()`][stream-resume]). + +```js +var readable = new stream.Readable + +readable.isPaused() // === false +readable.pause() +readable.isPaused() // === true +readable.resume() +readable.isPaused() // === false +``` + +#### readable.pause() + +* Return: `this` + +This method will cause a stream in flowing mode to stop emitting +[`'data'`][] events, switching out of flowing mode. Any data that becomes +available will remain in the internal buffer. + +```js +var readable = getReadableStreamSomehow(); +readable.on('data', (chunk) => { + console.log('got %d bytes of data', chunk.length); + readable.pause(); + console.log('there will be no more data for 1 second'); + setTimeout(() => { + console.log('now data will start flowing again'); + readable.resume(); + }, 1000); +}); +``` + +#### readable.pipe(destination[, options]) + +* `destination` {stream.Writable} The destination for writing data +* `options` {Object} Pipe options + * `end` {Boolean} End the writer when the reader ends. Default = `true` + +This method pulls all the data out of a readable stream, and writes it +to the supplied destination, automatically managing the flow so that +the destination is not overwhelmed by a fast readable stream. + +Multiple destinations can be piped to safely. + +```js +var readable = getReadableStreamSomehow(); +var writable = fs.createWriteStream('file.txt'); +// All the data from readable goes into 'file.txt' +readable.pipe(writable); +``` + +This function returns the destination stream, so you can set up pipe +chains like so: + +```js +var r = fs.createReadStream('file.txt'); +var z = zlib.createGzip(); +var w = fs.createWriteStream('file.txt.gz'); +r.pipe(z).pipe(w); +``` + +For example, emulating the Unix `cat` command: + +```js +process.stdin.pipe(process.stdout); +``` + +By default [`stream.end()`][stream-end] is called on the destination when the +source stream emits [`'end'`][], so that `destination` is no longer writable. +Pass `{ end: false }` as `options` to keep the destination stream open. + +This keeps `writer` open so that "Goodbye" can be written at the +end. + +```js +reader.pipe(writer, { end: false }); +reader.on('end', () => { + writer.end('Goodbye\n'); +}); +``` + +Note that [`process.stderr`][] and [`process.stdout`][] are never closed until +the process exits, regardless of the specified options. + +#### readable.read([size]) + +* `size` {Number} Optional argument to specify how much data to read. +* Return {String|Buffer|Null} + +The `read()` method pulls some data out of the internal buffer and +returns it. If there is no data available, then it will return +`null`. + +If you pass in a `size` argument, then it will return that many +bytes. If `size` bytes are not available, then it will return `null`, +unless we've ended, in which case it will return the data remaining +in the buffer. + +If you do not specify a `size` argument, then it will return all the +data in the internal buffer. + +This method should only be called in paused mode. In flowing mode, +this method is called automatically until the internal buffer is +drained. + +```js +var readable = getReadableStreamSomehow(); +readable.on('readable', () => { + var chunk; + while (null !== (chunk = readable.read())) { + console.log('got %d bytes of data', chunk.length); + } +}); +``` + +If this method returns a data chunk, then it will also trigger the +emission of a [`'data'`][] event. + +Note that calling [`stream.read([size])`][stream-read] after the [`'end'`][] +event has been triggered will return `null`. No runtime error will be raised. + +#### readable.resume() + +* Return: `this` + +This method will cause the readable stream to resume emitting [`'data'`][] +events. + +This method will switch the stream into flowing mode. If you do *not* +want to consume the data from a stream, but you *do* want to get to +its [`'end'`][] event, you can call [`stream.resume()`][stream-resume] to open +the flow of data. + +```js +var readable = getReadableStreamSomehow(); +readable.resume(); +readable.on('end', () => { + console.log('got to the end, but did not read anything'); +}); +``` + +#### readable.setEncoding(encoding) + +* `encoding` {String} The encoding to use. +* Return: `this` + +Call this function to cause the stream to return strings of the specified +encoding instead of Buffer objects. For example, if you do +`readable.setEncoding('utf8')`, then the output data will be interpreted as +UTF-8 data, and returned as strings. If you do `readable.setEncoding('hex')`, +then the data will be encoded in hexadecimal string format. + +This properly handles multi-byte characters that would otherwise be +potentially mangled if you simply pulled the Buffers directly and +called [`buf.toString(encoding)`][] on them. If you want to read the data +as strings, always use this method. + +Also you can disable any encoding at all with `readable.setEncoding(null)`. +This approach is very useful if you deal with binary data or with large +multi-byte strings spread out over multiple chunks. + +```js +var readable = getReadableStreamSomehow(); +readable.setEncoding('utf8'); +readable.on('data', (chunk) => { + assert.equal(typeof chunk, 'string'); + console.log('got %d characters of string data', chunk.length); +}); +``` + +#### readable.unpipe([destination]) + +* `destination` {stream.Writable} Optional specific stream to unpipe + +This method will remove the hooks set up for a previous [`stream.pipe()`][] +call. + +If the destination is not specified, then all pipes are removed. + +If the destination is specified, but no pipe is set up for it, then +this is a no-op. + +```js +var readable = getReadableStreamSomehow(); +var writable = fs.createWriteStream('file.txt'); +// All the data from readable goes into 'file.txt', +// but only for the first second +readable.pipe(writable); +setTimeout(() => { + console.log('stop writing to file.txt'); + readable.unpipe(writable); + console.log('manually close the file stream'); + writable.end(); +}, 1000); +``` + +#### readable.unshift(chunk) + +* `chunk` {Buffer|String} Chunk of data to unshift onto the read queue + +This is useful in certain cases where a stream is being consumed by a +parser, which needs to "un-consume" some data that it has +optimistically pulled out of the source, so that the stream can be +passed on to some other party. + +Note that `stream.unshift(chunk)` cannot be called after the [`'end'`][] event +has been triggered; a runtime error will be raised. + +If you find that you must often call `stream.unshift(chunk)` in your +programs, consider implementing a [Transform][] stream instead. (See [API +for Stream Implementors][].) + +```js +// Pull off a header delimited by \n\n +// use unshift() if we get too much +// Call the callback with (error, header, stream) +const StringDecoder = require('string_decoder').StringDecoder; +function parseHeader(stream, callback) { + stream.on('error', callback); + stream.on('readable', onReadable); + var decoder = new StringDecoder('utf8'); + var header = ''; + function onReadable() { + var chunk; + while (null !== (chunk = stream.read())) { + var str = decoder.write(chunk); + if (str.match(/\n\n/)) { + // found the header boundary + var split = str.split(/\n\n/); + header += split.shift(); + var remaining = split.join('\n\n'); + var buf = new Buffer(remaining, 'utf8'); + if (buf.length) + stream.unshift(buf); + stream.removeListener('error', callback); + stream.removeListener('readable', onReadable); + // now the body of the message can be read from the stream. + callback(null, header, stream); + } else { + // still reading the header. + header += str; + } + } + } +} +``` + +Note that, unlike [`stream.push(chunk)`][stream-push], `stream.unshift(chunk)` +will not end the reading process by resetting the internal reading state of the +stream. This can cause unexpected results if `unshift()` is called during a +read (i.e. from within a [`stream._read()`][stream-_read] implementation on a +custom stream). Following the call to `unshift()` with an immediate +[`stream.push('')`][stream-push] will reset the reading state appropriately, +however it is best to simply avoid calling `unshift()` while in the process of +performing a read. + +#### readable.wrap(stream) + +* `stream` {Stream} An "old style" readable stream + +Versions of Node.js prior to v0.10 had streams that did not implement the +entire Streams API as it is today. (See [Compatibility][] for +more information.) + +If you are using an older Node.js library that emits [`'data'`][] events and +has a [`stream.pause()`][stream-pause] method that is advisory only, then you +can use the `wrap()` method to create a [Readable][] stream that uses the old +stream as its data source. + +You will very rarely ever need to call this function, but it exists +as a convenience for interacting with old Node.js programs and libraries. + +For example: + +```js +const OldReader = require('./old-api-module.js').OldReader; +const Readable = require('stream').Readable; +const oreader = new OldReader; +const myReader = new Readable().wrap(oreader); + +myReader.on('readable', () => { + myReader.read(); // etc. +}); +``` + +### Class: stream.Transform + +Transform streams are [Duplex][] streams where the output is in some way +computed from the input. They implement both the [Readable][] and +[Writable][] interfaces. + +Examples of Transform streams include: + +* [zlib streams][zlib] +* [crypto streams][crypto] + +### Class: stream.Writable + + + +The Writable stream interface is an abstraction for a *destination* +that you are writing data *to*. + +Examples of writable streams include: + +* [HTTP requests, on the client][] +* [HTTP responses, on the server][] +* [fs write streams][] +* [zlib streams][zlib] +* [crypto streams][crypto] +* [TCP sockets][] +* [child process stdin][] +* [`process.stdout`][], [`process.stderr`][] + +#### Event: 'drain' + +If a [`stream.write(chunk)`][stream-write] call returns `false`, then the +`'drain'` event will indicate when it is appropriate to begin writing more data +to the stream. + +```js +// Write the data to the supplied writable stream one million times. +// Be attentive to back-pressure. +function writeOneMillionTimes(writer, data, encoding, callback) { + var i = 1000000; + write(); + function write() { + var ok = true; + do { + i -= 1; + if (i === 0) { + // last time! + writer.write(data, encoding, callback); + } else { + // see if we should continue, or wait + // don't pass the callback, because we're not done yet. + ok = writer.write(data, encoding); + } + } while (i > 0 && ok); + if (i > 0) { + // had to stop early! + // write some more once it drains + writer.once('drain', write); + } + } +} +``` + +#### Event: 'error' + +* {Error} + +Emitted if there was an error when writing or piping data. + +#### Event: 'finish' + +When the [`stream.end()`][stream-end] method has been called, and all data has +been flushed to the underlying system, this event is emitted. + +```javascript +var writer = getWritableStreamSomehow(); +for (var i = 0; i < 100; i ++) { + writer.write('hello, #${i}!\n'); +} +writer.end('this is the end\n'); +writer.on('finish', () => { + console.error('all writes are now complete.'); +}); +``` + +#### Event: 'pipe' + +* `src` {stream.Readable} source stream that is piping to this writable + +This is emitted whenever the [`stream.pipe()`][] method is called on a readable +stream, adding this writable to its set of destinations. + +```js +var writer = getWritableStreamSomehow(); +var reader = getReadableStreamSomehow(); +writer.on('pipe', (src) => { + console.error('something is piping into the writer'); + assert.equal(src, reader); +}); +reader.pipe(writer); +``` + +#### Event: 'unpipe' + +* `src` {[Readable][] Stream} The source stream that + [unpiped][`stream.unpipe()`] this writable + +This is emitted whenever the [`stream.unpipe()`][] method is called on a +readable stream, removing this writable from its set of destinations. + +```js +var writer = getWritableStreamSomehow(); +var reader = getReadableStreamSomehow(); +writer.on('unpipe', (src) => { + console.error('something has stopped piping into the writer'); + assert.equal(src, reader); +}); +reader.pipe(writer); +reader.unpipe(writer); +``` + +#### writable.cork() + +Forces buffering of all writes. + +Buffered data will be flushed either at [`stream.uncork()`][] or at +[`stream.end()`][stream-end] call. + +#### writable.end([chunk][, encoding][, callback]) + +* `chunk` {String|Buffer} Optional data to write +* `encoding` {String} The encoding, if `chunk` is a String +* `callback` {Function} Optional callback for when the stream is finished + +Call this method when no more data will be written to the stream. If supplied, +the callback is attached as a listener on the [`'finish'`][] event. + +Calling [`stream.write()`][stream-write] after calling +[`stream.end()`][stream-end] will raise an error. + +```js +// write 'hello, ' and then end with 'world!' +var file = fs.createWriteStream('example.txt'); +file.write('hello, '); +file.end('world!'); +// writing more now is not allowed! +``` + +#### writable.setDefaultEncoding(encoding) + +* `encoding` {String} The new default encoding + +Sets the default encoding for a writable stream. + +#### writable.uncork() + +Flush all data, buffered since [`stream.cork()`][] call. + +#### writable.write(chunk[, encoding][, callback]) + +* `chunk` {String|Buffer} The data to write +* `encoding` {String} The encoding, if `chunk` is a String +* `callback` {Function} Callback for when this chunk of data is flushed +* Returns: {Boolean} `true` if the data was handled completely. + +This method writes some data to the underlying system, and calls the +supplied callback once the data has been fully handled. + +The return value indicates if you should continue writing right now. +If the data had to be buffered internally, then it will return +`false`. Otherwise, it will return `true`. + +This return value is strictly advisory. You MAY continue to write, +even if it returns `false`. However, writes will be buffered in +memory, so it is best not to do this excessively. Instead, wait for +the [`'drain'`][] event before writing more data. + + +## API for Stream Implementors + + + +To implement any sort of stream, the pattern is the same: + +1. Extend the appropriate parent class in your own subclass. (The + [`util.inherits()`][] method is particularly helpful for this.) +2. Call the appropriate parent class constructor in your constructor, + to be sure that the internal mechanisms are set up properly. +3. Implement one or more specific methods, as detailed below. + +The class to extend and the method(s) to implement depend on the sort +of stream class you are writing: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      +

      Use-case

      +
      +

      Class

      +
      +

      Method(s) to implement

      +
      +

      Reading only

      +
      +

      [Readable](#stream_class_stream_readable_1)

      +
      +

      [_read][stream-_read]

      +
      +

      Writing only

      +
      +

      [Writable](#stream_class_stream_writable_1)

      +
      +

      [_write][stream-_write], [_writev][stream-_writev]

      +
      +

      Reading and writing

      +
      +

      [Duplex](#stream_class_stream_duplex_1)

      +
      +

      [_read][stream-_read], [_write][stream-_write], [_writev][stream-_writev]

      +
      +

      Operate on written data, then read the result

      +
      +

      [Transform](#stream_class_stream_transform_1)

      +
      +

      [_transform][stream-_transform], [_flush][stream-_flush]

      +
      + +In your implementation code, it is very important to never call the methods +described in [API for Stream Consumers][]. Otherwise, you can potentially cause +adverse side effects in programs that consume your streaming interfaces. + +### Class: stream.Duplex + + + +A "duplex" stream is one that is both Readable and Writable, such as a TCP +socket connection. + +Note that `stream.Duplex` is an abstract class designed to be extended +with an underlying implementation of the [`stream._read(size)`][stream-_read] +and [`stream._write(chunk, encoding, callback)`][stream-_write] methods as you +would with a Readable or Writable stream class. + +Since JavaScript doesn't have multiple prototypal inheritance, this class +prototypally inherits from Readable, and then parasitically from Writable. It is +thus up to the user to implement both the low-level +[`stream._read(n)`][stream-_read] method as well as the low-level +[`stream._write(chunk, encoding, callback)`][stream-_write] method on extension +duplex classes. + +#### new stream.Duplex(options) + +* `options` {Object} Passed to both Writable and Readable + constructors. Also has the following fields: + * `allowHalfOpen` {Boolean} Default = `true`. If set to `false`, then + the stream will automatically end the readable side when the + writable side ends and vice versa. + * `readableObjectMode` {Boolean} Default = `false`. Sets `objectMode` + for readable side of the stream. Has no effect if `objectMode` + is `true`. + * `writableObjectMode` {Boolean} Default = `false`. Sets `objectMode` + for writable side of the stream. Has no effect if `objectMode` + is `true`. + +In classes that extend the Duplex class, make sure to call the +constructor so that the buffering settings can be properly +initialized. + +### Class: stream.PassThrough + +This is a trivial implementation of a [Transform][] stream that simply +passes the input bytes across to the output. Its purpose is mainly +for examples and testing, but there are occasionally use cases where +it can come in handy as a building block for novel sorts of streams. + +### Class: stream.Readable + + + +`stream.Readable` is an abstract class designed to be extended with an +underlying implementation of the [`stream._read(size)`][stream-_read] method. + +Please see [API for Stream Consumers][] for how to consume +streams in your programs. What follows is an explanation of how to +implement Readable streams in your programs. + +#### new stream.Readable([options]) + +* `options` {Object} + * `highWaterMark` {Number} The maximum number of bytes to store in + the internal buffer before ceasing to read from the underlying + resource. Default = `16384` (16kb), or `16` for `objectMode` streams + * `encoding` {String} If specified, then buffers will be decoded to + strings using the specified encoding. Default = `null` + * `objectMode` {Boolean} Whether this stream should behave + as a stream of objects. Meaning that [`stream.read(n)`][stream-read] returns + a single value instead of a Buffer of size n. Default = `false` + * `read` {Function} Implementation for the [`stream._read()`][stream-_read] + method. + +In classes that extend the Readable class, make sure to call the +Readable constructor so that the buffering settings can be properly +initialized. + +#### readable.\_read(size) + +* `size` {Number} Number of bytes to read asynchronously + +Note: **Implement this method, but do NOT call it directly.** + +This method is prefixed with an underscore because it is internal to the +class that defines it and should only be called by the internal Readable +class methods. All Readable stream implementations must provide a \_read +method to fetch data from the underlying resource. + +When `_read()` is called, if data is available from the resource, the `_read()` +implementation should start pushing that data into the read queue by calling +[`this.push(dataChunk)`][stream-push]. `_read()` should continue reading from +the resource and pushing data until push returns `false`, at which point it +should stop reading from the resource. Only when `_read()` is called again after +it has stopped should it start reading more data from the resource and pushing +that data onto the queue. + +Note: once the `_read()` method is called, it will not be called again until +the [`stream.push()`][stream-push] method is called. + +The `size` argument is advisory. Implementations where a "read" is a +single call that returns data can use this to know how much data to +fetch. Implementations where that is not relevant, such as TCP or +TLS, may ignore this argument, and simply provide data whenever it +becomes available. There is no need, for example to "wait" until +`size` bytes are available before calling [`stream.push(chunk)`][stream-push]. + +#### readable.push(chunk[, encoding]) + + +* `chunk` {Buffer|Null|String} Chunk of data to push into the read queue +* `encoding` {String} Encoding of String chunks. Must be a valid + Buffer encoding, such as `'utf8'` or `'ascii'` +* return {Boolean} Whether or not more pushes should be performed + +Note: **This method should be called by Readable implementors, NOT +by consumers of Readable streams.** + +If a value other than null is passed, The `push()` method adds a chunk of data +into the queue for subsequent stream processors to consume. If `null` is +passed, it signals the end of the stream (EOF), after which no more data +can be written. + +The data added with `push()` can be pulled out by calling the +[`stream.read()`][stream-read] method when the [`'readable'`][] event fires. + +This API is designed to be as flexible as possible. For example, +you may be wrapping a lower-level source which has some sort of +pause/resume mechanism, and a data callback. In those cases, you +could wrap the low-level source object by doing something like this: + +```js +// source is an object with readStop() and readStart() methods, +// and an `ondata` member that gets called when it has data, and +// an `onend` member that gets called when the data is over. + +util.inherits(SourceWrapper, Readable); + +function SourceWrapper(options) { + Readable.call(this, options); + + this._source = getLowlevelSourceObject(); + + // Every time there's data, we push it into the internal buffer. + this._source.ondata = (chunk) => { + // if push() returns false, then we need to stop reading from source + if (!this.push(chunk)) + this._source.readStop(); + }; + + // When the source ends, we push the EOF-signaling `null` chunk + this._source.onend = () => { + this.push(null); + }; +} + +// _read will be called when the stream wants to pull more data in +// the advisory size argument is ignored in this case. +SourceWrapper.prototype._read = function(size) { + this._source.readStart(); +}; +``` + +#### Example: A Counting Stream + + + +This is a basic example of a Readable stream. It emits the numerals +from 1 to 1,000,000 in ascending order, and then ends. + +```js +const Readable = require('stream').Readable; +const util = require('util'); +util.inherits(Counter, Readable); + +function Counter(opt) { + Readable.call(this, opt); + this._max = 1000000; + this._index = 1; +} + +Counter.prototype._read = function() { + var i = this._index++; + if (i > this._max) + this.push(null); + else { + var str = '' + i; + var buf = new Buffer(str, 'ascii'); + this.push(buf); + } +}; +``` + +#### Example: SimpleProtocol v1 (Sub-optimal) + +This is similar to the `parseHeader` function described +[here](#stream_readable_unshift_chunk), but implemented as a custom stream. +Also, note that this implementation does not convert the incoming data to a +string. + +However, this would be better implemented as a [Transform][] stream. See +[SimpleProtocol v2][] for a better implementation. + +```js +// A parser for a simple data protocol. +// The "header" is a JSON object, followed by 2 \n characters, and +// then a message body. +// +// NOTE: This can be done more simply as a Transform stream! +// Using Readable directly for this is sub-optimal. See the +// alternative example below under the Transform section. + +const Readable = require('stream').Readable; +const util = require('util'); + +util.inherits(SimpleProtocol, Readable); + +function SimpleProtocol(source, options) { + if (!(this instanceof SimpleProtocol)) + return new SimpleProtocol(source, options); + + Readable.call(this, options); + this._inBody = false; + this._sawFirstCr = false; + + // source is a readable stream, such as a socket or file + this._source = source; + + var self = this; + source.on('end', () => { + self.push(null); + }); + + // give it a kick whenever the source is readable + // read(0) will not consume any bytes + source.on('readable', () => { + self.read(0); + }); + + this._rawHeader = []; + this.header = null; +} + +SimpleProtocol.prototype._read = function(n) { + if (!this._inBody) { + var chunk = this._source.read(); + + // if the source doesn't have data, we don't have data yet. + if (chunk === null) + return this.push(''); + + // check if the chunk has a \n\n + var split = -1; + for (var i = 0; i < chunk.length; i++) { + if (chunk[i] === 10) { // '\n' + if (this._sawFirstCr) { + split = i; + break; + } else { + this._sawFirstCr = true; + } + } else { + this._sawFirstCr = false; + } + } + + if (split === -1) { + // still waiting for the \n\n + // stash the chunk, and try again. + this._rawHeader.push(chunk); + this.push(''); + } else { + this._inBody = true; + var h = chunk.slice(0, split); + this._rawHeader.push(h); + var header = Buffer.concat(this._rawHeader).toString(); + try { + this.header = JSON.parse(header); + } catch (er) { + this.emit('error', new Error('invalid simple protocol data')); + return; + } + // now, because we got some extra data, unshift the rest + // back into the read queue so that our consumer will see it. + var b = chunk.slice(split); + this.unshift(b); + // calling unshift by itself does not reset the reading state + // of the stream; since we're inside _read, doing an additional + // push('') will reset the state appropriately. + this.push(''); + + // and let them know that we are done parsing the header. + this.emit('header', this.header); + } + } else { + // from there on, just provide the data to our consumer. + // careful not to push(null), since that would indicate EOF. + var chunk = this._source.read(); + if (chunk) this.push(chunk); + } +}; + +// Usage: +// var parser = new SimpleProtocol(source); +// Now parser is a readable stream that will emit 'header' +// with the parsed header data. +``` + +### Class: stream.Transform + +A "transform" stream is a duplex stream where the output is causally +connected in some way to the input, such as a [zlib][] stream or a +[crypto][] stream. + +There is no requirement that the output be the same size as the input, +the same number of chunks, or arrive at the same time. For example, a +Hash stream will only ever have a single chunk of output which is +provided when the input is ended. A zlib stream will produce output +that is either much smaller or much larger than its input. + +Rather than implement the [`stream._read()`][stream-_read] and +[`stream._write()`][stream-_write] methods, Transform classes must implement the +[`stream._transform()`][stream-_transform] method, and may optionally +also implement the [`stream._flush()`][stream-_flush] method. (See below.) + +#### new stream.Transform([options]) + +* `options` {Object} Passed to both Writable and Readable + constructors. Also has the following fields: + * `transform` {Function} Implementation for the + [`stream._transform()`][stream-_transform] method. + * `flush` {Function} Implementation for the [`stream._flush()`][stream-_flush] + method. + +In classes that extend the Transform class, make sure to call the +constructor so that the buffering settings can be properly +initialized. + +#### Events: 'finish' and 'end' + +The [`'finish'`][] and [`'end'`][] events are from the parent Writable +and Readable classes respectively. The `'finish'` event is fired after +[`stream.end()`][stream-end] is called and all chunks have been processed by +[`stream._transform()`][stream-_transform], `'end'` is fired after all data has +been output which is after the callback in [`stream._flush()`][stream-_flush] +has been called. + +#### transform.\_flush(callback) + +* `callback` {Function} Call this function (optionally with an error + argument) when you are done flushing any remaining data. + +Note: **This function MUST NOT be called directly.** It MAY be implemented +by child classes, and if so, will be called by the internal Transform +class methods only. + +In some cases, your transform operation may need to emit a bit more +data at the end of the stream. For example, a `Zlib` compression +stream will store up some internal state so that it can optimally +compress the output. At the end, however, it needs to do the best it +can with what is left, so that the data will be complete. + +In those cases, you can implement a `_flush()` method, which will be +called at the very end, after all the written data is consumed, but +before emitting [`'end'`][] to signal the end of the readable side. Just +like with [`stream._transform()`][stream-_transform], call +`transform.push(chunk)` zero or more times, as appropriate, and call `callback` +when the flush operation is complete. + +This method is prefixed with an underscore because it is internal to +the class that defines it, and should not be called directly by user +programs. However, you **are** expected to override this method in +your own extension classes. + +#### transform.\_transform(chunk, encoding, callback) + +* `chunk` {Buffer|String} The chunk to be transformed. Will **always** + be a buffer unless the `decodeStrings` option was set to `false`. +* `encoding` {String} If the chunk is a string, then this is the + encoding type. If chunk is a buffer, then this is the special + value - 'buffer', ignore it in this case. +* `callback` {Function} Call this function (optionally with an error + argument and data) when you are done processing the supplied chunk. + +Note: **This function MUST NOT be called directly.** It should be +implemented by child classes, and called by the internal Transform +class methods only. + +All Transform stream implementations must provide a `_transform()` +method to accept input and produce output. + +`_transform()` should do whatever has to be done in this specific +Transform class, to handle the bytes being written, and pass them off +to the readable portion of the interface. Do asynchronous I/O, +process things, and so on. + +Call `transform.push(outputChunk)` 0 or more times to generate output +from this input chunk, depending on how much data you want to output +as a result of this chunk. + +Call the callback function only when the current chunk is completely +consumed. Note that there may or may not be output as a result of any +particular input chunk. If you supply a second argument to the callback +it will be passed to the push method. In other words the following are +equivalent: + +```js +transform.prototype._transform = function (data, encoding, callback) { + this.push(data); + callback(); +}; + +transform.prototype._transform = function (data, encoding, callback) { + callback(null, data); +}; +``` + +This method is prefixed with an underscore because it is internal to +the class that defines it, and should not be called directly by user +programs. However, you **are** expected to override this method in +your own extension classes. + +#### Example: `SimpleProtocol` parser v2 + +The example [here](#stream_example_simpleprotocol_v1_sub_optimal) of a simple +protocol parser can be implemented simply by using the higher level +[Transform][] stream class, similar to the `parseHeader` and `SimpleProtocol +v1` examples. + +In this example, rather than providing the input as an argument, it +would be piped into the parser, which is a more idiomatic Node.js stream +approach. + +```javascript +const util = require('util'); +const Transform = require('stream').Transform; +util.inherits(SimpleProtocol, Transform); + +function SimpleProtocol(options) { + if (!(this instanceof SimpleProtocol)) + return new SimpleProtocol(options); + + Transform.call(this, options); + this._inBody = false; + this._sawFirstCr = false; + this._rawHeader = []; + this.header = null; +} + +SimpleProtocol.prototype._transform = function(chunk, encoding, done) { + if (!this._inBody) { + // check if the chunk has a \n\n + var split = -1; + for (var i = 0; i < chunk.length; i++) { + if (chunk[i] === 10) { // '\n' + if (this._sawFirstCr) { + split = i; + break; + } else { + this._sawFirstCr = true; + } + } else { + this._sawFirstCr = false; + } + } + + if (split === -1) { + // still waiting for the \n\n + // stash the chunk, and try again. + this._rawHeader.push(chunk); + } else { + this._inBody = true; + var h = chunk.slice(0, split); + this._rawHeader.push(h); + var header = Buffer.concat(this._rawHeader).toString(); + try { + this.header = JSON.parse(header); + } catch (er) { + this.emit('error', new Error('invalid simple protocol data')); + return; + } + // and let them know that we are done parsing the header. + this.emit('header', this.header); + + // now, because we got some extra data, emit this first. + this.push(chunk.slice(split)); + } + } else { + // from there on, just provide the data to our consumer as-is. + this.push(chunk); + } + done(); +}; + +// Usage: +// var parser = new SimpleProtocol(); +// source.pipe(parser) +// Now parser is a readable stream that will emit 'header' +// with the parsed header data. +``` + +### Class: stream.Writable + + + +`stream.Writable` is an abstract class designed to be extended with an +underlying implementation of the +[`stream._write(chunk, encoding, callback)`][stream-_write] method. + +Please see [API for Stream Consumers][] for how to consume +writable streams in your programs. What follows is an explanation of +how to implement Writable streams in your programs. + +#### new stream.Writable([options]) + +* `options` {Object} + * `highWaterMark` {Number} Buffer level when + [`stream.write()`][stream-write] starts returning `false`. Default = `16384` + (16kb), or `16` for `objectMode` streams. + * `decodeStrings` {Boolean} Whether or not to decode strings into + Buffers before passing them to [`stream._write()`][stream-_write]. + Default = `true` + * `objectMode` {Boolean} Whether or not the + [`stream.write(anyObj)`][stream-write] is a valid operation. If set you can + write arbitrary data instead of only `Buffer` / `String` data. + Default = `false` + * `write` {Function} Implementation for the + [`stream._write()`][stream-_write] method. + * `writev` {Function} Implementation for the + [`stream._writev()`][stream-_writev] method. + +In classes that extend the Writable class, make sure to call the +constructor so that the buffering settings can be properly +initialized. + +#### writable.\_write(chunk, encoding, callback) + +* `chunk` {Buffer|String} The chunk to be written. Will **always** + be a buffer unless the `decodeStrings` option was set to `false`. +* `encoding` {String} If the chunk is a string, then this is the + encoding type. If chunk is a buffer, then this is the special + value - 'buffer', ignore it in this case. +* `callback` {Function} Call this function (optionally with an error + argument) when you are done processing the supplied chunk. + +All Writable stream implementations must provide a +[`stream._write()`][stream-_write] method to send data to the underlying +resource. + +Note: **This function MUST NOT be called directly.** It should be +implemented by child classes, and called by the internal Writable +class methods only. + +Call the callback using the standard `callback(error)` pattern to +signal that the write completed successfully or with an error. + +If the `decodeStrings` flag is set in the constructor options, then +`chunk` may be a string rather than a Buffer, and `encoding` will +indicate the sort of string that it is. This is to support +implementations that have an optimized handling for certain string +data encodings. If you do not explicitly set the `decodeStrings` +option to `false`, then you can safely ignore the `encoding` argument, +and assume that `chunk` will always be a Buffer. + +This method is prefixed with an underscore because it is internal to +the class that defines it, and should not be called directly by user +programs. However, you **are** expected to override this method in +your own extension classes. + +#### writable.\_writev(chunks, callback) + +* `chunks` {Array} The chunks to be written. Each chunk has following + format: `{ chunk: ..., encoding: ... }`. +* `callback` {Function} Call this function (optionally with an error + argument) when you are done processing the supplied chunks. + +Note: **This function MUST NOT be called directly.** It may be +implemented by child classes, and called by the internal Writable +class methods only. + +This function is completely optional to implement. In most cases it is +unnecessary. If implemented, it will be called with all the chunks +that are buffered in the write queue. + + +## Simplified Constructor API + + + +In simple cases there is now the added benefit of being able to construct a +stream without inheritance. + +This can be done by passing the appropriate methods as constructor options: + +Examples: + +### Duplex + +```js +var duplex = new stream.Duplex({ + read: function(n) { + // sets this._read under the hood + + // push data onto the read queue, passing null + // will signal the end of the stream (EOF) + this.push(chunk); + }, + write: function(chunk, encoding, next) { + // sets this._write under the hood + + // An optional error can be passed as the first argument + next() + } +}); + +// or + +var duplex = new stream.Duplex({ + read: function(n) { + // sets this._read under the hood + + // push data onto the read queue, passing null + // will signal the end of the stream (EOF) + this.push(chunk); + }, + writev: function(chunks, next) { + // sets this._writev under the hood + + // An optional error can be passed as the first argument + next() + } +}); +``` + +### Readable + +```js +var readable = new stream.Readable({ + read: function(n) { + // sets this._read under the hood + + // push data onto the read queue, passing null + // will signal the end of the stream (EOF) + this.push(chunk); + } +}); +``` + +### Transform + +```js +var transform = new stream.Transform({ + transform: function(chunk, encoding, next) { + // sets this._transform under the hood + + // generate output as many times as needed + // this.push(chunk); + + // call when the current chunk is consumed + next(); + }, + flush: function(done) { + // sets this._flush under the hood + + // generate output as many times as needed + // this.push(chunk); + + done(); + } +}); +``` + +### Writable + +```js +var writable = new stream.Writable({ + write: function(chunk, encoding, next) { + // sets this._write under the hood + + // An optional error can be passed as the first argument + next() + } +}); + +// or + +var writable = new stream.Writable({ + writev: function(chunks, next) { + // sets this._writev under the hood + + // An optional error can be passed as the first argument + next() + } +}); +``` + +## Streams: Under the Hood + + + +### Buffering + + + +Both Writable and Readable streams will buffer data on an internal +object which can be retrieved from `_writableState.getBuffer()` or +`_readableState.buffer`, respectively. + +The amount of data that will potentially be buffered depends on the +`highWaterMark` option which is passed into the constructor. + +Buffering in Readable streams happens when the implementation calls +[`stream.push(chunk)`][stream-push]. If the consumer of the Stream does not +call [`stream.read()`][stream-read], then the data will sit in the internal +queue until it is consumed. + +Buffering in Writable streams happens when the user calls +[`stream.write(chunk)`][stream-write] repeatedly, even when it returns `false`. + +The purpose of streams, especially with the [`stream.pipe()`][] method, is to +limit the buffering of data to acceptable levels, so that sources and +destinations of varying speed will not overwhelm the available memory. + +### Compatibility with Older Node.js Versions + + + +In versions of Node.js prior to v0.10, the Readable stream interface was +simpler, but also less powerful and less useful. + +* Rather than waiting for you to call the [`stream.read()`][stream-read] method, + [`'data'`][] events would start emitting immediately. If you needed to do + some I/O to decide how to handle data, then you had to store the chunks + in some kind of buffer so that they would not be lost. +* The [`stream.pause()`][stream-pause] method was advisory, rather than + guaranteed. This meant that you still had to be prepared to receive + [`'data'`][] events even when the stream was in a paused state. + +In Node.js v0.10, the [Readable][] class was added. +For backwards compatibility with older Node.js programs, Readable streams +switch into "flowing mode" when a [`'data'`][] event handler is added, or +when the [`stream.resume()`][stream-resume] method is called. The effect is +that, even if you are not using the new [`stream.read()`][stream-read] method +and [`'readable'`][] event, you no longer have to worry about losing +[`'data'`][] chunks. + +Most programs will continue to function normally. However, this +introduces an edge case in the following conditions: + +* No [`'data'`][] event handler is added. +* The [`stream.resume()`][stream-resume] method is never called. +* The stream is not piped to any writable destination. + +For example, consider the following code: + +```js +// WARNING! BROKEN! +net.createServer((socket) => { + + // we add an 'end' method, but never consume the data + socket.on('end', () => { + // It will never get here. + socket.end('I got your message (but didnt read it)\n'); + }); + +}).listen(1337); +``` + +In versions of Node.js prior to v0.10, the incoming message data would be +simply discarded. However, in Node.js v0.10 and beyond, +the socket will remain paused forever. + +The workaround in this situation is to call the +[`stream.resume()`][stream-resume] method to start the flow of data: + +```js +// Workaround +net.createServer((socket) => { + + socket.on('end', () => { + socket.end('I got your message (but didnt read it)\n'); + }); + + // start the flow of data, discarding it. + socket.resume(); + +}).listen(1337); +``` + +In addition to new Readable streams switching into flowing mode, +pre-v0.10 style streams can be wrapped in a Readable class using the +[`stream.wrap()`][] method. + + +### Object Mode + + + +Normally, Streams operate on Strings and Buffers exclusively. + +Streams that are in **object mode** can emit generic JavaScript values +other than Buffers and Strings. + +A Readable stream in object mode will always return a single item from +a call to [`stream.read(size)`][stream-read], regardless of what the size +argument is. + +A Writable stream in object mode will always ignore the `encoding` +argument to [`stream.write(data, encoding)`][stream-write]. + +The special value `null` still retains its special value for object +mode streams. That is, for object mode readable streams, `null` as a +return value from [`stream.read()`][stream-read] indicates that there is no more +data, and [`stream.push(null)`][stream-push] will signal the end of stream data +(`EOF`). + +No streams in Node.js core are object mode streams. This pattern is only +used by userland streaming libraries. + +You should set `objectMode` in your stream child class constructor on +the options object. Setting `objectMode` mid-stream is not safe. + +For Duplex streams `objectMode` can be set exclusively for readable or +writable side with `readableObjectMode` and `writableObjectMode` +respectively. These options can be used to implement parsers and +serializers with Transform streams. + +```js +const util = require('util'); +const StringDecoder = require('string_decoder').StringDecoder; +const Transform = require('stream').Transform; +util.inherits(JSONParseStream, Transform); + +// Gets \n-delimited JSON string data, and emits the parsed objects +function JSONParseStream() { + if (!(this instanceof JSONParseStream)) + return new JSONParseStream(); + + Transform.call(this, { readableObjectMode : true }); + + this._buffer = ''; + this._decoder = new StringDecoder('utf8'); +} + +JSONParseStream.prototype._transform = function(chunk, encoding, cb) { + this._buffer += this._decoder.write(chunk); + // split on newlines + var lines = this._buffer.split(/\r?\n/); + // keep the last partial line buffered + this._buffer = lines.pop(); + for (var l = 0; l < lines.length; l++) { + var line = lines[l]; + try { + var obj = JSON.parse(line); + } catch (er) { + this.emit('error', er); + return; + } + // push the parsed object out to the readable consumer + this.push(obj); + } + cb(); +}; + +JSONParseStream.prototype._flush = function(cb) { + // Just handle any leftover + var rem = this._buffer.trim(); + if (rem) { + try { + var obj = JSON.parse(rem); + } catch (er) { + this.emit('error', er); + return; + } + // push the parsed object out to the readable consumer + this.push(obj); + } + cb(); +}; +``` + +### `stream.read(0)` + +There are some cases where you want to trigger a refresh of the +underlying readable stream mechanisms, without actually consuming any +data. In that case, you can call `stream.read(0)`, which will always +return null. + +If the internal read buffer is below the `highWaterMark`, and the +stream is not currently reading, then calling `stream.read(0)` will trigger +a low-level [`stream._read()`][stream-_read] call. + +There is almost never a need to do this. However, you will see some +cases in Node.js's internals where this is done, particularly in the +Readable stream class internals. + +### `stream.push('')` + +Pushing a zero-byte string or Buffer (when not in [Object mode][]) has an +interesting side effect. Because it *is* a call to +[`stream.push()`][stream-push], it will end the `reading` process. However, it +does *not* add any data to the readable buffer, so there's nothing for +a user to consume. + +Very rarely, there are cases where you have no data to provide now, +but the consumer of your stream (or, perhaps, another bit of your own +code) will know when to check again, by calling [`stream.read(0)`][stream-read]. +In those cases, you *may* call `stream.push('')`. + +So far, the only use case for this functionality is in the +[`tls.CryptoStream`][] class, which is deprecated in Node.js/io.js v1.0. If you +find that you have to use `stream.push('')`, please consider another +approach, because it almost certainly indicates that something is +horribly wrong. + +[`'data'`]: #stream_event_data +[`'drain'`]: #stream_event_drain +[`'end'`]: #stream_event_end +[`'finish'`]: #stream_event_finish +[`'readable'`]: #stream_event_readable +[`buf.toString(encoding)`]: https://nodejs.org/docs/v5.8.0/api/buffer.html#buffer_buf_tostring_encoding_start_end +[`EventEmitter`]: https://nodejs.org/docs/v5.8.0/api/events.html#events_class_eventemitter +[`process.stderr`]: https://nodejs.org/docs/v5.8.0/api/process.html#process_process_stderr +[`process.stdin`]: https://nodejs.org/docs/v5.8.0/api/process.html#process_process_stdin +[`process.stdout`]: https://nodejs.org/docs/v5.8.0/api/process.html#process_process_stdout +[`stream.cork()`]: #stream_writable_cork +[`stream.pipe()`]: #stream_readable_pipe_destination_options +[`stream.uncork()`]: #stream_writable_uncork +[`stream.unpipe()`]: #stream_readable_unpipe_destination +[`stream.wrap()`]: #stream_readable_wrap_stream +[`tls.CryptoStream`]: https://nodejs.org/docs/v5.8.0/api/tls.html#tls_class_cryptostream +[`util.inherits()`]: https://nodejs.org/docs/v5.8.0/api/util.html#util_util_inherits_constructor_superconstructor +[API for Stream Consumers]: #stream_api_for_stream_consumers +[API for Stream Implementors]: #stream_api_for_stream_implementors +[child process stdin]: https://nodejs.org/docs/v5.8.0/api/child_process.html#child_process_child_stdin +[child process stdout and stderr]: https://nodejs.org/docs/v5.8.0/api/child_process.html#child_process_child_stdout +[Compatibility]: #stream_compatibility_with_older_node_js_versions +[crypto]: crypto.html +[Duplex]: #stream_class_stream_duplex +[fs read streams]: https://nodejs.org/docs/v5.8.0/api/fs.html#fs_class_fs_readstream +[fs write streams]: https://nodejs.org/docs/v5.8.0/api/fs.html#fs_class_fs_writestream +[HTTP requests, on the client]: https://nodejs.org/docs/v5.8.0/api/http.html#http_class_http_clientrequest +[HTTP responses, on the server]: https://nodejs.org/docs/v5.8.0/api/http.html#http_class_http_serverresponse +[http-incoming-message]: https://nodejs.org/docs/v5.8.0/api/http.html#http_class_http_incomingmessage +[Object mode]: #stream_object_mode +[Readable]: #stream_class_stream_readable +[SimpleProtocol v2]: #stream_example_simpleprotocol_parser_v2 +[stream-_flush]: #stream_transform_flush_callback +[stream-_read]: #stream_readable_read_size_1 +[stream-_transform]: #stream_transform_transform_chunk_encoding_callback +[stream-_write]: #stream_writable_write_chunk_encoding_callback_1 +[stream-_writev]: #stream_writable_writev_chunks_callback +[stream-end]: #stream_writable_end_chunk_encoding_callback +[stream-pause]: #stream_readable_pause +[stream-push]: #stream_readable_push_chunk_encoding +[stream-read]: #stream_readable_read_size +[stream-resume]: #stream_readable_resume +[stream-write]: #stream_writable_write_chunk_encoding_callback +[TCP sockets]: https://nodejs.org/docs/v5.8.0/api/net.html#net_class_net_socket +[Transform]: #stream_class_stream_transform +[Writable]: #stream_class_stream_writable +[zlib]: zlib.html diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md new file mode 100644 index 00000000..c141a99c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md @@ -0,0 +1,58 @@ +# streams WG Meeting 2015-01-30 + +## Links + +* **Google Hangouts Video**: http://www.youtube.com/watch?v=I9nDOSGfwZg +* **GitHub Issue**: https://github.com/iojs/readable-stream/issues/106 +* **Original Minutes Google Doc**: https://docs.google.com/document/d/17aTgLnjMXIrfjgNaTUnHQO7m3xgzHR2VXBTmi03Qii4/ + +## Agenda + +Extracted from https://github.com/iojs/readable-stream/labels/wg-agenda prior to meeting. + +* adopt a charter [#105](https://github.com/iojs/readable-stream/issues/105) +* release and versioning strategy [#101](https://github.com/iojs/readable-stream/issues/101) +* simpler stream creation [#102](https://github.com/iojs/readable-stream/issues/102) +* proposal: deprecate implicit flowing of streams [#99](https://github.com/iojs/readable-stream/issues/99) + +## Minutes + +### adopt a charter + +* group: +1's all around + +### What versioning scheme should be adopted? +* group: +1’s 3.0.0 +* domenic+group: pulling in patches from other sources where appropriate +* mikeal: version independently, suggesting versions for io.js +* mikeal+domenic: work with TC to notify in advance of changes +simpler stream creation + +### streamline creation of streams +* sam: streamline creation of streams +* domenic: nice simple solution posted + but, we lose the opportunity to change the model + may not be backwards incompatible (double check keys) + + **action item:** domenic will check + +### remove implicit flowing of streams on(‘data’) +* add isFlowing / isPaused +* mikeal: worrying that we’re documenting polyfill methods – confuses users +* domenic: more reflective API is probably good, with warning labels for users +* new section for mad scientists (reflective stream access) +* calvin: name the “third state” +* mikeal: maybe borrow the name from whatwg? +* domenic: we’re missing the “third state” +* consensus: kind of difficult to name the third state +* mikeal: figure out differences in states / compat +* mathias: always flow on data – eliminates third state + * explore what it breaks + +**action items:** +* ask isaac for ability to list packages by what public io.js APIs they use (esp. Stream) +* ask rod/build for infrastructure +* **chris**: explore the “flow on data” approach +* add isPaused/isFlowing +* add new docs section +* move isPaused to that section diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/duplex.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/duplex.js new file mode 100644 index 00000000..ca807af8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/duplex.js @@ -0,0 +1 @@ +module.exports = require("./lib/_stream_duplex.js") diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js new file mode 100644 index 00000000..736693b8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js @@ -0,0 +1,75 @@ +// a duplex stream is just a stream that is both readable and writable. +// Since JS doesn't have multiple prototypal inheritance, this class +// prototypally inherits from Readable, and then parasitically from +// Writable. + +'use strict'; + +/**/ + +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) { + keys.push(key); + }return keys; +}; +/**/ + +module.exports = Duplex; + +/**/ +var processNextTick = require('process-nextick-args'); +/**/ + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +var Readable = require('./_stream_readable'); +var Writable = require('./_stream_writable'); + +util.inherits(Duplex, Readable); + +var keys = objectKeys(Writable.prototype); +for (var v = 0; v < keys.length; v++) { + var method = keys[v]; + if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; +} + +function Duplex(options) { + if (!(this instanceof Duplex)) return new Duplex(options); + + Readable.call(this, options); + Writable.call(this, options); + + if (options && options.readable === false) this.readable = false; + + if (options && options.writable === false) this.writable = false; + + this.allowHalfOpen = true; + if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; + + this.once('end', onend); +} + +// the no-half-open enforcer +function onend() { + // if we allow half-open state, or if the writable side ended, + // then we're ok. + if (this.allowHalfOpen || this._writableState.ended) return; + + // no more data can be written. + // But allow more writes to happen in this tick. + processNextTick(onEndNT, this); +} + +function onEndNT(self) { + self.end(); +} + +function forEach(xs, f) { + for (var i = 0, l = xs.length; i < l; i++) { + f(xs[i], i); + } +} \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js new file mode 100644 index 00000000..d06f71f1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js @@ -0,0 +1,26 @@ +// a passthrough stream. +// basically just the most minimal sort of Transform stream. +// Every written chunk gets output as-is. + +'use strict'; + +module.exports = PassThrough; + +var Transform = require('./_stream_transform'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +util.inherits(PassThrough, Transform); + +function PassThrough(options) { + if (!(this instanceof PassThrough)) return new PassThrough(options); + + Transform.call(this, options); +} + +PassThrough.prototype._transform = function (chunk, encoding, cb) { + cb(null, chunk); +}; \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js new file mode 100644 index 00000000..54a9d5c5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js @@ -0,0 +1,880 @@ +'use strict'; + +module.exports = Readable; + +/**/ +var processNextTick = require('process-nextick-args'); +/**/ + +/**/ +var isArray = require('isarray'); +/**/ + +/**/ +var Buffer = require('buffer').Buffer; +/**/ + +Readable.ReadableState = ReadableState; + +var EE = require('events'); + +/**/ +var EElistenerCount = function (emitter, type) { + return emitter.listeners(type).length; +}; +/**/ + +/**/ +var Stream; +(function () { + try { + Stream = require('st' + 'ream'); + } catch (_) {} finally { + if (!Stream) Stream = require('events').EventEmitter; + } +})(); +/**/ + +var Buffer = require('buffer').Buffer; + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +/**/ +var debugUtil = require('util'); +var debug = undefined; +if (debugUtil && debugUtil.debuglog) { + debug = debugUtil.debuglog('stream'); +} else { + debug = function () {}; +} +/**/ + +var StringDecoder; + +util.inherits(Readable, Stream); + +var Duplex; +function ReadableState(options, stream) { + Duplex = Duplex || require('./_stream_duplex'); + + options = options || {}; + + // object stream flag. Used to make read(n) ignore n and to + // make all the buffer merging and length checks go away + this.objectMode = !!options.objectMode; + + if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode; + + // the point at which it stops calling _read() to fill the buffer + // Note: 0 is a valid value, means "don't call _read preemptively ever" + var hwm = options.highWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; + + // cast to ints. + this.highWaterMark = ~ ~this.highWaterMark; + + this.buffer = []; + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = null; + this.ended = false; + this.endEmitted = false; + this.reading = false; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // whenever we return null, then we set a flag to say + // that we're awaiting a 'readable' event emission. + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + this.resumeScheduled = false; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // when piping, we only care about 'readable' events that happen + // after read()ing all the bytes and not getting any pushback. + this.ranOut = false; + + // the number of writers that are awaiting a drain event in .pipe()s + this.awaitDrain = 0; + + // if true, a maybeReadMore has been scheduled + this.readingMore = false; + + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; + } +} + +var Duplex; +function Readable(options) { + Duplex = Duplex || require('./_stream_duplex'); + + if (!(this instanceof Readable)) return new Readable(options); + + this._readableState = new ReadableState(options, this); + + // legacy + this.readable = true; + + if (options && typeof options.read === 'function') this._read = options.read; + + Stream.call(this); +} + +// Manually shove something into the read() buffer. +// This returns true if the highWaterMark has not been hit yet, +// similar to how Writable.write() returns true if you should +// write() some more. +Readable.prototype.push = function (chunk, encoding) { + var state = this._readableState; + + if (!state.objectMode && typeof chunk === 'string') { + encoding = encoding || state.defaultEncoding; + if (encoding !== state.encoding) { + chunk = new Buffer(chunk, encoding); + encoding = ''; + } + } + + return readableAddChunk(this, state, chunk, encoding, false); +}; + +// Unshift should *always* be something directly out of read() +Readable.prototype.unshift = function (chunk) { + var state = this._readableState; + return readableAddChunk(this, state, chunk, '', true); +}; + +Readable.prototype.isPaused = function () { + return this._readableState.flowing === false; +}; + +function readableAddChunk(stream, state, chunk, encoding, addToFront) { + var er = chunkInvalid(state, chunk); + if (er) { + stream.emit('error', er); + } else if (chunk === null) { + state.reading = false; + onEofChunk(stream, state); + } else if (state.objectMode || chunk && chunk.length > 0) { + if (state.ended && !addToFront) { + var e = new Error('stream.push() after EOF'); + stream.emit('error', e); + } else if (state.endEmitted && addToFront) { + var e = new Error('stream.unshift() after end event'); + stream.emit('error', e); + } else { + var skipAdd; + if (state.decoder && !addToFront && !encoding) { + chunk = state.decoder.write(chunk); + skipAdd = !state.objectMode && chunk.length === 0; + } + + if (!addToFront) state.reading = false; + + // Don't add to the buffer if we've decoded to an empty string chunk and + // we're not in object mode + if (!skipAdd) { + // if we want the data now, just emit it. + if (state.flowing && state.length === 0 && !state.sync) { + stream.emit('data', chunk); + stream.read(0); + } else { + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); + + if (state.needReadable) emitReadable(stream); + } + } + + maybeReadMore(stream, state); + } + } else if (!addToFront) { + state.reading = false; + } + + return needMoreData(state); +} + +// if it's past the high water mark, we can push in some more. +// Also, if we have no data yet, we can stand some +// more bytes. This is to work around cases where hwm=0, +// such as the repl. Also, if the push() triggered a +// readable event, and the user called read(largeNumber) such that +// needReadable was set, then we ought to push more, so that another +// 'readable' event will be triggered. +function needMoreData(state) { + return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); +} + +// backwards compatibility. +Readable.prototype.setEncoding = function (enc) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + this._readableState.decoder = new StringDecoder(enc); + this._readableState.encoding = enc; + return this; +}; + +// Don't raise the hwm > 8MB +var MAX_HWM = 0x800000; +function computeNewHighWaterMark(n) { + if (n >= MAX_HWM) { + n = MAX_HWM; + } else { + // Get the next highest power of 2 + n--; + n |= n >>> 1; + n |= n >>> 2; + n |= n >>> 4; + n |= n >>> 8; + n |= n >>> 16; + n++; + } + return n; +} + +function howMuchToRead(n, state) { + if (state.length === 0 && state.ended) return 0; + + if (state.objectMode) return n === 0 ? 0 : 1; + + if (n === null || isNaN(n)) { + // only flow one buffer at a time + if (state.flowing && state.buffer.length) return state.buffer[0].length;else return state.length; + } + + if (n <= 0) return 0; + + // If we're asking for more than the target buffer level, + // then raise the water mark. Bump up to the next highest + // power of 2, to prevent increasing it excessively in tiny + // amounts. + if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); + + // don't have that much. return null, unless we've ended. + if (n > state.length) { + if (!state.ended) { + state.needReadable = true; + return 0; + } else { + return state.length; + } + } + + return n; +} + +// you can override either this method, or the async _read(n) below. +Readable.prototype.read = function (n) { + debug('read', n); + var state = this._readableState; + var nOrig = n; + + if (typeof n !== 'number' || n > 0) state.emittedReadable = false; + + // if we're doing read(0) to trigger a readable event, but we + // already have a bunch of data in the buffer, then just trigger + // the 'readable' event and move on. + if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { + debug('read: emitReadable', state.length, state.ended); + if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); + return null; + } + + n = howMuchToRead(n, state); + + // if we've ended, and we're now clear, then finish it up. + if (n === 0 && state.ended) { + if (state.length === 0) endReadable(this); + return null; + } + + // All the actual chunk generation logic needs to be + // *below* the call to _read. The reason is that in certain + // synthetic stream cases, such as passthrough streams, _read + // may be a completely synchronous operation which may change + // the state of the read buffer, providing enough data when + // before there was *not* enough. + // + // So, the steps are: + // 1. Figure out what the state of things will be after we do + // a read from the buffer. + // + // 2. If that resulting state will trigger a _read, then call _read. + // Note that this may be asynchronous, or synchronous. Yes, it is + // deeply ugly to write APIs this way, but that still doesn't mean + // that the Readable class should behave improperly, as streams are + // designed to be sync/async agnostic. + // Take note if the _read call is sync or async (ie, if the read call + // has returned yet), so that we know whether or not it's safe to emit + // 'readable' etc. + // + // 3. Actually pull the requested chunks out of the buffer and return. + + // if we need a readable event, then we need to do some reading. + var doRead = state.needReadable; + debug('need readable', doRead); + + // if we currently have less than the highWaterMark, then also read some + if (state.length === 0 || state.length - n < state.highWaterMark) { + doRead = true; + debug('length less than watermark', doRead); + } + + // however, if we've ended, then there's no point, and if we're already + // reading, then it's unnecessary. + if (state.ended || state.reading) { + doRead = false; + debug('reading or ended', doRead); + } + + if (doRead) { + debug('do read'); + state.reading = true; + state.sync = true; + // if the length is currently zero, then we *need* a readable event. + if (state.length === 0) state.needReadable = true; + // call internal read method + this._read(state.highWaterMark); + state.sync = false; + } + + // If _read pushed data synchronously, then `reading` will be false, + // and we need to re-evaluate how much data we can return to the user. + if (doRead && !state.reading) n = howMuchToRead(nOrig, state); + + var ret; + if (n > 0) ret = fromList(n, state);else ret = null; + + if (ret === null) { + state.needReadable = true; + n = 0; + } + + state.length -= n; + + // If we have nothing in the buffer, then we want to know + // as soon as we *do* get something into the buffer. + if (state.length === 0 && !state.ended) state.needReadable = true; + + // If we tried to read() past the EOF, then emit end on the next tick. + if (nOrig !== n && state.ended && state.length === 0) endReadable(this); + + if (ret !== null) this.emit('data', ret); + + return ret; +}; + +function chunkInvalid(state, chunk) { + var er = null; + if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + return er; +} + +function onEofChunk(stream, state) { + if (state.ended) return; + if (state.decoder) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) { + state.buffer.push(chunk); + state.length += state.objectMode ? 1 : chunk.length; + } + } + state.ended = true; + + // emit 'readable' now to make sure it gets picked up. + emitReadable(stream); +} + +// Don't emit readable right away in sync mode, because this can trigger +// another read() call => stack overflow. This way, it might trigger +// a nextTick recursion warning, but that's not so bad. +function emitReadable(stream) { + var state = stream._readableState; + state.needReadable = false; + if (!state.emittedReadable) { + debug('emitReadable', state.flowing); + state.emittedReadable = true; + if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream); + } +} + +function emitReadable_(stream) { + debug('emit readable'); + stream.emit('readable'); + flow(stream); +} + +// at this point, the user has presumably seen the 'readable' event, +// and called read() to consume some data. that may have triggered +// in turn another _read(n) call, in which case reading = true if +// it's in progress. +// However, if we're not ended, or reading, and the length < hwm, +// then go ahead and try to read some more preemptively. +function maybeReadMore(stream, state) { + if (!state.readingMore) { + state.readingMore = true; + processNextTick(maybeReadMore_, stream, state); + } +} + +function maybeReadMore_(stream, state) { + var len = state.length; + while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { + debug('maybeReadMore read 0'); + stream.read(0); + if (len === state.length) + // didn't get any data, stop spinning. + break;else len = state.length; + } + state.readingMore = false; +} + +// abstract method. to be overridden in specific implementation classes. +// call cb(er, data) where data is <= n in length. +// for virtual (non-string, non-buffer) streams, "length" is somewhat +// arbitrary, and perhaps not very meaningful. +Readable.prototype._read = function (n) { + this.emit('error', new Error('not implemented')); +}; + +Readable.prototype.pipe = function (dest, pipeOpts) { + var src = this; + var state = this._readableState; + + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; + case 1: + state.pipes = [state.pipes, dest]; + break; + default: + state.pipes.push(dest); + break; + } + state.pipesCount += 1; + debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); + + var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; + + var endFn = doEnd ? onend : cleanup; + if (state.endEmitted) processNextTick(endFn);else src.once('end', endFn); + + dest.on('unpipe', onunpipe); + function onunpipe(readable) { + debug('onunpipe'); + if (readable === src) { + cleanup(); + } + } + + function onend() { + debug('onend'); + dest.end(); + } + + // when the dest drains, it reduces the awaitDrain counter + // on the source. This would be more elegant with a .once() + // handler in flow(), but adding and removing repeatedly is + // too slow. + var ondrain = pipeOnDrain(src); + dest.on('drain', ondrain); + + var cleanedUp = false; + function cleanup() { + debug('cleanup'); + // cleanup event handlers once the pipe is broken + dest.removeListener('close', onclose); + dest.removeListener('finish', onfinish); + dest.removeListener('drain', ondrain); + dest.removeListener('error', onerror); + dest.removeListener('unpipe', onunpipe); + src.removeListener('end', onend); + src.removeListener('end', cleanup); + src.removeListener('data', ondata); + + cleanedUp = true; + + // if the reader is waiting for a drain event from this + // specific writer, then it would cause it to never start + // flowing again. + // So, if this is awaiting a drain, then we just call it now. + // If we don't know, then assume that we are waiting for one. + if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); + } + + src.on('data', ondata); + function ondata(chunk) { + debug('ondata'); + var ret = dest.write(chunk); + if (false === ret) { + // If the user unpiped during `dest.write()`, it is possible + // to get stuck in a permanently paused state if that write + // also returned false. + if (state.pipesCount === 1 && state.pipes[0] === dest && src.listenerCount('data') === 1 && !cleanedUp) { + debug('false write response, pause', src._readableState.awaitDrain); + src._readableState.awaitDrain++; + } + src.pause(); + } + } + + // if the dest has an error, then stop piping into it. + // however, don't suppress the throwing behavior for this. + function onerror(er) { + debug('onerror', er); + unpipe(); + dest.removeListener('error', onerror); + if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); + } + // This is a brutally ugly hack to make sure that our error handler + // is attached before any userland ones. NEVER DO THIS. + if (!dest._events || !dest._events.error) dest.on('error', onerror);else if (isArray(dest._events.error)) dest._events.error.unshift(onerror);else dest._events.error = [onerror, dest._events.error]; + + // Both close and finish should trigger unpipe, but only once. + function onclose() { + dest.removeListener('finish', onfinish); + unpipe(); + } + dest.once('close', onclose); + function onfinish() { + debug('onfinish'); + dest.removeListener('close', onclose); + unpipe(); + } + dest.once('finish', onfinish); + + function unpipe() { + debug('unpipe'); + src.unpipe(dest); + } + + // tell the dest that it's being piped to + dest.emit('pipe', src); + + // start the flow if it hasn't been started already. + if (!state.flowing) { + debug('pipe resume'); + src.resume(); + } + + return dest; +}; + +function pipeOnDrain(src) { + return function () { + var state = src._readableState; + debug('pipeOnDrain', state.awaitDrain); + if (state.awaitDrain) state.awaitDrain--; + if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { + state.flowing = true; + flow(src); + } + }; +} + +Readable.prototype.unpipe = function (dest) { + var state = this._readableState; + + // if we're not piping anywhere, then do nothing. + if (state.pipesCount === 0) return this; + + // just one destination. most common case. + if (state.pipesCount === 1) { + // passed in one, but it's not the right one. + if (dest && dest !== state.pipes) return this; + + if (!dest) dest = state.pipes; + + // got a match. + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + if (dest) dest.emit('unpipe', this); + return this; + } + + // slow case. multiple pipe destinations. + + if (!dest) { + // remove all. + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + + for (var _i = 0; _i < len; _i++) { + dests[_i].emit('unpipe', this); + }return this; + } + + // try to find the right one. + var i = indexOf(state.pipes, dest); + if (i === -1) return this; + + state.pipes.splice(i, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) state.pipes = state.pipes[0]; + + dest.emit('unpipe', this); + + return this; +}; + +// set up data events if they are asked for +// Ensure readable listeners eventually get something +Readable.prototype.on = function (ev, fn) { + var res = Stream.prototype.on.call(this, ev, fn); + + // If listening to data, and it has not explicitly been paused, + // then call resume to start the flow of data on the next tick. + if (ev === 'data' && false !== this._readableState.flowing) { + this.resume(); + } + + if (ev === 'readable' && !this._readableState.endEmitted) { + var state = this._readableState; + if (!state.readableListening) { + state.readableListening = true; + state.emittedReadable = false; + state.needReadable = true; + if (!state.reading) { + processNextTick(nReadingNextTick, this); + } else if (state.length) { + emitReadable(this, state); + } + } + } + + return res; +}; +Readable.prototype.addListener = Readable.prototype.on; + +function nReadingNextTick(self) { + debug('readable nexttick read 0'); + self.read(0); +} + +// pause() and resume() are remnants of the legacy readable stream API +// If the user uses them, then switch into old mode. +Readable.prototype.resume = function () { + var state = this._readableState; + if (!state.flowing) { + debug('resume'); + state.flowing = true; + resume(this, state); + } + return this; +}; + +function resume(stream, state) { + if (!state.resumeScheduled) { + state.resumeScheduled = true; + processNextTick(resume_, stream, state); + } +} + +function resume_(stream, state) { + if (!state.reading) { + debug('resume read 0'); + stream.read(0); + } + + state.resumeScheduled = false; + stream.emit('resume'); + flow(stream); + if (state.flowing && !state.reading) stream.read(0); +} + +Readable.prototype.pause = function () { + debug('call pause flowing=%j', this._readableState.flowing); + if (false !== this._readableState.flowing) { + debug('pause'); + this._readableState.flowing = false; + this.emit('pause'); + } + return this; +}; + +function flow(stream) { + var state = stream._readableState; + debug('flow', state.flowing); + if (state.flowing) { + do { + var chunk = stream.read(); + } while (null !== chunk && state.flowing); + } +} + +// wrap an old-style stream as the async data source. +// This is *not* part of the readable stream interface. +// It is an ugly unfortunate mess of history. +Readable.prototype.wrap = function (stream) { + var state = this._readableState; + var paused = false; + + var self = this; + stream.on('end', function () { + debug('wrapped end'); + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) self.push(chunk); + } + + self.push(null); + }); + + stream.on('data', function (chunk) { + debug('wrapped data'); + if (state.decoder) chunk = state.decoder.write(chunk); + + // don't skip over falsy values in objectMode + if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; + + var ret = self.push(chunk); + if (!ret) { + paused = true; + stream.pause(); + } + }); + + // proxy all the other methods. + // important when wrapping filters and duplexes. + for (var i in stream) { + if (this[i] === undefined && typeof stream[i] === 'function') { + this[i] = function (method) { + return function () { + return stream[method].apply(stream, arguments); + }; + }(i); + } + } + + // proxy certain important events. + var events = ['error', 'close', 'destroy', 'pause', 'resume']; + forEach(events, function (ev) { + stream.on(ev, self.emit.bind(self, ev)); + }); + + // when we try to consume some more bytes, simply unpause the + // underlying stream. + self._read = function (n) { + debug('wrapped _read', n); + if (paused) { + paused = false; + stream.resume(); + } + }; + + return self; +}; + +// exposed for testing purposes only. +Readable._fromList = fromList; + +// Pluck off n bytes from an array of buffers. +// Length is the combined lengths of all the buffers in the list. +function fromList(n, state) { + var list = state.buffer; + var length = state.length; + var stringMode = !!state.decoder; + var objectMode = !!state.objectMode; + var ret; + + // nothing in the list, definitely empty. + if (list.length === 0) return null; + + if (length === 0) ret = null;else if (objectMode) ret = list.shift();else if (!n || n >= length) { + // read it all, truncate the array. + if (stringMode) ret = list.join('');else if (list.length === 1) ret = list[0];else ret = Buffer.concat(list, length); + list.length = 0; + } else { + // read just some of it. + if (n < list[0].length) { + // just take a part of the first list item. + // slice is the same for buffers and strings. + var buf = list[0]; + ret = buf.slice(0, n); + list[0] = buf.slice(n); + } else if (n === list[0].length) { + // first list is a perfect match + ret = list.shift(); + } else { + // complex case. + // we have enough to cover it, but it spans past the first buffer. + if (stringMode) ret = '';else ret = new Buffer(n); + + var c = 0; + for (var i = 0, l = list.length; i < l && c < n; i++) { + var buf = list[0]; + var cpy = Math.min(n - c, buf.length); + + if (stringMode) ret += buf.slice(0, cpy);else buf.copy(ret, c, 0, cpy); + + if (cpy < buf.length) list[0] = buf.slice(cpy);else list.shift(); + + c += cpy; + } + } + } + + return ret; +} + +function endReadable(stream) { + var state = stream._readableState; + + // If we get here before consuming all the bytes, then that is a + // bug in node. Should never happen. + if (state.length > 0) throw new Error('endReadable called on non-empty stream'); + + if (!state.endEmitted) { + state.ended = true; + processNextTick(endReadableNT, state, stream); + } +} + +function endReadableNT(state, stream) { + // Check that we didn't get one last unshift. + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit('end'); + } +} + +function forEach(xs, f) { + for (var i = 0, l = xs.length; i < l; i++) { + f(xs[i], i); + } +} + +function indexOf(xs, x) { + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + return -1; +} \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js new file mode 100644 index 00000000..625cdc17 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js @@ -0,0 +1,180 @@ +// a transform stream is a readable/writable stream where you do +// something with the data. Sometimes it's called a "filter", +// but that's not a great name for it, since that implies a thing where +// some bits pass through, and others are simply ignored. (That would +// be a valid example of a transform, of course.) +// +// While the output is causally related to the input, it's not a +// necessarily symmetric or synchronous transformation. For example, +// a zlib stream might take multiple plain-text writes(), and then +// emit a single compressed chunk some time in the future. +// +// Here's how this works: +// +// The Transform stream has all the aspects of the readable and writable +// stream classes. When you write(chunk), that calls _write(chunk,cb) +// internally, and returns false if there's a lot of pending writes +// buffered up. When you call read(), that calls _read(n) until +// there's enough pending readable data buffered up. +// +// In a transform stream, the written data is placed in a buffer. When +// _read(n) is called, it transforms the queued up data, calling the +// buffered _write cb's as it consumes chunks. If consuming a single +// written chunk would result in multiple output chunks, then the first +// outputted bit calls the readcb, and subsequent chunks just go into +// the read buffer, and will cause it to emit 'readable' if necessary. +// +// This way, back-pressure is actually determined by the reading side, +// since _read has to be called to start processing a new chunk. However, +// a pathological inflate type of transform can cause excessive buffering +// here. For example, imagine a stream where every byte of input is +// interpreted as an integer from 0-255, and then results in that many +// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in +// 1kb of data being output. In this case, you could write a very small +// amount of input, and end up with a very large amount of output. In +// such a pathological inflating mechanism, there'd be no way to tell +// the system to stop doing the transform. A single 4MB write could +// cause the system to run out of memory. +// +// However, even in such a pathological case, only a single written chunk +// would be consumed, and then the rest would wait (un-transformed) until +// the results of the previous transformed chunk were consumed. + +'use strict'; + +module.exports = Transform; + +var Duplex = require('./_stream_duplex'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +util.inherits(Transform, Duplex); + +function TransformState(stream) { + this.afterTransform = function (er, data) { + return afterTransform(stream, er, data); + }; + + this.needTransform = false; + this.transforming = false; + this.writecb = null; + this.writechunk = null; + this.writeencoding = null; +} + +function afterTransform(stream, er, data) { + var ts = stream._transformState; + ts.transforming = false; + + var cb = ts.writecb; + + if (!cb) return stream.emit('error', new Error('no writecb in Transform class')); + + ts.writechunk = null; + ts.writecb = null; + + if (data !== null && data !== undefined) stream.push(data); + + cb(er); + + var rs = stream._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + stream._read(rs.highWaterMark); + } +} + +function Transform(options) { + if (!(this instanceof Transform)) return new Transform(options); + + Duplex.call(this, options); + + this._transformState = new TransformState(this); + + // when the writable side finishes, then flush out anything remaining. + var stream = this; + + // start out asking for a readable event once data is transformed. + this._readableState.needReadable = true; + + // we have implemented the _read method, and done the other things + // that Readable wants before the first _read call, so unset the + // sync guard flag. + this._readableState.sync = false; + + if (options) { + if (typeof options.transform === 'function') this._transform = options.transform; + + if (typeof options.flush === 'function') this._flush = options.flush; + } + + this.once('prefinish', function () { + if (typeof this._flush === 'function') this._flush(function (er) { + done(stream, er); + });else done(stream); + }); +} + +Transform.prototype.push = function (chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); +}; + +// This is the part where you do stuff! +// override this function in implementation classes. +// 'chunk' is an input chunk. +// +// Call `push(newChunk)` to pass along transformed output +// to the readable side. You may call 'push' zero or more times. +// +// Call `cb(err)` when you are done with this chunk. If you pass +// an error, then that'll put the hurt on the whole operation. If you +// never call cb(), then you'll never get another chunk. +Transform.prototype._transform = function (chunk, encoding, cb) { + throw new Error('not implemented'); +}; + +Transform.prototype._write = function (chunk, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk; + ts.writeencoding = encoding; + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); + } +}; + +// Doesn't matter what the args are here. +// _transform does all the work. +// That we got here means that the readable side wants more data. +Transform.prototype._read = function (n) { + var ts = this._transformState; + + if (ts.writechunk !== null && ts.writecb && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + // mark that we need a transform, so that any data that comes in + // will get processed, now that we've asked for it. + ts.needTransform = true; + } +}; + +function done(stream, er) { + if (er) return stream.emit('error', er); + + // if there's nothing in the write buffer, then that means + // that nothing more will ever be provided + var ws = stream._writableState; + var ts = stream._transformState; + + if (ws.length) throw new Error('calling transform done when ws.length != 0'); + + if (ts.transforming) throw new Error('calling transform done when still transforming'); + + return stream.push(null); +} \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js new file mode 100644 index 00000000..95916c99 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js @@ -0,0 +1,516 @@ +// A bit simpler than readable streams. +// Implement an async ._write(chunk, encoding, cb), and it'll handle all +// the drain event emission and buffering. + +'use strict'; + +module.exports = Writable; + +/**/ +var processNextTick = require('process-nextick-args'); +/**/ + +/**/ +var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick; +/**/ + +/**/ +var Buffer = require('buffer').Buffer; +/**/ + +Writable.WritableState = WritableState; + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +/**/ +var internalUtil = { + deprecate: require('util-deprecate') +}; +/**/ + +/**/ +var Stream; +(function () { + try { + Stream = require('st' + 'ream'); + } catch (_) {} finally { + if (!Stream) Stream = require('events').EventEmitter; + } +})(); +/**/ + +var Buffer = require('buffer').Buffer; + +util.inherits(Writable, Stream); + +function nop() {} + +function WriteReq(chunk, encoding, cb) { + this.chunk = chunk; + this.encoding = encoding; + this.callback = cb; + this.next = null; +} + +var Duplex; +function WritableState(options, stream) { + Duplex = Duplex || require('./_stream_duplex'); + + options = options || {}; + + // object stream flag to indicate whether or not this stream + // contains buffers or objects. + this.objectMode = !!options.objectMode; + + if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.writableObjectMode; + + // the point at which write() starts returning false + // Note: 0 is a valid value, means that we always return false if + // the entire buffer is not flushed immediately on write() + var hwm = options.highWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; + + // cast to ints. + this.highWaterMark = ~ ~this.highWaterMark; + + this.needDrain = false; + // at the start of calling end() + this.ending = false; + // when end() has been called, and returned + this.ended = false; + // when 'finish' is emitted + this.finished = false; + + // should we decode strings into buffers before passing to _write? + // this is here so that some node-core streams can optimize string + // handling at a lower level. + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // not an actual buffer we keep track of, but a measurement + // of how much we're waiting to get pushed to some underlying + // socket or file. + this.length = 0; + + // a flag to see when we're in the middle of a write. + this.writing = false; + + // when true all writes will be buffered until .uncork() call + this.corked = 0; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // a flag to know if we're processing previously buffered items, which + // may call the _write() callback in the same tick, so that we don't + // end up in an overlapped onwrite situation. + this.bufferProcessing = false; + + // the callback that's passed to _write(chunk,cb) + this.onwrite = function (er) { + onwrite(stream, er); + }; + + // the callback that the user supplies to write(chunk,encoding,cb) + this.writecb = null; + + // the amount that is being written when _write is called. + this.writelen = 0; + + this.bufferedRequest = null; + this.lastBufferedRequest = null; + + // number of pending user-supplied write callbacks + // this must be 0 before 'finish' can be emitted + this.pendingcb = 0; + + // emit prefinish if the only thing we're waiting for is _write cbs + // This is relevant for synchronous Transform streams + this.prefinished = false; + + // True if the error was already emitted and should not be thrown again + this.errorEmitted = false; + + // count buffered requests + this.bufferedRequestCount = 0; + + // create the two objects needed to store the corked requests + // they are not a linked list, as no new elements are inserted in there + this.corkedRequestsFree = new CorkedRequest(this); + this.corkedRequestsFree.next = new CorkedRequest(this); +} + +WritableState.prototype.getBuffer = function writableStateGetBuffer() { + var current = this.bufferedRequest; + var out = []; + while (current) { + out.push(current); + current = current.next; + } + return out; +}; + +(function () { + try { + Object.defineProperty(WritableState.prototype, 'buffer', { + get: internalUtil.deprecate(function () { + return this.getBuffer(); + }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.') + }); + } catch (_) {} +})(); + +var Duplex; +function Writable(options) { + Duplex = Duplex || require('./_stream_duplex'); + + // Writable ctor is applied to Duplexes, though they're not + // instanceof Writable, they're instanceof Readable. + if (!(this instanceof Writable) && !(this instanceof Duplex)) return new Writable(options); + + this._writableState = new WritableState(options, this); + + // legacy. + this.writable = true; + + if (options) { + if (typeof options.write === 'function') this._write = options.write; + + if (typeof options.writev === 'function') this._writev = options.writev; + } + + Stream.call(this); +} + +// Otherwise people can pipe Writable streams, which is just wrong. +Writable.prototype.pipe = function () { + this.emit('error', new Error('Cannot pipe. Not readable.')); +}; + +function writeAfterEnd(stream, cb) { + var er = new Error('write after end'); + // TODO: defer error events consistently everywhere, not just the cb + stream.emit('error', er); + processNextTick(cb, er); +} + +// If we get something that is not a buffer, string, null, or undefined, +// and we're not in objectMode, then that's an error. +// Otherwise stream chunks are all considered to be of length=1, and the +// watermarks determine how many objects to keep in the buffer, rather than +// how many bytes or characters. +function validChunk(stream, state, chunk, cb) { + var valid = true; + + if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) { + var er = new TypeError('Invalid non-string/buffer chunk'); + stream.emit('error', er); + processNextTick(cb, er); + valid = false; + } + return valid; +} + +Writable.prototype.write = function (chunk, encoding, cb) { + var state = this._writableState; + var ret = false; + + if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (Buffer.isBuffer(chunk)) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; + + if (typeof cb !== 'function') cb = nop; + + if (state.ended) writeAfterEnd(this, cb);else if (validChunk(this, state, chunk, cb)) { + state.pendingcb++; + ret = writeOrBuffer(this, state, chunk, encoding, cb); + } + + return ret; +}; + +Writable.prototype.cork = function () { + var state = this._writableState; + + state.corked++; +}; + +Writable.prototype.uncork = function () { + var state = this._writableState; + + if (state.corked) { + state.corked--; + + if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); + } +}; + +Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + // node::ParseEncoding() requires lower case. + if (typeof encoding === 'string') encoding = encoding.toLowerCase(); + if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); + this._writableState.defaultEncoding = encoding; +}; + +function decodeChunk(state, chunk, encoding) { + if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { + chunk = new Buffer(chunk, encoding); + } + return chunk; +} + +// if we're already writing something, then just put this +// in the queue, and wait our turn. Otherwise, call _write +// If we return false, then we need a drain event, so set that flag. +function writeOrBuffer(stream, state, chunk, encoding, cb) { + chunk = decodeChunk(state, chunk, encoding); + + if (Buffer.isBuffer(chunk)) encoding = 'buffer'; + var len = state.objectMode ? 1 : chunk.length; + + state.length += len; + + var ret = state.length < state.highWaterMark; + // we must ensure that previous needDrain will not be reset to false. + if (!ret) state.needDrain = true; + + if (state.writing || state.corked) { + var last = state.lastBufferedRequest; + state.lastBufferedRequest = new WriteReq(chunk, encoding, cb); + if (last) { + last.next = state.lastBufferedRequest; + } else { + state.bufferedRequest = state.lastBufferedRequest; + } + state.bufferedRequestCount += 1; + } else { + doWrite(stream, state, false, len, chunk, encoding, cb); + } + + return ret; +} + +function doWrite(stream, state, writev, len, chunk, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); + state.sync = false; +} + +function onwriteError(stream, state, sync, er, cb) { + --state.pendingcb; + if (sync) processNextTick(cb, er);else cb(er); + + stream._writableState.errorEmitted = true; + stream.emit('error', er); +} + +function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; +} + +function onwrite(stream, er) { + var state = stream._writableState; + var sync = state.sync; + var cb = state.writecb; + + onwriteStateUpdate(state); + + if (er) onwriteError(stream, state, sync, er, cb);else { + // Check if we're actually ready to finish, but don't emit yet + var finished = needFinish(state); + + if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { + clearBuffer(stream, state); + } + + if (sync) { + /**/ + asyncWrite(afterWrite, stream, state, finished, cb); + /**/ + } else { + afterWrite(stream, state, finished, cb); + } + } +} + +function afterWrite(stream, state, finished, cb) { + if (!finished) onwriteDrain(stream, state); + state.pendingcb--; + cb(); + finishMaybe(stream, state); +} + +// Must force callback to be called on nextTick, so that we don't +// emit 'drain' before the write() consumer gets the 'false' return +// value, and has a chance to attach a 'drain' listener. +function onwriteDrain(stream, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream.emit('drain'); + } +} + +// if there's something in the buffer waiting, then process it +function clearBuffer(stream, state) { + state.bufferProcessing = true; + var entry = state.bufferedRequest; + + if (stream._writev && entry && entry.next) { + // Fast case, write everything using _writev() + var l = state.bufferedRequestCount; + var buffer = new Array(l); + var holder = state.corkedRequestsFree; + holder.entry = entry; + + var count = 0; + while (entry) { + buffer[count] = entry; + entry = entry.next; + count += 1; + } + + doWrite(stream, state, true, state.length, buffer, '', holder.finish); + + // doWrite is always async, defer these to save a bit of time + // as the hot path ends with doWrite + state.pendingcb++; + state.lastBufferedRequest = null; + state.corkedRequestsFree = holder.next; + holder.next = null; + } else { + // Slow case, write chunks one-by-one + while (entry) { + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk.length; + + doWrite(stream, state, false, len, chunk, encoding, cb); + entry = entry.next; + // if we didn't call the onwrite immediately, then + // it means that we need to wait until it does. + // also, that means that the chunk and cb are currently + // being processed, so move the buffer counter past them. + if (state.writing) { + break; + } + } + + if (entry === null) state.lastBufferedRequest = null; + } + + state.bufferedRequestCount = 0; + state.bufferedRequest = entry; + state.bufferProcessing = false; +} + +Writable.prototype._write = function (chunk, encoding, cb) { + cb(new Error('not implemented')); +}; + +Writable.prototype._writev = null; + +Writable.prototype.end = function (chunk, encoding, cb) { + var state = this._writableState; + + if (typeof chunk === 'function') { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); + + // .end() fully uncorks + if (state.corked) { + state.corked = 1; + this.uncork(); + } + + // ignore unnecessary end() calls. + if (!state.ending && !state.finished) endWritable(this, state, cb); +}; + +function needFinish(state) { + return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; +} + +function prefinish(stream, state) { + if (!state.prefinished) { + state.prefinished = true; + stream.emit('prefinish'); + } +} + +function finishMaybe(stream, state) { + var need = needFinish(state); + if (need) { + if (state.pendingcb === 0) { + prefinish(stream, state); + state.finished = true; + stream.emit('finish'); + } else { + prefinish(stream, state); + } + } + return need; +} + +function endWritable(stream, state, cb) { + state.ending = true; + finishMaybe(stream, state); + if (cb) { + if (state.finished) processNextTick(cb);else stream.once('finish', cb); + } + state.ended = true; + stream.writable = false; +} + +// It seems a linked list but it is not +// there will be only 2 of these for each stream +function CorkedRequest(state) { + var _this = this; + + this.next = null; + this.entry = null; + + this.finish = function (err) { + var entry = _this.entry; + _this.entry = null; + while (entry) { + var cb = entry.callback; + state.pendingcb--; + cb(err); + entry = entry.next; + } + if (state.corkedRequestsFree) { + state.corkedRequestsFree.next = _this; + } else { + state.corkedRequestsFree = _this; + } + }; +} \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/LICENSE new file mode 100644 index 00000000..d8d7f943 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/LICENSE @@ -0,0 +1,19 @@ +Copyright Node.js contributors. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/README.md new file mode 100644 index 00000000..5a76b414 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/README.md @@ -0,0 +1,3 @@ +# core-util-is + +The `util.is*` functions introduced in Node v0.12. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/float.patch b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/float.patch new file mode 100644 index 00000000..a06d5c05 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/float.patch @@ -0,0 +1,604 @@ +diff --git a/lib/util.js b/lib/util.js +index a03e874..9074e8e 100644 +--- a/lib/util.js ++++ b/lib/util.js +@@ -19,430 +19,6 @@ + // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + // USE OR OTHER DEALINGS IN THE SOFTWARE. + +-var formatRegExp = /%[sdj%]/g; +-exports.format = function(f) { +- if (!isString(f)) { +- var objects = []; +- for (var i = 0; i < arguments.length; i++) { +- objects.push(inspect(arguments[i])); +- } +- return objects.join(' '); +- } +- +- var i = 1; +- var args = arguments; +- var len = args.length; +- var str = String(f).replace(formatRegExp, function(x) { +- if (x === '%%') return '%'; +- if (i >= len) return x; +- switch (x) { +- case '%s': return String(args[i++]); +- case '%d': return Number(args[i++]); +- case '%j': +- try { +- return JSON.stringify(args[i++]); +- } catch (_) { +- return '[Circular]'; +- } +- default: +- return x; +- } +- }); +- for (var x = args[i]; i < len; x = args[++i]) { +- if (isNull(x) || !isObject(x)) { +- str += ' ' + x; +- } else { +- str += ' ' + inspect(x); +- } +- } +- return str; +-}; +- +- +-// Mark that a method should not be used. +-// Returns a modified function which warns once by default. +-// If --no-deprecation is set, then it is a no-op. +-exports.deprecate = function(fn, msg) { +- // Allow for deprecating things in the process of starting up. +- if (isUndefined(global.process)) { +- return function() { +- return exports.deprecate(fn, msg).apply(this, arguments); +- }; +- } +- +- if (process.noDeprecation === true) { +- return fn; +- } +- +- var warned = false; +- function deprecated() { +- if (!warned) { +- if (process.throwDeprecation) { +- throw new Error(msg); +- } else if (process.traceDeprecation) { +- console.trace(msg); +- } else { +- console.error(msg); +- } +- warned = true; +- } +- return fn.apply(this, arguments); +- } +- +- return deprecated; +-}; +- +- +-var debugs = {}; +-var debugEnviron; +-exports.debuglog = function(set) { +- if (isUndefined(debugEnviron)) +- debugEnviron = process.env.NODE_DEBUG || ''; +- set = set.toUpperCase(); +- if (!debugs[set]) { +- if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { +- var pid = process.pid; +- debugs[set] = function() { +- var msg = exports.format.apply(exports, arguments); +- console.error('%s %d: %s', set, pid, msg); +- }; +- } else { +- debugs[set] = function() {}; +- } +- } +- return debugs[set]; +-}; +- +- +-/** +- * Echos the value of a value. Trys to print the value out +- * in the best way possible given the different types. +- * +- * @param {Object} obj The object to print out. +- * @param {Object} opts Optional options object that alters the output. +- */ +-/* legacy: obj, showHidden, depth, colors*/ +-function inspect(obj, opts) { +- // default options +- var ctx = { +- seen: [], +- stylize: stylizeNoColor +- }; +- // legacy... +- if (arguments.length >= 3) ctx.depth = arguments[2]; +- if (arguments.length >= 4) ctx.colors = arguments[3]; +- if (isBoolean(opts)) { +- // legacy... +- ctx.showHidden = opts; +- } else if (opts) { +- // got an "options" object +- exports._extend(ctx, opts); +- } +- // set default options +- if (isUndefined(ctx.showHidden)) ctx.showHidden = false; +- if (isUndefined(ctx.depth)) ctx.depth = 2; +- if (isUndefined(ctx.colors)) ctx.colors = false; +- if (isUndefined(ctx.customInspect)) ctx.customInspect = true; +- if (ctx.colors) ctx.stylize = stylizeWithColor; +- return formatValue(ctx, obj, ctx.depth); +-} +-exports.inspect = inspect; +- +- +-// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics +-inspect.colors = { +- 'bold' : [1, 22], +- 'italic' : [3, 23], +- 'underline' : [4, 24], +- 'inverse' : [7, 27], +- 'white' : [37, 39], +- 'grey' : [90, 39], +- 'black' : [30, 39], +- 'blue' : [34, 39], +- 'cyan' : [36, 39], +- 'green' : [32, 39], +- 'magenta' : [35, 39], +- 'red' : [31, 39], +- 'yellow' : [33, 39] +-}; +- +-// Don't use 'blue' not visible on cmd.exe +-inspect.styles = { +- 'special': 'cyan', +- 'number': 'yellow', +- 'boolean': 'yellow', +- 'undefined': 'grey', +- 'null': 'bold', +- 'string': 'green', +- 'date': 'magenta', +- // "name": intentionally not styling +- 'regexp': 'red' +-}; +- +- +-function stylizeWithColor(str, styleType) { +- var style = inspect.styles[styleType]; +- +- if (style) { +- return '\u001b[' + inspect.colors[style][0] + 'm' + str + +- '\u001b[' + inspect.colors[style][1] + 'm'; +- } else { +- return str; +- } +-} +- +- +-function stylizeNoColor(str, styleType) { +- return str; +-} +- +- +-function arrayToHash(array) { +- var hash = {}; +- +- array.forEach(function(val, idx) { +- hash[val] = true; +- }); +- +- return hash; +-} +- +- +-function formatValue(ctx, value, recurseTimes) { +- // Provide a hook for user-specified inspect functions. +- // Check that value is an object with an inspect function on it +- if (ctx.customInspect && +- value && +- isFunction(value.inspect) && +- // Filter out the util module, it's inspect function is special +- value.inspect !== exports.inspect && +- // Also filter out any prototype objects using the circular check. +- !(value.constructor && value.constructor.prototype === value)) { +- var ret = value.inspect(recurseTimes, ctx); +- if (!isString(ret)) { +- ret = formatValue(ctx, ret, recurseTimes); +- } +- return ret; +- } +- +- // Primitive types cannot have properties +- var primitive = formatPrimitive(ctx, value); +- if (primitive) { +- return primitive; +- } +- +- // Look up the keys of the object. +- var keys = Object.keys(value); +- var visibleKeys = arrayToHash(keys); +- +- if (ctx.showHidden) { +- keys = Object.getOwnPropertyNames(value); +- } +- +- // Some type of object without properties can be shortcutted. +- if (keys.length === 0) { +- if (isFunction(value)) { +- var name = value.name ? ': ' + value.name : ''; +- return ctx.stylize('[Function' + name + ']', 'special'); +- } +- if (isRegExp(value)) { +- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); +- } +- if (isDate(value)) { +- return ctx.stylize(Date.prototype.toString.call(value), 'date'); +- } +- if (isError(value)) { +- return formatError(value); +- } +- } +- +- var base = '', array = false, braces = ['{', '}']; +- +- // Make Array say that they are Array +- if (isArray(value)) { +- array = true; +- braces = ['[', ']']; +- } +- +- // Make functions say that they are functions +- if (isFunction(value)) { +- var n = value.name ? ': ' + value.name : ''; +- base = ' [Function' + n + ']'; +- } +- +- // Make RegExps say that they are RegExps +- if (isRegExp(value)) { +- base = ' ' + RegExp.prototype.toString.call(value); +- } +- +- // Make dates with properties first say the date +- if (isDate(value)) { +- base = ' ' + Date.prototype.toUTCString.call(value); +- } +- +- // Make error with message first say the error +- if (isError(value)) { +- base = ' ' + formatError(value); +- } +- +- if (keys.length === 0 && (!array || value.length == 0)) { +- return braces[0] + base + braces[1]; +- } +- +- if (recurseTimes < 0) { +- if (isRegExp(value)) { +- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); +- } else { +- return ctx.stylize('[Object]', 'special'); +- } +- } +- +- ctx.seen.push(value); +- +- var output; +- if (array) { +- output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); +- } else { +- output = keys.map(function(key) { +- return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); +- }); +- } +- +- ctx.seen.pop(); +- +- return reduceToSingleString(output, base, braces); +-} +- +- +-function formatPrimitive(ctx, value) { +- if (isUndefined(value)) +- return ctx.stylize('undefined', 'undefined'); +- if (isString(value)) { +- var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') +- .replace(/'/g, "\\'") +- .replace(/\\"/g, '"') + '\''; +- return ctx.stylize(simple, 'string'); +- } +- if (isNumber(value)) { +- // Format -0 as '-0'. Strict equality won't distinguish 0 from -0, +- // so instead we use the fact that 1 / -0 < 0 whereas 1 / 0 > 0 . +- if (value === 0 && 1 / value < 0) +- return ctx.stylize('-0', 'number'); +- return ctx.stylize('' + value, 'number'); +- } +- if (isBoolean(value)) +- return ctx.stylize('' + value, 'boolean'); +- // For some reason typeof null is "object", so special case here. +- if (isNull(value)) +- return ctx.stylize('null', 'null'); +-} +- +- +-function formatError(value) { +- return '[' + Error.prototype.toString.call(value) + ']'; +-} +- +- +-function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { +- var output = []; +- for (var i = 0, l = value.length; i < l; ++i) { +- if (hasOwnProperty(value, String(i))) { +- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, +- String(i), true)); +- } else { +- output.push(''); +- } +- } +- keys.forEach(function(key) { +- if (!key.match(/^\d+$/)) { +- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, +- key, true)); +- } +- }); +- return output; +-} +- +- +-function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { +- var name, str, desc; +- desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; +- if (desc.get) { +- if (desc.set) { +- str = ctx.stylize('[Getter/Setter]', 'special'); +- } else { +- str = ctx.stylize('[Getter]', 'special'); +- } +- } else { +- if (desc.set) { +- str = ctx.stylize('[Setter]', 'special'); +- } +- } +- if (!hasOwnProperty(visibleKeys, key)) { +- name = '[' + key + ']'; +- } +- if (!str) { +- if (ctx.seen.indexOf(desc.value) < 0) { +- if (isNull(recurseTimes)) { +- str = formatValue(ctx, desc.value, null); +- } else { +- str = formatValue(ctx, desc.value, recurseTimes - 1); +- } +- if (str.indexOf('\n') > -1) { +- if (array) { +- str = str.split('\n').map(function(line) { +- return ' ' + line; +- }).join('\n').substr(2); +- } else { +- str = '\n' + str.split('\n').map(function(line) { +- return ' ' + line; +- }).join('\n'); +- } +- } +- } else { +- str = ctx.stylize('[Circular]', 'special'); +- } +- } +- if (isUndefined(name)) { +- if (array && key.match(/^\d+$/)) { +- return str; +- } +- name = JSON.stringify('' + key); +- if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { +- name = name.substr(1, name.length - 2); +- name = ctx.stylize(name, 'name'); +- } else { +- name = name.replace(/'/g, "\\'") +- .replace(/\\"/g, '"') +- .replace(/(^"|"$)/g, "'"); +- name = ctx.stylize(name, 'string'); +- } +- } +- +- return name + ': ' + str; +-} +- +- +-function reduceToSingleString(output, base, braces) { +- var numLinesEst = 0; +- var length = output.reduce(function(prev, cur) { +- numLinesEst++; +- if (cur.indexOf('\n') >= 0) numLinesEst++; +- return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; +- }, 0); +- +- if (length > 60) { +- return braces[0] + +- (base === '' ? '' : base + '\n ') + +- ' ' + +- output.join(',\n ') + +- ' ' + +- braces[1]; +- } +- +- return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; +-} +- +- + // NOTE: These type checking functions intentionally don't use `instanceof` + // because it is fragile and can be easily faked with `Object.create()`. + function isArray(ar) { +@@ -522,166 +98,10 @@ function isPrimitive(arg) { + exports.isPrimitive = isPrimitive; + + function isBuffer(arg) { +- return arg instanceof Buffer; ++ return Buffer.isBuffer(arg); + } + exports.isBuffer = isBuffer; + + function objectToString(o) { + return Object.prototype.toString.call(o); +-} +- +- +-function pad(n) { +- return n < 10 ? '0' + n.toString(10) : n.toString(10); +-} +- +- +-var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', +- 'Oct', 'Nov', 'Dec']; +- +-// 26 Feb 16:19:34 +-function timestamp() { +- var d = new Date(); +- var time = [pad(d.getHours()), +- pad(d.getMinutes()), +- pad(d.getSeconds())].join(':'); +- return [d.getDate(), months[d.getMonth()], time].join(' '); +-} +- +- +-// log is just a thin wrapper to console.log that prepends a timestamp +-exports.log = function() { +- console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); +-}; +- +- +-/** +- * Inherit the prototype methods from one constructor into another. +- * +- * The Function.prototype.inherits from lang.js rewritten as a standalone +- * function (not on Function.prototype). NOTE: If this file is to be loaded +- * during bootstrapping this function needs to be rewritten using some native +- * functions as prototype setup using normal JavaScript does not work as +- * expected during bootstrapping (see mirror.js in r114903). +- * +- * @param {function} ctor Constructor function which needs to inherit the +- * prototype. +- * @param {function} superCtor Constructor function to inherit prototype from. +- */ +-exports.inherits = function(ctor, superCtor) { +- ctor.super_ = superCtor; +- ctor.prototype = Object.create(superCtor.prototype, { +- constructor: { +- value: ctor, +- enumerable: false, +- writable: true, +- configurable: true +- } +- }); +-}; +- +-exports._extend = function(origin, add) { +- // Don't do anything if add isn't an object +- if (!add || !isObject(add)) return origin; +- +- var keys = Object.keys(add); +- var i = keys.length; +- while (i--) { +- origin[keys[i]] = add[keys[i]]; +- } +- return origin; +-}; +- +-function hasOwnProperty(obj, prop) { +- return Object.prototype.hasOwnProperty.call(obj, prop); +-} +- +- +-// Deprecated old stuff. +- +-exports.p = exports.deprecate(function() { +- for (var i = 0, len = arguments.length; i < len; ++i) { +- console.error(exports.inspect(arguments[i])); +- } +-}, 'util.p: Use console.error() instead'); +- +- +-exports.exec = exports.deprecate(function() { +- return require('child_process').exec.apply(this, arguments); +-}, 'util.exec is now called `child_process.exec`.'); +- +- +-exports.print = exports.deprecate(function() { +- for (var i = 0, len = arguments.length; i < len; ++i) { +- process.stdout.write(String(arguments[i])); +- } +-}, 'util.print: Use console.log instead'); +- +- +-exports.puts = exports.deprecate(function() { +- for (var i = 0, len = arguments.length; i < len; ++i) { +- process.stdout.write(arguments[i] + '\n'); +- } +-}, 'util.puts: Use console.log instead'); +- +- +-exports.debug = exports.deprecate(function(x) { +- process.stderr.write('DEBUG: ' + x + '\n'); +-}, 'util.debug: Use console.error instead'); +- +- +-exports.error = exports.deprecate(function(x) { +- for (var i = 0, len = arguments.length; i < len; ++i) { +- process.stderr.write(arguments[i] + '\n'); +- } +-}, 'util.error: Use console.error instead'); +- +- +-exports.pump = exports.deprecate(function(readStream, writeStream, callback) { +- var callbackCalled = false; +- +- function call(a, b, c) { +- if (callback && !callbackCalled) { +- callback(a, b, c); +- callbackCalled = true; +- } +- } +- +- readStream.addListener('data', function(chunk) { +- if (writeStream.write(chunk) === false) readStream.pause(); +- }); +- +- writeStream.addListener('drain', function() { +- readStream.resume(); +- }); +- +- readStream.addListener('end', function() { +- writeStream.end(); +- }); +- +- readStream.addListener('close', function() { +- call(); +- }); +- +- readStream.addListener('error', function(err) { +- writeStream.end(); +- call(err); +- }); +- +- writeStream.addListener('error', function(err) { +- readStream.destroy(); +- call(err); +- }); +-}, 'util.pump(): Use readableStream.pipe() instead'); +- +- +-var uv; +-exports._errnoException = function(err, syscall) { +- if (isUndefined(uv)) uv = process.binding('uv'); +- var errname = uv.errname(err); +- var e = new Error(syscall + ' ' + errname); +- e.code = errname; +- e.errno = errname; +- e.syscall = syscall; +- return e; +-}; ++} \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/lib/util.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/lib/util.js new file mode 100644 index 00000000..ff4c851c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/lib/util.js @@ -0,0 +1,107 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. + +function isArray(arg) { + if (Array.isArray) { + return Array.isArray(arg); + } + return objectToString(arg) === '[object Array]'; +} +exports.isArray = isArray; + +function isBoolean(arg) { + return typeof arg === 'boolean'; +} +exports.isBoolean = isBoolean; + +function isNull(arg) { + return arg === null; +} +exports.isNull = isNull; + +function isNullOrUndefined(arg) { + return arg == null; +} +exports.isNullOrUndefined = isNullOrUndefined; + +function isNumber(arg) { + return typeof arg === 'number'; +} +exports.isNumber = isNumber; + +function isString(arg) { + return typeof arg === 'string'; +} +exports.isString = isString; + +function isSymbol(arg) { + return typeof arg === 'symbol'; +} +exports.isSymbol = isSymbol; + +function isUndefined(arg) { + return arg === void 0; +} +exports.isUndefined = isUndefined; + +function isRegExp(re) { + return objectToString(re) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} +exports.isObject = isObject; + +function isDate(d) { + return objectToString(d) === '[object Date]'; +} +exports.isDate = isDate; + +function isError(e) { + return (objectToString(e) === '[object Error]' || e instanceof Error); +} +exports.isError = isError; + +function isFunction(arg) { + return typeof arg === 'function'; +} +exports.isFunction = isFunction; + +function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; +} +exports.isPrimitive = isPrimitive; + +exports.isBuffer = Buffer.isBuffer; + +function objectToString(o) { + return Object.prototype.toString.call(o); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json new file mode 100644 index 00000000..19fb8592 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json @@ -0,0 +1,60 @@ +{ + "name": "core-util-is", + "version": "1.0.2", + "description": "The `util.is*` functions introduced in Node v0.12.", + "main": "lib/util.js", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/core-util-is.git" + }, + "keywords": [ + "util", + "isBuffer", + "isArray", + "isNumber", + "isString", + "isRegExp", + "isThis", + "isThat", + "polyfill" + ], + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/isaacs/core-util-is/issues" + }, + "scripts": { + "test": "tap test.js" + }, + "devDependencies": { + "tap": "^2.3.0" + }, + "gitHead": "a177da234df5638b363ddc15fa324619a38577c8", + "homepage": "https://github.com/isaacs/core-util-is#readme", + "_id": "core-util-is@1.0.2", + "_shasum": "b5fd54220aa2bc5ab57aab7140c940754503c1a7", + "_from": "core-util-is@>=1.0.0 <1.1.0", + "_npmVersion": "3.3.2", + "_nodeVersion": "4.0.0", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "dist": { + "shasum": "b5fd54220aa2bc5ab57aab7140c940754503c1a7", + "tarball": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/test.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/test.js new file mode 100644 index 00000000..1a490c65 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/test.js @@ -0,0 +1,68 @@ +var assert = require('tap'); + +var t = require('./lib/util'); + +assert.equal(t.isArray([]), true); +assert.equal(t.isArray({}), false); + +assert.equal(t.isBoolean(null), false); +assert.equal(t.isBoolean(true), true); +assert.equal(t.isBoolean(false), true); + +assert.equal(t.isNull(null), true); +assert.equal(t.isNull(undefined), false); +assert.equal(t.isNull(false), false); +assert.equal(t.isNull(), false); + +assert.equal(t.isNullOrUndefined(null), true); +assert.equal(t.isNullOrUndefined(undefined), true); +assert.equal(t.isNullOrUndefined(false), false); +assert.equal(t.isNullOrUndefined(), true); + +assert.equal(t.isNumber(null), false); +assert.equal(t.isNumber('1'), false); +assert.equal(t.isNumber(1), true); + +assert.equal(t.isString(null), false); +assert.equal(t.isString('1'), true); +assert.equal(t.isString(1), false); + +assert.equal(t.isSymbol(null), false); +assert.equal(t.isSymbol('1'), false); +assert.equal(t.isSymbol(1), false); +assert.equal(t.isSymbol(Symbol()), true); + +assert.equal(t.isUndefined(null), false); +assert.equal(t.isUndefined(undefined), true); +assert.equal(t.isUndefined(false), false); +assert.equal(t.isUndefined(), true); + +assert.equal(t.isRegExp(null), false); +assert.equal(t.isRegExp('1'), false); +assert.equal(t.isRegExp(new RegExp()), true); + +assert.equal(t.isObject({}), true); +assert.equal(t.isObject([]), true); +assert.equal(t.isObject(new RegExp()), true); +assert.equal(t.isObject(new Date()), true); + +assert.equal(t.isDate(null), false); +assert.equal(t.isDate('1'), false); +assert.equal(t.isDate(new Date()), true); + +assert.equal(t.isError(null), false); +assert.equal(t.isError({ err: true }), false); +assert.equal(t.isError(new Error()), true); + +assert.equal(t.isFunction(null), false); +assert.equal(t.isFunction({ }), false); +assert.equal(t.isFunction(function() {}), true); + +assert.equal(t.isPrimitive(null), true); +assert.equal(t.isPrimitive(''), true); +assert.equal(t.isPrimitive(0), true); +assert.equal(t.isPrimitive(new Date()), false); + +assert.equal(t.isBuffer(null), false); +assert.equal(t.isBuffer({}), false); +assert.equal(t.isBuffer(new Buffer(0)), true); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/.npmignore new file mode 100644 index 00000000..3c3629e6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/.travis.yml new file mode 100644 index 00000000..cc4dba29 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.8" + - "0.10" diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/Makefile b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/Makefile new file mode 100644 index 00000000..0ecc29c4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/Makefile @@ -0,0 +1,5 @@ + +test: + @node_modules/.bin/tape test.js + +.PHONY: test diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/README.md new file mode 100644 index 00000000..16d2c59c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/README.md @@ -0,0 +1,60 @@ + +# isarray + +`Array#isArray` for older browsers. + +[![build status](https://secure.travis-ci.org/juliangruber/isarray.svg)](http://travis-ci.org/juliangruber/isarray) +[![downloads](https://img.shields.io/npm/dm/isarray.svg)](https://www.npmjs.org/package/isarray) + +[![browser support](https://ci.testling.com/juliangruber/isarray.png) +](https://ci.testling.com/juliangruber/isarray) + +## Usage + +```js +var isArray = require('isarray'); + +console.log(isArray([])); // => true +console.log(isArray({})); // => false +``` + +## Installation + +With [npm](http://npmjs.org) do + +```bash +$ npm install isarray +``` + +Then bundle for the browser with +[browserify](https://github.com/substack/browserify). + +With [component](http://component.io) do + +```bash +$ component install juliangruber/isarray +``` + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/component.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/component.json new file mode 100644 index 00000000..9e31b683 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/component.json @@ -0,0 +1,19 @@ +{ + "name" : "isarray", + "description" : "Array#isArray for older browsers", + "version" : "0.0.1", + "repository" : "juliangruber/isarray", + "homepage": "https://github.com/juliangruber/isarray", + "main" : "index.js", + "scripts" : [ + "index.js" + ], + "dependencies" : {}, + "keywords": ["browser","isarray","array"], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/index.js new file mode 100644 index 00000000..a57f6349 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/index.js @@ -0,0 +1,5 @@ +var toString = {}.toString; + +module.exports = Array.isArray || function (arr) { + return toString.call(arr) == '[object Array]'; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json new file mode 100644 index 00000000..e86d232e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json @@ -0,0 +1,71 @@ +{ + "name": "isarray", + "description": "Array#isArray for older browsers", + "version": "1.0.0", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/isarray.git" + }, + "homepage": "https://github.com/juliangruber/isarray", + "main": "index.js", + "dependencies": {}, + "devDependencies": { + "tape": "~2.13.4" + }, + "keywords": [ + "browser", + "isarray", + "array" + ], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT", + "testling": { + "files": "test.js", + "browsers": [ + "ie/8..latest", + "firefox/17..latest", + "firefox/nightly", + "chrome/22..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "scripts": { + "test": "tape test.js" + }, + "gitHead": "2a23a281f369e9ae06394c0fb4d2381355a6ba33", + "bugs": { + "url": "https://github.com/juliangruber/isarray/issues" + }, + "_id": "isarray@1.0.0", + "_shasum": "bb935d48582cba168c06834957a54a3e07124f11", + "_from": "isarray@>=1.0.0 <1.1.0", + "_npmVersion": "3.3.12", + "_nodeVersion": "5.1.0", + "_npmUser": { + "name": "juliangruber", + "email": "julian@juliangruber.com" + }, + "dist": { + "shasum": "bb935d48582cba168c06834957a54a3e07124f11", + "tarball": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" + }, + "maintainers": [ + { + "name": "juliangruber", + "email": "julian@juliangruber.com" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/test.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/test.js new file mode 100644 index 00000000..f7f7bcd1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/test.js @@ -0,0 +1,19 @@ +var isArray = require('./'); +var test = require('tape'); + +test('is array', function(t){ + t.ok(isArray([])); + t.notOk(isArray({})); + t.notOk(isArray(null)); + t.notOk(isArray(false)); + + var obj = {}; + obj[0] = true; + t.notOk(isArray(obj)); + + var arr = []; + arr.foo = 'bar'; + t.ok(isArray(arr)); + + t.end(); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml new file mode 100644 index 00000000..36201b10 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml @@ -0,0 +1,12 @@ +language: node_js +node_js: + - "0.8" + - "0.10" + - "0.11" + - "0.12" + - "1.7.1" + - 1 + - 2 + - 3 + - 4 + - 5 diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/index.js new file mode 100644 index 00000000..a4f40f84 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/index.js @@ -0,0 +1,43 @@ +'use strict'; + +if (!process.version || + process.version.indexOf('v0.') === 0 || + process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) { + module.exports = nextTick; +} else { + module.exports = process.nextTick; +} + +function nextTick(fn, arg1, arg2, arg3) { + if (typeof fn !== 'function') { + throw new TypeError('"callback" argument must be a function'); + } + var len = arguments.length; + var args, i; + switch (len) { + case 0: + case 1: + return process.nextTick(fn); + case 2: + return process.nextTick(function afterTickOne() { + fn.call(null, arg1); + }); + case 3: + return process.nextTick(function afterTickTwo() { + fn.call(null, arg1, arg2); + }); + case 4: + return process.nextTick(function afterTickThree() { + fn.call(null, arg1, arg2, arg3); + }); + default: + args = new Array(len - 1); + i = 0; + while (i < args.length) { + args[i++] = arguments[i]; + } + return process.nextTick(function afterTick() { + fn.apply(null, args); + }); + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/license.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/license.md new file mode 100644 index 00000000..c67e3532 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/license.md @@ -0,0 +1,19 @@ +# Copyright (c) 2015 Calvin Metcalf + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +**THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.** diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/package.json new file mode 100644 index 00000000..211b098d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/package.json @@ -0,0 +1,49 @@ +{ + "name": "process-nextick-args", + "version": "1.0.7", + "description": "process.nextTick but always with args", + "main": "index.js", + "scripts": { + "test": "node test.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/calvinmetcalf/process-nextick-args.git" + }, + "author": "", + "license": "MIT", + "bugs": { + "url": "https://github.com/calvinmetcalf/process-nextick-args/issues" + }, + "homepage": "https://github.com/calvinmetcalf/process-nextick-args", + "devDependencies": { + "tap": "~0.2.6" + }, + "gitHead": "5c00899ab01dd32f93ad4b5743da33da91404f39", + "_id": "process-nextick-args@1.0.7", + "_shasum": "150e20b756590ad3f91093f25a4f2ad8bff30ba3", + "_from": "process-nextick-args@>=1.0.6 <1.1.0", + "_npmVersion": "3.8.6", + "_nodeVersion": "5.11.0", + "_npmUser": { + "name": "cwmma", + "email": "calvin.metcalf@gmail.com" + }, + "dist": { + "shasum": "150e20b756590ad3f91093f25a4f2ad8bff30ba3", + "tarball": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz" + }, + "maintainers": [ + { + "name": "cwmma", + "email": "calvin.metcalf@gmail.com" + } + ], + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/process-nextick-args-1.0.7.tgz_1462394251778_0.36989671061746776" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/readme.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/readme.md new file mode 100644 index 00000000..78e7cfae --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/readme.md @@ -0,0 +1,18 @@ +process-nextick-args +===== + +[![Build Status](https://travis-ci.org/calvinmetcalf/process-nextick-args.svg?branch=master)](https://travis-ci.org/calvinmetcalf/process-nextick-args) + +```bash +npm install --save process-nextick-args +``` + +Always be able to pass arguments to process.nextTick, no matter the platform + +```js +var nextTick = require('process-nextick-args'); + +nextTick(function (a, b, c) { + console.log(a, b, c); +}, 'step', 3, 'profit'); +``` diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/test.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/test.js new file mode 100644 index 00000000..ef157215 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/test.js @@ -0,0 +1,24 @@ +var test = require("tap").test; +var nextTick = require('./'); + +test('should work', function (t) { + t.plan(5); + nextTick(function (a) { + t.ok(a); + nextTick(function (thing) { + t.equals(thing, 7); + }, 7); + }, true); + nextTick(function (a, b, c) { + t.equals(a, 'step'); + t.equals(b, 3); + t.equals(c, 'profit'); + }, 'step', 3, 'profit'); +}); + +test('correct number of arguments', function (t) { + t.plan(1); + nextTick(function () { + t.equals(2, arguments.length, 'correct number'); + }, 1, 2); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/.npmignore new file mode 100644 index 00000000..206320cc --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/.npmignore @@ -0,0 +1,2 @@ +build +test diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/LICENSE new file mode 100644 index 00000000..6de584a4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/LICENSE @@ -0,0 +1,20 @@ +Copyright Joyent, Inc. and other Node contributors. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to permit +persons to whom the Software is furnished to do so, subject to the +following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/README.md new file mode 100644 index 00000000..4d2aa001 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/README.md @@ -0,0 +1,7 @@ +**string_decoder.js** (`require('string_decoder')`) from Node.js core + +Copyright Joyent, Inc. and other Node contributors. See LICENCE file for details. + +Version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. **Prefer the stable version over the unstable.** + +The *build/* directory contains a build script that will scrape the source from the [joyent/node](https://github.com/joyent/node) repo given a specific Node version. \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/index.js new file mode 100644 index 00000000..b00e54fb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/index.js @@ -0,0 +1,221 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var Buffer = require('buffer').Buffer; + +var isBufferEncoding = Buffer.isEncoding + || function(encoding) { + switch (encoding && encoding.toLowerCase()) { + case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true; + default: return false; + } + } + + +function assertEncoding(encoding) { + if (encoding && !isBufferEncoding(encoding)) { + throw new Error('Unknown encoding: ' + encoding); + } +} + +// StringDecoder provides an interface for efficiently splitting a series of +// buffers into a series of JS strings without breaking apart multi-byte +// characters. CESU-8 is handled as part of the UTF-8 encoding. +// +// @TODO Handling all encodings inside a single object makes it very difficult +// to reason about this code, so it should be split up in the future. +// @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code +// points as used by CESU-8. +var StringDecoder = exports.StringDecoder = function(encoding) { + this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, ''); + assertEncoding(encoding); + switch (this.encoding) { + case 'utf8': + // CESU-8 represents each of Surrogate Pair by 3-bytes + this.surrogateSize = 3; + break; + case 'ucs2': + case 'utf16le': + // UTF-16 represents each of Surrogate Pair by 2-bytes + this.surrogateSize = 2; + this.detectIncompleteChar = utf16DetectIncompleteChar; + break; + case 'base64': + // Base-64 stores 3 bytes in 4 chars, and pads the remainder. + this.surrogateSize = 3; + this.detectIncompleteChar = base64DetectIncompleteChar; + break; + default: + this.write = passThroughWrite; + return; + } + + // Enough space to store all bytes of a single character. UTF-8 needs 4 + // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate). + this.charBuffer = new Buffer(6); + // Number of bytes received for the current incomplete multi-byte character. + this.charReceived = 0; + // Number of bytes expected for the current incomplete multi-byte character. + this.charLength = 0; +}; + + +// write decodes the given buffer and returns it as JS string that is +// guaranteed to not contain any partial multi-byte characters. Any partial +// character found at the end of the buffer is buffered up, and will be +// returned when calling write again with the remaining bytes. +// +// Note: Converting a Buffer containing an orphan surrogate to a String +// currently works, but converting a String to a Buffer (via `new Buffer`, or +// Buffer#write) will replace incomplete surrogates with the unicode +// replacement character. See https://codereview.chromium.org/121173009/ . +StringDecoder.prototype.write = function(buffer) { + var charStr = ''; + // if our last write ended with an incomplete multibyte character + while (this.charLength) { + // determine how many remaining bytes this buffer has to offer for this char + var available = (buffer.length >= this.charLength - this.charReceived) ? + this.charLength - this.charReceived : + buffer.length; + + // add the new bytes to the char buffer + buffer.copy(this.charBuffer, this.charReceived, 0, available); + this.charReceived += available; + + if (this.charReceived < this.charLength) { + // still not enough chars in this buffer? wait for more ... + return ''; + } + + // remove bytes belonging to the current character from the buffer + buffer = buffer.slice(available, buffer.length); + + // get the character that was split + charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding); + + // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character + var charCode = charStr.charCodeAt(charStr.length - 1); + if (charCode >= 0xD800 && charCode <= 0xDBFF) { + this.charLength += this.surrogateSize; + charStr = ''; + continue; + } + this.charReceived = this.charLength = 0; + + // if there are no more bytes in this buffer, just emit our char + if (buffer.length === 0) { + return charStr; + } + break; + } + + // determine and set charLength / charReceived + this.detectIncompleteChar(buffer); + + var end = buffer.length; + if (this.charLength) { + // buffer the incomplete character bytes we got + buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end); + end -= this.charReceived; + } + + charStr += buffer.toString(this.encoding, 0, end); + + var end = charStr.length - 1; + var charCode = charStr.charCodeAt(end); + // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character + if (charCode >= 0xD800 && charCode <= 0xDBFF) { + var size = this.surrogateSize; + this.charLength += size; + this.charReceived += size; + this.charBuffer.copy(this.charBuffer, size, 0, size); + buffer.copy(this.charBuffer, 0, 0, size); + return charStr.substring(0, end); + } + + // or just emit the charStr + return charStr; +}; + +// detectIncompleteChar determines if there is an incomplete UTF-8 character at +// the end of the given buffer. If so, it sets this.charLength to the byte +// length that character, and sets this.charReceived to the number of bytes +// that are available for this character. +StringDecoder.prototype.detectIncompleteChar = function(buffer) { + // determine how many bytes we have to check at the end of this buffer + var i = (buffer.length >= 3) ? 3 : buffer.length; + + // Figure out if one of the last i bytes of our buffer announces an + // incomplete char. + for (; i > 0; i--) { + var c = buffer[buffer.length - i]; + + // See http://en.wikipedia.org/wiki/UTF-8#Description + + // 110XXXXX + if (i == 1 && c >> 5 == 0x06) { + this.charLength = 2; + break; + } + + // 1110XXXX + if (i <= 2 && c >> 4 == 0x0E) { + this.charLength = 3; + break; + } + + // 11110XXX + if (i <= 3 && c >> 3 == 0x1E) { + this.charLength = 4; + break; + } + } + this.charReceived = i; +}; + +StringDecoder.prototype.end = function(buffer) { + var res = ''; + if (buffer && buffer.length) + res = this.write(buffer); + + if (this.charReceived) { + var cr = this.charReceived; + var buf = this.charBuffer; + var enc = this.encoding; + res += buf.slice(0, cr).toString(enc); + } + + return res; +}; + +function passThroughWrite(buffer) { + return buffer.toString(this.encoding); +} + +function utf16DetectIncompleteChar(buffer) { + this.charReceived = buffer.length % 2; + this.charLength = this.charReceived ? 2 : 0; +} + +function base64DetectIncompleteChar(buffer) { + this.charReceived = buffer.length % 3; + this.charLength = this.charReceived ? 3 : 0; +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json new file mode 100644 index 00000000..8e8b77db --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json @@ -0,0 +1,54 @@ +{ + "name": "string_decoder", + "version": "0.10.31", + "description": "The string_decoder module from Node core", + "main": "index.js", + "dependencies": {}, + "devDependencies": { + "tap": "~0.4.8" + }, + "scripts": { + "test": "tap test/simple/*.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/rvagg/string_decoder.git" + }, + "homepage": "https://github.com/rvagg/string_decoder", + "keywords": [ + "string", + "decoder", + "browser", + "browserify" + ], + "license": "MIT", + "gitHead": "d46d4fd87cf1d06e031c23f1ba170ca7d4ade9a0", + "bugs": { + "url": "https://github.com/rvagg/string_decoder/issues" + }, + "_id": "string_decoder@0.10.31", + "_shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", + "_from": "string_decoder@>=0.10.0 <0.11.0", + "_npmVersion": "1.4.23", + "_npmUser": { + "name": "rvagg", + "email": "rod@vagg.org" + }, + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + }, + { + "name": "rvagg", + "email": "rod@vagg.org" + } + ], + "dist": { + "shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", + "tarball": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/History.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/History.md new file mode 100644 index 00000000..acc86753 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/History.md @@ -0,0 +1,16 @@ + +1.0.2 / 2015-10-07 +================== + + * use try/catch when checking `localStorage` (#3, @kumavis) + +1.0.1 / 2014-11-25 +================== + + * browser: use `console.warn()` for deprecation calls + * browser: more jsdocs + +1.0.0 / 2014-04-30 +================== + + * initial commit diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/LICENSE new file mode 100644 index 00000000..6a60e8c2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/LICENSE @@ -0,0 +1,24 @@ +(The MIT License) + +Copyright (c) 2014 Nathan Rajlich + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/README.md new file mode 100644 index 00000000..75622fa7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/README.md @@ -0,0 +1,53 @@ +util-deprecate +============== +### The Node.js `util.deprecate()` function with browser support + +In Node.js, this module simply re-exports the `util.deprecate()` function. + +In the web browser (i.e. via browserify), a browser-specific implementation +of the `util.deprecate()` function is used. + + +## API + +A `deprecate()` function is the only thing exposed by this module. + +``` javascript +// setup: +exports.foo = deprecate(foo, 'foo() is deprecated, use bar() instead'); + + +// users see: +foo(); +// foo() is deprecated, use bar() instead +foo(); +foo(); +``` + + +## License + +(The MIT License) + +Copyright (c) 2014 Nathan Rajlich + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/browser.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/browser.js new file mode 100644 index 00000000..549ae2f0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/browser.js @@ -0,0 +1,67 @@ + +/** + * Module exports. + */ + +module.exports = deprecate; + +/** + * Mark that a method should not be used. + * Returns a modified function which warns once by default. + * + * If `localStorage.noDeprecation = true` is set, then it is a no-op. + * + * If `localStorage.throwDeprecation = true` is set, then deprecated functions + * will throw an Error when invoked. + * + * If `localStorage.traceDeprecation = true` is set, then deprecated functions + * will invoke `console.trace()` instead of `console.error()`. + * + * @param {Function} fn - the function to deprecate + * @param {String} msg - the string to print to the console when `fn` is invoked + * @returns {Function} a new "deprecated" version of `fn` + * @api public + */ + +function deprecate (fn, msg) { + if (config('noDeprecation')) { + return fn; + } + + var warned = false; + function deprecated() { + if (!warned) { + if (config('throwDeprecation')) { + throw new Error(msg); + } else if (config('traceDeprecation')) { + console.trace(msg); + } else { + console.warn(msg); + } + warned = true; + } + return fn.apply(this, arguments); + } + + return deprecated; +} + +/** + * Checks `localStorage` for boolean values for the given `name`. + * + * @param {String} name + * @returns {Boolean} + * @api private + */ + +function config (name) { + // accessing global.localStorage can trigger a DOMException in sandboxed iframes + try { + if (!global.localStorage) return false; + } catch (_) { + return false; + } + var val = global.localStorage[name]; + if (null == val) return false; + return String(val).toLowerCase() === 'true'; +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/node.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/node.js new file mode 100644 index 00000000..5e6fcff5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/node.js @@ -0,0 +1,6 @@ + +/** + * For Node.js, simply re-export the core `util.deprecate` function. + */ + +module.exports = require('util').deprecate; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/package.json new file mode 100644 index 00000000..a0181354 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/package.json @@ -0,0 +1,54 @@ +{ + "name": "util-deprecate", + "version": "1.0.2", + "description": "The Node.js `util.deprecate()` function with browser support", + "main": "node.js", + "browser": "browser.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git://github.com/TooTallNate/util-deprecate.git" + }, + "keywords": [ + "util", + "deprecate", + "browserify", + "browser", + "node" + ], + "author": { + "name": "Nathan Rajlich", + "email": "nathan@tootallnate.net", + "url": "http://n8.io/" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/TooTallNate/util-deprecate/issues" + }, + "homepage": "https://github.com/TooTallNate/util-deprecate", + "gitHead": "475fb6857cd23fafff20c1be846c1350abf8e6d4", + "_id": "util-deprecate@1.0.2", + "_shasum": "450d4dc9fa70de732762fbd2d4a28981419a0ccf", + "_from": "util-deprecate@>=1.0.1 <1.1.0", + "_npmVersion": "2.14.4", + "_nodeVersion": "4.1.2", + "_npmUser": { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + }, + "maintainers": [ + { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + } + ], + "dist": { + "shasum": "450d4dc9fa70de732762fbd2d4a28981419a0ccf", + "tarball": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json new file mode 100644 index 00000000..b9fc0dae --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json @@ -0,0 +1,80 @@ +{ + "name": "readable-stream", + "version": "2.0.6", + "description": "Streams3, a user-land copy of the stream library from Node.js", + "main": "readable.js", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "~1.0.0", + "process-nextick-args": "~1.0.6", + "string_decoder": "~0.10.x", + "util-deprecate": "~1.0.1" + }, + "devDependencies": { + "tap": "~0.2.6", + "tape": "~4.5.1", + "zuul": "~3.9.0" + }, + "scripts": { + "test": "tap test/parallel/*.js test/ours/*.js", + "browser": "npm run write-zuul && zuul -- test/browser.js", + "write-zuul": "printf \"ui: tape\nbrowsers:\n - name: $BROWSER_NAME\n version: $BROWSER_VERSION\n\">.zuul.yml" + }, + "repository": { + "type": "git", + "url": "git://github.com/nodejs/readable-stream.git" + }, + "keywords": [ + "readable", + "stream", + "pipe" + ], + "browser": { + "util": false + }, + "license": "MIT", + "gitHead": "01fb5608a970b42c900b96746cadc13d27dd9d7e", + "bugs": { + "url": "https://github.com/nodejs/readable-stream/issues" + }, + "homepage": "https://github.com/nodejs/readable-stream#readme", + "_id": "readable-stream@2.0.6", + "_shasum": "8f90341e68a53ccc928788dacfcd11b36eb9b78e", + "_from": "readable-stream@>=2.0.5 <2.1.0", + "_npmVersion": "3.6.0", + "_nodeVersion": "5.7.0", + "_npmUser": { + "name": "cwmma", + "email": "calvin.metcalf@gmail.com" + }, + "dist": { + "shasum": "8f90341e68a53ccc928788dacfcd11b36eb9b78e", + "tarball": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + }, + { + "name": "rvagg", + "email": "rod@vagg.org" + }, + { + "name": "cwmma", + "email": "calvin.metcalf@gmail.com" + } + ], + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/readable-stream-2.0.6.tgz_1457893507709_0.369257491780445" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/passthrough.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/passthrough.js new file mode 100644 index 00000000..27e8d8a5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/passthrough.js @@ -0,0 +1 @@ +module.exports = require("./lib/_stream_passthrough.js") diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/readable.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/readable.js new file mode 100644 index 00000000..6222a579 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/readable.js @@ -0,0 +1,12 @@ +var Stream = (function (){ + try { + return require('st' + 'ream'); // hack to fix a circular dependency issue when used with browserify + } catch(_){} +}()); +exports = module.exports = require('./lib/_stream_readable.js'); +exports.Stream = Stream || exports; +exports.Readable = exports; +exports.Writable = require('./lib/_stream_writable.js'); +exports.Duplex = require('./lib/_stream_duplex.js'); +exports.Transform = require('./lib/_stream_transform.js'); +exports.PassThrough = require('./lib/_stream_passthrough.js'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/transform.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/transform.js new file mode 100644 index 00000000..5d482f07 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/transform.js @@ -0,0 +1 @@ +module.exports = require("./lib/_stream_transform.js") diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/writable.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/writable.js new file mode 100644 index 00000000..e1e9efdf --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/writable.js @@ -0,0 +1 @@ +module.exports = require("./lib/_stream_writable.js") diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/package.json new file mode 100644 index 00000000..23203168 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/package.json @@ -0,0 +1,64 @@ +{ + "name": "bl", + "version": "1.1.2", + "description": "Buffer List: collect buffers and access with a standard readable Buffer interface, streamable too!", + "main": "bl.js", + "scripts": { + "test": "node test/test.js | faucet" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/rvagg/bl.git" + }, + "homepage": "https://github.com/rvagg/bl", + "authors": [ + "Rod Vagg (https://github.com/rvagg)", + "Matteo Collina (https://github.com/mcollina)", + "Jarett Cruger (https://github.com/jcrugzz)" + ], + "keywords": [ + "buffer", + "buffers", + "stream", + "awesomesauce" + ], + "license": "MIT", + "dependencies": { + "readable-stream": "~2.0.5" + }, + "devDependencies": { + "faucet": "0.0.1", + "hash_file": "~0.1.1", + "tape": "~4.4.0" + }, + "gitHead": "ea42021059dc65fc60d7f4b9217c73431f09d23d", + "bugs": { + "url": "https://github.com/rvagg/bl/issues" + }, + "_id": "bl@1.1.2", + "_shasum": "fdca871a99713aa00d19e3bbba41c44787a65398", + "_from": "bl@>=1.1.2 <1.2.0", + "_npmVersion": "3.3.12", + "_nodeVersion": "5.3.0", + "_npmUser": { + "name": "rvagg", + "email": "rod@vagg.org" + }, + "maintainers": [ + { + "name": "rvagg", + "email": "rod@vagg.org" + } + ], + "dist": { + "shasum": "fdca871a99713aa00d19e3bbba41c44787a65398", + "tarball": "https://registry.npmjs.org/bl/-/bl-1.1.2.tgz" + }, + "_npmOperationalInternal": { + "host": "packages-9-west.internal.npmjs.com", + "tmp": "tmp/bl-1.1.2.tgz_1455246621698_0.6300242957659066" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/bl/-/bl-1.1.2.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/test/test.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/test/test.js new file mode 100644 index 00000000..c95b1ba4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/bl/test/test.js @@ -0,0 +1,640 @@ +var tape = require('tape') + , crypto = require('crypto') + , fs = require('fs') + , hash = require('hash_file') + , BufferList = require('../') + + , encodings = + ('hex utf8 utf-8 ascii binary base64' + + (process.browser ? '' : ' ucs2 ucs-2 utf16le utf-16le')).split(' ') + +tape('single bytes from single buffer', function (t) { + var bl = new BufferList() + bl.append(new Buffer('abcd')) + + t.equal(bl.length, 4) + + t.equal(bl.get(0), 97) + t.equal(bl.get(1), 98) + t.equal(bl.get(2), 99) + t.equal(bl.get(3), 100) + + t.end() +}) + +tape('single bytes from multiple buffers', function (t) { + var bl = new BufferList() + bl.append(new Buffer('abcd')) + bl.append(new Buffer('efg')) + bl.append(new Buffer('hi')) + bl.append(new Buffer('j')) + + t.equal(bl.length, 10) + + t.equal(bl.get(0), 97) + t.equal(bl.get(1), 98) + t.equal(bl.get(2), 99) + t.equal(bl.get(3), 100) + t.equal(bl.get(4), 101) + t.equal(bl.get(5), 102) + t.equal(bl.get(6), 103) + t.equal(bl.get(7), 104) + t.equal(bl.get(8), 105) + t.equal(bl.get(9), 106) + t.end() +}) + +tape('multi bytes from single buffer', function (t) { + var bl = new BufferList() + bl.append(new Buffer('abcd')) + + t.equal(bl.length, 4) + + t.equal(bl.slice(0, 4).toString('ascii'), 'abcd') + t.equal(bl.slice(0, 3).toString('ascii'), 'abc') + t.equal(bl.slice(1, 4).toString('ascii'), 'bcd') + + t.end() +}) + +tape('multiple bytes from multiple buffers', function (t) { + var bl = new BufferList() + + bl.append(new Buffer('abcd')) + bl.append(new Buffer('efg')) + bl.append(new Buffer('hi')) + bl.append(new Buffer('j')) + + t.equal(bl.length, 10) + + t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij') + t.equal(bl.slice(3, 10).toString('ascii'), 'defghij') + t.equal(bl.slice(3, 6).toString('ascii'), 'def') + t.equal(bl.slice(3, 8).toString('ascii'), 'defgh') + t.equal(bl.slice(5, 10).toString('ascii'), 'fghij') + + t.end() +}) + +tape('multiple bytes from multiple buffer lists', function (t) { + var bl = new BufferList() + + bl.append(new BufferList([ new Buffer('abcd'), new Buffer('efg') ])) + bl.append(new BufferList([ new Buffer('hi'), new Buffer('j') ])) + + t.equal(bl.length, 10) + + t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij') + + t.equal(bl.slice(3, 10).toString('ascii'), 'defghij') + t.equal(bl.slice(3, 6).toString('ascii'), 'def') + t.equal(bl.slice(3, 8).toString('ascii'), 'defgh') + t.equal(bl.slice(5, 10).toString('ascii'), 'fghij') + + t.end() +}) + +// same data as previous test, just using nested constructors +tape('multiple bytes from crazy nested buffer lists', function (t) { + var bl = new BufferList() + + bl.append(new BufferList([ + new BufferList([ + new BufferList(new Buffer('abc')) + , new Buffer('d') + , new BufferList(new Buffer('efg')) + ]) + , new BufferList([ new Buffer('hi') ]) + , new BufferList(new Buffer('j')) + ])) + + t.equal(bl.length, 10) + + t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij') + + t.equal(bl.slice(3, 10).toString('ascii'), 'defghij') + t.equal(bl.slice(3, 6).toString('ascii'), 'def') + t.equal(bl.slice(3, 8).toString('ascii'), 'defgh') + t.equal(bl.slice(5, 10).toString('ascii'), 'fghij') + + t.end() +}) + +tape('append accepts arrays of Buffers', function (t) { + var bl = new BufferList() + bl.append(new Buffer('abc')) + bl.append([ new Buffer('def') ]) + bl.append([ new Buffer('ghi'), new Buffer('jkl') ]) + bl.append([ new Buffer('mnop'), new Buffer('qrstu'), new Buffer('vwxyz') ]) + t.equal(bl.length, 26) + t.equal(bl.slice().toString('ascii'), 'abcdefghijklmnopqrstuvwxyz') + t.end() +}) + +tape('append accepts arrays of BufferLists', function (t) { + var bl = new BufferList() + bl.append(new Buffer('abc')) + bl.append([ new BufferList('def') ]) + bl.append(new BufferList([ new Buffer('ghi'), new BufferList('jkl') ])) + bl.append([ new Buffer('mnop'), new BufferList([ new Buffer('qrstu'), new Buffer('vwxyz') ]) ]) + t.equal(bl.length, 26) + t.equal(bl.slice().toString('ascii'), 'abcdefghijklmnopqrstuvwxyz') + t.end() +}) + +tape('append chainable', function (t) { + var bl = new BufferList() + t.ok(bl.append(new Buffer('abcd')) === bl) + t.ok(bl.append([ new Buffer('abcd') ]) === bl) + t.ok(bl.append(new BufferList(new Buffer('abcd'))) === bl) + t.ok(bl.append([ new BufferList(new Buffer('abcd')) ]) === bl) + t.end() +}) + +tape('append chainable (test results)', function (t) { + var bl = new BufferList('abc') + .append([ new BufferList('def') ]) + .append(new BufferList([ new Buffer('ghi'), new BufferList('jkl') ])) + .append([ new Buffer('mnop'), new BufferList([ new Buffer('qrstu'), new Buffer('vwxyz') ]) ]) + + t.equal(bl.length, 26) + t.equal(bl.slice().toString('ascii'), 'abcdefghijklmnopqrstuvwxyz') + t.end() +}) + +tape('consuming from multiple buffers', function (t) { + var bl = new BufferList() + + bl.append(new Buffer('abcd')) + bl.append(new Buffer('efg')) + bl.append(new Buffer('hi')) + bl.append(new Buffer('j')) + + t.equal(bl.length, 10) + + t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij') + + bl.consume(3) + t.equal(bl.length, 7) + t.equal(bl.slice(0, 7).toString('ascii'), 'defghij') + + bl.consume(2) + t.equal(bl.length, 5) + t.equal(bl.slice(0, 5).toString('ascii'), 'fghij') + + bl.consume(1) + t.equal(bl.length, 4) + t.equal(bl.slice(0, 4).toString('ascii'), 'ghij') + + bl.consume(1) + t.equal(bl.length, 3) + t.equal(bl.slice(0, 3).toString('ascii'), 'hij') + + bl.consume(2) + t.equal(bl.length, 1) + t.equal(bl.slice(0, 1).toString('ascii'), 'j') + + t.end() +}) + +tape('complete consumption', function (t) { + var bl = new BufferList() + + bl.append(new Buffer('a')) + bl.append(new Buffer('b')) + + bl.consume(2) + + t.equal(bl.length, 0) + t.equal(bl._bufs.length, 0) + + t.end() +}) + +tape('test readUInt8 / readInt8', function (t) { + var buf1 = new Buffer(1) + , buf2 = new Buffer(3) + , buf3 = new Buffer(3) + , bl = new BufferList() + + buf2[1] = 0x3 + buf2[2] = 0x4 + buf3[0] = 0x23 + buf3[1] = 0x42 + + bl.append(buf1) + bl.append(buf2) + bl.append(buf3) + + t.equal(bl.readUInt8(2), 0x3) + t.equal(bl.readInt8(2), 0x3) + t.equal(bl.readUInt8(3), 0x4) + t.equal(bl.readInt8(3), 0x4) + t.equal(bl.readUInt8(4), 0x23) + t.equal(bl.readInt8(4), 0x23) + t.equal(bl.readUInt8(5), 0x42) + t.equal(bl.readInt8(5), 0x42) + t.end() +}) + +tape('test readUInt16LE / readUInt16BE / readInt16LE / readInt16BE', function (t) { + var buf1 = new Buffer(1) + , buf2 = new Buffer(3) + , buf3 = new Buffer(3) + , bl = new BufferList() + + buf2[1] = 0x3 + buf2[2] = 0x4 + buf3[0] = 0x23 + buf3[1] = 0x42 + + bl.append(buf1) + bl.append(buf2) + bl.append(buf3) + + t.equal(bl.readUInt16BE(2), 0x0304) + t.equal(bl.readUInt16LE(2), 0x0403) + t.equal(bl.readInt16BE(2), 0x0304) + t.equal(bl.readInt16LE(2), 0x0403) + t.equal(bl.readUInt16BE(3), 0x0423) + t.equal(bl.readUInt16LE(3), 0x2304) + t.equal(bl.readInt16BE(3), 0x0423) + t.equal(bl.readInt16LE(3), 0x2304) + t.equal(bl.readUInt16BE(4), 0x2342) + t.equal(bl.readUInt16LE(4), 0x4223) + t.equal(bl.readInt16BE(4), 0x2342) + t.equal(bl.readInt16LE(4), 0x4223) + t.end() +}) + +tape('test readUInt32LE / readUInt32BE / readInt32LE / readInt32BE', function (t) { + var buf1 = new Buffer(1) + , buf2 = new Buffer(3) + , buf3 = new Buffer(3) + , bl = new BufferList() + + buf2[1] = 0x3 + buf2[2] = 0x4 + buf3[0] = 0x23 + buf3[1] = 0x42 + + bl.append(buf1) + bl.append(buf2) + bl.append(buf3) + + t.equal(bl.readUInt32BE(2), 0x03042342) + t.equal(bl.readUInt32LE(2), 0x42230403) + t.equal(bl.readInt32BE(2), 0x03042342) + t.equal(bl.readInt32LE(2), 0x42230403) + t.end() +}) + +tape('test readFloatLE / readFloatBE', function (t) { + var buf1 = new Buffer(1) + , buf2 = new Buffer(3) + , buf3 = new Buffer(3) + , bl = new BufferList() + + buf2[1] = 0x00 + buf2[2] = 0x00 + buf3[0] = 0x80 + buf3[1] = 0x3f + + bl.append(buf1) + bl.append(buf2) + bl.append(buf3) + + t.equal(bl.readFloatLE(2), 0x01) + t.end() +}) + +tape('test readDoubleLE / readDoubleBE', function (t) { + var buf1 = new Buffer(1) + , buf2 = new Buffer(3) + , buf3 = new Buffer(10) + , bl = new BufferList() + + buf2[1] = 0x55 + buf2[2] = 0x55 + buf3[0] = 0x55 + buf3[1] = 0x55 + buf3[2] = 0x55 + buf3[3] = 0x55 + buf3[4] = 0xd5 + buf3[5] = 0x3f + + bl.append(buf1) + bl.append(buf2) + bl.append(buf3) + + t.equal(bl.readDoubleLE(2), 0.3333333333333333) + t.end() +}) + +tape('test toString', function (t) { + var bl = new BufferList() + + bl.append(new Buffer('abcd')) + bl.append(new Buffer('efg')) + bl.append(new Buffer('hi')) + bl.append(new Buffer('j')) + + t.equal(bl.toString('ascii', 0, 10), 'abcdefghij') + t.equal(bl.toString('ascii', 3, 10), 'defghij') + t.equal(bl.toString('ascii', 3, 6), 'def') + t.equal(bl.toString('ascii', 3, 8), 'defgh') + t.equal(bl.toString('ascii', 5, 10), 'fghij') + + t.end() +}) + +tape('test toString encoding', function (t) { + var bl = new BufferList() + , b = new Buffer('abcdefghij\xff\x00') + + bl.append(new Buffer('abcd')) + bl.append(new Buffer('efg')) + bl.append(new Buffer('hi')) + bl.append(new Buffer('j')) + bl.append(new Buffer('\xff\x00')) + + encodings.forEach(function (enc) { + t.equal(bl.toString(enc), b.toString(enc), enc) + }) + + t.end() +}) + +!process.browser && tape('test stream', function (t) { + var random = crypto.randomBytes(65534) + , rndhash = hash(random, 'md5') + , md5sum = crypto.createHash('md5') + , bl = new BufferList(function (err, buf) { + t.ok(Buffer.isBuffer(buf)) + t.ok(err === null) + t.equal(rndhash, hash(bl.slice(), 'md5')) + t.equal(rndhash, hash(buf, 'md5')) + + bl.pipe(fs.createWriteStream('/tmp/bl_test_rnd_out.dat')) + .on('close', function () { + var s = fs.createReadStream('/tmp/bl_test_rnd_out.dat') + s.on('data', md5sum.update.bind(md5sum)) + s.on('end', function() { + t.equal(rndhash, md5sum.digest('hex'), 'woohoo! correct hash!') + t.end() + }) + }) + + }) + + fs.writeFileSync('/tmp/bl_test_rnd.dat', random) + fs.createReadStream('/tmp/bl_test_rnd.dat').pipe(bl) +}) + +tape('instantiation with Buffer', function (t) { + var buf = crypto.randomBytes(1024) + , buf2 = crypto.randomBytes(1024) + , b = BufferList(buf) + + t.equal(buf.toString('hex'), b.slice().toString('hex'), 'same buffer') + b = BufferList([ buf, buf2 ]) + t.equal(b.slice().toString('hex'), Buffer.concat([ buf, buf2 ]).toString('hex'), 'same buffer') + t.end() +}) + +tape('test String appendage', function (t) { + var bl = new BufferList() + , b = new Buffer('abcdefghij\xff\x00') + + bl.append('abcd') + bl.append('efg') + bl.append('hi') + bl.append('j') + bl.append('\xff\x00') + + encodings.forEach(function (enc) { + t.equal(bl.toString(enc), b.toString(enc)) + }) + + t.end() +}) + +tape('test Number appendage', function (t) { + var bl = new BufferList() + , b = new Buffer('1234567890') + + bl.append(1234) + bl.append(567) + bl.append(89) + bl.append(0) + + encodings.forEach(function (enc) { + t.equal(bl.toString(enc), b.toString(enc)) + }) + + t.end() +}) + +tape('write nothing, should get empty buffer', function (t) { + t.plan(3) + BufferList(function (err, data) { + t.notOk(err, 'no error') + t.ok(Buffer.isBuffer(data), 'got a buffer') + t.equal(0, data.length, 'got a zero-length buffer') + t.end() + }).end() +}) + +tape('unicode string', function (t) { + t.plan(2) + var inp1 = '\u2600' + , inp2 = '\u2603' + , exp = inp1 + ' and ' + inp2 + , bl = BufferList() + bl.write(inp1) + bl.write(' and ') + bl.write(inp2) + t.equal(exp, bl.toString()) + t.equal(new Buffer(exp).toString('hex'), bl.toString('hex')) +}) + +tape('should emit finish', function (t) { + var source = BufferList() + , dest = BufferList() + + source.write('hello') + source.pipe(dest) + + dest.on('finish', function () { + t.equal(dest.toString('utf8'), 'hello') + t.end() + }) +}) + +tape('basic copy', function (t) { + var buf = crypto.randomBytes(1024) + , buf2 = new Buffer(1024) + , b = BufferList(buf) + + b.copy(buf2) + t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer') + t.end() +}) + +tape('copy after many appends', function (t) { + var buf = crypto.randomBytes(512) + , buf2 = new Buffer(1024) + , b = BufferList(buf) + + b.append(buf) + b.copy(buf2) + t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer') + t.end() +}) + +tape('copy at a precise position', function (t) { + var buf = crypto.randomBytes(1004) + , buf2 = new Buffer(1024) + , b = BufferList(buf) + + b.copy(buf2, 20) + t.equal(b.slice().toString('hex'), buf2.slice(20).toString('hex'), 'same buffer') + t.end() +}) + +tape('copy starting from a precise location', function (t) { + var buf = crypto.randomBytes(10) + , buf2 = new Buffer(5) + , b = BufferList(buf) + + b.copy(buf2, 0, 5) + t.equal(b.slice(5).toString('hex'), buf2.toString('hex'), 'same buffer') + t.end() +}) + +tape('copy in an interval', function (t) { + var rnd = crypto.randomBytes(10) + , b = BufferList(rnd) // put the random bytes there + , actual = new Buffer(3) + , expected = new Buffer(3) + + rnd.copy(expected, 0, 5, 8) + b.copy(actual, 0, 5, 8) + + t.equal(actual.toString('hex'), expected.toString('hex'), 'same buffer') + t.end() +}) + +tape('copy an interval between two buffers', function (t) { + var buf = crypto.randomBytes(10) + , buf2 = new Buffer(10) + , b = BufferList(buf) + + b.append(buf) + b.copy(buf2, 0, 5, 15) + + t.equal(b.slice(5, 15).toString('hex'), buf2.toString('hex'), 'same buffer') + t.end() +}) + +tape('duplicate', function (t) { + t.plan(2) + + var bl = new BufferList('abcdefghij\xff\x00') + , dup = bl.duplicate() + + t.equal(bl.prototype, dup.prototype) + t.equal(bl.toString('hex'), dup.toString('hex')) +}) + +tape('destroy no pipe', function (t) { + t.plan(2) + + var bl = new BufferList('alsdkfja;lsdkfja;lsdk') + bl.destroy() + + t.equal(bl._bufs.length, 0) + t.equal(bl.length, 0) +}) + +!process.browser && tape('destroy with pipe before read end', function (t) { + t.plan(2) + + var bl = new BufferList() + fs.createReadStream(__dirname + '/test.js') + .pipe(bl) + + bl.destroy() + + t.equal(bl._bufs.length, 0) + t.equal(bl.length, 0) + +}) + +!process.browser && tape('destroy with pipe before read end with race', function (t) { + t.plan(2) + + var bl = new BufferList() + fs.createReadStream(__dirname + '/test.js') + .pipe(bl) + + setTimeout(function () { + bl.destroy() + setTimeout(function () { + t.equal(bl._bufs.length, 0) + t.equal(bl.length, 0) + }, 500) + }, 500) +}) + +!process.browser && tape('destroy with pipe after read end', function (t) { + t.plan(2) + + var bl = new BufferList() + fs.createReadStream(__dirname + '/test.js') + .on('end', onEnd) + .pipe(bl) + + function onEnd () { + bl.destroy() + + t.equal(bl._bufs.length, 0) + t.equal(bl.length, 0) + } +}) + +!process.browser && tape('destroy with pipe while writing to a destination', function (t) { + t.plan(4) + + var bl = new BufferList() + , ds = new BufferList() + + fs.createReadStream(__dirname + '/test.js') + .on('end', onEnd) + .pipe(bl) + + function onEnd () { + bl.pipe(ds) + + setTimeout(function () { + bl.destroy() + + t.equals(bl._bufs.length, 0) + t.equals(bl.length, 0) + + ds.destroy() + + t.equals(bl._bufs.length, 0) + t.equals(bl.length, 0) + + }, 100) + } +}) + +!process.browser && tape('handle error', function (t) { + t.plan(2) + fs.createReadStream('/does/not/exist').pipe(BufferList(function (err, data) { + t.ok(err instanceof Error, 'has error') + t.notOk(data, 'no data') + })) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/caseless/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/caseless/LICENSE new file mode 100644 index 00000000..61789f4a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/caseless/LICENSE @@ -0,0 +1,28 @@ +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +1. Definitions. +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +You must give any other recipients of the Work or Derivative Works a copy of this License; and +You must cause any modified files to carry prominent notices stating that You changed the files; and +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/caseless/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/caseless/README.md new file mode 100644 index 00000000..e5077a21 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/caseless/README.md @@ -0,0 +1,45 @@ +## Caseless -- wrap an object to set and get property with caseless semantics but also preserve caseing. + +This library is incredibly useful when working with HTTP headers. It allows you to get/set/check for headers in a caseless manner while also preserving the caseing of headers the first time they are set. + +## Usage + +```javascript +var headers = {} + , c = caseless(headers) + ; +c.set('a-Header', 'asdf') +c.get('a-header') === 'asdf' +``` + +## has(key) + +Has takes a name and if it finds a matching header will return that header name with the preserved caseing it was set with. + +```javascript +c.has('a-header') === 'a-Header' +``` + +## set(key, value[, clobber=true]) + +Set is fairly straight forward except that if the header exists and clobber is disabled it will add `','+value` to the existing header. + +```javascript +c.set('a-Header', 'fdas') +c.set('a-HEADER', 'more', false) +c.get('a-header') === 'fdsa,more' +``` + +## swap(key) + +Swaps the casing of a header with the new one that is passed in. + +```javascript +var headers = {} + , c = caseless(headers) + ; +c.set('a-Header', 'fdas') +c.swap('a-HEADER') +c.has('a-header') === 'a-HEADER' +headers === {'a-HEADER': 'fdas'} +``` diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/caseless/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/caseless/index.js new file mode 100644 index 00000000..d86a70ec --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/caseless/index.js @@ -0,0 +1,66 @@ +function Caseless (dict) { + this.dict = dict || {} +} +Caseless.prototype.set = function (name, value, clobber) { + if (typeof name === 'object') { + for (var i in name) { + this.set(i, name[i], value) + } + } else { + if (typeof clobber === 'undefined') clobber = true + var has = this.has(name) + + if (!clobber && has) this.dict[has] = this.dict[has] + ',' + value + else this.dict[has || name] = value + return has + } +} +Caseless.prototype.has = function (name) { + var keys = Object.keys(this.dict) + , name = name.toLowerCase() + ; + for (var i=0;i=0.11.0 <0.12.0", + "_npmVersion": "2.8.3", + "_nodeVersion": "1.8.1", + "_npmUser": { + "name": "mikeal", + "email": "mikeal.rogers@gmail.com" + }, + "maintainers": [ + { + "name": "mikeal", + "email": "mikeal.rogers@gmail.com" + }, + { + "name": "nylen", + "email": "jnylen@gmail.com" + }, + { + "name": "simov", + "email": "simeonvelichkov@gmail.com" + } + ], + "dist": { + "shasum": "715b96ea9841593cc33067923f5ec60ebda4f7d7", + "tarball": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/caseless/test.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/caseless/test.js new file mode 100644 index 00000000..084bbaf5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/caseless/test.js @@ -0,0 +1,40 @@ +var tape = require('tape') + , caseless = require('./') + ; + +tape('set get has', function (t) { + var headers = {} + , c = caseless(headers) + ; + t.plan(17) + c.set('a-Header', 'asdf') + t.equal(c.get('a-header'), 'asdf') + t.equal(c.has('a-header'), 'a-Header') + t.ok(!c.has('nothing')) + // old bug where we used the wrong regex + t.ok(!c.has('a-hea')) + c.set('a-header', 'fdsa') + t.equal(c.get('a-header'), 'fdsa') + t.equal(c.get('a-Header'), 'fdsa') + c.set('a-HEADER', 'more', false) + t.equal(c.get('a-header'), 'fdsa,more') + + t.deepEqual(headers, {'a-Header': 'fdsa,more'}) + c.swap('a-HEADER') + t.deepEqual(headers, {'a-HEADER': 'fdsa,more'}) + + c.set('deleteme', 'foobar') + t.ok(c.has('deleteme')) + t.ok(c.del('deleteme')) + t.notOk(c.has('deleteme')) + t.notOk(c.has('idonotexist')) + t.ok(c.del('idonotexist')) + + c.set('tva', 'test1') + c.set('tva-header', 'test2') + t.equal(c.has('tva'), 'tva') + t.notOk(c.has('header')) + + t.equal(c.get('tva'), 'test1') + +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/combined-stream/License b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/combined-stream/License new file mode 100644 index 00000000..4804b7ab --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/combined-stream/License @@ -0,0 +1,19 @@ +Copyright (c) 2011 Debuggable Limited + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/combined-stream/Readme.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/combined-stream/Readme.md new file mode 100644 index 00000000..3a9e025f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/combined-stream/Readme.md @@ -0,0 +1,138 @@ +# combined-stream + +A stream that emits multiple other streams one after another. + +**NB** Currently `combined-stream` works with streams vesrion 1 only. There is ongoing effort to switch this library to streams version 2. Any help is welcome. :) Meanwhile you can explore other libraries that provide streams2 support with more or less compatability with `combined-stream`. + +- [combined-stream2](https://www.npmjs.com/package/combined-stream2): A drop-in streams2-compatible replacement for the combined-stream module. + +- [multistream](https://www.npmjs.com/package/multistream): A stream that emits multiple other streams one after another. + +## Installation + +``` bash +npm install combined-stream +``` + +## Usage + +Here is a simple example that shows how you can use combined-stream to combine +two files into one: + +``` javascript +var CombinedStream = require('combined-stream'); +var fs = require('fs'); + +var combinedStream = CombinedStream.create(); +combinedStream.append(fs.createReadStream('file1.txt')); +combinedStream.append(fs.createReadStream('file2.txt')); + +combinedStream.pipe(fs.createWriteStream('combined.txt')); +``` + +While the example above works great, it will pause all source streams until +they are needed. If you don't want that to happen, you can set `pauseStreams` +to `false`: + +``` javascript +var CombinedStream = require('combined-stream'); +var fs = require('fs'); + +var combinedStream = CombinedStream.create({pauseStreams: false}); +combinedStream.append(fs.createReadStream('file1.txt')); +combinedStream.append(fs.createReadStream('file2.txt')); + +combinedStream.pipe(fs.createWriteStream('combined.txt')); +``` + +However, what if you don't have all the source streams yet, or you don't want +to allocate the resources (file descriptors, memory, etc.) for them right away? +Well, in that case you can simply provide a callback that supplies the stream +by calling a `next()` function: + +``` javascript +var CombinedStream = require('combined-stream'); +var fs = require('fs'); + +var combinedStream = CombinedStream.create(); +combinedStream.append(function(next) { + next(fs.createReadStream('file1.txt')); +}); +combinedStream.append(function(next) { + next(fs.createReadStream('file2.txt')); +}); + +combinedStream.pipe(fs.createWriteStream('combined.txt')); +``` + +## API + +### CombinedStream.create([options]) + +Returns a new combined stream object. Available options are: + +* `maxDataSize` +* `pauseStreams` + +The effect of those options is described below. + +### combinedStream.pauseStreams = `true` + +Whether to apply back pressure to the underlaying streams. If set to `false`, +the underlaying streams will never be paused. If set to `true`, the +underlaying streams will be paused right after being appended, as well as when +`delayedStream.pipe()` wants to throttle. + +### combinedStream.maxDataSize = `2 * 1024 * 1024` + +The maximum amount of bytes (or characters) to buffer for all source streams. +If this value is exceeded, `combinedStream` emits an `'error'` event. + +### combinedStream.dataSize = `0` + +The amount of bytes (or characters) currently buffered by `combinedStream`. + +### combinedStream.append(stream) + +Appends the given `stream` to the combinedStream object. If `pauseStreams` is +set to `true, this stream will also be paused right away. + +`streams` can also be a function that takes one parameter called `next`. `next` +is a function that must be invoked in order to provide the `next` stream, see +example above. + +Regardless of how the `stream` is appended, combined-stream always attaches an +`'error'` listener to it, so you don't have to do that manually. + +Special case: `stream` can also be a String or Buffer. + +### combinedStream.write(data) + +You should not call this, `combinedStream` takes care of piping the appended +streams into itself for you. + +### combinedStream.resume() + +Causes `combinedStream` to start drain the streams it manages. The function is +idempotent, and also emits a `'resume'` event each time which usually goes to +the stream that is currently being drained. + +### combinedStream.pause(); + +If `combinedStream.pauseStreams` is set to `false`, this does nothing. +Otherwise a `'pause'` event is emitted, this goes to the stream that is +currently being drained, so you can use it to apply back pressure. + +### combinedStream.end(); + +Sets `combinedStream.writable` to false, emits an `'end'` event, and removes +all streams from the queue. + +### combinedStream.destroy(); + +Same as `combinedStream.end()`, except it emits a `'close'` event instead of +`'end'`. + +## License + +combined-stream is licensed under the MIT license. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/combined-stream/lib/combined_stream.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/combined-stream/lib/combined_stream.js new file mode 100644 index 00000000..6b5c21b6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/combined-stream/lib/combined_stream.js @@ -0,0 +1,188 @@ +var util = require('util'); +var Stream = require('stream').Stream; +var DelayedStream = require('delayed-stream'); + +module.exports = CombinedStream; +function CombinedStream() { + this.writable = false; + this.readable = true; + this.dataSize = 0; + this.maxDataSize = 2 * 1024 * 1024; + this.pauseStreams = true; + + this._released = false; + this._streams = []; + this._currentStream = null; +} +util.inherits(CombinedStream, Stream); + +CombinedStream.create = function(options) { + var combinedStream = new this(); + + options = options || {}; + for (var option in options) { + combinedStream[option] = options[option]; + } + + return combinedStream; +}; + +CombinedStream.isStreamLike = function(stream) { + return (typeof stream !== 'function') + && (typeof stream !== 'string') + && (typeof stream !== 'boolean') + && (typeof stream !== 'number') + && (!Buffer.isBuffer(stream)); +}; + +CombinedStream.prototype.append = function(stream) { + var isStreamLike = CombinedStream.isStreamLike(stream); + + if (isStreamLike) { + if (!(stream instanceof DelayedStream)) { + var newStream = DelayedStream.create(stream, { + maxDataSize: Infinity, + pauseStream: this.pauseStreams, + }); + stream.on('data', this._checkDataSize.bind(this)); + stream = newStream; + } + + this._handleErrors(stream); + + if (this.pauseStreams) { + stream.pause(); + } + } + + this._streams.push(stream); + return this; +}; + +CombinedStream.prototype.pipe = function(dest, options) { + Stream.prototype.pipe.call(this, dest, options); + this.resume(); + return dest; +}; + +CombinedStream.prototype._getNext = function() { + this._currentStream = null; + var stream = this._streams.shift(); + + + if (typeof stream == 'undefined') { + this.end(); + return; + } + + if (typeof stream !== 'function') { + this._pipeNext(stream); + return; + } + + var getStream = stream; + getStream(function(stream) { + var isStreamLike = CombinedStream.isStreamLike(stream); + if (isStreamLike) { + stream.on('data', this._checkDataSize.bind(this)); + this._handleErrors(stream); + } + + this._pipeNext(stream); + }.bind(this)); +}; + +CombinedStream.prototype._pipeNext = function(stream) { + this._currentStream = stream; + + var isStreamLike = CombinedStream.isStreamLike(stream); + if (isStreamLike) { + stream.on('end', this._getNext.bind(this)); + stream.pipe(this, {end: false}); + return; + } + + var value = stream; + this.write(value); + this._getNext(); +}; + +CombinedStream.prototype._handleErrors = function(stream) { + var self = this; + stream.on('error', function(err) { + self._emitError(err); + }); +}; + +CombinedStream.prototype.write = function(data) { + this.emit('data', data); +}; + +CombinedStream.prototype.pause = function() { + if (!this.pauseStreams) { + return; + } + + if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause(); + this.emit('pause'); +}; + +CombinedStream.prototype.resume = function() { + if (!this._released) { + this._released = true; + this.writable = true; + this._getNext(); + } + + if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume(); + this.emit('resume'); +}; + +CombinedStream.prototype.end = function() { + this._reset(); + this.emit('end'); +}; + +CombinedStream.prototype.destroy = function() { + this._reset(); + this.emit('close'); +}; + +CombinedStream.prototype._reset = function() { + this.writable = false; + this._streams = []; + this._currentStream = null; +}; + +CombinedStream.prototype._checkDataSize = function() { + this._updateDataSize(); + if (this.dataSize <= this.maxDataSize) { + return; + } + + var message = + 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'; + this._emitError(new Error(message)); +}; + +CombinedStream.prototype._updateDataSize = function() { + this.dataSize = 0; + + var self = this; + this._streams.forEach(function(stream) { + if (!stream.dataSize) { + return; + } + + self.dataSize += stream.dataSize; + }); + + if (this._currentStream && this._currentStream.dataSize) { + this.dataSize += this._currentStream.dataSize; + } +}; + +CombinedStream.prototype._emitError = function(err) { + this._reset(); + this.emit('error', err); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/.npmignore new file mode 100644 index 00000000..9daeafb9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/.npmignore @@ -0,0 +1 @@ +test diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/License b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/License new file mode 100644 index 00000000..4804b7ab --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/License @@ -0,0 +1,19 @@ +Copyright (c) 2011 Debuggable Limited + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Makefile b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Makefile new file mode 100644 index 00000000..b4ff85a3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Makefile @@ -0,0 +1,7 @@ +SHELL := /bin/bash + +test: + @./test/run.js + +.PHONY: test + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Readme.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Readme.md new file mode 100644 index 00000000..aca36f9f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Readme.md @@ -0,0 +1,141 @@ +# delayed-stream + +Buffers events from a stream until you are ready to handle them. + +## Installation + +``` bash +npm install delayed-stream +``` + +## Usage + +The following example shows how to write a http echo server that delays its +response by 1000 ms. + +``` javascript +var DelayedStream = require('delayed-stream'); +var http = require('http'); + +http.createServer(function(req, res) { + var delayed = DelayedStream.create(req); + + setTimeout(function() { + res.writeHead(200); + delayed.pipe(res); + }, 1000); +}); +``` + +If you are not using `Stream#pipe`, you can also manually release the buffered +events by calling `delayedStream.resume()`: + +``` javascript +var delayed = DelayedStream.create(req); + +setTimeout(function() { + // Emit all buffered events and resume underlaying source + delayed.resume(); +}, 1000); +``` + +## Implementation + +In order to use this meta stream properly, here are a few things you should +know about the implementation. + +### Event Buffering / Proxying + +All events of the `source` stream are hijacked by overwriting the `source.emit` +method. Until node implements a catch-all event listener, this is the only way. + +However, delayed-stream still continues to emit all events it captures on the +`source`, regardless of whether you have released the delayed stream yet or +not. + +Upon creation, delayed-stream captures all `source` events and stores them in +an internal event buffer. Once `delayedStream.release()` is called, all +buffered events are emitted on the `delayedStream`, and the event buffer is +cleared. After that, delayed-stream merely acts as a proxy for the underlaying +source. + +### Error handling + +Error events on `source` are buffered / proxied just like any other events. +However, `delayedStream.create` attaches a no-op `'error'` listener to the +`source`. This way you only have to handle errors on the `delayedStream` +object, rather than in two places. + +### Buffer limits + +delayed-stream provides a `maxDataSize` property that can be used to limit +the amount of data being buffered. In order to protect you from bad `source` +streams that don't react to `source.pause()`, this feature is enabled by +default. + +## API + +### DelayedStream.create(source, [options]) + +Returns a new `delayedStream`. Available options are: + +* `pauseStream` +* `maxDataSize` + +The description for those properties can be found below. + +### delayedStream.source + +The `source` stream managed by this object. This is useful if you are +passing your `delayedStream` around, and you still want to access properties +on the `source` object. + +### delayedStream.pauseStream = true + +Whether to pause the underlaying `source` when calling +`DelayedStream.create()`. Modifying this property afterwards has no effect. + +### delayedStream.maxDataSize = 1024 * 1024 + +The amount of data to buffer before emitting an `error`. + +If the underlaying source is emitting `Buffer` objects, the `maxDataSize` +refers to bytes. + +If the underlaying source is emitting JavaScript strings, the size refers to +characters. + +If you know what you are doing, you can set this property to `Infinity` to +disable this feature. You can also modify this property during runtime. + +### delayedStream.dataSize = 0 + +The amount of data buffered so far. + +### delayedStream.readable + +An ECMA5 getter that returns the value of `source.readable`. + +### delayedStream.resume() + +If the `delayedStream` has not been released so far, `delayedStream.release()` +is called. + +In either case, `source.resume()` is called. + +### delayedStream.pause() + +Calls `source.pause()`. + +### delayedStream.pipe(dest) + +Calls `delayedStream.resume()` and then proxies the arguments to `source.pipe`. + +### delayedStream.release() + +Emits and clears all events that have been buffered up so far. This does not +resume the underlaying source, use `delayedStream.resume()` instead. + +## License + +delayed-stream is licensed under the MIT license. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js new file mode 100644 index 00000000..b38fc85f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js @@ -0,0 +1,107 @@ +var Stream = require('stream').Stream; +var util = require('util'); + +module.exports = DelayedStream; +function DelayedStream() { + this.source = null; + this.dataSize = 0; + this.maxDataSize = 1024 * 1024; + this.pauseStream = true; + + this._maxDataSizeExceeded = false; + this._released = false; + this._bufferedEvents = []; +} +util.inherits(DelayedStream, Stream); + +DelayedStream.create = function(source, options) { + var delayedStream = new this(); + + options = options || {}; + for (var option in options) { + delayedStream[option] = options[option]; + } + + delayedStream.source = source; + + var realEmit = source.emit; + source.emit = function() { + delayedStream._handleEmit(arguments); + return realEmit.apply(source, arguments); + }; + + source.on('error', function() {}); + if (delayedStream.pauseStream) { + source.pause(); + } + + return delayedStream; +}; + +Object.defineProperty(DelayedStream.prototype, 'readable', { + configurable: true, + enumerable: true, + get: function() { + return this.source.readable; + } +}); + +DelayedStream.prototype.setEncoding = function() { + return this.source.setEncoding.apply(this.source, arguments); +}; + +DelayedStream.prototype.resume = function() { + if (!this._released) { + this.release(); + } + + this.source.resume(); +}; + +DelayedStream.prototype.pause = function() { + this.source.pause(); +}; + +DelayedStream.prototype.release = function() { + this._released = true; + + this._bufferedEvents.forEach(function(args) { + this.emit.apply(this, args); + }.bind(this)); + this._bufferedEvents = []; +}; + +DelayedStream.prototype.pipe = function() { + var r = Stream.prototype.pipe.apply(this, arguments); + this.resume(); + return r; +}; + +DelayedStream.prototype._handleEmit = function(args) { + if (this._released) { + this.emit.apply(this, args); + return; + } + + if (args[0] === 'data') { + this.dataSize += args[1].length; + this._checkIfMaxDataSizeExceeded(); + } + + this._bufferedEvents.push(args); +}; + +DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() { + if (this._maxDataSizeExceeded) { + return; + } + + if (this.dataSize <= this.maxDataSize) { + return; + } + + this._maxDataSizeExceeded = true; + var message = + 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.' + this.emit('error', new Error(message)); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/package.json new file mode 100644 index 00000000..a4717288 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/package.json @@ -0,0 +1,64 @@ +{ + "author": { + "name": "Felix Geisendörfer", + "email": "felix@debuggable.com", + "url": "http://debuggable.com/" + }, + "contributors": [ + { + "name": "Mike Atkins", + "email": "apeherder@gmail.com" + } + ], + "name": "delayed-stream", + "description": "Buffers events from a stream until you are ready to handle them.", + "license": "MIT", + "version": "1.0.0", + "homepage": "https://github.com/felixge/node-delayed-stream", + "repository": { + "type": "git", + "url": "git://github.com/felixge/node-delayed-stream.git" + }, + "main": "./lib/delayed_stream", + "engines": { + "node": ">=0.4.0" + }, + "scripts": { + "test": "make test" + }, + "dependencies": {}, + "devDependencies": { + "fake": "0.2.0", + "far": "0.0.1" + }, + "gitHead": "07a9dc99fb8f1a488160026b9ad77493f766fb84", + "bugs": { + "url": "https://github.com/felixge/node-delayed-stream/issues" + }, + "_id": "delayed-stream@1.0.0", + "_shasum": "df3ae199acadfb7d440aaae0b29e2272b24ec619", + "_from": "delayed-stream@>=1.0.0 <1.1.0", + "_npmVersion": "2.8.3", + "_nodeVersion": "1.6.4", + "_npmUser": { + "name": "apechimp", + "email": "apeherder@gmail.com" + }, + "dist": { + "shasum": "df3ae199acadfb7d440aaae0b29e2272b24ec619", + "tarball": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz" + }, + "maintainers": [ + { + "name": "felixge", + "email": "felix@debuggable.com" + }, + { + "name": "apechimp", + "email": "apeherder@gmail.com" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/combined-stream/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/combined-stream/package.json new file mode 100644 index 00000000..74d35f12 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/combined-stream/package.json @@ -0,0 +1,67 @@ +{ + "author": { + "name": "Felix Geisendörfer", + "email": "felix@debuggable.com", + "url": "http://debuggable.com/" + }, + "name": "combined-stream", + "description": "A stream that emits multiple other streams one after another.", + "version": "1.0.5", + "homepage": "https://github.com/felixge/node-combined-stream", + "repository": { + "type": "git", + "url": "git://github.com/felixge/node-combined-stream.git" + }, + "main": "./lib/combined_stream", + "scripts": { + "test": "node test/run.js" + }, + "engines": { + "node": ">= 0.8" + }, + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "devDependencies": { + "far": "~0.0.7" + }, + "license": "MIT", + "gitHead": "cfc7b815d090a109bcedb5bb0f6713148d55a6b7", + "bugs": { + "url": "https://github.com/felixge/node-combined-stream/issues" + }, + "_id": "combined-stream@1.0.5", + "_shasum": "938370a57b4a51dea2c77c15d5c5fdf895164009", + "_from": "combined-stream@>=1.0.5 <1.1.0", + "_npmVersion": "2.10.1", + "_nodeVersion": "0.12.4", + "_npmUser": { + "name": "alexindigo", + "email": "iam@alexindigo.com" + }, + "dist": { + "shasum": "938370a57b4a51dea2c77c15d5c5fdf895164009", + "tarball": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz" + }, + "maintainers": [ + { + "name": "felixge", + "email": "felix@debuggable.com" + }, + { + "name": "celer", + "email": "dtyree77@gmail.com" + }, + { + "name": "alexindigo", + "email": "iam@alexindigo.com" + }, + { + "name": "apechimp", + "email": "apeherder@gmail.com" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/extend/.jscs.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/extend/.jscs.json new file mode 100644 index 00000000..59faa8bd --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/extend/.jscs.json @@ -0,0 +1,103 @@ +{ + "additionalRules": [], + + "requireSemicolons": true, + + "disallowMultipleSpaces": true, + + "disallowIdentifierNames": [], + + "requireCurlyBraces": ["if", "else", "for", "while", "do", "try", "catch"], + + "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"], + + "disallowSpaceAfterKeywords": [], + + "requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true }, + "requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true }, + "requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true }, + + "requireSpaceBetweenArguments": true, + + "disallowSpacesInsideParentheses": true, + + "disallowSpacesInsideArrayBrackets": true, + + "disallowQuotedKeysInObjects": "allButReserved", + + "disallowSpaceAfterObjectKeys": true, + + "requireCommaBeforeLineBreak": true, + + "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], + "requireSpaceAfterPrefixUnaryOperators": [], + + "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], + "requireSpaceBeforePostfixUnaryOperators": [], + + "disallowSpaceBeforeBinaryOperators": [], + "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], + + "requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], + "disallowSpaceAfterBinaryOperators": [], + + "disallowImplicitTypeConversion": ["binary", "string"], + + "disallowKeywords": ["with", "eval"], + + "requireKeywordsOnNewLine": [], + "disallowKeywordsOnNewLine": ["else"], + + "requireLineFeedAtFileEnd": true, + + "disallowTrailingWhitespace": true, + + "disallowTrailingComma": true, + + "excludeFiles": ["node_modules/**", "vendor/**"], + + "disallowMultipleLineStrings": true, + + "requireDotNotation": true, + + "requireParenthesesAroundIIFE": true, + + "validateLineBreaks": "LF", + + "validateQuoteMarks": { + "escape": true, + "mark": "'" + }, + + "disallowOperatorBeforeLineBreak": [], + + "requireSpaceBeforeKeywords": [ + "do", + "for", + "if", + "else", + "switch", + "case", + "try", + "catch", + "finally", + "while", + "with", + "return" + ], + + "validateAlignedFunctionParameters": { + "lineBreakAfterOpeningBraces": true, + "lineBreakBeforeClosingBraces": true + }, + + "requirePaddingNewLinesBeforeExport": true, + + "validateNewlineAfterArrayElements": { + "maximum": 6 + }, + + "requirePaddingNewLinesAfterUseStrict": true +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/extend/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/extend/.npmignore new file mode 100644 index 00000000..30d74d25 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/extend/.npmignore @@ -0,0 +1 @@ +test \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/extend/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/extend/.travis.yml new file mode 100644 index 00000000..ebef6449 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/extend/.travis.yml @@ -0,0 +1,44 @@ +language: node_js +node_js: + - "iojs-v2.3" + - "iojs-v2.2" + - "iojs-v2.1" + - "iojs-v2.0" + - "iojs-v1.8" + - "iojs-v1.7" + - "iojs-v1.6" + - "iojs-v1.5" + - "iojs-v1.4" + - "iojs-v1.3" + - "iojs-v1.2" + - "iojs-v1.1" + - "iojs-v1.0" + - "0.12" + - "0.11" + - "0.10" + - "0.9" + - "0.8" + - "0.6" + - "0.4" +before_install: + - '[ "${TRAVIS_NODE_VERSION}" = "0.6" ] || npm install -g npm@1.4.28 && npm install -g npm' +sudo: false +matrix: + fast_finish: true + allow_failures: + - node_js: "iojs-v2.2" + - node_js: "iojs-v2.1" + - node_js: "iojs-v2.0" + - node_js: "iojs-v1.7" + - node_js: "iojs-v1.6" + - node_js: "iojs-v1.5" + - node_js: "iojs-v1.4" + - node_js: "iojs-v1.3" + - node_js: "iojs-v1.2" + - node_js: "iojs-v1.1" + - node_js: "iojs-v1.0" + - node_js: "0.11" + - node_js: "0.9" + - node_js: "0.8" + - node_js: "0.6" + - node_js: "0.4" diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/extend/CHANGELOG.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/extend/CHANGELOG.md new file mode 100644 index 00000000..2874d2ec --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/extend/CHANGELOG.md @@ -0,0 +1,68 @@ +3.0.0 / 2015-07-01 +================== + * [Possible breaking change] Use global "strict" directive (#32) + * [Tests] `int` is an ES3 reserved word + * [Tests] Test up to `io.js` `v2.3` + * [Tests] Add `npm run eslint` + * [Dev Deps] Update `covert`, `jscs` + +2.0.1 / 2015-04-25 +================== + * Use an inline `isArray` check, for ES3 browsers. (#27) + * Some old browsers fail when an identifier is `toString` + * Test latest `node` and `io.js` versions on `travis-ci`; speed up builds + * Add license info to package.json (#25) + * Update `tape`, `jscs` + * Adding a CHANGELOG + +2.0.0 / 2014-10-01 +================== + * Increase code coverage to 100%; run code coverage as part of tests + * Add `npm run lint`; Run linter as part of tests + * Remove nodeType and setInterval checks in isPlainObject + * Updating `tape`, `jscs`, `covert` + * General style and README cleanup + +1.3.0 / 2014-06-20 +================== + * Add component.json for browser support (#18) + * Use SVG for badges in README (#16) + * Updating `tape`, `covert` + * Updating travis-ci to work with multiple node versions + * Fix `deep === false` bug (returning target as {}) (#14) + * Fixing constructor checks in isPlainObject + * Adding additional test coverage + * Adding `npm run coverage` + * Add LICENSE (#13) + * Adding a warning about `false`, per #11 + * General style and whitespace cleanup + +1.2.1 / 2013-09-14 +================== + * Fixing hasOwnProperty bugs that would only have shown up in specific browsers. Fixes #8 + * Updating `tape` + +1.2.0 / 2013-09-02 +================== + * Updating the README: add badges + * Adding a missing variable reference. + * Using `tape` instead of `buster` for tests; add more tests (#7) + * Adding node 0.10 to Travis CI (#6) + * Enabling "npm test" and cleaning up package.json (#5) + * Add Travis CI. + +1.1.3 / 2012-12-06 +================== + * Added unit tests. + * Ensure extend function is named. (Looks nicer in a stack trace.) + * README cleanup. + +1.1.1 / 2012-11-07 +================== + * README cleanup. + * Added installation instructions. + * Added a missing semicolon + +1.0.0 / 2012-04-08 +================== + * Initial commit diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/extend/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/extend/LICENSE new file mode 100644 index 00000000..92d41503 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/extend/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2014 Stefan Thomas + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/extend/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/extend/README.md new file mode 100644 index 00000000..3a47b218 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/extend/README.md @@ -0,0 +1,61 @@ +[![Build Status][travis-svg]][travis-url] +[![dependency status][deps-svg]][deps-url] +[![dev dependency status][dev-deps-svg]][dev-deps-url] + +# extend() for Node.js [![Version Badge][npm-version-png]][npm-url] + +`node-extend` is a port of the classic extend() method from jQuery. It behaves as you expect. It is simple, tried and true. + +## Installation + +This package is available on [npm][npm-url] as: `extend` + +``` sh +npm install extend +``` + +## Usage + +**Syntax:** extend **(** [`deep`], `target`, `object1`, [`objectN`] **)** + +*Extend one object with one or more others, returning the modified object.* + +Keep in mind that the target object will be modified, and will be returned from extend(). + +If a boolean true is specified as the first argument, extend performs a deep copy, recursively copying any objects it finds. Otherwise, the copy will share structure with the original object(s). +Undefined properties are not copied. However, properties inherited from the object's prototype will be copied over. +Warning: passing `false` as the first argument is not supported. + +### Arguments + +* `deep` *Boolean* (optional) +If set, the merge becomes recursive (i.e. deep copy). +* `target` *Object* +The object to extend. +* `object1` *Object* +The object that will be merged into the first. +* `objectN` *Object* (Optional) +More objects to merge into the first. + +## License + +`node-extend` is licensed under the [MIT License][mit-license-url]. + +## Acknowledgements + +All credit to the jQuery authors for perfecting this amazing utility. + +Ported to Node.js by [Stefan Thomas][github-justmoon] with contributions by [Jonathan Buchanan][github-insin] and [Jordan Harband][github-ljharb]. + +[travis-svg]: https://travis-ci.org/justmoon/node-extend.svg +[travis-url]: https://travis-ci.org/justmoon/node-extend +[npm-url]: https://npmjs.org/package/extend +[mit-license-url]: http://opensource.org/licenses/MIT +[github-justmoon]: https://github.com/justmoon +[github-insin]: https://github.com/insin +[github-ljharb]: https://github.com/ljharb +[npm-version-png]: http://vb.teelaun.ch/justmoon/node-extend.svg +[deps-svg]: https://david-dm.org/justmoon/node-extend.svg +[deps-url]: https://david-dm.org/justmoon/node-extend +[dev-deps-svg]: https://david-dm.org/justmoon/node-extend/dev-status.svg +[dev-deps-url]: https://david-dm.org/justmoon/node-extend#info=devDependencies diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/extend/component.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/extend/component.json new file mode 100644 index 00000000..0f76b593 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/extend/component.json @@ -0,0 +1,31 @@ +{ + "name": "extend", + "author": "Stefan Thomas (http://www.justmoon.net)", + "version": "3.0.0", + "description": "Port of jQuery.extend for node.js and the browser.", + "scripts": [ + "index.js" + ], + "contributors": [ + { + "name": "Jordan Harband", + "url": "https://github.com/ljharb" + } + ], + "keywords": [ + "extend", + "clone", + "merge" + ], + "repository" : { + "type": "git", + "url": "https://github.com/justmoon/node-extend.git" + }, + "dependencies": { + }, + "devDependencies": { + "tape" : "~3.0.0", + "covert": "~0.4.0", + "jscs": "~1.6.2" + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/extend/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/extend/index.js new file mode 100644 index 00000000..2f957482 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/extend/index.js @@ -0,0 +1,85 @@ +'use strict'; + +var hasOwn = Object.prototype.hasOwnProperty; +var toStr = Object.prototype.toString; + +var isArray = function isArray(arr) { + if (typeof Array.isArray === 'function') { + return Array.isArray(arr); + } + + return toStr.call(arr) === '[object Array]'; +}; + +var isPlainObject = function isPlainObject(obj) { + if (!obj || toStr.call(obj) !== '[object Object]') { + return false; + } + + var hasOwnConstructor = hasOwn.call(obj, 'constructor'); + var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf'); + // Not own constructor property must be Object + if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) { + return false; + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + var key; + for (key in obj) {/**/} + + return typeof key === 'undefined' || hasOwn.call(obj, key); +}; + +module.exports = function extend() { + var options, name, src, copy, copyIsArray, clone, + target = arguments[0], + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if (typeof target === 'boolean') { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } else if ((typeof target !== 'object' && typeof target !== 'function') || target == null) { + target = {}; + } + + for (; i < length; ++i) { + options = arguments[i]; + // Only deal with non-null/undefined values + if (options != null) { + // Extend the base object + for (name in options) { + src = target[name]; + copy = options[name]; + + // Prevent never-ending loop + if (target !== copy) { + // Recurse if we're merging plain objects or arrays + if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) { + if (copyIsArray) { + copyIsArray = false; + clone = src && isArray(src) ? src : []; + } else { + clone = src && isPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + target[name] = extend(deep, clone, copy); + + // Don't bring in undefined values + } else if (typeof copy !== 'undefined') { + target[name] = copy; + } + } + } + } + } + + // Return the modified object + return target; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/extend/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/extend/package.json new file mode 100644 index 00000000..f8341433 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/extend/package.json @@ -0,0 +1,73 @@ +{ + "name": "extend", + "author": { + "name": "Stefan Thomas", + "email": "justmoon@members.fsf.org", + "url": "http://www.justmoon.net" + }, + "version": "3.0.0", + "description": "Port of jQuery.extend for node.js and the browser", + "main": "index", + "scripts": { + "test": "npm run lint && node test/index.js && npm run coverage-quiet", + "coverage": "covert test/index.js", + "coverage-quiet": "covert test/index.js --quiet", + "lint": "npm run jscs && npm run eslint", + "jscs": "jscs *.js */*.js", + "eslint": "eslint *.js */*.js" + }, + "contributors": [ + { + "name": "Jordan Harband", + "url": "https://github.com/ljharb" + } + ], + "keywords": [ + "extend", + "clone", + "merge" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/justmoon/node-extend.git" + }, + "dependencies": {}, + "devDependencies": { + "tape": "^4.0.0", + "covert": "^1.1.0", + "jscs": "^1.13.1", + "eslint": "^0.24.0" + }, + "license": "MIT", + "gitHead": "148e7270cab2e9413af2cd0cab147070d755ed6d", + "bugs": { + "url": "https://github.com/justmoon/node-extend/issues" + }, + "homepage": "https://github.com/justmoon/node-extend#readme", + "_id": "extend@3.0.0", + "_shasum": "5a474353b9f3353ddd8176dfd37b91c83a46f1d4", + "_from": "extend@>=3.0.0 <3.1.0", + "_npmVersion": "2.11.3", + "_nodeVersion": "2.3.1", + "_npmUser": { + "name": "ljharb", + "email": "ljharb@gmail.com" + }, + "dist": { + "shasum": "5a474353b9f3353ddd8176dfd37b91c83a46f1d4", + "tarball": "https://registry.npmjs.org/extend/-/extend-3.0.0.tgz" + }, + "maintainers": [ + { + "name": "justmoon", + "email": "justmoon@members.fsf.org" + }, + { + "name": "ljharb", + "email": "ljharb@gmail.com" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/extend/-/extend-3.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/forever-agent/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/forever-agent/LICENSE new file mode 100644 index 00000000..a4a9aee0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/forever-agent/LICENSE @@ -0,0 +1,55 @@ +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of this License; and + +You must cause any modified files to carry prominent notices stating that You changed the files; and + +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/forever-agent/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/forever-agent/README.md new file mode 100644 index 00000000..9d5b6634 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/forever-agent/README.md @@ -0,0 +1,4 @@ +forever-agent +============= + +HTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/forever-agent/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/forever-agent/index.js new file mode 100644 index 00000000..416c7abd --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/forever-agent/index.js @@ -0,0 +1,138 @@ +module.exports = ForeverAgent +ForeverAgent.SSL = ForeverAgentSSL + +var util = require('util') + , Agent = require('http').Agent + , net = require('net') + , tls = require('tls') + , AgentSSL = require('https').Agent + +function getConnectionName(host, port) { + var name = '' + if (typeof host === 'string') { + name = host + ':' + port + } else { + // For node.js v012.0 and iojs-v1.5.1, host is an object. And any existing localAddress is part of the connection name. + name = host.host + ':' + host.port + ':' + (host.localAddress ? (host.localAddress + ':') : ':') + } + return name +} + +function ForeverAgent(options) { + var self = this + self.options = options || {} + self.requests = {} + self.sockets = {} + self.freeSockets = {} + self.maxSockets = self.options.maxSockets || Agent.defaultMaxSockets + self.minSockets = self.options.minSockets || ForeverAgent.defaultMinSockets + self.on('free', function(socket, host, port) { + var name = getConnectionName(host, port) + + if (self.requests[name] && self.requests[name].length) { + self.requests[name].shift().onSocket(socket) + } else if (self.sockets[name].length < self.minSockets) { + if (!self.freeSockets[name]) self.freeSockets[name] = [] + self.freeSockets[name].push(socket) + + // if an error happens while we don't use the socket anyway, meh, throw the socket away + var onIdleError = function() { + socket.destroy() + } + socket._onIdleError = onIdleError + socket.on('error', onIdleError) + } else { + // If there are no pending requests just destroy the + // socket and it will get removed from the pool. This + // gets us out of timeout issues and allows us to + // default to Connection:keep-alive. + socket.destroy() + } + }) + +} +util.inherits(ForeverAgent, Agent) + +ForeverAgent.defaultMinSockets = 5 + + +ForeverAgent.prototype.createConnection = net.createConnection +ForeverAgent.prototype.addRequestNoreuse = Agent.prototype.addRequest +ForeverAgent.prototype.addRequest = function(req, host, port) { + var name = getConnectionName(host, port) + + if (typeof host !== 'string') { + var options = host + port = options.port + host = options.host + } + + if (this.freeSockets[name] && this.freeSockets[name].length > 0 && !req.useChunkedEncodingByDefault) { + var idleSocket = this.freeSockets[name].pop() + idleSocket.removeListener('error', idleSocket._onIdleError) + delete idleSocket._onIdleError + req._reusedSocket = true + req.onSocket(idleSocket) + } else { + this.addRequestNoreuse(req, host, port) + } +} + +ForeverAgent.prototype.removeSocket = function(s, name, host, port) { + if (this.sockets[name]) { + var index = this.sockets[name].indexOf(s) + if (index !== -1) { + this.sockets[name].splice(index, 1) + } + } else if (this.sockets[name] && this.sockets[name].length === 0) { + // don't leak + delete this.sockets[name] + delete this.requests[name] + } + + if (this.freeSockets[name]) { + var index = this.freeSockets[name].indexOf(s) + if (index !== -1) { + this.freeSockets[name].splice(index, 1) + if (this.freeSockets[name].length === 0) { + delete this.freeSockets[name] + } + } + } + + if (this.requests[name] && this.requests[name].length) { + // If we have pending requests and a socket gets closed a new one + // needs to be created to take over in the pool for the one that closed. + this.createSocket(name, host, port).emit('free') + } +} + +function ForeverAgentSSL (options) { + ForeverAgent.call(this, options) +} +util.inherits(ForeverAgentSSL, ForeverAgent) + +ForeverAgentSSL.prototype.createConnection = createConnectionSSL +ForeverAgentSSL.prototype.addRequestNoreuse = AgentSSL.prototype.addRequest + +function createConnectionSSL (port, host, options) { + if (typeof port === 'object') { + options = port; + } else if (typeof host === 'object') { + options = host; + } else if (typeof options === 'object') { + options = options; + } else { + options = {}; + } + + if (typeof port === 'number') { + options.port = port; + } + + if (typeof host === 'string') { + options.host = host; + } + + return tls.connect(options); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/forever-agent/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/forever-agent/package.json new file mode 100644 index 00000000..36c4f594 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/forever-agent/package.json @@ -0,0 +1,56 @@ +{ + "author": { + "name": "Mikeal Rogers", + "email": "mikeal.rogers@gmail.com", + "url": "http://www.futurealoof.com" + }, + "name": "forever-agent", + "description": "HTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module.", + "version": "0.6.1", + "license": "Apache-2.0", + "repository": { + "url": "git+https://github.com/mikeal/forever-agent.git" + }, + "main": "index.js", + "dependencies": {}, + "devDependencies": {}, + "optionalDependencies": {}, + "engines": { + "node": "*" + }, + "gitHead": "1b3b6163f2b3c2c4122bbfa288c1325c0df9871d", + "bugs": { + "url": "https://github.com/mikeal/forever-agent/issues" + }, + "homepage": "https://github.com/mikeal/forever-agent", + "_id": "forever-agent@0.6.1", + "scripts": {}, + "_shasum": "fbc71f0c41adeb37f96c577ad1ed42d8fdacca91", + "_from": "forever-agent@>=0.6.1 <0.7.0", + "_npmVersion": "1.4.28", + "_npmUser": { + "name": "simov", + "email": "simeonvelichkov@gmail.com" + }, + "maintainers": [ + { + "name": "mikeal", + "email": "mikeal.rogers@gmail.com" + }, + { + "name": "nylen", + "email": "jnylen@gmail.com" + }, + { + "name": "simov", + "email": "simeonvelichkov@gmail.com" + } + ], + "dist": { + "shasum": "fbc71f0c41adeb37f96c577ad1ed42d8fdacca91", + "tarball": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/form-data/.dockerignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/form-data/.dockerignore new file mode 100644 index 00000000..c67305cf --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/form-data/.dockerignore @@ -0,0 +1,7 @@ +*.iml +*.sublime-* +*.un~ +.idea +sftp-config.json +node_modules/ +test/tmp/ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/form-data/.editorconfig b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/form-data/.editorconfig new file mode 100644 index 00000000..0f099897 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/form-data/.editorconfig @@ -0,0 +1,10 @@ +# editorconfig.org +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/form-data/.eslintignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/form-data/.eslintignore new file mode 100644 index 00000000..8d87b1d2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/form-data/.eslintignore @@ -0,0 +1 @@ +node_modules/* diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/form-data/License b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/form-data/License new file mode 100644 index 00000000..c7ff12a2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/form-data/License @@ -0,0 +1,19 @@ +Copyright (c) 2012 Felix Geisendörfer (felix@debuggable.com) and contributors + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/form-data/Readme.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/form-data/Readme.md new file mode 100644 index 00000000..e857db6e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/form-data/Readme.md @@ -0,0 +1,218 @@ +# Form-Data [![NPM Module](https://img.shields.io/npm/v/form-data.svg)](https://www.npmjs.com/package/form-data) [![Join the chat at https://gitter.im/form-data/form-data](http://form-data.github.io/images/gitterbadge.svg)](https://gitter.im/form-data/form-data) + +A library to create readable ```"multipart/form-data"``` streams. Can be used to submit forms and file uploads to other web applications. + +The API of this library is inspired by the [XMLHttpRequest-2 FormData Interface][xhr2-fd]. + +[xhr2-fd]: http://dev.w3.org/2006/webapi/XMLHttpRequest-2/Overview.html#the-formdata-interface +[streams2-thing]: http://nodejs.org/api/stream.html#stream_compatibility_with_older_node_versions + +[![Linux Build](https://img.shields.io/travis/form-data/form-data/master.svg?label=linux:0.10-5.x)](https://travis-ci.org/form-data/form-data) +[![Windows Build](https://img.shields.io/appveyor/ci/alexindigo/form-data/master.svg?label=windows:0.10-5.x)](https://ci.appveyor.com/project/alexindigo/form-data) +[![Coverage Status](https://img.shields.io/coveralls/form-data/form-data/master.svg?label=code+coverage)](https://coveralls.io/github/form-data/form-data?branch=master) + +[![Dependency Status](https://img.shields.io/david/form-data/form-data.svg)](https://david-dm.org/form-data/form-data) +[![Codacy Badge](https://img.shields.io/codacy/43ece80331c246179695e41f81eeffe2.svg)](https://www.codacy.com/app/form-data/form-data) +[![bitHound Overall Score](https://www.bithound.io/github/form-data/form-data/badges/score.svg)](https://www.bithound.io/github/form-data/form-data) + +## Install + +``` +npm install form-data +``` + +## Usage + +In this example we are constructing a form with 3 fields that contain a string, +a buffer and a file stream. + +``` javascript +var FormData = require('form-data'); +var fs = require('fs'); + +var form = new FormData(); +form.append('my_field', 'my value'); +form.append('my_buffer', new Buffer(10)); +form.append('my_file', fs.createReadStream('/foo/bar.jpg')); +``` + +Also you can use http-response stream: + +``` javascript +var FormData = require('form-data'); +var http = require('http'); + +var form = new FormData(); + +http.request('http://nodejs.org/images/logo.png', function(response) { + form.append('my_field', 'my value'); + form.append('my_buffer', new Buffer(10)); + form.append('my_logo', response); +}); +``` + +Or @mikeal's [request](https://github.com/request/request) stream: + +``` javascript +var FormData = require('form-data'); +var request = require('request'); + +var form = new FormData(); + +form.append('my_field', 'my value'); +form.append('my_buffer', new Buffer(10)); +form.append('my_logo', request('http://nodejs.org/images/logo.png')); +``` + +In order to submit this form to a web application, call ```submit(url, [callback])``` method: + +``` javascript +form.submit('http://example.org/', function(err, res) { + // res – response object (http.IncomingMessage) // + res.resume(); +}); + +``` + +For more advanced request manipulations ```submit()``` method returns ```http.ClientRequest``` object, or you can choose from one of the alternative submission methods. + +### Alternative submission methods + +You can use node's http client interface: + +``` javascript +var http = require('http'); + +var request = http.request({ + method: 'post', + host: 'example.org', + path: '/upload', + headers: form.getHeaders() +}); + +form.pipe(request); + +request.on('response', function(res) { + console.log(res.statusCode); +}); +``` + +Or if you would prefer the `'Content-Length'` header to be set for you: + +``` javascript +form.submit('example.org/upload', function(err, res) { + console.log(res.statusCode); +}); +``` + +To use custom headers and pre-known length in parts: + +``` javascript +var CRLF = '\r\n'; +var form = new FormData(); + +var options = { + header: CRLF + '--' + form.getBoundary() + CRLF + 'X-Custom-Header: 123' + CRLF + CRLF, + knownLength: 1 +}; + +form.append('my_buffer', buffer, options); + +form.submit('http://example.com/', function(err, res) { + if (err) throw err; + console.log('Done'); +}); +``` + +Form-Data can recognize and fetch all the required information from common types of streams (```fs.readStream```, ```http.response``` and ```mikeal's request```), for some other types of streams you'd need to provide "file"-related information manually: + +``` javascript +someModule.stream(function(err, stdout, stderr) { + if (err) throw err; + + var form = new FormData(); + + form.append('file', stdout, { + filename: 'unicycle.jpg', + contentType: 'image/jpg', + knownLength: 19806 + }); + + form.submit('http://example.com/', function(err, res) { + if (err) throw err; + console.log('Done'); + }); +}); +``` + +For edge cases, like POST request to URL with query string or to pass HTTP auth credentials, object can be passed to `form.submit()` as first parameter: + +``` javascript +form.submit({ + host: 'example.com', + path: '/probably.php?extra=params', + auth: 'username:password' +}, function(err, res) { + console.log(res.statusCode); +}); +``` + +In case you need to also send custom HTTP headers with the POST request, you can use the `headers` key in first parameter of `form.submit()`: + +``` javascript +form.submit({ + host: 'example.com', + path: '/surelynot.php', + headers: {'x-test-header': 'test-header-value'} +}, function(err, res) { + console.log(res.statusCode); +}); +``` + +### Integration with other libraries + +#### Request + +Form submission using [request](https://github.com/request/request): + +```javascript +var formData = { + my_field: 'my_value', + my_file: fs.createReadStream(__dirname + '/unicycle.jpg'), +}; + +request.post({url:'http://service.com/upload', formData: formData}, function(err, httpResponse, body) { + if (err) { + return console.error('upload failed:', err); + } + console.log('Upload successful! Server responded with:', body); +}); +``` + +For more details see [request readme](https://github.com/request/request#multipartform-data-multipart-form-uploads). + +#### node-fetch + +You can also submit a form using [node-fetch](https://github.com/bitinn/node-fetch): + +```javascript +var form = new FormData(); + +form.append('a', 1); + +fetch('http://example.com', { method: 'POST', body: form }) + .then(function(res) { + return res.json(); + }).then(function(json) { + console.log(json); + }); +``` + +## Notes + +- ```getLengthSync()``` method DOESN'T calculate length for streams, use ```knownLength``` options as workaround. +- If it feels like FormData hangs after submit and you're on ```node-0.10```, please check [Compatibility with Older Node Versions][streams2-thing] + +## License + +Form-Data is licensed under the MIT license. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/form-data/lib/browser.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/form-data/lib/browser.js new file mode 100644 index 00000000..8141d658 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/form-data/lib/browser.js @@ -0,0 +1,2 @@ +/* eslint-env browser */ +module.exports = FormData; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/form-data/lib/form_data.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/form-data/lib/form_data.js new file mode 100644 index 00000000..55328b46 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/form-data/lib/form_data.js @@ -0,0 +1,411 @@ +var CombinedStream = require('combined-stream'); +var util = require('util'); +var path = require('path'); +var http = require('http'); +var https = require('https'); +var parseUrl = require('url').parse; +var fs = require('fs'); +var mime = require('mime-types'); +var async = require('async'); +var populate = require('./populate.js'); + +// Public API +module.exports = FormData; + +// make it a Stream +util.inherits(FormData, CombinedStream); + +/** + * Create readable "multipart/form-data" streams. + * Can be used to submit forms + * and file uploads to other web applications. + * + * @constructor + */ +function FormData() { + if (!(this instanceof FormData)) { + throw new TypeError('Failed to construct FormData: Please use the _new_ operator, this object constructor cannot be called as a function.'); + } + + this._overheadLength = 0; + this._valueLength = 0; + this._lengthRetrievers = []; + + CombinedStream.call(this); +} + +FormData.LINE_BREAK = '\r\n'; +FormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream'; + +FormData.prototype.append = function(field, value, options) { + + options = options || {}; + + // allow filename as single option + if (typeof options == 'string') { + options = {filename: options}; + } + + var append = CombinedStream.prototype.append.bind(this); + + // all that streamy business can't handle numbers + if (typeof value == 'number') { + value = '' + value; + } + + // https://github.com/felixge/node-form-data/issues/38 + if (util.isArray(value)) { + // Please convert your array into string + // the way web server expects it + this._error(new Error('Arrays are not supported.')); + return; + } + + var header = this._multiPartHeader(field, value, options); + var footer = this._multiPartFooter(); + + append(header); + append(value); + append(footer); + + // pass along options.knownLength + this._trackLength(header, value, options); +}; + +FormData.prototype._trackLength = function(header, value, options) { + var valueLength = 0; + + // used w/ getLengthSync(), when length is known. + // e.g. for streaming directly from a remote server, + // w/ a known file a size, and not wanting to wait for + // incoming file to finish to get its size. + if (options.knownLength != null) { + valueLength += +options.knownLength; + } else if (Buffer.isBuffer(value)) { + valueLength = value.length; + } else if (typeof value === 'string') { + valueLength = Buffer.byteLength(value); + } + + this._valueLength += valueLength; + + // @check why add CRLF? does this account for custom/multiple CRLFs? + this._overheadLength += + Buffer.byteLength(header) + + FormData.LINE_BREAK.length; + + // empty or either doesn't have path or not an http response + if (!value || ( !value.path && !(value.readable && value.hasOwnProperty('httpVersion')) )) { + return; + } + + // no need to bother with the length + if (!options.knownLength) { + this._lengthRetrievers.push(function(next) { + + if (value.hasOwnProperty('fd')) { + + // take read range into a account + // `end` = Infinity –> read file till the end + // + // TODO: Looks like there is bug in Node fs.createReadStream + // it doesn't respect `end` options without `start` options + // Fix it when node fixes it. + // https://github.com/joyent/node/issues/7819 + if (value.end != undefined && value.end != Infinity && value.start != undefined) { + + // when end specified + // no need to calculate range + // inclusive, starts with 0 + next(null, value.end + 1 - (value.start ? value.start : 0)); + + // not that fast snoopy + } else { + // still need to fetch file size from fs + fs.stat(value.path, function(err, stat) { + + var fileSize; + + if (err) { + next(err); + return; + } + + // update final size based on the range options + fileSize = stat.size - (value.start ? value.start : 0); + next(null, fileSize); + }); + } + + // or http response + } else if (value.hasOwnProperty('httpVersion')) { + next(null, +value.headers['content-length']); + + // or request stream http://github.com/mikeal/request + } else if (value.hasOwnProperty('httpModule')) { + // wait till response come back + value.on('response', function(response) { + value.pause(); + next(null, +response.headers['content-length']); + }); + value.resume(); + + // something else + } else { + next('Unknown stream'); + } + }); + } +}; + +FormData.prototype._multiPartHeader = function(field, value, options) { + // custom header specified (as string)? + // it becomes responsible for boundary + // (e.g. to handle extra CRLFs on .NET servers) + if (options.header) { + return options.header; + } + + var contentDisposition = this._getContentDisposition(value, options); + var contentType = this._getContentType(value, options); + + var contents = ''; + var headers = { + // add custom disposition as third element or keep it two elements if not + 'Content-Disposition': ['form-data', 'name="' + field + '"'].concat(contentDisposition || []), + // if no content type. allow it to be empty array + 'Content-Type': [].concat(contentType || []) + }; + + for (var prop in headers) { + if (headers[prop].length) { + contents += prop + ': ' + headers[prop].join('; ') + FormData.LINE_BREAK; + } + } + + return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK; +}; + +FormData.prototype._getContentDisposition = function(value, options) { + + var contentDisposition; + + // custom filename takes precedence + // fs- and request- streams have path property + var filename = options.filename || value.path; + + // or try http response + if (!filename && value.readable && value.hasOwnProperty('httpVersion')) { + filename = value.client._httpMessage.path; + } + + if (filename) { + contentDisposition = 'filename="' + path.basename(filename) + '"'; + } + + return contentDisposition; +}; + +FormData.prototype._getContentType = function(value, options) { + + // use custom content-type above all + var contentType = options.contentType; + + // or try `path` from fs-, request- streams + if (!contentType && value.path) { + contentType = mime.lookup(value.path); + } + + // or if it's http-reponse + if (!contentType && value.readable && value.hasOwnProperty('httpVersion')) { + contentType = value.headers['content-type']; + } + + // or guess it from the filename + if (!contentType && options.filename) { + contentType = mime.lookup(options.filename); + } + + // fallback to the default content type if `value` is not simple value + if (!contentType && typeof value == 'object') { + contentType = FormData.DEFAULT_CONTENT_TYPE; + } + + return contentType; +}; + +FormData.prototype._multiPartFooter = function() { + return function(next) { + var footer = FormData.LINE_BREAK; + + var lastPart = (this._streams.length === 0); + if (lastPart) { + footer += this._lastBoundary(); + } + + next(footer); + }.bind(this); +}; + +FormData.prototype._lastBoundary = function() { + return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK; +}; + +FormData.prototype.getHeaders = function(userHeaders) { + var header; + var formHeaders = { + 'content-type': 'multipart/form-data; boundary=' + this.getBoundary() + }; + + for (header in userHeaders) { + if (userHeaders.hasOwnProperty(header)) { + formHeaders[header.toLowerCase()] = userHeaders[header]; + } + } + + return formHeaders; +}; + +FormData.prototype.getCustomHeaders = function(contentType) { + contentType = contentType ? contentType : 'multipart/form-data'; + + var formHeaders = { + 'content-type': contentType + '; boundary=' + this.getBoundary(), + 'content-length': this.getLengthSync() + }; + + return formHeaders; +}; + +FormData.prototype.getBoundary = function() { + if (!this._boundary) { + this._generateBoundary(); + } + + return this._boundary; +}; + +FormData.prototype._generateBoundary = function() { + // This generates a 50 character boundary similar to those used by Firefox. + // They are optimized for boyer-moore parsing. + var boundary = '--------------------------'; + for (var i = 0; i < 24; i++) { + boundary += Math.floor(Math.random() * 10).toString(16); + } + + this._boundary = boundary; +}; + +// Note: getLengthSync DOESN'T calculate streams length +// As workaround one can calculate file size manually +// and add it as knownLength option +FormData.prototype.getLengthSync = function() { + var knownLength = this._overheadLength + this._valueLength; + + // Don't get confused, there are 3 "internal" streams for each keyval pair + // so it basically checks if there is any value added to the form + if (this._streams.length) { + knownLength += this._lastBoundary().length; + } + + // https://github.com/form-data/form-data/issues/40 + if (this._lengthRetrievers.length) { + // Some async length retrievers are present + // therefore synchronous length calculation is false. + // Please use getLength(callback) to get proper length + this._error(new Error('Cannot calculate proper length in synchronous way.')); + } + + return knownLength; +}; + +FormData.prototype.getLength = function(cb) { + var knownLength = this._overheadLength + this._valueLength; + + if (this._streams.length) { + knownLength += this._lastBoundary().length; + } + + if (!this._lengthRetrievers.length) { + process.nextTick(cb.bind(this, null, knownLength)); + return; + } + + async.parallel(this._lengthRetrievers, function(err, values) { + if (err) { + cb(err); + return; + } + + values.forEach(function(length) { + knownLength += length; + }); + + cb(null, knownLength); + }); +}; + +FormData.prototype.submit = function(params, cb) { + var request + , options + , defaults = {method: 'post'} + ; + + // parse provided url if it's string + // or treat it as options object + if (typeof params == 'string') { + + params = parseUrl(params); + options = populate({ + port: params.port, + path: params.pathname, + host: params.hostname + }, defaults); + + // use custom params + } else { + + options = populate(params, defaults); + // if no port provided use default one + if (!options.port) { + options.port = options.protocol == 'https:' ? 443 : 80; + } + } + + // put that good code in getHeaders to some use + options.headers = this.getHeaders(params.headers); + + // https if specified, fallback to http in any other case + if (options.protocol == 'https:') { + request = https.request(options); + } else { + request = http.request(options); + } + + // get content length and fire away + this.getLength(function(err, length) { + if (err) { + this._error(err); + return; + } + + // add content length + request.setHeader('Content-Length', length); + + this.pipe(request); + if (cb) { + request.on('error', cb); + request.on('response', cb.bind(this, null)); + } + }.bind(this)); + + return request; +}; + +FormData.prototype._error = function(err) { + if (!this.error) { + this.error = err; + this.pause(); + this.emit('error', err); + } +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/form-data/lib/populate.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/form-data/lib/populate.js new file mode 100644 index 00000000..6f64a6d3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/form-data/lib/populate.js @@ -0,0 +1,9 @@ +// populates missing values +module.exports = function(dst, src) { + for (var prop in src) { + if (src.hasOwnProperty(prop) && !dst[prop]) { + dst[prop] = src[prop]; + } + } + return dst; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/form-data/node_modules/async/CHANGELOG.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/form-data/node_modules/async/CHANGELOG.md new file mode 100644 index 00000000..fcb2b2c0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/form-data/node_modules/async/CHANGELOG.md @@ -0,0 +1,125 @@ +# v1.5.2 +- Allow using `"consructor"` as an argument in `memoize` (#998) +- Give a better error messsage when `auto` dependency checking fails (#994) +- Various doc updates (#936, #956, #979, #1002) + +# v1.5.1 +- Fix issue with `pause` in `queue` with concurrency enabled (#946) +- `while` and `until` now pass the final result to callback (#963) +- `auto` will properly handle concurrency when there is no callback (#966) +- `auto` will now properly stop execution when an error occurs (#988, #993) +- Various doc fixes (#971, #980) + +# v1.5.0 + +- Added `transform`, analogous to [`_.transform`](http://lodash.com/docs#transform) (#892) +- `map` now returns an object when an object is passed in, rather than array with non-numeric keys. `map` will begin always returning an array with numeric indexes in the next major release. (#873) +- `auto` now accepts an optional `concurrency` argument to limit the number of running tasks (#637) +- Added `queue#workersList()`, to retrieve the list of currently running tasks. (#891) +- Various code simplifications (#896, #904) +- Various doc fixes :scroll: (#890, #894, #903, #905, #912) + +# v1.4.2 + +- Ensure coverage files don't get published on npm (#879) + +# v1.4.1 + +- Add in overlooked `detectLimit` method (#866) +- Removed unnecessary files from npm releases (#861) +- Removed usage of a reserved word to prevent :boom: in older environments (#870) + +# v1.4.0 + +- `asyncify` now supports promises (#840) +- Added `Limit` versions of `filter` and `reject` (#836) +- Add `Limit` versions of `detect`, `some` and `every` (#828, #829) +- `some`, `every` and `detect` now short circuit early (#828, #829) +- Improve detection of the global object (#804), enabling use in WebWorkers +- `whilst` now called with arguments from iterator (#823) +- `during` now gets called with arguments from iterator (#824) +- Code simplifications and optimizations aplenty ([diff](https://github.com/caolan/async/compare/v1.3.0...v1.4.0)) + + +# v1.3.0 + +New Features: +- Added `constant` +- Added `asyncify`/`wrapSync` for making sync functions work with callbacks. (#671, #806) +- Added `during` and `doDuring`, which are like `whilst` with an async truth test. (#800) +- `retry` now accepts an `interval` parameter to specify a delay between retries. (#793) +- `async` should work better in Web Workers due to better `root` detection (#804) +- Callbacks are now optional in `whilst`, `doWhilst`, `until`, and `doUntil` (#642) +- Various internal updates (#786, #801, #802, #803) +- Various doc fixes (#790, #794) + +Bug Fixes: +- `cargo` now exposes the `payload` size, and `cargo.payload` can be changed on the fly after the `cargo` is created. (#740, #744, #783) + + +# v1.2.1 + +Bug Fix: + +- Small regression with synchronous iterator behavior in `eachSeries` with a 1-element array. Before 1.1.0, `eachSeries`'s callback was called on the same tick, which this patch restores. In 2.0.0, it will be called on the next tick. (#782) + + +# v1.2.0 + +New Features: + +- Added `timesLimit` (#743) +- `concurrency` can be changed after initialization in `queue` by setting `q.concurrency`. The new concurrency will be reflected the next time a task is processed. (#747, #772) + +Bug Fixes: + +- Fixed a regression in `each` and family with empty arrays that have additional properties. (#775, #777) + + +# v1.1.1 + +Bug Fix: + +- Small regression with synchronous iterator behavior in `eachSeries` with a 1-element array. Before 1.1.0, `eachSeries`'s callback was called on the same tick, which this patch restores. In 2.0.0, it will be called on the next tick. (#782) + + +# v1.1.0 + +New Features: + +- `cargo` now supports all of the same methods and event callbacks as `queue`. +- Added `ensureAsync` - A wrapper that ensures an async function calls its callback on a later tick. (#769) +- Optimized `map`, `eachOf`, and `waterfall` families of functions +- Passing a `null` or `undefined` array to `map`, `each`, `parallel` and families will be treated as an empty array (#667). +- The callback is now optional for the composed results of `compose` and `seq`. (#618) +- Reduced file size by 4kb, (minified version by 1kb) +- Added code coverage through `nyc` and `coveralls` (#768) + +Bug Fixes: + +- `forever` will no longer stack overflow with a synchronous iterator (#622) +- `eachLimit` and other limit functions will stop iterating once an error occurs (#754) +- Always pass `null` in callbacks when there is no error (#439) +- Ensure proper conditions when calling `drain()` after pushing an empty data set to a queue (#668) +- `each` and family will properly handle an empty array (#578) +- `eachSeries` and family will finish if the underlying array is modified during execution (#557) +- `queue` will throw if a non-function is passed to `q.push()` (#593) +- Doc fixes (#629, #766) + + +# v1.0.0 + +No known breaking changes, we are simply complying with semver from here on out. + +Changes: + +- Start using a changelog! +- Add `forEachOf` for iterating over Objects (or to iterate Arrays with indexes available) (#168 #704 #321) +- Detect deadlocks in `auto` (#663) +- Better support for require.js (#527) +- Throw if queue created with concurrency `0` (#714) +- Fix unneeded iteration in `queue.resume()` (#758) +- Guard against timer mocking overriding `setImmediate` (#609 #611) +- Miscellaneous doc fixes (#542 #596 #615 #628 #631 #690 #729) +- Use single noop function internally (#546) +- Optimize internal `_each`, `_map` and `_keys` functions. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/form-data/node_modules/async/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/form-data/node_modules/async/LICENSE new file mode 100644 index 00000000..8f296985 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/form-data/node_modules/async/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2010-2014 Caolan McMahon + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/form-data/node_modules/async/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/form-data/node_modules/async/README.md new file mode 100644 index 00000000..3a0f0177 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/form-data/node_modules/async/README.md @@ -0,0 +1,1877 @@ +# Async.js + +[![Build Status via Travis CI](https://travis-ci.org/caolan/async.svg?branch=master)](https://travis-ci.org/caolan/async) +[![NPM version](http://img.shields.io/npm/v/async.svg)](https://www.npmjs.org/package/async) +[![Coverage Status](https://coveralls.io/repos/caolan/async/badge.svg?branch=master)](https://coveralls.io/r/caolan/async?branch=master) +[![Join the chat at https://gitter.im/caolan/async](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/caolan/async?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + + +Async is a utility module which provides straight-forward, powerful functions +for working with asynchronous JavaScript. Although originally designed for +use with [Node.js](http://nodejs.org) and installable via `npm install async`, +it can also be used directly in the browser. + +Async is also installable via: + +- [bower](http://bower.io/): `bower install async` +- [component](https://github.com/component/component): `component install + caolan/async` +- [jam](http://jamjs.org/): `jam install async` +- [spm](http://spmjs.io/): `spm install async` + +Async provides around 20 functions that include the usual 'functional' +suspects (`map`, `reduce`, `filter`, `each`…) as well as some common patterns +for asynchronous control flow (`parallel`, `series`, `waterfall`…). All these +functions assume you follow the Node.js convention of providing a single +callback as the last argument of your `async` function. + + +## Quick Examples + +```javascript +async.map(['file1','file2','file3'], fs.stat, function(err, results){ + // results is now an array of stats for each file +}); + +async.filter(['file1','file2','file3'], fs.exists, function(results){ + // results now equals an array of the existing files +}); + +async.parallel([ + function(){ ... }, + function(){ ... } +], callback); + +async.series([ + function(){ ... }, + function(){ ... } +]); +``` + +There are many more functions available so take a look at the docs below for a +full list. This module aims to be comprehensive, so if you feel anything is +missing please create a GitHub issue for it. + +## Common Pitfalls [(StackOverflow)](http://stackoverflow.com/questions/tagged/async.js) +### Synchronous iteration functions + +If you get an error like `RangeError: Maximum call stack size exceeded.` or other stack overflow issues when using async, you are likely using a synchronous iterator. By *synchronous* we mean a function that calls its callback on the same tick in the javascript event loop, without doing any I/O or using any timers. Calling many callbacks iteratively will quickly overflow the stack. If you run into this issue, just defer your callback with `async.setImmediate` to start a new call stack on the next tick of the event loop. + +This can also arise by accident if you callback early in certain cases: + +```js +async.eachSeries(hugeArray, function iterator(item, callback) { + if (inCache(item)) { + callback(null, cache[item]); // if many items are cached, you'll overflow + } else { + doSomeIO(item, callback); + } +}, function done() { + //... +}); +``` + +Just change it to: + +```js +async.eachSeries(hugeArray, function iterator(item, callback) { + if (inCache(item)) { + async.setImmediate(function () { + callback(null, cache[item]); + }); + } else { + doSomeIO(item, callback); + //... +``` + +Async guards against synchronous functions in some, but not all, cases. If you are still running into stack overflows, you can defer as suggested above, or wrap functions with [`async.ensureAsync`](#ensureAsync) Functions that are asynchronous by their nature do not have this problem and don't need the extra callback deferral. + +If JavaScript's event loop is still a bit nebulous, check out [this article](http://blog.carbonfive.com/2013/10/27/the-javascript-event-loop-explained/) or [this talk](http://2014.jsconf.eu/speakers/philip-roberts-what-the-heck-is-the-event-loop-anyway.html) for more detailed information about how it works. + + +### Multiple callbacks + +Make sure to always `return` when calling a callback early, otherwise you will cause multiple callbacks and unpredictable behavior in many cases. + +```js +async.waterfall([ + function (callback) { + getSomething(options, function (err, result) { + if (err) { + callback(new Error("failed getting something:" + err.message)); + // we should return here + } + // since we did not return, this callback still will be called and + // `processData` will be called twice + callback(null, result); + }); + }, + processData +], done) +``` + +It is always good practice to `return callback(err, result)` whenever a callback call is not the last statement of a function. + + +### Binding a context to an iterator + +This section is really about `bind`, not about `async`. If you are wondering how to +make `async` execute your iterators in a given context, or are confused as to why +a method of another library isn't working as an iterator, study this example: + +```js +// Here is a simple object with an (unnecessarily roundabout) squaring method +var AsyncSquaringLibrary = { + squareExponent: 2, + square: function(number, callback){ + var result = Math.pow(number, this.squareExponent); + setTimeout(function(){ + callback(null, result); + }, 200); + } +}; + +async.map([1, 2, 3], AsyncSquaringLibrary.square, function(err, result){ + // result is [NaN, NaN, NaN] + // This fails because the `this.squareExponent` expression in the square + // function is not evaluated in the context of AsyncSquaringLibrary, and is + // therefore undefined. +}); + +async.map([1, 2, 3], AsyncSquaringLibrary.square.bind(AsyncSquaringLibrary), function(err, result){ + // result is [1, 4, 9] + // With the help of bind we can attach a context to the iterator before + // passing it to async. Now the square function will be executed in its + // 'home' AsyncSquaringLibrary context and the value of `this.squareExponent` + // will be as expected. +}); +``` + +## Download + +The source is available for download from +[GitHub](https://github.com/caolan/async/blob/master/lib/async.js). +Alternatively, you can install using Node Package Manager (`npm`): + + npm install async + +As well as using Bower: + + bower install async + +__Development:__ [async.js](https://github.com/caolan/async/raw/master/lib/async.js) - 29.6kb Uncompressed + +## In the Browser + +So far it's been tested in IE6, IE7, IE8, FF3.6 and Chrome 5. + +Usage: + +```html + + +``` + +## Documentation + +Some functions are also available in the following forms: +* `Series` - the same as `` but runs only a single async operation at a time +* `Limit` - the same as `` but runs a maximum of `limit` async operations at a time + +### Collections + +* [`each`](#each), `eachSeries`, `eachLimit` +* [`forEachOf`](#forEachOf), `forEachOfSeries`, `forEachOfLimit` +* [`map`](#map), `mapSeries`, `mapLimit` +* [`filter`](#filter), `filterSeries`, `filterLimit` +* [`reject`](#reject), `rejectSeries`, `rejectLimit` +* [`reduce`](#reduce), [`reduceRight`](#reduceRight) +* [`detect`](#detect), `detectSeries`, `detectLimit` +* [`sortBy`](#sortBy) +* [`some`](#some), `someLimit` +* [`every`](#every), `everyLimit` +* [`concat`](#concat), `concatSeries` + +### Control Flow + +* [`series`](#seriestasks-callback) +* [`parallel`](#parallel), `parallelLimit` +* [`whilst`](#whilst), [`doWhilst`](#doWhilst) +* [`until`](#until), [`doUntil`](#doUntil) +* [`during`](#during), [`doDuring`](#doDuring) +* [`forever`](#forever) +* [`waterfall`](#waterfall) +* [`compose`](#compose) +* [`seq`](#seq) +* [`applyEach`](#applyEach), `applyEachSeries` +* [`queue`](#queue), [`priorityQueue`](#priorityQueue) +* [`cargo`](#cargo) +* [`auto`](#auto) +* [`retry`](#retry) +* [`iterator`](#iterator) +* [`times`](#times), `timesSeries`, `timesLimit` + +### Utils + +* [`apply`](#apply) +* [`nextTick`](#nextTick) +* [`memoize`](#memoize) +* [`unmemoize`](#unmemoize) +* [`ensureAsync`](#ensureAsync) +* [`constant`](#constant) +* [`asyncify`](#asyncify) +* [`wrapSync`](#wrapSync) +* [`log`](#log) +* [`dir`](#dir) +* [`noConflict`](#noConflict) + +## Collections + + + +### each(arr, iterator, [callback]) + +Applies the function `iterator` to each item in `arr`, in parallel. +The `iterator` is called with an item from the list, and a callback for when it +has finished. If the `iterator` passes an error to its `callback`, the main +`callback` (for the `each` function) is immediately called with the error. + +Note, that since this function applies `iterator` to each item in parallel, +there is no guarantee that the iterator functions will complete in order. + +__Arguments__ + +* `arr` - An array to iterate over. +* `iterator(item, callback)` - A function to apply to each item in `arr`. + The iterator is passed a `callback(err)` which must be called once it has + completed. If no error has occurred, the `callback` should be run without + arguments or with an explicit `null` argument. The array index is not passed + to the iterator. If you need the index, use [`forEachOf`](#forEachOf). +* `callback(err)` - *Optional* A callback which is called when all `iterator` functions + have finished, or an error occurs. + +__Examples__ + + +```js +// assuming openFiles is an array of file names and saveFile is a function +// to save the modified contents of that file: + +async.each(openFiles, saveFile, function(err){ + // if any of the saves produced an error, err would equal that error +}); +``` + +```js +// assuming openFiles is an array of file names + +async.each(openFiles, function(file, callback) { + + // Perform operation on file here. + console.log('Processing file ' + file); + + if( file.length > 32 ) { + console.log('This file name is too long'); + callback('File name too long'); + } else { + // Do work to process file here + console.log('File processed'); + callback(); + } +}, function(err){ + // if any of the file processing produced an error, err would equal that error + if( err ) { + // One of the iterations produced an error. + // All processing will now stop. + console.log('A file failed to process'); + } else { + console.log('All files have been processed successfully'); + } +}); +``` + +__Related__ + +* eachSeries(arr, iterator, [callback]) +* eachLimit(arr, limit, iterator, [callback]) + +--------------------------------------- + + + + +### forEachOf(obj, iterator, [callback]) + +Like `each`, except that it iterates over objects, and passes the key as the second argument to the iterator. + +__Arguments__ + +* `obj` - An object or array to iterate over. +* `iterator(item, key, callback)` - A function to apply to each item in `obj`. +The `key` is the item's key, or index in the case of an array. The iterator is +passed a `callback(err)` which must be called once it has completed. If no +error has occurred, the callback should be run without arguments or with an +explicit `null` argument. +* `callback(err)` - *Optional* A callback which is called when all `iterator` functions have finished, or an error occurs. + +__Example__ + +```js +var obj = {dev: "/dev.json", test: "/test.json", prod: "/prod.json"}; +var configs = {}; + +async.forEachOf(obj, function (value, key, callback) { + fs.readFile(__dirname + value, "utf8", function (err, data) { + if (err) return callback(err); + try { + configs[key] = JSON.parse(data); + } catch (e) { + return callback(e); + } + callback(); + }) +}, function (err) { + if (err) console.error(err.message); + // configs is now a map of JSON data + doSomethingWith(configs); +}) +``` + +__Related__ + +* forEachOfSeries(obj, iterator, [callback]) +* forEachOfLimit(obj, limit, iterator, [callback]) + +--------------------------------------- + + +### map(arr, iterator, [callback]) + +Produces a new array of values by mapping each value in `arr` through +the `iterator` function. The `iterator` is called with an item from `arr` and a +callback for when it has finished processing. Each of these callback takes 2 arguments: +an `error`, and the transformed item from `arr`. If `iterator` passes an error to its +callback, the main `callback` (for the `map` function) is immediately called with the error. + +Note, that since this function applies the `iterator` to each item in parallel, +there is no guarantee that the `iterator` functions will complete in order. +However, the results array will be in the same order as the original `arr`. + +__Arguments__ + +* `arr` - An array to iterate over. +* `iterator(item, callback)` - A function to apply to each item in `arr`. + The iterator is passed a `callback(err, transformed)` which must be called once + it has completed with an error (which can be `null`) and a transformed item. +* `callback(err, results)` - *Optional* A callback which is called when all `iterator` + functions have finished, or an error occurs. Results is an array of the + transformed items from the `arr`. + +__Example__ + +```js +async.map(['file1','file2','file3'], fs.stat, function(err, results){ + // results is now an array of stats for each file +}); +``` + +__Related__ +* mapSeries(arr, iterator, [callback]) +* mapLimit(arr, limit, iterator, [callback]) + +--------------------------------------- + + + +### filter(arr, iterator, [callback]) + +__Alias:__ `select` + +Returns a new array of all the values in `arr` which pass an async truth test. +_The callback for each `iterator` call only accepts a single argument of `true` or +`false`; it does not accept an error argument first!_ This is in-line with the +way node libraries work with truth tests like `fs.exists`. This operation is +performed in parallel, but the results array will be in the same order as the +original. + +__Arguments__ + +* `arr` - An array to iterate over. +* `iterator(item, callback)` - A truth test to apply to each item in `arr`. + The `iterator` is passed a `callback(truthValue)`, which must be called with a + boolean argument once it has completed. +* `callback(results)` - *Optional* A callback which is called after all the `iterator` + functions have finished. + +__Example__ + +```js +async.filter(['file1','file2','file3'], fs.exists, function(results){ + // results now equals an array of the existing files +}); +``` + +__Related__ + +* filterSeries(arr, iterator, [callback]) +* filterLimit(arr, limit, iterator, [callback]) + +--------------------------------------- + + +### reject(arr, iterator, [callback]) + +The opposite of [`filter`](#filter). Removes values that pass an `async` truth test. + +__Related__ + +* rejectSeries(arr, iterator, [callback]) +* rejectLimit(arr, limit, iterator, [callback]) + +--------------------------------------- + + +### reduce(arr, memo, iterator, [callback]) + +__Aliases:__ `inject`, `foldl` + +Reduces `arr` into a single value using an async `iterator` to return +each successive step. `memo` is the initial state of the reduction. +This function only operates in series. + +For performance reasons, it may make sense to split a call to this function into +a parallel map, and then use the normal `Array.prototype.reduce` on the results. +This function is for situations where each step in the reduction needs to be async; +if you can get the data before reducing it, then it's probably a good idea to do so. + +__Arguments__ + +* `arr` - An array to iterate over. +* `memo` - The initial state of the reduction. +* `iterator(memo, item, callback)` - A function applied to each item in the + array to produce the next step in the reduction. The `iterator` is passed a + `callback(err, reduction)` which accepts an optional error as its first + argument, and the state of the reduction as the second. If an error is + passed to the callback, the reduction is stopped and the main `callback` is + immediately called with the error. +* `callback(err, result)` - *Optional* A callback which is called after all the `iterator` + functions have finished. Result is the reduced value. + +__Example__ + +```js +async.reduce([1,2,3], 0, function(memo, item, callback){ + // pointless async: + process.nextTick(function(){ + callback(null, memo + item) + }); +}, function(err, result){ + // result is now equal to the last value of memo, which is 6 +}); +``` + +--------------------------------------- + + +### reduceRight(arr, memo, iterator, [callback]) + +__Alias:__ `foldr` + +Same as [`reduce`](#reduce), only operates on `arr` in reverse order. + + +--------------------------------------- + + +### detect(arr, iterator, [callback]) + +Returns the first value in `arr` that passes an async truth test. The +`iterator` is applied in parallel, meaning the first iterator to return `true` will +fire the detect `callback` with that result. That means the result might not be +the first item in the original `arr` (in terms of order) that passes the test. + +If order within the original `arr` is important, then look at [`detectSeries`](#detectSeries). + +__Arguments__ + +* `arr` - An array to iterate over. +* `iterator(item, callback)` - A truth test to apply to each item in `arr`. + The iterator is passed a `callback(truthValue)` which must be called with a + boolean argument once it has completed. **Note: this callback does not take an error as its first argument.** +* `callback(result)` - *Optional* A callback which is called as soon as any iterator returns + `true`, or after all the `iterator` functions have finished. Result will be + the first item in the array that passes the truth test (iterator) or the + value `undefined` if none passed. **Note: this callback does not take an error as its first argument.** + +__Example__ + +```js +async.detect(['file1','file2','file3'], fs.exists, function(result){ + // result now equals the first file in the list that exists +}); +``` + +__Related__ + +* detectSeries(arr, iterator, [callback]) +* detectLimit(arr, limit, iterator, [callback]) + +--------------------------------------- + + +### sortBy(arr, iterator, [callback]) + +Sorts a list by the results of running each `arr` value through an async `iterator`. + +__Arguments__ + +* `arr` - An array to iterate over. +* `iterator(item, callback)` - A function to apply to each item in `arr`. + The iterator is passed a `callback(err, sortValue)` which must be called once it + has completed with an error (which can be `null`) and a value to use as the sort + criteria. +* `callback(err, results)` - *Optional* A callback which is called after all the `iterator` + functions have finished, or an error occurs. Results is the items from + the original `arr` sorted by the values returned by the `iterator` calls. + +__Example__ + +```js +async.sortBy(['file1','file2','file3'], function(file, callback){ + fs.stat(file, function(err, stats){ + callback(err, stats.mtime); + }); +}, function(err, results){ + // results is now the original array of files sorted by + // modified date +}); +``` + +__Sort Order__ + +By modifying the callback parameter the sorting order can be influenced: + +```js +//ascending order +async.sortBy([1,9,3,5], function(x, callback){ + callback(null, x); +}, function(err,result){ + //result callback +} ); + +//descending order +async.sortBy([1,9,3,5], function(x, callback){ + callback(null, x*-1); //<- x*-1 instead of x, turns the order around +}, function(err,result){ + //result callback +} ); +``` + +--------------------------------------- + + +### some(arr, iterator, [callback]) + +__Alias:__ `any` + +Returns `true` if at least one element in the `arr` satisfies an async test. +_The callback for each iterator call only accepts a single argument of `true` or +`false`; it does not accept an error argument first!_ This is in-line with the +way node libraries work with truth tests like `fs.exists`. Once any iterator +call returns `true`, the main `callback` is immediately called. + +__Arguments__ + +* `arr` - An array to iterate over. +* `iterator(item, callback)` - A truth test to apply to each item in the array + in parallel. The iterator is passed a `callback(truthValue)`` which must be + called with a boolean argument once it has completed. +* `callback(result)` - *Optional* A callback which is called as soon as any iterator returns + `true`, or after all the iterator functions have finished. Result will be + either `true` or `false` depending on the values of the async tests. + + **Note: the callbacks do not take an error as their first argument.** +__Example__ + +```js +async.some(['file1','file2','file3'], fs.exists, function(result){ + // if result is true then at least one of the files exists +}); +``` + +__Related__ + +* someLimit(arr, limit, iterator, callback) + +--------------------------------------- + + +### every(arr, iterator, [callback]) + +__Alias:__ `all` + +Returns `true` if every element in `arr` satisfies an async test. +_The callback for each `iterator` call only accepts a single argument of `true` or +`false`; it does not accept an error argument first!_ This is in-line with the +way node libraries work with truth tests like `fs.exists`. + +__Arguments__ + +* `arr` - An array to iterate over. +* `iterator(item, callback)` - A truth test to apply to each item in the array + in parallel. The iterator is passed a `callback(truthValue)` which must be + called with a boolean argument once it has completed. +* `callback(result)` - *Optional* A callback which is called as soon as any iterator returns + `false`, or after all the iterator functions have finished. Result will be + either `true` or `false` depending on the values of the async tests. + + **Note: the callbacks do not take an error as their first argument.** + +__Example__ + +```js +async.every(['file1','file2','file3'], fs.exists, function(result){ + // if result is true then every file exists +}); +``` + +__Related__ + +* everyLimit(arr, limit, iterator, callback) + +--------------------------------------- + + +### concat(arr, iterator, [callback]) + +Applies `iterator` to each item in `arr`, concatenating the results. Returns the +concatenated list. The `iterator`s are called in parallel, and the results are +concatenated as they return. There is no guarantee that the results array will +be returned in the original order of `arr` passed to the `iterator` function. + +__Arguments__ + +* `arr` - An array to iterate over. +* `iterator(item, callback)` - A function to apply to each item in `arr`. + The iterator is passed a `callback(err, results)` which must be called once it + has completed with an error (which can be `null`) and an array of results. +* `callback(err, results)` - *Optional* A callback which is called after all the `iterator` + functions have finished, or an error occurs. Results is an array containing + the concatenated results of the `iterator` function. + +__Example__ + +```js +async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){ + // files is now a list of filenames that exist in the 3 directories +}); +``` + +__Related__ + +* concatSeries(arr, iterator, [callback]) + + +## Control Flow + + +### series(tasks, [callback]) + +Run the functions in the `tasks` array in series, each one running once the previous +function has completed. If any functions in the series pass an error to its +callback, no more functions are run, and `callback` is immediately called with the value of the error. +Otherwise, `callback` receives an array of results when `tasks` have completed. + +It is also possible to use an object instead of an array. Each property will be +run as a function, and the results will be passed to the final `callback` as an object +instead of an array. This can be a more readable way of handling results from +[`series`](#series). + +**Note** that while many implementations preserve the order of object properties, the +[ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6) +explicitly states that + +> The mechanics and order of enumerating the properties is not specified. + +So if you rely on the order in which your series of functions are executed, and want +this to work on all platforms, consider using an array. + +__Arguments__ + +* `tasks` - An array or object containing functions to run, each function is passed + a `callback(err, result)` it must call on completion with an error `err` (which can + be `null`) and an optional `result` value. +* `callback(err, results)` - An optional callback to run once all the functions + have completed. This function gets a results array (or object) containing all + the result arguments passed to the `task` callbacks. + +__Example__ + +```js +async.series([ + function(callback){ + // do some stuff ... + callback(null, 'one'); + }, + function(callback){ + // do some more stuff ... + callback(null, 'two'); + } +], +// optional callback +function(err, results){ + // results is now equal to ['one', 'two'] +}); + + +// an example using an object instead of an array +async.series({ + one: function(callback){ + setTimeout(function(){ + callback(null, 1); + }, 200); + }, + two: function(callback){ + setTimeout(function(){ + callback(null, 2); + }, 100); + } +}, +function(err, results) { + // results is now equal to: {one: 1, two: 2} +}); +``` + +--------------------------------------- + + +### parallel(tasks, [callback]) + +Run the `tasks` array of functions in parallel, without waiting until the previous +function has completed. If any of the functions pass an error to its +callback, the main `callback` is immediately called with the value of the error. +Once the `tasks` have completed, the results are passed to the final `callback` as an +array. + +**Note:** `parallel` is about kicking-off I/O tasks in parallel, not about parallel execution of code. If your tasks do not use any timers or perform any I/O, they will actually be executed in series. Any synchronous setup sections for each task will happen one after the other. JavaScript remains single-threaded. + +It is also possible to use an object instead of an array. Each property will be +run as a function and the results will be passed to the final `callback` as an object +instead of an array. This can be a more readable way of handling results from +[`parallel`](#parallel). + + +__Arguments__ + +* `tasks` - An array or object containing functions to run. Each function is passed + a `callback(err, result)` which it must call on completion with an error `err` + (which can be `null`) and an optional `result` value. +* `callback(err, results)` - An optional callback to run once all the functions + have completed successfully. This function gets a results array (or object) containing all + the result arguments passed to the task callbacks. + +__Example__ + +```js +async.parallel([ + function(callback){ + setTimeout(function(){ + callback(null, 'one'); + }, 200); + }, + function(callback){ + setTimeout(function(){ + callback(null, 'two'); + }, 100); + } +], +// optional callback +function(err, results){ + // the results array will equal ['one','two'] even though + // the second function had a shorter timeout. +}); + + +// an example using an object instead of an array +async.parallel({ + one: function(callback){ + setTimeout(function(){ + callback(null, 1); + }, 200); + }, + two: function(callback){ + setTimeout(function(){ + callback(null, 2); + }, 100); + } +}, +function(err, results) { + // results is now equals to: {one: 1, two: 2} +}); +``` + +__Related__ + +* parallelLimit(tasks, limit, [callback]) + +--------------------------------------- + + +### whilst(test, fn, callback) + +Repeatedly call `fn`, while `test` returns `true`. Calls `callback` when stopped, +or an error occurs. + +__Arguments__ + +* `test()` - synchronous truth test to perform before each execution of `fn`. +* `fn(callback)` - A function which is called each time `test` passes. The function is + passed a `callback(err)`, which must be called once it has completed with an + optional `err` argument. +* `callback(err, [results])` - A callback which is called after the test + function has failed and repeated execution of `fn` has stopped. `callback` + will be passed an error and any arguments passed to the final `fn`'s callback. + +__Example__ + +```js +var count = 0; + +async.whilst( + function () { return count < 5; }, + function (callback) { + count++; + setTimeout(function () { + callback(null, count); + }, 1000); + }, + function (err, n) { + // 5 seconds have passed, n = 5 + } +); +``` + +--------------------------------------- + + +### doWhilst(fn, test, callback) + +The post-check version of [`whilst`](#whilst). To reflect the difference in +the order of operations, the arguments `test` and `fn` are switched. + +`doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript. + +--------------------------------------- + + +### until(test, fn, callback) + +Repeatedly call `fn` until `test` returns `true`. Calls `callback` when stopped, +or an error occurs. `callback` will be passed an error and any arguments passed +to the final `fn`'s callback. + +The inverse of [`whilst`](#whilst). + +--------------------------------------- + + +### doUntil(fn, test, callback) + +Like [`doWhilst`](#doWhilst), except the `test` is inverted. Note the argument ordering differs from `until`. + +--------------------------------------- + + +### during(test, fn, callback) + +Like [`whilst`](#whilst), except the `test` is an asynchronous function that is passed a callback in the form of `function (err, truth)`. If error is passed to `test` or `fn`, the main callback is immediately called with the value of the error. + +__Example__ + +```js +var count = 0; + +async.during( + function (callback) { + return callback(null, count < 5); + }, + function (callback) { + count++; + setTimeout(callback, 1000); + }, + function (err) { + // 5 seconds have passed + } +); +``` + +--------------------------------------- + + +### doDuring(fn, test, callback) + +The post-check version of [`during`](#during). To reflect the difference in +the order of operations, the arguments `test` and `fn` are switched. + +Also a version of [`doWhilst`](#doWhilst) with asynchronous `test` function. + +--------------------------------------- + + +### forever(fn, [errback]) + +Calls the asynchronous function `fn` with a callback parameter that allows it to +call itself again, in series, indefinitely. + +If an error is passed to the callback then `errback` is called with the +error, and execution stops, otherwise it will never be called. + +```js +async.forever( + function(next) { + // next is suitable for passing to things that need a callback(err [, whatever]); + // it will result in this function being called again. + }, + function(err) { + // if next is called with a value in its first parameter, it will appear + // in here as 'err', and execution will stop. + } +); +``` + +--------------------------------------- + + +### waterfall(tasks, [callback]) + +Runs the `tasks` array of functions in series, each passing their results to the next in +the array. However, if any of the `tasks` pass an error to their own callback, the +next function is not executed, and the main `callback` is immediately called with +the error. + +__Arguments__ + +* `tasks` - An array of functions to run, each function is passed a + `callback(err, result1, result2, ...)` it must call on completion. The first + argument is an error (which can be `null`) and any further arguments will be + passed as arguments in order to the next task. +* `callback(err, [results])` - An optional callback to run once all the functions + have completed. This will be passed the results of the last task's callback. + + + +__Example__ + +```js +async.waterfall([ + function(callback) { + callback(null, 'one', 'two'); + }, + function(arg1, arg2, callback) { + // arg1 now equals 'one' and arg2 now equals 'two' + callback(null, 'three'); + }, + function(arg1, callback) { + // arg1 now equals 'three' + callback(null, 'done'); + } +], function (err, result) { + // result now equals 'done' +}); +``` +Or, with named functions: + +```js +async.waterfall([ + myFirstFunction, + mySecondFunction, + myLastFunction, +], function (err, result) { + // result now equals 'done' +}); +function myFirstFunction(callback) { + callback(null, 'one', 'two'); +} +function mySecondFunction(arg1, arg2, callback) { + // arg1 now equals 'one' and arg2 now equals 'two' + callback(null, 'three'); +} +function myLastFunction(arg1, callback) { + // arg1 now equals 'three' + callback(null, 'done'); +} +``` + +Or, if you need to pass any argument to the first function: + +```js +async.waterfall([ + async.apply(myFirstFunction, 'zero'), + mySecondFunction, + myLastFunction, +], function (err, result) { + // result now equals 'done' +}); +function myFirstFunction(arg1, callback) { + // arg1 now equals 'zero' + callback(null, 'one', 'two'); +} +function mySecondFunction(arg1, arg2, callback) { + // arg1 now equals 'one' and arg2 now equals 'two' + callback(null, 'three'); +} +function myLastFunction(arg1, callback) { + // arg1 now equals 'three' + callback(null, 'done'); +} +``` + +--------------------------------------- + +### compose(fn1, fn2...) + +Creates a function which is a composition of the passed asynchronous +functions. Each function consumes the return value of the function that +follows. Composing functions `f()`, `g()`, and `h()` would produce the result of +`f(g(h()))`, only this version uses callbacks to obtain the return values. + +Each function is executed with the `this` binding of the composed function. + +__Arguments__ + +* `functions...` - the asynchronous functions to compose + + +__Example__ + +```js +function add1(n, callback) { + setTimeout(function () { + callback(null, n + 1); + }, 10); +} + +function mul3(n, callback) { + setTimeout(function () { + callback(null, n * 3); + }, 10); +} + +var add1mul3 = async.compose(mul3, add1); + +add1mul3(4, function (err, result) { + // result now equals 15 +}); +``` + +--------------------------------------- + +### seq(fn1, fn2...) + +Version of the compose function that is more natural to read. +Each function consumes the return value of the previous function. +It is the equivalent of [`compose`](#compose) with the arguments reversed. + +Each function is executed with the `this` binding of the composed function. + +__Arguments__ + +* `functions...` - the asynchronous functions to compose + + +__Example__ + +```js +// Requires lodash (or underscore), express3 and dresende's orm2. +// Part of an app, that fetches cats of the logged user. +// This example uses `seq` function to avoid overnesting and error +// handling clutter. +app.get('/cats', function(request, response) { + var User = request.models.User; + async.seq( + _.bind(User.get, User), // 'User.get' has signature (id, callback(err, data)) + function(user, fn) { + user.getCats(fn); // 'getCats' has signature (callback(err, data)) + } + )(req.session.user_id, function (err, cats) { + if (err) { + console.error(err); + response.json({ status: 'error', message: err.message }); + } else { + response.json({ status: 'ok', message: 'Cats found', data: cats }); + } + }); +}); +``` + +--------------------------------------- + +### applyEach(fns, args..., callback) + +Applies the provided arguments to each function in the array, calling +`callback` after all functions have completed. If you only provide the first +argument, then it will return a function which lets you pass in the +arguments as if it were a single function call. + +__Arguments__ + +* `fns` - the asynchronous functions to all call with the same arguments +* `args...` - any number of separate arguments to pass to the function +* `callback` - the final argument should be the callback, called when all + functions have completed processing + + +__Example__ + +```js +async.applyEach([enableSearch, updateSchema], 'bucket', callback); + +// partial application example: +async.each( + buckets, + async.applyEach([enableSearch, updateSchema]), + callback +); +``` + +__Related__ + +* applyEachSeries(tasks, args..., [callback]) + +--------------------------------------- + + +### queue(worker, [concurrency]) + +Creates a `queue` object with the specified `concurrency`. Tasks added to the +`queue` are processed in parallel (up to the `concurrency` limit). If all +`worker`s are in progress, the task is queued until one becomes available. +Once a `worker` completes a `task`, that `task`'s callback is called. + +__Arguments__ + +* `worker(task, callback)` - An asynchronous function for processing a queued + task, which must call its `callback(err)` argument when finished, with an + optional `error` as an argument. If you want to handle errors from an individual task, pass a callback to `q.push()`. +* `concurrency` - An `integer` for determining how many `worker` functions should be + run in parallel. If omitted, the concurrency defaults to `1`. If the concurrency is `0`, an error is thrown. + +__Queue objects__ + +The `queue` object returned by this function has the following properties and +methods: + +* `length()` - a function returning the number of items waiting to be processed. +* `started` - a function returning whether or not any items have been pushed and processed by the queue +* `running()` - a function returning the number of items currently being processed. +* `workersList()` - a function returning the array of items currently being processed. +* `idle()` - a function returning false if there are items waiting or being processed, or true if not. +* `concurrency` - an integer for determining how many `worker` functions should be + run in parallel. This property can be changed after a `queue` is created to + alter the concurrency on-the-fly. +* `push(task, [callback])` - add a new task to the `queue`. Calls `callback` once + the `worker` has finished processing the task. Instead of a single task, a `tasks` array + can be submitted. The respective callback is used for every task in the list. +* `unshift(task, [callback])` - add a new task to the front of the `queue`. +* `saturated` - a callback that is called when the `queue` length hits the `concurrency` limit, + and further tasks will be queued. +* `empty` - a callback that is called when the last item from the `queue` is given to a `worker`. +* `drain` - a callback that is called when the last item from the `queue` has returned from the `worker`. +* `paused` - a boolean for determining whether the queue is in a paused state +* `pause()` - a function that pauses the processing of tasks until `resume()` is called. +* `resume()` - a function that resumes the processing of queued tasks when the queue is paused. +* `kill()` - a function that removes the `drain` callback and empties remaining tasks from the queue forcing it to go idle. + +__Example__ + +```js +// create a queue object with concurrency 2 + +var q = async.queue(function (task, callback) { + console.log('hello ' + task.name); + callback(); +}, 2); + + +// assign a callback +q.drain = function() { + console.log('all items have been processed'); +} + +// add some items to the queue + +q.push({name: 'foo'}, function (err) { + console.log('finished processing foo'); +}); +q.push({name: 'bar'}, function (err) { + console.log('finished processing bar'); +}); + +// add some items to the queue (batch-wise) + +q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) { + console.log('finished processing item'); +}); + +// add some items to the front of the queue + +q.unshift({name: 'bar'}, function (err) { + console.log('finished processing bar'); +}); +``` + + +--------------------------------------- + + +### priorityQueue(worker, concurrency) + +The same as [`queue`](#queue) only tasks are assigned a priority and completed in ascending priority order. There are two differences between `queue` and `priorityQueue` objects: + +* `push(task, priority, [callback])` - `priority` should be a number. If an array of + `tasks` is given, all tasks will be assigned the same priority. +* The `unshift` method was removed. + +--------------------------------------- + + +### cargo(worker, [payload]) + +Creates a `cargo` object with the specified payload. Tasks added to the +cargo will be processed altogether (up to the `payload` limit). If the +`worker` is in progress, the task is queued until it becomes available. Once +the `worker` has completed some tasks, each callback of those tasks is called. +Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966) for how `cargo` and `queue` work. + +While [queue](#queue) passes only one task to one of a group of workers +at a time, cargo passes an array of tasks to a single worker, repeating +when the worker is finished. + +__Arguments__ + +* `worker(tasks, callback)` - An asynchronous function for processing an array of + queued tasks, which must call its `callback(err)` argument when finished, with + an optional `err` argument. +* `payload` - An optional `integer` for determining how many tasks should be + processed per round; if omitted, the default is unlimited. + +__Cargo objects__ + +The `cargo` object returned by this function has the following properties and +methods: + +* `length()` - A function returning the number of items waiting to be processed. +* `payload` - An `integer` for determining how many tasks should be + process per round. This property can be changed after a `cargo` is created to + alter the payload on-the-fly. +* `push(task, [callback])` - Adds `task` to the `queue`. The callback is called + once the `worker` has finished processing the task. Instead of a single task, an array of `tasks` + can be submitted. The respective callback is used for every task in the list. +* `saturated` - A callback that is called when the `queue.length()` hits the concurrency and further tasks will be queued. +* `empty` - A callback that is called when the last item from the `queue` is given to a `worker`. +* `drain` - A callback that is called when the last item from the `queue` has returned from the `worker`. +* `idle()`, `pause()`, `resume()`, `kill()` - cargo inherits all of the same methods and event calbacks as [`queue`](#queue) + +__Example__ + +```js +// create a cargo object with payload 2 + +var cargo = async.cargo(function (tasks, callback) { + for(var i=0; i +### auto(tasks, [concurrency], [callback]) + +Determines the best order for running the functions in `tasks`, based on their requirements. Each function can optionally depend on other functions being completed first, and each function is run as soon as its requirements are satisfied. + +If any of the functions pass an error to their callback, the `auto` sequence will stop. Further tasks will not execute (so any other functions depending on it will not run), and the main `callback` is immediately called with the error. Functions also receive an object containing the results of functions which have completed so far. + +Note, all functions are called with a `results` object as a second argument, +so it is unsafe to pass functions in the `tasks` object which cannot handle the +extra argument. + +For example, this snippet of code: + +```js +async.auto({ + readData: async.apply(fs.readFile, 'data.txt', 'utf-8') +}, callback); +``` + +will have the effect of calling `readFile` with the results object as the last +argument, which will fail: + +```js +fs.readFile('data.txt', 'utf-8', cb, {}); +``` + +Instead, wrap the call to `readFile` in a function which does not forward the +`results` object: + +```js +async.auto({ + readData: function(cb, results){ + fs.readFile('data.txt', 'utf-8', cb); + } +}, callback); +``` + +__Arguments__ + +* `tasks` - An object. Each of its properties is either a function or an array of + requirements, with the function itself the last item in the array. The object's key + of a property serves as the name of the task defined by that property, + i.e. can be used when specifying requirements for other tasks. + The function receives two arguments: (1) a `callback(err, result)` which must be + called when finished, passing an `error` (which can be `null`) and the result of + the function's execution, and (2) a `results` object, containing the results of + the previously executed functions. +* `concurrency` - An optional `integer` for determining the maximum number of tasks that can be run in parallel. By default, as many as possible. +* `callback(err, results)` - An optional callback which is called when all the + tasks have been completed. It receives the `err` argument if any `tasks` + pass an error to their callback. Results are always returned; however, if + an error occurs, no further `tasks` will be performed, and the results + object will only contain partial results. + + +__Example__ + +```js +async.auto({ + get_data: function(callback){ + console.log('in get_data'); + // async code to get some data + callback(null, 'data', 'converted to array'); + }, + make_folder: function(callback){ + console.log('in make_folder'); + // async code to create a directory to store a file in + // this is run at the same time as getting the data + callback(null, 'folder'); + }, + write_file: ['get_data', 'make_folder', function(callback, results){ + console.log('in write_file', JSON.stringify(results)); + // once there is some data and the directory exists, + // write the data to a file in the directory + callback(null, 'filename'); + }], + email_link: ['write_file', function(callback, results){ + console.log('in email_link', JSON.stringify(results)); + // once the file is written let's email a link to it... + // results.write_file contains the filename returned by write_file. + callback(null, {'file':results.write_file, 'email':'user@example.com'}); + }] +}, function(err, results) { + console.log('err = ', err); + console.log('results = ', results); +}); +``` + +This is a fairly trivial example, but to do this using the basic parallel and +series functions would look like this: + +```js +async.parallel([ + function(callback){ + console.log('in get_data'); + // async code to get some data + callback(null, 'data', 'converted to array'); + }, + function(callback){ + console.log('in make_folder'); + // async code to create a directory to store a file in + // this is run at the same time as getting the data + callback(null, 'folder'); + } +], +function(err, results){ + async.series([ + function(callback){ + console.log('in write_file', JSON.stringify(results)); + // once there is some data and the directory exists, + // write the data to a file in the directory + results.push('filename'); + callback(null); + }, + function(callback){ + console.log('in email_link', JSON.stringify(results)); + // once the file is written let's email a link to it... + callback(null, {'file':results.pop(), 'email':'user@example.com'}); + } + ]); +}); +``` + +For a complicated series of `async` tasks, using the [`auto`](#auto) function makes adding +new tasks much easier (and the code more readable). + + +--------------------------------------- + + +### retry([opts = {times: 5, interval: 0}| 5], task, [callback]) + +Attempts to get a successful response from `task` no more than `times` times before +returning an error. If the task is successful, the `callback` will be passed the result +of the successful task. If all attempts fail, the callback will be passed the error and +result (if any) of the final attempt. + +__Arguments__ + +* `opts` - Can be either an object with `times` and `interval` or a number. + * `times` - The number of attempts to make before giving up. The default is `5`. + * `interval` - The time to wait between retries, in milliseconds. The default is `0`. + * If `opts` is a number, the number specifies the number of times to retry, with the default interval of `0`. +* `task(callback, results)` - A function which receives two arguments: (1) a `callback(err, result)` + which must be called when finished, passing `err` (which can be `null`) and the `result` of + the function's execution, and (2) a `results` object, containing the results of + the previously executed functions (if nested inside another control flow). +* `callback(err, results)` - An optional callback which is called when the + task has succeeded, or after the final failed attempt. It receives the `err` and `result` arguments of the last attempt at completing the `task`. + +The [`retry`](#retry) function can be used as a stand-alone control flow by passing a callback, as shown below: + +```js +// try calling apiMethod 3 times +async.retry(3, apiMethod, function(err, result) { + // do something with the result +}); +``` + +```js +// try calling apiMethod 3 times, waiting 200 ms between each retry +async.retry({times: 3, interval: 200}, apiMethod, function(err, result) { + // do something with the result +}); +``` + +```js +// try calling apiMethod the default 5 times no delay between each retry +async.retry(apiMethod, function(err, result) { + // do something with the result +}); +``` + +It can also be embedded within other control flow functions to retry individual methods +that are not as reliable, like this: + +```js +async.auto({ + users: api.getUsers.bind(api), + payments: async.retry(3, api.getPayments.bind(api)) +}, function(err, results) { + // do something with the results +}); +``` + + +--------------------------------------- + + +### iterator(tasks) + +Creates an iterator function which calls the next function in the `tasks` array, +returning a continuation to call the next one after that. It's also possible to +“peek” at the next iterator with `iterator.next()`. + +This function is used internally by the `async` module, but can be useful when +you want to manually control the flow of functions in series. + +__Arguments__ + +* `tasks` - An array of functions to run. + +__Example__ + +```js +var iterator = async.iterator([ + function(){ sys.p('one'); }, + function(){ sys.p('two'); }, + function(){ sys.p('three'); } +]); + +node> var iterator2 = iterator(); +'one' +node> var iterator3 = iterator2(); +'two' +node> iterator3(); +'three' +node> var nextfn = iterator2.next(); +node> nextfn(); +'three' +``` + +--------------------------------------- + + +### apply(function, arguments..) + +Creates a continuation function with some arguments already applied. + +Useful as a shorthand when combined with other control flow functions. Any arguments +passed to the returned function are added to the arguments originally passed +to apply. + +__Arguments__ + +* `function` - The function you want to eventually apply all arguments to. +* `arguments...` - Any number of arguments to automatically apply when the + continuation is called. + +__Example__ + +```js +// using apply + +async.parallel([ + async.apply(fs.writeFile, 'testfile1', 'test1'), + async.apply(fs.writeFile, 'testfile2', 'test2'), +]); + + +// the same process without using apply + +async.parallel([ + function(callback){ + fs.writeFile('testfile1', 'test1', callback); + }, + function(callback){ + fs.writeFile('testfile2', 'test2', callback); + } +]); +``` + +It's possible to pass any number of additional arguments when calling the +continuation: + +```js +node> var fn = async.apply(sys.puts, 'one'); +node> fn('two', 'three'); +one +two +three +``` + +--------------------------------------- + + +### nextTick(callback), setImmediate(callback) + +Calls `callback` on a later loop around the event loop. In Node.js this just +calls `process.nextTick`; in the browser it falls back to `setImmediate(callback)` +if available, otherwise `setTimeout(callback, 0)`, which means other higher priority +events may precede the execution of `callback`. + +This is used internally for browser-compatibility purposes. + +__Arguments__ + +* `callback` - The function to call on a later loop around the event loop. + +__Example__ + +```js +var call_order = []; +async.nextTick(function(){ + call_order.push('two'); + // call_order now equals ['one','two'] +}); +call_order.push('one') +``` + + +### times(n, iterator, [callback]) + +Calls the `iterator` function `n` times, and accumulates results in the same manner +you would use with [`map`](#map). + +__Arguments__ + +* `n` - The number of times to run the function. +* `iterator` - The function to call `n` times. +* `callback` - see [`map`](#map) + +__Example__ + +```js +// Pretend this is some complicated async factory +var createUser = function(id, callback) { + callback(null, { + id: 'user' + id + }) +} +// generate 5 users +async.times(5, function(n, next){ + createUser(n, function(err, user) { + next(err, user) + }) +}, function(err, users) { + // we should now have 5 users +}); +``` + +__Related__ + +* timesSeries(n, iterator, [callback]) +* timesLimit(n, limit, iterator, [callback]) + + +## Utils + + +### memoize(fn, [hasher]) + +Caches the results of an `async` function. When creating a hash to store function +results against, the callback is omitted from the hash and an optional hash +function can be used. + +If no hash function is specified, the first argument is used as a hash key, which may work reasonably if it is a string or a data type that converts to a distinct string. Note that objects and arrays will not behave reasonably. Neither will cases where the other arguments are significant. In such cases, specify your own hash function. + +The cache of results is exposed as the `memo` property of the function returned +by `memoize`. + +__Arguments__ + +* `fn` - The function to proxy and cache results from. +* `hasher` - An optional function for generating a custom hash for storing + results. It has all the arguments applied to it apart from the callback, and + must be synchronous. + +__Example__ + +```js +var slow_fn = function (name, callback) { + // do something + callback(null, result); +}; +var fn = async.memoize(slow_fn); + +// fn can now be used as if it were slow_fn +fn('some name', function () { + // callback +}); +``` + + +### unmemoize(fn) + +Undoes a [`memoize`](#memoize)d function, reverting it to the original, unmemoized +form. Handy for testing. + +__Arguments__ + +* `fn` - the memoized function + +--------------------------------------- + + +### ensureAsync(fn) + +Wrap an async function and ensure it calls its callback on a later tick of the event loop. If the function already calls its callback on a next tick, no extra deferral is added. This is useful for preventing stack overflows (`RangeError: Maximum call stack size exceeded`) and generally keeping [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony) contained. + +__Arguments__ + +* `fn` - an async function, one that expects a node-style callback as its last argument + +Returns a wrapped function with the exact same call signature as the function passed in. + +__Example__ + +```js +function sometimesAsync(arg, callback) { + if (cache[arg]) { + return callback(null, cache[arg]); // this would be synchronous!! + } else { + doSomeIO(arg, callback); // this IO would be asynchronous + } +} + +// this has a risk of stack overflows if many results are cached in a row +async.mapSeries(args, sometimesAsync, done); + +// this will defer sometimesAsync's callback if necessary, +// preventing stack overflows +async.mapSeries(args, async.ensureAsync(sometimesAsync), done); + +``` + +--------------------------------------- + + +### constant(values...) + +Returns a function that when called, calls-back with the values provided. Useful as the first function in a `waterfall`, or for plugging values in to `auto`. + +__Example__ + +```js +async.waterfall([ + async.constant(42), + function (value, next) { + // value === 42 + }, + //... +], callback); + +async.waterfall([ + async.constant(filename, "utf8"), + fs.readFile, + function (fileData, next) { + //... + } + //... +], callback); + +async.auto({ + hostname: async.constant("https://server.net/"), + port: findFreePort, + launchServer: ["hostname", "port", function (cb, options) { + startServer(options, cb); + }], + //... +}, callback); + +``` + +--------------------------------------- + + + +### asyncify(func) + +__Alias:__ `wrapSync` + +Take a sync function and make it async, passing its return value to a callback. This is useful for plugging sync functions into a waterfall, series, or other async functions. Any arguments passed to the generated function will be passed to the wrapped function (except for the final callback argument). Errors thrown will be passed to the callback. + +__Example__ + +```js +async.waterfall([ + async.apply(fs.readFile, filename, "utf8"), + async.asyncify(JSON.parse), + function (data, next) { + // data is the result of parsing the text. + // If there was a parsing error, it would have been caught. + } +], callback) +``` + +If the function passed to `asyncify` returns a Promise, that promises's resolved/rejected state will be used to call the callback, rather than simply the synchronous return value. Example: + +```js +async.waterfall([ + async.apply(fs.readFile, filename, "utf8"), + async.asyncify(function (contents) { + return db.model.create(contents); + }), + function (model, next) { + // `model` is the instantiated model object. + // If there was an error, this function would be skipped. + } +], callback) +``` + +This also means you can asyncify ES2016 `async` functions. + +```js +var q = async.queue(async.asyncify(async function (file) { + var intermediateStep = await processFile(file); + return await somePromise(intermediateStep) +})); + +q.push(files); +``` + +--------------------------------------- + + +### log(function, arguments) + +Logs the result of an `async` function to the `console`. Only works in Node.js or +in browsers that support `console.log` and `console.error` (such as FF and Chrome). +If multiple arguments are returned from the async function, `console.log` is +called on each argument in order. + +__Arguments__ + +* `function` - The function you want to eventually apply all arguments to. +* `arguments...` - Any number of arguments to apply to the function. + +__Example__ + +```js +var hello = function(name, callback){ + setTimeout(function(){ + callback(null, 'hello ' + name); + }, 1000); +}; +``` +```js +node> async.log(hello, 'world'); +'hello world' +``` + +--------------------------------------- + + +### dir(function, arguments) + +Logs the result of an `async` function to the `console` using `console.dir` to +display the properties of the resulting object. Only works in Node.js or +in browsers that support `console.dir` and `console.error` (such as FF and Chrome). +If multiple arguments are returned from the async function, `console.dir` is +called on each argument in order. + +__Arguments__ + +* `function` - The function you want to eventually apply all arguments to. +* `arguments...` - Any number of arguments to apply to the function. + +__Example__ + +```js +var hello = function(name, callback){ + setTimeout(function(){ + callback(null, {hello: name}); + }, 1000); +}; +``` +```js +node> async.dir(hello, 'world'); +{hello: 'world'} +``` + +--------------------------------------- + + +### noConflict() + +Changes the value of `async` back to its original value, returning a reference to the +`async` object. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/form-data/node_modules/async/dist/async.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/form-data/node_modules/async/dist/async.js new file mode 100644 index 00000000..ee0a268e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/form-data/node_modules/async/dist/async.js @@ -0,0 +1,1265 @@ +/*! + * async + * https://github.com/caolan/async + * + * Copyright 2010-2014 Caolan McMahon + * Released under the MIT license + */ +(function () { + + var async = {}; + function noop() {} + function identity(v) { + return v; + } + function toBool(v) { + return !!v; + } + function notId(v) { + return !v; + } + + // global on the server, window in the browser + var previous_async; + + // Establish the root object, `window` (`self`) in the browser, `global` + // on the server, or `this` in some virtual machines. We use `self` + // instead of `window` for `WebWorker` support. + var root = typeof self === 'object' && self.self === self && self || + typeof global === 'object' && global.global === global && global || + this; + + if (root != null) { + previous_async = root.async; + } + + async.noConflict = function () { + root.async = previous_async; + return async; + }; + + function only_once(fn) { + return function() { + if (fn === null) throw new Error("Callback was already called."); + fn.apply(this, arguments); + fn = null; + }; + } + + function _once(fn) { + return function() { + if (fn === null) return; + fn.apply(this, arguments); + fn = null; + }; + } + + //// cross-browser compatiblity functions //// + + var _toString = Object.prototype.toString; + + var _isArray = Array.isArray || function (obj) { + return _toString.call(obj) === '[object Array]'; + }; + + // Ported from underscore.js isObject + var _isObject = function(obj) { + var type = typeof obj; + return type === 'function' || type === 'object' && !!obj; + }; + + function _isArrayLike(arr) { + return _isArray(arr) || ( + // has a positive integer length property + typeof arr.length === "number" && + arr.length >= 0 && + arr.length % 1 === 0 + ); + } + + function _arrayEach(arr, iterator) { + var index = -1, + length = arr.length; + + while (++index < length) { + iterator(arr[index], index, arr); + } + } + + function _map(arr, iterator) { + var index = -1, + length = arr.length, + result = Array(length); + + while (++index < length) { + result[index] = iterator(arr[index], index, arr); + } + return result; + } + + function _range(count) { + return _map(Array(count), function (v, i) { return i; }); + } + + function _reduce(arr, iterator, memo) { + _arrayEach(arr, function (x, i, a) { + memo = iterator(memo, x, i, a); + }); + return memo; + } + + function _forEachOf(object, iterator) { + _arrayEach(_keys(object), function (key) { + iterator(object[key], key); + }); + } + + function _indexOf(arr, item) { + for (var i = 0; i < arr.length; i++) { + if (arr[i] === item) return i; + } + return -1; + } + + var _keys = Object.keys || function (obj) { + var keys = []; + for (var k in obj) { + if (obj.hasOwnProperty(k)) { + keys.push(k); + } + } + return keys; + }; + + function _keyIterator(coll) { + var i = -1; + var len; + var keys; + if (_isArrayLike(coll)) { + len = coll.length; + return function next() { + i++; + return i < len ? i : null; + }; + } else { + keys = _keys(coll); + len = keys.length; + return function next() { + i++; + return i < len ? keys[i] : null; + }; + } + } + + // Similar to ES6's rest param (http://ariya.ofilabs.com/2013/03/es6-and-rest-parameter.html) + // This accumulates the arguments passed into an array, after a given index. + // From underscore.js (https://github.com/jashkenas/underscore/pull/2140). + function _restParam(func, startIndex) { + startIndex = startIndex == null ? func.length - 1 : +startIndex; + return function() { + var length = Math.max(arguments.length - startIndex, 0); + var rest = Array(length); + for (var index = 0; index < length; index++) { + rest[index] = arguments[index + startIndex]; + } + switch (startIndex) { + case 0: return func.call(this, rest); + case 1: return func.call(this, arguments[0], rest); + } + // Currently unused but handle cases outside of the switch statement: + // var args = Array(startIndex + 1); + // for (index = 0; index < startIndex; index++) { + // args[index] = arguments[index]; + // } + // args[startIndex] = rest; + // return func.apply(this, args); + }; + } + + function _withoutIndex(iterator) { + return function (value, index, callback) { + return iterator(value, callback); + }; + } + + //// exported async module functions //// + + //// nextTick implementation with browser-compatible fallback //// + + // capture the global reference to guard against fakeTimer mocks + var _setImmediate = typeof setImmediate === 'function' && setImmediate; + + var _delay = _setImmediate ? function(fn) { + // not a direct alias for IE10 compatibility + _setImmediate(fn); + } : function(fn) { + setTimeout(fn, 0); + }; + + if (typeof process === 'object' && typeof process.nextTick === 'function') { + async.nextTick = process.nextTick; + } else { + async.nextTick = _delay; + } + async.setImmediate = _setImmediate ? _delay : async.nextTick; + + + async.forEach = + async.each = function (arr, iterator, callback) { + return async.eachOf(arr, _withoutIndex(iterator), callback); + }; + + async.forEachSeries = + async.eachSeries = function (arr, iterator, callback) { + return async.eachOfSeries(arr, _withoutIndex(iterator), callback); + }; + + + async.forEachLimit = + async.eachLimit = function (arr, limit, iterator, callback) { + return _eachOfLimit(limit)(arr, _withoutIndex(iterator), callback); + }; + + async.forEachOf = + async.eachOf = function (object, iterator, callback) { + callback = _once(callback || noop); + object = object || []; + + var iter = _keyIterator(object); + var key, completed = 0; + + while ((key = iter()) != null) { + completed += 1; + iterator(object[key], key, only_once(done)); + } + + if (completed === 0) callback(null); + + function done(err) { + completed--; + if (err) { + callback(err); + } + // Check key is null in case iterator isn't exhausted + // and done resolved synchronously. + else if (key === null && completed <= 0) { + callback(null); + } + } + }; + + async.forEachOfSeries = + async.eachOfSeries = function (obj, iterator, callback) { + callback = _once(callback || noop); + obj = obj || []; + var nextKey = _keyIterator(obj); + var key = nextKey(); + function iterate() { + var sync = true; + if (key === null) { + return callback(null); + } + iterator(obj[key], key, only_once(function (err) { + if (err) { + callback(err); + } + else { + key = nextKey(); + if (key === null) { + return callback(null); + } else { + if (sync) { + async.setImmediate(iterate); + } else { + iterate(); + } + } + } + })); + sync = false; + } + iterate(); + }; + + + + async.forEachOfLimit = + async.eachOfLimit = function (obj, limit, iterator, callback) { + _eachOfLimit(limit)(obj, iterator, callback); + }; + + function _eachOfLimit(limit) { + + return function (obj, iterator, callback) { + callback = _once(callback || noop); + obj = obj || []; + var nextKey = _keyIterator(obj); + if (limit <= 0) { + return callback(null); + } + var done = false; + var running = 0; + var errored = false; + + (function replenish () { + if (done && running <= 0) { + return callback(null); + } + + while (running < limit && !errored) { + var key = nextKey(); + if (key === null) { + done = true; + if (running <= 0) { + callback(null); + } + return; + } + running += 1; + iterator(obj[key], key, only_once(function (err) { + running -= 1; + if (err) { + callback(err); + errored = true; + } + else { + replenish(); + } + })); + } + })(); + }; + } + + + function doParallel(fn) { + return function (obj, iterator, callback) { + return fn(async.eachOf, obj, iterator, callback); + }; + } + function doParallelLimit(fn) { + return function (obj, limit, iterator, callback) { + return fn(_eachOfLimit(limit), obj, iterator, callback); + }; + } + function doSeries(fn) { + return function (obj, iterator, callback) { + return fn(async.eachOfSeries, obj, iterator, callback); + }; + } + + function _asyncMap(eachfn, arr, iterator, callback) { + callback = _once(callback || noop); + arr = arr || []; + var results = _isArrayLike(arr) ? [] : {}; + eachfn(arr, function (value, index, callback) { + iterator(value, function (err, v) { + results[index] = v; + callback(err); + }); + }, function (err) { + callback(err, results); + }); + } + + async.map = doParallel(_asyncMap); + async.mapSeries = doSeries(_asyncMap); + async.mapLimit = doParallelLimit(_asyncMap); + + // reduce only has a series version, as doing reduce in parallel won't + // work in many situations. + async.inject = + async.foldl = + async.reduce = function (arr, memo, iterator, callback) { + async.eachOfSeries(arr, function (x, i, callback) { + iterator(memo, x, function (err, v) { + memo = v; + callback(err); + }); + }, function (err) { + callback(err, memo); + }); + }; + + async.foldr = + async.reduceRight = function (arr, memo, iterator, callback) { + var reversed = _map(arr, identity).reverse(); + async.reduce(reversed, memo, iterator, callback); + }; + + async.transform = function (arr, memo, iterator, callback) { + if (arguments.length === 3) { + callback = iterator; + iterator = memo; + memo = _isArray(arr) ? [] : {}; + } + + async.eachOf(arr, function(v, k, cb) { + iterator(memo, v, k, cb); + }, function(err) { + callback(err, memo); + }); + }; + + function _filter(eachfn, arr, iterator, callback) { + var results = []; + eachfn(arr, function (x, index, callback) { + iterator(x, function (v) { + if (v) { + results.push({index: index, value: x}); + } + callback(); + }); + }, function () { + callback(_map(results.sort(function (a, b) { + return a.index - b.index; + }), function (x) { + return x.value; + })); + }); + } + + async.select = + async.filter = doParallel(_filter); + + async.selectLimit = + async.filterLimit = doParallelLimit(_filter); + + async.selectSeries = + async.filterSeries = doSeries(_filter); + + function _reject(eachfn, arr, iterator, callback) { + _filter(eachfn, arr, function(value, cb) { + iterator(value, function(v) { + cb(!v); + }); + }, callback); + } + async.reject = doParallel(_reject); + async.rejectLimit = doParallelLimit(_reject); + async.rejectSeries = doSeries(_reject); + + function _createTester(eachfn, check, getResult) { + return function(arr, limit, iterator, cb) { + function done() { + if (cb) cb(getResult(false, void 0)); + } + function iteratee(x, _, callback) { + if (!cb) return callback(); + iterator(x, function (v) { + if (cb && check(v)) { + cb(getResult(true, x)); + cb = iterator = false; + } + callback(); + }); + } + if (arguments.length > 3) { + eachfn(arr, limit, iteratee, done); + } else { + cb = iterator; + iterator = limit; + eachfn(arr, iteratee, done); + } + }; + } + + async.any = + async.some = _createTester(async.eachOf, toBool, identity); + + async.someLimit = _createTester(async.eachOfLimit, toBool, identity); + + async.all = + async.every = _createTester(async.eachOf, notId, notId); + + async.everyLimit = _createTester(async.eachOfLimit, notId, notId); + + function _findGetResult(v, x) { + return x; + } + async.detect = _createTester(async.eachOf, identity, _findGetResult); + async.detectSeries = _createTester(async.eachOfSeries, identity, _findGetResult); + async.detectLimit = _createTester(async.eachOfLimit, identity, _findGetResult); + + async.sortBy = function (arr, iterator, callback) { + async.map(arr, function (x, callback) { + iterator(x, function (err, criteria) { + if (err) { + callback(err); + } + else { + callback(null, {value: x, criteria: criteria}); + } + }); + }, function (err, results) { + if (err) { + return callback(err); + } + else { + callback(null, _map(results.sort(comparator), function (x) { + return x.value; + })); + } + + }); + + function comparator(left, right) { + var a = left.criteria, b = right.criteria; + return a < b ? -1 : a > b ? 1 : 0; + } + }; + + async.auto = function (tasks, concurrency, callback) { + if (typeof arguments[1] === 'function') { + // concurrency is optional, shift the args. + callback = concurrency; + concurrency = null; + } + callback = _once(callback || noop); + var keys = _keys(tasks); + var remainingTasks = keys.length; + if (!remainingTasks) { + return callback(null); + } + if (!concurrency) { + concurrency = remainingTasks; + } + + var results = {}; + var runningTasks = 0; + + var hasError = false; + + var listeners = []; + function addListener(fn) { + listeners.unshift(fn); + } + function removeListener(fn) { + var idx = _indexOf(listeners, fn); + if (idx >= 0) listeners.splice(idx, 1); + } + function taskComplete() { + remainingTasks--; + _arrayEach(listeners.slice(0), function (fn) { + fn(); + }); + } + + addListener(function () { + if (!remainingTasks) { + callback(null, results); + } + }); + + _arrayEach(keys, function (k) { + if (hasError) return; + var task = _isArray(tasks[k]) ? tasks[k]: [tasks[k]]; + var taskCallback = _restParam(function(err, args) { + runningTasks--; + if (args.length <= 1) { + args = args[0]; + } + if (err) { + var safeResults = {}; + _forEachOf(results, function(val, rkey) { + safeResults[rkey] = val; + }); + safeResults[k] = args; + hasError = true; + + callback(err, safeResults); + } + else { + results[k] = args; + async.setImmediate(taskComplete); + } + }); + var requires = task.slice(0, task.length - 1); + // prevent dead-locks + var len = requires.length; + var dep; + while (len--) { + if (!(dep = tasks[requires[len]])) { + throw new Error('Has nonexistent dependency in ' + requires.join(', ')); + } + if (_isArray(dep) && _indexOf(dep, k) >= 0) { + throw new Error('Has cyclic dependencies'); + } + } + function ready() { + return runningTasks < concurrency && _reduce(requires, function (a, x) { + return (a && results.hasOwnProperty(x)); + }, true) && !results.hasOwnProperty(k); + } + if (ready()) { + runningTasks++; + task[task.length - 1](taskCallback, results); + } + else { + addListener(listener); + } + function listener() { + if (ready()) { + runningTasks++; + removeListener(listener); + task[task.length - 1](taskCallback, results); + } + } + }); + }; + + + + async.retry = function(times, task, callback) { + var DEFAULT_TIMES = 5; + var DEFAULT_INTERVAL = 0; + + var attempts = []; + + var opts = { + times: DEFAULT_TIMES, + interval: DEFAULT_INTERVAL + }; + + function parseTimes(acc, t){ + if(typeof t === 'number'){ + acc.times = parseInt(t, 10) || DEFAULT_TIMES; + } else if(typeof t === 'object'){ + acc.times = parseInt(t.times, 10) || DEFAULT_TIMES; + acc.interval = parseInt(t.interval, 10) || DEFAULT_INTERVAL; + } else { + throw new Error('Unsupported argument type for \'times\': ' + typeof t); + } + } + + var length = arguments.length; + if (length < 1 || length > 3) { + throw new Error('Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)'); + } else if (length <= 2 && typeof times === 'function') { + callback = task; + task = times; + } + if (typeof times !== 'function') { + parseTimes(opts, times); + } + opts.callback = callback; + opts.task = task; + + function wrappedTask(wrappedCallback, wrappedResults) { + function retryAttempt(task, finalAttempt) { + return function(seriesCallback) { + task(function(err, result){ + seriesCallback(!err || finalAttempt, {err: err, result: result}); + }, wrappedResults); + }; + } + + function retryInterval(interval){ + return function(seriesCallback){ + setTimeout(function(){ + seriesCallback(null); + }, interval); + }; + } + + while (opts.times) { + + var finalAttempt = !(opts.times-=1); + attempts.push(retryAttempt(opts.task, finalAttempt)); + if(!finalAttempt && opts.interval > 0){ + attempts.push(retryInterval(opts.interval)); + } + } + + async.series(attempts, function(done, data){ + data = data[data.length - 1]; + (wrappedCallback || opts.callback)(data.err, data.result); + }); + } + + // If a callback is passed, run this as a controll flow + return opts.callback ? wrappedTask() : wrappedTask; + }; + + async.waterfall = function (tasks, callback) { + callback = _once(callback || noop); + if (!_isArray(tasks)) { + var err = new Error('First argument to waterfall must be an array of functions'); + return callback(err); + } + if (!tasks.length) { + return callback(); + } + function wrapIterator(iterator) { + return _restParam(function (err, args) { + if (err) { + callback.apply(null, [err].concat(args)); + } + else { + var next = iterator.next(); + if (next) { + args.push(wrapIterator(next)); + } + else { + args.push(callback); + } + ensureAsync(iterator).apply(null, args); + } + }); + } + wrapIterator(async.iterator(tasks))(); + }; + + function _parallel(eachfn, tasks, callback) { + callback = callback || noop; + var results = _isArrayLike(tasks) ? [] : {}; + + eachfn(tasks, function (task, key, callback) { + task(_restParam(function (err, args) { + if (args.length <= 1) { + args = args[0]; + } + results[key] = args; + callback(err); + })); + }, function (err) { + callback(err, results); + }); + } + + async.parallel = function (tasks, callback) { + _parallel(async.eachOf, tasks, callback); + }; + + async.parallelLimit = function(tasks, limit, callback) { + _parallel(_eachOfLimit(limit), tasks, callback); + }; + + async.series = function(tasks, callback) { + _parallel(async.eachOfSeries, tasks, callback); + }; + + async.iterator = function (tasks) { + function makeCallback(index) { + function fn() { + if (tasks.length) { + tasks[index].apply(null, arguments); + } + return fn.next(); + } + fn.next = function () { + return (index < tasks.length - 1) ? makeCallback(index + 1): null; + }; + return fn; + } + return makeCallback(0); + }; + + async.apply = _restParam(function (fn, args) { + return _restParam(function (callArgs) { + return fn.apply( + null, args.concat(callArgs) + ); + }); + }); + + function _concat(eachfn, arr, fn, callback) { + var result = []; + eachfn(arr, function (x, index, cb) { + fn(x, function (err, y) { + result = result.concat(y || []); + cb(err); + }); + }, function (err) { + callback(err, result); + }); + } + async.concat = doParallel(_concat); + async.concatSeries = doSeries(_concat); + + async.whilst = function (test, iterator, callback) { + callback = callback || noop; + if (test()) { + var next = _restParam(function(err, args) { + if (err) { + callback(err); + } else if (test.apply(this, args)) { + iterator(next); + } else { + callback.apply(null, [null].concat(args)); + } + }); + iterator(next); + } else { + callback(null); + } + }; + + async.doWhilst = function (iterator, test, callback) { + var calls = 0; + return async.whilst(function() { + return ++calls <= 1 || test.apply(this, arguments); + }, iterator, callback); + }; + + async.until = function (test, iterator, callback) { + return async.whilst(function() { + return !test.apply(this, arguments); + }, iterator, callback); + }; + + async.doUntil = function (iterator, test, callback) { + return async.doWhilst(iterator, function() { + return !test.apply(this, arguments); + }, callback); + }; + + async.during = function (test, iterator, callback) { + callback = callback || noop; + + var next = _restParam(function(err, args) { + if (err) { + callback(err); + } else { + args.push(check); + test.apply(this, args); + } + }); + + var check = function(err, truth) { + if (err) { + callback(err); + } else if (truth) { + iterator(next); + } else { + callback(null); + } + }; + + test(check); + }; + + async.doDuring = function (iterator, test, callback) { + var calls = 0; + async.during(function(next) { + if (calls++ < 1) { + next(null, true); + } else { + test.apply(this, arguments); + } + }, iterator, callback); + }; + + function _queue(worker, concurrency, payload) { + if (concurrency == null) { + concurrency = 1; + } + else if(concurrency === 0) { + throw new Error('Concurrency must not be zero'); + } + function _insert(q, data, pos, callback) { + if (callback != null && typeof callback !== "function") { + throw new Error("task callback must be a function"); + } + q.started = true; + if (!_isArray(data)) { + data = [data]; + } + if(data.length === 0 && q.idle()) { + // call drain immediately if there are no tasks + return async.setImmediate(function() { + q.drain(); + }); + } + _arrayEach(data, function(task) { + var item = { + data: task, + callback: callback || noop + }; + + if (pos) { + q.tasks.unshift(item); + } else { + q.tasks.push(item); + } + + if (q.tasks.length === q.concurrency) { + q.saturated(); + } + }); + async.setImmediate(q.process); + } + function _next(q, tasks) { + return function(){ + workers -= 1; + + var removed = false; + var args = arguments; + _arrayEach(tasks, function (task) { + _arrayEach(workersList, function (worker, index) { + if (worker === task && !removed) { + workersList.splice(index, 1); + removed = true; + } + }); + + task.callback.apply(task, args); + }); + if (q.tasks.length + workers === 0) { + q.drain(); + } + q.process(); + }; + } + + var workers = 0; + var workersList = []; + var q = { + tasks: [], + concurrency: concurrency, + payload: payload, + saturated: noop, + empty: noop, + drain: noop, + started: false, + paused: false, + push: function (data, callback) { + _insert(q, data, false, callback); + }, + kill: function () { + q.drain = noop; + q.tasks = []; + }, + unshift: function (data, callback) { + _insert(q, data, true, callback); + }, + process: function () { + while(!q.paused && workers < q.concurrency && q.tasks.length){ + + var tasks = q.payload ? + q.tasks.splice(0, q.payload) : + q.tasks.splice(0, q.tasks.length); + + var data = _map(tasks, function (task) { + return task.data; + }); + + if (q.tasks.length === 0) { + q.empty(); + } + workers += 1; + workersList.push(tasks[0]); + var cb = only_once(_next(q, tasks)); + worker(data, cb); + } + }, + length: function () { + return q.tasks.length; + }, + running: function () { + return workers; + }, + workersList: function () { + return workersList; + }, + idle: function() { + return q.tasks.length + workers === 0; + }, + pause: function () { + q.paused = true; + }, + resume: function () { + if (q.paused === false) { return; } + q.paused = false; + var resumeCount = Math.min(q.concurrency, q.tasks.length); + // Need to call q.process once per concurrent + // worker to preserve full concurrency after pause + for (var w = 1; w <= resumeCount; w++) { + async.setImmediate(q.process); + } + } + }; + return q; + } + + async.queue = function (worker, concurrency) { + var q = _queue(function (items, cb) { + worker(items[0], cb); + }, concurrency, 1); + + return q; + }; + + async.priorityQueue = function (worker, concurrency) { + + function _compareTasks(a, b){ + return a.priority - b.priority; + } + + function _binarySearch(sequence, item, compare) { + var beg = -1, + end = sequence.length - 1; + while (beg < end) { + var mid = beg + ((end - beg + 1) >>> 1); + if (compare(item, sequence[mid]) >= 0) { + beg = mid; + } else { + end = mid - 1; + } + } + return beg; + } + + function _insert(q, data, priority, callback) { + if (callback != null && typeof callback !== "function") { + throw new Error("task callback must be a function"); + } + q.started = true; + if (!_isArray(data)) { + data = [data]; + } + if(data.length === 0) { + // call drain immediately if there are no tasks + return async.setImmediate(function() { + q.drain(); + }); + } + _arrayEach(data, function(task) { + var item = { + data: task, + priority: priority, + callback: typeof callback === 'function' ? callback : noop + }; + + q.tasks.splice(_binarySearch(q.tasks, item, _compareTasks) + 1, 0, item); + + if (q.tasks.length === q.concurrency) { + q.saturated(); + } + async.setImmediate(q.process); + }); + } + + // Start with a normal queue + var q = async.queue(worker, concurrency); + + // Override push to accept second parameter representing priority + q.push = function (data, priority, callback) { + _insert(q, data, priority, callback); + }; + + // Remove unshift function + delete q.unshift; + + return q; + }; + + async.cargo = function (worker, payload) { + return _queue(worker, 1, payload); + }; + + function _console_fn(name) { + return _restParam(function (fn, args) { + fn.apply(null, args.concat([_restParam(function (err, args) { + if (typeof console === 'object') { + if (err) { + if (console.error) { + console.error(err); + } + } + else if (console[name]) { + _arrayEach(args, function (x) { + console[name](x); + }); + } + } + })])); + }); + } + async.log = _console_fn('log'); + async.dir = _console_fn('dir'); + /*async.info = _console_fn('info'); + async.warn = _console_fn('warn'); + async.error = _console_fn('error');*/ + + async.memoize = function (fn, hasher) { + var memo = {}; + var queues = {}; + var has = Object.prototype.hasOwnProperty; + hasher = hasher || identity; + var memoized = _restParam(function memoized(args) { + var callback = args.pop(); + var key = hasher.apply(null, args); + if (has.call(memo, key)) { + async.setImmediate(function () { + callback.apply(null, memo[key]); + }); + } + else if (has.call(queues, key)) { + queues[key].push(callback); + } + else { + queues[key] = [callback]; + fn.apply(null, args.concat([_restParam(function (args) { + memo[key] = args; + var q = queues[key]; + delete queues[key]; + for (var i = 0, l = q.length; i < l; i++) { + q[i].apply(null, args); + } + })])); + } + }); + memoized.memo = memo; + memoized.unmemoized = fn; + return memoized; + }; + + async.unmemoize = function (fn) { + return function () { + return (fn.unmemoized || fn).apply(null, arguments); + }; + }; + + function _times(mapper) { + return function (count, iterator, callback) { + mapper(_range(count), iterator, callback); + }; + } + + async.times = _times(async.map); + async.timesSeries = _times(async.mapSeries); + async.timesLimit = function (count, limit, iterator, callback) { + return async.mapLimit(_range(count), limit, iterator, callback); + }; + + async.seq = function (/* functions... */) { + var fns = arguments; + return _restParam(function (args) { + var that = this; + + var callback = args[args.length - 1]; + if (typeof callback == 'function') { + args.pop(); + } else { + callback = noop; + } + + async.reduce(fns, args, function (newargs, fn, cb) { + fn.apply(that, newargs.concat([_restParam(function (err, nextargs) { + cb(err, nextargs); + })])); + }, + function (err, results) { + callback.apply(that, [err].concat(results)); + }); + }); + }; + + async.compose = function (/* functions... */) { + return async.seq.apply(null, Array.prototype.reverse.call(arguments)); + }; + + + function _applyEach(eachfn) { + return _restParam(function(fns, args) { + var go = _restParam(function(args) { + var that = this; + var callback = args.pop(); + return eachfn(fns, function (fn, _, cb) { + fn.apply(that, args.concat([cb])); + }, + callback); + }); + if (args.length) { + return go.apply(this, args); + } + else { + return go; + } + }); + } + + async.applyEach = _applyEach(async.eachOf); + async.applyEachSeries = _applyEach(async.eachOfSeries); + + + async.forever = function (fn, callback) { + var done = only_once(callback || noop); + var task = ensureAsync(fn); + function next(err) { + if (err) { + return done(err); + } + task(next); + } + next(); + }; + + function ensureAsync(fn) { + return _restParam(function (args) { + var callback = args.pop(); + args.push(function () { + var innerArgs = arguments; + if (sync) { + async.setImmediate(function () { + callback.apply(null, innerArgs); + }); + } else { + callback.apply(null, innerArgs); + } + }); + var sync = true; + fn.apply(this, args); + sync = false; + }); + } + + async.ensureAsync = ensureAsync; + + async.constant = _restParam(function(values) { + var args = [null].concat(values); + return function (callback) { + return callback.apply(this, args); + }; + }); + + async.wrapSync = + async.asyncify = function asyncify(func) { + return _restParam(function (args) { + var callback = args.pop(); + var result; + try { + result = func.apply(this, args); + } catch (e) { + return callback(e); + } + // if result is Promise object + if (_isObject(result) && typeof result.then === "function") { + result.then(function(value) { + callback(null, value); + })["catch"](function(err) { + callback(err.message ? err : new Error(err)); + }); + } else { + callback(null, result); + } + }); + }; + + // Node.js + if (typeof module === 'object' && module.exports) { + module.exports = async; + } + // AMD / RequireJS + else if (typeof define === 'function' && define.amd) { + define([], function () { + return async; + }); + } + // included directly via \n\n```\n\n## Documentation\n\nSome functions are also available in the following forms:\n* `Series` - the same as `` but runs only a single async operation at a time\n* `Limit` - the same as `` but runs a maximum of `limit` async operations at a time\n\n### Collections\n\n* [`each`](#each), `eachSeries`, `eachLimit`\n* [`forEachOf`](#forEachOf), `forEachOfSeries`, `forEachOfLimit`\n* [`map`](#map), `mapSeries`, `mapLimit`\n* [`filter`](#filter), `filterSeries`, `filterLimit`\n* [`reject`](#reject), `rejectSeries`, `rejectLimit`\n* [`reduce`](#reduce), [`reduceRight`](#reduceRight)\n* [`detect`](#detect), `detectSeries`, `detectLimit`\n* [`sortBy`](#sortBy)\n* [`some`](#some), `someLimit`\n* [`every`](#every), `everyLimit`\n* [`concat`](#concat), `concatSeries`\n\n### Control Flow\n\n* [`series`](#seriestasks-callback)\n* [`parallel`](#parallel), `parallelLimit`\n* [`whilst`](#whilst), [`doWhilst`](#doWhilst)\n* [`until`](#until), [`doUntil`](#doUntil)\n* [`during`](#during), [`doDuring`](#doDuring)\n* [`forever`](#forever)\n* [`waterfall`](#waterfall)\n* [`compose`](#compose)\n* [`seq`](#seq)\n* [`applyEach`](#applyEach), `applyEachSeries`\n* [`queue`](#queue), [`priorityQueue`](#priorityQueue)\n* [`cargo`](#cargo)\n* [`auto`](#auto)\n* [`retry`](#retry)\n* [`iterator`](#iterator)\n* [`times`](#times), `timesSeries`, `timesLimit`\n\n### Utils\n\n* [`apply`](#apply)\n* [`nextTick`](#nextTick)\n* [`memoize`](#memoize)\n* [`unmemoize`](#unmemoize)\n* [`ensureAsync`](#ensureAsync)\n* [`constant`](#constant)\n* [`asyncify`](#asyncify)\n* [`wrapSync`](#wrapSync)\n* [`log`](#log)\n* [`dir`](#dir)\n* [`noConflict`](#noConflict)\n\n## Collections\n\n\n\n### each(arr, iterator, [callback])\n\nApplies the function `iterator` to each item in `arr`, in parallel.\nThe `iterator` is called with an item from the list, and a callback for when it\nhas finished. If the `iterator` passes an error to its `callback`, the main\n`callback` (for the `each` function) is immediately called with the error.\n\nNote, that since this function applies `iterator` to each item in parallel,\nthere is no guarantee that the iterator functions will complete in order.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A function to apply to each item in `arr`.\n The iterator is passed a `callback(err)` which must be called once it has\n completed. If no error has occurred, the `callback` should be run without\n arguments or with an explicit `null` argument. The array index is not passed\n to the iterator. If you need the index, use [`forEachOf`](#forEachOf).\n* `callback(err)` - *Optional* A callback which is called when all `iterator` functions\n have finished, or an error occurs.\n\n__Examples__\n\n\n```js\n// assuming openFiles is an array of file names and saveFile is a function\n// to save the modified contents of that file:\n\nasync.each(openFiles, saveFile, function(err){\n // if any of the saves produced an error, err would equal that error\n});\n```\n\n```js\n// assuming openFiles is an array of file names\n\nasync.each(openFiles, function(file, callback) {\n\n // Perform operation on file here.\n console.log('Processing file ' + file);\n\n if( file.length > 32 ) {\n console.log('This file name is too long');\n callback('File name too long');\n } else {\n // Do work to process file here\n console.log('File processed');\n callback();\n }\n}, function(err){\n // if any of the file processing produced an error, err would equal that error\n if( err ) {\n // One of the iterations produced an error.\n // All processing will now stop.\n console.log('A file failed to process');\n } else {\n console.log('All files have been processed successfully');\n }\n});\n```\n\n__Related__\n\n* eachSeries(arr, iterator, [callback])\n* eachLimit(arr, limit, iterator, [callback])\n\n---------------------------------------\n\n\n\n\n### forEachOf(obj, iterator, [callback])\n\nLike `each`, except that it iterates over objects, and passes the key as the second argument to the iterator.\n\n__Arguments__\n\n* `obj` - An object or array to iterate over.\n* `iterator(item, key, callback)` - A function to apply to each item in `obj`.\nThe `key` is the item's key, or index in the case of an array. The iterator is\npassed a `callback(err)` which must be called once it has completed. If no\nerror has occurred, the callback should be run without arguments or with an\nexplicit `null` argument.\n* `callback(err)` - *Optional* A callback which is called when all `iterator` functions have finished, or an error occurs.\n\n__Example__\n\n```js\nvar obj = {dev: \"/dev.json\", test: \"/test.json\", prod: \"/prod.json\"};\nvar configs = {};\n\nasync.forEachOf(obj, function (value, key, callback) {\n fs.readFile(__dirname + value, \"utf8\", function (err, data) {\n if (err) return callback(err);\n try {\n configs[key] = JSON.parse(data);\n } catch (e) {\n return callback(e);\n }\n callback();\n })\n}, function (err) {\n if (err) console.error(err.message);\n // configs is now a map of JSON data\n doSomethingWith(configs);\n})\n```\n\n__Related__\n\n* forEachOfSeries(obj, iterator, [callback])\n* forEachOfLimit(obj, limit, iterator, [callback])\n\n---------------------------------------\n\n\n### map(arr, iterator, [callback])\n\nProduces a new array of values by mapping each value in `arr` through\nthe `iterator` function. The `iterator` is called with an item from `arr` and a\ncallback for when it has finished processing. Each of these callback takes 2 arguments:\nan `error`, and the transformed item from `arr`. If `iterator` passes an error to its\ncallback, the main `callback` (for the `map` function) is immediately called with the error.\n\nNote, that since this function applies the `iterator` to each item in parallel,\nthere is no guarantee that the `iterator` functions will complete in order.\nHowever, the results array will be in the same order as the original `arr`.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A function to apply to each item in `arr`.\n The iterator is passed a `callback(err, transformed)` which must be called once\n it has completed with an error (which can be `null`) and a transformed item.\n* `callback(err, results)` - *Optional* A callback which is called when all `iterator`\n functions have finished, or an error occurs. Results is an array of the\n transformed items from the `arr`.\n\n__Example__\n\n```js\nasync.map(['file1','file2','file3'], fs.stat, function(err, results){\n // results is now an array of stats for each file\n});\n```\n\n__Related__\n* mapSeries(arr, iterator, [callback])\n* mapLimit(arr, limit, iterator, [callback])\n\n---------------------------------------\n\n\n\n### filter(arr, iterator, [callback])\n\n__Alias:__ `select`\n\nReturns a new array of all the values in `arr` which pass an async truth test.\n_The callback for each `iterator` call only accepts a single argument of `true` or\n`false`; it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like `fs.exists`. This operation is\nperformed in parallel, but the results array will be in the same order as the\noriginal.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A truth test to apply to each item in `arr`.\n The `iterator` is passed a `callback(truthValue)`, which must be called with a\n boolean argument once it has completed.\n* `callback(results)` - *Optional* A callback which is called after all the `iterator`\n functions have finished.\n\n__Example__\n\n```js\nasync.filter(['file1','file2','file3'], fs.exists, function(results){\n // results now equals an array of the existing files\n});\n```\n\n__Related__\n\n* filterSeries(arr, iterator, [callback])\n* filterLimit(arr, limit, iterator, [callback])\n\n---------------------------------------\n\n\n### reject(arr, iterator, [callback])\n\nThe opposite of [`filter`](#filter). Removes values that pass an `async` truth test.\n\n__Related__\n\n* rejectSeries(arr, iterator, [callback])\n* rejectLimit(arr, limit, iterator, [callback])\n\n---------------------------------------\n\n\n### reduce(arr, memo, iterator, [callback])\n\n__Aliases:__ `inject`, `foldl`\n\nReduces `arr` into a single value using an async `iterator` to return\neach successive step. `memo` is the initial state of the reduction.\nThis function only operates in series.\n\nFor performance reasons, it may make sense to split a call to this function into\na parallel map, and then use the normal `Array.prototype.reduce` on the results.\nThis function is for situations where each step in the reduction needs to be async;\nif you can get the data before reducing it, then it's probably a good idea to do so.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `memo` - The initial state of the reduction.\n* `iterator(memo, item, callback)` - A function applied to each item in the\n array to produce the next step in the reduction. The `iterator` is passed a\n `callback(err, reduction)` which accepts an optional error as its first\n argument, and the state of the reduction as the second. If an error is\n passed to the callback, the reduction is stopped and the main `callback` is\n immediately called with the error.\n* `callback(err, result)` - *Optional* A callback which is called after all the `iterator`\n functions have finished. Result is the reduced value.\n\n__Example__\n\n```js\nasync.reduce([1,2,3], 0, function(memo, item, callback){\n // pointless async:\n process.nextTick(function(){\n callback(null, memo + item)\n });\n}, function(err, result){\n // result is now equal to the last value of memo, which is 6\n});\n```\n\n---------------------------------------\n\n\n### reduceRight(arr, memo, iterator, [callback])\n\n__Alias:__ `foldr`\n\nSame as [`reduce`](#reduce), only operates on `arr` in reverse order.\n\n\n---------------------------------------\n\n\n### detect(arr, iterator, [callback])\n\nReturns the first value in `arr` that passes an async truth test. The\n`iterator` is applied in parallel, meaning the first iterator to return `true` will\nfire the detect `callback` with that result. That means the result might not be\nthe first item in the original `arr` (in terms of order) that passes the test.\n\nIf order within the original `arr` is important, then look at [`detectSeries`](#detectSeries).\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A truth test to apply to each item in `arr`.\n The iterator is passed a `callback(truthValue)` which must be called with a\n boolean argument once it has completed. **Note: this callback does not take an error as its first argument.**\n* `callback(result)` - *Optional* A callback which is called as soon as any iterator returns\n `true`, or after all the `iterator` functions have finished. Result will be\n the first item in the array that passes the truth test (iterator) or the\n value `undefined` if none passed. **Note: this callback does not take an error as its first argument.**\n\n__Example__\n\n```js\nasync.detect(['file1','file2','file3'], fs.exists, function(result){\n // result now equals the first file in the list that exists\n});\n```\n\n__Related__\n\n* detectSeries(arr, iterator, [callback])\n* detectLimit(arr, limit, iterator, [callback])\n\n---------------------------------------\n\n\n### sortBy(arr, iterator, [callback])\n\nSorts a list by the results of running each `arr` value through an async `iterator`.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A function to apply to each item in `arr`.\n The iterator is passed a `callback(err, sortValue)` which must be called once it\n has completed with an error (which can be `null`) and a value to use as the sort\n criteria.\n* `callback(err, results)` - *Optional* A callback which is called after all the `iterator`\n functions have finished, or an error occurs. Results is the items from\n the original `arr` sorted by the values returned by the `iterator` calls.\n\n__Example__\n\n```js\nasync.sortBy(['file1','file2','file3'], function(file, callback){\n fs.stat(file, function(err, stats){\n callback(err, stats.mtime);\n });\n}, function(err, results){\n // results is now the original array of files sorted by\n // modified date\n});\n```\n\n__Sort Order__\n\nBy modifying the callback parameter the sorting order can be influenced:\n\n```js\n//ascending order\nasync.sortBy([1,9,3,5], function(x, callback){\n callback(null, x);\n}, function(err,result){\n //result callback\n} );\n\n//descending order\nasync.sortBy([1,9,3,5], function(x, callback){\n callback(null, x*-1); //<- x*-1 instead of x, turns the order around\n}, function(err,result){\n //result callback\n} );\n```\n\n---------------------------------------\n\n\n### some(arr, iterator, [callback])\n\n__Alias:__ `any`\n\nReturns `true` if at least one element in the `arr` satisfies an async test.\n_The callback for each iterator call only accepts a single argument of `true` or\n`false`; it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like `fs.exists`. Once any iterator\ncall returns `true`, the main `callback` is immediately called.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A truth test to apply to each item in the array\n in parallel. The iterator is passed a `callback(truthValue)`` which must be\n called with a boolean argument once it has completed.\n* `callback(result)` - *Optional* A callback which is called as soon as any iterator returns\n `true`, or after all the iterator functions have finished. Result will be\n either `true` or `false` depending on the values of the async tests.\n\n **Note: the callbacks do not take an error as their first argument.**\n__Example__\n\n```js\nasync.some(['file1','file2','file3'], fs.exists, function(result){\n // if result is true then at least one of the files exists\n});\n```\n\n__Related__\n\n* someLimit(arr, limit, iterator, callback)\n\n---------------------------------------\n\n\n### every(arr, iterator, [callback])\n\n__Alias:__ `all`\n\nReturns `true` if every element in `arr` satisfies an async test.\n_The callback for each `iterator` call only accepts a single argument of `true` or\n`false`; it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like `fs.exists`.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A truth test to apply to each item in the array\n in parallel. The iterator is passed a `callback(truthValue)` which must be\n called with a boolean argument once it has completed.\n* `callback(result)` - *Optional* A callback which is called as soon as any iterator returns\n `false`, or after all the iterator functions have finished. Result will be\n either `true` or `false` depending on the values of the async tests.\n\n **Note: the callbacks do not take an error as their first argument.**\n\n__Example__\n\n```js\nasync.every(['file1','file2','file3'], fs.exists, function(result){\n // if result is true then every file exists\n});\n```\n\n__Related__\n\n* everyLimit(arr, limit, iterator, callback)\n\n---------------------------------------\n\n\n### concat(arr, iterator, [callback])\n\nApplies `iterator` to each item in `arr`, concatenating the results. Returns the\nconcatenated list. The `iterator`s are called in parallel, and the results are\nconcatenated as they return. There is no guarantee that the results array will\nbe returned in the original order of `arr` passed to the `iterator` function.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A function to apply to each item in `arr`.\n The iterator is passed a `callback(err, results)` which must be called once it\n has completed with an error (which can be `null`) and an array of results.\n* `callback(err, results)` - *Optional* A callback which is called after all the `iterator`\n functions have finished, or an error occurs. Results is an array containing\n the concatenated results of the `iterator` function.\n\n__Example__\n\n```js\nasync.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){\n // files is now a list of filenames that exist in the 3 directories\n});\n```\n\n__Related__\n\n* concatSeries(arr, iterator, [callback])\n\n\n## Control Flow\n\n\n### series(tasks, [callback])\n\nRun the functions in the `tasks` array in series, each one running once the previous\nfunction has completed. If any functions in the series pass an error to its\ncallback, no more functions are run, and `callback` is immediately called with the value of the error.\nOtherwise, `callback` receives an array of results when `tasks` have completed.\n\nIt is also possible to use an object instead of an array. Each property will be\nrun as a function, and the results will be passed to the final `callback` as an object\ninstead of an array. This can be a more readable way of handling results from\n[`series`](#series).\n\n**Note** that while many implementations preserve the order of object properties, the\n[ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6)\nexplicitly states that\n\n> The mechanics and order of enumerating the properties is not specified.\n\nSo if you rely on the order in which your series of functions are executed, and want\nthis to work on all platforms, consider using an array.\n\n__Arguments__\n\n* `tasks` - An array or object containing functions to run, each function is passed\n a `callback(err, result)` it must call on completion with an error `err` (which can\n be `null`) and an optional `result` value.\n* `callback(err, results)` - An optional callback to run once all the functions\n have completed. This function gets a results array (or object) containing all\n the result arguments passed to the `task` callbacks.\n\n__Example__\n\n```js\nasync.series([\n function(callback){\n // do some stuff ...\n callback(null, 'one');\n },\n function(callback){\n // do some more stuff ...\n callback(null, 'two');\n }\n],\n// optional callback\nfunction(err, results){\n // results is now equal to ['one', 'two']\n});\n\n\n// an example using an object instead of an array\nasync.series({\n one: function(callback){\n setTimeout(function(){\n callback(null, 1);\n }, 200);\n },\n two: function(callback){\n setTimeout(function(){\n callback(null, 2);\n }, 100);\n }\n},\nfunction(err, results) {\n // results is now equal to: {one: 1, two: 2}\n});\n```\n\n---------------------------------------\n\n\n### parallel(tasks, [callback])\n\nRun the `tasks` array of functions in parallel, without waiting until the previous\nfunction has completed. If any of the functions pass an error to its\ncallback, the main `callback` is immediately called with the value of the error.\nOnce the `tasks` have completed, the results are passed to the final `callback` as an\narray.\n\n**Note:** `parallel` is about kicking-off I/O tasks in parallel, not about parallel execution of code. If your tasks do not use any timers or perform any I/O, they will actually be executed in series. Any synchronous setup sections for each task will happen one after the other. JavaScript remains single-threaded.\n\nIt is also possible to use an object instead of an array. Each property will be\nrun as a function and the results will be passed to the final `callback` as an object\ninstead of an array. This can be a more readable way of handling results from\n[`parallel`](#parallel).\n\n\n__Arguments__\n\n* `tasks` - An array or object containing functions to run. Each function is passed\n a `callback(err, result)` which it must call on completion with an error `err`\n (which can be `null`) and an optional `result` value.\n* `callback(err, results)` - An optional callback to run once all the functions\n have completed successfully. This function gets a results array (or object) containing all\n the result arguments passed to the task callbacks.\n\n__Example__\n\n```js\nasync.parallel([\n function(callback){\n setTimeout(function(){\n callback(null, 'one');\n }, 200);\n },\n function(callback){\n setTimeout(function(){\n callback(null, 'two');\n }, 100);\n }\n],\n// optional callback\nfunction(err, results){\n // the results array will equal ['one','two'] even though\n // the second function had a shorter timeout.\n});\n\n\n// an example using an object instead of an array\nasync.parallel({\n one: function(callback){\n setTimeout(function(){\n callback(null, 1);\n }, 200);\n },\n two: function(callback){\n setTimeout(function(){\n callback(null, 2);\n }, 100);\n }\n},\nfunction(err, results) {\n // results is now equals to: {one: 1, two: 2}\n});\n```\n\n__Related__\n\n* parallelLimit(tasks, limit, [callback])\n\n---------------------------------------\n\n\n### whilst(test, fn, callback)\n\nRepeatedly call `fn`, while `test` returns `true`. Calls `callback` when stopped,\nor an error occurs.\n\n__Arguments__\n\n* `test()` - synchronous truth test to perform before each execution of `fn`.\n* `fn(callback)` - A function which is called each time `test` passes. The function is\n passed a `callback(err)`, which must be called once it has completed with an\n optional `err` argument.\n* `callback(err, [results])` - A callback which is called after the test\n function has failed and repeated execution of `fn` has stopped. `callback`\n will be passed an error and any arguments passed to the final `fn`'s callback.\n\n__Example__\n\n```js\nvar count = 0;\n\nasync.whilst(\n function () { return count < 5; },\n function (callback) {\n count++;\n setTimeout(function () {\n callback(null, count);\n }, 1000);\n },\n function (err, n) {\n // 5 seconds have passed, n = 5\n }\n);\n```\n\n---------------------------------------\n\n\n### doWhilst(fn, test, callback)\n\nThe post-check version of [`whilst`](#whilst). To reflect the difference in\nthe order of operations, the arguments `test` and `fn` are switched.\n\n`doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript.\n\n---------------------------------------\n\n\n### until(test, fn, callback)\n\nRepeatedly call `fn` until `test` returns `true`. Calls `callback` when stopped,\nor an error occurs. `callback` will be passed an error and any arguments passed\nto the final `fn`'s callback.\n\nThe inverse of [`whilst`](#whilst).\n\n---------------------------------------\n\n\n### doUntil(fn, test, callback)\n\nLike [`doWhilst`](#doWhilst), except the `test` is inverted. Note the argument ordering differs from `until`.\n\n---------------------------------------\n\n\n### during(test, fn, callback)\n\nLike [`whilst`](#whilst), except the `test` is an asynchronous function that is passed a callback in the form of `function (err, truth)`. If error is passed to `test` or `fn`, the main callback is immediately called with the value of the error.\n\n__Example__\n\n```js\nvar count = 0;\n\nasync.during(\n function (callback) {\n return callback(null, count < 5);\n },\n function (callback) {\n count++;\n setTimeout(callback, 1000);\n },\n function (err) {\n // 5 seconds have passed\n }\n);\n```\n\n---------------------------------------\n\n\n### doDuring(fn, test, callback)\n\nThe post-check version of [`during`](#during). To reflect the difference in\nthe order of operations, the arguments `test` and `fn` are switched.\n\nAlso a version of [`doWhilst`](#doWhilst) with asynchronous `test` function.\n\n---------------------------------------\n\n\n### forever(fn, [errback])\n\nCalls the asynchronous function `fn` with a callback parameter that allows it to\ncall itself again, in series, indefinitely.\n\nIf an error is passed to the callback then `errback` is called with the\nerror, and execution stops, otherwise it will never be called.\n\n```js\nasync.forever(\n function(next) {\n // next is suitable for passing to things that need a callback(err [, whatever]);\n // it will result in this function being called again.\n },\n function(err) {\n // if next is called with a value in its first parameter, it will appear\n // in here as 'err', and execution will stop.\n }\n);\n```\n\n---------------------------------------\n\n\n### waterfall(tasks, [callback])\n\nRuns the `tasks` array of functions in series, each passing their results to the next in\nthe array. However, if any of the `tasks` pass an error to their own callback, the\nnext function is not executed, and the main `callback` is immediately called with\nthe error.\n\n__Arguments__\n\n* `tasks` - An array of functions to run, each function is passed a\n `callback(err, result1, result2, ...)` it must call on completion. The first\n argument is an error (which can be `null`) and any further arguments will be\n passed as arguments in order to the next task.\n* `callback(err, [results])` - An optional callback to run once all the functions\n have completed. This will be passed the results of the last task's callback.\n\n\n\n__Example__\n\n```js\nasync.waterfall([\n function(callback) {\n callback(null, 'one', 'two');\n },\n function(arg1, arg2, callback) {\n // arg1 now equals 'one' and arg2 now equals 'two'\n callback(null, 'three');\n },\n function(arg1, callback) {\n // arg1 now equals 'three'\n callback(null, 'done');\n }\n], function (err, result) {\n // result now equals 'done'\n});\n```\nOr, with named functions:\n\n```js\nasync.waterfall([\n myFirstFunction,\n mySecondFunction,\n myLastFunction,\n], function (err, result) {\n // result now equals 'done'\n});\nfunction myFirstFunction(callback) {\n callback(null, 'one', 'two');\n}\nfunction mySecondFunction(arg1, arg2, callback) {\n // arg1 now equals 'one' and arg2 now equals 'two'\n callback(null, 'three');\n}\nfunction myLastFunction(arg1, callback) {\n // arg1 now equals 'three'\n callback(null, 'done');\n}\n```\n\nOr, if you need to pass any argument to the first function:\n\n```js\nasync.waterfall([\n async.apply(myFirstFunction, 'zero'),\n mySecondFunction,\n myLastFunction,\n], function (err, result) {\n // result now equals 'done'\n});\nfunction myFirstFunction(arg1, callback) {\n // arg1 now equals 'zero'\n callback(null, 'one', 'two');\n}\nfunction mySecondFunction(arg1, arg2, callback) {\n // arg1 now equals 'one' and arg2 now equals 'two'\n callback(null, 'three');\n}\nfunction myLastFunction(arg1, callback) {\n // arg1 now equals 'three'\n callback(null, 'done');\n}\n```\n\n---------------------------------------\n\n### compose(fn1, fn2...)\n\nCreates a function which is a composition of the passed asynchronous\nfunctions. Each function consumes the return value of the function that\nfollows. Composing functions `f()`, `g()`, and `h()` would produce the result of\n`f(g(h()))`, only this version uses callbacks to obtain the return values.\n\nEach function is executed with the `this` binding of the composed function.\n\n__Arguments__\n\n* `functions...` - the asynchronous functions to compose\n\n\n__Example__\n\n```js\nfunction add1(n, callback) {\n setTimeout(function () {\n callback(null, n + 1);\n }, 10);\n}\n\nfunction mul3(n, callback) {\n setTimeout(function () {\n callback(null, n * 3);\n }, 10);\n}\n\nvar add1mul3 = async.compose(mul3, add1);\n\nadd1mul3(4, function (err, result) {\n // result now equals 15\n});\n```\n\n---------------------------------------\n\n### seq(fn1, fn2...)\n\nVersion of the compose function that is more natural to read.\nEach function consumes the return value of the previous function.\nIt is the equivalent of [`compose`](#compose) with the arguments reversed.\n\nEach function is executed with the `this` binding of the composed function.\n\n__Arguments__\n\n* `functions...` - the asynchronous functions to compose\n\n\n__Example__\n\n```js\n// Requires lodash (or underscore), express3 and dresende's orm2.\n// Part of an app, that fetches cats of the logged user.\n// This example uses `seq` function to avoid overnesting and error\n// handling clutter.\napp.get('/cats', function(request, response) {\n var User = request.models.User;\n async.seq(\n _.bind(User.get, User), // 'User.get' has signature (id, callback(err, data))\n function(user, fn) {\n user.getCats(fn); // 'getCats' has signature (callback(err, data))\n }\n )(req.session.user_id, function (err, cats) {\n if (err) {\n console.error(err);\n response.json({ status: 'error', message: err.message });\n } else {\n response.json({ status: 'ok', message: 'Cats found', data: cats });\n }\n });\n});\n```\n\n---------------------------------------\n\n### applyEach(fns, args..., callback)\n\nApplies the provided arguments to each function in the array, calling\n`callback` after all functions have completed. If you only provide the first\nargument, then it will return a function which lets you pass in the\narguments as if it were a single function call.\n\n__Arguments__\n\n* `fns` - the asynchronous functions to all call with the same arguments\n* `args...` - any number of separate arguments to pass to the function\n* `callback` - the final argument should be the callback, called when all\n functions have completed processing\n\n\n__Example__\n\n```js\nasync.applyEach([enableSearch, updateSchema], 'bucket', callback);\n\n// partial application example:\nasync.each(\n buckets,\n async.applyEach([enableSearch, updateSchema]),\n callback\n);\n```\n\n__Related__\n\n* applyEachSeries(tasks, args..., [callback])\n\n---------------------------------------\n\n\n### queue(worker, [concurrency])\n\nCreates a `queue` object with the specified `concurrency`. Tasks added to the\n`queue` are processed in parallel (up to the `concurrency` limit). If all\n`worker`s are in progress, the task is queued until one becomes available.\nOnce a `worker` completes a `task`, that `task`'s callback is called.\n\n__Arguments__\n\n* `worker(task, callback)` - An asynchronous function for processing a queued\n task, which must call its `callback(err)` argument when finished, with an\n optional `error` as an argument. If you want to handle errors from an individual task, pass a callback to `q.push()`.\n* `concurrency` - An `integer` for determining how many `worker` functions should be\n run in parallel. If omitted, the concurrency defaults to `1`. If the concurrency is `0`, an error is thrown.\n\n__Queue objects__\n\nThe `queue` object returned by this function has the following properties and\nmethods:\n\n* `length()` - a function returning the number of items waiting to be processed.\n* `started` - a function returning whether or not any items have been pushed and processed by the queue\n* `running()` - a function returning the number of items currently being processed.\n* `workersList()` - a function returning the array of items currently being processed.\n* `idle()` - a function returning false if there are items waiting or being processed, or true if not.\n* `concurrency` - an integer for determining how many `worker` functions should be\n run in parallel. This property can be changed after a `queue` is created to\n alter the concurrency on-the-fly.\n* `push(task, [callback])` - add a new task to the `queue`. Calls `callback` once\n the `worker` has finished processing the task. Instead of a single task, a `tasks` array\n can be submitted. The respective callback is used for every task in the list.\n* `unshift(task, [callback])` - add a new task to the front of the `queue`.\n* `saturated` - a callback that is called when the `queue` length hits the `concurrency` limit,\n and further tasks will be queued.\n* `empty` - a callback that is called when the last item from the `queue` is given to a `worker`.\n* `drain` - a callback that is called when the last item from the `queue` has returned from the `worker`.\n* `paused` - a boolean for determining whether the queue is in a paused state\n* `pause()` - a function that pauses the processing of tasks until `resume()` is called.\n* `resume()` - a function that resumes the processing of queued tasks when the queue is paused.\n* `kill()` - a function that removes the `drain` callback and empties remaining tasks from the queue forcing it to go idle.\n\n__Example__\n\n```js\n// create a queue object with concurrency 2\n\nvar q = async.queue(function (task, callback) {\n console.log('hello ' + task.name);\n callback();\n}, 2);\n\n\n// assign a callback\nq.drain = function() {\n console.log('all items have been processed');\n}\n\n// add some items to the queue\n\nq.push({name: 'foo'}, function (err) {\n console.log('finished processing foo');\n});\nq.push({name: 'bar'}, function (err) {\n console.log('finished processing bar');\n});\n\n// add some items to the queue (batch-wise)\n\nq.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) {\n console.log('finished processing item');\n});\n\n// add some items to the front of the queue\n\nq.unshift({name: 'bar'}, function (err) {\n console.log('finished processing bar');\n});\n```\n\n\n---------------------------------------\n\n\n### priorityQueue(worker, concurrency)\n\nThe same as [`queue`](#queue) only tasks are assigned a priority and completed in ascending priority order. There are two differences between `queue` and `priorityQueue` objects:\n\n* `push(task, priority, [callback])` - `priority` should be a number. If an array of\n `tasks` is given, all tasks will be assigned the same priority.\n* The `unshift` method was removed.\n\n---------------------------------------\n\n\n### cargo(worker, [payload])\n\nCreates a `cargo` object with the specified payload. Tasks added to the\ncargo will be processed altogether (up to the `payload` limit). If the\n`worker` is in progress, the task is queued until it becomes available. Once\nthe `worker` has completed some tasks, each callback of those tasks is called.\nCheck out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966) for how `cargo` and `queue` work.\n\nWhile [queue](#queue) passes only one task to one of a group of workers\nat a time, cargo passes an array of tasks to a single worker, repeating\nwhen the worker is finished.\n\n__Arguments__\n\n* `worker(tasks, callback)` - An asynchronous function for processing an array of\n queued tasks, which must call its `callback(err)` argument when finished, with\n an optional `err` argument.\n* `payload` - An optional `integer` for determining how many tasks should be\n processed per round; if omitted, the default is unlimited.\n\n__Cargo objects__\n\nThe `cargo` object returned by this function has the following properties and\nmethods:\n\n* `length()` - A function returning the number of items waiting to be processed.\n* `payload` - An `integer` for determining how many tasks should be\n process per round. This property can be changed after a `cargo` is created to\n alter the payload on-the-fly.\n* `push(task, [callback])` - Adds `task` to the `queue`. The callback is called\n once the `worker` has finished processing the task. Instead of a single task, an array of `tasks`\n can be submitted. The respective callback is used for every task in the list.\n* `saturated` - A callback that is called when the `queue.length()` hits the concurrency and further tasks will be queued.\n* `empty` - A callback that is called when the last item from the `queue` is given to a `worker`.\n* `drain` - A callback that is called when the last item from the `queue` has returned from the `worker`.\n* `idle()`, `pause()`, `resume()`, `kill()` - cargo inherits all of the same methods and event calbacks as [`queue`](#queue)\n\n__Example__\n\n```js\n// create a cargo object with payload 2\n\nvar cargo = async.cargo(function (tasks, callback) {\n for(var i=0; i\n### auto(tasks, [concurrency], [callback])\n\nDetermines the best order for running the functions in `tasks`, based on their requirements. Each function can optionally depend on other functions being completed first, and each function is run as soon as its requirements are satisfied.\n\nIf any of the functions pass an error to their callback, the `auto` sequence will stop. Further tasks will not execute (so any other functions depending on it will not run), and the main `callback` is immediately called with the error. Functions also receive an object containing the results of functions which have completed so far.\n\nNote, all functions are called with a `results` object as a second argument,\nso it is unsafe to pass functions in the `tasks` object which cannot handle the\nextra argument.\n\nFor example, this snippet of code:\n\n```js\nasync.auto({\n readData: async.apply(fs.readFile, 'data.txt', 'utf-8')\n}, callback);\n```\n\nwill have the effect of calling `readFile` with the results object as the last\nargument, which will fail:\n\n```js\nfs.readFile('data.txt', 'utf-8', cb, {});\n```\n\nInstead, wrap the call to `readFile` in a function which does not forward the\n`results` object:\n\n```js\nasync.auto({\n readData: function(cb, results){\n fs.readFile('data.txt', 'utf-8', cb);\n }\n}, callback);\n```\n\n__Arguments__\n\n* `tasks` - An object. Each of its properties is either a function or an array of\n requirements, with the function itself the last item in the array. The object's key\n of a property serves as the name of the task defined by that property,\n i.e. can be used when specifying requirements for other tasks.\n The function receives two arguments: (1) a `callback(err, result)` which must be\n called when finished, passing an `error` (which can be `null`) and the result of\n the function's execution, and (2) a `results` object, containing the results of\n the previously executed functions.\n* `concurrency` - An optional `integer` for determining the maximum number of tasks that can be run in parallel. By default, as many as possible.\n* `callback(err, results)` - An optional callback which is called when all the\n tasks have been completed. It receives the `err` argument if any `tasks`\n pass an error to their callback. Results are always returned; however, if\n an error occurs, no further `tasks` will be performed, and the results\n object will only contain partial results.\n\n\n__Example__\n\n```js\nasync.auto({\n get_data: function(callback){\n console.log('in get_data');\n // async code to get some data\n callback(null, 'data', 'converted to array');\n },\n make_folder: function(callback){\n console.log('in make_folder');\n // async code to create a directory to store a file in\n // this is run at the same time as getting the data\n callback(null, 'folder');\n },\n write_file: ['get_data', 'make_folder', function(callback, results){\n console.log('in write_file', JSON.stringify(results));\n // once there is some data and the directory exists,\n // write the data to a file in the directory\n callback(null, 'filename');\n }],\n email_link: ['write_file', function(callback, results){\n console.log('in email_link', JSON.stringify(results));\n // once the file is written let's email a link to it...\n // results.write_file contains the filename returned by write_file.\n callback(null, {'file':results.write_file, 'email':'user@example.com'});\n }]\n}, function(err, results) {\n console.log('err = ', err);\n console.log('results = ', results);\n});\n```\n\nThis is a fairly trivial example, but to do this using the basic parallel and\nseries functions would look like this:\n\n```js\nasync.parallel([\n function(callback){\n console.log('in get_data');\n // async code to get some data\n callback(null, 'data', 'converted to array');\n },\n function(callback){\n console.log('in make_folder');\n // async code to create a directory to store a file in\n // this is run at the same time as getting the data\n callback(null, 'folder');\n }\n],\nfunction(err, results){\n async.series([\n function(callback){\n console.log('in write_file', JSON.stringify(results));\n // once there is some data and the directory exists,\n // write the data to a file in the directory\n results.push('filename');\n callback(null);\n },\n function(callback){\n console.log('in email_link', JSON.stringify(results));\n // once the file is written let's email a link to it...\n callback(null, {'file':results.pop(), 'email':'user@example.com'});\n }\n ]);\n});\n```\n\nFor a complicated series of `async` tasks, using the [`auto`](#auto) function makes adding\nnew tasks much easier (and the code more readable).\n\n\n---------------------------------------\n\n\n### retry([opts = {times: 5, interval: 0}| 5], task, [callback])\n\nAttempts to get a successful response from `task` no more than `times` times before\nreturning an error. If the task is successful, the `callback` will be passed the result\nof the successful task. If all attempts fail, the callback will be passed the error and\nresult (if any) of the final attempt.\n\n__Arguments__\n\n* `opts` - Can be either an object with `times` and `interval` or a number.\n * `times` - The number of attempts to make before giving up. The default is `5`.\n * `interval` - The time to wait between retries, in milliseconds. The default is `0`.\n * If `opts` is a number, the number specifies the number of times to retry, with the default interval of `0`. \n* `task(callback, results)` - A function which receives two arguments: (1) a `callback(err, result)`\n which must be called when finished, passing `err` (which can be `null`) and the `result` of\n the function's execution, and (2) a `results` object, containing the results of\n the previously executed functions (if nested inside another control flow).\n* `callback(err, results)` - An optional callback which is called when the\n task has succeeded, or after the final failed attempt. It receives the `err` and `result` arguments of the last attempt at completing the `task`.\n\nThe [`retry`](#retry) function can be used as a stand-alone control flow by passing a callback, as shown below:\n\n```js\n// try calling apiMethod 3 times\nasync.retry(3, apiMethod, function(err, result) {\n // do something with the result\n});\n```\n\n```js\n// try calling apiMethod 3 times, waiting 200 ms between each retry \nasync.retry({times: 3, interval: 200}, apiMethod, function(err, result) {\n // do something with the result\n});\n```\n\n```js\n// try calling apiMethod the default 5 times no delay between each retry \nasync.retry(apiMethod, function(err, result) {\n // do something with the result\n});\n```\n\nIt can also be embedded within other control flow functions to retry individual methods\nthat are not as reliable, like this:\n\n```js\nasync.auto({\n users: api.getUsers.bind(api),\n payments: async.retry(3, api.getPayments.bind(api))\n}, function(err, results) {\n // do something with the results\n});\n```\n\n\n---------------------------------------\n\n\n### iterator(tasks)\n\nCreates an iterator function which calls the next function in the `tasks` array,\nreturning a continuation to call the next one after that. It's also possible to\n“peek” at the next iterator with `iterator.next()`.\n\nThis function is used internally by the `async` module, but can be useful when\nyou want to manually control the flow of functions in series.\n\n__Arguments__\n\n* `tasks` - An array of functions to run.\n\n__Example__\n\n```js\nvar iterator = async.iterator([\n function(){ sys.p('one'); },\n function(){ sys.p('two'); },\n function(){ sys.p('three'); }\n]);\n\nnode> var iterator2 = iterator();\n'one'\nnode> var iterator3 = iterator2();\n'two'\nnode> iterator3();\n'three'\nnode> var nextfn = iterator2.next();\nnode> nextfn();\n'three'\n```\n\n---------------------------------------\n\n\n### apply(function, arguments..)\n\nCreates a continuation function with some arguments already applied.\n\nUseful as a shorthand when combined with other control flow functions. Any arguments\npassed to the returned function are added to the arguments originally passed\nto apply.\n\n__Arguments__\n\n* `function` - The function you want to eventually apply all arguments to.\n* `arguments...` - Any number of arguments to automatically apply when the\n continuation is called.\n\n__Example__\n\n```js\n// using apply\n\nasync.parallel([\n async.apply(fs.writeFile, 'testfile1', 'test1'),\n async.apply(fs.writeFile, 'testfile2', 'test2'),\n]);\n\n\n// the same process without using apply\n\nasync.parallel([\n function(callback){\n fs.writeFile('testfile1', 'test1', callback);\n },\n function(callback){\n fs.writeFile('testfile2', 'test2', callback);\n }\n]);\n```\n\nIt's possible to pass any number of additional arguments when calling the\ncontinuation:\n\n```js\nnode> var fn = async.apply(sys.puts, 'one');\nnode> fn('two', 'three');\none\ntwo\nthree\n```\n\n---------------------------------------\n\n\n### nextTick(callback), setImmediate(callback)\n\nCalls `callback` on a later loop around the event loop. In Node.js this just\ncalls `process.nextTick`; in the browser it falls back to `setImmediate(callback)`\nif available, otherwise `setTimeout(callback, 0)`, which means other higher priority\nevents may precede the execution of `callback`.\n\nThis is used internally for browser-compatibility purposes.\n\n__Arguments__\n\n* `callback` - The function to call on a later loop around the event loop.\n\n__Example__\n\n```js\nvar call_order = [];\nasync.nextTick(function(){\n call_order.push('two');\n // call_order now equals ['one','two']\n});\ncall_order.push('one')\n```\n\n\n### times(n, iterator, [callback])\n\nCalls the `iterator` function `n` times, and accumulates results in the same manner\nyou would use with [`map`](#map).\n\n__Arguments__\n\n* `n` - The number of times to run the function.\n* `iterator` - The function to call `n` times.\n* `callback` - see [`map`](#map)\n\n__Example__\n\n```js\n// Pretend this is some complicated async factory\nvar createUser = function(id, callback) {\n callback(null, {\n id: 'user' + id\n })\n}\n// generate 5 users\nasync.times(5, function(n, next){\n createUser(n, function(err, user) {\n next(err, user)\n })\n}, function(err, users) {\n // we should now have 5 users\n});\n```\n\n__Related__\n\n* timesSeries(n, iterator, [callback])\n* timesLimit(n, limit, iterator, [callback])\n\n\n## Utils\n\n\n### memoize(fn, [hasher])\n\nCaches the results of an `async` function. When creating a hash to store function\nresults against, the callback is omitted from the hash and an optional hash\nfunction can be used.\n\nIf no hash function is specified, the first argument is used as a hash key, which may work reasonably if it is a string or a data type that converts to a distinct string. Note that objects and arrays will not behave reasonably. Neither will cases where the other arguments are significant. In such cases, specify your own hash function.\n\nThe cache of results is exposed as the `memo` property of the function returned\nby `memoize`.\n\n__Arguments__\n\n* `fn` - The function to proxy and cache results from.\n* `hasher` - An optional function for generating a custom hash for storing\n results. It has all the arguments applied to it apart from the callback, and\n must be synchronous.\n\n__Example__\n\n```js\nvar slow_fn = function (name, callback) {\n // do something\n callback(null, result);\n};\nvar fn = async.memoize(slow_fn);\n\n// fn can now be used as if it were slow_fn\nfn('some name', function () {\n // callback\n});\n```\n\n\n### unmemoize(fn)\n\nUndoes a [`memoize`](#memoize)d function, reverting it to the original, unmemoized\nform. Handy for testing.\n\n__Arguments__\n\n* `fn` - the memoized function\n\n---------------------------------------\n\n\n### ensureAsync(fn)\n\nWrap an async function and ensure it calls its callback on a later tick of the event loop. If the function already calls its callback on a next tick, no extra deferral is added. This is useful for preventing stack overflows (`RangeError: Maximum call stack size exceeded`) and generally keeping [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony) contained.\n\n__Arguments__\n\n* `fn` - an async function, one that expects a node-style callback as its last argument\n\nReturns a wrapped function with the exact same call signature as the function passed in.\n\n__Example__\n\n```js\nfunction sometimesAsync(arg, callback) {\n if (cache[arg]) {\n return callback(null, cache[arg]); // this would be synchronous!!\n } else {\n doSomeIO(arg, callback); // this IO would be asynchronous\n }\n}\n\n// this has a risk of stack overflows if many results are cached in a row\nasync.mapSeries(args, sometimesAsync, done);\n\n// this will defer sometimesAsync's callback if necessary,\n// preventing stack overflows\nasync.mapSeries(args, async.ensureAsync(sometimesAsync), done);\n\n```\n\n---------------------------------------\n\n\n### constant(values...)\n\nReturns a function that when called, calls-back with the values provided. Useful as the first function in a `waterfall`, or for plugging values in to `auto`.\n\n__Example__\n\n```js\nasync.waterfall([\n async.constant(42),\n function (value, next) {\n // value === 42\n },\n //...\n], callback);\n\nasync.waterfall([\n async.constant(filename, \"utf8\"),\n fs.readFile,\n function (fileData, next) {\n //...\n }\n //...\n], callback);\n\nasync.auto({\n hostname: async.constant(\"https://server.net/\"),\n port: findFreePort,\n launchServer: [\"hostname\", \"port\", function (cb, options) {\n startServer(options, cb);\n }],\n //...\n}, callback);\n\n```\n\n---------------------------------------\n\n\n\n### asyncify(func)\n\n__Alias:__ `wrapSync`\n\nTake a sync function and make it async, passing its return value to a callback. This is useful for plugging sync functions into a waterfall, series, or other async functions. Any arguments passed to the generated function will be passed to the wrapped function (except for the final callback argument). Errors thrown will be passed to the callback.\n\n__Example__\n\n```js\nasync.waterfall([\n async.apply(fs.readFile, filename, \"utf8\"),\n async.asyncify(JSON.parse),\n function (data, next) {\n // data is the result of parsing the text.\n // If there was a parsing error, it would have been caught.\n }\n], callback)\n```\n\nIf the function passed to `asyncify` returns a Promise, that promises's resolved/rejected state will be used to call the callback, rather than simply the synchronous return value. Example:\n\n```js\nasync.waterfall([\n async.apply(fs.readFile, filename, \"utf8\"),\n async.asyncify(function (contents) {\n return db.model.create(contents);\n }),\n function (model, next) {\n // `model` is the instantiated model object. \n // If there was an error, this function would be skipped.\n }\n], callback)\n```\n\nThis also means you can asyncify ES2016 `async` functions.\n\n```js\nvar q = async.queue(async.asyncify(async function (file) {\n var intermediateStep = await processFile(file);\n return await somePromise(intermediateStep)\n}));\n\nq.push(files);\n```\n\n---------------------------------------\n\n\n### log(function, arguments)\n\nLogs the result of an `async` function to the `console`. Only works in Node.js or\nin browsers that support `console.log` and `console.error` (such as FF and Chrome).\nIf multiple arguments are returned from the async function, `console.log` is\ncalled on each argument in order.\n\n__Arguments__\n\n* `function` - The function you want to eventually apply all arguments to.\n* `arguments...` - Any number of arguments to apply to the function.\n\n__Example__\n\n```js\nvar hello = function(name, callback){\n setTimeout(function(){\n callback(null, 'hello ' + name);\n }, 1000);\n};\n```\n```js\nnode> async.log(hello, 'world');\n'hello world'\n```\n\n---------------------------------------\n\n\n### dir(function, arguments)\n\nLogs the result of an `async` function to the `console` using `console.dir` to\ndisplay the properties of the resulting object. Only works in Node.js or\nin browsers that support `console.dir` and `console.error` (such as FF and Chrome).\nIf multiple arguments are returned from the async function, `console.dir` is\ncalled on each argument in order.\n\n__Arguments__\n\n* `function` - The function you want to eventually apply all arguments to.\n* `arguments...` - Any number of arguments to apply to the function.\n\n__Example__\n\n```js\nvar hello = function(name, callback){\n setTimeout(function(){\n callback(null, {hello: name});\n }, 1000);\n};\n```\n```js\nnode> async.dir(hello, 'world');\n{hello: 'world'}\n```\n\n---------------------------------------\n\n\n### noConflict()\n\nChanges the value of `async` back to its original value, returning a reference to the\n`async` object.\n", + "readmeFilename": "README.md", + "homepage": "https://github.com/caolan/async#readme", + "_id": "async@1.5.2", + "_shasum": "ec6a61ae56480c0c3cb241c95618e20892f9672a", + "_resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "_from": "async@>=1.5.2 <2.0.0" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/form-data/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/form-data/package.json new file mode 100644 index 00000000..a230be3a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/form-data/package.json @@ -0,0 +1,104 @@ +{ + "author": { + "name": "Felix Geisendörfer", + "email": "felix@debuggable.com", + "url": "http://debuggable.com/" + }, + "name": "form-data", + "description": "A library to create readable \"multipart/form-data\" streams. Can be used to submit forms and file uploads to other web applications.", + "version": "1.0.0-rc4", + "repository": { + "type": "git", + "url": "git://github.com/form-data/form-data.git" + }, + "main": "./lib/form_data", + "browser": "./lib/browser", + "scripts": { + "pretest": "rimraf coverage test/tmp", + "test": "istanbul cover --report none test/run.js", + "posttest": "istanbul report", + "lint": "eslint lib/*.js test/*.js test/**/*.js", + "predebug": "rimraf coverage test/tmp", + "debug": "verbose=1 ./test/run.js", + "check": "istanbul check-coverage coverage/coverage*.json", + "coverage": "codacy-coverage < ./coverage/lcov.info; true" + }, + "pre-commit": [ + "lint", + "test", + "check" + ], + "engines": { + "node": ">= 0.10" + }, + "dependencies": { + "async": "^1.5.2", + "combined-stream": "^1.0.5", + "mime-types": "^2.1.10" + }, + "license": "MIT", + "devDependencies": { + "codacy-coverage": "^1.1.3", + "coveralls": "^2.11.8", + "cross-spawn": "^2.1.5", + "eslint": "^2.4.0", + "fake": "^0.2.2", + "far": "^0.0.7", + "formidable": "^1.0.17", + "istanbul": "^0.4.2", + "pre-commit": "^1.1.2", + "request": "^2.69.0", + "rimraf": "^2.5.2" + }, + "gitHead": "f73996e0508ee2d4b2b376276adfac1de4188ac2", + "bugs": { + "url": "https://github.com/form-data/form-data/issues" + }, + "homepage": "https://github.com/form-data/form-data#readme", + "_id": "form-data@1.0.0-rc4", + "_shasum": "05ac6bc22227b43e4461f488161554699d4f8b5e", + "_from": "form-data@>=1.0.0-rc4 <1.1.0", + "_npmVersion": "2.14.9", + "_nodeVersion": "0.12.11", + "_npmUser": { + "name": "alexindigo", + "email": "iam@alexindigo.com" + }, + "dist": { + "shasum": "05ac6bc22227b43e4461f488161554699d4f8b5e", + "tarball": "https://registry.npmjs.org/form-data/-/form-data-1.0.0-rc4.tgz" + }, + "maintainers": [ + { + "name": "felixge", + "email": "felix@debuggable.com" + }, + { + "name": "idralyuk", + "email": "igor@buran.us" + }, + { + "name": "alexindigo", + "email": "iam@alexindigo.com" + }, + { + "name": "mikeal", + "email": "mikeal.rogers@gmail.com" + }, + { + "name": "celer", + "email": "dtyree77@gmail.com" + }, + { + "name": "dylanpiercey", + "email": "pierceydylan@gmail.com" + } + ], + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/form-data-1.0.0-rc4.tgz_1458059747097_0.14101114077493548" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/form-data/-/form-data-1.0.0-rc4.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/form-data/wercker.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/form-data/wercker.yml new file mode 100644 index 00000000..6b118d1e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/form-data/wercker.yml @@ -0,0 +1,36 @@ +# This references the default nodejs container from +# the Docker Hub: https://registry.hub.docker.com/_/node/ +# If you want Nodesource's container you would reference nodesource/node +# Read more about containers on our dev center +# http://devcenter.wercker.com/docs/containers/index.html +box: node +# This is the build pipeline. Pipelines are the core of wercker +# Read more about pipelines on our dev center +# http://devcenter.wercker.com/docs/pipelines/index.html + +# You can also use services such as databases. Read more on our dev center: +# http://devcenter.wercker.com/docs/services/index.html +# services: + # - postgres + # http://devcenter.wercker.com/docs/services/postgresql.html + + # - mongodb + # http://devcenter.wercker.com/docs/services/mongodb.html +build: + # The steps that will be executed on build + # Steps make up the actions in your pipeline + # Read more about steps on our dev center: + # http://devcenter.wercker.com/docs/steps/index.html + steps: + # A step that executes `npm install` command + - npm-install + # A step that executes `npm test` command + - npm-test + + # A custom script step, name value is used in the UI + # and the code value contains the command that get executed + - script: + name: echo nodejs information + code: | + echo "node version $(node -v) running" + echo "npm version $(npm -v) running" diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/LICENSE new file mode 100644 index 00000000..ca55c91a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2015, Ahmad Nassri + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/README.md new file mode 100644 index 00000000..91526e6d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/README.md @@ -0,0 +1,309 @@ +# HAR Validator [![version][npm-version]][npm-url] [![License][npm-license]][license-url] + +Extremely fast HTTP Archive ([HAR](http://www.softwareishard.com/blog/har-12-spec/)) validator using JSON Schema. + +[![Build Status][travis-image]][travis-url] +[![Downloads][npm-downloads]][npm-url] +[![Code Climate][codeclimate-quality]][codeclimate-url] +[![Coverage Status][codeclimate-coverage]][codeclimate-url] +[![Dependencies][david-image]][david-url] + +## Install + +```shell +# to use in cli +npm install --global har-validator + +# to use as a module +npm install --save har-validator +``` + +## Usage + +``` + + Usage: har-validator [options] + + Options: + + -h, --help output usage information + -V, --version output the version number + -s, --schema [name] validate schema name (log, request, response, etc ...) + +``` + +###### Example + +```shell +har-validator har.json + +har-validator --schema request request.json +``` + +## API + +**Note**: as of [`v2.0.0`](https://github.com/ahmadnassri/har-validator/releases/tag/v2.0.0) this module defaults to Promise based API. *For backward comptability with `v1.x` an [async/callback API](#callback-api) is provided* + +### Validate(data) + +> Returns a promise that resolves to the valid object. + +- **data**: `Object` *(Required)* + a full [HAR](http://www.softwareishard.com/blog/har-12-spec/) object + +```js +validate(data) + .then(data => console.log('horray!')) + .catch(console.error) +``` + +### Validate.log(data) + +> Returns a promise that resolves to the valid object. + +- **data**: `Object` *(Required)* + a [log](http://www.softwareishard.com/blog/har-12-spec/#log) object + +```js +validate.log(data) + .then(data => console.log('horray!')) + .catch(console.error) +``` + +### Validate.cache(data) + +> Returns a promise that resolves to the valid object. + +- **data**: `Object` *(Required)* + a [cache](http://www.softwareishard.com/blog/har-12-spec/#cache) object + +```js +validate.cache(data) + .then(data => console.log('horray!')) + .catch(console.error) +``` + +### Validate.cacheEntry(data) + +> Returns a promise that resolves to the valid object. + +- **data**: `Object` *(Required)* + a ["beforeRequest" or "afterRequest"](http://www.softwareishard.com/blog/har-12-spec/#cache) objects + +```js +validate.cacheEntry(data) + .then(data => console.log('horray!')) + .catch(console.error) +``` + +### Validate.content(data) + +> Returns a promise that resolves to the valid object. + +- **data**: `Object` *(Required)* + a [content](http://www.softwareishard.com/blog/har-12-spec/#content) object + +```js +validate.content(data) + .then(data => console.log('horray!')) + .catch(console.error) +``` + +### Validate.cookie(data) + +> Returns a promise that resolves to the valid object. + +- **data**: `Object` *(Required)* + a [cookie](http://www.softwareishard.com/blog/har-12-spec/#cookies) object + +```js +validate.cookie(data) + .then(data => console.log('horray!')) + .catch(console.error) +``` + +### Validate.creator(data) + +> Returns a promise that resolves to the valid object. + +- **data**: `Object` *(Required)* + a [creator](http://www.softwareishard.com/blog/har-12-spec/#creator) object + +```js +validate.creator(data) + .then(data => console.log('horray!')) + .catch(console.error) +``` + +### Validate.entry(data) + +> Returns a promise that resolves to the valid object. + +- **data**: `Object` *(Required)* + an [entry](http://www.softwareishard.com/blog/har-12-spec/#entries) object + +```js +validate.entry(data) + .then(data => console.log('horray!')) + .catch(console.error) +``` + +### Validate.log(data) + +alias of [`Validate(data)`](#validate-data-callback-) + +### Validate.page(data) + +> Returns a promise that resolves to the valid object. + +- **data**: `Object` *(Required)* + a [page](http://www.softwareishard.com/blog/har-12-spec/#pages) object + +```js +validate.page(data) + .then(data => console.log('horray!')) + .catch(console.error) +``` + +### Validate.pageTimings(data) + +> Returns a promise that resolves to the valid object. + +- **data**: `Object` *(Required)* + a [pageTimings](http://www.softwareishard.com/blog/har-12-spec/#pageTimings) object + +```js +validate.pageTimings(data) + .then(data => console.log('horray!')) + .catch(console.error) +``` + +### Validate.postData(data) + +> Returns a promise that resolves to the valid object. + +- **data**: `Object` *(Required)* + a [postData](http://www.softwareishard.com/blog/har-12-spec/#postData) object + +```js +validate.postData(data) + .then(data => console.log('horray!')) + .catch(console.error) +``` + +### Validate.record(data) + +> Returns a promise that resolves to the valid object. + +- **data**: `Object` *(Required)* + a [record](http://www.softwareishard.com/blog/har-12-spec/#headers) object + +```js +validate.record(data) + .then(data => console.log('horray!')) + .catch(console.error) +``` + +### Validate.request(data) + +> Returns a promise that resolves to the valid object. + +- **data**: `Object` *(Required)* + a [request](http://www.softwareishard.com/blog/har-12-spec/#request) object + +```js +validate.request(data) + .then(data => console.log('horray!')) + .catch(console.error) +``` + +### Validate.response(data) + +> Returns a promise that resolves to the valid object. + +- **data**: `Object` *(Required)* + a [response](http://www.softwareishard.com/blog/har-12-spec/#response) object + +```js +validate.cacheEntry(data) + .then(data => console.log('horray!')) + .catch(console.error) +``` + +### Validate.timings(data) + +> Returns a promise that resolves to the valid object. + +- **data**: `Object` *(Required)* + a [timings](http://www.softwareishard.com/blog/har-12-spec/#timings) object + +```js +validate.timings(data) + .then(data => console.log('horray!')) + .catch(console.error) +``` + +---- + +## Callback API + +### Validate(data [, callback]) + +> Returns `true` or `false`. + +```js +var HAR = require('./har.json'); +var validate = require('har-validator/lib/async'); + +validate(HAR, function (e, valid) { + if (e) console.log(e.errors) + + if (valid) console.log('horray!'); +}); + +``` +The async API provides exactly the same methods as the [Promise API](#promise-api) + +---- + +## Support + +Donations are welcome to help support the continuous development of this project. + +[![Gratipay][gratipay-image]][gratipay-url] +[![PayPal][paypal-image]][paypal-url] +[![Flattr][flattr-image]][flattr-url] +[![Bitcoin][bitcoin-image]][bitcoin-url] + +## License + +[ISC License](LICENSE) © [Ahmad Nassri](https://www.ahmadnassri.com/) + +[license-url]: https://github.com/ahmadnassri/har-validator/blob/master/LICENSE + +[travis-url]: https://travis-ci.org/ahmadnassri/har-validator +[travis-image]: https://img.shields.io/travis/ahmadnassri/har-validator.svg?style=flat-square + +[npm-url]: https://www.npmjs.com/package/har-validator +[npm-license]: https://img.shields.io/npm/l/har-validator.svg?style=flat-square +[npm-version]: https://img.shields.io/npm/v/har-validator.svg?style=flat-square +[npm-downloads]: https://img.shields.io/npm/dm/har-validator.svg?style=flat-square + +[codeclimate-url]: https://codeclimate.com/github/ahmadnassri/har-validator +[codeclimate-quality]: https://img.shields.io/codeclimate/github/ahmadnassri/har-validator.svg?style=flat-square +[codeclimate-coverage]: https://img.shields.io/codeclimate/coverage/github/ahmadnassri/har-validator.svg?style=flat-square + +[david-url]: https://david-dm.org/ahmadnassri/har-validator +[david-image]: https://img.shields.io/david/ahmadnassri/har-validator.svg?style=flat-square + +[gratipay-url]: https://www.gratipay.com/ahmadnassri/ +[gratipay-image]: https://img.shields.io/gratipay/ahmadnassri.svg?style=flat-square + +[paypal-url]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UJ2B2BTK9VLRS&on0=project&os0=har-validator +[paypal-image]: http://img.shields.io/badge/paypal-donate-green.svg?style=flat-square + +[flattr-url]: https://flattr.com/submit/auto?user_id=ahmadnassri&url=https://github.com/ahmadnassri/har-validator&title=har-validator&language=&tags=github&category=software +[flattr-image]: http://img.shields.io/badge/flattr-donate-green.svg?style=flat-square + +[bitcoin-image]: http://img.shields.io/badge/bitcoin-1Nb46sZRVG3or7pNaDjthcGJpWhvoPpCxy-green.svg?style=flat-square +[bitcoin-url]: https://www.coinbase.com/checkouts/ae383ae6bb931a2fa5ad11cec115191e?name=har-validator diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/async.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/async.js new file mode 100644 index 00000000..77b99a7d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/async.js @@ -0,0 +1,14 @@ +'use strict' + +var runner = require('./runner') +var schemas = require('./schemas') + +module.exports = function (data, cb) { + return runner(schemas.har, data, cb) +} + +Object.keys(schemas).map(function (name) { + module.exports[name] = function (data, cb) { + return runner(schemas[name], data, cb) + } +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/error.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/error.js new file mode 100644 index 00000000..fc08a872 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/error.js @@ -0,0 +1,10 @@ +'use strict' + +function ValidationError (errors) { + this.name = 'ValidationError' + this.errors = errors +} + +ValidationError.prototype = Error.prototype + +module.exports = ValidationError diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/index.js new file mode 100644 index 00000000..e8351b8d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/index.js @@ -0,0 +1,22 @@ +'use strict' + +var Promise = require('pinkie-promise') +var runner = require('./runner') +var schemas = require('./schemas') + +var promisify = function (schema) { + return function (data) { + return new Promise(function (resolve, reject) { + runner(schema, data, function (err, valid) { + return err === null ? resolve(data) : reject(err) + }) + }) + } +} + +module.exports = promisify(schemas.har) + +// utility methods for all parts of the schema +Object.keys(schemas).map(function (name) { + module.exports[name] = promisify(schemas[name]) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/runner.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/runner.js new file mode 100644 index 00000000..f0ed484e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/runner.js @@ -0,0 +1,29 @@ +'use strict' + +var schemas = require('./schemas') +var ValidationError = require('./error') +var validator = require('is-my-json-valid') + +module.exports = function (schema, data, cb) { + // default value + var valid = false + + // validator config + var validate = validator(schema, { + greedy: true, + verbose: true, + schemas: schemas + }) + + // execute is-my-json-valid + if (data !== undefined) { + valid = validate(data) + } + + // callback? + if (typeof cb === 'function') { + return cb(validate.errors ? new ValidationError(validate.errors) : null, valid) + } + + return valid +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/cache.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/cache.json new file mode 100644 index 00000000..a3ab682d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/cache.json @@ -0,0 +1,13 @@ +{ + "properties": { + "beforeRequest": { + "$ref": "#cacheEntry" + }, + "afterRequest": { + "$ref": "#cacheEntry" + }, + "comment": { + "type": "string" + } + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/cacheEntry.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/cacheEntry.json new file mode 100644 index 00000000..a397439f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/cacheEntry.json @@ -0,0 +1,31 @@ +{ + "oneOf": [{ + "type": "object", + "optional": true, + "required": [ + "lastAccess", + "eTag", + "hitCount" + ], + "properties": { + "expires": { + "type": "string" + }, + "lastAccess": { + "type": "string" + }, + "eTag": { + "type": "string" + }, + "hitCount": { + "type": "integer" + }, + "comment": { + "type": "string" + } + } + }, { + "type": null, + "additionalProperties": false + }] +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/content.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/content.json new file mode 100644 index 00000000..3710d793 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/content.json @@ -0,0 +1,27 @@ +{ + "type": "object", + "required": [ + "size", + "mimeType" + ], + "properties": { + "size": { + "type": "integer" + }, + "compression": { + "type": "integer" + }, + "mimeType": { + "type": "string" + }, + "text": { + "type": "string" + }, + "encoding": { + "type": "string" + }, + "comment": { + "type": "string" + } + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/cookie.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/cookie.json new file mode 100644 index 00000000..57681818 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/cookie.json @@ -0,0 +1,34 @@ +{ + "type": "object", + "required": [ + "name", + "value" + ], + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + }, + "path": { + "type": "string" + }, + "domain": { + "type": "string" + }, + "expires": { + "type": ["string", "null"], + "format": "date-time" + }, + "httpOnly": { + "type": "boolean" + }, + "secure": { + "type": "boolean" + }, + "comment": { + "type": "string" + } + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/creator.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/creator.json new file mode 100644 index 00000000..50586006 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/creator.json @@ -0,0 +1,18 @@ +{ + "type": "object", + "required": [ + "name", + "version" + ], + "properties": { + "name": { + "type": "string" + }, + "version": { + "type": "string" + }, + "comment": { + "type": "string" + } + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/entry.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/entry.json new file mode 100644 index 00000000..8a9c022b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/entry.json @@ -0,0 +1,51 @@ +{ + "type": "object", + "optional": true, + "required": [ + "startedDateTime", + "time", + "request", + "response", + "cache", + "timings" + ], + "properties": { + "pageref": { + "type": "string" + }, + "startedDateTime": { + "type": "string", + "format": "date-time", + "pattern": "^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))" + }, + "time": { + "type": "number", + "min": 0 + }, + "request": { + "$ref": "#request" + }, + "response": { + "$ref": "#response" + }, + "cache": { + "$ref": "#cache" + }, + "timings": { + "$ref": "#timings" + }, + "serverIPAddress": { + "type": "string", + "oneOf": [ + { "format": "ipv4" }, + { "format": "ipv6" } + ] + }, + "connection": { + "type": "string" + }, + "comment": { + "type": "string" + } + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/har.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/har.json new file mode 100644 index 00000000..b542782d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/har.json @@ -0,0 +1,11 @@ +{ + "type": "object", + "required": [ + "log" + ], + "properties": { + "log": { + "$ref": "#log" + } + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/index.js new file mode 100644 index 00000000..7b6db7da --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/index.js @@ -0,0 +1,49 @@ +'use strict' + +var schemas = { + cache: require('./cache.json'), + cacheEntry: require('./cacheEntry.json'), + content: require('./content.json'), + cookie: require('./cookie.json'), + creator: require('./creator.json'), + entry: require('./entry.json'), + har: require('./har.json'), + log: require('./log.json'), + page: require('./page.json'), + pageTimings: require('./pageTimings.json'), + postData: require('./postData.json'), + record: require('./record.json'), + request: require('./request.json'), + response: require('./response.json'), + timings: require('./timings.json') +} + +// is-my-json-valid does not provide meaningful error messages for external schemas +// this is a workaround +schemas.cache.properties.beforeRequest = schemas.cacheEntry +schemas.cache.properties.afterRequest = schemas.cacheEntry + +schemas.page.properties.pageTimings = schemas.pageTimings + +schemas.request.properties.cookies.items = schemas.cookie +schemas.request.properties.headers.items = schemas.record +schemas.request.properties.queryString.items = schemas.record +schemas.request.properties.postData = schemas.postData + +schemas.response.properties.cookies.items = schemas.cookie +schemas.response.properties.headers.items = schemas.record +schemas.response.properties.content = schemas.content + +schemas.entry.properties.request = schemas.request +schemas.entry.properties.response = schemas.response +schemas.entry.properties.cache = schemas.cache +schemas.entry.properties.timings = schemas.timings + +schemas.log.properties.creator = schemas.creator +schemas.log.properties.browser = schemas.creator +schemas.log.properties.pages.items = schemas.page +schemas.log.properties.entries.items = schemas.entry + +schemas.har.properties.log = schemas.log + +module.exports = schemas diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/log.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/log.json new file mode 100644 index 00000000..0c91d38b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/log.json @@ -0,0 +1,34 @@ +{ + "type": "object", + "required": [ + "version", + "creator", + "entries" + ], + "properties": { + "version": { + "type": "string" + }, + "creator": { + "$ref": "#creator" + }, + "browser": { + "$ref": "#creator" + }, + "pages": { + "type": "array", + "items": { + "$ref": "#page" + } + }, + "entries": { + "type": "array", + "items": { + "$ref": "#entry" + } + }, + "comment": { + "type": "string" + } + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/page.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/page.json new file mode 100644 index 00000000..ef64abe5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/page.json @@ -0,0 +1,30 @@ +{ + "type": "object", + "optional": true, + "required": [ + "startedDateTime", + "id", + "title", + "pageTimings" + ], + "properties": { + "startedDateTime": { + "type": "string", + "format": "date-time", + "pattern": "^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))" + }, + "id": { + "type": "string", + "unique": true + }, + "title": { + "type": "string" + }, + "pageTimings": { + "$ref": "#pageTimings" + }, + "comment": { + "type": "string" + } + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/pageTimings.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/pageTimings.json new file mode 100644 index 00000000..adc83ccc --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/pageTimings.json @@ -0,0 +1,16 @@ +{ + "type": "object", + "properties": { + "onContentLoad": { + "type": "number", + "min": -1 + }, + "onLoad": { + "type": "number", + "min": -1 + }, + "comment": { + "type": "string" + } + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/postData.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/postData.json new file mode 100644 index 00000000..91958b64 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/postData.json @@ -0,0 +1,41 @@ +{ + "type": "object", + "optional": true, + "required": [ + "mimeType" + ], + "properties": { + "mimeType": { + "type": "string" + }, + "text": { + "type": "string" + }, + "params": { + "type": "array", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + }, + "fileName": { + "type": "string" + }, + "contentType": { + "type": "string" + }, + "comment": { + "type": "string" + } + } + }, + "comment": { + "type": "string" + } + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/record.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/record.json new file mode 100644 index 00000000..04acd519 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/record.json @@ -0,0 +1,18 @@ +{ + "type": "object", + "required": [ + "name", + "value" + ], + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + }, + "comment": { + "type": "string" + } + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/request.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/request.json new file mode 100644 index 00000000..639af06d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/request.json @@ -0,0 +1,55 @@ +{ + "type": "object", + "required": [ + "method", + "url", + "httpVersion", + "cookies", + "headers", + "queryString", + "headersSize", + "bodySize" + ], + "properties": { + "method": { + "type": "string" + }, + "url": { + "type": "string", + "format": "uri" + }, + "httpVersion": { + "type": "string" + }, + "cookies": { + "type": "array", + "items": { + "$ref": "#cookie" + } + }, + "headers": { + "type": "array", + "items": { + "$ref": "#record" + } + }, + "queryString": { + "type": "array", + "items": { + "$ref": "#record" + } + }, + "postData": { + "$ref": "#postData" + }, + "headersSize": { + "type": "integer" + }, + "bodySize": { + "type": "integer" + }, + "comment": { + "type": "string" + } + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/response.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/response.json new file mode 100644 index 00000000..de99c55b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/response.json @@ -0,0 +1,52 @@ +{ + "type": "object", + "required": [ + "status", + "statusText", + "httpVersion", + "cookies", + "headers", + "content", + "redirectURL", + "headersSize", + "bodySize" + ], + "properties": { + "status": { + "type": "integer" + }, + "statusText": { + "type": "string" + }, + "httpVersion": { + "type": "string" + }, + "cookies": { + "type": "array", + "items": { + "$ref": "#cookie" + } + }, + "headers": { + "type": "array", + "items": { + "$ref": "#record" + } + }, + "content": { + "$ref": "#content" + }, + "redirectURL": { + "type": "string" + }, + "headersSize": { + "type": "integer" + }, + "bodySize": { + "type": "integer" + }, + "comment": { + "type": "string" + } + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/timings.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/timings.json new file mode 100644 index 00000000..066ef71a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/lib/schemas/timings.json @@ -0,0 +1,40 @@ +{ + "required": [ + "send", + "wait", + "receive" + ], + "properties": { + "dns": { + "type": "number", + "min": -1 + }, + "connect": { + "type": "number", + "min": -1 + }, + "blocked": { + "type": "number", + "min": -1 + }, + "send": { + "type": "number", + "min": -1 + }, + "wait": { + "type": "number", + "min": -1 + }, + "receive": { + "type": "number", + "min": -1 + }, + "ssl": { + "type": "number", + "min": -1 + }, + "comment": { + "type": "string" + } + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/index.js new file mode 100644 index 00000000..2d85a917 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/index.js @@ -0,0 +1,116 @@ +'use strict'; +var escapeStringRegexp = require('escape-string-regexp'); +var ansiStyles = require('ansi-styles'); +var stripAnsi = require('strip-ansi'); +var hasAnsi = require('has-ansi'); +var supportsColor = require('supports-color'); +var defineProps = Object.defineProperties; +var isSimpleWindowsTerm = process.platform === 'win32' && !/^xterm/i.test(process.env.TERM); + +function Chalk(options) { + // detect mode if not set manually + this.enabled = !options || options.enabled === undefined ? supportsColor : options.enabled; +} + +// use bright blue on Windows as the normal blue color is illegible +if (isSimpleWindowsTerm) { + ansiStyles.blue.open = '\u001b[94m'; +} + +var styles = (function () { + var ret = {}; + + Object.keys(ansiStyles).forEach(function (key) { + ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g'); + + ret[key] = { + get: function () { + return build.call(this, this._styles.concat(key)); + } + }; + }); + + return ret; +})(); + +var proto = defineProps(function chalk() {}, styles); + +function build(_styles) { + var builder = function () { + return applyStyle.apply(builder, arguments); + }; + + builder._styles = _styles; + builder.enabled = this.enabled; + // __proto__ is used because we must return a function, but there is + // no way to create a function with a different prototype. + /* eslint-disable no-proto */ + builder.__proto__ = proto; + + return builder; +} + +function applyStyle() { + // support varags, but simply cast to string in case there's only one arg + var args = arguments; + var argsLen = args.length; + var str = argsLen !== 0 && String(arguments[0]); + + if (argsLen > 1) { + // don't slice `arguments`, it prevents v8 optimizations + for (var a = 1; a < argsLen; a++) { + str += ' ' + args[a]; + } + } + + if (!this.enabled || !str) { + return str; + } + + var nestedStyles = this._styles; + var i = nestedStyles.length; + + // Turns out that on Windows dimmed gray text becomes invisible in cmd.exe, + // see https://github.com/chalk/chalk/issues/58 + // If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop. + var originalDim = ansiStyles.dim.open; + if (isSimpleWindowsTerm && (nestedStyles.indexOf('gray') !== -1 || nestedStyles.indexOf('grey') !== -1)) { + ansiStyles.dim.open = ''; + } + + while (i--) { + var code = ansiStyles[nestedStyles[i]]; + + // Replace any instances already present with a re-opening code + // otherwise only the part of the string until said closing code + // will be colored, and the rest will simply be 'plain'. + str = code.open + str.replace(code.closeRe, code.open) + code.close; + } + + // Reset the original 'dim' if we changed it to work around the Windows dimmed gray issue. + ansiStyles.dim.open = originalDim; + + return str; +} + +function init() { + var ret = {}; + + Object.keys(styles).forEach(function (name) { + ret[name] = { + get: function () { + return build.call(this, [name]); + } + }; + }); + + return ret; +} + +defineProps(Chalk.prototype, init()); + +module.exports = new Chalk(); +module.exports.styles = ansiStyles; +module.exports.hasColor = hasAnsi; +module.exports.stripColor = stripAnsi; +module.exports.supportsColor = supportsColor; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/license b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/index.js new file mode 100644 index 00000000..78945278 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/index.js @@ -0,0 +1,65 @@ +'use strict'; + +function assembleStyles () { + var styles = { + modifiers: { + reset: [0, 0], + bold: [1, 22], // 21 isn't widely supported and 22 does the same thing + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29] + }, + colors: { + black: [30, 39], + red: [31, 39], + green: [32, 39], + yellow: [33, 39], + blue: [34, 39], + magenta: [35, 39], + cyan: [36, 39], + white: [37, 39], + gray: [90, 39] + }, + bgColors: { + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49] + } + }; + + // fix humans + styles.colors.grey = styles.colors.gray; + + Object.keys(styles).forEach(function (groupName) { + var group = styles[groupName]; + + Object.keys(group).forEach(function (styleName) { + var style = group[styleName]; + + styles[styleName] = group[styleName] = { + open: '\u001b[' + style[0] + 'm', + close: '\u001b[' + style[1] + 'm' + }; + }); + + Object.defineProperty(styles, groupName, { + value: group, + enumerable: false + }); + }); + + return styles; +} + +Object.defineProperty(module, 'exports', { + enumerable: true, + get: assembleStyles +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/license b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/package.json new file mode 100644 index 00000000..de25e5c3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/package.json @@ -0,0 +1,80 @@ +{ + "name": "ansi-styles", + "version": "2.2.1", + "description": "ANSI escape codes for styling strings in the terminal", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/ansi-styles.git" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha" + }, + "files": [ + "index.js" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "devDependencies": { + "mocha": "*" + }, + "gitHead": "95c59b23be760108b6530ca1c89477c21b258032", + "bugs": { + "url": "https://github.com/chalk/ansi-styles/issues" + }, + "homepage": "https://github.com/chalk/ansi-styles#readme", + "_id": "ansi-styles@2.2.1", + "_shasum": "b432dd3358b634cf75e1e4664368240533c1ddbe", + "_from": "ansi-styles@>=2.2.1 <3.0.0", + "_npmVersion": "3.8.3", + "_nodeVersion": "4.3.0", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "dist": { + "shasum": "b432dd3358b634cf75e1e4664368240533c1ddbe", + "tarball": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz" + }, + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/ansi-styles-2.2.1.tgz_1459197317833_0.9694824463222176" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/readme.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/readme.md new file mode 100644 index 00000000..3f933f61 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/readme.md @@ -0,0 +1,86 @@ +# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles) + +> [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal + +You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings. + +![](screenshot.png) + + +## Install + +``` +$ npm install --save ansi-styles +``` + + +## Usage + +```js +var ansi = require('ansi-styles'); + +console.log(ansi.green.open + 'Hello world!' + ansi.green.close); +``` + + +## API + +Each style has an `open` and `close` property. + + +## Styles + +### Modifiers + +- `reset` +- `bold` +- `dim` +- `italic` *(not widely supported)* +- `underline` +- `inverse` +- `hidden` +- `strikethrough` *(not widely supported)* + +### Colors + +- `black` +- `red` +- `green` +- `yellow` +- `blue` +- `magenta` +- `cyan` +- `white` +- `gray` + +### Background colors + +- `bgBlack` +- `bgRed` +- `bgGreen` +- `bgYellow` +- `bgBlue` +- `bgMagenta` +- `bgCyan` +- `bgWhite` + + +## Advanced usage + +By default you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module. + +- `ansi.modifiers` +- `ansi.colors` +- `ansi.bgColors` + + +###### Example + +```js +console.log(ansi.colors.green.open); +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/index.js new file mode 100644 index 00000000..7834bf9b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/index.js @@ -0,0 +1,11 @@ +'use strict'; + +var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; + +module.exports = function (str) { + if (typeof str !== 'string') { + throw new TypeError('Expected a string'); + } + + return str.replace(matchOperatorsRe, '\\$&'); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/license b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json new file mode 100644 index 00000000..7714d5d1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json @@ -0,0 +1,75 @@ +{ + "name": "escape-string-regexp", + "version": "1.0.5", + "description": "Escape RegExp special characters", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/escape-string-regexp.git" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "jbnicolai", + "email": "jappelman@xebia.com" + } + ], + "engines": { + "node": ">=0.8.0" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js" + ], + "keywords": [ + "escape", + "regex", + "regexp", + "re", + "regular", + "expression", + "string", + "str", + "special", + "characters" + ], + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "gitHead": "db124a3e1aae9d692c4899e42a5c6c3e329eaa20", + "bugs": { + "url": "https://github.com/sindresorhus/escape-string-regexp/issues" + }, + "homepage": "https://github.com/sindresorhus/escape-string-regexp", + "_id": "escape-string-regexp@1.0.5", + "_shasum": "1b61c0562190a8dff6ae3bb2cf0200ca130b86d4", + "_from": "escape-string-regexp@>=1.0.2 <2.0.0", + "_npmVersion": "2.14.12", + "_nodeVersion": "4.2.6", + "_npmUser": { + "name": "jbnicolai", + "email": "jappelman@xebia.com" + }, + "dist": { + "shasum": "1b61c0562190a8dff6ae3bb2cf0200ca130b86d4", + "tarball": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz" + }, + "_npmOperationalInternal": { + "host": "packages-9-west.internal.npmjs.com", + "tmp": "tmp/escape-string-regexp-1.0.5.tgz_1456059312074_0.7245344955008477" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/readme.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/readme.md new file mode 100644 index 00000000..87ac82d5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/readme.md @@ -0,0 +1,27 @@ +# escape-string-regexp [![Build Status](https://travis-ci.org/sindresorhus/escape-string-regexp.svg?branch=master)](https://travis-ci.org/sindresorhus/escape-string-regexp) + +> Escape RegExp special characters + + +## Install + +``` +$ npm install --save escape-string-regexp +``` + + +## Usage + +```js +const escapeStringRegexp = require('escape-string-regexp'); + +const escapedString = escapeStringRegexp('how much $ for a unicorn?'); +//=> 'how much \$ for a unicorn\?' + +new RegExp(escapedString); +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/index.js new file mode 100644 index 00000000..98fae067 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/index.js @@ -0,0 +1,4 @@ +'use strict'; +var ansiRegex = require('ansi-regex'); +var re = new RegExp(ansiRegex().source); // remove the `g` flag +module.exports = re.test.bind(re); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/license b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/package.json new file mode 100644 index 00000000..443129da --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/package.json @@ -0,0 +1,85 @@ +{ + "name": "has-ansi", + "version": "2.0.0", + "description": "Check if a string has ANSI escape codes", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/has-ansi.git" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "jbnicolai", + "email": "jappelman@xebia.com" + } + ], + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "node test.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "string", + "tty", + "escape", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern", + "has" + ], + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "devDependencies": { + "ava": "0.0.4" + }, + "gitHead": "0722275e1bef139fcd09137da6e5550c3cd368b9", + "bugs": { + "url": "https://github.com/sindresorhus/has-ansi/issues" + }, + "homepage": "https://github.com/sindresorhus/has-ansi", + "_id": "has-ansi@2.0.0", + "_shasum": "34f5049ce1ecdf2b0649af3ef24e45ed35416d91", + "_from": "has-ansi@>=2.0.0 <3.0.0", + "_npmVersion": "2.11.2", + "_nodeVersion": "0.12.5", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "dist": { + "shasum": "34f5049ce1ecdf2b0649af3ef24e45ed35416d91", + "tarball": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/readme.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/readme.md new file mode 100644 index 00000000..02bc7c23 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/readme.md @@ -0,0 +1,36 @@ +# has-ansi [![Build Status](https://travis-ci.org/sindresorhus/has-ansi.svg?branch=master)](https://travis-ci.org/sindresorhus/has-ansi) + +> Check if a string has [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) + + +## Install + +``` +$ npm install --save has-ansi +``` + + +## Usage + +```js +var hasAnsi = require('has-ansi'); + +hasAnsi('\u001b[4mcake\u001b[0m'); +//=> true + +hasAnsi('cake'); +//=> false +``` + + +## Related + +- [has-ansi-cli](https://github.com/sindresorhus/has-ansi-cli) - CLI for this module +- [strip-ansi](https://github.com/sindresorhus/strip-ansi) - Strip ANSI escape codes +- [ansi-regex](https://github.com/sindresorhus/ansi-regex) - Regular expression for matching ANSI escape codes +- [chalk](https://github.com/sindresorhus/chalk) - Terminal string styling done right + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/index.js new file mode 100644 index 00000000..4346e272 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/index.js @@ -0,0 +1,50 @@ +'use strict'; +var argv = process.argv; + +var terminator = argv.indexOf('--'); +var hasFlag = function (flag) { + flag = '--' + flag; + var pos = argv.indexOf(flag); + return pos !== -1 && (terminator !== -1 ? pos < terminator : true); +}; + +module.exports = (function () { + if ('FORCE_COLOR' in process.env) { + return true; + } + + if (hasFlag('no-color') || + hasFlag('no-colors') || + hasFlag('color=false')) { + return false; + } + + if (hasFlag('color') || + hasFlag('colors') || + hasFlag('color=true') || + hasFlag('color=always')) { + return true; + } + + if (process.stdout && !process.stdout.isTTY) { + return false; + } + + if (process.platform === 'win32') { + return true; + } + + if ('COLORTERM' in process.env) { + return true; + } + + if (process.env.TERM === 'dumb') { + return false; + } + + if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) { + return true; + } + + return false; +})(); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/license b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/package.json new file mode 100644 index 00000000..cf1119fe --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/package.json @@ -0,0 +1,79 @@ +{ + "name": "supports-color", + "version": "2.0.0", + "description": "Detect whether a terminal supports color", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/supports-color.git" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "jbnicolai", + "email": "jappelman@xebia.com" + } + ], + "engines": { + "node": ">=0.8.0" + }, + "scripts": { + "test": "mocha" + }, + "files": [ + "index.js" + ], + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "ansi", + "styles", + "tty", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "support", + "supports", + "capability", + "detect" + ], + "devDependencies": { + "mocha": "*", + "require-uncached": "^1.0.2" + }, + "gitHead": "8400d98ade32b2adffd50902c06d9e725a5c6588", + "bugs": { + "url": "https://github.com/chalk/supports-color/issues" + }, + "homepage": "https://github.com/chalk/supports-color", + "_id": "supports-color@2.0.0", + "_shasum": "535d045ce6b6363fa40117084629995e9df324c7", + "_from": "supports-color@>=2.0.0 <3.0.0", + "_npmVersion": "2.11.2", + "_nodeVersion": "0.12.5", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "dist": { + "shasum": "535d045ce6b6363fa40117084629995e9df324c7", + "tarball": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/readme.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/readme.md new file mode 100644 index 00000000..b4761f1e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/readme.md @@ -0,0 +1,36 @@ +# supports-color [![Build Status](https://travis-ci.org/chalk/supports-color.svg?branch=master)](https://travis-ci.org/chalk/supports-color) + +> Detect whether a terminal supports color + + +## Install + +``` +$ npm install --save supports-color +``` + + +## Usage + +```js +var supportsColor = require('supports-color'); + +if (supportsColor) { + console.log('Terminal supports color'); +} +``` + +It obeys the `--color` and `--no-color` CLI flags. + +For situations where using `--color` is not possible, add an environment variable `FORCE_COLOR` with any value to force color. Trumps `--no-color`. + + +## Related + +- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module +- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/package.json new file mode 100644 index 00000000..d96edabd --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/package.json @@ -0,0 +1,107 @@ +{ + "name": "chalk", + "version": "1.1.3", + "description": "Terminal string styling done right. Much color.", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/chalk.git" + }, + "maintainers": [ + { + "name": "qix", + "email": "i.am.qix@gmail.com" + }, + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "unicorn", + "email": "sindresorhus+unicorn@gmail.com" + } + ], + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "xo && mocha", + "bench": "matcha benchmark.js", + "coverage": "nyc npm test && nyc report", + "coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls" + }, + "files": [ + "index.js" + ], + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "str", + "ansi", + "style", + "styles", + "tty", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + }, + "devDependencies": { + "coveralls": "^2.11.2", + "matcha": "^0.6.0", + "mocha": "*", + "nyc": "^3.0.0", + "require-uncached": "^1.0.2", + "resolve-from": "^1.0.0", + "semver": "^4.3.3", + "xo": "*" + }, + "xo": { + "envs": [ + "node", + "mocha" + ] + }, + "gitHead": "0d8d8c204eb87a4038219131ad4d8369c9f59d24", + "bugs": { + "url": "https://github.com/chalk/chalk/issues" + }, + "homepage": "https://github.com/chalk/chalk#readme", + "_id": "chalk@1.1.3", + "_shasum": "a8115c55e4a702fe4d150abd3872822a7e09fc98", + "_from": "chalk@>=1.1.1 <2.0.0", + "_npmVersion": "2.14.2", + "_nodeVersion": "0.10.32", + "_npmUser": { + "name": "qix", + "email": "i.am.qix@gmail.com" + }, + "dist": { + "shasum": "a8115c55e4a702fe4d150abd3872822a7e09fc98", + "tarball": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz" + }, + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/chalk-1.1.3.tgz_1459210604109_0.3892582862172276" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/readme.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/readme.md new file mode 100644 index 00000000..5cf111e3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/readme.md @@ -0,0 +1,213 @@ +

      +
      +
      + chalk +
      +
      +
      +

      + +> Terminal string styling done right + +[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) +[![Coverage Status](https://coveralls.io/repos/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/r/chalk/chalk?branch=master) +[![](http://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) + + +[colors.js](https://github.com/Marak/colors.js) used to be the most popular string styling module, but it has serious deficiencies like extending `String.prototype` which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68). Although there are other ones, they either do too much or not enough. + +**Chalk is a clean and focused alternative.** + +![](https://github.com/chalk/ansi-styles/raw/master/screenshot.png) + + +## Why + +- Highly performant +- Doesn't extend `String.prototype` +- Expressive API +- Ability to nest styles +- Clean and focused +- Auto-detects color support +- Actively maintained +- [Used by ~4500 modules](https://www.npmjs.com/browse/depended/chalk) as of July 15, 2015 + + +## Install + +``` +$ npm install --save chalk +``` + + +## Usage + +Chalk comes with an easy to use composable API where you just chain and nest the styles you want. + +```js +var chalk = require('chalk'); + +// style a string +chalk.blue('Hello world!'); + +// combine styled and normal strings +chalk.blue('Hello') + 'World' + chalk.red('!'); + +// compose multiple styles using the chainable API +chalk.blue.bgRed.bold('Hello world!'); + +// pass in multiple arguments +chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz'); + +// nest styles +chalk.red('Hello', chalk.underline.bgBlue('world') + '!'); + +// nest styles of the same type even (color, underline, background) +chalk.green( + 'I am a green line ' + + chalk.blue.underline.bold('with a blue substring') + + ' that becomes green again!' +); +``` + +Easily define your own themes. + +```js +var chalk = require('chalk'); +var error = chalk.bold.red; +console.log(error('Error!')); +``` + +Take advantage of console.log [string substitution](http://nodejs.org/docs/latest/api/console.html#console_console_log_data). + +```js +var name = 'Sindre'; +console.log(chalk.green('Hello %s'), name); +//=> Hello Sindre +``` + + +## API + +### chalk.` + + + + + + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/node-uuid/test/test.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/node-uuid/test/test.js new file mode 100644 index 00000000..5f1113d8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/node-uuid/test/test.js @@ -0,0 +1,231 @@ +if (!this.uuid) { + // node.js + uuid = require('../uuid'); + if (!/_rb/.test(uuid._rng.toString())) { + throw new Error("should use crypto for node.js"); + } +} + +// +// x-platform log/assert shims +// + +function _log(msg, type) { + type = type || 'log'; + + if (typeof(document) != 'undefined') { + document.write('
      ' + msg.replace(/\n/g, '
      ') + '
      '); + } + if (typeof(console) != 'undefined') { + var color = { + log: '\033[39m', + warn: '\033[33m', + error: '\033[31m' + }; + console[type](color[type] + msg + color.log); + } +} + +function log(msg) {_log(msg, 'log');} +function warn(msg) {_log(msg, 'warn');} +function error(msg) {_log(msg, 'error');} + +function assert(res, msg) { + if (!res) { + error('FAIL: ' + msg); + } else { + log('Pass: ' + msg); + } +} + +// +// Unit tests +// + +// Verify ordering of v1 ids created with explicit times +var TIME = 1321644961388; // 2011-11-18 11:36:01.388-08:00 + +function compare(name, ids) { + ids = ids.map(function(id) { + return id.split('-').reverse().join('-'); + }).sort(); + var sorted = ([].concat(ids)).sort(); + + assert(sorted.toString() == ids.toString(), name + ' have expected order'); +} + +// Verify ordering of v1 ids created using default behavior +compare('uuids with current time', [ + uuid.v1(), + uuid.v1(), + uuid.v1(), + uuid.v1(), + uuid.v1() +]); + +// Verify ordering of v1 ids created with explicit times +compare('uuids with time option', [ + uuid.v1({msecs: TIME - 10*3600*1000}), + uuid.v1({msecs: TIME - 1}), + uuid.v1({msecs: TIME}), + uuid.v1({msecs: TIME + 1}), + uuid.v1({msecs: TIME + 28*24*3600*1000}) +]); + +assert( + uuid.v1({msecs: TIME}) != uuid.v1({msecs: TIME}), + 'IDs created at same msec are different' +); + +// Verify throw if too many ids created +var thrown = false; +try { + uuid.v1({msecs: TIME, nsecs: 10000}); +} catch (e) { + thrown = true; +} +assert(thrown, 'Exception thrown when > 10K ids created in 1 ms'); + +// Verify clock regression bumps clockseq +var uidt = uuid.v1({msecs: TIME}); +var uidtb = uuid.v1({msecs: TIME - 1}); +assert( + parseInt(uidtb.split('-')[3], 16) - parseInt(uidt.split('-')[3], 16) === 1, + 'Clock regression by msec increments the clockseq' +); + +// Verify clock regression bumps clockseq +var uidtn = uuid.v1({msecs: TIME, nsecs: 10}); +var uidtnb = uuid.v1({msecs: TIME, nsecs: 9}); +assert( + parseInt(uidtnb.split('-')[3], 16) - parseInt(uidtn.split('-')[3], 16) === 1, + 'Clock regression by nsec increments the clockseq' +); + +// Verify explicit options produce expected id +var id = uuid.v1({ + msecs: 1321651533573, + nsecs: 5432, + clockseq: 0x385c, + node: [ 0x61, 0xcd, 0x3c, 0xbb, 0x32, 0x10 ] +}); +assert(id == 'd9428888-122b-11e1-b85c-61cd3cbb3210', 'Explicit options produce expected id'); + +// Verify adjacent ids across a msec boundary are 1 time unit apart +var u0 = uuid.v1({msecs: TIME, nsecs: 9999}); +var u1 = uuid.v1({msecs: TIME + 1, nsecs: 0}); + +var before = u0.split('-')[0], after = u1.split('-')[0]; +var dt = parseInt(after, 16) - parseInt(before, 16); +assert(dt === 1, 'Ids spanning 1ms boundary are 100ns apart'); + +// +// Test parse/unparse +// + +id = '00112233445566778899aabbccddeeff'; +assert(uuid.unparse(uuid.parse(id.substr(0,10))) == + '00112233-4400-0000-0000-000000000000', 'Short parse'); +assert(uuid.unparse(uuid.parse('(this is the uuid -> ' + id + id)) == + '00112233-4455-6677-8899-aabbccddeeff', 'Dirty parse'); + +// +// Perf tests +// + +var generators = { + v1: uuid.v1, + v4: uuid.v4 +}; + +var UUID_FORMAT = { + v1: /[0-9a-f]{8}-[0-9a-f]{4}-1[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/i, + v4: /[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/i +}; + +var N = 1e4; + +// Get %'age an actual value differs from the ideal value +function divergence(actual, ideal) { + return Math.round(100*100*(actual - ideal)/ideal)/100; +} + +function rate(msg, t) { + log(msg + ': ' + (N / (Date.now() - t) * 1e3 | 0) + ' uuids\/second'); +} + +for (var version in generators) { + var counts = {}, max = 0; + var generator = generators[version]; + var format = UUID_FORMAT[version]; + + log('\nSanity check ' + N + ' ' + version + ' uuids'); + for (var i = 0, ok = 0; i < N; i++) { + id = generator(); + if (!format.test(id)) { + throw Error(id + ' is not a valid UUID string'); + } + + if (id != uuid.unparse(uuid.parse(id))) { + assert(fail, id + ' is not a valid id'); + } + + // Count digits for our randomness check + if (version == 'v4') { + var digits = id.replace(/-/g, '').split(''); + for (var j = digits.length-1; j >= 0; j--) { + var c = digits[j]; + max = Math.max(max, counts[c] = (counts[c] || 0) + 1); + } + } + } + + // Check randomness for v4 UUIDs + if (version == 'v4') { + // Limit that we get worried about randomness. (Purely empirical choice, this!) + var limit = 2*100*Math.sqrt(1/N); + + log('\nChecking v4 randomness. Distribution of Hex Digits (% deviation from ideal)'); + + for (var i = 0; i < 16; i++) { + var c = i.toString(16); + var bar = '', n = counts[c], p = Math.round(n/max*100|0); + + // 1-3,5-8, and D-F: 1:16 odds over 30 digits + var ideal = N*30/16; + if (i == 4) { + // 4: 1:1 odds on 1 digit, plus 1:16 odds on 30 digits + ideal = N*(1 + 30/16); + } else if (i >= 8 && i <= 11) { + // 8-B: 1:4 odds on 1 digit, plus 1:16 odds on 30 digits + ideal = N*(1/4 + 30/16); + } else { + // Otherwise: 1:16 odds on 30 digits + ideal = N*30/16; + } + var d = divergence(n, ideal); + + // Draw bar using UTF squares (just for grins) + var s = n/max*50 | 0; + while (s--) bar += '='; + + assert(Math.abs(d) < limit, c + ' |' + bar + '| ' + counts[c] + ' (' + d + '% < ' + limit + '%)'); + } + } +} + +// Perf tests +for (var version in generators) { + log('\nPerformance testing ' + version + ' UUIDs'); + var generator = generators[version]; + var buf = new uuid.BufferClass(16); + + for (var i = 0, t = Date.now(); i < N; i++) generator(); + rate('uuid.' + version + '()', t); + + for (var i = 0, t = Date.now(); i < N; i++) generator('binary'); + rate('uuid.' + version + '(\'binary\')', t); + + for (var i = 0, t = Date.now(); i < N; i++) generator('binary', buf); + rate('uuid.' + version + '(\'binary\', buffer)', t); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/node-uuid/uuid.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/node-uuid/uuid.js new file mode 100644 index 00000000..89c5b8fb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/node-uuid/uuid.js @@ -0,0 +1,272 @@ +// uuid.js +// +// Copyright (c) 2010-2012 Robert Kieffer +// MIT License - http://opensource.org/licenses/mit-license.php + +/*global window, require, define */ +(function(_window) { + 'use strict'; + + // Unique ID creation requires a high quality random # generator. We feature + // detect to determine the best RNG source, normalizing to a function that + // returns 128-bits of randomness, since that's what's usually required + var _rng, _mathRNG, _nodeRNG, _whatwgRNG, _previousRoot; + + function setupBrowser() { + // Allow for MSIE11 msCrypto + var _crypto = _window.crypto || _window.msCrypto; + + if (!_rng && _crypto && _crypto.getRandomValues) { + // WHATWG crypto-based RNG - http://wiki.whatwg.org/wiki/Crypto + // + // Moderately fast, high quality + try { + var _rnds8 = new Uint8Array(16); + _whatwgRNG = _rng = function whatwgRNG() { + _crypto.getRandomValues(_rnds8); + return _rnds8; + }; + _rng(); + } catch(e) {} + } + + if (!_rng) { + // Math.random()-based (RNG) + // + // If all else fails, use Math.random(). It's fast, but is of unspecified + // quality. + var _rnds = new Array(16); + _mathRNG = _rng = function() { + for (var i = 0, r; i < 16; i++) { + if ((i & 0x03) === 0) { r = Math.random() * 0x100000000; } + _rnds[i] = r >>> ((i & 0x03) << 3) & 0xff; + } + + return _rnds; + }; + if ('undefined' !== typeof console && console.warn) { + console.warn("[SECURITY] node-uuid: crypto not usable, falling back to insecure Math.random()"); + } + } + } + + function setupNode() { + // Node.js crypto-based RNG - http://nodejs.org/docs/v0.6.2/api/crypto.html + // + // Moderately fast, high quality + if ('function' === typeof require) { + try { + var _rb = require('crypto').randomBytes; + _nodeRNG = _rng = _rb && function() {return _rb(16);}; + _rng(); + } catch(e) {} + } + } + + if (_window) { + setupBrowser(); + } else { + setupNode(); + } + + // Buffer class to use + var BufferClass = ('function' === typeof Buffer) ? Buffer : Array; + + // Maps for number <-> hex string conversion + var _byteToHex = []; + var _hexToByte = {}; + for (var i = 0; i < 256; i++) { + _byteToHex[i] = (i + 0x100).toString(16).substr(1); + _hexToByte[_byteToHex[i]] = i; + } + + // **`parse()` - Parse a UUID into it's component bytes** + function parse(s, buf, offset) { + var i = (buf && offset) || 0, ii = 0; + + buf = buf || []; + s.toLowerCase().replace(/[0-9a-f]{2}/g, function(oct) { + if (ii < 16) { // Don't overflow! + buf[i + ii++] = _hexToByte[oct]; + } + }); + + // Zero out remaining bytes if string was short + while (ii < 16) { + buf[i + ii++] = 0; + } + + return buf; + } + + // **`unparse()` - Convert UUID byte array (ala parse()) into a string** + function unparse(buf, offset) { + var i = offset || 0, bth = _byteToHex; + return bth[buf[i++]] + bth[buf[i++]] + + bth[buf[i++]] + bth[buf[i++]] + '-' + + bth[buf[i++]] + bth[buf[i++]] + '-' + + bth[buf[i++]] + bth[buf[i++]] + '-' + + bth[buf[i++]] + bth[buf[i++]] + '-' + + bth[buf[i++]] + bth[buf[i++]] + + bth[buf[i++]] + bth[buf[i++]] + + bth[buf[i++]] + bth[buf[i++]]; + } + + // **`v1()` - Generate time-based UUID** + // + // Inspired by https://github.com/LiosK/UUID.js + // and http://docs.python.org/library/uuid.html + + // random #'s we need to init node and clockseq + var _seedBytes = _rng(); + + // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) + var _nodeId = [ + _seedBytes[0] | 0x01, + _seedBytes[1], _seedBytes[2], _seedBytes[3], _seedBytes[4], _seedBytes[5] + ]; + + // Per 4.2.2, randomize (14 bit) clockseq + var _clockseq = (_seedBytes[6] << 8 | _seedBytes[7]) & 0x3fff; + + // Previous uuid creation time + var _lastMSecs = 0, _lastNSecs = 0; + + // See https://github.com/broofa/node-uuid for API details + function v1(options, buf, offset) { + var i = buf && offset || 0; + var b = buf || []; + + options = options || {}; + + var clockseq = (options.clockseq != null) ? options.clockseq : _clockseq; + + // UUID timestamps are 100 nano-second units since the Gregorian epoch, + // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so + // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' + // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. + var msecs = (options.msecs != null) ? options.msecs : new Date().getTime(); + + // Per 4.2.1.2, use count of uuid's generated during the current clock + // cycle to simulate higher resolution clock + var nsecs = (options.nsecs != null) ? options.nsecs : _lastNSecs + 1; + + // Time since last uuid creation (in msecs) + var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000; + + // Per 4.2.1.2, Bump clockseq on clock regression + if (dt < 0 && options.clockseq == null) { + clockseq = clockseq + 1 & 0x3fff; + } + + // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new + // time interval + if ((dt < 0 || msecs > _lastMSecs) && options.nsecs == null) { + nsecs = 0; + } + + // Per 4.2.1.2 Throw error if too many uuids are requested + if (nsecs >= 10000) { + throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec'); + } + + _lastMSecs = msecs; + _lastNSecs = nsecs; + _clockseq = clockseq; + + // Per 4.1.4 - Convert from unix epoch to Gregorian epoch + msecs += 12219292800000; + + // `time_low` + var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; + b[i++] = tl >>> 24 & 0xff; + b[i++] = tl >>> 16 & 0xff; + b[i++] = tl >>> 8 & 0xff; + b[i++] = tl & 0xff; + + // `time_mid` + var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff; + b[i++] = tmh >>> 8 & 0xff; + b[i++] = tmh & 0xff; + + // `time_high_and_version` + b[i++] = tmh >>> 24 & 0xf | 0x10; // include version + b[i++] = tmh >>> 16 & 0xff; + + // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) + b[i++] = clockseq >>> 8 | 0x80; + + // `clock_seq_low` + b[i++] = clockseq & 0xff; + + // `node` + var node = options.node || _nodeId; + for (var n = 0; n < 6; n++) { + b[i + n] = node[n]; + } + + return buf ? buf : unparse(b); + } + + // **`v4()` - Generate random UUID** + + // See https://github.com/broofa/node-uuid for API details + function v4(options, buf, offset) { + // Deprecated - 'format' argument, as supported in v1.2 + var i = buf && offset || 0; + + if (typeof(options) === 'string') { + buf = (options === 'binary') ? new BufferClass(16) : null; + options = null; + } + options = options || {}; + + var rnds = options.random || (options.rng || _rng)(); + + // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + rnds[6] = (rnds[6] & 0x0f) | 0x40; + rnds[8] = (rnds[8] & 0x3f) | 0x80; + + // Copy bytes to buffer, if provided + if (buf) { + for (var ii = 0; ii < 16; ii++) { + buf[i + ii] = rnds[ii]; + } + } + + return buf || unparse(rnds); + } + + // Export public API + var uuid = v4; + uuid.v1 = v1; + uuid.v4 = v4; + uuid.parse = parse; + uuid.unparse = unparse; + uuid.BufferClass = BufferClass; + uuid._rng = _rng; + uuid._mathRNG = _mathRNG; + uuid._nodeRNG = _nodeRNG; + uuid._whatwgRNG = _whatwgRNG; + + if (('undefined' !== typeof module) && module.exports) { + // Publish as node.js module + module.exports = uuid; + } else if (typeof define === 'function' && define.amd) { + // Publish as AMD module + define(function() {return uuid;}); + + + } else { + // Publish as global (in browsers) + _previousRoot = _window.uuid; + + // **`noConflict()` - (browser only) to reset global 'uuid' var** + uuid.noConflict = function() { + _window.uuid = _previousRoot; + return uuid; + }; + + _window.uuid = uuid; + } +})('undefined' !== typeof window ? window : null); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/oauth-sign/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/oauth-sign/LICENSE new file mode 100644 index 00000000..a4a9aee0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/oauth-sign/LICENSE @@ -0,0 +1,55 @@ +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of this License; and + +You must cause any modified files to carry prominent notices stating that You changed the files; and + +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/oauth-sign/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/oauth-sign/README.md new file mode 100644 index 00000000..34c4a85d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/oauth-sign/README.md @@ -0,0 +1,4 @@ +oauth-sign +========== + +OAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/oauth-sign/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/oauth-sign/index.js new file mode 100644 index 00000000..b7fc0ace --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/oauth-sign/index.js @@ -0,0 +1,135 @@ +var crypto = require('crypto') + , qs = require('querystring') + ; + +function sha1 (key, body) { + return crypto.createHmac('sha1', key).update(body).digest('base64') +} + +function rsa (key, body) { + return crypto.createSign("RSA-SHA1").update(body).sign(key, 'base64'); +} + +function rfc3986 (str) { + return encodeURIComponent(str) + .replace(/!/g,'%21') + .replace(/\*/g,'%2A') + .replace(/\(/g,'%28') + .replace(/\)/g,'%29') + .replace(/'/g,'%27') + ; +} + +// Maps object to bi-dimensional array +// Converts { foo: 'A', bar: [ 'b', 'B' ]} to +// [ ['foo', 'A'], ['bar', 'b'], ['bar', 'B'] ] +function map (obj) { + var key, val, arr = [] + for (key in obj) { + val = obj[key] + if (Array.isArray(val)) + for (var i = 0; i < val.length; i++) + arr.push([key, val[i]]) + else if (typeof val === "object") + for (var prop in val) + arr.push([key + '[' + prop + ']', val[prop]]); + else + arr.push([key, val]) + } + return arr +} + +// Compare function for sort +function compare (a, b) { + return a > b ? 1 : a < b ? -1 : 0 +} + +function generateBase (httpMethod, base_uri, params) { + // adapted from https://dev.twitter.com/docs/auth/oauth and + // https://dev.twitter.com/docs/auth/creating-signature + + // Parameter normalization + // http://tools.ietf.org/html/rfc5849#section-3.4.1.3.2 + var normalized = map(params) + // 1. First, the name and value of each parameter are encoded + .map(function (p) { + return [ rfc3986(p[0]), rfc3986(p[1] || '') ] + }) + // 2. The parameters are sorted by name, using ascending byte value + // ordering. If two or more parameters share the same name, they + // are sorted by their value. + .sort(function (a, b) { + return compare(a[0], b[0]) || compare(a[1], b[1]) + }) + // 3. The name of each parameter is concatenated to its corresponding + // value using an "=" character (ASCII code 61) as a separator, even + // if the value is empty. + .map(function (p) { return p.join('=') }) + // 4. The sorted name/value pairs are concatenated together into a + // single string by using an "&" character (ASCII code 38) as + // separator. + .join('&') + + var base = [ + rfc3986(httpMethod ? httpMethod.toUpperCase() : 'GET'), + rfc3986(base_uri), + rfc3986(normalized) + ].join('&') + + return base +} + +function hmacsign (httpMethod, base_uri, params, consumer_secret, token_secret) { + var base = generateBase(httpMethod, base_uri, params) + var key = [ + consumer_secret || '', + token_secret || '' + ].map(rfc3986).join('&') + + return sha1(key, base) +} + +function rsasign (httpMethod, base_uri, params, private_key, token_secret) { + var base = generateBase(httpMethod, base_uri, params) + var key = private_key || '' + + return rsa(key, base) +} + +function plaintext (consumer_secret, token_secret) { + var key = [ + consumer_secret || '', + token_secret || '' + ].map(rfc3986).join('&') + + return key +} + +function sign (signMethod, httpMethod, base_uri, params, consumer_secret, token_secret) { + var method + var skipArgs = 1 + + switch (signMethod) { + case 'RSA-SHA1': + method = rsasign + break + case 'HMAC-SHA1': + method = hmacsign + break + case 'PLAINTEXT': + method = plaintext + skipArgs = 4 + break + default: + throw new Error("Signature method not supported: " + signMethod) + } + + return method.apply(null, [].slice.call(arguments, skipArgs)) +} + +exports.hmacsign = hmacsign +exports.rsasign = rsasign +exports.plaintext = plaintext +exports.sign = sign +exports.rfc3986 = rfc3986 +exports.generateBase = generateBase diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/oauth-sign/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/oauth-sign/package.json new file mode 100644 index 00000000..cf1eeb77 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/oauth-sign/package.json @@ -0,0 +1,66 @@ +{ + "author": { + "name": "Mikeal Rogers", + "email": "mikeal.rogers@gmail.com", + "url": "http://www.futurealoof.com" + }, + "name": "oauth-sign", + "description": "OAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module.", + "version": "0.8.2", + "license": "Apache-2.0", + "repository": { + "url": "git+https://github.com/mikeal/oauth-sign.git" + }, + "main": "index.js", + "files": [ + "index.js" + ], + "dependencies": {}, + "devDependencies": {}, + "optionalDependencies": {}, + "engines": { + "node": "*" + }, + "scripts": { + "test": "node test.js" + }, + "gitHead": "0b034206316132f57e26970152c2fb18e71bddd5", + "bugs": { + "url": "https://github.com/mikeal/oauth-sign/issues" + }, + "homepage": "https://github.com/mikeal/oauth-sign#readme", + "_id": "oauth-sign@0.8.2", + "_shasum": "46a6ab7f0aead8deae9ec0565780b7d4efeb9d43", + "_from": "oauth-sign@>=0.8.1 <0.9.0", + "_npmVersion": "2.15.3", + "_nodeVersion": "5.9.0", + "_npmUser": { + "name": "simov", + "email": "simeonvelichkov@gmail.com" + }, + "dist": { + "shasum": "46a6ab7f0aead8deae9ec0565780b7d4efeb9d43", + "tarball": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz" + }, + "maintainers": [ + { + "name": "mikeal", + "email": "mikeal.rogers@gmail.com" + }, + { + "name": "nylen", + "email": "jnylen@gmail.com" + }, + { + "name": "simov", + "email": "simeonvelichkov@gmail.com" + } + ], + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/oauth-sign-0.8.2.tgz_1462396399020_0.8175400267355144" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/.eslintignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/.eslintignore new file mode 100644 index 00000000..1521c8b7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/.eslintignore @@ -0,0 +1 @@ +dist diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/CHANGELOG.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/CHANGELOG.md new file mode 100644 index 00000000..86bea763 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/CHANGELOG.md @@ -0,0 +1,130 @@ +## **6.2.1** +- [Fix] ensure `key[]=x&key[]&key[]=y` results in 3, not 2, values +- [Refactor] Be explicit and use `Object.prototype.hasOwnProperty.call` +- [Tests] remove `parallelshell` since it does not reliably report failures +- [Tests] up to `node` `v6.3`, `v5.12` +- [Dev Deps] update `tape`, `eslint`, `@ljharb/eslint-config`, `qs-iconv` + +## [**6.2.0**](https://github.com/ljharb/qs/issues?milestone=36&state=closed) +- [New] pass Buffers to the encoder/decoder directly (#161) +- [New] add "encoder" and "decoder" options, for custom param encoding/decoding (#160) +- [Fix] fix compacting of nested sparse arrays (#150) + +## [**6.1.0**](https://github.com/ljharb/qs/issues?milestone=35&state=closed) +- [New] allowDots option for `stringify` (#151) +- [Fix] "sort" option should work at a depth of 3 or more (#151) +- [Fix] Restore `dist` directory; will be removed in v7 (#148) + +## [**6.0.2**](https://github.com/ljharb/qs/issues?milestone=33&state=closed) +- Revert ES6 requirement and restore support for node down to v0.8. + +## [**6.0.1**](https://github.com/ljharb/qs/issues?milestone=32&state=closed) +- [**#127**](https://github.com/ljharb/qs/pull/127) Fix engines definition in package.json + +## [**6.0.0**](https://github.com/ljharb/qs/issues?milestone=31&state=closed) +- [**#124**](https://github.com/ljharb/qs/issues/124) Use ES6 and drop support for node < v4 + +## **5.2.1** +- [Fix] ensure `key[]=x&key[]&key[]=y` results in 3, not 2, values + +## [**5.2.0**](https://github.com/ljharb/qs/issues?milestone=30&state=closed) +- [**#64**](https://github.com/ljharb/qs/issues/64) Add option to sort object keys in the query string + +## [**5.1.0**](https://github.com/ljharb/qs/issues?milestone=29&state=closed) +- [**#117**](https://github.com/ljharb/qs/issues/117) make URI encoding stringified results optional +- [**#106**](https://github.com/ljharb/qs/issues/106) Add flag `skipNulls` to optionally skip null values in stringify + +## [**5.0.0**](https://github.com/ljharb/qs/issues?milestone=28&state=closed) +- [**#114**](https://github.com/ljharb/qs/issues/114) default allowDots to false +- [**#100**](https://github.com/ljharb/qs/issues/100) include dist to npm + +## [**4.0.0**](https://github.com/ljharb/qs/issues?milestone=26&state=closed) +- [**#98**](https://github.com/ljharb/qs/issues/98) make returning plain objects and allowing prototype overwriting properties optional + +## [**3.1.0**](https://github.com/ljharb/qs/issues?milestone=24&state=closed) +- [**#89**](https://github.com/ljharb/qs/issues/89) Add option to disable "Transform dot notation to bracket notation" + +## [**3.0.0**](https://github.com/ljharb/qs/issues?milestone=23&state=closed) +- [**#80**](https://github.com/ljharb/qs/issues/80) qs.parse silently drops properties +- [**#77**](https://github.com/ljharb/qs/issues/77) Perf boost +- [**#60**](https://github.com/ljharb/qs/issues/60) Add explicit option to disable array parsing +- [**#74**](https://github.com/ljharb/qs/issues/74) Bad parse when turning array into object +- [**#81**](https://github.com/ljharb/qs/issues/81) Add a `filter` option +- [**#68**](https://github.com/ljharb/qs/issues/68) Fixed issue with recursion and passing strings into objects. +- [**#66**](https://github.com/ljharb/qs/issues/66) Add mixed array and object dot notation support Closes: #47 +- [**#76**](https://github.com/ljharb/qs/issues/76) RFC 3986 +- [**#85**](https://github.com/ljharb/qs/issues/85) No equal sign +- [**#84**](https://github.com/ljharb/qs/issues/84) update license attribute + +## [**2.4.1**](https://github.com/ljharb/qs/issues?milestone=20&state=closed) +- [**#73**](https://github.com/ljharb/qs/issues/73) Property 'hasOwnProperty' of object # is not a function + +## [**2.4.0**](https://github.com/ljharb/qs/issues?milestone=19&state=closed) +- [**#70**](https://github.com/ljharb/qs/issues/70) Add arrayFormat option + +## [**2.3.3**](https://github.com/ljharb/qs/issues?milestone=18&state=closed) +- [**#59**](https://github.com/ljharb/qs/issues/59) make sure array indexes are >= 0, closes #57 +- [**#58**](https://github.com/ljharb/qs/issues/58) make qs usable for browser loader + +## [**2.3.2**](https://github.com/ljharb/qs/issues?milestone=17&state=closed) +- [**#55**](https://github.com/ljharb/qs/issues/55) allow merging a string into an object + +## [**2.3.1**](https://github.com/ljharb/qs/issues?milestone=16&state=closed) +- [**#52**](https://github.com/ljharb/qs/issues/52) Return "undefined" and "false" instead of throwing "TypeError". + +## [**2.3.0**](https://github.com/ljharb/qs/issues?milestone=15&state=closed) +- [**#50**](https://github.com/ljharb/qs/issues/50) add option to omit array indices, closes #46 + +## [**2.2.5**](https://github.com/ljharb/qs/issues?milestone=14&state=closed) +- [**#39**](https://github.com/ljharb/qs/issues/39) Is there an alternative to Buffer.isBuffer? +- [**#49**](https://github.com/ljharb/qs/issues/49) refactor utils.merge, fixes #45 +- [**#41**](https://github.com/ljharb/qs/issues/41) avoid browserifying Buffer, for #39 + +## [**2.2.4**](https://github.com/ljharb/qs/issues?milestone=13&state=closed) +- [**#38**](https://github.com/ljharb/qs/issues/38) how to handle object keys beginning with a number + +## [**2.2.3**](https://github.com/ljharb/qs/issues?milestone=12&state=closed) +- [**#37**](https://github.com/ljharb/qs/issues/37) parser discards first empty value in array +- [**#36**](https://github.com/ljharb/qs/issues/36) Update to lab 4.x + +## [**2.2.2**](https://github.com/ljharb/qs/issues?milestone=11&state=closed) +- [**#33**](https://github.com/ljharb/qs/issues/33) Error when plain object in a value +- [**#34**](https://github.com/ljharb/qs/issues/34) use Object.prototype.hasOwnProperty.call instead of obj.hasOwnProperty +- [**#24**](https://github.com/ljharb/qs/issues/24) Changelog? Semver? + +## [**2.2.1**](https://github.com/ljharb/qs/issues?milestone=10&state=closed) +- [**#32**](https://github.com/ljharb/qs/issues/32) account for circular references properly, closes #31 +- [**#31**](https://github.com/ljharb/qs/issues/31) qs.parse stackoverflow on circular objects + +## [**2.2.0**](https://github.com/ljharb/qs/issues?milestone=9&state=closed) +- [**#26**](https://github.com/ljharb/qs/issues/26) Don't use Buffer global if it's not present +- [**#30**](https://github.com/ljharb/qs/issues/30) Bug when merging non-object values into arrays +- [**#29**](https://github.com/ljharb/qs/issues/29) Don't call Utils.clone at the top of Utils.merge +- [**#23**](https://github.com/ljharb/qs/issues/23) Ability to not limit parameters? + +## [**2.1.0**](https://github.com/ljharb/qs/issues?milestone=8&state=closed) +- [**#22**](https://github.com/ljharb/qs/issues/22) Enable using a RegExp as delimiter + +## [**2.0.0**](https://github.com/ljharb/qs/issues?milestone=7&state=closed) +- [**#18**](https://github.com/ljharb/qs/issues/18) Why is there arrayLimit? +- [**#20**](https://github.com/ljharb/qs/issues/20) Configurable parametersLimit +- [**#21**](https://github.com/ljharb/qs/issues/21) make all limits optional, for #18, for #20 + +## [**1.2.2**](https://github.com/ljharb/qs/issues?milestone=6&state=closed) +- [**#19**](https://github.com/ljharb/qs/issues/19) Don't overwrite null values + +## [**1.2.1**](https://github.com/ljharb/qs/issues?milestone=5&state=closed) +- [**#16**](https://github.com/ljharb/qs/issues/16) ignore non-string delimiters +- [**#15**](https://github.com/ljharb/qs/issues/15) Close code block + +## [**1.2.0**](https://github.com/ljharb/qs/issues?milestone=4&state=closed) +- [**#12**](https://github.com/ljharb/qs/issues/12) Add optional delim argument +- [**#13**](https://github.com/ljharb/qs/issues/13) fix #11: flattened keys in array are now correctly parsed + +## [**1.1.0**](https://github.com/ljharb/qs/issues?milestone=3&state=closed) +- [**#7**](https://github.com/ljharb/qs/issues/7) Empty values of a POST array disappear after being submitted +- [**#9**](https://github.com/ljharb/qs/issues/9) Should not omit equals signs (=) when value is null +- [**#6**](https://github.com/ljharb/qs/issues/6) Minor grammar fix in README + +## [**1.0.2**](https://github.com/ljharb/qs/issues?milestone=2&state=closed) +- [**#5**](https://github.com/ljharb/qs/issues/5) array holes incorrectly copied into object on large index diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/CONTRIBUTING.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/CONTRIBUTING.md new file mode 100644 index 00000000..89283615 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/CONTRIBUTING.md @@ -0,0 +1 @@ +Please view our [hapijs contributing guide](https://github.com/hapijs/hapi/blob/master/CONTRIBUTING.md). diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/LICENSE new file mode 100644 index 00000000..d4569487 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/LICENSE @@ -0,0 +1,28 @@ +Copyright (c) 2014 Nathan LaFreniere and other contributors. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * The names of any contributors may not be used to endorse or promote + products derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + * * * + +The complete list of contributors can be found at: https://github.com/hapijs/qs/graphs/contributors diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/Readme.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/Readme.md new file mode 100644 index 00000000..4a313528 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/Readme.md @@ -0,0 +1,376 @@ +# qs + +A querystring parsing and stringifying library with some added security. + +[![Build Status](https://api.travis-ci.org/ljharb/qs.svg)](http://travis-ci.org/ljharb/qs) + +Lead Maintainer: [Jordan Harband](https://github.com/ljharb) + +The **qs** module was originally created and maintained by [TJ Holowaychuk](https://github.com/visionmedia/node-querystring). + +## Usage + +```javascript +var qs = require('qs'); +var assert = require('assert'); + +var obj = qs.parse('a=c'); +assert.deepEqual(obj, { a: 'c' }); + +var str = qs.stringify(obj); +assert.equal(str, 'a=c'); +``` + +### Parsing Objects + +[](#preventEval) +```javascript +qs.parse(string, [options]); +``` + +**qs** allows you to create nested objects within your query strings, by surrounding the name of sub-keys with square brackets `[]`. +For example, the string `'foo[bar]=baz'` converts to: + +```javascript +assert.deepEqual(qs.parse('foo[bar]=baz'), { + foo: { + bar: 'baz' + } +}); +``` + +When using the `plainObjects` option the parsed value is returned as a plain object, created via `Object.create(null)` and as such you should be aware that prototype methods will not exist on it and a user may set those names to whatever value they like: + +```javascript +var plainObject = qs.parse('a[hasOwnProperty]=b', { plainObjects: true }); +assert.deepEqual(plainObject, { a: { hasOwnProperty: 'b' } }); +``` + +By default parameters that would overwrite properties on the object prototype are ignored, if you wish to keep the data from those fields either use `plainObjects` as mentioned above, or set `allowPrototypes` to `true` which will allow user input to overwrite those properties. *WARNING* It is generally a bad idea to enable this option as it can cause problems when attempting to use the properties that have been overwritten. Always be careful with this option. + +```javascript +var protoObject = qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true }); +assert.deepEqual(protoObject, { a: { hasOwnProperty: 'b' } }); +``` + +URI encoded strings work too: + +```javascript +assert.deepEqual(qs.parse('a%5Bb%5D=c'), { + a: { b: 'c' } +}); +``` + +You can also nest your objects, like `'foo[bar][baz]=foobarbaz'`: + +```javascript +assert.deepEqual(qs.parse('foo[bar][baz]=foobarbaz'), { + foo: { + bar: { + baz: 'foobarbaz' + } + } +}); +``` + +By default, when nesting objects **qs** will only parse up to 5 children deep. This means if you attempt to parse a string like +`'a[b][c][d][e][f][g][h][i]=j'` your resulting object will be: + +```javascript +var expected = { + a: { + b: { + c: { + d: { + e: { + f: { + '[g][h][i]': 'j' + } + } + } + } + } + } +}; +var string = 'a[b][c][d][e][f][g][h][i]=j'; +assert.deepEqual(qs.parse(string), expected); +``` + +This depth can be overridden by passing a `depth` option to `qs.parse(string, [options])`: + +```javascript +var deep = qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 }); +assert.deepEqual(deep, { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } }); +``` + +The depth limit helps mitigate abuse when **qs** is used to parse user input, and it is recommended to keep it a reasonably small number. + +For similar reasons, by default **qs** will only parse up to 1000 parameters. This can be overridden by passing a `parameterLimit` option: + +```javascript +var limited = qs.parse('a=b&c=d', { parameterLimit: 1 }); +assert.deepEqual(limited, { a: 'b' }); +``` + +An optional delimiter can also be passed: + +```javascript +var delimited = qs.parse('a=b;c=d', { delimiter: ';' }); +assert.deepEqual(delimited, { a: 'b', c: 'd' }); +``` + +Delimiters can be a regular expression too: + +```javascript +var regexed = qs.parse('a=b;c=d,e=f', { delimiter: /[;,]/ }); +assert.deepEqual(regexed, { a: 'b', c: 'd', e: 'f' }); +``` + +Option `allowDots` can be used to enable dot notation: + +```javascript +var withDots = qs.parse('a.b=c', { allowDots: true }); +assert.deepEqual(withDots, { a: { b: 'c' } }); +``` + +### Parsing Arrays + +**qs** can also parse arrays using a similar `[]` notation: + +```javascript +var withArray = qs.parse('a[]=b&a[]=c'); +assert.deepEqual(withArray, { a: ['b', 'c'] }); +``` + +You may specify an index as well: + +```javascript +var withIndexes = qs.parse('a[1]=c&a[0]=b'); +assert.deepEqual(withIndexes, { a: ['b', 'c'] }); +``` + +Note that the only difference between an index in an array and a key in an object is that the value between the brackets must be a number +to create an array. When creating arrays with specific indices, **qs** will compact a sparse array to only the existing values preserving +their order: + +```javascript +var noSparse = qs.parse('a[1]=b&a[15]=c'); +assert.deepEqual(noSparse, { a: ['b', 'c'] }); +``` + +Note that an empty string is also a value, and will be preserved: + +```javascript +var withEmptyString = qs.parse('a[]=&a[]=b'); +assert.deepEqual(withEmptyString, { a: ['', 'b'] }); + +var withIndexedEmptyString = qs.parse('a[0]=b&a[1]=&a[2]=c'); +assert.deepEqual(withIndexedEmptyString, { a: ['b', '', 'c'] }); +``` + +**qs** will also limit specifying indices in an array to a maximum index of `20`. Any array members with an index of greater than `20` will +instead be converted to an object with the index as the key: + +```javascript +var withMaxIndex = qs.parse('a[100]=b'); +assert.deepEqual(withMaxIndex, { a: { '100': 'b' } }); +``` + +This limit can be overridden by passing an `arrayLimit` option: + +```javascript +var withArrayLimit = qs.parse('a[1]=b', { arrayLimit: 0 }); +assert.deepEqual(withArrayLimit, { a: { '1': 'b' } }); +``` + +To disable array parsing entirely, set `parseArrays` to `false`. + +```javascript +var noParsingArrays = qs.parse('a[]=b', { parseArrays: false }); +assert.deepEqual(noParsingArrays, { a: { '0': 'b' } }); +``` + +If you mix notations, **qs** will merge the two items into an object: + +```javascript +var mixedNotation = qs.parse('a[0]=b&a[b]=c'); +assert.deepEqual(mixedNotation, { a: { '0': 'b', b: 'c' } }); +``` + +You can also create arrays of objects: + +```javascript +var arraysOfObjects = qs.parse('a[][b]=c'); +assert.deepEqual(arraysOfObjects, { a: [{ b: 'c' }] }); +``` + +### Stringifying + +[](#preventEval) +```javascript +qs.stringify(object, [options]); +``` + +When stringifying, **qs** by default URI encodes output. Objects are stringified as you would expect: + +```javascript +assert.equal(qs.stringify({ a: 'b' }), 'a=b'); +assert.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c'); +``` + +This encoding can be disabled by setting the `encode` option to `false`: + +```javascript +var unencoded = qs.stringify({ a: { b: 'c' } }, { encode: false }); +assert.equal(unencoded, 'a[b]=c'); +``` + +This encoding can also be replaced by a custom encoding method set as `encoder` option: + +```javascript +var encoded = qs.stringify({ a: { b: 'c' } }, { encoder: function (str) { + // Passed in values `a`, `b`, `c` + return // Return encoded string +}}) +``` + +_(Note: the `encoder` option does not apply if `encode` is `false`)_ + +Analogue to the `encoder` there is a `decoder` option for `parse` to override decoding of properties and values: + +```javascript +var decoded = qs.parse('x=z', { decoder: function (str) { + // Passed in values `x`, `z` + return // Return decoded string +}}) +``` + +Examples beyond this point will be shown as though the output is not URI encoded for clarity. Please note that the return values in these cases *will* be URI encoded during real usage. + +When arrays are stringified, by default they are given explicit indices: + +```javascript +qs.stringify({ a: ['b', 'c', 'd'] }); +// 'a[0]=b&a[1]=c&a[2]=d' +``` + +You may override this by setting the `indices` option to `false`: + +```javascript +qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false }); +// 'a=b&a=c&a=d' +``` + +You may use the `arrayFormat` option to specify the format of the output array + +```javascript +qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' }) +// 'a[0]=b&a[1]=c' +qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' }) +// 'a[]=b&a[]=c' +qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' }) +// 'a=b&a=c' +``` + +Empty strings and null values will omit the value, but the equals sign (=) remains in place: + +```javascript +assert.equal(qs.stringify({ a: '' }), 'a='); +``` + +Properties that are set to `undefined` will be omitted entirely: + +```javascript +assert.equal(qs.stringify({ a: null, b: undefined }), 'a='); +``` + +The delimiter may be overridden with stringify as well: + +```javascript +assert.equal(qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }), 'a=b;c=d'); +``` + +Finally, you can use the `filter` option to restrict which keys will be included in the stringified output. +If you pass a function, it will be called for each key to obtain the replacement value. Otherwise, if you +pass an array, it will be used to select properties and array indices for stringification: + +```javascript +function filterFunc(prefix, value) { + if (prefix == 'b') { + // Return an `undefined` value to omit a property. + return; + } + if (prefix == 'e[f]') { + return value.getTime(); + } + if (prefix == 'e[g][0]') { + return value * 2; + } + return value; +} +qs.stringify({ a: 'b', c: 'd', e: { f: new Date(123), g: [2] } }, { filter: filterFunc }); +// 'a=b&c=d&e[f]=123&e[g][0]=4' +qs.stringify({ a: 'b', c: 'd', e: 'f' }, { filter: ['a', 'e'] }); +// 'a=b&e=f' +qs.stringify({ a: ['b', 'c', 'd'], e: 'f' }, { filter: ['a', 0, 2] }); +// 'a[0]=b&a[2]=d' +``` + +### Handling of `null` values + +By default, `null` values are treated like empty strings: + +```javascript +var withNull = qs.stringify({ a: null, b: '' }); +assert.equal(withNull, 'a=&b='); +``` + +Parsing does not distinguish between parameters with and without equal signs. Both are converted to empty strings. + +```javascript +var equalsInsensitive = qs.parse('a&b='); +assert.deepEqual(equalsInsensitive, { a: '', b: '' }); +``` + +To distinguish between `null` values and empty strings use the `strictNullHandling` flag. In the result string the `null` +values have no `=` sign: + +```javascript +var strictNull = qs.stringify({ a: null, b: '' }, { strictNullHandling: true }); +assert.equal(strictNull, 'a&b='); +``` + +To parse values without `=` back to `null` use the `strictNullHandling` flag: + +```javascript +var parsedStrictNull = qs.parse('a&b=', { strictNullHandling: true }); +assert.deepEqual(parsedStrictNull, { a: null, b: '' }); +``` + +To completely skip rendering keys with `null` values, use the `skipNulls` flag: + +```javascript +var nullsSkipped = qs.stringify({ a: 'b', c: null}, { skipNulls: true }); +assert.equal(nullsSkipped, 'a=b'); +``` + +### Dealing with special character sets + +By default the encoding and decoding of characters is done in `utf-8`. If you +wish to encode querystrings to a different character set (i.e. +[Shift JIS](https://en.wikipedia.org/wiki/Shift_JIS)) you can use the +[`qs-iconv`](https://github.com/martinheidegger/qs-iconv) library: + +```javascript +var encoder = require('qs-iconv/encoder')('shift_jis'); +var shiftJISEncoded = qs.stringify({ a: 'こんにちは!' }, { encoder: encoder }); +assert.equal(shiftJISEncoded, 'a=%82%B1%82%F1%82%C9%82%BF%82%CD%81I'); +``` + +This also works for decoding of query strings: + +```javascript +var decoder = require('qs-iconv/decoder')('shift_jis'); +var obj = qs.parse('a=%82%B1%82%F1%82%C9%82%BF%82%CD%81I', { decoder: decoder }); +assert.deepEqual(obj, { a: 'こんにちは!' }); +``` diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/dist/qs.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/dist/qs.js new file mode 100644 index 00000000..fcf825b5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/dist/qs.js @@ -0,0 +1,486 @@ +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Qs = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= 0 && + (options.parseArrays && index <= options.arrayLimit) + ) { + obj = []; + obj[index] = parseObject(chain, val, options); + } else { + obj[cleanRoot] = parseObject(chain, val, options); + } + } + + return obj; +}; + +var parseKeys = function parseKeys(givenKey, val, options) { + if (!givenKey) { + return; + } + + // Transform dot notation to bracket notation + var key = options.allowDots ? givenKey.replace(/\.([^\.\[]+)/g, '[$1]') : givenKey; + + // The regex chunks + + var parent = /^([^\[\]]*)/; + var child = /(\[[^\[\]]*\])/g; + + // Get the parent + + var segment = parent.exec(key); + + // Stash the parent if it exists + + var keys = []; + if (segment[1]) { + // If we aren't using plain objects, optionally prefix keys + // that would overwrite object prototype properties + if (!options.plainObjects && has.call(Object.prototype, segment[1])) { + if (!options.allowPrototypes) { + return; + } + } + + keys.push(segment[1]); + } + + // Loop through children appending to the array until we hit depth + + var i = 0; + while ((segment = child.exec(key)) !== null && i < options.depth) { + i += 1; + if (!options.plainObjects && has.call(Object.prototype, segment[1].replace(/\[|\]/g, ''))) { + if (!options.allowPrototypes) { + continue; + } + } + keys.push(segment[1]); + } + + // If there's a remainder, just add whatever is left + + if (segment) { + keys.push('[' + key.slice(segment.index) + ']'); + } + + return parseObject(keys, val, options); +}; + +module.exports = function (str, opts) { + var options = opts || {}; + + if (options.decoder !== null && options.decoder !== undefined && typeof options.decoder !== 'function') { + throw new TypeError('Decoder has to be a function.'); + } + + options.delimiter = typeof options.delimiter === 'string' || Utils.isRegExp(options.delimiter) ? options.delimiter : defaults.delimiter; + options.depth = typeof options.depth === 'number' ? options.depth : defaults.depth; + options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : defaults.arrayLimit; + options.parseArrays = options.parseArrays !== false; + options.decoder = typeof options.decoder === 'function' ? options.decoder : defaults.decoder; + options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : defaults.allowDots; + options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : defaults.plainObjects; + options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : defaults.allowPrototypes; + options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : defaults.parameterLimit; + options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling; + + if (str === '' || str === null || typeof str === 'undefined') { + return options.plainObjects ? Object.create(null) : {}; + } + + var tempObj = typeof str === 'string' ? parseValues(str, options) : str; + var obj = options.plainObjects ? Object.create(null) : {}; + + // Iterate over the keys and setup the new object + + var keys = Object.keys(tempObj); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + var newObj = parseKeys(key, tempObj[key], options); + obj = Utils.merge(obj, newObj, options); + } + + return Utils.compact(obj); +}; + +},{"./utils":4}],3:[function(require,module,exports){ +'use strict'; + +var Utils = require('./utils'); + +var arrayPrefixGenerators = { + brackets: function brackets(prefix) { + return prefix + '[]'; + }, + indices: function indices(prefix, key) { + return prefix + '[' + key + ']'; + }, + repeat: function repeat(prefix) { + return prefix; + } +}; + +var defaults = { + delimiter: '&', + strictNullHandling: false, + skipNulls: false, + encode: true, + encoder: Utils.encode +}; + +var stringify = function stringify(object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots) { + var obj = object; + if (typeof filter === 'function') { + obj = filter(prefix, obj); + } else if (obj instanceof Date) { + obj = obj.toISOString(); + } else if (obj === null) { + if (strictNullHandling) { + return encoder ? encoder(prefix) : prefix; + } + + obj = ''; + } + + if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || Utils.isBuffer(obj)) { + if (encoder) { + return [encoder(prefix) + '=' + encoder(obj)]; + } + return [prefix + '=' + String(obj)]; + } + + var values = []; + + if (typeof obj === 'undefined') { + return values; + } + + var objKeys; + if (Array.isArray(filter)) { + objKeys = filter; + } else { + var keys = Object.keys(obj); + objKeys = sort ? keys.sort(sort) : keys; + } + + for (var i = 0; i < objKeys.length; ++i) { + var key = objKeys[i]; + + if (skipNulls && obj[key] === null) { + continue; + } + + if (Array.isArray(obj)) { + values = values.concat(stringify(obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots)); + } else { + values = values.concat(stringify(obj[key], prefix + (allowDots ? '.' + key : '[' + key + ']'), generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots)); + } + } + + return values; +}; + +module.exports = function (object, opts) { + var obj = object; + var options = opts || {}; + var delimiter = typeof options.delimiter === 'undefined' ? defaults.delimiter : options.delimiter; + var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling; + var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : defaults.skipNulls; + var encode = typeof options.encode === 'boolean' ? options.encode : defaults.encode; + var encoder = encode ? (typeof options.encoder === 'function' ? options.encoder : defaults.encoder) : null; + var sort = typeof options.sort === 'function' ? options.sort : null; + var allowDots = typeof options.allowDots === 'undefined' ? false : options.allowDots; + var objKeys; + var filter; + + if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') { + throw new TypeError('Encoder has to be a function.'); + } + + if (typeof options.filter === 'function') { + filter = options.filter; + obj = filter('', obj); + } else if (Array.isArray(options.filter)) { + objKeys = filter = options.filter; + } + + var keys = []; + + if (typeof obj !== 'object' || obj === null) { + return ''; + } + + var arrayFormat; + if (options.arrayFormat in arrayPrefixGenerators) { + arrayFormat = options.arrayFormat; + } else if ('indices' in options) { + arrayFormat = options.indices ? 'indices' : 'repeat'; + } else { + arrayFormat = 'indices'; + } + + var generateArrayPrefix = arrayPrefixGenerators[arrayFormat]; + + if (!objKeys) { + objKeys = Object.keys(obj); + } + + if (sort) { + objKeys.sort(sort); + } + + for (var i = 0; i < objKeys.length; ++i) { + var key = objKeys[i]; + + if (skipNulls && obj[key] === null) { + continue; + } + + keys = keys.concat(stringify(obj[key], key, generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots)); + } + + return keys.join(delimiter); +}; + +},{"./utils":4}],4:[function(require,module,exports){ +'use strict'; + +var hexTable = (function () { + var array = new Array(256); + for (var i = 0; i < 256; ++i) { + array[i] = '%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase(); + } + + return array; +}()); + +exports.arrayToObject = function (source, options) { + var obj = options.plainObjects ? Object.create(null) : {}; + for (var i = 0; i < source.length; ++i) { + if (typeof source[i] !== 'undefined') { + obj[i] = source[i]; + } + } + + return obj; +}; + +exports.merge = function (target, source, options) { + if (!source) { + return target; + } + + if (typeof source !== 'object') { + if (Array.isArray(target)) { + target.push(source); + } else if (typeof target === 'object') { + target[source] = true; + } else { + return [target, source]; + } + + return target; + } + + if (typeof target !== 'object') { + return [target].concat(source); + } + + var mergeTarget = target; + if (Array.isArray(target) && !Array.isArray(source)) { + mergeTarget = exports.arrayToObject(target, options); + } + + return Object.keys(source).reduce(function (acc, key) { + var value = source[key]; + + if (Object.prototype.hasOwnProperty.call(acc, key)) { + acc[key] = exports.merge(acc[key], value, options); + } else { + acc[key] = value; + } + return acc; + }, mergeTarget); +}; + +exports.decode = function (str) { + try { + return decodeURIComponent(str.replace(/\+/g, ' ')); + } catch (e) { + return str; + } +}; + +exports.encode = function (str) { + // This code was originally written by Brian White (mscdex) for the io.js core querystring library. + // It has been adapted here for stricter adherence to RFC 3986 + if (str.length === 0) { + return str; + } + + var string = typeof str === 'string' ? str : String(str); + + var out = ''; + for (var i = 0; i < string.length; ++i) { + var c = string.charCodeAt(i); + + if ( + c === 0x2D || // - + c === 0x2E || // . + c === 0x5F || // _ + c === 0x7E || // ~ + (c >= 0x30 && c <= 0x39) || // 0-9 + (c >= 0x41 && c <= 0x5A) || // a-z + (c >= 0x61 && c <= 0x7A) // A-Z + ) { + out += string.charAt(i); + continue; + } + + if (c < 0x80) { + out = out + hexTable[c]; + continue; + } + + if (c < 0x800) { + out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]); + continue; + } + + if (c < 0xD800 || c >= 0xE000) { + out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]); + continue; + } + + i += 1; + c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF)); + out += hexTable[0xF0 | (c >> 18)] + hexTable[0x80 | ((c >> 12) & 0x3F)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]; + } + + return out; +}; + +exports.compact = function (obj, references) { + if (typeof obj !== 'object' || obj === null) { + return obj; + } + + var refs = references || []; + var lookup = refs.indexOf(obj); + if (lookup !== -1) { + return refs[lookup]; + } + + refs.push(obj); + + if (Array.isArray(obj)) { + var compacted = []; + + for (var i = 0; i < obj.length; ++i) { + if (obj[i] && typeof obj[i] === 'object') { + compacted.push(exports.compact(obj[i], refs)); + } else if (typeof obj[i] !== 'undefined') { + compacted.push(obj[i]); + } + } + + return compacted; + } + + var keys = Object.keys(obj); + for (var j = 0; j < keys.length; ++j) { + var key = keys[j]; + obj[key] = exports.compact(obj[key], refs); + } + + return obj; +}; + +exports.isRegExp = function (obj) { + return Object.prototype.toString.call(obj) === '[object RegExp]'; +}; + +exports.isBuffer = function (obj) { + if (obj === null || typeof obj === 'undefined') { + return false; + } + + return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); +}; + +},{}]},{},[1])(1) +}); \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/lib/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/lib/index.js new file mode 100644 index 00000000..19019590 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/lib/index.js @@ -0,0 +1,9 @@ +'use strict'; + +var Stringify = require('./stringify'); +var Parse = require('./parse'); + +module.exports = { + stringify: Stringify, + parse: Parse +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/lib/parse.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/lib/parse.js new file mode 100644 index 00000000..8b37cb3b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/lib/parse.js @@ -0,0 +1,166 @@ +'use strict'; + +var Utils = require('./utils'); + +var has = Object.prototype.hasOwnProperty; + +var defaults = { + delimiter: '&', + depth: 5, + arrayLimit: 20, + parameterLimit: 1000, + strictNullHandling: false, + plainObjects: false, + allowPrototypes: false, + allowDots: false, + decoder: Utils.decode +}; + +var parseValues = function parseValues(str, options) { + var obj = {}; + var parts = str.split(options.delimiter, options.parameterLimit === Infinity ? undefined : options.parameterLimit); + + for (var i = 0; i < parts.length; ++i) { + var part = parts[i]; + var pos = part.indexOf(']=') === -1 ? part.indexOf('=') : part.indexOf(']=') + 1; + + var key, val; + if (pos === -1) { + key = options.decoder(part); + val = options.strictNullHandling ? null : ''; + } else { + key = options.decoder(part.slice(0, pos)); + val = options.decoder(part.slice(pos + 1)); + } + if (has.call(obj, key)) { + obj[key] = [].concat(obj[key]).concat(val); + } else { + obj[key] = val; + } + } + + return obj; +}; + +var parseObject = function parseObject(chain, val, options) { + if (!chain.length) { + return val; + } + + var root = chain.shift(); + + var obj; + if (root === '[]') { + obj = []; + obj = obj.concat(parseObject(chain, val, options)); + } else { + obj = options.plainObjects ? Object.create(null) : {}; + var cleanRoot = root[0] === '[' && root[root.length - 1] === ']' ? root.slice(1, root.length - 1) : root; + var index = parseInt(cleanRoot, 10); + if ( + !isNaN(index) && + root !== cleanRoot && + String(index) === cleanRoot && + index >= 0 && + (options.parseArrays && index <= options.arrayLimit) + ) { + obj = []; + obj[index] = parseObject(chain, val, options); + } else { + obj[cleanRoot] = parseObject(chain, val, options); + } + } + + return obj; +}; + +var parseKeys = function parseKeys(givenKey, val, options) { + if (!givenKey) { + return; + } + + // Transform dot notation to bracket notation + var key = options.allowDots ? givenKey.replace(/\.([^\.\[]+)/g, '[$1]') : givenKey; + + // The regex chunks + + var parent = /^([^\[\]]*)/; + var child = /(\[[^\[\]]*\])/g; + + // Get the parent + + var segment = parent.exec(key); + + // Stash the parent if it exists + + var keys = []; + if (segment[1]) { + // If we aren't using plain objects, optionally prefix keys + // that would overwrite object prototype properties + if (!options.plainObjects && has.call(Object.prototype, segment[1])) { + if (!options.allowPrototypes) { + return; + } + } + + keys.push(segment[1]); + } + + // Loop through children appending to the array until we hit depth + + var i = 0; + while ((segment = child.exec(key)) !== null && i < options.depth) { + i += 1; + if (!options.plainObjects && has.call(Object.prototype, segment[1].replace(/\[|\]/g, ''))) { + if (!options.allowPrototypes) { + continue; + } + } + keys.push(segment[1]); + } + + // If there's a remainder, just add whatever is left + + if (segment) { + keys.push('[' + key.slice(segment.index) + ']'); + } + + return parseObject(keys, val, options); +}; + +module.exports = function (str, opts) { + var options = opts || {}; + + if (options.decoder !== null && options.decoder !== undefined && typeof options.decoder !== 'function') { + throw new TypeError('Decoder has to be a function.'); + } + + options.delimiter = typeof options.delimiter === 'string' || Utils.isRegExp(options.delimiter) ? options.delimiter : defaults.delimiter; + options.depth = typeof options.depth === 'number' ? options.depth : defaults.depth; + options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : defaults.arrayLimit; + options.parseArrays = options.parseArrays !== false; + options.decoder = typeof options.decoder === 'function' ? options.decoder : defaults.decoder; + options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : defaults.allowDots; + options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : defaults.plainObjects; + options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : defaults.allowPrototypes; + options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : defaults.parameterLimit; + options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling; + + if (str === '' || str === null || typeof str === 'undefined') { + return options.plainObjects ? Object.create(null) : {}; + } + + var tempObj = typeof str === 'string' ? parseValues(str, options) : str; + var obj = options.plainObjects ? Object.create(null) : {}; + + // Iterate over the keys and setup the new object + + var keys = Object.keys(tempObj); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + var newObj = parseKeys(key, tempObj[key], options); + obj = Utils.merge(obj, newObj, options); + } + + return Utils.compact(obj); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/lib/stringify.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/lib/stringify.js new file mode 100644 index 00000000..6e1c9a26 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/lib/stringify.js @@ -0,0 +1,137 @@ +'use strict'; + +var Utils = require('./utils'); + +var arrayPrefixGenerators = { + brackets: function brackets(prefix) { + return prefix + '[]'; + }, + indices: function indices(prefix, key) { + return prefix + '[' + key + ']'; + }, + repeat: function repeat(prefix) { + return prefix; + } +}; + +var defaults = { + delimiter: '&', + strictNullHandling: false, + skipNulls: false, + encode: true, + encoder: Utils.encode +}; + +var stringify = function stringify(object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots) { + var obj = object; + if (typeof filter === 'function') { + obj = filter(prefix, obj); + } else if (obj instanceof Date) { + obj = obj.toISOString(); + } else if (obj === null) { + if (strictNullHandling) { + return encoder ? encoder(prefix) : prefix; + } + + obj = ''; + } + + if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || Utils.isBuffer(obj)) { + if (encoder) { + return [encoder(prefix) + '=' + encoder(obj)]; + } + return [prefix + '=' + String(obj)]; + } + + var values = []; + + if (typeof obj === 'undefined') { + return values; + } + + var objKeys; + if (Array.isArray(filter)) { + objKeys = filter; + } else { + var keys = Object.keys(obj); + objKeys = sort ? keys.sort(sort) : keys; + } + + for (var i = 0; i < objKeys.length; ++i) { + var key = objKeys[i]; + + if (skipNulls && obj[key] === null) { + continue; + } + + if (Array.isArray(obj)) { + values = values.concat(stringify(obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots)); + } else { + values = values.concat(stringify(obj[key], prefix + (allowDots ? '.' + key : '[' + key + ']'), generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots)); + } + } + + return values; +}; + +module.exports = function (object, opts) { + var obj = object; + var options = opts || {}; + var delimiter = typeof options.delimiter === 'undefined' ? defaults.delimiter : options.delimiter; + var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling; + var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : defaults.skipNulls; + var encode = typeof options.encode === 'boolean' ? options.encode : defaults.encode; + var encoder = encode ? (typeof options.encoder === 'function' ? options.encoder : defaults.encoder) : null; + var sort = typeof options.sort === 'function' ? options.sort : null; + var allowDots = typeof options.allowDots === 'undefined' ? false : options.allowDots; + var objKeys; + var filter; + + if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') { + throw new TypeError('Encoder has to be a function.'); + } + + if (typeof options.filter === 'function') { + filter = options.filter; + obj = filter('', obj); + } else if (Array.isArray(options.filter)) { + objKeys = filter = options.filter; + } + + var keys = []; + + if (typeof obj !== 'object' || obj === null) { + return ''; + } + + var arrayFormat; + if (options.arrayFormat in arrayPrefixGenerators) { + arrayFormat = options.arrayFormat; + } else if ('indices' in options) { + arrayFormat = options.indices ? 'indices' : 'repeat'; + } else { + arrayFormat = 'indices'; + } + + var generateArrayPrefix = arrayPrefixGenerators[arrayFormat]; + + if (!objKeys) { + objKeys = Object.keys(obj); + } + + if (sort) { + objKeys.sort(sort); + } + + for (var i = 0; i < objKeys.length; ++i) { + var key = objKeys[i]; + + if (skipNulls && obj[key] === null) { + continue; + } + + keys = keys.concat(stringify(obj[key], key, generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots)); + } + + return keys.join(delimiter); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/lib/utils.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/lib/utils.js new file mode 100644 index 00000000..2c5c8ee5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/lib/utils.js @@ -0,0 +1,164 @@ +'use strict'; + +var hexTable = (function () { + var array = new Array(256); + for (var i = 0; i < 256; ++i) { + array[i] = '%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase(); + } + + return array; +}()); + +exports.arrayToObject = function (source, options) { + var obj = options.plainObjects ? Object.create(null) : {}; + for (var i = 0; i < source.length; ++i) { + if (typeof source[i] !== 'undefined') { + obj[i] = source[i]; + } + } + + return obj; +}; + +exports.merge = function (target, source, options) { + if (!source) { + return target; + } + + if (typeof source !== 'object') { + if (Array.isArray(target)) { + target.push(source); + } else if (typeof target === 'object') { + target[source] = true; + } else { + return [target, source]; + } + + return target; + } + + if (typeof target !== 'object') { + return [target].concat(source); + } + + var mergeTarget = target; + if (Array.isArray(target) && !Array.isArray(source)) { + mergeTarget = exports.arrayToObject(target, options); + } + + return Object.keys(source).reduce(function (acc, key) { + var value = source[key]; + + if (Object.prototype.hasOwnProperty.call(acc, key)) { + acc[key] = exports.merge(acc[key], value, options); + } else { + acc[key] = value; + } + return acc; + }, mergeTarget); +}; + +exports.decode = function (str) { + try { + return decodeURIComponent(str.replace(/\+/g, ' ')); + } catch (e) { + return str; + } +}; + +exports.encode = function (str) { + // This code was originally written by Brian White (mscdex) for the io.js core querystring library. + // It has been adapted here for stricter adherence to RFC 3986 + if (str.length === 0) { + return str; + } + + var string = typeof str === 'string' ? str : String(str); + + var out = ''; + for (var i = 0; i < string.length; ++i) { + var c = string.charCodeAt(i); + + if ( + c === 0x2D || // - + c === 0x2E || // . + c === 0x5F || // _ + c === 0x7E || // ~ + (c >= 0x30 && c <= 0x39) || // 0-9 + (c >= 0x41 && c <= 0x5A) || // a-z + (c >= 0x61 && c <= 0x7A) // A-Z + ) { + out += string.charAt(i); + continue; + } + + if (c < 0x80) { + out = out + hexTable[c]; + continue; + } + + if (c < 0x800) { + out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]); + continue; + } + + if (c < 0xD800 || c >= 0xE000) { + out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]); + continue; + } + + i += 1; + c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF)); + out += hexTable[0xF0 | (c >> 18)] + hexTable[0x80 | ((c >> 12) & 0x3F)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]; + } + + return out; +}; + +exports.compact = function (obj, references) { + if (typeof obj !== 'object' || obj === null) { + return obj; + } + + var refs = references || []; + var lookup = refs.indexOf(obj); + if (lookup !== -1) { + return refs[lookup]; + } + + refs.push(obj); + + if (Array.isArray(obj)) { + var compacted = []; + + for (var i = 0; i < obj.length; ++i) { + if (obj[i] && typeof obj[i] === 'object') { + compacted.push(exports.compact(obj[i], refs)); + } else if (typeof obj[i] !== 'undefined') { + compacted.push(obj[i]); + } + } + + return compacted; + } + + var keys = Object.keys(obj); + for (var j = 0; j < keys.length; ++j) { + var key = keys[j]; + obj[key] = exports.compact(obj[key], refs); + } + + return obj; +}; + +exports.isRegExp = function (obj) { + return Object.prototype.toString.call(obj) === '[object RegExp]'; +}; + +exports.isBuffer = function (obj) { + if (obj === null || typeof obj === 'undefined') { + return false; + } + + return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/package.json new file mode 100644 index 00000000..a3cff0a0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/package.json @@ -0,0 +1,87 @@ +{ + "name": "qs", + "description": "A querystring parser that supports nesting and arrays, with a depth limit", + "homepage": "https://github.com/ljharb/qs", + "version": "6.2.1", + "repository": { + "type": "git", + "url": "git+https://github.com/ljharb/qs.git" + }, + "main": "lib/index.js", + "contributors": [ + { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + } + ], + "keywords": [ + "querystring", + "qs" + ], + "engines": { + "node": ">=0.6" + }, + "dependencies": {}, + "devDependencies": { + "browserify": "^13.0.1", + "tape": "^4.6.0", + "covert": "^1.1.0", + "mkdirp": "^0.5.1", + "eslint": "^3.1.0", + "@ljharb/eslint-config": "^6.0.0", + "parallelshell": "^2.0.0", + "iconv-lite": "^0.4.13", + "qs-iconv": "^1.0.3", + "evalmd": "^0.0.17" + }, + "scripts": { + "pretest": "npm run --silent readme && npm run --silent lint", + "test": "npm run --silent coverage", + "tests-only": "node test", + "readme": "evalmd README.md", + "lint": "eslint lib/*.js text/*.js", + "coverage": "covert test", + "dist": "mkdirp dist && browserify --standalone Qs lib/index.js > dist/qs.js", + "prepublish": "npm run dist" + }, + "license": "BSD-3-Clause", + "gitHead": "335f839142e6c2c69f5302c4940d92acb0e77561", + "bugs": { + "url": "https://github.com/ljharb/qs/issues" + }, + "_id": "qs@6.2.1", + "_shasum": "ce03c5ff0935bc1d9d69a9f14cbd18e568d67625", + "_from": "qs@>=6.2.0 <6.3.0", + "_npmVersion": "3.10.3", + "_nodeVersion": "6.3.0", + "_npmUser": { + "name": "ljharb", + "email": "ljharb@gmail.com" + }, + "dist": { + "shasum": "ce03c5ff0935bc1d9d69a9f14cbd18e568d67625", + "tarball": "https://registry.npmjs.org/qs/-/qs-6.2.1.tgz" + }, + "maintainers": [ + { + "name": "hueniverse", + "email": "eran@hammer.io" + }, + { + "name": "ljharb", + "email": "ljharb@gmail.com" + }, + { + "name": "nlf", + "email": "quitlahok@gmail.com" + } + ], + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/qs-6.2.1.tgz_1469044929716_0.06957711698487401" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/qs/-/qs-6.2.1.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/test/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/test/index.js new file mode 100644 index 00000000..b6a7d952 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/test/index.js @@ -0,0 +1,5 @@ +require('./parse'); + +require('./stringify'); + +require('./utils'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/test/parse.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/test/parse.js new file mode 100644 index 00000000..ccf8c8c4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/test/parse.js @@ -0,0 +1,451 @@ +'use strict'; + +var test = require('tape'); +var qs = require('../'); +var iconv = require('iconv-lite'); + +test('parse()', function (t) { + t.test('parses a simple string', function (st) { + st.deepEqual(qs.parse('0=foo'), { '0': 'foo' }); + st.deepEqual(qs.parse('foo=c++'), { foo: 'c ' }); + st.deepEqual(qs.parse('a[>=]=23'), { a: { '>=': '23' } }); + st.deepEqual(qs.parse('a[<=>]==23'), { a: { '<=>': '=23' } }); + st.deepEqual(qs.parse('a[==]=23'), { a: { '==': '23' } }); + st.deepEqual(qs.parse('foo', { strictNullHandling: true }), { foo: null }); + st.deepEqual(qs.parse('foo'), { foo: '' }); + st.deepEqual(qs.parse('foo='), { foo: '' }); + st.deepEqual(qs.parse('foo=bar'), { foo: 'bar' }); + st.deepEqual(qs.parse(' foo = bar = baz '), { ' foo ': ' bar = baz ' }); + st.deepEqual(qs.parse('foo=bar=baz'), { foo: 'bar=baz' }); + st.deepEqual(qs.parse('foo=bar&bar=baz'), { foo: 'bar', bar: 'baz' }); + st.deepEqual(qs.parse('foo2=bar2&baz2='), { foo2: 'bar2', baz2: '' }); + st.deepEqual(qs.parse('foo=bar&baz', { strictNullHandling: true }), { foo: 'bar', baz: null }); + st.deepEqual(qs.parse('foo=bar&baz'), { foo: 'bar', baz: '' }); + st.deepEqual(qs.parse('cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World'), { + cht: 'p3', + chd: 't:60,40', + chs: '250x100', + chl: 'Hello|World' + }); + st.end(); + }); + + t.test('allows enabling dot notation', function (st) { + st.deepEqual(qs.parse('a.b=c'), { 'a.b': 'c' }); + st.deepEqual(qs.parse('a.b=c', { allowDots: true }), { a: { b: 'c' } }); + st.end(); + }); + + t.deepEqual(qs.parse('a[b]=c'), { a: { b: 'c' } }, 'parses a single nested string'); + t.deepEqual(qs.parse('a[b][c]=d'), { a: { b: { c: 'd' } } }, 'parses a double nested string'); + t.deepEqual( + qs.parse('a[b][c][d][e][f][g][h]=i'), + { a: { b: { c: { d: { e: { f: { '[g][h]': 'i' } } } } } } }, + 'defaults to a depth of 5' + ); + + t.test('only parses one level when depth = 1', function (st) { + st.deepEqual(qs.parse('a[b][c]=d', { depth: 1 }), { a: { b: { '[c]': 'd' } } }); + st.deepEqual(qs.parse('a[b][c][d]=e', { depth: 1 }), { a: { b: { '[c][d]': 'e' } } }); + st.end(); + }); + + t.deepEqual(qs.parse('a=b&a=c'), { a: ['b', 'c'] }, 'parses a simple array'); + + t.test('parses an explicit array', function (st) { + st.deepEqual(qs.parse('a[]=b'), { a: ['b'] }); + st.deepEqual(qs.parse('a[]=b&a[]=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[]=b&a[]=c&a[]=d'), { a: ['b', 'c', 'd'] }); + st.end(); + }); + + t.test('parses a mix of simple and explicit arrays', function (st) { + st.deepEqual(qs.parse('a=b&a[]=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[]=b&a=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[0]=b&a=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a=b&a[0]=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[1]=b&a=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a=b&a[1]=c'), { a: ['b', 'c'] }); + st.end(); + }); + + t.test('parses a nested array', function (st) { + st.deepEqual(qs.parse('a[b][]=c&a[b][]=d'), { a: { b: ['c', 'd'] } }); + st.deepEqual(qs.parse('a[>=]=25'), { a: { '>=': '25' } }); + st.end(); + }); + + t.test('allows to specify array indices', function (st) { + st.deepEqual(qs.parse('a[1]=c&a[0]=b&a[2]=d'), { a: ['b', 'c', 'd'] }); + st.deepEqual(qs.parse('a[1]=c&a[0]=b'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[1]=c'), { a: ['c'] }); + st.end(); + }); + + t.test('limits specific array indices to 20', function (st) { + st.deepEqual(qs.parse('a[20]=a'), { a: ['a'] }); + st.deepEqual(qs.parse('a[21]=a'), { a: { '21': 'a' } }); + st.end(); + }); + + t.deepEqual(qs.parse('a[12b]=c'), { a: { '12b': 'c' } }, 'supports keys that begin with a number'); + + t.test('supports encoded = signs', function (st) { + st.deepEqual(qs.parse('he%3Dllo=th%3Dere'), { 'he=llo': 'th=ere' }); + st.end(); + }); + + t.test('is ok with url encoded strings', function (st) { + st.deepEqual(qs.parse('a[b%20c]=d'), { a: { 'b c': 'd' } }); + st.deepEqual(qs.parse('a[b]=c%20d'), { a: { b: 'c d' } }); + st.end(); + }); + + t.test('allows brackets in the value', function (st) { + st.deepEqual(qs.parse('pets=["tobi"]'), { pets: '["tobi"]' }); + st.deepEqual(qs.parse('operators=[">=", "<="]'), { operators: '[">=", "<="]' }); + st.end(); + }); + + t.test('allows empty values', function (st) { + st.deepEqual(qs.parse(''), {}); + st.deepEqual(qs.parse(null), {}); + st.deepEqual(qs.parse(undefined), {}); + st.end(); + }); + + t.test('transforms arrays to objects', function (st) { + st.deepEqual(qs.parse('foo[0]=bar&foo[bad]=baz'), { foo: { '0': 'bar', bad: 'baz' } }); + st.deepEqual(qs.parse('foo[bad]=baz&foo[0]=bar'), { foo: { bad: 'baz', '0': 'bar' } }); + st.deepEqual(qs.parse('foo[bad]=baz&foo[]=bar'), { foo: { bad: 'baz', '0': 'bar' } }); + st.deepEqual(qs.parse('foo[]=bar&foo[bad]=baz'), { foo: { '0': 'bar', bad: 'baz' } }); + st.deepEqual(qs.parse('foo[bad]=baz&foo[]=bar&foo[]=foo'), { foo: { bad: 'baz', '0': 'bar', '1': 'foo' } }); + st.deepEqual(qs.parse('foo[0][a]=a&foo[0][b]=b&foo[1][a]=aa&foo[1][b]=bb'), { foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] }); + + st.deepEqual(qs.parse('a[]=b&a[t]=u&a[hasOwnProperty]=c', { allowPrototypes: false }), { a: { '0': 'b', c: true, t: 'u' } }); + st.deepEqual(qs.parse('a[]=b&a[t]=u&a[hasOwnProperty]=c', { allowPrototypes: true }), { a: { '0': 'b', t: 'u', hasOwnProperty: 'c' } }); + st.deepEqual(qs.parse('a[]=b&a[hasOwnProperty]=c&a[x]=y', { allowPrototypes: false }), { a: { '0': 'b', '1': 'c', x: 'y' } }); + st.deepEqual(qs.parse('a[]=b&a[hasOwnProperty]=c&a[x]=y', { allowPrototypes: true }), { a: { '0': 'b', hasOwnProperty: 'c', x: 'y' } }); + st.end(); + }); + + t.test('transforms arrays to objects (dot notation)', function (st) { + st.deepEqual(qs.parse('foo[0].baz=bar&fool.bad=baz', { allowDots: true }), { foo: [{ baz: 'bar' }], fool: { bad: 'baz' } }); + st.deepEqual(qs.parse('foo[0].baz=bar&fool.bad.boo=baz', { allowDots: true }), { foo: [{ baz: 'bar' }], fool: { bad: { boo: 'baz' } } }); + st.deepEqual(qs.parse('foo[0][0].baz=bar&fool.bad=baz', { allowDots: true }), { foo: [[{ baz: 'bar' }]], fool: { bad: 'baz' } }); + st.deepEqual(qs.parse('foo[0].baz[0]=15&foo[0].bar=2', { allowDots: true }), { foo: [{ baz: ['15'], bar: '2' }] }); + st.deepEqual(qs.parse('foo[0].baz[0]=15&foo[0].baz[1]=16&foo[0].bar=2', { allowDots: true }), { foo: [{ baz: ['15', '16'], bar: '2' }] }); + st.deepEqual(qs.parse('foo.bad=baz&foo[0]=bar', { allowDots: true }), { foo: { bad: 'baz', '0': 'bar' } }); + st.deepEqual(qs.parse('foo.bad=baz&foo[]=bar', { allowDots: true }), { foo: { bad: 'baz', '0': 'bar' } }); + st.deepEqual(qs.parse('foo[]=bar&foo.bad=baz', { allowDots: true }), { foo: { '0': 'bar', bad: 'baz' } }); + st.deepEqual(qs.parse('foo.bad=baz&foo[]=bar&foo[]=foo', { allowDots: true }), { foo: { bad: 'baz', '0': 'bar', '1': 'foo' } }); + st.deepEqual(qs.parse('foo[0].a=a&foo[0].b=b&foo[1].a=aa&foo[1].b=bb', { allowDots: true }), { foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] }); + st.end(); + }); + + t.deepEqual(qs.parse('a[b]=c&a=d'), { a: { b: 'c', d: true } }, 'can add keys to objects'); + + t.test('correctly prunes undefined values when converting an array to an object', function (st) { + st.deepEqual(qs.parse('a[2]=b&a[99999999]=c'), { a: { '2': 'b', '99999999': 'c' } }); + st.end(); + }); + + t.test('supports malformed uri characters', function (st) { + st.deepEqual(qs.parse('{%:%}', { strictNullHandling: true }), { '{%:%}': null }); + st.deepEqual(qs.parse('{%:%}='), { '{%:%}': '' }); + st.deepEqual(qs.parse('foo=%:%}'), { foo: '%:%}' }); + st.end(); + }); + + t.test('doesn\'t produce empty keys', function (st) { + st.deepEqual(qs.parse('_r=1&'), { '_r': '1' }); + st.end(); + }); + + t.test('cannot access Object prototype', function (st) { + qs.parse('constructor[prototype][bad]=bad'); + qs.parse('bad[constructor][prototype][bad]=bad'); + st.equal(typeof Object.prototype.bad, 'undefined'); + st.end(); + }); + + t.test('parses arrays of objects', function (st) { + st.deepEqual(qs.parse('a[][b]=c'), { a: [{ b: 'c' }] }); + st.deepEqual(qs.parse('a[0][b]=c'), { a: [{ b: 'c' }] }); + st.end(); + }); + + t.test('allows for empty strings in arrays', function (st) { + st.deepEqual(qs.parse('a[]=b&a[]=&a[]=c'), { a: ['b', '', 'c'] }); + + st.deepEqual( + qs.parse('a[0]=b&a[1]&a[2]=c&a[19]=', { strictNullHandling: true, arrayLimit: 20 }), + { a: ['b', null, 'c', ''] }, + 'with arrayLimit 20 + array indices: null then empty string works' + ); + st.deepEqual( + qs.parse('a[]=b&a[]&a[]=c&a[]=', { strictNullHandling: true, arrayLimit: 0 }), + { a: ['b', null, 'c', ''] }, + 'with arrayLimit 0 + array brackets: null then empty string works' + ); + + st.deepEqual( + qs.parse('a[0]=b&a[1]=&a[2]=c&a[19]', { strictNullHandling: true, arrayLimit: 20 }), + { a: ['b', '', 'c', null] }, + 'with arrayLimit 20 + array indices: empty string then null works' + ); + st.deepEqual( + qs.parse('a[]=b&a[]=&a[]=c&a[]', { strictNullHandling: true, arrayLimit: 0 }), + { a: ['b', '', 'c', null] }, + 'with arrayLimit 0 + array brackets: empty string then null works' + ); + + st.deepEqual( + qs.parse('a[]=&a[]=b&a[]=c'), + { a: ['', 'b', 'c'] }, + 'array brackets: empty strings work' + ); + st.end(); + }); + + t.test('compacts sparse arrays', function (st) { + st.deepEqual(qs.parse('a[10]=1&a[2]=2'), { a: ['2', '1'] }); + st.deepEqual(qs.parse('a[1][b][2][c]=1'), { a: [{ b: [{ c: '1' }] }] }); + st.deepEqual(qs.parse('a[1][2][3][c]=1'), { a: [[[{ c: '1' }]]] }); + st.deepEqual(qs.parse('a[1][2][3][c][1]=1'), { a: [[[{ c: ['1'] }]]] }); + st.end(); + }); + + t.test('parses semi-parsed strings', function (st) { + st.deepEqual(qs.parse({ 'a[b]': 'c' }), { a: { b: 'c' } }); + st.deepEqual(qs.parse({ 'a[b]': 'c', 'a[d]': 'e' }), { a: { b: 'c', d: 'e' } }); + st.end(); + }); + + t.test('parses buffers correctly', function (st) { + var b = new Buffer('test'); + st.deepEqual(qs.parse({ a: b }), { a: b }); + st.end(); + }); + + t.test('continues parsing when no parent is found', function (st) { + st.deepEqual(qs.parse('[]=&a=b'), { '0': '', a: 'b' }); + st.deepEqual(qs.parse('[]&a=b', { strictNullHandling: true }), { '0': null, a: 'b' }); + st.deepEqual(qs.parse('[foo]=bar'), { foo: 'bar' }); + st.end(); + }); + + t.test('does not error when parsing a very long array', function (st) { + var str = 'a[]=a'; + while (Buffer.byteLength(str) < 128 * 1024) { + str = str + '&' + str; + } + + st.doesNotThrow(function () { qs.parse(str); }); + + st.end(); + }); + + t.test('should not throw when a native prototype has an enumerable property', { parallel: false }, function (st) { + Object.prototype.crash = ''; + Array.prototype.crash = ''; + st.doesNotThrow(qs.parse.bind(null, 'a=b')); + st.deepEqual(qs.parse('a=b'), { a: 'b' }); + st.doesNotThrow(qs.parse.bind(null, 'a[][b]=c')); + st.deepEqual(qs.parse('a[][b]=c'), { a: [{ b: 'c' }] }); + delete Object.prototype.crash; + delete Array.prototype.crash; + st.end(); + }); + + t.test('parses a string with an alternative string delimiter', function (st) { + st.deepEqual(qs.parse('a=b;c=d', { delimiter: ';' }), { a: 'b', c: 'd' }); + st.end(); + }); + + t.test('parses a string with an alternative RegExp delimiter', function (st) { + st.deepEqual(qs.parse('a=b; c=d', { delimiter: /[;,] */ }), { a: 'b', c: 'd' }); + st.end(); + }); + + t.test('does not use non-splittable objects as delimiters', function (st) { + st.deepEqual(qs.parse('a=b&c=d', { delimiter: true }), { a: 'b', c: 'd' }); + st.end(); + }); + + t.test('allows overriding parameter limit', function (st) { + st.deepEqual(qs.parse('a=b&c=d', { parameterLimit: 1 }), { a: 'b' }); + st.end(); + }); + + t.test('allows setting the parameter limit to Infinity', function (st) { + st.deepEqual(qs.parse('a=b&c=d', { parameterLimit: Infinity }), { a: 'b', c: 'd' }); + st.end(); + }); + + t.test('allows overriding array limit', function (st) { + st.deepEqual(qs.parse('a[0]=b', { arrayLimit: -1 }), { a: { '0': 'b' } }); + st.deepEqual(qs.parse('a[-1]=b', { arrayLimit: -1 }), { a: { '-1': 'b' } }); + st.deepEqual(qs.parse('a[0]=b&a[1]=c', { arrayLimit: 0 }), { a: { '0': 'b', '1': 'c' } }); + st.end(); + }); + + t.test('allows disabling array parsing', function (st) { + st.deepEqual(qs.parse('a[0]=b&a[1]=c', { parseArrays: false }), { a: { '0': 'b', '1': 'c' } }); + st.end(); + }); + + t.test('parses an object', function (st) { + var input = { + 'user[name]': { 'pop[bob]': 3 }, + 'user[email]': null + }; + + var expected = { + user: { + name: { 'pop[bob]': 3 }, + email: null + } + }; + + var result = qs.parse(input); + + st.deepEqual(result, expected); + st.end(); + }); + + t.test('parses an object in dot notation', function (st) { + var input = { + 'user.name': { 'pop[bob]': 3 }, + 'user.email.': null + }; + + var expected = { + user: { + name: { 'pop[bob]': 3 }, + email: null + } + }; + + var result = qs.parse(input, { allowDots: true }); + + st.deepEqual(result, expected); + st.end(); + }); + + t.test('parses an object and not child values', function (st) { + var input = { + 'user[name]': { 'pop[bob]': { 'test': 3 } }, + 'user[email]': null + }; + + var expected = { + user: { + name: { 'pop[bob]': { 'test': 3 } }, + email: null + } + }; + + var result = qs.parse(input); + + st.deepEqual(result, expected); + st.end(); + }); + + t.test('does not blow up when Buffer global is missing', function (st) { + var tempBuffer = global.Buffer; + delete global.Buffer; + var result = qs.parse('a=b&c=d'); + global.Buffer = tempBuffer; + st.deepEqual(result, { a: 'b', c: 'd' }); + st.end(); + }); + + t.test('does not crash when parsing circular references', function (st) { + var a = {}; + a.b = a; + + var parsed; + + st.doesNotThrow(function () { + parsed = qs.parse({ 'foo[bar]': 'baz', 'foo[baz]': a }); + }); + + st.equal('foo' in parsed, true, 'parsed has "foo" property'); + st.equal('bar' in parsed.foo, true); + st.equal('baz' in parsed.foo, true); + st.equal(parsed.foo.bar, 'baz'); + st.deepEqual(parsed.foo.baz, a); + st.end(); + }); + + t.test('parses plain objects correctly', function (st) { + var a = Object.create(null); + a.b = 'c'; + + st.deepEqual(qs.parse(a), { b: 'c' }); + var result = qs.parse({ a: a }); + st.equal('a' in result, true, 'result has "a" property'); + st.deepEqual(result.a, a); + st.end(); + }); + + t.test('parses dates correctly', function (st) { + var now = new Date(); + st.deepEqual(qs.parse({ a: now }), { a: now }); + st.end(); + }); + + t.test('parses regular expressions correctly', function (st) { + var re = /^test$/; + st.deepEqual(qs.parse({ a: re }), { a: re }); + st.end(); + }); + + t.test('can allow overwriting prototype properties', function (st) { + st.deepEqual(qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true }), { a: { hasOwnProperty: 'b' } }, { prototype: false }); + st.deepEqual(qs.parse('hasOwnProperty=b', { allowPrototypes: true }), { hasOwnProperty: 'b' }, { prototype: false }); + st.end(); + }); + + t.test('can return plain objects', function (st) { + var expected = Object.create(null); + expected.a = Object.create(null); + expected.a.b = 'c'; + expected.a.hasOwnProperty = 'd'; + st.deepEqual(qs.parse('a[b]=c&a[hasOwnProperty]=d', { plainObjects: true }), expected); + st.deepEqual(qs.parse(null, { plainObjects: true }), Object.create(null)); + var expectedArray = Object.create(null); + expectedArray.a = Object.create(null); + expectedArray.a['0'] = 'b'; + expectedArray.a.c = 'd'; + st.deepEqual(qs.parse('a[]=b&a[c]=d', { plainObjects: true }), expectedArray); + st.end(); + }); + + t.test('can parse with custom encoding', function (st) { + st.deepEqual(qs.parse('%8c%a7=%91%e5%8d%e3%95%7b', { + decoder: function (str) { + var reg = /\%([0-9A-F]{2})/ig; + var result = []; + var parts; + var last = 0; + while (parts = reg.exec(str)) { + result.push(parseInt(parts[1], 16)); + last = parts.index + parts[0].length; + } + return iconv.decode(new Buffer(result), 'shift_jis').toString(); + } + }), { 県: '大阪府' }); + st.end(); + }); + + t.test('throws error with wrong decoder', function (st) { + st.throws(function () { + qs.parse({}, { + decoder: 'string' + }); + }, new TypeError('Decoder has to be a function.')); + st.end(); + }); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/test/stringify.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/test/stringify.js new file mode 100644 index 00000000..699397e3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/test/stringify.js @@ -0,0 +1,305 @@ +'use strict'; + +var test = require('tape'); +var qs = require('../'); +var iconv = require('iconv-lite'); + +test('stringify()', function (t) { + t.test('stringifies a querystring object', function (st) { + st.equal(qs.stringify({ a: 'b' }), 'a=b'); + st.equal(qs.stringify({ a: 1 }), 'a=1'); + st.equal(qs.stringify({ a: 1, b: 2 }), 'a=1&b=2'); + st.equal(qs.stringify({ a: 'A_Z' }), 'a=A_Z'); + st.equal(qs.stringify({ a: '€' }), 'a=%E2%82%AC'); + st.equal(qs.stringify({ a: '' }), 'a=%EE%80%80'); + st.equal(qs.stringify({ a: 'א' }), 'a=%D7%90'); + st.equal(qs.stringify({ a: '𐐷' }), 'a=%F0%90%90%B7'); + st.end(); + }); + + t.test('stringifies a nested object', function (st) { + st.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c'); + st.equal(qs.stringify({ a: { b: { c: { d: 'e' } } } }), 'a%5Bb%5D%5Bc%5D%5Bd%5D=e'); + st.end(); + }); + + t.test('stringifies a nested object with dots notation', function (st) { + st.equal(qs.stringify({ a: { b: 'c' } }, { allowDots: true }), 'a.b=c'); + st.equal(qs.stringify({ a: { b: { c: { d: 'e' } } } }, { allowDots: true }), 'a.b.c.d=e'); + st.end(); + }); + + t.test('stringifies an array value', function (st) { + st.equal(qs.stringify({ a: ['b', 'c', 'd'] }), 'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d'); + st.end(); + }); + + t.test('omits nulls when asked', function (st) { + st.equal(qs.stringify({ a: 'b', c: null }, { skipNulls: true }), 'a=b'); + st.end(); + }); + + + t.test('omits nested nulls when asked', function (st) { + st.equal(qs.stringify({ a: { b: 'c', d: null } }, { skipNulls: true }), 'a%5Bb%5D=c'); + st.end(); + }); + + t.test('omits array indices when asked', function (st) { + st.equal(qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false }), 'a=b&a=c&a=d'); + st.end(); + }); + + t.test('stringifies a nested array value', function (st) { + st.equal(qs.stringify({ a: { b: ['c', 'd'] } }), 'a%5Bb%5D%5B0%5D=c&a%5Bb%5D%5B1%5D=d'); + st.end(); + }); + + t.test('stringifies a nested array value with dots notation', function (st) { + st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { allowDots: true, encode: false }), 'a.b[0]=c&a.b[1]=d'); + st.end(); + }); + + t.test('stringifies an object inside an array', function (st) { + st.equal(qs.stringify({ a: [{ b: 'c' }] }), 'a%5B0%5D%5Bb%5D=c'); + st.equal(qs.stringify({ a: [{ b: { c: [1] } }] }), 'a%5B0%5D%5Bb%5D%5Bc%5D%5B0%5D=1'); + st.end(); + }); + + t.test('stringifies an array with mixed objects and primitives', function (st) { + st.equal(qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encode: false }), 'a[0][b]=1&a[1]=2&a[2]=3'); + st.end(); + }); + + t.test('stringifies an object inside an array with dots notation', function (st) { + st.equal(qs.stringify({ a: [{ b: 'c' }] }, { allowDots: true, encode: false }), 'a[0].b=c'); + st.equal(qs.stringify({ a: [{ b: { c: [1] } }] }, { allowDots: true, encode: false }), 'a[0].b.c[0]=1'); + st.end(); + }); + + t.test('does not omit object keys when indices = false', function (st) { + st.equal(qs.stringify({ a: [{ b: 'c' }] }, { indices: false }), 'a%5Bb%5D=c'); + st.end(); + }); + + t.test('uses indices notation for arrays when indices=true', function (st) { + st.equal(qs.stringify({ a: ['b', 'c'] }, { indices: true }), 'a%5B0%5D=b&a%5B1%5D=c'); + st.end(); + }); + + t.test('uses indices notation for arrays when no arrayFormat is specified', function (st) { + st.equal(qs.stringify({ a: ['b', 'c'] }), 'a%5B0%5D=b&a%5B1%5D=c'); + st.end(); + }); + + t.test('uses indices notation for arrays when no arrayFormat=indices', function (st) { + st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' }), 'a%5B0%5D=b&a%5B1%5D=c'); + st.end(); + }); + + t.test('uses repeat notation for arrays when no arrayFormat=repeat', function (st) { + st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' }), 'a=b&a=c'); + st.end(); + }); + + t.test('uses brackets notation for arrays when no arrayFormat=brackets', function (st) { + st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' }), 'a%5B%5D=b&a%5B%5D=c'); + st.end(); + }); + + t.test('stringifies a complicated object', function (st) { + st.equal(qs.stringify({ a: { b: 'c', d: 'e' } }), 'a%5Bb%5D=c&a%5Bd%5D=e'); + st.end(); + }); + + t.test('stringifies an empty value', function (st) { + st.equal(qs.stringify({ a: '' }), 'a='); + st.equal(qs.stringify({ a: null }, { strictNullHandling: true }), 'a'); + + st.equal(qs.stringify({ a: '', b: '' }), 'a=&b='); + st.equal(qs.stringify({ a: null, b: '' }, { strictNullHandling: true }), 'a&b='); + + st.equal(qs.stringify({ a: { b: '' } }), 'a%5Bb%5D='); + st.equal(qs.stringify({ a: { b: null } }, { strictNullHandling: true }), 'a%5Bb%5D'); + st.equal(qs.stringify({ a: { b: null } }, { strictNullHandling: false }), 'a%5Bb%5D='); + + st.end(); + }); + + t.test('stringifies an empty object', function (st) { + var obj = Object.create(null); + obj.a = 'b'; + st.equal(qs.stringify(obj), 'a=b'); + st.end(); + }); + + t.test('returns an empty string for invalid input', function (st) { + st.equal(qs.stringify(undefined), ''); + st.equal(qs.stringify(false), ''); + st.equal(qs.stringify(null), ''); + st.equal(qs.stringify(''), ''); + st.end(); + }); + + t.test('stringifies an object with an empty object as a child', function (st) { + var obj = { + a: Object.create(null) + }; + + obj.a.b = 'c'; + st.equal(qs.stringify(obj), 'a%5Bb%5D=c'); + st.end(); + }); + + t.test('drops keys with a value of undefined', function (st) { + st.equal(qs.stringify({ a: undefined }), ''); + + st.equal(qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: true }), 'a%5Bc%5D'); + st.equal(qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: false }), 'a%5Bc%5D='); + st.equal(qs.stringify({ a: { b: undefined, c: '' } }), 'a%5Bc%5D='); + st.end(); + }); + + t.test('url encodes values', function (st) { + st.equal(qs.stringify({ a: 'b c' }), 'a=b%20c'); + st.end(); + }); + + t.test('stringifies a date', function (st) { + var now = new Date(); + var str = 'a=' + encodeURIComponent(now.toISOString()); + st.equal(qs.stringify({ a: now }), str); + st.end(); + }); + + t.test('stringifies the weird object from qs', function (st) { + st.equal(qs.stringify({ 'my weird field': '~q1!2"\'w$5&7/z8)?' }), 'my%20weird%20field=~q1%212%22%27w%245%267%2Fz8%29%3F'); + st.end(); + }); + + t.test('skips properties that are part of the object prototype', function (st) { + Object.prototype.crash = 'test'; + st.equal(qs.stringify({ a: 'b' }), 'a=b'); + st.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c'); + delete Object.prototype.crash; + st.end(); + }); + + t.test('stringifies boolean values', function (st) { + st.equal(qs.stringify({ a: true }), 'a=true'); + st.equal(qs.stringify({ a: { b: true } }), 'a%5Bb%5D=true'); + st.equal(qs.stringify({ b: false }), 'b=false'); + st.equal(qs.stringify({ b: { c: false } }), 'b%5Bc%5D=false'); + st.end(); + }); + + t.test('stringifies buffer values', function (st) { + st.equal(qs.stringify({ a: new Buffer('test') }), 'a=test'); + st.equal(qs.stringify({ a: { b: new Buffer('test') } }), 'a%5Bb%5D=test'); + st.end(); + }); + + t.test('stringifies an object using an alternative delimiter', function (st) { + st.equal(qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }), 'a=b;c=d'); + st.end(); + }); + + t.test('doesn\'t blow up when Buffer global is missing', function (st) { + var tempBuffer = global.Buffer; + delete global.Buffer; + var result = qs.stringify({ a: 'b', c: 'd' }); + global.Buffer = tempBuffer; + st.equal(result, 'a=b&c=d'); + st.end(); + }); + + t.test('selects properties when filter=array', function (st) { + st.equal(qs.stringify({ a: 'b' }, { filter: ['a'] }), 'a=b'); + st.equal(qs.stringify({ a: 1 }, { filter: [] }), ''); + st.equal(qs.stringify({ a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, { filter: ['a', 'b', 0, 2] }), 'a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3'); + st.end(); + }); + + t.test('supports custom representations when filter=function', function (st) { + var calls = 0; + var obj = { a: 'b', c: 'd', e: { f: new Date(1257894000000) } }; + var filterFunc = function (prefix, value) { + calls++; + if (calls === 1) { + st.equal(prefix, '', 'prefix is empty'); + st.equal(value, obj); + } else if (prefix === 'c') { + return; + } else if (value instanceof Date) { + st.equal(prefix, 'e[f]'); + return value.getTime(); + } + return value; + }; + + st.equal(qs.stringify(obj, { filter: filterFunc }), 'a=b&e%5Bf%5D=1257894000000'); + st.equal(calls, 5); + st.end(); + }); + + t.test('can disable uri encoding', function (st) { + st.equal(qs.stringify({ a: 'b' }, { encode: false }), 'a=b'); + st.equal(qs.stringify({ a: { b: 'c' } }, { encode: false }), 'a[b]=c'); + st.equal(qs.stringify({ a: 'b', c: null }, { strictNullHandling: true, encode: false }), 'a=b&c'); + st.end(); + }); + + t.test('can sort the keys', function (st) { + var sort = function (a, b) { return a.localeCompare(b); }; + st.equal(qs.stringify({ a: 'c', z: 'y', b: 'f' }, { sort: sort }), 'a=c&b=f&z=y'); + st.equal(qs.stringify({ a: 'c', z: { j: 'a', i: 'b' }, b: 'f' }, { sort: sort }), 'a=c&b=f&z%5Bi%5D=b&z%5Bj%5D=a'); + st.end(); + }); + + t.test('can sort the keys at depth 3 or more too', function (st) { + var sort = function (a, b) { return a.localeCompare(b); }; + st.equal(qs.stringify({ a: 'a', z: { zj: {zjb: 'zjb', zja: 'zja'}, zi: {zib: 'zib', zia: 'zia'} }, b: 'b' }, { sort: sort, encode: false }), 'a=a&b=b&z[zi][zia]=zia&z[zi][zib]=zib&z[zj][zja]=zja&z[zj][zjb]=zjb'); + st.equal(qs.stringify({ a: 'a', z: { zj: {zjb: 'zjb', zja: 'zja'}, zi: {zib: 'zib', zia: 'zia'} }, b: 'b' }, { sort: null, encode: false }), 'a=a&z[zj][zjb]=zjb&z[zj][zja]=zja&z[zi][zib]=zib&z[zi][zia]=zia&b=b'); + st.end(); + }); + + t.test('can stringify with custom encoding', function (st) { + st.equal(qs.stringify({ 県: '大阪府', '': ''}, { + encoder: function (str) { + if (str.length === 0) { + return ''; + } + var buf = iconv.encode(str, 'shiftjis'); + var result = []; + for (var i=0; i < buf.length; ++i) { + result.push(buf.readUInt8(i).toString(16)); + } + return '%' + result.join('%'); + } + }), '%8c%a7=%91%e5%8d%e3%95%7b&='); + st.end(); + }); + + t.test('throws error with wrong encoder', function (st) { + st.throws(function () { + qs.stringify({}, { + encoder: 'string' + }); + }, new TypeError('Encoder has to be a function.')); + st.end(); + }); + + t.test('can use custom encoder for a buffer object', { + skip: typeof Buffer === 'undefined' + }, function (st) { + st.equal(qs.stringify({ a: new Buffer([1]) }, { + encoder: function (buffer) { + if (typeof buffer === 'string') { + return buffer; + } + return String.fromCharCode(buffer.readUInt8(0) + 97); + } + }), 'a=b'); + st.end(); + }); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/test/utils.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/test/utils.js new file mode 100644 index 00000000..4a8d8246 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/qs/test/utils.js @@ -0,0 +1,9 @@ +'use strict'; + +var test = require('tape'); +var utils = require('../lib/utils'); + +test('merge()', function (t) { + t.deepEqual(utils.merge({ a: 'b' }, { a: 'c' }), { a: ['b', 'c'] }, 'merges two objects with the same key'); + t.end(); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/stringstream/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/stringstream/.npmignore new file mode 100644 index 00000000..7dccd970 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/stringstream/.npmignore @@ -0,0 +1,15 @@ +lib-cov +*.seed +*.log +*.csv +*.dat +*.out +*.pid +*.gz + +pids +logs +results + +node_modules +npm-debug.log \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/stringstream/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/stringstream/.travis.yml new file mode 100644 index 00000000..f1d0f13c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/stringstream/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.4 + - 0.6 diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/stringstream/LICENSE.txt b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/stringstream/LICENSE.txt new file mode 100644 index 00000000..ab861acd --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/stringstream/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright (c) 2012 Michael Hart (michael.hart.au@gmail.com) + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/stringstream/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/stringstream/README.md new file mode 100644 index 00000000..32fc9825 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/stringstream/README.md @@ -0,0 +1,38 @@ +# Decode streams into strings The Right Way(tm) + +```javascript +var fs = require('fs') +var zlib = require('zlib') +var strs = require('stringstream') + +var utf8Stream = fs.createReadStream('massiveLogFile.gz') + .pipe(zlib.createGunzip()) + .pipe(strs('utf8')) +``` + +No need to deal with `setEncoding()` weirdness, just compose streams +like they were supposed to be! + +Handles input and output encoding: + +```javascript +// Stream from utf8 to hex to base64... Why not, ay. +var hex64Stream = fs.createReadStream('myFile') + .pipe(strs('utf8', 'hex')) + .pipe(strs('hex', 'base64')) +``` + +Also deals with `base64` output correctly by aligning each emitted data +chunk so that there are no dangling `=` characters: + +```javascript +var stream = fs.createReadStream('myFile').pipe(strs('base64')) + +var base64Str = '' + +stream.on('data', function(data) { base64Str += data }) +stream.on('end', function() { + console.log('My base64 encoded file is: ' + base64Str) // Wouldn't work with setEncoding() + console.log('Original file is: ' + new Buffer(base64Str, 'base64')) +}) +``` diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/stringstream/example.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/stringstream/example.js new file mode 100644 index 00000000..f82b85ed --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/stringstream/example.js @@ -0,0 +1,27 @@ +var fs = require('fs') +var zlib = require('zlib') +var strs = require('stringstream') + +var utf8Stream = fs.createReadStream('massiveLogFile.gz') + .pipe(zlib.createGunzip()) + .pipe(strs('utf8')) + +utf8Stream.pipe(process.stdout) + +// Stream from utf8 to hex to base64... Why not, ay. +var hex64Stream = fs.createReadStream('myFile') + .pipe(strs('utf8', 'hex')) + .pipe(strs('hex', 'base64')) + +hex64Stream.pipe(process.stdout) + +// Deals with base64 correctly by aligning chunks +var stream = fs.createReadStream('myFile').pipe(strs('base64')) + +var base64Str = '' + +stream.on('data', function(data) { base64Str += data }) +stream.on('end', function() { + console.log('My base64 encoded file is: ' + base64Str) // Wouldn't work with setEncoding() + console.log('Original file is: ' + new Buffer(base64Str, 'base64')) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/stringstream/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/stringstream/package.json new file mode 100644 index 00000000..2c6d7cdc --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/stringstream/package.json @@ -0,0 +1,50 @@ +{ + "name": "stringstream", + "version": "0.0.5", + "description": "Encode and decode streams into string streams", + "author": { + "name": "Michael Hart", + "email": "michael.hart.au@gmail.com", + "url": "http://github.com/mhart" + }, + "main": "stringstream.js", + "keywords": [ + "string", + "stream", + "base64", + "gzip" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/mhart/StringStream.git" + }, + "license": "MIT", + "gitHead": "1efe3bf507bf3a1161f8473908b60e881d41422b", + "bugs": { + "url": "https://github.com/mhart/StringStream/issues" + }, + "homepage": "https://github.com/mhart/StringStream#readme", + "_id": "stringstream@0.0.5", + "scripts": {}, + "_shasum": "4e484cd4de5a0bbbee18e46307710a8a81621878", + "_from": "stringstream@>=0.0.4 <0.1.0", + "_npmVersion": "2.14.8", + "_nodeVersion": "4.2.1", + "_npmUser": { + "name": "hichaelmart", + "email": "michael.hart.au@gmail.com" + }, + "maintainers": [ + { + "name": "hichaelmart", + "email": "michael.hart.au@gmail.com" + } + ], + "dist": { + "shasum": "4e484cd4de5a0bbbee18e46307710a8a81621878", + "tarball": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/stringstream/stringstream.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/stringstream/stringstream.js new file mode 100644 index 00000000..4ece1275 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/stringstream/stringstream.js @@ -0,0 +1,102 @@ +var util = require('util') +var Stream = require('stream') +var StringDecoder = require('string_decoder').StringDecoder + +module.exports = StringStream +module.exports.AlignedStringDecoder = AlignedStringDecoder + +function StringStream(from, to) { + if (!(this instanceof StringStream)) return new StringStream(from, to) + + Stream.call(this) + + if (from == null) from = 'utf8' + + this.readable = this.writable = true + this.paused = false + this.toEncoding = (to == null ? from : to) + this.fromEncoding = (to == null ? '' : from) + this.decoder = new AlignedStringDecoder(this.toEncoding) +} +util.inherits(StringStream, Stream) + +StringStream.prototype.write = function(data) { + if (!this.writable) { + var err = new Error('stream not writable') + err.code = 'EPIPE' + this.emit('error', err) + return false + } + if (this.fromEncoding) { + if (Buffer.isBuffer(data)) data = data.toString() + data = new Buffer(data, this.fromEncoding) + } + var string = this.decoder.write(data) + if (string.length) this.emit('data', string) + return !this.paused +} + +StringStream.prototype.flush = function() { + if (this.decoder.flush) { + var string = this.decoder.flush() + if (string.length) this.emit('data', string) + } +} + +StringStream.prototype.end = function() { + if (!this.writable && !this.readable) return + this.flush() + this.emit('end') + this.writable = this.readable = false + this.destroy() +} + +StringStream.prototype.destroy = function() { + this.decoder = null + this.writable = this.readable = false + this.emit('close') +} + +StringStream.prototype.pause = function() { + this.paused = true +} + +StringStream.prototype.resume = function () { + if (this.paused) this.emit('drain') + this.paused = false +} + +function AlignedStringDecoder(encoding) { + StringDecoder.call(this, encoding) + + switch (this.encoding) { + case 'base64': + this.write = alignedWrite + this.alignedBuffer = new Buffer(3) + this.alignedBytes = 0 + break + } +} +util.inherits(AlignedStringDecoder, StringDecoder) + +AlignedStringDecoder.prototype.flush = function() { + if (!this.alignedBuffer || !this.alignedBytes) return '' + var leftover = this.alignedBuffer.toString(this.encoding, 0, this.alignedBytes) + this.alignedBytes = 0 + return leftover +} + +function alignedWrite(buffer) { + var rem = (this.alignedBytes + buffer.length) % this.alignedBuffer.length + if (!rem && !this.alignedBytes) return buffer.toString(this.encoding) + + var returnBuffer = new Buffer(this.alignedBytes + buffer.length - rem) + + this.alignedBuffer.copy(returnBuffer, 0, 0, this.alignedBytes) + buffer.copy(returnBuffer, this.alignedBytes, 0, buffer.length - rem) + + buffer.copy(this.alignedBuffer, 0, buffer.length - rem, buffer.length) + this.alignedBytes = rem + + return returnBuffer.toString(this.encoding) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/tough-cookie/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/tough-cookie/LICENSE new file mode 100644 index 00000000..1bc286fb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/tough-cookie/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2015, Salesforce.com, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +3. Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +=== + +The following exceptions apply: + +=== + +`public_suffix_list.dat` was obtained from + via +. The license for this file is MPL/2.0. The header of +that file reads as follows: + + // This Source Code Form is subject to the terms of the Mozilla Public + // License, v. 2.0. If a copy of the MPL was not distributed with this + // file, You can obtain one at http://mozilla.org/MPL/2.0/. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/tough-cookie/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/tough-cookie/README.md new file mode 100644 index 00000000..126f222b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/tough-cookie/README.md @@ -0,0 +1,506 @@ +[RFC6265](https://tools.ietf.org/html/rfc6265) Cookies and CookieJar for Node.js + +[![npm package](https://nodei.co/npm/tough-cookie.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/tough-cookie/) + +[![Build Status](https://travis-ci.org/SalesforceEng/tough-cookie.png?branch=master)](https://travis-ci.org/SalesforceEng/tough-cookie) + +# Synopsis + +``` javascript +var tough = require('tough-cookie'); +var Cookie = tough.Cookie; +var cookie = Cookie.parse(header); +cookie.value = 'somethingdifferent'; +header = cookie.toString(); + +var cookiejar = new tough.CookieJar(); +cookiejar.setCookie(cookie, 'http://currentdomain.example.com/path', cb); +// ... +cookiejar.getCookies('http://example.com/otherpath',function(err,cookies) { + res.headers['cookie'] = cookies.join('; '); +}); +``` + +# Installation + +It's _so_ easy! + +`npm install tough-cookie` + +Why the name? NPM modules `cookie`, `cookies` and `cookiejar` were already taken. + +## Version Support + +Support for versions of node.js will follow that of the [request](https://www.npmjs.com/package/request) module. + +# API + +## tough + +Functions on the module you get from `require('tough-cookie')`. All can be used as pure functions and don't need to be "bound". + +**Note**: prior to 1.0.x, several of these functions took a `strict` parameter. This has since been removed from the API as it was no longer necessary. + +### `parseDate(string)` + +Parse a cookie date string into a `Date`. Parses according to RFC6265 Section 5.1.1, not `Date.parse()`. + +### `formatDate(date)` + +Format a Date into a RFC1123 string (the RFC6265-recommended format). + +### `canonicalDomain(str)` + +Transforms a domain-name into a canonical domain-name. The canonical domain-name is a trimmed, lowercased, stripped-of-leading-dot and optionally punycode-encoded domain-name (Section 5.1.2 of RFC6265). For the most part, this function is idempotent (can be run again on its output without ill effects). + +### `domainMatch(str,domStr[,canonicalize=true])` + +Answers "does this real domain match the domain in a cookie?". The `str` is the "current" domain-name and the `domStr` is the "cookie" domain-name. Matches according to RFC6265 Section 5.1.3, but it helps to think of it as a "suffix match". + +The `canonicalize` parameter will run the other two paramters through `canonicalDomain` or not. + +### `defaultPath(path)` + +Given a current request/response path, gives the Path apropriate for storing in a cookie. This is basically the "directory" of a "file" in the path, but is specified by Section 5.1.4 of the RFC. + +The `path` parameter MUST be _only_ the pathname part of a URI (i.e. excludes the hostname, query, fragment, etc.). This is the `.pathname` property of node's `uri.parse()` output. + +### `pathMatch(reqPath,cookiePath)` + +Answers "does the request-path path-match a given cookie-path?" as per RFC6265 Section 5.1.4. Returns a boolean. + +This is essentially a prefix-match where `cookiePath` is a prefix of `reqPath`. + +### `parse(cookieString[, options])` + +alias for `Cookie.parse(cookieString[, options])` + +### `fromJSON(string)` + +alias for `Cookie.fromJSON(string)` + +### `getPublicSuffix(hostname)` + +Returns the public suffix of this hostname. The public suffix is the shortest domain-name upon which a cookie can be set. Returns `null` if the hostname cannot have cookies set for it. + +For example: `www.example.com` and `www.subdomain.example.com` both have public suffix `example.com`. + +For further information, see http://publicsuffix.org/. This module derives its list from that site. + +### `cookieCompare(a,b)` + +For use with `.sort()`, sorts a list of cookies into the recommended order given in the RFC (Section 5.4 step 2). The sort algorithm is, in order of precedence: + +* Longest `.path` +* oldest `.creation` (which has a 1ms precision, same as `Date`) +* lowest `.creationIndex` (to get beyond the 1ms precision) + +``` javascript +var cookies = [ /* unsorted array of Cookie objects */ ]; +cookies = cookies.sort(cookieCompare); +``` + +**Note**: Since JavaScript's `Date` is limited to a 1ms precision, cookies within the same milisecond are entirely possible. This is especially true when using the `now` option to `.setCookie()`. The `.creationIndex` property is a per-process global counter, assigned during construction with `new Cookie()`. This preserves the spirit of the RFC sorting: older cookies go first. This works great for `MemoryCookieStore`, since `Set-Cookie` headers are parsed in order, but may not be so great for distributed systems. Sophisticated `Store`s may wish to set this to some other _logical clock_ such that if cookies A and B are created in the same millisecond, but cookie A is created before cookie B, then `A.creationIndex < B.creationIndex`. If you want to alter the global counter, which you probably _shouldn't_ do, it's stored in `Cookie.cookiesCreated`. + +### `permuteDomain(domain)` + +Generates a list of all possible domains that `domainMatch()` the parameter. May be handy for implementing cookie stores. + +### `permutePath(path)` + +Generates a list of all possible paths that `pathMatch()` the parameter. May be handy for implementing cookie stores. + + +## Cookie + +Exported via `tough.Cookie`. + +### `Cookie.parse(cookieString[, options])` + +Parses a single Cookie or Set-Cookie HTTP header into a `Cookie` object. Returns `undefined` if the string can't be parsed. + +The options parameter is not required and currently has only one property: + + * _loose_ - boolean - if `true` enable parsing of key-less cookies like `=abc` and `=`, which are not RFC-compliant. + +If options is not an object, it is ignored, which means you can use `Array#map` with it. + +Here's how to process the Set-Cookie header(s) on a node HTTP/HTTPS response: + +``` javascript +if (res.headers['set-cookie'] instanceof Array) + cookies = res.headers['set-cookie'].map(Cookie.parse); +else + cookies = [Cookie.parse(res.headers['set-cookie'])]; +``` + +### Properties + +Cookie object properties: + + * _key_ - string - the name or key of the cookie (default "") + * _value_ - string - the value of the cookie (default "") + * _expires_ - `Date` - if set, the `Expires=` attribute of the cookie (defaults to the string `"Infinity"`). See `setExpires()` + * _maxAge_ - seconds - if set, the `Max-Age=` attribute _in seconds_ of the cookie. May also be set to strings `"Infinity"` and `"-Infinity"` for non-expiry and immediate-expiry, respectively. See `setMaxAge()` + * _domain_ - string - the `Domain=` attribute of the cookie + * _path_ - string - the `Path=` of the cookie + * _secure_ - boolean - the `Secure` cookie flag + * _httpOnly_ - boolean - the `HttpOnly` cookie flag + * _extensions_ - `Array` - any unrecognized cookie attributes as strings (even if equal-signs inside) + * _creation_ - `Date` - when this cookie was constructed + * _creationIndex_ - number - set at construction, used to provide greater sort precision (please see `cookieCompare(a,b)` for a full explanation) + +After a cookie has been passed through `CookieJar.setCookie()` it will have the following additional attributes: + + * _hostOnly_ - boolean - is this a host-only cookie (i.e. no Domain field was set, but was instead implied) + * _pathIsDefault_ - boolean - if true, there was no Path field on the cookie and `defaultPath()` was used to derive one. + * _creation_ - `Date` - **modified** from construction to when the cookie was added to the jar + * _lastAccessed_ - `Date` - last time the cookie got accessed. Will affect cookie cleaning once implemented. Using `cookiejar.getCookies(...)` will update this attribute. + +### `Cookie([{properties}])` + +Receives an options object that can contain any of the above Cookie properties, uses the default for unspecified properties. + +### `.toString()` + +encode to a Set-Cookie header value. The Expires cookie field is set using `formatDate()`, but is omitted entirely if `.expires` is `Infinity`. + +### `.cookieString()` + +encode to a Cookie header value (i.e. the `.key` and `.value` properties joined with '='). + +### `.setExpires(String)` + +sets the expiry based on a date-string passed through `parseDate()`. If parseDate returns `null` (i.e. can't parse this date string), `.expires` is set to `"Infinity"` (a string) is set. + +### `.setMaxAge(number)` + +sets the maxAge in seconds. Coerces `-Infinity` to `"-Infinity"` and `Infinity` to `"Infinity"` so it JSON serializes correctly. + +### `.expiryTime([now=Date.now()])` + +### `.expiryDate([now=Date.now()])` + +expiryTime() Computes the absolute unix-epoch milliseconds that this cookie expires. expiryDate() works similarly, except it returns a `Date` object. Note that in both cases the `now` parameter should be milliseconds. + +Max-Age takes precedence over Expires (as per the RFC). The `.creation` attribute -- or, by default, the `now` paramter -- is used to offset the `.maxAge` attribute. + +If Expires (`.expires`) is set, that's returned. + +Otherwise, `expiryTime()` returns `Infinity` and `expiryDate()` returns a `Date` object for "Tue, 19 Jan 2038 03:14:07 GMT" (latest date that can be expressed by a 32-bit `time_t`; the common limit for most user-agents). + +### `.TTL([now=Date.now()])` + +compute the TTL relative to `now` (milliseconds). The same precedence rules as for `expiryTime`/`expiryDate` apply. + +The "number" `Infinity` is returned for cookies without an explicit expiry and `0` is returned if the cookie is expired. Otherwise a time-to-live in milliseconds is returned. + +### `.canonicalizedDoman()` + +### `.cdomain()` + +return the canonicalized `.domain` field. This is lower-cased and punycode (RFC3490) encoded if the domain has any non-ASCII characters. + +### `.toJSON()` + +For convenience in using `JSON.serialize(cookie)`. Returns a plain-old `Object` that can be JSON-serialized. + +Any `Date` properties (i.e., `.expires`, `.creation`, and `.lastAccessed`) are exported in ISO format (`.toISOString()`). + +**NOTE**: Custom `Cookie` properties will be discarded. In tough-cookie 1.x, since there was no `.toJSON` method explicitly defined, all enumerable properties were captured. If you want a property to be serialized, add the property name to the `Cookie.serializableProperties` Array. + +### `Cookie.fromJSON(strOrObj)` + +Does the reverse of `cookie.toJSON()`. If passed a string, will `JSON.parse()` that first. + +Any `Date` properties (i.e., `.expires`, `.creation`, and `.lastAccessed`) are parsed via `Date.parse()`, not the tough-cookie `parseDate`, since it's JavaScript/JSON-y timestamps being handled at this layer. + +Returns `null` upon JSON parsing error. + +### `.clone()` + +Does a deep clone of this cookie, exactly implemented as `Cookie.fromJSON(cookie.toJSON())`. + +### `.validate()` + +Status: *IN PROGRESS*. Works for a few things, but is by no means comprehensive. + +validates cookie attributes for semantic correctness. Useful for "lint" checking any Set-Cookie headers you generate. For now, it returns a boolean, but eventually could return a reason string -- you can future-proof with this construct: + +``` javascript +if (cookie.validate() === true) { + // it's tasty +} else { + // yuck! +} +``` + + +## CookieJar + +Exported via `tough.CookieJar`. + +### `CookieJar([store],[options])` + +Simply use `new CookieJar()`. If you'd like to use a custom store, pass that to the constructor otherwise a `MemoryCookieStore` will be created and used. + +The `options` object can be omitted and can have the following properties: + + * _rejectPublicSuffixes_ - boolean - default `true` - reject cookies with domains like "com" and "co.uk" + * _looseMode_ - boolean - default `false` - accept malformed cookies like `bar` and `=bar`, which have an implied empty name. + This is not in the standard, but is used sometimes on the web and is accepted by (most) browsers. + +Since eventually this module would like to support database/remote/etc. CookieJars, continuation passing style is used for CookieJar methods. + +### `.setCookie(cookieOrString, currentUrl, [{options},] cb(err,cookie))` + +Attempt to set the cookie in the cookie jar. If the operation fails, an error will be given to the callback `cb`, otherwise the cookie is passed through. The cookie will have updated `.creation`, `.lastAccessed` and `.hostOnly` properties. + +The `options` object can be omitted and can have the following properties: + + * _http_ - boolean - default `true` - indicates if this is an HTTP or non-HTTP API. Affects HttpOnly cookies. + * _secure_ - boolean - autodetect from url - indicates if this is a "Secure" API. If the currentUrl starts with `https:` or `wss:` then this is defaulted to `true`, otherwise `false`. + * _now_ - Date - default `new Date()` - what to use for the creation/access time of cookies + * _ignoreError_ - boolean - default `false` - silently ignore things like parse errors and invalid domains. `Store` errors aren't ignored by this option. + +As per the RFC, the `.hostOnly` property is set if there was no "Domain=" parameter in the cookie string (or `.domain` was null on the Cookie object). The `.domain` property is set to the fully-qualified hostname of `currentUrl` in this case. Matching this cookie requires an exact hostname match (not a `domainMatch` as per usual). + +### `.setCookieSync(cookieOrString, currentUrl, [{options}])` + +Synchronous version of `setCookie`; only works with synchronous stores (e.g. the default `MemoryCookieStore`). + +### `.getCookies(currentUrl, [{options},] cb(err,cookies))` + +Retrieve the list of cookies that can be sent in a Cookie header for the current url. + +If an error is encountered, that's passed as `err` to the callback, otherwise an `Array` of `Cookie` objects is passed. The array is sorted with `cookieCompare()` unless the `{sort:false}` option is given. + +The `options` object can be omitted and can have the following properties: + + * _http_ - boolean - default `true` - indicates if this is an HTTP or non-HTTP API. Affects HttpOnly cookies. + * _secure_ - boolean - autodetect from url - indicates if this is a "Secure" API. If the currentUrl starts with `https:` or `wss:` then this is defaulted to `true`, otherwise `false`. + * _now_ - Date - default `new Date()` - what to use for the creation/access time of cookies + * _expire_ - boolean - default `true` - perform expiry-time checking of cookies and asynchronously remove expired cookies from the store. Using `false` will return expired cookies and **not** remove them from the store (which is useful for replaying Set-Cookie headers, potentially). + * _allPaths_ - boolean - default `false` - if `true`, do not scope cookies by path. The default uses RFC-compliant path scoping. **Note**: may not be supported by the underlying store (the default `MemoryCookieStore` supports it). + +The `.lastAccessed` property of the returned cookies will have been updated. + +### `.getCookiesSync(currentUrl, [{options}])` + +Synchronous version of `getCookies`; only works with synchronous stores (e.g. the default `MemoryCookieStore`). + +### `.getCookieString(...)` + +Accepts the same options as `.getCookies()` but passes a string suitable for a Cookie header rather than an array to the callback. Simply maps the `Cookie` array via `.cookieString()`. + +### `.getCookieStringSync(...)` + +Synchronous version of `getCookieString`; only works with synchronous stores (e.g. the default `MemoryCookieStore`). + +### `.getSetCookieStrings(...)` + +Returns an array of strings suitable for **Set-Cookie** headers. Accepts the same options as `.getCookies()`. Simply maps the cookie array via `.toString()`. + +### `.getSetCookieStringsSync(...)` + +Synchronous version of `getSetCookieStrings`; only works with synchronous stores (e.g. the default `MemoryCookieStore`). + +### `.serialize(cb(err,serializedObject))` + +Serialize the Jar if the underlying store supports `.getAllCookies`. + +**NOTE**: Custom `Cookie` properties will be discarded. If you want a property to be serialized, add the property name to the `Cookie.serializableProperties` Array. + +See [Serialization Format]. + +### `.serializeSync()` + +Sync version of .serialize + +### `.toJSON()` + +Alias of .serializeSync() for the convenience of `JSON.stringify(cookiejar)`. + +### `CookieJar.deserialize(serialized, [store], cb(err,object))` + +A new Jar is created and the serialized Cookies are added to the underlying store. Each `Cookie` is added via `store.putCookie` in the order in which they appear in the serialization. + +The `store` argument is optional, but should be an instance of `Store`. By default, a new instance of `MemoryCookieStore` is created. + +As a convenience, if `serialized` is a string, it is passed through `JSON.parse` first. If that throws an error, this is passed to the callback. + +### `CookieJar.deserializeSync(serialized, [store])` + +Sync version of `.deserialize`. _Note_ that the `store` must be synchronous for this to work. + +### `CookieJar.fromJSON(string)` + +Alias of `.deserializeSync` to provide consistency with `Cookie.fromJSON()`. + +### `.clone([store,]cb(err,newJar))` + +Produces a deep clone of this jar. Modifications to the original won't affect the clone, and vice versa. + +The `store` argument is optional, but should be an instance of `Store`. By default, a new instance of `MemoryCookieStore` is created. Transferring between store types is supported so long as the source implements `.getAllCookies()` and the destination implements `.putCookie()`. + +### `.cloneSync([store])` + +Synchronous version of `.clone`, returning a new `CookieJar` instance. + +The `store` argument is optional, but must be a _synchronous_ `Store` instance if specified. If not passed, a new instance of `MemoryCookieStore` is used. + +The _source_ and _destination_ must both be synchronous `Store`s. If one or both stores are asynchronous, use `.clone` instead. Recall that `MemoryCookieStore` supports both synchronous and asynchronous API calls. + +## Store + +Base class for CookieJar stores. Available as `tough.Store`. + +## Store API + +The storage model for each `CookieJar` instance can be replaced with a custom implementation. The default is `MemoryCookieStore` which can be found in the `lib/memstore.js` file. The API uses continuation-passing-style to allow for asynchronous stores. + +Stores should inherit from the base `Store` class, which is available as `require('tough-cookie').Store`. + +Stores are asynchronous by default, but if `store.synchronous` is set to `true`, then the `*Sync` methods on the of the containing `CookieJar` can be used (however, the continuation-passing style + +All `domain` parameters will have been normalized before calling. + +The Cookie store must have all of the following methods. + +### `store.findCookie(domain, path, key, cb(err,cookie))` + +Retrieve a cookie with the given domain, path and key (a.k.a. name). The RFC maintains that exactly one of these cookies should exist in a store. If the store is using versioning, this means that the latest/newest such cookie should be returned. + +Callback takes an error and the resulting `Cookie` object. If no cookie is found then `null` MUST be passed instead (i.e. not an error). + +### `store.findCookies(domain, path, cb(err,cookies))` + +Locates cookies matching the given domain and path. This is most often called in the context of `cookiejar.getCookies()` above. + +If no cookies are found, the callback MUST be passed an empty array. + +The resulting list will be checked for applicability to the current request according to the RFC (domain-match, path-match, http-only-flag, secure-flag, expiry, etc.), so it's OK to use an optimistic search algorithm when implementing this method. However, the search algorithm used SHOULD try to find cookies that `domainMatch()` the domain and `pathMatch()` the path in order to limit the amount of checking that needs to be done. + +As of version 0.9.12, the `allPaths` option to `cookiejar.getCookies()` above will cause the path here to be `null`. If the path is `null`, path-matching MUST NOT be performed (i.e. domain-matching only). + +### `store.putCookie(cookie, cb(err))` + +Adds a new cookie to the store. The implementation SHOULD replace any existing cookie with the same `.domain`, `.path`, and `.key` properties -- depending on the nature of the implementation, it's possible that between the call to `fetchCookie` and `putCookie` that a duplicate `putCookie` can occur. + +The `cookie` object MUST NOT be modified; the caller will have already updated the `.creation` and `.lastAccessed` properties. + +Pass an error if the cookie cannot be stored. + +### `store.updateCookie(oldCookie, newCookie, cb(err))` + +Update an existing cookie. The implementation MUST update the `.value` for a cookie with the same `domain`, `.path` and `.key`. The implementation SHOULD check that the old value in the store is equivalent to `oldCookie` - how the conflict is resolved is up to the store. + +The `.lastAccessed` property will always be different between the two objects (to the precision possible via JavaScript's clock). Both `.creation` and `.creationIndex` are guaranteed to be the same. Stores MAY ignore or defer the `.lastAccessed` change at the cost of affecting how cookies are selected for automatic deletion (e.g., least-recently-used, which is up to the store to implement). + +Stores may wish to optimize changing the `.value` of the cookie in the store versus storing a new cookie. If the implementation doesn't define this method a stub that calls `putCookie(newCookie,cb)` will be added to the store object. + +The `newCookie` and `oldCookie` objects MUST NOT be modified. + +Pass an error if the newCookie cannot be stored. + +### `store.removeCookie(domain, path, key, cb(err))` + +Remove a cookie from the store (see notes on `findCookie` about the uniqueness constraint). + +The implementation MUST NOT pass an error if the cookie doesn't exist; only pass an error due to the failure to remove an existing cookie. + +### `store.removeCookies(domain, path, cb(err))` + +Removes matching cookies from the store. The `path` parameter is optional, and if missing means all paths in a domain should be removed. + +Pass an error ONLY if removing any existing cookies failed. + +### `store.getAllCookies(cb(err, cookies))` + +Produces an `Array` of all cookies during `jar.serialize()`. The items in the array can be true `Cookie` objects or generic `Object`s with the [Serialization Format] data structure. + +Cookies SHOULD be returned in creation order to preserve sorting via `compareCookies()`. For reference, `MemoryCookieStore` will sort by `.creationIndex` since it uses true `Cookie` objects internally. If you don't return the cookies in creation order, they'll still be sorted by creation time, but this only has a precision of 1ms. See `compareCookies` for more detail. + +Pass an error if retrieval fails. + +## MemoryCookieStore + +Inherits from `Store`. + +A just-in-memory CookieJar synchronous store implementation, used by default. Despite being a synchronous implementation, it's usable with both the synchronous and asynchronous forms of the `CookieJar` API. + +## Community Cookie Stores + +These are some Store implementations authored and maintained by the community. They aren't official and we don't vouch for them but you may be interested to have a look: + +- [`db-cookie-store`](https://github.com/JSBizon/db-cookie-store): SQL including SQLite-based databases +- [`file-cookie-store`](https://github.com/JSBizon/file-cookie-store): Netscape cookie file format on disk +- [`redis-cookie-store`](https://github.com/benkroeger/redis-cookie-store): Redis +- [`tough-cookie-filestore`](https://github.com/mitsuru/tough-cookie-filestore): JSON on disk +- [`tough-cookie-web-storage-store`](https://github.com/exponentjs/tough-cookie-web-storage-store): DOM localStorage and sessionStorage + + +# Serialization Format + +**NOTE**: if you want to have custom `Cookie` properties serialized, add the property name to `Cookie.serializableProperties`. + +```js + { + // The version of tough-cookie that serialized this jar. + version: 'tough-cookie@1.x.y', + + // add the store type, to make humans happy: + storeType: 'MemoryCookieStore', + + // CookieJar configuration: + rejectPublicSuffixes: true, + // ... future items go here + + // Gets filled from jar.store.getAllCookies(): + cookies: [ + { + key: 'string', + value: 'string', + // ... + /* other Cookie.serializableProperties go here */ + } + ] + } +``` + +# Copyright and License + +(tl;dr: BSD-3-Clause with some MPL/2.0) + +```text + Copyright (c) 2015, Salesforce.com, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + 3. Neither the name of Salesforce.com nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +``` + +Portions may be licensed under different licenses (in particular `public_suffix_list.dat` is MPL/2.0); please read that file and the LICENSE file for full details. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/tough-cookie/lib/cookie.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/tough-cookie/lib/cookie.js new file mode 100644 index 00000000..c3dacfe4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/tough-cookie/lib/cookie.js @@ -0,0 +1,1336 @@ +/*! + * Copyright (c) 2015, Salesforce.com, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of Salesforce.com nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +'use strict'; +var net = require('net'); +var urlParse = require('url').parse; +var pubsuffix = require('./pubsuffix'); +var Store = require('./store').Store; +var MemoryCookieStore = require('./memstore').MemoryCookieStore; +var pathMatch = require('./pathMatch').pathMatch; +var VERSION = require('../package.json').version; + +var punycode; +try { + punycode = require('punycode'); +} catch(e) { + console.warn("cookie: can't load punycode; won't use punycode for domain normalization"); +} + +var DATE_DELIM = /[\x09\x20-\x2F\x3B-\x40\x5B-\x60\x7B-\x7E]/; + +// From RFC6265 S4.1.1 +// note that it excludes \x3B ";" +var COOKIE_OCTET = /[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]/; +var COOKIE_OCTETS = new RegExp('^'+COOKIE_OCTET.source+'+$'); + +var CONTROL_CHARS = /[\x00-\x1F]/; + +// Double quotes are part of the value (see: S4.1.1). +// '\r', '\n' and '\0' should be treated as a terminator in the "relaxed" mode +// (see: https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/parsed_cookie.cc#L60) +// '=' and ';' are attribute/values separators +// (see: https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/parsed_cookie.cc#L64) +var COOKIE_PAIR = /^(([^=;]+))\s*=\s*([^\n\r\0]*)/; + +// Used to parse non-RFC-compliant cookies like '=abc' when given the `loose` +// option in Cookie.parse: +var LOOSE_COOKIE_PAIR = /^((?:=)?([^=;]*)\s*=\s*)?([^\n\r\0]*)/; + +// RFC6265 S4.1.1 defines path value as 'any CHAR except CTLs or ";"' +// Note ';' is \x3B +var PATH_VALUE = /[\x20-\x3A\x3C-\x7E]+/; + +var DAY_OF_MONTH = /^(\d{1,2})[^\d]*$/; +var TIME = /^(\d{1,2})[^\d]*:(\d{1,2})[^\d]*:(\d{1,2})[^\d]*$/; +var MONTH = /^(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)/i; + +var MONTH_TO_NUM = { + jan:0, feb:1, mar:2, apr:3, may:4, jun:5, + jul:6, aug:7, sep:8, oct:9, nov:10, dec:11 +}; +var NUM_TO_MONTH = [ + 'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec' +]; +var NUM_TO_DAY = [ + 'Sun','Mon','Tue','Wed','Thu','Fri','Sat' +]; + +var YEAR = /^(\d{2}|\d{4})$/; // 2 to 4 digits + +var MAX_TIME = 2147483647000; // 31-bit max +var MIN_TIME = 0; // 31-bit min + + +// RFC6265 S5.1.1 date parser: +function parseDate(str) { + if (!str) { + return; + } + + /* RFC6265 S5.1.1: + * 2. Process each date-token sequentially in the order the date-tokens + * appear in the cookie-date + */ + var tokens = str.split(DATE_DELIM); + if (!tokens) { + return; + } + + var hour = null; + var minutes = null; + var seconds = null; + var day = null; + var month = null; + var year = null; + + for (var i=0; i 23 || minutes > 59 || seconds > 59) { + return; + } + + continue; + } + } + + /* 2.2. If the found-day-of-month flag is not set and the date-token matches + * the day-of-month production, set the found-day-of- month flag and set + * the day-of-month-value to the number denoted by the date-token. Skip + * the remaining sub-steps and continue to the next date-token. + */ + if (day === null) { + result = DAY_OF_MONTH.exec(token); + if (result) { + day = parseInt(result, 10); + /* RFC6265 S5.1.1.5: + * [fail if] the day-of-month-value is less than 1 or greater than 31 + */ + if(day < 1 || day > 31) { + return; + } + continue; + } + } + + /* 2.3. If the found-month flag is not set and the date-token matches the + * month production, set the found-month flag and set the month-value to + * the month denoted by the date-token. Skip the remaining sub-steps and + * continue to the next date-token. + */ + if (month === null) { + result = MONTH.exec(token); + if (result) { + month = MONTH_TO_NUM[result[1].toLowerCase()]; + continue; + } + } + + /* 2.4. If the found-year flag is not set and the date-token matches the year + * production, set the found-year flag and set the year-value to the number + * denoted by the date-token. Skip the remaining sub-steps and continue to + * the next date-token. + */ + if (year === null) { + result = YEAR.exec(token); + if (result) { + year = parseInt(result[0], 10); + /* From S5.1.1: + * 3. If the year-value is greater than or equal to 70 and less + * than or equal to 99, increment the year-value by 1900. + * 4. If the year-value is greater than or equal to 0 and less + * than or equal to 69, increment the year-value by 2000. + */ + if (70 <= year && year <= 99) { + year += 1900; + } else if (0 <= year && year <= 69) { + year += 2000; + } + + if (year < 1601) { + return; // 5. ... the year-value is less than 1601 + } + } + } + } + + if (seconds === null || day === null || month === null || year === null) { + return; // 5. ... at least one of the found-day-of-month, found-month, found- + // year, or found-time flags is not set, + } + + return new Date(Date.UTC(year, month, day, hour, minutes, seconds)); +} + +function formatDate(date) { + var d = date.getUTCDate(); d = d >= 10 ? d : '0'+d; + var h = date.getUTCHours(); h = h >= 10 ? h : '0'+h; + var m = date.getUTCMinutes(); m = m >= 10 ? m : '0'+m; + var s = date.getUTCSeconds(); s = s >= 10 ? s : '0'+s; + return NUM_TO_DAY[date.getUTCDay()] + ', ' + + d+' '+ NUM_TO_MONTH[date.getUTCMonth()] +' '+ date.getUTCFullYear() +' '+ + h+':'+m+':'+s+' GMT'; +} + +// S5.1.2 Canonicalized Host Names +function canonicalDomain(str) { + if (str == null) { + return null; + } + str = str.trim().replace(/^\./,''); // S4.1.2.3 & S5.2.3: ignore leading . + + // convert to IDN if any non-ASCII characters + if (punycode && /[^\u0001-\u007f]/.test(str)) { + str = punycode.toASCII(str); + } + + return str.toLowerCase(); +} + +// S5.1.3 Domain Matching +function domainMatch(str, domStr, canonicalize) { + if (str == null || domStr == null) { + return null; + } + if (canonicalize !== false) { + str = canonicalDomain(str); + domStr = canonicalDomain(domStr); + } + + /* + * "The domain string and the string are identical. (Note that both the + * domain string and the string will have been canonicalized to lower case at + * this point)" + */ + if (str == domStr) { + return true; + } + + /* "All of the following [three] conditions hold:" (order adjusted from the RFC) */ + + /* "* The string is a host name (i.e., not an IP address)." */ + if (net.isIP(str)) { + return false; + } + + /* "* The domain string is a suffix of the string" */ + var idx = str.indexOf(domStr); + if (idx <= 0) { + return false; // it's a non-match (-1) or prefix (0) + } + + // e.g "a.b.c".indexOf("b.c") === 2 + // 5 === 3+2 + if (str.length !== domStr.length + idx) { // it's not a suffix + return false; + } + + /* "* The last character of the string that is not included in the domain + * string is a %x2E (".") character." */ + if (str.substr(idx-1,1) !== '.') { + return false; + } + + return true; +} + + +// RFC6265 S5.1.4 Paths and Path-Match + +/* + * "The user agent MUST use an algorithm equivalent to the following algorithm + * to compute the default-path of a cookie:" + * + * Assumption: the path (and not query part or absolute uri) is passed in. + */ +function defaultPath(path) { + // "2. If the uri-path is empty or if the first character of the uri-path is not + // a %x2F ("/") character, output %x2F ("/") and skip the remaining steps. + if (!path || path.substr(0,1) !== "/") { + return "/"; + } + + // "3. If the uri-path contains no more than one %x2F ("/") character, output + // %x2F ("/") and skip the remaining step." + if (path === "/") { + return path; + } + + var rightSlash = path.lastIndexOf("/"); + if (rightSlash === 0) { + return "/"; + } + + // "4. Output the characters of the uri-path from the first character up to, + // but not including, the right-most %x2F ("/")." + return path.slice(0, rightSlash); +} + + +function parse(str, options) { + if (!options || typeof options !== 'object') { + options = {}; + } + str = str.trim(); + + // We use a regex to parse the "name-value-pair" part of S5.2 + var firstSemi = str.indexOf(';'); // S5.2 step 1 + var pairRe = options.loose ? LOOSE_COOKIE_PAIR : COOKIE_PAIR; + var result = pairRe.exec(firstSemi === -1 ? str : str.substr(0,firstSemi)); + + // Rx satisfies the "the name string is empty" and "lacks a %x3D ("=")" + // constraints as well as trimming any whitespace. + if (!result) { + return; + } + + var c = new Cookie(); + if (result[1]) { + c.key = result[2].trim(); + } else { + c.key = ''; + } + c.value = result[3].trim(); + if (CONTROL_CHARS.test(c.key) || CONTROL_CHARS.test(c.value)) { + return; + } + + if (firstSemi === -1) { + return c; + } + + // S5.2.3 "unparsed-attributes consist of the remainder of the set-cookie-string + // (including the %x3B (";") in question)." plus later on in the same section + // "discard the first ";" and trim". + var unparsed = str.slice(firstSemi + 1).trim(); + + // "If the unparsed-attributes string is empty, skip the rest of these + // steps." + if (unparsed.length === 0) { + return c; + } + + /* + * S5.2 says that when looping over the items "[p]rocess the attribute-name + * and attribute-value according to the requirements in the following + * subsections" for every item. Plus, for many of the individual attributes + * in S5.3 it says to use the "attribute-value of the last attribute in the + * cookie-attribute-list". Therefore, in this implementation, we overwrite + * the previous value. + */ + var cookie_avs = unparsed.split(';'); + while (cookie_avs.length) { + var av = cookie_avs.shift().trim(); + if (av.length === 0) { // happens if ";;" appears + continue; + } + var av_sep = av.indexOf('='); + var av_key, av_value; + + if (av_sep === -1) { + av_key = av; + av_value = null; + } else { + av_key = av.substr(0,av_sep); + av_value = av.substr(av_sep+1); + } + + av_key = av_key.trim().toLowerCase(); + + if (av_value) { + av_value = av_value.trim(); + } + + switch(av_key) { + case 'expires': // S5.2.1 + if (av_value) { + var exp = parseDate(av_value); + // "If the attribute-value failed to parse as a cookie date, ignore the + // cookie-av." + if (exp) { + // over and underflow not realistically a concern: V8's getTime() seems to + // store something larger than a 32-bit time_t (even with 32-bit node) + c.expires = exp; + } + } + break; + + case 'max-age': // S5.2.2 + if (av_value) { + // "If the first character of the attribute-value is not a DIGIT or a "-" + // character ...[or]... If the remainder of attribute-value contains a + // non-DIGIT character, ignore the cookie-av." + if (/^-?[0-9]+$/.test(av_value)) { + var delta = parseInt(av_value, 10); + // "If delta-seconds is less than or equal to zero (0), let expiry-time + // be the earliest representable date and time." + c.setMaxAge(delta); + } + } + break; + + case 'domain': // S5.2.3 + // "If the attribute-value is empty, the behavior is undefined. However, + // the user agent SHOULD ignore the cookie-av entirely." + if (av_value) { + // S5.2.3 "Let cookie-domain be the attribute-value without the leading %x2E + // (".") character." + var domain = av_value.trim().replace(/^\./, ''); + if (domain) { + // "Convert the cookie-domain to lower case." + c.domain = domain.toLowerCase(); + } + } + break; + + case 'path': // S5.2.4 + /* + * "If the attribute-value is empty or if the first character of the + * attribute-value is not %x2F ("/"): + * Let cookie-path be the default-path. + * Otherwise: + * Let cookie-path be the attribute-value." + * + * We'll represent the default-path as null since it depends on the + * context of the parsing. + */ + c.path = av_value && av_value[0] === "/" ? av_value : null; + break; + + case 'secure': // S5.2.5 + /* + * "If the attribute-name case-insensitively matches the string "Secure", + * the user agent MUST append an attribute to the cookie-attribute-list + * with an attribute-name of Secure and an empty attribute-value." + */ + c.secure = true; + break; + + case 'httponly': // S5.2.6 -- effectively the same as 'secure' + c.httpOnly = true; + break; + + default: + c.extensions = c.extensions || []; + c.extensions.push(av); + break; + } + } + + return c; +} + +// avoid the V8 deoptimization monster! +function jsonParse(str) { + var obj; + try { + obj = JSON.parse(str); + } catch (e) { + return e; + } + return obj; +} + +function fromJSON(str) { + if (!str) { + return null; + } + + var obj; + if (typeof str === 'string') { + obj = jsonParse(str); + if (obj instanceof Error) { + return null; + } + } else { + // assume it's an Object + obj = str; + } + + var c = new Cookie(); + for (var i=0; i 1) { + var lindex = path.lastIndexOf('/'); + if (lindex === 0) { + break; + } + path = path.substr(0,lindex); + permutations.push(path); + } + permutations.push('/'); + return permutations; +} + +function getCookieContext(url) { + if (url instanceof Object) { + return url; + } + // NOTE: decodeURI will throw on malformed URIs (see GH-32). + // Therefore, we will just skip decoding for such URIs. + try { + url = decodeURI(url); + } + catch(err) { + // Silently swallow error + } + + return urlParse(url); +} + +function Cookie(options) { + options = options || {}; + + Object.keys(options).forEach(function(prop) { + if (Cookie.prototype.hasOwnProperty(prop) && + Cookie.prototype[prop] !== options[prop] && + prop.substr(0,1) !== '_') + { + this[prop] = options[prop]; + } + }, this); + + this.creation = this.creation || new Date(); + + // used to break creation ties in cookieCompare(): + Object.defineProperty(this, 'creationIndex', { + configurable: false, + enumerable: false, // important for assert.deepEqual checks + writable: true, + value: ++Cookie.cookiesCreated + }); +} + +Cookie.cookiesCreated = 0; // incremented each time a cookie is created + +Cookie.parse = parse; +Cookie.fromJSON = fromJSON; + +Cookie.prototype.key = ""; +Cookie.prototype.value = ""; + +// the order in which the RFC has them: +Cookie.prototype.expires = "Infinity"; // coerces to literal Infinity +Cookie.prototype.maxAge = null; // takes precedence over expires for TTL +Cookie.prototype.domain = null; +Cookie.prototype.path = null; +Cookie.prototype.secure = false; +Cookie.prototype.httpOnly = false; +Cookie.prototype.extensions = null; + +// set by the CookieJar: +Cookie.prototype.hostOnly = null; // boolean when set +Cookie.prototype.pathIsDefault = null; // boolean when set +Cookie.prototype.creation = null; // Date when set; defaulted by Cookie.parse +Cookie.prototype.lastAccessed = null; // Date when set +Object.defineProperty(Cookie.prototype, 'creationIndex', { + configurable: true, + enumerable: false, + writable: true, + value: 0 +}); + +Cookie.serializableProperties = Object.keys(Cookie.prototype) + .filter(function(prop) { + return !( + Cookie.prototype[prop] instanceof Function || + prop === 'creationIndex' || + prop.substr(0,1) === '_' + ); + }); + +Cookie.prototype.inspect = function inspect() { + var now = Date.now(); + return 'Cookie="'+this.toString() + + '; hostOnly='+(this.hostOnly != null ? this.hostOnly : '?') + + '; aAge='+(this.lastAccessed ? (now-this.lastAccessed.getTime())+'ms' : '?') + + '; cAge='+(this.creation ? (now-this.creation.getTime())+'ms' : '?') + + '"'; +}; + +Cookie.prototype.toJSON = function() { + var obj = {}; + + var props = Cookie.serializableProperties; + for (var i=0; i suffixLen) { + var publicSuffix = parts.slice(0,suffixLen+1).reverse().join('.'); + return converted ? punycode.toUnicode(publicSuffix) : publicSuffix; + } + + return null; +}; + +// The following generated structure is used under the MPL version 2.0 +// See public-suffix.txt for more information + +var index = module.exports.index = Object.freeze( +{"ac":true,"com.ac":true,"edu.ac":true,"gov.ac":true,"net.ac":true,"mil.ac":true,"org.ac":true,"ad":true,"nom.ad":true,"ae":true,"co.ae":true,"net.ae":true,"org.ae":true,"sch.ae":true,"ac.ae":true,"gov.ae":true,"mil.ae":true,"aero":true,"accident-investigation.aero":true,"accident-prevention.aero":true,"aerobatic.aero":true,"aeroclub.aero":true,"aerodrome.aero":true,"agents.aero":true,"aircraft.aero":true,"airline.aero":true,"airport.aero":true,"air-surveillance.aero":true,"airtraffic.aero":true,"air-traffic-control.aero":true,"ambulance.aero":true,"amusement.aero":true,"association.aero":true,"author.aero":true,"ballooning.aero":true,"broker.aero":true,"caa.aero":true,"cargo.aero":true,"catering.aero":true,"certification.aero":true,"championship.aero":true,"charter.aero":true,"civilaviation.aero":true,"club.aero":true,"conference.aero":true,"consultant.aero":true,"consulting.aero":true,"control.aero":true,"council.aero":true,"crew.aero":true,"design.aero":true,"dgca.aero":true,"educator.aero":true,"emergency.aero":true,"engine.aero":true,"engineer.aero":true,"entertainment.aero":true,"equipment.aero":true,"exchange.aero":true,"express.aero":true,"federation.aero":true,"flight.aero":true,"freight.aero":true,"fuel.aero":true,"gliding.aero":true,"government.aero":true,"groundhandling.aero":true,"group.aero":true,"hanggliding.aero":true,"homebuilt.aero":true,"insurance.aero":true,"journal.aero":true,"journalist.aero":true,"leasing.aero":true,"logistics.aero":true,"magazine.aero":true,"maintenance.aero":true,"marketplace.aero":true,"media.aero":true,"microlight.aero":true,"modelling.aero":true,"navigation.aero":true,"parachuting.aero":true,"paragliding.aero":true,"passenger-association.aero":true,"pilot.aero":true,"press.aero":true,"production.aero":true,"recreation.aero":true,"repbody.aero":true,"res.aero":true,"research.aero":true,"rotorcraft.aero":true,"safety.aero":true,"scientist.aero":true,"services.aero":true,"show.aero":true,"skydiving.aero":true,"software.aero":true,"student.aero":true,"taxi.aero":true,"trader.aero":true,"trading.aero":true,"trainer.aero":true,"union.aero":true,"workinggroup.aero":true,"works.aero":true,"af":true,"gov.af":true,"com.af":true,"org.af":true,"net.af":true,"edu.af":true,"ag":true,"com.ag":true,"org.ag":true,"net.ag":true,"co.ag":true,"nom.ag":true,"ai":true,"off.ai":true,"com.ai":true,"net.ai":true,"org.ai":true,"al":true,"com.al":true,"edu.al":true,"gov.al":true,"mil.al":true,"net.al":true,"org.al":true,"am":true,"an":true,"com.an":true,"net.an":true,"org.an":true,"edu.an":true,"ao":true,"ed.ao":true,"gv.ao":true,"og.ao":true,"co.ao":true,"pb.ao":true,"it.ao":true,"aq":true,"ar":true,"com.ar":true,"edu.ar":true,"gob.ar":true,"gov.ar":true,"int.ar":true,"mil.ar":true,"net.ar":true,"org.ar":true,"tur.ar":true,"arpa":true,"e164.arpa":true,"in-addr.arpa":true,"ip6.arpa":true,"iris.arpa":true,"uri.arpa":true,"urn.arpa":true,"as":true,"gov.as":true,"asia":true,"at":true,"ac.at":true,"co.at":true,"gv.at":true,"or.at":true,"au":true,"com.au":true,"net.au":true,"org.au":true,"edu.au":true,"gov.au":true,"asn.au":true,"id.au":true,"info.au":true,"conf.au":true,"oz.au":true,"act.au":true,"nsw.au":true,"nt.au":true,"qld.au":true,"sa.au":true,"tas.au":true,"vic.au":true,"wa.au":true,"act.edu.au":true,"nsw.edu.au":true,"nt.edu.au":true,"qld.edu.au":true,"sa.edu.au":true,"tas.edu.au":true,"vic.edu.au":true,"wa.edu.au":true,"qld.gov.au":true,"sa.gov.au":true,"tas.gov.au":true,"vic.gov.au":true,"wa.gov.au":true,"aw":true,"com.aw":true,"ax":true,"az":true,"com.az":true,"net.az":true,"int.az":true,"gov.az":true,"org.az":true,"edu.az":true,"info.az":true,"pp.az":true,"mil.az":true,"name.az":true,"pro.az":true,"biz.az":true,"ba":true,"org.ba":true,"net.ba":true,"edu.ba":true,"gov.ba":true,"mil.ba":true,"unsa.ba":true,"unbi.ba":true,"co.ba":true,"com.ba":true,"rs.ba":true,"bb":true,"biz.bb":true,"co.bb":true,"com.bb":true,"edu.bb":true,"gov.bb":true,"info.bb":true,"net.bb":true,"org.bb":true,"store.bb":true,"tv.bb":true,"*.bd":true,"be":true,"ac.be":true,"bf":true,"gov.bf":true,"bg":true,"a.bg":true,"b.bg":true,"c.bg":true,"d.bg":true,"e.bg":true,"f.bg":true,"g.bg":true,"h.bg":true,"i.bg":true,"j.bg":true,"k.bg":true,"l.bg":true,"m.bg":true,"n.bg":true,"o.bg":true,"p.bg":true,"q.bg":true,"r.bg":true,"s.bg":true,"t.bg":true,"u.bg":true,"v.bg":true,"w.bg":true,"x.bg":true,"y.bg":true,"z.bg":true,"0.bg":true,"1.bg":true,"2.bg":true,"3.bg":true,"4.bg":true,"5.bg":true,"6.bg":true,"7.bg":true,"8.bg":true,"9.bg":true,"bh":true,"com.bh":true,"edu.bh":true,"net.bh":true,"org.bh":true,"gov.bh":true,"bi":true,"co.bi":true,"com.bi":true,"edu.bi":true,"or.bi":true,"org.bi":true,"biz":true,"bj":true,"asso.bj":true,"barreau.bj":true,"gouv.bj":true,"bm":true,"com.bm":true,"edu.bm":true,"gov.bm":true,"net.bm":true,"org.bm":true,"*.bn":true,"bo":true,"com.bo":true,"edu.bo":true,"gov.bo":true,"gob.bo":true,"int.bo":true,"org.bo":true,"net.bo":true,"mil.bo":true,"tv.bo":true,"br":true,"adm.br":true,"adv.br":true,"agr.br":true,"am.br":true,"arq.br":true,"art.br":true,"ato.br":true,"b.br":true,"bio.br":true,"blog.br":true,"bmd.br":true,"cim.br":true,"cng.br":true,"cnt.br":true,"com.br":true,"coop.br":true,"ecn.br":true,"eco.br":true,"edu.br":true,"emp.br":true,"eng.br":true,"esp.br":true,"etc.br":true,"eti.br":true,"far.br":true,"flog.br":true,"fm.br":true,"fnd.br":true,"fot.br":true,"fst.br":true,"g12.br":true,"ggf.br":true,"gov.br":true,"imb.br":true,"ind.br":true,"inf.br":true,"jor.br":true,"jus.br":true,"leg.br":true,"lel.br":true,"mat.br":true,"med.br":true,"mil.br":true,"mp.br":true,"mus.br":true,"net.br":true,"*.nom.br":true,"not.br":true,"ntr.br":true,"odo.br":true,"org.br":true,"ppg.br":true,"pro.br":true,"psc.br":true,"psi.br":true,"qsl.br":true,"radio.br":true,"rec.br":true,"slg.br":true,"srv.br":true,"taxi.br":true,"teo.br":true,"tmp.br":true,"trd.br":true,"tur.br":true,"tv.br":true,"vet.br":true,"vlog.br":true,"wiki.br":true,"zlg.br":true,"bs":true,"com.bs":true,"net.bs":true,"org.bs":true,"edu.bs":true,"gov.bs":true,"bt":true,"com.bt":true,"edu.bt":true,"gov.bt":true,"net.bt":true,"org.bt":true,"bv":true,"bw":true,"co.bw":true,"org.bw":true,"by":true,"gov.by":true,"mil.by":true,"com.by":true,"of.by":true,"bz":true,"com.bz":true,"net.bz":true,"org.bz":true,"edu.bz":true,"gov.bz":true,"ca":true,"ab.ca":true,"bc.ca":true,"mb.ca":true,"nb.ca":true,"nf.ca":true,"nl.ca":true,"ns.ca":true,"nt.ca":true,"nu.ca":true,"on.ca":true,"pe.ca":true,"qc.ca":true,"sk.ca":true,"yk.ca":true,"gc.ca":true,"cat":true,"cc":true,"cd":true,"gov.cd":true,"cf":true,"cg":true,"ch":true,"ci":true,"org.ci":true,"or.ci":true,"com.ci":true,"co.ci":true,"edu.ci":true,"ed.ci":true,"ac.ci":true,"net.ci":true,"go.ci":true,"asso.ci":true,"xn--aroport-bya.ci":true,"int.ci":true,"presse.ci":true,"md.ci":true,"gouv.ci":true,"*.ck":true,"www.ck":false,"cl":true,"gov.cl":true,"gob.cl":true,"co.cl":true,"mil.cl":true,"cm":true,"co.cm":true,"com.cm":true,"gov.cm":true,"net.cm":true,"cn":true,"ac.cn":true,"com.cn":true,"edu.cn":true,"gov.cn":true,"net.cn":true,"org.cn":true,"mil.cn":true,"xn--55qx5d.cn":true,"xn--io0a7i.cn":true,"xn--od0alg.cn":true,"ah.cn":true,"bj.cn":true,"cq.cn":true,"fj.cn":true,"gd.cn":true,"gs.cn":true,"gz.cn":true,"gx.cn":true,"ha.cn":true,"hb.cn":true,"he.cn":true,"hi.cn":true,"hl.cn":true,"hn.cn":true,"jl.cn":true,"js.cn":true,"jx.cn":true,"ln.cn":true,"nm.cn":true,"nx.cn":true,"qh.cn":true,"sc.cn":true,"sd.cn":true,"sh.cn":true,"sn.cn":true,"sx.cn":true,"tj.cn":true,"xj.cn":true,"xz.cn":true,"yn.cn":true,"zj.cn":true,"hk.cn":true,"mo.cn":true,"tw.cn":true,"co":true,"arts.co":true,"com.co":true,"edu.co":true,"firm.co":true,"gov.co":true,"info.co":true,"int.co":true,"mil.co":true,"net.co":true,"nom.co":true,"org.co":true,"rec.co":true,"web.co":true,"com":true,"coop":true,"cr":true,"ac.cr":true,"co.cr":true,"ed.cr":true,"fi.cr":true,"go.cr":true,"or.cr":true,"sa.cr":true,"cu":true,"com.cu":true,"edu.cu":true,"org.cu":true,"net.cu":true,"gov.cu":true,"inf.cu":true,"cv":true,"cw":true,"com.cw":true,"edu.cw":true,"net.cw":true,"org.cw":true,"cx":true,"gov.cx":true,"ac.cy":true,"biz.cy":true,"com.cy":true,"ekloges.cy":true,"gov.cy":true,"ltd.cy":true,"name.cy":true,"net.cy":true,"org.cy":true,"parliament.cy":true,"press.cy":true,"pro.cy":true,"tm.cy":true,"cz":true,"de":true,"dj":true,"dk":true,"dm":true,"com.dm":true,"net.dm":true,"org.dm":true,"edu.dm":true,"gov.dm":true,"do":true,"art.do":true,"com.do":true,"edu.do":true,"gob.do":true,"gov.do":true,"mil.do":true,"net.do":true,"org.do":true,"sld.do":true,"web.do":true,"dz":true,"com.dz":true,"org.dz":true,"net.dz":true,"gov.dz":true,"edu.dz":true,"asso.dz":true,"pol.dz":true,"art.dz":true,"ec":true,"com.ec":true,"info.ec":true,"net.ec":true,"fin.ec":true,"k12.ec":true,"med.ec":true,"pro.ec":true,"org.ec":true,"edu.ec":true,"gov.ec":true,"gob.ec":true,"mil.ec":true,"edu":true,"ee":true,"edu.ee":true,"gov.ee":true,"riik.ee":true,"lib.ee":true,"med.ee":true,"com.ee":true,"pri.ee":true,"aip.ee":true,"org.ee":true,"fie.ee":true,"eg":true,"com.eg":true,"edu.eg":true,"eun.eg":true,"gov.eg":true,"mil.eg":true,"name.eg":true,"net.eg":true,"org.eg":true,"sci.eg":true,"*.er":true,"es":true,"com.es":true,"nom.es":true,"org.es":true,"gob.es":true,"edu.es":true,"et":true,"com.et":true,"gov.et":true,"org.et":true,"edu.et":true,"biz.et":true,"name.et":true,"info.et":true,"net.et":true,"eu":true,"fi":true,"aland.fi":true,"*.fj":true,"*.fk":true,"fm":true,"fo":true,"fr":true,"com.fr":true,"asso.fr":true,"nom.fr":true,"prd.fr":true,"presse.fr":true,"tm.fr":true,"aeroport.fr":true,"assedic.fr":true,"avocat.fr":true,"avoues.fr":true,"cci.fr":true,"chambagri.fr":true,"chirurgiens-dentistes.fr":true,"experts-comptables.fr":true,"geometre-expert.fr":true,"gouv.fr":true,"greta.fr":true,"huissier-justice.fr":true,"medecin.fr":true,"notaires.fr":true,"pharmacien.fr":true,"port.fr":true,"veterinaire.fr":true,"ga":true,"gb":true,"gd":true,"ge":true,"com.ge":true,"edu.ge":true,"gov.ge":true,"org.ge":true,"mil.ge":true,"net.ge":true,"pvt.ge":true,"gf":true,"gg":true,"co.gg":true,"net.gg":true,"org.gg":true,"gh":true,"com.gh":true,"edu.gh":true,"gov.gh":true,"org.gh":true,"mil.gh":true,"gi":true,"com.gi":true,"ltd.gi":true,"gov.gi":true,"mod.gi":true,"edu.gi":true,"org.gi":true,"gl":true,"co.gl":true,"com.gl":true,"edu.gl":true,"net.gl":true,"org.gl":true,"gm":true,"gn":true,"ac.gn":true,"com.gn":true,"edu.gn":true,"gov.gn":true,"org.gn":true,"net.gn":true,"gov":true,"gp":true,"com.gp":true,"net.gp":true,"mobi.gp":true,"edu.gp":true,"org.gp":true,"asso.gp":true,"gq":true,"gr":true,"com.gr":true,"edu.gr":true,"net.gr":true,"org.gr":true,"gov.gr":true,"gs":true,"gt":true,"com.gt":true,"edu.gt":true,"gob.gt":true,"ind.gt":true,"mil.gt":true,"net.gt":true,"org.gt":true,"*.gu":true,"gw":true,"gy":true,"co.gy":true,"com.gy":true,"net.gy":true,"hk":true,"com.hk":true,"edu.hk":true,"gov.hk":true,"idv.hk":true,"net.hk":true,"org.hk":true,"xn--55qx5d.hk":true,"xn--wcvs22d.hk":true,"xn--lcvr32d.hk":true,"xn--mxtq1m.hk":true,"xn--gmqw5a.hk":true,"xn--ciqpn.hk":true,"xn--gmq050i.hk":true,"xn--zf0avx.hk":true,"xn--io0a7i.hk":true,"xn--mk0axi.hk":true,"xn--od0alg.hk":true,"xn--od0aq3b.hk":true,"xn--tn0ag.hk":true,"xn--uc0atv.hk":true,"xn--uc0ay4a.hk":true,"hm":true,"hn":true,"com.hn":true,"edu.hn":true,"org.hn":true,"net.hn":true,"mil.hn":true,"gob.hn":true,"hr":true,"iz.hr":true,"from.hr":true,"name.hr":true,"com.hr":true,"ht":true,"com.ht":true,"shop.ht":true,"firm.ht":true,"info.ht":true,"adult.ht":true,"net.ht":true,"pro.ht":true,"org.ht":true,"med.ht":true,"art.ht":true,"coop.ht":true,"pol.ht":true,"asso.ht":true,"edu.ht":true,"rel.ht":true,"gouv.ht":true,"perso.ht":true,"hu":true,"co.hu":true,"info.hu":true,"org.hu":true,"priv.hu":true,"sport.hu":true,"tm.hu":true,"2000.hu":true,"agrar.hu":true,"bolt.hu":true,"casino.hu":true,"city.hu":true,"erotica.hu":true,"erotika.hu":true,"film.hu":true,"forum.hu":true,"games.hu":true,"hotel.hu":true,"ingatlan.hu":true,"jogasz.hu":true,"konyvelo.hu":true,"lakas.hu":true,"media.hu":true,"news.hu":true,"reklam.hu":true,"sex.hu":true,"shop.hu":true,"suli.hu":true,"szex.hu":true,"tozsde.hu":true,"utazas.hu":true,"video.hu":true,"id":true,"ac.id":true,"biz.id":true,"co.id":true,"desa.id":true,"go.id":true,"mil.id":true,"my.id":true,"net.id":true,"or.id":true,"sch.id":true,"web.id":true,"ie":true,"gov.ie":true,"il":true,"ac.il":true,"co.il":true,"gov.il":true,"idf.il":true,"k12.il":true,"muni.il":true,"net.il":true,"org.il":true,"im":true,"ac.im":true,"co.im":true,"com.im":true,"ltd.co.im":true,"net.im":true,"org.im":true,"plc.co.im":true,"tt.im":true,"tv.im":true,"in":true,"co.in":true,"firm.in":true,"net.in":true,"org.in":true,"gen.in":true,"ind.in":true,"nic.in":true,"ac.in":true,"edu.in":true,"res.in":true,"gov.in":true,"mil.in":true,"info":true,"int":true,"eu.int":true,"io":true,"com.io":true,"iq":true,"gov.iq":true,"edu.iq":true,"mil.iq":true,"com.iq":true,"org.iq":true,"net.iq":true,"ir":true,"ac.ir":true,"co.ir":true,"gov.ir":true,"id.ir":true,"net.ir":true,"org.ir":true,"sch.ir":true,"xn--mgba3a4f16a.ir":true,"xn--mgba3a4fra.ir":true,"is":true,"net.is":true,"com.is":true,"edu.is":true,"gov.is":true,"org.is":true,"int.is":true,"it":true,"gov.it":true,"edu.it":true,"abr.it":true,"abruzzo.it":true,"aosta-valley.it":true,"aostavalley.it":true,"bas.it":true,"basilicata.it":true,"cal.it":true,"calabria.it":true,"cam.it":true,"campania.it":true,"emilia-romagna.it":true,"emiliaromagna.it":true,"emr.it":true,"friuli-v-giulia.it":true,"friuli-ve-giulia.it":true,"friuli-vegiulia.it":true,"friuli-venezia-giulia.it":true,"friuli-veneziagiulia.it":true,"friuli-vgiulia.it":true,"friuliv-giulia.it":true,"friulive-giulia.it":true,"friulivegiulia.it":true,"friulivenezia-giulia.it":true,"friuliveneziagiulia.it":true,"friulivgiulia.it":true,"fvg.it":true,"laz.it":true,"lazio.it":true,"lig.it":true,"liguria.it":true,"lom.it":true,"lombardia.it":true,"lombardy.it":true,"lucania.it":true,"mar.it":true,"marche.it":true,"mol.it":true,"molise.it":true,"piedmont.it":true,"piemonte.it":true,"pmn.it":true,"pug.it":true,"puglia.it":true,"sar.it":true,"sardegna.it":true,"sardinia.it":true,"sic.it":true,"sicilia.it":true,"sicily.it":true,"taa.it":true,"tos.it":true,"toscana.it":true,"trentino-a-adige.it":true,"trentino-aadige.it":true,"trentino-alto-adige.it":true,"trentino-altoadige.it":true,"trentino-s-tirol.it":true,"trentino-stirol.it":true,"trentino-sud-tirol.it":true,"trentino-sudtirol.it":true,"trentino-sued-tirol.it":true,"trentino-suedtirol.it":true,"trentinoa-adige.it":true,"trentinoaadige.it":true,"trentinoalto-adige.it":true,"trentinoaltoadige.it":true,"trentinos-tirol.it":true,"trentinostirol.it":true,"trentinosud-tirol.it":true,"trentinosudtirol.it":true,"trentinosued-tirol.it":true,"trentinosuedtirol.it":true,"tuscany.it":true,"umb.it":true,"umbria.it":true,"val-d-aosta.it":true,"val-daosta.it":true,"vald-aosta.it":true,"valdaosta.it":true,"valle-aosta.it":true,"valle-d-aosta.it":true,"valle-daosta.it":true,"valleaosta.it":true,"valled-aosta.it":true,"valledaosta.it":true,"vallee-aoste.it":true,"valleeaoste.it":true,"vao.it":true,"vda.it":true,"ven.it":true,"veneto.it":true,"ag.it":true,"agrigento.it":true,"al.it":true,"alessandria.it":true,"alto-adige.it":true,"altoadige.it":true,"an.it":true,"ancona.it":true,"andria-barletta-trani.it":true,"andria-trani-barletta.it":true,"andriabarlettatrani.it":true,"andriatranibarletta.it":true,"ao.it":true,"aosta.it":true,"aoste.it":true,"ap.it":true,"aq.it":true,"aquila.it":true,"ar.it":true,"arezzo.it":true,"ascoli-piceno.it":true,"ascolipiceno.it":true,"asti.it":true,"at.it":true,"av.it":true,"avellino.it":true,"ba.it":true,"balsan.it":true,"bari.it":true,"barletta-trani-andria.it":true,"barlettatraniandria.it":true,"belluno.it":true,"benevento.it":true,"bergamo.it":true,"bg.it":true,"bi.it":true,"biella.it":true,"bl.it":true,"bn.it":true,"bo.it":true,"bologna.it":true,"bolzano.it":true,"bozen.it":true,"br.it":true,"brescia.it":true,"brindisi.it":true,"bs.it":true,"bt.it":true,"bz.it":true,"ca.it":true,"cagliari.it":true,"caltanissetta.it":true,"campidano-medio.it":true,"campidanomedio.it":true,"campobasso.it":true,"carbonia-iglesias.it":true,"carboniaiglesias.it":true,"carrara-massa.it":true,"carraramassa.it":true,"caserta.it":true,"catania.it":true,"catanzaro.it":true,"cb.it":true,"ce.it":true,"cesena-forli.it":true,"cesenaforli.it":true,"ch.it":true,"chieti.it":true,"ci.it":true,"cl.it":true,"cn.it":true,"co.it":true,"como.it":true,"cosenza.it":true,"cr.it":true,"cremona.it":true,"crotone.it":true,"cs.it":true,"ct.it":true,"cuneo.it":true,"cz.it":true,"dell-ogliastra.it":true,"dellogliastra.it":true,"en.it":true,"enna.it":true,"fc.it":true,"fe.it":true,"fermo.it":true,"ferrara.it":true,"fg.it":true,"fi.it":true,"firenze.it":true,"florence.it":true,"fm.it":true,"foggia.it":true,"forli-cesena.it":true,"forlicesena.it":true,"fr.it":true,"frosinone.it":true,"ge.it":true,"genoa.it":true,"genova.it":true,"go.it":true,"gorizia.it":true,"gr.it":true,"grosseto.it":true,"iglesias-carbonia.it":true,"iglesiascarbonia.it":true,"im.it":true,"imperia.it":true,"is.it":true,"isernia.it":true,"kr.it":true,"la-spezia.it":true,"laquila.it":true,"laspezia.it":true,"latina.it":true,"lc.it":true,"le.it":true,"lecce.it":true,"lecco.it":true,"li.it":true,"livorno.it":true,"lo.it":true,"lodi.it":true,"lt.it":true,"lu.it":true,"lucca.it":true,"macerata.it":true,"mantova.it":true,"massa-carrara.it":true,"massacarrara.it":true,"matera.it":true,"mb.it":true,"mc.it":true,"me.it":true,"medio-campidano.it":true,"mediocampidano.it":true,"messina.it":true,"mi.it":true,"milan.it":true,"milano.it":true,"mn.it":true,"mo.it":true,"modena.it":true,"monza-brianza.it":true,"monza-e-della-brianza.it":true,"monza.it":true,"monzabrianza.it":true,"monzaebrianza.it":true,"monzaedellabrianza.it":true,"ms.it":true,"mt.it":true,"na.it":true,"naples.it":true,"napoli.it":true,"no.it":true,"novara.it":true,"nu.it":true,"nuoro.it":true,"og.it":true,"ogliastra.it":true,"olbia-tempio.it":true,"olbiatempio.it":true,"or.it":true,"oristano.it":true,"ot.it":true,"pa.it":true,"padova.it":true,"padua.it":true,"palermo.it":true,"parma.it":true,"pavia.it":true,"pc.it":true,"pd.it":true,"pe.it":true,"perugia.it":true,"pesaro-urbino.it":true,"pesarourbino.it":true,"pescara.it":true,"pg.it":true,"pi.it":true,"piacenza.it":true,"pisa.it":true,"pistoia.it":true,"pn.it":true,"po.it":true,"pordenone.it":true,"potenza.it":true,"pr.it":true,"prato.it":true,"pt.it":true,"pu.it":true,"pv.it":true,"pz.it":true,"ra.it":true,"ragusa.it":true,"ravenna.it":true,"rc.it":true,"re.it":true,"reggio-calabria.it":true,"reggio-emilia.it":true,"reggiocalabria.it":true,"reggioemilia.it":true,"rg.it":true,"ri.it":true,"rieti.it":true,"rimini.it":true,"rm.it":true,"rn.it":true,"ro.it":true,"roma.it":true,"rome.it":true,"rovigo.it":true,"sa.it":true,"salerno.it":true,"sassari.it":true,"savona.it":true,"si.it":true,"siena.it":true,"siracusa.it":true,"so.it":true,"sondrio.it":true,"sp.it":true,"sr.it":true,"ss.it":true,"suedtirol.it":true,"sv.it":true,"ta.it":true,"taranto.it":true,"te.it":true,"tempio-olbia.it":true,"tempioolbia.it":true,"teramo.it":true,"terni.it":true,"tn.it":true,"to.it":true,"torino.it":true,"tp.it":true,"tr.it":true,"trani-andria-barletta.it":true,"trani-barletta-andria.it":true,"traniandriabarletta.it":true,"tranibarlettaandria.it":true,"trapani.it":true,"trentino.it":true,"trento.it":true,"treviso.it":true,"trieste.it":true,"ts.it":true,"turin.it":true,"tv.it":true,"ud.it":true,"udine.it":true,"urbino-pesaro.it":true,"urbinopesaro.it":true,"va.it":true,"varese.it":true,"vb.it":true,"vc.it":true,"ve.it":true,"venezia.it":true,"venice.it":true,"verbania.it":true,"vercelli.it":true,"verona.it":true,"vi.it":true,"vibo-valentia.it":true,"vibovalentia.it":true,"vicenza.it":true,"viterbo.it":true,"vr.it":true,"vs.it":true,"vt.it":true,"vv.it":true,"je":true,"co.je":true,"net.je":true,"org.je":true,"*.jm":true,"jo":true,"com.jo":true,"org.jo":true,"net.jo":true,"edu.jo":true,"sch.jo":true,"gov.jo":true,"mil.jo":true,"name.jo":true,"jobs":true,"jp":true,"ac.jp":true,"ad.jp":true,"co.jp":true,"ed.jp":true,"go.jp":true,"gr.jp":true,"lg.jp":true,"ne.jp":true,"or.jp":true,"aichi.jp":true,"akita.jp":true,"aomori.jp":true,"chiba.jp":true,"ehime.jp":true,"fukui.jp":true,"fukuoka.jp":true,"fukushima.jp":true,"gifu.jp":true,"gunma.jp":true,"hiroshima.jp":true,"hokkaido.jp":true,"hyogo.jp":true,"ibaraki.jp":true,"ishikawa.jp":true,"iwate.jp":true,"kagawa.jp":true,"kagoshima.jp":true,"kanagawa.jp":true,"kochi.jp":true,"kumamoto.jp":true,"kyoto.jp":true,"mie.jp":true,"miyagi.jp":true,"miyazaki.jp":true,"nagano.jp":true,"nagasaki.jp":true,"nara.jp":true,"niigata.jp":true,"oita.jp":true,"okayama.jp":true,"okinawa.jp":true,"osaka.jp":true,"saga.jp":true,"saitama.jp":true,"shiga.jp":true,"shimane.jp":true,"shizuoka.jp":true,"tochigi.jp":true,"tokushima.jp":true,"tokyo.jp":true,"tottori.jp":true,"toyama.jp":true,"wakayama.jp":true,"yamagata.jp":true,"yamaguchi.jp":true,"yamanashi.jp":true,"xn--4pvxs.jp":true,"xn--vgu402c.jp":true,"xn--c3s14m.jp":true,"xn--f6qx53a.jp":true,"xn--8pvr4u.jp":true,"xn--uist22h.jp":true,"xn--djrs72d6uy.jp":true,"xn--mkru45i.jp":true,"xn--0trq7p7nn.jp":true,"xn--8ltr62k.jp":true,"xn--2m4a15e.jp":true,"xn--efvn9s.jp":true,"xn--32vp30h.jp":true,"xn--4it797k.jp":true,"xn--1lqs71d.jp":true,"xn--5rtp49c.jp":true,"xn--5js045d.jp":true,"xn--ehqz56n.jp":true,"xn--1lqs03n.jp":true,"xn--qqqt11m.jp":true,"xn--kbrq7o.jp":true,"xn--pssu33l.jp":true,"xn--ntsq17g.jp":true,"xn--uisz3g.jp":true,"xn--6btw5a.jp":true,"xn--1ctwo.jp":true,"xn--6orx2r.jp":true,"xn--rht61e.jp":true,"xn--rht27z.jp":true,"xn--djty4k.jp":true,"xn--nit225k.jp":true,"xn--rht3d.jp":true,"xn--klty5x.jp":true,"xn--kltx9a.jp":true,"xn--kltp7d.jp":true,"xn--uuwu58a.jp":true,"xn--zbx025d.jp":true,"xn--ntso0iqx3a.jp":true,"xn--elqq16h.jp":true,"xn--4it168d.jp":true,"xn--klt787d.jp":true,"xn--rny31h.jp":true,"xn--7t0a264c.jp":true,"xn--5rtq34k.jp":true,"xn--k7yn95e.jp":true,"xn--tor131o.jp":true,"xn--d5qv7z876c.jp":true,"*.kawasaki.jp":true,"*.kitakyushu.jp":true,"*.kobe.jp":true,"*.nagoya.jp":true,"*.sapporo.jp":true,"*.sendai.jp":true,"*.yokohama.jp":true,"city.kawasaki.jp":false,"city.kitakyushu.jp":false,"city.kobe.jp":false,"city.nagoya.jp":false,"city.sapporo.jp":false,"city.sendai.jp":false,"city.yokohama.jp":false,"aisai.aichi.jp":true,"ama.aichi.jp":true,"anjo.aichi.jp":true,"asuke.aichi.jp":true,"chiryu.aichi.jp":true,"chita.aichi.jp":true,"fuso.aichi.jp":true,"gamagori.aichi.jp":true,"handa.aichi.jp":true,"hazu.aichi.jp":true,"hekinan.aichi.jp":true,"higashiura.aichi.jp":true,"ichinomiya.aichi.jp":true,"inazawa.aichi.jp":true,"inuyama.aichi.jp":true,"isshiki.aichi.jp":true,"iwakura.aichi.jp":true,"kanie.aichi.jp":true,"kariya.aichi.jp":true,"kasugai.aichi.jp":true,"kira.aichi.jp":true,"kiyosu.aichi.jp":true,"komaki.aichi.jp":true,"konan.aichi.jp":true,"kota.aichi.jp":true,"mihama.aichi.jp":true,"miyoshi.aichi.jp":true,"nishio.aichi.jp":true,"nisshin.aichi.jp":true,"obu.aichi.jp":true,"oguchi.aichi.jp":true,"oharu.aichi.jp":true,"okazaki.aichi.jp":true,"owariasahi.aichi.jp":true,"seto.aichi.jp":true,"shikatsu.aichi.jp":true,"shinshiro.aichi.jp":true,"shitara.aichi.jp":true,"tahara.aichi.jp":true,"takahama.aichi.jp":true,"tobishima.aichi.jp":true,"toei.aichi.jp":true,"togo.aichi.jp":true,"tokai.aichi.jp":true,"tokoname.aichi.jp":true,"toyoake.aichi.jp":true,"toyohashi.aichi.jp":true,"toyokawa.aichi.jp":true,"toyone.aichi.jp":true,"toyota.aichi.jp":true,"tsushima.aichi.jp":true,"yatomi.aichi.jp":true,"akita.akita.jp":true,"daisen.akita.jp":true,"fujisato.akita.jp":true,"gojome.akita.jp":true,"hachirogata.akita.jp":true,"happou.akita.jp":true,"higashinaruse.akita.jp":true,"honjo.akita.jp":true,"honjyo.akita.jp":true,"ikawa.akita.jp":true,"kamikoani.akita.jp":true,"kamioka.akita.jp":true,"katagami.akita.jp":true,"kazuno.akita.jp":true,"kitaakita.akita.jp":true,"kosaka.akita.jp":true,"kyowa.akita.jp":true,"misato.akita.jp":true,"mitane.akita.jp":true,"moriyoshi.akita.jp":true,"nikaho.akita.jp":true,"noshiro.akita.jp":true,"odate.akita.jp":true,"oga.akita.jp":true,"ogata.akita.jp":true,"semboku.akita.jp":true,"yokote.akita.jp":true,"yurihonjo.akita.jp":true,"aomori.aomori.jp":true,"gonohe.aomori.jp":true,"hachinohe.aomori.jp":true,"hashikami.aomori.jp":true,"hiranai.aomori.jp":true,"hirosaki.aomori.jp":true,"itayanagi.aomori.jp":true,"kuroishi.aomori.jp":true,"misawa.aomori.jp":true,"mutsu.aomori.jp":true,"nakadomari.aomori.jp":true,"noheji.aomori.jp":true,"oirase.aomori.jp":true,"owani.aomori.jp":true,"rokunohe.aomori.jp":true,"sannohe.aomori.jp":true,"shichinohe.aomori.jp":true,"shingo.aomori.jp":true,"takko.aomori.jp":true,"towada.aomori.jp":true,"tsugaru.aomori.jp":true,"tsuruta.aomori.jp":true,"abiko.chiba.jp":true,"asahi.chiba.jp":true,"chonan.chiba.jp":true,"chosei.chiba.jp":true,"choshi.chiba.jp":true,"chuo.chiba.jp":true,"funabashi.chiba.jp":true,"futtsu.chiba.jp":true,"hanamigawa.chiba.jp":true,"ichihara.chiba.jp":true,"ichikawa.chiba.jp":true,"ichinomiya.chiba.jp":true,"inzai.chiba.jp":true,"isumi.chiba.jp":true,"kamagaya.chiba.jp":true,"kamogawa.chiba.jp":true,"kashiwa.chiba.jp":true,"katori.chiba.jp":true,"katsuura.chiba.jp":true,"kimitsu.chiba.jp":true,"kisarazu.chiba.jp":true,"kozaki.chiba.jp":true,"kujukuri.chiba.jp":true,"kyonan.chiba.jp":true,"matsudo.chiba.jp":true,"midori.chiba.jp":true,"mihama.chiba.jp":true,"minamiboso.chiba.jp":true,"mobara.chiba.jp":true,"mutsuzawa.chiba.jp":true,"nagara.chiba.jp":true,"nagareyama.chiba.jp":true,"narashino.chiba.jp":true,"narita.chiba.jp":true,"noda.chiba.jp":true,"oamishirasato.chiba.jp":true,"omigawa.chiba.jp":true,"onjuku.chiba.jp":true,"otaki.chiba.jp":true,"sakae.chiba.jp":true,"sakura.chiba.jp":true,"shimofusa.chiba.jp":true,"shirako.chiba.jp":true,"shiroi.chiba.jp":true,"shisui.chiba.jp":true,"sodegaura.chiba.jp":true,"sosa.chiba.jp":true,"tako.chiba.jp":true,"tateyama.chiba.jp":true,"togane.chiba.jp":true,"tohnosho.chiba.jp":true,"tomisato.chiba.jp":true,"urayasu.chiba.jp":true,"yachimata.chiba.jp":true,"yachiyo.chiba.jp":true,"yokaichiba.chiba.jp":true,"yokoshibahikari.chiba.jp":true,"yotsukaido.chiba.jp":true,"ainan.ehime.jp":true,"honai.ehime.jp":true,"ikata.ehime.jp":true,"imabari.ehime.jp":true,"iyo.ehime.jp":true,"kamijima.ehime.jp":true,"kihoku.ehime.jp":true,"kumakogen.ehime.jp":true,"masaki.ehime.jp":true,"matsuno.ehime.jp":true,"matsuyama.ehime.jp":true,"namikata.ehime.jp":true,"niihama.ehime.jp":true,"ozu.ehime.jp":true,"saijo.ehime.jp":true,"seiyo.ehime.jp":true,"shikokuchuo.ehime.jp":true,"tobe.ehime.jp":true,"toon.ehime.jp":true,"uchiko.ehime.jp":true,"uwajima.ehime.jp":true,"yawatahama.ehime.jp":true,"echizen.fukui.jp":true,"eiheiji.fukui.jp":true,"fukui.fukui.jp":true,"ikeda.fukui.jp":true,"katsuyama.fukui.jp":true,"mihama.fukui.jp":true,"minamiechizen.fukui.jp":true,"obama.fukui.jp":true,"ohi.fukui.jp":true,"ono.fukui.jp":true,"sabae.fukui.jp":true,"sakai.fukui.jp":true,"takahama.fukui.jp":true,"tsuruga.fukui.jp":true,"wakasa.fukui.jp":true,"ashiya.fukuoka.jp":true,"buzen.fukuoka.jp":true,"chikugo.fukuoka.jp":true,"chikuho.fukuoka.jp":true,"chikujo.fukuoka.jp":true,"chikushino.fukuoka.jp":true,"chikuzen.fukuoka.jp":true,"chuo.fukuoka.jp":true,"dazaifu.fukuoka.jp":true,"fukuchi.fukuoka.jp":true,"hakata.fukuoka.jp":true,"higashi.fukuoka.jp":true,"hirokawa.fukuoka.jp":true,"hisayama.fukuoka.jp":true,"iizuka.fukuoka.jp":true,"inatsuki.fukuoka.jp":true,"kaho.fukuoka.jp":true,"kasuga.fukuoka.jp":true,"kasuya.fukuoka.jp":true,"kawara.fukuoka.jp":true,"keisen.fukuoka.jp":true,"koga.fukuoka.jp":true,"kurate.fukuoka.jp":true,"kurogi.fukuoka.jp":true,"kurume.fukuoka.jp":true,"minami.fukuoka.jp":true,"miyako.fukuoka.jp":true,"miyama.fukuoka.jp":true,"miyawaka.fukuoka.jp":true,"mizumaki.fukuoka.jp":true,"munakata.fukuoka.jp":true,"nakagawa.fukuoka.jp":true,"nakama.fukuoka.jp":true,"nishi.fukuoka.jp":true,"nogata.fukuoka.jp":true,"ogori.fukuoka.jp":true,"okagaki.fukuoka.jp":true,"okawa.fukuoka.jp":true,"oki.fukuoka.jp":true,"omuta.fukuoka.jp":true,"onga.fukuoka.jp":true,"onojo.fukuoka.jp":true,"oto.fukuoka.jp":true,"saigawa.fukuoka.jp":true,"sasaguri.fukuoka.jp":true,"shingu.fukuoka.jp":true,"shinyoshitomi.fukuoka.jp":true,"shonai.fukuoka.jp":true,"soeda.fukuoka.jp":true,"sue.fukuoka.jp":true,"tachiarai.fukuoka.jp":true,"tagawa.fukuoka.jp":true,"takata.fukuoka.jp":true,"toho.fukuoka.jp":true,"toyotsu.fukuoka.jp":true,"tsuiki.fukuoka.jp":true,"ukiha.fukuoka.jp":true,"umi.fukuoka.jp":true,"usui.fukuoka.jp":true,"yamada.fukuoka.jp":true,"yame.fukuoka.jp":true,"yanagawa.fukuoka.jp":true,"yukuhashi.fukuoka.jp":true,"aizubange.fukushima.jp":true,"aizumisato.fukushima.jp":true,"aizuwakamatsu.fukushima.jp":true,"asakawa.fukushima.jp":true,"bandai.fukushima.jp":true,"date.fukushima.jp":true,"fukushima.fukushima.jp":true,"furudono.fukushima.jp":true,"futaba.fukushima.jp":true,"hanawa.fukushima.jp":true,"higashi.fukushima.jp":true,"hirata.fukushima.jp":true,"hirono.fukushima.jp":true,"iitate.fukushima.jp":true,"inawashiro.fukushima.jp":true,"ishikawa.fukushima.jp":true,"iwaki.fukushima.jp":true,"izumizaki.fukushima.jp":true,"kagamiishi.fukushima.jp":true,"kaneyama.fukushima.jp":true,"kawamata.fukushima.jp":true,"kitakata.fukushima.jp":true,"kitashiobara.fukushima.jp":true,"koori.fukushima.jp":true,"koriyama.fukushima.jp":true,"kunimi.fukushima.jp":true,"miharu.fukushima.jp":true,"mishima.fukushima.jp":true,"namie.fukushima.jp":true,"nango.fukushima.jp":true,"nishiaizu.fukushima.jp":true,"nishigo.fukushima.jp":true,"okuma.fukushima.jp":true,"omotego.fukushima.jp":true,"ono.fukushima.jp":true,"otama.fukushima.jp":true,"samegawa.fukushima.jp":true,"shimogo.fukushima.jp":true,"shirakawa.fukushima.jp":true,"showa.fukushima.jp":true,"soma.fukushima.jp":true,"sukagawa.fukushima.jp":true,"taishin.fukushima.jp":true,"tamakawa.fukushima.jp":true,"tanagura.fukushima.jp":true,"tenei.fukushima.jp":true,"yabuki.fukushima.jp":true,"yamato.fukushima.jp":true,"yamatsuri.fukushima.jp":true,"yanaizu.fukushima.jp":true,"yugawa.fukushima.jp":true,"anpachi.gifu.jp":true,"ena.gifu.jp":true,"gifu.gifu.jp":true,"ginan.gifu.jp":true,"godo.gifu.jp":true,"gujo.gifu.jp":true,"hashima.gifu.jp":true,"hichiso.gifu.jp":true,"hida.gifu.jp":true,"higashishirakawa.gifu.jp":true,"ibigawa.gifu.jp":true,"ikeda.gifu.jp":true,"kakamigahara.gifu.jp":true,"kani.gifu.jp":true,"kasahara.gifu.jp":true,"kasamatsu.gifu.jp":true,"kawaue.gifu.jp":true,"kitagata.gifu.jp":true,"mino.gifu.jp":true,"minokamo.gifu.jp":true,"mitake.gifu.jp":true,"mizunami.gifu.jp":true,"motosu.gifu.jp":true,"nakatsugawa.gifu.jp":true,"ogaki.gifu.jp":true,"sakahogi.gifu.jp":true,"seki.gifu.jp":true,"sekigahara.gifu.jp":true,"shirakawa.gifu.jp":true,"tajimi.gifu.jp":true,"takayama.gifu.jp":true,"tarui.gifu.jp":true,"toki.gifu.jp":true,"tomika.gifu.jp":true,"wanouchi.gifu.jp":true,"yamagata.gifu.jp":true,"yaotsu.gifu.jp":true,"yoro.gifu.jp":true,"annaka.gunma.jp":true,"chiyoda.gunma.jp":true,"fujioka.gunma.jp":true,"higashiagatsuma.gunma.jp":true,"isesaki.gunma.jp":true,"itakura.gunma.jp":true,"kanna.gunma.jp":true,"kanra.gunma.jp":true,"katashina.gunma.jp":true,"kawaba.gunma.jp":true,"kiryu.gunma.jp":true,"kusatsu.gunma.jp":true,"maebashi.gunma.jp":true,"meiwa.gunma.jp":true,"midori.gunma.jp":true,"minakami.gunma.jp":true,"naganohara.gunma.jp":true,"nakanojo.gunma.jp":true,"nanmoku.gunma.jp":true,"numata.gunma.jp":true,"oizumi.gunma.jp":true,"ora.gunma.jp":true,"ota.gunma.jp":true,"shibukawa.gunma.jp":true,"shimonita.gunma.jp":true,"shinto.gunma.jp":true,"showa.gunma.jp":true,"takasaki.gunma.jp":true,"takayama.gunma.jp":true,"tamamura.gunma.jp":true,"tatebayashi.gunma.jp":true,"tomioka.gunma.jp":true,"tsukiyono.gunma.jp":true,"tsumagoi.gunma.jp":true,"ueno.gunma.jp":true,"yoshioka.gunma.jp":true,"asaminami.hiroshima.jp":true,"daiwa.hiroshima.jp":true,"etajima.hiroshima.jp":true,"fuchu.hiroshima.jp":true,"fukuyama.hiroshima.jp":true,"hatsukaichi.hiroshima.jp":true,"higashihiroshima.hiroshima.jp":true,"hongo.hiroshima.jp":true,"jinsekikogen.hiroshima.jp":true,"kaita.hiroshima.jp":true,"kui.hiroshima.jp":true,"kumano.hiroshima.jp":true,"kure.hiroshima.jp":true,"mihara.hiroshima.jp":true,"miyoshi.hiroshima.jp":true,"naka.hiroshima.jp":true,"onomichi.hiroshima.jp":true,"osakikamijima.hiroshima.jp":true,"otake.hiroshima.jp":true,"saka.hiroshima.jp":true,"sera.hiroshima.jp":true,"seranishi.hiroshima.jp":true,"shinichi.hiroshima.jp":true,"shobara.hiroshima.jp":true,"takehara.hiroshima.jp":true,"abashiri.hokkaido.jp":true,"abira.hokkaido.jp":true,"aibetsu.hokkaido.jp":true,"akabira.hokkaido.jp":true,"akkeshi.hokkaido.jp":true,"asahikawa.hokkaido.jp":true,"ashibetsu.hokkaido.jp":true,"ashoro.hokkaido.jp":true,"assabu.hokkaido.jp":true,"atsuma.hokkaido.jp":true,"bibai.hokkaido.jp":true,"biei.hokkaido.jp":true,"bifuka.hokkaido.jp":true,"bihoro.hokkaido.jp":true,"biratori.hokkaido.jp":true,"chippubetsu.hokkaido.jp":true,"chitose.hokkaido.jp":true,"date.hokkaido.jp":true,"ebetsu.hokkaido.jp":true,"embetsu.hokkaido.jp":true,"eniwa.hokkaido.jp":true,"erimo.hokkaido.jp":true,"esan.hokkaido.jp":true,"esashi.hokkaido.jp":true,"fukagawa.hokkaido.jp":true,"fukushima.hokkaido.jp":true,"furano.hokkaido.jp":true,"furubira.hokkaido.jp":true,"haboro.hokkaido.jp":true,"hakodate.hokkaido.jp":true,"hamatonbetsu.hokkaido.jp":true,"hidaka.hokkaido.jp":true,"higashikagura.hokkaido.jp":true,"higashikawa.hokkaido.jp":true,"hiroo.hokkaido.jp":true,"hokuryu.hokkaido.jp":true,"hokuto.hokkaido.jp":true,"honbetsu.hokkaido.jp":true,"horokanai.hokkaido.jp":true,"horonobe.hokkaido.jp":true,"ikeda.hokkaido.jp":true,"imakane.hokkaido.jp":true,"ishikari.hokkaido.jp":true,"iwamizawa.hokkaido.jp":true,"iwanai.hokkaido.jp":true,"kamifurano.hokkaido.jp":true,"kamikawa.hokkaido.jp":true,"kamishihoro.hokkaido.jp":true,"kamisunagawa.hokkaido.jp":true,"kamoenai.hokkaido.jp":true,"kayabe.hokkaido.jp":true,"kembuchi.hokkaido.jp":true,"kikonai.hokkaido.jp":true,"kimobetsu.hokkaido.jp":true,"kitahiroshima.hokkaido.jp":true,"kitami.hokkaido.jp":true,"kiyosato.hokkaido.jp":true,"koshimizu.hokkaido.jp":true,"kunneppu.hokkaido.jp":true,"kuriyama.hokkaido.jp":true,"kuromatsunai.hokkaido.jp":true,"kushiro.hokkaido.jp":true,"kutchan.hokkaido.jp":true,"kyowa.hokkaido.jp":true,"mashike.hokkaido.jp":true,"matsumae.hokkaido.jp":true,"mikasa.hokkaido.jp":true,"minamifurano.hokkaido.jp":true,"mombetsu.hokkaido.jp":true,"moseushi.hokkaido.jp":true,"mukawa.hokkaido.jp":true,"muroran.hokkaido.jp":true,"naie.hokkaido.jp":true,"nakagawa.hokkaido.jp":true,"nakasatsunai.hokkaido.jp":true,"nakatombetsu.hokkaido.jp":true,"nanae.hokkaido.jp":true,"nanporo.hokkaido.jp":true,"nayoro.hokkaido.jp":true,"nemuro.hokkaido.jp":true,"niikappu.hokkaido.jp":true,"niki.hokkaido.jp":true,"nishiokoppe.hokkaido.jp":true,"noboribetsu.hokkaido.jp":true,"numata.hokkaido.jp":true,"obihiro.hokkaido.jp":true,"obira.hokkaido.jp":true,"oketo.hokkaido.jp":true,"okoppe.hokkaido.jp":true,"otaru.hokkaido.jp":true,"otobe.hokkaido.jp":true,"otofuke.hokkaido.jp":true,"otoineppu.hokkaido.jp":true,"oumu.hokkaido.jp":true,"ozora.hokkaido.jp":true,"pippu.hokkaido.jp":true,"rankoshi.hokkaido.jp":true,"rebun.hokkaido.jp":true,"rikubetsu.hokkaido.jp":true,"rishiri.hokkaido.jp":true,"rishirifuji.hokkaido.jp":true,"saroma.hokkaido.jp":true,"sarufutsu.hokkaido.jp":true,"shakotan.hokkaido.jp":true,"shari.hokkaido.jp":true,"shibecha.hokkaido.jp":true,"shibetsu.hokkaido.jp":true,"shikabe.hokkaido.jp":true,"shikaoi.hokkaido.jp":true,"shimamaki.hokkaido.jp":true,"shimizu.hokkaido.jp":true,"shimokawa.hokkaido.jp":true,"shinshinotsu.hokkaido.jp":true,"shintoku.hokkaido.jp":true,"shiranuka.hokkaido.jp":true,"shiraoi.hokkaido.jp":true,"shiriuchi.hokkaido.jp":true,"sobetsu.hokkaido.jp":true,"sunagawa.hokkaido.jp":true,"taiki.hokkaido.jp":true,"takasu.hokkaido.jp":true,"takikawa.hokkaido.jp":true,"takinoue.hokkaido.jp":true,"teshikaga.hokkaido.jp":true,"tobetsu.hokkaido.jp":true,"tohma.hokkaido.jp":true,"tomakomai.hokkaido.jp":true,"tomari.hokkaido.jp":true,"toya.hokkaido.jp":true,"toyako.hokkaido.jp":true,"toyotomi.hokkaido.jp":true,"toyoura.hokkaido.jp":true,"tsubetsu.hokkaido.jp":true,"tsukigata.hokkaido.jp":true,"urakawa.hokkaido.jp":true,"urausu.hokkaido.jp":true,"uryu.hokkaido.jp":true,"utashinai.hokkaido.jp":true,"wakkanai.hokkaido.jp":true,"wassamu.hokkaido.jp":true,"yakumo.hokkaido.jp":true,"yoichi.hokkaido.jp":true,"aioi.hyogo.jp":true,"akashi.hyogo.jp":true,"ako.hyogo.jp":true,"amagasaki.hyogo.jp":true,"aogaki.hyogo.jp":true,"asago.hyogo.jp":true,"ashiya.hyogo.jp":true,"awaji.hyogo.jp":true,"fukusaki.hyogo.jp":true,"goshiki.hyogo.jp":true,"harima.hyogo.jp":true,"himeji.hyogo.jp":true,"ichikawa.hyogo.jp":true,"inagawa.hyogo.jp":true,"itami.hyogo.jp":true,"kakogawa.hyogo.jp":true,"kamigori.hyogo.jp":true,"kamikawa.hyogo.jp":true,"kasai.hyogo.jp":true,"kasuga.hyogo.jp":true,"kawanishi.hyogo.jp":true,"miki.hyogo.jp":true,"minamiawaji.hyogo.jp":true,"nishinomiya.hyogo.jp":true,"nishiwaki.hyogo.jp":true,"ono.hyogo.jp":true,"sanda.hyogo.jp":true,"sannan.hyogo.jp":true,"sasayama.hyogo.jp":true,"sayo.hyogo.jp":true,"shingu.hyogo.jp":true,"shinonsen.hyogo.jp":true,"shiso.hyogo.jp":true,"sumoto.hyogo.jp":true,"taishi.hyogo.jp":true,"taka.hyogo.jp":true,"takarazuka.hyogo.jp":true,"takasago.hyogo.jp":true,"takino.hyogo.jp":true,"tamba.hyogo.jp":true,"tatsuno.hyogo.jp":true,"toyooka.hyogo.jp":true,"yabu.hyogo.jp":true,"yashiro.hyogo.jp":true,"yoka.hyogo.jp":true,"yokawa.hyogo.jp":true,"ami.ibaraki.jp":true,"asahi.ibaraki.jp":true,"bando.ibaraki.jp":true,"chikusei.ibaraki.jp":true,"daigo.ibaraki.jp":true,"fujishiro.ibaraki.jp":true,"hitachi.ibaraki.jp":true,"hitachinaka.ibaraki.jp":true,"hitachiomiya.ibaraki.jp":true,"hitachiota.ibaraki.jp":true,"ibaraki.ibaraki.jp":true,"ina.ibaraki.jp":true,"inashiki.ibaraki.jp":true,"itako.ibaraki.jp":true,"iwama.ibaraki.jp":true,"joso.ibaraki.jp":true,"kamisu.ibaraki.jp":true,"kasama.ibaraki.jp":true,"kashima.ibaraki.jp":true,"kasumigaura.ibaraki.jp":true,"koga.ibaraki.jp":true,"miho.ibaraki.jp":true,"mito.ibaraki.jp":true,"moriya.ibaraki.jp":true,"naka.ibaraki.jp":true,"namegata.ibaraki.jp":true,"oarai.ibaraki.jp":true,"ogawa.ibaraki.jp":true,"omitama.ibaraki.jp":true,"ryugasaki.ibaraki.jp":true,"sakai.ibaraki.jp":true,"sakuragawa.ibaraki.jp":true,"shimodate.ibaraki.jp":true,"shimotsuma.ibaraki.jp":true,"shirosato.ibaraki.jp":true,"sowa.ibaraki.jp":true,"suifu.ibaraki.jp":true,"takahagi.ibaraki.jp":true,"tamatsukuri.ibaraki.jp":true,"tokai.ibaraki.jp":true,"tomobe.ibaraki.jp":true,"tone.ibaraki.jp":true,"toride.ibaraki.jp":true,"tsuchiura.ibaraki.jp":true,"tsukuba.ibaraki.jp":true,"uchihara.ibaraki.jp":true,"ushiku.ibaraki.jp":true,"yachiyo.ibaraki.jp":true,"yamagata.ibaraki.jp":true,"yawara.ibaraki.jp":true,"yuki.ibaraki.jp":true,"anamizu.ishikawa.jp":true,"hakui.ishikawa.jp":true,"hakusan.ishikawa.jp":true,"kaga.ishikawa.jp":true,"kahoku.ishikawa.jp":true,"kanazawa.ishikawa.jp":true,"kawakita.ishikawa.jp":true,"komatsu.ishikawa.jp":true,"nakanoto.ishikawa.jp":true,"nanao.ishikawa.jp":true,"nomi.ishikawa.jp":true,"nonoichi.ishikawa.jp":true,"noto.ishikawa.jp":true,"shika.ishikawa.jp":true,"suzu.ishikawa.jp":true,"tsubata.ishikawa.jp":true,"tsurugi.ishikawa.jp":true,"uchinada.ishikawa.jp":true,"wajima.ishikawa.jp":true,"fudai.iwate.jp":true,"fujisawa.iwate.jp":true,"hanamaki.iwate.jp":true,"hiraizumi.iwate.jp":true,"hirono.iwate.jp":true,"ichinohe.iwate.jp":true,"ichinoseki.iwate.jp":true,"iwaizumi.iwate.jp":true,"iwate.iwate.jp":true,"joboji.iwate.jp":true,"kamaishi.iwate.jp":true,"kanegasaki.iwate.jp":true,"karumai.iwate.jp":true,"kawai.iwate.jp":true,"kitakami.iwate.jp":true,"kuji.iwate.jp":true,"kunohe.iwate.jp":true,"kuzumaki.iwate.jp":true,"miyako.iwate.jp":true,"mizusawa.iwate.jp":true,"morioka.iwate.jp":true,"ninohe.iwate.jp":true,"noda.iwate.jp":true,"ofunato.iwate.jp":true,"oshu.iwate.jp":true,"otsuchi.iwate.jp":true,"rikuzentakata.iwate.jp":true,"shiwa.iwate.jp":true,"shizukuishi.iwate.jp":true,"sumita.iwate.jp":true,"tanohata.iwate.jp":true,"tono.iwate.jp":true,"yahaba.iwate.jp":true,"yamada.iwate.jp":true,"ayagawa.kagawa.jp":true,"higashikagawa.kagawa.jp":true,"kanonji.kagawa.jp":true,"kotohira.kagawa.jp":true,"manno.kagawa.jp":true,"marugame.kagawa.jp":true,"mitoyo.kagawa.jp":true,"naoshima.kagawa.jp":true,"sanuki.kagawa.jp":true,"tadotsu.kagawa.jp":true,"takamatsu.kagawa.jp":true,"tonosho.kagawa.jp":true,"uchinomi.kagawa.jp":true,"utazu.kagawa.jp":true,"zentsuji.kagawa.jp":true,"akune.kagoshima.jp":true,"amami.kagoshima.jp":true,"hioki.kagoshima.jp":true,"isa.kagoshima.jp":true,"isen.kagoshima.jp":true,"izumi.kagoshima.jp":true,"kagoshima.kagoshima.jp":true,"kanoya.kagoshima.jp":true,"kawanabe.kagoshima.jp":true,"kinko.kagoshima.jp":true,"kouyama.kagoshima.jp":true,"makurazaki.kagoshima.jp":true,"matsumoto.kagoshima.jp":true,"minamitane.kagoshima.jp":true,"nakatane.kagoshima.jp":true,"nishinoomote.kagoshima.jp":true,"satsumasendai.kagoshima.jp":true,"soo.kagoshima.jp":true,"tarumizu.kagoshima.jp":true,"yusui.kagoshima.jp":true,"aikawa.kanagawa.jp":true,"atsugi.kanagawa.jp":true,"ayase.kanagawa.jp":true,"chigasaki.kanagawa.jp":true,"ebina.kanagawa.jp":true,"fujisawa.kanagawa.jp":true,"hadano.kanagawa.jp":true,"hakone.kanagawa.jp":true,"hiratsuka.kanagawa.jp":true,"isehara.kanagawa.jp":true,"kaisei.kanagawa.jp":true,"kamakura.kanagawa.jp":true,"kiyokawa.kanagawa.jp":true,"matsuda.kanagawa.jp":true,"minamiashigara.kanagawa.jp":true,"miura.kanagawa.jp":true,"nakai.kanagawa.jp":true,"ninomiya.kanagawa.jp":true,"odawara.kanagawa.jp":true,"oi.kanagawa.jp":true,"oiso.kanagawa.jp":true,"sagamihara.kanagawa.jp":true,"samukawa.kanagawa.jp":true,"tsukui.kanagawa.jp":true,"yamakita.kanagawa.jp":true,"yamato.kanagawa.jp":true,"yokosuka.kanagawa.jp":true,"yugawara.kanagawa.jp":true,"zama.kanagawa.jp":true,"zushi.kanagawa.jp":true,"aki.kochi.jp":true,"geisei.kochi.jp":true,"hidaka.kochi.jp":true,"higashitsuno.kochi.jp":true,"ino.kochi.jp":true,"kagami.kochi.jp":true,"kami.kochi.jp":true,"kitagawa.kochi.jp":true,"kochi.kochi.jp":true,"mihara.kochi.jp":true,"motoyama.kochi.jp":true,"muroto.kochi.jp":true,"nahari.kochi.jp":true,"nakamura.kochi.jp":true,"nankoku.kochi.jp":true,"nishitosa.kochi.jp":true,"niyodogawa.kochi.jp":true,"ochi.kochi.jp":true,"okawa.kochi.jp":true,"otoyo.kochi.jp":true,"otsuki.kochi.jp":true,"sakawa.kochi.jp":true,"sukumo.kochi.jp":true,"susaki.kochi.jp":true,"tosa.kochi.jp":true,"tosashimizu.kochi.jp":true,"toyo.kochi.jp":true,"tsuno.kochi.jp":true,"umaji.kochi.jp":true,"yasuda.kochi.jp":true,"yusuhara.kochi.jp":true,"amakusa.kumamoto.jp":true,"arao.kumamoto.jp":true,"aso.kumamoto.jp":true,"choyo.kumamoto.jp":true,"gyokuto.kumamoto.jp":true,"hitoyoshi.kumamoto.jp":true,"kamiamakusa.kumamoto.jp":true,"kashima.kumamoto.jp":true,"kikuchi.kumamoto.jp":true,"kosa.kumamoto.jp":true,"kumamoto.kumamoto.jp":true,"mashiki.kumamoto.jp":true,"mifune.kumamoto.jp":true,"minamata.kumamoto.jp":true,"minamioguni.kumamoto.jp":true,"nagasu.kumamoto.jp":true,"nishihara.kumamoto.jp":true,"oguni.kumamoto.jp":true,"ozu.kumamoto.jp":true,"sumoto.kumamoto.jp":true,"takamori.kumamoto.jp":true,"uki.kumamoto.jp":true,"uto.kumamoto.jp":true,"yamaga.kumamoto.jp":true,"yamato.kumamoto.jp":true,"yatsushiro.kumamoto.jp":true,"ayabe.kyoto.jp":true,"fukuchiyama.kyoto.jp":true,"higashiyama.kyoto.jp":true,"ide.kyoto.jp":true,"ine.kyoto.jp":true,"joyo.kyoto.jp":true,"kameoka.kyoto.jp":true,"kamo.kyoto.jp":true,"kita.kyoto.jp":true,"kizu.kyoto.jp":true,"kumiyama.kyoto.jp":true,"kyotamba.kyoto.jp":true,"kyotanabe.kyoto.jp":true,"kyotango.kyoto.jp":true,"maizuru.kyoto.jp":true,"minami.kyoto.jp":true,"minamiyamashiro.kyoto.jp":true,"miyazu.kyoto.jp":true,"muko.kyoto.jp":true,"nagaokakyo.kyoto.jp":true,"nakagyo.kyoto.jp":true,"nantan.kyoto.jp":true,"oyamazaki.kyoto.jp":true,"sakyo.kyoto.jp":true,"seika.kyoto.jp":true,"tanabe.kyoto.jp":true,"uji.kyoto.jp":true,"ujitawara.kyoto.jp":true,"wazuka.kyoto.jp":true,"yamashina.kyoto.jp":true,"yawata.kyoto.jp":true,"asahi.mie.jp":true,"inabe.mie.jp":true,"ise.mie.jp":true,"kameyama.mie.jp":true,"kawagoe.mie.jp":true,"kiho.mie.jp":true,"kisosaki.mie.jp":true,"kiwa.mie.jp":true,"komono.mie.jp":true,"kumano.mie.jp":true,"kuwana.mie.jp":true,"matsusaka.mie.jp":true,"meiwa.mie.jp":true,"mihama.mie.jp":true,"minamiise.mie.jp":true,"misugi.mie.jp":true,"miyama.mie.jp":true,"nabari.mie.jp":true,"shima.mie.jp":true,"suzuka.mie.jp":true,"tado.mie.jp":true,"taiki.mie.jp":true,"taki.mie.jp":true,"tamaki.mie.jp":true,"toba.mie.jp":true,"tsu.mie.jp":true,"udono.mie.jp":true,"ureshino.mie.jp":true,"watarai.mie.jp":true,"yokkaichi.mie.jp":true,"furukawa.miyagi.jp":true,"higashimatsushima.miyagi.jp":true,"ishinomaki.miyagi.jp":true,"iwanuma.miyagi.jp":true,"kakuda.miyagi.jp":true,"kami.miyagi.jp":true,"kawasaki.miyagi.jp":true,"kesennuma.miyagi.jp":true,"marumori.miyagi.jp":true,"matsushima.miyagi.jp":true,"minamisanriku.miyagi.jp":true,"misato.miyagi.jp":true,"murata.miyagi.jp":true,"natori.miyagi.jp":true,"ogawara.miyagi.jp":true,"ohira.miyagi.jp":true,"onagawa.miyagi.jp":true,"osaki.miyagi.jp":true,"rifu.miyagi.jp":true,"semine.miyagi.jp":true,"shibata.miyagi.jp":true,"shichikashuku.miyagi.jp":true,"shikama.miyagi.jp":true,"shiogama.miyagi.jp":true,"shiroishi.miyagi.jp":true,"tagajo.miyagi.jp":true,"taiwa.miyagi.jp":true,"tome.miyagi.jp":true,"tomiya.miyagi.jp":true,"wakuya.miyagi.jp":true,"watari.miyagi.jp":true,"yamamoto.miyagi.jp":true,"zao.miyagi.jp":true,"aya.miyazaki.jp":true,"ebino.miyazaki.jp":true,"gokase.miyazaki.jp":true,"hyuga.miyazaki.jp":true,"kadogawa.miyazaki.jp":true,"kawaminami.miyazaki.jp":true,"kijo.miyazaki.jp":true,"kitagawa.miyazaki.jp":true,"kitakata.miyazaki.jp":true,"kitaura.miyazaki.jp":true,"kobayashi.miyazaki.jp":true,"kunitomi.miyazaki.jp":true,"kushima.miyazaki.jp":true,"mimata.miyazaki.jp":true,"miyakonojo.miyazaki.jp":true,"miyazaki.miyazaki.jp":true,"morotsuka.miyazaki.jp":true,"nichinan.miyazaki.jp":true,"nishimera.miyazaki.jp":true,"nobeoka.miyazaki.jp":true,"saito.miyazaki.jp":true,"shiiba.miyazaki.jp":true,"shintomi.miyazaki.jp":true,"takaharu.miyazaki.jp":true,"takanabe.miyazaki.jp":true,"takazaki.miyazaki.jp":true,"tsuno.miyazaki.jp":true,"achi.nagano.jp":true,"agematsu.nagano.jp":true,"anan.nagano.jp":true,"aoki.nagano.jp":true,"asahi.nagano.jp":true,"azumino.nagano.jp":true,"chikuhoku.nagano.jp":true,"chikuma.nagano.jp":true,"chino.nagano.jp":true,"fujimi.nagano.jp":true,"hakuba.nagano.jp":true,"hara.nagano.jp":true,"hiraya.nagano.jp":true,"iida.nagano.jp":true,"iijima.nagano.jp":true,"iiyama.nagano.jp":true,"iizuna.nagano.jp":true,"ikeda.nagano.jp":true,"ikusaka.nagano.jp":true,"ina.nagano.jp":true,"karuizawa.nagano.jp":true,"kawakami.nagano.jp":true,"kiso.nagano.jp":true,"kisofukushima.nagano.jp":true,"kitaaiki.nagano.jp":true,"komagane.nagano.jp":true,"komoro.nagano.jp":true,"matsukawa.nagano.jp":true,"matsumoto.nagano.jp":true,"miasa.nagano.jp":true,"minamiaiki.nagano.jp":true,"minamimaki.nagano.jp":true,"minamiminowa.nagano.jp":true,"minowa.nagano.jp":true,"miyada.nagano.jp":true,"miyota.nagano.jp":true,"mochizuki.nagano.jp":true,"nagano.nagano.jp":true,"nagawa.nagano.jp":true,"nagiso.nagano.jp":true,"nakagawa.nagano.jp":true,"nakano.nagano.jp":true,"nozawaonsen.nagano.jp":true,"obuse.nagano.jp":true,"ogawa.nagano.jp":true,"okaya.nagano.jp":true,"omachi.nagano.jp":true,"omi.nagano.jp":true,"ookuwa.nagano.jp":true,"ooshika.nagano.jp":true,"otaki.nagano.jp":true,"otari.nagano.jp":true,"sakae.nagano.jp":true,"sakaki.nagano.jp":true,"saku.nagano.jp":true,"sakuho.nagano.jp":true,"shimosuwa.nagano.jp":true,"shinanomachi.nagano.jp":true,"shiojiri.nagano.jp":true,"suwa.nagano.jp":true,"suzaka.nagano.jp":true,"takagi.nagano.jp":true,"takamori.nagano.jp":true,"takayama.nagano.jp":true,"tateshina.nagano.jp":true,"tatsuno.nagano.jp":true,"togakushi.nagano.jp":true,"togura.nagano.jp":true,"tomi.nagano.jp":true,"ueda.nagano.jp":true,"wada.nagano.jp":true,"yamagata.nagano.jp":true,"yamanouchi.nagano.jp":true,"yasaka.nagano.jp":true,"yasuoka.nagano.jp":true,"chijiwa.nagasaki.jp":true,"futsu.nagasaki.jp":true,"goto.nagasaki.jp":true,"hasami.nagasaki.jp":true,"hirado.nagasaki.jp":true,"iki.nagasaki.jp":true,"isahaya.nagasaki.jp":true,"kawatana.nagasaki.jp":true,"kuchinotsu.nagasaki.jp":true,"matsuura.nagasaki.jp":true,"nagasaki.nagasaki.jp":true,"obama.nagasaki.jp":true,"omura.nagasaki.jp":true,"oseto.nagasaki.jp":true,"saikai.nagasaki.jp":true,"sasebo.nagasaki.jp":true,"seihi.nagasaki.jp":true,"shimabara.nagasaki.jp":true,"shinkamigoto.nagasaki.jp":true,"togitsu.nagasaki.jp":true,"tsushima.nagasaki.jp":true,"unzen.nagasaki.jp":true,"ando.nara.jp":true,"gose.nara.jp":true,"heguri.nara.jp":true,"higashiyoshino.nara.jp":true,"ikaruga.nara.jp":true,"ikoma.nara.jp":true,"kamikitayama.nara.jp":true,"kanmaki.nara.jp":true,"kashiba.nara.jp":true,"kashihara.nara.jp":true,"katsuragi.nara.jp":true,"kawai.nara.jp":true,"kawakami.nara.jp":true,"kawanishi.nara.jp":true,"koryo.nara.jp":true,"kurotaki.nara.jp":true,"mitsue.nara.jp":true,"miyake.nara.jp":true,"nara.nara.jp":true,"nosegawa.nara.jp":true,"oji.nara.jp":true,"ouda.nara.jp":true,"oyodo.nara.jp":true,"sakurai.nara.jp":true,"sango.nara.jp":true,"shimoichi.nara.jp":true,"shimokitayama.nara.jp":true,"shinjo.nara.jp":true,"soni.nara.jp":true,"takatori.nara.jp":true,"tawaramoto.nara.jp":true,"tenkawa.nara.jp":true,"tenri.nara.jp":true,"uda.nara.jp":true,"yamatokoriyama.nara.jp":true,"yamatotakada.nara.jp":true,"yamazoe.nara.jp":true,"yoshino.nara.jp":true,"aga.niigata.jp":true,"agano.niigata.jp":true,"gosen.niigata.jp":true,"itoigawa.niigata.jp":true,"izumozaki.niigata.jp":true,"joetsu.niigata.jp":true,"kamo.niigata.jp":true,"kariwa.niigata.jp":true,"kashiwazaki.niigata.jp":true,"minamiuonuma.niigata.jp":true,"mitsuke.niigata.jp":true,"muika.niigata.jp":true,"murakami.niigata.jp":true,"myoko.niigata.jp":true,"nagaoka.niigata.jp":true,"niigata.niigata.jp":true,"ojiya.niigata.jp":true,"omi.niigata.jp":true,"sado.niigata.jp":true,"sanjo.niigata.jp":true,"seiro.niigata.jp":true,"seirou.niigata.jp":true,"sekikawa.niigata.jp":true,"shibata.niigata.jp":true,"tagami.niigata.jp":true,"tainai.niigata.jp":true,"tochio.niigata.jp":true,"tokamachi.niigata.jp":true,"tsubame.niigata.jp":true,"tsunan.niigata.jp":true,"uonuma.niigata.jp":true,"yahiko.niigata.jp":true,"yoita.niigata.jp":true,"yuzawa.niigata.jp":true,"beppu.oita.jp":true,"bungoono.oita.jp":true,"bungotakada.oita.jp":true,"hasama.oita.jp":true,"hiji.oita.jp":true,"himeshima.oita.jp":true,"hita.oita.jp":true,"kamitsue.oita.jp":true,"kokonoe.oita.jp":true,"kuju.oita.jp":true,"kunisaki.oita.jp":true,"kusu.oita.jp":true,"oita.oita.jp":true,"saiki.oita.jp":true,"taketa.oita.jp":true,"tsukumi.oita.jp":true,"usa.oita.jp":true,"usuki.oita.jp":true,"yufu.oita.jp":true,"akaiwa.okayama.jp":true,"asakuchi.okayama.jp":true,"bizen.okayama.jp":true,"hayashima.okayama.jp":true,"ibara.okayama.jp":true,"kagamino.okayama.jp":true,"kasaoka.okayama.jp":true,"kibichuo.okayama.jp":true,"kumenan.okayama.jp":true,"kurashiki.okayama.jp":true,"maniwa.okayama.jp":true,"misaki.okayama.jp":true,"nagi.okayama.jp":true,"niimi.okayama.jp":true,"nishiawakura.okayama.jp":true,"okayama.okayama.jp":true,"satosho.okayama.jp":true,"setouchi.okayama.jp":true,"shinjo.okayama.jp":true,"shoo.okayama.jp":true,"soja.okayama.jp":true,"takahashi.okayama.jp":true,"tamano.okayama.jp":true,"tsuyama.okayama.jp":true,"wake.okayama.jp":true,"yakage.okayama.jp":true,"aguni.okinawa.jp":true,"ginowan.okinawa.jp":true,"ginoza.okinawa.jp":true,"gushikami.okinawa.jp":true,"haebaru.okinawa.jp":true,"higashi.okinawa.jp":true,"hirara.okinawa.jp":true,"iheya.okinawa.jp":true,"ishigaki.okinawa.jp":true,"ishikawa.okinawa.jp":true,"itoman.okinawa.jp":true,"izena.okinawa.jp":true,"kadena.okinawa.jp":true,"kin.okinawa.jp":true,"kitadaito.okinawa.jp":true,"kitanakagusuku.okinawa.jp":true,"kumejima.okinawa.jp":true,"kunigami.okinawa.jp":true,"minamidaito.okinawa.jp":true,"motobu.okinawa.jp":true,"nago.okinawa.jp":true,"naha.okinawa.jp":true,"nakagusuku.okinawa.jp":true,"nakijin.okinawa.jp":true,"nanjo.okinawa.jp":true,"nishihara.okinawa.jp":true,"ogimi.okinawa.jp":true,"okinawa.okinawa.jp":true,"onna.okinawa.jp":true,"shimoji.okinawa.jp":true,"taketomi.okinawa.jp":true,"tarama.okinawa.jp":true,"tokashiki.okinawa.jp":true,"tomigusuku.okinawa.jp":true,"tonaki.okinawa.jp":true,"urasoe.okinawa.jp":true,"uruma.okinawa.jp":true,"yaese.okinawa.jp":true,"yomitan.okinawa.jp":true,"yonabaru.okinawa.jp":true,"yonaguni.okinawa.jp":true,"zamami.okinawa.jp":true,"abeno.osaka.jp":true,"chihayaakasaka.osaka.jp":true,"chuo.osaka.jp":true,"daito.osaka.jp":true,"fujiidera.osaka.jp":true,"habikino.osaka.jp":true,"hannan.osaka.jp":true,"higashiosaka.osaka.jp":true,"higashisumiyoshi.osaka.jp":true,"higashiyodogawa.osaka.jp":true,"hirakata.osaka.jp":true,"ibaraki.osaka.jp":true,"ikeda.osaka.jp":true,"izumi.osaka.jp":true,"izumiotsu.osaka.jp":true,"izumisano.osaka.jp":true,"kadoma.osaka.jp":true,"kaizuka.osaka.jp":true,"kanan.osaka.jp":true,"kashiwara.osaka.jp":true,"katano.osaka.jp":true,"kawachinagano.osaka.jp":true,"kishiwada.osaka.jp":true,"kita.osaka.jp":true,"kumatori.osaka.jp":true,"matsubara.osaka.jp":true,"minato.osaka.jp":true,"minoh.osaka.jp":true,"misaki.osaka.jp":true,"moriguchi.osaka.jp":true,"neyagawa.osaka.jp":true,"nishi.osaka.jp":true,"nose.osaka.jp":true,"osakasayama.osaka.jp":true,"sakai.osaka.jp":true,"sayama.osaka.jp":true,"sennan.osaka.jp":true,"settsu.osaka.jp":true,"shijonawate.osaka.jp":true,"shimamoto.osaka.jp":true,"suita.osaka.jp":true,"tadaoka.osaka.jp":true,"taishi.osaka.jp":true,"tajiri.osaka.jp":true,"takaishi.osaka.jp":true,"takatsuki.osaka.jp":true,"tondabayashi.osaka.jp":true,"toyonaka.osaka.jp":true,"toyono.osaka.jp":true,"yao.osaka.jp":true,"ariake.saga.jp":true,"arita.saga.jp":true,"fukudomi.saga.jp":true,"genkai.saga.jp":true,"hamatama.saga.jp":true,"hizen.saga.jp":true,"imari.saga.jp":true,"kamimine.saga.jp":true,"kanzaki.saga.jp":true,"karatsu.saga.jp":true,"kashima.saga.jp":true,"kitagata.saga.jp":true,"kitahata.saga.jp":true,"kiyama.saga.jp":true,"kouhoku.saga.jp":true,"kyuragi.saga.jp":true,"nishiarita.saga.jp":true,"ogi.saga.jp":true,"omachi.saga.jp":true,"ouchi.saga.jp":true,"saga.saga.jp":true,"shiroishi.saga.jp":true,"taku.saga.jp":true,"tara.saga.jp":true,"tosu.saga.jp":true,"yoshinogari.saga.jp":true,"arakawa.saitama.jp":true,"asaka.saitama.jp":true,"chichibu.saitama.jp":true,"fujimi.saitama.jp":true,"fujimino.saitama.jp":true,"fukaya.saitama.jp":true,"hanno.saitama.jp":true,"hanyu.saitama.jp":true,"hasuda.saitama.jp":true,"hatogaya.saitama.jp":true,"hatoyama.saitama.jp":true,"hidaka.saitama.jp":true,"higashichichibu.saitama.jp":true,"higashimatsuyama.saitama.jp":true,"honjo.saitama.jp":true,"ina.saitama.jp":true,"iruma.saitama.jp":true,"iwatsuki.saitama.jp":true,"kamiizumi.saitama.jp":true,"kamikawa.saitama.jp":true,"kamisato.saitama.jp":true,"kasukabe.saitama.jp":true,"kawagoe.saitama.jp":true,"kawaguchi.saitama.jp":true,"kawajima.saitama.jp":true,"kazo.saitama.jp":true,"kitamoto.saitama.jp":true,"koshigaya.saitama.jp":true,"kounosu.saitama.jp":true,"kuki.saitama.jp":true,"kumagaya.saitama.jp":true,"matsubushi.saitama.jp":true,"minano.saitama.jp":true,"misato.saitama.jp":true,"miyashiro.saitama.jp":true,"miyoshi.saitama.jp":true,"moroyama.saitama.jp":true,"nagatoro.saitama.jp":true,"namegawa.saitama.jp":true,"niiza.saitama.jp":true,"ogano.saitama.jp":true,"ogawa.saitama.jp":true,"ogose.saitama.jp":true,"okegawa.saitama.jp":true,"omiya.saitama.jp":true,"otaki.saitama.jp":true,"ranzan.saitama.jp":true,"ryokami.saitama.jp":true,"saitama.saitama.jp":true,"sakado.saitama.jp":true,"satte.saitama.jp":true,"sayama.saitama.jp":true,"shiki.saitama.jp":true,"shiraoka.saitama.jp":true,"soka.saitama.jp":true,"sugito.saitama.jp":true,"toda.saitama.jp":true,"tokigawa.saitama.jp":true,"tokorozawa.saitama.jp":true,"tsurugashima.saitama.jp":true,"urawa.saitama.jp":true,"warabi.saitama.jp":true,"yashio.saitama.jp":true,"yokoze.saitama.jp":true,"yono.saitama.jp":true,"yorii.saitama.jp":true,"yoshida.saitama.jp":true,"yoshikawa.saitama.jp":true,"yoshimi.saitama.jp":true,"aisho.shiga.jp":true,"gamo.shiga.jp":true,"higashiomi.shiga.jp":true,"hikone.shiga.jp":true,"koka.shiga.jp":true,"konan.shiga.jp":true,"kosei.shiga.jp":true,"koto.shiga.jp":true,"kusatsu.shiga.jp":true,"maibara.shiga.jp":true,"moriyama.shiga.jp":true,"nagahama.shiga.jp":true,"nishiazai.shiga.jp":true,"notogawa.shiga.jp":true,"omihachiman.shiga.jp":true,"otsu.shiga.jp":true,"ritto.shiga.jp":true,"ryuoh.shiga.jp":true,"takashima.shiga.jp":true,"takatsuki.shiga.jp":true,"torahime.shiga.jp":true,"toyosato.shiga.jp":true,"yasu.shiga.jp":true,"akagi.shimane.jp":true,"ama.shimane.jp":true,"gotsu.shimane.jp":true,"hamada.shimane.jp":true,"higashiizumo.shimane.jp":true,"hikawa.shimane.jp":true,"hikimi.shimane.jp":true,"izumo.shimane.jp":true,"kakinoki.shimane.jp":true,"masuda.shimane.jp":true,"matsue.shimane.jp":true,"misato.shimane.jp":true,"nishinoshima.shimane.jp":true,"ohda.shimane.jp":true,"okinoshima.shimane.jp":true,"okuizumo.shimane.jp":true,"shimane.shimane.jp":true,"tamayu.shimane.jp":true,"tsuwano.shimane.jp":true,"unnan.shimane.jp":true,"yakumo.shimane.jp":true,"yasugi.shimane.jp":true,"yatsuka.shimane.jp":true,"arai.shizuoka.jp":true,"atami.shizuoka.jp":true,"fuji.shizuoka.jp":true,"fujieda.shizuoka.jp":true,"fujikawa.shizuoka.jp":true,"fujinomiya.shizuoka.jp":true,"fukuroi.shizuoka.jp":true,"gotemba.shizuoka.jp":true,"haibara.shizuoka.jp":true,"hamamatsu.shizuoka.jp":true,"higashiizu.shizuoka.jp":true,"ito.shizuoka.jp":true,"iwata.shizuoka.jp":true,"izu.shizuoka.jp":true,"izunokuni.shizuoka.jp":true,"kakegawa.shizuoka.jp":true,"kannami.shizuoka.jp":true,"kawanehon.shizuoka.jp":true,"kawazu.shizuoka.jp":true,"kikugawa.shizuoka.jp":true,"kosai.shizuoka.jp":true,"makinohara.shizuoka.jp":true,"matsuzaki.shizuoka.jp":true,"minamiizu.shizuoka.jp":true,"mishima.shizuoka.jp":true,"morimachi.shizuoka.jp":true,"nishiizu.shizuoka.jp":true,"numazu.shizuoka.jp":true,"omaezaki.shizuoka.jp":true,"shimada.shizuoka.jp":true,"shimizu.shizuoka.jp":true,"shimoda.shizuoka.jp":true,"shizuoka.shizuoka.jp":true,"susono.shizuoka.jp":true,"yaizu.shizuoka.jp":true,"yoshida.shizuoka.jp":true,"ashikaga.tochigi.jp":true,"bato.tochigi.jp":true,"haga.tochigi.jp":true,"ichikai.tochigi.jp":true,"iwafune.tochigi.jp":true,"kaminokawa.tochigi.jp":true,"kanuma.tochigi.jp":true,"karasuyama.tochigi.jp":true,"kuroiso.tochigi.jp":true,"mashiko.tochigi.jp":true,"mibu.tochigi.jp":true,"moka.tochigi.jp":true,"motegi.tochigi.jp":true,"nasu.tochigi.jp":true,"nasushiobara.tochigi.jp":true,"nikko.tochigi.jp":true,"nishikata.tochigi.jp":true,"nogi.tochigi.jp":true,"ohira.tochigi.jp":true,"ohtawara.tochigi.jp":true,"oyama.tochigi.jp":true,"sakura.tochigi.jp":true,"sano.tochigi.jp":true,"shimotsuke.tochigi.jp":true,"shioya.tochigi.jp":true,"takanezawa.tochigi.jp":true,"tochigi.tochigi.jp":true,"tsuga.tochigi.jp":true,"ujiie.tochigi.jp":true,"utsunomiya.tochigi.jp":true,"yaita.tochigi.jp":true,"aizumi.tokushima.jp":true,"anan.tokushima.jp":true,"ichiba.tokushima.jp":true,"itano.tokushima.jp":true,"kainan.tokushima.jp":true,"komatsushima.tokushima.jp":true,"matsushige.tokushima.jp":true,"mima.tokushima.jp":true,"minami.tokushima.jp":true,"miyoshi.tokushima.jp":true,"mugi.tokushima.jp":true,"nakagawa.tokushima.jp":true,"naruto.tokushima.jp":true,"sanagochi.tokushima.jp":true,"shishikui.tokushima.jp":true,"tokushima.tokushima.jp":true,"wajiki.tokushima.jp":true,"adachi.tokyo.jp":true,"akiruno.tokyo.jp":true,"akishima.tokyo.jp":true,"aogashima.tokyo.jp":true,"arakawa.tokyo.jp":true,"bunkyo.tokyo.jp":true,"chiyoda.tokyo.jp":true,"chofu.tokyo.jp":true,"chuo.tokyo.jp":true,"edogawa.tokyo.jp":true,"fuchu.tokyo.jp":true,"fussa.tokyo.jp":true,"hachijo.tokyo.jp":true,"hachioji.tokyo.jp":true,"hamura.tokyo.jp":true,"higashikurume.tokyo.jp":true,"higashimurayama.tokyo.jp":true,"higashiyamato.tokyo.jp":true,"hino.tokyo.jp":true,"hinode.tokyo.jp":true,"hinohara.tokyo.jp":true,"inagi.tokyo.jp":true,"itabashi.tokyo.jp":true,"katsushika.tokyo.jp":true,"kita.tokyo.jp":true,"kiyose.tokyo.jp":true,"kodaira.tokyo.jp":true,"koganei.tokyo.jp":true,"kokubunji.tokyo.jp":true,"komae.tokyo.jp":true,"koto.tokyo.jp":true,"kouzushima.tokyo.jp":true,"kunitachi.tokyo.jp":true,"machida.tokyo.jp":true,"meguro.tokyo.jp":true,"minato.tokyo.jp":true,"mitaka.tokyo.jp":true,"mizuho.tokyo.jp":true,"musashimurayama.tokyo.jp":true,"musashino.tokyo.jp":true,"nakano.tokyo.jp":true,"nerima.tokyo.jp":true,"ogasawara.tokyo.jp":true,"okutama.tokyo.jp":true,"ome.tokyo.jp":true,"oshima.tokyo.jp":true,"ota.tokyo.jp":true,"setagaya.tokyo.jp":true,"shibuya.tokyo.jp":true,"shinagawa.tokyo.jp":true,"shinjuku.tokyo.jp":true,"suginami.tokyo.jp":true,"sumida.tokyo.jp":true,"tachikawa.tokyo.jp":true,"taito.tokyo.jp":true,"tama.tokyo.jp":true,"toshima.tokyo.jp":true,"chizu.tottori.jp":true,"hino.tottori.jp":true,"kawahara.tottori.jp":true,"koge.tottori.jp":true,"kotoura.tottori.jp":true,"misasa.tottori.jp":true,"nanbu.tottori.jp":true,"nichinan.tottori.jp":true,"sakaiminato.tottori.jp":true,"tottori.tottori.jp":true,"wakasa.tottori.jp":true,"yazu.tottori.jp":true,"yonago.tottori.jp":true,"asahi.toyama.jp":true,"fuchu.toyama.jp":true,"fukumitsu.toyama.jp":true,"funahashi.toyama.jp":true,"himi.toyama.jp":true,"imizu.toyama.jp":true,"inami.toyama.jp":true,"johana.toyama.jp":true,"kamiichi.toyama.jp":true,"kurobe.toyama.jp":true,"nakaniikawa.toyama.jp":true,"namerikawa.toyama.jp":true,"nanto.toyama.jp":true,"nyuzen.toyama.jp":true,"oyabe.toyama.jp":true,"taira.toyama.jp":true,"takaoka.toyama.jp":true,"tateyama.toyama.jp":true,"toga.toyama.jp":true,"tonami.toyama.jp":true,"toyama.toyama.jp":true,"unazuki.toyama.jp":true,"uozu.toyama.jp":true,"yamada.toyama.jp":true,"arida.wakayama.jp":true,"aridagawa.wakayama.jp":true,"gobo.wakayama.jp":true,"hashimoto.wakayama.jp":true,"hidaka.wakayama.jp":true,"hirogawa.wakayama.jp":true,"inami.wakayama.jp":true,"iwade.wakayama.jp":true,"kainan.wakayama.jp":true,"kamitonda.wakayama.jp":true,"katsuragi.wakayama.jp":true,"kimino.wakayama.jp":true,"kinokawa.wakayama.jp":true,"kitayama.wakayama.jp":true,"koya.wakayama.jp":true,"koza.wakayama.jp":true,"kozagawa.wakayama.jp":true,"kudoyama.wakayama.jp":true,"kushimoto.wakayama.jp":true,"mihama.wakayama.jp":true,"misato.wakayama.jp":true,"nachikatsuura.wakayama.jp":true,"shingu.wakayama.jp":true,"shirahama.wakayama.jp":true,"taiji.wakayama.jp":true,"tanabe.wakayama.jp":true,"wakayama.wakayama.jp":true,"yuasa.wakayama.jp":true,"yura.wakayama.jp":true,"asahi.yamagata.jp":true,"funagata.yamagata.jp":true,"higashine.yamagata.jp":true,"iide.yamagata.jp":true,"kahoku.yamagata.jp":true,"kaminoyama.yamagata.jp":true,"kaneyama.yamagata.jp":true,"kawanishi.yamagata.jp":true,"mamurogawa.yamagata.jp":true,"mikawa.yamagata.jp":true,"murayama.yamagata.jp":true,"nagai.yamagata.jp":true,"nakayama.yamagata.jp":true,"nanyo.yamagata.jp":true,"nishikawa.yamagata.jp":true,"obanazawa.yamagata.jp":true,"oe.yamagata.jp":true,"oguni.yamagata.jp":true,"ohkura.yamagata.jp":true,"oishida.yamagata.jp":true,"sagae.yamagata.jp":true,"sakata.yamagata.jp":true,"sakegawa.yamagata.jp":true,"shinjo.yamagata.jp":true,"shirataka.yamagata.jp":true,"shonai.yamagata.jp":true,"takahata.yamagata.jp":true,"tendo.yamagata.jp":true,"tozawa.yamagata.jp":true,"tsuruoka.yamagata.jp":true,"yamagata.yamagata.jp":true,"yamanobe.yamagata.jp":true,"yonezawa.yamagata.jp":true,"yuza.yamagata.jp":true,"abu.yamaguchi.jp":true,"hagi.yamaguchi.jp":true,"hikari.yamaguchi.jp":true,"hofu.yamaguchi.jp":true,"iwakuni.yamaguchi.jp":true,"kudamatsu.yamaguchi.jp":true,"mitou.yamaguchi.jp":true,"nagato.yamaguchi.jp":true,"oshima.yamaguchi.jp":true,"shimonoseki.yamaguchi.jp":true,"shunan.yamaguchi.jp":true,"tabuse.yamaguchi.jp":true,"tokuyama.yamaguchi.jp":true,"toyota.yamaguchi.jp":true,"ube.yamaguchi.jp":true,"yuu.yamaguchi.jp":true,"chuo.yamanashi.jp":true,"doshi.yamanashi.jp":true,"fuefuki.yamanashi.jp":true,"fujikawa.yamanashi.jp":true,"fujikawaguchiko.yamanashi.jp":true,"fujiyoshida.yamanashi.jp":true,"hayakawa.yamanashi.jp":true,"hokuto.yamanashi.jp":true,"ichikawamisato.yamanashi.jp":true,"kai.yamanashi.jp":true,"kofu.yamanashi.jp":true,"koshu.yamanashi.jp":true,"kosuge.yamanashi.jp":true,"minami-alps.yamanashi.jp":true,"minobu.yamanashi.jp":true,"nakamichi.yamanashi.jp":true,"nanbu.yamanashi.jp":true,"narusawa.yamanashi.jp":true,"nirasaki.yamanashi.jp":true,"nishikatsura.yamanashi.jp":true,"oshino.yamanashi.jp":true,"otsuki.yamanashi.jp":true,"showa.yamanashi.jp":true,"tabayama.yamanashi.jp":true,"tsuru.yamanashi.jp":true,"uenohara.yamanashi.jp":true,"yamanakako.yamanashi.jp":true,"yamanashi.yamanashi.jp":true,"*.ke":true,"kg":true,"org.kg":true,"net.kg":true,"com.kg":true,"edu.kg":true,"gov.kg":true,"mil.kg":true,"*.kh":true,"ki":true,"edu.ki":true,"biz.ki":true,"net.ki":true,"org.ki":true,"gov.ki":true,"info.ki":true,"com.ki":true,"km":true,"org.km":true,"nom.km":true,"gov.km":true,"prd.km":true,"tm.km":true,"edu.km":true,"mil.km":true,"ass.km":true,"com.km":true,"coop.km":true,"asso.km":true,"presse.km":true,"medecin.km":true,"notaires.km":true,"pharmaciens.km":true,"veterinaire.km":true,"gouv.km":true,"kn":true,"net.kn":true,"org.kn":true,"edu.kn":true,"gov.kn":true,"kp":true,"com.kp":true,"edu.kp":true,"gov.kp":true,"org.kp":true,"rep.kp":true,"tra.kp":true,"kr":true,"ac.kr":true,"co.kr":true,"es.kr":true,"go.kr":true,"hs.kr":true,"kg.kr":true,"mil.kr":true,"ms.kr":true,"ne.kr":true,"or.kr":true,"pe.kr":true,"re.kr":true,"sc.kr":true,"busan.kr":true,"chungbuk.kr":true,"chungnam.kr":true,"daegu.kr":true,"daejeon.kr":true,"gangwon.kr":true,"gwangju.kr":true,"gyeongbuk.kr":true,"gyeonggi.kr":true,"gyeongnam.kr":true,"incheon.kr":true,"jeju.kr":true,"jeonbuk.kr":true,"jeonnam.kr":true,"seoul.kr":true,"ulsan.kr":true,"*.kw":true,"ky":true,"edu.ky":true,"gov.ky":true,"com.ky":true,"org.ky":true,"net.ky":true,"kz":true,"org.kz":true,"edu.kz":true,"net.kz":true,"gov.kz":true,"mil.kz":true,"com.kz":true,"la":true,"int.la":true,"net.la":true,"info.la":true,"edu.la":true,"gov.la":true,"per.la":true,"com.la":true,"org.la":true,"lb":true,"com.lb":true,"edu.lb":true,"gov.lb":true,"net.lb":true,"org.lb":true,"lc":true,"com.lc":true,"net.lc":true,"co.lc":true,"org.lc":true,"edu.lc":true,"gov.lc":true,"li":true,"lk":true,"gov.lk":true,"sch.lk":true,"net.lk":true,"int.lk":true,"com.lk":true,"org.lk":true,"edu.lk":true,"ngo.lk":true,"soc.lk":true,"web.lk":true,"ltd.lk":true,"assn.lk":true,"grp.lk":true,"hotel.lk":true,"ac.lk":true,"lr":true,"com.lr":true,"edu.lr":true,"gov.lr":true,"org.lr":true,"net.lr":true,"ls":true,"co.ls":true,"org.ls":true,"lt":true,"gov.lt":true,"lu":true,"lv":true,"com.lv":true,"edu.lv":true,"gov.lv":true,"org.lv":true,"mil.lv":true,"id.lv":true,"net.lv":true,"asn.lv":true,"conf.lv":true,"ly":true,"com.ly":true,"net.ly":true,"gov.ly":true,"plc.ly":true,"edu.ly":true,"sch.ly":true,"med.ly":true,"org.ly":true,"id.ly":true,"ma":true,"co.ma":true,"net.ma":true,"gov.ma":true,"org.ma":true,"ac.ma":true,"press.ma":true,"mc":true,"tm.mc":true,"asso.mc":true,"md":true,"me":true,"co.me":true,"net.me":true,"org.me":true,"edu.me":true,"ac.me":true,"gov.me":true,"its.me":true,"priv.me":true,"mg":true,"org.mg":true,"nom.mg":true,"gov.mg":true,"prd.mg":true,"tm.mg":true,"edu.mg":true,"mil.mg":true,"com.mg":true,"co.mg":true,"mh":true,"mil":true,"mk":true,"com.mk":true,"org.mk":true,"net.mk":true,"edu.mk":true,"gov.mk":true,"inf.mk":true,"name.mk":true,"ml":true,"com.ml":true,"edu.ml":true,"gouv.ml":true,"gov.ml":true,"net.ml":true,"org.ml":true,"presse.ml":true,"*.mm":true,"mn":true,"gov.mn":true,"edu.mn":true,"org.mn":true,"mo":true,"com.mo":true,"net.mo":true,"org.mo":true,"edu.mo":true,"gov.mo":true,"mobi":true,"mp":true,"mq":true,"mr":true,"gov.mr":true,"ms":true,"com.ms":true,"edu.ms":true,"gov.ms":true,"net.ms":true,"org.ms":true,"mt":true,"com.mt":true,"edu.mt":true,"net.mt":true,"org.mt":true,"mu":true,"com.mu":true,"net.mu":true,"org.mu":true,"gov.mu":true,"ac.mu":true,"co.mu":true,"or.mu":true,"museum":true,"academy.museum":true,"agriculture.museum":true,"air.museum":true,"airguard.museum":true,"alabama.museum":true,"alaska.museum":true,"amber.museum":true,"ambulance.museum":true,"american.museum":true,"americana.museum":true,"americanantiques.museum":true,"americanart.museum":true,"amsterdam.museum":true,"and.museum":true,"annefrank.museum":true,"anthro.museum":true,"anthropology.museum":true,"antiques.museum":true,"aquarium.museum":true,"arboretum.museum":true,"archaeological.museum":true,"archaeology.museum":true,"architecture.museum":true,"art.museum":true,"artanddesign.museum":true,"artcenter.museum":true,"artdeco.museum":true,"arteducation.museum":true,"artgallery.museum":true,"arts.museum":true,"artsandcrafts.museum":true,"asmatart.museum":true,"assassination.museum":true,"assisi.museum":true,"association.museum":true,"astronomy.museum":true,"atlanta.museum":true,"austin.museum":true,"australia.museum":true,"automotive.museum":true,"aviation.museum":true,"axis.museum":true,"badajoz.museum":true,"baghdad.museum":true,"bahn.museum":true,"bale.museum":true,"baltimore.museum":true,"barcelona.museum":true,"baseball.museum":true,"basel.museum":true,"baths.museum":true,"bauern.museum":true,"beauxarts.museum":true,"beeldengeluid.museum":true,"bellevue.museum":true,"bergbau.museum":true,"berkeley.museum":true,"berlin.museum":true,"bern.museum":true,"bible.museum":true,"bilbao.museum":true,"bill.museum":true,"birdart.museum":true,"birthplace.museum":true,"bonn.museum":true,"boston.museum":true,"botanical.museum":true,"botanicalgarden.museum":true,"botanicgarden.museum":true,"botany.museum":true,"brandywinevalley.museum":true,"brasil.museum":true,"bristol.museum":true,"british.museum":true,"britishcolumbia.museum":true,"broadcast.museum":true,"brunel.museum":true,"brussel.museum":true,"brussels.museum":true,"bruxelles.museum":true,"building.museum":true,"burghof.museum":true,"bus.museum":true,"bushey.museum":true,"cadaques.museum":true,"california.museum":true,"cambridge.museum":true,"can.museum":true,"canada.museum":true,"capebreton.museum":true,"carrier.museum":true,"cartoonart.museum":true,"casadelamoneda.museum":true,"castle.museum":true,"castres.museum":true,"celtic.museum":true,"center.museum":true,"chattanooga.museum":true,"cheltenham.museum":true,"chesapeakebay.museum":true,"chicago.museum":true,"children.museum":true,"childrens.museum":true,"childrensgarden.museum":true,"chiropractic.museum":true,"chocolate.museum":true,"christiansburg.museum":true,"cincinnati.museum":true,"cinema.museum":true,"circus.museum":true,"civilisation.museum":true,"civilization.museum":true,"civilwar.museum":true,"clinton.museum":true,"clock.museum":true,"coal.museum":true,"coastaldefence.museum":true,"cody.museum":true,"coldwar.museum":true,"collection.museum":true,"colonialwilliamsburg.museum":true,"coloradoplateau.museum":true,"columbia.museum":true,"columbus.museum":true,"communication.museum":true,"communications.museum":true,"community.museum":true,"computer.museum":true,"computerhistory.museum":true,"xn--comunicaes-v6a2o.museum":true,"contemporary.museum":true,"contemporaryart.museum":true,"convent.museum":true,"copenhagen.museum":true,"corporation.museum":true,"xn--correios-e-telecomunicaes-ghc29a.museum":true,"corvette.museum":true,"costume.museum":true,"countryestate.museum":true,"county.museum":true,"crafts.museum":true,"cranbrook.museum":true,"creation.museum":true,"cultural.museum":true,"culturalcenter.museum":true,"culture.museum":true,"cyber.museum":true,"cymru.museum":true,"dali.museum":true,"dallas.museum":true,"database.museum":true,"ddr.museum":true,"decorativearts.museum":true,"delaware.museum":true,"delmenhorst.museum":true,"denmark.museum":true,"depot.museum":true,"design.museum":true,"detroit.museum":true,"dinosaur.museum":true,"discovery.museum":true,"dolls.museum":true,"donostia.museum":true,"durham.museum":true,"eastafrica.museum":true,"eastcoast.museum":true,"education.museum":true,"educational.museum":true,"egyptian.museum":true,"eisenbahn.museum":true,"elburg.museum":true,"elvendrell.museum":true,"embroidery.museum":true,"encyclopedic.museum":true,"england.museum":true,"entomology.museum":true,"environment.museum":true,"environmentalconservation.museum":true,"epilepsy.museum":true,"essex.museum":true,"estate.museum":true,"ethnology.museum":true,"exeter.museum":true,"exhibition.museum":true,"family.museum":true,"farm.museum":true,"farmequipment.museum":true,"farmers.museum":true,"farmstead.museum":true,"field.museum":true,"figueres.museum":true,"filatelia.museum":true,"film.museum":true,"fineart.museum":true,"finearts.museum":true,"finland.museum":true,"flanders.museum":true,"florida.museum":true,"force.museum":true,"fortmissoula.museum":true,"fortworth.museum":true,"foundation.museum":true,"francaise.museum":true,"frankfurt.museum":true,"franziskaner.museum":true,"freemasonry.museum":true,"freiburg.museum":true,"fribourg.museum":true,"frog.museum":true,"fundacio.museum":true,"furniture.museum":true,"gallery.museum":true,"garden.museum":true,"gateway.museum":true,"geelvinck.museum":true,"gemological.museum":true,"geology.museum":true,"georgia.museum":true,"giessen.museum":true,"glas.museum":true,"glass.museum":true,"gorge.museum":true,"grandrapids.museum":true,"graz.museum":true,"guernsey.museum":true,"halloffame.museum":true,"hamburg.museum":true,"handson.museum":true,"harvestcelebration.museum":true,"hawaii.museum":true,"health.museum":true,"heimatunduhren.museum":true,"hellas.museum":true,"helsinki.museum":true,"hembygdsforbund.museum":true,"heritage.museum":true,"histoire.museum":true,"historical.museum":true,"historicalsociety.museum":true,"historichouses.museum":true,"historisch.museum":true,"historisches.museum":true,"history.museum":true,"historyofscience.museum":true,"horology.museum":true,"house.museum":true,"humanities.museum":true,"illustration.museum":true,"imageandsound.museum":true,"indian.museum":true,"indiana.museum":true,"indianapolis.museum":true,"indianmarket.museum":true,"intelligence.museum":true,"interactive.museum":true,"iraq.museum":true,"iron.museum":true,"isleofman.museum":true,"jamison.museum":true,"jefferson.museum":true,"jerusalem.museum":true,"jewelry.museum":true,"jewish.museum":true,"jewishart.museum":true,"jfk.museum":true,"journalism.museum":true,"judaica.museum":true,"judygarland.museum":true,"juedisches.museum":true,"juif.museum":true,"karate.museum":true,"karikatur.museum":true,"kids.museum":true,"koebenhavn.museum":true,"koeln.museum":true,"kunst.museum":true,"kunstsammlung.museum":true,"kunstunddesign.museum":true,"labor.museum":true,"labour.museum":true,"lajolla.museum":true,"lancashire.museum":true,"landes.museum":true,"lans.museum":true,"xn--lns-qla.museum":true,"larsson.museum":true,"lewismiller.museum":true,"lincoln.museum":true,"linz.museum":true,"living.museum":true,"livinghistory.museum":true,"localhistory.museum":true,"london.museum":true,"losangeles.museum":true,"louvre.museum":true,"loyalist.museum":true,"lucerne.museum":true,"luxembourg.museum":true,"luzern.museum":true,"mad.museum":true,"madrid.museum":true,"mallorca.museum":true,"manchester.museum":true,"mansion.museum":true,"mansions.museum":true,"manx.museum":true,"marburg.museum":true,"maritime.museum":true,"maritimo.museum":true,"maryland.museum":true,"marylhurst.museum":true,"media.museum":true,"medical.museum":true,"medizinhistorisches.museum":true,"meeres.museum":true,"memorial.museum":true,"mesaverde.museum":true,"michigan.museum":true,"midatlantic.museum":true,"military.museum":true,"mill.museum":true,"miners.museum":true,"mining.museum":true,"minnesota.museum":true,"missile.museum":true,"missoula.museum":true,"modern.museum":true,"moma.museum":true,"money.museum":true,"monmouth.museum":true,"monticello.museum":true,"montreal.museum":true,"moscow.museum":true,"motorcycle.museum":true,"muenchen.museum":true,"muenster.museum":true,"mulhouse.museum":true,"muncie.museum":true,"museet.museum":true,"museumcenter.museum":true,"museumvereniging.museum":true,"music.museum":true,"national.museum":true,"nationalfirearms.museum":true,"nationalheritage.museum":true,"nativeamerican.museum":true,"naturalhistory.museum":true,"naturalhistorymuseum.museum":true,"naturalsciences.museum":true,"nature.museum":true,"naturhistorisches.museum":true,"natuurwetenschappen.museum":true,"naumburg.museum":true,"naval.museum":true,"nebraska.museum":true,"neues.museum":true,"newhampshire.museum":true,"newjersey.museum":true,"newmexico.museum":true,"newport.museum":true,"newspaper.museum":true,"newyork.museum":true,"niepce.museum":true,"norfolk.museum":true,"north.museum":true,"nrw.museum":true,"nuernberg.museum":true,"nuremberg.museum":true,"nyc.museum":true,"nyny.museum":true,"oceanographic.museum":true,"oceanographique.museum":true,"omaha.museum":true,"online.museum":true,"ontario.museum":true,"openair.museum":true,"oregon.museum":true,"oregontrail.museum":true,"otago.museum":true,"oxford.museum":true,"pacific.museum":true,"paderborn.museum":true,"palace.museum":true,"paleo.museum":true,"palmsprings.museum":true,"panama.museum":true,"paris.museum":true,"pasadena.museum":true,"pharmacy.museum":true,"philadelphia.museum":true,"philadelphiaarea.museum":true,"philately.museum":true,"phoenix.museum":true,"photography.museum":true,"pilots.museum":true,"pittsburgh.museum":true,"planetarium.museum":true,"plantation.museum":true,"plants.museum":true,"plaza.museum":true,"portal.museum":true,"portland.museum":true,"portlligat.museum":true,"posts-and-telecommunications.museum":true,"preservation.museum":true,"presidio.museum":true,"press.museum":true,"project.museum":true,"public.museum":true,"pubol.museum":true,"quebec.museum":true,"railroad.museum":true,"railway.museum":true,"research.museum":true,"resistance.museum":true,"riodejaneiro.museum":true,"rochester.museum":true,"rockart.museum":true,"roma.museum":true,"russia.museum":true,"saintlouis.museum":true,"salem.museum":true,"salvadordali.museum":true,"salzburg.museum":true,"sandiego.museum":true,"sanfrancisco.museum":true,"santabarbara.museum":true,"santacruz.museum":true,"santafe.museum":true,"saskatchewan.museum":true,"satx.museum":true,"savannahga.museum":true,"schlesisches.museum":true,"schoenbrunn.museum":true,"schokoladen.museum":true,"school.museum":true,"schweiz.museum":true,"science.museum":true,"scienceandhistory.museum":true,"scienceandindustry.museum":true,"sciencecenter.museum":true,"sciencecenters.museum":true,"science-fiction.museum":true,"sciencehistory.museum":true,"sciences.museum":true,"sciencesnaturelles.museum":true,"scotland.museum":true,"seaport.museum":true,"settlement.museum":true,"settlers.museum":true,"shell.museum":true,"sherbrooke.museum":true,"sibenik.museum":true,"silk.museum":true,"ski.museum":true,"skole.museum":true,"society.museum":true,"sologne.museum":true,"soundandvision.museum":true,"southcarolina.museum":true,"southwest.museum":true,"space.museum":true,"spy.museum":true,"square.museum":true,"stadt.museum":true,"stalbans.museum":true,"starnberg.museum":true,"state.museum":true,"stateofdelaware.museum":true,"station.museum":true,"steam.museum":true,"steiermark.museum":true,"stjohn.museum":true,"stockholm.museum":true,"stpetersburg.museum":true,"stuttgart.museum":true,"suisse.museum":true,"surgeonshall.museum":true,"surrey.museum":true,"svizzera.museum":true,"sweden.museum":true,"sydney.museum":true,"tank.museum":true,"tcm.museum":true,"technology.museum":true,"telekommunikation.museum":true,"television.museum":true,"texas.museum":true,"textile.museum":true,"theater.museum":true,"time.museum":true,"timekeeping.museum":true,"topology.museum":true,"torino.museum":true,"touch.museum":true,"town.museum":true,"transport.museum":true,"tree.museum":true,"trolley.museum":true,"trust.museum":true,"trustee.museum":true,"uhren.museum":true,"ulm.museum":true,"undersea.museum":true,"university.museum":true,"usa.museum":true,"usantiques.museum":true,"usarts.museum":true,"uscountryestate.museum":true,"usculture.museum":true,"usdecorativearts.museum":true,"usgarden.museum":true,"ushistory.museum":true,"ushuaia.museum":true,"uslivinghistory.museum":true,"utah.museum":true,"uvic.museum":true,"valley.museum":true,"vantaa.museum":true,"versailles.museum":true,"viking.museum":true,"village.museum":true,"virginia.museum":true,"virtual.museum":true,"virtuel.museum":true,"vlaanderen.museum":true,"volkenkunde.museum":true,"wales.museum":true,"wallonie.museum":true,"war.museum":true,"washingtondc.museum":true,"watchandclock.museum":true,"watch-and-clock.museum":true,"western.museum":true,"westfalen.museum":true,"whaling.museum":true,"wildlife.museum":true,"williamsburg.museum":true,"windmill.museum":true,"workshop.museum":true,"york.museum":true,"yorkshire.museum":true,"yosemite.museum":true,"youth.museum":true,"zoological.museum":true,"zoology.museum":true,"xn--9dbhblg6di.museum":true,"xn--h1aegh.museum":true,"mv":true,"aero.mv":true,"biz.mv":true,"com.mv":true,"coop.mv":true,"edu.mv":true,"gov.mv":true,"info.mv":true,"int.mv":true,"mil.mv":true,"museum.mv":true,"name.mv":true,"net.mv":true,"org.mv":true,"pro.mv":true,"mw":true,"ac.mw":true,"biz.mw":true,"co.mw":true,"com.mw":true,"coop.mw":true,"edu.mw":true,"gov.mw":true,"int.mw":true,"museum.mw":true,"net.mw":true,"org.mw":true,"mx":true,"com.mx":true,"org.mx":true,"gob.mx":true,"edu.mx":true,"net.mx":true,"my":true,"com.my":true,"net.my":true,"org.my":true,"gov.my":true,"edu.my":true,"mil.my":true,"name.my":true,"*.mz":true,"teledata.mz":false,"na":true,"info.na":true,"pro.na":true,"name.na":true,"school.na":true,"or.na":true,"dr.na":true,"us.na":true,"mx.na":true,"ca.na":true,"in.na":true,"cc.na":true,"tv.na":true,"ws.na":true,"mobi.na":true,"co.na":true,"com.na":true,"org.na":true,"name":true,"nc":true,"asso.nc":true,"ne":true,"net":true,"nf":true,"com.nf":true,"net.nf":true,"per.nf":true,"rec.nf":true,"web.nf":true,"arts.nf":true,"firm.nf":true,"info.nf":true,"other.nf":true,"store.nf":true,"ng":true,"com.ng":true,"edu.ng":true,"name.ng":true,"net.ng":true,"org.ng":true,"sch.ng":true,"gov.ng":true,"mil.ng":true,"mobi.ng":true,"*.ni":true,"nl":true,"bv.nl":true,"no":true,"fhs.no":true,"vgs.no":true,"fylkesbibl.no":true,"folkebibl.no":true,"museum.no":true,"idrett.no":true,"priv.no":true,"mil.no":true,"stat.no":true,"dep.no":true,"kommune.no":true,"herad.no":true,"aa.no":true,"ah.no":true,"bu.no":true,"fm.no":true,"hl.no":true,"hm.no":true,"jan-mayen.no":true,"mr.no":true,"nl.no":true,"nt.no":true,"of.no":true,"ol.no":true,"oslo.no":true,"rl.no":true,"sf.no":true,"st.no":true,"svalbard.no":true,"tm.no":true,"tr.no":true,"va.no":true,"vf.no":true,"gs.aa.no":true,"gs.ah.no":true,"gs.bu.no":true,"gs.fm.no":true,"gs.hl.no":true,"gs.hm.no":true,"gs.jan-mayen.no":true,"gs.mr.no":true,"gs.nl.no":true,"gs.nt.no":true,"gs.of.no":true,"gs.ol.no":true,"gs.oslo.no":true,"gs.rl.no":true,"gs.sf.no":true,"gs.st.no":true,"gs.svalbard.no":true,"gs.tm.no":true,"gs.tr.no":true,"gs.va.no":true,"gs.vf.no":true,"akrehamn.no":true,"xn--krehamn-dxa.no":true,"algard.no":true,"xn--lgrd-poac.no":true,"arna.no":true,"brumunddal.no":true,"bryne.no":true,"bronnoysund.no":true,"xn--brnnysund-m8ac.no":true,"drobak.no":true,"xn--drbak-wua.no":true,"egersund.no":true,"fetsund.no":true,"floro.no":true,"xn--flor-jra.no":true,"fredrikstad.no":true,"hokksund.no":true,"honefoss.no":true,"xn--hnefoss-q1a.no":true,"jessheim.no":true,"jorpeland.no":true,"xn--jrpeland-54a.no":true,"kirkenes.no":true,"kopervik.no":true,"krokstadelva.no":true,"langevag.no":true,"xn--langevg-jxa.no":true,"leirvik.no":true,"mjondalen.no":true,"xn--mjndalen-64a.no":true,"mo-i-rana.no":true,"mosjoen.no":true,"xn--mosjen-eya.no":true,"nesoddtangen.no":true,"orkanger.no":true,"osoyro.no":true,"xn--osyro-wua.no":true,"raholt.no":true,"xn--rholt-mra.no":true,"sandnessjoen.no":true,"xn--sandnessjen-ogb.no":true,"skedsmokorset.no":true,"slattum.no":true,"spjelkavik.no":true,"stathelle.no":true,"stavern.no":true,"stjordalshalsen.no":true,"xn--stjrdalshalsen-sqb.no":true,"tananger.no":true,"tranby.no":true,"vossevangen.no":true,"afjord.no":true,"xn--fjord-lra.no":true,"agdenes.no":true,"al.no":true,"xn--l-1fa.no":true,"alesund.no":true,"xn--lesund-hua.no":true,"alstahaug.no":true,"alta.no":true,"xn--lt-liac.no":true,"alaheadju.no":true,"xn--laheadju-7ya.no":true,"alvdal.no":true,"amli.no":true,"xn--mli-tla.no":true,"amot.no":true,"xn--mot-tla.no":true,"andebu.no":true,"andoy.no":true,"xn--andy-ira.no":true,"andasuolo.no":true,"ardal.no":true,"xn--rdal-poa.no":true,"aremark.no":true,"arendal.no":true,"xn--s-1fa.no":true,"aseral.no":true,"xn--seral-lra.no":true,"asker.no":true,"askim.no":true,"askvoll.no":true,"askoy.no":true,"xn--asky-ira.no":true,"asnes.no":true,"xn--snes-poa.no":true,"audnedaln.no":true,"aukra.no":true,"aure.no":true,"aurland.no":true,"aurskog-holand.no":true,"xn--aurskog-hland-jnb.no":true,"austevoll.no":true,"austrheim.no":true,"averoy.no":true,"xn--avery-yua.no":true,"balestrand.no":true,"ballangen.no":true,"balat.no":true,"xn--blt-elab.no":true,"balsfjord.no":true,"bahccavuotna.no":true,"xn--bhccavuotna-k7a.no":true,"bamble.no":true,"bardu.no":true,"beardu.no":true,"beiarn.no":true,"bajddar.no":true,"xn--bjddar-pta.no":true,"baidar.no":true,"xn--bidr-5nac.no":true,"berg.no":true,"bergen.no":true,"berlevag.no":true,"xn--berlevg-jxa.no":true,"bearalvahki.no":true,"xn--bearalvhki-y4a.no":true,"bindal.no":true,"birkenes.no":true,"bjarkoy.no":true,"xn--bjarky-fya.no":true,"bjerkreim.no":true,"bjugn.no":true,"bodo.no":true,"xn--bod-2na.no":true,"badaddja.no":true,"xn--bdddj-mrabd.no":true,"budejju.no":true,"bokn.no":true,"bremanger.no":true,"bronnoy.no":true,"xn--brnny-wuac.no":true,"bygland.no":true,"bykle.no":true,"barum.no":true,"xn--brum-voa.no":true,"bo.telemark.no":true,"xn--b-5ga.telemark.no":true,"bo.nordland.no":true,"xn--b-5ga.nordland.no":true,"bievat.no":true,"xn--bievt-0qa.no":true,"bomlo.no":true,"xn--bmlo-gra.no":true,"batsfjord.no":true,"xn--btsfjord-9za.no":true,"bahcavuotna.no":true,"xn--bhcavuotna-s4a.no":true,"dovre.no":true,"drammen.no":true,"drangedal.no":true,"dyroy.no":true,"xn--dyry-ira.no":true,"donna.no":true,"xn--dnna-gra.no":true,"eid.no":true,"eidfjord.no":true,"eidsberg.no":true,"eidskog.no":true,"eidsvoll.no":true,"eigersund.no":true,"elverum.no":true,"enebakk.no":true,"engerdal.no":true,"etne.no":true,"etnedal.no":true,"evenes.no":true,"evenassi.no":true,"xn--eveni-0qa01ga.no":true,"evje-og-hornnes.no":true,"farsund.no":true,"fauske.no":true,"fuossko.no":true,"fuoisku.no":true,"fedje.no":true,"fet.no":true,"finnoy.no":true,"xn--finny-yua.no":true,"fitjar.no":true,"fjaler.no":true,"fjell.no":true,"flakstad.no":true,"flatanger.no":true,"flekkefjord.no":true,"flesberg.no":true,"flora.no":true,"fla.no":true,"xn--fl-zia.no":true,"folldal.no":true,"forsand.no":true,"fosnes.no":true,"frei.no":true,"frogn.no":true,"froland.no":true,"frosta.no":true,"frana.no":true,"xn--frna-woa.no":true,"froya.no":true,"xn--frya-hra.no":true,"fusa.no":true,"fyresdal.no":true,"forde.no":true,"xn--frde-gra.no":true,"gamvik.no":true,"gangaviika.no":true,"xn--ggaviika-8ya47h.no":true,"gaular.no":true,"gausdal.no":true,"gildeskal.no":true,"xn--gildeskl-g0a.no":true,"giske.no":true,"gjemnes.no":true,"gjerdrum.no":true,"gjerstad.no":true,"gjesdal.no":true,"gjovik.no":true,"xn--gjvik-wua.no":true,"gloppen.no":true,"gol.no":true,"gran.no":true,"grane.no":true,"granvin.no":true,"gratangen.no":true,"grimstad.no":true,"grong.no":true,"kraanghke.no":true,"xn--kranghke-b0a.no":true,"grue.no":true,"gulen.no":true,"hadsel.no":true,"halden.no":true,"halsa.no":true,"hamar.no":true,"hamaroy.no":true,"habmer.no":true,"xn--hbmer-xqa.no":true,"hapmir.no":true,"xn--hpmir-xqa.no":true,"hammerfest.no":true,"hammarfeasta.no":true,"xn--hmmrfeasta-s4ac.no":true,"haram.no":true,"hareid.no":true,"harstad.no":true,"hasvik.no":true,"aknoluokta.no":true,"xn--koluokta-7ya57h.no":true,"hattfjelldal.no":true,"aarborte.no":true,"haugesund.no":true,"hemne.no":true,"hemnes.no":true,"hemsedal.no":true,"heroy.more-og-romsdal.no":true,"xn--hery-ira.xn--mre-og-romsdal-qqb.no":true,"heroy.nordland.no":true,"xn--hery-ira.nordland.no":true,"hitra.no":true,"hjartdal.no":true,"hjelmeland.no":true,"hobol.no":true,"xn--hobl-ira.no":true,"hof.no":true,"hol.no":true,"hole.no":true,"holmestrand.no":true,"holtalen.no":true,"xn--holtlen-hxa.no":true,"hornindal.no":true,"horten.no":true,"hurdal.no":true,"hurum.no":true,"hvaler.no":true,"hyllestad.no":true,"hagebostad.no":true,"xn--hgebostad-g3a.no":true,"hoyanger.no":true,"xn--hyanger-q1a.no":true,"hoylandet.no":true,"xn--hylandet-54a.no":true,"ha.no":true,"xn--h-2fa.no":true,"ibestad.no":true,"inderoy.no":true,"xn--indery-fya.no":true,"iveland.no":true,"jevnaker.no":true,"jondal.no":true,"jolster.no":true,"xn--jlster-bya.no":true,"karasjok.no":true,"karasjohka.no":true,"xn--krjohka-hwab49j.no":true,"karlsoy.no":true,"galsa.no":true,"xn--gls-elac.no":true,"karmoy.no":true,"xn--karmy-yua.no":true,"kautokeino.no":true,"guovdageaidnu.no":true,"klepp.no":true,"klabu.no":true,"xn--klbu-woa.no":true,"kongsberg.no":true,"kongsvinger.no":true,"kragero.no":true,"xn--krager-gya.no":true,"kristiansand.no":true,"kristiansund.no":true,"krodsherad.no":true,"xn--krdsherad-m8a.no":true,"kvalsund.no":true,"rahkkeravju.no":true,"xn--rhkkervju-01af.no":true,"kvam.no":true,"kvinesdal.no":true,"kvinnherad.no":true,"kviteseid.no":true,"kvitsoy.no":true,"xn--kvitsy-fya.no":true,"kvafjord.no":true,"xn--kvfjord-nxa.no":true,"giehtavuoatna.no":true,"kvanangen.no":true,"xn--kvnangen-k0a.no":true,"navuotna.no":true,"xn--nvuotna-hwa.no":true,"kafjord.no":true,"xn--kfjord-iua.no":true,"gaivuotna.no":true,"xn--givuotna-8ya.no":true,"larvik.no":true,"lavangen.no":true,"lavagis.no":true,"loabat.no":true,"xn--loabt-0qa.no":true,"lebesby.no":true,"davvesiida.no":true,"leikanger.no":true,"leirfjord.no":true,"leka.no":true,"leksvik.no":true,"lenvik.no":true,"leangaviika.no":true,"xn--leagaviika-52b.no":true,"lesja.no":true,"levanger.no":true,"lier.no":true,"lierne.no":true,"lillehammer.no":true,"lillesand.no":true,"lindesnes.no":true,"lindas.no":true,"xn--linds-pra.no":true,"lom.no":true,"loppa.no":true,"lahppi.no":true,"xn--lhppi-xqa.no":true,"lund.no":true,"lunner.no":true,"luroy.no":true,"xn--lury-ira.no":true,"luster.no":true,"lyngdal.no":true,"lyngen.no":true,"ivgu.no":true,"lardal.no":true,"lerdal.no":true,"xn--lrdal-sra.no":true,"lodingen.no":true,"xn--ldingen-q1a.no":true,"lorenskog.no":true,"xn--lrenskog-54a.no":true,"loten.no":true,"xn--lten-gra.no":true,"malvik.no":true,"masoy.no":true,"xn--msy-ula0h.no":true,"muosat.no":true,"xn--muost-0qa.no":true,"mandal.no":true,"marker.no":true,"marnardal.no":true,"masfjorden.no":true,"meland.no":true,"meldal.no":true,"melhus.no":true,"meloy.no":true,"xn--mely-ira.no":true,"meraker.no":true,"xn--merker-kua.no":true,"moareke.no":true,"xn--moreke-jua.no":true,"midsund.no":true,"midtre-gauldal.no":true,"modalen.no":true,"modum.no":true,"molde.no":true,"moskenes.no":true,"moss.no":true,"mosvik.no":true,"malselv.no":true,"xn--mlselv-iua.no":true,"malatvuopmi.no":true,"xn--mlatvuopmi-s4a.no":true,"namdalseid.no":true,"aejrie.no":true,"namsos.no":true,"namsskogan.no":true,"naamesjevuemie.no":true,"xn--nmesjevuemie-tcba.no":true,"laakesvuemie.no":true,"nannestad.no":true,"narvik.no":true,"narviika.no":true,"naustdal.no":true,"nedre-eiker.no":true,"nes.akershus.no":true,"nes.buskerud.no":true,"nesna.no":true,"nesodden.no":true,"nesseby.no":true,"unjarga.no":true,"xn--unjrga-rta.no":true,"nesset.no":true,"nissedal.no":true,"nittedal.no":true,"nord-aurdal.no":true,"nord-fron.no":true,"nord-odal.no":true,"norddal.no":true,"nordkapp.no":true,"davvenjarga.no":true,"xn--davvenjrga-y4a.no":true,"nordre-land.no":true,"nordreisa.no":true,"raisa.no":true,"xn--risa-5na.no":true,"nore-og-uvdal.no":true,"notodden.no":true,"naroy.no":true,"xn--nry-yla5g.no":true,"notteroy.no":true,"xn--nttery-byae.no":true,"odda.no":true,"oksnes.no":true,"xn--ksnes-uua.no":true,"oppdal.no":true,"oppegard.no":true,"xn--oppegrd-ixa.no":true,"orkdal.no":true,"orland.no":true,"xn--rland-uua.no":true,"orskog.no":true,"xn--rskog-uua.no":true,"orsta.no":true,"xn--rsta-fra.no":true,"os.hedmark.no":true,"os.hordaland.no":true,"osen.no":true,"osteroy.no":true,"xn--ostery-fya.no":true,"ostre-toten.no":true,"xn--stre-toten-zcb.no":true,"overhalla.no":true,"ovre-eiker.no":true,"xn--vre-eiker-k8a.no":true,"oyer.no":true,"xn--yer-zna.no":true,"oygarden.no":true,"xn--ygarden-p1a.no":true,"oystre-slidre.no":true,"xn--ystre-slidre-ujb.no":true,"porsanger.no":true,"porsangu.no":true,"xn--porsgu-sta26f.no":true,"porsgrunn.no":true,"radoy.no":true,"xn--rady-ira.no":true,"rakkestad.no":true,"rana.no":true,"ruovat.no":true,"randaberg.no":true,"rauma.no":true,"rendalen.no":true,"rennebu.no":true,"rennesoy.no":true,"xn--rennesy-v1a.no":true,"rindal.no":true,"ringebu.no":true,"ringerike.no":true,"ringsaker.no":true,"rissa.no":true,"risor.no":true,"xn--risr-ira.no":true,"roan.no":true,"rollag.no":true,"rygge.no":true,"ralingen.no":true,"xn--rlingen-mxa.no":true,"rodoy.no":true,"xn--rdy-0nab.no":true,"romskog.no":true,"xn--rmskog-bya.no":true,"roros.no":true,"xn--rros-gra.no":true,"rost.no":true,"xn--rst-0na.no":true,"royken.no":true,"xn--ryken-vua.no":true,"royrvik.no":true,"xn--ryrvik-bya.no":true,"rade.no":true,"xn--rde-ula.no":true,"salangen.no":true,"siellak.no":true,"saltdal.no":true,"salat.no":true,"xn--slt-elab.no":true,"xn--slat-5na.no":true,"samnanger.no":true,"sande.more-og-romsdal.no":true,"sande.xn--mre-og-romsdal-qqb.no":true,"sande.vestfold.no":true,"sandefjord.no":true,"sandnes.no":true,"sandoy.no":true,"xn--sandy-yua.no":true,"sarpsborg.no":true,"sauda.no":true,"sauherad.no":true,"sel.no":true,"selbu.no":true,"selje.no":true,"seljord.no":true,"sigdal.no":true,"siljan.no":true,"sirdal.no":true,"skaun.no":true,"skedsmo.no":true,"ski.no":true,"skien.no":true,"skiptvet.no":true,"skjervoy.no":true,"xn--skjervy-v1a.no":true,"skierva.no":true,"xn--skierv-uta.no":true,"skjak.no":true,"xn--skjk-soa.no":true,"skodje.no":true,"skanland.no":true,"xn--sknland-fxa.no":true,"skanit.no":true,"xn--sknit-yqa.no":true,"smola.no":true,"xn--smla-hra.no":true,"snillfjord.no":true,"snasa.no":true,"xn--snsa-roa.no":true,"snoasa.no":true,"snaase.no":true,"xn--snase-nra.no":true,"sogndal.no":true,"sokndal.no":true,"sola.no":true,"solund.no":true,"songdalen.no":true,"sortland.no":true,"spydeberg.no":true,"stange.no":true,"stavanger.no":true,"steigen.no":true,"steinkjer.no":true,"stjordal.no":true,"xn--stjrdal-s1a.no":true,"stokke.no":true,"stor-elvdal.no":true,"stord.no":true,"stordal.no":true,"storfjord.no":true,"omasvuotna.no":true,"strand.no":true,"stranda.no":true,"stryn.no":true,"sula.no":true,"suldal.no":true,"sund.no":true,"sunndal.no":true,"surnadal.no":true,"sveio.no":true,"svelvik.no":true,"sykkylven.no":true,"sogne.no":true,"xn--sgne-gra.no":true,"somna.no":true,"xn--smna-gra.no":true,"sondre-land.no":true,"xn--sndre-land-0cb.no":true,"sor-aurdal.no":true,"xn--sr-aurdal-l8a.no":true,"sor-fron.no":true,"xn--sr-fron-q1a.no":true,"sor-odal.no":true,"xn--sr-odal-q1a.no":true,"sor-varanger.no":true,"xn--sr-varanger-ggb.no":true,"matta-varjjat.no":true,"xn--mtta-vrjjat-k7af.no":true,"sorfold.no":true,"xn--srfold-bya.no":true,"sorreisa.no":true,"xn--srreisa-q1a.no":true,"sorum.no":true,"xn--srum-gra.no":true,"tana.no":true,"deatnu.no":true,"time.no":true,"tingvoll.no":true,"tinn.no":true,"tjeldsund.no":true,"dielddanuorri.no":true,"tjome.no":true,"xn--tjme-hra.no":true,"tokke.no":true,"tolga.no":true,"torsken.no":true,"tranoy.no":true,"xn--trany-yua.no":true,"tromso.no":true,"xn--troms-zua.no":true,"tromsa.no":true,"romsa.no":true,"trondheim.no":true,"troandin.no":true,"trysil.no":true,"trana.no":true,"xn--trna-woa.no":true,"trogstad.no":true,"xn--trgstad-r1a.no":true,"tvedestrand.no":true,"tydal.no":true,"tynset.no":true,"tysfjord.no":true,"divtasvuodna.no":true,"divttasvuotna.no":true,"tysnes.no":true,"tysvar.no":true,"xn--tysvr-vra.no":true,"tonsberg.no":true,"xn--tnsberg-q1a.no":true,"ullensaker.no":true,"ullensvang.no":true,"ulvik.no":true,"utsira.no":true,"vadso.no":true,"xn--vads-jra.no":true,"cahcesuolo.no":true,"xn--hcesuolo-7ya35b.no":true,"vaksdal.no":true,"valle.no":true,"vang.no":true,"vanylven.no":true,"vardo.no":true,"xn--vard-jra.no":true,"varggat.no":true,"xn--vrggt-xqad.no":true,"vefsn.no":true,"vaapste.no":true,"vega.no":true,"vegarshei.no":true,"xn--vegrshei-c0a.no":true,"vennesla.no":true,"verdal.no":true,"verran.no":true,"vestby.no":true,"vestnes.no":true,"vestre-slidre.no":true,"vestre-toten.no":true,"vestvagoy.no":true,"xn--vestvgy-ixa6o.no":true,"vevelstad.no":true,"vik.no":true,"vikna.no":true,"vindafjord.no":true,"volda.no":true,"voss.no":true,"varoy.no":true,"xn--vry-yla5g.no":true,"vagan.no":true,"xn--vgan-qoa.no":true,"voagat.no":true,"vagsoy.no":true,"xn--vgsy-qoa0j.no":true,"vaga.no":true,"xn--vg-yiab.no":true,"valer.ostfold.no":true,"xn--vler-qoa.xn--stfold-9xa.no":true,"valer.hedmark.no":true,"xn--vler-qoa.hedmark.no":true,"*.np":true,"nr":true,"biz.nr":true,"info.nr":true,"gov.nr":true,"edu.nr":true,"org.nr":true,"net.nr":true,"com.nr":true,"nu":true,"nz":true,"ac.nz":true,"co.nz":true,"cri.nz":true,"geek.nz":true,"gen.nz":true,"govt.nz":true,"health.nz":true,"iwi.nz":true,"kiwi.nz":true,"maori.nz":true,"mil.nz":true,"xn--mori-qsa.nz":true,"net.nz":true,"org.nz":true,"parliament.nz":true,"school.nz":true,"om":true,"co.om":true,"com.om":true,"edu.om":true,"gov.om":true,"med.om":true,"museum.om":true,"net.om":true,"org.om":true,"pro.om":true,"org":true,"pa":true,"ac.pa":true,"gob.pa":true,"com.pa":true,"org.pa":true,"sld.pa":true,"edu.pa":true,"net.pa":true,"ing.pa":true,"abo.pa":true,"med.pa":true,"nom.pa":true,"pe":true,"edu.pe":true,"gob.pe":true,"nom.pe":true,"mil.pe":true,"org.pe":true,"com.pe":true,"net.pe":true,"pf":true,"com.pf":true,"org.pf":true,"edu.pf":true,"*.pg":true,"ph":true,"com.ph":true,"net.ph":true,"org.ph":true,"gov.ph":true,"edu.ph":true,"ngo.ph":true,"mil.ph":true,"i.ph":true,"pk":true,"com.pk":true,"net.pk":true,"edu.pk":true,"org.pk":true,"fam.pk":true,"biz.pk":true,"web.pk":true,"gov.pk":true,"gob.pk":true,"gok.pk":true,"gon.pk":true,"gop.pk":true,"gos.pk":true,"info.pk":true,"pl":true,"com.pl":true,"net.pl":true,"org.pl":true,"aid.pl":true,"agro.pl":true,"atm.pl":true,"auto.pl":true,"biz.pl":true,"edu.pl":true,"gmina.pl":true,"gsm.pl":true,"info.pl":true,"mail.pl":true,"miasta.pl":true,"media.pl":true,"mil.pl":true,"nieruchomosci.pl":true,"nom.pl":true,"pc.pl":true,"powiat.pl":true,"priv.pl":true,"realestate.pl":true,"rel.pl":true,"sex.pl":true,"shop.pl":true,"sklep.pl":true,"sos.pl":true,"szkola.pl":true,"targi.pl":true,"tm.pl":true,"tourism.pl":true,"travel.pl":true,"turystyka.pl":true,"gov.pl":true,"ap.gov.pl":true,"ic.gov.pl":true,"is.gov.pl":true,"us.gov.pl":true,"kmpsp.gov.pl":true,"kppsp.gov.pl":true,"kwpsp.gov.pl":true,"psp.gov.pl":true,"wskr.gov.pl":true,"kwp.gov.pl":true,"mw.gov.pl":true,"ug.gov.pl":true,"um.gov.pl":true,"umig.gov.pl":true,"ugim.gov.pl":true,"upow.gov.pl":true,"uw.gov.pl":true,"starostwo.gov.pl":true,"pa.gov.pl":true,"po.gov.pl":true,"psse.gov.pl":true,"pup.gov.pl":true,"rzgw.gov.pl":true,"sa.gov.pl":true,"so.gov.pl":true,"sr.gov.pl":true,"wsa.gov.pl":true,"sko.gov.pl":true,"uzs.gov.pl":true,"wiih.gov.pl":true,"winb.gov.pl":true,"pinb.gov.pl":true,"wios.gov.pl":true,"witd.gov.pl":true,"wzmiuw.gov.pl":true,"piw.gov.pl":true,"wiw.gov.pl":true,"griw.gov.pl":true,"wif.gov.pl":true,"oum.gov.pl":true,"sdn.gov.pl":true,"zp.gov.pl":true,"uppo.gov.pl":true,"mup.gov.pl":true,"wuoz.gov.pl":true,"konsulat.gov.pl":true,"oirm.gov.pl":true,"augustow.pl":true,"babia-gora.pl":true,"bedzin.pl":true,"beskidy.pl":true,"bialowieza.pl":true,"bialystok.pl":true,"bielawa.pl":true,"bieszczady.pl":true,"boleslawiec.pl":true,"bydgoszcz.pl":true,"bytom.pl":true,"cieszyn.pl":true,"czeladz.pl":true,"czest.pl":true,"dlugoleka.pl":true,"elblag.pl":true,"elk.pl":true,"glogow.pl":true,"gniezno.pl":true,"gorlice.pl":true,"grajewo.pl":true,"ilawa.pl":true,"jaworzno.pl":true,"jelenia-gora.pl":true,"jgora.pl":true,"kalisz.pl":true,"kazimierz-dolny.pl":true,"karpacz.pl":true,"kartuzy.pl":true,"kaszuby.pl":true,"katowice.pl":true,"kepno.pl":true,"ketrzyn.pl":true,"klodzko.pl":true,"kobierzyce.pl":true,"kolobrzeg.pl":true,"konin.pl":true,"konskowola.pl":true,"kutno.pl":true,"lapy.pl":true,"lebork.pl":true,"legnica.pl":true,"lezajsk.pl":true,"limanowa.pl":true,"lomza.pl":true,"lowicz.pl":true,"lubin.pl":true,"lukow.pl":true,"malbork.pl":true,"malopolska.pl":true,"mazowsze.pl":true,"mazury.pl":true,"mielec.pl":true,"mielno.pl":true,"mragowo.pl":true,"naklo.pl":true,"nowaruda.pl":true,"nysa.pl":true,"olawa.pl":true,"olecko.pl":true,"olkusz.pl":true,"olsztyn.pl":true,"opoczno.pl":true,"opole.pl":true,"ostroda.pl":true,"ostroleka.pl":true,"ostrowiec.pl":true,"ostrowwlkp.pl":true,"pila.pl":true,"pisz.pl":true,"podhale.pl":true,"podlasie.pl":true,"polkowice.pl":true,"pomorze.pl":true,"pomorskie.pl":true,"prochowice.pl":true,"pruszkow.pl":true,"przeworsk.pl":true,"pulawy.pl":true,"radom.pl":true,"rawa-maz.pl":true,"rybnik.pl":true,"rzeszow.pl":true,"sanok.pl":true,"sejny.pl":true,"slask.pl":true,"slupsk.pl":true,"sosnowiec.pl":true,"stalowa-wola.pl":true,"skoczow.pl":true,"starachowice.pl":true,"stargard.pl":true,"suwalki.pl":true,"swidnica.pl":true,"swiebodzin.pl":true,"swinoujscie.pl":true,"szczecin.pl":true,"szczytno.pl":true,"tarnobrzeg.pl":true,"tgory.pl":true,"turek.pl":true,"tychy.pl":true,"ustka.pl":true,"walbrzych.pl":true,"warmia.pl":true,"warszawa.pl":true,"waw.pl":true,"wegrow.pl":true,"wielun.pl":true,"wlocl.pl":true,"wloclawek.pl":true,"wodzislaw.pl":true,"wolomin.pl":true,"wroclaw.pl":true,"zachpomor.pl":true,"zagan.pl":true,"zarow.pl":true,"zgora.pl":true,"zgorzelec.pl":true,"pm":true,"pn":true,"gov.pn":true,"co.pn":true,"org.pn":true,"edu.pn":true,"net.pn":true,"post":true,"pr":true,"com.pr":true,"net.pr":true,"org.pr":true,"gov.pr":true,"edu.pr":true,"isla.pr":true,"pro.pr":true,"biz.pr":true,"info.pr":true,"name.pr":true,"est.pr":true,"prof.pr":true,"ac.pr":true,"pro":true,"aca.pro":true,"bar.pro":true,"cpa.pro":true,"jur.pro":true,"law.pro":true,"med.pro":true,"eng.pro":true,"ps":true,"edu.ps":true,"gov.ps":true,"sec.ps":true,"plo.ps":true,"com.ps":true,"org.ps":true,"net.ps":true,"pt":true,"net.pt":true,"gov.pt":true,"org.pt":true,"edu.pt":true,"int.pt":true,"publ.pt":true,"com.pt":true,"nome.pt":true,"pw":true,"co.pw":true,"ne.pw":true,"or.pw":true,"ed.pw":true,"go.pw":true,"belau.pw":true,"py":true,"com.py":true,"coop.py":true,"edu.py":true,"gov.py":true,"mil.py":true,"net.py":true,"org.py":true,"qa":true,"com.qa":true,"edu.qa":true,"gov.qa":true,"mil.qa":true,"name.qa":true,"net.qa":true,"org.qa":true,"sch.qa":true,"re":true,"com.re":true,"asso.re":true,"nom.re":true,"ro":true,"com.ro":true,"org.ro":true,"tm.ro":true,"nt.ro":true,"nom.ro":true,"info.ro":true,"rec.ro":true,"arts.ro":true,"firm.ro":true,"store.ro":true,"www.ro":true,"rs":true,"co.rs":true,"org.rs":true,"edu.rs":true,"ac.rs":true,"gov.rs":true,"in.rs":true,"ru":true,"ac.ru":true,"com.ru":true,"edu.ru":true,"int.ru":true,"net.ru":true,"org.ru":true,"pp.ru":true,"adygeya.ru":true,"altai.ru":true,"amur.ru":true,"arkhangelsk.ru":true,"astrakhan.ru":true,"bashkiria.ru":true,"belgorod.ru":true,"bir.ru":true,"bryansk.ru":true,"buryatia.ru":true,"cbg.ru":true,"chel.ru":true,"chelyabinsk.ru":true,"chita.ru":true,"chukotka.ru":true,"chuvashia.ru":true,"dagestan.ru":true,"dudinka.ru":true,"e-burg.ru":true,"grozny.ru":true,"irkutsk.ru":true,"ivanovo.ru":true,"izhevsk.ru":true,"jar.ru":true,"joshkar-ola.ru":true,"kalmykia.ru":true,"kaluga.ru":true,"kamchatka.ru":true,"karelia.ru":true,"kazan.ru":true,"kchr.ru":true,"kemerovo.ru":true,"khabarovsk.ru":true,"khakassia.ru":true,"khv.ru":true,"kirov.ru":true,"koenig.ru":true,"komi.ru":true,"kostroma.ru":true,"krasnoyarsk.ru":true,"kuban.ru":true,"kurgan.ru":true,"kursk.ru":true,"lipetsk.ru":true,"magadan.ru":true,"mari.ru":true,"mari-el.ru":true,"marine.ru":true,"mordovia.ru":true,"msk.ru":true,"murmansk.ru":true,"nalchik.ru":true,"nnov.ru":true,"nov.ru":true,"novosibirsk.ru":true,"nsk.ru":true,"omsk.ru":true,"orenburg.ru":true,"oryol.ru":true,"palana.ru":true,"penza.ru":true,"perm.ru":true,"ptz.ru":true,"rnd.ru":true,"ryazan.ru":true,"sakhalin.ru":true,"samara.ru":true,"saratov.ru":true,"simbirsk.ru":true,"smolensk.ru":true,"spb.ru":true,"stavropol.ru":true,"stv.ru":true,"surgut.ru":true,"tambov.ru":true,"tatarstan.ru":true,"tom.ru":true,"tomsk.ru":true,"tsaritsyn.ru":true,"tsk.ru":true,"tula.ru":true,"tuva.ru":true,"tver.ru":true,"tyumen.ru":true,"udm.ru":true,"udmurtia.ru":true,"ulan-ude.ru":true,"vladikavkaz.ru":true,"vladimir.ru":true,"vladivostok.ru":true,"volgograd.ru":true,"vologda.ru":true,"voronezh.ru":true,"vrn.ru":true,"vyatka.ru":true,"yakutia.ru":true,"yamal.ru":true,"yaroslavl.ru":true,"yekaterinburg.ru":true,"yuzhno-sakhalinsk.ru":true,"amursk.ru":true,"baikal.ru":true,"cmw.ru":true,"fareast.ru":true,"jamal.ru":true,"kms.ru":true,"k-uralsk.ru":true,"kustanai.ru":true,"kuzbass.ru":true,"magnitka.ru":true,"mytis.ru":true,"nakhodka.ru":true,"nkz.ru":true,"norilsk.ru":true,"oskol.ru":true,"pyatigorsk.ru":true,"rubtsovsk.ru":true,"snz.ru":true,"syzran.ru":true,"vdonsk.ru":true,"zgrad.ru":true,"gov.ru":true,"mil.ru":true,"test.ru":true,"rw":true,"gov.rw":true,"net.rw":true,"edu.rw":true,"ac.rw":true,"com.rw":true,"co.rw":true,"int.rw":true,"mil.rw":true,"gouv.rw":true,"sa":true,"com.sa":true,"net.sa":true,"org.sa":true,"gov.sa":true,"med.sa":true,"pub.sa":true,"edu.sa":true,"sch.sa":true,"sb":true,"com.sb":true,"edu.sb":true,"gov.sb":true,"net.sb":true,"org.sb":true,"sc":true,"com.sc":true,"gov.sc":true,"net.sc":true,"org.sc":true,"edu.sc":true,"sd":true,"com.sd":true,"net.sd":true,"org.sd":true,"edu.sd":true,"med.sd":true,"tv.sd":true,"gov.sd":true,"info.sd":true,"se":true,"a.se":true,"ac.se":true,"b.se":true,"bd.se":true,"brand.se":true,"c.se":true,"d.se":true,"e.se":true,"f.se":true,"fh.se":true,"fhsk.se":true,"fhv.se":true,"g.se":true,"h.se":true,"i.se":true,"k.se":true,"komforb.se":true,"kommunalforbund.se":true,"komvux.se":true,"l.se":true,"lanbib.se":true,"m.se":true,"n.se":true,"naturbruksgymn.se":true,"o.se":true,"org.se":true,"p.se":true,"parti.se":true,"pp.se":true,"press.se":true,"r.se":true,"s.se":true,"t.se":true,"tm.se":true,"u.se":true,"w.se":true,"x.se":true,"y.se":true,"z.se":true,"sg":true,"com.sg":true,"net.sg":true,"org.sg":true,"gov.sg":true,"edu.sg":true,"per.sg":true,"sh":true,"com.sh":true,"net.sh":true,"gov.sh":true,"org.sh":true,"mil.sh":true,"si":true,"sj":true,"sk":true,"sl":true,"com.sl":true,"net.sl":true,"edu.sl":true,"gov.sl":true,"org.sl":true,"sm":true,"sn":true,"art.sn":true,"com.sn":true,"edu.sn":true,"gouv.sn":true,"org.sn":true,"perso.sn":true,"univ.sn":true,"so":true,"com.so":true,"net.so":true,"org.so":true,"sr":true,"st":true,"co.st":true,"com.st":true,"consulado.st":true,"edu.st":true,"embaixada.st":true,"gov.st":true,"mil.st":true,"net.st":true,"org.st":true,"principe.st":true,"saotome.st":true,"store.st":true,"su":true,"adygeya.su":true,"arkhangelsk.su":true,"balashov.su":true,"bashkiria.su":true,"bryansk.su":true,"dagestan.su":true,"grozny.su":true,"ivanovo.su":true,"kalmykia.su":true,"kaluga.su":true,"karelia.su":true,"khakassia.su":true,"krasnodar.su":true,"kurgan.su":true,"lenug.su":true,"mordovia.su":true,"msk.su":true,"murmansk.su":true,"nalchik.su":true,"nov.su":true,"obninsk.su":true,"penza.su":true,"pokrovsk.su":true,"sochi.su":true,"spb.su":true,"togliatti.su":true,"troitsk.su":true,"tula.su":true,"tuva.su":true,"vladikavkaz.su":true,"vladimir.su":true,"vologda.su":true,"sv":true,"com.sv":true,"edu.sv":true,"gob.sv":true,"org.sv":true,"red.sv":true,"sx":true,"gov.sx":true,"sy":true,"edu.sy":true,"gov.sy":true,"net.sy":true,"mil.sy":true,"com.sy":true,"org.sy":true,"sz":true,"co.sz":true,"ac.sz":true,"org.sz":true,"tc":true,"td":true,"tel":true,"tf":true,"tg":true,"th":true,"ac.th":true,"co.th":true,"go.th":true,"in.th":true,"mi.th":true,"net.th":true,"or.th":true,"tj":true,"ac.tj":true,"biz.tj":true,"co.tj":true,"com.tj":true,"edu.tj":true,"go.tj":true,"gov.tj":true,"int.tj":true,"mil.tj":true,"name.tj":true,"net.tj":true,"nic.tj":true,"org.tj":true,"test.tj":true,"web.tj":true,"tk":true,"tl":true,"gov.tl":true,"tm":true,"com.tm":true,"co.tm":true,"org.tm":true,"net.tm":true,"nom.tm":true,"gov.tm":true,"mil.tm":true,"edu.tm":true,"tn":true,"com.tn":true,"ens.tn":true,"fin.tn":true,"gov.tn":true,"ind.tn":true,"intl.tn":true,"nat.tn":true,"net.tn":true,"org.tn":true,"info.tn":true,"perso.tn":true,"tourism.tn":true,"edunet.tn":true,"rnrt.tn":true,"rns.tn":true,"rnu.tn":true,"mincom.tn":true,"agrinet.tn":true,"defense.tn":true,"turen.tn":true,"to":true,"com.to":true,"gov.to":true,"net.to":true,"org.to":true,"edu.to":true,"mil.to":true,"tp":true,"tr":true,"com.tr":true,"info.tr":true,"biz.tr":true,"net.tr":true,"org.tr":true,"web.tr":true,"gen.tr":true,"tv.tr":true,"av.tr":true,"dr.tr":true,"bbs.tr":true,"name.tr":true,"tel.tr":true,"gov.tr":true,"bel.tr":true,"pol.tr":true,"mil.tr":true,"k12.tr":true,"edu.tr":true,"kep.tr":true,"nc.tr":true,"gov.nc.tr":true,"travel":true,"tt":true,"co.tt":true,"com.tt":true,"org.tt":true,"net.tt":true,"biz.tt":true,"info.tt":true,"pro.tt":true,"int.tt":true,"coop.tt":true,"jobs.tt":true,"mobi.tt":true,"travel.tt":true,"museum.tt":true,"aero.tt":true,"name.tt":true,"gov.tt":true,"edu.tt":true,"tv":true,"tw":true,"edu.tw":true,"gov.tw":true,"mil.tw":true,"com.tw":true,"net.tw":true,"org.tw":true,"idv.tw":true,"game.tw":true,"ebiz.tw":true,"club.tw":true,"xn--zf0ao64a.tw":true,"xn--uc0atv.tw":true,"xn--czrw28b.tw":true,"tz":true,"ac.tz":true,"co.tz":true,"go.tz":true,"hotel.tz":true,"info.tz":true,"me.tz":true,"mil.tz":true,"mobi.tz":true,"ne.tz":true,"or.tz":true,"sc.tz":true,"tv.tz":true,"ua":true,"com.ua":true,"edu.ua":true,"gov.ua":true,"in.ua":true,"net.ua":true,"org.ua":true,"cherkassy.ua":true,"cherkasy.ua":true,"chernigov.ua":true,"chernihiv.ua":true,"chernivtsi.ua":true,"chernovtsy.ua":true,"ck.ua":true,"cn.ua":true,"cr.ua":true,"crimea.ua":true,"cv.ua":true,"dn.ua":true,"dnepropetrovsk.ua":true,"dnipropetrovsk.ua":true,"dominic.ua":true,"donetsk.ua":true,"dp.ua":true,"if.ua":true,"ivano-frankivsk.ua":true,"kh.ua":true,"kharkiv.ua":true,"kharkov.ua":true,"kherson.ua":true,"khmelnitskiy.ua":true,"khmelnytskyi.ua":true,"kiev.ua":true,"kirovograd.ua":true,"km.ua":true,"kr.ua":true,"krym.ua":true,"ks.ua":true,"kv.ua":true,"kyiv.ua":true,"lg.ua":true,"lt.ua":true,"lugansk.ua":true,"lutsk.ua":true,"lv.ua":true,"lviv.ua":true,"mk.ua":true,"mykolaiv.ua":true,"nikolaev.ua":true,"od.ua":true,"odesa.ua":true,"odessa.ua":true,"pl.ua":true,"poltava.ua":true,"rivne.ua":true,"rovno.ua":true,"rv.ua":true,"sb.ua":true,"sebastopol.ua":true,"sevastopol.ua":true,"sm.ua":true,"sumy.ua":true,"te.ua":true,"ternopil.ua":true,"uz.ua":true,"uzhgorod.ua":true,"vinnica.ua":true,"vinnytsia.ua":true,"vn.ua":true,"volyn.ua":true,"yalta.ua":true,"zaporizhzhe.ua":true,"zaporizhzhia.ua":true,"zhitomir.ua":true,"zhytomyr.ua":true,"zp.ua":true,"zt.ua":true,"ug":true,"co.ug":true,"or.ug":true,"ac.ug":true,"sc.ug":true,"go.ug":true,"ne.ug":true,"com.ug":true,"org.ug":true,"uk":true,"ac.uk":true,"co.uk":true,"gov.uk":true,"ltd.uk":true,"me.uk":true,"net.uk":true,"nhs.uk":true,"org.uk":true,"plc.uk":true,"police.uk":true,"*.sch.uk":true,"us":true,"dni.us":true,"fed.us":true,"isa.us":true,"kids.us":true,"nsn.us":true,"ak.us":true,"al.us":true,"ar.us":true,"as.us":true,"az.us":true,"ca.us":true,"co.us":true,"ct.us":true,"dc.us":true,"de.us":true,"fl.us":true,"ga.us":true,"gu.us":true,"hi.us":true,"ia.us":true,"id.us":true,"il.us":true,"in.us":true,"ks.us":true,"ky.us":true,"la.us":true,"ma.us":true,"md.us":true,"me.us":true,"mi.us":true,"mn.us":true,"mo.us":true,"ms.us":true,"mt.us":true,"nc.us":true,"nd.us":true,"ne.us":true,"nh.us":true,"nj.us":true,"nm.us":true,"nv.us":true,"ny.us":true,"oh.us":true,"ok.us":true,"or.us":true,"pa.us":true,"pr.us":true,"ri.us":true,"sc.us":true,"sd.us":true,"tn.us":true,"tx.us":true,"ut.us":true,"vi.us":true,"vt.us":true,"va.us":true,"wa.us":true,"wi.us":true,"wv.us":true,"wy.us":true,"k12.ak.us":true,"k12.al.us":true,"k12.ar.us":true,"k12.as.us":true,"k12.az.us":true,"k12.ca.us":true,"k12.co.us":true,"k12.ct.us":true,"k12.dc.us":true,"k12.de.us":true,"k12.fl.us":true,"k12.ga.us":true,"k12.gu.us":true,"k12.ia.us":true,"k12.id.us":true,"k12.il.us":true,"k12.in.us":true,"k12.ks.us":true,"k12.ky.us":true,"k12.la.us":true,"k12.ma.us":true,"k12.md.us":true,"k12.me.us":true,"k12.mi.us":true,"k12.mn.us":true,"k12.mo.us":true,"k12.ms.us":true,"k12.mt.us":true,"k12.nc.us":true,"k12.ne.us":true,"k12.nh.us":true,"k12.nj.us":true,"k12.nm.us":true,"k12.nv.us":true,"k12.ny.us":true,"k12.oh.us":true,"k12.ok.us":true,"k12.or.us":true,"k12.pa.us":true,"k12.pr.us":true,"k12.ri.us":true,"k12.sc.us":true,"k12.tn.us":true,"k12.tx.us":true,"k12.ut.us":true,"k12.vi.us":true,"k12.vt.us":true,"k12.va.us":true,"k12.wa.us":true,"k12.wi.us":true,"k12.wy.us":true,"cc.ak.us":true,"cc.al.us":true,"cc.ar.us":true,"cc.as.us":true,"cc.az.us":true,"cc.ca.us":true,"cc.co.us":true,"cc.ct.us":true,"cc.dc.us":true,"cc.de.us":true,"cc.fl.us":true,"cc.ga.us":true,"cc.gu.us":true,"cc.hi.us":true,"cc.ia.us":true,"cc.id.us":true,"cc.il.us":true,"cc.in.us":true,"cc.ks.us":true,"cc.ky.us":true,"cc.la.us":true,"cc.ma.us":true,"cc.md.us":true,"cc.me.us":true,"cc.mi.us":true,"cc.mn.us":true,"cc.mo.us":true,"cc.ms.us":true,"cc.mt.us":true,"cc.nc.us":true,"cc.nd.us":true,"cc.ne.us":true,"cc.nh.us":true,"cc.nj.us":true,"cc.nm.us":true,"cc.nv.us":true,"cc.ny.us":true,"cc.oh.us":true,"cc.ok.us":true,"cc.or.us":true,"cc.pa.us":true,"cc.pr.us":true,"cc.ri.us":true,"cc.sc.us":true,"cc.sd.us":true,"cc.tn.us":true,"cc.tx.us":true,"cc.ut.us":true,"cc.vi.us":true,"cc.vt.us":true,"cc.va.us":true,"cc.wa.us":true,"cc.wi.us":true,"cc.wv.us":true,"cc.wy.us":true,"lib.ak.us":true,"lib.al.us":true,"lib.ar.us":true,"lib.as.us":true,"lib.az.us":true,"lib.ca.us":true,"lib.co.us":true,"lib.ct.us":true,"lib.dc.us":true,"lib.de.us":true,"lib.fl.us":true,"lib.ga.us":true,"lib.gu.us":true,"lib.hi.us":true,"lib.ia.us":true,"lib.id.us":true,"lib.il.us":true,"lib.in.us":true,"lib.ks.us":true,"lib.ky.us":true,"lib.la.us":true,"lib.ma.us":true,"lib.md.us":true,"lib.me.us":true,"lib.mi.us":true,"lib.mn.us":true,"lib.mo.us":true,"lib.ms.us":true,"lib.mt.us":true,"lib.nc.us":true,"lib.nd.us":true,"lib.ne.us":true,"lib.nh.us":true,"lib.nj.us":true,"lib.nm.us":true,"lib.nv.us":true,"lib.ny.us":true,"lib.oh.us":true,"lib.ok.us":true,"lib.or.us":true,"lib.pa.us":true,"lib.pr.us":true,"lib.ri.us":true,"lib.sc.us":true,"lib.sd.us":true,"lib.tn.us":true,"lib.tx.us":true,"lib.ut.us":true,"lib.vi.us":true,"lib.vt.us":true,"lib.va.us":true,"lib.wa.us":true,"lib.wi.us":true,"lib.wy.us":true,"pvt.k12.ma.us":true,"chtr.k12.ma.us":true,"paroch.k12.ma.us":true,"uy":true,"com.uy":true,"edu.uy":true,"gub.uy":true,"mil.uy":true,"net.uy":true,"org.uy":true,"uz":true,"co.uz":true,"com.uz":true,"net.uz":true,"org.uz":true,"va":true,"vc":true,"com.vc":true,"net.vc":true,"org.vc":true,"gov.vc":true,"mil.vc":true,"edu.vc":true,"ve":true,"arts.ve":true,"co.ve":true,"com.ve":true,"e12.ve":true,"edu.ve":true,"firm.ve":true,"gob.ve":true,"gov.ve":true,"info.ve":true,"int.ve":true,"mil.ve":true,"net.ve":true,"org.ve":true,"rec.ve":true,"store.ve":true,"tec.ve":true,"web.ve":true,"vg":true,"vi":true,"co.vi":true,"com.vi":true,"k12.vi":true,"net.vi":true,"org.vi":true,"vn":true,"com.vn":true,"net.vn":true,"org.vn":true,"edu.vn":true,"gov.vn":true,"int.vn":true,"ac.vn":true,"biz.vn":true,"info.vn":true,"name.vn":true,"pro.vn":true,"health.vn":true,"vu":true,"com.vu":true,"edu.vu":true,"net.vu":true,"org.vu":true,"wf":true,"ws":true,"com.ws":true,"net.ws":true,"org.ws":true,"gov.ws":true,"edu.ws":true,"yt":true,"xn--mgbaam7a8h":true,"xn--y9a3aq":true,"xn--54b7fta0cc":true,"xn--90ais":true,"xn--fiqs8s":true,"xn--fiqz9s":true,"xn--lgbbat1ad8j":true,"xn--wgbh1c":true,"xn--node":true,"xn--qxam":true,"xn--j6w193g":true,"xn--h2brj9c":true,"xn--mgbbh1a71e":true,"xn--fpcrj9c3d":true,"xn--gecrj9c":true,"xn--s9brj9c":true,"xn--45brj9c":true,"xn--xkc2dl3a5ee0h":true,"xn--mgba3a4f16a":true,"xn--mgba3a4fra":true,"xn--mgbtx2b":true,"xn--mgbayh7gpa":true,"xn--3e0b707e":true,"xn--80ao21a":true,"xn--fzc2c9e2c":true,"xn--xkc2al3hye2a":true,"xn--mgbc0a9azcg":true,"xn--d1alf":true,"xn--l1acc":true,"xn--mix891f":true,"xn--mix082f":true,"xn--mgbx4cd0ab":true,"xn--mgb9awbf":true,"xn--mgbai9azgqp6j":true,"xn--mgbai9a5eva00b":true,"xn--ygbi2ammx":true,"xn--90a3ac":true,"xn--o1ac.xn--90a3ac":true,"xn--c1avg.xn--90a3ac":true,"xn--90azh.xn--90a3ac":true,"xn--d1at.xn--90a3ac":true,"xn--o1ach.xn--90a3ac":true,"xn--80au.xn--90a3ac":true,"xn--p1ai":true,"xn--wgbl6a":true,"xn--mgberp4a5d4ar":true,"xn--mgberp4a5d4a87g":true,"xn--mgbqly7c0a67fbc":true,"xn--mgbqly7cvafr":true,"xn--mgbpl2fh":true,"xn--yfro4i67o":true,"xn--clchc0ea0b2g2a9gcd":true,"xn--ogbpf8fl":true,"xn--mgbtf8fl":true,"xn--o3cw4h":true,"xn--pgbs0dh":true,"xn--kpry57d":true,"xn--kprw13d":true,"xn--nnx388a":true,"xn--j1amh":true,"xn--mgb2ddes":true,"xxx":true,"*.ye":true,"ac.za":true,"agrica.za":true,"alt.za":true,"co.za":true,"edu.za":true,"gov.za":true,"grondar.za":true,"law.za":true,"mil.za":true,"net.za":true,"ngo.za":true,"nis.za":true,"nom.za":true,"org.za":true,"school.za":true,"tm.za":true,"web.za":true,"*.zm":true,"*.zw":true,"aaa":true,"aarp":true,"abarth":true,"abb":true,"abbott":true,"abbvie":true,"abc":true,"able":true,"abogado":true,"abudhabi":true,"academy":true,"accenture":true,"accountant":true,"accountants":true,"aco":true,"active":true,"actor":true,"adac":true,"ads":true,"adult":true,"aeg":true,"aetna":true,"afamilycompany":true,"afl":true,"africa":true,"africamagic":true,"agakhan":true,"agency":true,"aig":true,"aigo":true,"airbus":true,"airforce":true,"airtel":true,"akdn":true,"alfaromeo":true,"alibaba":true,"alipay":true,"allfinanz":true,"allstate":true,"ally":true,"alsace":true,"alstom":true,"americanexpress":true,"americanfamily":true,"amex":true,"amfam":true,"amica":true,"amsterdam":true,"analytics":true,"android":true,"anquan":true,"anz":true,"aol":true,"apartments":true,"app":true,"apple":true,"aquarelle":true,"aramco":true,"archi":true,"army":true,"arte":true,"asda":true,"associates":true,"athleta":true,"attorney":true,"auction":true,"audi":true,"audible":true,"audio":true,"auspost":true,"author":true,"auto":true,"autos":true,"avianca":true,"aws":true,"axa":true,"azure":true,"baby":true,"baidu":true,"banamex":true,"bananarepublic":true,"band":true,"bank":true,"bar":true,"barcelona":true,"barclaycard":true,"barclays":true,"barefoot":true,"bargains":true,"basketball":true,"bauhaus":true,"bayern":true,"bbc":true,"bbt":true,"bbva":true,"bcg":true,"bcn":true,"beats":true,"beer":true,"bentley":true,"berlin":true,"best":true,"bestbuy":true,"bet":true,"bharti":true,"bible":true,"bid":true,"bike":true,"bing":true,"bingo":true,"bio":true,"black":true,"blackfriday":true,"blanco":true,"blockbuster":true,"blog":true,"bloomberg":true,"blue":true,"bms":true,"bmw":true,"bnl":true,"bnpparibas":true,"boats":true,"boehringer":true,"bofa":true,"bom":true,"bond":true,"boo":true,"book":true,"booking":true,"boots":true,"bosch":true,"bostik":true,"bot":true,"boutique":true,"bradesco":true,"bridgestone":true,"broadway":true,"broker":true,"brother":true,"brussels":true,"budapest":true,"bugatti":true,"build":true,"builders":true,"business":true,"buy":true,"buzz":true,"bzh":true,"cab":true,"cafe":true,"cal":true,"call":true,"calvinklein":true,"camera":true,"camp":true,"cancerresearch":true,"canon":true,"capetown":true,"capital":true,"capitalone":true,"car":true,"caravan":true,"cards":true,"care":true,"career":true,"careers":true,"cars":true,"cartier":true,"casa":true,"case":true,"caseih":true,"cash":true,"casino":true,"catering":true,"cba":true,"cbn":true,"cbre":true,"cbs":true,"ceb":true,"center":true,"ceo":true,"cern":true,"cfa":true,"cfd":true,"chanel":true,"channel":true,"chase":true,"chat":true,"cheap":true,"chintai":true,"chloe":true,"christmas":true,"chrome":true,"chrysler":true,"church":true,"cipriani":true,"circle":true,"cisco":true,"citadel":true,"citi":true,"citic":true,"city":true,"cityeats":true,"claims":true,"cleaning":true,"click":true,"clinic":true,"clothing":true,"cloud":true,"club":true,"clubmed":true,"coach":true,"codes":true,"coffee":true,"college":true,"cologne":true,"comcast":true,"commbank":true,"community":true,"company":true,"computer":true,"comsec":true,"condos":true,"construction":true,"consulting":true,"contact":true,"contractors":true,"cooking":true,"cookingchannel":true,"cool":true,"corsica":true,"country":true,"coupon":true,"coupons":true,"courses":true,"credit":true,"creditcard":true,"creditunion":true,"cricket":true,"crown":true,"crs":true,"cruises":true,"csc":true,"cuisinella":true,"cymru":true,"cyou":true,"dabur":true,"dad":true,"dance":true,"date":true,"dating":true,"datsun":true,"day":true,"dclk":true,"dds":true,"deal":true,"dealer":true,"deals":true,"degree":true,"delivery":true,"dell":true,"deloitte":true,"delta":true,"democrat":true,"dental":true,"dentist":true,"desi":true,"design":true,"dev":true,"dhl":true,"diamonds":true,"diet":true,"digital":true,"direct":true,"directory":true,"discount":true,"discover":true,"dish":true,"dnp":true,"docs":true,"dodge":true,"dog":true,"doha":true,"domains":true,"doosan":true,"dot":true,"download":true,"drive":true,"dstv":true,"dtv":true,"dubai":true,"duck":true,"dunlop":true,"duns":true,"dupont":true,"durban":true,"dvag":true,"dwg":true,"earth":true,"eat":true,"edeka":true,"education":true,"email":true,"emerck":true,"emerson":true,"energy":true,"engineer":true,"engineering":true,"enterprises":true,"epost":true,"epson":true,"equipment":true,"ericsson":true,"erni":true,"esq":true,"estate":true,"esurance":true,"etisalat":true,"eurovision":true,"eus":true,"events":true,"everbank":true,"exchange":true,"expert":true,"exposed":true,"express":true,"extraspace":true,"fage":true,"fail":true,"fairwinds":true,"faith":true,"family":true,"fan":true,"fans":true,"farm":true,"farmers":true,"fashion":true,"fast":true,"fedex":true,"feedback":true,"ferrari":true,"ferrero":true,"fiat":true,"fidelity":true,"fido":true,"film":true,"final":true,"finance":true,"financial":true,"fire":true,"firestone":true,"firmdale":true,"fish":true,"fishing":true,"fit":true,"fitness":true,"flickr":true,"flights":true,"flir":true,"florist":true,"flowers":true,"flsmidth":true,"fly":true,"foo":true,"foodnetwork":true,"football":true,"ford":true,"forex":true,"forsale":true,"forum":true,"foundation":true,"fox":true,"fresenius":true,"frl":true,"frogans":true,"frontdoor":true,"frontier":true,"ftr":true,"fujitsu":true,"fujixerox":true,"fund":true,"furniture":true,"futbol":true,"fyi":true,"gal":true,"gallery":true,"gallo":true,"gallup":true,"game":true,"games":true,"gap":true,"garden":true,"gbiz":true,"gdn":true,"gea":true,"gent":true,"genting":true,"george":true,"ggee":true,"gift":true,"gifts":true,"gives":true,"giving":true,"glade":true,"glass":true,"gle":true,"global":true,"globo":true,"gmail":true,"gmo":true,"gmx":true,"godaddy":true,"gold":true,"goldpoint":true,"golf":true,"goo":true,"goodhands":true,"goodyear":true,"goog":true,"google":true,"gop":true,"got":true,"gotv":true,"grainger":true,"graphics":true,"gratis":true,"green":true,"gripe":true,"group":true,"guardian":true,"gucci":true,"guge":true,"guide":true,"guitars":true,"guru":true,"hamburg":true,"hangout":true,"haus":true,"hbo":true,"hdfc":true,"hdfcbank":true,"health":true,"healthcare":true,"help":true,"helsinki":true,"here":true,"hermes":true,"hgtv":true,"hiphop":true,"hisamitsu":true,"hitachi":true,"hiv":true,"hkt":true,"hockey":true,"holdings":true,"holiday":true,"homedepot":true,"homegoods":true,"homes":true,"homesense":true,"honda":true,"honeywell":true,"horse":true,"host":true,"hosting":true,"hot":true,"hoteles":true,"hotmail":true,"house":true,"how":true,"hsbc":true,"htc":true,"hughes":true,"hyatt":true,"hyundai":true,"ibm":true,"icbc":true,"ice":true,"icu":true,"ieee":true,"ifm":true,"iinet":true,"ikano":true,"imamat":true,"imdb":true,"immo":true,"immobilien":true,"industries":true,"infiniti":true,"ing":true,"ink":true,"institute":true,"insurance":true,"insure":true,"intel":true,"international":true,"intuit":true,"investments":true,"ipiranga":true,"irish":true,"iselect":true,"ismaili":true,"ist":true,"istanbul":true,"itau":true,"itv":true,"iveco":true,"iwc":true,"jaguar":true,"java":true,"jcb":true,"jcp":true,"jeep":true,"jetzt":true,"jewelry":true,"jio":true,"jlc":true,"jll":true,"jmp":true,"jnj":true,"joburg":true,"jot":true,"joy":true,"jpmorgan":true,"jprs":true,"juegos":true,"juniper":true,"kaufen":true,"kddi":true,"kerryhotels":true,"kerrylogistics":true,"kerryproperties":true,"kfh":true,"kia":true,"kim":true,"kinder":true,"kindle":true,"kitchen":true,"kiwi":true,"koeln":true,"komatsu":true,"kosher":true,"kpmg":true,"kpn":true,"krd":true,"kred":true,"kuokgroup":true,"kyknet":true,"kyoto":true,"lacaixa":true,"ladbrokes":true,"lamborghini":true,"lancaster":true,"lancia":true,"lancome":true,"land":true,"landrover":true,"lanxess":true,"lasalle":true,"lat":true,"latino":true,"latrobe":true,"law":true,"lawyer":true,"lds":true,"lease":true,"leclerc":true,"lefrak":true,"legal":true,"lego":true,"lexus":true,"lgbt":true,"liaison":true,"lidl":true,"life":true,"lifeinsurance":true,"lifestyle":true,"lighting":true,"like":true,"lilly":true,"limited":true,"limo":true,"lincoln":true,"linde":true,"link":true,"lipsy":true,"live":true,"living":true,"lixil":true,"loan":true,"loans":true,"locker":true,"locus":true,"loft":true,"lol":true,"london":true,"lotte":true,"lotto":true,"love":true,"lpl":true,"lplfinancial":true,"ltd":true,"ltda":true,"lundbeck":true,"lupin":true,"luxe":true,"luxury":true,"macys":true,"madrid":true,"maif":true,"maison":true,"makeup":true,"man":true,"management":true,"mango":true,"market":true,"marketing":true,"markets":true,"marriott":true,"marshalls":true,"maserati":true,"mattel":true,"mba":true,"mcd":true,"mcdonalds":true,"mckinsey":true,"med":true,"media":true,"meet":true,"melbourne":true,"meme":true,"memorial":true,"men":true,"menu":true,"meo":true,"metlife":true,"miami":true,"microsoft":true,"mini":true,"mint":true,"mit":true,"mitsubishi":true,"mlb":true,"mls":true,"mma":true,"mnet":true,"mobily":true,"moda":true,"moe":true,"moi":true,"mom":true,"monash":true,"money":true,"monster":true,"montblanc":true,"mopar":true,"mormon":true,"mortgage":true,"moscow":true,"moto":true,"motorcycles":true,"mov":true,"movie":true,"movistar":true,"msd":true,"mtn":true,"mtpc":true,"mtr":true,"multichoice":true,"mutual":true,"mutuelle":true,"mzansimagic":true,"nab":true,"nadex":true,"nagoya":true,"naspers":true,"nationwide":true,"natura":true,"navy":true,"nba":true,"nec":true,"netbank":true,"netflix":true,"network":true,"neustar":true,"new":true,"newholland":true,"news":true,"next":true,"nextdirect":true,"nexus":true,"nfl":true,"ngo":true,"nhk":true,"nico":true,"nike":true,"nikon":true,"ninja":true,"nissan":true,"nokia":true,"northwesternmutual":true,"norton":true,"now":true,"nowruz":true,"nowtv":true,"nra":true,"nrw":true,"ntt":true,"nyc":true,"obi":true,"observer":true,"off":true,"office":true,"okinawa":true,"olayan":true,"olayangroup":true,"oldnavy":true,"ollo":true,"omega":true,"one":true,"ong":true,"onl":true,"online":true,"onyourside":true,"ooo":true,"open":true,"oracle":true,"orange":true,"organic":true,"orientexpress":true,"osaka":true,"otsuka":true,"ott":true,"ovh":true,"page":true,"pamperedchef":true,"panasonic":true,"panerai":true,"paris":true,"pars":true,"partners":true,"parts":true,"party":true,"passagens":true,"pay":true,"payu":true,"pccw":true,"pet":true,"pfizer":true,"pharmacy":true,"philips":true,"photo":true,"photography":true,"photos":true,"physio":true,"piaget":true,"pics":true,"pictet":true,"pictures":true,"pid":true,"pin":true,"ping":true,"pink":true,"pioneer":true,"pizza":true,"place":true,"play":true,"playstation":true,"plumbing":true,"plus":true,"pnc":true,"pohl":true,"poker":true,"politie":true,"porn":true,"pramerica":true,"praxi":true,"press":true,"prime":true,"prod":true,"productions":true,"prof":true,"progressive":true,"promo":true,"properties":true,"property":true,"protection":true,"pru":true,"prudential":true,"pub":true,"qpon":true,"quebec":true,"quest":true,"qvc":true,"racing":true,"raid":true,"read":true,"realestate":true,"realtor":true,"realty":true,"recipes":true,"red":true,"redstone":true,"redumbrella":true,"rehab":true,"reise":true,"reisen":true,"reit":true,"reliance":true,"ren":true,"rent":true,"rentals":true,"repair":true,"report":true,"republican":true,"rest":true,"restaurant":true,"review":true,"reviews":true,"rexroth":true,"rich":true,"richardli":true,"ricoh":true,"rightathome":true,"ril":true,"rio":true,"rip":true,"rocher":true,"rocks":true,"rodeo":true,"rogers":true,"room":true,"rsvp":true,"ruhr":true,"run":true,"rwe":true,"ryukyu":true,"saarland":true,"safe":true,"safety":true,"sakura":true,"sale":true,"salon":true,"samsclub":true,"samsung":true,"sandvik":true,"sandvikcoromant":true,"sanofi":true,"sap":true,"sapo":true,"sarl":true,"sas":true,"save":true,"saxo":true,"sbi":true,"sbs":true,"sca":true,"scb":true,"schaeffler":true,"schmidt":true,"scholarships":true,"school":true,"schule":true,"schwarz":true,"science":true,"scjohnson":true,"scor":true,"scot":true,"seat":true,"secure":true,"security":true,"seek":true,"sener":true,"services":true,"ses":true,"seven":true,"sew":true,"sex":true,"sexy":true,"sfr":true,"shangrila":true,"sharp":true,"shaw":true,"shell":true,"shia":true,"shiksha":true,"shoes":true,"shouji":true,"show":true,"showtime":true,"shriram":true,"silk":true,"sina":true,"singles":true,"site":true,"ski":true,"skin":true,"sky":true,"skype":true,"sling":true,"smart":true,"smile":true,"sncf":true,"soccer":true,"social":true,"softbank":true,"software":true,"sohu":true,"solar":true,"solutions":true,"song":true,"sony":true,"soy":true,"space":true,"spiegel":true,"spot":true,"spreadbetting":true,"srl":true,"srt":true,"stada":true,"staples":true,"star":true,"starhub":true,"statebank":true,"statefarm":true,"statoil":true,"stc":true,"stcgroup":true,"stockholm":true,"storage":true,"store":true,"studio":true,"study":true,"style":true,"sucks":true,"supersport":true,"supplies":true,"supply":true,"support":true,"surf":true,"surgery":true,"suzuki":true,"swatch":true,"swiftcover":true,"swiss":true,"sydney":true,"symantec":true,"systems":true,"tab":true,"taipei":true,"talk":true,"taobao":true,"target":true,"tatamotors":true,"tatar":true,"tattoo":true,"tax":true,"taxi":true,"tci":true,"tdk":true,"team":true,"tech":true,"technology":true,"telecity":true,"telefonica":true,"temasek":true,"tennis":true,"teva":true,"thd":true,"theater":true,"theatre":true,"theguardian":true,"tiaa":true,"tickets":true,"tienda":true,"tiffany":true,"tips":true,"tires":true,"tirol":true,"tjmaxx":true,"tjx":true,"tkmaxx":true,"tmall":true,"today":true,"tokyo":true,"tools":true,"top":true,"toray":true,"toshiba":true,"total":true,"tours":true,"town":true,"toyota":true,"toys":true,"trade":true,"trading":true,"training":true,"travelchannel":true,"travelers":true,"travelersinsurance":true,"trust":true,"trv":true,"tube":true,"tui":true,"tunes":true,"tushu":true,"tvs":true,"ubank":true,"ubs":true,"uconnect":true,"university":true,"uno":true,"uol":true,"ups":true,"vacations":true,"vana":true,"vanguard":true,"vegas":true,"ventures":true,"verisign":true,"versicherung":true,"vet":true,"viajes":true,"video":true,"vig":true,"viking":true,"villas":true,"vin":true,"vip":true,"virgin":true,"visa":true,"vision":true,"vista":true,"vistaprint":true,"viva":true,"vivo":true,"vlaanderen":true,"vodka":true,"volkswagen":true,"vote":true,"voting":true,"voto":true,"voyage":true,"vuelos":true,"wales":true,"walmart":true,"walter":true,"wang":true,"wanggou":true,"warman":true,"watch":true,"watches":true,"weather":true,"weatherchannel":true,"webcam":true,"weber":true,"website":true,"wed":true,"wedding":true,"weibo":true,"weir":true,"whoswho":true,"wien":true,"wiki":true,"williamhill":true,"win":true,"windows":true,"wine":true,"winners":true,"wme":true,"wolterskluwer":true,"woodside":true,"work":true,"works":true,"world":true,"wtc":true,"wtf":true,"xbox":true,"xerox":true,"xfinity":true,"xihuan":true,"xin":true,"xn--11b4c3d":true,"xn--1ck2e1b":true,"xn--1qqw23a":true,"xn--30rr7y":true,"xn--3bst00m":true,"xn--3ds443g":true,"xn--3oq18vl8pn36a":true,"xn--3pxu8k":true,"xn--42c2d9a":true,"xn--45q11c":true,"xn--4gbrim":true,"xn--4gq48lf9j":true,"xn--55qw42g":true,"xn--55qx5d":true,"xn--5su34j936bgsg":true,"xn--5tzm5g":true,"xn--6frz82g":true,"xn--6qq986b3xl":true,"xn--80adxhks":true,"xn--80asehdb":true,"xn--80aswg":true,"xn--8y0a063a":true,"xn--9dbq2a":true,"xn--9et52u":true,"xn--9krt00a":true,"xn--b4w605ferd":true,"xn--bck1b9a5dre4c":true,"xn--c1avg":true,"xn--c2br7g":true,"xn--cck2b3b":true,"xn--cg4bki":true,"xn--czr694b":true,"xn--czrs0t":true,"xn--czru2d":true,"xn--d1acj3b":true,"xn--eckvdtc9d":true,"xn--efvy88h":true,"xn--estv75g":true,"xn--fct429k":true,"xn--fhbei":true,"xn--fiq228c5hs":true,"xn--fiq64b":true,"xn--fjq720a":true,"xn--flw351e":true,"xn--fzys8d69uvgm":true,"xn--g2xx48c":true,"xn--gckr3f0f":true,"xn--hxt814e":true,"xn--i1b6b1a6a2e":true,"xn--imr513n":true,"xn--io0a7i":true,"xn--j1aef":true,"xn--jlq61u9w7b":true,"xn--jvr189m":true,"xn--kcrx77d1x4a":true,"xn--kpu716f":true,"xn--kput3i":true,"xn--mgba3a3ejt":true,"xn--mgba7c0bbn0a":true,"xn--mgbaakc7dvf":true,"xn--mgbab2bd":true,"xn--mgbb9fbpob":true,"xn--mgbca7dzdo":true,"xn--mgbt3dhd":true,"xn--mk1bu44c":true,"xn--mxtq1m":true,"xn--ngbc5azd":true,"xn--ngbe9e0a":true,"xn--nqv7f":true,"xn--nqv7fs00ema":true,"xn--nyqy26a":true,"xn--p1acf":true,"xn--pbt977c":true,"xn--pssy2u":true,"xn--q9jyb4c":true,"xn--qcka1pmc":true,"xn--rhqv96g":true,"xn--rovu88b":true,"xn--ses554g":true,"xn--t60b56a":true,"xn--tckwe":true,"xn--unup4y":true,"xn--vermgensberater-ctb":true,"xn--vermgensberatung-pwb":true,"xn--vhquv":true,"xn--vuq861b":true,"xn--w4r85el8fhu5dnra":true,"xn--w4rs40l":true,"xn--xhq521b":true,"xn--zfr164b":true,"xperia":true,"xyz":true,"yachts":true,"yahoo":true,"yamaxun":true,"yandex":true,"yodobashi":true,"yoga":true,"yokohama":true,"you":true,"youtube":true,"yun":true,"zappos":true,"zara":true,"zero":true,"zip":true,"zippo":true,"zone":true,"zuerich":true,"cloudfront.net":true,"ap-northeast-1.compute.amazonaws.com":true,"ap-southeast-1.compute.amazonaws.com":true,"ap-southeast-2.compute.amazonaws.com":true,"cn-north-1.compute.amazonaws.cn":true,"compute.amazonaws.cn":true,"compute.amazonaws.com":true,"compute-1.amazonaws.com":true,"eu-west-1.compute.amazonaws.com":true,"eu-central-1.compute.amazonaws.com":true,"sa-east-1.compute.amazonaws.com":true,"us-east-1.amazonaws.com":true,"us-gov-west-1.compute.amazonaws.com":true,"us-west-1.compute.amazonaws.com":true,"us-west-2.compute.amazonaws.com":true,"z-1.compute-1.amazonaws.com":true,"z-2.compute-1.amazonaws.com":true,"elasticbeanstalk.com":true,"elb.amazonaws.com":true,"s3.amazonaws.com":true,"s3-ap-northeast-1.amazonaws.com":true,"s3-ap-southeast-1.amazonaws.com":true,"s3-ap-southeast-2.amazonaws.com":true,"s3-external-1.amazonaws.com":true,"s3-external-2.amazonaws.com":true,"s3-fips-us-gov-west-1.amazonaws.com":true,"s3-eu-central-1.amazonaws.com":true,"s3-eu-west-1.amazonaws.com":true,"s3-sa-east-1.amazonaws.com":true,"s3-us-gov-west-1.amazonaws.com":true,"s3-us-west-1.amazonaws.com":true,"s3-us-west-2.amazonaws.com":true,"s3.cn-north-1.amazonaws.com.cn":true,"s3.eu-central-1.amazonaws.com":true,"betainabox.com":true,"ae.org":true,"ar.com":true,"br.com":true,"cn.com":true,"com.de":true,"com.se":true,"de.com":true,"eu.com":true,"gb.com":true,"gb.net":true,"hu.com":true,"hu.net":true,"jp.net":true,"jpn.com":true,"kr.com":true,"mex.com":true,"no.com":true,"qc.com":true,"ru.com":true,"sa.com":true,"se.com":true,"se.net":true,"uk.com":true,"uk.net":true,"us.com":true,"uy.com":true,"za.bz":true,"za.com":true,"africa.com":true,"gr.com":true,"in.net":true,"us.org":true,"co.com":true,"c.la":true,"cloudcontrolled.com":true,"cloudcontrolapp.com":true,"co.ca":true,"c.cdn77.org":true,"cdn77-ssl.net":true,"r.cdn77.net":true,"rsc.cdn77.org":true,"ssl.origin.cdn77-secure.org":true,"co.nl":true,"co.no":true,"*.platform.sh":true,"cupcake.is":true,"dreamhosters.com":true,"duckdns.org":true,"dyndns-at-home.com":true,"dyndns-at-work.com":true,"dyndns-blog.com":true,"dyndns-free.com":true,"dyndns-home.com":true,"dyndns-ip.com":true,"dyndns-mail.com":true,"dyndns-office.com":true,"dyndns-pics.com":true,"dyndns-remote.com":true,"dyndns-server.com":true,"dyndns-web.com":true,"dyndns-wiki.com":true,"dyndns-work.com":true,"dyndns.biz":true,"dyndns.info":true,"dyndns.org":true,"dyndns.tv":true,"at-band-camp.net":true,"ath.cx":true,"barrel-of-knowledge.info":true,"barrell-of-knowledge.info":true,"better-than.tv":true,"blogdns.com":true,"blogdns.net":true,"blogdns.org":true,"blogsite.org":true,"boldlygoingnowhere.org":true,"broke-it.net":true,"buyshouses.net":true,"cechire.com":true,"dnsalias.com":true,"dnsalias.net":true,"dnsalias.org":true,"dnsdojo.com":true,"dnsdojo.net":true,"dnsdojo.org":true,"does-it.net":true,"doesntexist.com":true,"doesntexist.org":true,"dontexist.com":true,"dontexist.net":true,"dontexist.org":true,"doomdns.com":true,"doomdns.org":true,"dvrdns.org":true,"dyn-o-saur.com":true,"dynalias.com":true,"dynalias.net":true,"dynalias.org":true,"dynathome.net":true,"dyndns.ws":true,"endofinternet.net":true,"endofinternet.org":true,"endoftheinternet.org":true,"est-a-la-maison.com":true,"est-a-la-masion.com":true,"est-le-patron.com":true,"est-mon-blogueur.com":true,"for-better.biz":true,"for-more.biz":true,"for-our.info":true,"for-some.biz":true,"for-the.biz":true,"forgot.her.name":true,"forgot.his.name":true,"from-ak.com":true,"from-al.com":true,"from-ar.com":true,"from-az.net":true,"from-ca.com":true,"from-co.net":true,"from-ct.com":true,"from-dc.com":true,"from-de.com":true,"from-fl.com":true,"from-ga.com":true,"from-hi.com":true,"from-ia.com":true,"from-id.com":true,"from-il.com":true,"from-in.com":true,"from-ks.com":true,"from-ky.com":true,"from-la.net":true,"from-ma.com":true,"from-md.com":true,"from-me.org":true,"from-mi.com":true,"from-mn.com":true,"from-mo.com":true,"from-ms.com":true,"from-mt.com":true,"from-nc.com":true,"from-nd.com":true,"from-ne.com":true,"from-nh.com":true,"from-nj.com":true,"from-nm.com":true,"from-nv.com":true,"from-ny.net":true,"from-oh.com":true,"from-ok.com":true,"from-or.com":true,"from-pa.com":true,"from-pr.com":true,"from-ri.com":true,"from-sc.com":true,"from-sd.com":true,"from-tn.com":true,"from-tx.com":true,"from-ut.com":true,"from-va.com":true,"from-vt.com":true,"from-wa.com":true,"from-wi.com":true,"from-wv.com":true,"from-wy.com":true,"ftpaccess.cc":true,"fuettertdasnetz.de":true,"game-host.org":true,"game-server.cc":true,"getmyip.com":true,"gets-it.net":true,"go.dyndns.org":true,"gotdns.com":true,"gotdns.org":true,"groks-the.info":true,"groks-this.info":true,"ham-radio-op.net":true,"here-for-more.info":true,"hobby-site.com":true,"hobby-site.org":true,"home.dyndns.org":true,"homedns.org":true,"homeftp.net":true,"homeftp.org":true,"homeip.net":true,"homelinux.com":true,"homelinux.net":true,"homelinux.org":true,"homeunix.com":true,"homeunix.net":true,"homeunix.org":true,"iamallama.com":true,"in-the-band.net":true,"is-a-anarchist.com":true,"is-a-blogger.com":true,"is-a-bookkeeper.com":true,"is-a-bruinsfan.org":true,"is-a-bulls-fan.com":true,"is-a-candidate.org":true,"is-a-caterer.com":true,"is-a-celticsfan.org":true,"is-a-chef.com":true,"is-a-chef.net":true,"is-a-chef.org":true,"is-a-conservative.com":true,"is-a-cpa.com":true,"is-a-cubicle-slave.com":true,"is-a-democrat.com":true,"is-a-designer.com":true,"is-a-doctor.com":true,"is-a-financialadvisor.com":true,"is-a-geek.com":true,"is-a-geek.net":true,"is-a-geek.org":true,"is-a-green.com":true,"is-a-guru.com":true,"is-a-hard-worker.com":true,"is-a-hunter.com":true,"is-a-knight.org":true,"is-a-landscaper.com":true,"is-a-lawyer.com":true,"is-a-liberal.com":true,"is-a-libertarian.com":true,"is-a-linux-user.org":true,"is-a-llama.com":true,"is-a-musician.com":true,"is-a-nascarfan.com":true,"is-a-nurse.com":true,"is-a-painter.com":true,"is-a-patsfan.org":true,"is-a-personaltrainer.com":true,"is-a-photographer.com":true,"is-a-player.com":true,"is-a-republican.com":true,"is-a-rockstar.com":true,"is-a-socialist.com":true,"is-a-soxfan.org":true,"is-a-student.com":true,"is-a-teacher.com":true,"is-a-techie.com":true,"is-a-therapist.com":true,"is-an-accountant.com":true,"is-an-actor.com":true,"is-an-actress.com":true,"is-an-anarchist.com":true,"is-an-artist.com":true,"is-an-engineer.com":true,"is-an-entertainer.com":true,"is-by.us":true,"is-certified.com":true,"is-found.org":true,"is-gone.com":true,"is-into-anime.com":true,"is-into-cars.com":true,"is-into-cartoons.com":true,"is-into-games.com":true,"is-leet.com":true,"is-lost.org":true,"is-not-certified.com":true,"is-saved.org":true,"is-slick.com":true,"is-uberleet.com":true,"is-very-bad.org":true,"is-very-evil.org":true,"is-very-good.org":true,"is-very-nice.org":true,"is-very-sweet.org":true,"is-with-theband.com":true,"isa-geek.com":true,"isa-geek.net":true,"isa-geek.org":true,"isa-hockeynut.com":true,"issmarterthanyou.com":true,"isteingeek.de":true,"istmein.de":true,"kicks-ass.net":true,"kicks-ass.org":true,"knowsitall.info":true,"land-4-sale.us":true,"lebtimnetz.de":true,"leitungsen.de":true,"likes-pie.com":true,"likescandy.com":true,"merseine.nu":true,"mine.nu":true,"misconfused.org":true,"mypets.ws":true,"myphotos.cc":true,"neat-url.com":true,"office-on-the.net":true,"on-the-web.tv":true,"podzone.net":true,"podzone.org":true,"readmyblog.org":true,"saves-the-whales.com":true,"scrapper-site.net":true,"scrapping.cc":true,"selfip.biz":true,"selfip.com":true,"selfip.info":true,"selfip.net":true,"selfip.org":true,"sells-for-less.com":true,"sells-for-u.com":true,"sells-it.net":true,"sellsyourhome.org":true,"servebbs.com":true,"servebbs.net":true,"servebbs.org":true,"serveftp.net":true,"serveftp.org":true,"servegame.org":true,"shacknet.nu":true,"simple-url.com":true,"space-to-rent.com":true,"stuff-4-sale.org":true,"stuff-4-sale.us":true,"teaches-yoga.com":true,"thruhere.net":true,"traeumtgerade.de":true,"webhop.biz":true,"webhop.info":true,"webhop.net":true,"webhop.org":true,"worse-than.tv":true,"writesthisblog.com":true,"eu.org":true,"al.eu.org":true,"asso.eu.org":true,"at.eu.org":true,"au.eu.org":true,"be.eu.org":true,"bg.eu.org":true,"ca.eu.org":true,"cd.eu.org":true,"ch.eu.org":true,"cn.eu.org":true,"cy.eu.org":true,"cz.eu.org":true,"de.eu.org":true,"dk.eu.org":true,"edu.eu.org":true,"ee.eu.org":true,"es.eu.org":true,"fi.eu.org":true,"fr.eu.org":true,"gr.eu.org":true,"hr.eu.org":true,"hu.eu.org":true,"ie.eu.org":true,"il.eu.org":true,"in.eu.org":true,"int.eu.org":true,"is.eu.org":true,"it.eu.org":true,"jp.eu.org":true,"kr.eu.org":true,"lt.eu.org":true,"lu.eu.org":true,"lv.eu.org":true,"mc.eu.org":true,"me.eu.org":true,"mk.eu.org":true,"mt.eu.org":true,"my.eu.org":true,"net.eu.org":true,"ng.eu.org":true,"nl.eu.org":true,"no.eu.org":true,"nz.eu.org":true,"paris.eu.org":true,"pl.eu.org":true,"pt.eu.org":true,"q-a.eu.org":true,"ro.eu.org":true,"ru.eu.org":true,"se.eu.org":true,"si.eu.org":true,"sk.eu.org":true,"tr.eu.org":true,"uk.eu.org":true,"us.eu.org":true,"a.ssl.fastly.net":true,"b.ssl.fastly.net":true,"global.ssl.fastly.net":true,"a.prod.fastly.net":true,"global.prod.fastly.net":true,"firebaseapp.com":true,"flynnhub.com":true,"service.gov.uk":true,"github.io":true,"githubusercontent.com":true,"ro.com":true,"appspot.com":true,"blogspot.ae":true,"blogspot.al":true,"blogspot.am":true,"blogspot.ba":true,"blogspot.be":true,"blogspot.bg":true,"blogspot.bj":true,"blogspot.ca":true,"blogspot.cf":true,"blogspot.ch":true,"blogspot.cl":true,"blogspot.co.at":true,"blogspot.co.id":true,"blogspot.co.il":true,"blogspot.co.ke":true,"blogspot.co.nz":true,"blogspot.co.uk":true,"blogspot.co.za":true,"blogspot.com":true,"blogspot.com.ar":true,"blogspot.com.au":true,"blogspot.com.br":true,"blogspot.com.by":true,"blogspot.com.co":true,"blogspot.com.cy":true,"blogspot.com.ee":true,"blogspot.com.eg":true,"blogspot.com.es":true,"blogspot.com.mt":true,"blogspot.com.ng":true,"blogspot.com.tr":true,"blogspot.com.uy":true,"blogspot.cv":true,"blogspot.cz":true,"blogspot.de":true,"blogspot.dk":true,"blogspot.fi":true,"blogspot.fr":true,"blogspot.gr":true,"blogspot.hk":true,"blogspot.hr":true,"blogspot.hu":true,"blogspot.ie":true,"blogspot.in":true,"blogspot.is":true,"blogspot.it":true,"blogspot.jp":true,"blogspot.kr":true,"blogspot.li":true,"blogspot.lt":true,"blogspot.lu":true,"blogspot.md":true,"blogspot.mk":true,"blogspot.mr":true,"blogspot.mx":true,"blogspot.my":true,"blogspot.nl":true,"blogspot.no":true,"blogspot.pe":true,"blogspot.pt":true,"blogspot.qa":true,"blogspot.re":true,"blogspot.ro":true,"blogspot.rs":true,"blogspot.ru":true,"blogspot.se":true,"blogspot.sg":true,"blogspot.si":true,"blogspot.sk":true,"blogspot.sn":true,"blogspot.td":true,"blogspot.tw":true,"blogspot.ug":true,"blogspot.vn":true,"codespot.com":true,"googleapis.com":true,"googlecode.com":true,"pagespeedmobilizer.com":true,"withgoogle.com":true,"withyoutube.com":true,"herokuapp.com":true,"herokussl.com":true,"iki.fi":true,"biz.at":true,"info.at":true,"co.pl":true,"azurewebsites.net":true,"azure-mobile.net":true,"cloudapp.net":true,"bmoattachments.org":true,"4u.com":true,"nfshost.com":true,"nyc.mn":true,"nid.io":true,"operaunite.com":true,"outsystemscloud.com":true,"art.pl":true,"gliwice.pl":true,"krakow.pl":true,"poznan.pl":true,"wroc.pl":true,"zakopane.pl":true,"pantheon.io":true,"gotpantheon.com":true,"priv.at":true,"qa2.com":true,"rhcloud.com":true,"sandcats.io":true,"biz.ua":true,"co.ua":true,"pp.ua":true,"sinaapp.com":true,"vipsinaapp.com":true,"1kapp.com":true,"gda.pl":true,"gdansk.pl":true,"gdynia.pl":true,"med.pl":true,"sopot.pl":true,"hk.com":true,"hk.org":true,"ltd.hk":true,"inc.hk":true,"yolasite.com":true,"za.net":true,"za.org":true}); + +// END of automatically generated file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/tough-cookie/lib/store.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/tough-cookie/lib/store.js new file mode 100644 index 00000000..bce52925 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/tough-cookie/lib/store.js @@ -0,0 +1,71 @@ +/*! + * Copyright (c) 2015, Salesforce.com, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of Salesforce.com nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +'use strict'; +/*jshint unused:false */ + +function Store() { +} +exports.Store = Store; + +// Stores may be synchronous, but are still required to use a +// Continuation-Passing Style API. The CookieJar itself will expose a "*Sync" +// API that converts from synchronous-callbacks to imperative style. +Store.prototype.synchronous = false; + +Store.prototype.findCookie = function(domain, path, key, cb) { + throw new Error('findCookie is not implemented'); +}; + +Store.prototype.findCookies = function(domain, path, cb) { + throw new Error('findCookies is not implemented'); +}; + +Store.prototype.putCookie = function(cookie, cb) { + throw new Error('putCookie is not implemented'); +}; + +Store.prototype.updateCookie = function(oldCookie, newCookie, cb) { + // recommended default implementation: + // return this.putCookie(newCookie, cb); + throw new Error('updateCookie is not implemented'); +}; + +Store.prototype.removeCookie = function(domain, path, key, cb) { + throw new Error('removeCookie is not implemented'); +}; + +Store.prototype.removeCookies = function(domain, path, cb) { + throw new Error('removeCookies is not implemented'); +}; + +Store.prototype.getAllCookies = function(cb) { + throw new Error('getAllCookies is not implemented (therefore jar cannot be serialized)'); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/tough-cookie/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/tough-cookie/package.json new file mode 100644 index 00000000..289a4ab2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/tough-cookie/package.json @@ -0,0 +1,95 @@ +{ + "author": { + "name": "Jeremy Stashewsky", + "email": "jstashewsky@salesforce.com" + }, + "contributors": [ + { + "name": "Alexander Savin" + }, + { + "name": "Ian Livingstone" + }, + { + "name": "Ivan Nikulin" + }, + { + "name": "Lalit Kapoor" + }, + { + "name": "Sam Thompson" + }, + { + "name": "Sebastian Mayr" + } + ], + "license": "BSD-3-Clause", + "name": "tough-cookie", + "description": "RFC6265 Cookies and Cookie Jar for node.js", + "keywords": [ + "HTTP", + "cookie", + "cookies", + "set-cookie", + "cookiejar", + "jar", + "RFC6265", + "RFC2965" + ], + "version": "2.3.1", + "homepage": "https://github.com/SalesforceEng/tough-cookie", + "repository": { + "type": "git", + "url": "git://github.com/SalesforceEng/tough-cookie.git" + }, + "bugs": { + "url": "https://github.com/SalesforceEng/tough-cookie/issues" + }, + "main": "./lib/cookie", + "files": [ + "lib" + ], + "scripts": { + "suffixup": "curl -o public_suffix_list.dat https://publicsuffix.org/list/public_suffix_list.dat && ./generate-pubsuffix.js", + "test": "vows test/*_test.js" + }, + "engines": { + "node": ">=0.8" + }, + "devDependencies": { + "async": "^1.4.2", + "string.prototype.repeat": "^0.2.0", + "vows": "^0.8.1" + }, + "gitHead": "c11a2d11d12348a35ef595c809e30e641a804a7d", + "_id": "tough-cookie@2.3.1", + "_shasum": "99c77dfbb7d804249e8a299d4cb0fd81fef083fd", + "_from": "tough-cookie@>=2.3.0 <2.4.0", + "_npmVersion": "3.10.3", + "_nodeVersion": "6.3.1", + "_npmUser": { + "name": "jstash", + "email": "jstash@gmail.com" + }, + "dist": { + "shasum": "99c77dfbb7d804249e8a299d4cb0fd81fef083fd", + "tarball": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.1.tgz" + }, + "maintainers": [ + { + "name": "jstash", + "email": "jstash@gmail.com" + }, + { + "name": "nexxy", + "email": "emily@contactvibe.com" + } + ], + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/tough-cookie-2.3.1.tgz_1469494891088_0.8524557144846767" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.1.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/tunnel-agent/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/tunnel-agent/LICENSE new file mode 100644 index 00000000..a4a9aee0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/tunnel-agent/LICENSE @@ -0,0 +1,55 @@ +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of this License; and + +You must cause any modified files to carry prominent notices stating that You changed the files; and + +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/tunnel-agent/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/tunnel-agent/README.md new file mode 100644 index 00000000..bb533d56 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/tunnel-agent/README.md @@ -0,0 +1,4 @@ +tunnel-agent +============ + +HTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/tunnel-agent/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/tunnel-agent/index.js new file mode 100644 index 00000000..68013ac1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/tunnel-agent/index.js @@ -0,0 +1,243 @@ +'use strict' + +var net = require('net') + , tls = require('tls') + , http = require('http') + , https = require('https') + , events = require('events') + , assert = require('assert') + , util = require('util') + ; + +exports.httpOverHttp = httpOverHttp +exports.httpsOverHttp = httpsOverHttp +exports.httpOverHttps = httpOverHttps +exports.httpsOverHttps = httpsOverHttps + + +function httpOverHttp(options) { + var agent = new TunnelingAgent(options) + agent.request = http.request + return agent +} + +function httpsOverHttp(options) { + var agent = new TunnelingAgent(options) + agent.request = http.request + agent.createSocket = createSecureSocket + agent.defaultPort = 443 + return agent +} + +function httpOverHttps(options) { + var agent = new TunnelingAgent(options) + agent.request = https.request + return agent +} + +function httpsOverHttps(options) { + var agent = new TunnelingAgent(options) + agent.request = https.request + agent.createSocket = createSecureSocket + agent.defaultPort = 443 + return agent +} + + +function TunnelingAgent(options) { + var self = this + self.options = options || {} + self.proxyOptions = self.options.proxy || {} + self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets + self.requests = [] + self.sockets = [] + + self.on('free', function onFree(socket, host, port) { + for (var i = 0, len = self.requests.length; i < len; ++i) { + var pending = self.requests[i] + if (pending.host === host && pending.port === port) { + // Detect the request to connect same origin server, + // reuse the connection. + self.requests.splice(i, 1) + pending.request.onSocket(socket) + return + } + } + socket.destroy() + self.removeSocket(socket) + }) +} +util.inherits(TunnelingAgent, events.EventEmitter) + +TunnelingAgent.prototype.addRequest = function addRequest(req, options) { + var self = this + + // Legacy API: addRequest(req, host, port, path) + if (typeof options === 'string') { + options = { + host: options, + port: arguments[2], + path: arguments[3] + }; + } + + if (self.sockets.length >= this.maxSockets) { + // We are over limit so we'll add it to the queue. + self.requests.push({host: options.host, port: options.port, request: req}) + return + } + + // If we are under maxSockets create a new one. + self.createConnection({host: options.host, port: options.port, request: req}) +} + +TunnelingAgent.prototype.createConnection = function createConnection(pending) { + var self = this + + self.createSocket(pending, function(socket) { + socket.on('free', onFree) + socket.on('close', onCloseOrRemove) + socket.on('agentRemove', onCloseOrRemove) + pending.request.onSocket(socket) + + function onFree() { + self.emit('free', socket, pending.host, pending.port) + } + + function onCloseOrRemove(err) { + self.removeSocket(socket) + socket.removeListener('free', onFree) + socket.removeListener('close', onCloseOrRemove) + socket.removeListener('agentRemove', onCloseOrRemove) + } + }) +} + +TunnelingAgent.prototype.createSocket = function createSocket(options, cb) { + var self = this + var placeholder = {} + self.sockets.push(placeholder) + + var connectOptions = mergeOptions({}, self.proxyOptions, + { method: 'CONNECT' + , path: options.host + ':' + options.port + , agent: false + } + ) + if (connectOptions.proxyAuth) { + connectOptions.headers = connectOptions.headers || {} + connectOptions.headers['Proxy-Authorization'] = 'Basic ' + + new Buffer(connectOptions.proxyAuth).toString('base64') + } + + debug('making CONNECT request') + var connectReq = self.request(connectOptions) + connectReq.useChunkedEncodingByDefault = false // for v0.6 + connectReq.once('response', onResponse) // for v0.6 + connectReq.once('upgrade', onUpgrade) // for v0.6 + connectReq.once('connect', onConnect) // for v0.7 or later + connectReq.once('error', onError) + connectReq.end() + + function onResponse(res) { + // Very hacky. This is necessary to avoid http-parser leaks. + res.upgrade = true + } + + function onUpgrade(res, socket, head) { + // Hacky. + process.nextTick(function() { + onConnect(res, socket, head) + }) + } + + function onConnect(res, socket, head) { + connectReq.removeAllListeners() + socket.removeAllListeners() + + if (res.statusCode === 200) { + assert.equal(head.length, 0) + debug('tunneling connection has established') + self.sockets[self.sockets.indexOf(placeholder)] = socket + cb(socket) + } else { + debug('tunneling socket could not be established, statusCode=%d', res.statusCode) + var error = new Error('tunneling socket could not be established, ' + 'statusCode=' + res.statusCode) + error.code = 'ECONNRESET' + options.request.emit('error', error) + self.removeSocket(placeholder) + } + } + + function onError(cause) { + connectReq.removeAllListeners() + + debug('tunneling socket could not be established, cause=%s\n', cause.message, cause.stack) + var error = new Error('tunneling socket could not be established, ' + 'cause=' + cause.message) + error.code = 'ECONNRESET' + options.request.emit('error', error) + self.removeSocket(placeholder) + } +} + +TunnelingAgent.prototype.removeSocket = function removeSocket(socket) { + var pos = this.sockets.indexOf(socket) + if (pos === -1) return + + this.sockets.splice(pos, 1) + + var pending = this.requests.shift() + if (pending) { + // If we have pending requests and a socket gets closed a new one + // needs to be created to take over in the pool for the one that closed. + this.createConnection(pending) + } +} + +function createSecureSocket(options, cb) { + var self = this + TunnelingAgent.prototype.createSocket.call(self, options, function(socket) { + // 0 is dummy port for v0.6 + var secureSocket = tls.connect(0, mergeOptions({}, self.options, + { servername: options.host + , socket: socket + } + )) + self.sockets[self.sockets.indexOf(socket)] = secureSocket + cb(secureSocket) + }) +} + + +function mergeOptions(target) { + for (var i = 1, len = arguments.length; i < len; ++i) { + var overrides = arguments[i] + if (typeof overrides === 'object') { + var keys = Object.keys(overrides) + for (var j = 0, keyLen = keys.length; j < keyLen; ++j) { + var k = keys[j] + if (overrides[k] !== undefined) { + target[k] = overrides[k] + } + } + } + } + return target +} + + +var debug +if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) { + debug = function() { + var args = Array.prototype.slice.call(arguments) + if (typeof args[0] === 'string') { + args[0] = 'TUNNEL: ' + args[0] + } else { + args.unshift('TUNNEL:') + } + console.error.apply(console, args) + } +} else { + debug = function() {} +} +exports.debug = debug // for test diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/tunnel-agent/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/tunnel-agent/package.json new file mode 100644 index 00000000..6677690f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/node_modules/tunnel-agent/package.json @@ -0,0 +1,68 @@ +{ + "author": { + "name": "Mikeal Rogers", + "email": "mikeal.rogers@gmail.com", + "url": "http://www.futurealoof.com" + }, + "name": "tunnel-agent", + "license": "Apache-2.0", + "description": "HTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module.", + "version": "0.4.3", + "repository": { + "url": "git+https://github.com/mikeal/tunnel-agent.git" + }, + "main": "index.js", + "files": [ + "index.js" + ], + "dependencies": {}, + "devDependencies": {}, + "optionalDependencies": {}, + "engines": { + "node": "*" + }, + "gitHead": "e72d830f5ed388a2a71d37ce062c38e3fb34bdde", + "bugs": { + "url": "https://github.com/mikeal/tunnel-agent/issues" + }, + "homepage": "https://github.com/mikeal/tunnel-agent#readme", + "_id": "tunnel-agent@0.4.3", + "scripts": {}, + "_shasum": "6373db76909fe570e08d73583365ed828a74eeeb", + "_from": "tunnel-agent@>=0.4.1 <0.5.0", + "_npmVersion": "2.15.3", + "_nodeVersion": "5.9.0", + "_npmUser": { + "name": "simov", + "email": "simeonvelichkov@gmail.com" + }, + "dist": { + "shasum": "6373db76909fe570e08d73583365ed828a74eeeb", + "tarball": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz" + }, + "maintainers": [ + { + "name": "mikeal", + "email": "mikeal.rogers@gmail.com" + }, + { + "name": "nylen", + "email": "jnylen@gmail.com" + }, + { + "name": "fredkschott", + "email": "fkschott@gmail.com" + }, + { + "name": "simov", + "email": "simeonvelichkov@gmail.com" + } + ], + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/tunnel-agent-0.4.3.tgz_1462396470295_0.23639482469297945" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/package.json new file mode 100644 index 00000000..591e8bbf --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/package.json @@ -0,0 +1,119 @@ +{ + "name": "request", + "description": "Simplified HTTP request client.", + "tags": [ + "http", + "simple", + "util", + "utility" + ], + "version": "2.74.0", + "author": { + "name": "Mikeal Rogers", + "email": "mikeal.rogers@gmail.com" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/request/request.git" + }, + "bugs": { + "url": "http://github.com/request/request/issues" + }, + "license": "Apache-2.0", + "engines": { + "node": ">=0.8.0" + }, + "main": "index.js", + "dependencies": { + "aws-sign2": "~0.6.0", + "aws4": "^1.2.1", + "bl": "~1.1.2", + "caseless": "~0.11.0", + "combined-stream": "~1.0.5", + "extend": "~3.0.0", + "forever-agent": "~0.6.1", + "form-data": "~1.0.0-rc4", + "har-validator": "~2.0.6", + "hawk": "~3.1.3", + "http-signature": "~1.1.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.7", + "node-uuid": "~1.4.7", + "oauth-sign": "~0.8.1", + "qs": "~6.2.0", + "stringstream": "~0.0.4", + "tough-cookie": "~2.3.0", + "tunnel-agent": "~0.4.1" + }, + "scripts": { + "test": "npm run lint && npm run test-ci && npm run test-browser", + "test-ci": "taper tests/test-*.js", + "test-cov": "istanbul cover tape tests/test-*.js", + "test-browser": "node tests/browser/start.js", + "lint": "eslint lib/ *.js tests/ && echo Lint passed." + }, + "devDependencies": { + "bluebird": "^3.2.1", + "browserify": "^13.0.1", + "browserify-istanbul": "^2.0.0", + "buffer-equal": "^1.0.0", + "codecov": "^1.0.1", + "coveralls": "^2.11.4", + "eslint": "^2.5.3", + "function-bind": "^1.0.2", + "istanbul": "^0.4.0", + "karma": "^1.1.1", + "karma-browserify": "^5.0.1", + "karma-cli": "^1.0.0", + "karma-coverage": "^1.0.0", + "karma-phantomjs-launcher": "^1.0.0", + "karma-tap": "^2.0.1", + "phantomjs-prebuilt": "^2.1.3", + "rimraf": "^2.2.8", + "server-destroy": "^1.0.1", + "tape": "^4.6.0", + "taper": "^0.4.0" + }, + "gitHead": "76e82351cbc21049441b1763c6f2bbd504fa8f5a", + "homepage": "https://github.com/request/request#readme", + "_id": "request@2.74.0", + "_shasum": "7693ca768bbb0ea5c8ce08c084a45efa05b892ab", + "_from": "request@2.74.0", + "_npmVersion": "2.15.6", + "_nodeVersion": "6.2.2", + "_npmUser": { + "name": "simov", + "email": "simeonvelichkov@gmail.com" + }, + "dist": { + "shasum": "7693ca768bbb0ea5c8ce08c084a45efa05b892ab", + "tarball": "https://registry.npmjs.org/request/-/request-2.74.0.tgz" + }, + "maintainers": [ + { + "name": "mikeal", + "email": "mikeal.rogers@gmail.com" + }, + { + "name": "nylen", + "email": "jnylen@gmail.com" + }, + { + "name": "fredkschott", + "email": "fkschott@gmail.com" + }, + { + "name": "simov", + "email": "simeonvelichkov@gmail.com" + } + ], + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/request-2.74.0.tgz_1469231082306_0.13140005595050752" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/request/-/request-2.74.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/request.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/request.js new file mode 100644 index 00000000..8267c125 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/request/request.js @@ -0,0 +1,1434 @@ +'use strict' + +var http = require('http') + , https = require('https') + , url = require('url') + , util = require('util') + , stream = require('stream') + , zlib = require('zlib') + , bl = require('bl') + , hawk = require('hawk') + , aws2 = require('aws-sign2') + , aws4 = require('aws4') + , httpSignature = require('http-signature') + , mime = require('mime-types') + , stringstream = require('stringstream') + , caseless = require('caseless') + , ForeverAgent = require('forever-agent') + , FormData = require('form-data') + , extend = require('extend') + , isstream = require('isstream') + , isTypedArray = require('is-typedarray').strict + , helpers = require('./lib/helpers') + , cookies = require('./lib/cookies') + , getProxyFromURI = require('./lib/getProxyFromURI') + , Querystring = require('./lib/querystring').Querystring + , Har = require('./lib/har').Har + , Auth = require('./lib/auth').Auth + , OAuth = require('./lib/oauth').OAuth + , Multipart = require('./lib/multipart').Multipart + , Redirect = require('./lib/redirect').Redirect + , Tunnel = require('./lib/tunnel').Tunnel + +var safeStringify = helpers.safeStringify + , isReadStream = helpers.isReadStream + , toBase64 = helpers.toBase64 + , defer = helpers.defer + , copy = helpers.copy + , version = helpers.version + , globalCookieJar = cookies.jar() + + +var globalPool = {} + +function filterForNonReserved(reserved, options) { + // Filter out properties that are not reserved. + // Reserved values are passed in at call site. + + var object = {} + for (var i in options) { + var notReserved = (reserved.indexOf(i) === -1) + if (notReserved) { + object[i] = options[i] + } + } + return object +} + +function filterOutReservedFunctions(reserved, options) { + // Filter out properties that are functions and are reserved. + // Reserved values are passed in at call site. + + var object = {} + for (var i in options) { + var isReserved = !(reserved.indexOf(i) === -1) + var isFunction = (typeof options[i] === 'function') + if (!(isReserved && isFunction)) { + object[i] = options[i] + } + } + return object + +} + +// Return a simpler request object to allow serialization +function requestToJSON() { + var self = this + return { + uri: self.uri, + method: self.method, + headers: self.headers + } +} + +// Return a simpler response object to allow serialization +function responseToJSON() { + var self = this + return { + statusCode: self.statusCode, + body: self.body, + headers: self.headers, + request: requestToJSON.call(self.request) + } +} + +function Request (options) { + // if given the method property in options, set property explicitMethod to true + + // extend the Request instance with any non-reserved properties + // remove any reserved functions from the options object + // set Request instance to be readable and writable + // call init + + var self = this + + // start with HAR, then override with additional options + if (options.har) { + self._har = new Har(self) + options = self._har.options(options) + } + + stream.Stream.call(self) + var reserved = Object.keys(Request.prototype) + var nonReserved = filterForNonReserved(reserved, options) + + extend(self, nonReserved) + options = filterOutReservedFunctions(reserved, options) + + self.readable = true + self.writable = true + if (options.method) { + self.explicitMethod = true + } + self._qs = new Querystring(self) + self._auth = new Auth(self) + self._oauth = new OAuth(self) + self._multipart = new Multipart(self) + self._redirect = new Redirect(self) + self._tunnel = new Tunnel(self) + self.init(options) +} + +util.inherits(Request, stream.Stream) + +// Debugging +Request.debug = process.env.NODE_DEBUG && /\brequest\b/.test(process.env.NODE_DEBUG) +function debug() { + if (Request.debug) { + console.error('REQUEST %s', util.format.apply(util, arguments)) + } +} +Request.prototype.debug = debug + +Request.prototype.init = function (options) { + // init() contains all the code to setup the request object. + // the actual outgoing request is not started until start() is called + // this function is called from both the constructor and on redirect. + var self = this + if (!options) { + options = {} + } + self.headers = self.headers ? copy(self.headers) : {} + + // Delete headers with value undefined since they break + // ClientRequest.OutgoingMessage.setHeader in node 0.12 + for (var headerName in self.headers) { + if (typeof self.headers[headerName] === 'undefined') { + delete self.headers[headerName] + } + } + + caseless.httpify(self, self.headers) + + if (!self.method) { + self.method = options.method || 'GET' + } + if (!self.localAddress) { + self.localAddress = options.localAddress + } + + self._qs.init(options) + + debug(options) + if (!self.pool && self.pool !== false) { + self.pool = globalPool + } + self.dests = self.dests || [] + self.__isRequestRequest = true + + // Protect against double callback + if (!self._callback && self.callback) { + self._callback = self.callback + self.callback = function () { + if (self._callbackCalled) { + return // Print a warning maybe? + } + self._callbackCalled = true + self._callback.apply(self, arguments) + } + self.on('error', self.callback.bind()) + self.on('complete', self.callback.bind(self, null)) + } + + // People use this property instead all the time, so support it + if (!self.uri && self.url) { + self.uri = self.url + delete self.url + } + + // If there's a baseUrl, then use it as the base URL (i.e. uri must be + // specified as a relative path and is appended to baseUrl). + if (self.baseUrl) { + if (typeof self.baseUrl !== 'string') { + return self.emit('error', new Error('options.baseUrl must be a string')) + } + + if (typeof self.uri !== 'string') { + return self.emit('error', new Error('options.uri must be a string when using options.baseUrl')) + } + + if (self.uri.indexOf('//') === 0 || self.uri.indexOf('://') !== -1) { + return self.emit('error', new Error('options.uri must be a path when using options.baseUrl')) + } + + // Handle all cases to make sure that there's only one slash between + // baseUrl and uri. + var baseUrlEndsWithSlash = self.baseUrl.lastIndexOf('/') === self.baseUrl.length - 1 + var uriStartsWithSlash = self.uri.indexOf('/') === 0 + + if (baseUrlEndsWithSlash && uriStartsWithSlash) { + self.uri = self.baseUrl + self.uri.slice(1) + } else if (baseUrlEndsWithSlash || uriStartsWithSlash) { + self.uri = self.baseUrl + self.uri + } else if (self.uri === '') { + self.uri = self.baseUrl + } else { + self.uri = self.baseUrl + '/' + self.uri + } + delete self.baseUrl + } + + // A URI is needed by this point, emit error if we haven't been able to get one + if (!self.uri) { + return self.emit('error', new Error('options.uri is a required argument')) + } + + // If a string URI/URL was given, parse it into a URL object + if (typeof self.uri === 'string') { + self.uri = url.parse(self.uri) + } + + // Some URL objects are not from a URL parsed string and need href added + if (!self.uri.href) { + self.uri.href = url.format(self.uri) + } + + // DEPRECATED: Warning for users of the old Unix Sockets URL Scheme + if (self.uri.protocol === 'unix:') { + return self.emit('error', new Error('`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`')) + } + + // Support Unix Sockets + if (self.uri.host === 'unix') { + self.enableUnixSocket() + } + + if (self.strictSSL === false) { + self.rejectUnauthorized = false + } + + if (!self.uri.pathname) {self.uri.pathname = '/'} + + if (!(self.uri.host || (self.uri.hostname && self.uri.port)) && !self.uri.isUnix) { + // Invalid URI: it may generate lot of bad errors, like 'TypeError: Cannot call method `indexOf` of undefined' in CookieJar + // Detect and reject it as soon as possible + var faultyUri = url.format(self.uri) + var message = 'Invalid URI "' + faultyUri + '"' + if (Object.keys(options).length === 0) { + // No option ? This can be the sign of a redirect + // As this is a case where the user cannot do anything (they didn't call request directly with this URL) + // they should be warned that it can be caused by a redirection (can save some hair) + message += '. This can be caused by a crappy redirection.' + } + // This error was fatal + self.abort() + return self.emit('error', new Error(message)) + } + + if (!self.hasOwnProperty('proxy')) { + self.proxy = getProxyFromURI(self.uri) + } + + self.tunnel = self._tunnel.isEnabled() + if (self.proxy) { + self._tunnel.setup(options) + } + + self._redirect.onRequest(options) + + self.setHost = false + if (!self.hasHeader('host')) { + var hostHeaderName = self.originalHostHeaderName || 'host' + self.setHeader(hostHeaderName, self.uri.hostname) + if (self.uri.port) { + if ( !(self.uri.port === 80 && self.uri.protocol === 'http:') && + !(self.uri.port === 443 && self.uri.protocol === 'https:') ) { + self.setHeader(hostHeaderName, self.getHeader('host') + (':' + self.uri.port) ) + } + } + self.setHost = true + } + + self.jar(self._jar || options.jar) + + if (!self.uri.port) { + if (self.uri.protocol === 'http:') {self.uri.port = 80} + else if (self.uri.protocol === 'https:') {self.uri.port = 443} + } + + if (self.proxy && !self.tunnel) { + self.port = self.proxy.port + self.host = self.proxy.hostname + } else { + self.port = self.uri.port + self.host = self.uri.hostname + } + + if (options.form) { + self.form(options.form) + } + + if (options.formData) { + var formData = options.formData + var requestForm = self.form() + var appendFormValue = function (key, value) { + if (value && value.hasOwnProperty('value') && value.hasOwnProperty('options')) { + requestForm.append(key, value.value, value.options) + } else { + requestForm.append(key, value) + } + } + for (var formKey in formData) { + if (formData.hasOwnProperty(formKey)) { + var formValue = formData[formKey] + if (formValue instanceof Array) { + for (var j = 0; j < formValue.length; j++) { + appendFormValue(formKey, formValue[j]) + } + } else { + appendFormValue(formKey, formValue) + } + } + } + } + + if (options.qs) { + self.qs(options.qs) + } + + if (self.uri.path) { + self.path = self.uri.path + } else { + self.path = self.uri.pathname + (self.uri.search || '') + } + + if (self.path.length === 0) { + self.path = '/' + } + + // Auth must happen last in case signing is dependent on other headers + if (options.aws) { + self.aws(options.aws) + } + + if (options.hawk) { + self.hawk(options.hawk) + } + + if (options.httpSignature) { + self.httpSignature(options.httpSignature) + } + + if (options.auth) { + if (Object.prototype.hasOwnProperty.call(options.auth, 'username')) { + options.auth.user = options.auth.username + } + if (Object.prototype.hasOwnProperty.call(options.auth, 'password')) { + options.auth.pass = options.auth.password + } + + self.auth( + options.auth.user, + options.auth.pass, + options.auth.sendImmediately, + options.auth.bearer + ) + } + + if (self.gzip && !self.hasHeader('accept-encoding')) { + self.setHeader('accept-encoding', 'gzip, deflate') + } + + if (self.uri.auth && !self.hasHeader('authorization')) { + var uriAuthPieces = self.uri.auth.split(':').map(function(item) {return self._qs.unescape(item)}) + self.auth(uriAuthPieces[0], uriAuthPieces.slice(1).join(':'), true) + } + + if (!self.tunnel && self.proxy && self.proxy.auth && !self.hasHeader('proxy-authorization')) { + var proxyAuthPieces = self.proxy.auth.split(':').map(function(item) {return self._qs.unescape(item)}) + var authHeader = 'Basic ' + toBase64(proxyAuthPieces.join(':')) + self.setHeader('proxy-authorization', authHeader) + } + + if (self.proxy && !self.tunnel) { + self.path = (self.uri.protocol + '//' + self.uri.host + self.path) + } + + if (options.json) { + self.json(options.json) + } + if (options.multipart) { + self.multipart(options.multipart) + } + + if (options.time) { + self.timing = true + self.elapsedTime = self.elapsedTime || 0 + } + + function setContentLength () { + if (isTypedArray(self.body)) { + self.body = new Buffer(self.body) + } + + if (!self.hasHeader('content-length')) { + var length + if (typeof self.body === 'string') { + length = Buffer.byteLength(self.body) + } + else if (Array.isArray(self.body)) { + length = self.body.reduce(function (a, b) {return a + b.length}, 0) + } + else { + length = self.body.length + } + + if (length) { + self.setHeader('content-length', length) + } else { + self.emit('error', new Error('Argument error, options.body.')) + } + } + } + if (self.body && !isstream(self.body)) { + setContentLength() + } + + if (options.oauth) { + self.oauth(options.oauth) + } else if (self._oauth.params && self.hasHeader('authorization')) { + self.oauth(self._oauth.params) + } + + var protocol = self.proxy && !self.tunnel ? self.proxy.protocol : self.uri.protocol + , defaultModules = {'http:':http, 'https:':https} + , httpModules = self.httpModules || {} + + self.httpModule = httpModules[protocol] || defaultModules[protocol] + + if (!self.httpModule) { + return self.emit('error', new Error('Invalid protocol: ' + protocol)) + } + + if (options.ca) { + self.ca = options.ca + } + + if (!self.agent) { + if (options.agentOptions) { + self.agentOptions = options.agentOptions + } + + if (options.agentClass) { + self.agentClass = options.agentClass + } else if (options.forever) { + var v = version() + // use ForeverAgent in node 0.10- only + if (v.major === 0 && v.minor <= 10) { + self.agentClass = protocol === 'http:' ? ForeverAgent : ForeverAgent.SSL + } else { + self.agentClass = self.httpModule.Agent + self.agentOptions = self.agentOptions || {} + self.agentOptions.keepAlive = true + } + } else { + self.agentClass = self.httpModule.Agent + } + } + + if (self.pool === false) { + self.agent = false + } else { + self.agent = self.agent || self.getNewAgent() + } + + self.on('pipe', function (src) { + if (self.ntick && self._started) { + self.emit('error', new Error('You cannot pipe to this stream after the outbound request has started.')) + } + self.src = src + if (isReadStream(src)) { + if (!self.hasHeader('content-type')) { + self.setHeader('content-type', mime.lookup(src.path)) + } + } else { + if (src.headers) { + for (var i in src.headers) { + if (!self.hasHeader(i)) { + self.setHeader(i, src.headers[i]) + } + } + } + if (self._json && !self.hasHeader('content-type')) { + self.setHeader('content-type', 'application/json') + } + if (src.method && !self.explicitMethod) { + self.method = src.method + } + } + + // self.on('pipe', function () { + // console.error('You have already piped to this stream. Pipeing twice is likely to break the request.') + // }) + }) + + defer(function () { + if (self._aborted) { + return + } + + var end = function () { + if (self._form) { + if (!self._auth.hasAuth) { + self._form.pipe(self) + } + else if (self._auth.hasAuth && self._auth.sentAuth) { + self._form.pipe(self) + } + } + if (self._multipart && self._multipart.chunked) { + self._multipart.body.pipe(self) + } + if (self.body) { + if (isstream(self.body)) { + self.body.pipe(self) + } else { + setContentLength() + if (Array.isArray(self.body)) { + self.body.forEach(function (part) { + self.write(part) + }) + } else { + self.write(self.body) + } + self.end() + } + } else if (self.requestBodyStream) { + console.warn('options.requestBodyStream is deprecated, please pass the request object to stream.pipe.') + self.requestBodyStream.pipe(self) + } else if (!self.src) { + if (self._auth.hasAuth && !self._auth.sentAuth) { + self.end() + return + } + if (self.method !== 'GET' && typeof self.method !== 'undefined') { + self.setHeader('content-length', 0) + } + self.end() + } + } + + if (self._form && !self.hasHeader('content-length')) { + // Before ending the request, we had to compute the length of the whole form, asyncly + self.setHeader(self._form.getHeaders(), true) + self._form.getLength(function (err, length) { + if (!err && !isNaN(length)) { + self.setHeader('content-length', length) + } + end() + }) + } else { + end() + } + + self.ntick = true + }) + +} + +Request.prototype.getNewAgent = function () { + var self = this + var Agent = self.agentClass + var options = {} + if (self.agentOptions) { + for (var i in self.agentOptions) { + options[i] = self.agentOptions[i] + } + } + if (self.ca) { + options.ca = self.ca + } + if (self.ciphers) { + options.ciphers = self.ciphers + } + if (self.secureProtocol) { + options.secureProtocol = self.secureProtocol + } + if (self.secureOptions) { + options.secureOptions = self.secureOptions + } + if (typeof self.rejectUnauthorized !== 'undefined') { + options.rejectUnauthorized = self.rejectUnauthorized + } + + if (self.cert && self.key) { + options.key = self.key + options.cert = self.cert + } + + if (self.pfx) { + options.pfx = self.pfx + } + + if (self.passphrase) { + options.passphrase = self.passphrase + } + + var poolKey = '' + + // different types of agents are in different pools + if (Agent !== self.httpModule.Agent) { + poolKey += Agent.name + } + + // ca option is only relevant if proxy or destination are https + var proxy = self.proxy + if (typeof proxy === 'string') { + proxy = url.parse(proxy) + } + var isHttps = (proxy && proxy.protocol === 'https:') || this.uri.protocol === 'https:' + + if (isHttps) { + if (options.ca) { + if (poolKey) { + poolKey += ':' + } + poolKey += options.ca + } + + if (typeof options.rejectUnauthorized !== 'undefined') { + if (poolKey) { + poolKey += ':' + } + poolKey += options.rejectUnauthorized + } + + if (options.cert) { + if (poolKey) { + poolKey += ':' + } + poolKey += options.cert.toString('ascii') + options.key.toString('ascii') + } + + if (options.pfx) { + if (poolKey) { + poolKey += ':' + } + poolKey += options.pfx.toString('ascii') + } + + if (options.ciphers) { + if (poolKey) { + poolKey += ':' + } + poolKey += options.ciphers + } + + if (options.secureProtocol) { + if (poolKey) { + poolKey += ':' + } + poolKey += options.secureProtocol + } + + if (options.secureOptions) { + if (poolKey) { + poolKey += ':' + } + poolKey += options.secureOptions + } + } + + if (self.pool === globalPool && !poolKey && Object.keys(options).length === 0 && self.httpModule.globalAgent) { + // not doing anything special. Use the globalAgent + return self.httpModule.globalAgent + } + + // we're using a stored agent. Make sure it's protocol-specific + poolKey = self.uri.protocol + poolKey + + // generate a new agent for this setting if none yet exists + if (!self.pool[poolKey]) { + self.pool[poolKey] = new Agent(options) + // properly set maxSockets on new agents + if (self.pool.maxSockets) { + self.pool[poolKey].maxSockets = self.pool.maxSockets + } + } + + return self.pool[poolKey] +} + +Request.prototype.start = function () { + // start() is called once we are ready to send the outgoing HTTP request. + // this is usually called on the first write(), end() or on nextTick() + var self = this + + if (self._aborted) { + return + } + + self._started = true + self.method = self.method || 'GET' + self.href = self.uri.href + + if (self.src && self.src.stat && self.src.stat.size && !self.hasHeader('content-length')) { + self.setHeader('content-length', self.src.stat.size) + } + if (self._aws) { + self.aws(self._aws, true) + } + + // We have a method named auth, which is completely different from the http.request + // auth option. If we don't remove it, we're gonna have a bad time. + var reqOptions = copy(self) + delete reqOptions.auth + + debug('make request', self.uri.href) + + try { + self.req = self.httpModule.request(reqOptions) + } catch (err) { + self.emit('error', err) + return + } + + if (self.timing) { + self.startTime = new Date().getTime() + } + + if (self.timeout && !self.timeoutTimer) { + var timeout = self.timeout < 0 ? 0 : self.timeout + // Set a timeout in memory - this block will throw if the server takes more + // than `timeout` to write the HTTP status and headers (corresponding to + // the on('response') event on the client). NB: this measures wall-clock + // time, not the time between bytes sent by the server. + self.timeoutTimer = setTimeout(function () { + var connectTimeout = self.req.socket && self.req.socket.readable === false + self.abort() + var e = new Error('ETIMEDOUT') + e.code = 'ETIMEDOUT' + e.connect = connectTimeout + self.emit('error', e) + }, timeout) + + if (self.req.setTimeout) { // only works on node 0.6+ + // Set an additional timeout on the socket, via the `setsockopt` syscall. + // This timeout sets the amount of time to wait *between* bytes sent + // from the server, and may or may not correspond to the wall-clock time + // elapsed from the start of the request. + // + // In particular, it's useful for erroring if the server fails to send + // data halfway through streaming a response. + self.req.setTimeout(timeout, function () { + if (self.req) { + self.req.abort() + var e = new Error('ESOCKETTIMEDOUT') + e.code = 'ESOCKETTIMEDOUT' + e.connect = false + self.emit('error', e) + } + }) + } + } + + self.req.on('response', self.onRequestResponse.bind(self)) + self.req.on('error', self.onRequestError.bind(self)) + self.req.on('drain', function() { + self.emit('drain') + }) + self.req.on('socket', function(socket) { + self.emit('socket', socket) + }) + + self.emit('request', self.req) +} + +Request.prototype.onRequestError = function (error) { + var self = this + if (self._aborted) { + return + } + if (self.req && self.req._reusedSocket && error.code === 'ECONNRESET' + && self.agent.addRequestNoreuse) { + self.agent = { addRequest: self.agent.addRequestNoreuse.bind(self.agent) } + self.start() + self.req.end() + return + } + if (self.timeout && self.timeoutTimer) { + clearTimeout(self.timeoutTimer) + self.timeoutTimer = null + } + self.emit('error', error) +} + +Request.prototype.onRequestResponse = function (response) { + var self = this + debug('onRequestResponse', self.uri.href, response.statusCode, response.headers) + response.on('end', function() { + if (self.timing) { + self.elapsedTime += (new Date().getTime() - self.startTime) + debug('elapsed time', self.elapsedTime) + response.elapsedTime = self.elapsedTime + } + debug('response end', self.uri.href, response.statusCode, response.headers) + }) + + if (self._aborted) { + debug('aborted', self.uri.href) + response.resume() + return + } + + self.response = response + response.request = self + response.toJSON = responseToJSON + + // XXX This is different on 0.10, because SSL is strict by default + if (self.httpModule === https && + self.strictSSL && (!response.hasOwnProperty('socket') || + !response.socket.authorized)) { + debug('strict ssl error', self.uri.href) + var sslErr = response.hasOwnProperty('socket') ? response.socket.authorizationError : self.uri.href + ' does not support SSL' + self.emit('error', new Error('SSL Error: ' + sslErr)) + return + } + + // Save the original host before any redirect (if it changes, we need to + // remove any authorization headers). Also remember the case of the header + // name because lots of broken servers expect Host instead of host and we + // want the caller to be able to specify this. + self.originalHost = self.getHeader('host') + if (!self.originalHostHeaderName) { + self.originalHostHeaderName = self.hasHeader('host') + } + if (self.setHost) { + self.removeHeader('host') + } + if (self.timeout && self.timeoutTimer) { + clearTimeout(self.timeoutTimer) + self.timeoutTimer = null + } + + var targetCookieJar = (self._jar && self._jar.setCookie) ? self._jar : globalCookieJar + var addCookie = function (cookie) { + //set the cookie if it's domain in the href's domain. + try { + targetCookieJar.setCookie(cookie, self.uri.href, {ignoreError: true}) + } catch (e) { + self.emit('error', e) + } + } + + response.caseless = caseless(response.headers) + + if (response.caseless.has('set-cookie') && (!self._disableCookies)) { + var headerName = response.caseless.has('set-cookie') + if (Array.isArray(response.headers[headerName])) { + response.headers[headerName].forEach(addCookie) + } else { + addCookie(response.headers[headerName]) + } + } + + if (self._redirect.onResponse(response)) { + return // Ignore the rest of the response + } else { + // Be a good stream and emit end when the response is finished. + // Hack to emit end on close because of a core bug that never fires end + response.on('close', function () { + if (!self._ended) { + self.response.emit('end') + } + }) + + response.on('end', function () { + self._ended = true + }) + + var noBody = function (code) { + return ( + self.method === 'HEAD' + // Informational + || (code >= 100 && code < 200) + // No Content + || code === 204 + // Not Modified + || code === 304 + ) + } + + var responseContent + if (self.gzip && !noBody(response.statusCode)) { + var contentEncoding = response.headers['content-encoding'] || 'identity' + contentEncoding = contentEncoding.trim().toLowerCase() + + if (contentEncoding === 'gzip') { + responseContent = zlib.createGunzip() + response.pipe(responseContent) + } else if (contentEncoding === 'deflate') { + responseContent = zlib.createInflate() + response.pipe(responseContent) + } else { + // Since previous versions didn't check for Content-Encoding header, + // ignore any invalid values to preserve backwards-compatibility + if (contentEncoding !== 'identity') { + debug('ignoring unrecognized Content-Encoding ' + contentEncoding) + } + responseContent = response + } + } else { + responseContent = response + } + + if (self.encoding) { + if (self.dests.length !== 0) { + console.error('Ignoring encoding parameter as this stream is being piped to another stream which makes the encoding option invalid.') + } else if (responseContent.setEncoding) { + responseContent.setEncoding(self.encoding) + } else { + // Should only occur on node pre-v0.9.4 (joyent/node@9b5abe5) with + // zlib streams. + // If/When support for 0.9.4 is dropped, this should be unnecessary. + responseContent = responseContent.pipe(stringstream(self.encoding)) + } + } + + if (self._paused) { + responseContent.pause() + } + + self.responseContent = responseContent + + self.emit('response', response) + + self.dests.forEach(function (dest) { + self.pipeDest(dest) + }) + + responseContent.on('data', function (chunk) { + self._destdata = true + self.emit('data', chunk) + }) + responseContent.on('end', function (chunk) { + self.emit('end', chunk) + }) + responseContent.on('error', function (error) { + self.emit('error', error) + }) + responseContent.on('close', function () {self.emit('close')}) + + if (self.callback) { + self.readResponseBody(response) + } + //if no callback + else { + self.on('end', function () { + if (self._aborted) { + debug('aborted', self.uri.href) + return + } + self.emit('complete', response) + }) + } + } + debug('finish init function', self.uri.href) +} + +Request.prototype.readResponseBody = function (response) { + var self = this + debug('reading response\'s body') + var buffer = bl() + , strings = [] + + self.on('data', function (chunk) { + if (Buffer.isBuffer(chunk)) { + buffer.append(chunk) + } else { + strings.push(chunk) + } + }) + self.on('end', function () { + debug('end event', self.uri.href) + if (self._aborted) { + debug('aborted', self.uri.href) + // `buffer` is defined in the parent scope and used in a closure it exists for the life of the request. + // This can lead to leaky behavior if the user retains a reference to the request object. + buffer.destroy() + return + } + + if (buffer.length) { + debug('has body', self.uri.href, buffer.length) + if (self.encoding === null) { + // response.body = buffer + // can't move to this until https://github.com/rvagg/bl/issues/13 + response.body = buffer.slice() + } else { + response.body = buffer.toString(self.encoding) + } + // `buffer` is defined in the parent scope and used in a closure it exists for the life of the Request. + // This can lead to leaky behavior if the user retains a reference to the request object. + buffer.destroy() + } else if (strings.length) { + // The UTF8 BOM [0xEF,0xBB,0xBF] is converted to [0xFE,0xFF] in the JS UTC16/UCS2 representation. + // Strip this value out when the encoding is set to 'utf8', as upstream consumers won't expect it and it breaks JSON.parse(). + if (self.encoding === 'utf8' && strings[0].length > 0 && strings[0][0] === '\uFEFF') { + strings[0] = strings[0].substring(1) + } + response.body = strings.join('') + } + + if (self._json) { + try { + response.body = JSON.parse(response.body, self._jsonReviver) + } catch (e) { + debug('invalid JSON received', self.uri.href) + } + } + debug('emitting complete', self.uri.href) + if (typeof response.body === 'undefined' && !self._json) { + response.body = self.encoding === null ? new Buffer(0) : '' + } + self.emit('complete', response, response.body) + }) +} + +Request.prototype.abort = function () { + var self = this + self._aborted = true + + if (self.req) { + self.req.abort() + } + else if (self.response) { + self.response.destroy() + } + + self.emit('abort') +} + +Request.prototype.pipeDest = function (dest) { + var self = this + var response = self.response + // Called after the response is received + if (dest.headers && !dest.headersSent) { + if (response.caseless.has('content-type')) { + var ctname = response.caseless.has('content-type') + if (dest.setHeader) { + dest.setHeader(ctname, response.headers[ctname]) + } + else { + dest.headers[ctname] = response.headers[ctname] + } + } + + if (response.caseless.has('content-length')) { + var clname = response.caseless.has('content-length') + if (dest.setHeader) { + dest.setHeader(clname, response.headers[clname]) + } else { + dest.headers[clname] = response.headers[clname] + } + } + } + if (dest.setHeader && !dest.headersSent) { + for (var i in response.headers) { + // If the response content is being decoded, the Content-Encoding header + // of the response doesn't represent the piped content, so don't pass it. + if (!self.gzip || i !== 'content-encoding') { + dest.setHeader(i, response.headers[i]) + } + } + dest.statusCode = response.statusCode + } + if (self.pipefilter) { + self.pipefilter(response, dest) + } +} + +Request.prototype.qs = function (q, clobber) { + var self = this + var base + if (!clobber && self.uri.query) { + base = self._qs.parse(self.uri.query) + } else { + base = {} + } + + for (var i in q) { + base[i] = q[i] + } + + var qs = self._qs.stringify(base) + + if (qs === '') { + return self + } + + self.uri = url.parse(self.uri.href.split('?')[0] + '?' + qs) + self.url = self.uri + self.path = self.uri.path + + if (self.uri.host === 'unix') { + self.enableUnixSocket() + } + + return self +} +Request.prototype.form = function (form) { + var self = this + if (form) { + if (!/^application\/x-www-form-urlencoded\b/.test(self.getHeader('content-type'))) { + self.setHeader('content-type', 'application/x-www-form-urlencoded') + } + self.body = (typeof form === 'string') + ? self._qs.rfc3986(form.toString('utf8')) + : self._qs.stringify(form).toString('utf8') + return self + } + // create form-data object + self._form = new FormData() + self._form.on('error', function(err) { + err.message = 'form-data: ' + err.message + self.emit('error', err) + self.abort() + }) + return self._form +} +Request.prototype.multipart = function (multipart) { + var self = this + + self._multipart.onRequest(multipart) + + if (!self._multipart.chunked) { + self.body = self._multipart.body + } + + return self +} +Request.prototype.json = function (val) { + var self = this + + if (!self.hasHeader('accept')) { + self.setHeader('accept', 'application/json') + } + + if (typeof self.jsonReplacer === 'function') { + self._jsonReplacer = self.jsonReplacer + } + + self._json = true + if (typeof val === 'boolean') { + if (self.body !== undefined) { + if (!/^application\/x-www-form-urlencoded\b/.test(self.getHeader('content-type'))) { + self.body = safeStringify(self.body, self._jsonReplacer) + } else { + self.body = self._qs.rfc3986(self.body) + } + if (!self.hasHeader('content-type')) { + self.setHeader('content-type', 'application/json') + } + } + } else { + self.body = safeStringify(val, self._jsonReplacer) + if (!self.hasHeader('content-type')) { + self.setHeader('content-type', 'application/json') + } + } + + if (typeof self.jsonReviver === 'function') { + self._jsonReviver = self.jsonReviver + } + + return self +} +Request.prototype.getHeader = function (name, headers) { + var self = this + var result, re, match + if (!headers) { + headers = self.headers + } + Object.keys(headers).forEach(function (key) { + if (key.length !== name.length) { + return + } + re = new RegExp(name, 'i') + match = key.match(re) + if (match) { + result = headers[key] + } + }) + return result +} +Request.prototype.enableUnixSocket = function () { + // Get the socket & request paths from the URL + var unixParts = this.uri.path.split(':') + , host = unixParts[0] + , path = unixParts[1] + // Apply unix properties to request + this.socketPath = host + this.uri.pathname = path + this.uri.path = path + this.uri.host = host + this.uri.hostname = host + this.uri.isUnix = true +} + + +Request.prototype.auth = function (user, pass, sendImmediately, bearer) { + var self = this + + self._auth.onRequest(user, pass, sendImmediately, bearer) + + return self +} +Request.prototype.aws = function (opts, now) { + var self = this + + if (!now) { + self._aws = opts + return self + } + + if (opts.sign_version == 4 || opts.sign_version == '4') { + // use aws4 + var options = { + host: self.uri.host, + path: self.uri.path, + method: self.method, + headers: { + 'content-type': self.getHeader('content-type') || '' + }, + body: self.body + } + var signRes = aws4.sign(options, { + accessKeyId: opts.key, + secretAccessKey: opts.secret + }) + self.setHeader('authorization', signRes.headers.Authorization) + self.setHeader('x-amz-date', signRes.headers['X-Amz-Date']) + } + else { + // default: use aws-sign2 + var date = new Date() + self.setHeader('date', date.toUTCString()) + var auth = + { key: opts.key + , secret: opts.secret + , verb: self.method.toUpperCase() + , date: date + , contentType: self.getHeader('content-type') || '' + , md5: self.getHeader('content-md5') || '' + , amazonHeaders: aws2.canonicalizeHeaders(self.headers) + } + var path = self.uri.path + if (opts.bucket && path) { + auth.resource = '/' + opts.bucket + path + } else if (opts.bucket && !path) { + auth.resource = '/' + opts.bucket + } else if (!opts.bucket && path) { + auth.resource = path + } else if (!opts.bucket && !path) { + auth.resource = '/' + } + auth.resource = aws2.canonicalizeResource(auth.resource) + self.setHeader('authorization', aws2.authorization(auth)) + } + + return self +} +Request.prototype.httpSignature = function (opts) { + var self = this + httpSignature.signRequest({ + getHeader: function(header) { + return self.getHeader(header, self.headers) + }, + setHeader: function(header, value) { + self.setHeader(header, value) + }, + method: self.method, + path: self.path + }, opts) + debug('httpSignature authorization', self.getHeader('authorization')) + + return self +} +Request.prototype.hawk = function (opts) { + var self = this + self.setHeader('Authorization', hawk.client.header(self.uri, self.method, opts).field) +} +Request.prototype.oauth = function (_oauth) { + var self = this + + self._oauth.onRequest(_oauth) + + return self +} + +Request.prototype.jar = function (jar) { + var self = this + var cookies + + if (self._redirect.redirectsFollowed === 0) { + self.originalCookieHeader = self.getHeader('cookie') + } + + if (!jar) { + // disable cookies + cookies = false + self._disableCookies = true + } else { + var targetCookieJar = (jar && jar.getCookieString) ? jar : globalCookieJar + var urihref = self.uri.href + //fetch cookie in the Specified host + if (targetCookieJar) { + cookies = targetCookieJar.getCookieString(urihref) + } + } + + //if need cookie and cookie is not empty + if (cookies && cookies.length) { + if (self.originalCookieHeader) { + // Don't overwrite existing Cookie header + self.setHeader('cookie', self.originalCookieHeader + '; ' + cookies) + } else { + self.setHeader('cookie', cookies) + } + } + self._jar = jar + return self +} + + +// Stream API +Request.prototype.pipe = function (dest, opts) { + var self = this + + if (self.response) { + if (self._destdata) { + self.emit('error', new Error('You cannot pipe after data has been emitted from the response.')) + } else if (self._ended) { + self.emit('error', new Error('You cannot pipe after the response has been ended.')) + } else { + stream.Stream.prototype.pipe.call(self, dest, opts) + self.pipeDest(dest) + return dest + } + } else { + self.dests.push(dest) + stream.Stream.prototype.pipe.call(self, dest, opts) + return dest + } +} +Request.prototype.write = function () { + var self = this + if (self._aborted) {return} + + if (!self._started) { + self.start() + } + if (self.req) { + return self.req.write.apply(self.req, arguments) + } +} +Request.prototype.end = function (chunk) { + var self = this + if (self._aborted) {return} + + if (chunk) { + self.write(chunk) + } + if (!self._started) { + self.start() + } + if (self.req) { + self.req.end() + } +} +Request.prototype.pause = function () { + var self = this + if (!self.responseContent) { + self._paused = true + } else { + self.responseContent.pause.apply(self.responseContent, arguments) + } +} +Request.prototype.resume = function () { + var self = this + if (!self.responseContent) { + self._paused = false + } else { + self.responseContent.resume.apply(self.responseContent, arguments) + } +} +Request.prototype.destroy = function () { + var self = this + if (!self._ended) { + self.end() + } else if (self.response) { + self.response.destroy() + } +} + +Request.defaultProxyHeaderWhiteList = + Tunnel.defaultProxyHeaderWhiteList.slice() + +Request.defaultProxyHeaderExclusiveList = + Tunnel.defaultProxyHeaderExclusiveList.slice() + +// Exports + +Request.prototype.toJSON = requestToJSON +module.exports = Request diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/.npmignore new file mode 100644 index 00000000..e7726a07 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/.npmignore @@ -0,0 +1,2 @@ +/node_modules/* +npm-debug.log diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/License b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/License new file mode 100644 index 00000000..0b58de37 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/License @@ -0,0 +1,21 @@ +Copyright (c) 2011: +Tim Koschützki (tim@debuggable.com) +Felix Geisendörfer (felix@debuggable.com) + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/Makefile b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/Makefile new file mode 100644 index 00000000..eee21a99 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/Makefile @@ -0,0 +1,22 @@ +SHELL := /bin/bash + +test: + @node test/runner.js + +release-major: test + npm version major -m "Release %s" + git push + npm publish + +release-minor: test + npm version minor -m "Release %s" + git push + npm publish + +release-patch: test + npm version patch -m "Release %s" + git push + npm publish + +.PHONY: test + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/Readme.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/Readme.md new file mode 100644 index 00000000..eee05f7b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/Readme.md @@ -0,0 +1,215 @@ +# retry + +Abstraction for exponential and custom retry strategies for failed operations. + +## Installation + + npm install retry + +## Current Status + +This module has been tested and is ready to be used. + +## Tutorial + +The example below will retry a potentially failing `dns.resolve` operation +`10` times using an exponential backoff strategy. With the default settings, this +means the last attempt is made after `17 minutes and 3 seconds`. + +``` javascript +var dns = require('dns'); +var retry = require('retry'); + +function faultTolerantResolve(address, cb) { + var operation = retry.operation(); + + operation.attempt(function(currentAttempt) { + dns.resolve(address, function(err, addresses) { + if (operation.retry(err)) { + return; + } + + cb(err ? operation.mainError() : null, addresses); + }); + }); +} + +faultTolerantResolve('nodejs.org', function(err, addresses) { + console.log(err, addresses); +}); +``` + +Of course you can also configure the factors that go into the exponential +backoff. See the API documentation below for all available settings. +currentAttempt is an int representing the number of attempts so far. + +``` javascript +var operation = retry.operation({ + retries: 5, + factor: 3, + minTimeout: 1 * 1000, + maxTimeout: 60 * 1000, + randomize: true, +}); +``` + +## API + +### retry.operation([options]) + +Creates a new `RetryOperation` object. `options` is the same as `retry.timeouts()`'s `options`, with two additions: + +* `forever`: Whether to retry forever, defaults to `false`. +* `unref`: Wether to [unref](https://nodejs.org/api/timers.html#timers_unref) the setTimeout's, defaults to `false`. + +### retry.timeouts([options]) + +Returns an array of timeouts. All time `options` and return values are in +milliseconds. If `options` is an array, a copy of that array is returned. + +`options` is a JS object that can contain any of the following keys: + +* `retries`: The maximum amount of times to retry the operation. Default is `10`. +* `factor`: The exponential factor to use. Default is `2`. +* `minTimeout`: The number of milliseconds before starting the first retry. Default is `1000`. +* `maxTimeout`: The maximum number of milliseconds between two retries. Default is `Infinity`. +* `randomize`: Randomizes the timeouts by multiplying with a factor between `1` to `2`. Default is `false`. + +The formula used to calculate the individual timeouts is: + +``` +Math.min(random * minTimeout * Math.pow(factor, attempt), maxTimeout) +``` + +Have a look at [this article][article] for a better explanation of approach. + +If you want to tune your `factor` / `times` settings to attempt the last retry +after a certain amount of time, you can use wolfram alpha. For example in order +to tune for `10` attempts in `5 minutes`, you can use this equation: + +![screenshot](https://github.com/tim-kos/node-retry/raw/master/equation.gif) + +Explaining the various values from left to right: + +* `k = 0 ... 9`: The `retries` value (10) +* `1000`: The `minTimeout` value in ms (1000) +* `x^k`: No need to change this, `x` will be your resulting factor +* `5 * 60 * 1000`: The desired total amount of time for retrying in ms (5 minutes) + +To make this a little easier for you, use wolfram alpha to do the calculations: + + + +[article]: http://dthain.blogspot.com/2009/02/exponential-backoff-in-distributed.html + +### retry.createTimeout(attempt, opts) + +Returns a new `timeout` (integer in milliseconds) based on the given parameters. + +`attempt` is an integer representing for which retry the timeout should be calculated. If your retry operation was executed 4 times you had one attempt and 3 retries. If you then want to calculate a new timeout, you should set `attempt` to 4 (attempts are zero-indexed). + +`opts` can include `factor`, `minTimeout`, `randomize` (boolean) and `maxTimeout`. They are documented above. + +`retry.createTimeout()` is used internally by `retry.timeouts()` and is public for you to be able to create your own timeouts for reinserting an item, see [issue #13](https://github.com/tim-kos/node-retry/issues/13). + +### retry.wrap(obj, [options], [methodNames]) + +Wrap all functions of the `obj` with retry. Optionally you can pass operation options and +an array of method names which need to be wrapped. + +``` +retry.wrap(obj) + +retry.wrap(obj, ['method1', 'method2']) + +retry.wrap(obj, {retries: 3}) + +retry.wrap(obj, {retries: 3}, ['method1', 'method2']) +``` +The `options` object can take any options that the usual call to `retry.operation` can take. + +### new RetryOperation(timeouts, [options]) + +Creates a new `RetryOperation` where `timeouts` is an array where each value is +a timeout given in milliseconds. + +Available options: +* `forever`: Whether to retry forever, defaults to `false`. +* `unref`: Wether to [unref](https://nodejs.org/api/timers.html#timers_unref) the setTimeout's, defaults to `false`. + +If `forever` is true, the following changes happen: +* `RetryOperation.errors()` will only output an array of one item: the last error. +* `RetryOperation` will repeatedly use the `timeouts` array. Once all of its timeouts have been used up, it restarts with the first timeout, then uses the second and so on. + +#### retryOperation.errors() + +Returns an array of all errors that have been passed to +`retryOperation.retry()` so far. + +#### retryOperation.mainError() + +A reference to the error object that occured most frequently. Errors are +compared using the `error.message` property. + +If multiple error messages occured the same amount of time, the last error +object with that message is returned. + +If no errors occured so far, the value is `null`. + +#### retryOperation.attempt(fn, timeoutOps) + +Defines the function `fn` that is to be retried and executes it for the first +time right away. The `fn` function can receive an optional `currentAttempt` callback that represents the number of attempts to execute `fn` so far. + +Optionally defines `timeoutOps` which is an object having a property `timeout` in miliseconds and a property `cb` callback function. +Whenever your retry operation takes longer than `timeout` to execute, the timeout callback function `cb` is called. + + +#### retryOperation.try(fn) + +This is an alias for `retryOperation.attempt(fn)`. This is deprecated. Please use `retryOperation.attempt(fn)` instead. + +#### retryOperation.start(fn) + +This is an alias for `retryOperation.attempt(fn)`. This is deprecated. Please use `retryOperation.attempt(fn)` instead. + +#### retryOperation.retry(error) + +Returns `false` when no `error` value is given, or the maximum amount of retries +has been reached. + +Otherwise it returns `true`, and retries the operation after the timeout for +the current attempt number. + +#### retryOperation.stop() + +Allows you to stop the operation being retried. Useful for aborting the operation on a fatal error etc. + +#### retryOperation.attempts() + +Returns an int representing the number of attempts it took to call `fn` before it was successful. + +## License + +retry is licensed under the MIT license. + + +# Changelog + +0.10.0 Adding `stop` functionality, thanks to @maxnachlinger. + +0.9.0 Adding `unref` functionality, thanks to @satazor. + +0.8.0 Implementing retry.wrap. + +0.7.0 Some bug fixes and made retry.createTimeout() public. Fixed issues [#10](https://github.com/tim-kos/node-retry/issues/10), [#12](https://github.com/tim-kos/node-retry/issues/12), and [#13](https://github.com/tim-kos/node-retry/issues/13). + +0.6.0 Introduced optional timeOps parameter for the attempt() function which is an object having a property timeout in milliseconds and a property cb callback function. Whenever your retry operation takes longer than timeout to execute, the timeout callback function cb is called. + +0.5.0 Some minor refactoring. + +0.4.0 Changed retryOperation.try() to retryOperation.attempt(). Deprecated the aliases start() and try() for it. + +0.3.0 Added retryOperation.start() which is an alias for retryOperation.try(). + +0.2.0 Added attempts() function and parameter to retryOperation.try() representing the number of attempts it took to call fn(). diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/equation.gif b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/equation.gif new file mode 100644 index 00000000..97107237 Binary files /dev/null and b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/equation.gif differ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/example/dns.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/example/dns.js new file mode 100644 index 00000000..446729b6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/example/dns.js @@ -0,0 +1,31 @@ +var dns = require('dns'); +var retry = require('../lib/retry'); + +function faultTolerantResolve(address, cb) { + var opts = { + retries: 2, + factor: 2, + minTimeout: 1 * 1000, + maxTimeout: 2 * 1000, + randomize: true + }; + var operation = retry.operation(opts); + + operation.attempt(function(currentAttempt) { + dns.resolve(address, function(err, addresses) { + if (operation.retry(err)) { + return; + } + + cb(operation.mainError(), operation.errors(), addresses); + }); + }); +} + +faultTolerantResolve('nodejs.org', function(err, errors, addresses) { + console.warn('err:'); + console.log(err); + + console.warn('addresses:'); + console.log(addresses); +}); \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/example/stop.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/example/stop.js new file mode 100644 index 00000000..e1ceafee --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/example/stop.js @@ -0,0 +1,40 @@ +var retry = require('../lib/retry'); + +function attemptAsyncOperation(someInput, cb) { + var opts = { + retries: 2, + factor: 2, + minTimeout: 1 * 1000, + maxTimeout: 2 * 1000, + randomize: true + }; + var operation = retry.operation(opts); + + operation.attempt(function(currentAttempt) { + failingAsyncOperation(someInput, function(err, result) { + + if (err && err.message === 'A fatal error') { + operation.stop(); + return cb(err); + } + + if (operation.retry(err)) { + return; + } + + cb(operation.mainError(), operation.errors(), result); + }); + }); +} + +attemptAsyncOperation('test input', function(err, errors, result) { + console.warn('err:'); + console.log(err); + + console.warn('result:'); + console.log(result); +}); + +function failingAsyncOperation(input, cb) { + return setImmediate(cb.bind(null, new Error('A fatal error'))); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/index.js new file mode 100644 index 00000000..ee62f3a1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/index.js @@ -0,0 +1 @@ +module.exports = require('./lib/retry'); \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/lib/retry.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/lib/retry.js new file mode 100644 index 00000000..77428cfd --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/lib/retry.js @@ -0,0 +1,99 @@ +var RetryOperation = require('./retry_operation'); + +exports.operation = function(options) { + var timeouts = exports.timeouts(options); + return new RetryOperation(timeouts, { + forever: options && options.forever, + unref: options && options.unref + }); +}; + +exports.timeouts = function(options) { + if (options instanceof Array) { + return [].concat(options); + } + + var opts = { + retries: 10, + factor: 2, + minTimeout: 1 * 1000, + maxTimeout: Infinity, + randomize: false + }; + for (var key in options) { + opts[key] = options[key]; + } + + if (opts.minTimeout > opts.maxTimeout) { + throw new Error('minTimeout is greater than maxTimeout'); + } + + var timeouts = []; + for (var i = 0; i < opts.retries; i++) { + timeouts.push(this.createTimeout(i, opts)); + } + + if (options && options.forever && !timeouts.length) { + timeouts.push(this.createTimeout(i, opts)); + } + + // sort the array numerically ascending + timeouts.sort(function(a,b) { + return a - b; + }); + + return timeouts; +}; + +exports.createTimeout = function(attempt, opts) { + var random = (opts.randomize) + ? (Math.random() + 1) + : 1; + + var timeout = Math.round(random * opts.minTimeout * Math.pow(opts.factor, attempt)); + timeout = Math.min(timeout, opts.maxTimeout); + + return timeout; +}; + +exports.wrap = function(obj, options, methods) { + if (options instanceof Array) { + methods = options; + options = null; + } + + if (!methods) { + methods = []; + for (var key in obj) { + if (typeof obj[key] === 'function') { + methods.push(key); + } + } + } + + for (var i = 0; i < methods.length; i++) { + var method = methods[i]; + var original = obj[method]; + + obj[method] = function retryWrapper() { + var op = exports.operation(options); + var args = Array.prototype.slice.call(arguments); + var callback = args.pop(); + + args.push(function(err) { + if (op.retry(err)) { + return; + } + if (err) { + arguments[0] = op.mainError(); + } + callback.apply(this, arguments); + }); + + op.attempt(function() { + original.apply(obj, args); + }); + }; + obj[method].options = options; + } +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/lib/retry_operation.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/lib/retry_operation.js new file mode 100644 index 00000000..2b3db8e1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/lib/retry_operation.js @@ -0,0 +1,143 @@ +function RetryOperation(timeouts, options) { + // Compatibility for the old (timeouts, retryForever) signature + if (typeof options === 'boolean') { + options = { forever: options }; + } + + this._timeouts = timeouts; + this._options = options || {}; + this._fn = null; + this._errors = []; + this._attempts = 1; + this._operationTimeout = null; + this._operationTimeoutCb = null; + this._timeout = null; + + if (this._options.forever) { + this._cachedTimeouts = this._timeouts.slice(0); + } +} +module.exports = RetryOperation; + +RetryOperation.prototype.stop = function() { + if (this._timeout) { + clearTimeout(this._timeout); + } + + this._timeouts = []; + this._cachedTimeouts = null; +}; + +RetryOperation.prototype.retry = function(err) { + if (this._timeout) { + clearTimeout(this._timeout); + } + + if (!err) { + return false; + } + + this._errors.push(err); + + var timeout = this._timeouts.shift(); + if (timeout === undefined) { + if (this._cachedTimeouts) { + // retry forever, only keep last error + this._errors.splice(this._errors.length - 1, this._errors.length); + this._timeouts = this._cachedTimeouts.slice(0); + timeout = this._timeouts.shift(); + } else { + return false; + } + } + + var self = this; + var timer = setTimeout(function() { + self._attempts++; + + if (self._operationTimeoutCb) { + self._timeout = setTimeout(function() { + self._operationTimeoutCb(self._attempts); + }, self._operationTimeout); + + if (this._options.unref) { + self._timeout.unref(); + } + } + + self._fn(self._attempts); + }, timeout); + + if (this._options.unref) { + timer.unref(); + } + + return true; +}; + +RetryOperation.prototype.attempt = function(fn, timeoutOps) { + this._fn = fn; + + if (timeoutOps) { + if (timeoutOps.timeout) { + this._operationTimeout = timeoutOps.timeout; + } + if (timeoutOps.cb) { + this._operationTimeoutCb = timeoutOps.cb; + } + } + + var self = this; + if (this._operationTimeoutCb) { + this._timeout = setTimeout(function() { + self._operationTimeoutCb(); + }, self._operationTimeout); + } + + this._fn(this._attempts); +}; + +RetryOperation.prototype.try = function(fn) { + console.log('Using RetryOperation.try() is deprecated'); + this.attempt(fn); +}; + +RetryOperation.prototype.start = function(fn) { + console.log('Using RetryOperation.start() is deprecated'); + this.attempt(fn); +}; + +RetryOperation.prototype.start = RetryOperation.prototype.try; + +RetryOperation.prototype.errors = function() { + return this._errors; +}; + +RetryOperation.prototype.attempts = function() { + return this._attempts; +}; + +RetryOperation.prototype.mainError = function() { + if (this._errors.length === 0) { + return null; + } + + var counts = {}; + var mainError = null; + var mainErrorCount = 0; + + for (var i = 0; i < this._errors.length; i++) { + var error = this._errors[i]; + var message = error.message; + var count = (counts[message] || 0) + 1; + + counts[message] = count; + + if (count >= mainErrorCount) { + mainError = error; + mainErrorCount = count; + } + } + + return mainError; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/package.json new file mode 100644 index 00000000..7d4a38fc --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/package.json @@ -0,0 +1,58 @@ +{ + "author": { + "name": "Tim Koschützki", + "email": "tim@debuggable.com", + "url": "http://debuggable.com/" + }, + "name": "retry", + "description": "Abstraction for exponential and custom retry strategies for failed operations.", + "license": "MIT", + "version": "0.10.0", + "homepage": "https://github.com/tim-kos/node-retry", + "repository": { + "type": "git", + "url": "git://github.com/tim-kos/node-retry.git" + }, + "directories": { + "lib": "./lib" + }, + "main": "index", + "engines": { + "node": "*" + }, + "dependencies": {}, + "devDependencies": { + "fake": "0.2.0", + "far": "0.0.1" + }, + "gitHead": "0616e6a6ebc49b5a36b619c8f7c414ced8c3813b", + "bugs": { + "url": "https://github.com/tim-kos/node-retry/issues" + }, + "_id": "retry@0.10.0", + "scripts": {}, + "_shasum": "649e15ca408422d98318161935e7f7d652d435dd", + "_from": "retry@0.10.0", + "_npmVersion": "2.1.7", + "_nodeVersion": "4.2.1", + "_npmUser": { + "name": "tim-kos", + "email": "tim@debuggable.com" + }, + "maintainers": [ + { + "name": "tim-kos", + "email": "tim@debuggable.com" + } + ], + "dist": { + "shasum": "649e15ca408422d98318161935e7f7d652d435dd", + "tarball": "https://registry.npmjs.org/retry/-/retry-0.10.0.tgz" + }, + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/retry-0.10.0.tgz_1471682099847_0.5031970851123333" + }, + "_resolved": "https://registry.npmjs.org/retry/-/retry-0.10.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/test/common.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/test/common.js new file mode 100644 index 00000000..22472069 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/test/common.js @@ -0,0 +1,10 @@ +var common = module.exports; +var path = require('path'); + +var rootDir = path.join(__dirname, '..'); +common.dir = { + lib: rootDir + '/lib' +}; + +common.assert = require('assert'); +common.fake = require('fake'); \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/test/integration/test-forever.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/test/integration/test-forever.js new file mode 100644 index 00000000..b41307cb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/test/integration/test-forever.js @@ -0,0 +1,24 @@ +var common = require('../common'); +var assert = common.assert; +var retry = require(common.dir.lib + '/retry'); + +(function testForeverUsesFirstTimeout() { + var operation = retry.operation({ + retries: 0, + minTimeout: 100, + maxTimeout: 100, + forever: true + }); + + operation.attempt(function(numAttempt) { + console.log('>numAttempt', numAttempt); + var err = new Error("foo"); + if (numAttempt == 10) { + operation.stop(); + } + + if (operation.retry(err)) { + return; + } + }); +})(); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/test/integration/test-retry-operation.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/test/integration/test-retry-operation.js new file mode 100644 index 00000000..91693642 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/test/integration/test-retry-operation.js @@ -0,0 +1,176 @@ +var common = require('../common'); +var assert = common.assert; +var fake = common.fake.create(); +var retry = require(common.dir.lib + '/retry'); + +(function testErrors() { + var operation = retry.operation(); + + var error = new Error('some error'); + var error2 = new Error('some other error'); + operation._errors.push(error); + operation._errors.push(error2); + + assert.deepEqual(operation.errors(), [error, error2]); +})(); + +(function testMainErrorReturnsMostFrequentError() { + var operation = retry.operation(); + var error = new Error('some error'); + var error2 = new Error('some other error'); + + operation._errors.push(error); + operation._errors.push(error2); + operation._errors.push(error); + + assert.strictEqual(operation.mainError(), error); +})(); + +(function testMainErrorReturnsLastErrorOnEqualCount() { + var operation = retry.operation(); + var error = new Error('some error'); + var error2 = new Error('some other error'); + + operation._errors.push(error); + operation._errors.push(error2); + + assert.strictEqual(operation.mainError(), error2); +})(); + +(function testAttempt() { + var operation = retry.operation(); + var fn = new Function(); + + var timeoutOpts = { + timeout: 1, + cb: function() {} + }; + operation.attempt(fn, timeoutOpts); + + assert.strictEqual(fn, operation._fn); + assert.strictEqual(timeoutOpts.timeout, operation._operationTimeout); + assert.strictEqual(timeoutOpts.cb, operation._operationTimeoutCb); +})(); + +(function testRetry() { + var times = 3; + var error = new Error('some error'); + var operation = retry.operation([1, 2, 3]); + var attempts = 0; + + var finalCallback = fake.callback('finalCallback'); + fake.expectAnytime(finalCallback); + + var fn = function() { + operation.attempt(function(currentAttempt) { + attempts++; + assert.equal(currentAttempt, attempts); + if (operation.retry(error)) { + return; + } + + assert.strictEqual(attempts, 4); + assert.strictEqual(operation.attempts(), attempts); + assert.strictEqual(operation.mainError(), error); + finalCallback(); + }); + }; + + fn(); +})(); + +(function testRetryForever() { + var error = new Error('some error'); + var operation = retry.operation({ retries: 3, forever: true }); + var attempts = 0; + + var finalCallback = fake.callback('finalCallback'); + fake.expectAnytime(finalCallback); + + var fn = function() { + operation.attempt(function(currentAttempt) { + attempts++; + assert.equal(currentAttempt, attempts); + if (attempts !== 6 && operation.retry(error)) { + return; + } + + assert.strictEqual(attempts, 6); + assert.strictEqual(operation.attempts(), attempts); + assert.strictEqual(operation.mainError(), error); + finalCallback(); + }); + }; + + fn(); +})(); + +(function testRetryForeverNoRetries() { + var error = new Error('some error'); + var delay = 50 + var operation = retry.operation({ + retries: null, + forever: true, + minTimeout: delay, + maxTimeout: delay + }); + + var attempts = 0; + var startTime = new Date().getTime(); + + var finalCallback = fake.callback('finalCallback'); + fake.expectAnytime(finalCallback); + + var fn = function() { + operation.attempt(function(currentAttempt) { + attempts++; + assert.equal(currentAttempt, attempts); + if (attempts !== 4 && operation.retry(error)) { + return; + } + + var endTime = new Date().getTime(); + var minTime = startTime + (delay * 3); + var maxTime = minTime + 20 // add a little headroom for code execution time + assert(endTime > minTime) + assert(endTime < maxTime) + assert.strictEqual(attempts, 4); + assert.strictEqual(operation.attempts(), attempts); + assert.strictEqual(operation.mainError(), error); + finalCallback(); + }); + }; + + fn(); +})(); + +(function testStop() { + var error = new Error('some error'); + var operation = retry.operation([1, 2, 3]); + var attempts = 0; + + var finalCallback = fake.callback('finalCallback'); + fake.expectAnytime(finalCallback); + + var fn = function() { + operation.attempt(function(currentAttempt) { + attempts++; + assert.equal(currentAttempt, attempts); + + if (attempts === 2) { + operation.stop(); + + assert.strictEqual(attempts, 2); + assert.strictEqual(operation.attempts(), attempts); + assert.strictEqual(operation.mainError(), error); + finalCallback(); + } + + if (operation.retry(error)) { + return; + } + }); + }; + + fn(); +})(); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/test/integration/test-retry-wrap.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/test/integration/test-retry-wrap.js new file mode 100644 index 00000000..7ca8bc7e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/test/integration/test-retry-wrap.js @@ -0,0 +1,77 @@ +var common = require('../common'); +var assert = common.assert; +var fake = common.fake.create(); +var retry = require(common.dir.lib + '/retry'); + +function getLib() { + return { + fn1: function() {}, + fn2: function() {}, + fn3: function() {} + }; +} + +(function wrapAll() { + var lib = getLib(); + retry.wrap(lib); + assert.equal(lib.fn1.name, 'retryWrapper'); + assert.equal(lib.fn2.name, 'retryWrapper'); + assert.equal(lib.fn3.name, 'retryWrapper'); +}()); + +(function wrapAllPassOptions() { + var lib = getLib(); + retry.wrap(lib, {retries: 2}); + assert.equal(lib.fn1.name, 'retryWrapper'); + assert.equal(lib.fn2.name, 'retryWrapper'); + assert.equal(lib.fn3.name, 'retryWrapper'); + assert.equal(lib.fn1.options.retries, 2); + assert.equal(lib.fn2.options.retries, 2); + assert.equal(lib.fn3.options.retries, 2); +}()); + +(function wrapDefined() { + var lib = getLib(); + retry.wrap(lib, ['fn2', 'fn3']); + assert.notEqual(lib.fn1.name, 'retryWrapper'); + assert.equal(lib.fn2.name, 'retryWrapper'); + assert.equal(lib.fn3.name, 'retryWrapper'); +}()); + +(function wrapDefinedAndPassOptions() { + var lib = getLib(); + retry.wrap(lib, {retries: 2}, ['fn2', 'fn3']); + assert.notEqual(lib.fn1.name, 'retryWrapper'); + assert.equal(lib.fn2.name, 'retryWrapper'); + assert.equal(lib.fn3.name, 'retryWrapper'); + assert.equal(lib.fn2.options.retries, 2); + assert.equal(lib.fn3.options.retries, 2); +}()); + +(function runWrappedWithoutError() { + var callbackCalled; + var lib = {method: function(a, b, callback) { + assert.equal(a, 1); + assert.equal(b, 2); + assert.equal(typeof callback, 'function'); + callback(); + }}; + retry.wrap(lib); + lib.method(1, 2, function() { + callbackCalled = true; + }); + assert.ok(callbackCalled); +}()); + +(function runWrappedWithError() { + var callbackCalled; + var lib = {method: function(callback) { + callback(new Error('Some error')); + }}; + retry.wrap(lib, {retries: 1}); + lib.method(function(err) { + callbackCalled = true; + assert.ok(err instanceof Error); + }); + assert.ok(!callbackCalled); +}()); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/test/integration/test-timeouts.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/test/integration/test-timeouts.js new file mode 100644 index 00000000..7206b0fb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/test/integration/test-timeouts.js @@ -0,0 +1,69 @@ +var common = require('../common'); +var assert = common.assert; +var retry = require(common.dir.lib + '/retry'); + +(function testDefaultValues() { + var timeouts = retry.timeouts(); + + assert.equal(timeouts.length, 10); + assert.equal(timeouts[0], 1000); + assert.equal(timeouts[1], 2000); + assert.equal(timeouts[2], 4000); +})(); + +(function testDefaultValuesWithRandomize() { + var minTimeout = 5000; + var timeouts = retry.timeouts({ + minTimeout: minTimeout, + randomize: true + }); + + assert.equal(timeouts.length, 10); + assert.ok(timeouts[0] > minTimeout); + assert.ok(timeouts[1] > timeouts[0]); + assert.ok(timeouts[2] > timeouts[1]); +})(); + +(function testPassedTimeoutsAreUsed() { + var timeoutsArray = [1000, 2000, 3000]; + var timeouts = retry.timeouts(timeoutsArray); + assert.deepEqual(timeouts, timeoutsArray); + assert.notStrictEqual(timeouts, timeoutsArray); +})(); + +(function testTimeoutsAreWithinBoundaries() { + var minTimeout = 1000; + var maxTimeout = 10000; + var timeouts = retry.timeouts({ + minTimeout: minTimeout, + maxTimeout: maxTimeout + }); + for (var i = 0; i < timeouts; i++) { + assert.ok(timeouts[i] >= minTimeout); + assert.ok(timeouts[i] <= maxTimeout); + } +})(); + +(function testTimeoutsAreIncremental() { + var timeouts = retry.timeouts(); + var lastTimeout = timeouts[0]; + for (var i = 0; i < timeouts; i++) { + assert.ok(timeouts[i] > lastTimeout); + lastTimeout = timeouts[i]; + } +})(); + +(function testTimeoutsAreIncrementalForFactorsLessThanOne() { + var timeouts = retry.timeouts({ + retries: 3, + factor: 0.5 + }); + + var expected = [250, 500, 1000]; + assert.deepEqual(expected, timeouts); +})(); + +(function testRetries() { + var timeouts = retry.timeouts({retries: 2}); + assert.strictEqual(timeouts.length, 2); +})(); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/test/runner.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/test/runner.js new file mode 100644 index 00000000..e0ee2f57 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/retry/test/runner.js @@ -0,0 +1,5 @@ +var far = require('far').create(); + +far.add(__dirname); +far.include(/\/test-.*\.js$/); +far.execute(); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/rimraf/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/rimraf/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/rimraf/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/rimraf/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/rimraf/README.md new file mode 100644 index 00000000..423b8cf8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/rimraf/README.md @@ -0,0 +1,101 @@ +[![Build Status](https://travis-ci.org/isaacs/rimraf.svg?branch=master)](https://travis-ci.org/isaacs/rimraf) [![Dependency Status](https://david-dm.org/isaacs/rimraf.svg)](https://david-dm.org/isaacs/rimraf) [![devDependency Status](https://david-dm.org/isaacs/rimraf/dev-status.svg)](https://david-dm.org/isaacs/rimraf#info=devDependencies) + +The [UNIX command](http://en.wikipedia.org/wiki/Rm_(Unix)) `rm -rf` for node. + +Install with `npm install rimraf`, or just drop rimraf.js somewhere. + +## API + +`rimraf(f, [opts], callback)` + +The first parameter will be interpreted as a globbing pattern for files. If you +want to disable globbing you can do so with `opts.disableGlob` (defaults to +`false`). This might be handy, for instance, if you have filenames that contain +globbing wildcard characters. + +The callback will be called with an error if there is one. Certain +errors are handled for you: + +* Windows: `EBUSY` and `ENOTEMPTY` - rimraf will back off a maximum of + `opts.maxBusyTries` times before giving up, adding 100ms of wait + between each attempt. The default `maxBusyTries` is 3. +* `ENOENT` - If the file doesn't exist, rimraf will return + successfully, since your desired outcome is already the case. +* `EMFILE` - Since `readdir` requires opening a file descriptor, it's + possible to hit `EMFILE` if too many file descriptors are in use. + In the sync case, there's nothing to be done for this. But in the + async case, rimraf will gradually back off with timeouts up to + `opts.emfileWait` ms, which defaults to 1000. + +## options + +* unlink, chmod, stat, lstat, rmdir, readdir, + unlinkSync, chmodSync, statSync, lstatSync, rmdirSync, readdirSync + + In order to use a custom file system library, you can override + specific fs functions on the options object. + + If any of these functions are present on the options object, then + the supplied function will be used instead of the default fs + method. + + Sync methods are only relevant for `rimraf.sync()`, of course. + + For example: + + ```javascript + var myCustomFS = require('some-custom-fs') + + rimraf('some-thing', myCustomFS, callback) + ``` + +* maxBusyTries + + If an `EBUSY`, `ENOTEMPTY`, or `EPERM` error code is encountered + on Windows systems, then rimraf will retry with a linear backoff + wait of 100ms longer on each try. The default maxBusyTries is 3. + + Only relevant for async usage. + +* emfileWait + + If an `EMFILE` error is encountered, then rimraf will retry + repeatedly with a linear backoff of 1ms longer on each try, until + the timeout counter hits this max. The default limit is 1000. + + If you repeatedly encounter `EMFILE` errors, then consider using + [graceful-fs](http://npm.im/graceful-fs) in your program. + + Only relevant for async usage. + +* glob + + Set to `false` to disable [glob](http://npm.im/glob) pattern + matching. + + Set to an object to pass options to the glob module. The default + glob options are `{ nosort: true, silent: true }`. + + Glob version 6 is used in this module. + + Relevant for both sync and async usage. + +* disableGlob + + Set to any non-falsey value to disable globbing entirely. + (Equivalent to setting `glob: false`.) + +## rimraf.sync + +It can remove stuff synchronously, too. But that's not so good. Use +the async API. It's better. + +## CLI + +If installed with `npm install rimraf -g` it can be used as a global +command `rimraf [ ...]` which is useful for cross platform support. + +## mkdirp + +If you need to create a directory recursively, check out +[mkdirp](https://github.com/substack/node-mkdirp). diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/rimraf/bin.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/rimraf/bin.js new file mode 100644 index 00000000..1bd5a0d1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/rimraf/bin.js @@ -0,0 +1,40 @@ +#!/usr/bin/env node + +var rimraf = require('./') + +var help = false +var dashdash = false +var args = process.argv.slice(2).filter(function(arg) { + if (dashdash) + return !!arg + else if (arg === '--') + dashdash = true + else if (arg.match(/^(-+|\/)(h(elp)?|\?)$/)) + help = true + else + return !!arg +}); + +if (help || args.length === 0) { + // If they didn't ask for help, then this is not a "success" + var log = help ? console.log : console.error + log('Usage: rimraf [ ...]') + log('') + log(' Deletes all files and folders at "path" recursively.') + log('') + log('Options:') + log('') + log(' -h, --help Display this usage info') + process.exit(help ? 0 : 1) +} else + go(0) + +function go (n) { + if (n >= args.length) + return + rimraf(args[n], function (er) { + if (er) + throw er + go(n+1) + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/rimraf/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/rimraf/package.json new file mode 100644 index 00000000..3c19919e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/rimraf/package.json @@ -0,0 +1,66 @@ +{ + "name": "rimraf", + "version": "2.5.4", + "main": "rimraf.js", + "description": "A deep deletion module for node (like `rm -rf`)", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "ISC", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/rimraf.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "bin": { + "rimraf": "./bin.js" + }, + "dependencies": { + "glob": "^7.0.5" + }, + "files": [ + "LICENSE", + "README.md", + "bin.js", + "rimraf.js" + ], + "devDependencies": { + "mkdirp": "^0.5.1", + "tap": "^6.1.1" + }, + "gitHead": "2af08bbbd0a03549b278414309dc5d8097699443", + "bugs": { + "url": "https://github.com/isaacs/rimraf/issues" + }, + "homepage": "https://github.com/isaacs/rimraf#readme", + "_id": "rimraf@2.5.4", + "_shasum": "96800093cbf1a0c86bd95b4625467535c29dfa04", + "_from": "rimraf@latest", + "_npmVersion": "3.10.6", + "_nodeVersion": "4.4.4", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "dist": { + "shasum": "96800093cbf1a0c86bd95b4625467535c29dfa04", + "tarball": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.4.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/rimraf-2.5.4.tgz_1469206941888_0.8645927573088557" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.4.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/rimraf/rimraf.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/rimraf/rimraf.js new file mode 100644 index 00000000..5d9a5768 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/rimraf/rimraf.js @@ -0,0 +1,343 @@ +module.exports = rimraf +rimraf.sync = rimrafSync + +var assert = require("assert") +var path = require("path") +var fs = require("fs") +var glob = require("glob") + +var defaultGlobOpts = { + nosort: true, + silent: true +} + +// for EMFILE handling +var timeout = 0 + +var isWindows = (process.platform === "win32") + +function defaults (options) { + var methods = [ + 'unlink', + 'chmod', + 'stat', + 'lstat', + 'rmdir', + 'readdir' + ] + methods.forEach(function(m) { + options[m] = options[m] || fs[m] + m = m + 'Sync' + options[m] = options[m] || fs[m] + }) + + options.maxBusyTries = options.maxBusyTries || 3 + options.emfileWait = options.emfileWait || 1000 + if (options.glob === false) { + options.disableGlob = true + } + options.disableGlob = options.disableGlob || false + options.glob = options.glob || defaultGlobOpts +} + +function rimraf (p, options, cb) { + if (typeof options === 'function') { + cb = options + options = {} + } + + assert(p, 'rimraf: missing path') + assert.equal(typeof p, 'string', 'rimraf: path should be a string') + assert.equal(typeof cb, 'function', 'rimraf: callback function required') + assert(options, 'rimraf: invalid options argument provided') + assert.equal(typeof options, 'object', 'rimraf: options should be object') + + defaults(options) + + var busyTries = 0 + var errState = null + var n = 0 + + if (options.disableGlob || !glob.hasMagic(p)) + return afterGlob(null, [p]) + + options.lstat(p, function (er, stat) { + if (!er) + return afterGlob(null, [p]) + + glob(p, options.glob, afterGlob) + }) + + function next (er) { + errState = errState || er + if (--n === 0) + cb(errState) + } + + function afterGlob (er, results) { + if (er) + return cb(er) + + n = results.length + if (n === 0) + return cb() + + results.forEach(function (p) { + rimraf_(p, options, function CB (er) { + if (er) { + if (isWindows && (er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") && + busyTries < options.maxBusyTries) { + busyTries ++ + var time = busyTries * 100 + // try again, with the same exact callback as this one. + return setTimeout(function () { + rimraf_(p, options, CB) + }, time) + } + + // this one won't happen if graceful-fs is used. + if (er.code === "EMFILE" && timeout < options.emfileWait) { + return setTimeout(function () { + rimraf_(p, options, CB) + }, timeout ++) + } + + // already gone + if (er.code === "ENOENT") er = null + } + + timeout = 0 + next(er) + }) + }) + } +} + +// Two possible strategies. +// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR +// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR +// +// Both result in an extra syscall when you guess wrong. However, there +// are likely far more normal files in the world than directories. This +// is based on the assumption that a the average number of files per +// directory is >= 1. +// +// If anyone ever complains about this, then I guess the strategy could +// be made configurable somehow. But until then, YAGNI. +function rimraf_ (p, options, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + + // sunos lets the root user unlink directories, which is... weird. + // so we have to lstat here and make sure it's not a dir. + options.lstat(p, function (er, st) { + if (er && er.code === "ENOENT") + return cb(null) + + // Windows can EPERM on stat. Life is suffering. + if (er && er.code === "EPERM" && isWindows) + fixWinEPERM(p, options, er, cb) + + if (st && st.isDirectory()) + return rmdir(p, options, er, cb) + + options.unlink(p, function (er) { + if (er) { + if (er.code === "ENOENT") + return cb(null) + if (er.code === "EPERM") + return (isWindows) + ? fixWinEPERM(p, options, er, cb) + : rmdir(p, options, er, cb) + if (er.code === "EISDIR") + return rmdir(p, options, er, cb) + } + return cb(er) + }) + }) +} + +function fixWinEPERM (p, options, er, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + if (er) + assert(er instanceof Error) + + options.chmod(p, 666, function (er2) { + if (er2) + cb(er2.code === "ENOENT" ? null : er) + else + options.stat(p, function(er3, stats) { + if (er3) + cb(er3.code === "ENOENT" ? null : er) + else if (stats.isDirectory()) + rmdir(p, options, er, cb) + else + options.unlink(p, cb) + }) + }) +} + +function fixWinEPERMSync (p, options, er) { + assert(p) + assert(options) + if (er) + assert(er instanceof Error) + + try { + options.chmodSync(p, 666) + } catch (er2) { + if (er2.code === "ENOENT") + return + else + throw er + } + + try { + var stats = options.statSync(p) + } catch (er3) { + if (er3.code === "ENOENT") + return + else + throw er + } + + if (stats.isDirectory()) + rmdirSync(p, options, er) + else + options.unlinkSync(p) +} + +function rmdir (p, options, originalEr, cb) { + assert(p) + assert(options) + if (originalEr) + assert(originalEr instanceof Error) + assert(typeof cb === 'function') + + // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) + // if we guessed wrong, and it's not a directory, then + // raise the original error. + options.rmdir(p, function (er) { + if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")) + rmkids(p, options, cb) + else if (er && er.code === "ENOTDIR") + cb(originalEr) + else + cb(er) + }) +} + +function rmkids(p, options, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + + options.readdir(p, function (er, files) { + if (er) + return cb(er) + var n = files.length + if (n === 0) + return options.rmdir(p, cb) + var errState + files.forEach(function (f) { + rimraf(path.join(p, f), options, function (er) { + if (errState) + return + if (er) + return cb(errState = er) + if (--n === 0) + options.rmdir(p, cb) + }) + }) + }) +} + +// this looks simpler, and is strictly *faster*, but will +// tie up the JavaScript thread and fail on excessively +// deep directory trees. +function rimrafSync (p, options) { + options = options || {} + defaults(options) + + assert(p, 'rimraf: missing path') + assert.equal(typeof p, 'string', 'rimraf: path should be a string') + assert(options, 'rimraf: missing options') + assert.equal(typeof options, 'object', 'rimraf: options should be object') + + var results + + if (options.disableGlob || !glob.hasMagic(p)) { + results = [p] + } else { + try { + options.lstatSync(p) + results = [p] + } catch (er) { + results = glob.sync(p, options.glob) + } + } + + if (!results.length) + return + + for (var i = 0; i < results.length; i++) { + var p = results[i] + + try { + var st = options.lstatSync(p) + } catch (er) { + if (er.code === "ENOENT") + return + + // Windows can EPERM on stat. Life is suffering. + if (er.code === "EPERM" && isWindows) + fixWinEPERMSync(p, options, er) + } + + try { + // sunos lets the root user unlink directories, which is... weird. + if (st && st.isDirectory()) + rmdirSync(p, options, null) + else + options.unlinkSync(p) + } catch (er) { + if (er.code === "ENOENT") + return + if (er.code === "EPERM") + return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er) + if (er.code !== "EISDIR") + throw er + rmdirSync(p, options, er) + } + } +} + +function rmdirSync (p, options, originalEr) { + assert(p) + assert(options) + if (originalEr) + assert(originalEr instanceof Error) + + try { + options.rmdirSync(p) + } catch (er) { + if (er.code === "ENOENT") + return + if (er.code === "ENOTDIR") + throw originalEr + if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM") + rmkidsSync(p, options) + } +} + +function rmkidsSync (p, options) { + assert(p) + assert(options) + options.readdirSync(p).forEach(function (f) { + rimrafSync(path.join(p, f), options) + }) + options.rmdirSync(p, options) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/semver/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/semver/.npmignore new file mode 100644 index 00000000..534108e3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/semver/.npmignore @@ -0,0 +1,4 @@ +node_modules/ +coverage/ +.nyc_output/ +nyc_output/ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/semver/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/semver/.travis.yml new file mode 100644 index 00000000..991d04b6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/semver/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - '0.10' + - '0.12' + - 'iojs' diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/semver/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/semver/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/semver/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/semver/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/semver/README.md new file mode 100644 index 00000000..0b14a7e8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/semver/README.md @@ -0,0 +1,327 @@ +semver(1) -- The semantic versioner for npm +=========================================== + +## Usage + + $ npm install semver + + semver.valid('1.2.3') // '1.2.3' + semver.valid('a.b.c') // null + semver.clean(' =v1.2.3 ') // '1.2.3' + semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true + semver.gt('1.2.3', '9.8.7') // false + semver.lt('1.2.3', '9.8.7') // true + +As a command-line utility: + + $ semver -h + + Usage: semver [ [...]] [-r | -i | --preid | -l | -rv] + Test if version(s) satisfy the supplied range(s), and sort them. + + Multiple versions or ranges may be supplied, unless increment + option is specified. In that case, only a single version may + be used, and it is incremented by the specified level + + Program exits successfully if any valid version satisfies + all supplied ranges, and prints all satisfying versions. + + If no versions are valid, or ranges are not satisfied, + then exits failure. + + Versions are printed in ascending order, so supplying + multiple versions to the utility will just sort them. + +## Versions + +A "version" is described by the `v2.0.0` specification found at +. + +A leading `"="` or `"v"` character is stripped off and ignored. + +## Ranges + +A `version range` is a set of `comparators` which specify versions +that satisfy the range. + +A `comparator` is composed of an `operator` and a `version`. The set +of primitive `operators` is: + +* `<` Less than +* `<=` Less than or equal to +* `>` Greater than +* `>=` Greater than or equal to +* `=` Equal. If no operator is specified, then equality is assumed, + so this operator is optional, but MAY be included. + +For example, the comparator `>=1.2.7` would match the versions +`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6` +or `1.1.0`. + +Comparators can be joined by whitespace to form a `comparator set`, +which is satisfied by the **intersection** of all of the comparators +it includes. + +A range is composed of one or more comparator sets, joined by `||`. A +version matches a range if and only if every comparator in at least +one of the `||`-separated comparator sets is satisfied by the version. + +For example, the range `>=1.2.7 <1.3.0` would match the versions +`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`, +or `1.1.0`. + +The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`, +`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`. + +### Prerelease Tags + +If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then +it will only be allowed to satisfy comparator sets if at least one +comparator with the same `[major, minor, patch]` tuple also has a +prerelease tag. + +For example, the range `>1.2.3-alpha.3` would be allowed to match the +version `1.2.3-alpha.7`, but it would *not* be satisfied by +`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater +than" `1.2.3-alpha.3` according to the SemVer sort rules. The version +range only accepts prerelease tags on the `1.2.3` version. The +version `3.4.5` *would* satisfy the range, because it does not have a +prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`. + +The purpose for this behavior is twofold. First, prerelease versions +frequently are updated very quickly, and contain many breaking changes +that are (by the author's design) not yet fit for public consumption. +Therefore, by default, they are excluded from range matching +semantics. + +Second, a user who has opted into using a prerelease version has +clearly indicated the intent to use *that specific* set of +alpha/beta/rc versions. By including a prerelease tag in the range, +the user is indicating that they are aware of the risk. However, it +is still not appropriate to assume that they have opted into taking a +similar risk on the *next* set of prerelease versions. + +#### Prerelease Identifiers + +The method `.inc` takes an additional `identifier` string argument that +will append the value of the string as a prerelease identifier: + +```javascript +> semver.inc('1.2.3', 'prerelease', 'beta') +'1.2.4-beta.0' +``` + +command-line example: + +```shell +$ semver 1.2.3 -i prerelease --preid beta +1.2.4-beta.0 +``` + +Which then can be used to increment further: + +```shell +$ semver 1.2.4-beta.0 -i prerelease +1.2.4-beta.1 +``` + +### Advanced Range Syntax + +Advanced range syntax desugars to primitive comparators in +deterministic ways. + +Advanced ranges may be combined in the same way as primitive +comparators using white space or `||`. + +#### Hyphen Ranges `X.Y.Z - A.B.C` + +Specifies an inclusive set. + +* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4` + +If a partial version is provided as the first version in the inclusive +range, then the missing pieces are replaced with zeroes. + +* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4` + +If a partial version is provided as the second version in the +inclusive range, then all versions that start with the supplied parts +of the tuple are accepted, but nothing that would be greater than the +provided tuple parts. + +* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0` +* `1.2.3 - 2` := `>=1.2.3 <3.0.0` + +#### X-Ranges `1.2.x` `1.X` `1.2.*` `*` + +Any of `X`, `x`, or `*` may be used to "stand in" for one of the +numeric values in the `[major, minor, patch]` tuple. + +* `*` := `>=0.0.0` (Any version satisfies) +* `1.x` := `>=1.0.0 <2.0.0` (Matching major version) +* `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions) + +A partial version range is treated as an X-Range, so the special +character is in fact optional. + +* `""` (empty string) := `*` := `>=0.0.0` +* `1` := `1.x.x` := `>=1.0.0 <2.0.0` +* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0` + +#### Tilde Ranges `~1.2.3` `~1.2` `~1` + +Allows patch-level changes if a minor version is specified on the +comparator. Allows minor-level changes if not. + +* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0` +* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`) +* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`) +* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0` +* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`) +* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`) +* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in + the `1.2.3` version will be allowed, if they are greater than or + equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but + `1.2.4-beta.2` would not, because it is a prerelease of a + different `[major, minor, patch]` tuple. + +#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4` + +Allows changes that do not modify the left-most non-zero digit in the +`[major, minor, patch]` tuple. In other words, this allows patch and +minor updates for versions `1.0.0` and above, patch updates for +versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`. + +Many authors treat a `0.x` version as if the `x` were the major +"breaking-change" indicator. + +Caret ranges are ideal when an author may make breaking changes +between `0.2.4` and `0.3.0` releases, which is a common practice. +However, it presumes that there will *not* be breaking changes between +`0.2.4` and `0.2.5`. It allows for changes that are presumed to be +additive (but non-breaking), according to commonly observed practices. + +* `^1.2.3` := `>=1.2.3 <2.0.0` +* `^0.2.3` := `>=0.2.3 <0.3.0` +* `^0.0.3` := `>=0.0.3 <0.0.4` +* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in + the `1.2.3` version will be allowed, if they are greater than or + equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but + `1.2.4-beta.2` would not, because it is a prerelease of a + different `[major, minor, patch]` tuple. +* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4` Note that prereleases in the + `0.0.3` version *only* will be allowed, if they are greater than or + equal to `beta`. So, `0.0.3-pr.2` would be allowed. + +When parsing caret ranges, a missing `patch` value desugars to the +number `0`, but will allow flexibility within that value, even if the +major and minor versions are both `0`. + +* `^1.2.x` := `>=1.2.0 <2.0.0` +* `^0.0.x` := `>=0.0.0 <0.1.0` +* `^0.0` := `>=0.0.0 <0.1.0` + +A missing `minor` and `patch` values will desugar to zero, but also +allow flexibility within those values, even if the major version is +zero. + +* `^1.x` := `>=1.0.0 <2.0.0` +* `^0.x` := `>=0.0.0 <1.0.0` + +### Range Grammar + +Putting all this together, here is a Backus-Naur grammar for ranges, +for the benefit of parser authors: + +```bnf +range-set ::= range ( logical-or range ) * +logical-or ::= ( ' ' ) * '||' ( ' ' ) * +range ::= hyphen | simple ( ' ' simple ) * | '' +hyphen ::= partial ' - ' partial +simple ::= primitive | partial | tilde | caret +primitive ::= ( '<' | '>' | '>=' | '<=' | '=' | ) partial +partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? +xr ::= 'x' | 'X' | '*' | nr +nr ::= '0' | ['1'-'9']['0'-'9']+ +tilde ::= '~' partial +caret ::= '^' partial +qualifier ::= ( '-' pre )? ( '+' build )? +pre ::= parts +build ::= parts +parts ::= part ( '.' part ) * +part ::= nr | [-0-9A-Za-z]+ +``` + +## Functions + +All methods and classes take a final `loose` boolean argument that, if +true, will be more forgiving about not-quite-valid semver strings. +The resulting output will always be 100% strict, of course. + +Strict-mode Comparators and Ranges will be strict about the SemVer +strings that they parse. + +* `valid(v)`: Return the parsed version, or null if it's not valid. +* `inc(v, release)`: Return the version incremented by the release + type (`major`, `premajor`, `minor`, `preminor`, `patch`, + `prepatch`, or `prerelease`), or null if it's not valid + * `premajor` in one call will bump the version up to the next major + version and down to a prerelease of that major version. + `preminor`, and `prepatch` work the same way. + * If called from a non-prerelease version, the `prerelease` will work the + same as `prepatch`. It increments the patch version, then makes a + prerelease. If the input version is already a prerelease it simply + increments it. +* `major(v)`: Return the major version number. +* `minor(v)`: Return the minor version number. +* `patch(v)`: Return the patch version number. + +### Comparison + +* `gt(v1, v2)`: `v1 > v2` +* `gte(v1, v2)`: `v1 >= v2` +* `lt(v1, v2)`: `v1 < v2` +* `lte(v1, v2)`: `v1 <= v2` +* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent, + even if they're not the exact same string. You already know how to + compare strings. +* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`. +* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call + the corresponding function above. `"==="` and `"!=="` do simple + string comparison, but are included for completeness. Throws if an + invalid comparison string is provided. +* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if + `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. +* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions + in descending order when passed to `Array.sort()`. +* `diff(v1, v2)`: Returns difference between two versions by the release type + (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`), + or null if the versions are the same. + + +### Ranges + +* `validRange(range)`: Return the valid range or null if it's not valid +* `satisfies(version, range)`: Return true if the version satisfies the + range. +* `maxSatisfying(versions, range)`: Return the highest version in the list + that satisfies the range, or `null` if none of them do. +* `gtr(version, range)`: Return `true` if version is greater than all the + versions possible in the range. +* `ltr(version, range)`: Return `true` if version is less than all the + versions possible in the range. +* `outside(version, range, hilo)`: Return true if the version is outside + the bounds of the range in either the high or low direction. The + `hilo` argument must be either the string `'>'` or `'<'`. (This is + the function called by `gtr` and `ltr`.) + +Note that, since ranges may be non-contiguous, a version might not be +greater than a range, less than a range, *or* satisfy a range! For +example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9` +until `2.0.0`, so the version `1.2.10` would not be greater than the +range (because `2.0.1` satisfies, which is higher), nor less than the +range (since `1.2.8` satisfies, which is lower), and it also does not +satisfy the range. + +If you want to know if a version satisfies or does not satisfy a +range, use the `satisfies(version, range)` function. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/semver/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/semver/package.json new file mode 100644 index 00000000..0a874284 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/semver/package.json @@ -0,0 +1,51 @@ +{ + "name": "semver", + "version": "5.1.0", + "description": "The semantic version parser used by npm.", + "main": "semver.js", + "scripts": { + "test": "tap test/*.js" + }, + "devDependencies": { + "tap": "^2.0.0" + }, + "license": "ISC", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/node-semver.git" + }, + "bin": { + "semver": "./bin/semver" + }, + "gitHead": "8e33a30e62e40e4983d1c5f55e794331b861aadc", + "bugs": { + "url": "https://github.com/npm/node-semver/issues" + }, + "homepage": "https://github.com/npm/node-semver#readme", + "_id": "semver@5.1.0", + "_shasum": "85f2cf8550465c4df000cf7d86f6b054106ab9e5", + "_from": "semver@>=5.1.0 <5.2.0", + "_npmVersion": "3.3.2", + "_nodeVersion": "4.0.0", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "dist": { + "shasum": "85f2cf8550465c4df000cf7d86f6b054106ab9e5", + "tarball": "http://registry.npmjs.org/semver/-/semver-5.1.0.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/semver/-/semver-5.1.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/semver/range.bnf b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/semver/range.bnf new file mode 100644 index 00000000..000df923 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/semver/range.bnf @@ -0,0 +1,16 @@ +range-set ::= range ( logical-or range ) * +logical-or ::= ( ' ' ) * '||' ( ' ' ) * +range ::= hyphen | simple ( ' ' simple ) * | '' +hyphen ::= partial ' - ' partial +simple ::= primitive | partial | tilde | caret +primitive ::= ( '<' | '>' | '>=' | '<=' | '=' | ) partial +partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? +xr ::= 'x' | 'X' | '*' | nr +nr ::= '0' | ['1'-'9']['0'-'9']+ +tilde ::= '~' partial +caret ::= '^' partial +qualifier ::= ( '-' pre )? ( '+' build )? +pre ::= parts +build ::= parts +parts ::= part ( '.' part ) * +part ::= nr | [-0-9A-Za-z]+ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/semver/semver.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/semver/semver.js new file mode 100644 index 00000000..71795f6f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/semver/semver.js @@ -0,0 +1,1188 @@ +exports = module.exports = SemVer; + +// The debug function is excluded entirely from the minified version. +/* nomin */ var debug; +/* nomin */ if (typeof process === 'object' && + /* nomin */ process.env && + /* nomin */ process.env.NODE_DEBUG && + /* nomin */ /\bsemver\b/i.test(process.env.NODE_DEBUG)) + /* nomin */ debug = function() { + /* nomin */ var args = Array.prototype.slice.call(arguments, 0); + /* nomin */ args.unshift('SEMVER'); + /* nomin */ console.log.apply(console, args); + /* nomin */ }; +/* nomin */ else + /* nomin */ debug = function() {}; + +// Note: this is the semver.org version of the spec that it implements +// Not necessarily the package version of this code. +exports.SEMVER_SPEC_VERSION = '2.0.0'; + +var MAX_LENGTH = 256; +var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991; + +// The actual regexps go on exports.re +var re = exports.re = []; +var src = exports.src = []; +var R = 0; + +// The following Regular Expressions can be used for tokenizing, +// validating, and parsing SemVer version strings. + +// ## Numeric Identifier +// A single `0`, or a non-zero digit followed by zero or more digits. + +var NUMERICIDENTIFIER = R++; +src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'; +var NUMERICIDENTIFIERLOOSE = R++; +src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'; + + +// ## Non-numeric Identifier +// Zero or more digits, followed by a letter or hyphen, and then zero or +// more letters, digits, or hyphens. + +var NONNUMERICIDENTIFIER = R++; +src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'; + + +// ## Main Version +// Three dot-separated numeric identifiers. + +var MAINVERSION = R++; +src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' + + '(' + src[NUMERICIDENTIFIER] + ')\\.' + + '(' + src[NUMERICIDENTIFIER] + ')'; + +var MAINVERSIONLOOSE = R++; +src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[NUMERICIDENTIFIERLOOSE] + ')'; + +// ## Pre-release Version Identifier +// A numeric identifier, or a non-numeric identifier. + +var PRERELEASEIDENTIFIER = R++; +src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] + + '|' + src[NONNUMERICIDENTIFIER] + ')'; + +var PRERELEASEIDENTIFIERLOOSE = R++; +src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] + + '|' + src[NONNUMERICIDENTIFIER] + ')'; + + +// ## Pre-release Version +// Hyphen, followed by one or more dot-separated pre-release version +// identifiers. + +var PRERELEASE = R++; +src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] + + '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'; + +var PRERELEASELOOSE = R++; +src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] + + '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'; + +// ## Build Metadata Identifier +// Any combination of digits, letters, or hyphens. + +var BUILDIDENTIFIER = R++; +src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'; + +// ## Build Metadata +// Plus sign, followed by one or more period-separated build metadata +// identifiers. + +var BUILD = R++; +src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] + + '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'; + + +// ## Full Version String +// A main version, followed optionally by a pre-release version and +// build metadata. + +// Note that the only major, minor, patch, and pre-release sections of +// the version string are capturing groups. The build metadata is not a +// capturing group, because it should not ever be used in version +// comparison. + +var FULL = R++; +var FULLPLAIN = 'v?' + src[MAINVERSION] + + src[PRERELEASE] + '?' + + src[BUILD] + '?'; + +src[FULL] = '^' + FULLPLAIN + '$'; + +// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. +// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty +// common in the npm registry. +var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] + + src[PRERELEASELOOSE] + '?' + + src[BUILD] + '?'; + +var LOOSE = R++; +src[LOOSE] = '^' + LOOSEPLAIN + '$'; + +var GTLT = R++; +src[GTLT] = '((?:<|>)?=?)'; + +// Something like "2.*" or "1.2.x". +// Note that "x.x" is a valid xRange identifer, meaning "any version" +// Only the first item is strictly required. +var XRANGEIDENTIFIERLOOSE = R++; +src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'; +var XRANGEIDENTIFIER = R++; +src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'; + +var XRANGEPLAIN = R++; +src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + + '(?:' + src[PRERELEASE] + ')?' + + src[BUILD] + '?' + + ')?)?'; + +var XRANGEPLAINLOOSE = R++; +src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:' + src[PRERELEASELOOSE] + ')?' + + src[BUILD] + '?' + + ')?)?'; + +var XRANGE = R++; +src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'; +var XRANGELOOSE = R++; +src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'; + +// Tilde ranges. +// Meaning is "reasonably at or greater than" +var LONETILDE = R++; +src[LONETILDE] = '(?:~>?)'; + +var TILDETRIM = R++; +src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'; +re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g'); +var tildeTrimReplace = '$1~'; + +var TILDE = R++; +src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'; +var TILDELOOSE = R++; +src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'; + +// Caret ranges. +// Meaning is "at least and backwards compatible with" +var LONECARET = R++; +src[LONECARET] = '(?:\\^)'; + +var CARETTRIM = R++; +src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'; +re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g'); +var caretTrimReplace = '$1^'; + +var CARET = R++; +src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'; +var CARETLOOSE = R++; +src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'; + +// A simple gt/lt/eq thing, or just "" to indicate "any version" +var COMPARATORLOOSE = R++; +src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'; +var COMPARATOR = R++; +src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'; + + +// An expression to strip any whitespace between the gtlt and the thing +// it modifies, so that `> 1.2.3` ==> `>1.2.3` +var COMPARATORTRIM = R++; +src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] + + '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'; + +// this one has to use the /g flag +re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g'); +var comparatorTrimReplace = '$1$2$3'; + + +// Something like `1.2.3 - 1.2.4` +// Note that these all use the loose form, because they'll be +// checked against either the strict or loose comparator form +// later. +var HYPHENRANGE = R++; +src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' + + '\\s+-\\s+' + + '(' + src[XRANGEPLAIN] + ')' + + '\\s*$'; + +var HYPHENRANGELOOSE = R++; +src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' + + '\\s+-\\s+' + + '(' + src[XRANGEPLAINLOOSE] + ')' + + '\\s*$'; + +// Star ranges basically just allow anything at all. +var STAR = R++; +src[STAR] = '(<|>)?=?\\s*\\*'; + +// Compile to actual regexp objects. +// All are flag-free, unless they were created above with a flag. +for (var i = 0; i < R; i++) { + debug(i, src[i]); + if (!re[i]) + re[i] = new RegExp(src[i]); +} + +exports.parse = parse; +function parse(version, loose) { + if (version instanceof SemVer) + return version; + + if (typeof version !== 'string') + return null; + + if (version.length > MAX_LENGTH) + return null; + + var r = loose ? re[LOOSE] : re[FULL]; + if (!r.test(version)) + return null; + + try { + return new SemVer(version, loose); + } catch (er) { + return null; + } +} + +exports.valid = valid; +function valid(version, loose) { + var v = parse(version, loose); + return v ? v.version : null; +} + + +exports.clean = clean; +function clean(version, loose) { + var s = parse(version.trim().replace(/^[=v]+/, ''), loose); + return s ? s.version : null; +} + +exports.SemVer = SemVer; + +function SemVer(version, loose) { + if (version instanceof SemVer) { + if (version.loose === loose) + return version; + else + version = version.version; + } else if (typeof version !== 'string') { + throw new TypeError('Invalid Version: ' + version); + } + + if (version.length > MAX_LENGTH) + throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters') + + if (!(this instanceof SemVer)) + return new SemVer(version, loose); + + debug('SemVer', version, loose); + this.loose = loose; + var m = version.trim().match(loose ? re[LOOSE] : re[FULL]); + + if (!m) + throw new TypeError('Invalid Version: ' + version); + + this.raw = version; + + // these are actually numbers + this.major = +m[1]; + this.minor = +m[2]; + this.patch = +m[3]; + + if (this.major > MAX_SAFE_INTEGER || this.major < 0) + throw new TypeError('Invalid major version') + + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) + throw new TypeError('Invalid minor version') + + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) + throw new TypeError('Invalid patch version') + + // numberify any prerelease numeric ids + if (!m[4]) + this.prerelease = []; + else + this.prerelease = m[4].split('.').map(function(id) { + if (/^[0-9]+$/.test(id)) { + var num = +id + if (num >= 0 && num < MAX_SAFE_INTEGER) + return num + } + return id; + }); + + this.build = m[5] ? m[5].split('.') : []; + this.format(); +} + +SemVer.prototype.format = function() { + this.version = this.major + '.' + this.minor + '.' + this.patch; + if (this.prerelease.length) + this.version += '-' + this.prerelease.join('.'); + return this.version; +}; + +SemVer.prototype.toString = function() { + return this.version; +}; + +SemVer.prototype.compare = function(other) { + debug('SemVer.compare', this.version, this.loose, other); + if (!(other instanceof SemVer)) + other = new SemVer(other, this.loose); + + return this.compareMain(other) || this.comparePre(other); +}; + +SemVer.prototype.compareMain = function(other) { + if (!(other instanceof SemVer)) + other = new SemVer(other, this.loose); + + return compareIdentifiers(this.major, other.major) || + compareIdentifiers(this.minor, other.minor) || + compareIdentifiers(this.patch, other.patch); +}; + +SemVer.prototype.comparePre = function(other) { + if (!(other instanceof SemVer)) + other = new SemVer(other, this.loose); + + // NOT having a prerelease is > having one + if (this.prerelease.length && !other.prerelease.length) + return -1; + else if (!this.prerelease.length && other.prerelease.length) + return 1; + else if (!this.prerelease.length && !other.prerelease.length) + return 0; + + var i = 0; + do { + var a = this.prerelease[i]; + var b = other.prerelease[i]; + debug('prerelease compare', i, a, b); + if (a === undefined && b === undefined) + return 0; + else if (b === undefined) + return 1; + else if (a === undefined) + return -1; + else if (a === b) + continue; + else + return compareIdentifiers(a, b); + } while (++i); +}; + +// preminor will bump the version up to the next minor release, and immediately +// down to pre-release. premajor and prepatch work the same way. +SemVer.prototype.inc = function(release, identifier) { + switch (release) { + case 'premajor': + this.prerelease.length = 0; + this.patch = 0; + this.minor = 0; + this.major++; + this.inc('pre', identifier); + break; + case 'preminor': + this.prerelease.length = 0; + this.patch = 0; + this.minor++; + this.inc('pre', identifier); + break; + case 'prepatch': + // If this is already a prerelease, it will bump to the next version + // drop any prereleases that might already exist, since they are not + // relevant at this point. + this.prerelease.length = 0; + this.inc('patch', identifier); + this.inc('pre', identifier); + break; + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case 'prerelease': + if (this.prerelease.length === 0) + this.inc('patch', identifier); + this.inc('pre', identifier); + break; + + case 'major': + // If this is a pre-major version, bump up to the same major version. + // Otherwise increment major. + // 1.0.0-5 bumps to 1.0.0 + // 1.1.0 bumps to 2.0.0 + if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) + this.major++; + this.minor = 0; + this.patch = 0; + this.prerelease = []; + break; + case 'minor': + // If this is a pre-minor version, bump up to the same minor version. + // Otherwise increment minor. + // 1.2.0-5 bumps to 1.2.0 + // 1.2.1 bumps to 1.3.0 + if (this.patch !== 0 || this.prerelease.length === 0) + this.minor++; + this.patch = 0; + this.prerelease = []; + break; + case 'patch': + // If this is not a pre-release version, it will increment the patch. + // If it is a pre-release it will bump up to the same patch version. + // 1.2.0-5 patches to 1.2.0 + // 1.2.0 patches to 1.2.1 + if (this.prerelease.length === 0) + this.patch++; + this.prerelease = []; + break; + // This probably shouldn't be used publicly. + // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. + case 'pre': + if (this.prerelease.length === 0) + this.prerelease = [0]; + else { + var i = this.prerelease.length; + while (--i >= 0) { + if (typeof this.prerelease[i] === 'number') { + this.prerelease[i]++; + i = -2; + } + } + if (i === -1) // didn't increment anything + this.prerelease.push(0); + } + if (identifier) { + // 1.2.0-beta.1 bumps to 1.2.0-beta.2, + // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 + if (this.prerelease[0] === identifier) { + if (isNaN(this.prerelease[1])) + this.prerelease = [identifier, 0]; + } else + this.prerelease = [identifier, 0]; + } + break; + + default: + throw new Error('invalid increment argument: ' + release); + } + this.format(); + this.raw = this.version; + return this; +}; + +exports.inc = inc; +function inc(version, release, loose, identifier) { + if (typeof(loose) === 'string') { + identifier = loose; + loose = undefined; + } + + try { + return new SemVer(version, loose).inc(release, identifier).version; + } catch (er) { + return null; + } +} + +exports.diff = diff; +function diff(version1, version2) { + if (eq(version1, version2)) { + return null; + } else { + var v1 = parse(version1); + var v2 = parse(version2); + if (v1.prerelease.length || v2.prerelease.length) { + for (var key in v1) { + if (key === 'major' || key === 'minor' || key === 'patch') { + if (v1[key] !== v2[key]) { + return 'pre'+key; + } + } + } + return 'prerelease'; + } + for (var key in v1) { + if (key === 'major' || key === 'minor' || key === 'patch') { + if (v1[key] !== v2[key]) { + return key; + } + } + } + } +} + +exports.compareIdentifiers = compareIdentifiers; + +var numeric = /^[0-9]+$/; +function compareIdentifiers(a, b) { + var anum = numeric.test(a); + var bnum = numeric.test(b); + + if (anum && bnum) { + a = +a; + b = +b; + } + + return (anum && !bnum) ? -1 : + (bnum && !anum) ? 1 : + a < b ? -1 : + a > b ? 1 : + 0; +} + +exports.rcompareIdentifiers = rcompareIdentifiers; +function rcompareIdentifiers(a, b) { + return compareIdentifiers(b, a); +} + +exports.major = major; +function major(a, loose) { + return new SemVer(a, loose).major; +} + +exports.minor = minor; +function minor(a, loose) { + return new SemVer(a, loose).minor; +} + +exports.patch = patch; +function patch(a, loose) { + return new SemVer(a, loose).patch; +} + +exports.compare = compare; +function compare(a, b, loose) { + return new SemVer(a, loose).compare(b); +} + +exports.compareLoose = compareLoose; +function compareLoose(a, b) { + return compare(a, b, true); +} + +exports.rcompare = rcompare; +function rcompare(a, b, loose) { + return compare(b, a, loose); +} + +exports.sort = sort; +function sort(list, loose) { + return list.sort(function(a, b) { + return exports.compare(a, b, loose); + }); +} + +exports.rsort = rsort; +function rsort(list, loose) { + return list.sort(function(a, b) { + return exports.rcompare(a, b, loose); + }); +} + +exports.gt = gt; +function gt(a, b, loose) { + return compare(a, b, loose) > 0; +} + +exports.lt = lt; +function lt(a, b, loose) { + return compare(a, b, loose) < 0; +} + +exports.eq = eq; +function eq(a, b, loose) { + return compare(a, b, loose) === 0; +} + +exports.neq = neq; +function neq(a, b, loose) { + return compare(a, b, loose) !== 0; +} + +exports.gte = gte; +function gte(a, b, loose) { + return compare(a, b, loose) >= 0; +} + +exports.lte = lte; +function lte(a, b, loose) { + return compare(a, b, loose) <= 0; +} + +exports.cmp = cmp; +function cmp(a, op, b, loose) { + var ret; + switch (op) { + case '===': + if (typeof a === 'object') a = a.version; + if (typeof b === 'object') b = b.version; + ret = a === b; + break; + case '!==': + if (typeof a === 'object') a = a.version; + if (typeof b === 'object') b = b.version; + ret = a !== b; + break; + case '': case '=': case '==': ret = eq(a, b, loose); break; + case '!=': ret = neq(a, b, loose); break; + case '>': ret = gt(a, b, loose); break; + case '>=': ret = gte(a, b, loose); break; + case '<': ret = lt(a, b, loose); break; + case '<=': ret = lte(a, b, loose); break; + default: throw new TypeError('Invalid operator: ' + op); + } + return ret; +} + +exports.Comparator = Comparator; +function Comparator(comp, loose) { + if (comp instanceof Comparator) { + if (comp.loose === loose) + return comp; + else + comp = comp.value; + } + + if (!(this instanceof Comparator)) + return new Comparator(comp, loose); + + debug('comparator', comp, loose); + this.loose = loose; + this.parse(comp); + + if (this.semver === ANY) + this.value = ''; + else + this.value = this.operator + this.semver.version; + + debug('comp', this); +} + +var ANY = {}; +Comparator.prototype.parse = function(comp) { + var r = this.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; + var m = comp.match(r); + + if (!m) + throw new TypeError('Invalid comparator: ' + comp); + + this.operator = m[1]; + if (this.operator === '=') + this.operator = ''; + + // if it literally is just '>' or '' then allow anything. + if (!m[2]) + this.semver = ANY; + else + this.semver = new SemVer(m[2], this.loose); +}; + +Comparator.prototype.toString = function() { + return this.value; +}; + +Comparator.prototype.test = function(version) { + debug('Comparator.test', version, this.loose); + + if (this.semver === ANY) + return true; + + if (typeof version === 'string') + version = new SemVer(version, this.loose); + + return cmp(version, this.operator, this.semver, this.loose); +}; + + +exports.Range = Range; +function Range(range, loose) { + if ((range instanceof Range) && range.loose === loose) + return range; + + if (!(this instanceof Range)) + return new Range(range, loose); + + this.loose = loose; + + // First, split based on boolean or || + this.raw = range; + this.set = range.split(/\s*\|\|\s*/).map(function(range) { + return this.parseRange(range.trim()); + }, this).filter(function(c) { + // throw out any that are not relevant for whatever reason + return c.length; + }); + + if (!this.set.length) { + throw new TypeError('Invalid SemVer Range: ' + range); + } + + this.format(); +} + +Range.prototype.format = function() { + this.range = this.set.map(function(comps) { + return comps.join(' ').trim(); + }).join('||').trim(); + return this.range; +}; + +Range.prototype.toString = function() { + return this.range; +}; + +Range.prototype.parseRange = function(range) { + var loose = this.loose; + range = range.trim(); + debug('range', range, loose); + // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` + var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]; + range = range.replace(hr, hyphenReplace); + debug('hyphen replace', range); + // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` + range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace); + debug('comparator trim', range, re[COMPARATORTRIM]); + + // `~ 1.2.3` => `~1.2.3` + range = range.replace(re[TILDETRIM], tildeTrimReplace); + + // `^ 1.2.3` => `^1.2.3` + range = range.replace(re[CARETTRIM], caretTrimReplace); + + // normalize spaces + range = range.split(/\s+/).join(' '); + + // At this point, the range is completely trimmed and + // ready to be split into comparators. + + var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; + var set = range.split(' ').map(function(comp) { + return parseComparator(comp, loose); + }).join(' ').split(/\s+/); + if (this.loose) { + // in loose mode, throw out any that are not valid comparators + set = set.filter(function(comp) { + return !!comp.match(compRe); + }); + } + set = set.map(function(comp) { + return new Comparator(comp, loose); + }); + + return set; +}; + +// Mostly just for testing and legacy API reasons +exports.toComparators = toComparators; +function toComparators(range, loose) { + return new Range(range, loose).set.map(function(comp) { + return comp.map(function(c) { + return c.value; + }).join(' ').trim().split(' '); + }); +} + +// comprised of xranges, tildes, stars, and gtlt's at this point. +// already replaced the hyphen ranges +// turn into a set of JUST comparators. +function parseComparator(comp, loose) { + debug('comp', comp); + comp = replaceCarets(comp, loose); + debug('caret', comp); + comp = replaceTildes(comp, loose); + debug('tildes', comp); + comp = replaceXRanges(comp, loose); + debug('xrange', comp); + comp = replaceStars(comp, loose); + debug('stars', comp); + return comp; +} + +function isX(id) { + return !id || id.toLowerCase() === 'x' || id === '*'; +} + +// ~, ~> --> * (any, kinda silly) +// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 +// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 +// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 +// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 +// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 +function replaceTildes(comp, loose) { + return comp.trim().split(/\s+/).map(function(comp) { + return replaceTilde(comp, loose); + }).join(' '); +} + +function replaceTilde(comp, loose) { + var r = loose ? re[TILDELOOSE] : re[TILDE]; + return comp.replace(r, function(_, M, m, p, pr) { + debug('tilde', comp, _, M, m, p, pr); + var ret; + + if (isX(M)) + ret = ''; + else if (isX(m)) + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; + else if (isX(p)) + // ~1.2 == >=1.2.0- <1.3.0- + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; + else if (pr) { + debug('replaceTilde pr', pr); + if (pr.charAt(0) !== '-') + pr = '-' + pr; + ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + M + '.' + (+m + 1) + '.0'; + } else + // ~1.2.3 == >=1.2.3 <1.3.0 + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0'; + + debug('tilde return', ret); + return ret; + }); +} + +// ^ --> * (any, kinda silly) +// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 +// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 +// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 +// ^1.2.3 --> >=1.2.3 <2.0.0 +// ^1.2.0 --> >=1.2.0 <2.0.0 +function replaceCarets(comp, loose) { + return comp.trim().split(/\s+/).map(function(comp) { + return replaceCaret(comp, loose); + }).join(' '); +} + +function replaceCaret(comp, loose) { + debug('caret', comp, loose); + var r = loose ? re[CARETLOOSE] : re[CARET]; + return comp.replace(r, function(_, M, m, p, pr) { + debug('caret', comp, _, M, m, p, pr); + var ret; + + if (isX(M)) + ret = ''; + else if (isX(m)) + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; + else if (isX(p)) { + if (M === '0') + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; + else + ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'; + } else if (pr) { + debug('replaceCaret pr', pr); + if (pr.charAt(0) !== '-') + pr = '-' + pr; + if (M === '0') { + if (m === '0') + ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + M + '.' + m + '.' + (+p + 1); + else + ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + M + '.' + (+m + 1) + '.0'; + } else + ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + (+M + 1) + '.0.0'; + } else { + debug('no pr'); + if (M === '0') { + if (m === '0') + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + m + '.' + (+p + 1); + else + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0'; + } else + ret = '>=' + M + '.' + m + '.' + p + + ' <' + (+M + 1) + '.0.0'; + } + + debug('caret return', ret); + return ret; + }); +} + +function replaceXRanges(comp, loose) { + debug('replaceXRanges', comp, loose); + return comp.split(/\s+/).map(function(comp) { + return replaceXRange(comp, loose); + }).join(' '); +} + +function replaceXRange(comp, loose) { + comp = comp.trim(); + var r = loose ? re[XRANGELOOSE] : re[XRANGE]; + return comp.replace(r, function(ret, gtlt, M, m, p, pr) { + debug('xRange', comp, ret, gtlt, M, m, p, pr); + var xM = isX(M); + var xm = xM || isX(m); + var xp = xm || isX(p); + var anyX = xp; + + if (gtlt === '=' && anyX) + gtlt = ''; + + if (xM) { + if (gtlt === '>' || gtlt === '<') { + // nothing is allowed + ret = '<0.0.0'; + } else { + // nothing is forbidden + ret = '*'; + } + } else if (gtlt && anyX) { + // replace X with 0 + if (xm) + m = 0; + if (xp) + p = 0; + + if (gtlt === '>') { + // >1 => >=2.0.0 + // >1.2 => >=1.3.0 + // >1.2.3 => >= 1.2.4 + gtlt = '>='; + if (xm) { + M = +M + 1; + m = 0; + p = 0; + } else if (xp) { + m = +m + 1; + p = 0; + } + } else if (gtlt === '<=') { + // <=0.7.x is actually <0.8.0, since any 0.7.x should + // pass. Similarly, <=7.x is actually <8.0.0, etc. + gtlt = '<' + if (xm) + M = +M + 1 + else + m = +m + 1 + } + + ret = gtlt + M + '.' + m + '.' + p; + } else if (xm) { + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; + } else if (xp) { + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; + } + + debug('xRange return', ret); + + return ret; + }); +} + +// Because * is AND-ed with everything else in the comparator, +// and '' means "any version", just remove the *s entirely. +function replaceStars(comp, loose) { + debug('replaceStars', comp, loose); + // Looseness is ignored here. star is always as loose as it gets! + return comp.trim().replace(re[STAR], ''); +} + +// This function is passed to string.replace(re[HYPHENRANGE]) +// M, m, patch, prerelease, build +// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 +// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0 <3.5.0 +function hyphenReplace($0, + from, fM, fm, fp, fpr, fb, + to, tM, tm, tp, tpr, tb) { + + if (isX(fM)) + from = ''; + else if (isX(fm)) + from = '>=' + fM + '.0.0'; + else if (isX(fp)) + from = '>=' + fM + '.' + fm + '.0'; + else + from = '>=' + from; + + if (isX(tM)) + to = ''; + else if (isX(tm)) + to = '<' + (+tM + 1) + '.0.0'; + else if (isX(tp)) + to = '<' + tM + '.' + (+tm + 1) + '.0'; + else if (tpr) + to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr; + else + to = '<=' + to; + + return (from + ' ' + to).trim(); +} + + +// if ANY of the sets match ALL of its comparators, then pass +Range.prototype.test = function(version) { + if (!version) + return false; + + if (typeof version === 'string') + version = new SemVer(version, this.loose); + + for (var i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version)) + return true; + } + return false; +}; + +function testSet(set, version) { + for (var i = 0; i < set.length; i++) { + if (!set[i].test(version)) + return false; + } + + if (version.prerelease.length) { + // Find the set of versions that are allowed to have prereleases + // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 + // That should allow `1.2.3-pr.2` to pass. + // However, `1.2.4-alpha.notready` should NOT be allowed, + // even though it's within the range set by the comparators. + for (var i = 0; i < set.length; i++) { + debug(set[i].semver); + if (set[i].semver === ANY) + continue; + + if (set[i].semver.prerelease.length > 0) { + var allowed = set[i].semver; + if (allowed.major === version.major && + allowed.minor === version.minor && + allowed.patch === version.patch) + return true; + } + } + + // Version has a -pre, but it's not one of the ones we like. + return false; + } + + return true; +} + +exports.satisfies = satisfies; +function satisfies(version, range, loose) { + try { + range = new Range(range, loose); + } catch (er) { + return false; + } + return range.test(version); +} + +exports.maxSatisfying = maxSatisfying; +function maxSatisfying(versions, range, loose) { + return versions.filter(function(version) { + return satisfies(version, range, loose); + }).sort(function(a, b) { + return rcompare(a, b, loose); + })[0] || null; +} + +exports.validRange = validRange; +function validRange(range, loose) { + try { + // Return '*' instead of '' so that truthiness works. + // This will throw if it's invalid anyway + return new Range(range, loose).range || '*'; + } catch (er) { + return null; + } +} + +// Determine if version is less than all the versions possible in the range +exports.ltr = ltr; +function ltr(version, range, loose) { + return outside(version, range, '<', loose); +} + +// Determine if version is greater than all the versions possible in the range. +exports.gtr = gtr; +function gtr(version, range, loose) { + return outside(version, range, '>', loose); +} + +exports.outside = outside; +function outside(version, range, hilo, loose) { + version = new SemVer(version, loose); + range = new Range(range, loose); + + var gtfn, ltefn, ltfn, comp, ecomp; + switch (hilo) { + case '>': + gtfn = gt; + ltefn = lte; + ltfn = lt; + comp = '>'; + ecomp = '>='; + break; + case '<': + gtfn = lt; + ltefn = gte; + ltfn = gt; + comp = '<'; + ecomp = '<='; + break; + default: + throw new TypeError('Must provide a hilo val of "<" or ">"'); + } + + // If it satisifes the range it is not outside + if (satisfies(version, range, loose)) { + return false; + } + + // From now on, variable terms are as if we're in "gtr" mode. + // but note that everything is flipped for the "ltr" function. + + for (var i = 0; i < range.set.length; ++i) { + var comparators = range.set[i]; + + var high = null; + var low = null; + + comparators.forEach(function(comparator) { + if (comparator.semver === ANY) { + comparator = new Comparator('>=0.0.0') + } + high = high || comparator; + low = low || comparator; + if (gtfn(comparator.semver, high.semver, loose)) { + high = comparator; + } else if (ltfn(comparator.semver, low.semver, loose)) { + low = comparator; + } + }); + + // If the edge version comparator has a operator then our version + // isn't outside it + if (high.operator === comp || high.operator === ecomp) { + return false; + } + + // If the lowest version comparator has an operator and our version + // is less than it then it isn't higher than the range + if ((!low.operator || low.operator === comp) && + ltefn(version, low.semver)) { + return false; + } else if (low.operator === ecomp && ltfn(version, low.semver)) { + return false; + } + } + return true; +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/semver/test/big-numbers.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/semver/test/big-numbers.js new file mode 100644 index 00000000..c051864b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/semver/test/big-numbers.js @@ -0,0 +1,31 @@ +var test = require('tap').test +var semver = require('../') + +test('long version is too long', function (t) { + var v = '1.2.' + new Array(256).join('1') + t.throws(function () { + new semver.SemVer(v) + }) + t.equal(semver.valid(v, false), null) + t.equal(semver.valid(v, true), null) + t.equal(semver.inc(v, 'patch'), null) + t.end() +}) + +test('big number is like too long version', function (t) { + var v = '1.2.' + new Array(100).join('1') + t.throws(function () { + new semver.SemVer(v) + }) + t.equal(semver.valid(v, false), null) + t.equal(semver.valid(v, true), null) + t.equal(semver.inc(v, 'patch'), null) + t.end() +}) + +test('parsing null does not throw', function (t) { + t.equal(semver.parse(null), null) + t.equal(semver.parse({}), null) + t.equal(semver.parse(new semver.SemVer('1.2.3')).version, '1.2.3') + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/semver/test/clean.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/semver/test/clean.js new file mode 100644 index 00000000..9e268de9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/semver/test/clean.js @@ -0,0 +1,29 @@ +var tap = require('tap'); +var test = tap.test; +var semver = require('../semver.js'); +var clean = semver.clean; + +test('\nclean tests', function(t) { + // [range, version] + // Version should be detectable despite extra characters + [ + ['1.2.3', '1.2.3'], + [' 1.2.3 ', '1.2.3'], + [' 1.2.3-4 ', '1.2.3-4'], + [' 1.2.3-pre ', '1.2.3-pre'], + [' =v1.2.3 ', '1.2.3'], + ['v1.2.3', '1.2.3'], + [' v1.2.3 ', '1.2.3'], + ['\t1.2.3', '1.2.3'], + ['>1.2.3', null], + ['~1.2.3', null], + ['<=1.2.3', null], + ['1.2.x', null] + ].forEach(function(tuple) { + var range = tuple[0]; + var version = tuple[1]; + var msg = 'clean(' + range + ') = ' + version; + t.equal(clean(range), version, msg); + }); + t.end(); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/semver/test/gtr.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/semver/test/gtr.js new file mode 100644 index 00000000..bbb87896 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/semver/test/gtr.js @@ -0,0 +1,173 @@ +var tap = require('tap'); +var test = tap.test; +var semver = require('../semver.js'); +var gtr = semver.gtr; + +test('\ngtr tests', function(t) { + // [range, version, loose] + // Version should be greater than range + [ + ['~1.2.2', '1.3.0'], + ['~0.6.1-1', '0.7.1-1'], + ['1.0.0 - 2.0.0', '2.0.1'], + ['1.0.0', '1.0.1-beta1'], + ['1.0.0', '2.0.0'], + ['<=2.0.0', '2.1.1'], + ['<=2.0.0', '3.2.9'], + ['<2.0.0', '2.0.0'], + ['0.1.20 || 1.2.4', '1.2.5'], + ['2.x.x', '3.0.0'], + ['1.2.x', '1.3.0'], + ['1.2.x || 2.x', '3.0.0'], + ['2.*.*', '5.0.1'], + ['1.2.*', '1.3.3'], + ['1.2.* || 2.*', '4.0.0'], + ['2', '3.0.0'], + ['2.3', '2.4.2'], + ['~2.4', '2.5.0'], // >=2.4.0 <2.5.0 + ['~2.4', '2.5.5'], + ['~>3.2.1', '3.3.0'], // >=3.2.1 <3.3.0 + ['~1', '2.2.3'], // >=1.0.0 <2.0.0 + ['~>1', '2.2.4'], + ['~> 1', '3.2.3'], + ['~1.0', '1.1.2'], // >=1.0.0 <1.1.0 + ['~ 1.0', '1.1.0'], + ['<1.2', '1.2.0'], + ['< 1.2', '1.2.1'], + ['1', '2.0.0beta', true], + ['~v0.5.4-pre', '0.6.0'], + ['~v0.5.4-pre', '0.6.1-pre'], + ['=0.7.x', '0.8.0'], + ['=0.7.x', '0.8.0-asdf'], + ['<0.7.x', '0.7.0'], + ['~1.2.2', '1.3.0'], + ['1.0.0 - 2.0.0', '2.2.3'], + ['1.0.0', '1.0.1'], + ['<=2.0.0', '3.0.0'], + ['<=2.0.0', '2.9999.9999'], + ['<=2.0.0', '2.2.9'], + ['<2.0.0', '2.9999.9999'], + ['<2.0.0', '2.2.9'], + ['2.x.x', '3.1.3'], + ['1.2.x', '1.3.3'], + ['1.2.x || 2.x', '3.1.3'], + ['2.*.*', '3.1.3'], + ['1.2.*', '1.3.3'], + ['1.2.* || 2.*', '3.1.3'], + ['2', '3.1.2'], + ['2.3', '2.4.1'], + ['~2.4', '2.5.0'], // >=2.4.0 <2.5.0 + ['~>3.2.1', '3.3.2'], // >=3.2.1 <3.3.0 + ['~1', '2.2.3'], // >=1.0.0 <2.0.0 + ['~>1', '2.2.3'], + ['~1.0', '1.1.0'], // >=1.0.0 <1.1.0 + ['<1', '1.0.0'], + ['1', '2.0.0beta', true], + ['<1', '1.0.0beta', true], + ['< 1', '1.0.0beta', true], + ['=0.7.x', '0.8.2'], + ['<0.7.x', '0.7.2'] + ].forEach(function(tuple) { + var range = tuple[0]; + var version = tuple[1]; + var loose = tuple[2] || false; + var msg = 'gtr(' + version + ', ' + range + ', ' + loose + ')'; + t.ok(gtr(version, range, loose), msg); + }); + t.end(); +}); + +test('\nnegative gtr tests', function(t) { + // [range, version, loose] + // Version should NOT be greater than range + [ + ['~0.6.1-1', '0.6.1-1'], + ['1.0.0 - 2.0.0', '1.2.3'], + ['1.0.0 - 2.0.0', '0.9.9'], + ['1.0.0', '1.0.0'], + ['>=*', '0.2.4'], + ['', '1.0.0', true], + ['*', '1.2.3'], + ['*', 'v1.2.3-foo'], + ['>=1.0.0', '1.0.0'], + ['>=1.0.0', '1.0.1'], + ['>=1.0.0', '1.1.0'], + ['>1.0.0', '1.0.1'], + ['>1.0.0', '1.1.0'], + ['<=2.0.0', '2.0.0'], + ['<=2.0.0', '1.9999.9999'], + ['<=2.0.0', '0.2.9'], + ['<2.0.0', '1.9999.9999'], + ['<2.0.0', '0.2.9'], + ['>= 1.0.0', '1.0.0'], + ['>= 1.0.0', '1.0.1'], + ['>= 1.0.0', '1.1.0'], + ['> 1.0.0', '1.0.1'], + ['> 1.0.0', '1.1.0'], + ['<= 2.0.0', '2.0.0'], + ['<= 2.0.0', '1.9999.9999'], + ['<= 2.0.0', '0.2.9'], + ['< 2.0.0', '1.9999.9999'], + ['<\t2.0.0', '0.2.9'], + ['>=0.1.97', 'v0.1.97'], + ['>=0.1.97', '0.1.97'], + ['0.1.20 || 1.2.4', '1.2.4'], + ['0.1.20 || >1.2.4', '1.2.4'], + ['0.1.20 || 1.2.4', '1.2.3'], + ['0.1.20 || 1.2.4', '0.1.20'], + ['>=0.2.3 || <0.0.1', '0.0.0'], + ['>=0.2.3 || <0.0.1', '0.2.3'], + ['>=0.2.3 || <0.0.1', '0.2.4'], + ['||', '1.3.4'], + ['2.x.x', '2.1.3'], + ['1.2.x', '1.2.3'], + ['1.2.x || 2.x', '2.1.3'], + ['1.2.x || 2.x', '1.2.3'], + ['x', '1.2.3'], + ['2.*.*', '2.1.3'], + ['1.2.*', '1.2.3'], + ['1.2.* || 2.*', '2.1.3'], + ['1.2.* || 2.*', '1.2.3'], + ['1.2.* || 2.*', '1.2.3'], + ['*', '1.2.3'], + ['2', '2.1.2'], + ['2.3', '2.3.1'], + ['~2.4', '2.4.0'], // >=2.4.0 <2.5.0 + ['~2.4', '2.4.5'], + ['~>3.2.1', '3.2.2'], // >=3.2.1 <3.3.0 + ['~1', '1.2.3'], // >=1.0.0 <2.0.0 + ['~>1', '1.2.3'], + ['~> 1', '1.2.3'], + ['~1.0', '1.0.2'], // >=1.0.0 <1.1.0 + ['~ 1.0', '1.0.2'], + ['>=1', '1.0.0'], + ['>= 1', '1.0.0'], + ['<1.2', '1.1.1'], + ['< 1.2', '1.1.1'], + ['1', '1.0.0beta', true], + ['~v0.5.4-pre', '0.5.5'], + ['~v0.5.4-pre', '0.5.4'], + ['=0.7.x', '0.7.2'], + ['>=0.7.x', '0.7.2'], + ['=0.7.x', '0.7.0-asdf'], + ['>=0.7.x', '0.7.0-asdf'], + ['<=0.7.x', '0.6.2'], + ['>0.2.3 >0.2.4 <=0.2.5', '0.2.5'], + ['>=0.2.3 <=0.2.4', '0.2.4'], + ['1.0.0 - 2.0.0', '2.0.0'], + ['^1', '0.0.0-0'], + ['^3.0.0', '2.0.0'], + ['^1.0.0 || ~2.0.1', '2.0.0'], + ['^0.1.0 || ~3.0.1 || 5.0.0', '3.2.0'], + ['^0.1.0 || ~3.0.1 || 5.0.0', '1.0.0beta', true], + ['^0.1.0 || ~3.0.1 || 5.0.0', '5.0.0-0', true], + ['^0.1.0 || ~3.0.1 || >4 <=5.0.0', '3.5.0'] + ].forEach(function(tuple) { + var range = tuple[0]; + var version = tuple[1]; + var loose = tuple[2] || false; + var msg = '!gtr(' + version + ', ' + range + ', ' + loose + ')'; + t.notOk(gtr(version, range, loose), msg); + }); + t.end(); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/semver/test/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/semver/test/index.js new file mode 100644 index 00000000..47c3f5f9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/semver/test/index.js @@ -0,0 +1,698 @@ +'use strict'; + +var tap = require('tap'); +var test = tap.test; +var semver = require('../semver.js'); +var eq = semver.eq; +var gt = semver.gt; +var lt = semver.lt; +var neq = semver.neq; +var cmp = semver.cmp; +var gte = semver.gte; +var lte = semver.lte; +var satisfies = semver.satisfies; +var validRange = semver.validRange; +var inc = semver.inc; +var diff = semver.diff; +var replaceStars = semver.replaceStars; +var toComparators = semver.toComparators; +var SemVer = semver.SemVer; +var Range = semver.Range; + +test('\ncomparison tests', function(t) { + // [version1, version2] + // version1 should be greater than version2 + [['0.0.0', '0.0.0-foo'], + ['0.0.1', '0.0.0'], + ['1.0.0', '0.9.9'], + ['0.10.0', '0.9.0'], + ['0.99.0', '0.10.0'], + ['2.0.0', '1.2.3'], + ['v0.0.0', '0.0.0-foo', true], + ['v0.0.1', '0.0.0', true], + ['v1.0.0', '0.9.9', true], + ['v0.10.0', '0.9.0', true], + ['v0.99.0', '0.10.0', true], + ['v2.0.0', '1.2.3', true], + ['0.0.0', 'v0.0.0-foo', true], + ['0.0.1', 'v0.0.0', true], + ['1.0.0', 'v0.9.9', true], + ['0.10.0', 'v0.9.0', true], + ['0.99.0', 'v0.10.0', true], + ['2.0.0', 'v1.2.3', true], + ['1.2.3', '1.2.3-asdf'], + ['1.2.3', '1.2.3-4'], + ['1.2.3', '1.2.3-4-foo'], + ['1.2.3-5-foo', '1.2.3-5'], + ['1.2.3-5', '1.2.3-4'], + ['1.2.3-5-foo', '1.2.3-5-Foo'], + ['3.0.0', '2.7.2+asdf'], + ['1.2.3-a.10', '1.2.3-a.5'], + ['1.2.3-a.b', '1.2.3-a.5'], + ['1.2.3-a.b', '1.2.3-a'], + ['1.2.3-a.b.c.10.d.5', '1.2.3-a.b.c.5.d.100'], + ['1.2.3-r2', '1.2.3-r100'], + ['1.2.3-r100', '1.2.3-R2'] + ].forEach(function(v) { + var v0 = v[0]; + var v1 = v[1]; + var loose = v[2]; + t.ok(gt(v0, v1, loose), "gt('" + v0 + "', '" + v1 + "')"); + t.ok(lt(v1, v0, loose), "lt('" + v1 + "', '" + v0 + "')"); + t.ok(!gt(v1, v0, loose), "!gt('" + v1 + "', '" + v0 + "')"); + t.ok(!lt(v0, v1, loose), "!lt('" + v0 + "', '" + v1 + "')"); + t.ok(eq(v0, v0, loose), "eq('" + v0 + "', '" + v0 + "')"); + t.ok(eq(v1, v1, loose), "eq('" + v1 + "', '" + v1 + "')"); + t.ok(neq(v0, v1, loose), "neq('" + v0 + "', '" + v1 + "')"); + t.ok(cmp(v1, '==', v1, loose), "cmp('" + v1 + "' == '" + v1 + "')"); + t.ok(cmp(v0, '>=', v1, loose), "cmp('" + v0 + "' >= '" + v1 + "')"); + t.ok(cmp(v1, '<=', v0, loose), "cmp('" + v1 + "' <= '" + v0 + "')"); + t.ok(cmp(v0, '!=', v1, loose), "cmp('" + v0 + "' != '" + v1 + "')"); + }); + t.end(); +}); + +test('\nequality tests', function(t) { + // [version1, version2] + // version1 should be equivalent to version2 + [['1.2.3', 'v1.2.3', true], + ['1.2.3', '=1.2.3', true], + ['1.2.3', 'v 1.2.3', true], + ['1.2.3', '= 1.2.3', true], + ['1.2.3', ' v1.2.3', true], + ['1.2.3', ' =1.2.3', true], + ['1.2.3', ' v 1.2.3', true], + ['1.2.3', ' = 1.2.3', true], + ['1.2.3-0', 'v1.2.3-0', true], + ['1.2.3-0', '=1.2.3-0', true], + ['1.2.3-0', 'v 1.2.3-0', true], + ['1.2.3-0', '= 1.2.3-0', true], + ['1.2.3-0', ' v1.2.3-0', true], + ['1.2.3-0', ' =1.2.3-0', true], + ['1.2.3-0', ' v 1.2.3-0', true], + ['1.2.3-0', ' = 1.2.3-0', true], + ['1.2.3-1', 'v1.2.3-1', true], + ['1.2.3-1', '=1.2.3-1', true], + ['1.2.3-1', 'v 1.2.3-1', true], + ['1.2.3-1', '= 1.2.3-1', true], + ['1.2.3-1', ' v1.2.3-1', true], + ['1.2.3-1', ' =1.2.3-1', true], + ['1.2.3-1', ' v 1.2.3-1', true], + ['1.2.3-1', ' = 1.2.3-1', true], + ['1.2.3-beta', 'v1.2.3-beta', true], + ['1.2.3-beta', '=1.2.3-beta', true], + ['1.2.3-beta', 'v 1.2.3-beta', true], + ['1.2.3-beta', '= 1.2.3-beta', true], + ['1.2.3-beta', ' v1.2.3-beta', true], + ['1.2.3-beta', ' =1.2.3-beta', true], + ['1.2.3-beta', ' v 1.2.3-beta', true], + ['1.2.3-beta', ' = 1.2.3-beta', true], + ['1.2.3-beta+build', ' = 1.2.3-beta+otherbuild', true], + ['1.2.3+build', ' = 1.2.3+otherbuild', true], + ['1.2.3-beta+build', '1.2.3-beta+otherbuild'], + ['1.2.3+build', '1.2.3+otherbuild'], + [' v1.2.3+build', '1.2.3+otherbuild'] + ].forEach(function(v) { + var v0 = v[0]; + var v1 = v[1]; + var loose = v[2]; + t.ok(eq(v0, v1, loose), "eq('" + v0 + "', '" + v1 + "')"); + t.ok(!neq(v0, v1, loose), "!neq('" + v0 + "', '" + v1 + "')"); + t.ok(cmp(v0, '==', v1, loose), 'cmp(' + v0 + '==' + v1 + ')'); + t.ok(!cmp(v0, '!=', v1, loose), '!cmp(' + v0 + '!=' + v1 + ')'); + t.ok(!cmp(v0, '===', v1, loose), '!cmp(' + v0 + '===' + v1 + ')'); + t.ok(cmp(v0, '!==', v1, loose), 'cmp(' + v0 + '!==' + v1 + ')'); + t.ok(!gt(v0, v1, loose), "!gt('" + v0 + "', '" + v1 + "')"); + t.ok(gte(v0, v1, loose), "gte('" + v0 + "', '" + v1 + "')"); + t.ok(!lt(v0, v1, loose), "!lt('" + v0 + "', '" + v1 + "')"); + t.ok(lte(v0, v1, loose), "lte('" + v0 + "', '" + v1 + "')"); + }); + t.end(); +}); + + +test('\nrange tests', function(t) { + // [range, version] + // version should be included by range + [['1.0.0 - 2.0.0', '1.2.3'], + ['^1.2.3+build', '1.2.3'], + ['^1.2.3+build', '1.3.0'], + ['1.2.3-pre+asdf - 2.4.3-pre+asdf', '1.2.3'], + ['1.2.3pre+asdf - 2.4.3-pre+asdf', '1.2.3', true], + ['1.2.3-pre+asdf - 2.4.3pre+asdf', '1.2.3', true], + ['1.2.3pre+asdf - 2.4.3pre+asdf', '1.2.3', true], + ['1.2.3-pre+asdf - 2.4.3-pre+asdf', '1.2.3-pre.2'], + ['1.2.3-pre+asdf - 2.4.3-pre+asdf', '2.4.3-alpha'], + ['1.2.3+asdf - 2.4.3+asdf', '1.2.3'], + ['1.0.0', '1.0.0'], + ['>=*', '0.2.4'], + ['', '1.0.0'], + ['*', '1.2.3'], + ['*', 'v1.2.3', true], + ['>=1.0.0', '1.0.0'], + ['>=1.0.0', '1.0.1'], + ['>=1.0.0', '1.1.0'], + ['>1.0.0', '1.0.1'], + ['>1.0.0', '1.1.0'], + ['<=2.0.0', '2.0.0'], + ['<=2.0.0', '1.9999.9999'], + ['<=2.0.0', '0.2.9'], + ['<2.0.0', '1.9999.9999'], + ['<2.0.0', '0.2.9'], + ['>= 1.0.0', '1.0.0'], + ['>= 1.0.0', '1.0.1'], + ['>= 1.0.0', '1.1.0'], + ['> 1.0.0', '1.0.1'], + ['> 1.0.0', '1.1.0'], + ['<= 2.0.0', '2.0.0'], + ['<= 2.0.0', '1.9999.9999'], + ['<= 2.0.0', '0.2.9'], + ['< 2.0.0', '1.9999.9999'], + ['<\t2.0.0', '0.2.9'], + ['>=0.1.97', 'v0.1.97', true], + ['>=0.1.97', '0.1.97'], + ['0.1.20 || 1.2.4', '1.2.4'], + ['>=0.2.3 || <0.0.1', '0.0.0'], + ['>=0.2.3 || <0.0.1', '0.2.3'], + ['>=0.2.3 || <0.0.1', '0.2.4'], + ['||', '1.3.4'], + ['2.x.x', '2.1.3'], + ['1.2.x', '1.2.3'], + ['1.2.x || 2.x', '2.1.3'], + ['1.2.x || 2.x', '1.2.3'], + ['x', '1.2.3'], + ['2.*.*', '2.1.3'], + ['1.2.*', '1.2.3'], + ['1.2.* || 2.*', '2.1.3'], + ['1.2.* || 2.*', '1.2.3'], + ['*', '1.2.3'], + ['2', '2.1.2'], + ['2.3', '2.3.1'], + ['~2.4', '2.4.0'], // >=2.4.0 <2.5.0 + ['~2.4', '2.4.5'], + ['~>3.2.1', '3.2.2'], // >=3.2.1 <3.3.0, + ['~1', '1.2.3'], // >=1.0.0 <2.0.0 + ['~>1', '1.2.3'], + ['~> 1', '1.2.3'], + ['~1.0', '1.0.2'], // >=1.0.0 <1.1.0, + ['~ 1.0', '1.0.2'], + ['~ 1.0.3', '1.0.12'], + ['>=1', '1.0.0'], + ['>= 1', '1.0.0'], + ['<1.2', '1.1.1'], + ['< 1.2', '1.1.1'], + ['~v0.5.4-pre', '0.5.5'], + ['~v0.5.4-pre', '0.5.4'], + ['=0.7.x', '0.7.2'], + ['<=0.7.x', '0.7.2'], + ['>=0.7.x', '0.7.2'], + ['<=0.7.x', '0.6.2'], + ['~1.2.1 >=1.2.3', '1.2.3'], + ['~1.2.1 =1.2.3', '1.2.3'], + ['~1.2.1 1.2.3', '1.2.3'], + ['~1.2.1 >=1.2.3 1.2.3', '1.2.3'], + ['~1.2.1 1.2.3 >=1.2.3', '1.2.3'], + ['~1.2.1 1.2.3', '1.2.3'], + ['>=1.2.1 1.2.3', '1.2.3'], + ['1.2.3 >=1.2.1', '1.2.3'], + ['>=1.2.3 >=1.2.1', '1.2.3'], + ['>=1.2.1 >=1.2.3', '1.2.3'], + ['>=1.2', '1.2.8'], + ['^1.2.3', '1.8.1'], + ['^0.1.2', '0.1.2'], + ['^0.1', '0.1.2'], + ['^1.2', '1.4.2'], + ['^1.2 ^1', '1.4.2'], + ['^1.2.3-alpha', '1.2.3-pre'], + ['^1.2.0-alpha', '1.2.0-pre'], + ['^0.0.1-alpha', '0.0.1-beta'] + ].forEach(function(v) { + var range = v[0]; + var ver = v[1]; + var loose = v[2]; + t.ok(satisfies(ver, range, loose), range + ' satisfied by ' + ver); + }); + t.end(); +}); + +test('\nnegative range tests', function(t) { + // [range, version] + // version should not be included by range + [['1.0.0 - 2.0.0', '2.2.3'], + ['1.2.3+asdf - 2.4.3+asdf', '1.2.3-pre.2'], + ['1.2.3+asdf - 2.4.3+asdf', '2.4.3-alpha'], + ['^1.2.3+build', '2.0.0'], + ['^1.2.3+build', '1.2.0'], + ['^1.2.3', '1.2.3-pre'], + ['^1.2', '1.2.0-pre'], + ['>1.2', '1.3.0-beta'], + ['<=1.2.3', '1.2.3-beta'], + ['^1.2.3', '1.2.3-beta'], + ['=0.7.x', '0.7.0-asdf'], + ['>=0.7.x', '0.7.0-asdf'], + ['1', '1.0.0beta', true], + ['<1', '1.0.0beta', true], + ['< 1', '1.0.0beta', true], + ['1.0.0', '1.0.1'], + ['>=1.0.0', '0.0.0'], + ['>=1.0.0', '0.0.1'], + ['>=1.0.0', '0.1.0'], + ['>1.0.0', '0.0.1'], + ['>1.0.0', '0.1.0'], + ['<=2.0.0', '3.0.0'], + ['<=2.0.0', '2.9999.9999'], + ['<=2.0.0', '2.2.9'], + ['<2.0.0', '2.9999.9999'], + ['<2.0.0', '2.2.9'], + ['>=0.1.97', 'v0.1.93', true], + ['>=0.1.97', '0.1.93'], + ['0.1.20 || 1.2.4', '1.2.3'], + ['>=0.2.3 || <0.0.1', '0.0.3'], + ['>=0.2.3 || <0.0.1', '0.2.2'], + ['2.x.x', '1.1.3'], + ['2.x.x', '3.1.3'], + ['1.2.x', '1.3.3'], + ['1.2.x || 2.x', '3.1.3'], + ['1.2.x || 2.x', '1.1.3'], + ['2.*.*', '1.1.3'], + ['2.*.*', '3.1.3'], + ['1.2.*', '1.3.3'], + ['1.2.* || 2.*', '3.1.3'], + ['1.2.* || 2.*', '1.1.3'], + ['2', '1.1.2'], + ['2.3', '2.4.1'], + ['~2.4', '2.5.0'], // >=2.4.0 <2.5.0 + ['~2.4', '2.3.9'], + ['~>3.2.1', '3.3.2'], // >=3.2.1 <3.3.0 + ['~>3.2.1', '3.2.0'], // >=3.2.1 <3.3.0 + ['~1', '0.2.3'], // >=1.0.0 <2.0.0 + ['~>1', '2.2.3'], + ['~1.0', '1.1.0'], // >=1.0.0 <1.1.0 + ['<1', '1.0.0'], + ['>=1.2', '1.1.1'], + ['1', '2.0.0beta', true], + ['~v0.5.4-beta', '0.5.4-alpha'], + ['=0.7.x', '0.8.2'], + ['>=0.7.x', '0.6.2'], + ['<0.7.x', '0.7.2'], + ['<1.2.3', '1.2.3-beta'], + ['=1.2.3', '1.2.3-beta'], + ['>1.2', '1.2.8'], + ['^1.2.3', '2.0.0-alpha'], + ['^1.2.3', '1.2.2'], + ['^1.2', '1.1.9'], + ['*', 'v1.2.3-foo', true], + // invalid ranges never satisfied! + ['blerg', '1.2.3'], + ['git+https://user:password0123@github.com/foo', '123.0.0', true], + ['^1.2.3', '2.0.0-pre'] + ].forEach(function(v) { + var range = v[0]; + var ver = v[1]; + var loose = v[2]; + var found = satisfies(ver, range, loose); + t.ok(!found, ver + ' not satisfied by ' + range); + }); + t.end(); +}); + +test('\nincrement versions test', function(t) { +// [version, inc, result, identifier] +// inc(version, inc) -> result + [['1.2.3', 'major', '2.0.0'], + ['1.2.3', 'minor', '1.3.0'], + ['1.2.3', 'patch', '1.2.4'], + ['1.2.3tag', 'major', '2.0.0', true], + ['1.2.3-tag', 'major', '2.0.0'], + ['1.2.3', 'fake', null], + ['1.2.0-0', 'patch', '1.2.0'], + ['fake', 'major', null], + ['1.2.3-4', 'major', '2.0.0'], + ['1.2.3-4', 'minor', '1.3.0'], + ['1.2.3-4', 'patch', '1.2.3'], + ['1.2.3-alpha.0.beta', 'major', '2.0.0'], + ['1.2.3-alpha.0.beta', 'minor', '1.3.0'], + ['1.2.3-alpha.0.beta', 'patch', '1.2.3'], + ['1.2.4', 'prerelease', '1.2.5-0'], + ['1.2.3-0', 'prerelease', '1.2.3-1'], + ['1.2.3-alpha.0', 'prerelease', '1.2.3-alpha.1'], + ['1.2.3-alpha.1', 'prerelease', '1.2.3-alpha.2'], + ['1.2.3-alpha.2', 'prerelease', '1.2.3-alpha.3'], + ['1.2.3-alpha.0.beta', 'prerelease', '1.2.3-alpha.1.beta'], + ['1.2.3-alpha.1.beta', 'prerelease', '1.2.3-alpha.2.beta'], + ['1.2.3-alpha.2.beta', 'prerelease', '1.2.3-alpha.3.beta'], + ['1.2.3-alpha.10.0.beta', 'prerelease', '1.2.3-alpha.10.1.beta'], + ['1.2.3-alpha.10.1.beta', 'prerelease', '1.2.3-alpha.10.2.beta'], + ['1.2.3-alpha.10.2.beta', 'prerelease', '1.2.3-alpha.10.3.beta'], + ['1.2.3-alpha.10.beta.0', 'prerelease', '1.2.3-alpha.10.beta.1'], + ['1.2.3-alpha.10.beta.1', 'prerelease', '1.2.3-alpha.10.beta.2'], + ['1.2.3-alpha.10.beta.2', 'prerelease', '1.2.3-alpha.10.beta.3'], + ['1.2.3-alpha.9.beta', 'prerelease', '1.2.3-alpha.10.beta'], + ['1.2.3-alpha.10.beta', 'prerelease', '1.2.3-alpha.11.beta'], + ['1.2.3-alpha.11.beta', 'prerelease', '1.2.3-alpha.12.beta'], + ['1.2.0', 'prepatch', '1.2.1-0'], + ['1.2.0-1', 'prepatch', '1.2.1-0'], + ['1.2.0', 'preminor', '1.3.0-0'], + ['1.2.3-1', 'preminor', '1.3.0-0'], + ['1.2.0', 'premajor', '2.0.0-0'], + ['1.2.3-1', 'premajor', '2.0.0-0'], + ['1.2.0-1', 'minor', '1.2.0'], + ['1.0.0-1', 'major', '1.0.0'], + + ['1.2.3', 'major', '2.0.0', false, 'dev'], + ['1.2.3', 'minor', '1.3.0', false, 'dev'], + ['1.2.3', 'patch', '1.2.4', false, 'dev'], + ['1.2.3tag', 'major', '2.0.0', true, 'dev'], + ['1.2.3-tag', 'major', '2.0.0', false, 'dev'], + ['1.2.3', 'fake', null, false, 'dev'], + ['1.2.0-0', 'patch', '1.2.0', false, 'dev'], + ['fake', 'major', null, false, 'dev'], + ['1.2.3-4', 'major', '2.0.0', false, 'dev'], + ['1.2.3-4', 'minor', '1.3.0', false, 'dev'], + ['1.2.3-4', 'patch', '1.2.3', false, 'dev'], + ['1.2.3-alpha.0.beta', 'major', '2.0.0', false, 'dev'], + ['1.2.3-alpha.0.beta', 'minor', '1.3.0', false, 'dev'], + ['1.2.3-alpha.0.beta', 'patch', '1.2.3', false, 'dev'], + ['1.2.4', 'prerelease', '1.2.5-dev.0', false, 'dev'], + ['1.2.3-0', 'prerelease', '1.2.3-dev.0', false, 'dev'], + ['1.2.3-alpha.0', 'prerelease', '1.2.3-dev.0', false, 'dev'], + ['1.2.3-alpha.0', 'prerelease', '1.2.3-alpha.1', false, 'alpha'], + ['1.2.3-alpha.0.beta', 'prerelease', '1.2.3-dev.0', false, 'dev'], + ['1.2.3-alpha.0.beta', 'prerelease', '1.2.3-alpha.1.beta', false, 'alpha'], + ['1.2.3-alpha.10.0.beta', 'prerelease', '1.2.3-dev.0', false, 'dev'], + ['1.2.3-alpha.10.0.beta', 'prerelease', '1.2.3-alpha.10.1.beta', false, 'alpha'], + ['1.2.3-alpha.10.1.beta', 'prerelease', '1.2.3-alpha.10.2.beta', false, 'alpha'], + ['1.2.3-alpha.10.2.beta', 'prerelease', '1.2.3-alpha.10.3.beta', false, 'alpha'], + ['1.2.3-alpha.10.beta.0', 'prerelease', '1.2.3-dev.0', false, 'dev'], + ['1.2.3-alpha.10.beta.0', 'prerelease', '1.2.3-alpha.10.beta.1', false, 'alpha'], + ['1.2.3-alpha.10.beta.1', 'prerelease', '1.2.3-alpha.10.beta.2', false, 'alpha'], + ['1.2.3-alpha.10.beta.2', 'prerelease', '1.2.3-alpha.10.beta.3', false, 'alpha'], + ['1.2.3-alpha.9.beta', 'prerelease', '1.2.3-dev.0', false, 'dev'], + ['1.2.3-alpha.9.beta', 'prerelease', '1.2.3-alpha.10.beta', false, 'alpha'], + ['1.2.3-alpha.10.beta', 'prerelease', '1.2.3-alpha.11.beta', false, 'alpha'], + ['1.2.3-alpha.11.beta', 'prerelease', '1.2.3-alpha.12.beta', false, 'alpha'], + ['1.2.0', 'prepatch', '1.2.1-dev.0', false, 'dev'], + ['1.2.0-1', 'prepatch', '1.2.1-dev.0', false, 'dev'], + ['1.2.0', 'preminor', '1.3.0-dev.0', false, 'dev'], + ['1.2.3-1', 'preminor', '1.3.0-dev.0', false, 'dev'], + ['1.2.0', 'premajor', '2.0.0-dev.0', false, 'dev'], + ['1.2.3-1', 'premajor', '2.0.0-dev.0', false, 'dev'], + ['1.2.0-1', 'minor', '1.2.0', false, 'dev'], + ['1.0.0-1', 'major', '1.0.0', false, 'dev'], + ['1.2.3-dev.bar', 'prerelease', '1.2.3-dev.0', false, 'dev'] + + ].forEach(function(v) { + var pre = v[0]; + var what = v[1]; + var wanted = v[2]; + var loose = v[3]; + var id = v[4]; + var found = inc(pre, what, loose, id); + var cmd = 'inc(' + pre + ', ' + what + ', ' + id + ')'; + t.equal(found, wanted, cmd + ' === ' + wanted); + + var parsed = semver.parse(pre, loose); + if (wanted) { + parsed.inc(what, id); + t.equal(parsed.version, wanted, cmd + ' object version updated'); + t.equal(parsed.raw, wanted, cmd + ' object raw field updated'); + } else if (parsed) { + t.throws(function () { + parsed.inc(what, id) + }) + } else { + t.equal(parsed, null) + } + }); + + t.end(); +}); + +test('\ndiff versions test', function(t) { +// [version1, version2, result] +// diff(version1, version2) -> result + [['1.2.3', '0.2.3', 'major'], + ['1.4.5', '0.2.3', 'major'], + ['1.2.3', '2.0.0-pre', 'premajor'], + ['1.2.3', '1.3.3', 'minor'], + ['1.0.1', '1.1.0-pre', 'preminor'], + ['1.2.3', '1.2.4', 'patch'], + ['1.2.3', '1.2.4-pre', 'prepatch'], + ['0.0.1', '0.0.1-pre', 'prerelease'], + ['0.0.1', '0.0.1-pre-2', 'prerelease'], + ['1.1.0', '1.1.0-pre', 'prerelease'], + ['1.1.0-pre-1', '1.1.0-pre-2', 'prerelease'], + ['1.0.0', '1.0.0', null] + + ].forEach(function(v) { + var version1 = v[0]; + var version2 = v[1]; + var wanted = v[2]; + var found = diff(version1, version2); + var cmd = 'diff(' + version1 + ', ' + version2 + ')'; + t.equal(found, wanted, cmd + ' === ' + wanted); + }); + + t.end(); +}); + +test('\nvalid range test', function(t) { + // [range, result] + // validRange(range) -> result + // translate ranges into their canonical form + [['1.0.0 - 2.0.0', '>=1.0.0 <=2.0.0'], + ['1.0.0', '1.0.0'], + ['>=*', '*'], + ['', '*'], + ['*', '*'], + ['*', '*'], + ['>=1.0.0', '>=1.0.0'], + ['>1.0.0', '>1.0.0'], + ['<=2.0.0', '<=2.0.0'], + ['1', '>=1.0.0 <2.0.0'], + ['<=2.0.0', '<=2.0.0'], + ['<=2.0.0', '<=2.0.0'], + ['<2.0.0', '<2.0.0'], + ['<2.0.0', '<2.0.0'], + ['>= 1.0.0', '>=1.0.0'], + ['>= 1.0.0', '>=1.0.0'], + ['>= 1.0.0', '>=1.0.0'], + ['> 1.0.0', '>1.0.0'], + ['> 1.0.0', '>1.0.0'], + ['<= 2.0.0', '<=2.0.0'], + ['<= 2.0.0', '<=2.0.0'], + ['<= 2.0.0', '<=2.0.0'], + ['< 2.0.0', '<2.0.0'], + ['< 2.0.0', '<2.0.0'], + ['>=0.1.97', '>=0.1.97'], + ['>=0.1.97', '>=0.1.97'], + ['0.1.20 || 1.2.4', '0.1.20||1.2.4'], + ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1'], + ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1'], + ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1'], + ['||', '||'], + ['2.x.x', '>=2.0.0 <3.0.0'], + ['1.2.x', '>=1.2.0 <1.3.0'], + ['1.2.x || 2.x', '>=1.2.0 <1.3.0||>=2.0.0 <3.0.0'], + ['1.2.x || 2.x', '>=1.2.0 <1.3.0||>=2.0.0 <3.0.0'], + ['x', '*'], + ['2.*.*', '>=2.0.0 <3.0.0'], + ['1.2.*', '>=1.2.0 <1.3.0'], + ['1.2.* || 2.*', '>=1.2.0 <1.3.0||>=2.0.0 <3.0.0'], + ['*', '*'], + ['2', '>=2.0.0 <3.0.0'], + ['2.3', '>=2.3.0 <2.4.0'], + ['~2.4', '>=2.4.0 <2.5.0'], + ['~2.4', '>=2.4.0 <2.5.0'], + ['~>3.2.1', '>=3.2.1 <3.3.0'], + ['~1', '>=1.0.0 <2.0.0'], + ['~>1', '>=1.0.0 <2.0.0'], + ['~> 1', '>=1.0.0 <2.0.0'], + ['~1.0', '>=1.0.0 <1.1.0'], + ['~ 1.0', '>=1.0.0 <1.1.0'], + ['^0', '>=0.0.0 <1.0.0'], + ['^ 1', '>=1.0.0 <2.0.0'], + ['^0.1', '>=0.1.0 <0.2.0'], + ['^1.0', '>=1.0.0 <2.0.0'], + ['^1.2', '>=1.2.0 <2.0.0'], + ['^0.0.1', '>=0.0.1 <0.0.2'], + ['^0.0.1-beta', '>=0.0.1-beta <0.0.2'], + ['^0.1.2', '>=0.1.2 <0.2.0'], + ['^1.2.3', '>=1.2.3 <2.0.0'], + ['^1.2.3-beta.4', '>=1.2.3-beta.4 <2.0.0'], + ['<1', '<1.0.0'], + ['< 1', '<1.0.0'], + ['>=1', '>=1.0.0'], + ['>= 1', '>=1.0.0'], + ['<1.2', '<1.2.0'], + ['< 1.2', '<1.2.0'], + ['1', '>=1.0.0 <2.0.0'], + ['>01.02.03', '>1.2.3', true], + ['>01.02.03', null], + ['~1.2.3beta', '>=1.2.3-beta <1.3.0', true], + ['~1.2.3beta', null], + ['^ 1.2 ^ 1', '>=1.2.0 <2.0.0 >=1.0.0 <2.0.0'] + ].forEach(function(v) { + var pre = v[0]; + var wanted = v[1]; + var loose = v[2]; + var found = validRange(pre, loose); + + t.equal(found, wanted, 'validRange(' + pre + ') === ' + wanted); + }); + + t.end(); +}); + +test('\ncomparators test', function(t) { + // [range, comparators] + // turn range into a set of individual comparators + [['1.0.0 - 2.0.0', [['>=1.0.0', '<=2.0.0']]], + ['1.0.0', [['1.0.0']]], + ['>=*', [['']]], + ['', [['']]], + ['*', [['']]], + ['*', [['']]], + ['>=1.0.0', [['>=1.0.0']]], + ['>=1.0.0', [['>=1.0.0']]], + ['>=1.0.0', [['>=1.0.0']]], + ['>1.0.0', [['>1.0.0']]], + ['>1.0.0', [['>1.0.0']]], + ['<=2.0.0', [['<=2.0.0']]], + ['1', [['>=1.0.0', '<2.0.0']]], + ['<=2.0.0', [['<=2.0.0']]], + ['<=2.0.0', [['<=2.0.0']]], + ['<2.0.0', [['<2.0.0']]], + ['<2.0.0', [['<2.0.0']]], + ['>= 1.0.0', [['>=1.0.0']]], + ['>= 1.0.0', [['>=1.0.0']]], + ['>= 1.0.0', [['>=1.0.0']]], + ['> 1.0.0', [['>1.0.0']]], + ['> 1.0.0', [['>1.0.0']]], + ['<= 2.0.0', [['<=2.0.0']]], + ['<= 2.0.0', [['<=2.0.0']]], + ['<= 2.0.0', [['<=2.0.0']]], + ['< 2.0.0', [['<2.0.0']]], + ['<\t2.0.0', [['<2.0.0']]], + ['>=0.1.97', [['>=0.1.97']]], + ['>=0.1.97', [['>=0.1.97']]], + ['0.1.20 || 1.2.4', [['0.1.20'], ['1.2.4']]], + ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1']]], + ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1']]], + ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1']]], + ['||', [[''], ['']]], + ['2.x.x', [['>=2.0.0', '<3.0.0']]], + ['1.2.x', [['>=1.2.0', '<1.3.0']]], + ['1.2.x || 2.x', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]], + ['1.2.x || 2.x', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]], + ['x', [['']]], + ['2.*.*', [['>=2.0.0', '<3.0.0']]], + ['1.2.*', [['>=1.2.0', '<1.3.0']]], + ['1.2.* || 2.*', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]], + ['1.2.* || 2.*', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]], + ['*', [['']]], + ['2', [['>=2.0.0', '<3.0.0']]], + ['2.3', [['>=2.3.0', '<2.4.0']]], + ['~2.4', [['>=2.4.0', '<2.5.0']]], + ['~2.4', [['>=2.4.0', '<2.5.0']]], + ['~>3.2.1', [['>=3.2.1', '<3.3.0']]], + ['~1', [['>=1.0.0', '<2.0.0']]], + ['~>1', [['>=1.0.0', '<2.0.0']]], + ['~> 1', [['>=1.0.0', '<2.0.0']]], + ['~1.0', [['>=1.0.0', '<1.1.0']]], + ['~ 1.0', [['>=1.0.0', '<1.1.0']]], + ['~ 1.0.3', [['>=1.0.3', '<1.1.0']]], + ['~> 1.0.3', [['>=1.0.3', '<1.1.0']]], + ['<1', [['<1.0.0']]], + ['< 1', [['<1.0.0']]], + ['>=1', [['>=1.0.0']]], + ['>= 1', [['>=1.0.0']]], + ['<1.2', [['<1.2.0']]], + ['< 1.2', [['<1.2.0']]], + ['1', [['>=1.0.0', '<2.0.0']]], + ['1 2', [['>=1.0.0', '<2.0.0', '>=2.0.0', '<3.0.0']]], + ['1.2 - 3.4.5', [['>=1.2.0', '<=3.4.5']]], + ['1.2.3 - 3.4', [['>=1.2.3', '<3.5.0']]], + ['1.2.3 - 3', [['>=1.2.3', '<4.0.0']]], + ['>*', [['<0.0.0']]], + ['<*', [['<0.0.0']]] + ].forEach(function(v) { + var pre = v[0]; + var wanted = v[1]; + var found = toComparators(v[0]); + var jw = JSON.stringify(wanted); + t.equivalent(found, wanted, 'toComparators(' + pre + ') === ' + jw); + }); + + t.end(); +}); + +test('\ninvalid version numbers', function(t) { + ['1.2.3.4', + 'NOT VALID', + 1.2, + null, + 'Infinity.NaN.Infinity' + ].forEach(function(v) { + t.throws(function() { + new SemVer(v); + }, {name:'TypeError', message:'Invalid Version: ' + v}); + }); + + t.end(); +}); + +test('\nstrict vs loose version numbers', function(t) { + [['=1.2.3', '1.2.3'], + ['01.02.03', '1.2.3'], + ['1.2.3-beta.01', '1.2.3-beta.1'], + [' =1.2.3', '1.2.3'], + ['1.2.3foo', '1.2.3-foo'] + ].forEach(function(v) { + var loose = v[0]; + var strict = v[1]; + t.throws(function() { + new SemVer(loose); + }); + var lv = new SemVer(loose, true); + t.equal(lv.version, strict); + t.ok(eq(loose, strict, true)); + t.throws(function() { + eq(loose, strict); + }); + t.throws(function() { + new SemVer(strict).compare(loose); + }); + }); + t.end(); +}); + +test('\nstrict vs loose ranges', function(t) { + [['>=01.02.03', '>=1.2.3'], + ['~1.02.03beta', '>=1.2.3-beta <1.3.0'] + ].forEach(function(v) { + var loose = v[0]; + var comps = v[1]; + t.throws(function() { + new Range(loose); + }); + t.equal(new Range(loose, true).range, comps); + }); + t.end(); +}); + +test('\nmax satisfying', function(t) { + [[['1.2.3', '1.2.4'], '1.2', '1.2.4'], + [['1.2.4', '1.2.3'], '1.2', '1.2.4'], + [['1.2.3', '1.2.4', '1.2.5', '1.2.6'], '~1.2.3', '1.2.6'], + [['1.1.0', '1.2.0', '1.2.1', '1.3.0', '2.0.0b1', '2.0.0b2', '2.0.0b3', '2.0.0', '2.1.0'], '~2.0.0', '2.0.0', true] + ].forEach(function(v) { + var versions = v[0]; + var range = v[1]; + var expect = v[2]; + var loose = v[3]; + var actual = semver.maxSatisfying(versions, range, loose); + t.equal(actual, expect); + }); + t.end(); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/semver/test/ltr.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/semver/test/ltr.js new file mode 100644 index 00000000..0f7167d6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/semver/test/ltr.js @@ -0,0 +1,181 @@ +var tap = require('tap'); +var test = tap.test; +var semver = require('../semver.js'); +var ltr = semver.ltr; + +test('\nltr tests', function(t) { + // [range, version, loose] + // Version should be less than range + [ + ['~1.2.2', '1.2.1'], + ['~0.6.1-1', '0.6.1-0'], + ['1.0.0 - 2.0.0', '0.0.1'], + ['1.0.0-beta.2', '1.0.0-beta.1'], + ['1.0.0', '0.0.0'], + ['>=2.0.0', '1.1.1'], + ['>=2.0.0', '1.2.9'], + ['>2.0.0', '2.0.0'], + ['0.1.20 || 1.2.4', '0.1.5'], + ['2.x.x', '1.0.0'], + ['1.2.x', '1.1.0'], + ['1.2.x || 2.x', '1.0.0'], + ['2.*.*', '1.0.1'], + ['1.2.*', '1.1.3'], + ['1.2.* || 2.*', '1.1.9999'], + ['2', '1.0.0'], + ['2.3', '2.2.2'], + ['~2.4', '2.3.0'], // >=2.4.0 <2.5.0 + ['~2.4', '2.3.5'], + ['~>3.2.1', '3.2.0'], // >=3.2.1 <3.3.0 + ['~1', '0.2.3'], // >=1.0.0 <2.0.0 + ['~>1', '0.2.4'], + ['~> 1', '0.2.3'], + ['~1.0', '0.1.2'], // >=1.0.0 <1.1.0 + ['~ 1.0', '0.1.0'], + ['>1.2', '1.2.0'], + ['> 1.2', '1.2.1'], + ['1', '0.0.0beta', true], + ['~v0.5.4-pre', '0.5.4-alpha'], + ['~v0.5.4-pre', '0.5.4-alpha'], + ['=0.7.x', '0.6.0'], + ['=0.7.x', '0.6.0-asdf'], + ['>=0.7.x', '0.6.0'], + ['~1.2.2', '1.2.1'], + ['1.0.0 - 2.0.0', '0.2.3'], + ['1.0.0', '0.0.1'], + ['>=2.0.0', '1.0.0'], + ['>=2.0.0', '1.9999.9999'], + ['>=2.0.0', '1.2.9'], + ['>2.0.0', '2.0.0'], + ['>2.0.0', '1.2.9'], + ['2.x.x', '1.1.3'], + ['1.2.x', '1.1.3'], + ['1.2.x || 2.x', '1.1.3'], + ['2.*.*', '1.1.3'], + ['1.2.*', '1.1.3'], + ['1.2.* || 2.*', '1.1.3'], + ['2', '1.9999.9999'], + ['2.3', '2.2.1'], + ['~2.4', '2.3.0'], // >=2.4.0 <2.5.0 + ['~>3.2.1', '2.3.2'], // >=3.2.1 <3.3.0 + ['~1', '0.2.3'], // >=1.0.0 <2.0.0 + ['~>1', '0.2.3'], + ['~1.0', '0.0.0'], // >=1.0.0 <1.1.0 + ['>1', '1.0.0'], + ['2', '1.0.0beta', true], + ['>1', '1.0.0beta', true], + ['> 1', '1.0.0beta', true], + ['=0.7.x', '0.6.2'], + ['=0.7.x', '0.7.0-asdf'], + ['^1', '1.0.0-0'], + ['>=0.7.x', '0.7.0-asdf'], + ['1', '1.0.0beta', true], + ['>=0.7.x', '0.6.2'], + ['>1.2.3', '1.3.0-alpha'] + ].forEach(function(tuple) { + var range = tuple[0]; + var version = tuple[1]; + var loose = tuple[2] || false; + var msg = 'ltr(' + version + ', ' + range + ', ' + loose + ')'; + t.ok(ltr(version, range, loose), msg); + }); + t.end(); +}); + +test('\nnegative ltr tests', function(t) { + // [range, version, loose] + // Version should NOT be less than range + [ + ['~ 1.0', '1.1.0'], + ['~0.6.1-1', '0.6.1-1'], + ['1.0.0 - 2.0.0', '1.2.3'], + ['1.0.0 - 2.0.0', '2.9.9'], + ['1.0.0', '1.0.0'], + ['>=*', '0.2.4'], + ['', '1.0.0', true], + ['*', '1.2.3'], + ['>=1.0.0', '1.0.0'], + ['>=1.0.0', '1.0.1'], + ['>=1.0.0', '1.1.0'], + ['>1.0.0', '1.0.1'], + ['>1.0.0', '1.1.0'], + ['<=2.0.0', '2.0.0'], + ['<=2.0.0', '1.9999.9999'], + ['<=2.0.0', '0.2.9'], + ['<2.0.0', '1.9999.9999'], + ['<2.0.0', '0.2.9'], + ['>= 1.0.0', '1.0.0'], + ['>= 1.0.0', '1.0.1'], + ['>= 1.0.0', '1.1.0'], + ['> 1.0.0', '1.0.1'], + ['> 1.0.0', '1.1.0'], + ['<= 2.0.0', '2.0.0'], + ['<= 2.0.0', '1.9999.9999'], + ['<= 2.0.0', '0.2.9'], + ['< 2.0.0', '1.9999.9999'], + ['<\t2.0.0', '0.2.9'], + ['>=0.1.97', 'v0.1.97'], + ['>=0.1.97', '0.1.97'], + ['0.1.20 || 1.2.4', '1.2.4'], + ['0.1.20 || >1.2.4', '1.2.4'], + ['0.1.20 || 1.2.4', '1.2.3'], + ['0.1.20 || 1.2.4', '0.1.20'], + ['>=0.2.3 || <0.0.1', '0.0.0'], + ['>=0.2.3 || <0.0.1', '0.2.3'], + ['>=0.2.3 || <0.0.1', '0.2.4'], + ['||', '1.3.4'], + ['2.x.x', '2.1.3'], + ['1.2.x', '1.2.3'], + ['1.2.x || 2.x', '2.1.3'], + ['1.2.x || 2.x', '1.2.3'], + ['x', '1.2.3'], + ['2.*.*', '2.1.3'], + ['1.2.*', '1.2.3'], + ['1.2.* || 2.*', '2.1.3'], + ['1.2.* || 2.*', '1.2.3'], + ['1.2.* || 2.*', '1.2.3'], + ['*', '1.2.3'], + ['2', '2.1.2'], + ['2.3', '2.3.1'], + ['~2.4', '2.4.0'], // >=2.4.0 <2.5.0 + ['~2.4', '2.4.5'], + ['~>3.2.1', '3.2.2'], // >=3.2.1 <3.3.0 + ['~1', '1.2.3'], // >=1.0.0 <2.0.0 + ['~>1', '1.2.3'], + ['~> 1', '1.2.3'], + ['~1.0', '1.0.2'], // >=1.0.0 <1.1.0 + ['~ 1.0', '1.0.2'], + ['>=1', '1.0.0'], + ['>= 1', '1.0.0'], + ['<1.2', '1.1.1'], + ['< 1.2', '1.1.1'], + ['~v0.5.4-pre', '0.5.5'], + ['~v0.5.4-pre', '0.5.4'], + ['=0.7.x', '0.7.2'], + ['>=0.7.x', '0.7.2'], + ['<=0.7.x', '0.6.2'], + ['>0.2.3 >0.2.4 <=0.2.5', '0.2.5'], + ['>=0.2.3 <=0.2.4', '0.2.4'], + ['1.0.0 - 2.0.0', '2.0.0'], + ['^3.0.0', '4.0.0'], + ['^1.0.0 || ~2.0.1', '2.0.0'], + ['^0.1.0 || ~3.0.1 || 5.0.0', '3.2.0'], + ['^0.1.0 || ~3.0.1 || 5.0.0', '1.0.0beta', true], + ['^0.1.0 || ~3.0.1 || 5.0.0', '5.0.0-0', true], + ['^0.1.0 || ~3.0.1 || >4 <=5.0.0', '3.5.0'], + ['^1.0.0alpha', '1.0.0beta', true], + ['~1.0.0alpha', '1.0.0beta', true], + ['^1.0.0-alpha', '1.0.0beta', true], + ['~1.0.0-alpha', '1.0.0beta', true], + ['^1.0.0-alpha', '1.0.0-beta'], + ['~1.0.0-alpha', '1.0.0-beta'], + ['=0.1.0', '1.0.0'] + ].forEach(function(tuple) { + var range = tuple[0]; + var version = tuple[1]; + var loose = tuple[2] || false; + var msg = '!ltr(' + version + ', ' + range + ', ' + loose + ')'; + t.notOk(ltr(version, range, loose), msg); + }); + t.end(); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/semver/test/major-minor-patch.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/semver/test/major-minor-patch.js new file mode 100644 index 00000000..e9d4039c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/semver/test/major-minor-patch.js @@ -0,0 +1,72 @@ +var tap = require('tap'); +var test = tap.test; +var semver = require('../semver.js'); + +test('\nmajor tests', function(t) { + // [range, version] + // Version should be detectable despite extra characters + [ + ['1.2.3', 1], + [' 1.2.3 ', 1], + [' 2.2.3-4 ', 2], + [' 3.2.3-pre ', 3], + ['v5.2.3', 5], + [' v8.2.3 ', 8], + ['\t13.2.3', 13], + ['=21.2.3', 21, true], + ['v=34.2.3', 34, true] + ].forEach(function(tuple) { + var range = tuple[0]; + var version = tuple[1]; + var loose = tuple[2] || false; + var msg = 'major(' + range + ') = ' + version; + t.equal(semver.major(range, loose), version, msg); + }); + t.end(); +}); + +test('\nminor tests', function(t) { + // [range, version] + // Version should be detectable despite extra characters + [ + ['1.1.3', 1], + [' 1.1.3 ', 1], + [' 1.2.3-4 ', 2], + [' 1.3.3-pre ', 3], + ['v1.5.3', 5], + [' v1.8.3 ', 8], + ['\t1.13.3', 13], + ['=1.21.3', 21, true], + ['v=1.34.3', 34, true] + ].forEach(function(tuple) { + var range = tuple[0]; + var version = tuple[1]; + var loose = tuple[2] || false; + var msg = 'minor(' + range + ') = ' + version; + t.equal(semver.minor(range, loose), version, msg); + }); + t.end(); +}); + +test('\npatch tests', function(t) { + // [range, version] + // Version should be detectable despite extra characters + [ + ['1.2.1', 1], + [' 1.2.1 ', 1], + [' 1.2.2-4 ', 2], + [' 1.2.3-pre ', 3], + ['v1.2.5', 5], + [' v1.2.8 ', 8], + ['\t1.2.13', 13], + ['=1.2.21', 21, true], + ['v=1.2.34', 34, true] + ].forEach(function(tuple) { + var range = tuple[0]; + var version = tuple[1]; + var loose = tuple[2] || false; + var msg = 'patch(' + range + ') = ' + version; + t.equal(semver.patch(range, loose), version, msg); + }); + t.end(); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/.npmignore new file mode 100644 index 00000000..fcfd9449 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/.npmignore @@ -0,0 +1,4 @@ +node_modules +test +.gitignore +.travis.yml \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/LICENSE new file mode 100644 index 00000000..048a6f99 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/LICENSE @@ -0,0 +1,46 @@ +Copyright (c) 2013 Forbes Lindesay + +The BSD License + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +The MIT License (MIT) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/README.md new file mode 100644 index 00000000..a2b300cc --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/README.md @@ -0,0 +1,49 @@ +# sha + +Check and get file hashes (using any algorithm) + +[![Build Status](https://img.shields.io/travis/ForbesLindesay/sha/master.svg)](https://travis-ci.org/ForbesLindesay/sha) +[![Dependency Status](https://img.shields.io/gemnasium/ForbesLindesay/sha.svg)](https://gemnasium.com/ForbesLindesay/sha) +[![NPM version](https://img.shields.io/npm/v/sha.svg)](http://badge.fury.io/js/sha) + +## Installation + + $ npm install sha + +## API + +### check(fileName, expected, [options,] cb) / checkSync(filename, expected, [options]) + +Asynchronously check that `fileName` has a "hash" of `expected`. The callback will be called with either `null` or an error (indicating that they did not match). + +Options: + +- algorithm: defaults to `sha1` and can be any of the algorithms supported by `crypto.createHash` + +### get(fileName, [options,] cb) / getSync(filename, [options]) + +Asynchronously get the "hash" of `fileName`. The callback will be called with an optional `error` object and the (lower cased) hex digest of the hash. + +Options: + +- algorithm: defaults to `sha1` and can be any of the algorithms supported by `crypto.createHash` + +### stream(expected, [options]) + +Check the hash of a stream without ever buffering it. This is a pass through stream so you can do things like: + +```js +fs.createReadStream('src') + .pipe(sha.stream('expected')) + .pipe(fs.createWriteStream('dest')) +``` + +`dest` will be a complete copy of `src` and an error will be emitted if the hash did not match `'expected'`. + +Options: + +- algorithm: defaults to `sha1` and can be any of the algorithms supported by `crypto.createHash` + +## License + +You may use this software under the BSD or MIT. Take your pick. If you want me to release it under another license, open a pull request. \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/index.js new file mode 100644 index 00000000..44e7b4b5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/index.js @@ -0,0 +1,107 @@ +'use strict' + +var Transform = require('stream').Transform || require('readable-stream').Transform +var crypto = require('crypto') +var fs = require('graceful-fs') + +exports.check = check +exports.checkSync = checkSync +exports.get = get +exports.getSync = getSync +exports.stream = stream + +function check(file, expected, options, cb) { + if (typeof options === 'function') { + cb = options + options = undefined + } + expected = expected.toLowerCase().trim() + get(file, options, function (er, actual) { + if (er) { + if (er.message) er.message += ' while getting shasum for ' + file + return cb(er) + } + if (actual === expected) return cb(null) + cb(new Error( + 'shasum check failed for ' + file + '\n' + + 'Expected: ' + expected + '\n' + + 'Actual: ' + actual)) + }) +} +function checkSync(file, expected, options) { + expected = expected.toLowerCase().trim() + var actual + try { + actual = getSync(file, options) + } catch (er) { + if (er.message) er.message += ' while getting shasum for ' + file + throw er + } + if (actual !== expected) { + var ex = new Error( + 'shasum check failed for ' + file + '\n' + + 'Expected: ' + expected + '\n' + + 'Actual: ' + actual) + throw ex + } +} + + +function get(file, options, cb) { + if (typeof options === 'function') { + cb = options + options = undefined + } + options = options || {} + var algorithm = options.algorithm || 'sha1' + var hash = crypto.createHash(algorithm) + var source = fs.createReadStream(file) + var errState = null + source + .on('error', function (er) { + if (errState) return + return cb(errState = er) + }) + .on('data', function (chunk) { + if (errState) return + hash.update(chunk) + }) + .on('end', function () { + if (errState) return + var actual = hash.digest("hex").toLowerCase().trim() + cb(null, actual) + }) +} + +function getSync(file, options) { + options = options || {} + var algorithm = options.algorithm || 'sha1' + var hash = crypto.createHash(algorithm) + var source = fs.readFileSync(file) + hash.update(source) + return hash.digest("hex").toLowerCase().trim() +} + +function stream(expected, options) { + expected = expected.toLowerCase().trim() + options = options || {} + var algorithm = options.algorithm || 'sha1' + var hash = crypto.createHash(algorithm) + + var stream = new Transform() + stream._transform = function (chunk, encoding, callback) { + hash.update(chunk) + stream.push(chunk) + callback() + } + stream._flush = function (cb) { + var actual = hash.digest("hex").toLowerCase().trim() + if (actual === expected) return cb(null) + cb(new Error( + 'shasum check failed for:\n' + + ' Expected: ' + expected + '\n' + + ' Actual: ' + actual)) + this.push(null) + } + return stream +} \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/.npmignore new file mode 100644 index 00000000..38344f87 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/.npmignore @@ -0,0 +1,5 @@ +build/ +test/ +examples/ +fs.js +zlib.js \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/.travis.yml new file mode 100644 index 00000000..a2870dfb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/.travis.yml @@ -0,0 +1,39 @@ +sudo: false +language: node_js +before_install: + - npm install -g npm +notifications: + email: false +matrix: + include: + - node_js: '0.8' + env: TASK=test + - node_js: '0.10' + env: TASK=test + - node_js: '0.11' + env: TASK=test + - node_js: '0.12' + env: TASK=test + - node_js: 'iojs' + env: TASK=test + - node_js: 'iojs' + env: TASK=browser BROWSER_NAME=opera BROWSER_VERSION="11..latest" + - node_js: 'iojs' + env: TASK=browser BROWSER_NAME=ie BROWSER_VERSION="9..latest" + - node_js: 'iojs' + env: TASK=browser BROWSER_NAME=chrome BROWSER_VERSION="39..beta" + - node_js: 'iojs' + env: TASK=browser BROWSER_NAME=firefox BROWSER_VERSION="34..beta" + - node_js: 'iojs' + env: TASK=browser BROWSER_NAME=ipad BROWSER_VERSION="6.0..latest" + - node_js: 'iojs' + env: TASK=browser BROWSER_NAME=iphone BROWSER_VERSION="6.0..latest" + - node_js: 'iojs' + env: TASK=browser BROWSER_NAME=safari BROWSER_VERSION="5..latest" + - node_js: 'iojs' + env: TASK=browser BROWSER_NAME=android BROWSER_VERSION="4.0..latest" +script: "npm run $TASK" +env: + global: + - secure: rE2Vvo7vnjabYNULNyLFxOyt98BoJexDqsiOnfiD6kLYYsiQGfr/sbZkPMOFm9qfQG7pjqx+zZWZjGSswhTt+626C0t/njXqug7Yps4c3dFblzGfreQHp7wNX5TFsvrxd6dAowVasMp61sJcRnB2w8cUzoe3RAYUDHyiHktwqMc= + - secure: g9YINaKAdMatsJ28G9jCGbSaguXCyxSTy+pBO6Ch0Cf57ZLOTka3HqDj8p3nV28LUIHZ3ut5WO43CeYKwt4AUtLpBS3a0dndHdY6D83uY6b2qh5hXlrcbeQTq2cvw2y95F7hm4D1kwrgZ7ViqaKggRcEupAL69YbJnxeUDKWEdI= diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/.zuul.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/.zuul.yml new file mode 100644 index 00000000..96d9cfbd --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/.zuul.yml @@ -0,0 +1 @@ +ui: tape diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/LICENSE new file mode 100644 index 00000000..e3d4e695 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/LICENSE @@ -0,0 +1,18 @@ +Copyright Joyent, Inc. and other Node contributors. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/README.md new file mode 100644 index 00000000..77fafa3d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/README.md @@ -0,0 +1,36 @@ +# readable-stream + +***Node-core streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream) + + +[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/) +[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/) + + +[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream) + +```bash +npm install --save readable-stream +``` + +***Node-core streams for userland*** + +This package is a mirror of the Streams2 and Streams3 implementations in +Node-core, including [documentation](doc/stream.markdown). + +If you want to guarantee a stable streams base, regardless of what version of +Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html). + +As of version 2.0.0 **readable-stream** uses semantic versioning. + +# Streams WG Team Members + +* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) <christopher.s.dickinson@gmail.com> + - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B +* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com> + - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242 +* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) <rod@vagg.org> + - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D +* **Sam Newman** ([@sonewman](https://github.com/sonewman)) <newmansam@outlook.com> +* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com> +* **Domenic Denicola** ([@domenic](https://github.com/domenic)) <d@domenic.me> diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/doc/stream.markdown b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/doc/stream.markdown new file mode 100644 index 00000000..a2270c88 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/doc/stream.markdown @@ -0,0 +1,1651 @@ +# Stream + + Stability: 2 - Stable + +A stream is an abstract interface implemented by various objects in +io.js. For example a [request to an HTTP +server](https://iojs.org/dist/v2.3.0/doc/api/http.html#http_http_incomingmessage) is a stream, as is +[stdout][]. Streams are readable, writable, or both. All streams are +instances of [EventEmitter][] + +You can load the Stream base classes by doing `require('stream')`. +There are base classes provided for [Readable][] streams, [Writable][] +streams, [Duplex][] streams, and [Transform][] streams. + +This document is split up into 3 sections. The first explains the +parts of the API that you need to be aware of to use streams in your +programs. If you never implement a streaming API yourself, you can +stop there. + +The second section explains the parts of the API that you need to use +if you implement your own custom streams yourself. The API is +designed to make this easy for you to do. + +The third section goes into more depth about how streams work, +including some of the internal mechanisms and functions that you +should probably not modify unless you definitely know what you are +doing. + + +## API for Stream Consumers + + + +Streams can be either [Readable][], [Writable][], or both ([Duplex][]). + +All streams are EventEmitters, but they also have other custom methods +and properties depending on whether they are Readable, Writable, or +Duplex. + +If a stream is both Readable and Writable, then it implements all of +the methods and events below. So, a [Duplex][] or [Transform][] stream is +fully described by this API, though their implementation may be +somewhat different. + +It is not necessary to implement Stream interfaces in order to consume +streams in your programs. If you **are** implementing streaming +interfaces in your own program, please also refer to +[API for Stream Implementors][] below. + +Almost all io.js programs, no matter how simple, use Streams in some +way. Here is an example of using Streams in an io.js program: + +```javascript +var http = require('http'); + +var server = http.createServer(function (req, res) { + // req is an http.IncomingMessage, which is a Readable Stream + // res is an http.ServerResponse, which is a Writable Stream + + var body = ''; + // we want to get the data as utf8 strings + // If you don't set an encoding, then you'll get Buffer objects + req.setEncoding('utf8'); + + // Readable streams emit 'data' events once a listener is added + req.on('data', function (chunk) { + body += chunk; + }); + + // the end event tells you that you have entire body + req.on('end', function () { + try { + var data = JSON.parse(body); + } catch (er) { + // uh oh! bad json! + res.statusCode = 400; + return res.end('error: ' + er.message); + } + + // write back something interesting to the user: + res.write(typeof data); + res.end(); + }); +}); + +server.listen(1337); + +// $ curl localhost:1337 -d '{}' +// object +// $ curl localhost:1337 -d '"foo"' +// string +// $ curl localhost:1337 -d 'not json' +// error: Unexpected token o +``` + +### Class: stream.Readable + + + +The Readable stream interface is the abstraction for a *source* of +data that you are reading from. In other words, data comes *out* of a +Readable stream. + +A Readable stream will not start emitting data until you indicate that +you are ready to receive it. + +Readable streams have two "modes": a **flowing mode** and a **paused +mode**. When in flowing mode, data is read from the underlying system +and provided to your program as fast as possible. In paused mode, you +must explicitly call `stream.read()` to get chunks of data out. +Streams start out in paused mode. + +**Note**: If no data event handlers are attached, and there are no +[`pipe()`][] destinations, and the stream is switched into flowing +mode, then data will be lost. + +You can switch to flowing mode by doing any of the following: + +* Adding a [`'data'` event][] handler to listen for data. +* Calling the [`resume()`][] method to explicitly open the flow. +* Calling the [`pipe()`][] method to send the data to a [Writable][]. + +You can switch back to paused mode by doing either of the following: + +* If there are no pipe destinations, by calling the [`pause()`][] + method. +* If there are pipe destinations, by removing any [`'data'` event][] + handlers, and removing all pipe destinations by calling the + [`unpipe()`][] method. + +Note that, for backwards compatibility reasons, removing `'data'` +event handlers will **not** automatically pause the stream. Also, if +there are piped destinations, then calling `pause()` will not +guarantee that the stream will *remain* paused once those +destinations drain and ask for more data. + +Examples of readable streams include: + +* [http responses, on the client](https://iojs.org/dist/v2.3.0/doc/api/http.html#http_http_incomingmessage) +* [http requests, on the server](https://iojs.org/dist/v2.3.0/doc/api/http.html#http_http_incomingmessage) +* [fs read streams](https://iojs.org/dist/v2.3.0/doc/api/fs.html#fs_class_fs_readstream) +* [zlib streams][] +* [crypto streams][] +* [tcp sockets][] +* [child process stdout and stderr][] +* [process.stdin][] + +#### Event: 'readable' + +When a chunk of data can be read from the stream, it will emit a +`'readable'` event. + +In some cases, listening for a `'readable'` event will cause some data +to be read into the internal buffer from the underlying system, if it +hadn't already. + +```javascript +var readable = getReadableStreamSomehow(); +readable.on('readable', function() { + // there is some data to read now +}); +``` + +Once the internal buffer is drained, a `readable` event will fire +again when more data is available. + +#### Event: 'data' + +* `chunk` {Buffer | String} The chunk of data. + +Attaching a `data` event listener to a stream that has not been +explicitly paused will switch the stream into flowing mode. Data will +then be passed as soon as it is available. + +If you just want to get all the data out of the stream as fast as +possible, this is the best way to do so. + +```javascript +var readable = getReadableStreamSomehow(); +readable.on('data', function(chunk) { + console.log('got %d bytes of data', chunk.length); +}); +``` + +#### Event: 'end' + +This event fires when there will be no more data to read. + +Note that the `end` event **will not fire** unless the data is +completely consumed. This can be done by switching into flowing mode, +or by calling `read()` repeatedly until you get to the end. + +```javascript +var readable = getReadableStreamSomehow(); +readable.on('data', function(chunk) { + console.log('got %d bytes of data', chunk.length); +}); +readable.on('end', function() { + console.log('there will be no more data.'); +}); +``` + +#### Event: 'close' + +Emitted when the underlying resource (for example, the backing file +descriptor) has been closed. Not all streams will emit this. + +#### Event: 'error' + +* {Error Object} + +Emitted if there was an error receiving data. + +#### readable.read([size]) + +* `size` {Number} Optional argument to specify how much data to read. +* Return {String | Buffer | null} + +The `read()` method pulls some data out of the internal buffer and +returns it. If there is no data available, then it will return +`null`. + +If you pass in a `size` argument, then it will return that many +bytes. If `size` bytes are not available, then it will return `null`. + +If you do not specify a `size` argument, then it will return all the +data in the internal buffer. + +This method should only be called in paused mode. In flowing mode, +this method is called automatically until the internal buffer is +drained. + +```javascript +var readable = getReadableStreamSomehow(); +readable.on('readable', function() { + var chunk; + while (null !== (chunk = readable.read())) { + console.log('got %d bytes of data', chunk.length); + } +}); +``` + +If this method returns a data chunk, then it will also trigger the +emission of a [`'data'` event][]. + +#### readable.setEncoding(encoding) + +* `encoding` {String} The encoding to use. +* Return: `this` + +Call this function to cause the stream to return strings of the +specified encoding instead of Buffer objects. For example, if you do +`readable.setEncoding('utf8')`, then the output data will be +interpreted as UTF-8 data, and returned as strings. If you do +`readable.setEncoding('hex')`, then the data will be encoded in +hexadecimal string format. + +This properly handles multi-byte characters that would otherwise be +potentially mangled if you simply pulled the Buffers directly and +called `buf.toString(encoding)` on them. If you want to read the data +as strings, always use this method. + +```javascript +var readable = getReadableStreamSomehow(); +readable.setEncoding('utf8'); +readable.on('data', function(chunk) { + assert.equal(typeof chunk, 'string'); + console.log('got %d characters of string data', chunk.length); +}); +``` + +#### readable.resume() + +* Return: `this` + +This method will cause the readable stream to resume emitting `data` +events. + +This method will switch the stream into flowing mode. If you do *not* +want to consume the data from a stream, but you *do* want to get to +its `end` event, you can call [`readable.resume()`][] to open the flow of +data. + +```javascript +var readable = getReadableStreamSomehow(); +readable.resume(); +readable.on('end', function() { + console.log('got to the end, but did not read anything'); +}); +``` + +#### readable.pause() + +* Return: `this` + +This method will cause a stream in flowing mode to stop emitting +`data` events, switching out of flowing mode. Any data that becomes +available will remain in the internal buffer. + +```javascript +var readable = getReadableStreamSomehow(); +readable.on('data', function(chunk) { + console.log('got %d bytes of data', chunk.length); + readable.pause(); + console.log('there will be no more data for 1 second'); + setTimeout(function() { + console.log('now data will start flowing again'); + readable.resume(); + }, 1000); +}); +``` + +#### readable.isPaused() + +* Return: `Boolean` + +This method returns whether or not the `readable` has been **explicitly** +paused by client code (using `readable.pause()` without a corresponding +`readable.resume()`). + +```javascript +var readable = new stream.Readable + +readable.isPaused() // === false +readable.pause() +readable.isPaused() // === true +readable.resume() +readable.isPaused() // === false +``` + +#### readable.pipe(destination[, options]) + +* `destination` {[Writable][] Stream} The destination for writing data +* `options` {Object} Pipe options + * `end` {Boolean} End the writer when the reader ends. Default = `true` + +This method pulls all the data out of a readable stream, and writes it +to the supplied destination, automatically managing the flow so that +the destination is not overwhelmed by a fast readable stream. + +Multiple destinations can be piped to safely. + +```javascript +var readable = getReadableStreamSomehow(); +var writable = fs.createWriteStream('file.txt'); +// All the data from readable goes into 'file.txt' +readable.pipe(writable); +``` + +This function returns the destination stream, so you can set up pipe +chains like so: + +```javascript +var r = fs.createReadStream('file.txt'); +var z = zlib.createGzip(); +var w = fs.createWriteStream('file.txt.gz'); +r.pipe(z).pipe(w); +``` + +For example, emulating the Unix `cat` command: + +```javascript +process.stdin.pipe(process.stdout); +``` + +By default [`end()`][] is called on the destination when the source stream +emits `end`, so that `destination` is no longer writable. Pass `{ end: +false }` as `options` to keep the destination stream open. + +This keeps `writer` open so that "Goodbye" can be written at the +end. + +```javascript +reader.pipe(writer, { end: false }); +reader.on('end', function() { + writer.end('Goodbye\n'); +}); +``` + +Note that `process.stderr` and `process.stdout` are never closed until +the process exits, regardless of the specified options. + +#### readable.unpipe([destination]) + +* `destination` {[Writable][] Stream} Optional specific stream to unpipe + +This method will remove the hooks set up for a previous `pipe()` call. + +If the destination is not specified, then all pipes are removed. + +If the destination is specified, but no pipe is set up for it, then +this is a no-op. + +```javascript +var readable = getReadableStreamSomehow(); +var writable = fs.createWriteStream('file.txt'); +// All the data from readable goes into 'file.txt', +// but only for the first second +readable.pipe(writable); +setTimeout(function() { + console.log('stop writing to file.txt'); + readable.unpipe(writable); + console.log('manually close the file stream'); + writable.end(); +}, 1000); +``` + +#### readable.unshift(chunk) + +* `chunk` {Buffer | String} Chunk of data to unshift onto the read queue + +This is useful in certain cases where a stream is being consumed by a +parser, which needs to "un-consume" some data that it has +optimistically pulled out of the source, so that the stream can be +passed on to some other party. + +If you find that you must often call `stream.unshift(chunk)` in your +programs, consider implementing a [Transform][] stream instead. (See API +for Stream Implementors, below.) + +```javascript +// Pull off a header delimited by \n\n +// use unshift() if we get too much +// Call the callback with (error, header, stream) +var StringDecoder = require('string_decoder').StringDecoder; +function parseHeader(stream, callback) { + stream.on('error', callback); + stream.on('readable', onReadable); + var decoder = new StringDecoder('utf8'); + var header = ''; + function onReadable() { + var chunk; + while (null !== (chunk = stream.read())) { + var str = decoder.write(chunk); + if (str.match(/\n\n/)) { + // found the header boundary + var split = str.split(/\n\n/); + header += split.shift(); + var remaining = split.join('\n\n'); + var buf = new Buffer(remaining, 'utf8'); + if (buf.length) + stream.unshift(buf); + stream.removeListener('error', callback); + stream.removeListener('readable', onReadable); + // now the body of the message can be read from the stream. + callback(null, header, stream); + } else { + // still reading the header. + header += str; + } + } + } +} +``` + +#### readable.wrap(stream) + +* `stream` {Stream} An "old style" readable stream + +Versions of Node.js prior to v0.10 had streams that did not implement the +entire Streams API as it is today. (See "Compatibility" below for +more information.) + +If you are using an older io.js library that emits `'data'` events and +has a [`pause()`][] method that is advisory only, then you can use the +`wrap()` method to create a [Readable][] stream that uses the old stream +as its data source. + +You will very rarely ever need to call this function, but it exists +as a convenience for interacting with old io.js programs and libraries. + +For example: + +```javascript +var OldReader = require('./old-api-module.js').OldReader; +var oreader = new OldReader; +var Readable = require('stream').Readable; +var myReader = new Readable().wrap(oreader); + +myReader.on('readable', function() { + myReader.read(); // etc. +}); +``` + + +### Class: stream.Writable + + + +The Writable stream interface is an abstraction for a *destination* +that you are writing data *to*. + +Examples of writable streams include: + +* [http requests, on the client](https://iojs.org/dist/v2.3.0/doc/api/http.html#http_class_http_clientrequest) +* [http responses, on the server](https://iojs.org/dist/v2.3.0/doc/api/http.html#http_class_http_serverresponse) +* [fs write streams](https://iojs.org/dist/v2.3.0/doc/api/fs.html#fs_class_fs_writestream) +* [zlib streams][] +* [crypto streams][] +* [tcp sockets][] +* [child process stdin](https://iojs.org/dist/v2.3.0/doc/api/child_process.html#child_process_child_stdin) +* [process.stdout][], [process.stderr][] + +#### writable.write(chunk[, encoding][, callback]) + +* `chunk` {String | Buffer} The data to write +* `encoding` {String} The encoding, if `chunk` is a String +* `callback` {Function} Callback for when this chunk of data is flushed +* Returns: {Boolean} True if the data was handled completely. + +This method writes some data to the underlying system, and calls the +supplied callback once the data has been fully handled. + +The return value indicates if you should continue writing right now. +If the data had to be buffered internally, then it will return +`false`. Otherwise, it will return `true`. + +This return value is strictly advisory. You MAY continue to write, +even if it returns `false`. However, writes will be buffered in +memory, so it is best not to do this excessively. Instead, wait for +the `drain` event before writing more data. + +#### Event: 'drain' + +If a [`writable.write(chunk)`][] call returns false, then the `drain` +event will indicate when it is appropriate to begin writing more data +to the stream. + +```javascript +// Write the data to the supplied writable stream 1MM times. +// Be attentive to back-pressure. +function writeOneMillionTimes(writer, data, encoding, callback) { + var i = 1000000; + write(); + function write() { + var ok = true; + do { + i -= 1; + if (i === 0) { + // last time! + writer.write(data, encoding, callback); + } else { + // see if we should continue, or wait + // don't pass the callback, because we're not done yet. + ok = writer.write(data, encoding); + } + } while (i > 0 && ok); + if (i > 0) { + // had to stop early! + // write some more once it drains + writer.once('drain', write); + } + } +} +``` + +#### writable.cork() + +Forces buffering of all writes. + +Buffered data will be flushed either at `.uncork()` or at `.end()` call. + +#### writable.uncork() + +Flush all data, buffered since `.cork()` call. + +#### writable.setDefaultEncoding(encoding) + +* `encoding` {String} The new default encoding + +Sets the default encoding for a writable stream. + +#### writable.end([chunk][, encoding][, callback]) + +* `chunk` {String | Buffer} Optional data to write +* `encoding` {String} The encoding, if `chunk` is a String +* `callback` {Function} Optional callback for when the stream is finished + +Call this method when no more data will be written to the stream. If +supplied, the callback is attached as a listener on the `finish` event. + +Calling [`write()`][] after calling [`end()`][] will raise an error. + +```javascript +// write 'hello, ' and then end with 'world!' +var file = fs.createWriteStream('example.txt'); +file.write('hello, '); +file.end('world!'); +// writing more now is not allowed! +``` + +#### Event: 'finish' + +When the [`end()`][] method has been called, and all data has been flushed +to the underlying system, this event is emitted. + +```javascript +var writer = getWritableStreamSomehow(); +for (var i = 0; i < 100; i ++) { + writer.write('hello, #' + i + '!\n'); +} +writer.end('this is the end\n'); +writer.on('finish', function() { + console.error('all writes are now complete.'); +}); +``` + +#### Event: 'pipe' + +* `src` {[Readable][] Stream} source stream that is piping to this writable + +This is emitted whenever the `pipe()` method is called on a readable +stream, adding this writable to its set of destinations. + +```javascript +var writer = getWritableStreamSomehow(); +var reader = getReadableStreamSomehow(); +writer.on('pipe', function(src) { + console.error('something is piping into the writer'); + assert.equal(src, reader); +}); +reader.pipe(writer); +``` + +#### Event: 'unpipe' + +* `src` {[Readable][] Stream} The source stream that [unpiped][] this writable + +This is emitted whenever the [`unpipe()`][] method is called on a +readable stream, removing this writable from its set of destinations. + +```javascript +var writer = getWritableStreamSomehow(); +var reader = getReadableStreamSomehow(); +writer.on('unpipe', function(src) { + console.error('something has stopped piping into the writer'); + assert.equal(src, reader); +}); +reader.pipe(writer); +reader.unpipe(writer); +``` + +#### Event: 'error' + +* {Error object} + +Emitted if there was an error when writing or piping data. + +### Class: stream.Duplex + +Duplex streams are streams that implement both the [Readable][] and +[Writable][] interfaces. See above for usage. + +Examples of Duplex streams include: + +* [tcp sockets][] +* [zlib streams][] +* [crypto streams][] + + +### Class: stream.Transform + +Transform streams are [Duplex][] streams where the output is in some way +computed from the input. They implement both the [Readable][] and +[Writable][] interfaces. See above for usage. + +Examples of Transform streams include: + +* [zlib streams][] +* [crypto streams][] + + +## API for Stream Implementors + + + +To implement any sort of stream, the pattern is the same: + +1. Extend the appropriate parent class in your own subclass. (The + [`util.inherits`][] method is particularly helpful for this.) +2. Call the appropriate parent class constructor in your constructor, + to be sure that the internal mechanisms are set up properly. +2. Implement one or more specific methods, as detailed below. + +The class to extend and the method(s) to implement depend on the sort +of stream class you are writing: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      +

      Use-case

      +
      +

      Class

      +
      +

      Method(s) to implement

      +
      +

      Reading only

      +
      +

      [Readable](#stream_class_stream_readable_1)

      +
      +

      [_read][]

      +
      +

      Writing only

      +
      +

      [Writable](#stream_class_stream_writable_1)

      +
      +

      [_write][], _writev

      +
      +

      Reading and writing

      +
      +

      [Duplex](#stream_class_stream_duplex_1)

      +
      +

      [_read][], [_write][], _writev

      +
      +

      Operate on written data, then read the result

      +
      +

      [Transform](#stream_class_stream_transform_1)

      +
      +

      _transform, _flush

      +
      + +In your implementation code, it is very important to never call the +methods described in [API for Stream Consumers][] above. Otherwise, you +can potentially cause adverse side effects in programs that consume +your streaming interfaces. + +### Class: stream.Readable + + + +`stream.Readable` is an abstract class designed to be extended with an +underlying implementation of the [`_read(size)`][] method. + +Please see above under [API for Stream Consumers][] for how to consume +streams in your programs. What follows is an explanation of how to +implement Readable streams in your programs. + +#### Example: A Counting Stream + + + +This is a basic example of a Readable stream. It emits the numerals +from 1 to 1,000,000 in ascending order, and then ends. + +```javascript +var Readable = require('stream').Readable; +var util = require('util'); +util.inherits(Counter, Readable); + +function Counter(opt) { + Readable.call(this, opt); + this._max = 1000000; + this._index = 1; +} + +Counter.prototype._read = function() { + var i = this._index++; + if (i > this._max) + this.push(null); + else { + var str = '' + i; + var buf = new Buffer(str, 'ascii'); + this.push(buf); + } +}; +``` + +#### Example: SimpleProtocol v1 (Sub-optimal) + +This is similar to the `parseHeader` function described above, but +implemented as a custom stream. Also, note that this implementation +does not convert the incoming data to a string. + +However, this would be better implemented as a [Transform][] stream. See +below for a better implementation. + +```javascript +// A parser for a simple data protocol. +// The "header" is a JSON object, followed by 2 \n characters, and +// then a message body. +// +// NOTE: This can be done more simply as a Transform stream! +// Using Readable directly for this is sub-optimal. See the +// alternative example below under the Transform section. + +var Readable = require('stream').Readable; +var util = require('util'); + +util.inherits(SimpleProtocol, Readable); + +function SimpleProtocol(source, options) { + if (!(this instanceof SimpleProtocol)) + return new SimpleProtocol(source, options); + + Readable.call(this, options); + this._inBody = false; + this._sawFirstCr = false; + + // source is a readable stream, such as a socket or file + this._source = source; + + var self = this; + source.on('end', function() { + self.push(null); + }); + + // give it a kick whenever the source is readable + // read(0) will not consume any bytes + source.on('readable', function() { + self.read(0); + }); + + this._rawHeader = []; + this.header = null; +} + +SimpleProtocol.prototype._read = function(n) { + if (!this._inBody) { + var chunk = this._source.read(); + + // if the source doesn't have data, we don't have data yet. + if (chunk === null) + return this.push(''); + + // check if the chunk has a \n\n + var split = -1; + for (var i = 0; i < chunk.length; i++) { + if (chunk[i] === 10) { // '\n' + if (this._sawFirstCr) { + split = i; + break; + } else { + this._sawFirstCr = true; + } + } else { + this._sawFirstCr = false; + } + } + + if (split === -1) { + // still waiting for the \n\n + // stash the chunk, and try again. + this._rawHeader.push(chunk); + this.push(''); + } else { + this._inBody = true; + var h = chunk.slice(0, split); + this._rawHeader.push(h); + var header = Buffer.concat(this._rawHeader).toString(); + try { + this.header = JSON.parse(header); + } catch (er) { + this.emit('error', new Error('invalid simple protocol data')); + return; + } + // now, because we got some extra data, unshift the rest + // back into the read queue so that our consumer will see it. + var b = chunk.slice(split); + this.unshift(b); + + // and let them know that we are done parsing the header. + this.emit('header', this.header); + } + } else { + // from there on, just provide the data to our consumer. + // careful not to push(null), since that would indicate EOF. + var chunk = this._source.read(); + if (chunk) this.push(chunk); + } +}; + +// Usage: +// var parser = new SimpleProtocol(source); +// Now parser is a readable stream that will emit 'header' +// with the parsed header data. +``` + + +#### new stream.Readable([options]) + +* `options` {Object} + * `highWaterMark` {Number} The maximum number of bytes to store in + the internal buffer before ceasing to read from the underlying + resource. Default=16kb, or 16 for `objectMode` streams + * `encoding` {String} If specified, then buffers will be decoded to + strings using the specified encoding. Default=null + * `objectMode` {Boolean} Whether this stream should behave + as a stream of objects. Meaning that stream.read(n) returns + a single value instead of a Buffer of size n. Default=false + +In classes that extend the Readable class, make sure to call the +Readable constructor so that the buffering settings can be properly +initialized. + +#### readable.\_read(size) + +* `size` {Number} Number of bytes to read asynchronously + +Note: **Implement this function, but do NOT call it directly.** + +This function should NOT be called directly. It should be implemented +by child classes, and only called by the internal Readable class +methods. + +All Readable stream implementations must provide a `_read` method to +fetch data from the underlying resource. + +This method is prefixed with an underscore because it is internal to +the class that defines it, and should not be called directly by user +programs. However, you **are** expected to override this method in +your own extension classes. + +When data is available, put it into the read queue by calling +`readable.push(chunk)`. If `push` returns false, then you should stop +reading. When `_read` is called again, you should start pushing more +data. + +The `size` argument is advisory. Implementations where a "read" is a +single call that returns data can use this to know how much data to +fetch. Implementations where that is not relevant, such as TCP or +TLS, may ignore this argument, and simply provide data whenever it +becomes available. There is no need, for example to "wait" until +`size` bytes are available before calling [`stream.push(chunk)`][]. + +#### readable.push(chunk[, encoding]) + +* `chunk` {Buffer | null | String} Chunk of data to push into the read queue +* `encoding` {String} Encoding of String chunks. Must be a valid + Buffer encoding, such as `'utf8'` or `'ascii'` +* return {Boolean} Whether or not more pushes should be performed + +Note: **This function should be called by Readable implementors, NOT +by consumers of Readable streams.** + +The `_read()` function will not be called again until at least one +`push(chunk)` call is made. + +The `Readable` class works by putting data into a read queue to be +pulled out later by calling the `read()` method when the `'readable'` +event fires. + +The `push()` method will explicitly insert some data into the read +queue. If it is called with `null` then it will signal the end of the +data (EOF). + +This API is designed to be as flexible as possible. For example, +you may be wrapping a lower-level source which has some sort of +pause/resume mechanism, and a data callback. In those cases, you +could wrap the low-level source object by doing something like this: + +```javascript +// source is an object with readStop() and readStart() methods, +// and an `ondata` member that gets called when it has data, and +// an `onend` member that gets called when the data is over. + +util.inherits(SourceWrapper, Readable); + +function SourceWrapper(options) { + Readable.call(this, options); + + this._source = getLowlevelSourceObject(); + var self = this; + + // Every time there's data, we push it into the internal buffer. + this._source.ondata = function(chunk) { + // if push() returns false, then we need to stop reading from source + if (!self.push(chunk)) + self._source.readStop(); + }; + + // When the source ends, we push the EOF-signaling `null` chunk + this._source.onend = function() { + self.push(null); + }; +} + +// _read will be called when the stream wants to pull more data in +// the advisory size argument is ignored in this case. +SourceWrapper.prototype._read = function(size) { + this._source.readStart(); +}; +``` + + +### Class: stream.Writable + + + +`stream.Writable` is an abstract class designed to be extended with an +underlying implementation of the [`_write(chunk, encoding, callback)`][] method. + +Please see above under [API for Stream Consumers][] for how to consume +writable streams in your programs. What follows is an explanation of +how to implement Writable streams in your programs. + +#### new stream.Writable([options]) + +* `options` {Object} + * `highWaterMark` {Number} Buffer level when [`write()`][] starts + returning false. Default=16kb, or 16 for `objectMode` streams + * `decodeStrings` {Boolean} Whether or not to decode strings into + Buffers before passing them to [`_write()`][]. Default=true + * `objectMode` {Boolean} Whether or not the `write(anyObj)` is + a valid operation. If set you can write arbitrary data instead + of only `Buffer` / `String` data. Default=false + +In classes that extend the Writable class, make sure to call the +constructor so that the buffering settings can be properly +initialized. + +#### writable.\_write(chunk, encoding, callback) + +* `chunk` {Buffer | String} The chunk to be written. Will **always** + be a buffer unless the `decodeStrings` option was set to `false`. +* `encoding` {String} If the chunk is a string, then this is the + encoding type. If chunk is a buffer, then this is the special + value - 'buffer', ignore it in this case. +* `callback` {Function} Call this function (optionally with an error + argument) when you are done processing the supplied chunk. + +All Writable stream implementations must provide a [`_write()`][] +method to send data to the underlying resource. + +Note: **This function MUST NOT be called directly.** It should be +implemented by child classes, and called by the internal Writable +class methods only. + +Call the callback using the standard `callback(error)` pattern to +signal that the write completed successfully or with an error. + +If the `decodeStrings` flag is set in the constructor options, then +`chunk` may be a string rather than a Buffer, and `encoding` will +indicate the sort of string that it is. This is to support +implementations that have an optimized handling for certain string +data encodings. If you do not explicitly set the `decodeStrings` +option to `false`, then you can safely ignore the `encoding` argument, +and assume that `chunk` will always be a Buffer. + +This method is prefixed with an underscore because it is internal to +the class that defines it, and should not be called directly by user +programs. However, you **are** expected to override this method in +your own extension classes. + +#### writable.\_writev(chunks, callback) + +* `chunks` {Array} The chunks to be written. Each chunk has following + format: `{ chunk: ..., encoding: ... }`. +* `callback` {Function} Call this function (optionally with an error + argument) when you are done processing the supplied chunks. + +Note: **This function MUST NOT be called directly.** It may be +implemented by child classes, and called by the internal Writable +class methods only. + +This function is completely optional to implement. In most cases it is +unnecessary. If implemented, it will be called with all the chunks +that are buffered in the write queue. + + +### Class: stream.Duplex + + + +A "duplex" stream is one that is both Readable and Writable, such as a +TCP socket connection. + +Note that `stream.Duplex` is an abstract class designed to be extended +with an underlying implementation of the `_read(size)` and +[`_write(chunk, encoding, callback)`][] methods as you would with a +Readable or Writable stream class. + +Since JavaScript doesn't have multiple prototypal inheritance, this +class prototypally inherits from Readable, and then parasitically from +Writable. It is thus up to the user to implement both the lowlevel +`_read(n)` method as well as the lowlevel +[`_write(chunk, encoding, callback)`][] method on extension duplex classes. + +#### new stream.Duplex(options) + +* `options` {Object} Passed to both Writable and Readable + constructors. Also has the following fields: + * `allowHalfOpen` {Boolean} Default=true. If set to `false`, then + the stream will automatically end the readable side when the + writable side ends and vice versa. + * `readableObjectMode` {Boolean} Default=false. Sets `objectMode` + for readable side of the stream. Has no effect if `objectMode` + is `true`. + * `writableObjectMode` {Boolean} Default=false. Sets `objectMode` + for writable side of the stream. Has no effect if `objectMode` + is `true`. + +In classes that extend the Duplex class, make sure to call the +constructor so that the buffering settings can be properly +initialized. + + +### Class: stream.Transform + +A "transform" stream is a duplex stream where the output is causally +connected in some way to the input, such as a [zlib][] stream or a +[crypto][] stream. + +There is no requirement that the output be the same size as the input, +the same number of chunks, or arrive at the same time. For example, a +Hash stream will only ever have a single chunk of output which is +provided when the input is ended. A zlib stream will produce output +that is either much smaller or much larger than its input. + +Rather than implement the [`_read()`][] and [`_write()`][] methods, Transform +classes must implement the `_transform()` method, and may optionally +also implement the `_flush()` method. (See below.) + +#### new stream.Transform([options]) + +* `options` {Object} Passed to both Writable and Readable + constructors. + +In classes that extend the Transform class, make sure to call the +constructor so that the buffering settings can be properly +initialized. + +#### transform.\_transform(chunk, encoding, callback) + +* `chunk` {Buffer | String} The chunk to be transformed. Will **always** + be a buffer unless the `decodeStrings` option was set to `false`. +* `encoding` {String} If the chunk is a string, then this is the + encoding type. If chunk is a buffer, then this is the special + value - 'buffer', ignore it in this case. +* `callback` {Function} Call this function (optionally with an error + argument and data) when you are done processing the supplied chunk. + +Note: **This function MUST NOT be called directly.** It should be +implemented by child classes, and called by the internal Transform +class methods only. + +All Transform stream implementations must provide a `_transform` +method to accept input and produce output. + +`_transform` should do whatever has to be done in this specific +Transform class, to handle the bytes being written, and pass them off +to the readable portion of the interface. Do asynchronous I/O, +process things, and so on. + +Call `transform.push(outputChunk)` 0 or more times to generate output +from this input chunk, depending on how much data you want to output +as a result of this chunk. + +Call the callback function only when the current chunk is completely +consumed. Note that there may or may not be output as a result of any +particular input chunk. If you supply output as the second argument to the +callback, it will be passed to push method, in other words the following are +equivalent: + +```javascript +transform.prototype._transform = function (data, encoding, callback) { + this.push(data); + callback(); +} + +transform.prototype._transform = function (data, encoding, callback) { + callback(null, data); +} +``` + +This method is prefixed with an underscore because it is internal to +the class that defines it, and should not be called directly by user +programs. However, you **are** expected to override this method in +your own extension classes. + +#### transform.\_flush(callback) + +* `callback` {Function} Call this function (optionally with an error + argument) when you are done flushing any remaining data. + +Note: **This function MUST NOT be called directly.** It MAY be implemented +by child classes, and if so, will be called by the internal Transform +class methods only. + +In some cases, your transform operation may need to emit a bit more +data at the end of the stream. For example, a `Zlib` compression +stream will store up some internal state so that it can optimally +compress the output. At the end, however, it needs to do the best it +can with what is left, so that the data will be complete. + +In those cases, you can implement a `_flush` method, which will be +called at the very end, after all the written data is consumed, but +before emitting `end` to signal the end of the readable side. Just +like with `_transform`, call `transform.push(chunk)` zero or more +times, as appropriate, and call `callback` when the flush operation is +complete. + +This method is prefixed with an underscore because it is internal to +the class that defines it, and should not be called directly by user +programs. However, you **are** expected to override this method in +your own extension classes. + +#### Events: 'finish' and 'end' + +The [`finish`][] and [`end`][] events are from the parent Writable +and Readable classes respectively. The `finish` event is fired after +`.end()` is called and all chunks have been processed by `_transform`, +`end` is fired after all data has been output which is after the callback +in `_flush` has been called. + +#### Example: `SimpleProtocol` parser v2 + +The example above of a simple protocol parser can be implemented +simply by using the higher level [Transform][] stream class, similar to +the `parseHeader` and `SimpleProtocol v1` examples above. + +In this example, rather than providing the input as an argument, it +would be piped into the parser, which is a more idiomatic io.js stream +approach. + +```javascript +var util = require('util'); +var Transform = require('stream').Transform; +util.inherits(SimpleProtocol, Transform); + +function SimpleProtocol(options) { + if (!(this instanceof SimpleProtocol)) + return new SimpleProtocol(options); + + Transform.call(this, options); + this._inBody = false; + this._sawFirstCr = false; + this._rawHeader = []; + this.header = null; +} + +SimpleProtocol.prototype._transform = function(chunk, encoding, done) { + if (!this._inBody) { + // check if the chunk has a \n\n + var split = -1; + for (var i = 0; i < chunk.length; i++) { + if (chunk[i] === 10) { // '\n' + if (this._sawFirstCr) { + split = i; + break; + } else { + this._sawFirstCr = true; + } + } else { + this._sawFirstCr = false; + } + } + + if (split === -1) { + // still waiting for the \n\n + // stash the chunk, and try again. + this._rawHeader.push(chunk); + } else { + this._inBody = true; + var h = chunk.slice(0, split); + this._rawHeader.push(h); + var header = Buffer.concat(this._rawHeader).toString(); + try { + this.header = JSON.parse(header); + } catch (er) { + this.emit('error', new Error('invalid simple protocol data')); + return; + } + // and let them know that we are done parsing the header. + this.emit('header', this.header); + + // now, because we got some extra data, emit this first. + this.push(chunk.slice(split)); + } + } else { + // from there on, just provide the data to our consumer as-is. + this.push(chunk); + } + done(); +}; + +// Usage: +// var parser = new SimpleProtocol(); +// source.pipe(parser) +// Now parser is a readable stream that will emit 'header' +// with the parsed header data. +``` + + +### Class: stream.PassThrough + +This is a trivial implementation of a [Transform][] stream that simply +passes the input bytes across to the output. Its purpose is mainly +for examples and testing, but there are occasionally use cases where +it can come in handy as a building block for novel sorts of streams. + + +## Simplified Constructor API + + + +In simple cases there is now the added benefit of being able to construct a stream without inheritance. + +This can be done by passing the appropriate methods as constructor options: + +Examples: + +### Readable +```javascript +var readable = new stream.Readable({ + read: function(n) { + // sets this._read under the hood + } +}); +``` + +### Writable +```javascript +var writable = new stream.Writable({ + write: function(chunk, encoding, next) { + // sets this._write under the hood + } +}); + +// or + +var writable = new stream.Writable({ + writev: function(chunks, next) { + // sets this._writev under the hood + } +}); +``` + +### Duplex +```javascript +var duplex = new stream.Duplex({ + read: function(n) { + // sets this._read under the hood + }, + write: function(chunk, encoding, next) { + // sets this._write under the hood + } +}); + +// or + +var duplex = new stream.Duplex({ + read: function(n) { + // sets this._read under the hood + }, + writev: function(chunks, next) { + // sets this._writev under the hood + } +}); +``` + +### Transform +```javascript +var transform = new stream.Transform({ + transform: function(chunk, encoding, next) { + // sets this._transform under the hood + }, + flush: function(done) { + // sets this._flush under the hood + } +}); +``` + +## Streams: Under the Hood + + + +### Buffering + + + +Both Writable and Readable streams will buffer data on an internal +object called `_writableState.buffer` or `_readableState.buffer`, +respectively. + +The amount of data that will potentially be buffered depends on the +`highWaterMark` option which is passed into the constructor. + +Buffering in Readable streams happens when the implementation calls +[`stream.push(chunk)`][]. If the consumer of the Stream does not call +`stream.read()`, then the data will sit in the internal queue until it +is consumed. + +Buffering in Writable streams happens when the user calls +[`stream.write(chunk)`][] repeatedly, even when `write()` returns `false`. + +The purpose of streams, especially with the `pipe()` method, is to +limit the buffering of data to acceptable levels, so that sources and +destinations of varying speed will not overwhelm the available memory. + +### `stream.read(0)` + +There are some cases where you want to trigger a refresh of the +underlying readable stream mechanisms, without actually consuming any +data. In that case, you can call `stream.read(0)`, which will always +return null. + +If the internal read buffer is below the `highWaterMark`, and the +stream is not currently reading, then calling `read(0)` will trigger +a low-level `_read` call. + +There is almost never a need to do this. However, you will see some +cases in io.js's internals where this is done, particularly in the +Readable stream class internals. + +### `stream.push('')` + +Pushing a zero-byte string or Buffer (when not in [Object mode][]) has an +interesting side effect. Because it *is* a call to +[`stream.push()`][], it will end the `reading` process. However, it +does *not* add any data to the readable buffer, so there's nothing for +a user to consume. + +Very rarely, there are cases where you have no data to provide now, +but the consumer of your stream (or, perhaps, another bit of your own +code) will know when to check again, by calling `stream.read(0)`. In +those cases, you *may* call `stream.push('')`. + +So far, the only use case for this functionality is in the +[tls.CryptoStream][] class, which is deprecated in io.js v1.0. If you +find that you have to use `stream.push('')`, please consider another +approach, because it almost certainly indicates that something is +horribly wrong. + +### Compatibility with Older Node.js Versions + + + +In versions of Node.js prior to v0.10, the Readable stream interface was +simpler, but also less powerful and less useful. + +* Rather than waiting for you to call the `read()` method, `'data'` + events would start emitting immediately. If you needed to do some + I/O to decide how to handle data, then you had to store the chunks + in some kind of buffer so that they would not be lost. +* The [`pause()`][] method was advisory, rather than guaranteed. This + meant that you still had to be prepared to receive `'data'` events + even when the stream was in a paused state. + +In io.js v1.0 and Node.js v0.10, the Readable class described below was added. +For backwards compatibility with older Node.js programs, Readable streams +switch into "flowing mode" when a `'data'` event handler is added, or +when the [`resume()`][] method is called. The effect is that, even if +you are not using the new `read()` method and `'readable'` event, you +no longer have to worry about losing `'data'` chunks. + +Most programs will continue to function normally. However, this +introduces an edge case in the following conditions: + +* No [`'data'` event][] handler is added. +* The [`resume()`][] method is never called. +* The stream is not piped to any writable destination. + +For example, consider the following code: + +```javascript +// WARNING! BROKEN! +net.createServer(function(socket) { + + // we add an 'end' method, but never consume the data + socket.on('end', function() { + // It will never get here. + socket.end('I got your message (but didnt read it)\n'); + }); + +}).listen(1337); +``` + +In versions of Node.js prior to v0.10, the incoming message data would be +simply discarded. However, in io.js v1.0 and Node.js v0.10 and beyond, +the socket will remain paused forever. + +The workaround in this situation is to call the `resume()` method to +start the flow of data: + +```javascript +// Workaround +net.createServer(function(socket) { + + socket.on('end', function() { + socket.end('I got your message (but didnt read it)\n'); + }); + + // start the flow of data, discarding it. + socket.resume(); + +}).listen(1337); +``` + +In addition to new Readable streams switching into flowing mode, +pre-v0.10 style streams can be wrapped in a Readable class using the +`wrap()` method. + + +### Object Mode + + + +Normally, Streams operate on Strings and Buffers exclusively. + +Streams that are in **object mode** can emit generic JavaScript values +other than Buffers and Strings. + +A Readable stream in object mode will always return a single item from +a call to `stream.read(size)`, regardless of what the size argument +is. + +A Writable stream in object mode will always ignore the `encoding` +argument to `stream.write(data, encoding)`. + +The special value `null` still retains its special value for object +mode streams. That is, for object mode readable streams, `null` as a +return value from `stream.read()` indicates that there is no more +data, and [`stream.push(null)`][] will signal the end of stream data +(`EOF`). + +No streams in io.js core are object mode streams. This pattern is only +used by userland streaming libraries. + +You should set `objectMode` in your stream child class constructor on +the options object. Setting `objectMode` mid-stream is not safe. + +For Duplex streams `objectMode` can be set exclusively for readable or +writable side with `readableObjectMode` and `writableObjectMode` +respectively. These options can be used to implement parsers and +serializers with Transform streams. + +```javascript +var util = require('util'); +var StringDecoder = require('string_decoder').StringDecoder; +var Transform = require('stream').Transform; +util.inherits(JSONParseStream, Transform); + +// Gets \n-delimited JSON string data, and emits the parsed objects +function JSONParseStream() { + if (!(this instanceof JSONParseStream)) + return new JSONParseStream(); + + Transform.call(this, { readableObjectMode : true }); + + this._buffer = ''; + this._decoder = new StringDecoder('utf8'); +} + +JSONParseStream.prototype._transform = function(chunk, encoding, cb) { + this._buffer += this._decoder.write(chunk); + // split on newlines + var lines = this._buffer.split(/\r?\n/); + // keep the last partial line buffered + this._buffer = lines.pop(); + for (var l = 0; l < lines.length; l++) { + var line = lines[l]; + try { + var obj = JSON.parse(line); + } catch (er) { + this.emit('error', er); + return; + } + // push the parsed object out to the readable consumer + this.push(obj); + } + cb(); +}; + +JSONParseStream.prototype._flush = function(cb) { + // Just handle any leftover + var rem = this._buffer.trim(); + if (rem) { + try { + var obj = JSON.parse(rem); + } catch (er) { + this.emit('error', er); + return; + } + // push the parsed object out to the readable consumer + this.push(obj); + } + cb(); +}; +``` + + +[EventEmitter]: https://iojs.org/dist/v2.3.0/doc/api/events.html#events_class_events_eventemitter +[Object mode]: #stream_object_mode +[`stream.push(chunk)`]: #stream_readable_push_chunk_encoding +[`stream.push(null)`]: #stream_readable_push_chunk_encoding +[`stream.push()`]: #stream_readable_push_chunk_encoding +[`unpipe()`]: #stream_readable_unpipe_destination +[unpiped]: #stream_readable_unpipe_destination +[tcp sockets]: https://iojs.org/dist/v2.3.0/doc/api/net.html#net_class_net_socket +[zlib streams]: zlib.html +[zlib]: zlib.html +[crypto streams]: crypto.html +[crypto]: crypto.html +[tls.CryptoStream]: https://iojs.org/dist/v2.3.0/doc/api/tls.html#tls_class_cryptostream +[process.stdin]: https://iojs.org/dist/v2.3.0/doc/api/process.html#process_process_stdin +[stdout]: https://iojs.org/dist/v2.3.0/doc/api/process.html#process_process_stdout +[process.stdout]: https://iojs.org/dist/v2.3.0/doc/api/process.html#process_process_stdout +[process.stderr]: https://iojs.org/dist/v2.3.0/doc/api/process.html#process_process_stderr +[child process stdout and stderr]: https://iojs.org/dist/v2.3.0/doc/api/child_process.html#child_process_child_stdout +[API for Stream Consumers]: #stream_api_for_stream_consumers +[API for Stream Implementors]: #stream_api_for_stream_implementors +[Readable]: #stream_class_stream_readable +[Writable]: #stream_class_stream_writable +[Duplex]: #stream_class_stream_duplex +[Transform]: #stream_class_stream_transform +[`end`]: #stream_event_end +[`finish`]: #stream_event_finish +[`_read(size)`]: #stream_readable_read_size_1 +[`_read()`]: #stream_readable_read_size_1 +[_read]: #stream_readable_read_size_1 +[`writable.write(chunk)`]: #stream_writable_write_chunk_encoding_callback +[`write(chunk, encoding, callback)`]: #stream_writable_write_chunk_encoding_callback +[`write()`]: #stream_writable_write_chunk_encoding_callback +[`stream.write(chunk)`]: #stream_writable_write_chunk_encoding_callback +[`_write(chunk, encoding, callback)`]: #stream_writable_write_chunk_encoding_callback_1 +[`_write()`]: #stream_writable_write_chunk_encoding_callback_1 +[_write]: #stream_writable_write_chunk_encoding_callback_1 +[`util.inherits`]: https://iojs.org/dist/v2.3.0/doc/api/util.html#util_util_inherits_constructor_superconstructor +[`end()`]: #stream_writable_end_chunk_encoding_callback +[`'data'` event]: #stream_event_data +[`resume()`]: #stream_readable_resume +[`readable.resume()`]: #stream_readable_resume +[`pause()`]: #stream_readable_pause +[`unpipe()`]: #stream_readable_unpipe_destination +[`pipe()`]: #stream_readable_pipe_destination_options diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md new file mode 100644 index 00000000..c141a99c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md @@ -0,0 +1,58 @@ +# streams WG Meeting 2015-01-30 + +## Links + +* **Google Hangouts Video**: http://www.youtube.com/watch?v=I9nDOSGfwZg +* **GitHub Issue**: https://github.com/iojs/readable-stream/issues/106 +* **Original Minutes Google Doc**: https://docs.google.com/document/d/17aTgLnjMXIrfjgNaTUnHQO7m3xgzHR2VXBTmi03Qii4/ + +## Agenda + +Extracted from https://github.com/iojs/readable-stream/labels/wg-agenda prior to meeting. + +* adopt a charter [#105](https://github.com/iojs/readable-stream/issues/105) +* release and versioning strategy [#101](https://github.com/iojs/readable-stream/issues/101) +* simpler stream creation [#102](https://github.com/iojs/readable-stream/issues/102) +* proposal: deprecate implicit flowing of streams [#99](https://github.com/iojs/readable-stream/issues/99) + +## Minutes + +### adopt a charter + +* group: +1's all around + +### What versioning scheme should be adopted? +* group: +1’s 3.0.0 +* domenic+group: pulling in patches from other sources where appropriate +* mikeal: version independently, suggesting versions for io.js +* mikeal+domenic: work with TC to notify in advance of changes +simpler stream creation + +### streamline creation of streams +* sam: streamline creation of streams +* domenic: nice simple solution posted + but, we lose the opportunity to change the model + may not be backwards incompatible (double check keys) + + **action item:** domenic will check + +### remove implicit flowing of streams on(‘data’) +* add isFlowing / isPaused +* mikeal: worrying that we’re documenting polyfill methods – confuses users +* domenic: more reflective API is probably good, with warning labels for users +* new section for mad scientists (reflective stream access) +* calvin: name the “third state” +* mikeal: maybe borrow the name from whatwg? +* domenic: we’re missing the “third state” +* consensus: kind of difficult to name the third state +* mikeal: figure out differences in states / compat +* mathias: always flow on data – eliminates third state + * explore what it breaks + +**action items:** +* ask isaac for ability to list packages by what public io.js APIs they use (esp. Stream) +* ask rod/build for infrastructure +* **chris**: explore the “flow on data” approach +* add isPaused/isFlowing +* add new docs section +* move isPaused to that section diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/duplex.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/duplex.js new file mode 100644 index 00000000..ca807af8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/duplex.js @@ -0,0 +1 @@ +module.exports = require("./lib/_stream_duplex.js") diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_duplex.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_duplex.js new file mode 100644 index 00000000..69558af0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_duplex.js @@ -0,0 +1,82 @@ +// a duplex stream is just a stream that is both readable and writable. +// Since JS doesn't have multiple prototypal inheritance, this class +// prototypally inherits from Readable, and then parasitically from +// Writable. + +'use strict'; + +/**/ +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) keys.push(key); + return keys; +} +/**/ + + +module.exports = Duplex; + +/**/ +var processNextTick = require('process-nextick-args'); +/**/ + + + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +var Readable = require('./_stream_readable'); +var Writable = require('./_stream_writable'); + +util.inherits(Duplex, Readable); + +var keys = objectKeys(Writable.prototype); +for (var v = 0; v < keys.length; v++) { + var method = keys[v]; + if (!Duplex.prototype[method]) + Duplex.prototype[method] = Writable.prototype[method]; +} + +function Duplex(options) { + if (!(this instanceof Duplex)) + return new Duplex(options); + + Readable.call(this, options); + Writable.call(this, options); + + if (options && options.readable === false) + this.readable = false; + + if (options && options.writable === false) + this.writable = false; + + this.allowHalfOpen = true; + if (options && options.allowHalfOpen === false) + this.allowHalfOpen = false; + + this.once('end', onend); +} + +// the no-half-open enforcer +function onend() { + // if we allow half-open state, or if the writable side ended, + // then we're ok. + if (this.allowHalfOpen || this._writableState.ended) + return; + + // no more data can be written. + // But allow more writes to happen in this tick. + processNextTick(onEndNT, this); +} + +function onEndNT(self) { + self.end(); +} + +function forEach (xs, f) { + for (var i = 0, l = xs.length; i < l; i++) { + f(xs[i], i); + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_passthrough.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_passthrough.js new file mode 100644 index 00000000..bddfdd01 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_passthrough.js @@ -0,0 +1,27 @@ +// a passthrough stream. +// basically just the most minimal sort of Transform stream. +// Every written chunk gets output as-is. + +'use strict'; + +module.exports = PassThrough; + +var Transform = require('./_stream_transform'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +util.inherits(PassThrough, Transform); + +function PassThrough(options) { + if (!(this instanceof PassThrough)) + return new PassThrough(options); + + Transform.call(this, options); +} + +PassThrough.prototype._transform = function(chunk, encoding, cb) { + cb(null, chunk); +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_readable.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_readable.js new file mode 100644 index 00000000..eef3d825 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_readable.js @@ -0,0 +1,959 @@ +'use strict'; + +module.exports = Readable; + +/**/ +var processNextTick = require('process-nextick-args'); +/**/ + + +/**/ +var isArray = require('isarray'); +/**/ + + +/**/ +var Buffer = require('buffer').Buffer; +/**/ + +Readable.ReadableState = ReadableState; + +var EE = require('events').EventEmitter; + +/**/ +if (!EE.listenerCount) EE.listenerCount = function(emitter, type) { + return emitter.listeners(type).length; +}; +/**/ + + + +/**/ +var Stream; +(function (){try{ + Stream = require('st' + 'ream'); +}catch(_){}finally{ + if (!Stream) + Stream = require('events').EventEmitter; +}}()) +/**/ + +var Buffer = require('buffer').Buffer; + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + + + +/**/ +var debug = require('util'); +if (debug && debug.debuglog) { + debug = debug.debuglog('stream'); +} else { + debug = function () {}; +} +/**/ + +var StringDecoder; + +util.inherits(Readable, Stream); + +function ReadableState(options, stream) { + var Duplex = require('./_stream_duplex'); + + options = options || {}; + + // object stream flag. Used to make read(n) ignore n and to + // make all the buffer merging and length checks go away + this.objectMode = !!options.objectMode; + + if (stream instanceof Duplex) + this.objectMode = this.objectMode || !!options.readableObjectMode; + + // the point at which it stops calling _read() to fill the buffer + // Note: 0 is a valid value, means "don't call _read preemptively ever" + var hwm = options.highWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm; + + // cast to ints. + this.highWaterMark = ~~this.highWaterMark; + + this.buffer = []; + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = null; + this.ended = false; + this.endEmitted = false; + this.reading = false; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // whenever we return null, then we set a flag to say + // that we're awaiting a 'readable' event emission. + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // when piping, we only care about 'readable' events that happen + // after read()ing all the bytes and not getting any pushback. + this.ranOut = false; + + // the number of writers that are awaiting a drain event in .pipe()s + this.awaitDrain = 0; + + // if true, a maybeReadMore has been scheduled + this.readingMore = false; + + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder) + StringDecoder = require('string_decoder/').StringDecoder; + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; + } +} + +function Readable(options) { + var Duplex = require('./_stream_duplex'); + + if (!(this instanceof Readable)) + return new Readable(options); + + this._readableState = new ReadableState(options, this); + + // legacy + this.readable = true; + + if (options && typeof options.read === 'function') + this._read = options.read; + + Stream.call(this); +} + +// Manually shove something into the read() buffer. +// This returns true if the highWaterMark has not been hit yet, +// similar to how Writable.write() returns true if you should +// write() some more. +Readable.prototype.push = function(chunk, encoding) { + var state = this._readableState; + + if (!state.objectMode && typeof chunk === 'string') { + encoding = encoding || state.defaultEncoding; + if (encoding !== state.encoding) { + chunk = new Buffer(chunk, encoding); + encoding = ''; + } + } + + return readableAddChunk(this, state, chunk, encoding, false); +}; + +// Unshift should *always* be something directly out of read() +Readable.prototype.unshift = function(chunk) { + var state = this._readableState; + return readableAddChunk(this, state, chunk, '', true); +}; + +Readable.prototype.isPaused = function() { + return this._readableState.flowing === false; +}; + +function readableAddChunk(stream, state, chunk, encoding, addToFront) { + var er = chunkInvalid(state, chunk); + if (er) { + stream.emit('error', er); + } else if (chunk === null) { + state.reading = false; + onEofChunk(stream, state); + } else if (state.objectMode || chunk && chunk.length > 0) { + if (state.ended && !addToFront) { + var e = new Error('stream.push() after EOF'); + stream.emit('error', e); + } else if (state.endEmitted && addToFront) { + var e = new Error('stream.unshift() after end event'); + stream.emit('error', e); + } else { + if (state.decoder && !addToFront && !encoding) + chunk = state.decoder.write(chunk); + + if (!addToFront) + state.reading = false; + + // if we want the data now, just emit it. + if (state.flowing && state.length === 0 && !state.sync) { + stream.emit('data', chunk); + stream.read(0); + } else { + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) + state.buffer.unshift(chunk); + else + state.buffer.push(chunk); + + if (state.needReadable) + emitReadable(stream); + } + + maybeReadMore(stream, state); + } + } else if (!addToFront) { + state.reading = false; + } + + return needMoreData(state); +} + + + +// if it's past the high water mark, we can push in some more. +// Also, if we have no data yet, we can stand some +// more bytes. This is to work around cases where hwm=0, +// such as the repl. Also, if the push() triggered a +// readable event, and the user called read(largeNumber) such that +// needReadable was set, then we ought to push more, so that another +// 'readable' event will be triggered. +function needMoreData(state) { + return !state.ended && + (state.needReadable || + state.length < state.highWaterMark || + state.length === 0); +} + +// backwards compatibility. +Readable.prototype.setEncoding = function(enc) { + if (!StringDecoder) + StringDecoder = require('string_decoder/').StringDecoder; + this._readableState.decoder = new StringDecoder(enc); + this._readableState.encoding = enc; + return this; +}; + +// Don't raise the hwm > 128MB +var MAX_HWM = 0x800000; +function roundUpToNextPowerOf2(n) { + if (n >= MAX_HWM) { + n = MAX_HWM; + } else { + // Get the next highest power of 2 + n--; + for (var p = 1; p < 32; p <<= 1) n |= n >> p; + n++; + } + return n; +} + +function howMuchToRead(n, state) { + if (state.length === 0 && state.ended) + return 0; + + if (state.objectMode) + return n === 0 ? 0 : 1; + + if (n === null || isNaN(n)) { + // only flow one buffer at a time + if (state.flowing && state.buffer.length) + return state.buffer[0].length; + else + return state.length; + } + + if (n <= 0) + return 0; + + // If we're asking for more than the target buffer level, + // then raise the water mark. Bump up to the next highest + // power of 2, to prevent increasing it excessively in tiny + // amounts. + if (n > state.highWaterMark) + state.highWaterMark = roundUpToNextPowerOf2(n); + + // don't have that much. return null, unless we've ended. + if (n > state.length) { + if (!state.ended) { + state.needReadable = true; + return 0; + } else { + return state.length; + } + } + + return n; +} + +// you can override either this method, or the async _read(n) below. +Readable.prototype.read = function(n) { + debug('read', n); + var state = this._readableState; + var nOrig = n; + + if (typeof n !== 'number' || n > 0) + state.emittedReadable = false; + + // if we're doing read(0) to trigger a readable event, but we + // already have a bunch of data in the buffer, then just trigger + // the 'readable' event and move on. + if (n === 0 && + state.needReadable && + (state.length >= state.highWaterMark || state.ended)) { + debug('read: emitReadable', state.length, state.ended); + if (state.length === 0 && state.ended) + endReadable(this); + else + emitReadable(this); + return null; + } + + n = howMuchToRead(n, state); + + // if we've ended, and we're now clear, then finish it up. + if (n === 0 && state.ended) { + if (state.length === 0) + endReadable(this); + return null; + } + + // All the actual chunk generation logic needs to be + // *below* the call to _read. The reason is that in certain + // synthetic stream cases, such as passthrough streams, _read + // may be a completely synchronous operation which may change + // the state of the read buffer, providing enough data when + // before there was *not* enough. + // + // So, the steps are: + // 1. Figure out what the state of things will be after we do + // a read from the buffer. + // + // 2. If that resulting state will trigger a _read, then call _read. + // Note that this may be asynchronous, or synchronous. Yes, it is + // deeply ugly to write APIs this way, but that still doesn't mean + // that the Readable class should behave improperly, as streams are + // designed to be sync/async agnostic. + // Take note if the _read call is sync or async (ie, if the read call + // has returned yet), so that we know whether or not it's safe to emit + // 'readable' etc. + // + // 3. Actually pull the requested chunks out of the buffer and return. + + // if we need a readable event, then we need to do some reading. + var doRead = state.needReadable; + debug('need readable', doRead); + + // if we currently have less than the highWaterMark, then also read some + if (state.length === 0 || state.length - n < state.highWaterMark) { + doRead = true; + debug('length less than watermark', doRead); + } + + // however, if we've ended, then there's no point, and if we're already + // reading, then it's unnecessary. + if (state.ended || state.reading) { + doRead = false; + debug('reading or ended', doRead); + } + + if (doRead) { + debug('do read'); + state.reading = true; + state.sync = true; + // if the length is currently zero, then we *need* a readable event. + if (state.length === 0) + state.needReadable = true; + // call internal read method + this._read(state.highWaterMark); + state.sync = false; + } + + // If _read pushed data synchronously, then `reading` will be false, + // and we need to re-evaluate how much data we can return to the user. + if (doRead && !state.reading) + n = howMuchToRead(nOrig, state); + + var ret; + if (n > 0) + ret = fromList(n, state); + else + ret = null; + + if (ret === null) { + state.needReadable = true; + n = 0; + } + + state.length -= n; + + // If we have nothing in the buffer, then we want to know + // as soon as we *do* get something into the buffer. + if (state.length === 0 && !state.ended) + state.needReadable = true; + + // If we tried to read() past the EOF, then emit end on the next tick. + if (nOrig !== n && state.ended && state.length === 0) + endReadable(this); + + if (ret !== null) + this.emit('data', ret); + + return ret; +}; + +function chunkInvalid(state, chunk) { + var er = null; + if (!(Buffer.isBuffer(chunk)) && + typeof chunk !== 'string' && + chunk !== null && + chunk !== undefined && + !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + return er; +} + + +function onEofChunk(stream, state) { + if (state.ended) return; + if (state.decoder) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) { + state.buffer.push(chunk); + state.length += state.objectMode ? 1 : chunk.length; + } + } + state.ended = true; + + // emit 'readable' now to make sure it gets picked up. + emitReadable(stream); +} + +// Don't emit readable right away in sync mode, because this can trigger +// another read() call => stack overflow. This way, it might trigger +// a nextTick recursion warning, but that's not so bad. +function emitReadable(stream) { + var state = stream._readableState; + state.needReadable = false; + if (!state.emittedReadable) { + debug('emitReadable', state.flowing); + state.emittedReadable = true; + if (state.sync) + processNextTick(emitReadable_, stream); + else + emitReadable_(stream); + } +} + +function emitReadable_(stream) { + debug('emit readable'); + stream.emit('readable'); + flow(stream); +} + + +// at this point, the user has presumably seen the 'readable' event, +// and called read() to consume some data. that may have triggered +// in turn another _read(n) call, in which case reading = true if +// it's in progress. +// However, if we're not ended, or reading, and the length < hwm, +// then go ahead and try to read some more preemptively. +function maybeReadMore(stream, state) { + if (!state.readingMore) { + state.readingMore = true; + processNextTick(maybeReadMore_, stream, state); + } +} + +function maybeReadMore_(stream, state) { + var len = state.length; + while (!state.reading && !state.flowing && !state.ended && + state.length < state.highWaterMark) { + debug('maybeReadMore read 0'); + stream.read(0); + if (len === state.length) + // didn't get any data, stop spinning. + break; + else + len = state.length; + } + state.readingMore = false; +} + +// abstract method. to be overridden in specific implementation classes. +// call cb(er, data) where data is <= n in length. +// for virtual (non-string, non-buffer) streams, "length" is somewhat +// arbitrary, and perhaps not very meaningful. +Readable.prototype._read = function(n) { + this.emit('error', new Error('not implemented')); +}; + +Readable.prototype.pipe = function(dest, pipeOpts) { + var src = this; + var state = this._readableState; + + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; + case 1: + state.pipes = [state.pipes, dest]; + break; + default: + state.pipes.push(dest); + break; + } + state.pipesCount += 1; + debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); + + var doEnd = (!pipeOpts || pipeOpts.end !== false) && + dest !== process.stdout && + dest !== process.stderr; + + var endFn = doEnd ? onend : cleanup; + if (state.endEmitted) + processNextTick(endFn); + else + src.once('end', endFn); + + dest.on('unpipe', onunpipe); + function onunpipe(readable) { + debug('onunpipe'); + if (readable === src) { + cleanup(); + } + } + + function onend() { + debug('onend'); + dest.end(); + } + + // when the dest drains, it reduces the awaitDrain counter + // on the source. This would be more elegant with a .once() + // handler in flow(), but adding and removing repeatedly is + // too slow. + var ondrain = pipeOnDrain(src); + dest.on('drain', ondrain); + + function cleanup() { + debug('cleanup'); + // cleanup event handlers once the pipe is broken + dest.removeListener('close', onclose); + dest.removeListener('finish', onfinish); + dest.removeListener('drain', ondrain); + dest.removeListener('error', onerror); + dest.removeListener('unpipe', onunpipe); + src.removeListener('end', onend); + src.removeListener('end', cleanup); + src.removeListener('data', ondata); + + // if the reader is waiting for a drain event from this + // specific writer, then it would cause it to never start + // flowing again. + // So, if this is awaiting a drain, then we just call it now. + // If we don't know, then assume that we are waiting for one. + if (state.awaitDrain && + (!dest._writableState || dest._writableState.needDrain)) + ondrain(); + } + + src.on('data', ondata); + function ondata(chunk) { + debug('ondata'); + var ret = dest.write(chunk); + if (false === ret) { + debug('false write response, pause', + src._readableState.awaitDrain); + src._readableState.awaitDrain++; + src.pause(); + } + } + + // if the dest has an error, then stop piping into it. + // however, don't suppress the throwing behavior for this. + function onerror(er) { + debug('onerror', er); + unpipe(); + dest.removeListener('error', onerror); + if (EE.listenerCount(dest, 'error') === 0) + dest.emit('error', er); + } + // This is a brutally ugly hack to make sure that our error handler + // is attached before any userland ones. NEVER DO THIS. + if (!dest._events || !dest._events.error) + dest.on('error', onerror); + else if (isArray(dest._events.error)) + dest._events.error.unshift(onerror); + else + dest._events.error = [onerror, dest._events.error]; + + + + // Both close and finish should trigger unpipe, but only once. + function onclose() { + dest.removeListener('finish', onfinish); + unpipe(); + } + dest.once('close', onclose); + function onfinish() { + debug('onfinish'); + dest.removeListener('close', onclose); + unpipe(); + } + dest.once('finish', onfinish); + + function unpipe() { + debug('unpipe'); + src.unpipe(dest); + } + + // tell the dest that it's being piped to + dest.emit('pipe', src); + + // start the flow if it hasn't been started already. + if (!state.flowing) { + debug('pipe resume'); + src.resume(); + } + + return dest; +}; + +function pipeOnDrain(src) { + return function() { + var state = src._readableState; + debug('pipeOnDrain', state.awaitDrain); + if (state.awaitDrain) + state.awaitDrain--; + if (state.awaitDrain === 0 && EE.listenerCount(src, 'data')) { + state.flowing = true; + flow(src); + } + }; +} + + +Readable.prototype.unpipe = function(dest) { + var state = this._readableState; + + // if we're not piping anywhere, then do nothing. + if (state.pipesCount === 0) + return this; + + // just one destination. most common case. + if (state.pipesCount === 1) { + // passed in one, but it's not the right one. + if (dest && dest !== state.pipes) + return this; + + if (!dest) + dest = state.pipes; + + // got a match. + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + if (dest) + dest.emit('unpipe', this); + return this; + } + + // slow case. multiple pipe destinations. + + if (!dest) { + // remove all. + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + + for (var i = 0; i < len; i++) + dests[i].emit('unpipe', this); + return this; + } + + // try to find the right one. + var i = indexOf(state.pipes, dest); + if (i === -1) + return this; + + state.pipes.splice(i, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) + state.pipes = state.pipes[0]; + + dest.emit('unpipe', this); + + return this; +}; + +// set up data events if they are asked for +// Ensure readable listeners eventually get something +Readable.prototype.on = function(ev, fn) { + var res = Stream.prototype.on.call(this, ev, fn); + + // If listening to data, and it has not explicitly been paused, + // then call resume to start the flow of data on the next tick. + if (ev === 'data' && false !== this._readableState.flowing) { + this.resume(); + } + + if (ev === 'readable' && this.readable) { + var state = this._readableState; + if (!state.readableListening) { + state.readableListening = true; + state.emittedReadable = false; + state.needReadable = true; + if (!state.reading) { + processNextTick(nReadingNextTick, this); + } else if (state.length) { + emitReadable(this, state); + } + } + } + + return res; +}; +Readable.prototype.addListener = Readable.prototype.on; + +function nReadingNextTick(self) { + debug('readable nexttick read 0'); + self.read(0); +} + +// pause() and resume() are remnants of the legacy readable stream API +// If the user uses them, then switch into old mode. +Readable.prototype.resume = function() { + var state = this._readableState; + if (!state.flowing) { + debug('resume'); + state.flowing = true; + resume(this, state); + } + return this; +}; + +function resume(stream, state) { + if (!state.resumeScheduled) { + state.resumeScheduled = true; + processNextTick(resume_, stream, state); + } +} + +function resume_(stream, state) { + if (!state.reading) { + debug('resume read 0'); + stream.read(0); + } + + state.resumeScheduled = false; + stream.emit('resume'); + flow(stream); + if (state.flowing && !state.reading) + stream.read(0); +} + +Readable.prototype.pause = function() { + debug('call pause flowing=%j', this._readableState.flowing); + if (false !== this._readableState.flowing) { + debug('pause'); + this._readableState.flowing = false; + this.emit('pause'); + } + return this; +}; + +function flow(stream) { + var state = stream._readableState; + debug('flow', state.flowing); + if (state.flowing) { + do { + var chunk = stream.read(); + } while (null !== chunk && state.flowing); + } +} + +// wrap an old-style stream as the async data source. +// This is *not* part of the readable stream interface. +// It is an ugly unfortunate mess of history. +Readable.prototype.wrap = function(stream) { + var state = this._readableState; + var paused = false; + + var self = this; + stream.on('end', function() { + debug('wrapped end'); + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) + self.push(chunk); + } + + self.push(null); + }); + + stream.on('data', function(chunk) { + debug('wrapped data'); + if (state.decoder) + chunk = state.decoder.write(chunk); + + // don't skip over falsy values in objectMode + if (state.objectMode && (chunk === null || chunk === undefined)) + return; + else if (!state.objectMode && (!chunk || !chunk.length)) + return; + + var ret = self.push(chunk); + if (!ret) { + paused = true; + stream.pause(); + } + }); + + // proxy all the other methods. + // important when wrapping filters and duplexes. + for (var i in stream) { + if (this[i] === undefined && typeof stream[i] === 'function') { + this[i] = function(method) { return function() { + return stream[method].apply(stream, arguments); + }; }(i); + } + } + + // proxy certain important events. + var events = ['error', 'close', 'destroy', 'pause', 'resume']; + forEach(events, function(ev) { + stream.on(ev, self.emit.bind(self, ev)); + }); + + // when we try to consume some more bytes, simply unpause the + // underlying stream. + self._read = function(n) { + debug('wrapped _read', n); + if (paused) { + paused = false; + stream.resume(); + } + }; + + return self; +}; + + + +// exposed for testing purposes only. +Readable._fromList = fromList; + +// Pluck off n bytes from an array of buffers. +// Length is the combined lengths of all the buffers in the list. +function fromList(n, state) { + var list = state.buffer; + var length = state.length; + var stringMode = !!state.decoder; + var objectMode = !!state.objectMode; + var ret; + + // nothing in the list, definitely empty. + if (list.length === 0) + return null; + + if (length === 0) + ret = null; + else if (objectMode) + ret = list.shift(); + else if (!n || n >= length) { + // read it all, truncate the array. + if (stringMode) + ret = list.join(''); + else + ret = Buffer.concat(list, length); + list.length = 0; + } else { + // read just some of it. + if (n < list[0].length) { + // just take a part of the first list item. + // slice is the same for buffers and strings. + var buf = list[0]; + ret = buf.slice(0, n); + list[0] = buf.slice(n); + } else if (n === list[0].length) { + // first list is a perfect match + ret = list.shift(); + } else { + // complex case. + // we have enough to cover it, but it spans past the first buffer. + if (stringMode) + ret = ''; + else + ret = new Buffer(n); + + var c = 0; + for (var i = 0, l = list.length; i < l && c < n; i++) { + var buf = list[0]; + var cpy = Math.min(n - c, buf.length); + + if (stringMode) + ret += buf.slice(0, cpy); + else + buf.copy(ret, c, 0, cpy); + + if (cpy < buf.length) + list[0] = buf.slice(cpy); + else + list.shift(); + + c += cpy; + } + } + } + + return ret; +} + +function endReadable(stream) { + var state = stream._readableState; + + // If we get here before consuming all the bytes, then that is a + // bug in node. Should never happen. + if (state.length > 0) + throw new Error('endReadable called on non-empty stream'); + + if (!state.endEmitted) { + state.ended = true; + processNextTick(endReadableNT, state, stream); + } +} + +function endReadableNT(state, stream) { + // Check that we didn't get one last unshift. + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit('end'); + } +} + +function forEach (xs, f) { + for (var i = 0, l = xs.length; i < l; i++) { + f(xs[i], i); + } +} + +function indexOf (xs, x) { + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + return -1; +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_transform.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_transform.js new file mode 100644 index 00000000..3675d18d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_transform.js @@ -0,0 +1,197 @@ +// a transform stream is a readable/writable stream where you do +// something with the data. Sometimes it's called a "filter", +// but that's not a great name for it, since that implies a thing where +// some bits pass through, and others are simply ignored. (That would +// be a valid example of a transform, of course.) +// +// While the output is causally related to the input, it's not a +// necessarily symmetric or synchronous transformation. For example, +// a zlib stream might take multiple plain-text writes(), and then +// emit a single compressed chunk some time in the future. +// +// Here's how this works: +// +// The Transform stream has all the aspects of the readable and writable +// stream classes. When you write(chunk), that calls _write(chunk,cb) +// internally, and returns false if there's a lot of pending writes +// buffered up. When you call read(), that calls _read(n) until +// there's enough pending readable data buffered up. +// +// In a transform stream, the written data is placed in a buffer. When +// _read(n) is called, it transforms the queued up data, calling the +// buffered _write cb's as it consumes chunks. If consuming a single +// written chunk would result in multiple output chunks, then the first +// outputted bit calls the readcb, and subsequent chunks just go into +// the read buffer, and will cause it to emit 'readable' if necessary. +// +// This way, back-pressure is actually determined by the reading side, +// since _read has to be called to start processing a new chunk. However, +// a pathological inflate type of transform can cause excessive buffering +// here. For example, imagine a stream where every byte of input is +// interpreted as an integer from 0-255, and then results in that many +// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in +// 1kb of data being output. In this case, you could write a very small +// amount of input, and end up with a very large amount of output. In +// such a pathological inflating mechanism, there'd be no way to tell +// the system to stop doing the transform. A single 4MB write could +// cause the system to run out of memory. +// +// However, even in such a pathological case, only a single written chunk +// would be consumed, and then the rest would wait (un-transformed) until +// the results of the previous transformed chunk were consumed. + +'use strict'; + +module.exports = Transform; + +var Duplex = require('./_stream_duplex'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +util.inherits(Transform, Duplex); + + +function TransformState(stream) { + this.afterTransform = function(er, data) { + return afterTransform(stream, er, data); + }; + + this.needTransform = false; + this.transforming = false; + this.writecb = null; + this.writechunk = null; +} + +function afterTransform(stream, er, data) { + var ts = stream._transformState; + ts.transforming = false; + + var cb = ts.writecb; + + if (!cb) + return stream.emit('error', new Error('no writecb in Transform class')); + + ts.writechunk = null; + ts.writecb = null; + + if (data !== null && data !== undefined) + stream.push(data); + + if (cb) + cb(er); + + var rs = stream._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + stream._read(rs.highWaterMark); + } +} + + +function Transform(options) { + if (!(this instanceof Transform)) + return new Transform(options); + + Duplex.call(this, options); + + this._transformState = new TransformState(this); + + // when the writable side finishes, then flush out anything remaining. + var stream = this; + + // start out asking for a readable event once data is transformed. + this._readableState.needReadable = true; + + // we have implemented the _read method, and done the other things + // that Readable wants before the first _read call, so unset the + // sync guard flag. + this._readableState.sync = false; + + if (options) { + if (typeof options.transform === 'function') + this._transform = options.transform; + + if (typeof options.flush === 'function') + this._flush = options.flush; + } + + this.once('prefinish', function() { + if (typeof this._flush === 'function') + this._flush(function(er) { + done(stream, er); + }); + else + done(stream); + }); +} + +Transform.prototype.push = function(chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); +}; + +// This is the part where you do stuff! +// override this function in implementation classes. +// 'chunk' is an input chunk. +// +// Call `push(newChunk)` to pass along transformed output +// to the readable side. You may call 'push' zero or more times. +// +// Call `cb(err)` when you are done with this chunk. If you pass +// an error, then that'll put the hurt on the whole operation. If you +// never call cb(), then you'll never get another chunk. +Transform.prototype._transform = function(chunk, encoding, cb) { + throw new Error('not implemented'); +}; + +Transform.prototype._write = function(chunk, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk; + ts.writeencoding = encoding; + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || + rs.needReadable || + rs.length < rs.highWaterMark) + this._read(rs.highWaterMark); + } +}; + +// Doesn't matter what the args are here. +// _transform does all the work. +// That we got here means that the readable side wants more data. +Transform.prototype._read = function(n) { + var ts = this._transformState; + + if (ts.writechunk !== null && ts.writecb && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + // mark that we need a transform, so that any data that comes in + // will get processed, now that we've asked for it. + ts.needTransform = true; + } +}; + + +function done(stream, er) { + if (er) + return stream.emit('error', er); + + // if there's nothing in the write buffer, then that means + // that nothing more will ever be provided + var ws = stream._writableState; + var ts = stream._transformState; + + if (ws.length) + throw new Error('calling transform done when ws.length != 0'); + + if (ts.transforming) + throw new Error('calling transform done when still transforming'); + + return stream.push(null); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_writable.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_writable.js new file mode 100644 index 00000000..b2329520 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_writable.js @@ -0,0 +1,520 @@ +// A bit simpler than readable streams. +// Implement an async ._write(chunk, cb), and it'll handle all +// the drain event emission and buffering. + +'use strict'; + +module.exports = Writable; + +/**/ +var processNextTick = require('process-nextick-args'); +/**/ + + +/**/ +var Buffer = require('buffer').Buffer; +/**/ + +Writable.WritableState = WritableState; + + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + + + +/**/ +var Stream; +(function (){try{ + Stream = require('st' + 'ream'); +}catch(_){}finally{ + if (!Stream) + Stream = require('events').EventEmitter; +}}()) +/**/ + +var Buffer = require('buffer').Buffer; + +util.inherits(Writable, Stream); + +function nop() {} + +function WriteReq(chunk, encoding, cb) { + this.chunk = chunk; + this.encoding = encoding; + this.callback = cb; + this.next = null; +} + +function WritableState(options, stream) { + var Duplex = require('./_stream_duplex'); + + options = options || {}; + + // object stream flag to indicate whether or not this stream + // contains buffers or objects. + this.objectMode = !!options.objectMode; + + if (stream instanceof Duplex) + this.objectMode = this.objectMode || !!options.writableObjectMode; + + // the point at which write() starts returning false + // Note: 0 is a valid value, means that we always return false if + // the entire buffer is not flushed immediately on write() + var hwm = options.highWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm; + + // cast to ints. + this.highWaterMark = ~~this.highWaterMark; + + this.needDrain = false; + // at the start of calling end() + this.ending = false; + // when end() has been called, and returned + this.ended = false; + // when 'finish' is emitted + this.finished = false; + + // should we decode strings into buffers before passing to _write? + // this is here so that some node-core streams can optimize string + // handling at a lower level. + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // not an actual buffer we keep track of, but a measurement + // of how much we're waiting to get pushed to some underlying + // socket or file. + this.length = 0; + + // a flag to see when we're in the middle of a write. + this.writing = false; + + // when true all writes will be buffered until .uncork() call + this.corked = 0; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // a flag to know if we're processing previously buffered items, which + // may call the _write() callback in the same tick, so that we don't + // end up in an overlapped onwrite situation. + this.bufferProcessing = false; + + // the callback that's passed to _write(chunk,cb) + this.onwrite = function(er) { + onwrite(stream, er); + }; + + // the callback that the user supplies to write(chunk,encoding,cb) + this.writecb = null; + + // the amount that is being written when _write is called. + this.writelen = 0; + + this.bufferedRequest = null; + this.lastBufferedRequest = null; + + // number of pending user-supplied write callbacks + // this must be 0 before 'finish' can be emitted + this.pendingcb = 0; + + // emit prefinish if the only thing we're waiting for is _write cbs + // This is relevant for synchronous Transform streams + this.prefinished = false; + + // True if the error was already emitted and should not be thrown again + this.errorEmitted = false; +} + +WritableState.prototype.getBuffer = function writableStateGetBuffer() { + var current = this.bufferedRequest; + var out = []; + while (current) { + out.push(current); + current = current.next; + } + return out; +}; + +(function (){try { +Object.defineProperty(WritableState.prototype, 'buffer', { + get: require('util-deprecate')(function() { + return this.getBuffer(); + }, '_writableState.buffer is deprecated. Use ' + + '_writableState.getBuffer() instead.') +}); +}catch(_){}}()); + + +function Writable(options) { + var Duplex = require('./_stream_duplex'); + + // Writable ctor is applied to Duplexes, though they're not + // instanceof Writable, they're instanceof Readable. + if (!(this instanceof Writable) && !(this instanceof Duplex)) + return new Writable(options); + + this._writableState = new WritableState(options, this); + + // legacy. + this.writable = true; + + if (options) { + if (typeof options.write === 'function') + this._write = options.write; + + if (typeof options.writev === 'function') + this._writev = options.writev; + } + + Stream.call(this); +} + +// Otherwise people can pipe Writable streams, which is just wrong. +Writable.prototype.pipe = function() { + this.emit('error', new Error('Cannot pipe. Not readable.')); +}; + + +function writeAfterEnd(stream, cb) { + var er = new Error('write after end'); + // TODO: defer error events consistently everywhere, not just the cb + stream.emit('error', er); + processNextTick(cb, er); +} + +// If we get something that is not a buffer, string, null, or undefined, +// and we're not in objectMode, then that's an error. +// Otherwise stream chunks are all considered to be of length=1, and the +// watermarks determine how many objects to keep in the buffer, rather than +// how many bytes or characters. +function validChunk(stream, state, chunk, cb) { + var valid = true; + + if (!(Buffer.isBuffer(chunk)) && + typeof chunk !== 'string' && + chunk !== null && + chunk !== undefined && + !state.objectMode) { + var er = new TypeError('Invalid non-string/buffer chunk'); + stream.emit('error', er); + processNextTick(cb, er); + valid = false; + } + return valid; +} + +Writable.prototype.write = function(chunk, encoding, cb) { + var state = this._writableState; + var ret = false; + + if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (Buffer.isBuffer(chunk)) + encoding = 'buffer'; + else if (!encoding) + encoding = state.defaultEncoding; + + if (typeof cb !== 'function') + cb = nop; + + if (state.ended) + writeAfterEnd(this, cb); + else if (validChunk(this, state, chunk, cb)) { + state.pendingcb++; + ret = writeOrBuffer(this, state, chunk, encoding, cb); + } + + return ret; +}; + +Writable.prototype.cork = function() { + var state = this._writableState; + + state.corked++; +}; + +Writable.prototype.uncork = function() { + var state = this._writableState; + + if (state.corked) { + state.corked--; + + if (!state.writing && + !state.corked && + !state.finished && + !state.bufferProcessing && + state.bufferedRequest) + clearBuffer(this, state); + } +}; + +Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + // node::ParseEncoding() requires lower case. + if (typeof encoding === 'string') + encoding = encoding.toLowerCase(); + if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', +'ucs2', 'ucs-2','utf16le', 'utf-16le', 'raw'] +.indexOf((encoding + '').toLowerCase()) > -1)) + throw new TypeError('Unknown encoding: ' + encoding); + this._writableState.defaultEncoding = encoding; +}; + +function decodeChunk(state, chunk, encoding) { + if (!state.objectMode && + state.decodeStrings !== false && + typeof chunk === 'string') { + chunk = new Buffer(chunk, encoding); + } + return chunk; +} + +// if we're already writing something, then just put this +// in the queue, and wait our turn. Otherwise, call _write +// If we return false, then we need a drain event, so set that flag. +function writeOrBuffer(stream, state, chunk, encoding, cb) { + chunk = decodeChunk(state, chunk, encoding); + + if (Buffer.isBuffer(chunk)) + encoding = 'buffer'; + var len = state.objectMode ? 1 : chunk.length; + + state.length += len; + + var ret = state.length < state.highWaterMark; + // we must ensure that previous needDrain will not be reset to false. + if (!ret) + state.needDrain = true; + + if (state.writing || state.corked) { + var last = state.lastBufferedRequest; + state.lastBufferedRequest = new WriteReq(chunk, encoding, cb); + if (last) { + last.next = state.lastBufferedRequest; + } else { + state.bufferedRequest = state.lastBufferedRequest; + } + } else { + doWrite(stream, state, false, len, chunk, encoding, cb); + } + + return ret; +} + +function doWrite(stream, state, writev, len, chunk, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + if (writev) + stream._writev(chunk, state.onwrite); + else + stream._write(chunk, encoding, state.onwrite); + state.sync = false; +} + +function onwriteError(stream, state, sync, er, cb) { + --state.pendingcb; + if (sync) + processNextTick(cb, er); + else + cb(er); + + stream._writableState.errorEmitted = true; + stream.emit('error', er); +} + +function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; +} + +function onwrite(stream, er) { + var state = stream._writableState; + var sync = state.sync; + var cb = state.writecb; + + onwriteStateUpdate(state); + + if (er) + onwriteError(stream, state, sync, er, cb); + else { + // Check if we're actually ready to finish, but don't emit yet + var finished = needFinish(state); + + if (!finished && + !state.corked && + !state.bufferProcessing && + state.bufferedRequest) { + clearBuffer(stream, state); + } + + if (sync) { + processNextTick(afterWrite, stream, state, finished, cb); + } else { + afterWrite(stream, state, finished, cb); + } + } +} + +function afterWrite(stream, state, finished, cb) { + if (!finished) + onwriteDrain(stream, state); + state.pendingcb--; + cb(); + finishMaybe(stream, state); +} + +// Must force callback to be called on nextTick, so that we don't +// emit 'drain' before the write() consumer gets the 'false' return +// value, and has a chance to attach a 'drain' listener. +function onwriteDrain(stream, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream.emit('drain'); + } +} + + +// if there's something in the buffer waiting, then process it +function clearBuffer(stream, state) { + state.bufferProcessing = true; + var entry = state.bufferedRequest; + + if (stream._writev && entry && entry.next) { + // Fast case, write everything using _writev() + var buffer = []; + var cbs = []; + while (entry) { + cbs.push(entry.callback); + buffer.push(entry); + entry = entry.next; + } + + // count the one we are adding, as well. + // TODO(isaacs) clean this up + state.pendingcb++; + state.lastBufferedRequest = null; + doWrite(stream, state, true, state.length, buffer, '', function(err) { + for (var i = 0; i < cbs.length; i++) { + state.pendingcb--; + cbs[i](err); + } + }); + + // Clear buffer + } else { + // Slow case, write chunks one-by-one + while (entry) { + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk.length; + + doWrite(stream, state, false, len, chunk, encoding, cb); + entry = entry.next; + // if we didn't call the onwrite immediately, then + // it means that we need to wait until it does. + // also, that means that the chunk and cb are currently + // being processed, so move the buffer counter past them. + if (state.writing) { + break; + } + } + + if (entry === null) + state.lastBufferedRequest = null; + } + state.bufferedRequest = entry; + state.bufferProcessing = false; +} + +Writable.prototype._write = function(chunk, encoding, cb) { + cb(new Error('not implemented')); +}; + +Writable.prototype._writev = null; + +Writable.prototype.end = function(chunk, encoding, cb) { + var state = this._writableState; + + if (typeof chunk === 'function') { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (chunk !== null && chunk !== undefined) + this.write(chunk, encoding); + + // .end() fully uncorks + if (state.corked) { + state.corked = 1; + this.uncork(); + } + + // ignore unnecessary end() calls. + if (!state.ending && !state.finished) + endWritable(this, state, cb); +}; + + +function needFinish(state) { + return (state.ending && + state.length === 0 && + state.bufferedRequest === null && + !state.finished && + !state.writing); +} + +function prefinish(stream, state) { + if (!state.prefinished) { + state.prefinished = true; + stream.emit('prefinish'); + } +} + +function finishMaybe(stream, state) { + var need = needFinish(state); + if (need) { + if (state.pendingcb === 0) { + prefinish(stream, state); + state.finished = true; + stream.emit('finish'); + } else { + prefinish(stream, state); + } + } + return need; +} + +function endWritable(stream, state, cb) { + state.ending = true; + finishMaybe(stream, state); + if (cb) { + if (state.finished) + processNextTick(cb); + else + stream.once('finish', cb); + } + state.ended = true; +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/README.md new file mode 100644 index 00000000..5a76b414 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/README.md @@ -0,0 +1,3 @@ +# core-util-is + +The `util.is*` functions introduced in Node v0.12. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/float.patch b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/float.patch new file mode 100644 index 00000000..a06d5c05 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/float.patch @@ -0,0 +1,604 @@ +diff --git a/lib/util.js b/lib/util.js +index a03e874..9074e8e 100644 +--- a/lib/util.js ++++ b/lib/util.js +@@ -19,430 +19,6 @@ + // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + // USE OR OTHER DEALINGS IN THE SOFTWARE. + +-var formatRegExp = /%[sdj%]/g; +-exports.format = function(f) { +- if (!isString(f)) { +- var objects = []; +- for (var i = 0; i < arguments.length; i++) { +- objects.push(inspect(arguments[i])); +- } +- return objects.join(' '); +- } +- +- var i = 1; +- var args = arguments; +- var len = args.length; +- var str = String(f).replace(formatRegExp, function(x) { +- if (x === '%%') return '%'; +- if (i >= len) return x; +- switch (x) { +- case '%s': return String(args[i++]); +- case '%d': return Number(args[i++]); +- case '%j': +- try { +- return JSON.stringify(args[i++]); +- } catch (_) { +- return '[Circular]'; +- } +- default: +- return x; +- } +- }); +- for (var x = args[i]; i < len; x = args[++i]) { +- if (isNull(x) || !isObject(x)) { +- str += ' ' + x; +- } else { +- str += ' ' + inspect(x); +- } +- } +- return str; +-}; +- +- +-// Mark that a method should not be used. +-// Returns a modified function which warns once by default. +-// If --no-deprecation is set, then it is a no-op. +-exports.deprecate = function(fn, msg) { +- // Allow for deprecating things in the process of starting up. +- if (isUndefined(global.process)) { +- return function() { +- return exports.deprecate(fn, msg).apply(this, arguments); +- }; +- } +- +- if (process.noDeprecation === true) { +- return fn; +- } +- +- var warned = false; +- function deprecated() { +- if (!warned) { +- if (process.throwDeprecation) { +- throw new Error(msg); +- } else if (process.traceDeprecation) { +- console.trace(msg); +- } else { +- console.error(msg); +- } +- warned = true; +- } +- return fn.apply(this, arguments); +- } +- +- return deprecated; +-}; +- +- +-var debugs = {}; +-var debugEnviron; +-exports.debuglog = function(set) { +- if (isUndefined(debugEnviron)) +- debugEnviron = process.env.NODE_DEBUG || ''; +- set = set.toUpperCase(); +- if (!debugs[set]) { +- if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { +- var pid = process.pid; +- debugs[set] = function() { +- var msg = exports.format.apply(exports, arguments); +- console.error('%s %d: %s', set, pid, msg); +- }; +- } else { +- debugs[set] = function() {}; +- } +- } +- return debugs[set]; +-}; +- +- +-/** +- * Echos the value of a value. Trys to print the value out +- * in the best way possible given the different types. +- * +- * @param {Object} obj The object to print out. +- * @param {Object} opts Optional options object that alters the output. +- */ +-/* legacy: obj, showHidden, depth, colors*/ +-function inspect(obj, opts) { +- // default options +- var ctx = { +- seen: [], +- stylize: stylizeNoColor +- }; +- // legacy... +- if (arguments.length >= 3) ctx.depth = arguments[2]; +- if (arguments.length >= 4) ctx.colors = arguments[3]; +- if (isBoolean(opts)) { +- // legacy... +- ctx.showHidden = opts; +- } else if (opts) { +- // got an "options" object +- exports._extend(ctx, opts); +- } +- // set default options +- if (isUndefined(ctx.showHidden)) ctx.showHidden = false; +- if (isUndefined(ctx.depth)) ctx.depth = 2; +- if (isUndefined(ctx.colors)) ctx.colors = false; +- if (isUndefined(ctx.customInspect)) ctx.customInspect = true; +- if (ctx.colors) ctx.stylize = stylizeWithColor; +- return formatValue(ctx, obj, ctx.depth); +-} +-exports.inspect = inspect; +- +- +-// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics +-inspect.colors = { +- 'bold' : [1, 22], +- 'italic' : [3, 23], +- 'underline' : [4, 24], +- 'inverse' : [7, 27], +- 'white' : [37, 39], +- 'grey' : [90, 39], +- 'black' : [30, 39], +- 'blue' : [34, 39], +- 'cyan' : [36, 39], +- 'green' : [32, 39], +- 'magenta' : [35, 39], +- 'red' : [31, 39], +- 'yellow' : [33, 39] +-}; +- +-// Don't use 'blue' not visible on cmd.exe +-inspect.styles = { +- 'special': 'cyan', +- 'number': 'yellow', +- 'boolean': 'yellow', +- 'undefined': 'grey', +- 'null': 'bold', +- 'string': 'green', +- 'date': 'magenta', +- // "name": intentionally not styling +- 'regexp': 'red' +-}; +- +- +-function stylizeWithColor(str, styleType) { +- var style = inspect.styles[styleType]; +- +- if (style) { +- return '\u001b[' + inspect.colors[style][0] + 'm' + str + +- '\u001b[' + inspect.colors[style][1] + 'm'; +- } else { +- return str; +- } +-} +- +- +-function stylizeNoColor(str, styleType) { +- return str; +-} +- +- +-function arrayToHash(array) { +- var hash = {}; +- +- array.forEach(function(val, idx) { +- hash[val] = true; +- }); +- +- return hash; +-} +- +- +-function formatValue(ctx, value, recurseTimes) { +- // Provide a hook for user-specified inspect functions. +- // Check that value is an object with an inspect function on it +- if (ctx.customInspect && +- value && +- isFunction(value.inspect) && +- // Filter out the util module, it's inspect function is special +- value.inspect !== exports.inspect && +- // Also filter out any prototype objects using the circular check. +- !(value.constructor && value.constructor.prototype === value)) { +- var ret = value.inspect(recurseTimes, ctx); +- if (!isString(ret)) { +- ret = formatValue(ctx, ret, recurseTimes); +- } +- return ret; +- } +- +- // Primitive types cannot have properties +- var primitive = formatPrimitive(ctx, value); +- if (primitive) { +- return primitive; +- } +- +- // Look up the keys of the object. +- var keys = Object.keys(value); +- var visibleKeys = arrayToHash(keys); +- +- if (ctx.showHidden) { +- keys = Object.getOwnPropertyNames(value); +- } +- +- // Some type of object without properties can be shortcutted. +- if (keys.length === 0) { +- if (isFunction(value)) { +- var name = value.name ? ': ' + value.name : ''; +- return ctx.stylize('[Function' + name + ']', 'special'); +- } +- if (isRegExp(value)) { +- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); +- } +- if (isDate(value)) { +- return ctx.stylize(Date.prototype.toString.call(value), 'date'); +- } +- if (isError(value)) { +- return formatError(value); +- } +- } +- +- var base = '', array = false, braces = ['{', '}']; +- +- // Make Array say that they are Array +- if (isArray(value)) { +- array = true; +- braces = ['[', ']']; +- } +- +- // Make functions say that they are functions +- if (isFunction(value)) { +- var n = value.name ? ': ' + value.name : ''; +- base = ' [Function' + n + ']'; +- } +- +- // Make RegExps say that they are RegExps +- if (isRegExp(value)) { +- base = ' ' + RegExp.prototype.toString.call(value); +- } +- +- // Make dates with properties first say the date +- if (isDate(value)) { +- base = ' ' + Date.prototype.toUTCString.call(value); +- } +- +- // Make error with message first say the error +- if (isError(value)) { +- base = ' ' + formatError(value); +- } +- +- if (keys.length === 0 && (!array || value.length == 0)) { +- return braces[0] + base + braces[1]; +- } +- +- if (recurseTimes < 0) { +- if (isRegExp(value)) { +- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); +- } else { +- return ctx.stylize('[Object]', 'special'); +- } +- } +- +- ctx.seen.push(value); +- +- var output; +- if (array) { +- output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); +- } else { +- output = keys.map(function(key) { +- return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); +- }); +- } +- +- ctx.seen.pop(); +- +- return reduceToSingleString(output, base, braces); +-} +- +- +-function formatPrimitive(ctx, value) { +- if (isUndefined(value)) +- return ctx.stylize('undefined', 'undefined'); +- if (isString(value)) { +- var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') +- .replace(/'/g, "\\'") +- .replace(/\\"/g, '"') + '\''; +- return ctx.stylize(simple, 'string'); +- } +- if (isNumber(value)) { +- // Format -0 as '-0'. Strict equality won't distinguish 0 from -0, +- // so instead we use the fact that 1 / -0 < 0 whereas 1 / 0 > 0 . +- if (value === 0 && 1 / value < 0) +- return ctx.stylize('-0', 'number'); +- return ctx.stylize('' + value, 'number'); +- } +- if (isBoolean(value)) +- return ctx.stylize('' + value, 'boolean'); +- // For some reason typeof null is "object", so special case here. +- if (isNull(value)) +- return ctx.stylize('null', 'null'); +-} +- +- +-function formatError(value) { +- return '[' + Error.prototype.toString.call(value) + ']'; +-} +- +- +-function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { +- var output = []; +- for (var i = 0, l = value.length; i < l; ++i) { +- if (hasOwnProperty(value, String(i))) { +- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, +- String(i), true)); +- } else { +- output.push(''); +- } +- } +- keys.forEach(function(key) { +- if (!key.match(/^\d+$/)) { +- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, +- key, true)); +- } +- }); +- return output; +-} +- +- +-function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { +- var name, str, desc; +- desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; +- if (desc.get) { +- if (desc.set) { +- str = ctx.stylize('[Getter/Setter]', 'special'); +- } else { +- str = ctx.stylize('[Getter]', 'special'); +- } +- } else { +- if (desc.set) { +- str = ctx.stylize('[Setter]', 'special'); +- } +- } +- if (!hasOwnProperty(visibleKeys, key)) { +- name = '[' + key + ']'; +- } +- if (!str) { +- if (ctx.seen.indexOf(desc.value) < 0) { +- if (isNull(recurseTimes)) { +- str = formatValue(ctx, desc.value, null); +- } else { +- str = formatValue(ctx, desc.value, recurseTimes - 1); +- } +- if (str.indexOf('\n') > -1) { +- if (array) { +- str = str.split('\n').map(function(line) { +- return ' ' + line; +- }).join('\n').substr(2); +- } else { +- str = '\n' + str.split('\n').map(function(line) { +- return ' ' + line; +- }).join('\n'); +- } +- } +- } else { +- str = ctx.stylize('[Circular]', 'special'); +- } +- } +- if (isUndefined(name)) { +- if (array && key.match(/^\d+$/)) { +- return str; +- } +- name = JSON.stringify('' + key); +- if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { +- name = name.substr(1, name.length - 2); +- name = ctx.stylize(name, 'name'); +- } else { +- name = name.replace(/'/g, "\\'") +- .replace(/\\"/g, '"') +- .replace(/(^"|"$)/g, "'"); +- name = ctx.stylize(name, 'string'); +- } +- } +- +- return name + ': ' + str; +-} +- +- +-function reduceToSingleString(output, base, braces) { +- var numLinesEst = 0; +- var length = output.reduce(function(prev, cur) { +- numLinesEst++; +- if (cur.indexOf('\n') >= 0) numLinesEst++; +- return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; +- }, 0); +- +- if (length > 60) { +- return braces[0] + +- (base === '' ? '' : base + '\n ') + +- ' ' + +- output.join(',\n ') + +- ' ' + +- braces[1]; +- } +- +- return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; +-} +- +- + // NOTE: These type checking functions intentionally don't use `instanceof` + // because it is fragile and can be easily faked with `Object.create()`. + function isArray(ar) { +@@ -522,166 +98,10 @@ function isPrimitive(arg) { + exports.isPrimitive = isPrimitive; + + function isBuffer(arg) { +- return arg instanceof Buffer; ++ return Buffer.isBuffer(arg); + } + exports.isBuffer = isBuffer; + + function objectToString(o) { + return Object.prototype.toString.call(o); +-} +- +- +-function pad(n) { +- return n < 10 ? '0' + n.toString(10) : n.toString(10); +-} +- +- +-var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', +- 'Oct', 'Nov', 'Dec']; +- +-// 26 Feb 16:19:34 +-function timestamp() { +- var d = new Date(); +- var time = [pad(d.getHours()), +- pad(d.getMinutes()), +- pad(d.getSeconds())].join(':'); +- return [d.getDate(), months[d.getMonth()], time].join(' '); +-} +- +- +-// log is just a thin wrapper to console.log that prepends a timestamp +-exports.log = function() { +- console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); +-}; +- +- +-/** +- * Inherit the prototype methods from one constructor into another. +- * +- * The Function.prototype.inherits from lang.js rewritten as a standalone +- * function (not on Function.prototype). NOTE: If this file is to be loaded +- * during bootstrapping this function needs to be rewritten using some native +- * functions as prototype setup using normal JavaScript does not work as +- * expected during bootstrapping (see mirror.js in r114903). +- * +- * @param {function} ctor Constructor function which needs to inherit the +- * prototype. +- * @param {function} superCtor Constructor function to inherit prototype from. +- */ +-exports.inherits = function(ctor, superCtor) { +- ctor.super_ = superCtor; +- ctor.prototype = Object.create(superCtor.prototype, { +- constructor: { +- value: ctor, +- enumerable: false, +- writable: true, +- configurable: true +- } +- }); +-}; +- +-exports._extend = function(origin, add) { +- // Don't do anything if add isn't an object +- if (!add || !isObject(add)) return origin; +- +- var keys = Object.keys(add); +- var i = keys.length; +- while (i--) { +- origin[keys[i]] = add[keys[i]]; +- } +- return origin; +-}; +- +-function hasOwnProperty(obj, prop) { +- return Object.prototype.hasOwnProperty.call(obj, prop); +-} +- +- +-// Deprecated old stuff. +- +-exports.p = exports.deprecate(function() { +- for (var i = 0, len = arguments.length; i < len; ++i) { +- console.error(exports.inspect(arguments[i])); +- } +-}, 'util.p: Use console.error() instead'); +- +- +-exports.exec = exports.deprecate(function() { +- return require('child_process').exec.apply(this, arguments); +-}, 'util.exec is now called `child_process.exec`.'); +- +- +-exports.print = exports.deprecate(function() { +- for (var i = 0, len = arguments.length; i < len; ++i) { +- process.stdout.write(String(arguments[i])); +- } +-}, 'util.print: Use console.log instead'); +- +- +-exports.puts = exports.deprecate(function() { +- for (var i = 0, len = arguments.length; i < len; ++i) { +- process.stdout.write(arguments[i] + '\n'); +- } +-}, 'util.puts: Use console.log instead'); +- +- +-exports.debug = exports.deprecate(function(x) { +- process.stderr.write('DEBUG: ' + x + '\n'); +-}, 'util.debug: Use console.error instead'); +- +- +-exports.error = exports.deprecate(function(x) { +- for (var i = 0, len = arguments.length; i < len; ++i) { +- process.stderr.write(arguments[i] + '\n'); +- } +-}, 'util.error: Use console.error instead'); +- +- +-exports.pump = exports.deprecate(function(readStream, writeStream, callback) { +- var callbackCalled = false; +- +- function call(a, b, c) { +- if (callback && !callbackCalled) { +- callback(a, b, c); +- callbackCalled = true; +- } +- } +- +- readStream.addListener('data', function(chunk) { +- if (writeStream.write(chunk) === false) readStream.pause(); +- }); +- +- writeStream.addListener('drain', function() { +- readStream.resume(); +- }); +- +- readStream.addListener('end', function() { +- writeStream.end(); +- }); +- +- readStream.addListener('close', function() { +- call(); +- }); +- +- readStream.addListener('error', function(err) { +- writeStream.end(); +- call(err); +- }); +- +- writeStream.addListener('error', function(err) { +- readStream.destroy(); +- call(err); +- }); +-}, 'util.pump(): Use readableStream.pipe() instead'); +- +- +-var uv; +-exports._errnoException = function(err, syscall) { +- if (isUndefined(uv)) uv = process.binding('uv'); +- var errname = uv.errname(err); +- var e = new Error(syscall + ' ' + errname); +- e.code = errname; +- e.errno = errname; +- e.syscall = syscall; +- return e; +-}; ++} \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/lib/util.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/lib/util.js new file mode 100644 index 00000000..9074e8eb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/lib/util.js @@ -0,0 +1,107 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. +function isArray(ar) { + return Array.isArray(ar); +} +exports.isArray = isArray; + +function isBoolean(arg) { + return typeof arg === 'boolean'; +} +exports.isBoolean = isBoolean; + +function isNull(arg) { + return arg === null; +} +exports.isNull = isNull; + +function isNullOrUndefined(arg) { + return arg == null; +} +exports.isNullOrUndefined = isNullOrUndefined; + +function isNumber(arg) { + return typeof arg === 'number'; +} +exports.isNumber = isNumber; + +function isString(arg) { + return typeof arg === 'string'; +} +exports.isString = isString; + +function isSymbol(arg) { + return typeof arg === 'symbol'; +} +exports.isSymbol = isSymbol; + +function isUndefined(arg) { + return arg === void 0; +} +exports.isUndefined = isUndefined; + +function isRegExp(re) { + return isObject(re) && objectToString(re) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} +exports.isObject = isObject; + +function isDate(d) { + return isObject(d) && objectToString(d) === '[object Date]'; +} +exports.isDate = isDate; + +function isError(e) { + return isObject(e) && + (objectToString(e) === '[object Error]' || e instanceof Error); +} +exports.isError = isError; + +function isFunction(arg) { + return typeof arg === 'function'; +} +exports.isFunction = isFunction; + +function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; +} +exports.isPrimitive = isPrimitive; + +function isBuffer(arg) { + return Buffer.isBuffer(arg); +} +exports.isBuffer = isBuffer; + +function objectToString(o) { + return Object.prototype.toString.call(o); +} \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/package.json new file mode 100644 index 00000000..466dfdfe --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/package.json @@ -0,0 +1,53 @@ +{ + "name": "core-util-is", + "version": "1.0.1", + "description": "The `util.is*` functions introduced in Node v0.12.", + "main": "lib/util.js", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/core-util-is.git" + }, + "keywords": [ + "util", + "isBuffer", + "isArray", + "isNumber", + "isString", + "isRegExp", + "isThis", + "isThat", + "polyfill" + ], + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/isaacs/core-util-is/issues" + }, + "readme": "# core-util-is\n\nThe `util.is*` functions introduced in Node v0.12.\n", + "readmeFilename": "README.md", + "homepage": "https://github.com/isaacs/core-util-is", + "_id": "core-util-is@1.0.1", + "dist": { + "shasum": "6b07085aef9a3ccac6ee53bf9d3df0c1521a5538", + "tarball": "http://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz" + }, + "_from": "core-util-is@>=1.0.0 <1.1.0", + "_npmVersion": "1.3.23", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "directories": {}, + "_shasum": "6b07085aef9a3ccac6ee53bf9d3df0c1521a5538", + "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/util.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/util.js new file mode 100644 index 00000000..007fa105 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/util.js @@ -0,0 +1,106 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. +function isArray(ar) { + return Array.isArray(ar); +} +exports.isArray = isArray; + +function isBoolean(arg) { + return typeof arg === 'boolean'; +} +exports.isBoolean = isBoolean; + +function isNull(arg) { + return arg === null; +} +exports.isNull = isNull; + +function isNullOrUndefined(arg) { + return arg == null; +} +exports.isNullOrUndefined = isNullOrUndefined; + +function isNumber(arg) { + return typeof arg === 'number'; +} +exports.isNumber = isNumber; + +function isString(arg) { + return typeof arg === 'string'; +} +exports.isString = isString; + +function isSymbol(arg) { + return typeof arg === 'symbol'; +} +exports.isSymbol = isSymbol; + +function isUndefined(arg) { + return arg === void 0; +} +exports.isUndefined = isUndefined; + +function isRegExp(re) { + return isObject(re) && objectToString(re) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} +exports.isObject = isObject; + +function isDate(d) { + return isObject(d) && objectToString(d) === '[object Date]'; +} +exports.isDate = isDate; + +function isError(e) { + return isObject(e) && objectToString(e) === '[object Error]'; +} +exports.isError = isError; + +function isFunction(arg) { + return typeof arg === 'function'; +} +exports.isFunction = isFunction; + +function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; +} +exports.isPrimitive = isPrimitive; + +function isBuffer(arg) { + return arg instanceof Buffer; +} +exports.isBuffer = isBuffer; + +function objectToString(o) { + return Object.prototype.toString.call(o); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/README.md new file mode 100644 index 00000000..052a62b8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/README.md @@ -0,0 +1,54 @@ + +# isarray + +`Array#isArray` for older browsers. + +## Usage + +```js +var isArray = require('isarray'); + +console.log(isArray([])); // => true +console.log(isArray({})); // => false +``` + +## Installation + +With [npm](http://npmjs.org) do + +```bash +$ npm install isarray +``` + +Then bundle for the browser with +[browserify](https://github.com/substack/browserify). + +With [component](http://component.io) do + +```bash +$ component install juliangruber/isarray +``` + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/build/build.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/build/build.js new file mode 100644 index 00000000..e1856ef0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/build/build.js @@ -0,0 +1,208 @@ + +/** + * Require the given path. + * + * @param {String} path + * @return {Object} exports + * @api public + */ + +function require(path, parent, orig) { + var resolved = require.resolve(path); + + // lookup failed + if (null == resolved) { + orig = orig || path; + parent = parent || 'root'; + var err = new Error('Failed to require "' + orig + '" from "' + parent + '"'); + err.path = orig; + err.parent = parent; + err.require = true; + throw err; + } + + var module = require.modules[resolved]; + + // perform real require() + // by invoking the module's + // registered function + if (!module.exports) { + module.exports = {}; + module.client = module.component = true; + module.call(this, module.exports, require.relative(resolved), module); + } + + return module.exports; +} + +/** + * Registered modules. + */ + +require.modules = {}; + +/** + * Registered aliases. + */ + +require.aliases = {}; + +/** + * Resolve `path`. + * + * Lookup: + * + * - PATH/index.js + * - PATH.js + * - PATH + * + * @param {String} path + * @return {String} path or null + * @api private + */ + +require.resolve = function(path) { + if (path.charAt(0) === '/') path = path.slice(1); + var index = path + '/index.js'; + + var paths = [ + path, + path + '.js', + path + '.json', + path + '/index.js', + path + '/index.json' + ]; + + for (var i = 0; i < paths.length; i++) { + var path = paths[i]; + if (require.modules.hasOwnProperty(path)) return path; + } + + if (require.aliases.hasOwnProperty(index)) { + return require.aliases[index]; + } +}; + +/** + * Normalize `path` relative to the current path. + * + * @param {String} curr + * @param {String} path + * @return {String} + * @api private + */ + +require.normalize = function(curr, path) { + var segs = []; + + if ('.' != path.charAt(0)) return path; + + curr = curr.split('/'); + path = path.split('/'); + + for (var i = 0; i < path.length; ++i) { + if ('..' == path[i]) { + curr.pop(); + } else if ('.' != path[i] && '' != path[i]) { + segs.push(path[i]); + } + } + + return curr.concat(segs).join('/'); +}; + +/** + * Register module at `path` with callback `definition`. + * + * @param {String} path + * @param {Function} definition + * @api private + */ + +require.register = function(path, definition) { + require.modules[path] = definition; +}; + +/** + * Alias a module definition. + * + * @param {String} from + * @param {String} to + * @api private + */ + +require.alias = function(from, to) { + if (!require.modules.hasOwnProperty(from)) { + throw new Error('Failed to alias "' + from + '", it does not exist'); + } + require.aliases[to] = from; +}; + +/** + * Return a require function relative to the `parent` path. + * + * @param {String} parent + * @return {Function} + * @api private + */ + +require.relative = function(parent) { + var p = require.normalize(parent, '..'); + + /** + * lastIndexOf helper. + */ + + function lastIndexOf(arr, obj) { + var i = arr.length; + while (i--) { + if (arr[i] === obj) return i; + } + return -1; + } + + /** + * The relative require() itself. + */ + + function localRequire(path) { + var resolved = localRequire.resolve(path); + return require(resolved, parent, path); + } + + /** + * Resolve relative to the parent. + */ + + localRequire.resolve = function(path) { + var c = path.charAt(0); + if ('/' == c) return path.slice(1); + if ('.' == c) return require.normalize(p, path); + + // resolve deps by returning + // the dep in the nearest "deps" + // directory + var segs = parent.split('/'); + var i = lastIndexOf(segs, 'deps') + 1; + if (!i) i = 0; + path = segs.slice(0, i + 1).join('/') + '/deps/' + path; + return path; + }; + + /** + * Check if module is defined at `path`. + */ + + localRequire.exists = function(path) { + return require.modules.hasOwnProperty(localRequire.resolve(path)); + }; + + return localRequire; +}; +require.register("isarray/index.js", function(exports, require, module){ +module.exports = Array.isArray || function (arr) { + return Object.prototype.toString.call(arr) == '[object Array]'; +}; + +}); +require.alias("isarray/index.js", "isarray/index.js"); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/component.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/component.json new file mode 100644 index 00000000..9e31b683 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/component.json @@ -0,0 +1,19 @@ +{ + "name" : "isarray", + "description" : "Array#isArray for older browsers", + "version" : "0.0.1", + "repository" : "juliangruber/isarray", + "homepage": "https://github.com/juliangruber/isarray", + "main" : "index.js", + "scripts" : [ + "index.js" + ], + "dependencies" : {}, + "keywords": ["browser","isarray","array"], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/index.js new file mode 100644 index 00000000..5f5ad45d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/index.js @@ -0,0 +1,3 @@ +module.exports = Array.isArray || function (arr) { + return Object.prototype.toString.call(arr) == '[object Array]'; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/package.json new file mode 100644 index 00000000..19228ab6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/package.json @@ -0,0 +1,53 @@ +{ + "name": "isarray", + "description": "Array#isArray for older browsers", + "version": "0.0.1", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/isarray.git" + }, + "homepage": "https://github.com/juliangruber/isarray", + "main": "index.js", + "scripts": { + "test": "tap test/*.js" + }, + "dependencies": {}, + "devDependencies": { + "tap": "*" + }, + "keywords": [ + "browser", + "isarray", + "array" + ], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT", + "_id": "isarray@0.0.1", + "dist": { + "shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf", + "tarball": "http://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz" + }, + "_from": "isarray@0.0.1", + "_npmVersion": "1.2.18", + "_npmUser": { + "name": "juliangruber", + "email": "julian@juliangruber.com" + }, + "maintainers": [ + { + "name": "juliangruber", + "email": "julian@juliangruber.com" + } + ], + "directories": {}, + "_shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf", + "_resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "bugs": { + "url": "https://github.com/juliangruber/isarray/issues" + }, + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml new file mode 100644 index 00000000..5ac98855 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml @@ -0,0 +1,7 @@ +language: node_js +node_js: + - "0.8" + - "0.10" + - "0.11" + - "0.12" + - "iojs" diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/process-nextick-args/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/process-nextick-args/index.js new file mode 100644 index 00000000..049521ca --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/process-nextick-args/index.js @@ -0,0 +1,13 @@ +'use strict'; +module.exports = nextTick; + +function nextTick(fn) { + var args = new Array(arguments.length - 1); + var i = 0; + while (i < args.length) { + args[i++] = arguments[i]; + } + process.nextTick(function afterTick() { + fn.apply(null, args); + }); +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/process-nextick-args/license.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/process-nextick-args/license.md new file mode 100644 index 00000000..c67e3532 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/process-nextick-args/license.md @@ -0,0 +1,19 @@ +# Copyright (c) 2015 Calvin Metcalf + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +**THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.** diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/process-nextick-args/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/process-nextick-args/package.json new file mode 100644 index 00000000..087586e8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/process-nextick-args/package.json @@ -0,0 +1,45 @@ +{ + "name": "process-nextick-args", + "version": "1.0.3", + "description": "process.nextTick but always with args", + "main": "index.js", + "scripts": { + "test": "node test.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/calvinmetcalf/process-nextick-args.git" + }, + "author": "", + "license": "MIT", + "bugs": { + "url": "https://github.com/calvinmetcalf/process-nextick-args/issues" + }, + "homepage": "https://github.com/calvinmetcalf/process-nextick-args", + "devDependencies": { + "tap": "~0.2.6" + }, + "gitHead": "e855846a69662b9489f1ad3dde1ebf2ccc4370b8", + "_id": "process-nextick-args@1.0.3", + "_shasum": "e272eed825d5e9f4ea74d8d73b1fe311c3beb630", + "_from": "process-nextick-args@>=1.0.0 <1.1.0", + "_npmVersion": "2.9.0", + "_nodeVersion": "2.5.0", + "_npmUser": { + "name": "cwmma", + "email": "calvin.metcalf@gmail.com" + }, + "dist": { + "shasum": "e272eed825d5e9f4ea74d8d73b1fe311c3beb630", + "tarball": "http://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.3.tgz" + }, + "maintainers": [ + { + "name": "cwmma", + "email": "calvin.metcalf@gmail.com" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.3.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/process-nextick-args/readme.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/process-nextick-args/readme.md new file mode 100644 index 00000000..78e7cfae --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/process-nextick-args/readme.md @@ -0,0 +1,18 @@ +process-nextick-args +===== + +[![Build Status](https://travis-ci.org/calvinmetcalf/process-nextick-args.svg?branch=master)](https://travis-ci.org/calvinmetcalf/process-nextick-args) + +```bash +npm install --save process-nextick-args +``` + +Always be able to pass arguments to process.nextTick, no matter the platform + +```js +var nextTick = require('process-nextick-args'); + +nextTick(function (a, b, c) { + console.log(a, b, c); +}, 'step', 3, 'profit'); +``` diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/process-nextick-args/test.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/process-nextick-args/test.js new file mode 100644 index 00000000..ef157215 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/process-nextick-args/test.js @@ -0,0 +1,24 @@ +var test = require("tap").test; +var nextTick = require('./'); + +test('should work', function (t) { + t.plan(5); + nextTick(function (a) { + t.ok(a); + nextTick(function (thing) { + t.equals(thing, 7); + }, 7); + }, true); + nextTick(function (a, b, c) { + t.equals(a, 'step'); + t.equals(b, 3); + t.equals(c, 'profit'); + }, 'step', 3, 'profit'); +}); + +test('correct number of arguments', function (t) { + t.plan(1); + nextTick(function () { + t.equals(2, arguments.length, 'correct number'); + }, 1, 2); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/.npmignore new file mode 100644 index 00000000..206320cc --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/.npmignore @@ -0,0 +1,2 @@ +build +test diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/LICENSE new file mode 100644 index 00000000..6de584a4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/LICENSE @@ -0,0 +1,20 @@ +Copyright Joyent, Inc. and other Node contributors. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to permit +persons to whom the Software is furnished to do so, subject to the +following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/README.md new file mode 100644 index 00000000..4d2aa001 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/README.md @@ -0,0 +1,7 @@ +**string_decoder.js** (`require('string_decoder')`) from Node.js core + +Copyright Joyent, Inc. and other Node contributors. See LICENCE file for details. + +Version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. **Prefer the stable version over the unstable.** + +The *build/* directory contains a build script that will scrape the source from the [joyent/node](https://github.com/joyent/node) repo given a specific Node version. \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/index.js new file mode 100644 index 00000000..b00e54fb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/index.js @@ -0,0 +1,221 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var Buffer = require('buffer').Buffer; + +var isBufferEncoding = Buffer.isEncoding + || function(encoding) { + switch (encoding && encoding.toLowerCase()) { + case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true; + default: return false; + } + } + + +function assertEncoding(encoding) { + if (encoding && !isBufferEncoding(encoding)) { + throw new Error('Unknown encoding: ' + encoding); + } +} + +// StringDecoder provides an interface for efficiently splitting a series of +// buffers into a series of JS strings without breaking apart multi-byte +// characters. CESU-8 is handled as part of the UTF-8 encoding. +// +// @TODO Handling all encodings inside a single object makes it very difficult +// to reason about this code, so it should be split up in the future. +// @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code +// points as used by CESU-8. +var StringDecoder = exports.StringDecoder = function(encoding) { + this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, ''); + assertEncoding(encoding); + switch (this.encoding) { + case 'utf8': + // CESU-8 represents each of Surrogate Pair by 3-bytes + this.surrogateSize = 3; + break; + case 'ucs2': + case 'utf16le': + // UTF-16 represents each of Surrogate Pair by 2-bytes + this.surrogateSize = 2; + this.detectIncompleteChar = utf16DetectIncompleteChar; + break; + case 'base64': + // Base-64 stores 3 bytes in 4 chars, and pads the remainder. + this.surrogateSize = 3; + this.detectIncompleteChar = base64DetectIncompleteChar; + break; + default: + this.write = passThroughWrite; + return; + } + + // Enough space to store all bytes of a single character. UTF-8 needs 4 + // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate). + this.charBuffer = new Buffer(6); + // Number of bytes received for the current incomplete multi-byte character. + this.charReceived = 0; + // Number of bytes expected for the current incomplete multi-byte character. + this.charLength = 0; +}; + + +// write decodes the given buffer and returns it as JS string that is +// guaranteed to not contain any partial multi-byte characters. Any partial +// character found at the end of the buffer is buffered up, and will be +// returned when calling write again with the remaining bytes. +// +// Note: Converting a Buffer containing an orphan surrogate to a String +// currently works, but converting a String to a Buffer (via `new Buffer`, or +// Buffer#write) will replace incomplete surrogates with the unicode +// replacement character. See https://codereview.chromium.org/121173009/ . +StringDecoder.prototype.write = function(buffer) { + var charStr = ''; + // if our last write ended with an incomplete multibyte character + while (this.charLength) { + // determine how many remaining bytes this buffer has to offer for this char + var available = (buffer.length >= this.charLength - this.charReceived) ? + this.charLength - this.charReceived : + buffer.length; + + // add the new bytes to the char buffer + buffer.copy(this.charBuffer, this.charReceived, 0, available); + this.charReceived += available; + + if (this.charReceived < this.charLength) { + // still not enough chars in this buffer? wait for more ... + return ''; + } + + // remove bytes belonging to the current character from the buffer + buffer = buffer.slice(available, buffer.length); + + // get the character that was split + charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding); + + // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character + var charCode = charStr.charCodeAt(charStr.length - 1); + if (charCode >= 0xD800 && charCode <= 0xDBFF) { + this.charLength += this.surrogateSize; + charStr = ''; + continue; + } + this.charReceived = this.charLength = 0; + + // if there are no more bytes in this buffer, just emit our char + if (buffer.length === 0) { + return charStr; + } + break; + } + + // determine and set charLength / charReceived + this.detectIncompleteChar(buffer); + + var end = buffer.length; + if (this.charLength) { + // buffer the incomplete character bytes we got + buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end); + end -= this.charReceived; + } + + charStr += buffer.toString(this.encoding, 0, end); + + var end = charStr.length - 1; + var charCode = charStr.charCodeAt(end); + // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character + if (charCode >= 0xD800 && charCode <= 0xDBFF) { + var size = this.surrogateSize; + this.charLength += size; + this.charReceived += size; + this.charBuffer.copy(this.charBuffer, size, 0, size); + buffer.copy(this.charBuffer, 0, 0, size); + return charStr.substring(0, end); + } + + // or just emit the charStr + return charStr; +}; + +// detectIncompleteChar determines if there is an incomplete UTF-8 character at +// the end of the given buffer. If so, it sets this.charLength to the byte +// length that character, and sets this.charReceived to the number of bytes +// that are available for this character. +StringDecoder.prototype.detectIncompleteChar = function(buffer) { + // determine how many bytes we have to check at the end of this buffer + var i = (buffer.length >= 3) ? 3 : buffer.length; + + // Figure out if one of the last i bytes of our buffer announces an + // incomplete char. + for (; i > 0; i--) { + var c = buffer[buffer.length - i]; + + // See http://en.wikipedia.org/wiki/UTF-8#Description + + // 110XXXXX + if (i == 1 && c >> 5 == 0x06) { + this.charLength = 2; + break; + } + + // 1110XXXX + if (i <= 2 && c >> 4 == 0x0E) { + this.charLength = 3; + break; + } + + // 11110XXX + if (i <= 3 && c >> 3 == 0x1E) { + this.charLength = 4; + break; + } + } + this.charReceived = i; +}; + +StringDecoder.prototype.end = function(buffer) { + var res = ''; + if (buffer && buffer.length) + res = this.write(buffer); + + if (this.charReceived) { + var cr = this.charReceived; + var buf = this.charBuffer; + var enc = this.encoding; + res += buf.slice(0, cr).toString(enc); + } + + return res; +}; + +function passThroughWrite(buffer) { + return buffer.toString(this.encoding); +} + +function utf16DetectIncompleteChar(buffer) { + this.charReceived = buffer.length % 2; + this.charLength = this.charReceived ? 2 : 0; +} + +function base64DetectIncompleteChar(buffer) { + this.charReceived = buffer.length % 3; + this.charLength = this.charReceived ? 3 : 0; +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/package.json new file mode 100644 index 00000000..0364d54b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/package.json @@ -0,0 +1,54 @@ +{ + "name": "string_decoder", + "version": "0.10.31", + "description": "The string_decoder module from Node core", + "main": "index.js", + "dependencies": {}, + "devDependencies": { + "tap": "~0.4.8" + }, + "scripts": { + "test": "tap test/simple/*.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/rvagg/string_decoder.git" + }, + "homepage": "https://github.com/rvagg/string_decoder", + "keywords": [ + "string", + "decoder", + "browser", + "browserify" + ], + "license": "MIT", + "gitHead": "d46d4fd87cf1d06e031c23f1ba170ca7d4ade9a0", + "bugs": { + "url": "https://github.com/rvagg/string_decoder/issues" + }, + "_id": "string_decoder@0.10.31", + "_shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", + "_from": "string_decoder@>=0.10.0 <0.11.0", + "_npmVersion": "1.4.23", + "_npmUser": { + "name": "rvagg", + "email": "rod@vagg.org" + }, + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + }, + { + "name": "rvagg", + "email": "rod@vagg.org" + } + ], + "dist": { + "shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", + "tarball": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/History.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/History.md new file mode 100644 index 00000000..ec010299 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/History.md @@ -0,0 +1,11 @@ + +1.0.1 / 2014-11-25 +================== + + * browser: use `console.warn()` for deprecation calls + * browser: more jsdocs + +1.0.0 / 2014-04-30 +================== + + * initial commit diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/LICENSE new file mode 100644 index 00000000..6a60e8c2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/LICENSE @@ -0,0 +1,24 @@ +(The MIT License) + +Copyright (c) 2014 Nathan Rajlich + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/README.md new file mode 100644 index 00000000..75622fa7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/README.md @@ -0,0 +1,53 @@ +util-deprecate +============== +### The Node.js `util.deprecate()` function with browser support + +In Node.js, this module simply re-exports the `util.deprecate()` function. + +In the web browser (i.e. via browserify), a browser-specific implementation +of the `util.deprecate()` function is used. + + +## API + +A `deprecate()` function is the only thing exposed by this module. + +``` javascript +// setup: +exports.foo = deprecate(foo, 'foo() is deprecated, use bar() instead'); + + +// users see: +foo(); +// foo() is deprecated, use bar() instead +foo(); +foo(); +``` + + +## License + +(The MIT License) + +Copyright (c) 2014 Nathan Rajlich + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/browser.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/browser.js new file mode 100644 index 00000000..55fa5a4b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/browser.js @@ -0,0 +1,62 @@ + +/** + * Module exports. + */ + +module.exports = deprecate; + +/** + * Mark that a method should not be used. + * Returns a modified function which warns once by default. + * + * If `localStorage.noDeprecation = true` is set, then it is a no-op. + * + * If `localStorage.throwDeprecation = true` is set, then deprecated functions + * will throw an Error when invoked. + * + * If `localStorage.traceDeprecation = true` is set, then deprecated functions + * will invoke `console.trace()` instead of `console.error()`. + * + * @param {Function} fn - the function to deprecate + * @param {String} msg - the string to print to the console when `fn` is invoked + * @returns {Function} a new "deprecated" version of `fn` + * @api public + */ + +function deprecate (fn, msg) { + if (config('noDeprecation')) { + return fn; + } + + var warned = false; + function deprecated() { + if (!warned) { + if (config('throwDeprecation')) { + throw new Error(msg); + } else if (config('traceDeprecation')) { + console.trace(msg); + } else { + console.warn(msg); + } + warned = true; + } + return fn.apply(this, arguments); + } + + return deprecated; +} + +/** + * Checks `localStorage` for boolean values for the given `name`. + * + * @param {String} name + * @returns {Boolean} + * @api private + */ + +function config (name) { + if (!global.localStorage) return false; + var val = global.localStorage[name]; + if (null == val) return false; + return String(val).toLowerCase() === 'true'; +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/node.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/node.js new file mode 100644 index 00000000..5e6fcff5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/node.js @@ -0,0 +1,6 @@ + +/** + * For Node.js, simply re-export the core `util.deprecate` function. + */ + +module.exports = require('util').deprecate; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/package.json new file mode 100644 index 00000000..ea487da0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/package.json @@ -0,0 +1,53 @@ +{ + "name": "util-deprecate", + "version": "1.0.1", + "description": "The Node.js `util.deprecate()` function with browser support", + "main": "node.js", + "browser": "browser.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git://github.com/TooTallNate/util-deprecate.git" + }, + "keywords": [ + "util", + "deprecate", + "browserify", + "browser", + "node" + ], + "author": { + "name": "Nathan Rajlich", + "email": "nathan@tootallnate.net", + "url": "http://n8.io/" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/TooTallNate/util-deprecate/issues" + }, + "homepage": "https://github.com/TooTallNate/util-deprecate", + "gitHead": "6e923f7d98a0afbe5b9c7db9d0f0029c1936746c", + "_id": "util-deprecate@1.0.1", + "_shasum": "3556a3d13c4c6aa7983d7e2425478197199b7881", + "_from": "util-deprecate@>=1.0.1 <1.1.0", + "_npmVersion": "1.4.28", + "_npmUser": { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + }, + "maintainers": [ + { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + } + ], + "dist": { + "shasum": "3556a3d13c4c6aa7983d7e2425478197199b7881", + "tarball": "http://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.1.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.1.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/package.json new file mode 100644 index 00000000..7a333a98 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/package.json @@ -0,0 +1,75 @@ +{ + "name": "readable-stream", + "version": "2.0.2", + "description": "Streams3, a user-land copy of the stream library from iojs v2.x", + "main": "readable.js", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "process-nextick-args": "~1.0.0", + "string_decoder": "~0.10.x", + "util-deprecate": "~1.0.1" + }, + "devDependencies": { + "tap": "~0.2.6", + "tape": "~4.0.0", + "zuul": "~3.0.0" + }, + "scripts": { + "test": "tap test/parallel/*.js", + "browser": "zuul --browser-name $BROWSER_NAME --browser-version $BROWSER_VERSION -- test/browser.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/nodejs/readable-stream.git" + }, + "keywords": [ + "readable", + "stream", + "pipe" + ], + "browser": { + "util": false + }, + "license": "MIT", + "gitHead": "1a70134a71196eeabb5e27bc7580faaa68d30513", + "bugs": { + "url": "https://github.com/nodejs/readable-stream/issues" + }, + "homepage": "https://github.com/nodejs/readable-stream#readme", + "_id": "readable-stream@2.0.2", + "_shasum": "bec81beae8cf455168bc2e5b2b31f5bcfaed9b1b", + "_from": "readable-stream@>=2.0.2 <3.0.0", + "_npmVersion": "2.11.1", + "_nodeVersion": "2.3.0", + "_npmUser": { + "name": "cwmma", + "email": "calvin.metcalf@gmail.com" + }, + "dist": { + "shasum": "bec81beae8cf455168bc2e5b2b31f5bcfaed9b1b", + "tarball": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.0.2.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + }, + { + "name": "rvagg", + "email": "rod@vagg.org" + }, + { + "name": "cwmma", + "email": "calvin.metcalf@gmail.com" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.2.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/passthrough.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/passthrough.js new file mode 100644 index 00000000..27e8d8a5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/passthrough.js @@ -0,0 +1 @@ +module.exports = require("./lib/_stream_passthrough.js") diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/readable.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/readable.js new file mode 100644 index 00000000..6222a579 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/readable.js @@ -0,0 +1,12 @@ +var Stream = (function (){ + try { + return require('st' + 'ream'); // hack to fix a circular dependency issue when used with browserify + } catch(_){} +}()); +exports = module.exports = require('./lib/_stream_readable.js'); +exports.Stream = Stream || exports; +exports.Readable = exports; +exports.Writable = require('./lib/_stream_writable.js'); +exports.Duplex = require('./lib/_stream_duplex.js'); +exports.Transform = require('./lib/_stream_transform.js'); +exports.PassThrough = require('./lib/_stream_passthrough.js'); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/transform.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/transform.js new file mode 100644 index 00000000..5d482f07 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/transform.js @@ -0,0 +1 @@ +module.exports = require("./lib/_stream_transform.js") diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/writable.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/writable.js new file mode 100644 index 00000000..e1e9efdf --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/node_modules/readable-stream/writable.js @@ -0,0 +1 @@ +module.exports = require("./lib/_stream_writable.js") diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/package.json new file mode 100644 index 00000000..95e55e13 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sha/package.json @@ -0,0 +1,54 @@ +{ + "name": "sha", + "version": "2.0.1", + "description": "Check and get file hashes", + "scripts": { + "test": "mocha -R spec" + }, + "repository": { + "type": "git", + "url": "https://github.com/ForbesLindesay/sha.git" + }, + "license": "(BSD-2-Clause OR MIT)", + "dependencies": { + "graceful-fs": "^4.1.2", + "readable-stream": "^2.0.2" + }, + "devDependencies": { + "mocha": "~1.9.0" + }, + "gitHead": "ce7c72ba753d886fb46c396cbadcbfc8eac25b4f", + "bugs": { + "url": "https://github.com/ForbesLindesay/sha/issues" + }, + "homepage": "https://github.com/ForbesLindesay/sha", + "_id": "sha@2.0.1", + "_shasum": "6030822fbd2c9823949f8f72ed6411ee5cf25aae", + "_from": "sha@2.0.1", + "_npmVersion": "2.7.1", + "_nodeVersion": "1.6.2", + "_npmUser": { + "name": "forbeslindesay", + "email": "forbes@lindesay.co.uk" + }, + "maintainers": [ + { + "name": "forbeslindesay", + "email": "forbes@lindesay.co.uk" + }, + { + "name": "kenan", + "email": "kenan@kenany.me" + }, + { + "name": "thefourtheye", + "email": "thechargingvolcano@gmail.com" + } + ], + "dist": { + "shasum": "6030822fbd2c9823949f8f72ed6411ee5cf25aae", + "tarball": "http://registry.npmjs.org/sha/-/sha-2.0.1.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/sha/-/sha-2.0.1.tgz" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/slide/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/slide/LICENSE new file mode 100644 index 00000000..05eeeb88 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/slide/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/slide/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/slide/README.md new file mode 100644 index 00000000..59ad738b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/slide/README.md @@ -0,0 +1,143 @@ +# Controlling Flow: callbacks are easy + +## What's actually hard? + +- Doing a bunch of things in a specific order. +- Knowing when stuff is done. +- Handling failures. +- Breaking up functionality into parts (avoid nested inline callbacks) + + +## Common Mistakes + +- Abandoning convention and consistency. +- Putting all callbacks inline. +- Using libraries without grokking them. +- Trying to make async code look sync. + +## Define Conventions + +- Two kinds of functions: *actors* take action, *callbacks* get results. +- Essentially the continuation pattern. Resulting code *looks* similar + to fibers, but is *much* simpler to implement. +- Node works this way in the lowlevel APIs already, and it's very flexible. + +## Callbacks + +- Simple responders +- Must always be prepared to handle errors, that's why it's the first argument. +- Often inline anonymous, but not always. +- Can trap and call other callbacks with modified data, or pass errors upwards. + +## Actors + +- Last argument is a callback. +- If any error occurs, and can't be handled, pass it to the callback and return. +- Must not throw. Return value ignored. +- return x ==> return cb(null, x) +- throw er ==> return cb(er) + +```javascript +// return true if a path is either +// a symlink or a directory. +function isLinkOrDir (path, cb) { + fs.lstat(path, function (er, s) { + if (er) return cb(er) + return cb(null, s.isDirectory() || s.isSymbolicLink()) + }) +} +``` + +# asyncMap + +## Usecases + +- I have a list of 10 files, and need to read all of them, and then continue when they're all done. +- I have a dozen URLs, and need to fetch them all, and then continue when they're all done. +- I have 4 connected users, and need to send a message to all of them, and then continue when that's done. +- I have a list of n things, and I need to dosomething with all of them, in parallel, and get the results once they're all complete. + + +## Solution + +```javascript +var asyncMap = require("slide").asyncMap +function writeFiles (files, what, cb) { + asyncMap(files, function (f, cb) { + fs.writeFile(f, what, cb) + }, cb) +} +writeFiles([my, file, list], "foo", cb) +``` + +# chain + +## Usecases + +- I have to do a bunch of things, in order. Get db credentials out of a file, + read the data from the db, write that data to another file. +- If anything fails, do not continue. +- I still have to provide an array of functions, which is a lot of boilerplate, + and a pita if your functions take args like + +```javascript +function (cb) { + blah(a, b, c, cb) +} +``` + +- Results are discarded, which is a bit lame. +- No way to branch. + +## Solution + +- reduces boilerplate by converting an array of [fn, args] to an actor + that takes no arguments (except cb) +- A bit like Function#bind, but tailored for our use-case. +- bindActor(obj, "method", a, b, c) +- bindActor(fn, a, b, c) +- bindActor(obj, fn, a, b, c) +- branching, skipping over falsey arguments + +```javascript +chain([ + doThing && [thing, a, b, c] +, isFoo && [doFoo, "foo"] +, subChain && [chain, [one, two]] +], cb) +``` + +- tracking results: results are stored in an optional array passed as argument, + last result is always in results[results.length - 1]. +- treat chain.first and chain.last as placeholders for the first/last + result up until that point. + + +## Non-trivial example + +- Read number files in a directory +- Add the results together +- Ping a web service with the result +- Write the response to a file +- Delete the number files + +```javascript +var chain = require("slide").chain +function myProgram (cb) { + var res = [], last = chain.last, first = chain.first + chain([ + [fs, "readdir", "the-directory"] + , [readFiles, "the-directory", last] + , [sum, last] + , [ping, "POST", "example.com", 80, "/foo", last] + , [fs, "writeFile", "result.txt", last] + , [rmFiles, "./the-directory", first] + ], res, cb) +} +``` + +# Conclusion: Convention Profits + +- Consistent API from top to bottom. +- Sneak in at any point to inject functionality. Testable, reusable, ... +- When ruby and python users whine, you can smile condescendingly. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/slide/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/slide/index.js new file mode 100644 index 00000000..0a9277f6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/slide/index.js @@ -0,0 +1 @@ +module.exports=require("./lib/slide") diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/slide/lib/async-map-ordered.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/slide/lib/async-map-ordered.js new file mode 100644 index 00000000..5cca79a8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/slide/lib/async-map-ordered.js @@ -0,0 +1,65 @@ + +throw new Error("TODO: Not yet implemented.") + +/* +usage: + +Like asyncMap, but only can take a single cb, and guarantees +the order of the results. +*/ + +module.exports = asyncMapOrdered + +function asyncMapOrdered (list, fn, cb_) { + if (typeof cb_ !== "function") throw new Error( + "No callback provided to asyncMapOrdered") + + if (typeof fn !== "function") throw new Error( + "No map function provided to asyncMapOrdered") + + if (list === undefined || list === null) return cb_(null, []) + if (!Array.isArray(list)) list = [list] + if (!list.length) return cb_(null, []) + + var errState = null + , l = list.length + , a = l + , res = [] + , resCount = 0 + , maxArgLen = 0 + + function cb (index) { return function () { + if (errState) return + var er = arguments[0] + var argLen = arguments.length + maxArgLen = Math.max(maxArgLen, argLen) + res[index] = argLen === 1 ? [er] : Array.apply(null, arguments) + + // see if any new things have been added. + if (list.length > l) { + var newList = list.slice(l) + a += (list.length - l) + var oldLen = l + l = list.length + process.nextTick(function () { + newList.forEach(function (ar, i) { fn(ar, cb(i + oldLen)) }) + }) + } + + if (er || --a === 0) { + errState = er + cb_.apply(null, [errState].concat(flip(res, resCount, maxArgLen))) + } + }} + // expect the supplied cb function to be called + // "n" times for each thing in the array. + list.forEach(function (ar) { + steps.forEach(function (fn, i) { fn(ar, cb(i)) }) + }) +} + +function flip (res, resCount, argLen) { + var flat = [] + // res = [[er, x, y], [er, x1, y1], [er, x2, y2, z2]] + // return [[x, x1, x2], [y, y1, y2], [undefined, undefined, z2]] + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/slide/lib/async-map.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/slide/lib/async-map.js new file mode 100644 index 00000000..ccf345f3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/slide/lib/async-map.js @@ -0,0 +1,54 @@ + +/* +usage: + +// do something to a list of things +asyncMap(myListOfStuff, function (thing, cb) { doSomething(thing.foo, cb) }, cb) +// do more than one thing to each item +asyncMap(list, fooFn, barFn, cb) + +*/ + +module.exports = asyncMap + +function asyncMap () { + var steps = Array.prototype.slice.call(arguments) + , list = steps.shift() || [] + , cb_ = steps.pop() + if (typeof cb_ !== "function") throw new Error( + "No callback provided to asyncMap") + if (!list) return cb_(null, []) + if (!Array.isArray(list)) list = [list] + var n = steps.length + , data = [] // 2d array + , errState = null + , l = list.length + , a = l * n + if (!a) return cb_(null, []) + function cb (er) { + if (er && !errState) errState = er + + var argLen = arguments.length + for (var i = 1; i < argLen; i ++) if (arguments[i] !== undefined) { + data[i - 1] = (data[i - 1] || []).concat(arguments[i]) + } + // see if any new things have been added. + if (list.length > l) { + var newList = list.slice(l) + a += (list.length - l) * n + l = list.length + process.nextTick(function () { + newList.forEach(function (ar) { + steps.forEach(function (fn) { fn(ar, cb) }) + }) + }) + } + + if (--a === 0) cb_.apply(null, [errState].concat(data)) + } + // expect the supplied cb function to be called + // "n" times for each thing in the array. + list.forEach(function (ar) { + steps.forEach(function (fn) { fn(ar, cb) }) + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/slide/lib/bind-actor.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/slide/lib/bind-actor.js new file mode 100644 index 00000000..6a370727 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/slide/lib/bind-actor.js @@ -0,0 +1,16 @@ +module.exports = bindActor +function bindActor () { + var args = + Array.prototype.slice.call + (arguments) // jswtf. + , obj = null + , fn + if (typeof args[0] === "object") { + obj = args.shift() + fn = args.shift() + if (typeof fn === "string") + fn = obj[ fn ] + } else fn = args.shift() + return function (cb) { + fn.apply(obj, args.concat(cb)) } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/slide/lib/chain.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/slide/lib/chain.js new file mode 100644 index 00000000..17b37114 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/slide/lib/chain.js @@ -0,0 +1,20 @@ +module.exports = chain +var bindActor = require("./bind-actor.js") +chain.first = {} ; chain.last = {} +function chain (things, cb) { + var res = [] + ;(function LOOP (i, len) { + if (i >= len) return cb(null,res) + if (Array.isArray(things[i])) + things[i] = bindActor.apply(null, + things[i].map(function(i){ + return (i===chain.first) ? res[0] + : (i===chain.last) + ? res[res.length - 1] : i })) + if (!things[i]) return LOOP(i + 1, len) + things[i](function (er, data) { + if (er) return cb(er, res) + if (data !== undefined) res = res.concat(data) + LOOP(i + 1, len) + }) + })(0, things.length) } diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/slide/lib/slide.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/slide/lib/slide.js new file mode 100644 index 00000000..6e9ec232 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/slide/lib/slide.js @@ -0,0 +1,3 @@ +exports.asyncMap = require("./async-map") +exports.bindActor = require("./bind-actor") +exports.chain = require("./chain") diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/slide/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/slide/package.json new file mode 100644 index 00000000..1c0b30bf --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/slide/package.json @@ -0,0 +1,54 @@ +{ + "name": "slide", + "version": "1.1.6", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "contributors": [ + { + "name": "S. Sriram", + "email": "ssriram@gmail.com", + "url": "http://www.565labs.com" + } + ], + "description": "A flow control lib small enough to fit on in a slide presentation. Derived live at Oak.JS", + "main": "./lib/slide.js", + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": "*" + }, + "repository": { + "type": "git", + "url": "git://github.com/isaacs/slide-flow-control.git" + }, + "license": "ISC", + "gitHead": "8345e51ee41e35825abc1a40750ea11462f57028", + "bugs": { + "url": "https://github.com/isaacs/slide-flow-control/issues" + }, + "homepage": "https://github.com/isaacs/slide-flow-control", + "_id": "slide@1.1.6", + "scripts": {}, + "_shasum": "56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707", + "_from": "slide@>=1.1.6 <1.2.0", + "_npmVersion": "2.0.0-beta.3", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "dist": { + "shasum": "56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707", + "tarball": "http://registry.npmjs.org/slide/-/slide-1.1.6.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sorted-object/LICENSE.txt b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sorted-object/LICENSE.txt new file mode 100644 index 00000000..4a323deb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sorted-object/LICENSE.txt @@ -0,0 +1,19 @@ +Copyright © 2014–2016 Domenic Denicola + +This work is free. You can redistribute it and/or modify it under the +terms of the Do What The Fuck You Want To Public License, Version 2, +as published by Sam Hocevar. See below for more details. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 + + Copyright (C) 2004 Sam Hocevar + + Everyone is permitted to copy and distribute verbatim or modified + copies of this license document, and changing it is allowed as long + as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sorted-object/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sorted-object/README.md new file mode 100644 index 00000000..d3f12a27 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sorted-object/README.md @@ -0,0 +1,20 @@ +# Get a Version of an Object with Sorted Keys + +Although objects in JavaScript are theoretically unsorted, in practice most engines use insertion order—at least, ignoring numeric keys. This manifests itself most prominently when dealing with an object's JSON serialization. + +So, for example, you might be trying to serialize some object to a JSON file. But every time you write it, it ends up being output in a different order, depending on how you created it in the first place! This makes for some ugly diffs. + +**sorted-object** gives you the answer. Just use this package to create a version of your object with its keys sorted before serializing, and you'll get a consistent order every time. + +```js +var sortedObject = require("sorted-object"); + +var objectToSerialize = generateStuffNondeterministically(); + +// Before: +fs.writeFileSync("dest.json", JSON.stringify(objectToSerialize)); + +// After: +var sortedVersion = sortedObject(objectToSerialize); +fs.writeFileSync("dest.json", JSON.stringify(sortedVersion)); +``` diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sorted-object/lib/sorted-object.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sorted-object/lib/sorted-object.js new file mode 100644 index 00000000..1b3fe81a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sorted-object/lib/sorted-object.js @@ -0,0 +1,11 @@ +"use strict"; + +module.exports = function (input) { + var output = {}; + + Object.keys(input).sort().forEach(function (key) { + output[key] = input[key]; + }); + + return output; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sorted-object/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sorted-object/package.json new file mode 100644 index 00000000..0e4022d0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/sorted-object/package.json @@ -0,0 +1,63 @@ +{ + "name": "sorted-object", + "description": "Returns a copy of an object with its keys sorted", + "keywords": [ + "sort", + "keys", + "object" + ], + "version": "2.0.0", + "author": { + "name": "Domenic Denicola", + "email": "d@domenic.me", + "url": "https://domenic.me/" + }, + "license": "WTFPL", + "repository": { + "type": "git", + "url": "git+https://github.com/domenic/sorted-object.git" + }, + "main": "lib/sorted-object.js", + "files": [ + "lib/" + ], + "scripts": { + "test": "tape test/tests.js", + "lint": "eslint ." + }, + "devDependencies": { + "eslint": "^2.4.0", + "tape": "^4.5.1" + }, + "gitHead": "3cbdde212c8ceef219fbb8fa7805bfc38b94aa90", + "bugs": { + "url": "https://github.com/domenic/sorted-object/issues" + }, + "homepage": "https://github.com/domenic/sorted-object#readme", + "_id": "sorted-object@2.0.0", + "_shasum": "1cfea981609047d8043807a490a9d99b317faf7f", + "_from": "sorted-object@2.0.0", + "_npmVersion": "3.6.0", + "_nodeVersion": "5.7.1", + "_npmUser": { + "name": "domenic", + "email": "d@domenic.me" + }, + "dist": { + "shasum": "1cfea981609047d8043807a490a9d99b317faf7f", + "tarball": "http://registry.npmjs.org/sorted-object/-/sorted-object-2.0.0.tgz" + }, + "maintainers": [ + { + "name": "domenic", + "email": "domenic@domenicdenicola.com" + } + ], + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/sorted-object-2.0.0.tgz_1457910693572_0.6718082851730287" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/sorted-object/-/sorted-object-2.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/spdx-license-ids/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/spdx-license-ids/LICENSE new file mode 100644 index 00000000..68a49daa --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/spdx-license-ids/LICENSE @@ -0,0 +1,24 @@ +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/spdx-license-ids/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/spdx-license-ids/README.md new file mode 100644 index 00000000..92523532 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/spdx-license-ids/README.md @@ -0,0 +1,55 @@ +# spdx-license-ids + +A list of [SPDX license](https://spdx.org/licenses/) identifiers + +[**Download JSON**](https://raw.githubusercontent.com/shinnn/spdx-license-ids/master/spdx-license-ids.json) + +## Use as a JavaScript Library + +[![NPM version](https://img.shields.io/npm/v/spdx-license-ids.svg)](https://www.npmjs.org/package/spdx-license-ids) +[![Bower version](https://img.shields.io/bower/v/spdx-license-ids.svg)](https://github.com/shinnn/spdx-license-ids/releases) +[![Build Status](https://travis-ci.org/shinnn/spdx-license-ids.svg?branch=master)](https://travis-ci.org/shinnn/spdx-license-ids) +[![Coverage Status](https://img.shields.io/coveralls/shinnn/spdx-license-ids.svg)](https://coveralls.io/r/shinnn/spdx-license-ids) +[![devDependency Status](https://david-dm.org/shinnn/spdx-license-ids/dev-status.svg)](https://david-dm.org/shinnn/spdx-license-ids#info=devDependencies) + +### Installation + +#### Package managers + +##### [npm](https://www.npmjs.com/) + +```sh +npm install spdx-license-ids +``` + +##### [bower](http://bower.io/) + +```sh +bower install spdx-license-ids +``` + +##### [Duo](http://duojs.org/) + +```javascript +const spdxLicenseIds = require('shinnn/spdx-license-ids'); +``` + +#### Standalone + +[Download the script file directly.](https://raw.githubusercontent.com/shinnn/spdx-license-ids/master/spdx-license-ids-browser.js) + +### API + +#### spdxLicenseIds + +Type: `Array` of `String` + +It returns an array of SPDX license identifiers. + +```javascript +const spdxLicenseIds = require('spdx-license-ids'); //=> ['Glide', 'Abstyles', 'AFL-1.1', ... ] +``` + +## License + +[The Unlicense](./LICENSE). diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/spdx-license-ids/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/spdx-license-ids/package.json new file mode 100644 index 00000000..c0b72753 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/spdx-license-ids/package.json @@ -0,0 +1,82 @@ +{ + "name": "spdx-license-ids", + "version": "1.2.2", + "description": "A list of SPDX license identifiers", + "repository": { + "type": "git", + "url": "git+https://github.com/shinnn/spdx-license-ids.git" + }, + "author": { + "name": "Shinnosuke Watanabe", + "url": "https://github.com/shinnn" + }, + "scripts": { + "build": "node --strong_mode build.js", + "lint": "eslint --config @shinnn/node --env browser --ignore-path .gitignore .", + "pretest": "${npm_package_scripts_build} && ${npm_package_scripts_lint}", + "test": "node --strong_mode test.js | tap-spec", + "coverage": "node --strong_mode node_modules/.bin/istanbul cover test.js" + }, + "license": "Unlicense", + "main": "spdx-license-ids.json", + "files": [ + "spdx-license-ids.json" + ], + "keywords": [ + "spdx", + "license", + "licenses", + "id", + "identifier", + "identifiers", + "json", + "array", + "oss", + "browser", + "client-side" + ], + "devDependencies": { + "@shinnn/eslint-config-node": "^3.0.0", + "chalk": "^1.1.3", + "eslint": "^3.1.1", + "get-spdx-license-ids": "^1.0.0", + "istanbul": "^0.4.4", + "loud-rejection": "^1.6.0", + "rimraf-promise": "^2.0.0", + "stringify-object": "^2.4.0", + "tap-spec": "^4.1.1", + "tape": "^4.6.0", + "write-file-atomically": "1.0.0" + }, + "gitHead": "70e2541bf04b4fbef4c5df52c581a1861fd355b2", + "bugs": { + "url": "https://github.com/shinnn/spdx-license-ids/issues" + }, + "homepage": "https://github.com/shinnn/spdx-license-ids#readme", + "_id": "spdx-license-ids@1.2.2", + "_shasum": "c9df7a3424594ade6bd11900d596696dc06bac57", + "_from": "spdx-license-ids@1.2.2", + "_npmVersion": "3.10.5", + "_nodeVersion": "6.3.0", + "_npmUser": { + "name": "shinnn", + "email": "snnskwtnb@gmail.com" + }, + "dist": { + "shasum": "c9df7a3424594ade6bd11900d596696dc06bac57", + "tarball": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz" + }, + "maintainers": [ + { + "name": "shinnn", + "email": "snnskwtnb@gmail.com" + } + ], + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/spdx-license-ids-1.2.2.tgz_1469529975605_0.35518706892617047" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/spdx-license-ids/spdx-license-ids.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/spdx-license-ids/spdx-license-ids.json new file mode 100644 index 00000000..1c60d6ee --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/spdx-license-ids/spdx-license-ids.json @@ -0,0 +1,334 @@ +[ + "Glide", + "Abstyles", + "AFL-1.1", + "AFL-1.2", + "AFL-2.0", + "AFL-2.1", + "AFL-3.0", + "AMPAS", + "APL-1.0", + "Adobe-Glyph", + "APAFML", + "Adobe-2006", + "AGPL-1.0", + "Afmparse", + "Aladdin", + "ADSL", + "AMDPLPA", + "ANTLR-PD", + "Apache-1.0", + "Apache-1.1", + "Apache-2.0", + "AML", + "APSL-1.0", + "APSL-1.1", + "APSL-1.2", + "APSL-2.0", + "Artistic-1.0", + "Artistic-1.0-Perl", + "Artistic-1.0-cl8", + "Artistic-2.0", + "AAL", + "Bahyph", + "Barr", + "Beerware", + "BitTorrent-1.0", + "BitTorrent-1.1", + "BSL-1.0", + "Borceux", + "BSD-2-Clause", + "BSD-2-Clause-FreeBSD", + "BSD-2-Clause-NetBSD", + "BSD-3-Clause", + "BSD-3-Clause-Clear", + "BSD-4-Clause", + "BSD-Protection", + "BSD-Source-Code", + "BSD-3-Clause-Attribution", + "0BSD", + "BSD-4-Clause-UC", + "bzip2-1.0.5", + "bzip2-1.0.6", + "Caldera", + "CECILL-1.0", + "CECILL-1.1", + "CECILL-2.0", + "CECILL-2.1", + "CECILL-B", + "CECILL-C", + "ClArtistic", + "MIT-CMU", + "CNRI-Jython", + "CNRI-Python", + "CNRI-Python-GPL-Compatible", + "CPOL-1.02", + "CDDL-1.0", + "CDDL-1.1", + "CPAL-1.0", + "CPL-1.0", + "CATOSL-1.1", + "Condor-1.1", + "CC-BY-1.0", + "CC-BY-2.0", + "CC-BY-2.5", + "CC-BY-3.0", + "CC-BY-4.0", + "CC-BY-ND-1.0", + "CC-BY-ND-2.0", + "CC-BY-ND-2.5", + "CC-BY-ND-3.0", + "CC-BY-ND-4.0", + "CC-BY-NC-1.0", + "CC-BY-NC-2.0", + "CC-BY-NC-2.5", + "CC-BY-NC-3.0", + "CC-BY-NC-4.0", + "CC-BY-NC-ND-1.0", + "CC-BY-NC-ND-2.0", + "CC-BY-NC-ND-2.5", + "CC-BY-NC-ND-3.0", + "CC-BY-NC-ND-4.0", + "CC-BY-NC-SA-1.0", + "CC-BY-NC-SA-2.0", + "CC-BY-NC-SA-2.5", + "CC-BY-NC-SA-3.0", + "CC-BY-NC-SA-4.0", + "CC-BY-SA-1.0", + "CC-BY-SA-2.0", + "CC-BY-SA-2.5", + "CC-BY-SA-3.0", + "CC-BY-SA-4.0", + "CC0-1.0", + "Crossword", + "CrystalStacker", + "CUA-OPL-1.0", + "Cube", + "curl", + "D-FSL-1.0", + "diffmark", + "WTFPL", + "DOC", + "Dotseqn", + "DSDP", + "dvipdfm", + "EPL-1.0", + "ECL-1.0", + "ECL-2.0", + "eGenix", + "EFL-1.0", + "EFL-2.0", + "MIT-advertising", + "MIT-enna", + "Entessa", + "ErlPL-1.1", + "EUDatagrid", + "EUPL-1.0", + "EUPL-1.1", + "Eurosym", + "Fair", + "MIT-feh", + "Frameworx-1.0", + "FreeImage", + "FTL", + "FSFAP", + "FSFUL", + "FSFULLR", + "Giftware", + "GL2PS", + "Glulxe", + "AGPL-3.0", + "GFDL-1.1", + "GFDL-1.2", + "GFDL-1.3", + "GPL-1.0", + "GPL-2.0", + "GPL-3.0", + "LGPL-2.1", + "LGPL-3.0", + "LGPL-2.0", + "gnuplot", + "gSOAP-1.3b", + "HaskellReport", + "HPND", + "IBM-pibs", + "IPL-1.0", + "ICU", + "ImageMagick", + "iMatix", + "Imlib2", + "IJG", + "Info-ZIP", + "Intel-ACPI", + "Intel", + "Interbase-1.0", + "IPA", + "ISC", + "JasPer-2.0", + "JSON", + "LPPL-1.0", + "LPPL-1.1", + "LPPL-1.2", + "LPPL-1.3a", + "LPPL-1.3c", + "Latex2e", + "BSD-3-Clause-LBNL", + "Leptonica", + "LGPLLR", + "Libpng", + "libtiff", + "LAL-1.2", + "LAL-1.3", + "LiLiQ-P-1.1", + "LiLiQ-Rplus-1.1", + "LiLiQ-R-1.1", + "LPL-1.02", + "LPL-1.0", + "MakeIndex", + "MTLL", + "MS-PL", + "MS-RL", + "MirOS", + "MITNFA", + "MIT", + "Motosoto", + "MPL-1.0", + "MPL-1.1", + "MPL-2.0", + "MPL-2.0-no-copyleft-exception", + "mpich2", + "Multics", + "Mup", + "NASA-1.3", + "Naumen", + "NBPL-1.0", + "NetCDF", + "NGPL", + "NOSL", + "NPL-1.0", + "NPL-1.1", + "Newsletr", + "NLPL", + "Nokia", + "NPOSL-3.0", + "NLOD-1.0", + "Noweb", + "NRL", + "NTP", + "Nunit", + "OCLC-2.0", + "ODbL-1.0", + "PDDL-1.0", + "OCCT-PL", + "OGTSL", + "OLDAP-2.2.2", + "OLDAP-1.1", + "OLDAP-1.2", + "OLDAP-1.3", + "OLDAP-1.4", + "OLDAP-2.0", + "OLDAP-2.0.1", + "OLDAP-2.1", + "OLDAP-2.2", + "OLDAP-2.2.1", + "OLDAP-2.3", + "OLDAP-2.4", + "OLDAP-2.5", + "OLDAP-2.6", + "OLDAP-2.7", + "OLDAP-2.8", + "OML", + "OPL-1.0", + "OSL-1.0", + "OSL-1.1", + "OSL-2.0", + "OSL-2.1", + "OSL-3.0", + "OpenSSL", + "OSET-PL-2.1", + "PHP-3.0", + "PHP-3.01", + "Plexus", + "PostgreSQL", + "psfrag", + "psutils", + "Python-2.0", + "QPL-1.0", + "Qhull", + "Rdisc", + "RPSL-1.0", + "RPL-1.1", + "RPL-1.5", + "RHeCos-1.1", + "RSCPL", + "RSA-MD", + "Ruby", + "SAX-PD", + "Saxpath", + "SCEA", + "SWL", + "SMPPL", + "Sendmail", + "SGI-B-1.0", + "SGI-B-1.1", + "SGI-B-2.0", + "OFL-1.0", + "OFL-1.1", + "SimPL-2.0", + "Sleepycat", + "SNIA", + "Spencer-86", + "Spencer-94", + "Spencer-99", + "SMLNJ", + "SugarCRM-1.1.3", + "SISSL", + "SISSL-1.2", + "SPL-1.0", + "Watcom-1.0", + "TCL", + "Unlicense", + "TMate", + "TORQUE-1.1", + "TOSL", + "Unicode-TOU", + "UPL-1.0", + "NCSA", + "Vim", + "VOSTROM", + "VSL-1.0", + "W3C-19980720", + "W3C", + "Wsuipa", + "Xnet", + "X11", + "Xerox", + "XFree86-1.1", + "xinetd", + "xpp", + "XSkat", + "YPL-1.0", + "YPL-1.1", + "Zed", + "Zend-2.0", + "Zimbra-1.3", + "Zimbra-1.4", + "Zlib", + "zlib-acknowledgement", + "ZPL-1.1", + "ZPL-2.0", + "ZPL-2.1", + "BSD-3-Clause-No-Nuclear-License", + "BSD-3-Clause-No-Nuclear-Warranty", + "BSD-3-Clause-No-Nuclear-License-2014", + "eCos-2.0", + "GPL-2.0-with-autoconf-exception", + "GPL-2.0-with-bison-exception", + "GPL-2.0-with-classpath-exception", + "GPL-2.0-with-font-exception", + "GPL-2.0-with-GCC-exception", + "GPL-3.0-with-autoconf-exception", + "GPL-3.0-with-GCC-exception", + "StandardML-NJ", + "WXwindows" +] diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/strip-ansi/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/strip-ansi/index.js new file mode 100644 index 00000000..099480fb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/strip-ansi/index.js @@ -0,0 +1,6 @@ +'use strict'; +var ansiRegex = require('ansi-regex')(); + +module.exports = function (str) { + return typeof str === 'string' ? str.replace(ansiRegex, '') : str; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/strip-ansi/license b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/strip-ansi/license new file mode 100644 index 00000000..654d0bfe --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/strip-ansi/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/strip-ansi/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/strip-ansi/package.json new file mode 100644 index 00000000..32e04f05 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/strip-ansi/package.json @@ -0,0 +1,90 @@ +{ + "name": "strip-ansi", + "version": "3.0.1", + "description": "Strip ANSI escape codes", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/strip-ansi.git" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "jbnicolai", + "email": "jappelman@xebia.com" + } + ], + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js" + ], + "keywords": [ + "strip", + "trim", + "remove", + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "gitHead": "8270705c704956da865623e564eba4875c3ea17f", + "bugs": { + "url": "https://github.com/chalk/strip-ansi/issues" + }, + "homepage": "https://github.com/chalk/strip-ansi", + "_id": "strip-ansi@3.0.1", + "_shasum": "6a385fb8853d952d5ff05d0e8aaf94278dc63dcf", + "_from": "strip-ansi@*", + "_npmVersion": "2.11.3", + "_nodeVersion": "0.12.7", + "_npmUser": { + "name": "jbnicolai", + "email": "jappelman@xebia.com" + }, + "dist": { + "shasum": "6a385fb8853d952d5ff05d0e8aaf94278dc63dcf", + "tarball": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz" + }, + "_npmOperationalInternal": { + "host": "packages-9-west.internal.npmjs.com", + "tmp": "tmp/strip-ansi-3.0.1.tgz_1456057278183_0.28958667791448534" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/strip-ansi/readme.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/strip-ansi/readme.md new file mode 100644 index 00000000..cb7d9ff7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/strip-ansi/readme.md @@ -0,0 +1,33 @@ +# strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi) + +> Strip [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) + + +## Install + +``` +$ npm install --save strip-ansi +``` + + +## Usage + +```js +var stripAnsi = require('strip-ansi'); + +stripAnsi('\u001b[4mcake\u001b[0m'); +//=> 'cake' +``` + + +## Related + +- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module +- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes +- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes +- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/.npmignore new file mode 100644 index 00000000..c167ad5b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/.npmignore @@ -0,0 +1,5 @@ +.*.swp +node_modules +examples/extract/ +test/tmp/ +test/fixtures/ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/.travis.yml new file mode 100644 index 00000000..fca8ef01 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.10 + - 0.11 diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/LICENSE new file mode 100644 index 00000000..019b7e40 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/LICENSE @@ -0,0 +1,12 @@ +The ISC License +Copyright (c) Isaac Z. Schlueter and Contributors +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/README.md new file mode 100644 index 00000000..cfda2ac1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/README.md @@ -0,0 +1,50 @@ +# node-tar + +Tar for Node.js. + +[![NPM](https://nodei.co/npm/tar.png)](https://nodei.co/npm/tar/) + +## API + +See `examples/` for usage examples. + +### var tar = require('tar') + +Returns an object with `.Pack`, `.Extract` and `.Parse` methods. + +### tar.Pack([properties]) + +Returns a through stream. Use +[fstream](https://npmjs.org/package/fstream) to write files into the +pack stream and you will receive tar archive data from the pack +stream. + +This only works with directories, it does not work with individual files. + +The optional `properties` object are used to set properties in the tar +'Global Extended Header'. If the `fromBase` property is set to true, +the tar will contain files relative to the path passed, and not with +the path included. + +### tar.Extract([options]) + +Returns a through stream. Write tar data to the stream and the files +in the tarball will be extracted onto the filesystem. + +`options` can be: + +```js +{ + path: '/path/to/extract/tar/into', + strip: 0, // how many path segments to strip from the root when extracting +} +``` + +`options` also get passed to the `fstream.Writer` instance that `tar` +uses internally. + +### tar.Parse() + +Returns a writable stream. Write tar data to it and it will emit +`entry` events for each entry parsed from the tarball. This is used by +`tar.Extract`. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/examples/extracter.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/examples/extracter.js new file mode 100644 index 00000000..f6253a72 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/examples/extracter.js @@ -0,0 +1,19 @@ +var tar = require("../tar.js") + , fs = require("fs") + + +function onError(err) { + console.error('An error occurred:', err) +} + +function onEnd() { + console.log('Extracted!') +} + +var extractor = tar.Extract({path: __dirname + "/extract"}) + .on('error', onError) + .on('end', onEnd); + +fs.createReadStream(__dirname + "/../test/fixtures/c.tar") + .on('error', onError) + .pipe(extractor); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/examples/packer.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/examples/packer.js new file mode 100644 index 00000000..039969ce --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/examples/packer.js @@ -0,0 +1,24 @@ +var tar = require("../tar.js") + , fstream = require("fstream") + , fs = require("fs") + +var dirDest = fs.createWriteStream('dir.tar') + + +function onError(err) { + console.error('An error occurred:', err) +} + +function onEnd() { + console.log('Packed!') +} + +var packer = tar.Pack({ noProprietary: true }) + .on('error', onError) + .on('end', onEnd); + +// This must be a "directory" +fstream.Reader({ path: __dirname, type: "Directory" }) + .on('error', onError) + .pipe(packer) + .pipe(dirDest) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/examples/reader.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/examples/reader.js new file mode 100644 index 00000000..39f3f088 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/examples/reader.js @@ -0,0 +1,36 @@ +var tar = require("../tar.js") + , fs = require("fs") + +fs.createReadStream(__dirname + "/../test/fixtures/c.tar") + .pipe(tar.Parse()) + .on("extendedHeader", function (e) { + console.error("extended pax header", e.props) + e.on("end", function () { + console.error("extended pax fields:", e.fields) + }) + }) + .on("ignoredEntry", function (e) { + console.error("ignoredEntry?!?", e.props) + }) + .on("longLinkpath", function (e) { + console.error("longLinkpath entry", e.props) + e.on("end", function () { + console.error("value=%j", e.body.toString()) + }) + }) + .on("longPath", function (e) { + console.error("longPath entry", e.props) + e.on("end", function () { + console.error("value=%j", e.body.toString()) + }) + }) + .on("entry", function (e) { + console.error("entry", e.props) + e.on("data", function (c) { + console.error(" >>>" + c.toString().replace(/\n/g, "\\n")) + }) + e.on("end", function () { + console.error(" << 0 + return !this._needDrain +} + +EntryWriter.prototype.end = function (c) { + // console.error(".. ew end") + if (c) this._buffer.push(c) + this._buffer.push(EOF) + this._ended = true + this._process() + this._needDrain = this._buffer.length > 0 +} + +EntryWriter.prototype.pause = function () { + // console.error(".. ew pause") + this._paused = true + this.emit("pause") +} + +EntryWriter.prototype.resume = function () { + // console.error(".. ew resume") + this._paused = false + this.emit("resume") + this._process() +} + +EntryWriter.prototype.add = function (entry) { + // console.error(".. ew add") + if (!this.parent) return this.emit("error", new Error("no parent")) + + // make sure that the _header and such is emitted, and clear out + // the _currentEntry link on the parent. + if (!this._ended) this.end() + + return this.parent.add(entry) +} + +EntryWriter.prototype._header = function () { + // console.error(".. ew header") + if (this._didHeader) return + this._didHeader = true + + var headerBlock = TarHeader.encode(this.props) + + if (this.props.needExtended && !this._meta) { + var me = this + + ExtendedHeaderWriter = ExtendedHeaderWriter || + require("./extended-header-writer.js") + + ExtendedHeaderWriter(this.props) + .on("data", function (c) { + me.emit("data", c) + }) + .on("error", function (er) { + me.emit("error", er) + }) + .end() + } + + // console.error(".. .. ew headerBlock emitting") + this.emit("data", headerBlock) + this.emit("header") +} + +EntryWriter.prototype._process = function () { + // console.error(".. .. ew process") + if (!this._didHeader && !this._meta) { + this._header() + } + + if (this._paused || this._processing) { + // console.error(".. .. .. paused=%j, processing=%j", this._paused, this._processing) + return + } + + this._processing = true + + var buf = this._buffer + for (var i = 0; i < buf.length; i ++) { + // console.error(".. .. .. i=%d", i) + + var c = buf[i] + + if (c === EOF) this._stream.end() + else this._stream.write(c) + + if (this._paused) { + // console.error(".. .. .. paused mid-emission") + this._processing = false + if (i < buf.length) { + this._needDrain = true + this._buffer = buf.slice(i + 1) + } + return + } + } + + // console.error(".. .. .. emitted") + this._buffer.length = 0 + this._processing = false + + // console.error(".. .. .. emitting drain") + this.emit("drain") +} + +EntryWriter.prototype.destroy = function () {} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/lib/entry.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/lib/entry.js new file mode 100644 index 00000000..5f5dd3c2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/lib/entry.js @@ -0,0 +1,220 @@ +// A passthrough read/write stream that sets its properties +// based on a header, extendedHeader, and globalHeader +// +// Can be either a file system object of some sort, or +// a pax/ustar metadata entry. + +module.exports = Entry + +var TarHeader = require("./header.js") + , tar = require("../tar") + , assert = require("assert").ok + , Stream = require("stream").Stream + , inherits = require("inherits") + , fstream = require("fstream").Abstract + +function Entry (header, extended, global) { + Stream.call(this) + this.readable = true + this.writable = true + + this._needDrain = false + this._paused = false + this._reading = false + this._ending = false + this._ended = false + this._remaining = 0 + this._abort = false + this._queue = [] + this._index = 0 + this._queueLen = 0 + + this._read = this._read.bind(this) + + this.props = {} + this._header = header + this._extended = extended || {} + + // globals can change throughout the course of + // a file parse operation. Freeze it at its current state. + this._global = {} + var me = this + Object.keys(global || {}).forEach(function (g) { + me._global[g] = global[g] + }) + + this._setProps() +} + +inherits(Entry, Stream) + +Entry.prototype.write = function (c) { + if (this._ending) this.error("write() after end()", null, true) + if (this._remaining === 0) { + this.error("invalid bytes past eof") + } + + // often we'll get a bunch of \0 at the end of the last write, + // since chunks will always be 512 bytes when reading a tarball. + if (c.length > this._remaining) { + c = c.slice(0, this._remaining) + } + this._remaining -= c.length + + // put it on the stack. + var ql = this._queueLen + this._queue.push(c) + this._queueLen ++ + + this._read() + + // either paused, or buffered + if (this._paused || ql > 0) { + this._needDrain = true + return false + } + + return true +} + +Entry.prototype.end = function (c) { + if (c) this.write(c) + this._ending = true + this._read() +} + +Entry.prototype.pause = function () { + this._paused = true + this.emit("pause") +} + +Entry.prototype.resume = function () { + // console.error(" Tar Entry resume", this.path) + this.emit("resume") + this._paused = false + this._read() + return this._queueLen - this._index > 1 +} + + // This is bound to the instance +Entry.prototype._read = function () { + // console.error(" Tar Entry _read", this.path) + + if (this._paused || this._reading || this._ended) return + + // set this flag so that event handlers don't inadvertently + // get multiple _read() calls running. + this._reading = true + + // have any data to emit? + while (this._index < this._queueLen && !this._paused) { + var chunk = this._queue[this._index ++] + this.emit("data", chunk) + } + + // check if we're drained + if (this._index >= this._queueLen) { + this._queue.length = this._queueLen = this._index = 0 + if (this._needDrain) { + this._needDrain = false + this.emit("drain") + } + if (this._ending) { + this._ended = true + this.emit("end") + } + } + + // if the queue gets too big, then pluck off whatever we can. + // this should be fairly rare. + var mql = this._maxQueueLen + if (this._queueLen > mql && this._index > 0) { + mql = Math.min(this._index, mql) + this._index -= mql + this._queueLen -= mql + this._queue = this._queue.slice(mql) + } + + this._reading = false +} + +Entry.prototype._setProps = function () { + // props = extended->global->header->{} + var header = this._header + , extended = this._extended + , global = this._global + , props = this.props + + // first get the values from the normal header. + var fields = tar.fields + for (var f = 0; fields[f] !== null; f ++) { + var field = fields[f] + , val = header[field] + if (typeof val !== "undefined") props[field] = val + } + + // next, the global header for this file. + // numeric values, etc, will have already been parsed. + ;[global, extended].forEach(function (p) { + Object.keys(p).forEach(function (f) { + if (typeof p[f] !== "undefined") props[f] = p[f] + }) + }) + + // no nulls allowed in path or linkpath + ;["path", "linkpath"].forEach(function (p) { + if (props.hasOwnProperty(p)) { + props[p] = props[p].split("\0")[0] + } + }) + + + // set date fields to be a proper date + ;["mtime", "ctime", "atime"].forEach(function (p) { + if (props.hasOwnProperty(p)) { + props[p] = new Date(props[p] * 1000) + } + }) + + // set the type so that we know what kind of file to create + var type + switch (tar.types[props.type]) { + case "OldFile": + case "ContiguousFile": + type = "File" + break + + case "GNUDumpDir": + type = "Directory" + break + + case undefined: + type = "Unknown" + break + + case "Link": + case "SymbolicLink": + case "CharacterDevice": + case "BlockDevice": + case "Directory": + case "FIFO": + default: + type = tar.types[props.type] + } + + this.type = type + this.path = props.path + this.size = props.size + + // size is special, since it signals when the file needs to end. + this._remaining = props.size +} + +// the parser may not call write if _abort is true. +// useful for skipping data from some files quickly. +Entry.prototype.abort = function(){ + this._abort = true +} + +Entry.prototype.warn = fstream.warn +Entry.prototype.error = fstream.error diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/lib/extended-header-writer.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/lib/extended-header-writer.js new file mode 100644 index 00000000..1728c458 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/lib/extended-header-writer.js @@ -0,0 +1,191 @@ + +module.exports = ExtendedHeaderWriter + +var inherits = require("inherits") + , EntryWriter = require("./entry-writer.js") + +inherits(ExtendedHeaderWriter, EntryWriter) + +var tar = require("../tar.js") + , path = require("path") + , TarHeader = require("./header.js") + +// props is the props of the thing we need to write an +// extended header for. +// Don't be shy with it. Just encode everything. +function ExtendedHeaderWriter (props) { + // console.error(">> ehw ctor") + var me = this + + if (!(me instanceof ExtendedHeaderWriter)) { + return new ExtendedHeaderWriter(props) + } + + me.fields = props + + var p = + { path : ("PaxHeader" + path.join("/", props.path || "")) + .replace(/\\/g, "/").substr(0, 100) + , mode : props.mode || 0666 + , uid : props.uid || 0 + , gid : props.gid || 0 + , size : 0 // will be set later + , mtime : props.mtime || Date.now() / 1000 + , type : "x" + , linkpath : "" + , ustar : "ustar\0" + , ustarver : "00" + , uname : props.uname || "" + , gname : props.gname || "" + , devmaj : props.devmaj || 0 + , devmin : props.devmin || 0 + } + + + EntryWriter.call(me, p) + // console.error(">> ehw props", me.props) + me.props = p + + me._meta = true +} + +ExtendedHeaderWriter.prototype.end = function () { + // console.error(">> ehw end") + var me = this + + if (me._ended) return + me._ended = true + + me._encodeFields() + + if (me.props.size === 0) { + // nothing to write! + me._ready = true + me._stream.end() + return + } + + me._stream.write(TarHeader.encode(me.props)) + me.body.forEach(function (l) { + me._stream.write(l) + }) + me._ready = true + + // console.error(">> ehw _process calling end()", me.props) + this._stream.end() +} + +ExtendedHeaderWriter.prototype._encodeFields = function () { + // console.error(">> ehw _encodeFields") + this.body = [] + if (this.fields.prefix) { + this.fields.path = this.fields.prefix + "/" + this.fields.path + this.fields.prefix = "" + } + encodeFields(this.fields, "", this.body, this.fields.noProprietary) + var me = this + this.body.forEach(function (l) { + me.props.size += l.length + }) +} + +function encodeFields (fields, prefix, body, nop) { + // console.error(">> >> ehw encodeFields") + // "%d %s=%s\n", , , + // The length is a decimal number, and includes itself and the \n + // Numeric values are decimal strings. + + Object.keys(fields).forEach(function (k) { + var val = fields[k] + , numeric = tar.numeric[k] + + if (prefix) k = prefix + "." + k + + // already including NODETAR.type, don't need File=true also + if (k === fields.type && val === true) return + + switch (k) { + // don't include anything that's always handled just fine + // in the normal header, or only meaningful in the context + // of nodetar + case "mode": + case "cksum": + case "ustar": + case "ustarver": + case "prefix": + case "basename": + case "dirname": + case "needExtended": + case "block": + case "filter": + return + + case "rdev": + if (val === 0) return + break + + case "nlink": + case "dev": // Truly a hero among men, Creator of Star! + case "ino": // Speak his name with reverent awe! It is: + k = "SCHILY." + k + break + + default: break + } + + if (val && typeof val === "object" && + !Buffer.isBuffer(val)) encodeFields(val, k, body, nop) + else if (val === null || val === undefined) return + else body.push.apply(body, encodeField(k, val, nop)) + }) + + return body +} + +function encodeField (k, v, nop) { + // lowercase keys must be valid, otherwise prefix with + // "NODETAR." + if (k.charAt(0) === k.charAt(0).toLowerCase()) { + var m = k.split(".")[0] + if (!tar.knownExtended[m]) k = "NODETAR." + k + } + + // no proprietary + if (nop && k.charAt(0) !== k.charAt(0).toLowerCase()) { + return [] + } + + if (typeof val === "number") val = val.toString(10) + + var s = new Buffer(" " + k + "=" + v + "\n") + , digits = Math.floor(Math.log(s.length) / Math.log(10)) + 1 + + // console.error("1 s=%j digits=%j s.length=%d", s.toString(), digits, s.length) + + // if adding that many digits will make it go over that length, + // then add one to it. For example, if the string is: + // " foo=bar\n" + // then that's 9 characters. With the "9", that bumps the length + // up to 10. However, this is invalid: + // "10 foo=bar\n" + // but, since that's actually 11 characters, since 10 adds another + // character to the length, and the length includes the number + // itself. In that case, just bump it up again. + if (s.length + digits >= Math.pow(10, digits)) digits += 1 + // console.error("2 s=%j digits=%j s.length=%d", s.toString(), digits, s.length) + + var len = digits + s.length + // console.error("3 s=%j digits=%j s.length=%d len=%d", s.toString(), digits, s.length, len) + var lenBuf = new Buffer("" + len) + if (lenBuf.length + s.length !== len) { + throw new Error("Bad length calculation\n"+ + "len="+len+"\n"+ + "lenBuf="+JSON.stringify(lenBuf.toString())+"\n"+ + "lenBuf.length="+lenBuf.length+"\n"+ + "digits="+digits+"\n"+ + "s="+JSON.stringify(s.toString())+"\n"+ + "s.length="+s.length) + } + + return [lenBuf, s] +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/lib/extended-header.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/lib/extended-header.js new file mode 100644 index 00000000..74f432ce --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/lib/extended-header.js @@ -0,0 +1,140 @@ +// An Entry consisting of: +// +// "%d %s=%s\n", , , +// +// The length is a decimal number, and includes itself and the \n +// \0 does not terminate anything. Only the length terminates the string. +// Numeric values are decimal strings. + +module.exports = ExtendedHeader + +var Entry = require("./entry.js") + , inherits = require("inherits") + , tar = require("../tar.js") + , numeric = tar.numeric + , keyTrans = { "SCHILY.dev": "dev" + , "SCHILY.ino": "ino" + , "SCHILY.nlink": "nlink" } + +function ExtendedHeader () { + Entry.apply(this, arguments) + this.on("data", this._parse) + this.fields = {} + this._position = 0 + this._fieldPos = 0 + this._state = SIZE + this._sizeBuf = [] + this._keyBuf = [] + this._valBuf = [] + this._size = -1 + this._key = "" +} + +inherits(ExtendedHeader, Entry) +ExtendedHeader.prototype._parse = parse + +var s = 0 + , states = ExtendedHeader.states = {} + , SIZE = states.SIZE = s++ + , KEY = states.KEY = s++ + , VAL = states.VAL = s++ + , ERR = states.ERR = s++ + +Object.keys(states).forEach(function (s) { + states[states[s]] = states[s] +}) + +states[s] = null + +// char code values for comparison +var _0 = "0".charCodeAt(0) + , _9 = "9".charCodeAt(0) + , point = ".".charCodeAt(0) + , a = "a".charCodeAt(0) + , Z = "Z".charCodeAt(0) + , a = "a".charCodeAt(0) + , z = "z".charCodeAt(0) + , space = " ".charCodeAt(0) + , eq = "=".charCodeAt(0) + , cr = "\n".charCodeAt(0) + +function parse (c) { + if (this._state === ERR) return + + for ( var i = 0, l = c.length + ; i < l + ; this._position++, this._fieldPos++, i++) { + // console.error("top of loop, size="+this._size) + + var b = c[i] + + if (this._size >= 0 && this._fieldPos > this._size) { + error(this, "field exceeds length="+this._size) + return + } + + switch (this._state) { + case ERR: return + + case SIZE: + // console.error("parsing size, b=%d, rest=%j", b, c.slice(i).toString()) + if (b === space) { + this._state = KEY + // this._fieldPos = this._sizeBuf.length + this._size = parseInt(new Buffer(this._sizeBuf).toString(), 10) + this._sizeBuf.length = 0 + continue + } + if (b < _0 || b > _9) { + error(this, "expected [" + _0 + ".." + _9 + "], got " + b) + return + } + this._sizeBuf.push(b) + continue + + case KEY: + // can be any char except =, not > size. + if (b === eq) { + this._state = VAL + this._key = new Buffer(this._keyBuf).toString() + if (keyTrans[this._key]) this._key = keyTrans[this._key] + this._keyBuf.length = 0 + continue + } + this._keyBuf.push(b) + continue + + case VAL: + // field must end with cr + if (this._fieldPos === this._size - 1) { + // console.error("finished with "+this._key) + if (b !== cr) { + error(this, "expected \\n at end of field") + return + } + var val = new Buffer(this._valBuf).toString() + if (numeric[this._key]) { + val = parseFloat(val) + } + this.fields[this._key] = val + + this._valBuf.length = 0 + this._state = SIZE + this._size = -1 + this._fieldPos = -1 + continue + } + this._valBuf.push(b) + continue + } + } +} + +function error (me, msg) { + msg = "invalid header: " + msg + + "\nposition=" + me._position + + "\nfield position=" + me._fieldPos + + me.error(msg) + me.state = ERR +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/lib/extract.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/lib/extract.js new file mode 100644 index 00000000..fe1bb976 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/lib/extract.js @@ -0,0 +1,94 @@ +// give it a tarball and a path, and it'll dump the contents + +module.exports = Extract + +var tar = require("../tar.js") + , fstream = require("fstream") + , inherits = require("inherits") + , path = require("path") + +function Extract (opts) { + if (!(this instanceof Extract)) return new Extract(opts) + tar.Parse.apply(this) + + if (typeof opts !== "object") { + opts = { path: opts } + } + + // better to drop in cwd? seems more standard. + opts.path = opts.path || path.resolve("node-tar-extract") + opts.type = "Directory" + opts.Directory = true + + // similar to --strip or --strip-components + opts.strip = +opts.strip + if (!opts.strip || opts.strip <= 0) opts.strip = 0 + + this._fst = fstream.Writer(opts) + + this.pause() + var me = this + + // Hardlinks in tarballs are relative to the root + // of the tarball. So, they need to be resolved against + // the target directory in order to be created properly. + me.on("entry", function (entry) { + // if there's a "strip" argument, then strip off that many + // path components. + if (opts.strip) { + var p = entry.path.split("/").slice(opts.strip).join("/") + entry.path = entry.props.path = p + if (entry.linkpath) { + var lp = entry.linkpath.split("/").slice(opts.strip).join("/") + entry.linkpath = entry.props.linkpath = lp + } + } + if (entry.type === "Link") { + entry.linkpath = entry.props.linkpath = + path.join(opts.path, path.join("/", entry.props.linkpath)) + } + + if (entry.type === "SymbolicLink") { + var dn = path.dirname(entry.path) || "" + var linkpath = entry.props.linkpath + var target = path.resolve(opts.path, dn, linkpath) + if (target.indexOf(opts.path) !== 0) { + linkpath = path.join(opts.path, path.join("/", linkpath)) + } + entry.linkpath = entry.props.linkpath = linkpath + } + }) + + this._fst.on("ready", function () { + me.pipe(me._fst, { end: false }) + me.resume() + }) + + this._fst.on('error', function(err) { + me.emit('error', err) + }) + + this._fst.on('drain', function() { + me.emit('drain') + }) + + // this._fst.on("end", function () { + // console.error("\nEEEE Extract End", me._fst.path) + // }) + + this._fst.on("close", function () { + // console.error("\nEEEE Extract End", me._fst.path) + me.emit("finish") + me.emit("end") + me.emit("close") + }) +} + +inherits(Extract, tar.Parse) + +Extract.prototype._streamEnd = function () { + var me = this + if (!me._ended || me._entry) me.error("unexpected eof") + me._fst.end() + // my .end() is coming later. +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/lib/global-header-writer.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/lib/global-header-writer.js new file mode 100644 index 00000000..0bfc7b80 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/lib/global-header-writer.js @@ -0,0 +1,14 @@ +module.exports = GlobalHeaderWriter + +var ExtendedHeaderWriter = require("./extended-header-writer.js") + , inherits = require("inherits") + +inherits(GlobalHeaderWriter, ExtendedHeaderWriter) + +function GlobalHeaderWriter (props) { + if (!(this instanceof GlobalHeaderWriter)) { + return new GlobalHeaderWriter(props) + } + ExtendedHeaderWriter.call(this, props) + this.props.type = "g" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/lib/header.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/lib/header.js new file mode 100644 index 00000000..05b237c0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/lib/header.js @@ -0,0 +1,385 @@ +// parse a 512-byte header block to a data object, or vice-versa +// If the data won't fit nicely in a simple header, then generate +// the appropriate extended header file, and return that. + +module.exports = TarHeader + +var tar = require("../tar.js") + , fields = tar.fields + , fieldOffs = tar.fieldOffs + , fieldEnds = tar.fieldEnds + , fieldSize = tar.fieldSize + , numeric = tar.numeric + , assert = require("assert").ok + , space = " ".charCodeAt(0) + , slash = "/".charCodeAt(0) + , bslash = process.platform === "win32" ? "\\".charCodeAt(0) : null + +function TarHeader (block) { + if (!(this instanceof TarHeader)) return new TarHeader(block) + if (block) this.decode(block) +} + +TarHeader.prototype = + { decode : decode + , encode: encode + , calcSum: calcSum + , checkSum: checkSum + } + +TarHeader.parseNumeric = parseNumeric +TarHeader.encode = encode +TarHeader.decode = decode + +// note that this will only do the normal ustar header, not any kind +// of extended posix header file. If something doesn't fit comfortably, +// then it will set obj.needExtended = true, and set the block to +// the closest approximation. +function encode (obj) { + if (!obj && !(this instanceof TarHeader)) throw new Error( + "encode must be called on a TarHeader, or supplied an object") + + obj = obj || this + var block = obj.block = new Buffer(512) + + // if the object has a "prefix", then that's actually an extension of + // the path field. + if (obj.prefix) { + // console.error("%% header encoding, got a prefix", obj.prefix) + obj.path = obj.prefix + "/" + obj.path + // console.error("%% header encoding, prefixed path", obj.path) + obj.prefix = "" + } + + obj.needExtended = false + + if (obj.mode) { + if (typeof obj.mode === "string") obj.mode = parseInt(obj.mode, 8) + obj.mode = obj.mode & 0777 + } + + for (var f = 0; fields[f] !== null; f ++) { + var field = fields[f] + , off = fieldOffs[f] + , end = fieldEnds[f] + , ret + + switch (field) { + case "cksum": + // special, done below, after all the others + break + + case "prefix": + // special, this is an extension of the "path" field. + // console.error("%% header encoding, skip prefix later") + break + + case "type": + // convert from long name to a single char. + var type = obj.type || "0" + if (type.length > 1) { + type = tar.types[obj.type] + if (!type) type = "0" + } + writeText(block, off, end, type) + break + + case "path": + // uses the "prefix" field if > 100 bytes, but <= 255 + var pathLen = Buffer.byteLength(obj.path) + , pathFSize = fieldSize[fields.path] + , prefFSize = fieldSize[fields.prefix] + + // paths between 100 and 255 should use the prefix field. + // longer than 255 + if (pathLen > pathFSize && + pathLen <= pathFSize + prefFSize) { + // need to find a slash somewhere in the middle so that + // path and prefix both fit in their respective fields + var searchStart = pathLen - 1 - pathFSize + , searchEnd = prefFSize + , found = false + , pathBuf = new Buffer(obj.path) + + for ( var s = searchStart + ; (s <= searchEnd) + ; s ++ ) { + if (pathBuf[s] === slash || pathBuf[s] === bslash) { + found = s + break + } + } + + if (found !== false) { + prefix = pathBuf.slice(0, found).toString("utf8") + path = pathBuf.slice(found + 1).toString("utf8") + + ret = writeText(block, off, end, path) + off = fieldOffs[fields.prefix] + end = fieldEnds[fields.prefix] + // console.error("%% header writing prefix", off, end, prefix) + ret = writeText(block, off, end, prefix) || ret + break + } + } + + // paths less than 100 chars don't need a prefix + // and paths longer than 255 need an extended header and will fail + // on old implementations no matter what we do here. + // Null out the prefix, and fallthrough to default. + // console.error("%% header writing no prefix") + var poff = fieldOffs[fields.prefix] + , pend = fieldEnds[fields.prefix] + writeText(block, poff, pend, "") + // fallthrough + + // all other fields are numeric or text + default: + ret = numeric[field] + ? writeNumeric(block, off, end, obj[field]) + : writeText(block, off, end, obj[field] || "") + break + } + obj.needExtended = obj.needExtended || ret + } + + var off = fieldOffs[fields.cksum] + , end = fieldEnds[fields.cksum] + + writeNumeric(block, off, end, calcSum.call(this, block)) + + return block +} + +// if it's a negative number, or greater than will fit, +// then use write256. +var MAXNUM = { 12: 077777777777 + , 11: 07777777777 + , 8 : 07777777 + , 7 : 0777777 } +function writeNumeric (block, off, end, num) { + var writeLen = end - off + , maxNum = MAXNUM[writeLen] || 0 + + num = num || 0 + // console.error(" numeric", num) + + if (num instanceof Date || + Object.prototype.toString.call(num) === "[object Date]") { + num = num.getTime() / 1000 + } + + if (num > maxNum || num < 0) { + write256(block, off, end, num) + // need an extended header if negative or too big. + return true + } + + // god, tar is so annoying + // if the string is small enough, you should put a space + // between the octal string and the \0, but if it doesn't + // fit, then don't. + var numStr = Math.floor(num).toString(8) + if (num < MAXNUM[writeLen - 1]) numStr += " " + + // pad with "0" chars + if (numStr.length < writeLen) { + numStr = (new Array(writeLen - numStr.length).join("0")) + numStr + } + + if (numStr.length !== writeLen - 1) { + throw new Error("invalid length: " + JSON.stringify(numStr) + "\n" + + "expected: "+writeLen) + } + block.write(numStr, off, writeLen, "utf8") + block[end - 1] = 0 +} + +function write256 (block, off, end, num) { + var buf = block.slice(off, end) + var positive = num >= 0 + buf[0] = positive ? 0x80 : 0xFF + + // get the number as a base-256 tuple + if (!positive) num *= -1 + var tuple = [] + do { + var n = num % 256 + tuple.push(n) + num = (num - n) / 256 + } while (num) + + var bytes = tuple.length + + var fill = buf.length - bytes + for (var i = 1; i < fill; i ++) { + buf[i] = positive ? 0 : 0xFF + } + + // tuple is a base256 number, with [0] as the *least* significant byte + // if it's negative, then we need to flip all the bits once we hit the + // first non-zero bit. The 2's-complement is (0x100 - n), and the 1's- + // complement is (0xFF - n). + var zero = true + for (i = bytes; i > 0; i --) { + var byte = tuple[bytes - i] + if (positive) buf[fill + i] = byte + else if (zero && byte === 0) buf[fill + i] = 0 + else if (zero) { + zero = false + buf[fill + i] = 0x100 - byte + } else buf[fill + i] = 0xFF - byte + } +} + +function writeText (block, off, end, str) { + // strings are written as utf8, then padded with \0 + var strLen = Buffer.byteLength(str) + , writeLen = Math.min(strLen, end - off) + // non-ascii fields need extended headers + // long fields get truncated + , needExtended = strLen !== str.length || strLen > writeLen + + // write the string, and null-pad + if (writeLen > 0) block.write(str, off, writeLen, "utf8") + for (var i = off + writeLen; i < end; i ++) block[i] = 0 + + return needExtended +} + +function calcSum (block) { + block = block || this.block + assert(Buffer.isBuffer(block) && block.length === 512) + + if (!block) throw new Error("Need block to checksum") + + // now figure out what it would be if the cksum was " " + var sum = 0 + , start = fieldOffs[fields.cksum] + , end = fieldEnds[fields.cksum] + + for (var i = 0; i < fieldOffs[fields.cksum]; i ++) { + sum += block[i] + } + + for (var i = start; i < end; i ++) { + sum += space + } + + for (var i = end; i < 512; i ++) { + sum += block[i] + } + + return sum +} + + +function checkSum (block) { + var sum = calcSum.call(this, block) + block = block || this.block + + var cksum = block.slice(fieldOffs[fields.cksum], fieldEnds[fields.cksum]) + cksum = parseNumeric(cksum) + + return cksum === sum +} + +function decode (block) { + block = block || this.block + assert(Buffer.isBuffer(block) && block.length === 512) + + this.block = block + this.cksumValid = this.checkSum() + + var prefix = null + + // slice off each field. + for (var f = 0; fields[f] !== null; f ++) { + var field = fields[f] + , val = block.slice(fieldOffs[f], fieldEnds[f]) + + switch (field) { + case "ustar": + // if not ustar, then everything after that is just padding. + if (val.toString() !== "ustar\0") { + this.ustar = false + return + } else { + // console.error("ustar:", val, val.toString()) + this.ustar = val.toString() + } + break + + // prefix is special, since it might signal the xstar header + case "prefix": + var atime = parseNumeric(val.slice(131, 131 + 12)) + , ctime = parseNumeric(val.slice(131 + 12, 131 + 12 + 12)) + if ((val[130] === 0 || val[130] === space) && + typeof atime === "number" && + typeof ctime === "number" && + val[131 + 12] === space && + val[131 + 12 + 12] === space) { + this.atime = atime + this.ctime = ctime + val = val.slice(0, 130) + } + prefix = val.toString("utf8").replace(/\0+$/, "") + // console.error("%% header reading prefix", prefix) + break + + // all other fields are null-padding text + // or a number. + default: + if (numeric[field]) { + this[field] = parseNumeric(val) + } else { + this[field] = val.toString("utf8").replace(/\0+$/, "") + } + break + } + } + + // if we got a prefix, then prepend it to the path. + if (prefix) { + this.path = prefix + "/" + this.path + // console.error("%% header got a prefix", this.path) + } +} + +function parse256 (buf) { + // first byte MUST be either 80 or FF + // 80 for positive, FF for 2's comp + var positive + if (buf[0] === 0x80) positive = true + else if (buf[0] === 0xFF) positive = false + else return null + + // build up a base-256 tuple from the least sig to the highest + var zero = false + , tuple = [] + for (var i = buf.length - 1; i > 0; i --) { + var byte = buf[i] + if (positive) tuple.push(byte) + else if (zero && byte === 0) tuple.push(0) + else if (zero) { + zero = false + tuple.push(0x100 - byte) + } else tuple.push(0xFF - byte) + } + + for (var sum = 0, i = 0, l = tuple.length; i < l; i ++) { + sum += tuple[i] * Math.pow(256, i) + } + + return positive ? sum : -1 * sum +} + +function parseNumeric (f) { + if (f[0] & 0x80) return parse256(f) + + var str = f.toString("utf8").split("\0")[0].trim() + , res = parseInt(str, 8) + + return isNaN(res) ? null : res +} + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/lib/pack.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/lib/pack.js new file mode 100644 index 00000000..5a3bb95a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/lib/pack.js @@ -0,0 +1,236 @@ +// pipe in an fstream, and it'll make a tarball. +// key-value pair argument is global extended header props. + +module.exports = Pack + +var EntryWriter = require("./entry-writer.js") + , Stream = require("stream").Stream + , path = require("path") + , inherits = require("inherits") + , GlobalHeaderWriter = require("./global-header-writer.js") + , collect = require("fstream").collect + , eof = new Buffer(512) + +for (var i = 0; i < 512; i ++) eof[i] = 0 + +inherits(Pack, Stream) + +function Pack (props) { + // console.error("-- p ctor") + var me = this + if (!(me instanceof Pack)) return new Pack(props) + + if (props) me._noProprietary = props.noProprietary + else me._noProprietary = false + + me._global = props + + me.readable = true + me.writable = true + me._buffer = [] + // console.error("-- -- set current to null in ctor") + me._currentEntry = null + me._processing = false + + me._pipeRoot = null + me.on("pipe", function (src) { + if (src.root === me._pipeRoot) return + me._pipeRoot = src + src.on("end", function () { + me._pipeRoot = null + }) + me.add(src) + }) +} + +Pack.prototype.addGlobal = function (props) { + // console.error("-- p addGlobal") + if (this._didGlobal) return + this._didGlobal = true + + var me = this + GlobalHeaderWriter(props) + .on("data", function (c) { + me.emit("data", c) + }) + .end() +} + +Pack.prototype.add = function (stream) { + if (this._global && !this._didGlobal) this.addGlobal(this._global) + + if (this._ended) return this.emit("error", new Error("add after end")) + + collect(stream) + this._buffer.push(stream) + this._process() + this._needDrain = this._buffer.length > 0 + return !this._needDrain +} + +Pack.prototype.pause = function () { + this._paused = true + if (this._currentEntry) this._currentEntry.pause() + this.emit("pause") +} + +Pack.prototype.resume = function () { + this._paused = false + if (this._currentEntry) this._currentEntry.resume() + this.emit("resume") + this._process() +} + +Pack.prototype.end = function () { + this._ended = true + this._buffer.push(eof) + this._process() +} + +Pack.prototype._process = function () { + var me = this + if (me._paused || me._processing) { + return + } + + var entry = me._buffer.shift() + + if (!entry) { + if (me._needDrain) { + me.emit("drain") + } + return + } + + if (entry.ready === false) { + // console.error("-- entry is not ready", entry) + me._buffer.unshift(entry) + entry.on("ready", function () { + // console.error("-- -- ready!", entry) + me._process() + }) + return + } + + me._processing = true + + if (entry === eof) { + // need 2 ending null blocks. + me.emit("data", eof) + me.emit("data", eof) + me.emit("end") + me.emit("close") + return + } + + // Change the path to be relative to the root dir that was + // added to the tarball. + // + // XXX This should be more like how -C works, so you can + // explicitly set a root dir, and also explicitly set a pathname + // in the tarball to use. That way we can skip a lot of extra + // work when resolving symlinks for bundled dependencies in npm. + + var root = path.dirname((entry.root || entry).path); + if (me._global && me._global.fromBase && entry.root && entry.root.path) { + // user set 'fromBase: true' indicating tar root should be directory itself + root = entry.root.path; + } + + var wprops = {} + + Object.keys(entry.props || {}).forEach(function (k) { + wprops[k] = entry.props[k] + }) + + if (me._noProprietary) wprops.noProprietary = true + + wprops.path = path.relative(root, entry.path || '') + + // actually not a matter of opinion or taste. + if (process.platform === "win32") { + wprops.path = wprops.path.replace(/\\/g, "/") + } + + if (!wprops.type) + wprops.type = 'Directory' + + switch (wprops.type) { + // sockets not supported + case "Socket": + return + + case "Directory": + wprops.path += "/" + wprops.size = 0 + break + + case "Link": + var lp = path.resolve(path.dirname(entry.path), entry.linkpath) + wprops.linkpath = path.relative(root, lp) || "." + wprops.size = 0 + break + + case "SymbolicLink": + var lp = path.resolve(path.dirname(entry.path), entry.linkpath) + wprops.linkpath = path.relative(path.dirname(entry.path), lp) || "." + wprops.size = 0 + break + } + + // console.error("-- new writer", wprops) + // if (!wprops.type) { + // // console.error("-- no type?", entry.constructor.name, entry) + // } + + // console.error("-- -- set current to new writer", wprops.path) + var writer = me._currentEntry = EntryWriter(wprops) + + writer.parent = me + + // writer.on("end", function () { + // // console.error("-- -- writer end", writer.path) + // }) + + writer.on("data", function (c) { + me.emit("data", c) + }) + + writer.on("header", function () { + Buffer.prototype.toJSON = function () { + return this.toString().split(/\0/).join(".") + } + // console.error("-- -- writer header %j", writer.props) + if (writer.props.size === 0) nextEntry() + }) + writer.on("close", nextEntry) + + var ended = false + function nextEntry () { + if (ended) return + ended = true + + // console.error("-- -- writer close", writer.path) + // console.error("-- -- set current to null", wprops.path) + me._currentEntry = null + me._processing = false + me._process() + } + + writer.on("error", function (er) { + // console.error("-- -- writer error", writer.path) + me.emit("error", er) + }) + + // if it's the root, then there's no need to add its entries, + // or data, since they'll be added directly. + if (entry === me._pipeRoot) { + // console.error("-- is the root, don't auto-add") + writer.add = null + } + + entry.pipe(writer) +} + +Pack.prototype.destroy = function () {} +Pack.prototype.write = function () {} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/lib/parse.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/lib/parse.js new file mode 100644 index 00000000..600ad782 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/lib/parse.js @@ -0,0 +1,275 @@ + +// A writable stream. +// It emits "entry" events, which provide a readable stream that has +// header info attached. + +module.exports = Parse.create = Parse + +var stream = require("stream") + , Stream = stream.Stream + , BlockStream = require("block-stream") + , tar = require("../tar.js") + , TarHeader = require("./header.js") + , Entry = require("./entry.js") + , BufferEntry = require("./buffer-entry.js") + , ExtendedHeader = require("./extended-header.js") + , assert = require("assert").ok + , inherits = require("inherits") + , fstream = require("fstream") + +// reading a tar is a lot like reading a directory +// However, we're actually not going to run the ctor, +// since it does a stat and various other stuff. +// This inheritance gives us the pause/resume/pipe +// behavior that is desired. +inherits(Parse, fstream.Reader) + +function Parse () { + var me = this + if (!(me instanceof Parse)) return new Parse() + + // doesn't apply fstream.Reader ctor? + // no, becasue we don't want to stat/etc, we just + // want to get the entry/add logic from .pipe() + Stream.apply(me) + + me.writable = true + me.readable = true + me._stream = new BlockStream(512) + me.position = 0 + me._ended = false + + me._stream.on("error", function (e) { + me.emit("error", e) + }) + + me._stream.on("data", function (c) { + me._process(c) + }) + + me._stream.on("end", function () { + me._streamEnd() + }) + + me._stream.on("drain", function () { + me.emit("drain") + }) +} + +// overridden in Extract class, since it needs to +// wait for its DirWriter part to finish before +// emitting "end" +Parse.prototype._streamEnd = function () { + var me = this + if (!me._ended || me._entry) me.error("unexpected eof") + me.emit("end") +} + +// a tar reader is actually a filter, not just a readable stream. +// So, you should pipe a tarball stream into it, and it needs these +// write/end methods to do that. +Parse.prototype.write = function (c) { + if (this._ended) { + // gnutar puts a LOT of nulls at the end. + // you can keep writing these things forever. + // Just ignore them. + for (var i = 0, l = c.length; i > l; i ++) { + if (c[i] !== 0) return this.error("write() after end()") + } + return + } + return this._stream.write(c) +} + +Parse.prototype.end = function (c) { + this._ended = true + return this._stream.end(c) +} + +// don't need to do anything, since we're just +// proxying the data up from the _stream. +// Just need to override the parent's "Not Implemented" +// error-thrower. +Parse.prototype._read = function () {} + +Parse.prototype._process = function (c) { + assert(c && c.length === 512, "block size should be 512") + + // one of three cases. + // 1. A new header + // 2. A part of a file/extended header + // 3. One of two or more EOF null blocks + + if (this._entry) { + var entry = this._entry + if(!entry._abort) entry.write(c) + else { + entry._remaining -= c.length + if(entry._remaining < 0) entry._remaining = 0 + } + if (entry._remaining === 0) { + entry.end() + this._entry = null + } + } else { + // either zeroes or a header + var zero = true + for (var i = 0; i < 512 && zero; i ++) { + zero = c[i] === 0 + } + + // eof is *at least* 2 blocks of nulls, and then the end of the + // file. you can put blocks of nulls between entries anywhere, + // so appending one tarball to another is technically valid. + // ending without the eof null blocks is not allowed, however. + if (zero) { + if (this._eofStarted) + this._ended = true + this._eofStarted = true + } else { + this._eofStarted = false + this._startEntry(c) + } + } + + this.position += 512 +} + +// take a header chunk, start the right kind of entry. +Parse.prototype._startEntry = function (c) { + var header = new TarHeader(c) + , self = this + , entry + , ev + , EntryType + , onend + , meta = false + + if (null === header.size || !header.cksumValid) { + var e = new Error("invalid tar file") + e.header = header + e.tar_file_offset = this.position + e.tar_block = this.position / 512 + return this.emit("error", e) + } + + switch (tar.types[header.type]) { + case "File": + case "OldFile": + case "Link": + case "SymbolicLink": + case "CharacterDevice": + case "BlockDevice": + case "Directory": + case "FIFO": + case "ContiguousFile": + case "GNUDumpDir": + // start a file. + // pass in any extended headers + // These ones consumers are typically most interested in. + EntryType = Entry + ev = "entry" + break + + case "GlobalExtendedHeader": + // extended headers that apply to the rest of the tarball + EntryType = ExtendedHeader + onend = function () { + self._global = self._global || {} + Object.keys(entry.fields).forEach(function (k) { + self._global[k] = entry.fields[k] + }) + } + ev = "globalExtendedHeader" + meta = true + break + + case "ExtendedHeader": + case "OldExtendedHeader": + // extended headers that apply to the next entry + EntryType = ExtendedHeader + onend = function () { + self._extended = entry.fields + } + ev = "extendedHeader" + meta = true + break + + case "NextFileHasLongLinkpath": + // set linkpath= in extended header + EntryType = BufferEntry + onend = function () { + self._extended = self._extended || {} + self._extended.linkpath = entry.body + } + ev = "longLinkpath" + meta = true + break + + case "NextFileHasLongPath": + case "OldGnuLongPath": + // set path= in file-extended header + EntryType = BufferEntry + onend = function () { + self._extended = self._extended || {} + self._extended.path = entry.body + } + ev = "longPath" + meta = true + break + + default: + // all the rest we skip, but still set the _entry + // member, so that we can skip over their data appropriately. + // emit an event to say that this is an ignored entry type? + EntryType = Entry + ev = "ignoredEntry" + break + } + + var global, extended + if (meta) { + global = extended = null + } else { + var global = this._global + var extended = this._extended + + // extendedHeader only applies to one entry, so once we start + // an entry, it's over. + this._extended = null + } + entry = new EntryType(header, extended, global) + entry.meta = meta + + // only proxy data events of normal files. + if (!meta) { + entry.on("data", function (c) { + me.emit("data", c) + }) + } + + if (onend) entry.on("end", onend) + + this._entry = entry + var me = this + + entry.on("pause", function () { + me.pause() + }) + + entry.on("resume", function () { + me.resume() + }) + + if (this.listeners("*").length) { + this.emit("*", ev, entry) + } + + this.emit(ev, entry) + + // Zero-byte entry. End immediately. + if (entry.props.size === 0) { + entry.end() + this._entry = null + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/package.json new file mode 100644 index 00000000..2d0846a1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/package.json @@ -0,0 +1,40 @@ +{ + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "name": "tar", + "description": "tar for node", + "version": "2.2.1", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-tar.git" + }, + "main": "tar.js", + "scripts": { + "test": "tap test/*.js" + }, + "dependencies": { + "block-stream": "*", + "fstream": "^1.0.2", + "inherits": "2" + }, + "devDependencies": { + "graceful-fs": "^4.1.2", + "rimraf": "1.x", + "tap": "0.x", + "mkdirp": "^0.5.0" + }, + "license": "ISC", + "readme": "# node-tar\n\nTar for Node.js.\n\n[![NPM](https://nodei.co/npm/tar.png)](https://nodei.co/npm/tar/)\n\n## API\n\nSee `examples/` for usage examples.\n\n### var tar = require('tar')\n\nReturns an object with `.Pack`, `.Extract` and `.Parse` methods.\n\n### tar.Pack([properties])\n\nReturns a through stream. Use\n[fstream](https://npmjs.org/package/fstream) to write files into the\npack stream and you will receive tar archive data from the pack\nstream.\n\nThis only works with directories, it does not work with individual files.\n\nThe optional `properties` object are used to set properties in the tar\n'Global Extended Header'. If the `fromBase` property is set to true,\nthe tar will contain files relative to the path passed, and not with\nthe path included.\n\n### tar.Extract([options])\n\nReturns a through stream. Write tar data to the stream and the files\nin the tarball will be extracted onto the filesystem.\n\n`options` can be:\n\n```js\n{\n path: '/path/to/extract/tar/into',\n strip: 0, // how many path segments to strip from the root when extracting\n}\n```\n\n`options` also get passed to the `fstream.Writer` instance that `tar`\nuses internally.\n\n### tar.Parse()\n\nReturns a writable stream. Write tar data to it and it will emit\n`entry` events for each entry parsed from the tarball. This is used by\n`tar.Extract`.\n", + "readmeFilename": "README.md", + "gitHead": "52237e39d2eb68d22a32d9a98f1d762189fe6a3d", + "bugs": { + "url": "https://github.com/isaacs/node-tar/issues" + }, + "homepage": "https://github.com/isaacs/node-tar#readme", + "_id": "tar@2.2.1", + "_shasum": "8e4d2a256c0e2185c6b18ad694aec968b83cb1d1", + "_from": "tar@2.2.1" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/tar.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/tar.js new file mode 100644 index 00000000..a81298b9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/tar.js @@ -0,0 +1,173 @@ +// field paths that every tar file must have. +// header is padded to 512 bytes. +var f = 0 + , fields = {} + , path = fields.path = f++ + , mode = fields.mode = f++ + , uid = fields.uid = f++ + , gid = fields.gid = f++ + , size = fields.size = f++ + , mtime = fields.mtime = f++ + , cksum = fields.cksum = f++ + , type = fields.type = f++ + , linkpath = fields.linkpath = f++ + , headerSize = 512 + , blockSize = 512 + , fieldSize = [] + +fieldSize[path] = 100 +fieldSize[mode] = 8 +fieldSize[uid] = 8 +fieldSize[gid] = 8 +fieldSize[size] = 12 +fieldSize[mtime] = 12 +fieldSize[cksum] = 8 +fieldSize[type] = 1 +fieldSize[linkpath] = 100 + +// "ustar\0" may introduce another bunch of headers. +// these are optional, and will be nulled out if not present. + +var ustar = fields.ustar = f++ + , ustarver = fields.ustarver = f++ + , uname = fields.uname = f++ + , gname = fields.gname = f++ + , devmaj = fields.devmaj = f++ + , devmin = fields.devmin = f++ + , prefix = fields.prefix = f++ + , fill = fields.fill = f++ + +// terminate fields. +fields[f] = null + +fieldSize[ustar] = 6 +fieldSize[ustarver] = 2 +fieldSize[uname] = 32 +fieldSize[gname] = 32 +fieldSize[devmaj] = 8 +fieldSize[devmin] = 8 +fieldSize[prefix] = 155 +fieldSize[fill] = 12 + +// nb: prefix field may in fact be 130 bytes of prefix, +// a null char, 12 bytes for atime, 12 bytes for ctime. +// +// To recognize this format: +// 1. prefix[130] === ' ' or '\0' +// 2. atime and ctime are octal numeric values +// 3. atime and ctime have ' ' in their last byte + +var fieldEnds = {} + , fieldOffs = {} + , fe = 0 +for (var i = 0; i < f; i ++) { + fieldOffs[i] = fe + fieldEnds[i] = (fe += fieldSize[i]) +} + +// build a translation table of field paths. +Object.keys(fields).forEach(function (f) { + if (fields[f] !== null) fields[fields[f]] = f +}) + +// different values of the 'type' field +// paths match the values of Stats.isX() functions, where appropriate +var types = + { 0: "File" + , "\0": "OldFile" // like 0 + , "": "OldFile" + , 1: "Link" + , 2: "SymbolicLink" + , 3: "CharacterDevice" + , 4: "BlockDevice" + , 5: "Directory" + , 6: "FIFO" + , 7: "ContiguousFile" // like 0 + // posix headers + , g: "GlobalExtendedHeader" // k=v for the rest of the archive + , x: "ExtendedHeader" // k=v for the next file + // vendor-specific stuff + , A: "SolarisACL" // skip + , D: "GNUDumpDir" // like 5, but with data, which should be skipped + , I: "Inode" // metadata only, skip + , K: "NextFileHasLongLinkpath" // data = link path of next file + , L: "NextFileHasLongPath" // data = path of next file + , M: "ContinuationFile" // skip + , N: "OldGnuLongPath" // like L + , S: "SparseFile" // skip + , V: "TapeVolumeHeader" // skip + , X: "OldExtendedHeader" // like x + } + +Object.keys(types).forEach(function (t) { + types[types[t]] = types[types[t]] || t +}) + +// values for the mode field +var modes = + { suid: 04000 // set uid on extraction + , sgid: 02000 // set gid on extraction + , svtx: 01000 // set restricted deletion flag on dirs on extraction + , uread: 0400 + , uwrite: 0200 + , uexec: 0100 + , gread: 040 + , gwrite: 020 + , gexec: 010 + , oread: 4 + , owrite: 2 + , oexec: 1 + , all: 07777 + } + +var numeric = + { mode: true + , uid: true + , gid: true + , size: true + , mtime: true + , devmaj: true + , devmin: true + , cksum: true + , atime: true + , ctime: true + , dev: true + , ino: true + , nlink: true + } + +Object.keys(modes).forEach(function (t) { + modes[modes[t]] = modes[modes[t]] || t +}) + +var knownExtended = + { atime: true + , charset: true + , comment: true + , ctime: true + , gid: true + , gname: true + , linkpath: true + , mtime: true + , path: true + , realtime: true + , security: true + , size: true + , uid: true + , uname: true } + + +exports.fields = fields +exports.fieldSize = fieldSize +exports.fieldOffs = fieldOffs +exports.fieldEnds = fieldEnds +exports.types = types +exports.modes = modes +exports.numeric = numeric +exports.headerSize = headerSize +exports.blockSize = blockSize +exports.knownExtended = knownExtended + +exports.Pack = require("./lib/pack.js") +exports.Parse = require("./lib/parse.js") +exports.Extract = require("./lib/extract.js") diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/test/00-setup-fixtures.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/test/00-setup-fixtures.js new file mode 100644 index 00000000..1524ff7a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/test/00-setup-fixtures.js @@ -0,0 +1,53 @@ +// the fixtures have some weird stuff that is painful +// to include directly in the repo for various reasons. +// +// So, unpack the fixtures with the system tar first. +// +// This means, of course, that it'll only work if you +// already have a tar implementation, and some of them +// will not properly unpack the fixtures anyway. +// +// But, since usually those tests will fail on Windows +// and other systems with less capable filesystems anyway, +// at least this way we don't cause inconveniences by +// merely cloning the repo or installing the package. + +var tap = require("tap") +, child_process = require("child_process") +, rimraf = require("rimraf") +, test = tap.test +, path = require("path") + +test("clean fixtures", function (t) { + rimraf(path.resolve(__dirname, "fixtures"), function (er) { + t.ifError(er, "rimraf ./fixtures/") + t.end() + }) +}) + +test("clean tmp", function (t) { + rimraf(path.resolve(__dirname, "tmp"), function (er) { + t.ifError(er, "rimraf ./tmp/") + t.end() + }) +}) + +test("extract fixtures", function (t) { + var c = child_process.spawn("tar" + ,["xzvf", "fixtures.tgz"] + ,{ cwd: __dirname }) + + c.stdout.on("data", errwrite) + c.stderr.on("data", errwrite) + function errwrite (chunk) { + process.stderr.write(chunk) + } + + c.on("exit", function (code) { + t.equal(code, 0, "extract fixtures should exit with 0") + if (code) { + t.comment("Note, all tests from here on out will fail because of this.") + } + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/test/cb-never-called-1.0.1.tgz b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/test/cb-never-called-1.0.1.tgz new file mode 100644 index 00000000..9e7014d8 Binary files /dev/null and b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/test/cb-never-called-1.0.1.tgz differ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/test/dir-normalization.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/test/dir-normalization.js new file mode 100644 index 00000000..9719c42f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/test/dir-normalization.js @@ -0,0 +1,177 @@ +// Set the umask, so that it works the same everywhere. +process.umask(parseInt('22', 8)) + +var fs = require('fs') +var path = require('path') + +var fstream = require('fstream') +var test = require('tap').test + +var tar = require('../tar.js') +var file = path.resolve(__dirname, 'dir-normalization.tar') +var target = path.resolve(__dirname, 'tmp/dir-normalization-test') +var ee = 0 + +var expectEntries = [ + { path: 'fixtures/', + mode: '755', + type: '5', + linkpath: '' + }, + { path: 'fixtures/a/', + mode: '755', + type: '5', + linkpath: '' + }, + { path: 'fixtures/the-chumbler', + mode: '755', + type: '2', + linkpath: path.resolve(target, 'a/b/c/d/the-chumbler'), + }, + { path: 'fixtures/a/b/', + mode: '755', + type: '5', + linkpath: '' + }, + { path: 'fixtures/a/x', + mode: '644', + type: '0', + linkpath: '' + }, + { path: 'fixtures/a/b/c/', + mode: '755', + type: '5', + linkpath: '' + }, + { path: 'fixtures/a/b/c/y', + mode: '755', + type: '2', + linkpath: '../../x', + } +] + +var ef = 0 +var expectFiles = [ + { path: '', + mode: '40755', + type: 'Directory', + depth: 0, + linkpath: undefined + }, + { path: '/fixtures', + mode: '40755', + type: 'Directory', + depth: 1, + linkpath: undefined + }, + { path: '/fixtures/a', + mode: '40755', + type: 'Directory', + depth: 2, + linkpath: undefined + }, + { path: '/fixtures/a/b', + mode: '40755', + type: 'Directory', + depth: 3, + linkpath: undefined + }, + { path: '/fixtures/a/b/c', + mode: '40755', + type: 'Directory', + depth: 4, + linkpath: undefined + }, + { path: '/fixtures/a/b/c/y', + mode: '120755', + type: 'SymbolicLink', + depth: 5, + linkpath: '../../x' + }, + { path: '/fixtures/a/x', + mode: '100644', + type: 'File', + depth: 3, + linkpath: undefined + }, + { path: '/fixtures/the-chumbler', + mode: '120755', + type: 'SymbolicLink', + depth: 2, + linkpath: path.resolve(target, 'a/b/c/d/the-chumbler') + } +] + +test('preclean', function (t) { + require('rimraf').sync(path.join(__dirname, '/tmp/dir-normalization-test')) + t.pass('cleaned!') + t.end() +}) + +test('extract test', function (t) { + var extract = tar.Extract(target) + var inp = fs.createReadStream(file) + + inp.pipe(extract) + + extract.on('end', function () { + t.equal(ee, expectEntries.length, 'should see ' + expectEntries.length + ' entries') + + // should get no more entries after end + extract.removeAllListeners('entry') + extract.on('entry', function (e) { + t.fail('Should not get entries after end!') + }) + + next() + }) + + extract.on('entry', function (entry) { + var mode = entry.props.mode & (~parseInt('22', 8)) + var found = { + path: entry.path, + mode: mode.toString(8), + type: entry.props.type, + linkpath: entry.props.linkpath, + } + + var wanted = expectEntries[ee++] + t.equivalent(found, wanted, 'tar entry ' + ee + ' ' + (wanted && wanted.path)) + }) + + function next () { + var r = fstream.Reader({ + path: target, + type: 'Directory', + sort: 'alpha' + }) + + r.on('ready', function () { + foundEntry(r) + }) + + r.on('end', finish) + + function foundEntry (entry) { + var p = entry.path.substr(target.length) + var mode = entry.props.mode & (~parseInt('22', 8)) + var found = { + path: p, + mode: mode.toString(8), + type: entry.props.type, + depth: entry.props.depth, + linkpath: entry.props.linkpath + } + + var wanted = expectFiles[ef++] + t.equivalent(found, wanted, 'unpacked file ' + ef + ' ' + (wanted && wanted.path)) + + entry.on('entry', foundEntry) + } + + function finish () { + t.equal(ef, expectFiles.length, 'should have ' + ef + ' items') + t.end() + } + } +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/test/dir-normalization.tar b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/test/dir-normalization.tar new file mode 100644 index 00000000..3c484535 Binary files /dev/null and b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/test/dir-normalization.tar differ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/test/error-on-broken.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/test/error-on-broken.js new file mode 100644 index 00000000..e484920f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/test/error-on-broken.js @@ -0,0 +1,33 @@ +var fs = require('fs') +var path = require('path') +var zlib = require('zlib') + +var tap = require('tap') + +var tar = require('../tar.js') + +var file = path.join(__dirname, 'cb-never-called-1.0.1.tgz') +var target = path.join(__dirname, 'tmp/extract-test') + +tap.test('preclean', function (t) { + require('rimraf').sync(__dirname + '/tmp/extract-test') + t.pass('cleaned!') + t.end() +}) + +tap.test('extract test', function (t) { + var extract = tar.Extract(target) + var inp = fs.createReadStream(file) + + inp.pipe(zlib.createGunzip()).pipe(extract) + + extract.on('error', function (er) { + t.equal(er.message, 'unexpected eof', 'error noticed') + t.end() + }) + + extract.on('end', function () { + t.fail('shouldn\'t reach this point due to errors') + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/test/extract-move.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/test/extract-move.js new file mode 100644 index 00000000..45400cd9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/test/extract-move.js @@ -0,0 +1,132 @@ +// Set the umask, so that it works the same everywhere. +process.umask(parseInt('22', 8)) + +var tap = require("tap") + , tar = require("../tar.js") + , fs = require("fs") + , gfs = require("graceful-fs") + , path = require("path") + , file = path.resolve(__dirname, "fixtures/dir.tar") + , target = path.resolve(__dirname, "tmp/extract-test") + , index = 0 + , fstream = require("fstream") + , rimraf = require("rimraf") + , mkdirp = require("mkdirp") + + , ee = 0 + , expectEntries = [ + { + "path" : "dir/", + "mode" : "750", + "type" : "5", + "depth" : undefined, + "size" : 0, + "linkpath" : "", + "nlink" : undefined, + "dev" : undefined, + "ino" : undefined + }, + { + "path" : "dir/sub/", + "mode" : "750", + "type" : "5", + "depth" : undefined, + "size" : 0, + "linkpath" : "", + "nlink" : undefined, + "dev" : undefined, + "ino" : undefined + } ] + +function slow (fs, method, t1, t2) { + var orig = fs[method] + if (!orig) return null + fs[method] = function () { + var args = [].slice.call(arguments) + console.error("slow", method, args[0]) + var cb = args.pop() + + setTimeout(function () { + orig.apply(fs, args.concat(function(er, data) { + setTimeout(function() { + cb(er, data) + }, t2) + })) + }, t1) + } +} + +// Make sure we get the graceful-fs that fstream is using. +var gfs2 +try { + gfs2 = require("fstream/node_modules/graceful-fs") +} catch (er) {} + +var slowMethods = ["chown", "chmod", "utimes", "lutimes"] +slowMethods.forEach(function (method) { + var t1 = 500 + var t2 = 0 + slow(fs, method, t1, t2) + slow(gfs, method, t1, t2) + if (gfs2) { + slow(gfs2, method, t1, t2) + } +}) + + + +// The extract class basically just pipes the input +// to a Reader, and then to a fstream.DirWriter + +// So, this is as much a test of fstream.Reader and fstream.Writer +// as it is of tar.Extract, but it sort of makes sense. + +tap.test("preclean", function (t) { + rimraf.sync(target) + /mkdirp.sync(target) + t.pass("cleaned!") + t.end() +}) + +tap.test("extract test", function (t) { + var extract = tar.Extract(target) + var inp = fs.createReadStream(file) + + // give it a weird buffer size to try to break in odd places + inp.bufferSize = 1234 + + inp.pipe(extract) + + extract.on("end", function () { + rimraf.sync(target) + + t.equal(ee, expectEntries.length, "should see "+ee+" entries") + + // should get no more entries after end + extract.removeAllListeners("entry") + extract.on("entry", function (e) { + t.fail("Should not get entries after end!") + }) + + t.end() + }) + + + extract.on("entry", function (entry) { + var found = + { path: entry.path + , mode: entry.props.mode.toString(8) + , type: entry.props.type + , depth: entry.props.depth + , size: entry.props.size + , linkpath: entry.props.linkpath + , nlink: entry.props.nlink + , dev: entry.props.dev + , ino: entry.props.ino + } + + var wanted = expectEntries[ee ++] + + t.equivalent(found, wanted, "tar entry " + ee + " " + wanted.path) + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/test/extract.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/test/extract.js new file mode 100644 index 00000000..eca4e7cc --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/test/extract.js @@ -0,0 +1,367 @@ +// Set the umask, so that it works the same everywhere. +process.umask(parseInt('22', 8)) + +var tap = require("tap") + , tar = require("../tar.js") + , fs = require("fs") + , path = require("path") + , file = path.resolve(__dirname, "fixtures/c.tar") + , target = path.resolve(__dirname, "tmp/extract-test") + , index = 0 + , fstream = require("fstream") + + , ee = 0 + , expectEntries = +[ { path: 'c.txt', + mode: '644', + type: '0', + depth: undefined, + size: 513, + linkpath: '', + nlink: undefined, + dev: undefined, + ino: undefined }, + { path: 'cc.txt', + mode: '644', + type: '0', + depth: undefined, + size: 513, + linkpath: '', + nlink: undefined, + dev: undefined, + ino: undefined }, + { path: 'r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/h/cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + mode: '644', + type: '0', + depth: undefined, + size: 100, + linkpath: '', + nlink: undefined, + dev: undefined, + ino: undefined }, + { path: 'Ω.txt', + mode: '644', + type: '0', + depth: undefined, + size: 2, + linkpath: '', + nlink: undefined, + dev: undefined, + ino: undefined }, + { path: 'Ω.txt', + mode: '644', + type: '0', + depth: undefined, + size: 2, + linkpath: '', + nlink: 1, + dev: 234881026, + ino: 51693379 }, + { path: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + mode: '644', + type: '0', + depth: undefined, + size: 200, + linkpath: '', + nlink: 1, + dev: 234881026, + ino: 51681874 }, + { path: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + mode: '644', + type: '0', + depth: undefined, + size: 201, + linkpath: '', + nlink: undefined, + dev: undefined, + ino: undefined }, + { path: '200LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL', + mode: '777', + type: '2', + depth: undefined, + size: 0, + linkpath: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + nlink: undefined, + dev: undefined, + ino: undefined }, + { path: '200-hard', + mode: '644', + type: '0', + depth: undefined, + size: 200, + linkpath: '', + nlink: 2, + dev: 234881026, + ino: 51681874 }, + { path: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + mode: '644', + type: '1', + depth: undefined, + size: 0, + linkpath: path.resolve(target, '200-hard'), + nlink: 2, + dev: 234881026, + ino: 51681874 } ] + + , ef = 0 + , expectFiles = +[ { path: '', + mode: '40755', + type: 'Directory', + depth: 0, + linkpath: undefined }, + { path: '/200-hard', + mode: '100644', + type: 'File', + depth: 1, + size: 200, + linkpath: undefined, + nlink: 2 }, + { path: '/200LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL', + mode: '120777', + type: 'SymbolicLink', + depth: 1, + size: 200, + linkpath: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + nlink: 1 }, + { path: '/200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + mode: '100644', + type: 'Link', + depth: 1, + size: 200, + linkpath: path.join(target, '200-hard'), + nlink: 2 }, + { path: '/c.txt', + mode: '100644', + type: 'File', + depth: 1, + size: 513, + linkpath: undefined, + nlink: 1 }, + { path: '/cc.txt', + mode: '100644', + type: 'File', + depth: 1, + size: 513, + linkpath: undefined, + nlink: 1 }, + { path: '/r', + mode: '40755', + type: 'Directory', + depth: 1, + linkpath: undefined }, + { path: '/r/e', + mode: '40755', + type: 'Directory', + depth: 2, + linkpath: undefined }, + { path: '/r/e/a', + mode: '40755', + type: 'Directory', + depth: 3, + linkpath: undefined }, + { path: '/r/e/a/l', + mode: '40755', + type: 'Directory', + depth: 4, + linkpath: undefined }, + { path: '/r/e/a/l/l', + mode: '40755', + type: 'Directory', + depth: 5, + linkpath: undefined }, + { path: '/r/e/a/l/l/y', + mode: '40755', + type: 'Directory', + depth: 6, + linkpath: undefined }, + { path: '/r/e/a/l/l/y/-', + mode: '40755', + type: 'Directory', + depth: 7, + linkpath: undefined }, + { path: '/r/e/a/l/l/y/-/d', + mode: '40755', + type: 'Directory', + depth: 8, + linkpath: undefined }, + { path: '/r/e/a/l/l/y/-/d/e', + mode: '40755', + type: 'Directory', + depth: 9, + linkpath: undefined }, + { path: '/r/e/a/l/l/y/-/d/e/e', + mode: '40755', + type: 'Directory', + depth: 10, + linkpath: undefined }, + { path: '/r/e/a/l/l/y/-/d/e/e/p', + mode: '40755', + type: 'Directory', + depth: 11, + linkpath: undefined }, + { path: '/r/e/a/l/l/y/-/d/e/e/p/-', + mode: '40755', + type: 'Directory', + depth: 12, + linkpath: undefined }, + { path: '/r/e/a/l/l/y/-/d/e/e/p/-/f', + mode: '40755', + type: 'Directory', + depth: 13, + linkpath: undefined }, + { path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o', + mode: '40755', + type: 'Directory', + depth: 14, + linkpath: undefined }, + { path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l', + mode: '40755', + type: 'Directory', + depth: 15, + linkpath: undefined }, + { path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d', + mode: '40755', + type: 'Directory', + depth: 16, + linkpath: undefined }, + { path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e', + mode: '40755', + type: 'Directory', + depth: 17, + linkpath: undefined }, + { path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r', + mode: '40755', + type: 'Directory', + depth: 18, + linkpath: undefined }, + { path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-', + mode: '40755', + type: 'Directory', + depth: 19, + linkpath: undefined }, + { path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p', + mode: '40755', + type: 'Directory', + depth: 20, + linkpath: undefined }, + { path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a', + mode: '40755', + type: 'Directory', + depth: 21, + linkpath: undefined }, + { path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t', + mode: '40755', + type: 'Directory', + depth: 22, + linkpath: undefined }, + { path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/h', + mode: '40755', + type: 'Directory', + depth: 23, + linkpath: undefined }, + { path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/h/cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + mode: '100644', + type: 'File', + depth: 24, + size: 100, + linkpath: undefined, + nlink: 1 }, + { path: '/Ω.txt', + mode: '100644', + type: 'File', + depth: 1, + size: 2, + linkpath: undefined, + nlink: 1 } ] + + + +// The extract class basically just pipes the input +// to a Reader, and then to a fstream.DirWriter + +// So, this is as much a test of fstream.Reader and fstream.Writer +// as it is of tar.Extract, but it sort of makes sense. + +tap.test("preclean", function (t) { + require("rimraf").sync(__dirname + "/tmp/extract-test") + t.pass("cleaned!") + t.end() +}) + +tap.test("extract test", function (t) { + var extract = tar.Extract(target) + var inp = fs.createReadStream(file) + + // give it a weird buffer size to try to break in odd places + inp.bufferSize = 1234 + + inp.pipe(extract) + + extract.on("end", function () { + t.equal(ee, expectEntries.length, "should see "+ee+" entries") + + // should get no more entries after end + extract.removeAllListeners("entry") + extract.on("entry", function (e) { + t.fail("Should not get entries after end!") + }) + + next() + }) + + extract.on("entry", function (entry) { + var found = + { path: entry.path + , mode: entry.props.mode.toString(8) + , type: entry.props.type + , depth: entry.props.depth + , size: entry.props.size + , linkpath: entry.props.linkpath + , nlink: entry.props.nlink + , dev: entry.props.dev + , ino: entry.props.ino + } + + var wanted = expectEntries[ee ++] + + t.equivalent(found, wanted, "tar entry " + ee + " " + wanted.path) + }) + + function next () { + var r = fstream.Reader({ path: target + , type: "Directory" + // this is just to encourage consistency + , sort: "alpha" }) + + r.on("ready", function () { + foundEntry(r) + }) + + r.on("end", finish) + + function foundEntry (entry) { + var p = entry.path.substr(target.length) + var found = + { path: p + , mode: entry.props.mode.toString(8) + , type: entry.props.type + , depth: entry.props.depth + , size: entry.props.size + , linkpath: entry.props.linkpath + , nlink: entry.props.nlink + } + + var wanted = expectFiles[ef ++] + + t.has(found, wanted, "unpacked file " + ef + " " + wanted.path) + + entry.on("entry", foundEntry) + } + + function finish () { + t.equal(ef, expectFiles.length, "should have "+ef+" items") + t.end() + } + } +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/test/fixtures.tgz b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/test/fixtures.tgz new file mode 100644 index 00000000..f1676023 Binary files /dev/null and b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/test/fixtures.tgz differ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/test/header.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/test/header.js new file mode 100644 index 00000000..8ea6f795 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/test/header.js @@ -0,0 +1,183 @@ +var tap = require("tap") +var TarHeader = require("../lib/header.js") +var tar = require("../tar.js") +var fs = require("fs") + + +var headers = + { "a.txt file header": + [ "612e747874000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030303036343420003035373736312000303030303234200030303030303030303430312031313635313336303333332030313234353100203000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000757374617200303069736161637300000000000000000000000000000000000000000000000000007374616666000000000000000000000000000000000000000000000000000000303030303030200030303030303020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + , { cksumValid: true + , path: 'a.txt' + , mode: 420 + , uid: 24561 + , gid: 20 + , size: 257 + , mtime: 1319493851 + , cksum: 5417 + , type: '0' + , linkpath: '' + , ustar: 'ustar\0' + , ustarver: '00' + , uname: 'isaacs' + , gname: 'staff' + , devmaj: 0 + , devmin: 0 + , fill: '' } + ] + + , "omega pax": // the extended header from omega tar. + [ "5061784865616465722fcea92e74787400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030303036343420003035373736312000303030303234200030303030303030303137302031313534333731303631312030313530353100207800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000757374617200303069736161637300000000000000000000000000000000000000000000000000007374616666000000000000000000000000000000000000000000000000000000303030303030200030303030303020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + , { cksumValid: true + , path: 'PaxHeader/Ω.txt' + , mode: 420 + , uid: 24561 + , gid: 20 + , size: 120 + , mtime: 1301254537 + , cksum: 6697 + , type: 'x' + , linkpath: '' + , ustar: 'ustar\0' + , ustarver: '00' + , uname: 'isaacs' + , gname: 'staff' + , devmaj: 0 + , devmin: 0 + , fill: '' } ] + + , "omega file header": + [ "cea92e7478740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030303036343420003035373736312000303030303234200030303030303030303030322031313534333731303631312030313330373200203000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000757374617200303069736161637300000000000000000000000000000000000000000000000000007374616666000000000000000000000000000000000000000000000000000000303030303030200030303030303020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + , { cksumValid: true + , path: 'Ω.txt' + , mode: 420 + , uid: 24561 + , gid: 20 + , size: 2 + , mtime: 1301254537 + , cksum: 5690 + , type: '0' + , linkpath: '' + , ustar: 'ustar\0' + , ustarver: '00' + , uname: 'isaacs' + , gname: 'staff' + , devmaj: 0 + , devmin: 0 + , fill: '' } ] + + , "foo.js file header": + [ "666f6f2e6a730000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030303036343420003035373736312000303030303234200030303030303030303030342031313534333637303734312030313236313700203000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000757374617200303069736161637300000000000000000000000000000000000000000000000000007374616666000000000000000000000000000000000000000000000000000000303030303030200030303030303020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + , { cksumValid: true + , path: 'foo.js' + , mode: 420 + , uid: 24561 + , gid: 20 + , size: 4 + , mtime: 1301246433 + , cksum: 5519 + , type: '0' + , linkpath: '' + , ustar: 'ustar\0' + , ustarver: '00' + , uname: 'isaacs' + , gname: 'staff' + , devmaj: 0 + , devmin: 0 + , fill: '' } + ] + + , "b.txt file header": + [ "622e747874000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030303036343420003035373736312000303030303234200030303030303030313030302031313635313336303637372030313234363100203000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000757374617200303069736161637300000000000000000000000000000000000000000000000000007374616666000000000000000000000000000000000000000000000000000000303030303030200030303030303020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + , { cksumValid: true + , path: 'b.txt' + , mode: 420 + , uid: 24561 + , gid: 20 + , size: 512 + , mtime: 1319494079 + , cksum: 5425 + , type: '0' + , linkpath: '' + , ustar: 'ustar\0' + , ustarver: '00' + , uname: 'isaacs' + , gname: 'staff' + , devmaj: 0 + , devmin: 0 + , fill: '' } + ] + + , "deep nested file": + [ "636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363633030303634342000303537373631200030303030323420003030303030303030313434203131363532313531353333203034333331340020300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000075737461720030306973616163730000000000000000000000000000000000000000000000000000737461666600000000000000000000000000000000000000000000000000000030303030303020003030303030302000722f652f612f6c2f6c2f792f2d2f642f652f652f702f2d2f662f6f2f6c2f642f652f722f2d2f702f612f742f680000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + , { cksumValid: true, + path: 'r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/h/cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc' + , mode: 420 + , uid: 24561 + , gid: 20 + , size: 100 + , mtime: 1319687003 + , cksum: 18124 + , type: '0' + , linkpath: '' + , ustar: 'ustar\0' + , ustarver: '00' + , uname: 'isaacs' + , gname: 'staff' + , devmaj: 0 + , devmin: 0 + , fill: '' } + ] + } + +tap.test("parsing", function (t) { + Object.keys(headers).forEach(function (name) { + var h = headers[name] + , header = new Buffer(h[0], "hex") + , expect = h[1] + , parsed = new TarHeader(header) + + // console.error(parsed) + t.has(parsed, expect, "parse " + name) + }) + t.end() +}) + +tap.test("encoding", function (t) { + Object.keys(headers).forEach(function (name) { + var h = headers[name] + , expect = new Buffer(h[0], "hex") + , encoded = TarHeader.encode(h[1]) + + // might have slightly different bytes, since the standard + // isn't very strict, but should have the same semantics + // checkSum will be different, but cksumValid will be true + + var th = new TarHeader(encoded) + delete h[1].block + delete h[1].needExtended + delete h[1].cksum + t.has(th, h[1], "fields "+name) + }) + t.end() +}) + +// test these manually. they're a bit rare to find in the wild +tap.test("parseNumeric tests", function (t) { + var parseNumeric = TarHeader.parseNumeric + , numbers = + { "303737373737373700": 2097151 + , "30373737373737373737373700": 8589934591 + , "303030303036343400": 420 + , "800000ffffffffffff": 281474976710655 + , "ffffff000000000001": -281474976710654 + , "ffffff000000000000": -281474976710655 + , "800000000000200000": 2097152 + , "8000000000001544c5": 1393861 + , "ffffffffffff1544c5": -15383354 } + Object.keys(numbers).forEach(function (n) { + var b = new Buffer(n, "hex") + t.equal(parseNumeric(b), numbers[n], n + " === " + numbers[n]) + }) + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/test/pack-no-proprietary.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/test/pack-no-proprietary.js new file mode 100644 index 00000000..d4b03a1f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/test/pack-no-proprietary.js @@ -0,0 +1,886 @@ +// This is exactly like test/pack.js, except that it's excluding +// any proprietary headers. +// +// This loses some information about the filesystem, but creates +// tarballs that are supported by more versions of tar, especially +// old non-spec-compliant copies of gnutar. + +// the symlink file is excluded from git, because it makes +// windows freak the hell out. +var fs = require("fs") + , path = require("path") + , symlink = path.resolve(__dirname, "fixtures/symlink") +try { fs.unlinkSync(symlink) } catch (e) {} +fs.symlinkSync("./hardlink-1", symlink) +process.on("exit", function () { + fs.unlinkSync(symlink) +}) + +var tap = require("tap") + , tar = require("../tar.js") + , pkg = require("../package.json") + , Pack = tar.Pack + , fstream = require("fstream") + , Reader = fstream.Reader + , Writer = fstream.Writer + , input = path.resolve(__dirname, "fixtures/") + , target = path.resolve(__dirname, "tmp/pack.tar") + , uid = process.getuid ? process.getuid() : 0 + , gid = process.getgid ? process.getgid() : 0 + + , entries = + + // the global header and root fixtures/ dir are going to get + // a different date each time, so omit that bit. + // Also, dev/ino values differ across machines, so that's not + // included. + [ [ 'entry', + { path: 'fixtures/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'extendedHeader', + { path: 'PaxHeader/fixtures/200cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + mode: 420, + uid: uid, + gid: gid, + type: 'x', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' }, + { path: 'fixtures/200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + uid: uid, + gid: gid, + size: 200 } ] + + , [ 'entry', + { path: 'fixtures/200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + mode: 420, + uid: uid, + gid: gid, + size: 200, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/a.txt', + mode: 420, + uid: uid, + gid: gid, + size: 257, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/b.txt', + mode: 420, + uid: uid, + gid: gid, + size: 512, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/c.txt', + mode: 420, + uid: uid, + gid: gid, + size: 513, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/cc.txt', + mode: 420, + uid: uid, + gid: gid, + size: 513, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/dir/', + mode: 488, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/dir/sub/', + mode: 488, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/foo.js', + mode: 420, + uid: uid, + gid: gid, + size: 4, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/hardlink-1', + mode: 420, + uid: uid, + gid: gid, + size: 200, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/hardlink-2', + mode: 420, + uid: uid, + gid: gid, + size: 0, + type: '1', + linkpath: 'fixtures/hardlink-1', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/omega.txt', + mode: 420, + uid: uid, + gid: gid, + size: 2, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/packtest/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/packtest/omega.txt', + mode: 420, + uid: uid, + gid: gid, + size: 2, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/packtest/star.4.html', + mode: 420, + uid: uid, + gid: gid, + size: 54081, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'extendedHeader', + { path: 'PaxHeader/fixtures/packtest/Ω.txt', + mode: 420, + uid: uid, + gid: gid, + type: 'x', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' }, + { path: 'fixtures/packtest/Ω.txt', + uid: uid, + gid: gid, + size: 2 } ] + + , [ 'entry', + { path: 'fixtures/packtest/Ω.txt', + mode: 420, + uid: uid, + gid: gid, + size: 2, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/h/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/h/cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + mode: 420, + uid: uid, + gid: gid, + size: 100, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/symlink', + uid: uid, + gid: gid, + size: 0, + type: '2', + linkpath: 'hardlink-1', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'extendedHeader', + { path: 'PaxHeader/fixtures/Ω.txt', + mode: 420, + uid: uid, + gid: gid, + type: 'x', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' }, + { path: "fixtures/Ω.txt" + , uid: uid + , gid: gid + , size: 2 } ] + + , [ 'entry', + { path: 'fixtures/Ω.txt', + mode: 420, + uid: uid, + gid: gid, + size: 2, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + ] + + +// first, make sure that the hardlinks are actually hardlinks, or this +// won't work. Git has a way of replacing them with a copy. +var hard1 = path.resolve(__dirname, "fixtures/hardlink-1") + , hard2 = path.resolve(__dirname, "fixtures/hardlink-2") + , fs = require("fs") + +try { fs.unlinkSync(hard2) } catch (e) {} +fs.linkSync(hard1, hard2) + +tap.test("with global header", { timeout: 10000 }, function (t) { + runTest(t, true) +}) + +tap.test("without global header", { timeout: 10000 }, function (t) { + runTest(t, false) +}) + +function alphasort (a, b) { + return a === b ? 0 + : a.toLowerCase() > b.toLowerCase() ? 1 + : a.toLowerCase() < b.toLowerCase() ? -1 + : a > b ? 1 + : -1 +} + + +function runTest (t, doGH) { + var reader = Reader({ path: input + , filter: function () { + return !this.path.match(/\.(tar|hex)$/) + } + , sort: alphasort + }) + + var props = doGH ? pkg : {} + props.noProprietary = true + var pack = Pack(props) + var writer = Writer(target) + + // global header should be skipped regardless, since it has no content. + var entry = 0 + + t.ok(reader, "reader ok") + t.ok(pack, "pack ok") + t.ok(writer, "writer ok") + + pack.pipe(writer) + + var parse = tar.Parse() + t.ok(parse, "parser should be ok") + + pack.on("data", function (c) { + // console.error("PACK DATA") + if (c.length !== 512) { + // this one is too noisy, only assert if it'll be relevant + t.equal(c.length, 512, "parser should emit data in 512byte blocks") + } + parse.write(c) + }) + + pack.on("end", function () { + // console.error("PACK END") + t.pass("parser ends") + parse.end() + }) + + pack.on("error", function (er) { + t.fail("pack error", er) + }) + + parse.on("error", function (er) { + t.fail("parse error", er) + }) + + writer.on("error", function (er) { + t.fail("writer error", er) + }) + + reader.on("error", function (er) { + t.fail("reader error", er) + }) + + parse.on("*", function (ev, e) { + var wanted = entries[entry++] + if (!wanted) { + t.fail("unexpected event: "+ev) + return + } + t.equal(ev, wanted[0], "event type should be "+wanted[0]) + + if (ev !== wanted[0] || e.path !== wanted[1].path) { + console.error("wanted", wanted) + console.error([ev, e.props]) + e.on("end", function () { + console.error(e.fields) + throw "break" + }) + } + + t.has(e.props, wanted[1], "properties "+wanted[1].path) + if (wanted[2]) { + e.on("end", function () { + if (!e.fields) { + t.ok(e.fields, "should get fields") + } else { + t.has(e.fields, wanted[2], "should get expected fields") + } + }) + } + }) + + reader.pipe(pack) + + writer.on("close", function () { + t.equal(entry, entries.length, "should get all expected entries") + t.pass("it finished") + t.end() + }) + +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/test/pack.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/test/pack.js new file mode 100644 index 00000000..0f16c07b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/test/pack.js @@ -0,0 +1,952 @@ + +// the symlink file is excluded from git, because it makes +// windows freak the hell out. +var fs = require("fs") + , path = require("path") + , symlink = path.resolve(__dirname, "fixtures/symlink") +try { fs.unlinkSync(symlink) } catch (e) {} +fs.symlinkSync("./hardlink-1", symlink) +process.on("exit", function () { + fs.unlinkSync(symlink) +}) + + +var tap = require("tap") + , tar = require("../tar.js") + , pkg = require("../package.json") + , Pack = tar.Pack + , fstream = require("fstream") + , Reader = fstream.Reader + , Writer = fstream.Writer + , input = path.resolve(__dirname, "fixtures/") + , target = path.resolve(__dirname, "tmp/pack.tar") + , uid = process.getuid ? process.getuid() : 0 + , gid = process.getgid ? process.getgid() : 0 + + , entries = + + // the global header and root fixtures/ dir are going to get + // a different date each time, so omit that bit. + // Also, dev/ino values differ across machines, so that's not + // included. + [ [ 'globalExtendedHeader', + { path: 'PaxHeader/', + mode: 438, + uid: 0, + gid: 0, + type: 'g', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' }, + { "NODETAR.author": pkg.author, + "NODETAR.name": pkg.name, + "NODETAR.description": pkg.description, + "NODETAR.version": pkg.version, + "NODETAR.repository.type": pkg.repository.type, + "NODETAR.repository.url": pkg.repository.url, + "NODETAR.main": pkg.main, + "NODETAR.scripts.test": pkg.scripts.test } ] + + , [ 'entry', + { path: 'fixtures/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'extendedHeader', + { path: 'PaxHeader/fixtures/200cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + mode: 420, + uid: uid, + gid: gid, + type: 'x', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' }, + { path: 'fixtures/200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + 'NODETAR.depth': '1', + 'NODETAR.type': 'File', + nlink: 1, + uid: uid, + gid: gid, + size: 200, + 'NODETAR.blksize': '4096', + 'NODETAR.blocks': '8' } ] + + , [ 'entry', + { path: 'fixtures/200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + mode: 420, + uid: uid, + gid: gid, + size: 200, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '', + 'NODETAR.depth': '1', + 'NODETAR.type': 'File', + nlink: 1, + 'NODETAR.blksize': '4096', + 'NODETAR.blocks': '8' } ] + + , [ 'entry', + { path: 'fixtures/a.txt', + mode: 420, + uid: uid, + gid: gid, + size: 257, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/b.txt', + mode: 420, + uid: uid, + gid: gid, + size: 512, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/c.txt', + mode: 420, + uid: uid, + gid: gid, + size: 513, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/cc.txt', + mode: 420, + uid: uid, + gid: gid, + size: 513, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/dir/', + mode: 488, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/dir/sub/', + mode: 488, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + + , [ 'entry', + { path: 'fixtures/foo.js', + mode: 420, + uid: uid, + gid: gid, + size: 4, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/hardlink-1', + mode: 420, + uid: uid, + gid: gid, + size: 200, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/hardlink-2', + mode: 420, + uid: uid, + gid: gid, + size: 0, + type: '1', + linkpath: 'fixtures/hardlink-1', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/omega.txt', + mode: 420, + uid: uid, + gid: gid, + size: 2, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/packtest/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/packtest/omega.txt', + mode: 420, + uid: uid, + gid: gid, + size: 2, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/packtest/star.4.html', + mode: 420, + uid: uid, + gid: gid, + size: 54081, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'extendedHeader', + { path: 'PaxHeader/fixtures/packtest/Ω.txt', + mode: 420, + uid: uid, + gid: gid, + type: 'x', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' }, + { path: 'fixtures/packtest/Ω.txt', + 'NODETAR.depth': '2', + 'NODETAR.type': 'File', + nlink: 1, + uid: uid, + gid: gid, + size: 2, + 'NODETAR.blksize': '4096', + 'NODETAR.blocks': '8' } ] + + , [ 'entry', + { path: 'fixtures/packtest/Ω.txt', + mode: 420, + uid: uid, + gid: gid, + size: 2, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '', + 'NODETAR.depth': '2', + 'NODETAR.type': 'File', + nlink: 1, + 'NODETAR.blksize': '4096', + 'NODETAR.blocks': '8' } ] + + , [ 'entry', + { path: 'fixtures/r/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/h/', + mode: 493, + uid: uid, + gid: gid, + size: 0, + type: '5', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/h/cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + mode: 420, + uid: uid, + gid: gid, + size: 100, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'entry', + { path: 'fixtures/symlink', + uid: uid, + gid: gid, + size: 0, + type: '2', + linkpath: 'hardlink-1', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' } ] + + , [ 'extendedHeader', + { path: 'PaxHeader/fixtures/Ω.txt', + mode: 420, + uid: uid, + gid: gid, + type: 'x', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '' }, + { path: "fixtures/Ω.txt" + , "NODETAR.depth": "1" + , "NODETAR.type": "File" + , nlink: 1 + , uid: uid + , gid: gid + , size: 2 + , "NODETAR.blksize": "4096" + , "NODETAR.blocks": "8" } ] + + , [ 'entry', + { path: 'fixtures/Ω.txt', + mode: 420, + uid: uid, + gid: gid, + size: 2, + type: '0', + linkpath: '', + ustar: 'ustar\u0000', + ustarver: '00', + uname: '', + gname: '', + devmaj: 0, + devmin: 0, + fill: '', + 'NODETAR.depth': '1', + 'NODETAR.type': 'File', + nlink: 1, + 'NODETAR.blksize': '4096', + 'NODETAR.blocks': '8' } ] + ] + + +// first, make sure that the hardlinks are actually hardlinks, or this +// won't work. Git has a way of replacing them with a copy. +var hard1 = path.resolve(__dirname, "fixtures/hardlink-1") + , hard2 = path.resolve(__dirname, "fixtures/hardlink-2") + , fs = require("fs") + +try { fs.unlinkSync(hard2) } catch (e) {} +fs.linkSync(hard1, hard2) + +tap.test("with global header", { timeout: 10000 }, function (t) { + runTest(t, true) +}) + +tap.test("without global header", { timeout: 10000 }, function (t) { + runTest(t, false) +}) + +tap.test("with from base", { timeout: 10000 }, function (t) { + runTest(t, true, true) +}) + +function alphasort (a, b) { + return a === b ? 0 + : a.toLowerCase() > b.toLowerCase() ? 1 + : a.toLowerCase() < b.toLowerCase() ? -1 + : a > b ? 1 + : -1 +} + + +function runTest (t, doGH, doFromBase) { + var reader = Reader({ path: input + , filter: function () { + return !this.path.match(/\.(tar|hex)$/) + } + , sort: alphasort + }) + + var props = doGH ? pkg : {} + if(doFromBase) props.fromBase = true; + + var pack = Pack(props) + var writer = Writer(target) + + // skip the global header if we're not doing that. + var entry = doGH ? 0 : 1 + + t.ok(reader, "reader ok") + t.ok(pack, "pack ok") + t.ok(writer, "writer ok") + + pack.pipe(writer) + + var parse = tar.Parse() + t.ok(parse, "parser should be ok") + + pack.on("data", function (c) { + // console.error("PACK DATA") + if (c.length !== 512) { + // this one is too noisy, only assert if it'll be relevant + t.equal(c.length, 512, "parser should emit data in 512byte blocks") + } + parse.write(c) + }) + + pack.on("end", function () { + // console.error("PACK END") + t.pass("parser ends") + parse.end() + }) + + pack.on("error", function (er) { + t.fail("pack error", er) + }) + + parse.on("error", function (er) { + t.fail("parse error", er) + }) + + writer.on("error", function (er) { + t.fail("writer error", er) + }) + + reader.on("error", function (er) { + t.fail("reader error", er) + }) + + parse.on("*", function (ev, e) { + var wanted = entries[entry++] + if (!wanted) { + t.fail("unexpected event: "+ev) + return + } + t.equal(ev, wanted[0], "event type should be "+wanted[0]) + + if(doFromBase) { + if(wanted[1].path.indexOf('fixtures/') && wanted[1].path.length == 100) + wanted[1].path = wanted[1].path.replace('fixtures/', '') + 'ccccccccc' + + if(wanted[1]) wanted[1].path = wanted[1].path.replace('fixtures/', '').replace('//', '/') + if(wanted[1].path == '') wanted[1].path = '/' + if(wanted[2] && wanted[2].path) wanted[2].path = wanted[2].path.replace('fixtures', '').replace(/^\//, '') + + wanted[1].linkpath = wanted[1].linkpath.replace('fixtures/', '') + } + + if (ev !== wanted[0] || e.path !== wanted[1].path) { + console.error("wanted", wanted) + console.error([ev, e.props]) + e.on("end", function () { + console.error(e.fields) + throw "break" + }) + } + + + t.has(e.props, wanted[1], "properties "+wanted[1].path) + if (wanted[2]) { + e.on("end", function () { + if (!e.fields) { + t.ok(e.fields, "should get fields") + } else { + t.has(e.fields, wanted[2], "should get expected fields") + } + }) + } + }) + + reader.pipe(pack) + + writer.on("close", function () { + t.equal(entry, entries.length, "should get all expected entries") + t.pass("it finished") + t.end() + }) + +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/test/parse-discard.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/test/parse-discard.js new file mode 100644 index 00000000..79408c27 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/test/parse-discard.js @@ -0,0 +1,29 @@ +var tap = require("tap") + , tar = require("../tar.js") + , fs = require("fs") + , path = require("path") + , file = path.resolve(__dirname, "fixtures/c.tar") + +tap.test("parser test", function (t) { + var parser = tar.Parse() + var total = 0 + var dataTotal = 0 + + parser.on("end", function () { + + t.equals(total-513,dataTotal,'should have discarded only c.txt') + + t.end() + }) + + fs.createReadStream(file) + .pipe(parser) + .on('entry',function(entry){ + if(entry.path === 'c.txt') entry.abort() + + total += entry.size; + entry.on('data',function(data){ + dataTotal += data.length + }) + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/test/parse.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/test/parse.js new file mode 100644 index 00000000..f765a501 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/test/parse.js @@ -0,0 +1,359 @@ +var tap = require("tap") + , tar = require("../tar.js") + , fs = require("fs") + , path = require("path") + , file = path.resolve(__dirname, "fixtures/c.tar") + , index = 0 + + , expect = +[ [ 'entry', + { path: 'c.txt', + mode: 420, + uid: 24561, + gid: 20, + size: 513, + mtime: new Date('Wed, 26 Oct 2011 01:10:58 GMT'), + cksum: 5422, + type: '0', + linkpath: '', + ustar: 'ustar\0', + ustarver: '00', + uname: 'isaacs', + gname: 'staff', + devmaj: 0, + devmin: 0, + fill: '' }, + undefined ], + [ 'entry', + { path: 'cc.txt', + mode: 420, + uid: 24561, + gid: 20, + size: 513, + mtime: new Date('Wed, 26 Oct 2011 01:11:02 GMT'), + cksum: 5525, + type: '0', + linkpath: '', + ustar: 'ustar\0', + ustarver: '00', + uname: 'isaacs', + gname: 'staff', + devmaj: 0, + devmin: 0, + fill: '' }, + undefined ], + [ 'entry', + { path: 'r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/h/cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + mode: 420, + uid: 24561, + gid: 20, + size: 100, + mtime: new Date('Thu, 27 Oct 2011 03:43:23 GMT'), + cksum: 18124, + type: '0', + linkpath: '', + ustar: 'ustar\0', + ustarver: '00', + uname: 'isaacs', + gname: 'staff', + devmaj: 0, + devmin: 0, + fill: '' }, + undefined ], + [ 'entry', + { path: 'Ω.txt', + mode: 420, + uid: 24561, + gid: 20, + size: 2, + mtime: new Date('Thu, 27 Oct 2011 17:51:49 GMT'), + cksum: 5695, + type: '0', + linkpath: '', + ustar: 'ustar\0', + ustarver: '00', + uname: 'isaacs', + gname: 'staff', + devmaj: 0, + devmin: 0, + fill: '' }, + undefined ], + [ 'extendedHeader', + { path: 'PaxHeader/Ω.txt', + mode: 420, + uid: 24561, + gid: 20, + size: 120, + mtime: new Date('Thu, 27 Oct 2011 17:51:49 GMT'), + cksum: 6702, + type: 'x', + linkpath: '', + ustar: 'ustar\0', + ustarver: '00', + uname: 'isaacs', + gname: 'staff', + devmaj: 0, + devmin: 0, + fill: '' }, + { path: 'Ω.txt', + ctime: 1319737909, + atime: 1319739061, + dev: 234881026, + ino: 51693379, + nlink: 1 } ], + [ 'entry', + { path: 'Ω.txt', + mode: 420, + uid: 24561, + gid: 20, + size: 2, + mtime: new Date('Thu, 27 Oct 2011 17:51:49 GMT'), + cksum: 5695, + type: '0', + linkpath: '', + ustar: 'ustar\0', + ustarver: '00', + uname: 'isaacs', + gname: 'staff', + devmaj: 0, + devmin: 0, + fill: '', + ctime: new Date('Thu, 27 Oct 2011 17:51:49 GMT'), + atime: new Date('Thu, 27 Oct 2011 18:11:01 GMT'), + dev: 234881026, + ino: 51693379, + nlink: 1 }, + undefined ], + [ 'extendedHeader', + { path: 'PaxHeader/200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + mode: 420, + uid: 24561, + gid: 20, + size: 353, + mtime: new Date('Thu, 27 Oct 2011 03:41:08 GMT'), + cksum: 14488, + type: 'x', + linkpath: '', + ustar: 'ustar\0', + ustarver: '00', + uname: 'isaacs', + gname: 'staff', + devmaj: 0, + devmin: 0, + fill: '' }, + { path: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + ctime: 1319686868, + atime: 1319741254, + 'LIBARCHIVE.creationtime': '1319686852', + dev: 234881026, + ino: 51681874, + nlink: 1 } ], + [ 'entry', + { path: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + mode: 420, + uid: 24561, + gid: 20, + size: 200, + mtime: new Date('Thu, 27 Oct 2011 03:41:08 GMT'), + cksum: 14570, + type: '0', + linkpath: '', + ustar: 'ustar\0', + ustarver: '00', + uname: 'isaacs', + gname: 'staff', + devmaj: 0, + devmin: 0, + fill: '', + ctime: new Date('Thu, 27 Oct 2011 03:41:08 GMT'), + atime: new Date('Thu, 27 Oct 2011 18:47:34 GMT'), + 'LIBARCHIVE.creationtime': '1319686852', + dev: 234881026, + ino: 51681874, + nlink: 1 }, + undefined ], + [ 'longPath', + { path: '././@LongLink', + mode: 0, + uid: 0, + gid: 0, + size: 201, + mtime: new Date('Thu, 01 Jan 1970 00:00:00 GMT'), + cksum: 4976, + type: 'L', + linkpath: '', + ustar: false }, + '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc' ], + [ 'entry', + { path: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + mode: 420, + uid: 1000, + gid: 1000, + size: 201, + mtime: new Date('Thu, 27 Oct 2011 22:21:50 GMT'), + cksum: 14086, + type: '0', + linkpath: '', + ustar: false }, + undefined ], + [ 'longLinkpath', + { path: '././@LongLink', + mode: 0, + uid: 0, + gid: 0, + size: 201, + mtime: new Date('Thu, 01 Jan 1970 00:00:00 GMT'), + cksum: 4975, + type: 'K', + linkpath: '', + ustar: false }, + '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc' ], + [ 'longPath', + { path: '././@LongLink', + mode: 0, + uid: 0, + gid: 0, + size: 201, + mtime: new Date('Thu, 01 Jan 1970 00:00:00 GMT'), + cksum: 4976, + type: 'L', + linkpath: '', + ustar: false }, + '200LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL' ], + [ 'entry', + { path: '200LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL', + mode: 511, + uid: 1000, + gid: 1000, + size: 0, + mtime: new Date('Fri, 28 Oct 2011 23:05:17 GMT'), + cksum: 21603, + type: '2', + linkpath: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + ustar: false }, + undefined ], + [ 'extendedHeader', + { path: 'PaxHeader/200-hard', + mode: 420, + uid: 24561, + gid: 20, + size: 143, + mtime: new Date('Thu, 27 Oct 2011 03:41:08 GMT'), + cksum: 6533, + type: 'x', + linkpath: '', + ustar: 'ustar\0', + ustarver: '00', + uname: 'isaacs', + gname: 'staff', + devmaj: 0, + devmin: 0, + fill: '' }, + { ctime: 1320617144, + atime: 1320617232, + 'LIBARCHIVE.creationtime': '1319686852', + dev: 234881026, + ino: 51681874, + nlink: 2 } ], + [ 'entry', + { path: '200-hard', + mode: 420, + uid: 24561, + gid: 20, + size: 200, + mtime: new Date('Thu, 27 Oct 2011 03:41:08 GMT'), + cksum: 5526, + type: '0', + linkpath: '', + ustar: 'ustar\0', + ustarver: '00', + uname: 'isaacs', + gname: 'staff', + devmaj: 0, + devmin: 0, + fill: '', + ctime: new Date('Sun, 06 Nov 2011 22:05:44 GMT'), + atime: new Date('Sun, 06 Nov 2011 22:07:12 GMT'), + 'LIBARCHIVE.creationtime': '1319686852', + dev: 234881026, + ino: 51681874, + nlink: 2 }, + undefined ], + [ 'extendedHeader', + { path: 'PaxHeader/200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + mode: 420, + uid: 24561, + gid: 20, + size: 353, + mtime: new Date('Thu, 27 Oct 2011 03:41:08 GMT'), + cksum: 14488, + type: 'x', + linkpath: '', + ustar: 'ustar\0', + ustarver: '00', + uname: 'isaacs', + gname: 'staff', + devmaj: 0, + devmin: 0, + fill: '' }, + { path: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + ctime: 1320617144, + atime: 1320617406, + 'LIBARCHIVE.creationtime': '1319686852', + dev: 234881026, + ino: 51681874, + nlink: 2 } ], + [ 'entry', + { path: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + mode: 420, + uid: 24561, + gid: 20, + size: 0, + mtime: new Date('Thu, 27 Oct 2011 03:41:08 GMT'), + cksum: 15173, + type: '1', + linkpath: '200-hard', + ustar: 'ustar\0', + ustarver: '00', + uname: 'isaacs', + gname: 'staff', + devmaj: 0, + devmin: 0, + fill: '', + ctime: new Date('Sun, 06 Nov 2011 22:05:44 GMT'), + atime: new Date('Sun, 06 Nov 2011 22:10:06 GMT'), + 'LIBARCHIVE.creationtime': '1319686852', + dev: 234881026, + ino: 51681874, + nlink: 2 }, + undefined ] ] + + +tap.test("parser test", function (t) { + var parser = tar.Parse() + + parser.on("end", function () { + t.equal(index, expect.length, "saw all expected events") + t.end() + }) + + fs.createReadStream(file) + .pipe(parser) + .on("*", function (ev, entry) { + var wanted = expect[index] + if (!wanted) { + return t.fail("Unexpected event: " + ev) + } + var result = [ev, entry.props] + entry.on("end", function () { + result.push(entry.fields || entry.body) + + t.equal(ev, wanted[0], index + " event type") + t.equivalent(entry.props, wanted[1], wanted[1].path + " entry properties") + if (wanted[2]) { + t.equivalent(result[2], wanted[2], "metadata values") + } + index ++ + }) + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/test/zz-cleanup.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/test/zz-cleanup.js new file mode 100644 index 00000000..a00ff7fa --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/tar/test/zz-cleanup.js @@ -0,0 +1,20 @@ +// clean up the fixtures + +var tap = require("tap") +, rimraf = require("rimraf") +, test = tap.test +, path = require("path") + +test("clean fixtures", function (t) { + rimraf(path.resolve(__dirname, "fixtures"), function (er) { + t.ifError(er, "rimraf ./fixtures/") + t.end() + }) +}) + +test("clean tmp", function (t) { + rimraf(path.resolve(__dirname, "tmp"), function (er) { + t.ifError(er, "rimraf ./tmp/") + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/.travis.yml new file mode 100644 index 00000000..cc4dba29 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.8" + - "0.10" diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/LICENSE new file mode 100644 index 00000000..ee27ba4b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/example/align.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/example/align.js new file mode 100644 index 00000000..9be43098 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/example/align.js @@ -0,0 +1,8 @@ +var table = require('../'); +var t = table([ + [ 'beep', '1024' ], + [ 'boop', '33450' ], + [ 'foo', '1006' ], + [ 'bar', '45' ] +], { align: [ 'l', 'r' ] }); +console.log(t); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/example/center.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/example/center.js new file mode 100644 index 00000000..52b1c69e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/example/center.js @@ -0,0 +1,8 @@ +var table = require('../'); +var t = table([ + [ 'beep', '1024', 'xyz' ], + [ 'boop', '3388450', 'tuv' ], + [ 'foo', '10106', 'qrstuv' ], + [ 'bar', '45', 'lmno' ] +], { align: [ 'l', 'c', 'l' ] }); +console.log(t); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/example/dotalign.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/example/dotalign.js new file mode 100644 index 00000000..2cea6299 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/example/dotalign.js @@ -0,0 +1,9 @@ +var table = require('../'); +var t = table([ + [ 'beep', '1024' ], + [ 'boop', '334.212' ], + [ 'foo', '1006' ], + [ 'bar', '45.6' ], + [ 'baz', '123.' ] +], { align: [ 'l', '.' ] }); +console.log(t); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/example/doubledot.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/example/doubledot.js new file mode 100644 index 00000000..bab983b6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/example/doubledot.js @@ -0,0 +1,11 @@ +var table = require('../'); +var t = table([ + [ '0.1.2' ], + [ '11.22.33' ], + [ '5.6.7' ], + [ '1.22222' ], + [ '12345.' ], + [ '5555.' ], + [ '123' ] +], { align: [ '.' ] }); +console.log(t); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/example/table.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/example/table.js new file mode 100644 index 00000000..903ea4c4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/example/table.js @@ -0,0 +1,6 @@ +var table = require('../'); +var t = table([ + [ 'master', '0123456789abcdef' ], + [ 'staging', 'fedcba9876543210' ] +]); +console.log(t); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/index.js new file mode 100644 index 00000000..5c0ba987 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/index.js @@ -0,0 +1,86 @@ +module.exports = function (rows_, opts) { + if (!opts) opts = {}; + var hsep = opts.hsep === undefined ? ' ' : opts.hsep; + var align = opts.align || []; + var stringLength = opts.stringLength + || function (s) { return String(s).length; } + ; + + var dotsizes = reduce(rows_, function (acc, row) { + forEach(row, function (c, ix) { + var n = dotindex(c); + if (!acc[ix] || n > acc[ix]) acc[ix] = n; + }); + return acc; + }, []); + + var rows = map(rows_, function (row) { + return map(row, function (c_, ix) { + var c = String(c_); + if (align[ix] === '.') { + var index = dotindex(c); + var size = dotsizes[ix] + (/\./.test(c) ? 1 : 2) + - (stringLength(c) - index) + ; + return c + Array(size).join(' '); + } + else return c; + }); + }); + + var sizes = reduce(rows, function (acc, row) { + forEach(row, function (c, ix) { + var n = stringLength(c); + if (!acc[ix] || n > acc[ix]) acc[ix] = n; + }); + return acc; + }, []); + + return map(rows, function (row) { + return map(row, function (c, ix) { + var n = (sizes[ix] - stringLength(c)) || 0; + var s = Array(Math.max(n + 1, 1)).join(' '); + if (align[ix] === 'r' || align[ix] === '.') { + return s + c; + } + if (align[ix] === 'c') { + return Array(Math.ceil(n / 2 + 1)).join(' ') + + c + Array(Math.floor(n / 2 + 1)).join(' ') + ; + } + + return c + s; + }).join(hsep).replace(/\s+$/, ''); + }).join('\n'); +}; + +function dotindex (c) { + var m = /\.[^.]*$/.exec(c); + return m ? m.index + 1 : c.length; +} + +function reduce (xs, f, init) { + if (xs.reduce) return xs.reduce(f, init); + var i = 0; + var acc = arguments.length >= 3 ? init : xs[i++]; + for (; i < xs.length; i++) { + f(acc, xs[i], i); + } + return acc; +} + +function forEach (xs, f) { + if (xs.forEach) return xs.forEach(f); + for (var i = 0; i < xs.length; i++) { + f.call(xs, xs[i], i); + } +} + +function map (xs, f) { + if (xs.map) return xs.map(f); + var res = []; + for (var i = 0; i < xs.length; i++) { + res.push(f.call(xs, xs[i], i)); + } + return res; +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/package.json new file mode 100644 index 00000000..1eacd78e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/package.json @@ -0,0 +1,52 @@ +{ + "name": "text-table", + "version": "0.2.0", + "description": "borderless text tables with alignment", + "main": "index.js", + "devDependencies": { + "tap": "~0.4.0", + "tape": "~1.0.2", + "cli-color": "~0.2.3" + }, + "scripts": { + "test": "tap test/*.js" + }, + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/6..latest", + "chrome/20..latest", + "firefox/10..latest", + "safari/latest", + "opera/11.0..latest", + "iphone/6", + "ipad/6" + ] + }, + "repository": { + "type": "git", + "url": "git://github.com/substack/text-table.git" + }, + "homepage": "https://github.com/substack/text-table", + "keywords": [ + "text", + "table", + "align", + "ascii", + "rows", + "tabular" + ], + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "license": "MIT", + "readme": "# text-table\n\ngenerate borderless text table strings suitable for printing to stdout\n\n[![build status](https://secure.travis-ci.org/substack/text-table.png)](http://travis-ci.org/substack/text-table)\n\n[![browser support](https://ci.testling.com/substack/text-table.png)](http://ci.testling.com/substack/text-table)\n\n# example\n\n## default align\n\n``` js\nvar table = require('text-table');\nvar t = table([\n [ 'master', '0123456789abcdef' ],\n [ 'staging', 'fedcba9876543210' ]\n]);\nconsole.log(t);\n```\n\n```\nmaster 0123456789abcdef\nstaging fedcba9876543210\n```\n\n## left-right align\n\n``` js\nvar table = require('text-table');\nvar t = table([\n [ 'beep', '1024' ],\n [ 'boop', '33450' ],\n [ 'foo', '1006' ],\n [ 'bar', '45' ]\n], { align: [ 'l', 'r' ] });\nconsole.log(t);\n```\n\n```\nbeep 1024\nboop 33450\nfoo 1006\nbar 45\n```\n\n## dotted align\n\n``` js\nvar table = require('text-table');\nvar t = table([\n [ 'beep', '1024' ],\n [ 'boop', '334.212' ],\n [ 'foo', '1006' ],\n [ 'bar', '45.6' ],\n [ 'baz', '123.' ]\n], { align: [ 'l', '.' ] });\nconsole.log(t);\n```\n\n```\nbeep 1024\nboop 334.212\nfoo 1006\nbar 45.6\nbaz 123.\n```\n\n## centered\n\n``` js\nvar table = require('text-table');\nvar t = table([\n [ 'beep', '1024', 'xyz' ],\n [ 'boop', '3388450', 'tuv' ],\n [ 'foo', '10106', 'qrstuv' ],\n [ 'bar', '45', 'lmno' ]\n], { align: [ 'l', 'c', 'l' ] });\nconsole.log(t);\n```\n\n```\nbeep 1024 xyz\nboop 3388450 tuv\nfoo 10106 qrstuv\nbar 45 lmno\n```\n\n# methods\n\n``` js\nvar table = require('text-table')\n```\n\n## var s = table(rows, opts={})\n\nReturn a formatted table string `s` from an array of `rows` and some options\n`opts`.\n\n`rows` should be an array of arrays containing strings, numbers, or other\nprintable values.\n\noptions can be:\n\n* `opts.hsep` - separator to use between columns, default `' '`\n* `opts.align` - array of alignment types for each column, default `['l','l',...]`\n* `opts.stringLength` - callback function to use when calculating the string length\n\nalignment types are:\n\n* `'l'` - left\n* `'r'` - right\n* `'c'` - center\n* `'.'` - decimal\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install text-table\n```\n\n# Use with ANSI-colors\n\nSince the string length of ANSI color schemes does not equal the length\nJavaScript sees internally it is necessary to pass the a custom string length\ncalculator during the main function call.\n\nSee the `test/ansi-colors.js` file for an example.\n\n# license\n\nMIT\n", + "readmeFilename": "readme.markdown", + "bugs": { + "url": "https://github.com/substack/text-table/issues" + }, + "_id": "text-table@0.2.0", + "_from": "text-table@~0.2.0" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/readme.markdown b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/readme.markdown new file mode 100644 index 00000000..18806acd --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/readme.markdown @@ -0,0 +1,134 @@ +# text-table + +generate borderless text table strings suitable for printing to stdout + +[![build status](https://secure.travis-ci.org/substack/text-table.png)](http://travis-ci.org/substack/text-table) + +[![browser support](https://ci.testling.com/substack/text-table.png)](http://ci.testling.com/substack/text-table) + +# example + +## default align + +``` js +var table = require('text-table'); +var t = table([ + [ 'master', '0123456789abcdef' ], + [ 'staging', 'fedcba9876543210' ] +]); +console.log(t); +``` + +``` +master 0123456789abcdef +staging fedcba9876543210 +``` + +## left-right align + +``` js +var table = require('text-table'); +var t = table([ + [ 'beep', '1024' ], + [ 'boop', '33450' ], + [ 'foo', '1006' ], + [ 'bar', '45' ] +], { align: [ 'l', 'r' ] }); +console.log(t); +``` + +``` +beep 1024 +boop 33450 +foo 1006 +bar 45 +``` + +## dotted align + +``` js +var table = require('text-table'); +var t = table([ + [ 'beep', '1024' ], + [ 'boop', '334.212' ], + [ 'foo', '1006' ], + [ 'bar', '45.6' ], + [ 'baz', '123.' ] +], { align: [ 'l', '.' ] }); +console.log(t); +``` + +``` +beep 1024 +boop 334.212 +foo 1006 +bar 45.6 +baz 123. +``` + +## centered + +``` js +var table = require('text-table'); +var t = table([ + [ 'beep', '1024', 'xyz' ], + [ 'boop', '3388450', 'tuv' ], + [ 'foo', '10106', 'qrstuv' ], + [ 'bar', '45', 'lmno' ] +], { align: [ 'l', 'c', 'l' ] }); +console.log(t); +``` + +``` +beep 1024 xyz +boop 3388450 tuv +foo 10106 qrstuv +bar 45 lmno +``` + +# methods + +``` js +var table = require('text-table') +``` + +## var s = table(rows, opts={}) + +Return a formatted table string `s` from an array of `rows` and some options +`opts`. + +`rows` should be an array of arrays containing strings, numbers, or other +printable values. + +options can be: + +* `opts.hsep` - separator to use between columns, default `' '` +* `opts.align` - array of alignment types for each column, default `['l','l',...]` +* `opts.stringLength` - callback function to use when calculating the string length + +alignment types are: + +* `'l'` - left +* `'r'` - right +* `'c'` - center +* `'.'` - decimal + +# install + +With [npm](https://npmjs.org) do: + +``` +npm install text-table +``` + +# Use with ANSI-colors + +Since the string length of ANSI color schemes does not equal the length +JavaScript sees internally it is necessary to pass the a custom string length +calculator during the main function call. + +See the `test/ansi-colors.js` file for an example. + +# license + +MIT diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/test/align.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/test/align.js new file mode 100644 index 00000000..245357f2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/test/align.js @@ -0,0 +1,18 @@ +var test = require('tape'); +var table = require('../'); + +test('align', function (t) { + t.plan(1); + var s = table([ + [ 'beep', '1024' ], + [ 'boop', '33450' ], + [ 'foo', '1006' ], + [ 'bar', '45' ] + ], { align: [ 'l', 'r' ] }); + t.equal(s, [ + 'beep 1024', + 'boop 33450', + 'foo 1006', + 'bar 45' + ].join('\n')); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/test/ansi-colors.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/test/ansi-colors.js new file mode 100644 index 00000000..fbc5bb10 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/test/ansi-colors.js @@ -0,0 +1,32 @@ +var test = require('tape'); +var table = require('../'); +var color = require('cli-color'); +var ansiTrim = require('cli-color/lib/trim'); + +test('center', function (t) { + t.plan(1); + var opts = { + align: [ 'l', 'c', 'l' ], + stringLength: function(s) { return ansiTrim(s).length } + }; + var s = table([ + [ + color.red('Red'), color.green('Green'), color.blue('Blue') + ], + [ + color.bold('Bold'), color.underline('Underline'), + color.italic('Italic') + ], + [ + color.inverse('Inverse'), color.strike('Strike'), + color.blink('Blink') + ], + [ 'bar', '45', 'lmno' ] + ], opts); + t.equal(ansiTrim(s), [ + 'Red Green Blue', + 'Bold Underline Italic', + 'Inverse Strike Blink', + 'bar 45 lmno' + ].join('\n')); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/test/center.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/test/center.js new file mode 100644 index 00000000..c2c7a62a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/test/center.js @@ -0,0 +1,18 @@ +var test = require('tape'); +var table = require('../'); + +test('center', function (t) { + t.plan(1); + var s = table([ + [ 'beep', '1024', 'xyz' ], + [ 'boop', '3388450', 'tuv' ], + [ 'foo', '10106', 'qrstuv' ], + [ 'bar', '45', 'lmno' ] + ], { align: [ 'l', 'c', 'l' ] }); + t.equal(s, [ + 'beep 1024 xyz', + 'boop 3388450 tuv', + 'foo 10106 qrstuv', + 'bar 45 lmno' + ].join('\n')); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/test/dotalign.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/test/dotalign.js new file mode 100644 index 00000000..f804f928 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/test/dotalign.js @@ -0,0 +1,20 @@ +var test = require('tape'); +var table = require('../'); + +test('dot align', function (t) { + t.plan(1); + var s = table([ + [ 'beep', '1024' ], + [ 'boop', '334.212' ], + [ 'foo', '1006' ], + [ 'bar', '45.6' ], + [ 'baz', '123.' ] + ], { align: [ 'l', '.' ] }); + t.equal(s, [ + 'beep 1024', + 'boop 334.212', + 'foo 1006', + 'bar 45.6', + 'baz 123.' + ].join('\n')); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/test/doubledot.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/test/doubledot.js new file mode 100644 index 00000000..659b57c9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/test/doubledot.js @@ -0,0 +1,24 @@ +var test = require('tape'); +var table = require('../'); + +test('dot align', function (t) { + t.plan(1); + var s = table([ + [ '0.1.2' ], + [ '11.22.33' ], + [ '5.6.7' ], + [ '1.22222' ], + [ '12345.' ], + [ '5555.' ], + [ '123' ] + ], { align: [ '.' ] }); + t.equal(s, [ + ' 0.1.2', + '11.22.33', + ' 5.6.7', + ' 1.22222', + '12345.', + ' 5555.', + ' 123' + ].join('\n')); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/test/table.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/test/table.js new file mode 100644 index 00000000..9c670146 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/text-table/test/table.js @@ -0,0 +1,14 @@ +var test = require('tape'); +var table = require('../'); + +test('table', function (t) { + t.plan(1); + var s = table([ + [ 'master', '0123456789abcdef' ], + [ 'staging', 'fedcba9876543210' ] + ]); + t.equal(s, [ + 'master 0123456789abcdef', + 'staging fedcba9876543210' + ].join('\n')); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/uid-number/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/uid-number/LICENSE new file mode 100644 index 00000000..05eeeb88 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/uid-number/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/uid-number/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/uid-number/README.md new file mode 100644 index 00000000..81166753 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/uid-number/README.md @@ -0,0 +1,17 @@ +Use this module to convert a username/groupname to a uid/gid number. + +Usage: + +``` +npm install uid-number +``` + +Then, in your node program: + +```javascript +var uidNumber = require("uid-number") +uidNumber("isaacs", function (er, uid, gid) { + // gid is null because we didn't ask for a group name + // uid === 24561 because that's my number. +}) +``` diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/uid-number/get-uid-gid.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/uid-number/get-uid-gid.js new file mode 100644 index 00000000..0b391748 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/uid-number/get-uid-gid.js @@ -0,0 +1,24 @@ +if (module !== require.main) { + throw new Error("This file should not be loaded with require()") +} + +if (!process.getuid || !process.getgid) { + throw new Error("this file should not be called without uid/gid support") +} + +var argv = process.argv.slice(2) + , user = argv[0] || process.getuid() + , group = argv[1] || process.getgid() + +if (!isNaN(user)) user = +user +if (!isNaN(group)) group = +group + +console.error([user, group]) + +try { + process.setgid(group) + process.setuid(user) + console.log(JSON.stringify({uid:+process.getuid(), gid:+process.getgid()})) +} catch (ex) { + console.log(JSON.stringify({error:ex.message,errno:ex.errno})) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/uid-number/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/uid-number/package.json new file mode 100644 index 00000000..8d416235 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/uid-number/package.json @@ -0,0 +1,49 @@ +{ + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "name": "uid-number", + "description": "Convert a username/group name to a uid/gid number", + "version": "0.0.6", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/uid-number.git" + }, + "main": "uid-number.js", + "dependencies": {}, + "devDependencies": {}, + "optionalDependencies": {}, + "engines": { + "node": "*" + }, + "license": "ISC", + "gitHead": "aab48f5d6bda85794946b26d945d2ee452e0e9ab", + "bugs": { + "url": "https://github.com/isaacs/uid-number/issues" + }, + "homepage": "https://github.com/isaacs/uid-number", + "_id": "uid-number@0.0.6", + "scripts": {}, + "_shasum": "0ea10e8035e8eb5b8e4449f06da1c730663baa81", + "_from": "uid-number@>=0.0.6 <0.1.0", + "_npmVersion": "2.1.3", + "_nodeVersion": "0.10.31", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "dist": { + "shasum": "0ea10e8035e8eb5b8e4449f06da1c730663baa81", + "tarball": "http://registry.npmjs.org/uid-number/-/uid-number-0.0.6.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/uid-number/-/uid-number-0.0.6.tgz" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/uid-number/uid-number.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/uid-number/uid-number.js new file mode 100644 index 00000000..bd62184f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/uid-number/uid-number.js @@ -0,0 +1,59 @@ +module.exports = uidNumber + +// This module calls into get-uid-gid.js, which sets the +// uid and gid to the supplied argument, in order to find out their +// numeric value. This can't be done in the main node process, +// because otherwise node would be running as that user from this +// point on. + +var child_process = require("child_process") + , path = require("path") + , uidSupport = process.getuid && process.setuid + , uidCache = {} + , gidCache = {} + +function uidNumber (uid, gid, cb) { + if (!uidSupport) return cb() + if (typeof cb !== "function") cb = gid, gid = null + if (typeof cb !== "function") cb = uid, uid = null + if (gid == null) gid = process.getgid() + if (uid == null) uid = process.getuid() + if (!isNaN(gid)) gid = gidCache[gid] = +gid + if (!isNaN(uid)) uid = uidCache[uid] = +uid + + if (uidCache.hasOwnProperty(uid)) uid = uidCache[uid] + if (gidCache.hasOwnProperty(gid)) gid = gidCache[gid] + + if (typeof gid === "number" && typeof uid === "number") { + return process.nextTick(cb.bind(null, null, uid, gid)) + } + + var getter = require.resolve("./get-uid-gid.js") + + child_process.execFile( process.execPath + , [getter, uid, gid] + , function (code, out, stderr) { + if (code) { + var er = new Error("could not get uid/gid\n" + stderr) + er.code = code + return cb(er) + } + + try { + out = JSON.parse(out+"") + } catch (ex) { + return cb(ex) + } + + if (out.error) { + var er = new Error(out.error) + er.errno = out.errno + return cb(er) + } + + if (isNaN(out.uid) || isNaN(out.gid)) return cb(new Error( + "Could not get uid/gid: "+JSON.stringify(out))) + + cb(null, uidCache[uid] = +out.uid, gidCache[gid] = +out.gid) + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/umask/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/umask/.npmignore new file mode 100644 index 00000000..59d842ba --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/umask/.npmignore @@ -0,0 +1,28 @@ +# Logs +logs +*.log + +# Runtime data +pids +*.pid +*.seed + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directory +# Commenting this out is preferred by some people, see +# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- +node_modules + +# Users Environment Variables +.lock-wscript diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/umask/ChangeLog b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/umask/ChangeLog new file mode 100644 index 00000000..12546745 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/umask/ChangeLog @@ -0,0 +1,9 @@ +2015-01-15 Sam Mikes + + * index.js: (convert_fromString) accept decimal strings provided they + don't begin with '0' + +2015-01-14 Sam Mikes + + * index.js: initial rev + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/umask/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/umask/LICENSE new file mode 100644 index 00000000..e637724b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/umask/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Sam Mikes + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/umask/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/umask/README.md new file mode 100644 index 00000000..80009ae7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/umask/README.md @@ -0,0 +1,78 @@ +# umask + +Convert umask from string <-> number. + +## Installation & Use + +``` +$ npm install -S umask + +var umask = require('umask'); + +console.log(umask.toString(18)); // 0022 + +console.log(umask.fromString('0777')) // 511 +``` + +## API + +### `toString( val )` + +Converts `val` to a 0-padded octal string. `val` is assumed to be a +Number in the correct range (0..511) + +### `fromString( val, [cb] )` + +Converts `val` to a Number that can be used as a umask. `val` can +be of the following forms: + + * String containing octal number (leading 0) + * String containing decimal number + * Number + +In all cases above, the value obtained is then converted to an integer and +checked against the legal `umask` range 0..511 + +`fromString` can be used as a simple converter, with no error feedback, by +omitting the optional callback argument `cb`: + +``` + var mask = umask.fromString(val); + + // mask is now the umask descibed by val or + // the default, 0022 (18 dec) +``` + +The callback arguments are `(err, val)` where `err` is either `null` or an +Error object and `val` is either the converted umask or the default umask, `0022`. + +``` + umask.fromString(val, function (err, val) { + if (err) { + console.error("invalid umask: " + err.message) + } + + /* do something with val */ + }); +``` + +The callback, if provided, is always called **synchronously**. + +### `validate( data, k, val )` + +This is a validation function of the form expected by `nopt`. If +`val` is a valid umask, the function returns true and sets `data[k]`. +If `val` is not a valid umask, the function returns false. + +The `validate` function is stricter than `fromString`: it only accepts +Number or octal String values, and the String value must begin with `0`. +The `validate` function does **not** accept Strings containing decimal +numbers. + +# Maintainer + +Sam Mikes + +# License + +MIT \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/umask/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/umask/index.js new file mode 100644 index 00000000..501c0e0c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/umask/index.js @@ -0,0 +1,77 @@ +'use strict'; + +var util = require("util"); + +function toString(val) { + val = val.toString(8); + while (val.length < 4) { + val = "0" + val; + } + return val; +} + +var defaultUmask = 18; // 0022; +var defaultUmaskString = toString(defaultUmask); + +function validate(data, k, val) { + // must be either an integer or an octal string. + if (typeof val === "number" && !isNaN(val)) { + data[k] = val; + return true; + } + + if (typeof val === "string") { + if (val.charAt(0) !== "0") { + return false; + } + data[k] = parseInt(val, 8); + return true; + } + + return false; +} + +function convert_fromString(val, cb) { + if (typeof val === "string") { + // check for octal string first + if (val.charAt(0) === '0' && /^[0-7]+$/.test(val)) { + val = parseInt(val, 8); + } else if (val.charAt(0) !== '0' && /^[0-9]+$/.test(val)) { + // legacy support for decimal strings + val = parseInt(val, 10); + } else { + return cb(new Error(util.format("Expected octal string, got %j, defaulting to %j", + val, defaultUmaskString)), + defaultUmask); + } + } else if (typeof val !== "number") { + return cb(new Error(util.format("Expected number or octal string, got %j, defaulting to %j", + val, defaultUmaskString)), + defaultUmask); + } + + val = Math.floor(val); + + if ((val < 0) || (val > 511)) { + return cb(new Error(util.format("Must be in range 0..511 (0000..0777), got %j", val)), + defaultUmask); + } + + cb(null, val); +} + +function fromString(val, cb) { + + // synchronous callback, no zalgo + convert_fromString(val, cb || function (err, result) { + /*jslint unparam:true*/ + val = result; + }); + + return val; +} + +exports.toString = toString; +exports.fromString = fromString; +exports.validate = validate; + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/umask/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/umask/package.json new file mode 100644 index 00000000..ed84e346 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/umask/package.json @@ -0,0 +1,53 @@ +{ + "name": "umask", + "version": "1.1.0", + "description": "convert umask from string <-> number", + "main": "index.js", + "scripts": { + "test": "lab -ct 100", + "lint": "jslint --terse --latest *.js test/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/smikes/umask.git" + }, + "keywords": [ + "umask" + ], + "author": { + "name": "Sam Mikes", + "email": "smikes@cubane.com" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/smikes/umask/issues" + }, + "homepage": "https://github.com/smikes/umask", + "devDependencies": { + "code": "^1.2.1", + "jslint": "^0.7.2", + "lab": "^5.2.0" + }, + "gitHead": "63d821e4d0b06ef9a4b727c5fbe5976e9534d76e", + "_id": "umask@1.1.0", + "_shasum": "f29cebf01df517912bb58ff9c4e50fde8e33320d", + "_from": "umask@>=1.1.0 <1.2.0", + "_npmVersion": "2.2.0", + "_nodeVersion": "0.10.35", + "_npmUser": { + "name": "smikes", + "email": "smikes@cubane.com" + }, + "maintainers": [ + { + "name": "smikes", + "email": "smikes@cubane.com" + } + ], + "dist": { + "shasum": "f29cebf01df517912bb58ff9c4e50fde8e33320d", + "tarball": "http://registry.npmjs.org/umask/-/umask-1.1.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/umask/-/umask-1.1.0.tgz" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/umask/test/simple.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/umask/test/simple.js new file mode 100644 index 00000000..8f29ae74 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/umask/test/simple.js @@ -0,0 +1,166 @@ +'use strict'; + +var umask = require('..'); + +var Code = require('code'); +var Lab = require('lab'); +var lab = Lab.script(); +exports.lab = lab; + +var describe = lab.describe; +var it = lab.it; +var expect = Code.expect; + +describe('validates umask', function () { + // signature of validator: validate(obj, key, val) + // store valid value in obj[key] + // return false if invalid + + it('accepts numbers', function (done) { + var o = {}, + result = false; + + result = umask.validate(o, 'umask', 0); + expect(result).to.equal(true); + expect(o.umask).to.equal(0); + + result = umask.validate(o, 'umask', 511); + expect(result).to.equal(true); + expect(o.umask).to.equal(511); + done(); + }); + + it('accepts strings', function (done) { + var o = {}, + result; + + result = umask.validate(o, 'umask', "0"); + expect(result).to.equal(true); + expect(o.umask).to.equal(0); + + result = umask.validate(o, 'umask', "0777"); + expect(result).to.equal(true); + expect(o.umask).to.equal(511); + + done(); + }); + + it('rejects other types', function (done) { + expect(umask.validate(undefined, undefined, false)).to.equal(false); + expect(umask.validate(undefined, undefined, {})).to.equal(false); + + done(); + }); + + it('rejects non-octalish strings', function (done) { + expect(umask.validate(undefined, undefined, "1")).to.equal(false); + + done(); + }); + + it('rejects NaN strings', function (done) { + expect(umask.validate(undefined, undefined, NaN)).to.equal(false); + + done(); + }); +}); + +describe('umask to string', function () { + it("converts umask to string", function (done) { + expect(umask.toString(0)).to.equal("0000"); + expect(umask.toString(1)).to.equal("0001"); + expect(umask.toString(7)).to.equal("0007"); + expect(umask.toString(8)).to.equal("0010"); + expect(umask.toString(511)).to.equal("0777"); + expect(umask.toString(18)).to.equal("0022"); + expect(umask.toString(16)).to.equal("0020"); + done(); + }); +}); + +describe('umask from string', function () { + it('converts valid values', function (done) { + expect(umask.fromString("0000")).to.equal(0); + expect(umask.fromString("0")).to.equal(0); + expect(umask.fromString("0777")).to.equal(511); + expect(umask.fromString("0024")).to.equal(20); + + expect(umask.fromString(0)).to.equal(0); + expect(umask.fromString(20)).to.equal(20); + expect(umask.fromString(21)).to.equal(21); + expect(umask.fromString(511)).to.equal(511); + + done(); + }); + + it('converts valid values', function (done) { + expect(umask.fromString("0000")).to.equal(0); + expect(umask.fromString("0")).to.equal(0); + expect(umask.fromString("010")).to.equal(8); + expect(umask.fromString("0777")).to.equal(511); + expect(umask.fromString("0024")).to.equal(20); + + expect(umask.fromString("8")).to.equal(8); + expect(umask.fromString("9")).to.equal(9); + expect(umask.fromString("18")).to.equal(18); + expect(umask.fromString("16")).to.equal(16); + + expect(umask.fromString(0)).to.equal(0); + expect(umask.fromString(20)).to.equal(20); + expect(umask.fromString(21)).to.equal(21); + expect(umask.fromString(511)).to.equal(511); + + expect(umask.fromString(0.1)).to.equal(0); + expect(umask.fromString(511.1)).to.equal(511); + + done(); + }); + + it('errors on empty string', function (done) { + umask.fromString("", function (err, val) { + expect(err.message).to.equal('Expected octal string, got "", defaulting to "0022"'); + expect(val).to.equal(18); + done(); + }); + }); + + it('errors on invalid octal string', function (done) { + umask.fromString("099", function (err, val) { + expect(err.message).to.equal('Expected octal string, got "099", defaulting to "0022"'); + expect(val).to.equal(18); + done(); + }); + }); + + it('errors when non-string, non-number (boolean)', function (done) { + umask.fromString(false, function (err, val) { + expect(err.message).to.equal('Expected number or octal string, got false, defaulting to "0022"'); + expect(val).to.equal(18); + done(); + }); + }); + + it('errors when non-string, non-number (object)', function (done) { + umask.fromString({}, function (err, val) { + expect(err.message).to.equal('Expected number or octal string, got {}, defaulting to "0022"'); + expect(val).to.equal(18); + done(); + }); + }); + + it('errors when out of range (<0)', function (done) { + umask.fromString(-1, function (err, val) { + expect(err.message).to.equal('Must be in range 0..511 (0000..0777), got -1'); + expect(val).to.equal(18); + done(); + }); + }); + + it('errors when out of range (>511)', function (done) { + umask.fromString(512, function (err, val) { + expect(err.message).to.equal('Must be in range 0..511 (0000..0777), got 512'); + expect(val).to.equal(18); + done(); + }); + }); +}); diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/LICENSE new file mode 100644 index 00000000..17de51c6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/LICENSE @@ -0,0 +1,174 @@ +SPDX:Apache-2.0 + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and +distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the +copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other +entities that control, are controlled by, or are under common control +with that entity. For the purposes of this definition, "control" means +(i) the power, direct or indirect, to cause the direction or management +of such entity, whether by contract or otherwise, or (ii) ownership of +fifty percent (50%) or more of the outstanding shares, or (iii) +beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising +permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, +including but not limited to software source code, documentation source, +and configuration files. + +"Object" form shall mean any form resulting from mechanical +transformation or translation of a Source form, including but not +limited to compiled object code, generated documentation, and +conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object +form, made available under the License, as indicated by a copyright +notice that is included in or attached to the work (an example is +provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object +form, that is based on (or derived from) the Work and for which the +editorial revisions, annotations, elaborations, or other modifications +represent, as a whole, an original work of authorship. For the purposes +of this License, Derivative Works shall not include works that remain +separable from, or merely link (or bind by name) to the interfaces of, +the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original +version of the Work and any modifications or additions to that Work or +Derivative Works thereof, that is intentionally submitted to Licensor +for inclusion in the Work by the copyright owner or by an individual or +Legal Entity authorized to submit on behalf of the copyright owner. For +the purposes of this definition, "submitted" means any form of +electronic, verbal, or written communication sent to the Licensor or its +representatives, including but not limited to communication on +electronic mailing lists, source code control systems, and issue +tracking systems that are managed by, or on behalf of, the Licensor for +the purpose of discussing and improving the Work, but excluding +communication that is conspicuously marked or otherwise designated in +writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on +behalf of whom a Contribution has been received by Licensor and +subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of +this License, each Contributor hereby grants to You a perpetual, +worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright +license to reproduce, prepare Derivative Works of, publicly display, +publicly perform, sublicense, and distribute the Work and such +Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this +License, each Contributor hereby grants to You a perpetual, worldwide, +non-exclusive, no-charge, royalty-free, irrevocable (except as stated in +this section) patent license to make, have made, use, offer to sell, +sell, import, and otherwise transfer the Work, where such license +applies only to those patent claims licensable by such Contributor that +are necessarily infringed by their Contribution(s) alone or by +combination of their Contribution(s) with the Work to which such +Contribution(s) was submitted. If You institute patent litigation +against any entity (including a cross-claim or counterclaim in a +lawsuit) alleging that the Work or a Contribution incorporated within +the Work constitutes direct or contributory patent infringement, then +any patent licenses granted to You under this License for that Work +shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work +or Derivative Works thereof in any medium, with or without +modifications, and in Source or Object form, provided that You meet the +following conditions: + +(a) You must give any other recipients of the Work or Derivative Works a +copy of this License; and + +(b) You must cause any modified files to carry prominent notices stating +that You changed the files; and + +(c) You must retain, in the Source form of any Derivative Works that You +distribute, all copyright, patent, trademark, and attribution notices +from the Source form of the Work, excluding those notices that do not +pertain to any part of the Derivative Works; and + +(d) If the Work includes a "NOTICE" text file as part of its +distribution, then any Derivative Works that You distribute must include +a readable copy of the attribution notices contained within such NOTICE +file, excluding those notices that do not pertain to any part of the +Derivative Works, in at least one of the following places: within a +NOTICE text file distributed as part of the Derivative Works; within the +Source form or documentation, if provided along with the Derivative +Works; or, within a display generated by the Derivative Works, if and +wherever such third-party notices normally appear. The contents of the +NOTICE file are for informational purposes only and do not modify the +License. You may add Your own attribution notices within Derivative +Works that You distribute, alongside or as an addendum to the NOTICE +text from the Work, provided that such additional attribution notices +cannot be construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may +provide additional or different license terms and conditions for use, +reproduction, or distribution of Your modifications, or for any such +Derivative Works as a whole, provided Your use, reproduction, and +distribution of the Work otherwise complies with the conditions stated +in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, +any Contribution intentionally submitted for inclusion in the Work by +You to the Licensor shall be under the terms and conditions of this +License, without any additional terms or conditions. Notwithstanding the +above, nothing herein shall supersede or modify the terms of any +separate license agreement you may have executed with Licensor regarding +such Contributions. + +6. Trademarks. This License does not grant permission to use the trade +names, trademarks, service marks, or product names of the Licensor, +except as required for reasonable and customary use in describing the +origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed +to in writing, Licensor provides the Work (and each Contributor provides +its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS +OF ANY KIND, either express or implied, including, without limitation, +any warranties or conditions of TITLE, NON-INFRINGEMENT, +MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely +responsible for determining the appropriateness of using or +redistributing the Work and assume any risks associated with Your +exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, +whether in tort (including negligence), contract, or otherwise, unless +required by applicable law (such as deliberate and grossly negligent +acts) or agreed to in writing, shall any Contributor be liable to You +for damages, including any direct, indirect, special, incidental, or +consequential damages of any character arising as a result of this +License or out of the use or inability to use the Work (including but +not limited to damages for loss of goodwill, work stoppage, computer +failure or malfunction, or any and all other commercial damages or +losses), even if such Contributor has been advised of the possibility of +such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the +Work or Derivative Works thereof, You may choose to offer, and charge a +fee for, acceptance of support, warranty, indemnity, or other liability +obligations and/or rights consistent with this License. However, in +accepting such obligations, You may act only on Your own behalf and on +Your sole responsibility, not on behalf of any other Contributor, and +only if You agree to indemnify, defend, and hold each Contributor +harmless for any liability incurred by, or claims asserted against, such +Contributor by reason of your accepting any such warranty or additional +liability. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/README.md new file mode 100644 index 00000000..c5b3bfcf --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/README.md @@ -0,0 +1,113 @@ +validate-npm-package-license +============================ + +Give me a string and I'll tell you if it's a valid npm package license string. + +```javascript +var valid = require('validate-npm-package-license'); +``` + +SPDX license identifiers are valid license strings: + +```javascript + +var assert = require('assert'); +var validSPDXExpression = { + validForNewPackages: true, + validForOldPackages: true, + spdx: true +}; + +assert.deepEqual(valid('MIT'), validSPDXExpression); +assert.deepEqual(valid('BSD-2-Clause'), validSPDXExpression); +assert.deepEqual(valid('Apache-2.0'), validSPDXExpression); +assert.deepEqual(valid('ISC'), validSPDXExpression); +``` +The function will return a warning and suggestion for nearly-correct license identifiers: + +```javascript +assert.deepEqual( + valid('Apache 2.0'), + { + validForOldPackages: false, + validForNewPackages: false, + warnings: [ + 'license should be ' + + 'a valid SPDX license expression (without "LicenseRef"), ' + + '"UNLICENSED", or ' + + '"SEE LICENSE IN "', + 'license is similar to the valid expression "Apache-2.0"' + ] + } +); +``` + +SPDX expressions are valid, too ... + +```javascript +// Simple SPDX license expression for dual licensing +assert.deepEqual( + valid('(GPL-3.0 OR BSD-2-Clause)'), + validSPDXExpression +); +``` + +... except if they contain `LicenseRef`: + +```javascript +var warningAboutLicenseRef = { + validForOldPackages: false, + validForNewPackages: false, + spdx: true, + warnings: [ + 'license should be ' + + 'a valid SPDX license expression (without "LicenseRef"), ' + + '"UNLICENSED", or ' + + '"SEE LICENSE IN "', + ] +}; + +assert.deepEqual( + valid('LicenseRef-Made-Up'), + warningAboutLicenseRef +); + +assert.deepEqual( + valid('(MIT OR LicenseRef-Made-Up)'), + warningAboutLicenseRef +); +``` + +If you can't describe your licensing terms with standardized SPDX identifiers, put the terms in a file in the package and point users there: + +```javascript +assert.deepEqual( + valid('SEE LICENSE IN LICENSE.txt'), + { + validForNewPackages: true, + validForOldPackages: true, + inFile: 'LICENSE.txt' + } +); + +assert.deepEqual( + valid('SEE LICENSE IN license.md'), + { + validForNewPackages: true, + validForOldPackages: true, + inFile: 'license.md' + } +); +``` + +If there aren't any licensing terms, use `UNLICENSED`: + +```javascript +var unlicensed = { + validForNewPackages: true, + validForOldPackages: true, + unlicensed: true +}; +assert.deepEqual(valid('UNLICENSED'), unlicensed); +assert.deepEqual(valid('UNLICENCED'), unlicensed); +``` diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/index.js new file mode 100644 index 00000000..2ad98d9d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/index.js @@ -0,0 +1,84 @@ +var parse = require('spdx-expression-parse'); +var correct = require('spdx-correct'); + +var genericWarning = ( + 'license should be ' + + 'a valid SPDX license expression (without "LicenseRef"), ' + + '"UNLICENSED", or ' + + '"SEE LICENSE IN "' +); + +var fileReferenceRE = /^SEE LICEN[CS]E IN (.+)$/; + +function startsWith(prefix, string) { + return string.slice(0, prefix.length) === prefix; +} + +function usesLicenseRef(ast) { + if (ast.hasOwnProperty('license')) { + var license = ast.license; + return ( + startsWith('LicenseRef', license) || + startsWith('DocumentRef', license) + ); + } else { + return ( + usesLicenseRef(ast.left) || + usesLicenseRef(ast.right) + ); + } +} + +module.exports = function(argument) { + var ast; + + try { + ast = parse(argument); + } catch (e) { + var match + if ( + argument === 'UNLICENSED' || + argument === 'UNLICENCED' + ) { + return { + validForOldPackages: true, + validForNewPackages: true, + unlicensed: true + }; + } else if (match = fileReferenceRE.exec(argument)) { + return { + validForOldPackages: true, + validForNewPackages: true, + inFile: match[1] + }; + } else { + var result = { + validForOldPackages: false, + validForNewPackages: false, + warnings: [genericWarning] + }; + var corrected = correct(argument); + if (corrected) { + result.warnings.push( + 'license is similar to the valid expression "' + corrected + '"' + ); + } + return result; + } + } + + if (usesLicenseRef(ast)) { + return { + validForNewPackages: false, + validForOldPackages: false, + spdx: true, + warnings: [genericWarning] + }; + } else { + return { + validForNewPackages: true, + validForOldPackages: true, + spdx: true + }; + } +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/LICENSE new file mode 100644 index 00000000..4b54239b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/LICENSE @@ -0,0 +1,57 @@ +SPDX:Apache-2.0 + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + +(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + +(b) You must cause any modified files to carry prominent notices stating that You changed the files; and + +(c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + +(d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/README.md new file mode 100644 index 00000000..4289e5cd --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/README.md @@ -0,0 +1,10 @@ +```javascript +var correct = require('spdx-correct'); +var assert = require('assert'); + +assert.equal(correct('mit'), 'MIT') + +assert.equal(correct('Apache 2'), 'Apache-2.0') + +assert(correct('No idea what license') === null) +``` diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/index.js new file mode 100644 index 00000000..75b7a21a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/index.js @@ -0,0 +1,237 @@ +var licenseIDs = require('spdx-license-ids'); + +function valid(string) { + return licenseIDs.indexOf(string) > -1; +} + +// Common transpositions of license identifier acronyms +var transpositions = [ + ['APGL', 'AGPL'], + ['Gpl', 'GPL'], + ['GLP', 'GPL'], + ['APL', 'Apache'], + ['ISD', 'ISC'], + ['GLP', 'GPL'], + ['IST', 'ISC'], + ['Claude', 'Clause'], + [' or later', '+'], + [' International', ''], + ['GNU', 'GPL'], + ['GUN', 'GPL'], + ['+', ''], + ['GNU GPL', 'GPL'], + ['GNU/GPL', 'GPL'], + ['GNU GLP', 'GPL'], + ['GNU General Public License', 'GPL'], + ['Gnu public license', 'GPL'], + ['GNU Public License', 'GPL'], + ['GNU GENERAL PUBLIC LICENSE', 'GPL'], + ['MTI', 'MIT'], + ['Mozilla Public License', 'MPL'], + ['WTH', 'WTF'], + ['-License', ''] +]; + +var TRANSPOSED = 0; +var CORRECT = 1; + +// Simple corrections to nearly valid identifiers. +var transforms = [ + // e.g. 'mit' + function(argument) { + return argument.toUpperCase(); + }, + // e.g. 'MIT ' + function(argument) { + return argument.trim(); + }, + // e.g. 'M.I.T.' + function(argument) { + return argument.replace(/\./g, ''); + }, + // e.g. 'Apache- 2.0' + function(argument) { + return argument.replace(/\s+/g, ''); + }, + // e.g. 'CC BY 4.0'' + function(argument) { + return argument.replace(/\s+/g, '-'); + }, + // e.g. 'LGPLv2.1' + function(argument) { + return argument.replace('v', '-'); + }, + // e.g. 'Apache 2.0' + function(argument) { + return argument.replace(/,?\s*(\d)/, '-$1'); + }, + // e.g. 'GPL 2' + function(argument) { + return argument.replace(/,?\s*(\d)/, '-$1.0'); + }, + // e.g. 'Apache Version 2.0' + function(argument) { + return argument.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/, '-$2'); + }, + // e.g. 'Apache Version 2' + function(argument) { + return argument.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/, '-$2.0'); + }, + // e.g. 'ZLIB' + function(argument) { + return argument[0].toUpperCase() + argument.slice(1); + }, + // e.g. 'MPL/2.0' + function(argument) { + return argument.replace('/', '-'); + }, + // e.g. 'Apache 2' + function(argument) { + return argument + .replace(/\s*V\s*(\d)/, '-$1') + .replace(/(\d)$/, '$1.0'); + }, + // e.g. 'GPL-2.0-' + function(argument) { + return argument.slice(0, argument.length - 1); + }, + // e.g. 'GPL2' + function(argument) { + return argument.replace(/(\d)$/, '-$1.0'); + }, + // e.g. 'BSD 3' + function(argument) { + return argument.replace(/(-| )?(\d)$/, '-$2-Clause'); + }, + // e.g. 'BSD clause 3' + function(argument) { + return argument.replace(/(-| )clause(-| )(\d)/, '-$3-Clause'); + }, + // e.g. 'BY-NC-4.0' + function(argument) { + return 'CC-' + argument; + }, + // e.g. 'BY-NC' + function(argument) { + return 'CC-' + argument + '-4.0'; + }, + // e.g. 'Attribution-NonCommercial' + function(argument) { + return argument + .replace('Attribution', 'BY') + .replace('NonCommercial', 'NC') + .replace('NoDerivatives', 'ND') + .replace(/ (\d)/, '-$1') + .replace(/ ?International/, ''); + }, + // e.g. 'Attribution-NonCommercial' + function(argument) { + return 'CC-' + + argument + .replace('Attribution', 'BY') + .replace('NonCommercial', 'NC') + .replace('NoDerivatives', 'ND') + .replace(/ (\d)/, '-$1') + .replace(/ ?International/, '') + + '-4.0'; + } +]; + +// If all else fails, guess that strings containing certain substrings +// meant to identify certain licenses. +var lastResorts = [ + ['UNLI', 'Unlicense'], + ['WTF', 'WTFPL'], + ['2 CLAUSE', 'BSD-2-Clause'], + ['2-CLAUSE', 'BSD-2-Clause'], + ['3 CLAUSE', 'BSD-3-Clause'], + ['3-CLAUSE', 'BSD-3-Clause'], + ['AFFERO', 'AGPL-3.0'], + ['AGPL', 'AGPL-3.0'], + ['APACHE', 'Apache-2.0'], + ['ARTISTIC', 'Artistic-2.0'], + ['Affero', 'AGPL-3.0'], + ['BEER', 'Beerware'], + ['BOOST', 'BSL-1.0'], + ['BSD', 'BSD-2-Clause'], + ['ECLIPSE', 'EPL-1.0'], + ['FUCK', 'WTFPL'], + ['GNU', 'GPL-3.0'], + ['LGPL', 'LGPL-3.0'], + ['GPL', 'GPL-3.0'], + ['MIT', 'MIT'], + ['MPL', 'MPL-2.0'], + ['X11', 'X11'], + ['ZLIB', 'Zlib'] +]; + +var SUBSTRING = 0; +var IDENTIFIER = 1; + +var validTransformation = function(identifier) { + for (var i = 0; i < transforms.length; i++) { + var transformed = transforms[i](identifier); + if (transformed !== identifier && valid(transformed)) { + return transformed; + } + } + return null; +}; + +var validLastResort = function(identifier) { + var upperCased = identifier.toUpperCase(); + for (var i = 0; i < lastResorts.length; i++) { + var lastResort = lastResorts[i]; + if (upperCased.indexOf(lastResort[SUBSTRING]) > -1) { + return lastResort[IDENTIFIER]; + } + } + return null; +}; + +var anyCorrection = function(identifier, check) { + for (var i = 0; i < transpositions.length; i++) { + var transposition = transpositions[i]; + var transposed = transposition[TRANSPOSED]; + if (identifier.indexOf(transposed) > -1) { + var corrected = identifier.replace( + transposed, + transposition[CORRECT] + ); + var checked = check(corrected); + if (checked !== null) { + return checked; + } + } + } + return null; +}; + +module.exports = function(identifier) { + identifier = identifier.replace(/\+$/, ''); + if (valid(identifier)) { + return identifier; + } + var transformed = validTransformation(identifier); + if (transformed !== null) { + return transformed; + } + transformed = anyCorrection(identifier, function(argument) { + if (valid(argument)) { + return argument; + } + return validTransformation(argument); + }); + if (transformed !== null) { + return transformed; + } + transformed = validLastResort(identifier); + if (transformed !== null) { + return transformed; + } + transformed = anyCorrection(identifier, validLastResort); + if (transformed !== null) { + return transformed; + } + return null; +}; diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/package.json new file mode 100644 index 00000000..1fcb7303 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/package.json @@ -0,0 +1,65 @@ +{ + "name": "spdx-correct", + "description": "correct invalid SPDX identifiers", + "version": "1.0.2", + "author": { + "name": "Kyle E. Mitchell", + "email": "kyle@kemitchell.com", + "url": "https://kemitchell.com" + }, + "dependencies": { + "spdx-license-ids": "^1.0.2" + }, + "devDependencies": { + "defence-cli": "^1.0.1", + "replace-require-self": "^1.0.0", + "spdx-expression-parse": "^1.0.0", + "tape": "~4.0.0" + }, + "keywords": [ + "SPDX", + "law", + "legal", + "license", + "metadata" + ], + "license": "Apache-2.0", + "repository": { + "type": "git", + "url": "git+https://github.com/kemitchell/spdx-correct.js.git" + }, + "scripts": { + "test": "defence README.md | replace-require-self | node && tape *.test.js" + }, + "gitHead": "8430a3ad521e1455208db33faafcb79c7b074236", + "bugs": { + "url": "https://github.com/kemitchell/spdx-correct.js/issues" + }, + "homepage": "https://github.com/kemitchell/spdx-correct.js#readme", + "_id": "spdx-correct@1.0.2", + "_shasum": "4b3073d933ff51f3912f03ac5519498a4150db40", + "_from": "spdx-correct@>=1.0.0 <1.1.0", + "_npmVersion": "3.3.6", + "_nodeVersion": "4.2.1", + "_npmUser": { + "name": "kemitchell", + "email": "kyle@kemitchell.com" + }, + "dist": { + "shasum": "4b3073d933ff51f3912f03ac5519498a4150db40", + "tarball": "http://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz" + }, + "maintainers": [ + { + "name": "kemitchell", + "email": "kyle@kemitchell.com" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/LICENSE new file mode 100644 index 00000000..51a8d6bf --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/LICENSE @@ -0,0 +1,22 @@ +The MIT License + +Copyright (c) 2015 Kyle E. Mitchell and other contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/README.md new file mode 100644 index 00000000..4b96d3e2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/README.md @@ -0,0 +1,44 @@ +```javascript +var parse = require('spdx-expression-parse') +var assert = require('assert') + +var firstAST = { + left: { license: 'LGPL-2.1' }, + conjunction: 'or', + right: { + left: { license: 'BSD-3-Clause' }, + conjunction: 'and', + right: { license: 'MIT' } } } + +assert.deepEqual( + parse('(LGPL-2.1 OR BSD-3-Clause AND MIT)'), + firstAST) + +var secondAST = { + left: { license: 'MIT' }, + conjunction: 'and', + right: { + left: { + license: 'LGPL-2.1', + plus: true }, + conjunction: 'and', + right: { license: 'BSD-3-Clause' } } } + +assert.deepEqual( + parse('(MIT AND (LGPL-2.1+ AND BSD-3-Clause))'), + secondAST) + +// We handle all the bare SPDX license and exception ids as well. +require('spdx-license-ids').forEach(function(id) { + assert.deepEqual( + parse(id), + { license: id }) + require('spdx-exceptions').forEach(function(e) { + assert.deepEqual( + parse(id + ' WITH ' + e), + { license: id, exception: e }) }) }) +``` + +--- + +[The Software Package Data Exchange (SPDX) specification](http://spdx.org) is the work of the [Linux Foundation](http://www.linuxfoundation.org) and its contributors, and is licensed under the terms of [the Creative Commons Attribution License 3.0 Unported (SPDX: "CC-BY-3.0")](http://spdx.org/licenses/CC-BY-3.0). "SPDX" is a United States federally registered trademark of the Linux Foundation. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/index.js new file mode 100644 index 00000000..3f38e3a7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/index.js @@ -0,0 +1,4 @@ +var parser = require('./parser.generated.js').parser + +module.exports = function(argument) { + return parser.parse(argument) } diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/node_modules/spdx-exceptions/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/node_modules/spdx-exceptions/README.md new file mode 100644 index 00000000..43a66372 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/node_modules/spdx-exceptions/README.md @@ -0,0 +1 @@ +The package exports an array of strings. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/node_modules/spdx-exceptions/index.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/node_modules/spdx-exceptions/index.json new file mode 100644 index 00000000..3b84277b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/node_modules/spdx-exceptions/index.json @@ -0,0 +1,24 @@ +[ + "389-exception", + "Autoconf-exception-2.0", + "Autoconf-exception-3.0", + "Bison-exception-2.2", + "CLISP-exception-2.0", + "Classpath-exception-2.0", + "FLTK-exception", + "FLTK-exception-2.0", + "Font-exception-2.0", + "GCC-exception-2.0", + "GCC-exception-3.1", + "LZMA-exception", + "Libtool-exception", + "Nokia-Qt-exception-1.1", + "Qwt-exception-1.0", + "WxWindows-exception-3.1", + "eCos-exception-2.0", + "freertos-exception-2.0", + "gnu-javamail-exception", + "i2p-gpl-java-exception", + "mif-exception", + "u-boot-exception-2.0" +] diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/node_modules/spdx-exceptions/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/node_modules/spdx-exceptions/package.json new file mode 100644 index 00000000..734aafb5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/node_modules/spdx-exceptions/package.json @@ -0,0 +1,48 @@ +{ + "name": "spdx-exceptions", + "description": "list of SPDX standard license exceptions", + "version": "1.0.4", + "author": { + "name": "The Linux Foundation" + }, + "contributors": [ + { + "name": "Kyle E. Mitchell", + "email": "kyle@kemitchell.com", + "url": "https://kemitchell.com/" + } + ], + "license": "CC-BY-3.0", + "repository": { + "type": "git", + "url": "git+https://github.com/kemitchell/spdx-exceptions.json.git" + }, + "gitHead": "770316d6c946417ab6efa8533b82d0b61779092b", + "bugs": { + "url": "https://github.com/kemitchell/spdx-exceptions.json/issues" + }, + "homepage": "https://github.com/kemitchell/spdx-exceptions.json#readme", + "_id": "spdx-exceptions@1.0.4", + "scripts": {}, + "_shasum": "220b84239119ae9045a892db81a83f4ce16f80fd", + "_from": "spdx-exceptions@>=1.0.4 <2.0.0", + "_npmVersion": "3.3.6", + "_nodeVersion": "5.0.0", + "_npmUser": { + "name": "kemitchell", + "email": "kyle@kemitchell.com" + }, + "dist": { + "shasum": "220b84239119ae9045a892db81a83f4ce16f80fd", + "tarball": "http://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-1.0.4.tgz" + }, + "maintainers": [ + { + "name": "kemitchell", + "email": "kyle@kemitchell.com" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-1.0.4.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/package.json new file mode 100644 index 00000000..662d8b47 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/package.json @@ -0,0 +1,66 @@ +{ + "name": "spdx-expression-parse", + "description": "parse SPDX license expressions", + "version": "1.0.2", + "author": { + "name": "Kyle E. Mitchell", + "email": "kyle@kemitchell.com", + "url": "http://kemitchell.com" + }, + "dependencies": { + "spdx-exceptions": "^1.0.4", + "spdx-license-ids": "^1.0.0" + }, + "devDependencies": { + "defence-cli": "^1.0.1", + "jison": "^0.4.15", + "replace-require-self": "^1.0.0", + "uglify-js": "^2.4.24" + }, + "keywords": [ + "SPDX", + "law", + "legal", + "license", + "metadata", + "package", + "package.json", + "standards" + ], + "license": "(MIT AND CC-BY-3.0)", + "repository": { + "type": "git", + "url": "git+https://github.com/kemitchell/spdx-expression-parse.js.git" + }, + "scripts": { + "prepublish": "node generate-parser.js | uglifyjs > parser.generated.js", + "pretest": "npm run prepublish", + "test": "defence -i javascript README.md | replace-require-self | node" + }, + "gitHead": "ffe2fa7272ebf640b18286fc561f17a844d4f06b", + "bugs": { + "url": "https://github.com/kemitchell/spdx-expression-parse.js/issues" + }, + "homepage": "https://github.com/kemitchell/spdx-expression-parse.js#readme", + "_id": "spdx-expression-parse@1.0.2", + "_shasum": "d52b14b5e9670771440af225bcb563122ac452f6", + "_from": "spdx-expression-parse@>=1.0.0 <1.1.0", + "_npmVersion": "3.3.6", + "_nodeVersion": "5.0.0", + "_npmUser": { + "name": "kemitchell", + "email": "kyle@kemitchell.com" + }, + "dist": { + "shasum": "d52b14b5e9670771440af225bcb563122ac452f6", + "tarball": "http://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.2.tgz" + }, + "maintainers": [ + { + "name": "kemitchell", + "email": "kyle@kemitchell.com" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.2.tgz" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/parser.generated.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/parser.generated.js new file mode 100644 index 00000000..7d9665a8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/parser.generated.js @@ -0,0 +1 @@ +var spdxparse=function(){var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,5],$V1=[1,6],$V2=[1,7],$V3=[1,4],$V4=[1,9],$V5=[1,10],$V6=[5,14,15,17],$V7=[5,12,14,15,17];var parser={trace:function trace(){},yy:{},symbols_:{error:2,start:3,expression:4,EOS:5,simpleExpression:6,LICENSE:7,PLUS:8,LICENSEREF:9,DOCUMENTREF:10,COLON:11,WITH:12,EXCEPTION:13,AND:14,OR:15,OPEN:16,CLOSE:17,$accept:0,$end:1},terminals_:{2:"error",5:"EOS",7:"LICENSE",8:"PLUS",9:"LICENSEREF",10:"DOCUMENTREF",11:"COLON",12:"WITH",13:"EXCEPTION",14:"AND",15:"OR",16:"OPEN",17:"CLOSE"},productions_:[0,[3,2],[6,1],[6,2],[6,1],[6,3],[4,1],[4,3],[4,3],[4,3],[4,3]],performAction:function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$){var $0=$$.length-1;switch(yystate){case 1:return this.$=$$[$0-1];break;case 2:case 4:case 5:this.$={license:yytext};break;case 3:this.$={license:$$[$0-1],plus:true};break;case 6:this.$=$$[$0];break;case 7:this.$={exception:$$[$0]};this.$.license=$$[$0-2].license;if($$[$0-2].hasOwnProperty("plus")){this.$.plus=$$[$0-2].plus}break;case 8:this.$={conjunction:"and",left:$$[$0-2],right:$$[$0]};break;case 9:this.$={conjunction:"or",left:$$[$0-2],right:$$[$0]};break;case 10:this.$=$$[$0-1];break}},table:[{3:1,4:2,6:3,7:$V0,9:$V1,10:$V2,16:$V3},{1:[3]},{5:[1,8],14:$V4,15:$V5},o($V6,[2,6],{12:[1,11]}),{4:12,6:3,7:$V0,9:$V1,10:$V2,16:$V3},o($V7,[2,2],{8:[1,13]}),o($V7,[2,4]),{11:[1,14]},{1:[2,1]},{4:15,6:3,7:$V0,9:$V1,10:$V2,16:$V3},{4:16,6:3,7:$V0,9:$V1,10:$V2,16:$V3},{13:[1,17]},{14:$V4,15:$V5,17:[1,18]},o($V7,[2,3]),{9:[1,19]},o($V6,[2,8]),o([5,15,17],[2,9],{14:$V4}),o($V6,[2,7]),o($V6,[2,10]),o($V7,[2,5])],defaultActions:{8:[2,1]},parseError:function parseError(str,hash){if(hash.recoverable){this.trace(str)}else{throw new Error(str)}},parse:function parse(input){var self=this,stack=[0],tstack=[],vstack=[null],lstack=[],table=this.table,yytext="",yylineno=0,yyleng=0,recovering=0,TERROR=2,EOF=1;var args=lstack.slice.call(arguments,1);var lexer=Object.create(this.lexer);var sharedState={yy:{}};for(var k in this.yy){if(Object.prototype.hasOwnProperty.call(this.yy,k)){sharedState.yy[k]=this.yy[k]}}lexer.setInput(input,sharedState.yy);sharedState.yy.lexer=lexer;sharedState.yy.parser=this;if(typeof lexer.yylloc=="undefined"){lexer.yylloc={}}var yyloc=lexer.yylloc;lstack.push(yyloc);var ranges=lexer.options&&lexer.options.ranges;if(typeof sharedState.yy.parseError==="function"){this.parseError=sharedState.yy.parseError}else{this.parseError=Object.getPrototypeOf(this).parseError}function popStack(n){stack.length=stack.length-2*n;vstack.length=vstack.length-n;lstack.length=lstack.length-n}_token_stack:function lex(){var token;token=lexer.lex()||EOF;if(typeof token!=="number"){token=self.symbols_[token]||token}return token}var symbol,preErrorSymbol,state,action,a,r,yyval={},p,len,newState,expected;while(true){state=stack[stack.length-1];if(this.defaultActions[state]){action=this.defaultActions[state]}else{if(symbol===null||typeof symbol=="undefined"){symbol=lex()}action=table[state]&&table[state][symbol]}if(typeof action==="undefined"||!action.length||!action[0]){var errStr="";expected=[];for(p in table[state]){if(this.terminals_[p]&&p>TERROR){expected.push("'"+this.terminals_[p]+"'")}}if(lexer.showPosition){errStr="Parse error on line "+(yylineno+1)+":\n"+lexer.showPosition()+"\nExpecting "+expected.join(", ")+", got '"+(this.terminals_[symbol]||symbol)+"'"}else{errStr="Parse error on line "+(yylineno+1)+": Unexpected "+(symbol==EOF?"end of input":"'"+(this.terminals_[symbol]||symbol)+"'")}this.parseError(errStr,{text:lexer.match,token:this.terminals_[symbol]||symbol,line:lexer.yylineno,loc:yyloc,expected:expected})}if(action[0]instanceof Array&&action.length>1){throw new Error("Parse Error: multiple actions possible at state: "+state+", token: "+symbol)}switch(action[0]){case 1:stack.push(symbol);vstack.push(lexer.yytext);lstack.push(lexer.yylloc);stack.push(action[1]);symbol=null;if(!preErrorSymbol){yyleng=lexer.yyleng;yytext=lexer.yytext;yylineno=lexer.yylineno;yyloc=lexer.yylloc;if(recovering>0){recovering--}}else{symbol=preErrorSymbol;preErrorSymbol=null}break;case 2:len=this.productions_[action[1]][1];yyval.$=vstack[vstack.length-len];yyval._$={first_line:lstack[lstack.length-(len||1)].first_line,last_line:lstack[lstack.length-1].last_line,first_column:lstack[lstack.length-(len||1)].first_column,last_column:lstack[lstack.length-1].last_column};if(ranges){yyval._$.range=[lstack[lstack.length-(len||1)].range[0],lstack[lstack.length-1].range[1]]}r=this.performAction.apply(yyval,[yytext,yyleng,yylineno,sharedState.yy,action[1],vstack,lstack].concat(args));if(typeof r!=="undefined"){return r}if(len){stack=stack.slice(0,-1*len*2);vstack=vstack.slice(0,-1*len);lstack=lstack.slice(0,-1*len)}stack.push(this.productions_[action[1]][0]);vstack.push(yyval.$);lstack.push(yyval._$);newState=table[stack[stack.length-2]][stack[stack.length-1]];stack.push(newState);break;case 3:return true}}return true}};var lexer=function(){var lexer={EOF:1,parseError:function parseError(str,hash){if(this.yy.parser){this.yy.parser.parseError(str,hash)}else{throw new Error(str)}},setInput:function(input,yy){this.yy=yy||this.yy||{};this._input=input;this._more=this._backtrack=this.done=false;this.yylineno=this.yyleng=0;this.yytext=this.matched=this.match="";this.conditionStack=["INITIAL"];this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};if(this.options.ranges){this.yylloc.range=[0,0]}this.offset=0;return this},input:function(){var ch=this._input[0];this.yytext+=ch;this.yyleng++;this.offset++;this.match+=ch;this.matched+=ch;var lines=ch.match(/(?:\r\n?|\n).*/g);if(lines){this.yylineno++;this.yylloc.last_line++}else{this.yylloc.last_column++}if(this.options.ranges){this.yylloc.range[1]++}this._input=this._input.slice(1);return ch},unput:function(ch){var len=ch.length;var lines=ch.split(/(?:\r\n?|\n)/g);this._input=ch+this._input;this.yytext=this.yytext.substr(0,this.yytext.length-len);this.offset-=len;var oldLines=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1);this.matched=this.matched.substr(0,this.matched.length-1);if(lines.length-1){this.yylineno-=lines.length-1}var r=this.yylloc.range;this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:lines?(lines.length===oldLines.length?this.yylloc.first_column:0)+oldLines[oldLines.length-lines.length].length-lines[0].length:this.yylloc.first_column-len};if(this.options.ranges){this.yylloc.range=[r[0],r[0]+this.yyleng-len]}this.yyleng=this.yytext.length;return this},more:function(){this._more=true;return this},reject:function(){if(this.options.backtrack_lexer){this._backtrack=true}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}return this},less:function(n){this.unput(this.match.slice(n))},pastInput:function(){var past=this.matched.substr(0,this.matched.length-this.match.length);return(past.length>20?"...":"")+past.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var next=this.match;if(next.length<20){next+=this._input.substr(0,20-next.length)}return(next.substr(0,20)+(next.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var pre=this.pastInput();var c=new Array(pre.length+1).join("-");return pre+this.upcomingInput()+"\n"+c+"^"},test_match:function(match,indexed_rule){var token,lines,backup;if(this.options.backtrack_lexer){backup={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done};if(this.options.ranges){backup.yylloc.range=this.yylloc.range.slice(0)}}lines=match[0].match(/(?:\r\n?|\n).*/g);if(lines){this.yylineno+=lines.length}this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:lines?lines[lines.length-1].length-lines[lines.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+match[0].length};this.yytext+=match[0];this.match+=match[0];this.matches=match;this.yyleng=this.yytext.length;if(this.options.ranges){this.yylloc.range=[this.offset,this.offset+=this.yyleng]}this._more=false;this._backtrack=false;this._input=this._input.slice(match[0].length);this.matched+=match[0];token=this.performAction.call(this,this.yy,this,indexed_rule,this.conditionStack[this.conditionStack.length-1]);if(this.done&&this._input){this.done=false}if(token){return token}else if(this._backtrack){for(var k in backup){this[k]=backup[k]}return false}return false},next:function(){if(this.done){return this.EOF}if(!this._input){this.done=true}var token,match,tempMatch,index;if(!this._more){this.yytext="";this.match=""}var rules=this._currentRules();for(var i=0;imatch[0].length)){match=tempMatch;index=i;if(this.options.backtrack_lexer){token=this.test_match(tempMatch,rules[i]);if(token!==false){return token}else if(this._backtrack){match=false;continue}else{return false}}else if(!this.options.flex){break}}}if(match){token=this.test_match(match,rules[index]);if(token!==false){return token}return false}if(this._input===""){return this.EOF}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}},lex:function lex(){var r=this.next();if(r){return r}else{return this.lex()}},begin:function begin(condition){this.conditionStack.push(condition)},popState:function popState(){var n=this.conditionStack.length-1;if(n>0){return this.conditionStack.pop()}else{return this.conditionStack[0]}},_currentRules:function _currentRules(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules}else{return this.conditions["INITIAL"].rules}},topState:function topState(n){n=this.conditionStack.length-1-Math.abs(n||0);if(n>=0){return this.conditionStack[n]}else{return"INITIAL"}},pushState:function pushState(condition){this.begin(condition)},stateStackSize:function stateStackSize(){return this.conditionStack.length},options:{},performAction:function anonymous(yy,yy_,$avoiding_name_collisions,YY_START){var YYSTATE=YY_START;switch($avoiding_name_collisions){case 0:return 5;break;case 1:break;case 2:return 8;break;case 3:return 16;break;case 4:return 17;break;case 5:return 11;break;case 6:return 10;break;case 7:return 9;break;case 8:return 14;break;case 9:return 15;break;case 10:return 12;break;case 11:return 7;break;case 12:return 7;break;case 13:return 7;break;case 14:return 13;break;case 15:return 13;break;case 16:return 13;break;case 17:return 13;break;case 18:return 13;break;case 19:return 13;break;case 20:return 13;break;case 21:return 13;break;case 22:return 7;break;case 23:return 7;break;case 24:return 13;break;case 25:return 13;break;case 26:return 13;break;case 27:return 7;break;case 28:return 13;break;case 29:return 13;break;case 30:return 13;break;case 31:return 7;break;case 32:return 7;break;case 33:return 13;break;case 34:return 13;break;case 35:return 13;break;case 36:return 7;break;case 37:return 13;break;case 38:return 7;break;case 39:return 7;break;case 40:return 7;break;case 41:return 7;break;case 42:return 7;break;case 43:return 7;break;case 44:return 7;break;case 45:return 7;break;case 46:return 7;break;case 47:return 7;break;case 48:return 7;break;case 49:return 7;break;case 50:return 7;break;case 51:return 13;break;case 52:return 7;break;case 53:return 7;break;case 54:return 7;break;case 55:return 13;break;case 56:return 7;break;case 57:return 7;break;case 58:return 7;break;case 59:return 13;break;case 60:return 7;break;case 61:return 13;break;case 62:return 7;break;case 63:return 7;break;case 64:return 7;break;case 65:return 7;break;case 66:return 7;break;case 67:return 7;break;case 68:return 7;break;case 69:return 7;break;case 70:return 7;break;case 71:return 7;break;case 72:return 7;break;case 73:return 7;break;case 74:return 7;break;case 75:return 7;break;case 76:return 7;break;case 77:return 7;break;case 78:return 7;break;case 79:return 7;break;case 80:return 7;break;case 81:return 7;break;case 82:return 7;break;case 83:return 7;break;case 84:return 7;break;case 85:return 7;break;case 86:return 7;break;case 87:return 7;break;case 88:return 7;break;case 89:return 7;break;case 90:return 7;break;case 91:return 7;break;case 92:return 7;break;case 93:return 7;break;case 94:return 7;break;case 95:return 7;break;case 96:return 7;break;case 97:return 7;break;case 98:return 7;break;case 99:return 7;break;case 100:return 7;break;case 101:return 7;break;case 102:return 7;break;case 103:return 7;break;case 104:return 7;break;case 105:return 7;break;case 106:return 7;break;case 107:return 7;break;case 108:return 7;break;case 109:return 7;break;case 110:return 7;break;case 111:return 7;break;case 112:return 7;break;case 113:return 7;break;case 114:return 7;break;case 115:return 7;break;case 116:return 7;break;case 117:return 7;break;case 118:return 7;break;case 119:return 7;break;case 120:return 7;break;case 121:return 7;break;case 122:return 7;break;case 123:return 7;break;case 124:return 7;break;case 125:return 7;break;case 126:return 7;break;case 127:return 7;break;case 128:return 7;break;case 129:return 7;break;case 130:return 7;break;case 131:return 7;break;case 132:return 7;break;case 133:return 7;break;case 134:return 7;break;case 135:return 7;break;case 136:return 7;break;case 137:return 7;break;case 138:return 7;break;case 139:return 7;break;case 140:return 7;break;case 141:return 7;break;case 142:return 7;break;case 143:return 7;break;case 144:return 7;break;case 145:return 7;break;case 146:return 7;break;case 147:return 7;break;case 148:return 7;break;case 149:return 7;break;case 150:return 7;break;case 151:return 7;break;case 152:return 7;break;case 153:return 7;break;case 154:return 7;break;case 155:return 7;break;case 156:return 7;break;case 157:return 7;break;case 158:return 7;break;case 159:return 7;break;case 160:return 7;break;case 161:return 7;break;case 162:return 7;break;case 163:return 7;break;case 164:return 7;break;case 165:return 7;break;case 166:return 7;break;case 167:return 7;break;case 168:return 7;break;case 169:return 7;break;case 170:return 7;break;case 171:return 7;break;case 172:return 7;break;case 173:return 7;break;case 174:return 7;break;case 175:return 7;break;case 176:return 7;break;case 177:return 7;break;case 178:return 7;break;case 179:return 7;break;case 180:return 7;break;case 181:return 7;break;case 182:return 7;break;case 183:return 7;break;case 184:return 7;break;case 185:return 7;break;case 186:return 7;break;case 187:return 7;break;case 188:return 7;break;case 189:return 7;break;case 190:return 7;break;case 191:return 7;break;case 192:return 7;break;case 193:return 7;break;case 194:return 7;break;case 195:return 7;break;case 196:return 7;break;case 197:return 7;break;case 198:return 7;break;case 199:return 7;break;case 200:return 7;break;case 201:return 7;break;case 202:return 7;break;case 203:return 7;break;case 204:return 7;break;case 205:return 7;break;case 206:return 7;break;case 207:return 7;break;case 208:return 7;break;case 209:return 7;break;case 210:return 7;break;case 211:return 7;break;case 212:return 7;break;case 213:return 7;break;case 214:return 7;break;case 215:return 7;break;case 216:return 7;break;case 217:return 7;break;case 218:return 7;break;case 219:return 7;break;case 220:return 7;break;case 221:return 7;break;case 222:return 7;break;case 223:return 7;break;case 224:return 7;break;case 225:return 7;break;case 226:return 7;break;case 227:return 7;break;case 228:return 7;break;case 229:return 7;break;case 230:return 7;break;case 231:return 7;break;case 232:return 7;break;case 233:return 7;break;case 234:return 7;break;case 235:return 7;break;case 236:return 7;break;case 237:return 7;break;case 238:return 7;break;case 239:return 7;break;case 240:return 7;break;case 241:return 7;break;case 242:return 7;break;case 243:return 7;break;case 244:return 7;break;case 245:return 7;break;case 246:return 7;break;case 247:return 7;break;case 248:return 7;break;case 249:return 7;break;case 250:return 7;break;case 251:return 7;break;case 252:return 7;break;case 253:return 7;break;case 254:return 7;break;case 255:return 7;break;case 256:return 7;break;case 257:return 7;break;case 258:return 7;break;case 259:return 7;break;case 260:return 7;break;case 261:return 7;break;case 262:return 7;break;case 263:return 7;break;case 264:return 7;break;case 265:return 7;break;case 266:return 7;break;case 267:return 7;break;case 268:return 7;break;case 269:return 7;break;case 270:return 7;break;case 271:return 7;break;case 272:return 7;break;case 273:return 7;break;case 274:return 7;break;case 275:return 7;break;case 276:return 7;break;case 277:return 7;break;case 278:return 7;break;case 279:return 7;break;case 280:return 7;break;case 281:return 7;break;case 282:return 7;break;case 283:return 7;break;case 284:return 7;break;case 285:return 7;break;case 286:return 7;break;case 287:return 7;break;case 288:return 7;break;case 289:return 7;break;case 290:return 7;break;case 291:return 7;break;case 292:return 7;break;case 293:return 7;break;case 294:return 7;break;case 295:return 7;break;case 296:return 7;break;case 297:return 7;break;case 298:return 7;break;case 299:return 7;break;case 300:return 7;break;case 301:return 7;break;case 302:return 7;break;case 303:return 7;break;case 304:return 7;break;case 305:return 7;break;case 306:return 7;break;case 307:return 7;break;case 308:return 7;break;case 309:return 7;break;case 310:return 7;break;case 311:return 7;break;case 312:return 7;break;case 313:return 7;break;case 314:return 7;break;case 315:return 7;break;case 316:return 7;break;case 317:return 7;break;case 318:return 7;break;case 319:return 7;break;case 320:return 7;break;case 321:return 7;break;case 322:return 7;break;case 323:return 7;break;case 324:return 7;break;case 325:return 7;break;case 326:return 7;break;case 327:return 7;break;case 328:return 7;break;case 329:return 7;break;case 330:return 7;break;case 331:return 7;break;case 332:return 7;break;case 333:return 7;break;case 334:return 7;break;case 335:return 7;break;case 336:return 7;break;case 337:return 7;break;case 338:return 7;break}},rules:[/^(?:$)/,/^(?:\s+)/,/^(?:\+)/,/^(?:\()/,/^(?:\))/,/^(?::)/,/^(?:DocumentRef-([0-9A-Za-z-+.]+))/,/^(?:LicenseRef-([0-9A-Za-z-+.]+))/,/^(?:AND)/,/^(?:OR)/,/^(?:WITH)/,/^(?:MPL-2\.0-no-copyleft-exception)/,/^(?:CNRI-Python-GPL-Compatible)/,/^(?:BSD-3-Clause-Attribution)/,/^(?:WxWindows-exception-3\.1)/,/^(?:Classpath-exception-2\.0)/,/^(?:gnu-javamail-exception)/,/^(?:freertos-exception-2\.0)/,/^(?:i2p-gpl-java-exception)/,/^(?:Autoconf-exception-2\.0)/,/^(?:Nokia-Qt-exception-1\.1)/,/^(?:Autoconf-exception-3\.0)/,/^(?:zlib-acknowledgement)/,/^(?:BSD-2-Clause-FreeBSD)/,/^(?:u-boot-exception-2\.0)/,/^(?:Bison-exception-2\.2)/,/^(?:CLISP-exception-2\.0)/,/^(?:BSD-2-Clause-NetBSD)/,/^(?:FLTK-exception-2\.0)/,/^(?:eCos-exception-2\.0)/,/^(?:Font-exception-2\.0)/,/^(?:BSD-3-Clause-Clear)/,/^(?:BSD-3-Clause-LBNL)/,/^(?:GCC-exception-3\.1)/,/^(?:Qwt-exception-1\.0)/,/^(?:GCC-exception-2\.0)/,/^(?:Artistic-1\.0-Perl)/,/^(?:Libtool-exception)/,/^(?:Artistic-1\.0-cl8)/,/^(?:CC-BY-NC-SA-4\.0)/,/^(?:CC-BY-NC-SA-1\.0)/,/^(?:CC-BY-NC-ND-4\.0)/,/^(?:CC-BY-NC-SA-3\.0)/,/^(?:CC-BY-NC-ND-3\.0)/,/^(?:CC-BY-NC-SA-2\.5)/,/^(?:CC-BY-NC-ND-2\.0)/,/^(?:CC-BY-NC-ND-1\.0)/,/^(?:CC-BY-NC-SA-2\.0)/,/^(?:MIT-advertising)/,/^(?:BSD-4-Clause-UC)/,/^(?:CC-BY-NC-ND-2\.5)/,/^(?:FLTK-exception)/,/^(?:SugarCRM-1\.1\.3)/,/^(?:CrystalStacker)/,/^(?:BSD-Protection)/,/^(?:LZMA-exception)/,/^(?:BitTorrent-1\.1)/,/^(?:BitTorrent-1\.0)/,/^(?:Frameworx-1\.0)/,/^(?:mif-exception)/,/^(?:Interbase-1\.0)/,/^(?:389-exception)/,/^(?:HaskellReport)/,/^(?:CC-BY-NC-3\.0)/,/^(?:CC-BY-ND-4\.0)/,/^(?:CC-BY-NC-1\.0)/,/^(?:CC-BY-NC-2\.0)/,/^(?:CC-BY-NC-2\.5)/,/^(?:CC-BY-SA-4\.0)/,/^(?:CC-BY-NC-4\.0)/,/^(?:W3C-19980720)/,/^(?:BSD-4-Clause)/,/^(?:Artistic-1\.0)/,/^(?:BSD-3-Clause)/,/^(?:CC-BY-ND-1\.0)/,/^(?:BSD-2-Clause)/,/^(?:CC-BY-ND-2\.0)/,/^(?:CC-BY-ND-2\.5)/,/^(?:CC-BY-ND-3\.0)/,/^(?:Artistic-2\.0)/,/^(?:CC-BY-SA-1\.0)/,/^(?:CC-BY-SA-2\.0)/,/^(?:CC-BY-SA-2\.5)/,/^(?:CC-BY-SA-3\.0)/,/^(?:XFree86-1\.1)/,/^(?:OLDAP-2\.0\.1)/,/^(?:bzip2-1\.0\.6)/,/^(?:OLDAP-2\.2\.1)/,/^(?:ImageMagick)/,/^(?:Unicode-TOU)/,/^(?:Adobe-Glyph)/,/^(?:CUA-OPL-1\.0)/,/^(?:CNRI-Jython)/,/^(?:CNRI-Python)/,/^(?:bzip2-1\.0\.5)/,/^(?:OLDAP-2\.2\.2)/,/^(?:PostgreSQL)/,/^(?:Apache-1\.1)/,/^(?:CECILL-1\.0)/,/^(?:Apache-2\.0)/,/^(?:Zimbra-1\.4)/,/^(?:CECILL-1\.1)/,/^(?:Zimbra-1\.3)/,/^(?:Adobe-2006)/,/^(?:JasPer-2\.0)/,/^(?:CECILL-2\.0)/,/^(?:TORQUE-1\.1)/,/^(?:CECILL-2\.1)/,/^(?:Watcom-1\.0)/,/^(?:Intel-ACPI)/,/^(?:ClArtistic)/,/^(?:Spencer-99)/,/^(?:Condor-1\.1)/,/^(?:Spencer-94)/,/^(?:gSOAP-1\.3b)/,/^(?:EUDatagrid)/,/^(?:Spencer-86)/,/^(?:Python-2\.0)/,/^(?:RHeCos-1\.1)/,/^(?:CATOSL-1\.1)/,/^(?:Apache-1\.0)/,/^(?:FreeImage)/,/^(?:SGI-B-1\.1)/,/^(?:SGI-B-1\.0)/,/^(?:SimPL-2\.0)/,/^(?:Sleepycat)/,/^(?:Crossword)/,/^(?:ErlPL-1\.1)/,/^(?:CPOL-1\.02)/,/^(?:OLDAP-2\.8)/,/^(?:OLDAP-2\.7)/,/^(?:OLDAP-2\.6)/,/^(?:CC-BY-1\.0)/,/^(?:OLDAP-2\.5)/,/^(?:OLDAP-2\.4)/,/^(?:OLDAP-2\.3)/,/^(?:SISSL-1\.2)/,/^(?:Unlicense)/,/^(?:SGI-B-2\.0)/,/^(?:OLDAP-2\.2)/,/^(?:OLDAP-2\.1)/,/^(?:CC-BY-2\.5)/,/^(?:D-FSL-1\.0)/,/^(?:LPPL-1\.3a)/,/^(?:LPPL-1\.3c)/,/^(?:OLDAP-2\.0)/,/^(?:CC-BY-3\.0)/,/^(?:Leptonica)/,/^(?:OLDAP-1\.4)/,/^(?:OLDAP-1\.3)/,/^(?:OLDAP-1\.2)/,/^(?:OLDAP-1\.1)/,/^(?:MakeIndex)/,/^(?:CC-BY-4\.0)/,/^(?:NPOSL-3\.0)/,/^(?:CC-BY-2\.0)/,/^(?:PHP-3\.01)/,/^(?:ANTLR-PD)/,/^(?:APSL-1\.0)/,/^(?:MIT-enna)/,/^(?:IBM-pibs)/,/^(?:APSL-1\.1)/,/^(?:APSL-1\.2)/,/^(?:Beerware)/,/^(?:EUPL-1\.0)/,/^(?:EUPL-1\.1)/,/^(?:diffmark)/,/^(?:CDDL-1\.0)/,/^(?:Zend-2\.0)/,/^(?:CDDL-1\.1)/,/^(?:CPAL-1\.0)/,/^(?:APSL-2\.0)/,/^(?:LPPL-1\.0)/,/^(?:AGPL-1\.0)/,/^(?:Giftware)/,/^(?:Abstyles)/,/^(?:LPPL-1\.1)/,/^(?:LPPL-1\.2)/,/^(?:Sendmail)/,/^(?:CECILL-B)/,/^(?:AGPL-3\.0)/,/^(?:GFDL-1\.1)/,/^(?:GFDL-1\.2)/,/^(?:GFDL-1\.3)/,/^(?:RPSL-1\.0)/,/^(?:LPL-1\.02)/,/^(?:CECILL-C)/,/^(?:Afmparse)/,/^(?:LGPL-2\.1)/,/^(?:PDDL-1\.0)/,/^(?:ODbL-1\.0)/,/^(?:OCLC-2\.0)/,/^(?:LGPL-3\.0)/,/^(?:Newsletr)/,/^(?:Motosoto)/,/^(?:NBPL-1\.0)/,/^(?:NASA-1\.3)/,/^(?:LGPL-2\.0)/,/^(?:FSFULLR)/,/^(?:MPL-2\.0)/,/^(?:Multics)/,/^(?:AFL-1\.1)/,/^(?:MPL-1\.1)/,/^(?:AFL-1\.2)/,/^(?:MPL-1\.0)/,/^(?:AFL-2\.0)/,/^(?:AFL-2\.1)/,/^(?:AFL-3\.0)/,/^(?:NPL-1\.0)/,/^(?:NPL-1\.1)/,/^(?:APL-1\.0)/,/^(?:Aladdin)/,/^(?:AMDPLPA)/,/^(?:BSL-1\.0)/,/^(?:Borceux)/,/^(?:Caldera)/,/^(?:MIT-CMU)/,/^(?:CPL-1\.0)/,/^(?:ZPL-2\.1)/,/^(?:ZPL-2\.0)/,/^(?:ZPL-1\.1)/,/^(?:CC0-1\.0)/,/^(?:YPL-1\.1)/,/^(?:LPL-1\.0)/,/^(?:libtiff)/,/^(?:YPL-1\.0)/,/^(?:Dotseqn)/,/^(?:Latex2e)/,/^(?:VSL-1\.0)/,/^(?:VOSTROM)/,/^(?:UPL-1\.0)/,/^(?:dvipdfm)/,/^(?:EPL-1\.0)/,/^(?:ECL-1\.0)/,/^(?:ECL-2\.0)/,/^(?:SPL-1\.0)/,/^(?:IPL-1\.0)/,/^(?:EFL-1\.0)/,/^(?:EFL-2\.0)/,/^(?:OPL-1\.0)/,/^(?:OSL-1\.0)/,/^(?:OSL-1\.1)/,/^(?:OSL-2\.0)/,/^(?:OSL-2\.1)/,/^(?:OSL-3\.0)/,/^(?:OpenSSL)/,/^(?:PHP-3\.0)/,/^(?:gnuplot)/,/^(?:Entessa)/,/^(?:GPL-3\.0)/,/^(?:Eurosym)/,/^(?:psutils)/,/^(?:GPL-2\.0)/,/^(?:QPL-1\.0)/,/^(?:MIT-feh)/,/^(?:OFL-1\.1)/,/^(?:GPL-1\.0)/,/^(?:RPL-1\.1)/,/^(?:RPL-1\.5)/,/^(?:OFL-1\.0)/,/^(?:Saxpath)/,/^(?:Bahyph)/,/^(?:RSA-MD)/,/^(?:Naumen)/,/^(?:NetCDF)/,/^(?:mpich2)/,/^(?:Glulxe)/,/^(?:APAFML)/,/^(?:psfrag)/,/^(?:Plexus)/,/^(?:SAX-PD)/,/^(?:MITNFA)/,/^(?:eGenix)/,/^(?:iMatix)/,/^(?:Imlib2)/,/^(?:Libpng)/,/^(?:xinetd)/,/^(?:LGPLLR)/,/^(?:Wsuipa)/,/^(?:SMLNJ)/,/^(?:RSCPL)/,/^(?:SISSL)/,/^(?:Rdisc)/,/^(?:Noweb)/,/^(?:Qhull)/,/^(?:Nunit)/,/^(?:GL2PS)/,/^(?:TMate)/,/^(?:MirOS)/,/^(?:MS-RL)/,/^(?:Intel)/,/^(?:MS-PL)/,/^(?:OGTSL)/,/^(?:WTFPL)/,/^(?:Nokia)/,/^(?:XSkat)/,/^(?:Glide)/,/^(?:FSFUL)/,/^(?:AMPAS)/,/^(?:Xerox)/,/^(?:0BSD)/,/^(?:Ruby)/,/^(?:JSON)/,/^(?:MTLL)/,/^(?:Cube)/,/^(?:Zlib)/,/^(?:NCSA)/,/^(?:TOSL)/,/^(?:Xnet)/,/^(?:DSDP)/,/^(?:HPND)/,/^(?:Barr)/,/^(?:SNIA)/,/^(?:ADSL)/,/^(?:NLPL)/,/^(?:Fair)/,/^(?:NOSL)/,/^(?:NGPL)/,/^(?:SCEA)/,/^(?:Zed)/,/^(?:DOC)/,/^(?:ICU)/,/^(?:Vim)/,/^(?:xpp)/,/^(?:OML)/,/^(?:AAL)/,/^(?:AML)/,/^(?:W3C)/,/^(?:ISC)/,/^(?:IPA)/,/^(?:X11)/,/^(?:MIT)/,/^(?:FTL)/,/^(?:IJG)/,/^(?:TCL)/,/^(?:SWL)/,/^(?:NTP)/,/^(?:Mup)/,/^(?:NRL)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338],inclusive:true}}};return lexer}();parser.lexer=lexer;function Parser(){this.yy={}}Parser.prototype=parser;parser.Parser=Parser;return new Parser}();if(typeof require!=="undefined"&&typeof exports!=="undefined"){exports.parser=spdxparse;exports.Parser=spdxparse.Parser;exports.parse=function(){return spdxparse.parse.apply(spdxparse,arguments)};exports.main=function commonjsMain(args){if(!args[1]){console.log("Usage: "+args[0]+" FILE");process.exit(1)}var source=require("fs").readFileSync(require("path").normalize(args[1]),"utf8");return exports.parser.parse(source)};if(typeof module!=="undefined"&&require.main===module){exports.main(process.argv.slice(1))}} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/package.json new file mode 100644 index 00000000..1b7e084b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-license/package.json @@ -0,0 +1,63 @@ +{ + "name": "validate-npm-package-license", + "description": "Give me a string and I'll tell you if it's a valid npm package license string", + "version": "3.0.1", + "author": { + "name": "Kyle E. Mitchell", + "email": "kyle@kemitchell.com", + "url": "https://kemitchell.com" + }, + "dependencies": { + "spdx-correct": "~1.0.0", + "spdx-expression-parse": "~1.0.0" + }, + "devDependencies": { + "defence-cli": "^1.0.1", + "replace-require-self": "^1.0.0" + }, + "keywords": [ + "license", + "npm", + "package", + "validation" + ], + "license": "Apache-2.0", + "repository": { + "type": "git", + "url": "git+https://github.com/kemitchell/validate-npm-package-license.js.git" + }, + "scripts": { + "test": "defence README.md | replace-require-self | node" + }, + "gitHead": "00200d28f9960985f221bc1a8a71e4760daf39bf", + "bugs": { + "url": "https://github.com/kemitchell/validate-npm-package-license.js/issues" + }, + "homepage": "https://github.com/kemitchell/validate-npm-package-license.js#readme", + "_id": "validate-npm-package-license@3.0.1", + "_shasum": "2804babe712ad3379459acfbe24746ab2c303fbc", + "_from": "validate-npm-package-license@>=3.0.1 <3.1.0", + "_npmVersion": "2.13.5", + "_nodeVersion": "0.12.7", + "_npmUser": { + "name": "kemitchell", + "email": "kyle@kemitchell.com" + }, + "dist": { + "shasum": "2804babe712ad3379459acfbe24746ab2c303fbc", + "tarball": "http://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz" + }, + "maintainers": [ + { + "name": "kemitchell", + "email": "kyle@kemitchell.com" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-name/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-name/.npmignore new file mode 100644 index 00000000..3c3629e6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-name/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-name/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-name/LICENSE new file mode 100644 index 00000000..fdcd63b3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-name/LICENSE @@ -0,0 +1,6 @@ +Copyright (c) 2015, npm, Inc + + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-name/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-name/README.md new file mode 100644 index 00000000..d967fdda --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-name/README.md @@ -0,0 +1,119 @@ +# validate-npm-package-name + +Give me a string and I'll tell you if it's a valid `npm` package name. + +This package exports a single synchronous function that takes a `string` as +input and returns an object with two properties: + +- `validForNewPackages` :: `Boolean` +- `validForOldPackages` :: `Boolean` + +## Contents + +- [Naming rules](#naming-rules) +- [Examples](#examples) + + [Valid Names](#valid-names) + + [Invalid Names](#invalid-names) +- [Legacy Names](#legacy-names) +- [Tests](#tests) +- [License](#license) + +## Naming Rules + +Below is a list of rules that valid `npm` package name should conform to. + +- package name length should be greater than zero +- all the characters in the package name must be lowercase i.e., no uppercase or mixed case names are allowed +- package name *can* consist of hyphens +- package name must *not* contain any non-url-safe characters (since name ends up being part of a URL) +- package name should not start with `.` or `_` +- package name should *not* contain any leading or trailing spaces +- package name *cannot* be the same as a node.js/io.js core module nor a reserved/blacklisted name. For example, the following names are invalid: + + http + + stream + + node_modules + + favicon.ico +- package name length cannot exceed 214 + + +## Examples + +### Valid Names + +```js +var validate = require("validate-npm-package-name") + +validate("some-package") +validate("example.com") +validate("under_score") +validate("123numeric") +validate("crazy!") +validate("@npm/thingy") +validate("@jane/foo.js") +``` + +All of the above names are valid, so you'll get this object back: + +```js +{ + validForNewPackages: true, + validForOldPackages: true +} +``` + +### Invalid Names + +```js +validate(" leading-space:and:weirdchars") +``` + +That was never a valid package name, so you get this: + +```js +{ + validForNewPackages: false, + validForOldPackages: false, + errors: [ + 'name cannot contain leading or trailing spaces', + 'name can only contain URL-friendly characters' + ] +} +``` + +## Legacy Names + +In the old days of npm, package names were wild. They could have capital +letters in them. They could be really long. They could be the name of an +existing module in node core. + +If you give this function a package name that **used to be valid**, you'll see +a change in the value of `validForNewPackages` property, and a warnings array +will be present: + +```js +validate("cRaZY-paCkAgE-with-mixed-case-and-more-than-214-characters-----------------------------------------------------------------------------------------------------------------------------------------------------------") +``` + +returns: + +```js +{ + validForNewPackages: false, + validForOldPackages: true, + warnings: [ + "name can no longer contain capital letters", + "name can no longer contain more than 214 characters" + ] +} +``` + +## Tests + +```sh +npm install +npm test +``` + +## License + +ISC diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-name/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-name/index.js new file mode 100644 index 00000000..66a1d473 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-name/index.js @@ -0,0 +1,102 @@ +var scopedPackagePattern = new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"); +var builtins = require("builtins") +var blacklist = [ + "node_modules", + "favicon.ico" +]; + +var validate = module.exports = function(name) { + + var warnings = [] + var errors = [] + + if (name === null) { + errors.push("name cannot be null") + return done(warnings, errors) + } + + if (name === undefined) { + errors.push("name cannot be undefined") + return done(warnings, errors) + } + + if (typeof name !== "string") { + errors.push("name must be a string") + return done(warnings, errors) + } + + if (!name.length) { + errors.push("name length must be greater than zero") + } + + if (name.match(/^\./)) { + errors.push("name cannot start with a period") + } + + if (name.match(/^_/)) { + errors.push("name cannot start with an underscore") + } + + if (name.trim() !== name) { + errors.push("name cannot contain leading or trailing spaces") + } + + // No funny business + blacklist.forEach(function(blacklistedName){ + if (name.toLowerCase() === blacklistedName) { + errors.push(blacklistedName + " is a blacklisted name") + } + }) + + // Generate warnings for stuff that used to be allowed + + // core module names like http, events, util, etc + builtins.forEach(function(builtin){ + if (name.toLowerCase() === builtin) { + warnings.push(builtin + " is a core module name") + } + }) + + // really-long-package-names-------------------------------such--length-----many---wow + // the thisisareallyreallylongpackagenameitshouldpublishdowenowhavealimittothelengthofpackagenames-poch. + if (name.length > 214) { + warnings.push("name can no longer contain more than 214 characters") + } + + // mIxeD CaSe nAMEs + if (name.toLowerCase() !== name) { + warnings.push("name can no longer contain capital letters") + } + + if (encodeURIComponent(name) !== name) { + + // Maybe it's a scoped package name, like @user/package + var nameMatch = name.match(scopedPackagePattern) + if (nameMatch) { + var user = nameMatch[1] + var pkg = nameMatch[2] + if (encodeURIComponent(user) === user && encodeURIComponent(pkg) === pkg) { + return done(warnings, errors) + } + } + + errors.push("name can only contain URL-friendly characters") + } + + return done(warnings, errors) + +} + +validate.scopedPackagePattern = scopedPackagePattern + +var done = function (warnings, errors) { + var result = { + validForNewPackages: errors.length === 0 && warnings.length === 0, + validForOldPackages: errors.length === 0, + warnings: warnings, + errors: errors + } + if (!result.warnings.length) delete result.warnings + if (!result.errors.length) delete result.errors + return result +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-name/node_modules/builtins/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-name/node_modules/builtins/.travis.yml new file mode 100644 index 00000000..cc4dba29 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-name/node_modules/builtins/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.8" + - "0.10" diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-name/node_modules/builtins/History.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-name/node_modules/builtins/History.md new file mode 100644 index 00000000..e9837a50 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-name/node_modules/builtins/History.md @@ -0,0 +1,39 @@ + +0.0.7 / 2014-09-01 +================== + + * update .repository + +0.0.6 / 2014-09-01 +================== + + * add travis + * add test script + * add constants + +0.0.5 / 2014-06-27 +================== + + * add module + * publish to public npm + +0.0.4 / 2014-04-25 +================== + + * add timers + +0.0.3 / 2014-02-22 +================== + + * add buffer + +0.0.2 / 2014-02-11 +================== + + * add assert + +0.0.1 / 2014-02-11 +================== + + * add main + * initial commit diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-name/node_modules/builtins/Readme.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-name/node_modules/builtins/Readme.md new file mode 100644 index 00000000..96f4b1f6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-name/node_modules/builtins/Readme.md @@ -0,0 +1,18 @@ + +# builtins + + List of node.js [builtin modules](http://nodejs.org/api/). + + [![build status](https://secure.travis-ci.org/juliangruber/builtins.svg)](http://travis-ci.org/juliangruber/builtins) + +## Example + +```js +var builtins = require('builtins'); + +assert(builtins.indexOf('http') > -1); +``` + +## License + + MIT diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-name/node_modules/builtins/builtins.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-name/node_modules/builtins/builtins.json new file mode 100644 index 00000000..c52221d7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-name/node_modules/builtins/builtins.json @@ -0,0 +1,31 @@ +[ + "assert", + "buffer", + "child_process", + "cluster", + "constants", + "crypto", + "dns", + "domain", + "events", + "fs", + "http", + "https", + "module", + "net", + "os", + "path", + "punycode", + "querystring", + "repl", + "stream", + "string_decoder", + "timers", + "tls", + "tty", + "dgram", + "url", + "util", + "vm", + "zlib" +] diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-name/node_modules/builtins/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-name/node_modules/builtins/package.json new file mode 100644 index 00000000..32b8c350 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-name/node_modules/builtins/package.json @@ -0,0 +1,25 @@ +{ + "name": "builtins", + "version": "0.0.7", + "description": "List of node.js builtin modules", + "repository": { + "type": "git", + "url": "git+https://github.com/juliangruber/builtins.git" + }, + "license": "MIT", + "main": "builtins.json", + "publishConfig": { + "registry": "https://registry.npmjs.org" + }, + "scripts": { + "test": "node -e \"require('./builtins.json')\"" + }, + "readme": "\n# builtins\n\n List of node.js [builtin modules](http://nodejs.org/api/).\n\n [![build status](https://secure.travis-ci.org/juliangruber/builtins.svg)](http://travis-ci.org/juliangruber/builtins)\n\n## Example\n\n```js\nvar builtins = require('builtins');\n\nassert(builtins.indexOf('http') > -1);\n```\n\n## License\n\n MIT\n", + "readmeFilename": "Readme.md", + "bugs": { + "url": "https://github.com/juliangruber/builtins/issues" + }, + "homepage": "https://github.com/juliangruber/builtins", + "_id": "builtins@0.0.7", + "_from": "builtins@0.0.7" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-name/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-name/package.json new file mode 100644 index 00000000..b2a6104a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-name/package.json @@ -0,0 +1,42 @@ +{ + "name": "validate-npm-package-name", + "version": "2.2.2", + "description": "Give me a string and I'll tell you if it's a valid npm package name", + "main": "index.js", + "directories": { + "test": "test" + }, + "dependencies": { + "builtins": "0.0.7" + }, + "devDependencies": { + "tap": "^0.4.13" + }, + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/validate-npm-package-name.git" + }, + "keywords": [ + "npm", + "package", + "names", + "validation" + ], + "author": { + "name": "zeke" + }, + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/validate-npm-package-name/issues" + }, + "homepage": "https://github.com/npm/validate-npm-package-name", + "readme": "# validate-npm-package-name\n\nGive me a string and I'll tell you if it's a valid `npm` package name.\n\nThis package exports a single synchronous function that takes a `string` as\ninput and returns an object with two properties:\n\n- `validForNewPackages` :: `Boolean`\n- `validForOldPackages` :: `Boolean`\n\n## Contents\n\n- [Naming rules](#naming-rules)\n- [Examples](#examples)\n + [Valid Names](#valid-names)\n + [Invalid Names](#invalid-names)\n- [Legacy Names](#legacy-names)\n- [Tests](#tests)\n- [License](#license)\n\n## Naming Rules\n\nBelow is a list of rules that valid `npm` package name should conform to.\n\n- package name length should be greater than zero\n- all the characters in the package name must be lowercase i.e., no uppercase or mixed case names are allowed\n- package name *can* consist of hyphens\n- package name must *not* contain any non-url-safe characters (since name ends up being part of a URL)\n- package name should not start with `.` or `_`\n- package name should *not* contain any leading or trailing spaces\n- package name *cannot* be the same as a node.js/io.js core module nor a reserved/blacklisted name. For example, the following names are invalid:\n + http\n + stream\n + node_modules\n + favicon.ico\n- package name length cannot exceed 214\n\n\n## Examples\n\n### Valid Names\n\n```js\nvar validate = require(\"validate-npm-package-name\")\n\nvalidate(\"some-package\")\nvalidate(\"example.com\")\nvalidate(\"under_score\")\nvalidate(\"123numeric\")\nvalidate(\"crazy!\")\nvalidate(\"@npm/thingy\")\nvalidate(\"@jane/foo.js\")\n```\n\nAll of the above names are valid, so you'll get this object back:\n\n```js\n{\n validForNewPackages: true,\n validForOldPackages: true\n}\n```\n\n### Invalid Names\n\n```js\nvalidate(\" leading-space:and:weirdchars\")\n```\n\nThat was never a valid package name, so you get this:\n\n```js\n{\n validForNewPackages: false,\n validForOldPackages: false,\n errors: [\n 'name cannot contain leading or trailing spaces',\n 'name can only contain URL-friendly characters'\n ]\n}\n```\n\n## Legacy Names\n\nIn the old days of npm, package names were wild. They could have capital\nletters in them. They could be really long. They could be the name of an\nexisting module in node core.\n\nIf you give this function a package name that **used to be valid**, you'll see\na change in the value of `validForNewPackages` property, and a warnings array\nwill be present:\n\n```js\nvalidate(\"cRaZY-paCkAgE-with-mixed-case-and-more-than-214-characters-----------------------------------------------------------------------------------------------------------------------------------------------------------\")\n```\n\nreturns:\n\n```js\n{\n validForNewPackages: false,\n validForOldPackages: true,\n warnings: [\n \"name can no longer contain capital letters\",\n \"name can no longer contain more than 214 characters\"\n ]\n}\n```\n\n## Tests\n\n```sh\nnpm install\nnpm test\n```\n\n## License\n\nISC\n", + "readmeFilename": "README.md", + "gitHead": "3af92c881549f1b96f05ab6bfb5768bba94ad72d", + "_id": "validate-npm-package-name@2.2.2", + "_shasum": "f65695b22f7324442019a3c7fa39a6e7fd299085", + "_from": "validate-npm-package-name@2.2.2" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-name/test/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-name/test/index.js new file mode 100644 index 00000000..1a7dca5d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/validate-npm-package-name/test/index.js @@ -0,0 +1,102 @@ +var validate = require("..") +var test = require("tap").test +var path = require("path") +var fs = require("fs") + +test("validate-npm-package-name", function (t) { + + // Traditional + + t.deepEqual(validate("some-package"), {validForNewPackages: true, validForOldPackages: true}) + t.deepEqual(validate("example.com"), {validForNewPackages: true, validForOldPackages: true}) + t.deepEqual(validate("under_score"), {validForNewPackages: true, validForOldPackages: true}) + t.deepEqual(validate("period.js"), {validForNewPackages: true, validForOldPackages: true}) + t.deepEqual(validate("123numeric"), {validForNewPackages: true, validForOldPackages: true}) + t.deepEqual(validate("crazy!"), {validForNewPackages: true, validForOldPackages: true}) + + // Scoped (npm 2+) + + t.deepEqual(validate("@npm/thingy"), {validForNewPackages: true, validForOldPackages: true}) + t.deepEqual(validate("@npm-zors/money!time.js"), {validForNewPackages: true, validForOldPackages: true}) + + // Invalid + + t.deepEqual(validate(""), { + validForNewPackages: false, + validForOldPackages: false, + errors: ["name length must be greater than zero"]}) + + t.deepEqual(validate(""), { + validForNewPackages: false, + validForOldPackages: false, + errors: ["name length must be greater than zero"]}) + + t.deepEqual(validate(".start-with-period"), { + validForNewPackages: false, + validForOldPackages: false, + errors: ["name cannot start with a period"]}) + + t.deepEqual(validate("_start-with-underscore"), { + validForNewPackages: false, + validForOldPackages: false, + errors: ["name cannot start with an underscore"]}) + + t.deepEqual(validate("contain:colons"), { + validForNewPackages: false, + validForOldPackages: false, + errors: ["name can only contain URL-friendly characters"]}) + + t.deepEqual(validate(" leading-space"), { + validForNewPackages: false, + validForOldPackages: false, + errors: ["name cannot contain leading or trailing spaces", "name can only contain URL-friendly characters"]}) + + t.deepEqual(validate("trailing-space "), { + validForNewPackages: false, + validForOldPackages: false, + errors: ["name cannot contain leading or trailing spaces", "name can only contain URL-friendly characters"]}) + + t.deepEqual(validate("s/l/a/s/h/e/s"), { + validForNewPackages: false, + validForOldPackages: false, + errors: ["name can only contain URL-friendly characters"]}) + + t.deepEqual(validate("node_modules"), { + validForNewPackages: false, + validForOldPackages: false, + errors: ["node_modules is a blacklisted name"]}) + + t.deepEqual(validate("favicon.ico"), { + validForNewPackages: false, + validForOldPackages: false, + errors: ["favicon.ico is a blacklisted name"]}) + + // Node/IO Core + + t.deepEqual(validate("http"), { + validForNewPackages: false, + validForOldPackages: true, + warnings: ["http is a core module name"]}) + + // Long Package Names + + t.deepEqual(validate("ifyouwanttogetthesumoftwonumberswherethosetwonumbersarechosenbyfindingthelargestoftwooutofthreenumbersandsquaringthemwhichismultiplyingthembyitselfthenyoushouldinputthreenumbersintothisfunctionanditwilldothatforyou-"), { + validForNewPackages: false, + validForOldPackages: true, + warnings: ["name can no longer contain more than 214 characters"] + }) + + t.deepEqual(validate("ifyouwanttogetthesumoftwonumberswherethosetwonumbersarechosenbyfindingthelargestoftwooutofthreenumbersandsquaringthemwhichismultiplyingthembyitselfthenyoushouldinputthreenumbersintothisfunctionanditwilldothatforyou"), { + validForNewPackages: true, + validForOldPackages: true + }) + + // Legacy Mixed-Case + + t.deepEqual(validate("CAPITAL-LETTERS"), { + validForNewPackages: false, + validForOldPackages: true, + warnings: ["name can no longer contain capital letters"]}) + + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/CHANGELOG.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/CHANGELOG.md new file mode 100644 index 00000000..f2c6e4fd --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/CHANGELOG.md @@ -0,0 +1,126 @@ +# Changes + + +## v1.2.11 + +* Prevent changelog script from being included in package + +## v1.2.10 + +* Use env.PATH only, not env.Path + +## v1.2.9 + +* fix for paths starting with ../ +* Remove unused `is-absolute` module + +## v1.2.8 + +* bullet items in changelog that contain (but don't start with) # + +## v1.2.7 + +* strip 'update changelog' changelog entries out of changelog + +## v1.2.6 + +* make the changelog bulleted + +## v1.2.5 + +* make a changelog, and keep it up to date +* don't include tests in package +* Properly handle relative-path executables +* appveyor +* Attach error code to Not Found error +* Make tests pass on Windows + +## v1.2.4 + +* Fix typo + +## v1.2.3 + +* update isexe, fix regression in pathExt handling + +## v1.2.2 + +* update deps, use isexe module, test windows + +## v1.2.1 + +* Sometimes windows PATH entries are quoted +* Fixed a bug in the check for group and user mode bits. This bug was introduced during refactoring for supporting strict mode. +* doc cli + +## v1.2.0 + +* Add support for opt.all and -as cli flags +* test the bin +* update travis +* Allow checking for multiple programs in bin/which +* tap 2 + +## v1.1.2 + +* travis +* Refactored and fixed undefined error on Windows +* Support strict mode + +## v1.1.1 + +* test +g exes against secondary groups, if available +* Use windows exe semantics on cygwin & msys +* cwd should be first in path on win32, not last +* Handle lower-case 'env.Path' on Windows +* Update docs +* use single-quotes + +## v1.1.0 + +* Add tests, depend on is-absolute + +## v1.0.9 + +* which.js: root is allowed to execute files owned by anyone + +## v1.0.8 + +* don't use graceful-fs + +## v1.0.7 + +* add license to package.json + +## v1.0.6 + +* isc license + +## 1.0.5 + +* Awful typo + +## 1.0.4 + +* Test for path absoluteness properly +* win: Allow '' as a pathext if cmd has a . in it + +## 1.0.3 + +* Remove references to execPath +* Make `which.sync()` work on Windows by honoring the PATHEXT variable. +* Make `isExe()` always return true on Windows. +* MIT + +## 1.0.2 + +* Only files can be exes + +## 1.0.1 + +* Respect the PATHEXT env for win32 support +* should 0755 the bin +* binary +* guts +* package +* 1st diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/README.md new file mode 100644 index 00000000..7f679d59 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/README.md @@ -0,0 +1,48 @@ +# which + +Like the unix `which` utility. + +Finds the first instance of a specified executable in the PATH +environment variable. Does not cache the results, so `hash -r` is not +needed when the PATH changes. + +## USAGE + +```javascript +var which = require('which') + +// async usage +which('node', function (er, resolvedPath) { + // er is returned if no "node" is found on the PATH + // if it is found, then the absolute path to the exec is returned +}) + +// sync usage +// throws if not found +var resolved = which.sync('node') + +// Pass options to override the PATH and PATHEXT environment vars. +which('node', { path: someOtherPath }, function (er, resolved) { + if (er) + throw er + console.log('found at %j', resolved) +}) +``` + +## CLI USAGE + +Same as the BSD `which(1)` binary. + +``` +usage: which [-as] program ... +``` + +## OPTIONS + +You may pass an options object as the second argument. + +- `path`: Use instead of the `PATH` environment variable. +- `pathExt`: Use instead of the `PATHEXT` environment variable. +- `all`: Return all matches, instead of just the first one. Note that + this means the function returns an array of strings instead of a + single string. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/node_modules/isexe/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/node_modules/isexe/.npmignore new file mode 100644 index 00000000..c1cb757a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/node_modules/isexe/.npmignore @@ -0,0 +1,2 @@ +.nyc_output/ +coverage/ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/node_modules/isexe/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/node_modules/isexe/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/node_modules/isexe/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/node_modules/isexe/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/node_modules/isexe/README.md new file mode 100644 index 00000000..30995ad7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/node_modules/isexe/README.md @@ -0,0 +1,51 @@ +# isexe + +Minimal module to check if a file is executable. + +Uses `fs.access` if available, and tests against the `PATHEXT` +environment variable on Windows. + +## USAGE + +```javascript +var isexe = require('isexe') +isexe('some-file-name', function (err, isExe) { + if (err) { + console.error('probably file does not exist or something', err) + } else if (isExe) { + console.error('this thing can be run') + } else { + console.error('cannot be run') + } +}) + +// same thing but synchronous, throws errors +var isExe = isexe.sync('some-file-name') + +// treat errors as just "not executable" +isexe('maybe-missing-file', { ignoreErrors: true }, callback) +var isExe = isexe.sync('maybe-missing-file', { ignoreErrors: true }) +``` + +## API + +### `isexe(path, [options], [callback])` + +Check if the path is executable. If no callback provided, and a +global `Promise` object is available, then a Promise will be returned. + +Will raise whatever errors may be raised by `fs.access` or `fs.stat`, +unless `options.ignoreErrors` is set to true. + +### `isexe.sync(path, [options])` + +Same as `isexe` but returns the value and throws any errors raised. + +### Options + +* `ignoreErrors` Treat all errors as "no, this is not executable", but + don't raise them. +* `uid` Number to use as the user id when using the `mode` approach. +* `gid` Number to use as the group id when using the `mode` approach. +* `pathExt` List of path extensions to use instead of `PATHEXT` + environment variable on Windows. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/node_modules/isexe/access.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/node_modules/isexe/access.js new file mode 100644 index 00000000..e67b28bd --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/node_modules/isexe/access.js @@ -0,0 +1,15 @@ +module.exports = isexe +isexe.sync = sync + +var fs = require('fs') + +function isexe (path, _, cb) { + fs.access(path, fs.X_OK, function (er) { + cb(er, !er) + }) +} + +function sync (path, _) { + fs.accessSync(path, fs.X_OK) + return true +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/node_modules/isexe/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/node_modules/isexe/index.js new file mode 100644 index 00000000..ff8ef113 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/node_modules/isexe/index.js @@ -0,0 +1,59 @@ +var fs = require('fs') +var core +if (process.platform === 'win32' || global.TESTING_WINDOWS) { + core = require('./windows.js') +} else if (typeof fs.access === 'function') { + core = require('./access.js') +} else { + core = require('./mode.js') +} + +module.exports = isexe +isexe.sync = sync + +function isexe (path, options, cb) { + if (typeof options === 'function') { + cb = options + options = {} + } + + if (!cb) { + if (typeof Promise !== 'function') { + throw new TypeError('callback not provided') + } + + return new Promise(function (resolve, reject) { + isexe(path, options || {}, function (er, is) { + if (er) { + reject(er) + } else { + resolve(is) + } + }) + }) + } + + core(path, options || {}, function (er, is) { + // ignore EACCES because that just means we aren't allowed to run it + if (er) { + if (er.code === 'EACCES' || options && options.ignoreErrors) { + er = null + is = false + } + } + cb(er, is) + }) +} + +function sync (path, options) { + // my kingdom for a filtered catch + try { + return core.sync(path, options || {}) + } catch (er) { + if (options && options.ignoreErrors || er.code === 'EACCES') { + return false + } else { + throw er + } + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/node_modules/isexe/mode.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/node_modules/isexe/mode.js new file mode 100644 index 00000000..20442807 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/node_modules/isexe/mode.js @@ -0,0 +1,37 @@ +module.exports = isexe +isexe.sync = sync + +var fs = require('fs') + +function isexe (path, options, cb) { + fs.stat(path, function (er, st) { + cb(er, er ? false : checkMode(st, options)) + }) +} + +function sync (path, options) { + return checkMode(fs.statSync(path), options) +} + +function checkMode (stat, options) { + var mod = stat.mode + var uid = stat.uid + var gid = stat.gid + + var myUid = options.uid !== undefined ? + options.uid : process.getuid && process.getuid() + var myGid = options.gid !== undefined ? + options.gid : process.getgid && process.getgid() + + var u = parseInt('100', 8) + var g = parseInt('010', 8) + var o = parseInt('001', 8) + var ug = u | g + + var ret = (mod & o) || + (mod & g) && gid === myGid || + (mod & u) && uid === myUid || + (mod & ug) && myUid === 0 + + return ret +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/node_modules/isexe/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/node_modules/isexe/package.json new file mode 100644 index 00000000..328d69c5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/node_modules/isexe/package.json @@ -0,0 +1,58 @@ +{ + "name": "isexe", + "version": "1.1.2", + "description": "Minimal module to check if a file is executable.", + "main": "index.js", + "directories": { + "test": "test" + }, + "devDependencies": { + "mkdirp": "^0.5.1", + "rimraf": "^2.5.0", + "tap": "^5.1.2" + }, + "scripts": { + "test": "tap test/*.js --branches=100 --statements=100 --functions=100 --lines=100" + }, + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "ISC", + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/isexe.git" + }, + "keywords": [], + "bugs": { + "url": "https://github.com/isaacs/isexe/issues" + }, + "homepage": "https://github.com/isaacs/isexe#readme", + "gitHead": "1882eed72c2ba152f4dd1336d857b0755ae306d9", + "_id": "isexe@1.1.2", + "_shasum": "36f3e22e60750920f5e7241a476a8c6a42275ad0", + "_from": "isexe@>=1.1.1 <2.0.0", + "_npmVersion": "3.7.0", + "_nodeVersion": "4.0.0", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "dist": { + "shasum": "36f3e22e60750920f5e7241a476a8c6a42275ad0", + "tarball": "https://registry.npmjs.org/isexe/-/isexe-1.1.2.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "_npmOperationalInternal": { + "host": "packages-9-west.internal.npmjs.com", + "tmp": "tmp/isexe-1.1.2.tgz_1454992795963_0.7608721863944083" + }, + "_resolved": "https://registry.npmjs.org/isexe/-/isexe-1.1.2.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/node_modules/isexe/test/basic.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/node_modules/isexe/test/basic.js new file mode 100644 index 00000000..969fc9a0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/node_modules/isexe/test/basic.js @@ -0,0 +1,211 @@ +var t = require('tap') +var fs = require('fs') +var path = require('path') +var fixture = path.resolve(__dirname, 'fixtures') +var meow = fixture + '/meow.cat' +var mine = fixture + '/mine.cat' +var ours = fixture + '/ours.cat' +var fail = fixture + '/fail.false' +var noent = fixture + '/enoent.exe' +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') + +var isWindows = process.platform === 'win32' +var hasAccess = typeof fs.access === 'function' +var winSkip = isWindows && 'windows' +var accessSkip = !hasAccess && 'no fs.access function' +var hasPromise = typeof Promise === 'function' +var promiseSkip = !hasPromise && 'no global Promise' + +function reset () { + delete require.cache[require.resolve('../')] + return require('../') +} + +t.test('setup fixtures', function (t) { + rimraf.sync(fixture) + mkdirp.sync(fixture) + fs.writeFileSync(meow, '#!/usr/bin/env cat\nmeow\n') + fs.chmodSync(meow, parseInt('0755', 8)) + fs.writeFileSync(fail, '#!/usr/bin/env false\n') + fs.chmodSync(fail, parseInt('0644', 8)) + fs.writeFileSync(mine, '#!/usr/bin/env cat\nmine\n') + fs.chmodSync(mine, parseInt('0744', 8)) + fs.writeFileSync(ours, '#!/usr/bin/env cat\nours\n') + fs.chmodSync(ours, parseInt('0754', 8)) + t.end() +}) + +t.test('promise', { skip: promiseSkip }, function (t) { + var isexe = reset() + t.test('meow async', function (t) { + isexe(meow).then(function (is) { + t.ok(is) + t.end() + }) + }) + t.test('fail async', function (t) { + isexe(fail).then(function (is) { + t.notOk(is) + t.end() + }) + }) + t.test('noent async', function (t) { + isexe(noent).catch(function (er) { + t.ok(er) + t.end() + }) + }) + t.test('noent ignore async', function (t) { + isexe(noent, { ignoreErrors: true }).then(function (is) { + t.notOk(is) + t.end() + }) + }) + t.end() +}) + +t.test('no promise', function (t) { + global.Promise = null + var isexe = reset() + t.throws('try to meow a promise', function () { + isexe(meow) + }) + t.end() +}) + +t.test('access', { skip: accessSkip || winSkip }, function (t) { + runTest(t) +}) + +t.test('mode', { skip: winSkip }, function (t) { + delete fs.access + delete fs.accessSync + var isexe = reset() + t.ok(isexe.sync(ours, { uid: 0, gid: 0 })) + t.ok(isexe.sync(mine, { uid: 0, gid: 0 })) + runTest(t) +}) + +t.test('windows', function (t) { + global.TESTING_WINDOWS = true + var pathExt = '.EXE;.CAT;.CMD;.COM' + t.test('pathExt option', function (t) { + runTest(t, { pathExt: '.EXE;.CAT;.CMD;.COM' }) + }) + t.test('pathExt env', function (t) { + process.env.PATHEXT = pathExt + runTest(t) + }) + t.test('no pathExt', function (t) { + // with a pathExt of '', any filename is fine. + // so the "fail" one would still pass. + runTest(t, { pathExt: '', skipFail: true }) + }) + t.test('pathext with empty entry', function (t) { + // with a pathExt of '', any filename is fine. + // so the "fail" one would still pass. + runTest(t, { pathExt: ';' + pathExt, skipFail: true }) + }) + t.end() +}) + +t.test('cleanup', function (t) { + rimraf.sync(fixture) + t.end() +}) + +function runTest (t, options) { + var isexe = reset() + + var optionsIgnore = Object.create(options || {}) + optionsIgnore.ignoreErrors = true + + if (!options || !options.skipFail) { + t.notOk(isexe.sync(fail, options)) + } + t.notOk(isexe.sync(noent, optionsIgnore)) + if (!options) { + t.ok(isexe.sync(meow)) + } else { + t.ok(isexe.sync(meow, options)) + } + + t.ok(isexe.sync(mine, options)) + t.ok(isexe.sync(ours, options)) + t.throws(function () { + isexe.sync(noent, options) + }) + + t.test('meow async', function (t) { + if (!options) { + isexe(meow, function (er, is) { + if (er) { + throw er + } + t.ok(is) + t.end() + }) + } else { + isexe(meow, options, function (er, is) { + if (er) { + throw er + } + t.ok(is) + t.end() + }) + } + }) + + t.test('mine async', function (t) { + isexe(mine, options, function (er, is) { + if (er) { + throw er + } + t.ok(is) + t.end() + }) + }) + + t.test('ours async', function (t) { + isexe(ours, options, function (er, is) { + if (er) { + throw er + } + t.ok(is) + t.end() + }) + }) + + if (!options || !options.skipFail) { + t.test('fail async', function (t) { + isexe(fail, options, function (er, is) { + if (er) { + throw er + } + t.notOk(is) + t.end() + }) + }) + } + + t.test('noent async', function (t) { + isexe(noent, options, function (er, is) { + t.ok(er) + t.notOk(is) + t.end() + }) + }) + + t.test('noent ignore async', function (t) { + isexe(noent, optionsIgnore, function (er, is) { + if (er) { + throw er + } + t.notOk(is) + t.end() + }) + }) + + t.end() +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/node_modules/isexe/windows.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/node_modules/isexe/windows.js new file mode 100644 index 00000000..aba8561f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/node_modules/isexe/windows.js @@ -0,0 +1,36 @@ +module.exports = isexe +isexe.sync = sync + +var fs = require('fs') + +function checkPathExt (path, options) { + var pathext = options.pathExt !== undefined ? + options.pathExt : process.env.PATHEXT + + if (!pathext) { + return true + } + + pathext = pathext.split(';') + if (pathext.indexOf('') !== -1) { + return true + } + for (var i = 0; i < pathext.length; i++) { + var p = pathext[i].toLowerCase() + if (p && path.substr(-p.length).toLowerCase() === p) { + return true + } + } + return false +} + +function isexe (path, options, cb) { + fs.stat(path, function (er, st) { + cb(er, er ? false : checkPathExt(path, options)) + }) +} + +function sync (path, options) { + fs.statSync(path) + return checkPathExt(path, options) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/package.json new file mode 100644 index 00000000..37426be0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/package.json @@ -0,0 +1,67 @@ +{ + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me" + }, + "name": "which", + "description": "Like which(1) unix command. Find the first instance of an executable in the PATH.", + "version": "1.2.11", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-which.git" + }, + "main": "which.js", + "bin": { + "which": "./bin/which" + }, + "license": "ISC", + "dependencies": { + "isexe": "^1.1.1" + }, + "devDependencies": { + "mkdirp": "^0.5.0", + "rimraf": "^2.3.3", + "tap": "^5.1.1" + }, + "scripts": { + "test": "tap test/*.js --cov", + "changelog": "bash gen-changelog.sh", + "postversion": "npm run changelog && git add CHANGELOG.md && git commit -m 'update changelog - '${npm_package_version}" + }, + "files": [ + "which.js", + "bin/which" + ], + "gitHead": "8a7d0aa1ca10173f9f4d84bf528a3efc1f5d0c6f", + "bugs": { + "url": "https://github.com/isaacs/node-which/issues" + }, + "homepage": "https://github.com/isaacs/node-which#readme", + "_id": "which@1.2.11", + "_shasum": "c8b2eeea6b8c1659fa7c1dd4fdaabe9533dc5e8b", + "_from": "which@1.2.11", + "_npmVersion": "3.10.7", + "_nodeVersion": "6.5.0", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "dist": { + "shasum": "c8b2eeea6b8c1659fa7c1dd4fdaabe9533dc5e8b", + "tarball": "https://registry.npmjs.org/which/-/which-1.2.11.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/which-1.2.11.tgz_1473093398489_0.1032072464004159" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/which/-/which-1.2.11.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/which.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/which.js new file mode 100644 index 00000000..5a9b15ca --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/which/which.js @@ -0,0 +1,133 @@ +module.exports = which +which.sync = whichSync + +var isWindows = process.platform === 'win32' || + process.env.OSTYPE === 'cygwin' || + process.env.OSTYPE === 'msys' + +var path = require('path') +var COLON = isWindows ? ';' : ':' +var isexe = require('isexe') +var fs = require('fs') + +function getNotFoundError (cmd) { + var er = new Error('not found: ' + cmd) + er.code = 'ENOENT' + + return er +} + +function getPathInfo (cmd, opt) { + var colon = opt.colon || COLON + var pathEnv = opt.path || process.env.PATH || '' + var pathExt = [''] + + pathEnv = pathEnv.split(colon) + + var pathExtExe = '' + if (isWindows) { + pathEnv.unshift(process.cwd()) + pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM') + pathExt = pathExtExe.split(colon) + + + // Always test the cmd itself first. isexe will check to make sure + // it's found in the pathExt set. + if (cmd.indexOf('.') !== -1 && pathExt[0] !== '') + pathExt.unshift('') + } + + // If it has a slash, then we don't bother searching the pathenv. + // just check the file itself, and that's it. + if (cmd.match(/\//) || isWindows && cmd.match(/\\/)) + pathEnv = [''] + + return { + env: pathEnv, + ext: pathExt, + extExe: pathExtExe + } +} + +function which (cmd, opt, cb) { + if (typeof opt === 'function') { + cb = opt + opt = {} + } + + var info = getPathInfo(cmd, opt) + var pathEnv = info.env + var pathExt = info.ext + var pathExtExe = info.extExe + var found = [] + + ;(function F (i, l) { + if (i === l) { + if (opt.all && found.length) + return cb(null, found) + else + return cb(getNotFoundError(cmd)) + } + + var pathPart = pathEnv[i] + if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"') + pathPart = pathPart.slice(1, -1) + + var p = path.join(pathPart, cmd) + if (!pathPart && (/^\.[\\\/]/).test(cmd)) { + p = cmd.slice(0, 2) + p + } + ;(function E (ii, ll) { + if (ii === ll) return F(i + 1, l) + var ext = pathExt[ii] + isexe(p + ext, { pathExt: pathExtExe }, function (er, is) { + if (!er && is) { + if (opt.all) + found.push(p + ext) + else + return cb(null, p + ext) + } + return E(ii + 1, ll) + }) + })(0, pathExt.length) + })(0, pathEnv.length) +} + +function whichSync (cmd, opt) { + opt = opt || {} + + var info = getPathInfo(cmd, opt) + var pathEnv = info.env + var pathExt = info.ext + var pathExtExe = info.extExe + var found = [] + + for (var i = 0, l = pathEnv.length; i < l; i ++) { + var pathPart = pathEnv[i] + if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"') + pathPart = pathPart.slice(1, -1) + + var p = path.join(pathPart, cmd) + if (!pathPart && /^\.[\\\/]/.test(cmd)) { + p = cmd.slice(0, 2) + p + } + for (var j = 0, ll = pathExt.length; j < ll; j ++) { + var cur = p + pathExt[j] + var is + try { + is = isexe.sync(cur, { pathExt: pathExtExe }) + if (is) { + if (opt.all) + found.push(cur) + else + return cur + } + } catch (ex) {} + } + } + + if (opt.all && found.length) + return found + + throw getNotFoundError(cmd) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/wrappy/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/wrappy/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/wrappy/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/wrappy/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/wrappy/README.md new file mode 100644 index 00000000..98eab252 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/wrappy/README.md @@ -0,0 +1,36 @@ +# wrappy + +Callback wrapping utility + +## USAGE + +```javascript +var wrappy = require("wrappy") + +// var wrapper = wrappy(wrapperFunction) + +// make sure a cb is called only once +// See also: http://npm.im/once for this specific use case +var once = wrappy(function (cb) { + var called = false + return function () { + if (called) return + called = true + return cb.apply(this, arguments) + } +}) + +function printBoo () { + console.log('boo') +} +// has some rando property +printBoo.iAmBooPrinter = true + +var onlyPrintOnce = once(printBoo) + +onlyPrintOnce() // prints 'boo' +onlyPrintOnce() // does nothing + +// random property is retained! +assert.equal(onlyPrintOnce.iAmBooPrinter, true) +``` diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/wrappy/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/wrappy/package.json new file mode 100644 index 00000000..4028270c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/wrappy/package.json @@ -0,0 +1,63 @@ +{ + "name": "wrappy", + "version": "1.0.2", + "description": "Callback wrapping utility", + "main": "wrappy.js", + "files": [ + "wrappy.js" + ], + "directories": { + "test": "test" + }, + "dependencies": {}, + "devDependencies": { + "tap": "^2.3.1" + }, + "scripts": { + "test": "tap --coverage test/*.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/wrappy.git" + }, + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/wrappy/issues" + }, + "homepage": "https://github.com/npm/wrappy", + "gitHead": "71d91b6dc5bdeac37e218c2cf03f9ab55b60d214", + "_id": "wrappy@1.0.2", + "_shasum": "b5243d8f3ec1aa35f1364605bc0d1036e30ab69f", + "_from": "wrappy@>=1.0.2 <1.1.0", + "_npmVersion": "3.9.1", + "_nodeVersion": "5.10.1", + "_npmUser": { + "name": "zkat", + "email": "kat@sykosomatic.org" + }, + "dist": { + "shasum": "b5243d8f3ec1aa35f1364605bc0d1036e30ab69f", + "tarball": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" + } + ], + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/wrappy-1.0.2.tgz_1463527848281_0.037129373755306005" + }, + "_resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/wrappy/wrappy.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/wrappy/wrappy.js new file mode 100644 index 00000000..bb7e7d6f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/wrappy/wrappy.js @@ -0,0 +1,33 @@ +// Returns a wrapper function that returns a wrapped callback +// The wrapper function should do some stuff, and return a +// presumably different callback function. +// This makes sure that own properties are retained, so that +// decorations and such are not lost along the way. +module.exports = wrappy +function wrappy (fn, cb) { + if (fn && cb) return wrappy(fn)(cb) + + if (typeof fn !== 'function') + throw new TypeError('need wrapper function') + + Object.keys(fn).forEach(function (k) { + wrapper[k] = fn[k] + }) + + return wrapper + + function wrapper() { + var args = new Array(arguments.length) + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i] + } + var ret = fn.apply(this, args) + var cb = args[args.length-1] + if (typeof ret === 'function' && ret !== cb) { + Object.keys(cb).forEach(function (k) { + ret[k] = cb[k] + }) + } + return ret + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/write-file-atomic/.npmignore b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/write-file-atomic/.npmignore new file mode 100644 index 00000000..45438263 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/write-file-atomic/.npmignore @@ -0,0 +1,4 @@ +*~ +DEADJOE +.#* +node_modules \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/write-file-atomic/.nyc_output/47248.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/write-file-atomic/.nyc_output/47248.json new file mode 100644 index 00000000..9e26dfee --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/write-file-atomic/.nyc_output/47248.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/write-file-atomic/.nyc_output/47250.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/write-file-atomic/.nyc_output/47250.json new file mode 100644 index 00000000..eada5f58 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/write-file-atomic/.nyc_output/47250.json @@ -0,0 +1 @@ +{"./index.js":{"path":"./index.js","s":{"1":1,"2":1,"3":1,"4":1,"5":14,"6":14,"7":42,"8":14,"9":1,"10":1,"11":14,"12":1,"13":7,"14":5,"15":5,"16":7,"17":5,"18":7,"19":7,"20":7,"21":4,"22":1,"23":7,"24":5,"25":7,"26":7,"27":7,"28":6,"29":1,"30":5,"31":4,"32":4,"33":4},"b":{"1":[5,2],"2":[5,2],"3":[7,1],"4":[4,3],"5":[5,2],"6":[1,5]},"f":{"1":14,"2":14,"3":7,"4":7,"5":4,"6":7},"fnMap":{"1":{"name":"murmurhex","line":6,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":22}}},"2":{"name":"(anonymous_2)","line":12,"loc":{"start":{"line":12,"column":17},"end":{"line":12,"column":37}}},"3":{"name":"writeFile","line":16,"loc":{"start":{"line":16,"column":17},"end":{"line":16,"column":72}}},"4":{"name":"(anonymous_4)","line":27,"loc":{"start":{"line":27,"column":5},"end":{"line":27,"column":20}}},"5":{"name":"(anonymous_5)","line":28,"loc":{"start":{"line":28,"column":29},"end":{"line":28,"column":41}}},"6":{"name":"writeFileSync","line":33,"loc":{"start":{"line":33,"column":22},"end":{"line":33,"column":71}}}},"statementMap":{"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":31}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":34}},"3":{"start":{"line":4,"column":0},"end":{"line":4,"column":40}},"4":{"start":{"line":6,"column":0},"end":{"line":10,"column":1}},"5":{"start":{"line":7,"column":2},"end":{"line":7,"column":30}},"6":{"start":{"line":8,"column":2},"end":{"line":8,"column":77}},"7":{"start":{"line":8,"column":48},"end":{"line":8,"column":77}},"8":{"start":{"line":9,"column":2},"end":{"line":9,"column":22}},"9":{"start":{"line":11,"column":0},"end":{"line":11,"column":19}},"10":{"start":{"line":12,"column":0},"end":{"line":14,"column":1}},"11":{"start":{"line":13,"column":2},"end":{"line":13,"column":75}},"12":{"start":{"line":16,"column":0},"end":{"line":31,"column":1}},"13":{"start":{"line":17,"column":2},"end":{"line":20,"column":3}},"14":{"start":{"line":18,"column":4},"end":{"line":18,"column":22}},"15":{"start":{"line":19,"column":4},"end":{"line":19,"column":18}},"16":{"start":{"line":21,"column":2},"end":{"line":21,"column":28}},"17":{"start":{"line":21,"column":16},"end":{"line":21,"column":28}},"18":{"start":{"line":22,"column":2},"end":{"line":22,"column":36}},"19":{"start":{"line":23,"column":2},"end":{"line":30,"column":4}},"20":{"start":{"line":28,"column":4},"end":{"line":29,"column":18}},"21":{"start":{"line":28,"column":43},"end":{"line":28,"column":57}},"22":{"start":{"line":33,"column":0},"end":{"line":44,"column":1}},"23":{"start":{"line":34,"column":2},"end":{"line":34,"column":28}},"24":{"start":{"line":34,"column":16},"end":{"line":34,"column":28}},"25":{"start":{"line":35,"column":2},"end":{"line":35,"column":36}},"26":{"start":{"line":36,"column":2},"end":{"line":43,"column":3}},"27":{"start":{"line":37,"column":4},"end":{"line":37,"column":44}},"28":{"start":{"line":38,"column":4},"end":{"line":38,"column":82}},"29":{"start":{"line":38,"column":23},"end":{"line":38,"column":82}},"30":{"start":{"line":39,"column":4},"end":{"line":39,"column":36}},"31":{"start":{"line":41,"column":4},"end":{"line":41,"column":47}},"32":{"start":{"line":41,"column":10},"end":{"line":41,"column":33}},"33":{"start":{"line":42,"column":4},"end":{"line":42,"column":13}}},"branchMap":{"1":{"line":17,"type":"if","locations":[{"start":{"line":17,"column":2},"end":{"line":17,"column":2}},{"start":{"line":17,"column":2},"end":{"line":17,"column":2}}]},"2":{"line":21,"type":"if","locations":[{"start":{"line":21,"column":2},"end":{"line":21,"column":2}},{"start":{"line":21,"column":2},"end":{"line":21,"column":2}}]},"3":{"line":25,"type":"binary-expr","locations":[{"start":{"line":25,"column":4},"end":{"line":25,"column":17}},{"start":{"line":25,"column":21},"end":{"line":25,"column":82}}]},"4":{"line":28,"type":"cond-expr","locations":[{"start":{"line":28,"column":10},"end":{"line":28,"column":59}},{"start":{"line":29,"column":8},"end":{"line":29,"column":18}}]},"5":{"line":34,"type":"if","locations":[{"start":{"line":34,"column":2},"end":{"line":34,"column":2}},{"start":{"line":34,"column":2},"end":{"line":34,"column":2}}]},"6":{"line":38,"type":"if","locations":[{"start":{"line":38,"column":4},"end":{"line":38,"column":4}},{"start":{"line":38,"column":4},"end":{"line":38,"column":4}}]}}}} \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/write-file-atomic/.travis.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/write-file-atomic/.travis.yml new file mode 100644 index 00000000..3bc5d90c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/write-file-atomic/.travis.yml @@ -0,0 +1,11 @@ +language: node_js +sudo: false +before_install: + - "npm -g install npm" +node_js: + - "0.8" + - "0.10" + - "0.12" + - "iojs" + - "4" + - "5" diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/write-file-atomic/LICENSE b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/write-file-atomic/LICENSE new file mode 100644 index 00000000..af458806 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/write-file-atomic/LICENSE @@ -0,0 +1,5 @@ +Copyright (c) 2015, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/write-file-atomic/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/write-file-atomic/README.md new file mode 100644 index 00000000..26e434d1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/write-file-atomic/README.md @@ -0,0 +1,44 @@ +write-file-atomic +----------------- + +This is an extension for node's `fs.writeFile` that makes its operation +atomic and allows you set ownership (uid/gid of the file). + +### var writeFileAtomic = require('write-file-atomic')
      writeFileAtomic(filename, data, [options], callback) + +* filename **String** +* data **String** | **Buffer** +* options **Object** + * chown **Object** + * uid **Number** + * gid **Number** + * encoding **String** | **Null** default = 'utf8' + * mode **Number** default = 438 (aka 0666 in Octal) +callback **Function** + +Atomically and asynchronously writes data to a file, replacing the file if it already +exists. data can be a string or a buffer. + +The file is initially named `filename + "." + md5hex(__filename, process.pid, ++invocations)`. +If writeFile completes successfully then, if passed the **chown** option it will change +the ownership of the file. Finally it renames the file back to the filename you specified. If +it encounters errors at any of these steps it will attempt to unlink the temporary file and then +pass the error back to the caller. + +If provided, the **chown** option requires both **uid** and **gid** properties or else +you'll get an error. + +The **encoding** option is ignored if **data** is a buffer. It defaults to 'utf8'. + +Example: + +```javascript +writeFileAtomic('message.txt', 'Hello Node', {chown:{uid:100,gid:50}}, function (err) { + if (err) throw err; + console.log('It\'s saved!'); +}); +``` + +### var writeFileAtomicSync = require('write-file-atomic').sync
      writeFileAtomicSync(filename, data, [options]) + +The synchronous version of **writeFileAtomic**. diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/write-file-atomic/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/write-file-atomic/index.js new file mode 100644 index 00000000..797e5717 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/write-file-atomic/index.js @@ -0,0 +1,44 @@ +'use strict' +var fs = require('graceful-fs') +var chain = require('slide').chain +var MurmurHash3 = require('imurmurhash') + +function murmurhex () { + var hash = new MurmurHash3() + for (var ii = 0; ii < arguments.length; ++ii) hash.hash('' + arguments[ii]) + return hash.result() +} +var invocations = 0 +var getTmpname = function (filename) { + return filename + '.' + murmurhex(__filename, process.pid, ++invocations) +} + +module.exports = function writeFile (filename, data, options, callback) { + if (options instanceof Function) { + callback = options + options = null + } + if (!options) options = {} + var tmpfile = getTmpname(filename) + chain([ + [fs, fs.writeFile, tmpfile, data, options], + options.chown && [fs, fs.chown, tmpfile, options.chown.uid, options.chown.gid], + [fs, fs.rename, tmpfile, filename] + ], function (err) { + err ? fs.unlink(tmpfile, function () { callback(err) }) + : callback() + }) +} + +module.exports.sync = function writeFileSync (filename, data, options) { + if (!options) options = {} + var tmpfile = getTmpname(filename) + try { + fs.writeFileSync(tmpfile, data, options) + if (options.chown) fs.chownSync(tmpfile, options.chown.uid, options.chown.gid) + fs.renameSync(tmpfile, filename) + } catch (err) { + try { fs.unlinkSync(tmpfile) } catch (e) {} + throw err + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/write-file-atomic/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/write-file-atomic/package.json new file mode 100644 index 00000000..36598cd4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/write-file-atomic/package.json @@ -0,0 +1,43 @@ +{ + "name": "write-file-atomic", + "version": "1.1.4", + "description": "Write files in an atomic fashion w/configurable ownership", + "main": "index.js", + "scripts": { + "test": "standard && tap --coverage test/*.js" + }, + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/iarna/write-file-atomic.git" + }, + "keywords": [ + "writeFile", + "atomic" + ], + "author": { + "name": "Rebecca Turner", + "email": "me@re-becca.org", + "url": "http://re-becca.org" + }, + "license": "ISC", + "bugs": { + "url": "https://github.com/iarna/write-file-atomic/issues" + }, + "homepage": "https://github.com/iarna/write-file-atomic", + "dependencies": { + "graceful-fs": "^4.1.2", + "imurmurhash": "^0.1.4", + "slide": "^1.1.5" + }, + "devDependencies": { + "require-inject": "^1.1.0", + "standard": "^5.4.1", + "tap": "^2.3.1" + }, + "readme": "write-file-atomic\n-----------------\n\nThis is an extension for node's `fs.writeFile` that makes its operation\natomic and allows you set ownership (uid/gid of the file).\n\n### var writeFileAtomic = require('write-file-atomic')
      writeFileAtomic(filename, data, [options], callback)\n\n* filename **String**\n* data **String** | **Buffer**\n* options **Object**\n * chown **Object**\n * uid **Number**\n * gid **Number**\n * encoding **String** | **Null** default = 'utf8'\n * mode **Number** default = 438 (aka 0666 in Octal)\ncallback **Function**\n\nAtomically and asynchronously writes data to a file, replacing the file if it already\nexists. data can be a string or a buffer.\n\nThe file is initially named `filename + \".\" + md5hex(__filename, process.pid, ++invocations)`.\nIf writeFile completes successfully then, if passed the **chown** option it will change\nthe ownership of the file. Finally it renames the file back to the filename you specified. If\nit encounters errors at any of these steps it will attempt to unlink the temporary file and then\npass the error back to the caller.\n\nIf provided, the **chown** option requires both **uid** and **gid** properties or else\nyou'll get an error.\n\nThe **encoding** option is ignored if **data** is a buffer. It defaults to 'utf8'.\n\nExample:\n\n```javascript\nwriteFileAtomic('message.txt', 'Hello Node', {chown:{uid:100,gid:50}}, function (err) {\n if (err) throw err;\n console.log('It\\'s saved!');\n});\n```\n\n### var writeFileAtomicSync = require('write-file-atomic').sync
      writeFileAtomicSync(filename, data, [options])\n\nThe synchronous version of **writeFileAtomic**.\n", + "readmeFilename": "README.md", + "gitHead": "42dc04a17af96ac045f4979c8c951ee5a14a8b8b", + "_id": "write-file-atomic@1.1.4", + "_shasum": "b1f52dc2e8dc0e3cb04d187a25f758a38a90ca3b", + "_from": "write-file-atomic@>=1.1.4 <1.2.0" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/write-file-atomic/test/basic.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/write-file-atomic/test/basic.js new file mode 100644 index 00000000..13b97197 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/write-file-atomic/test/basic.js @@ -0,0 +1,97 @@ +'use strict' +var test = require('tap').test +var requireInject = require('require-inject') +var writeFileAtomic = requireInject('../index', { + 'graceful-fs': { + writeFile: function (tmpfile, data, options, cb) { + if (/nowrite/.test(tmpfile)) return cb(new Error('ENOWRITE')) + cb() + }, + chown: function (tmpfile, uid, gid, cb) { + if (/nochown/.test(tmpfile)) return cb(new Error('ENOCHOWN')) + cb() + }, + rename: function (tmpfile, filename, cb) { + if (/norename/.test(tmpfile)) return cb(new Error('ENORENAME')) + cb() + }, + unlink: function (tmpfile, cb) { + if (/nounlink/.test(tmpfile)) return cb(new Error('ENOUNLINK')) + cb() + }, + writeFileSync: function (tmpfile, data, options) { + if (/nowrite/.test(tmpfile)) throw new Error('ENOWRITE') + }, + chownSync: function (tmpfile, uid, gid) { + if (/nochown/.test(tmpfile)) throw new Error('ENOCHOWN') + }, + renameSync: function (tmpfile, filename) { + if (/norename/.test(tmpfile)) throw new Error('ENORENAME') + }, + unlinkSync: function (tmpfile) { + if (/nounlink/.test(tmpfile)) throw new Error('ENOUNLINK') + } + } +}) +var writeFileAtomicSync = writeFileAtomic.sync + +test('async tests', function (t) { + t.plan(7) + writeFileAtomic('good', 'test', {mode: '0777'}, function (err) { + t.notOk(err, 'No errors occur when passing in options') + }) + writeFileAtomic('good', 'test', function (err) { + t.notOk(err, 'No errors occur when NOT passing in options') + }) + writeFileAtomic('nowrite', 'test', function (err) { + t.is(err.message, 'ENOWRITE', 'writeFile failures propagate') + }) + writeFileAtomic('nochown', 'test', {chown: {uid: 100, gid: 100}}, function (err) { + t.is(err.message, 'ENOCHOWN', 'Chown failures propagate') + }) + writeFileAtomic('nochown', 'test', function (err) { + t.notOk(err, 'No attempt to chown when no uid/gid passed in') + }) + writeFileAtomic('norename', 'test', function (err) { + t.is(err.message, 'ENORENAME', 'Rename errors propagate') + }) + writeFileAtomic('norename nounlink', 'test', function (err) { + t.is(err.message, 'ENORENAME', 'Failure to unlink the temp file does not clobber the original error') + }) +}) + +test('sync tests', function (t) { + t.plan(7) + var throws = function (shouldthrow, msg, todo) { + var err + try { todo() } catch (e) { err = e } + t.is(shouldthrow, err.message, msg) + } + var noexception = function (msg, todo) { + var err + try { todo() } catch (e) { err = e } + t.notOk(err, msg) + } + + noexception('No errors occur when passing in options', function () { + writeFileAtomicSync('good', 'test', {mode: '0777'}) + }) + noexception('No errors occur when NOT passing in options', function () { + writeFileAtomicSync('good', 'test') + }) + throws('ENOWRITE', 'writeFile failures propagate', function () { + writeFileAtomicSync('nowrite', 'test') + }) + throws('ENOCHOWN', 'Chown failures propagate', function () { + writeFileAtomicSync('nochown', 'test', {chown: {uid: 100, gid: 100}}) + }) + noexception('No attempt to chown when no uid/gid passed in', function () { + writeFileAtomicSync('nochown', 'test') + }) + throws('ENORENAME', 'Rename errors propagate', function () { + writeFileAtomicSync('norename', 'test') + }) + throws('ENORENAME', 'Failure to unlink the temp file does not clobber the original error', function () { + writeFileAtomicSync('norename nounlink', 'test') + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/package.json new file mode 100644 index 00000000..45c111cc --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/package.json @@ -0,0 +1,199 @@ +{ + "version": "2.15.11", + "name": "npm", + "description": "a package manager for JavaScript", + "keywords": [ + "package manager", + "modules", + "install", + "package.json" + ], + "preferGlobal": true, + "config": { + "publishtest": false + }, + "homepage": "https://docs.npmjs.com/", + "author": "Isaac Z. Schlueter (http://blog.izs.me)", + "repository": { + "type": "git", + "url": "https://github.com/npm/npm" + }, + "bugs": { + "url": "https://github.com/npm/npm/issues" + }, + "directories": { + "doc": "./doc", + "man": "./man", + "lib": "./lib", + "bin": "./bin" + }, + "main": "./lib/npm.js", + "bin": "./bin/npm-cli.js", + "dependencies": { + "abbrev": "~1.0.9", + "ansi": "~0.3.1", + "ansicolors": "~0.3.2", + "ansistyles": "~0.1.3", + "archy": "~1.0.0", + "async-some": "~1.0.2", + "block-stream": "0.0.9", + "char-spinner": "~1.0.1", + "chmodr": "~1.0.2", + "chownr": "~1.0.1", + "cmd-shim": "~2.0.2", + "columnify": "~1.5.4", + "config-chain": "~1.1.10", + "dezalgo": "~1.0.3", + "editor": "~1.0.0", + "fs-vacuum": "~1.2.9", + "fs-write-stream-atomic": "~1.0.8", + "fstream": "~1.0.10", + "fstream-npm": "~1.1.1", + "github-url-from-git": "~1.4.0", + "github-url-from-username-repo": "~1.0.2", + "glob": "~7.0.6", + "graceful-fs": "~4.1.6", + "hosted-git-info": "~2.1.5", + "inflight": "~1.0.4", + "inherits": "~2.0.3", + "ini": "~1.3.4", + "init-package-json": "~1.9.4", + "lockfile": "~1.0.1", + "lru-cache": "~4.0.1", + "minimatch": "~3.0.3", + "mkdirp": "~0.5.1", + "node-gyp": "~3.4.0", + "nopt": "~3.0.6", + "normalize-git-url": "~3.0.2", + "normalize-package-data": "~2.3.5", + "npm-cache-filename": "~1.0.2", + "npm-install-checks": "~1.0.7", + "npm-package-arg": "~4.1.0", + "npm-registry-client": "~7.2.1", + "npm-user-validate": "~0.1.5", + "npmlog": "~2.0.4", + "once": "~1.4.0", + "opener": "~1.4.1", + "osenv": "~0.1.3", + "path-is-inside": "~1.0.0", + "read": "~1.0.7", + "read-installed": "~4.0.3", + "read-package-json": "~2.0.4", + "readable-stream": "~2.1.5", + "realize-package-specifier": "~3.0.1", + "request": "~2.74.0", + "retry": "~0.10.0", + "rimraf": "~2.5.4", + "semver": "~5.1.0", + "sha": "~2.0.1", + "slide": "~1.1.6", + "sorted-object": "~2.0.0", + "spdx-license-ids": "~1.2.2", + "strip-ansi": "~3.0.1", + "tar": "~2.2.1", + "text-table": "~0.2.0", + "uid-number": "0.0.6", + "umask": "~1.1.0", + "validate-npm-package-license": "~3.0.1", + "validate-npm-package-name": "~2.2.2", + "which": "~1.2.11", + "wrappy": "~1.0.2", + "write-file-atomic": "~1.1.4" + }, + "bundleDependencies": [ + "abbrev", + "ansi", + "ansi-regex", + "ansicolors", + "ansistyles", + "archy", + "async-some", + "block-stream", + "char-spinner", + "chmodr", + "chownr", + "cmd-shim", + "columnify", + "config-chain", + "dezalgo", + "editor", + "fs-vacuum", + "fs-write-stream-atomic", + "fstream", + "fstream-npm", + "github-url-from-git", + "github-url-from-username-repo", + "glob", + "graceful-fs", + "hosted-git-info", + "imurmurhash", + "inflight", + "inherits", + "ini", + "init-package-json", + "lockfile", + "lru-cache", + "minimatch", + "mkdirp", + "node-gyp", + "nopt", + "normalize-git-url", + "normalize-package-data", + "npm-cache-filename", + "npm-install-checks", + "npm-package-arg", + "npm-registry-client", + "npm-user-validate", + "npmlog", + "once", + "opener", + "osenv", + "path-is-inside", + "read", + "read-installed", + "read-package-json", + "readable-stream", + "realize-package-specifier", + "request", + "retry", + "rimraf", + "semver", + "sha", + "slide", + "sorted-object", + "spdx-license-ids", + "strip-ansi", + "tar", + "text-table", + "uid-number", + "umask", + "validate-npm-package-license", + "validate-npm-package-name", + "which", + "wrappy", + "write-file-atomic" + ], + "devDependencies": { + "deep-equal": "~1.0.1", + "marked": "~0.3.5", + "marked-man": "~0.1.5", + "npm-registry-couchapp": "~2.6.12", + "npm-registry-mock": "~1.0.1", + "require-inject": "~1.4.0", + "sprintf-js": "~1.0.3", + "tacks": "~1.2.1", + "tap": "~7.1.1" + }, + "scripts": { + "dumpconf": "env | grep npm | sort | uniq", + "prepublish": "node bin/npm-cli.js prune --prefix=. --no-global && rimraf test/*/*/node_modules && make doc-clean && make -j4 doc", + "preversion": "bash scripts/update-authors.sh && git add AUTHORS && git commit -m \"update AUTHORS\" || true", + "tap": "tap --reporter=classic --timeout 300", + "tap-cover": "tap --coverage --reporter=classic --timeout 600", + "test": "npm run test-tap", + "test-coverage": "npm run tap-cover -- \"test/tap/*.js\"", + "test-tap": "npm run tap -- \"test/tap/*.js\"", + "test-node": "\"$NODE\" \"node_modules/.bin/tap\" --timeout 240 \"test/tap/*.js\"" + }, + "license": "Artistic-2.0" +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/scripts/clean-old.sh b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/scripts/clean-old.sh new file mode 100644 index 00000000..cda80f2f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/scripts/clean-old.sh @@ -0,0 +1,165 @@ +#!/bin/bash + +# look for old 0.x cruft, and get rid of it. +# Should already be sitting in the npm folder. + +# This doesn't have to be quite as cross-platform as install.sh. +# There are some bash-isms, because maintaining *two* +# fully-portable posix/bourne sh scripts is too much for +# one project with a sane maintainer. + +# If readlink isn't available, then this is just too tricky. +# However, greadlink is fine, so Solaris can join the party, too. +readlink="readlink" +which $readlink >/dev/null 2>/dev/null +if [ $? -ne 0 ]; then + readlink="greadlink" + which $readlink >/dev/null 2>/dev/null + if [ $? -ne 0 ]; then + echo "Can't find the readlink or greadlink command. Aborting." + exit 1 + fi +fi + +if [ "x$npm_config_prefix" != "x" ]; then + PREFIXES=$npm_config_prefix +else + node="$NODE" + if [ "x$node" = "x" ]; then + node=`which node` + fi + if [ "x$node" = "x" ]; then + echo "Can't find node to determine prefix. Aborting." + exit 1 + fi + + + PREFIX=`dirname $node` + PREFIX=`dirname $PREFIX` + echo "cleanup prefix=$PREFIX" + PREFIXES=$PREFIX + + altprefix=`"$node" -e process.installPrefix` + if [ "x$altprefix" != "x" ] && [ "x$altprefix" != "x$PREFIX" ]; then + echo "altprefix=$altprefix" + PREFIXES="$PREFIX $altprefix" + fi +fi + +# now prefix is where npm would be rooted by default +# go hunting. + +packages= +for prefix in $PREFIXES; do + packages="$packages + "`ls "$prefix"/lib/node/.npm 2>/dev/null | grep -v .cache` +done + +packages=`echo $packages` + +filelist=() +fid=0 + +for prefix in $PREFIXES; do + # remove any links into the .npm dir, or links to + # version-named shims/symlinks. + for folder in share/man bin lib/node; do + find $prefix/$folder -type l | while read file; do + target=`$readlink $file | grep '/\.npm/'` + if [ "x$target" != "x" ]; then + # found one! + filelist[$fid]="$file" + let 'fid++' + # also remove any symlinks to this file. + base=`basename "$file"` + base=`echo "$base" | awk -F@ '{print $1}'` + if [ "x$base" != "x" ]; then + find "`dirname $file`" -type l -name "$base"'*' \ + | while read l; do + target=`$readlink "$l" | grep "$base"` + if [ "x$target" != "x" ]; then + filelist[$fid]="$1" + let 'fid++' + fi + done + fi + fi + done + + # Scour for shim files. These are relics of 0.2 npm installs. + # note: grep -r is not portable. + find $prefix/$folder -type f \ + | xargs grep -sl '// generated by npm' \ + | while read file; do + filelist[$fid]="$file" + let 'fid++' + done + done + + # now remove the package modules, and the .npm folder itself. + if [ "x$packages" != "x" ]; then + for pkg in $packages; do + filelist[$fid]="$prefix/lib/node/$pkg" + let 'fid++' + for i in $prefix/lib/node/$pkg\@*; do + filelist[$fid]="$i" + let 'fid++' + done + done + fi + + for folder in lib/node/.npm lib/npm share/npm; do + if [ -d $prefix/$folder ]; then + filelist[$fid]="$prefix/$folder" + let 'fid++' + fi + done +done + +# now actually clean, but only if there's anything TO clean +if [ "${#filelist[@]}" -gt 0 ]; then + echo "" + echo "This script will find and eliminate any shims, symbolic" + echo "links, and other cruft that was installed by npm 0.x." + echo "" + + if [ "x$packages" != "x" ]; then + echo "The following packages appear to have been installed with" + echo "an old version of npm, and will be removed forcibly:" + for pkg in $packages; do + echo " $pkg" + done + echo "Make a note of these. You may want to install them" + echo "with npm 1.0 when this process is completed." + echo "" + fi + + OK= + if [ "x$1" = "x-y" ]; then + OK="yes" + fi + + while [ "$OK" != "y" ] && [ "$OK" != "yes" ] && [ "$OK" != "no" ]; do + echo "Is this OK?" + echo " enter 'yes' or 'no'" + echo " or 'show' to see a list of files " + read OK + if [ "x$OK" = "xshow" ] || [ "x$OK" = "xs" ]; then + for i in "${filelist[@]}"; do + echo "$i" + done + fi + done + if [ "$OK" = "no" ]; then + echo "Aborting" + exit 1 + fi + for i in "${filelist[@]}"; do + rm -rf "$i" + done +fi + +echo "" +echo 'All clean!' + +exit 0 diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/scripts/doc-build.sh b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/scripts/doc-build.sh new file mode 100644 index 00000000..61819028 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/scripts/doc-build.sh @@ -0,0 +1,119 @@ +#!/usr/bin/env bash + +if [[ $DEBUG != "" ]]; then + set -x +fi +set -o errexit +set -o pipefail + +if ! [ -x node_modules/.bin/marked-man ]; then + ps=0 + if [ -f .building_marked-man ]; then + pid=$(cat .building_marked-man) + ps=$(ps -p $pid | grep $pid | wc -l) || true + fi + + if [ -f .building_marked-man ] && [ $ps != 0 ]; then + while [ -f .building_marked-man ]; do + sleep 1 + done + else + # a race to see which make process will be the one to install marked-man + echo $$ > .building_marked-man + sleep 1 + if [ $(cat .building_marked-man) == $$ ]; then + make node_modules/.bin/marked-man + rm .building_marked-man + else + while [ -f .building_marked-man ]; do + sleep 1 + done + fi + fi +fi + +if ! [ -x node_modules/.bin/marked ]; then + ps=0 + if [ -f .building_marked ]; then + pid=$(cat .building_marked) + ps=$(ps -p $pid | grep $pid | wc -l) || true + fi + + if [ -f .building_marked ] && [ $ps != 0 ]; then + while [ -f .building_marked ]; do + sleep 1 + done + else + # a race to see which make process will be the one to install marked + echo $$ > .building_marked + sleep 1 + if [ $(cat .building_marked) == $$ ]; then + make node_modules/.bin/marked + rm .building_marked + else + while [ -f .building_marked ]; do + sleep 1 + done + fi + fi +fi + +src=$1 +dest=$2 +name=$(basename ${src%.*}) +date=$(date -u +'%Y-%m-%d %H:%M:%S') +version=$(node cli.js -v) + +mkdir -p $(dirname $dest) + +html_replace_tokens () { + local url=$1 + sed "s|@NAME@|$name|g" \ + | sed "s|@DATE@|$date|g" \ + | sed "s|@URL@|$url|g" \ + | sed "s|@VERSION@|$version|g" \ + | perl -p -e 's/]*)>([^\(]*\([0-9]\)) -- (.*?)<\/h1>/

      \2<\/h1>

      \3<\/p>/g' \ + | perl -p -e 's/npm-npm/npm/g' \ + | perl -p -e 's/([^"-])(npm-)?README(?!\.html)(\(1\))?/\1README<\/a>/g' \ + | perl -p -e 's/<a href="[^"]+README.html">README<\/a><\/title>/<title>README<\/title>/g' \ + | perl -p -e 's/([^"-])([^\(> ]+)(\(1\))/\1<a href="..\/cli\/\2.html">\2\3<\/a>/g' \ + | perl -p -e 's/([^"-])([^\(> ]+)(\(3\))/\1<a href="..\/api\/\2.html">\2\3<\/a>/g' \ + | perl -p -e 's/([^"-])([^\(> ]+)(\(5\))/\1<a href="..\/files\/\2.html">\2\3<\/a>/g' \ + | perl -p -e 's/([^"-])([^\(> ]+)(\(7\))/\1<a href="..\/misc\/\2.html">\2\3<\/a>/g' \ + | perl -p -e 's/\([1357]\)<\/a><\/h1>/<\/a><\/h1>/g' \ + | (if [ $(basename $(dirname $dest)) == "doc" ]; then + perl -p -e 's/ href="\.\.\// href="/g' + else + cat + fi) +} + +man_replace_tokens () { + sed "s|@VERSION@|$version|g" \ + | perl -p -e 's/(npm\\-)?([a-zA-Z\\\.\-]*)\(1\)/npm help \2/g' \ + | perl -p -e 's/(npm\\-)?([a-zA-Z\\\.\-]*)\(([57])\)/npm help \3 \2/g' \ + | perl -p -e 's/(npm\\-)?([a-zA-Z\\\.\-]*)\(3\)/npm apihelp \2/g' \ + | perl -p -e 's/npm\(1\)/npm help npm/g' \ + | perl -p -e 's/npm\(3\)/npm apihelp npm/g' +} + +case $dest in + *.[1357]) + ./node_modules/.bin/marked-man --roff $src \ + | man_replace_tokens > $dest + exit $? + ;; + *.html) + url=${dest/html\//} + (cat html/dochead.html && \ + cat $src | ./node_modules/.bin/marked && + cat html/docfoot.html)\ + | html_replace_tokens $url \ + > $dest + exit $? + ;; + *) + echo "Invalid destination type: $dest" >&2 + exit 1 + ;; +esac diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/scripts/index-build.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/scripts/index-build.js new file mode 100644 index 00000000..21297cc9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/scripts/index-build.js @@ -0,0 +1,63 @@ +#!/usr/bin/env node +var fs = require("fs") + , path = require("path") + , root = path.resolve(__dirname, "..") + , glob = require("glob") + , conversion = { "cli": 1, "api": 3, "files": 5, "misc": 7 } + +glob(root + "/{README.md,doc/*/*.md}", function (er, files) { + if (er) + throw er + output(files.map(function (f) { + var b = path.basename(f) + if (b === "README.md") + return [0, b] + if (b === "index.md") + return null + var s = conversion[path.basename(path.dirname(f))] + return [s, f] + }).filter(function (f) { + return f + }).sort(function (a, b) { + return (a[0] === b[0]) + ? ( path.basename(a[1]) === "npm.md" ? -1 + : path.basename(b[1]) === "npm.md" ? 1 + : a[1] > b[1] ? 1 : -1 ) + : a[0] - b[0] + })) +}) + +return + +function output (files) { + console.log( + "npm-index(7) -- Index of all npm documentation\n" + + "==============================================\n") + + writeLines(files, 0) + writeLines(files, 1, "Command Line Documentation", "Using npm on the command line") + writeLines(files, 3, "API Documentation", "Using npm in your Node programs") + writeLines(files, 5, "Files", "File system structures npm uses") + writeLines(files, 7, "Misc", "Various other bits and bobs") +} + +function writeLines (files, sxn, heading, desc) { + if (heading) { + console.log("## %s\n\n%s\n", heading, desc) + } + files.filter(function (f) { + return f[0] === sxn + }).forEach(writeLine) +} + + +function writeLine (sd) { + var sxn = sd[0] || 1 + , doc = sd[1] + , d = path.basename(doc, ".md") + + var content = fs.readFileSync(doc, "utf8").split("\n")[0].split("-- ")[1] + + console.log("### %s(%d)\n", d, sxn) + console.log(content + "\n") +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/scripts/install.sh b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/scripts/install.sh new file mode 100644 index 00000000..e6624f06 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/scripts/install.sh @@ -0,0 +1,270 @@ +#!/bin/sh + +# A word about this shell script: +# +# It must work everywhere, including on systems that lack +# a /bin/bash, map 'sh' to ksh, ksh97, bash, ash, or zsh, +# and potentially have either a posix shell or bourne +# shell living at /bin/sh. +# +# See this helpful document on writing portable shell scripts: +# http://www.gnu.org/s/hello/manual/autoconf/Portable-Shell.html +# +# The only shell it won't ever work on is cmd.exe. + +if [ "x$0" = "xsh" ]; then + # run as curl | sh + # on some systems, you can just do cat>npm-install.sh + # which is a bit cuter. But on others, &1 is already closed, + # so catting to another script file won't do anything. + # Follow Location: headers, and fail on errors + curl -f -L -s https://www.npmjs.org/install.sh > npm-install-$$.sh + ret=$? + if [ $ret -eq 0 ]; then + (exit 0) + else + rm npm-install-$$.sh + echo "Failed to download script" >&2 + exit $ret + fi + sh npm-install-$$.sh + ret=$? + rm npm-install-$$.sh + exit $ret +fi + +# See what "npm_config_*" things there are in the env, +# and make them permanent. +# If this fails, it's not such a big deal. +configures="`env | grep 'npm_config_' | sed -e 's|^npm_config_||g'`" + +npm_config_loglevel="error" +if [ "x$npm_debug" = "x" ]; then + (exit 0) +else + echo "Running in debug mode." + echo "Note that this requires bash or zsh." + set -o xtrace + set -o pipefail + npm_config_loglevel="verbose" +fi +export npm_config_loglevel + +# make sure that node exists +node=`which node 2>&1` +ret=$? +if [ $ret -eq 0 ] && [ -x "$node" ]; then + (exit 0) +else + echo "npm cannot be installed without node.js." >&2 + echo "Install node first, and then try again." >&2 + echo "" >&2 + echo "Maybe node is installed, but not in the PATH?" >&2 + echo "Note that running as sudo can change envs." >&2 + echo "" + echo "PATH=$PATH" >&2 + exit $ret +fi + +# set the temp dir +TMP="${TMPDIR}" +if [ "x$TMP" = "x" ]; then + TMP="/tmp" +fi +TMP="${TMP}/npm.$$" +rm -rf "$TMP" || true +mkdir "$TMP" +if [ $? -ne 0 ]; then + echo "failed to mkdir $TMP" >&2 + exit 1 +fi + +BACK="$PWD" + +ret=0 +tar="${TAR}" +if [ -z "$tar" ]; then + tar="${npm_config_tar}" +fi +if [ -z "$tar" ]; then + tar=`which tar 2>&1` + ret=$? +fi + +if [ $ret -eq 0 ] && [ -x "$tar" ]; then + echo "tar=$tar" + echo "version:" + $tar --version + ret=$? +fi + +if [ $ret -eq 0 ]; then + (exit 0) +else + echo "No suitable tar program found." + exit 1 +fi + + + +# Try to find a suitable make +# If the MAKE environment var is set, use that. +# otherwise, try to find gmake, and then make. +# If no make is found, then just execute the necessary commands. + +# XXX For some reason, make is building all the docs every time. This +# is an annoying source of bugs. Figure out why this happens. +MAKE=NOMAKE + +if [ "x$MAKE" = "x" ]; then + make=`which gmake 2>&1` + if [ $? -eq 0 ] && [ -x "$make" ]; then + (exit 0) + else + make=`which make 2>&1` + if [ $? -eq 0 ] && [ -x "$make" ]; then + (exit 0) + else + make=NOMAKE + fi + fi +else + make="$MAKE" +fi + +if [ -x "$make" ]; then + (exit 0) +else + # echo "Installing without make. This may fail." >&2 + make=NOMAKE +fi + +# If there's no bash, then don't even try to clean +if [ -x "/bin/bash" ]; then + (exit 0) +else + clean="no" +fi + +node_version=`"$node" --version 2>&1` +ret=$? +if [ $ret -ne 0 ]; then + echo "You need node to run this program." >&2 + echo "node --version reports: $node_version" >&2 + echo "with exit code = $ret" >&2 + echo "Please install node before continuing." >&2 + exit $ret +fi + +t="${npm_install}" +if [ -z "$t" ]; then + # switch based on node version. + # note that we can only use strict sh-compatible patterns here. + case $node_version in + 0.[01234567].* | v0.[01234567].*) + echo "You are using an outdated and unsupported version of" >&2 + echo "node ($node_version). Please update node and try again." >&2 + exit 99 + ;; + *) + echo "install npm@latest" + t="latest" + ;; + esac +fi + +# need to echo "" after, because Posix sed doesn't treat EOF +# as an implied end of line. +url=`(curl -SsL https://registry.npmjs.org/npm/$t; echo "") \ + | sed -e 's/^.*tarball":"//' \ + | sed -e 's/".*$//'` + +ret=$? +if [ "x$url" = "x" ]; then + ret=125 + # try without the -e arg to sed. + url=`(curl -SsL https://registry.npmjs.org/npm/$t; echo "") \ + | sed 's/^.*tarball":"//' \ + | sed 's/".*$//'` + ret=$? + if [ "x$url" = "x" ]; then + ret=125 + fi +fi +if [ $ret -ne 0 ]; then + echo "Failed to get tarball url for npm/$t" >&2 + exit $ret +fi + + +echo "fetching: $url" >&2 + +cd "$TMP" \ + && curl -SsL "$url" \ + | $tar -xzf - \ + && cd "$TMP"/* \ + && (ver=`"$node" bin/read-package-json.js package.json version` + isnpm10=0 + if [ $ret -eq 0 ]; then + if [ -d node_modules ]; then + if "$node" node_modules/semver/bin/semver -v "$ver" -r "1" + then + isnpm10=1 + fi + else + if "$node" bin/semver -v "$ver" -r ">=1.0"; then + isnpm10=1 + fi + fi + fi + + ret=0 + if [ $isnpm10 -eq 1 ] && [ -f "scripts/clean-old.sh" ]; then + if [ "x$skipclean" = "x" ]; then + (exit 0) + else + clean=no + fi + if [ "x$clean" = "xno" ] \ + || [ "x$clean" = "xn" ]; then + echo "Skipping 0.x cruft clean" >&2 + ret=0 + elif [ "x$clean" = "xy" ] || [ "x$clean" = "xyes" ]; then + NODE="$node" /bin/bash "scripts/clean-old.sh" "-y" + ret=$? + else + NODE="$node" /bin/bash "scripts/clean-old.sh" </dev/tty + ret=$? + fi + fi + + if [ $ret -ne 0 ]; then + echo "Aborted 0.x cleanup. Exiting." >&2 + exit $ret + fi) \ + && (if [ "x$configures" = "x" ]; then + (exit 0) + else + echo "./configure $configures" + echo "$configures" > npmrc + fi) \ + && (if [ "$make" = "NOMAKE" ]; then + (exit 0) + elif "$make" uninstall install; then + (exit 0) + else + make="NOMAKE" + fi + if [ "$make" = "NOMAKE" ]; then + "$node" cli.js rm npm -gf + "$node" cli.js install -gf + fi) \ + && cd "$BACK" \ + && rm -rf "$TMP" \ + && echo "It worked" + +ret=$? +if [ $ret -ne 0 ]; then + echo "It failed" >&2 +fi +exit $ret diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/scripts/publish-tag.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/scripts/publish-tag.js new file mode 100644 index 00000000..046ec988 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/scripts/publish-tag.js @@ -0,0 +1,3 @@ +var semver = require("semver") +var version = semver.parse(require("../package.json").version) +console.log('v%s.%s-next', version.major, version.minor) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/scripts/release.sh b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/scripts/release.sh new file mode 100644 index 00000000..abe6c197 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/scripts/release.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +# script for creating a zip and tarball for inclusion in node + +unset CDPATH + +set -e + +rm -rf release *.tgz || true +mkdir release +node ./cli.js pack --loglevel error >/dev/null +mv *.tgz release +cd release +tar xzf *.tgz + +mkdir node_modules +mv package node_modules/npm + +# make the zip for windows users +cp node_modules/npm/bin/*.cmd . +zipname=npm-$(node ../cli.js -v).zip +zip -q -9 -r -X "$zipname" *.cmd node_modules + +# make the tar for node's deps +cd node_modules +tarname=npm-$(node ../../cli.js -v).tgz +tar czf "$tarname" npm + +cd .. +mv "node_modules/$tarname" . + +rm -rf *.cmd +rm -rf node_modules + +echo "release/$tarname" +echo "release/$zipname" diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/scripts/relocate.sh b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/scripts/relocate.sh new file mode 100644 index 00000000..b7483f29 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/scripts/relocate.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# Change the cli shebang to point at the specified node +# Useful for when the program is moved around after install. +# Also used by the default 'make install' in node to point +# npm at the newly installed node, rather than the first one +# in the PATH, which would be the default otherwise. + +# bash /path/to/npm/scripts/relocate.sh $nodepath +# If $nodepath is blank, then it'll use /usr/bin/env + +dir="$(dirname "$(dirname "$0")")" +cli="$dir"/bin/npm-cli.js +tmp="$cli".tmp + +node="$1" +if [ "x$node" = "x" ]; then + node="/usr/bin/env node" +fi +node="#!$node" + +sed -e 1d "$cli" > "$tmp" +echo "$node" > "$cli" +cat "$tmp" >> "$cli" +rm "$tmp" +chmod ogu+x $cli diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/scripts/update-authors.sh b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/scripts/update-authors.sh new file mode 100644 index 00000000..75a6e549 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/scripts/update-authors.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +git log --reverse --format='%aN <%aE>' | perl -wnE ' +BEGIN { + say "# Authors sorted by whether or not they\x27re me"; +} + +print $seen{$_} = $_ unless $seen{$_} +' > AUTHORS diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/common-tap.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/common-tap.js new file mode 100644 index 00000000..06c1e3f9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/common-tap.js @@ -0,0 +1,97 @@ +// cheesy hackaround for test deps (read: nock) that rely on setImmediate +if (!global.setImmediate || !require('timers').setImmediate) { + require('timers').setImmediate = global.setImmediate = function () { + var args = [arguments[0], 0].concat([].slice.call(arguments, 1)) + setTimeout.apply(this, args) + } +} +var spawn = require('child_process').spawn +var path = require('path') + +var port = exports.port = 1337 +exports.registry = 'http://localhost:' + port +process.env.npm_config_loglevel = 'error' + +var npm_config_cache = path.resolve(__dirname, 'npm_cache') +process.env.npm_config_cache = exports.npm_config_cache = npm_config_cache +process.env.npm_config_userconfig = exports.npm_config_userconfig = path.join(__dirname, 'fixtures', 'config', 'userconfig') +process.env.npm_config_globalconfig = exports.npm_config_globalconfig = path.join(__dirname, 'fixtures', 'config', 'globalconfig') +process.env.random_env_var = 'foo' +// suppress warnings about using a prerelease version of node +process.env.npm_config_node_version = process.version.replace(/-.*$/, '') + +var bin = exports.bin = require.resolve('../bin/npm-cli.js') +var chain = require('slide').chain +var once = require('once') + +exports.npm = function npm (cmd, opts, cb) { + cb = once(cb) + cmd = [bin].concat(cmd) + opts = opts || {} + + opts.env = opts.env || process.env + if (!opts.env.npm_config_cache) { + opts.env.npm_config_cache = npm_config_cache + } + + var stdout = '' + var stderr = '' + var node = process.execPath + var child = spawn(node, cmd, opts) + + if (child.stderr) { + child.stderr.on('data', function (chunk) { + stderr += chunk + }) + } + + if (child.stdout) { + child.stdout.on('data', function (chunk) { + stdout += chunk + }) + } + + child.on('error', cb) + + child.on('close', function (code) { + cb(null, code, stdout, stderr) + }) + return child +} + +exports.makeGitRepo = function makeGitRepo (params, cb) { + // git must be called after npm.load because it uses config + var git = require('../lib/utils/git.js') + + var root = params.path || process.cwd() + var user = params.user || 'PhantomFaker' + var email = params.email || 'nope@not.real' + var added = params.added || ['package.json'] + var message = params.message || 'stub repo' + + var opts = { cwd: root, env: { PATH: process.env.PATH }} + var commands = [ + git.chainableExec(['init'], opts), + git.chainableExec(['config', 'user.name', user], opts), + git.chainableExec(['config', 'user.email', email], opts), + git.chainableExec(['add'].concat(added), opts), + git.chainableExec(['commit', '-m', message], opts) + ] + + if (Array.isArray(params.commands)) { + commands = commands.concat(params.commands) + } + + chain(commands, cb) +} + +exports.rmFromInShrinkwrap = function rmFromInShrinkwrap (obj) { + for (var i in obj) { + if (i === "from") + delete obj[i] + else if (i === "dependencies") + for (var j in obj[i]) + exports.rmFromInShrinkwrap(obj[i][j]) + } + return obj +} \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/config/builtin b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/config/builtin new file mode 100644 index 00000000..dcd542c0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/config/builtin @@ -0,0 +1 @@ +builtin-config = true diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/config/globalconfig b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/config/globalconfig new file mode 100644 index 00000000..41c0b70c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/config/globalconfig @@ -0,0 +1 @@ +package-config:foo = boo diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/config/malformed b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/config/malformed new file mode 100644 index 00000000..182c4d2c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/config/malformed @@ -0,0 +1 @@ +email = """ \ No newline at end of file diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/config/multi-ca b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/config/multi-ca new file mode 100644 index 00000000..0bc922b2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/config/multi-ca @@ -0,0 +1,32 @@ +-----BEGIN CERTIFICATE----- +MIICjTCCAfigAwIBAgIEMaYgRzALBgkqhkiG9w0BAQQwRTELMAkGA1UEBhMCVVMx +NjA0BgNVBAoTLU5hdGlvbmFsIEFlcm9uYXV0aWNzIGFuZCBTcGFjZSBBZG1pbmlz +dHJhdGlvbjAmFxE5NjA1MjgxMzQ5MDUrMDgwMBcROTgwNTI4MTM0OTA1KzA4MDAw +ZzELMAkGA1UEBhMCVVMxNjA0BgNVBAoTLU5hdGlvbmFsIEFlcm9uYXV0aWNzIGFu +ZCBTcGFjZSBBZG1pbmlzdHJhdGlvbjEgMAkGA1UEBRMCMTYwEwYDVQQDEwxTdGV2 +ZSBTY2hvY2gwWDALBgkqhkiG9w0BAQEDSQAwRgJBALrAwyYdgxmzNP/ts0Uyf6Bp +miJYktU/w4NG67ULaN4B5CnEz7k57s9o3YY3LecETgQ5iQHmkwlYDTL2fTgVfw0C +AQOjgaswgagwZAYDVR0ZAQH/BFowWDBWMFQxCzAJBgNVBAYTAlVTMTYwNAYDVQQK +Ey1OYXRpAAAAACBBZXJvbmF1dGljcyBhbmQgU3BhY2UgQWRtaW5pc3RyYXRpb24x +DTALBgNVBAMTBENSTDEwFwYDVR0BAQH/BA0wC4AJODMyOTcwODEwMBgGA1UdAgQR +MA8ECTgzMjk3MDgyM4ACBSAwDQYDVR0KBAYwBAMCBkAwCwYJKoZIhvcNAQEEA4GB +AH2y1VCEw/A4zaXzSYZJTTUi3uawbbFiS2yxHvgf28+8Js0OHXk1H1w2d6qOHH21 +X82tZXd/0JtG0g1T9usFFBDvYK8O0ebgz/P5ELJnBL2+atObEuJy1ZZ0pBDWINR3 +WkDNLCGiTkCKp0F5EWIrVDwh54NNevkCQRZita+z4IBO +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +AAAAAACCAfigAwIBAgIEMaYgRzALBgkqhkiG9w0BAQQwRTELMAkGA1UEBhMCVVMx +NjA0BgNVBAoTLU5hdGlvbmFsIEFlcm9uYXV0aWNzIGFuZCBTcGFjZSBBZG1pbmlz +dHJhdGlvbjAmFxE5NjA1MjgxMzQ5MDUrMDgwMBcROTgwNTI4MTM0OTA1KzA4MDAw +ZzELMAkGA1UEBhMCVVMxNjA0BgNVBAoTLU5hdGlvbmFsIEFlcm9uYXV0aWNzIGFu +ZCBTcGFjZSBBZG1pbmlzdHJhdGlvbjEgMAkGA1UEBRMCMTYwEwYDVQQDEwxTdGV2 +ZSBTY2hvY2gwWDALBgkqhkiG9w0BAQEDSQAwRgJBALrAwyYdgxmzNP/ts0Uyf6Bp +miJYktU/w4NG67ULaN4B5CnEz7k57s9o3YY3LecETgQ5iQHmkwlYDTL2fTgVfw0C +AQOjgaswgagwZAYDVR0ZAQH/BFowWDBWMFQxCzAJBgNVBAYTAlVTMTYwNAYDVQQK +Ey1OYXRpb25hbCBBZXJvbmF1dGljcyBhbmQgU3BhY2UgQWRtaW5pc3RyYXRpb24x +DTALBgNVBAMTBENSTDEwFwYDVR0BAQH/BA0wC4AJODMyOTcwODEwMBgGA1UdAgQR +MA8ECTgzMjk3MDgyM4ACBSAwDQYDVR0KBAYwBAMCBkAwCwYJKoZIhvcNAQEEA4GB +AH2y1VCEw/A4zaXzSYZJTTUi3uawbbFiS2yxHvgf28+8Js0OHXk1H1w2d6qOHH21 +X82tZXd/0JtG0g1T9usFFBDvYK8O0ebgz/P5ELJnBL2+atObEuJy1ZZ0pBDWINR3 +WkDNLCGiTkCKp0F5EWIrVDwh54NNevkCQRZita+z4IBO +-----END CERTIFICATE----- diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/config/package.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/config/package.json new file mode 100644 index 00000000..e69de29b diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/config/userconfig b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/config/userconfig new file mode 100644 index 00000000..d600c066 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/config/userconfig @@ -0,0 +1,23 @@ +email = i@izs.me +env-thing = ${random_env_var} +init.author.name = Isaac Z. Schlueter +init.author.email = i@izs.me +init.author.url = http://blog.izs.me/ +init.version = 1.2.3 +proprietary-attribs = false +npm:publishtest = true +_npmjs.org:couch = https://admin:password@localhost:5984/registry +npm-www:nocache = 1 +nodedir = /Users/isaacs/dev/js/node-v0.8 +sign-git-tag = true +message = v%s +strict-ssl = false +tmp = ~/.tmp +_auth = dXNlcm5hbWU6cGFzc3dvcmQ= + +[_token] +AuthSession = yabba-dabba-doodle +version = 1 +expires = 1345001053415 +path = / +httponly = true diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/forked-underscore-1.5.1.tgz b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/forked-underscore-1.5.1.tgz new file mode 100644 index 00000000..5aca6247 Binary files /dev/null and b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/forked-underscore-1.5.1.tgz differ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/github-com-BryanDonovan-dummy-npm-bar.git.tar.gz b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/github-com-BryanDonovan-dummy-npm-bar.git.tar.gz new file mode 100644 index 00000000..fb27e17f Binary files /dev/null and b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/github-com-BryanDonovan-dummy-npm-bar.git.tar.gz differ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/github-com-BryanDonovan-dummy-npm-buzz.git.tar.gz b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/github-com-BryanDonovan-dummy-npm-buzz.git.tar.gz new file mode 100644 index 00000000..0ea851fb Binary files /dev/null and b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/github-com-BryanDonovan-dummy-npm-buzz.git.tar.gz differ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/github-com-BryanDonovan-dummy-npm-foo.git.tar.gz b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/github-com-BryanDonovan-dummy-npm-foo.git.tar.gz new file mode 100644 index 00000000..8e1abc6d Binary files /dev/null and b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/github-com-BryanDonovan-dummy-npm-foo.git.tar.gz differ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/github-com-BryanDonovan-npm-git-test.git.tar.gz b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/github-com-BryanDonovan-npm-git-test.git.tar.gz new file mode 100644 index 00000000..7a4b9e81 Binary files /dev/null and b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/github-com-BryanDonovan-npm-git-test.git.tar.gz differ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/gitignore-and-npmignore-2.tar b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/gitignore-and-npmignore-2.tar new file mode 100644 index 00000000..289dd568 Binary files /dev/null and b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/gitignore-and-npmignore-2.tar differ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/gitignore-and-npmignore.tar b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/gitignore-and-npmignore.tar new file mode 100644 index 00000000..8b638b11 Binary files /dev/null and b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/gitignore-and-npmignore.tar differ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/gitignore-and-npmignore.tgz b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/gitignore-and-npmignore.tgz new file mode 100644 index 00000000..4be43641 Binary files /dev/null and b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/gitignore-and-npmignore.tgz differ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/gitignore.tgz b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/gitignore.tgz new file mode 100644 index 00000000..7f5f2d71 Binary files /dev/null and b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/gitignore.tgz differ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/npmignore.tgz b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/npmignore.tgz new file mode 100644 index 00000000..765593de Binary files /dev/null and b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/npmignore.tgz differ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/onload.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/onload.js new file mode 100644 index 00000000..90c1a3aa --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/onload.js @@ -0,0 +1 @@ +console.error('called onload') diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/scoped-underscore-1.3.1.tgz b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/scoped-underscore-1.3.1.tgz new file mode 100644 index 00000000..d98a3459 Binary files /dev/null and b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/fixtures/scoped-underscore-1.3.1.tgz differ diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/packages/npm-test-array-bin/test.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/packages/npm-test-array-bin/test.js new file mode 100644 index 00000000..984bedb4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/packages/npm-test-array-bin/test.js @@ -0,0 +1,4 @@ +require('child_process').exec('array-bin', { env: process.env }, + function (err) { + if (err && err.code) throw new Error('exited badly with code = ' + err.code) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/packages/npm-test-blerg/test.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/packages/npm-test-blerg/test.js new file mode 100644 index 00000000..f548458a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/packages/npm-test-blerg/test.js @@ -0,0 +1,5 @@ + +var assert = require("assert") +assert.equal(undefined, process.env.npm_config__password, "password exposed!") +assert.equal(undefined, process.env.npm_config__auth, "auth exposed!") +assert.equal(undefined, process.env.npm_config__authCrypt, "authCrypt exposed!") diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/packages/npm-test-blerg3/test.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/packages/npm-test-blerg3/test.js new file mode 100644 index 00000000..f548458a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/packages/npm-test-blerg3/test.js @@ -0,0 +1,5 @@ + +var assert = require("assert") +assert.equal(undefined, process.env.npm_config__password, "password exposed!") +assert.equal(undefined, process.env.npm_config__auth, "auth exposed!") +assert.equal(undefined, process.env.npm_config__authCrypt, "authCrypt exposed!") diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/packages/npm-test-bundled-git/minimatch-expected.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/packages/npm-test-bundled-git/minimatch-expected.json new file mode 100644 index 00000000..62b20d69 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/packages/npm-test-bundled-git/minimatch-expected.json @@ -0,0 +1,29 @@ +{ + "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me)", + "name": "minimatch", + "description": "a glob matcher in javascript", + "version": "0.2.1", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/minimatch.git" + }, + "main": "minimatch.js", + "scripts": { + "test": "tap test" + }, + "engines": { + "node": "*" + }, + "dependencies": { + "lru-cache": "~1.0.5" + }, + "devDependencies": { + "tap": "~0.1.3" + }, + "licenses" : [ + { + "type" : "MIT", + "url" : "http://github.com/isaacs/minimatch/raw/master/LICENSE" + } + ] +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/packages/npm-test-bundled-git/test.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/packages/npm-test-bundled-git/test.js new file mode 100644 index 00000000..4fcc54ca --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/packages/npm-test-bundled-git/test.js @@ -0,0 +1,4 @@ +var a = require("./node_modules/glob/node_modules/minimatch/package.json") +var e = require("./minimatch-expected.json") +var assert = require("assert") +assert.deepEqual(a, e, "didn't get expected minimatch/package.json") diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/packages/npm-test-dir-bin/test.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/packages/npm-test-dir-bin/test.js new file mode 100644 index 00000000..c59ec92d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/packages/npm-test-dir-bin/test.js @@ -0,0 +1,4 @@ +require('child_process').exec('dir-bin', { stdio: 'pipe', + env: process.env }, function (err) { + if (err && err.code) throw new Error('exited badly with code = ' + err.code) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/packages/npm-test-ignore-nested-nm/test.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/packages/npm-test-ignore-nested-nm/test.js new file mode 100644 index 00000000..308c66b5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/packages/npm-test-ignore-nested-nm/test.js @@ -0,0 +1,2 @@ +fs = require('fs') +fs.statSync(__dirname + '/lib/node_modules/foo') diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/packages/npm-test-missing-bindir/test.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/packages/npm-test-missing-bindir/test.js new file mode 100644 index 00000000..f548458a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/packages/npm-test-missing-bindir/test.js @@ -0,0 +1,5 @@ + +var assert = require("assert") +assert.equal(undefined, process.env.npm_config__password, "password exposed!") +assert.equal(undefined, process.env.npm_config__auth, "auth exposed!") +assert.equal(undefined, process.env.npm_config__authCrypt, "authCrypt exposed!") diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/packages/npm-test-optional-deps/test.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/packages/npm-test-optional-deps/test.js new file mode 100644 index 00000000..2232906d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/packages/npm-test-optional-deps/test.js @@ -0,0 +1,9 @@ +var fs = require("fs") +var assert = require("assert") +var path = require("path") + +// sax should be the only dep that ends up installed + +var dir = path.resolve(__dirname, "node_modules") +assert.deepEqual(fs.readdirSync(dir), ["sax"]) +assert.equal(require("sax/package.json").version, "0.3.5") diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/packages/npm-test-shrinkwrap/npm-shrinkwrap.json b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/packages/npm-test-shrinkwrap/npm-shrinkwrap.json new file mode 100644 index 00000000..09a03414 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/packages/npm-test-shrinkwrap/npm-shrinkwrap.json @@ -0,0 +1,48 @@ +{ + "name": "npm-test-shrinkwrap", + "version": "0.0.0", + "dependencies": { + "npm-test-single-file": { + "version": "1.2.3", + "resolved": "https://gist.github.com/isaacs/1837112/raw/9ef57a59fc22aeb1d1ca346b68826dcb638b8416/index.js" + }, + "glob": { + "version": "3.1.5", + "resolved": "git://github.com/isaacs/node-glob.git#67bda227fd7a559cca5620307c7d30a6732a792f", + "dependencies": { + "minimatch": { + "version": "0.2.1", + "dependencies": { + "lru-cache": { + "version": "1.0.5" + } + } + }, + "graceful-fs": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.1.5.tgz", + "dependencies": { + "fast-list": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/fast-list/-/fast-list-1.0.2.tgz" + } + } + }, + "inherits": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-1.0.0.tgz" + } + } + }, + "minimatch": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.1.5.tgz", + "dependencies": { + "lru-cache": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-1.0.5.tgz" + } + } + } + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/run.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/run.js new file mode 100644 index 00000000..5b33e68a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/run.js @@ -0,0 +1,193 @@ +// Everything in this file uses child processes, because we're +// testing a command line utility. + +var chain = require("slide").chain +var child_process = require("child_process") +var path = require("path") + , testdir = __dirname + , fs = require("graceful-fs") + , npmpkg = path.dirname(testdir) + , npmcli = path.resolve(npmpkg, "bin", "npm-cli.js") + +var temp = process.env.TMPDIR + || process.env.TMP + || process.env.TEMP + || ( process.platform === "win32" + ? "c:\\windows\\temp" + : "/tmp" ) + +temp = path.resolve(temp, "npm-test-" + process.pid) + +var root = path.resolve(temp, "root") + , cache = path.resolve(temp, "npm_cache") + +var failures = 0 + , mkdir = require("mkdirp") + , rimraf = require("rimraf") + +var pathEnvSplit = process.platform === "win32" ? ";" : ":" + , pathEnv = process.env.PATH.split(pathEnvSplit) + , npmPath = process.platform === "win32" ? root : path.join(root, "bin") + +pathEnv.unshift(npmPath, path.join(root, "node_modules", ".bin")) + +// lastly, make sure that we get the same node that is being used to do +// run this script. That's very important, especially when running this +// test file from in the node source folder. +pathEnv.unshift(path.dirname(process.execPath)) + +// the env for all the test installs etc. +var env = {} +Object.keys(process.env).forEach(function (i) { + env[i] = process.env[i] +}) +env.npm_config_prefix = root +env.npm_config_color = "always" +env.npm_config_global = "true" +// have to set this to false, or it'll try to test itself forever +env.npm_config_npat = "false" +env.PATH = pathEnv.join(pathEnvSplit) +env.NODE_PATH = path.join(root, "node_modules") +env.npm_config_cache = cache + + + +function cleanup (cb) { + if (failures !== 0) return + rimraf(root, function (er) { + if (er) cb(er) + mkdir(root, 0755, cb) + }) +} + +function prefix (content, pref) { + return pref + (content.trim().split(/\r?\n/).join("\n" + pref)) +} + +var execCount = 0 +function exec (cmd, cwd, shouldFail, cb) { + if (typeof shouldFail === "function") { + cb = shouldFail, shouldFail = false + } + console.error("\n+"+cmd + (shouldFail ? " (expect failure)" : "")) + + // special: replace 'node' with the current execPath, + // and 'npm' with the thing we installed. + var cmdShow = cmd + var npmReplace = path.resolve(npmPath, "npm") + var nodeReplace = process.execPath + if (process.platform === "win32") { + npmReplace = '"' + npmReplace + '"' + nodeReplace = '"' + nodeReplace + '"' + } + cmd = cmd.replace(/^npm /, npmReplace + " ") + cmd = cmd.replace(/^node /, nodeReplace + " ") + + console.error("$$$$$$ cd %s; PATH=%s %s", cwd, env.PATH, cmd) + + child_process.exec(cmd, {cwd: cwd, env: env}, function (er, stdout, stderr) { + console.error("$$$$$$ after command", cmd, cwd) + if (stdout) { + console.error(prefix(stdout, " 1> ")) + } + if (stderr) { + console.error(prefix(stderr, " 2> ")) + } + + execCount ++ + if (!shouldFail && !er || shouldFail && er) { + // stdout = (""+stdout).trim() + console.log("ok " + execCount + " " + cmdShow) + return cb() + } else { + console.log("not ok " + execCount + " " + cmdShow) + cb(new Error("failed "+cmdShow)) + } + }) +} + +function execChain (cmds, cb) { + chain(cmds.map(function (args) { + return [exec].concat(args) + }), cb) +} + +function flatten (arr) { + return arr.reduce(function (l, r) { + return l.concat(r) + }, []) +} + +function setup (cb) { + cleanup(function (er) { + if (er) return cb(er) + exec("node \""+npmcli+"\" install \""+npmpkg+"\"", root, false, cb) + }) +} + +function main (cb) { + console.log("# testing in %s", temp) + console.log("# global prefix = %s", root) + + + + failures = 0 + + process.chdir(testdir) + var base = path.resolve(root, path.join("lib", "node_modules")) + + // get the list of packages + var packages = fs.readdirSync(path.resolve(testdir, "packages")) + packages = packages.filter(function (p) { + return p && !p.match(/^\./) + }) + + installAllThenTestAll() + + function installAllThenTestAll () { + var packagesToRm = packages.slice(0) + if (process.platform !== "win32") { + // Windows can't handle npm rm npm due to file-in-use issues. + packagesToRm.push("npm") + } + + chain( + [ setup + , [ exec, "npm install "+npmpkg, testdir ] + , [ execChain, packages.map(function (p) { + return [ "npm install packages/"+p, testdir ] + }) ] + , [ execChain, packages.map(function (p) { + return [ "npm test -ddd", path.resolve(base, p) ] + }) ] + , [ execChain, packagesToRm.map(function (p) { + return [ "npm rm "+p, root ] + }) ] + , installAndTestEach + ] + , cb + ) + } + + function installAndTestEach (cb) { + var thingsToChain = [ + setup + , [ execChain, flatten(packages.map(function (p) { + return [ [ "npm install packages/"+p, testdir ] + , [ "npm test", path.resolve(base, p) ] + , [ "npm rm "+p, root ] ] + })) ] + ] + if (process.platform !== "win32") { + // Windows can't handle npm rm npm due to file-in-use issues. + thingsToChain.push([exec, "npm rm npm", testdir]) + } + + chain(thingsToChain, cb) + } +} + +main(function (er) { + console.log("1.." + execCount) + if (er) throw er +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/00-check-mock-dep.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/00-check-mock-dep.js new file mode 100644 index 00000000..1c862317 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/00-check-mock-dep.js @@ -0,0 +1,17 @@ +console.log("TAP Version 13") + +process.on("uncaughtException", function (er) { + if (er) { throw er } + console.log("not ok - Failed checking mock registry dep. Expect much fail!") + console.log("1..1") + process.exit(1) +}) + +var assert = require("assert") +var semver = require("semver") +var mock = require("npm-registry-mock/package.json").version +var req = require("../../package.json").devDependencies["npm-registry-mock"] + +assert(semver.satisfies(mock, req)) +console.log("ok") +console.log("1..1") diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/00-config-setup.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/00-config-setup.js new file mode 100644 index 00000000..0daf0dec --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/00-config-setup.js @@ -0,0 +1,83 @@ +var fs = require("graceful-fs") +var path = require("path") +var userconfigSrc = path.resolve(__dirname, "..", "fixtures", "config", "userconfig") +exports.userconfig = userconfigSrc + "-with-gc" +exports.globalconfig = path.resolve(__dirname, "..", "fixtures", "config", "globalconfig") +exports.builtin = path.resolve(__dirname, "..", "fixtures", "config", "builtin") +exports.malformed = path.resolve(__dirname, "..", "fixtures", "config", "malformed") +exports.ucData = + { globalconfig: exports.globalconfig, + email: "i@izs.me", + "env-thing": "asdf", + "init.author.name": "Isaac Z. Schlueter", + "init.author.email": "i@izs.me", + "init.author.url": "http://blog.izs.me/", + "init.version": "1.2.3", + "proprietary-attribs": false, + "npm:publishtest": true, + "_npmjs.org:couch": "https://admin:password@localhost:5984/registry", + "npm-www:nocache": "1", + nodedir: "/Users/isaacs/dev/js/node-v0.8", + "sign-git-tag": true, + message: "v%s", + "strict-ssl": false, + "tmp": process.env.HOME + "/.tmp", + _auth: "dXNlcm5hbWU6cGFzc3dvcmQ=", + _token: + { AuthSession: "yabba-dabba-doodle", + version: "1", + expires: "1345001053415", + path: "/", + httponly: true } } + +// set the userconfig in the env +// unset anything else that npm might be trying to foist on us +Object.keys(process.env).forEach(function (k) { + if (k.match(/^npm_config_/i)) { + delete process.env[k] + } +}) +process.env.npm_config_userconfig = exports.userconfig +process.env.npm_config_other_env_thing = 1000 +process.env.random_env_var = "asdf" +process.env.npm_config__underbar_env_thing = "underful" +process.env.NPM_CONFIG_UPPERCASE_ENV_THING = 42 + +exports.envData = { + userconfig: exports.userconfig, + "_underbar-env-thing": "underful", + "uppercase-env-thing": "42", + "other-env-thing": "1000" +} +exports.envDataFix = { + userconfig: exports.userconfig, + "_underbar-env-thing": "underful", + "uppercase-env-thing": 42, + "other-env-thing": 1000 +} + +var projectConf = path.resolve(__dirname, '..', '..', '.npmrc') +try { + fs.statSync(projectConf) +} catch (er) { + // project conf not found, probably working with packed npm + fs.writeFileSync(projectConf, 'save-prefix = ~\nproprietary-attribs = false\n') +} + +var projectRc = path.join(__dirname, '..', 'fixtures', 'config', '.npmrc') +try { + fs.statSync(projectRc) +} catch (er) { + // project conf not found, probably working with packed npm + fs.writeFileSync(projectRc, 'just = testing') +} + +if (module === require.main) { + // set the globalconfig in the userconfig + var uc = fs.readFileSync(userconfigSrc) + var gcini = "globalconfig = " + exports.globalconfig + "\n" + fs.writeFileSync(exports.userconfig, gcini + uc) + + console.log("1..1") + console.log("ok 1 setup done") +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/00-verify-bundle-deps.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/00-verify-bundle-deps.js new file mode 100644 index 00000000..9d16b2d3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/00-verify-bundle-deps.js @@ -0,0 +1,27 @@ +var fs = require("fs") +var path = require("path") +var test = require("tap").test + +var manifest = require("../../package.json") +var deps = Object.keys(manifest.dependencies) +var dev = Object.keys(manifest.devDependencies) +var bundled = manifest.bundleDependencies + +test("all deps are bundled deps or dev deps", function (t) { + deps.forEach(function (name) { + t.assert( + bundled.indexOf(name) !== -1, + name + " is in bundledDependencies" + ) + }) + + t.same( + fs.readdirSync(path.resolve(__dirname, "../../node_modules")).filter(function (name) { + return (dev.indexOf(name) === -1) && (name !== ".bin") + }).sort(), + bundled.sort(), + "bundleDependencies matches what's in node_modules" + ) + + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/00-verify-ls-ok.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/00-verify-ls-ok.js new file mode 100644 index 00000000..aa6acdbc --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/00-verify-ls-ok.js @@ -0,0 +1,18 @@ +var common = require("../common-tap") +var test = require("tap").test +var path = require("path") +var cwd = path.resolve(__dirname, "..", "..") +var fs = require("fs") + +test("npm ls in npm", function (t) { + t.ok(fs.existsSync(cwd), "ensure that the path we are calling ls within exists") + var files = fs.readdirSync(cwd) + t.notEqual(files.length, 0, "ensure there are files in the directory we are to ls") + + var opt = { cwd: cwd, stdio: [ "ignore", "ignore", 2 ] } + common.npm(["ls"], opt, function (err, code) { + t.ifError(err, "error should not exist") + t.equal(code, 0, "npm ls exited with code") + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/404-parent.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/404-parent.js new file mode 100644 index 00000000..eb8ae9bb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/404-parent.js @@ -0,0 +1,57 @@ +var common = require("../common-tap.js") +var test = require("tap").test +var npm = require("../../") +var osenv = require("osenv") +var path = require("path") +var fs = require("fs") +var rimraf = require("rimraf") +var mkdirp = require("mkdirp") +var pkg = path.resolve(__dirname, "404-parent") +var mr = require("npm-registry-mock") + +test("404-parent: if parent exists, specify parent in error message", function (t) { + setup() + rimraf.sync(path.resolve(pkg, "node_modules")) + performInstall(function (err) { + t.ok(err instanceof Error, "error was returned") + t.ok(err.parent === "404-parent-test", "error's parent set") + t.end() + }) +}) + +test("cleanup", function (t) { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) + t.end() +}) + +function setup() { + mkdirp.sync(pkg) + mkdirp.sync(path.resolve(pkg, "cache")) + fs.writeFileSync(path.resolve(pkg, "package.json"), JSON.stringify({ + author: "Evan Lucas", + name: "404-parent-test", + version: "0.0.0", + description: "Test for 404-parent", + dependencies: { + "test-npm-404-parent-test": "*" + } + }), "utf8") + process.chdir(pkg) +} + +function plugin (server) { + server.get("/test-npm-404-parent-test") + .reply(404, {"error": "version not found"}) +} + +function performInstall (cb) { + mr({port : common.port, plugin : plugin}, function (er, s) { // create mock registry. + npm.load({registry: common.registry}, function () { + npm.commands.install(pkg, [], function (err) { + cb(err) + s.close() // shutdown mock npm server. + }) + }) + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/404-private-registry-scoped.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/404-private-registry-scoped.js new file mode 100644 index 00000000..84251b11 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/404-private-registry-scoped.js @@ -0,0 +1,38 @@ +var test = require('tap').test +var common = require('../common-tap.js') +var mr = require('npm-registry-mock') +var server + +test('setup', function (t) { + mr({port: common.port, throwOnUnmatched: true}, function (err, s) { + t.ifError(err, 'registry mocked successfully') + server = s + t.end() + }) +}) + +test('scoped package names not mangled on error with non-root registry', function (t) { + common.npm( + [ + 'cache', + 'add', + '@scope/foo@*', + '--force' + ], + {}, + function (er, code, stdout, stderr) { + t.ifError(er, 'correctly handled 404') + t.equal(code, 1, 'exited with error') + t.match(stderr, /404 Not found/, 'should notify the sort of error as a 404') + t.match(stderr, /@scope\/foo/, 'should have package name in error') + t.end() + } + ) +}) + +test('cleanup', function (t) { + t.pass('cleaned up') + server.done() + server.close() + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/404-private-registry.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/404-private-registry.js new file mode 100644 index 00000000..bc716b17 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/404-private-registry.js @@ -0,0 +1,39 @@ +var test = require('tap').test +var path = require('path') +var common = require('../common-tap.js') +var mr = require('npm-registry-mock') +var server + +var packageName = path.basename(__filename,'.js') + +test('setup', function (t) { + mr({port: common.port, throwOnUnmatched: true}, function (err, s) { + t.ifError(err, 'registry mocked successfully') + server = s + t.end() + }) +}) + +test('package names not mangled on error with non-root registry', function (t) { + common.npm( + [ + 'cache', + 'add', + packageName + '@*' + ], + {}, + function (er, code, stdout, stderr) { + t.ifError(er, 'correctly handled 404') + t.equal(code, 1, 'exited with error') + t.match(stderr, packageName, 'should have package name in error') + t.end() + } + ) +}) + +test('cleanup', function (t) { + t.pass('cleaned up') + server.done() + server.close() + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/access.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/access.js new file mode 100644 index 00000000..41d2c936 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/access.js @@ -0,0 +1,527 @@ +var fs = require('fs') +var path = require('path') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var mr = require('npm-registry-mock') + +var test = require('tap').test +var common = require('../common-tap.js') + +var pkg = path.resolve(__dirname, 'access') +var server + +var scoped = { + name: '@scoped/pkg', + version: '1.1.1' +} + +test('setup', function (t) { + mkdirp(pkg, function (er) { + t.ifError(er, pkg + ' made successfully') + + mr({port: common.port}, function (err, s) { + t.ifError(err, 'registry mocked successfully') + server = s + + fs.writeFile( + path.join(pkg, 'package.json'), + JSON.stringify(scoped), + function (er) { + t.ifError(er, 'wrote package.json') + t.end() + } + ) + }) + }) +}) + +test('npm access public on current package', function (t) { + server.post('/-/package/%40scoped%2Fpkg/access', JSON.stringify({ + access: 'public' + })).reply(200, { + accessChanged: true + }) + common.npm([ + 'access', + 'public', + '--registry', common.registry, + '--loglevel', 'silent' + ], { + cwd: pkg + }, + function (er, code, stdout, stderr) { + t.ifError(er, 'npm access') + t.equal(code, 0, 'exited OK') + t.equal(stderr, '', 'no error output') + t.end() + }) +}) + +test('npm access public when no package passed and no package.json', function (t) { + // need to simulate a missing package.json + var missing = path.join(__dirname, 'access-public-missing-guard') + mkdirp.sync(path.join(missing, 'node_modules')) + + common.npm([ + 'access', + 'public', + '--registry', common.registry + ], { + cwd: missing + }, + function (er, code, stdout, stderr) { + t.ifError(er, 'npm access') + t.match(stderr, /no package name passed to command and no package.json found/) + rimraf.sync(missing) + t.end() + }) +}) + +test('npm access public when no package passed and invalid package.json', function (t) { + // need to simulate a missing package.json + var invalid = path.join(__dirname, 'access-public-invalid-package') + mkdirp.sync(path.join(invalid, 'node_modules')) + // it's hard to force `read-package-json` to break w/o ENOENT, but this will do it + fs.writeFileSync(path.join(invalid, 'package.json'), '{\n') + + common.npm([ + 'access', + 'public', + '--registry', common.registry + ], { + cwd: invalid + }, + function (er, code, stdout, stderr) { + t.ifError(er, 'npm access') + t.match(stderr, /Failed to parse json/) + rimraf.sync(invalid) + t.end() + }) +}) + +test('npm access restricted on current package', function (t) { + server.post('/-/package/%40scoped%2Fpkg/access', JSON.stringify({ + access: 'restricted' + })).reply(200, { + accessChanged: true + }) + common.npm([ + 'access', + 'restricted', + '--registry', common.registry, + '--loglevel', 'silent' + ], { + cwd: pkg + }, + function (er, code, stdout, stderr) { + t.ifError(er, 'npm access') + t.equal(code, 0, 'exited OK') + t.equal(stderr, '', 'no error output') + t.end() + }) +}) + +test('npm access on named package', function (t) { + server.post('/-/package/%40scoped%2Fanother/access', { + access: 'public' + }).reply(200, { + accessChaged: true + }) + common.npm( + [ + 'access', + 'public', '@scoped/another', + '--registry', common.registry, + '--loglevel', 'silent' + ], + { cwd: pkg }, + function (er, code, stdout, stderr) { + t.ifError(er, 'npm access') + t.equal(code, 0, 'exited OK') + t.equal(stderr, '', 'no error output') + + t.end() + } + ) +}) + +test('npm change access on unscoped package', function (t) { + common.npm( + [ + 'access', + 'restricted', 'yargs', + '--registry', common.registry + ], + { cwd: pkg }, + function (er, code, stdout, stderr) { + t.ok(code, 'exited with Error') + t.matches( + stderr, /access commands are only accessible for scoped packages/) + t.end() + } + ) +}) + +test('npm access grant read-only', function (t) { + server.put('/-/team/myorg/myteam/package', { + permissions: 'read-only', + package: '@scoped/another' + }).reply(201, { + accessChaged: true + }) + common.npm( + [ + 'access', + 'grant', 'read-only', + 'myorg:myteam', + '@scoped/another', + '--registry', common.registry + ], + { cwd: pkg }, + function (er, code, stdout, stderr) { + t.ifError(er, 'npm access grant') + t.equal(code, 0, 'exited with Error') + t.end() + } + ) +}) + +test('npm access grant read-write', function (t) { + server.put('/-/team/myorg/myteam/package', { + permissions: 'read-write', + package: '@scoped/another' + }).reply(201, { + accessChaged: true + }) + common.npm( + [ + 'access', + 'grant', 'read-write', + 'myorg:myteam', + '@scoped/another', + '--registry', common.registry + ], + { cwd: pkg }, + function (er, code, stdout, stderr) { + t.ifError(er, 'npm access grant') + t.equal(code, 0, 'exited with Error') + t.end() + } + ) +}) + +test('npm access grant others', function (t) { + common.npm( + [ + 'access', + 'grant', 'rerere', + 'myorg:myteam', + '@scoped/another', + '--registry', common.registry + ], + { cwd: pkg }, + function (er, code, stdout, stderr) { + t.ok(code, 'exited with Error') + t.matches(stderr, /read-only/) + t.matches(stderr, /read-write/) + t.end() + } + ) +}) + +test('npm access revoke', function (t) { + server.delete('/-/team/myorg/myteam/package', { + package: '@scoped/another' + }).reply(200, { + accessChaged: true + }) + common.npm( + [ + 'access', + 'revoke', + 'myorg:myteam', + '@scoped/another', + '--registry', common.registry + ], + { cwd: pkg }, + function (er, code, stdout, stderr) { + t.ifError(er, 'npm access grant') + t.equal(code, 0, 'exited with Error') + t.end() + } + ) +}) + +test('npm access ls-packages with no team', function (t) { + var serverPackages = { + '@foo/bar': 'write', + '@foo/util': 'read' + } + var clientPackages = { + '@foo/bar': 'read-write', + '@foo/util': 'read-only' + } + server.get( + '/-/org/username/package?format=cli' + ).reply(200, serverPackages) + common.npm( + [ + 'access', + 'ls-packages', + '--registry', common.registry + ], + { cwd: pkg }, + function (er, code, stdout, stderr) { + t.ifError(er, 'npm access ls-packages') + t.same(JSON.parse(stdout), clientPackages) + t.end() + } + ) +}) + +test('npm access ls-packages on team', function (t) { + var serverPackages = { + '@foo/bar': 'write', + '@foo/util': 'read' + } + var clientPackages = { + '@foo/bar': 'read-write', + '@foo/util': 'read-only' + } + server.get( + '/-/team/myorg/myteam/package?format=cli' + ).reply(200, serverPackages) + common.npm( + [ + 'access', + 'ls-packages', + 'myorg:myteam', + '--registry', common.registry + ], + { cwd: pkg }, + function (er, code, stdout, stderr) { + t.ifError(er, 'npm access ls-packages') + t.same(JSON.parse(stdout), clientPackages) + t.end() + } + ) +}) + +test('npm access ls-packages on org', function (t) { + var serverPackages = { + '@foo/bar': 'write', + '@foo/util': 'read' + } + var clientPackages = { + '@foo/bar': 'read-write', + '@foo/util': 'read-only' + } + server.get( + '/-/org/myorg/package?format=cli' + ).reply(200, serverPackages) + common.npm( + [ + 'access', + 'ls-packages', + 'myorg', + '--registry', common.registry + ], + { cwd: pkg }, + function (er, code, stdout, stderr) { + t.ifError(er, 'npm access ls-packages') + t.same(JSON.parse(stdout), clientPackages) + t.end() + } + ) +}) + +test('npm access ls-packages on user', function (t) { + var serverPackages = { + '@foo/bar': 'write', + '@foo/util': 'read' + } + var clientPackages = { + '@foo/bar': 'read-write', + '@foo/util': 'read-only' + } + server.get( + '/-/org/myorg/package?format=cli' + ).reply(404, {error: 'nope'}) + server.get( + '/-/user/myorg/package?format=cli' + ).reply(200, serverPackages) + common.npm( + [ + 'access', + 'ls-packages', + 'myorg', + '--registry', common.registry + ], + { cwd: pkg }, + function (er, code, stdout, stderr) { + t.ifError(er, 'npm access ls-packages') + t.same(JSON.parse(stdout), clientPackages) + t.end() + } + ) +}) + +test('npm access ls-packages with no package specified or package.json', function (t) { + // need to simulate a missing package.json + var missing = path.join(__dirname, 'access-missing-guard') + mkdirp.sync(path.join(missing, 'node_modules')) + + var serverPackages = { + '@foo/bar': 'write', + '@foo/util': 'read' + } + var clientPackages = { + '@foo/bar': 'read-write', + '@foo/util': 'read-only' + } + server.get( + '/-/org/myorg/package?format=cli' + ).reply(404, {error: 'nope'}) + server.get( + '/-/user/myorg/package?format=cli' + ).reply(200, serverPackages) + common.npm( + [ + 'access', + 'ls-packages', + 'myorg', + '--registry', common.registry + ], + { cwd: missing }, + function (er, code, stdout, stderr) { + t.ifError(er, 'npm access ls-packages') + t.same(JSON.parse(stdout), clientPackages) + rimraf.sync(missing) + t.end() + } + ) +}) + +test('npm access ls-collaborators on current', function (t) { + var serverCollaborators = { + 'myorg:myteam': 'write', + 'myorg:anotherteam': 'read' + } + var clientCollaborators = { + 'myorg:myteam': 'read-write', + 'myorg:anotherteam': 'read-only' + } + server.get( + '/-/package/%40scoped%2Fpkg/collaborators?format=cli' + ).reply(200, serverCollaborators) + common.npm( + [ + 'access', + 'ls-collaborators', + '--registry', common.registry + ], + { cwd: pkg }, + function (er, code, stdout, stderr) { + t.ifError(er, 'npm access ls-collaborators') + t.same(JSON.parse(stdout), clientCollaborators) + t.end() + } + ) +}) + +test('npm access ls-collaborators on package', function (t) { + var serverCollaborators = { + 'myorg:myteam': 'write', + 'myorg:anotherteam': 'read' + } + var clientCollaborators = { + 'myorg:myteam': 'read-write', + 'myorg:anotherteam': 'read-only' + } + server.get( + '/-/package/%40scoped%2Fanother/collaborators?format=cli' + ).reply(200, serverCollaborators) + common.npm( + [ + 'access', + 'ls-collaborators', + '@scoped/another', + '--registry', common.registry + ], + { cwd: pkg }, + function (er, code, stdout, stderr) { + t.ifError(er, 'npm access ls-collaborators') + t.same(JSON.parse(stdout), clientCollaborators) + t.end() + } + ) +}) + +test('npm access ls-collaborators on current w/user filter', function (t) { + var serverCollaborators = { + 'myorg:myteam': 'write', + 'myorg:anotherteam': 'read' + } + var clientCollaborators = { + 'myorg:myteam': 'read-write', + 'myorg:anotherteam': 'read-only' + } + server.get( + '/-/package/%40scoped%2Fanother/collaborators?format=cli&user=zkat' + ).reply(200, serverCollaborators) + common.npm( + [ + 'access', + 'ls-collaborators', + '@scoped/another', + 'zkat', + '--registry', common.registry + ], + { cwd: pkg }, + function (er, code, stdout, stderr) { + t.ifError(er, 'npm access ls-collaborators') + t.same(JSON.parse(stdout), clientCollaborators) + t.end() + } + ) +}) + +test('npm access edit', function (t) { + common.npm( + [ + 'access', + 'edit', '@scoped/another', + '--registry', common.registry + ], + { cwd: pkg }, + function (er, code, stdout, stderr) { + t.ok(code, 'exited with Error') + t.match(stderr, /edit subcommand is not implemented yet/) + t.end() + } + ) +}) + +test('npm access blerg', function (t) { + common.npm( + [ + 'access', + 'blerg', '@scoped/another', + '--registry', common.registry + ], + { cwd: pkg }, + function (er, code, stdout, stderr) { + t.ok(code, 'exited with Error') + t.matches(stderr, /Usage:/) + t.end() + } + ) +}) + +test('cleanup', function (t) { + t.pass('cleaned up') + rimraf.sync(pkg) + server.done() + server.close() + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/add-local.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/add-local.js new file mode 100644 index 00000000..0a5b7b5d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/add-local.js @@ -0,0 +1,137 @@ +var path = require('path') +var test = require('tap').test +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var requireInject = require('require-inject') + +var pkg = path.join(__dirname, '/local-dir') +var cache = path.join(pkg, '/cache') +var tmp = path.join(pkg, '/tmp') +var prefix = path.join(pkg, '/prefix') + +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir + +test('addLocal directory race on Windows', function (t) { + setup() + var p = { + name: 'test', + version: '1.0.0', + type: 'directory', + spec: pkg + } + var fixture = new Tacks( + Dir({ + 'package.json': File(p) + }) + ) + var addLocal = requireInject('../../lib/cache/add-local', { + '../../lib/npm.js': { + cache: cache, + tmp: tmp, + prefix: prefix + }, + '../../lib/cache/get-stat': function (cb) { + cb(null, {}) + }, + chownr: function (x, y, z, cb) { + cb(new Error('chownr should never have been called')) + }, + '../../lib/cache/add-local-tarball.js': function (tgz, data, shasum, cb) { + cb(null) + }, + '../../lib/utils/lifecycle.js': function (data, cycle, p, cb) { + cb(null) + }, + '../../lib/utils/tar.js': { + pack: function (tgz, p, data, fancy, cb) { + cb(null) + } + }, + 'sha': { + get: function (tgz, cb) { + cb(null, 'deadbeef') + } + } + }) + + fixture.create(pkg) + addLocal(p, null, function (err) { + t.ifErr(err, 'addLocal completed without error') + t.done() + }) +}) + +test('addLocal temporary cache file race', function (t) { + // See https://github.com/npm/npm/issues/12669 + setup() + var p = { + name: 'test', + version: '1.0.0', + type: 'directory', + spec: pkg + } + var fixture = new Tacks( + Dir({ + 'package.json': File(p) + }) + ) + var addLocal = requireInject('../../lib/cache/add-local', { + // basic setup/mock stuff + '../../lib/npm.js': { + cache: cache, + tmp: tmp, + prefix: prefix + }, + '../../lib/cache/add-local-tarball.js': function (tgz, data, shasum, cb) { + cb(null) + }, + '../../lib/utils/lifecycle.js': function (data, cycle, p, cb) { + cb(null) + }, + '../../lib/utils/tar.js': { + pack: function (tgz, p, data, fancy, cb) { + cb(null) + } + }, + 'sha': { + get: function (tgz, cb) { + cb(null, 'deadbeef') + } + }, + + // Test-specific mocked values to simulate race. + '../../lib/cache/get-stat': function (cb) { + cb(null, {uid: 1, gid: 2}) + }, + chownr: function (x, y, z, cb) { + // Simulate a race condition between `tar.pack` and `chownr` + // where the latter will return `ENOENT` when an async process + // removes a file that its internal `fs.readdir` listed. + cb({code: 'ENOENT'}) + } + }) + + fixture.create(pkg) + addLocal(p, null, function (err) { + t.ifErr(err, 'addLocal completed without error') + t.done() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.done() +}) + +function setup () { + mkdirp.sync(cache) + mkdirp.sync(tmp) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/add-named-update-protocol-port.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/add-named-update-protocol-port.js new file mode 100644 index 00000000..38b500d0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/add-named-update-protocol-port.js @@ -0,0 +1,113 @@ +'use strict' +var path = require('path') +var test = require('tap').test +var common = require('../common-tap') +var mr = require('npm-registry-mock') +var server1 +var server2 + +var packageName = path.basename(__filename, '.js') + +var fooPkg = { + name: packageName, + versions: { + '0.0.0': { + name: packageName, + version: '0.0.0', + dist: { + tarball: 'https://localhost:1338/registry/' + packageName + '/-/' + packageName + '-0.0.0.tgz', + shasum: '356a192b7913b04c54574d18c28d46e6395428ab' + } + } + } +} + +var iPackageName = packageName + 'i' +var fooiPkg = { + name: iPackageName, + versions: { + '0.0.0': { + name: iPackageName, + version: '0.0.0', + dist: { + tarball: 'http://127.0.0.1:1338/registry/' + iPackageName + '/-/' + iPackageName + '-0.0.0.tgz', + shasum: '356a192b7913b04c54574d18c28d46e6395428ab' + } + } + } +} + +test('setup', function (t) { + mr({ + port: 1337, + throwOnUnmatched: true + }, function (err, s) { + t.ifError(err, 'registry mocked successfully') + server1 = s + mr({ + port: 1338, + throwOnUnmatched: true + }, function (err, s) { + t.ifError(err, 'registry mocked successfully') + server2 = s + t.end() + }) + }) + +}) + +test('tarball paths should update port if updating protocol', function (t) { + server1.get('/registry/' + packageName).reply(200, fooPkg) + server1.get( + '/registry/' + packageName + '/-/' + packageName + '-0.0.0.tgz' + ).reply(200, '1') + + common.npm( + [ + 'cache', + 'add', + packageName + '@0.0.0', + '--registry', + 'http://localhost:1337/registry' + ], + {}, + function (er, code, stdout, stderr) { + if (er) { throw er } + t.equal(code, 0, 'addNamed worked') + server1.done() + t.end() + } + ) +}) + +test('tarball paths should NOT update if different hostname', function (t) { + server1.get('/registry/' + iPackageName).reply(200, fooiPkg) + server2.get( + '/registry/' + iPackageName + '/-/' + iPackageName + '-0.0.0.tgz' + ).reply(200, '1') + + common.npm( + [ + 'cache', + 'add', + iPackageName + '@0.0.0', + '--registry', + 'http://localhost:1337/registry' + ], + {}, + function (er, code, stdout, stderr) { + if (er) { throw er } + t.equal(code, 0, 'addNamed worked') + server1.done() + server2.done() + t.end() + } + ) +}) + +test('cleanup', function (t) { + t.pass('cleaned up') + server1.close() + server2.close() + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/add-remote-git-fake-windows.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/add-remote-git-fake-windows.js new file mode 100644 index 00000000..66d70800 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/add-remote-git-fake-windows.js @@ -0,0 +1,133 @@ +var fs = require('fs') +var resolve = require('path').resolve + +var osenv = require('osenv') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var test = require('tap').test + +var npm = require('../../lib/npm.js') +var common = require('../common-tap.js') + +var pkg = resolve(__dirname, 'add-remote-git') +var repo = resolve(__dirname, 'add-remote-git-repo') + +var daemon +var daemonPID +var git + +var pjParent = JSON.stringify({ + name: 'parent', + version: '1.2.3', + dependencies: { + child: 'git://localhost:1234/child.git' + } +}, null, 2) + '\n' + +var pjChild = JSON.stringify({ + name: 'child', + version: '1.0.3' +}, null, 2) + '\n' + + +test('setup', function (t) { + bootstrap() + setup(function (er, r) { + if (er) { + throw er + } + + if (!er) { + daemon = r[r.length - 2] + daemonPID = r[r.length - 1] + } + + t.end() + }) +}) + +test('install from repo on \'Windows\'', function (t) { + // before we confuse everything by switching the platform + require('../../lib/install.js') + require('../../lib/unbuild.js') + process.platform = 'win32' + process.chdir(pkg) + npm.commands.install('.', [], function (er) { + t.ifError(er, 'npm installed via git') + + t.end() + }) +}) + +test('clean', function (t) { + daemon.on('close', function () { + cleanup() + t.end() + }) + process.kill(daemonPID) +}) + +function bootstrap () { + rimraf.sync(pkg) + mkdirp.sync(pkg) + fs.writeFileSync(resolve(pkg, 'package.json'), pjParent) +} + +function setup (cb) { + rimraf.sync(repo) + mkdirp.sync(repo) + fs.writeFileSync(resolve(repo, 'package.json'), pjChild) + npm.load({ registry: common.registry, loglevel: 'silent' }, function () { + // some really cheesy monkeypatching + require('module')._cache[require.resolve('which')] = { + exports: function (_, cb) { cb() } + } + git = require('../../lib/utils/git.js') + + function startDaemon (cb) { + // start git server + var d = git.spawn( + [ + 'daemon', + '--verbose', + '--listen=localhost', + '--export-all', + '--base-path=.', + '--reuseaddr', + '--port=1234' + ], + { + cwd: pkg, + env: process.env, + stdio: ['pipe', 'pipe', 'pipe'] + } + ) + d.stderr.on('data', childFinder) + + function childFinder (c) { + var cpid = c.toString().match(/^\[(\d+)\]/) + if (cpid[1]) { + this.removeListener('data', childFinder) + cb(null, [d, cpid[1]]) + } + } + } + + common.makeGitRepo({ + path: repo, + commands: [ + git.chainableExec( + ['clone', '--bare', repo, 'child.git'], + { cwd: pkg, env: process.env } + ), + startDaemon + ] + }, cb) + }) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(repo) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/add-remote-git-file.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/add-remote-git-file.js new file mode 100644 index 00000000..673be4c2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/add-remote-git-file.js @@ -0,0 +1,78 @@ +var fs = require('fs') +var resolve = require('path').resolve +var url = require('url') + +var osenv = require('osenv') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var test = require('tap').test + +var npm = require('../../lib/npm.js') +var common = require('../common-tap.js') + +var pkg = resolve(__dirname, 'add-remote-git-file') +var repo = resolve(__dirname, 'add-remote-git-file-repo') + +var git +var cloneURL = 'git+file://' + resolve(pkg, 'child.git') + +var pjChild = JSON.stringify({ + name: 'child', + version: '1.0.3' +}, null, 2) + '\n' + +test('setup', function (t) { + bootstrap() + setup(function (er, r) { + t.ifError(er, 'git started up successfully') + + t.end() + }) +}) + +test('cache from repo', function (t) { + process.chdir(pkg) + var addRemoteGit = require('../../lib/cache/add-remote-git.js') + addRemoteGit(cloneURL, function (er, data) { + t.ifError(er, 'cached via git') + t.equal( + url.parse(data._resolved).protocol, + 'git+file:', + 'npm didn\'t go crazy adding git+git+git+git' + ) + + t.end() + }) +}) + +test('clean', function (t) { + cleanup() + t.end() +}) + +function bootstrap () { + cleanup() + mkdirp.sync(pkg) +} + +function setup (cb) { + mkdirp.sync(repo) + fs.writeFileSync(resolve(repo, 'package.json'), pjChild) + npm.load({ registry: common.registry, loglevel: 'silent' }, function () { + git = require('../../lib/utils/git.js') + + common.makeGitRepo({ + path: repo, + commands: [git.chainableExec( + ['clone', '--bare', repo, 'child.git'], + { cwd: pkg, env: process.env } + )] + }, cb) + }) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(repo) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/add-remote-git-get-resolved.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/add-remote-git-get-resolved.js new file mode 100644 index 00000000..0bd0f29e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/add-remote-git-get-resolved.js @@ -0,0 +1,130 @@ +'use strict' +var test = require('tap').test + +var npm = require('../../lib/npm.js') +var common = require('../common-tap.js') + +var normalizeGitUrl = require('normalize-git-url') +var getResolved = null + +/** + * Note: This is here because `normalizeGitUrl` is usually called + * before getResolved is, and receives *that* URL. + */ +function tryGetResolved(uri, treeish) { + return getResolved(normalizeGitUrl(uri).url, treeish) +} + +test('setup', function (t) { + var opts = { + registry: common.registry, + loglevel: 'silent' + } + npm.load(opts, function (er) { + t.ifError(er, 'npm loaded without error') + getResolved = require('../../lib/cache/add-remote-git.js').getResolved + t.end() + }) +}) + +test('add-remote-git#get-resolved git: passthru', function (t) { + verify('git:github.com/foo/repo') + verify('git:github.com/foo/repo.git') + verify('git://github.com/foo/repo#decadacefadabade') + verify('git://github.com/foo/repo.git#decadacefadabade') + + function verify (uri) { + t.equal( + tryGetResolved(uri, 'decadacefadabade'), + 'git://github.com/foo/repo.git#decadacefadabade', + uri + ' normalized to canonical form git://github.com/foo/repo.git#decadacefadabade' + ) + } + t.end() +}) + +test('add-remote-git#get-resolved SSH', function (t) { + t.comment('tests for https://github.com/npm/npm/issues/7961') + verify('git@github.com:foo/repo') + verify('git@github.com:foo/repo#master') + verify('git+ssh://git@github.com/foo/repo#master') + verify('git+ssh://git@github.com/foo/repo#decadacefadabade') + + function verify (uri) { + t.equal( + tryGetResolved(uri, 'decadacefadabade'), + 'git+ssh://git@github.com/foo/repo.git#decadacefadabade', + uri + ' normalized to canonical form git+ssh://git@github.com/foo/repo.git#decadacefadabade' + ) + } + t.end() +}) + +test('add-remote-git#get-resolved HTTPS', function (t) { + verify('https://github.com/foo/repo') + verify('https://github.com/foo/repo#master') + verify('git+https://github.com/foo/repo.git#master') + verify('git+https://github.com/foo/repo#decadacefadabade') + // DEPRECATED + // this is an invalid URL but we normalize it + // anyway. Users shouldn't use this in the future. See note + // below for how this affected non-hosted URLs. + // See https://github.com/npm/npm/issues/8881 + verify('git+https://github.com:foo/repo.git#master') + + function verify (uri) { + t.equal( + tryGetResolved(uri, 'decadacefadabade'), + 'git+https://github.com/foo/repo.git#decadacefadabade', + uri + ' normalized to canonical form git+https://github.com/foo/repo.git#decadacefadabade' + ) + } + t.end() +}) + +test('add-remote-git#get-resolved edge cases', function (t) { + + t.equal( + tryGetResolved('git+ssh://user@bananaboat.com:galbi/blah.git', 'decadacefadabade'), + 'git+ssh://user@bananaboat.com:galbi/blah.git#decadacefadabade', + 'don\'t break non-hosted scp-style locations' + ) + + t.equal( + tryGetResolved('git+ssh://bananaboat:galbi/blah', 'decadacefadabade'), + 'git+ssh://bananaboat:galbi/blah#decadacefadabade', + 'don\'t break non-hosted scp-style locations' + ) + + // DEPRECATED + // When we were normalizing all git URIs, git+https: was being + // automatically converted to ssh:. Some users were relying + // on this funky behavior, so after removing the aggressive + // normalization from non-hosted URIs, we brought this back. + // See https://github.com/npm/npm/issues/8881 + t.equal( + tryGetResolved('git+https://bananaboat:galbi/blah', 'decadacefadabade'), + 'git+https://bananaboat/galbi/blah#decadacefadabade', + 'don\'t break non-hosted scp-style locations' + ) + + t.equal( + tryGetResolved('git+ssh://git.bananaboat.net/foo', 'decadacefadabade'), + 'git+ssh://git.bananaboat.net/foo#decadacefadabade', + 'don\'t break non-hosted SSH URLs' + ) + + t.equal( + tryGetResolved('git+ssh://git.bananaboat.net:/foo', 'decadacefadabade'), + 'git+ssh://git.bananaboat.net:/foo#decadacefadabade', + 'don\'t break non-hosted SSH URLs' + ) + + t.equal( + tryGetResolved('git://gitbub.com/foo/bar.git', 'decadacefadabade'), + 'git://gitbub.com/foo/bar.git#decadacefadabade', + 'don\'t break non-hosted git: URLs' + ) + + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/add-remote-git-shrinkwrap.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/add-remote-git-shrinkwrap.js new file mode 100644 index 00000000..e1882d8e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/add-remote-git-shrinkwrap.js @@ -0,0 +1,161 @@ +var fs = require('fs') +var resolve = require('path').resolve + +var osenv = require('osenv') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var test = require('tap').test + +var npm = require('../../lib/npm.js') +var common = require('../common-tap.js') + +var pkg = resolve(__dirname, 'add-remote-git-shrinkwrap') +var repo = resolve(__dirname, 'add-remote-git-shrinkwrap-repo') + +var daemon +var daemonPID +var git + +var pjParent = JSON.stringify({ + name: 'parent', + version: '1.2.3', + dependencies: { + 'child': 'git://localhost:1234/child.git#master' + } +}, null, 2) + '\n' + +var pjChild = JSON.stringify({ + name: 'child', + version: '1.0.3' +}, null, 2) + '\n' + +test('setup', function (t) { + bootstrap() + setup(function (er, r) { + t.ifError(er, 'git started up successfully') + + if (!er) { + daemon = r[r.length - 2] + daemonPID = r[r.length - 1] + } + + t.end() + }) +}) + +test('install from repo', function (t) { + process.chdir(pkg) + npm.commands.install('.', [], function (er) { + t.ifError(er, 'npm installed via git') + + t.end() + }) +}) + +test('shrinkwrap gets correct _from and _resolved (#7121)', function (t) { + common.npm( + [ + 'shrinkwrap', + '--loglevel', 'silent' + ], + { cwd: pkg }, + function (er, code, stdout, stderr) { + t.ifError(er, 'npm shrinkwrapped without errors') + t.notOk(code, '`npm shrinkwrap` exited with 0') + t.equal(stdout.trim(), 'wrote npm-shrinkwrap.json') + t.notOk(stderr, 'no error output on successful shrinkwrap') + + var shrinkwrap = require(resolve(pkg, 'npm-shrinkwrap.json')) + t.equal( + shrinkwrap.dependencies.child.from, + 'git://localhost:1234/child.git#master', + 'npm shrinkwrapped from correctly' + ) + + git.whichAndExec( + ['rev-list', '-n1', 'master'], + { cwd: repo, env: process.env }, + function (er, stdout, stderr) { + t.ifErr(er, 'git rev-list ran without error') + t.notOk(stderr, 'no error output') + var treeish = stdout.trim() + + t.equal( + shrinkwrap.dependencies.child.resolved, + 'git://localhost:1234/child.git#' + treeish, + 'npm shrinkwrapped resolved correctly' + ) + + t.end() + } + ) + } + ) +}) + +test('clean', function (t) { + daemon.on('close', function () { + cleanup() + t.end() + }) + process.kill(daemonPID) +}) + +function bootstrap () { + mkdirp.sync(pkg) + fs.writeFileSync(resolve(pkg, 'package.json'), pjParent) +} + +function setup (cb) { + mkdirp.sync(repo) + fs.writeFileSync(resolve(repo, 'package.json'), pjChild) + npm.load({ prefix: pkg, registry: common.registry, loglevel: 'silent' }, function () { + git = require('../../lib/utils/git.js') + + function startDaemon (cb) { + // start git server + var d = git.spawn( + [ + 'daemon', + '--verbose', + '--listen=localhost', + '--export-all', + '--base-path=.', + '--reuseaddr', + '--port=1234' + ], + { + cwd: pkg, + env: process.env, + stdio: ['pipe', 'pipe', 'pipe'] + } + ) + d.stderr.on('data', childFinder) + + function childFinder (c) { + var cpid = c.toString().match(/^\[(\d+)\]/) + if (cpid[1]) { + this.removeListener('data', childFinder) + cb(null, [d, cpid[1]]) + } + } + } + + common.makeGitRepo({ + path: repo, + commands: [ + git.chainableExec( + ['clone', '--bare', repo, 'child.git'], + { cwd: pkg, env: process.env } + ), + startDaemon + ] + }, cb) + }) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(repo) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/add-remote-git.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/add-remote-git.js new file mode 100644 index 00000000..24abf33a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/add-remote-git.js @@ -0,0 +1,120 @@ +var fs = require('fs') +var resolve = require('path').resolve + +var osenv = require('osenv') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var test = require('tap').test + +var npm = require('../../lib/npm.js') +var common = require('../common-tap.js') + +var pkg = resolve(__dirname, 'add-remote-git') +var repo = resolve(__dirname, 'add-remote-git-repo') + +var daemon +var daemonPID +var git + +var pjParent = JSON.stringify({ + name: 'parent', + version: '1.2.3', + dependencies: { + child: 'git://localhost:1234/child.git' + } +}, null, 2) + '\n' + +var pjChild = JSON.stringify({ + name: 'child', + version: '1.0.3' +}, null, 2) + '\n' + +test('setup', function (t) { + bootstrap() + setup(function (er, r) { + t.ifError(er, 'git started up successfully') + + if (!er) { + daemon = r[r.length - 2] + daemonPID = r[r.length - 1] + } + + t.end() + }) +}) + +test('install from repo', function (t) { + process.chdir(pkg) + npm.commands.install('.', [], function (er) { + t.ifError(er, 'npm installed via git') + + t.end() + }) +}) + +test('clean', function (t) { + daemon.on('close', function () { + cleanup() + t.end() + }) + process.kill(daemonPID) +}) + +function bootstrap () { + mkdirp.sync(pkg) + fs.writeFileSync(resolve(pkg, 'package.json'), pjParent) +} + +function setup (cb) { + mkdirp.sync(repo) + fs.writeFileSync(resolve(repo, 'package.json'), pjChild) + npm.load({ registry: common.registry, loglevel: 'silent' }, function () { + git = require('../../lib/utils/git.js') + + function startDaemon (cb) { + // start git server + var d = git.spawn( + [ + 'daemon', + '--verbose', + '--listen=localhost', + '--export-all', + '--base-path=.', + '--reuseaddr', + '--port=1234' + ], + { + cwd: pkg, + env: process.env, + stdio: ['pipe', 'pipe', 'pipe'] + } + ) + d.stderr.on('data', childFinder) + + function childFinder (c) { + var cpid = c.toString().match(/^\[(\d+)\]/) + if (cpid[1]) { + this.removeListener('data', childFinder) + cb(null, [d, cpid[1]]) + } + } + } + + common.makeGitRepo({ + path: repo, + commands: [ + git.chainableExec( + ['clone', '--bare', repo, 'child.git'], + { cwd: pkg, env: process.env } + ), + startDaemon + ] + }, cb) + }) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(repo) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/adduser-always-auth.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/adduser-always-auth.js new file mode 100644 index 00000000..db0e8b47 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/adduser-always-auth.js @@ -0,0 +1,264 @@ +var fs = require("fs") +var path = require("path") +var rimraf = require("rimraf") +var mr = require("npm-registry-mock") + +var test = require("tap").test +var common = require("../common-tap.js") + +var opts = {cwd : __dirname} +var outfile = path.resolve(__dirname, "_npmrc") +var responses = { + "Username" : "u\n", + "Password" : "p\n", + "Email" : "u@p.me\n" +} + +function verifyStdout (runner, successMessage, t) { + var remaining = Object.keys(responses).length + return function (chunk) { + if (remaining > 0) { + remaining-- + + var label = chunk.toString('utf8').split(':')[0] + runner.stdin.write(responses[label]) + + if (remaining === 0) runner.stdin.end() + } else { + var message = chunk.toString('utf8').trim() + t.equal(message, successMessage) + } + } +} + +function mocks (server) { + server.filteringRequestBody(function (r) { + if (r.match(/\"_id\":\"org\.couchdb\.user:u\"/)) { + return "auth" + } + }) + server.put("/-/user/org.couchdb.user:u", "auth") + .reply(201, {username : "u", password : "p", email : "u@p.me"}) +} + +test("npm login", function (t) { + mr({port : common.port, plugin : mocks}, function (er, s) { + var runner = common.npm( + [ + "login", + "--registry", common.registry, + "--loglevel", "silent", + "--userconfig", outfile + ], + opts, + function (err, code) { + t.notOk(code, "exited OK") + t.notOk(err, "no error output") + var config = fs.readFileSync(outfile, "utf8") + t.like(config, /:always-auth=false/, "always-auth is scoped and false (by default)") + s.close() + rimraf(outfile, function (err) { + t.ifError(err, "removed config file OK") + t.end() + }) + }) + + var message = 'Logged in as u on ' + common.registry + '/.' + runner.stdout.on('data', verifyStdout(runner, message, t)) + }) +}) + +test('npm login --scope <scope> uses <scope>:registry as its URI', function (t) { + var port = common.port + 1 + var uri = 'http://localhost:' + port + '/' + var scope = '@myco' + common.npm( + [ + 'config', + '--userconfig', outfile, + 'set', + scope + ':registry', + uri + ], + opts, + function (err, code) { + t.notOk(code, 'exited OK') + t.notOk(err, 'no error output') + + mr({ port: port, plugin: mocks }, function (er, s) { + var runner = common.npm( + [ + 'login', + '--loglevel', 'silent', + '--userconfig', outfile, + '--scope', scope + ], + opts, + function (err, code) { + t.notOk(code, 'exited OK') + t.notOk(err, 'no error output') + var config = fs.readFileSync(outfile, 'utf8') + t.like(config, new RegExp(scope + ':registry=' + uri), 'scope:registry is set') + s.close() + rimraf(outfile, function (err) { + t.ifError(err, 'removed config file OK') + t.end() + }) + }) + + var message = 'Logged in as u to scope ' + scope + ' on ' + uri + '.' + runner.stdout.on('data', verifyStdout(runner, message, t)) + }) + }) +}) + +test('npm login --scope <scope> makes sure <scope> is prefixed by an @', function (t) { + var port = common.port + 1 + var uri = 'http://localhost:' + port + '/' + var scope = 'myco' + var prefixedScope = '@' + scope + common.npm( + [ + '--userconfig', outfile, + 'config', + 'set', + prefixedScope + ':registry', + uri + ], + opts, + function (err, code) { + t.notOk(code, 'exited OK') + t.notOk(err, 'no error output') + + mr({ port: port, plugin: mocks }, function (er, s) { + var runner = common.npm( + [ + 'login', + '--loglevel', 'silent', + '--userconfig', outfile, + '--scope', scope + ], + opts, + function (err, code) { + t.notOk(code, 'exited OK') + t.notOk(err, 'no error output') + var config = fs.readFileSync(outfile, 'utf8') + t.like(config, new RegExp(prefixedScope + ':registry=' + uri), 'scope:registry is set') + s.close() + rimraf(outfile, function (err) { + t.ifError(err, 'removed config file OK') + t.end() + }) + }) + + var message = 'Logged in as u to scope ' + prefixedScope + ' on ' + uri + '.' + runner.stdout.on('data', verifyStdout(runner, message, t)) + }) + }) +}) + +test('npm login --scope <scope> --registry <registry> uses <registry> as its URI', function (t) { + var scope = '@myco' + common.npm( + [ + '--userconfig', outfile, + 'config', + 'set', + scope + ':registry', + 'invalidurl' + ], + opts, + function (err, code) { + t.notOk(code, 'exited OK') + t.notOk(err, 'no error output') + + mr({ port: common.port, plugin: mocks }, function (er, s) { + var runner = common.npm( + [ + 'login', + '--registry', common.registry, + '--loglevel', 'silent', + '--userconfig', outfile, + '--scope', scope + ], + opts, + function (err, code) { + t.notOk(code, 'exited OK') + t.notOk(err, 'no error output') + var config = fs.readFileSync(outfile, 'utf8') + t.like(config, new RegExp(scope + ':registry=' + common.registry), 'scope:registry is set') + s.close() + rimraf(outfile, function (err) { + t.ifError(err, 'removed config file OK') + t.end() + }) + }) + + var message = 'Logged in as u to scope ' + scope + ' on ' + common.registry + '/.' + runner.stdout.on('data', verifyStdout(runner, message, t)) + }) + }) +}) + +test("npm login --always-auth", function (t) { + mr({port : common.port, plugin : mocks}, function (er, s) { + var runner = common.npm( + [ + "login", + "--registry", common.registry, + "--loglevel", "silent", + "--userconfig", outfile, + "--always-auth" + ], + opts, + function (err, code) { + t.notOk(code, "exited OK") + t.notOk(err, "no error output") + var config = fs.readFileSync(outfile, "utf8") + t.like(config, /:always-auth=true/, "always-auth is scoped and true") + s.close() + rimraf(outfile, function (err) { + t.ifError(err, "removed config file OK") + t.end() + }) + }) + + var message = 'Logged in as u on ' + common.registry + '/.' + runner.stdout.on('data', verifyStdout(runner, message, t)) + }) +}) + +test("npm login --no-always-auth", function (t) { + mr({port : common.port, plugin : mocks}, function (er, s) { + var runner = common.npm( + [ + "login", + "--registry", common.registry, + "--loglevel", "silent", + "--userconfig", outfile, + "--no-always-auth" + ], + opts, + function (err, code) { + t.notOk(code, "exited OK") + t.notOk(err, "no error output") + var config = fs.readFileSync(outfile, "utf8") + t.like(config, /:always-auth=false/, "always-auth is scoped and false") + s.close() + rimraf(outfile, function (err) { + t.ifError(err, "removed config file OK") + t.end() + }) + }) + + var message = 'Logged in as u on ' + common.registry + '/.' + runner.stdout.on('data', verifyStdout(runner, message, t)) + }) +}) + + +test("cleanup", function (t) { + rimraf.sync(outfile) + t.pass("cleaned up") + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/adduser-legacy-auth.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/adduser-legacy-auth.js new file mode 100644 index 00000000..890a3fd2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/adduser-legacy-auth.js @@ -0,0 +1,97 @@ +var fs = require('fs') +var path = require('path') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var mr = require('npm-registry-mock') + +var test = require('tap').test +var common = require('../common-tap.js') + +var opts = { cwd: __dirname } +var pkg = path.resolve(__dirname, 'adduser-legacy-auth') +var outfile = path.resolve(pkg, '_npmrc') + +var contents = '_auth=' + new Buffer('u:x').toString('base64') + '\n' + + 'registry=https://nonexistent.lvh.me/registry\n' + + 'email=u@p.me\n' + +var responses = { + 'Username': 'u\n', + 'Password': 'p\n', + 'Email': 'u@p.me\n' +} + +function mocks (server) { + server.filteringRequestBody(function (r) { + if (r.match(/"_id":"org\.couchdb\.user:u"/)) { + return 'auth' + } + }) + server.put('/-/user/org.couchdb.user:u', 'auth') + .reply(409, { error: 'user exists' }) + server.get('/-/user/org.couchdb.user:u?write=true') + .reply(200, { _rev: '3-deadcafebabebeef' }) + server.put( + '/-/user/org.couchdb.user:u/-rev/3-deadcafebabebeef', + 'auth', + { authorization: 'Basic dTpw' } + ).reply(201, { username: 'u', password: 'p', email: 'u@p.me' }) +} + +test('setup', function (t) { + mkdirp(pkg, function (er) { + t.ifError(er, pkg + ' made successfully') + + fs.writeFile(outfile, contents, function (er) { + t.ifError(er, 'wrote legacy config') + + t.end() + }) + }) +}) + +test('npm login', function (t) { + mr({ port: common.port, plugin: mocks }, function (er, s) { + var runner = common.npm( + [ + 'login', + '--registry', common.registry, + '--loglevel', 'silent', + '--userconfig', outfile + ], + opts, + function (err, code, stdout, stderr) { + t.ifError(err, 'npm ran without issue') + t.notOk(code, 'exited OK') + t.notOk(stderr, 'no error output') + var config = fs.readFileSync(outfile, 'utf8') + t.like(config, /:always-auth=false/, 'always-auth is scoped and false (by default)') + s.close() + rimraf(outfile, function (err) { + t.ifError(err, 'removed config file OK') + t.end() + }) + }) + + var remaining = Object.keys(responses).length + runner.stdout.on('data', function (chunk) { + if (remaining > 0) { + remaining-- + + var label = chunk.toString('utf8').split(':')[0] + runner.stdin.write(responses[label]) + + if (remaining === 0) runner.stdin.end() + } else { + var message = chunk.toString('utf8').trim() + t.equal(message, 'Logged in as u on ' + common.registry + '/.') + } + }) + }) +}) + +test('cleanup', function (t) { + rimraf.sync(pkg) + t.pass('cleaned up') + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/bearer-token-check.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/bearer-token-check.js new file mode 100644 index 00000000..6db2b832 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/bearer-token-check.js @@ -0,0 +1,119 @@ +var resolve = require('path').resolve +var writeFileSync = require('graceful-fs').writeFileSync + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') +var toNerfDart = require('../../lib/config/nerf-dart.js') + +var pkg = resolve(__dirname, 'install-bearer-check') +var outfile = resolve(pkg, '_npmrc') +var modules = resolve(pkg, 'node_modules') +var tarballPath = '/scoped-underscore/-/scoped-underscore-1.3.1.tgz' +// needs to be a different hostname to verify tokens (not) being sent correctly +var tarballURL = 'http://lvh.me:' + common.port + tarballPath +var tarball = resolve(__dirname, '../fixtures/scoped-underscore-1.3.1.tgz') + +var server + +var EXEC_OPTS = { cwd: pkg } + +function mocks (server) { + var auth = 'Bearer 0xabad1dea' + server.get(tarballPath, { authorization: auth }).reply(403, { + error: 'token leakage', + reason: 'This token should not be sent.' + }) + server.get(tarballPath).replyWithFile(200, tarball) +} + +test('setup', function (t) { + mr({ port: common.port, plugin: mocks }, function (er, s) { + server = s + t.ok(s, 'set up mock registry') + setup() + t.end() + }) +}) + +test('authed npm install with tarball not on registry', function (t) { + common.npm( + [ + 'install', + '--loglevel', 'silent', + '--json', + '--fetch-retries', 0, + '--userconfig', outfile + ], + EXEC_OPTS, + function (err, code, stdout, stderr) { + t.ifError(err, 'test runner executed without error') + t.equal(code, 0, 'npm install exited OK') + t.notOk(stderr, 'no output on stderr') + try { + var results = JSON.parse(stdout) + } catch (ex) { + console.error('#', ex) + t.ifError(ex, 'stdout was valid JSON') + } + + if (results) { + var installedversion = { + 'name': '@scoped/underscore', + 'version': '1.3.1', + 'from': 'http://lvh.me:1337/scoped-underscore/-/scoped-underscore-1.3.1.tgz', + 'dependencies': {} + } + t.isDeeply(results[0], installedversion, '@scoped/underscore installed') + } + + t.end() + } + ) +}) + +test('cleanup', function (t) { + server.close() + cleanup() + t.end() +}) + +var contents = '@scoped:registry=' + common.registry + '\n' + + toNerfDart(common.registry) + ':_authToken=0xabad1dea\n' + +var json = { + name: 'test-package-install', + version: '1.0.0' +} + +var shrinkwrap = { + name: 'test-package-install', + version: '1.0.0', + dependencies: { + '@scoped/underscore': { + resolved: tarballURL, + from: '>=1.3.1 <2', + version: '1.3.1' + } + } +} + +function setup () { + cleanup() + mkdirp.sync(modules) + writeFileSync(resolve(pkg, 'package.json'), JSON.stringify(json, null, 2) + '\n') + writeFileSync(outfile, contents) + writeFileSync( + resolve(pkg, 'npm-shrinkwrap.json'), + JSON.stringify(shrinkwrap, null, 2) + '\n' + ) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/bin.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/bin.js new file mode 100644 index 00000000..ee4e1ff2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/bin.js @@ -0,0 +1,17 @@ +var path = require("path") +var test = require("tap").test +var common = require("../common-tap.js") +var opts = { cwd: __dirname } +var binDir = "../../node_modules/.bin" +var fixture = path.resolve(__dirname, binDir) + +test('npm bin', function (t) { + common.npm(["bin"], opts, function (err, code, stdout, stderr) { + t.ifError(err, "bin ran without issue") + t.notOk(stderr, "should have no stderr") + t.equal(code, 0, "exit ok") + var res = path.resolve(stdout) + t.equal(res, fixture + "\n") + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/bitbucket-https-url-with-creds-package.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/bitbucket-https-url-with-creds-package.js new file mode 100644 index 00000000..e5a4142e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/bitbucket-https-url-with-creds-package.js @@ -0,0 +1,83 @@ +'use strict' +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var requireInject = require('require-inject') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var pkg = path.resolve(__dirname, 'bitbucket-https-url-with-creds-package') + +var json = { + name: 'bitbucket-https-url-with-creds-package', + version: '0.0.0', + dependencies: { + 'private': 'git+https://user:pass@bitbucket.org/foo/private.git' + } +} + +test('setup', function (t) { + setup() + t.end() +}) + +test('bitbucket-https-url-with-creds-package', function (t) { + var cloneUrls = [ + ['https://user:pass@bitbucket.org/foo/private.git', 'Bitbucket URLs with passwords try only that.'] + ] + + var npm = requireInject.installGlobally('../../lib/npm.js', { + 'child_process': { + 'execFile': function (cmd, args, options, cb) { + process.nextTick(function () { + if (args[0] !== 'clone') return cb(null, '', '') + var cloneUrl = cloneUrls.shift() + if (cloneUrl) { + t.is(args[3], cloneUrl[0], cloneUrl[1]) + } else { + t.fail('too many attempts to clone') + } + cb(new Error()) + }) + } + } + }) + + var opts = { + cache: path.resolve(pkg, 'cache'), + prefix: pkg, + registry: common.registry, + loglevel: 'silent' + } + npm.load(opts, function (er) { + t.ifError(er, 'npm loaded without error') + npm.commands.install([], function (er) { + t.ok(er, 'mocked install failed as expected') + t.end() + }) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function setup () { + cleanup() + mkdirp.sync(pkg) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + process.chdir(pkg) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/bitbucket-https-url-with-creds.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/bitbucket-https-url-with-creds.js new file mode 100644 index 00000000..3f39e3be --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/bitbucket-https-url-with-creds.js @@ -0,0 +1,80 @@ +'use strict' +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var requireInject = require('require-inject') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var pkg = path.resolve(__dirname, 'bitbucket-https-url-with-creds') + +var json = { + name: 'bitbucket-https-url-with-creds', + version: '0.0.0' +} + +test('setup', function (t) { + setup() + t.end() +}) + +test('bitbucket-https-url-with-creds', function (t) { + var cloneUrls = [ + ['https://user:pass@bitbucket.org/foo/private.git', 'Bitbucket URLs with passwords try only that.'] + ] + + var npm = requireInject.installGlobally('../../lib/npm.js', { + 'child_process': { + 'execFile': function (cmd, args, options, cb) { + process.nextTick(function () { + if (args[0] !== 'clone') return cb(null, '', '') + var cloneUrl = cloneUrls.shift() + if (cloneUrl) { + t.is(args[3], cloneUrl[0], cloneUrl[1]) + } else { + t.fail('too many attempts to clone') + } + cb(new Error()) + }) + } + } + }) + + var opts = { + cache: path.resolve(pkg, 'cache'), + prefix: pkg, + registry: common.registry, + loglevel: 'silent' + } + npm.load(opts, function (er) { + t.ifError(er, 'npm loaded without error') + npm.commands.install(['git+https://user:pass@bitbucket.org/foo/private.git'], function (er) { + t.ok(er, 'mocked install failed as expected') + t.end() + }) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function setup () { + cleanup() + mkdirp.sync(pkg) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + process.chdir(pkg) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/bitbucket-shortcut-package.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/bitbucket-shortcut-package.js new file mode 100644 index 00000000..bc38bd02 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/bitbucket-shortcut-package.js @@ -0,0 +1,84 @@ +'use strict' +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var requireInject = require('require-inject') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var pkg = path.resolve(__dirname, 'bitbucket-shortcut-package') + +var json = { + name: 'bitbucket-shortcut-package', + version: '0.0.0', + dependencies: { + 'private': 'bitbucket:foo/private' + } +} + +test('setup', function (t) { + setup() + t.end() +}) + +test('bitbucket-shortcut', function (t) { + var cloneUrls = [ + ['git@bitbucket.org:foo/private.git', 'Bitbucket shortcuts try SSH first'], + ['https://bitbucket.org/foo/private.git', 'Bitbucket shortcuts try HTTPS URLs second'] + ] + + var npm = requireInject.installGlobally('../../lib/npm.js', { + 'child_process': { + 'execFile': function (cmd, args, options, cb) { + process.nextTick(function () { + if (args[0] !== 'clone') return cb(null, '', '') + var cloneUrl = cloneUrls.shift() + if (cloneUrl) { + t.is(args[3], cloneUrl[0], cloneUrl[1]) + } else { + t.fail('too many attempts to clone') + } + cb(new Error()) + }) + } + } + }) + + var opts = { + cache: path.resolve(pkg, 'cache'), + prefix: pkg, + registry: common.registry, + loglevel: 'silent' + } + npm.load(opts, function (er) { + t.ifError(er, 'npm loaded without error') + npm.commands.install([], function (er) { + t.ok(er, 'mocked install failed as expected') + t.end() + }) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function setup () { + cleanup() + mkdirp.sync(pkg) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + process.chdir(pkg) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/bitbucket-shortcut.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/bitbucket-shortcut.js new file mode 100644 index 00000000..51afe199 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/bitbucket-shortcut.js @@ -0,0 +1,81 @@ +'use strict' +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var requireInject = require('require-inject') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var pkg = path.resolve(__dirname, 'bitbucket-shortcut') + +var json = { + name: 'bitbucket-shortcut', + version: '0.0.0' +} + +test('setup', function (t) { + setup() + t.end() +}) + +test('bitbucket-shortcut', function (t) { + var cloneUrls = [ + ['git@bitbucket.org:foo/private.git', 'Bitbucket shortcuts try SSH first'], + ['https://bitbucket.org/foo/private.git', 'Bitbucket shortcuts try HTTPS URLs second'] + ] + + var npm = requireInject.installGlobally('../../lib/npm.js', { + 'child_process': { + 'execFile': function (cmd, args, options, cb) { + process.nextTick(function () { + if (args[0] !== 'clone') return cb(null, '', '') + var cloneUrl = cloneUrls.shift() + if (cloneUrl) { + t.is(args[3], cloneUrl[0], cloneUrl[1]) + } else { + t.fail('too many attempts to clone') + } + cb(new Error()) + }) + } + } + }) + + var opts = { + cache: path.resolve(pkg, 'cache'), + prefix: pkg, + registry: common.registry, + loglevel: 'silent' + } + npm.load(opts, function (er) { + t.ifError(er, 'npm loaded without error') + npm.commands.install(['bitbucket:foo/private'], function (er) { + t.ok(er, 'mocked install failed as expected') + t.end() + }) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function setup () { + cleanup() + mkdirp.sync(pkg) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + process.chdir(pkg) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/bugs.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/bugs.js new file mode 100644 index 00000000..51ba5d3f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/bugs.js @@ -0,0 +1,151 @@ +if (process.platform === "win32") { + console.error("skipping test, because windows and shebangs") + return +} + +var common = require("../common-tap.js") +var mr = require("npm-registry-mock") + +var test = require("tap").test +var rimraf = require("rimraf") +var fs = require("fs") +var path = require("path") +var join = path.join +var outFile = path.join(__dirname, "/_output") + +var opts = { cwd: __dirname } + +test("setup", function (t) { + var s = "#!/usr/bin/env bash\n" + + "echo \"$@\" > " + JSON.stringify(__dirname) + "/_output\n" + fs.writeFileSync(join(__dirname, "/_script.sh"), s, "ascii") + fs.chmodSync(join(__dirname, "/_script.sh"), "0755") + t.pass("made script") + t.end() +}) + +test("npm bugs underscore", function (t) { + mr({port : common.port}, function (er, s) { + common.npm([ + "bugs", "underscore", + "--registry=" + common.registry, + "--loglevel=silent", + "--browser=" + join(__dirname, "/_script.sh") + ], opts, function (err, code, stdout, stderr) { + t.ifError(err, "bugs ran without issue") + t.notOk(stderr, "should have no stderr") + t.equal(code, 0, "exit ok") + var res = fs.readFileSync(outFile, "ascii") + s.close() + t.equal(res, "https://github.com/jashkenas/underscore/issues\n") + rimraf.sync(outFile) + t.end() + }) + }) +}) + +test("npm bugs optimist - github (https://)", function (t) { + mr({port : common.port}, function (er, s) { + common.npm([ + "bugs", "optimist", + "--registry=" + common.registry, + "--loglevel=silent", + "--browser=" + join(__dirname, "/_script.sh") + ], opts, function (err, code, stdout, stderr) { + t.ifError(err, "bugs ran without issue") + t.notOk(stderr, "should have no stderr") + t.equal(code, 0, "exit ok") + var res = fs.readFileSync(outFile, "ascii") + s.close() + t.equal(res, "https://github.com/substack/node-optimist/issues\n") + rimraf.sync(outFile) + t.end() + }) + }) +}) + +test("npm bugs npm-test-peer-deps - no repo", function (t) { + mr({port : common.port}, function (er, s) { + common.npm([ + "bugs", "npm-test-peer-deps", + "--registry=" + common.registry, + "--loglevel=silent", + "--browser=" + join(__dirname, "/_script.sh") + ], opts, function (err, code, stdout, stderr) { + t.ifError(err, "bugs ran without issue") + t.notOk(stderr, "should have no stderr") + t.equal(code, 0, "exit ok") + var res = fs.readFileSync(outFile, "ascii") + s.close() + t.equal(res, "https://www.npmjs.org/package/npm-test-peer-deps\n") + rimraf.sync(outFile) + t.end() + }) + }) +}) + +test("npm bugs test-repo-url-http - non-github (http://)", function (t) { + mr({port : common.port}, function (er, s) { + common.npm([ + "bugs", "test-repo-url-http", + "--registry=" + common.registry, + "--loglevel=silent", + "--browser=" + join(__dirname, "/_script.sh") + ], opts, function (err, code, stdout, stderr) { + t.ifError(err, "bugs ran without issue") + t.notOk(stderr, "should have no stderr") + t.equal(code, 0, "exit ok") + var res = fs.readFileSync(outFile, "ascii") + s.close() + t.equal(res, "https://www.npmjs.org/package/test-repo-url-http\n") + rimraf.sync(outFile) + t.end() + }) + }) +}) + +test("npm bugs test-repo-url-https - non-github (https://)", function (t) { + mr({port : common.port}, function (er, s) { + common.npm([ + "bugs", "test-repo-url-https", + "--registry=" + common.registry, + "--loglevel=silent", + "--browser=" + join(__dirname, "/_script.sh") + ], opts, function (err, code, stdout, stderr) { + t.ifError(err, "bugs ran without issue") + t.notOk(stderr, "should have no stderr") + t.equal(code, 0, "exit ok") + var res = fs.readFileSync(outFile, "ascii") + s.close() + t.equal(res, "https://www.npmjs.org/package/test-repo-url-https\n") + rimraf.sync(outFile) + t.end() + }) + }) +}) + +test("npm bugs test-repo-url-ssh - non-github (ssh://)", function (t) { + mr({port : common.port}, function (er, s) { + common.npm([ + "bugs", "test-repo-url-ssh", + "--registry=" + common.registry, + "--loglevel=silent", + "--browser=" + join(__dirname, "/_script.sh") + ], opts, function (err, code, stdout, stderr) { + t.ifError(err, "bugs ran without issue") + t.notOk(stderr, "should have no stderr") + t.equal(code, 0, "exit ok") + var res = fs.readFileSync(outFile, "ascii") + s.close() + t.equal(res, "https://www.npmjs.org/package/test-repo-url-ssh\n") + rimraf.sync(outFile) + t.end() + }) + }) +}) + +test("cleanup", function (t) { + fs.unlinkSync(join(__dirname, "/_script.sh")) + t.pass("cleaned up") + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/build-already-built.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/build-already-built.js new file mode 100644 index 00000000..8e5546fe --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/build-already-built.js @@ -0,0 +1,81 @@ +// if "npm rebuild" is run with bundled dependencies, +// message "already built" should not be error +var test = require("tap").test +var path = require("path") +var osenv = require("osenv") +var rimraf = require("rimraf") +var npmlog = require("npmlog") +var mkdirp = require("mkdirp") +var requireInject = require("require-inject") + +var npm = require("../../lib/npm.js") + +var PKG_DIR = path.resolve(__dirname, "build-already-built") +var fakePkg = "foo" + +test("setup", function (t) { + cleanup() + + t.end() +}) + +test("issue #6735 build 'already built' message", function (t) { + npm.load({loglevel : "warn"}, function () { + // capture log messages with level + var log = "" + npmlog.on("log", function (chunk) { + log += chunk.level + " " + chunk.message + "\n" + }) + + mkdirp.sync(fakePkg) + var folder = path.resolve(fakePkg) + + var global = npm.config.get("global") + + var build = requireInject("../../lib/build", { + }) + + t.test("pin previous behavior", function (t) { + + build([fakePkg], global, false, false, function (err) { + t.ok(err, "build failed as expected") + t.similar(err.message, /package.json/, "missing package.json as expected") + t.notSimilar(log, /already built/, "no already built message written") + + t.end() + }) + }) + + t.test("simulate rebuild of bundledDependency", function (t) { + + log = "" + + build._didBuild[folder] = true + + build([fakePkg], global, false, false, function (err) { + t.ok(err, "build failed as expected") + t.similar(err.message, /package.json/, "missing package.json as expected") + + t.similar(log, /already built/, "already built message written") + t.notSimilar(log, /ERR! already built/, "already built message written is not error") + t.similar(log, /info already built/, "already built message written is info") + + t.end() + }) + }) + + t.end() + }) +}) + + +test("cleanup", function (t) { + cleanup() + + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(PKG_DIR) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/builtin-config.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/builtin-config.js new file mode 100644 index 00000000..d92551ed --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/builtin-config.js @@ -0,0 +1,126 @@ +var fs = require("fs") + +if (process.argv[2] === "write-builtin") { + var pid = process.argv[3] + fs.writeFileSync("npmrc", "foo=bar\npid=" + pid + "\n") + return +} + +var rcdata = "foo=bar\npid=" + process.pid + "\n" +var common = require("../common-tap.js") +var path = require("path") +var rimraf = require("rimraf") +var mkdirp = require("mkdirp") +var folder = path.resolve(__dirname, "builtin-config") +var test = require("tap").test +var npm = path.resolve(__dirname, "../..") +var spawn = require("child_process").spawn +var node = process.execPath + +test("setup", function (t) { + rimraf.sync(folder) + mkdirp.sync(folder + "/first") + mkdirp.sync(folder + "/second") + mkdirp.sync(folder + "/cache") + mkdirp.sync(folder + "/tmp") + + t.pass("finished setup") + t.end() +}) + + +test("install npm into first folder", function (t) { + var args = ["install", npm, "-g", + "--prefix=" + folder + "/first", + "--ignore-scripts", + "--cache=" + folder + "/cache", + "--no-spin", + "--loglevel=silent", + "--tmp=" + folder + "/tmp"] + common.npm(args, {stdio: "inherit"}, function (er, code) { + if (er) throw er + t.equal(code, 0) + t.end() + }) +}) + +test("write npmrc file", function (t) { + common.npm(["explore", "npm", "-g", + "--prefix=" + folder + "/first", + "--cache=" + folder + "/cache", + "--tmp=" + folder + "/tmp", + "--no-spin", + "--", + node, __filename, "write-builtin", process.pid + ], + {"stdio": "inherit"}, + function (er, code) { + if (er) throw er + t.equal(code, 0) + t.end() + }) +}) + +test("use first npm to install second npm", function (t) { + // get the root location + common.npm([ "root", "-g", + "--prefix=" + folder + "/first", + "--cache=" + folder + "/cache", + "--tmp=" + folder + "/tmp", + "--no-spin" + ], {}, function (er, code, so) { + if (er) throw er + t.equal(code, 0) + var root = so.trim() + t.ok(fs.statSync(root).isDirectory()) + + var bin = path.resolve(root, "npm/bin/npm-cli.js") + spawn( node + , [ bin + , "install", npm + , "-g" + , "--prefix=" + folder + "/second" + , "--cache=" + folder + "/cache" + , "--tmp=" + folder + "/tmp" + , "--no-spin" + ]) + .on("error", function (er) { throw er }) + .on("close", function (code) { + t.equal(code, 0, "code is zero") + t.end() + }) + }) +}) + +test("verify that the builtin config matches", function (t) { + common.npm([ "root", "-g", + "--prefix=" + folder + "/first", + "--cache=" + folder + "/cache", + "--tmp=" + folder + "/tmp" + ], {}, function (er, code, so) { + if (er) throw er + t.equal(code, 0) + var firstRoot = so.trim() + common.npm([ "root", "-g", + "--prefix=" + folder + "/second", + "--cache=" + folder + "/cache", + "--tmp=" + folder + "/tmp" + ], {}, function (er, code, so) { + if (er) throw er + t.equal(code, 0) + var secondRoot = so.trim() + var firstRc = path.resolve(firstRoot, "npm", "npmrc") + var secondRc = path.resolve(secondRoot, "npm", "npmrc") + var firstData = fs.readFileSync(firstRc, "utf8") + var secondData = fs.readFileSync(secondRc, "utf8") + t.equal(firstData, secondData) + t.end() + }) + }) +}) + + +test("clean", function (t) { + rimraf.sync(folder) + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/bundled-dependencies-nonarray.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/bundled-dependencies-nonarray.js new file mode 100644 index 00000000..bff0522d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/bundled-dependencies-nonarray.js @@ -0,0 +1,77 @@ +var fs = require('graceful-fs') +var path = require('path') + +var osenv = require('osenv') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var test = require('tap').test + +var npm = require('../../lib/npm.js') +var common = require('../common-tap.js') + +var dir = path.resolve(__dirname, 'bundleddependencies') +var pkg = path.resolve(dir, 'pkg-with-bundled') +var dep = path.resolve(dir, 'a-bundled-dep') + +var pj = JSON.stringify({ + name: 'pkg-with-bundled', + version: '1.0.0', + dependencies: { + 'a-bundled-dep': 'file:../a-bundled-dep' + }, + bundledDependencies: { + 'a-bundled-dep': 'file:../a-bundled-dep' + } +}, null, 2) + '\n' + +var pjDep = JSON.stringify({ + name: 'a-bundled-dep', + version: '2.0.0' +}, null, 2) + '\n' + +test('setup', function (t) { + bootstrap() + t.end() +}) + +test('errors on non-array bundleddependencies', function (t) { + t.plan(6) + process.chdir(pkg) + npm.load({}, + function () { + common.npm(['install'], { cwd: pkg }, function (err, code, stdout, stderr) { + t.ifError(err, 'npm install ran without issue') + t.notOk(code, 'exited with a non-error code') + t.notOk(stderr, 'no error output') + + common.npm(['install', './pkg-with-bundled'], { cwd: dir }, + function (err, code, stdout, stderr) { + t.ifError(err, 'npm install ran without issue') + t.ok(code, 'exited with a error code') + t.ok(stderr.indexOf('be an array') > -1, 'nice error output') + } + ) + }) + } + ) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function bootstrap () { + mkdirp.sync(dir) + + mkdirp.sync(pkg) + fs.writeFileSync(path.resolve(pkg, 'package.json'), pj) + + mkdirp.sync(dep) + fs.writeFileSync(path.resolve(dep, 'package.json'), pjDep) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(dir) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/cache-add-localdir-fallback.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/cache-add-localdir-fallback.js new file mode 100644 index 00000000..facd95c3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/cache-add-localdir-fallback.js @@ -0,0 +1,84 @@ +var path = require("path") +var test = require("tap").test +var npm = require("../../lib/npm.js") +var requireInject = require("require-inject") + +var realizePackageSpecifier = requireInject("realize-package-specifier", { + "fs": { + stat: function (file, cb) { + process.nextTick(function () { + switch (file) { + case path.resolve("named"): + cb(new Error("ENOENT")) + break + case path.resolve("file.tgz"): + cb(null, { isDirectory: function () { return false } }) + break + case path.resolve("dir-no-package"): + cb(null, { isDirectory: function () { return true } }) + break + case path.resolve("dir-no-package/package.json"): + cb(new Error("ENOENT")) + break + case path.resolve("dir-with-package"): + cb(null, { isDirectory: function () { return true } }) + break + case path.resolve("dir-with-package/package.json"): + cb(null, {}) + break + case path.resolve(__dirname, "dir-with-package"): + cb(null, { isDirectory: function () { return true } }) + break + case path.join(__dirname, "dir-with-package", "package.json"): + cb(null, {}) + break + case path.resolve(__dirname, "file.tgz"): + cb(null, { isDirectory: function () { return false } }) + break + default: + throw new Error("Unknown test file passed to stat: " + file) + } + }) + } + } +}) + +npm.load({loglevel : "silent"}, function () { + var cache = requireInject("../../lib/cache.js", { + "realize-package-specifier": realizePackageSpecifier, + "../../lib/cache/add-named.js": function addNamed (name, version, data, cb) { + cb(null, "addNamed") + }, + "../../lib/cache/add-local.js": function addLocal (name, data, cb) { + cb(null, "addLocal") + } + }) + + test("npm install localdir fallback", function (t) { + t.plan(12) + cache.add("named", null, null, false, function (er, which) { + t.ifError(er, "named was cached") + t.is(which, "addNamed", "registry package name") + }) + cache.add("file.tgz", null, null, false, function (er, which) { + t.ifError(er, "file.tgz was cached") + t.is(which, "addLocal", "local file") + }) + cache.add("dir-no-package", null, null, false, function (er, which) { + t.ifError(er, "local directory was cached") + t.is(which, "addNamed", "local directory w/o package.json") + }) + cache.add("dir-with-package", null, null, false, function (er, which) { + t.ifError(er, "local directory with package was cached") + t.is(which,"addLocal", "local directory with package.json") + }) + cache.add("file:./dir-with-package", null, __dirname, false, function (er, which) { + t.ifError(er, "local directory (as URI) with package was cached") + t.is(which, "addLocal", "file: URI to local directory with package.json") + }) + cache.add("file:./file.tgz", null, __dirname, false, function (er, which) { + t.ifError(er, "local file (as URI) with package was cached") + t.is(which, "addLocal", "file: URI to local file with package.json") + }) + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/cache-add-unpublished.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/cache-add-unpublished.js new file mode 100644 index 00000000..fe26929f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/cache-add-unpublished.js @@ -0,0 +1,34 @@ +var common = require("../common-tap.js") +var test = require("tap").test +var mr = require("npm-registry-mock") + +test("cache add", function (t) { + setup(function (er, s) { + if (er) { + throw er + } + common.npm([ + "cache", + "add", + "superfoo", + "--registry=http://localhost:1337/" + ], {}, function (er, c, so, se) { + if (er) throw er + t.ok(c, "got non-zero exit code") + t.equal(so, "", "nothing printed to stdout") + t.similar(se, /404 Not Found: superfoo/, "got expected error") + s.close() + t.end() + }) + }) +}) + +function setup (cb) { + var s = require("http").createServer(function (req, res) { + res.statusCode = 404 + res.end("{\"error\":\"not_found\"}\n") + }) + s.listen(1337, function () { + cb(null, s) + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/cache-shasum-fork.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/cache-shasum-fork.js new file mode 100644 index 00000000..f16404cb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/cache-shasum-fork.js @@ -0,0 +1,101 @@ +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +// Install from a tarball that thinks it is underscore@1.5.1 +// (but is actually a fork) +var forkPath = path.resolve( + __dirname, '..', 'fixtures', 'forked-underscore-1.5.1.tgz' +) +var pkg = path.resolve(__dirname, 'cache-shasum-fork') +var cache = path.join(pkg, 'cache') +var server + +test('setup', function (t) { + setup() + t.comment('test for https://github.com/npm/npm/issues/3265') + mr({ port: common.port }, function (er, s) { + server = s + t.end() + }) +}) + +test('npm cache - install from fork', function (t) { + setup() + common.npm( + [ + '--loglevel', 'silent', + '--registry', common.registry, + 'install', forkPath + ], + { + cwd: pkg, + env: { npm_config_cache: cache } + }, + function (err, code, stdout, stderr) { + t.ifErr(err, 'install finished without error') + t.notOk(stderr, 'Should not get data on stderr: ' + stderr) + t.equal(code, 0, 'install finished successfully') + + t.equal(stdout, 'underscore@1.5.1 node_modules/underscore\n') + var index = fs.readFileSync( + path.join(pkg, 'node_modules', 'underscore', 'index.js'), + 'utf8' + ) + t.equal(index, 'console.log("This is the fork");\n\n') + t.end() + } + ) +}) + +// Now install the real 1.5.1. +test('npm cache - install from origin', function (t) { + setup() + common.npm( + [ + '--loglevel', 'silent', + '--registry', common.registry, + 'install', 'underscore' + ], + { + cwd: pkg, + env: { npm_config_cache: cache } + }, + function (err, code, stdout, stderr) { + t.ifErr(err, 'install finished without error') + t.equal(code, 0, 'install finished successfully') + t.notOk(stderr, 'Should not get data on stderr: ' + stderr) + t.equal(stdout, 'underscore@1.5.1 node_modules/underscore\n') + var index = fs.readFileSync( + path.join(pkg, 'node_modules', 'underscore', 'index.js'), + 'utf8' + ) + t.equal(index, 'module.exports = require(\'./underscore\');\n') + t.end() + } + ) +}) + +test('cleanup', function (t) { + server.close() + cleanup() + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} + +function setup () { + mkdirp.sync(cache) + mkdirp.sync(path.join(pkg, 'node_modules')) + process.chdir(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/cache-shasum.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/cache-shasum.js new file mode 100644 index 00000000..f86037cc --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/cache-shasum.js @@ -0,0 +1,59 @@ +var npm = require.resolve("../../") +var test = require("tap").test +var path = require("path") +var rimraf = require("rimraf") +var mkdirp = require("mkdirp") +var mr = require("npm-registry-mock") +var common = require("../common-tap.js") +var cache = path.resolve(__dirname, "cache-shasum") +var spawn = require("child_process").spawn +var sha = require("sha") +var server + +test("mock reg", function (t) { + rimraf.sync(cache) + mkdirp.sync(cache) + mr({port : common.port}, function (er, s) { + server = s + t.pass("ok") + t.end() + }) +}) + +test("npm cache add request", function (t) { + var c = spawn(process.execPath, [ + npm, "cache", "add", "request@2.27.0", + "--cache=" + cache, + "--registry=" + common.registry, + "--loglevel=quiet" + ]) + c.stderr.pipe(process.stderr) + + c.stdout.on("data", function (d) { + t.fail("Should not get data on stdout: " + d) + }) + + c.on("close", function (code) { + t.notOk(code, "exit ok") + t.end() + }) +}) + +test("compare", function (t) { + var d = path.resolve(__dirname, "cache-shasum/request") + var p = path.resolve(d, "2.27.0/package.tgz") + var r = require("./cache-shasum/localhost_1337/request/.cache.json") + var rshasum = r.versions["2.27.0"].dist.shasum + sha.get(p, function (er, pshasum) { + if (er) + throw er + t.equal(pshasum, rshasum) + t.end() + }) +}) + +test("cleanup", function (t) { + server.close() + rimraf.sync(cache) + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/circular-dep.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/circular-dep.js new file mode 100644 index 00000000..002b30cd --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/circular-dep.js @@ -0,0 +1,99 @@ +var fs = require('graceful-fs') +var path = require('path') +var existsSync = fs.existsSync || path.existsSync + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') +var server + +var pkg = path.resolve(__dirname, 'circular-dep') +var minimist = path.join(pkg, 'minimist') + +var EXEC_OPTS = { + cwd: path.join(pkg, 'minimist/node_modules'), + npm_config_cache: path.join(pkg, 'cache') +} + +var json = { + name: 'minimist', + version: '0.0.5', + dependencies: { + optimist: '0.6.0' + } +} + +test('setup', function (t) { + t.comment('test for https://github.com/npm/npm/issues/4312') + setup(function () { + t.end() + }) +}) + +test('installing a package that depends on the current package', function (t) { + common.npm( + [ + '--registry', common.registry, + '--loglevel', 'silent', + 'install', 'optimist' + ], + EXEC_OPTS, + function (err, code, stdout, stderr) { + t.ifError(err, 'npm ran without issue') + t.notOk(code, 'npm ran without raising an error code') + t.notOk(stderr, 'no error output') + + common.npm( + [ + '--registry', common.registry, + '--loglevel', 'silent', + 'dedupe' + ], + EXEC_OPTS, + function (err, code, stdout, stderr) { + t.ifError(err, 'npm ran without issue') + t.notOk(code, 'npm ran without raising an error code') + t.notOk(stderr, 'no error output') + + t.ok(existsSync(path.resolve( + minimist, + 'node_modules', 'optimist', + 'node_modules', 'minimist' + )), 'circular dependency uncircled') + t.end() + } + ) + } + ) +}) + +test('cleanup', function (t) { + cleanup() + server.close() + t.end() +}) + +function setup (cb) { + cleanup() + mkdirp.sync(minimist) + fs.writeFileSync( + path.join(minimist, 'package.json'), + JSON.stringify(json, null, 2) + ) + process.chdir(path.resolve(pkg, 'minimist')) + + fs.mkdirSync(path.resolve(pkg, 'minimist/node_modules')) + mr({ port: common.port }, function (er, s) { + server = s + cb() + }) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/config-basic.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/config-basic.js new file mode 100644 index 00000000..d5a950a8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/config-basic.js @@ -0,0 +1,66 @@ +var test = require("tap").test +var npmconf = require("../../lib/config/core.js") +var common = require("./00-config-setup.js") +var path = require("path") + +var projectData = { + "save-prefix": "~", + "proprietary-attribs": false +} + +var ucData = common.ucData +var envData = common.envData +var envDataFix = common.envDataFix + +var gcData = { "package-config:foo": "boo" } + +var biData = {} + +var cli = { foo: "bar", umask: 022 } + +var expectList = +[ cli, + envDataFix, + projectData, + ucData, + gcData, + biData ] + +var expectSources = { + cli: { data: cli }, + env: { + data: envDataFix, + source: envData, + prefix: "" + }, + project: { + path: path.resolve(__dirname, "..", "..", ".npmrc"), + type: "ini", + data: projectData + }, + user: { + path: common.userconfig, + type: "ini", + data: ucData + }, + global: { + path: common.globalconfig, + type: "ini", + data: gcData + }, + builtin: { data: biData } +} + +test("no builtin", function (t) { + npmconf.load(cli, function (er, conf) { + if (er) throw er + t.same(conf.list, expectList) + t.same(conf.sources, expectSources) + t.same(npmconf.rootConf.list, []) + t.equal(npmconf.rootConf.root, npmconf.defs.defaults) + t.equal(conf.root, npmconf.defs.defaults) + t.equal(conf.get("umask"), 022) + t.equal(conf.get("heading"), "npm") + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/config-builtin.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/config-builtin.js new file mode 100644 index 00000000..5a1589ff --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/config-builtin.js @@ -0,0 +1,68 @@ +var test = require("tap").test +var npmconf = require("../../lib/config/core.js") +var common = require("./00-config-setup.js") +var path = require("path") + +var ucData = common.ucData + +var envData = common.envData +var envDataFix = common.envDataFix + +var gcData = { "package-config:foo": "boo" } + +var biData = { "builtin-config": true } + +var cli = { foo: "bar", heading: "foo", "git-tag-version": false } + +var projectData = { + "save-prefix": "~", + "proprietary-attribs": false +} + +var expectList = [ + cli, + envDataFix, + projectData, + ucData, + gcData, + biData +] + +var expectSources = { + cli: { data: cli }, + env: { + data: envDataFix, + source: envData, + prefix: "" + }, + project: { + path: path.resolve(__dirname, "..", "..", ".npmrc"), + type: "ini", + data: projectData + }, + user: { + path: common.userconfig, + type: "ini", + data: ucData + }, + global: { + path: common.globalconfig, + type: "ini", + data: gcData + }, + builtin: { data: biData } +} + +test("with builtin", function (t) { + npmconf.load(cli, common.builtin, function (er, conf) { + if (er) throw er + t.same(conf.list, expectList) + t.same(conf.sources, expectSources) + t.same(npmconf.rootConf.list, []) + t.equal(npmconf.rootConf.root, npmconf.defs.defaults) + t.equal(conf.root, npmconf.defs.defaults) + t.equal(conf.get("heading"), "foo") + t.equal(conf.get("git-tag-version"), false) + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/config-certfile.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/config-certfile.js new file mode 100644 index 00000000..25de9963 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/config-certfile.js @@ -0,0 +1,18 @@ +require("./00-config-setup.js") + +var path = require("path") +var fs = require("fs") +var test = require("tap").test +var npmconf = require("../../lib/config/core.js") + +test("cafile loads as ca", function (t) { + var cafile = path.join(__dirname, "..", "fixtures", "config", "multi-ca") + + npmconf.load({cafile: cafile}, function (er, conf) { + if (er) throw er + + t.same(conf.get("cafile"), cafile) + t.same(conf.get("ca").join("\n"), fs.readFileSync(cafile, "utf8").trim()) + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/config-credentials.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/config-credentials.js new file mode 100644 index 00000000..c23be12f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/config-credentials.js @@ -0,0 +1,350 @@ +var test = require("tap").test + +var npmconf = require("../../lib/config/core.js") +var common = require("./00-config-setup.js") + +var URI = "https://registry.lvh.me:8661/" + +test("getting scope with no credentials set", function (t) { + npmconf.load({}, function (er, conf) { + t.ifError(er, "configuration loaded") + + var basic = conf.getCredentialsByURI(URI) + t.equal(basic.scope, "//registry.lvh.me:8661/", "nerfed URL extracted") + + t.end() + }) +}) + +test("trying to set credentials with no URI", function (t) { + npmconf.load(common.builtin, function (er, conf) { + t.ifError(er, "configuration loaded") + + t.throws(function () { + conf.setCredentialsByURI() + }, "enforced missing URI") + + t.end() + }) +}) + +test("trying to clear credentials with no URI", function (t) { + npmconf.load(common.builtin, function (er, conf) { + t.ifError(er, "configuration loaded") + + t.throws(function () { + conf.clearCredentialsByURI() + }, "enforced missing URI") + + t.end() + }) +}) + +test("set with missing credentials object", function (t) { + npmconf.load(common.builtin, function (er, conf) { + t.ifError(er, "configuration loaded") + + t.throws(function () { + conf.setCredentialsByURI(URI) + }, "enforced missing credentials") + + t.end() + }) +}) + +test("set with empty credentials object", function (t) { + npmconf.load(common.builtin, function (er, conf) { + t.ifError(er, "configuration loaded") + + t.throws(function () { + conf.setCredentialsByURI(URI, {}) + }, "enforced missing credentials") + + t.end() + }) +}) + +test("set with token", function (t) { + npmconf.load(common.builtin, function (er, conf) { + t.ifError(er, "configuration loaded") + + t.doesNotThrow(function () { + conf.setCredentialsByURI(URI, {token : "simple-token"}) + }, "needs only token") + + var expected = { + scope: '//registry.lvh.me:8661/', + token: 'simple-token', + username: undefined, + password: undefined, + email: undefined, + auth: undefined, + alwaysAuth: false + } + + t.same(conf.getCredentialsByURI(URI), expected, "got bearer token and scope") + + t.end() + }) +}) + +test("clear with token", function (t) { + npmconf.load(common.builtin, function (er, conf) { + t.ifError(er, "configuration loaded") + + t.doesNotThrow(function () { + conf.setCredentialsByURI(URI, {token : "simple-token"}) + }, "needs only token") + + t.doesNotThrow(function () { + conf.clearCredentialsByURI(URI) + }, "needs only URI") + + t.notOk(conf.getCredentialsByURI(URI).token, "token all gone") + + t.end() + }) +}) + +test("set with missing username", function (t) { + npmconf.load(common.builtin, function (er, conf) { + t.ifError(er, "configuration loaded") + + var credentials = { + password : "password", + email : "ogd@aoaioxxysz.net" + } + + t.throws(function () { + conf.setCredentialsByURI(URI, credentials) + }, "enforced missing email") + + t.end() + }) +}) + +test("set with missing password", function (t) { + npmconf.load(common.builtin, function (er, conf) { + t.ifError(er, "configuration loaded") + + var credentials = { + username : "username", + email : "ogd@aoaioxxysz.net" + } + + t.throws(function () { + conf.setCredentialsByURI(URI, credentials) + }, "enforced missing email") + + t.end() + }) +}) + +test("set with missing email", function (t) { + npmconf.load(common.builtin, function (er, conf) { + t.ifError(er, "configuration loaded") + + var credentials = { + username : "username", + password : "password" + } + + t.throws(function () { + conf.setCredentialsByURI(URI, credentials) + }, "enforced missing email") + + t.end() + }) +}) + +test("set with old-style credentials", function (t) { + npmconf.load(common.builtin, function (er, conf) { + t.ifError(er, "configuration loaded") + + var credentials = { + username : "username", + password : "password", + email : "ogd@aoaioxxysz.net" + } + + t.doesNotThrow(function () { + conf.setCredentialsByURI(URI, credentials) + }, "requires all of username, password, and email") + + var expected = { + scope : "//registry.lvh.me:8661/", + token : undefined, + username : "username", + password : "password", + email : "ogd@aoaioxxysz.net", + auth : "dXNlcm5hbWU6cGFzc3dvcmQ=", + alwaysAuth : false + } + + t.same(conf.getCredentialsByURI(URI), expected, "got credentials") + + t.end() + }) +}) + +test("clear with old-style credentials", function (t) { + npmconf.load(common.builtin, function (er, conf) { + t.ifError(er, "configuration loaded") + + var credentials = { + username : "username", + password : "password", + email : "ogd@aoaioxxysz.net" + } + + t.doesNotThrow(function () { + conf.setCredentialsByURI(URI, credentials) + }, "requires all of username, password, and email") + + t.doesNotThrow(function () { + conf.clearCredentialsByURI(URI) + }, "clearing only required URI") + + t.notOk(conf.getCredentialsByURI(URI).username, "username cleared") + t.notOk(conf.getCredentialsByURI(URI).password, "password cleared") + + t.end() + }) +}) + +test("get old-style credentials for default registry", function (t) { + npmconf.load(common.builtin, function (er, conf) { + var actual = conf.getCredentialsByURI(conf.get("registry")) + var expected = { + scope : "//registry.npmjs.org/", + token : undefined, + password : "password", + username : "username", + email : "i@izs.me", + auth : "dXNlcm5hbWU6cGFzc3dvcmQ=", + alwaysAuth : false + } + t.same(actual, expected) + t.end() + }) +}) + +test("set with always-auth enabled", function (t) { + npmconf.load(common.builtin, function (er, conf) { + t.ifError(er, "configuration loaded") + + var credentials = { + username : "username", + password : "password", + email : "ogd@aoaioxxysz.net", + alwaysAuth : true + } + + conf.setCredentialsByURI(URI, credentials) + + var expected = { + scope : "//registry.lvh.me:8661/", + token : undefined, + username : "username", + password : "password", + email : "ogd@aoaioxxysz.net", + auth : "dXNlcm5hbWU6cGFzc3dvcmQ=", + alwaysAuth : true + } + + t.same(conf.getCredentialsByURI(URI), expected, "got credentials") + + t.end() + }) +}) + +test("set with always-auth disabled", function (t) { + npmconf.load(common.builtin, function (er, conf) { + t.ifError(er, "configuration loaded") + + var credentials = { + username : "username", + password : "password", + email : "ogd@aoaioxxysz.net", + alwaysAuth : false + } + + conf.setCredentialsByURI(URI, credentials) + + var expected = { + scope : "//registry.lvh.me:8661/", + token : undefined, + username : "username", + password : "password", + email : "ogd@aoaioxxysz.net", + auth : "dXNlcm5hbWU6cGFzc3dvcmQ=", + alwaysAuth : false + } + + t.same(conf.getCredentialsByURI(URI), expected, "got credentials") + + t.end() + }) +}) + +test("set with global always-auth enabled", function (t) { + npmconf.load(common.builtin, function (er, conf) { + t.ifError(er, "configuration loaded") + var original = conf.get("always-auth") + conf.set("always-auth", true) + + var credentials = { + username : "username", + password : "password", + email : "ogd@aoaioxxysz.net" + } + + conf.setCredentialsByURI(URI, credentials) + + var expected = { + scope : "//registry.lvh.me:8661/", + token : undefined, + username : "username", + password : "password", + email : "ogd@aoaioxxysz.net", + auth : "dXNlcm5hbWU6cGFzc3dvcmQ=", + alwaysAuth : true + } + + t.same(conf.getCredentialsByURI(URI), expected, "got credentials") + + conf.set("always-auth", original) + t.end() + }) +}) + +test("set with global always-auth disabled", function (t) { + npmconf.load(common.builtin, function (er, conf) { + t.ifError(er, "configuration loaded") + var original = conf.get("always-auth") + conf.set("always-auth", false) + + var credentials = { + username : "username", + password : "password", + email : "ogd@aoaioxxysz.net" + } + + conf.setCredentialsByURI(URI, credentials) + + var expected = { + scope : "//registry.lvh.me:8661/", + token : undefined, + username : "username", + password : "password", + email : "ogd@aoaioxxysz.net", + auth : "dXNlcm5hbWU6cGFzc3dvcmQ=", + alwaysAuth : false + } + + t.same(conf.getCredentialsByURI(URI), expected, "got credentials") + + conf.set("always-auth", original) + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/config-edit.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/config-edit.js new file mode 100644 index 00000000..97a54d2e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/config-edit.js @@ -0,0 +1,72 @@ +var fs = require("fs") +var path = require("path") + +var mkdirp = require("mkdirp") +var rimraf = require("rimraf") +var test = require("tap").test +var common = require("../common-tap.js") + +var pkg = path.resolve(__dirname, "npm-global-edit") + +var editorSrc = function () {/* +#!/usr/bin/env node +var fs = require("fs") +if (fs.existsSync(process.argv[2])) { + console.log("success") +} else { + console.log("error") + process.exit(1) +} +*/}.toString().split("\n").slice(1, -1).join("\n") +var editorPath = path.join(pkg, "editor") + +test("setup", function (t) { + cleanup(function (er) { + t.ifError(er, "old directory removed") + + mkdirp(pkg, "0777", function (er) { + fs.writeFileSync(editorPath, editorSrc) + fs.chmodSync(editorPath, "0777") + t.ifError(er, "created package directory correctly") + t.end() + }) + }) +}) + +test("saving configs", function (t) { + var opts = { + cwd: pkg, + env: { + PATH: process.env.PATH, + EDITOR: editorPath + } + } + common.npm( + [ + "config", + "--prefix", pkg, + "--global", + "edit" + ], + opts, + function (err, code, stdout, stderr) { + t.ifError(err, "command ran without issue") + + t.equal(stderr, "", "got nothing on stderr") + t.equal(code, 0, "exit ok") + t.equal(stdout, "success\n", "got success message") + t.end() + } + ) +}) + +test("cleanup", function (t) { + cleanup(function (er) { + t.ifError(er, "test directory removed OK") + t.end() + }) +}) + +function cleanup (cb) { + rimraf(pkg, cb) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/config-malformed.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/config-malformed.js new file mode 100644 index 00000000..04502214 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/config-malformed.js @@ -0,0 +1,14 @@ +var test = require('tap').test + +var npmconf = require("../../lib/config/core.js") +var common = require("./00-config-setup.js") + +test('with malformed', function (t) { + npmconf.load({}, common.malformed, function (er, conf) { + t.ok(er, 'Expected parse error') + if (!(er && /Failed parsing JSON config key email/.test(er.message))) { + throw er + } + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/config-meta.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/config-meta.js new file mode 100644 index 00000000..3da27a87 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/config-meta.js @@ -0,0 +1,128 @@ +// this is a weird meta test. It verifies that all the instances of +// `npm.config.get(...)` are: +// a) Simple strings, and not variables +// b) Documented +// c) Defined in the `npmconf` package. + +var test = require("tap").test +var fs = require("fs") +var path = require("path") +var root = path.resolve(__dirname, "..", "..") +var lib = path.resolve(root, "lib") +var nm = path.resolve(root, "node_modules") +var doc = path.resolve(root, "doc/misc/npm-config.md") +var FILES = [] +var CONFS = {} +var DOC = {} + +var exceptions = [ + path.resolve(lib, "adduser.js"), + path.resolve(lib, "config.js"), + path.resolve(lib, "publish.js"), + path.resolve(lib, "utils", "lifecycle.js"), + path.resolve(lib, "utils", "map-to-registry.js"), + path.resolve(nm, "npm-registry-client", "lib", "publish.js"), + path.resolve(nm, "npm-registry-client", "lib", "request.js") +] + +test("get files", function (t) { + walk(nm) + walk(lib) + t.pass("got files") + t.end() + + function walk(lib) { + var files = fs.readdirSync(lib).map(function (f) { + return path.resolve(lib, f) + }) + files.forEach(function (f) { + try { + var s = fs.lstatSync(f) + } catch (er) { + return + } + if (s.isDirectory()) + walk(f) + else if (f.match(/\.js$/)) + FILES.push(f) + }) + } +}) + +test("get lines", function (t) { + FILES.forEach(function (f) { + var lines = fs.readFileSync(f, "utf8").split(/\r|\n/) + lines.forEach(function (l, i) { + var matches = l.split(/conf(?:ig)?\.get\(/g) + matches.shift() + matches.forEach(function (m) { + m = m.split(")").shift() + var literal = m.match(/^['"].+?['"]/) + if (literal) { + m = literal[0].slice(1, -1) + if (!m.match(/^\_/) && m !== "argv") + CONFS[m] = { + file: f, + line: i + } + } else if (exceptions.indexOf(f) === -1) { + t.fail("non-string-literal config used in " + f + ":" + i) + } + }) + }) + }) + t.pass("got lines") + t.end() +}) + +test("get docs", function (t) { + var d = fs.readFileSync(doc, "utf8").split(/\r|\n/) + // walk down until the "## Config Settings" section + for (var i = 0; i < d.length && d[i] !== "## Config Settings"; i++); + i++ + // now gather up all the ^###\s lines until the next ^##\s + for (; i < d.length && !d[i].match(/^## /); i++) { + if (d[i].match(/^### /)) + DOC[ d[i].replace(/^### /, "").trim() ] = true + } + t.pass("read the docs") + t.end() +}) + +test("check configs", function (t) { + var defs = require("../../lib/config/defaults.js") + var types = Object.keys(defs.types) + var defaults = Object.keys(defs.defaults) + for (var c1 in CONFS) { + if (CONFS[c1].file.indexOf(lib) === 0) { + t.ok(DOC[c1], "should be documented " + c1 + " " + + CONFS[c1].file + ":" + CONFS[c1].line) + t.ok(types.indexOf(c1) !== -1, "should be defined in npmconf " + c1) + t.ok(defaults.indexOf(c1) !== -1, "should have default in npmconf " + c1) + } + } + + for (var c2 in DOC) { + if (c2 !== "versions" && c2 !== "version" && c2 !== "init.version") { + t.ok(CONFS[c2], "config in doc should be used somewhere " + c2) + t.ok(types.indexOf(c2) !== -1, "should be defined in npmconf " + c2) + t.ok(defaults.indexOf(c2) !== -1, "should have default in npmconf " + c2) + } + } + + types.forEach(function (c) { + if (!c.match(/^\_/) && c !== "argv" && !c.match(/^versions?$/)) { + t.ok(DOC[c], "defined type should be documented " + c) + t.ok(CONFS[c], "defined type should be used " + c) + } + }) + + defaults.forEach(function (c) { + if (!c.match(/^\_/) && c !== "argv" && !c.match(/^versions?$/)) { + t.ok(DOC[c], "defaulted type should be documented " + c) + t.ok(CONFS[c], "defaulted type should be used " + c) + } + }) + + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/config-new-cafile.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/config-new-cafile.js new file mode 100644 index 00000000..9cffb190 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/config-new-cafile.js @@ -0,0 +1,56 @@ +require('./00-config-setup.js') + +var path = require('path') +var fs = require('graceful-fs') +var test = require('tap').test +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var osenv = require('osenv') +var npmconf = require('../../lib/config/core.js') + +var dir = path.resolve(__dirname, 'config-new-cafile') +var beep = path.resolve(dir, 'beep.pem') + +test('setup', function (t) { + bootstrap() + t.end() +}) + +test('can set new cafile when old is gone', function (t) { + t.plan(5) + npmconf.load(function (error, conf) { + npmconf.loaded = false + t.ifError(error) + conf.set('cafile', beep, 'user') + conf.save('user', function (error) { + t.ifError(error) + t.equal(conf.get('cafile'), beep) + rimraf.sync(beep) + npmconf.load(function (error, conf) { + if (error) { + throw error + } + t.equal(conf.get('cafile'), beep) + conf.del('cafile') + conf.save('user', function (error) { + t.ifError(error) + }) + }) + }) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function bootstrap () { + mkdirp.sync(dir) + fs.writeFileSync(beep, '') +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(dir) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/config-private.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/config-private.js new file mode 100644 index 00000000..37e283ee --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/config-private.js @@ -0,0 +1,81 @@ +var fs = require("fs") +var path = require("path") +var test = require("tap").test +var rimraf = require("rimraf") +var mkdirp = require("mkdirp") +var common = require("../common-tap.js") + +var pkg = path.resolve(__dirname, "config-private") +var opts = { cwd: pkg } + +test("setup", function (t) { + rimraf.sync(pkg) + mkdirp.sync(pkg) + t.end() +}) + +test("config get private var (old auth)", function (t) { + common.npm([ + "config", + "get", + "_auth" + ], + opts, + function (err, code, stdout, stderr) { + t.ifError(err) + + t.similar(stderr, /sekretz/, "password blocked on stderr") + t.equal(stdout, "", "no output") + t.end() + } + ) +}) + +test("config get private var (new auth)", function (t) { + common.npm([ + "config", + "get", + "//registry.npmjs.org/:_password" + ], + opts, + function (err, code, stdout, stderr) { + t.ifError(err) + + t.similar(stderr, /sekretz/, "password blocked on stderr") + t.equal(stdout, "", "no output") + t.end() + } + ) +}) + +test("config get public var (new username)", function (t) { + var FIXTURE_PATH = path.resolve(pkg, "fixture_npmrc") + var s = "//registry.lvh.me/:username = wombat\n" + + "//registry.lvh.me/:_password = YmFkIHBhc3N3b3Jk\n" + + "//registry.lvh.me/:email = lindsay@wdu.org.au\n" + fs.writeFileSync(FIXTURE_PATH, s, "ascii") + fs.chmodSync(FIXTURE_PATH, "0444") + + common.npm( + [ + "config", + "get", + "//registry.lvh.me/:username", + "--userconfig=" + FIXTURE_PATH, + "--registry=http://registry.lvh.me/" + ], + opts, + function (err, code, stdout, stderr) { + t.ifError(err) + + t.equal(stderr, "", "stderr is empty") + t.equal(stdout, "wombat\n", "got usename is output") + t.end() + } + ) +}) + +test("clean", function (t) { + rimraf.sync(pkg) + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/config-project.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/config-project.js new file mode 100644 index 00000000..337355bf --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/config-project.js @@ -0,0 +1,66 @@ +var test = require("tap").test +var path = require("path") +var fix = path.resolve(__dirname, "..", "fixtures", "config") +var projectRc = path.resolve(fix, ".npmrc") +var npmconf = require("../../lib/config/core.js") +var common = require("./00-config-setup.js") + +var projectData = { just: "testing" } + +var ucData = common.ucData +var envData = common.envData +var envDataFix = common.envDataFix + +var gcData = { "package-config:foo": "boo" } + +var biData = {} + +var cli = { foo: "bar", umask: 022, prefix: fix } + +var expectList = [ + cli, + envDataFix, + projectData, + ucData, + gcData, + biData +] + +var expectSources = { + cli: { data: cli }, + env: { + data: envDataFix, + source: envData, + prefix: "" + }, + project: { + path: projectRc, + type: "ini", + data: projectData + }, + user: { + path: common.userconfig, + type: "ini", + data: ucData + }, + global: { + path: common.globalconfig, + type: "ini", + data: gcData + }, + builtin: { data: biData } +} + +test("no builtin", function (t) { + npmconf.load(cli, function (er, conf) { + if (er) throw er + t.same(conf.list, expectList) + t.same(conf.sources, expectSources) + t.same(npmconf.rootConf.list, []) + t.equal(npmconf.rootConf.root, npmconf.defs.defaults) + t.equal(conf.root, npmconf.defs.defaults) + t.equal(conf.get("umask"), 022) + t.equal(conf.get("heading"), "npm") + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/config-save.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/config-save.js new file mode 100644 index 00000000..88526a38 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/config-save.js @@ -0,0 +1,88 @@ +var fs = require("fs") +var ini = require("ini") +var test = require("tap").test +var npmconf = require("../../lib/config/core.js") +var common = require("./00-config-setup.js") + +var expectConf = [ + "globalconfig = " + common.globalconfig, + "email = i@izs.me", + "env-thing = asdf", + "init.author.name = Isaac Z. Schlueter", + "init.author.email = i@izs.me", + "init.author.url = http://blog.izs.me/", + "init.version = 1.2.3", + "proprietary-attribs = false", + "npm:publishtest = true", + "_npmjs.org:couch = https://admin:password@localhost:5984/registry", + "npm-www:nocache = 1", + "sign-git-tag = false", + "message = v%s", + "strict-ssl = false", + "_auth = dXNlcm5hbWU6cGFzc3dvcmQ=", + "", + "[_token]", + "AuthSession = yabba-dabba-doodle", + "version = 1", + "expires = 1345001053415", + "path = /", + "httponly = true", + "" +].join("\n") + +var expectFile = [ + "globalconfig = " + common.globalconfig, + "email = i@izs.me", + "env-thing = asdf", + "init.author.name = Isaac Z. Schlueter", + "init.author.email = i@izs.me", + "init.author.url = http://blog.izs.me/", + "init.version = 1.2.3", + "proprietary-attribs = false", + "npm:publishtest = true", + "_npmjs.org:couch = https://admin:password@localhost:5984/registry", + "npm-www:nocache = 1", + "sign-git-tag = false", + "message = v%s", + "strict-ssl = false", + "_auth = dXNlcm5hbWU6cGFzc3dvcmQ=", + "", + "[_token]", + "AuthSession = yabba-dabba-doodle", + "version = 1", + "expires = 1345001053415", + "path = /", + "httponly = true", + "" +].join("\n") + +test("saving configs", function (t) { + npmconf.load(function (er, conf) { + if (er) + throw er + conf.set("sign-git-tag", false, "user") + conf.del("nodedir") + conf.del("tmp") + var foundConf = ini.stringify(conf.sources.user.data) + t.same(ini.parse(foundConf), ini.parse(expectConf)) + fs.unlinkSync(common.userconfig) + conf.save("user", function (er) { + if (er) + throw er + var uc = fs.readFileSync(conf.get("userconfig"), "utf8") + t.same(ini.parse(uc), ini.parse(expectFile)) + t.end() + }) + }) +}) + +test("setting prefix", function (t) { + npmconf.load(function (er, conf) { + if (er) + throw er + + conf.prefix = "newvalue" + t.same(conf.prefix, "newvalue") + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/correct-mkdir.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/correct-mkdir.js new file mode 100644 index 00000000..a4f86598 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/correct-mkdir.js @@ -0,0 +1,163 @@ +var test = require('tap').test +var assert = require('assert') +var path = require('path') +var requireInject = require('require-inject') +var cache_dir = path.resolve(__dirname, 'correct-mkdir') + +test('correct-mkdir: no race conditions', function (t) { + var mock_fs = {} + var did_hook = false + mock_fs.stat = function (path, cb) { + if (path === cache_dir) { + // Return a non-matching owner + cb(null, { + uid: +process.uid + 1, + isDirectory: function () { + return true + } + }) + if (!did_hook) { + did_hook = true + doHook() + } + } else { + assert.ok(false, 'Unhandled stat path: ' + path) + } + } + var chown_in_progress = 0 + var mock_chownr = function (path, uid, gid, cb) { + ++chown_in_progress + process.nextTick(function () { + --chown_in_progress + cb(null) + }) + } + var mocks = { + 'graceful-fs': mock_fs, + 'chownr': mock_chownr + } + var correctMkdir = requireInject('../../lib/utils/correct-mkdir.js', mocks) + + var calls_in_progress = 3 + function handleCallFinish () { + t.equal(chown_in_progress, 0, 'should not return while chown still in progress') + if (!--calls_in_progress) { + t.end() + } + } + function doHook () { + // This is fired during the first correctMkdir call, after the stat has finished + // but before the chownr has finished + // Buggy old code will fail and return a cached value before initial call is done + correctMkdir(cache_dir, handleCallFinish) + } + // Initial call + correctMkdir(cache_dir, handleCallFinish) + // Immediate call again in case of race condition there + correctMkdir(cache_dir, handleCallFinish) +}) + +test('correct-mkdir: ignore ENOENTs from chownr', function (t) { + var mock_fs = {} + mock_fs.stat = function (path, cb) { + if (path === cache_dir) { + cb(null, { + isDirectory: function () { + return true + } + }) + } else { + assert.ok(false, 'Unhandled stat path: ' + path) + } + } + var mock_chownr = function (path, uid, gid, cb) { + cb({code: 'ENOENT'}) + } + var mocks = { + 'graceful-fs': mock_fs, + 'chownr': mock_chownr + } + var correctMkdir = requireInject('../../lib/utils/correct-mkdir.js', mocks) + + function handleCallFinish (err) { + t.ifErr(err, 'chownr\'s ENOENT errors were ignored') + t.end() + } + correctMkdir(cache_dir, handleCallFinish) +}) + +// NEED TO RUN LAST + +// These test checks that Windows users are protected by crashes related to +// unexpectedly having a UID/GID other than 0 if a user happens to add these +// variables to their environment. There are assumptions in correct-mkdir +// that special-case Windows by checking on UID-related things. +test('correct-mkdir: SUDO_UID and SUDO_GID non-Windows', function (t) { + process.env.SUDO_UID = 999 + process.env.SUDO_GID = 999 + process.getuid = function () { return 0 } + process.getgid = function () { return 0 } + var mock_fs = {} + mock_fs.stat = function (path, cb) { + if (path === cache_dir) { + cb(null, { + uid: 0, + isDirectory: function () { + return true + } + }) + } else { + assert.ok(false, 'Unhandled stat path: ' + path) + } + } + var mock_chownr = function (path, uid, gid, cb) { + t.is(uid, +process.env.SUDO_UID, 'using the environment\'s UID') + t.is(gid, +process.env.SUDO_GID, 'using the environment\'s GID') + cb(null, {}) + } + var mocks = { + 'graceful-fs': mock_fs, + 'chownr': mock_chownr + } + var correctMkdir = requireInject('../../lib/utils/correct-mkdir.js', mocks) + + function handleCallFinish () { + t.end() + } + correctMkdir(cache_dir, handleCallFinish) +}) + +test('correct-mkdir: SUDO_UID and SUDO_GID Windows', function (t) { + process.env.SUDO_UID = 999 + process.env.SUDO_GID = 999 + delete process.getuid + delete process.getgid + var mock_fs = {} + mock_fs.stat = function (path, cb) { + if (path === cache_dir) { + cb(null, { + uid: 0, + isDirectory: function () { + return true + } + }) + } else { + assert.ok(false, 'Unhandled stat path: ' + path) + } + } + var mock_chownr = function (path, uid, gid, cb) { + t.fail('chownr should not be called at all on Windows') + cb('nope') + } + var mocks = { + 'graceful-fs': mock_fs, + 'chownr': mock_chownr + } + var correctMkdir = requireInject('../../lib/utils/correct-mkdir.js', mocks) + + function handleCallFinish (err) { + t.ifErr(err, 'chownr was not called because Windows') + t.end() + } + correctMkdir(cache_dir, handleCallFinish) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/dedupe-scoped.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/dedupe-scoped.js new file mode 100644 index 00000000..a093e1f8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/dedupe-scoped.js @@ -0,0 +1,147 @@ +var fs = require('fs') +var join = require('path').join + +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') +var pkg = join(__dirname, 'dedupe-scoped') +var modules = join(pkg, 'node_modules') + +var EXEC_OPTS = { cwd: pkg } + +var prolog = 'dedupe@0.0.0 ' + pkg +var body = function () {/* +├─┬ first@1.0.0 +│ └── @scope/shared@2.1.6 +└─┬ second@2.0.0 + └── @scope/shared@2.1.6 +*/}.toString().split('\n').slice(1, -1) + +var deduper = { + 'name': 'dedupe', + 'version': '0.0.0', + 'dependencies': { + 'first': '1.0.0', + 'second': '2.0.0' + } +} + +var first = { + 'name': 'first', + 'version': '1.0.0', + 'dependencies': { + 'firstUnique': '0.6.0', + '@scope/shared': '2.1.6' + } +} + +var second = { + 'name': 'second', + 'version': '2.0.0', + 'dependencies': { + 'secondUnique': '1.2.0', + '@scope/shared': '2.1.6' + } +} + +var shared = { + 'name': '@scope/shared', + 'version': '2.1.6' +} + +var firstUnique = { + 'name': 'firstUnique', + 'version': '0.6.0' +} + +var secondUnique = { + 'name': 'secondUnique', + 'version': '1.2.0' +} + + +test('setup', function (t) { + setup() + t.end() +}) + +// we like the cars +function ltrimm (l) { return l.trim() } + +test('dedupe finds the common scoped modules and moves it up one level', function (t) { + common.npm( + [ + 'find-dupes' // I actually found a use for this command! + ], + EXEC_OPTS, + function (err, code, stdout, stderr) { + t.ifError(err, 'successful dry run against fake install') + t.notOk(code, 'npm ran without issue') + t.notOk(stderr, 'npm printed no errors') + t.same( + stdout.trim().split('\n').map(ltrimm), + [prolog].concat(body).map(ltrimm), + 'got expected output' + ) + + t.end() + } + ) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function setup (cb) { + cleanup() + + mkdirp.sync(pkg) + fs.writeFileSync( + join(pkg, 'package.json'), + JSON.stringify(deduper, null, 2) + ) + + mkdirp.sync(join(modules, 'first')) + fs.writeFileSync( + join(modules, 'first', 'package.json'), + JSON.stringify(first, null, 2) + ) + + mkdirp.sync(join(modules, 'first', 'node_modules', 'firstUnique')) + fs.writeFileSync( + join(modules, 'first', 'node_modules', 'firstUnique', 'package.json'), + JSON.stringify(firstUnique, null, 2) + ) + + mkdirp.sync(join(modules, 'first', 'node_modules', '@scope', 'shared')) + fs.writeFileSync( + join(modules, 'first', 'node_modules', '@scope', 'shared', 'package.json'), + JSON.stringify(shared, null, 2) + ) + + mkdirp.sync(join(modules, 'second')) + fs.writeFileSync( + join(modules, 'second', 'package.json'), + JSON.stringify(second, null, 2) + ) + + mkdirp.sync(join(modules, 'second', 'node_modules', 'secondUnique')) + fs.writeFileSync( + join(modules, 'second', 'node_modules', 'secondUnique', 'package.json'), + JSON.stringify(secondUnique, null, 2) + ) + + mkdirp.sync(join(modules, 'second', 'node_modules', '@scope', 'shared')) + fs.writeFileSync( + join(modules, 'second', 'node_modules', '@scope', 'shared', 'package.json'), + JSON.stringify(shared, null, 2) + ) +} + +function cleanup () { + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/dedupe.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/dedupe.js new file mode 100644 index 00000000..7b80102b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/dedupe.js @@ -0,0 +1,86 @@ +var fs = require('graceful-fs') +var path = require('path') +var existsSync = fs.existsSync || path.existsSync + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') +var server + +var pkg = path.join(__dirname, 'dedupe') + +var EXEC_OPTS = { cwd: pkg } + +var json = { + author: 'Dedupe tester', + name: 'dedupe', + version: '0.0.0', + dependencies: { + optimist: '0.6.0', + clean: '2.1.6' + } +} + +test('setup', function (t) { + t.comment('test for https://github.com/npm/npm/issues/4675') + setup(function () { + t.end() + }) +}) + +test('dedupe finds the common module and moves it up one level', function (t) { + common.npm( + [ + '--registry', common.registry, + 'install', '.' + ], + EXEC_OPTS, + function (err, code) { + t.ifError(err, 'successfully installed directory') + t.equal(code, 0, 'npm install exited with code') + common.npm( + [ + 'dedupe' + ], + EXEC_OPTS, + function (err, code) { + t.ifError(err, 'successfully deduped against previous install') + t.notOk(code, 'npm dedupe exited with code') + + t.ok(existsSync(path.join(pkg, 'node_modules', 'minimist'))) + t.notOk(existsSync(path.join(pkg, 'node_modules', 'checker'))) + + t.end() + } + ) + }) +}) + +test('cleanup', function (t) { + server.close() + cleanup() + + t.end() +}) + +function cleanup () { + rimraf.sync(pkg) +} + +function setup (cb) { + cleanup() + mkdirp.sync(path.join(pkg, 'node_modules')) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + process.chdir(pkg) + + mr({ port: common.port }, function (er, s) { + server = s + cb() + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/deprecate.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/deprecate.js new file mode 100644 index 00000000..c1d6e45a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/deprecate.js @@ -0,0 +1,163 @@ +var fs = require('fs') +var path = require('path') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var mr = require('npm-registry-mock') +var semver = require('semver') + +var test = require('tap').test +var common = require('../common-tap.js') + +var pkg = path.resolve(__dirname, 'deprecate') +var server + +var cache = { + '_id': 'cond', + '_rev': '19-d458a706de1740662cd7728d7d7ddf07', + 'name': 'cond', + 'time': { + 'modified': '2015-02-13T07:33:58.120Z', + 'created': '2014-03-16T20:52:52.236Z', + '0.0.0': '2014-03-16T20:52:52.236Z', + '0.0.1': '2014-03-16T21:12:33.393Z', + '0.0.2': '2014-03-16T21:15:25.430Z' + }, + 'versions': { + '0.0.0': {}, + '0.0.1': {}, + '0.0.2': {} + }, + 'dist-tags': { + 'latest': '0.0.2' + }, + 'description': 'Restartable error handling system', + 'license': 'CC0' +} + +test('setup', function (t) { + mr({port: common.port}, function (err, s) { + t.ifError(err, 'registry mocked successfully') + server = s + t.ok(true) + t.end() + }) +}) + +test('npm deprecate an unscoped package', function (t) { + var deprecated = JSON.parse(JSON.stringify(cache)) + deprecated.versions = { + '0.0.0': {}, + '0.0.1': { deprecated: 'make it dead' }, + '0.0.2': {} + } + server.get('/cond?write=true').reply(200, cache) + server.put('/cond', deprecated).reply(201, { deprecated: true }) + common.npm([ + 'deprecate', + 'cond@0.0.1', + 'make it dead', + '--registry', common.registry, + '--loglevel', 'silent' + ], {}, + function (er, code, stdout, stderr) { + t.ifError(er, 'npm deprecate') + t.equal(stderr, '', 'no error output') + t.equal(code, 0, 'exited OK') + t.end() + }) +}) + +test('npm deprecate a scoped package', function (t) { + var cacheCopy = JSON.parse(JSON.stringify(cache)) + cacheCopy.name = '@scope/cond' + cacheCopy._id = '@scope/cond' + var deprecated = JSON.parse(JSON.stringify(cacheCopy)) + deprecated.versions = { + '0.0.0': {}, + '0.0.1': { deprecated: 'make it dead' }, + '0.0.2': {} + } + server.get('/@scope%2fcond?write=true').reply(200, cacheCopy) + server.put('/@scope%2fcond', deprecated).reply(201, { deprecated: true }) + common.npm([ + 'deprecate', + '@scope/cond@0.0.1', + 'make it dead', + '--registry', common.registry, + '--loglevel', 'silent' + ], {}, + function (er, code, stdout, stderr) { + t.ifError(er, 'npm deprecate') + t.equal(stderr, '', 'no error output') + t.equal(code, 0, 'exited OK') + t.end() + }) +}) + +test('npm deprecate semver range', function (t) { + var deprecated = JSON.parse(JSON.stringify(cache)) + deprecated.versions = { + '0.0.0': { deprecated: 'make it dead' }, + '0.0.1': { deprecated: 'make it dead' }, + '0.0.2': {} + } + server.get('/cond?write=true').reply(200, cache) + server.put('/cond', deprecated).reply(201, { deprecated: true }) + common.npm([ + 'deprecate', + 'cond@<0.0.2', + 'make it dead', + '--registry', common.registry, + '--loglevel', 'silent' + ], {}, + function (er, code, stdout, stderr) { + t.ifError(er, 'npm deprecate') + t.equal(stderr, '', 'no error output') + t.equal(code, 0, 'exited OK') + t.end() + }) +}) + +test('npm deprecate bad semver range', function (t) { + common.npm([ + 'deprecate', + 'cond@-9001', + 'make it dead', + '--registry', common.registry + ], {}, + function (er, code, stdout, stderr) { + t.equal(code, 1, 'errored') + t.match(stderr, /invalid version range/, 'bad semver') + t.end() + }) +}) + +test('npm deprecate a package with no semver range', function (t) { + var deprecated = JSON.parse(JSON.stringify(cache)) + deprecated.versions = { + '0.0.0': { deprecated: 'make it dead' }, + '0.0.1': { deprecated: 'make it dead' }, + '0.0.2': { deprecated: 'make it dead' } + } + server.get('/cond?write=true').reply(200, cache) + server.put('/cond', deprecated).reply(201, { deprecated: true }) + common.npm([ + 'deprecate', + 'cond', + 'make it dead', + '--registry', common.registry, + '--loglevel', 'silent' + ], {}, + function (er, code, stdout, stderr) { + t.ifError(er, 'npm deprecate') + t.equal(stderr, '', 'no error output') + t.equal(code, 0, 'exited OK') + t.end() + }) +}) + +test('cleanup', function (t) { + server.close() + t.ok(true) + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/dist-tag.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/dist-tag.js new file mode 100644 index 00000000..08a5ca43 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/dist-tag.js @@ -0,0 +1,195 @@ +var fs = require("fs") +var path = require("path") +var mkdirp = require("mkdirp") +var rimraf = require("rimraf") +var mr = require("npm-registry-mock") + +var test = require("tap").test +var common = require("../common-tap.js") + +var pkg = path.resolve(__dirname, "dist-tag") +var server + +var scoped = { + name : "@scoped/pkg", + version : "1.1.1" +} + +function mocks (server) { + // ls current package + server.get("/-/package/@scoped%2fpkg/dist-tags") + .reply(200, { latest : "1.0.0", a : "0.0.1", b : "0.5.0" }) + + // ls named package + server.get("/-/package/@scoped%2fanother/dist-tags") + .reply(200, { latest : "2.0.0", a : "0.0.2", b : "0.6.0" }) + + // add c + server.get("/-/package/@scoped%2fanother/dist-tags") + .reply(200, { latest : "2.0.0", a : "0.0.2", b : "0.6.0" }) + server.put("/-/package/@scoped%2fanother/dist-tags/c", "\"7.7.7\"") + .reply(200, { latest : "7.7.7", a : "0.0.2", b : "0.6.0", c : "7.7.7" }) + + // set same version + server.get("/-/package/@scoped%2fanother/dist-tags") + .reply(200, { latest : "2.0.0", b : "0.6.0" }) + + // rm + server.get("/-/package/@scoped%2fanother/dist-tags") + .reply(200, { latest : "2.0.0", a : "0.0.2", b : "0.6.0", c : "7.7.7" }) + server.delete("/-/package/@scoped%2fanother/dist-tags/c") + .reply(200, { c : "7.7.7" }) + + // rm + server.get("/-/package/@scoped%2fanother/dist-tags") + .reply(200, { latest : "4.0.0" }) +} + +test("setup", function (t) { + mkdirp(pkg, function (er) { + t.ifError(er, pkg + " made successfully") + + mr({port : common.port, plugin : mocks}, function (er, s) { + server = s + + fs.writeFile( + path.join(pkg, "package.json"), + JSON.stringify(scoped), + function (er) { + t.ifError(er, "wrote package.json") + t.end() + } + ) + }) + }) +}) + +test("npm dist-tags ls in current package", function (t) { + common.npm( + [ + "dist-tags", "ls", + "--registry", common.registry, + "--loglevel", "silent" + ], + { cwd : pkg }, + function (er, code, stdout, stderr) { + t.ifError(er, "npm access") + t.notOk(code, "exited OK") + t.notOk(stderr, "no error output") + t.equal(stdout, "a: 0.0.1\nb: 0.5.0\nlatest: 1.0.0\n") + + t.end() + } + ) +}) + +test("npm dist-tags ls on named package", function (t) { + common.npm( + [ + "dist-tags", + "ls", "@scoped/another", + "--registry", common.registry, + "--loglevel", "silent" + ], + { cwd : pkg }, + function (er, code, stdout, stderr) { + t.ifError(er, "npm access") + t.notOk(code, "exited OK") + t.notOk(stderr, "no error output") + t.equal(stdout, "a: 0.0.2\nb: 0.6.0\nlatest: 2.0.0\n") + + t.end() + } + ) +}) + +test("npm dist-tags add @scoped/another@7.7.7 c", function (t) { + common.npm( + [ + "dist-tags", + "add", "@scoped/another@7.7.7", "c", + "--registry", common.registry, + "--loglevel", "silent" + ], + { cwd : pkg }, + function (er, code, stdout, stderr) { + t.ifError(er, "npm access") + t.notOk(code, "exited OK") + t.notOk(stderr, "no error output") + t.equal(stdout, "+c: @scoped/another@7.7.7\n") + + t.end() + } + ) +}) + +test("npm dist-tags set same version", function (t) { + common.npm( + [ + "dist-tag", + "set", "@scoped/another@0.6.0", "b", + "--registry", common.registry, + "--loglevel", "warn" + ], + { cwd : pkg }, + function (er, code, stdout, stderr) { + t.ifError(er, "npm access") + t.notOk(code, "exited OK") + t.equal( + stderr, + "npm WARN dist-tag add b is already set to version 0.6.0\n", + "warned about setting same version" + ) + t.notOk(stdout, "only expecting warning message") + + t.end() + } + ) +}) + +test("npm dist-tags rm @scoped/another c", function (t) { + common.npm( + [ + "dist-tags", + "rm", "@scoped/another", "c", + "--registry", common.registry, + "--loglevel", "silent" + ], + { cwd : pkg }, + function (er, code, stdout, stderr) { + t.ifError(er, "npm access") + t.notOk(code, "exited OK") + t.notOk(stderr, "no error output") + t.equal(stdout, "-c: @scoped/another@7.7.7\n") + + t.end() + } + ) +}) + +test("npm dist-tags rm @scoped/another nonexistent", function (t) { + common.npm( + [ + "dist-tags", + "rm", "@scoped/another", "nonexistent", + "--registry", common.registry, + "--loglevel", "silent" + ], + { cwd : pkg }, + function (er, code, stdout, stderr) { + t.ifError(er, "npm dist-tag") + t.ok(code, "expecting nonzero exit code") + t.notOk(stderr, "no error output") + t.notOk(stdout, "not expecting output") + + t.end() + } + ) +}) + +test("cleanup", function (t) { + t.pass("cleaned up") + rimraf.sync(pkg) + server.close() + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/false-name.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/false-name.js new file mode 100644 index 00000000..c98a5103 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/false-name.js @@ -0,0 +1,85 @@ +// this is a test for fix #2538 + +// the false_name-test-package has the name property 'test-package' set +// in the package.json and a dependency named 'test-package' is also a +// defined dependency of 'test-package-with-one-dep'. +// +// this leads to a conflict during installation and the fix is covered +// by this test + +var fs = require('graceful-fs') +var path = require('path') +var existsSync = fs.existsSync || path.existsSync + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var pkg = path.join(__dirname, 'false-name') +var cache = path.join(pkg, 'cache') +var server + +var EXEC_OPTS = { cwd: pkg } + +var indexContent = 'module.exports = true\n' +var json = { + name: 'test-package', + version: '0.0.0', + main: 'index.js', + dependencies: { + 'test-package-with-one-dep': '0.0.0' + } +} + +test('setup', function (t) { + t.comment('test for https://github.com/npm/npm/issues/2538') + setup() + mr({ port: common.port }, function (er, s) { + server = s + t.end() + }) +}) + +test('not every pkg.name can be required', function (t) { + common.npm( + [ + 'install', '.', + '--cache', cache, + '--registry', common.registry + ], + EXEC_OPTS, + function (err, code) { + t.ifErr(err, 'install finished without error') + t.equal(code, 0, 'install exited ok') + t.ok(existsSync(path.join( + pkg, + 'node_modules/test-package-with-one-dep', + 'node_modules/test-package' + )), 'package installed OK') + t.end() + } + ) +}) + +test('cleanup', function (t) { + server.close() + cleanup() + t.end() +}) + +function cleanup () { + rimraf.sync(pkg) +} + +function setup () { + cleanup() + mkdirp.sync(cache) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + fs.writeFileSync(path.join(pkg, 'index.js'), indexContent) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/files-and-ignores.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/files-and-ignores.js new file mode 100644 index 00000000..02371cfe --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/files-and-ignores.js @@ -0,0 +1,558 @@ +'use strict' +var test = require('tap').test +var common = require('../common-tap.js') +var path = require('path') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var fs = require('graceful-fs') +var basepath = path.resolve(__dirname, path.basename(__filename, '.js')) +var fixturepath = path.resolve(basepath, 'npm-test-files') +var modulepath = path.resolve(basepath, 'node_modules') +var installedpath = path.resolve(modulepath, 'npm-test-files') +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir + +test('basic file inclusion', function (t) { + var fixture = new Tacks( + Dir({ + 'package.json': File({ + name: 'npm-test-files', + version: '1.2.5', + files: [ + 'include', + 'sub/include' + ] + }), + include: File(''), + sub: Dir({ include: File('') }), + notincluded: File('') + }) + ) + withFixture(t, fixture, function (done) { + t.ok(fileExists('include'), 'toplevel file included') + t.ok(fileExists('sub/include'), 'nested file included') + t.notOk(fileExists('notincluded'), 'unspecified file not included') + done() + }) +}) + +test('basic file exclusion', function (t) { + var fixture = new Tacks( + Dir({ + 'package.json': File({ + name: 'npm-test-files', + version: '1.2.5' + }), + '.npmignore': File( + 'ignore\n' + + 'sub/ignore\n' + ), + include: File(''), + ignore: File(''), + sub: Dir({ ignore: File('') }) + }) + ) + withFixture(t, fixture, function (done) { + t.notOk(fileExists('ignore'), 'toplevel file excluded') + t.notOk(fileExists('sub/ignore'), 'nested file excluded') + t.ok(fileExists('include'), 'unignored file included') + done() + }) +}) + +test('toplevel-only and blanket ignores', function (t) { + var fixture = new Tacks( + Dir({ + 'package.json': File({ + name: 'npm-test-files', + version: '1.2.5' + }), + '.npmignore': File( + './shallow1\n' + + '/shallow2\n' + + '/sub/onelevel\n' + + 'deep\n' + + '' + ), + shallow1: File(''), + shallow2: File(''), + deep: File(''), + sub: Dir({ + shallow1: File(''), + shallow2: File(''), + onelevel: File(''), + deep: File(''), + sub: Dir({ + deep: File(''), + onelevel: File('') + }) + }) + }) + ) + withFixture(t, fixture, function (done) { + t.notOk(fileExists('shallow2'), '/ file excluded') + t.ok(fileExists('sub/shallow1'), 'nested ./ file included') + t.ok(fileExists('sub/shallow2'), 'nested / file included') + t.ok(fileExists('sub/sub/onelevel'), 'double-nested file included') + t.notOk(fileExists('sub/onelevel'), 'nested / file excluded') + t.notOk(fileExists('deep'), 'deep file excluded') + t.notOk(fileExists('sub/deep'), 'nested deep file excluded') + t.notOk(fileExists('sub/sub/deep'), 'double-nested deep file excluded') + t.ok(fileExists('shallow1'), './ file included') + done() + }) +}) + +test('.npmignore works for nested directories recursively', function (t) { + var fixture = new Tacks( + Dir({ + 'package.json': File({ + name: 'npm-test-files', + version: '1.2.5' + }), + '.npmignore': File( + '/ignore\n' + + 'deep\n' + ), + include: File(''), + ignore: File(''), + deep: File(''), + sub: Dir({ + ignore: File(''), + include: File(''), + deep: File(''), + sub: Dir({ + '.npmignore': File( + '/ignore\n' + ), + ignore: File(''), + include: File(''), + deep: File('') + }) + }) + }) + ) + withFixture(t, fixture, function (done) { + t.notOk(fileExists('ignore'), 'toplevel file excluded') + t.ok(fileExists('include'), 'unignored file included') + t.ok(fileExists('sub/ignore'), 'same-name file in nested dir included') + t.ok(fileExists('sub/include'), 'unignored nested dir file included') + t.notOk(fileExists('sub/sub/ignore'), 'sub-sub-directory file excluded') + t.ok(fileExists('sub/sub/include'), 'sub-sube-directory file included') + t.notOk(fileExists('deep'), 'deep file excluded') + t.notOk(fileExists('sub/deep'), 'sub-dir deep file excluded') + t.notOk(fileExists('sub/sub/deep'), 'sub-sub-dir deep file excluded') + done() + }) +}) + +test('.gitignore should have identical semantics', function (t) { + var fixture = new Tacks( + Dir({ + 'package.json': File({ + name: 'npm-test-files', + version: '1.2.5' + }), + '.gitignore': File( + './shallow1\n' + + '/shallow2\n' + + '/sub/onelevel\n' + + 'deep\n' + + '' + ), + shallow1: File(''), + shallow2: File(''), + deep: File(''), + sub: Dir({ + shallow1: File(''), + shallow2: File(''), + onelevel: File(''), + deep: File(''), + sub: Dir({ + deep: File(''), + onelevel: File('') + }) + }) + }) + ) + withFixture(t, fixture, function (done) { + t.notOk(fileExists('shallow2'), '/ file excluded') + t.ok(fileExists('sub/shallow1'), 'nested ./ file included') + t.ok(fileExists('sub/shallow2'), 'nested / file included') + t.ok(fileExists('sub/sub/onelevel'), 'double-nested file included') + t.notOk(fileExists('sub/onelevel'), 'nested / file excluded') + t.notOk(fileExists('deep'), 'deep file excluded') + t.notOk(fileExists('sub/deep'), 'nested deep file excluded') + t.notOk(fileExists('sub/sub/deep'), 'double-nested deep file excluded') + t.ok(fileExists('shallow1'), './ file included') + done() + }) +}) + +test('.npmignore should always be overridden by files array', function (t) { + var fixture = new Tacks( + Dir({ + 'package.json': File({ + name: 'npm-test-files', + version: '1.2.5', + files: [ + 'include', + 'sub' + ] + }), + '.npmignore': File( + 'include\n' + + 'ignore\n' + + 'sub/included\n' + ), + include: File(''), + ignore: File(''), + sub: Dir({ + include: File('') + }) + }) + ) + withFixture(t, fixture, function (done) { + t.notOk(fileExists('ignore'), 'toplevel file excluded') + t.ok(fileExists('include'), 'unignored file included') + t.ok(fileExists('sub/include'), 'nested file included') + done() + }) +}) + +test('.gitignore supported for ignores', function (t) { + var fixture = new Tacks( + Dir({ + 'package.json': File({ + name: 'npm-test-files', + version: '1.2.5' + }), + '.gitignore': File( + 'ignore\n' + + 'sub/ignore\n' + ), + include: File(''), + ignore: File(''), + sub: Dir({ ignore: File('') }) + }) + ) + withFixture(t, fixture, function (done) { + t.notOk(fileExists('ignore'), 'toplevel file excluded') + t.notOk(fileExists('sub/ignore'), 'nested file excluded') + t.ok(fileExists('include'), 'unignored file included') + done() + }) +}) + +test('.npmignore completely overrides .gitignore', function (t) { + var fixture = new Tacks( + Dir({ + 'package.json': File({ + name: 'npm-test-files', + version: '1.2.5' + }), + '.npmignore': File( + 'ignore\n' + + 'sub/ignore\n' + ), + '.gitignore': File( + 'include\n' + + 'sub/include\n' + + 'extra\n' + ), + include: File(''), + sub: Dir({ include: File('') }), + extra: File('') + }) + ) + withFixture(t, fixture, function (done) { + t.ok(fileExists('include'), 'gitignored toplevel file included') + t.ok(fileExists('extra'), 'gitignored extra toplevel file included') + t.ok(fileExists('sub/include'), 'gitignored nested file included') + t.notOk(fileExists('ignore'), 'toplevel file excluded') + t.notOk(fileExists('sub/ignore'), 'nested file excluded') + done() + }) +}) + +test('files array overrides .npmignore', function (t) { + var fixture = new Tacks( + Dir({ + 'package.json': File({ + name: 'npm-test-files', + version: '1.2.5', + files: [ + 'include', + 'sub/include' + ] + }), + '.npmignore': File( + 'include\n' + + 'sub/include\n' + ), + include: File(''), + sub: Dir({ include: File('') }) + }) + ) + withFixture(t, fixture, function (done) { + t.ok(fileExists('include'), 'toplevel file included') + t.ok(fileExists('sub/include'), 'nested file included') + done() + }) +}) + +test('includes files regardless of emptiness', function (t) { + var fixture = new Tacks( + Dir({ + 'package.json': File({ + name: 'npm-test-files', + version: '1.2.5', + files: [ + 'full', + 'empty' + ] + }), + full: File('This file has contents~'), + empty: File('') + }) + ) + withFixture(t, fixture, function (done) { + t.ok(fileExists('full'), 'contentful file included') + t.ok(fileExists('empty'), 'empty file included') + done() + }) +}) + +test('.npmignore itself gets included', function (t) { + var fixture = new Tacks( + Dir({ + 'package.json': File({ + name: 'npm-test-files', + version: '1.2.5', + files: [ + '.npmignore' + ] + }), + '.npmignore': File('') + }) + ) + withFixture(t, fixture, function (done) { + t.ok(fileExists('.npmignore'), '.npmignore included') + done() + }) +}) + +test('include default files when missing files spec', function (t) { + var fixture = new Tacks( + Dir({ + 'package.json': File({ + name: 'npm-test-files', + version: '1.2.5' + }), + 'index.js': File(''), + foo: File(''), + node_modules: Dir({foo: Dir({bar: File('')})}) + }) + ) + withFixture(t, fixture, function (done) { + t.ok(fileExists('index.js'), 'index.js included') + t.ok(fileExists('foo'), 'foo included') + t.notOk(fileExists('node_modules'), 'node_modules not included') + done() + }) +}) + +test('include main file', function (t) { + var fixture = new Tacks( + Dir({ + 'package.json': File({ + name: 'npm-test-files', + version: '1.2.5', + main: 'foo.js', + files: [] + }), + 'index.js': File(''), + 'foo.js': File('') + }) + ) + withFixture(t, fixture, function (done) { + t.ok(fileExists('foo.js'), 'foo.js included because of main') + t.notOk(fileExists('index.js'), 'index.js not included') + done() + }) +}) + +test('certain files ignored unconditionally', function (t) { + var fixture = new Tacks( + Dir({ + 'package.json': File({ + name: 'npm-test-files', + version: '1.2.5', + files: [ + '.git', + '.svn', + 'CVS', + '.hg', + '.lock-wscript', + '.wafpickle-0', + '.wafpickle-5', + '.wafpickle-50', + 'build/config.gypi', + 'npm-debug.log', + '.npmrc', + '.foo.swp', + '.DS_Store', + '._ohno' + ] + }), + '.git': Dir({foo: File('')}), + '.svn': Dir({foo: File('')}), + 'CVS': Dir({foo: File('')}), + '.hg': Dir({foo: File('')}), + '.lock-wscript': File(''), + '.wafpickle-0': File(''), + '.wafpickle-5': File(''), + '.wafpickle-50': File(''), + 'build': Dir({'config.gypi': File('')}), + 'npm-debug.log': File(''), + '.npmrc': File(''), + '.foo.swp': File(''), + '.DS_Store': Dir({foo: File('')}), + '._ohno': File(''), + '._ohnoes': Dir({noes: File('')}) + }) + ) + withFixture(t, fixture, function (done) { + t.notOk(fileExists('.git'), '.git not included') + t.notOk(fileExists('.svn'), '.svn not included') + t.notOk(fileExists('CVS'), 'CVS not included') + t.notOk(fileExists('.hg'), '.hg not included') + t.notOk(fileExists('.lock-wscript'), '.lock-wscript not included') + t.notOk(fileExists('.wafpickle-0'), '.wafpickle-0 not included') + t.notOk(fileExists('.wafpickle-5'), '.wafpickle-5 not included') + t.notOk(fileExists('.wafpickle-50'), '.wafpickle-50 not included') + t.notOk(fileExists('build/config.gypi'), 'build/config.gypi not included') + t.notOk(fileExists('npm-debug.log'), 'npm-debug.log not included') + t.notOk(fileExists('.npmrc'), '.npmrc not included') + t.notOk(fileExists('.foo.swp'), '.foo.swp not included') + t.notOk(fileExists('.DS_Store'), '.DS_Store not included') + t.notOk(fileExists('._ohno'), '._ohno not included') + t.notOk(fileExists('._ohnoes'), '._ohnoes not included') + done() + }) +}) + +test('certain files included unconditionally', function (t) { + var fixture = new Tacks( + Dir({ + 'package.json': File({ + name: 'npm-test-files', + version: '1.2.5' + }), + '.npmignore': File( + 'package.json', + 'README', + 'Readme', + 'readme.md', + 'readme.randomext', + 'changelog', + 'CHAngelog', + 'ChangeLOG.txt', + 'license', + 'licence', + 'LICENSE', + 'LICENCE' + ), + 'README': File(''), + 'Readme': File(''), + 'readme.md': File(''), + 'readme.randomext': File(''), + 'changelog': File(''), + 'CHAngelog': File(''), + 'ChangeLOG.txt': File(''), + 'license': File(''), + 'licence': File(''), + 'LICENSE': File(''), + 'LICENCE': File('') + }) + ) + withFixture(t, fixture, function (done) { + t.ok(fileExists('package.json'), 'package.json included') + t.ok(fileExists('README'), 'README included') + t.ok(fileExists('Readme'), 'Readme included') + t.ok(fileExists('readme.md'), 'readme.md included') + t.ok(fileExists('readme.randomext'), 'readme.randomext included') + t.ok(fileExists('changelog'), 'changelog included') + t.ok(fileExists('CHAngelog'), 'CHAngelog included') + t.ok(fileExists('ChangeLOG.txt'), 'ChangeLOG.txt included') + t.ok(fileExists('license'), 'license included') + t.ok(fileExists('licence'), 'licence included') + t.ok(fileExists('LICENSE'), 'LICENSE included') + t.ok(fileExists('LICENCE'), 'LICENCE included') + done() + }) +}) + +test('folder-based inclusion works', function (t) { + var fixture = new Tacks( + Dir({ + 'package.json': File({ + name: 'npm-test-files', + version: '1.2.5', + files: [ + 'sub1/sub', + 'sub2' + ] + }), + sub1: Dir({ + sub: Dir({ + include1: File(''), + include2: File('') + }), + ignored: File('') + }), + sub2: Dir({ + include1: File(''), + include2: File(''), + empty: Dir({}) + }) + }) + ) + withFixture(t, fixture, function (done) { + t.ok(fileExists('sub1/sub/include1'), 'nested dir included') + t.ok(fileExists('sub1/sub/include2'), 'nested dir included') + t.notOk(fileExists('sub1/ignored'), 'unspecified file not included') + + t.ok(fileExists('sub2/include1'), 'dir contents included') + t.ok(fileExists('sub2/include2'), 'dir contents included') + t.notOk(fileExists('sub2/empty'), 'empty dir not included') + + done() + }) +}) + +function fileExists (file) { + try { + return !!fs.statSync(path.resolve(installedpath, file)) + } catch (_) { + return false + } +} + +function withFixture (t, fixture, tester) { + fixture.create(fixturepath) + mkdirp.sync(modulepath) + common.npm(['install', fixturepath], {cwd: basepath}, installCheckAndTest) + function installCheckAndTest (err, code) { + if (err) throw err + t.is(code, 0, 'install went ok') + tester(removeAndDone) + } + function removeAndDone (err) { + if (err) throw err + fixture.remove(fixturepath) + rimraf.sync(basepath) + t.done() + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/gently-rm-overeager.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/gently-rm-overeager.js new file mode 100644 index 00000000..35f46cc2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/gently-rm-overeager.js @@ -0,0 +1,62 @@ +var resolve = require("path").resolve +var fs = require("graceful-fs") +var test = require("tap").test +var mkdirp = require("mkdirp") +var rimraf = require("rimraf") + +var common = require("../common-tap.js") + +var pkg = resolve(__dirname, "gently-rm-overeager") +var dep = resolve(__dirname, "test-whoops") + +var EXEC_OPTS = { + cwd : pkg +} + +var fixture = { + name: "@test/whoops", + version: "1.0.0", + scripts: { + postinstall: "echo \"nope\" && exit 1" + } +} + +test("setup", function (t) { + cleanup() + setup() + + t.end() +}) + +test("cache add", function (t) { + common.npm(["install", "../test-whoops"], EXEC_OPTS, function (er, c) { + t.ifError(er, "test-whoops install didn't explode") + t.ok(c, "test-whoops install also failed") + fs.readdir(pkg, function (er, files) { + t.ifError(er, "package directory is still there") + t.deepEqual(files, ["npm-debug.log"], "only debug log remains") + + t.end() + }) + }) +}) + +test("cleanup", function (t) { + cleanup() + + t.end() +}) + + +function cleanup () { + rimraf.sync(pkg) + rimraf.sync(dep) +} + +function setup () { + mkdirp.sync(pkg) + // so it doesn't try to install into npm's own node_modules + mkdirp.sync(resolve(pkg, "node_modules")) + mkdirp.sync(dep) + fs.writeFileSync(resolve(dep, "package.json"), JSON.stringify(fixture)) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/gently-rm-symlink.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/gently-rm-symlink.js new file mode 100644 index 00000000..d69b62e5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/gently-rm-symlink.js @@ -0,0 +1,113 @@ +var resolve = require("path").resolve +var fs = require("graceful-fs") +var test = require("tap").test +var mkdirp = require("mkdirp") +var rimraf = require("rimraf") + +var common = require("../common-tap.js") + +var pkg = resolve(__dirname, "gently-rm-linked") +var dep = resolve(__dirname, "test-linked") +var glb = resolve(__dirname, "test-global") +var lnk = resolve(__dirname, "test-global-link") + +var EXEC_OPTS = { + cwd : pkg +} + + +var index = "module.exports = function () { console.log('whoop whoop') }" + +var fixture = { + name: "@test/linked", + version: "1.0.0", + bin: { + linked: "./index.js" + } +} + +test("setup", function (t) { + cleanup() + setup() + + t.end() +}) + +test("install and link", function (t) { + common.npm( + [ + "--global", + "--prefix", lnk, + "--loglevel", "silent", + "install", "../test-linked" + ], + EXEC_OPTS, + function (er, code, stdout, stderr) { + t.ifError(er, "test-linked install didn't explode") + t.notOk(code, "test-linked install also failed") + t.notOk(stderr, "no log output") + + verify(t, stdout) + + // again, to make sure unlinking works properlyt + common.npm( + [ + "--global", + "--prefix", lnk, + "--loglevel", "silent", + "install", "../test-linked" + ], + EXEC_OPTS, + function (er, code, stdout, stderr) { + t.ifError(er, "test-linked install didn't explode") + t.notOk(code, "test-linked install also failed") + t.notOk(stderr, "no log output") + + verify(t, stdout) + + fs.readdir(pkg, function (er, files) { + t.ifError(er, "package directory is still there") + t.deepEqual(files, ["node_modules"], "only stub modules dir remains") + + t.end() + }) + } + ) + } + ) +}) + +test("cleanup", function (t) { + cleanup() + + t.end() +}) + +function verify (t, stdout) { + var binPath = resolve(lnk, "bin", "linked") + var pkgPath = resolve(lnk, "lib", "node_modules", "@test", "linked") + var trgPath = resolve(pkgPath, "index.js") + t.equal( + stdout, + binPath+" -> "+trgPath+"\n@test/linked@1.0.0 "+pkgPath+"\n", + "got expected install output" + ) +} + +function cleanup () { + rimraf.sync(pkg) + rimraf.sync(dep) + rimraf.sync(lnk) + rimraf.sync(glb) +} + +function setup () { + mkdirp.sync(pkg) + mkdirp.sync(glb) + fs.symlinkSync(glb, lnk) + // so it doesn't try to install into npm's own node_modules + mkdirp.sync(resolve(pkg, "node_modules")) + mkdirp.sync(dep) + fs.writeFileSync(resolve(dep, "package.json"), JSON.stringify(fixture)) + fs.writeFileSync(resolve(dep, "index.js"), index) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/get.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/get.js new file mode 100644 index 00000000..98324302 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/get.js @@ -0,0 +1,126 @@ +var common = require("../common-tap.js") +var test = require("tap").test +var cacheFile = require("npm-cache-filename") +var npm = require("../../") +var mkdirp = require("mkdirp") +var rimraf = require("rimraf") +var path = require("path") +var mr = require("npm-registry-mock") +var fs = require("graceful-fs") + +function nop () {} + +var URI = "https://npm.registry:8043/rewrite" +var TIMEOUT = 3600 +var FOLLOW = false +var STALE_OK = true +var TOKEN = "lolbutts" +var AUTH = { + token : TOKEN +} +var PARAMS = { + timeout : TIMEOUT, + follow : FOLLOW, + staleOk : STALE_OK, + auth : AUTH +} +var PKG_DIR = path.resolve(__dirname, "get-basic") +var CACHE_DIR = path.resolve(PKG_DIR, "cache") +var BIGCO_SAMPLE = { + name : "@bigco/sample", + version : "1.2.3" +} + +// mock server reference +var server + +var mocks = { + "get": { + "/@bigco%2fsample/1.2.3" : [200, BIGCO_SAMPLE] + } +} + +var mapper = cacheFile(CACHE_DIR) + +function getCachePath (uri) { + return path.join(mapper(uri), ".cache.json") +} + +test("setup", function (t) { + mkdirp.sync(CACHE_DIR) + + mr({port: common.port, mocks: mocks}, function (er, s) { + t.ifError(er) + npm.load({cache: CACHE_DIR, registry: common.registry}, function (er) { + t.ifError(er) + server = s + t.end() + }) + }) +}) + +test("get call contract", function (t) { + t.throws(function () { + npm.registry.get(undefined, PARAMS, nop) + }, "requires a URI") + + t.throws(function () { + npm.registry.get([], PARAMS, nop) + }, "requires URI to be a string") + + t.throws(function () { + npm.registry.get(URI, undefined, nop) + }, "requires params object") + + t.throws(function () { + npm.registry.get(URI, "", nop) + }, "params must be object") + + t.throws(function () { + npm.registry.get(URI, PARAMS, undefined) + }, "requires callback") + + t.throws(function () { + npm.registry.get(URI, PARAMS, "callback") + }, "callback must be function") + + t.end() +}) + +test("basic request", function (t) { + t.plan(9) + + var versioned = common.registry + "/underscore/1.3.3" + npm.registry.get(versioned, PARAMS, function (er, data) { + t.ifError(er, "loaded specified version underscore data") + t.equal(data.version, "1.3.3") + fs.stat(getCachePath(versioned), function (er) { + t.ifError(er, "underscore 1.3.3 cache data written") + }) + }) + + var rollup = common.registry + "/underscore" + npm.registry.get(rollup, PARAMS, function (er, data) { + t.ifError(er, "loaded all metadata") + t.deepEqual(data.name, "underscore") + fs.stat(getCachePath(rollup), function (er) { + t.ifError(er, "underscore rollup cache data written") + }) + }) + + var scoped = common.registry + "/@bigco%2fsample/1.2.3" + npm.registry.get(scoped, PARAMS, function (er, data) { + t.ifError(er, "loaded all metadata") + t.equal(data.name, "@bigco/sample") + fs.stat(getCachePath(scoped), function (er) { + t.ifError(er, "scoped cache data written") + }) + }) +}) + +test("cleanup", function (t) { + server.close() + rimraf.sync(PKG_DIR) + + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/gist-short-shortcut-package.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/gist-short-shortcut-package.js new file mode 100644 index 00000000..02457b4d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/gist-short-shortcut-package.js @@ -0,0 +1,84 @@ +'use strict' +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var requireInject = require('require-inject') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var pkg = path.resolve(__dirname, 'gist-short-shortcut-package') + +var json = { + name: 'gist-short-shortcut-package', + version: '0.0.0', + dependencies: { + 'private-gist': 'gist:deadbeef' + } +} + +test('setup', function (t) { + setup() + t.end() +}) + +test('gist-short-shortcut-package', function (t) { + var cloneUrls = [ + ['git://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try git URLs first'], + ['https://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try HTTPS URLs second'], + ['git@gist.github.com:/deadbeef.git', 'GitHub gist shortcuts try SSH third'] + ] + var npm = requireInject.installGlobally('../../lib/npm.js', { + 'child_process': { + 'execFile': function (cmd, args, options, cb) { + process.nextTick(function () { + if (args[0] !== 'clone') return cb(null, '', '') + var cloneUrl = cloneUrls.shift() + if (cloneUrl) { + t.is(args[3], cloneUrl[0], cloneUrl[1]) + } else { + t.fail('too many attempts to clone') + } + cb(new Error()) + }) + } + } + }) + + var opts = { + cache: path.resolve(pkg, 'cache'), + prefix: pkg, + registry: common.registry, + loglevel: 'silent' + } + npm.load(opts, function (er) { + t.ifError(er, 'npm loaded without error') + npm.commands.install([], function (er, result) { + t.ok(er, 'mocked install failed as expected') + t.end() + }) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function setup () { + cleanup() + mkdirp.sync(pkg) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + process.chdir(pkg) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/gist-short-shortcut.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/gist-short-shortcut.js new file mode 100644 index 00000000..57f2006b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/gist-short-shortcut.js @@ -0,0 +1,81 @@ +'use strict' +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var requireInject = require('require-inject') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var pkg = path.resolve(__dirname, 'gist-short-shortcut') + +var json = { + name: 'gist-short-shortcut', + version: '0.0.0' +} + +test('setup', function (t) { + setup() + t.end() +}) + +test('gist-shortcut', function (t) { + var cloneUrls = [ + ['git://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try git URLs first'], + ['https://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try HTTPS URLs second'], + ['git@gist.github.com:/deadbeef.git', 'GitHub gist shortcuts try SSH third'] + ] + var npm = requireInject.installGlobally('../../lib/npm.js', { + 'child_process': { + 'execFile': function (cmd, args, options, cb) { + process.nextTick(function () { + if (args[0] !== 'clone') return cb(null, '', '') + var cloneUrl = cloneUrls.shift() + if (cloneUrl) { + t.is(args[3], cloneUrl[0], cloneUrl[1]) + } else { + t.fail('too many attempts to clone') + } + cb(new Error()) + }) + } + } + }) + + var opts = { + cache: path.resolve(pkg, 'cache'), + prefix: pkg, + registry: common.registry, + loglevel: 'silent' + } + npm.load(opts, function (er) { + t.ifError(er, 'npm loaded without error') + npm.commands.install(['gist:deadbeef'], function (er, result) { + t.ok(er, 'mocked install failed as expected') + t.end() + }) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function setup () { + cleanup() + mkdirp.sync(pkg) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + process.chdir(pkg) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/gist-shortcut-package.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/gist-shortcut-package.js new file mode 100644 index 00000000..370476ac --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/gist-shortcut-package.js @@ -0,0 +1,84 @@ +'use strict' +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var requireInject = require('require-inject') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var pkg = path.resolve(__dirname, 'gist-shortcut-package') + +var json = { + name: 'gist-shortcut-package', + version: '0.0.0', + dependencies: { + 'private-gist': 'gist:foo/deadbeef' + } +} + +test('setup', function (t) { + setup() + t.end() +}) + +test('gist-shortcut-package', function (t) { + var cloneUrls = [ + ['git://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try git URLs first'], + ['https://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try HTTPS URLs second'], + ['git@gist.github.com:/deadbeef.git', 'GitHub gist shortcuts try SSH third'] + ] + var npm = requireInject.installGlobally('../../lib/npm.js', { + 'child_process': { + 'execFile': function (cmd, args, options, cb) { + process.nextTick(function () { + if (args[0] !== 'clone') return cb(null, '', '') + var cloneUrl = cloneUrls.shift() + if (cloneUrl) { + t.is(args[3], cloneUrl[0], cloneUrl[1]) + } else { + t.fail('too many attempts to clone') + } + cb(new Error()) + }) + } + } + }) + + var opts = { + cache: path.resolve(pkg, 'cache'), + prefix: pkg, + registry: common.registry, + loglevel: 'silent' + } + npm.load(opts, function (er) { + t.ifError(er, 'npm loaded without error') + npm.commands.install([], function (er, result) { + t.ok(er, 'mocked install failed as expected') + t.end() + }) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function setup () { + cleanup() + mkdirp.sync(pkg) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + process.chdir(pkg) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/gist-shortcut.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/gist-shortcut.js new file mode 100644 index 00000000..e975a09b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/gist-shortcut.js @@ -0,0 +1,81 @@ +'use strict' +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var requireInject = require('require-inject') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var pkg = path.resolve(__dirname, 'gist-shortcut') + +var json = { + name: 'gist-shortcut', + version: '0.0.0' +} + +test('setup', function (t) { + setup() + t.end() +}) + +test('gist-shortcut', function (t) { + var cloneUrls = [ + ['git://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try git URLs first'], + ['https://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try HTTPS URLs second'], + ['git@gist.github.com:/deadbeef.git', 'GitHub gist shortcuts try SSH third'] + ] + var npm = requireInject.installGlobally('../../lib/npm.js', { + 'child_process': { + 'execFile': function (cmd, args, options, cb) { + process.nextTick(function () { + if (args[0] !== 'clone') return cb(null, '', '') + var cloneUrl = cloneUrls.shift() + if (cloneUrl) { + t.is(args[3], cloneUrl[0], cloneUrl[1]) + } else { + t.fail('too many attempts to clone') + } + cb(new Error()) + }) + } + } + }) + + var opts = { + cache: path.resolve(pkg, 'cache'), + prefix: pkg, + registry: common.registry, + loglevel: 'silent' + } + npm.load(opts, function (er) { + t.ifError(er, 'npm loaded without error') + npm.commands.install(['gist:foo/deadbeef'], function (er, result) { + t.ok(er, 'mocked install failed as expected') + t.end() + }) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function setup () { + cleanup() + mkdirp.sync(pkg) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + process.chdir(pkg) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/git-cache-locking.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/git-cache-locking.js new file mode 100644 index 00000000..e08c96e1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/git-cache-locking.js @@ -0,0 +1,46 @@ +var test = require('tap').test +var common = require('../common-tap') +var path = require('path') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var pkg = path.resolve(__dirname, 'git-cache-locking') +var tmp = path.join(pkg, 'tmp') +var cache = path.join(pkg, 'cache') + +test('setup', function (t) { + rimraf.sync(pkg) + mkdirp.sync(path.resolve(pkg, 'node_modules')) + t.end() +}) + +test('git-cache-locking: install a git dependency', function (t) { + // disable git integration tests on Travis. + if (process.env.TRAVIS) return t.end() + + // package c depends on a.git#master and b.git#master + // package b depends on a.git#master + common.npm([ + 'install', + 'git://github.com/nigelzor/npm-4503-c.git' + ], { + cwd: pkg, + env: { + npm_config_cache: cache, + npm_config_tmp: tmp, + npm_config_prefix: pkg, + npm_config_global: 'false', + HOME: process.env.HOME, + Path: process.env.PATH, + PATH: process.env.PATH + } + }, function (err, code, stdout, stderr) { + t.ifErr(err, 'npm install finished without error') + t.equal(0, code, 'npm install should succeed') + t.end() + }) +}) + +test('cleanup', function (t) { + rimraf.sync(pkg) + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/git-cache-no-hooks.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/git-cache-no-hooks.js new file mode 100644 index 00000000..32731fa1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/git-cache-no-hooks.js @@ -0,0 +1,63 @@ +var test = require("tap").test + , fs = require("fs") + , path = require("path") + , rimraf = require("rimraf") + , mkdirp = require("mkdirp") + , spawn = require("child_process").spawn + , npmCli = require.resolve("../../bin/npm-cli.js") + , node = process.execPath + , pkg = path.resolve(__dirname, "git-cache-no-hooks") + , tmp = path.join(pkg, "tmp") + , cache = path.join(pkg, "cache") + + +test("setup", function (t) { + rimraf.sync(pkg) + mkdirp.sync(pkg) + mkdirp.sync(cache) + mkdirp.sync(tmp) + mkdirp.sync(path.resolve(pkg, "node_modules")) + t.end() +}) + +test("git-cache-no-hooks: install a git dependency", function (t) { + + // disable git integration tests on Travis. + if (process.env.TRAVIS) return t.end() + + var command = [ npmCli + , "install" + , "git://github.com/nigelzor/npm-4503-a.git" + ] + var child = spawn(node, command, { + cwd: pkg, + env: { + "npm_config_cache" : cache, + "npm_config_tmp" : tmp, + "npm_config_prefix" : pkg, + "npm_config_global" : "false", + "npm_config_umask" : "00", + HOME : process.env.HOME, + Path : process.env.PATH, + PATH : process.env.PATH + }, + stdio: "inherit" + }) + + child.on("close", function (code) { + t.equal(code, 0, "npm install should succeed") + + // verify permissions on git hooks + var repoDir = "git-github-com-nigelzor-npm-4503-a-git-40c5cb24" + var hooksPath = path.join(cache, "_git-remotes", repoDir, "hooks") + fs.readdir(hooksPath, function (err) { + t.equal(err && err.code, "ENOENT", "hooks are not brought along with repo") + t.end() + }) + }) +}) + +test("cleanup", function (t) { + rimraf.sync(pkg) + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/git-dependency-install-link.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/git-dependency-install-link.js new file mode 100644 index 00000000..4fb14157 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/git-dependency-install-link.js @@ -0,0 +1,175 @@ +var fs = require('fs') +var resolve = require('path').resolve + +var osenv = require('osenv') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var test = require('tap').test +var readJson = require('read-package-json') +var mr = require('npm-registry-mock') + +var npm = require('../../lib/npm.js') +var common = require('../common-tap.js') + +var pkg = resolve(__dirname, 'git-dependency-install-link') +var repo = resolve(__dirname, 'git-dependency-install-link-repo') +var cache = resolve(pkg, 'cache') + +var daemon +var daemonPID +var git +var mockRegistry + +var EXEC_OPTS = { + registry: common.registry, + cwd: pkg, + cache: cache +} + +var pjParent = JSON.stringify({ + name: 'parent', + version: '1.2.3', + dependencies: { + 'child': 'git://localhost:1234/child.git' + } +}, null, 2) + '\n' + +var pjChild = JSON.stringify({ + name: 'child', + version: '1.0.3' +}, null, 2) + '\n' + + +test('setup', function (t) { + bootstrap() + setup(function (er, r) { + t.ifError(er, 'git started up successfully') + + if (!er) { + daemon = r[r.length - 2] + daemonPID = r[r.length - 1] + } + + mr({ + port: common.port + }, function (er, server) { + t.ifError(er, 'started mock registry') + mockRegistry = server + + t.end() + }) + }) +}) + +test('install from git repo [no --link]', function (t) { + process.chdir(pkg) + + common.npm(['install', '--loglevel', 'error'], EXEC_OPTS, function (err, code, stdout, stderr) { + t.ifError(err, 'npm install failed') + + t.dissimilar(stderr, /Command failed:/, 'expect git to succeed') + t.dissimilar(stderr, /version not found/, 'should not go to repository') + + readJson(resolve(pkg, 'node_modules', 'child', 'package.json'), function (err, data) { + t.ifError(err, 'error reading child package.json') + + t.equal(data && data.version, '1.0.3') + t.end() + }) + }) +}) + +test('install from git repo [with --link]', function (t) { + process.chdir(pkg) + rimraf.sync(resolve(pkg, 'node_modules')) + + common.npm(['install', '--link', '--loglevel', 'error'], EXEC_OPTS, function (err, code, stdout, stderr) { + t.ifError(err, 'npm install --link failed') + + t.dissimilar(stderr, /Command failed:/, 'expect git to succeed') + t.dissimilar(stderr, /version not found/, 'should not go to repository') + + readJson(resolve(pkg, 'node_modules', 'child', 'package.json'), function (err, data) { + t.ifError(err, 'error reading child package.json') + + t.equal(data && data.version, '1.0.3') + t.end() + }) + }) +}) + +test('clean', function (t) { + mockRegistry.close() + daemon.on('close', function () { + cleanup() + t.end() + }) + process.kill(daemonPID) +}) + +function bootstrap () { + rimraf.sync(repo) + rimraf.sync(pkg) + mkdirp.sync(pkg) + mkdirp.sync(cache) + + fs.writeFileSync(resolve(pkg, 'package.json'), pjParent) +} + +function setup (cb) { + mkdirp.sync(repo) + fs.writeFileSync(resolve(repo, 'package.json'), pjChild) + npm.load({ + link: true, + prefix: pkg, + loglevel: 'silent' + }, function () { + git = require('../../lib/utils/git.js') + + function startDaemon (cb) { + // start git server + var d = git.spawn( + [ + 'daemon', + '--verbose', + '--listen=localhost', + '--export-all', + '--base-path=.', + '--reuseaddr', + '--port=1234' + ], + { + cwd: pkg, + env: process.env, + stdio: ['pipe', 'pipe', 'pipe'] + } + ) + d.stderr.on('data', childFinder) + + function childFinder (c) { + var cpid = c.toString().match(/^\[(\d+)\]/) + if (cpid[1]) { + this.removeListener('data', childFinder) + cb(null, [d, cpid[1]]) + } + } + } + + common.makeGitRepo({ + path: repo, + commands: [ + git.chainableExec( + ['clone', '--bare', repo, 'child.git'], + { cwd: pkg, env: process.env } + ), + startDaemon + ] + }, cb) + }) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(repo) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/git-npmignore.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/git-npmignore.js new file mode 100644 index 00000000..5e915a70 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/git-npmignore.js @@ -0,0 +1,173 @@ +var cat = require("graceful-fs").writeFileSync +var exec = require("child_process").exec +var readdir = require("graceful-fs").readdirSync +var resolve = require("path").resolve + +var mkdirp = require("mkdirp") +var rimraf = require("rimraf") +var test = require("tap").test +var tmpdir = require("osenv").tmpdir +var which = require("which") + +var common = require("../common-tap.js") + +var pkg = resolve(__dirname, "git-npmignore") +var dep = resolve(pkg, "deps", "gitch") +var packname = "gitch-1.0.0.tgz" +var packed = resolve(pkg, packname) +var modules = resolve(pkg, "node_modules") +var installed = resolve(modules, "gitch") +var expected = [ + "a.js", + "package.json", + ".npmignore" +].sort() + +var EXEC_OPTS = { + cwd : pkg +} + +var gitignore = "node_modules/\n" +var npmignore = "t.js\n" + +var a = "console.log('hi');" +var t = "require('tap').test(function (t) { t.pass('I am a test!'); t.end(); });" +var fixture = { + "name" : "gitch", + "version" : "1.0.0", + "private" : true, + "main" : "a.js" +} + + +test("setup", function (t) { + setup(function (er) { + t.ifError(er, "setup ran OK") + + t.end() + }) +}) + +test("npm pack directly from directory", function (t) { + packInstallTest(dep, t) +}) + +test("npm pack via git", function (t) { + packInstallTest("git+file://"+dep, t) +}) + +test("cleanup", function (t) { + cleanup() + + t.end() +}) + +function packInstallTest (spec, t) { + common.npm( + [ + "--loglevel", "silent", + "pack", spec + ], + EXEC_OPTS, + function (err, code, stdout, stderr) { + t.ifError(err, "npm pack ran without error") + t.notOk(code, "npm pack exited cleanly") + t.notOk(stderr, "npm pack ran silently") + t.equal(stdout.trim(), packname, "got expected package name") + + common.npm( + [ + "--loglevel", "silent", + "install", packed + ], + EXEC_OPTS, + function (err, code, stdout, stderr) { + t.ifError(err, "npm install ran without error") + t.notOk(code, "npm install exited cleanly") + t.notOk(stderr, "npm install ran silently") + + var actual = readdir(installed).sort() + t.same(actual, expected, "no unexpected files in packed directory") + + rimraf(packed, function () { + t.end() + }) + } + ) + } + ) +} + +function cleanup () { + process.chdir(tmpdir()) + rimraf.sync(pkg) +} + +function setup (cb) { + cleanup() + + mkdirp.sync(modules) + mkdirp.sync(dep) + + process.chdir(dep) + + cat(resolve(dep, ".npmignore"), npmignore) + cat(resolve(dep, ".gitignore"), gitignore) + cat(resolve(dep, "a.js"), a) + cat(resolve(dep, "t.js"), t) + cat(resolve(dep, "package.json"), JSON.stringify(fixture)) + + common.npm( + [ + "--loglevel", "silent", + "cache", "clean" + ], + EXEC_OPTS, + function (er, code, _, stderr) { + if (er) return cb(er) + if (code) return cb(new Error("npm cache nonzero exit: "+code)) + if (stderr) return cb(new Error("npm cache clean error: "+stderr)) + + which("git", function found (er, git) { + if (er) return cb(er) + + exec(git+" init", init) + + function init (er, _, stderr) { + if (er) return cb(er) + if (stderr) return cb(new Error("git init error: "+stderr)) + + exec(git+" config user.name 'Phantom Faker'", user) + } + + function user (er, _, stderr) { + if (er) return cb(er) + if (stderr) return cb(new Error("git config error: "+stderr)) + + exec(git+" config user.email nope@not.real", email) + } + + function email (er, _, stderr) { + if (er) return cb(er) + if (stderr) return cb(new Error("git config error: "+stderr)) + + exec(git+" add .", addAll) + } + + function addAll (er, _, stderr) { + if (er) return cb(er) + if (stderr) return cb(new Error("git add . error: "+stderr)) + + exec(git+" commit -m boot", commit) + } + + function commit (er, _, stderr) { + if (er) return cb(er) + if (stderr) return cb(new Error("git commit error: "+stderr)) + + cb() + } + }) + } + ) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/git-races.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/git-races.js new file mode 100644 index 00000000..6bbfe78b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/git-races.js @@ -0,0 +1,212 @@ +var execFile = require('child_process').execFile +var path = require('path') +var zlib = require('zlib') + +var asyncMap = require('slide').asyncMap +var deepEqual = require('deep-equal') +var fs = require('graceful-fs') +var mkdirp = require('mkdirp') +var once = require('once') +var requireInject = require('require-inject') +var rimraf = require('rimraf') +var tar = require('tar') +var test = require('tap').test +var tmpdir = require('osenv').tmpdir +var which = require('which') + +var wd = path.resolve(tmpdir(), 'git-races') +var fixtures = path.resolve(__dirname, '../fixtures') +var testcase = 'github-com-BryanDonovan-npm-git-test' +var testcase_git = path.resolve(wd, testcase + '.git') +var testcase_path = path.resolve(wd, testcase) +var testcase_tgz = path.resolve(fixtures, testcase + '.git.tar.gz') + +var testtarballs = [] +var testrepos = {} +var testurls = {} + +/* +This test is specifically for #7202, where the bug was if you tried installing multiple git urls that +pointed at the same repo but had different comittishes, you'd sometimes get the wrong version. +The test cases, provided by @BryanDonovan, have a dependency tree like this: + + top + bar#4.0.0 + buzz#3.0.0 + foo#3.0.0 + buzz#3.0.0 + foo#4.0.0 + buzz#2.0.0 + +But what would happen is that buzz#2.0.0 would end up installed under bar#4.0.0. + +bar#4.0.0 shouldn't have gotten its own copy if buzz, and if it did, it shouldn've been buzz#3.0.0 +*/ + +;['bar', 'foo', 'buzz'].forEach(function (name) { + var mockurl = 'ssh://git@github.com/BryanDonovan/dummy-npm-' + name + '.git' + var realrepo = path.resolve(wd, 'github-com-BryanDonovan-dummy-npm-' + name + '.git') + var tgz = path.resolve(fixtures, 'github-com-BryanDonovan-dummy-npm-' + name + '.git.tar.gz') + + testrepos[mockurl] = realrepo + testtarballs.push(tgz) +}) + +function cleanup () { + process.chdir(tmpdir()) + rimraf.sync(wd) +} + +var npm = requireInject.installGlobally('../../lib/npm.js', { + 'child_process': { + 'execFile': function (cmd, args, options, cb) { + // If it's a clone we swap any requests for any of the urls we're mocking + // with the path to the bare repo + if (args[0] === 'clone') { + var m2 = args.length - 2 + var m1 = args.length - 1 + if (testrepos[args[m2]]) { + testurls[args[m1]] = args[m2] + args[m2] = testrepos[args[m2]] + } + execFile(cmd, args, options, cb) + // here, we intercept npm validating the remote origin url on one of the + // clones we've done previously and return the original url that was requested + } else if (args[0] === 'config' && args[1] === '--get' && args[2] === 'remote.origin.url') { + process.nextTick(function () { + cb(null, testurls[options.cwd], '') + }) + } else { + execFile(cmd, args, options, cb) + } + } + } +}) + +function extract (tarball, target, cb) { + cb = once(cb) + fs.createReadStream(tarball).on('error', function (er) { cb(er) }) + .pipe(zlib.createGunzip()).on('error', function (er) { cb(er) }) + .pipe(tar.Extract({path: target})).on('error', function (er) { cb(er) }) + .on('end', function () { + cb() + }) +} + +// Copied from lib/utils/git, because we need to use +// it before calling npm.load and lib/utils/git uses npm.js +// which doesn't allow that. =( =( + +function prefixGitArgs () { + return process.platform === 'win32' ? ['-c', 'core.longpaths=true'] : [] +} + +var gitcmd + +function execGit (args, options, cb) { + var fullArgs = prefixGitArgs().concat(args || []) + return execFile(gitcmd, fullArgs, options, cb) +} + +function gitWhichAndExec (args, options, cb) { + if (gitcmd) return execGit(args, options, cb) + + which('git', function (err, pathtogit) { + if (err) { + err.code = 'ENOGIT' + return cb(err) + } + gitcmd = pathtogit + + execGit(args, options, cb) + }) +} + +function andClone (gitdir, repodir, cb) { + return function (er) { + if (er) return cb(er) + gitWhichAndExec(['clone', gitdir, repodir], {}, cb) + } +} + +function setup (cb) { + cleanup() + mkdirp.sync(wd) + + extract(testcase_tgz, wd, andClone(testcase_git, testcase_path, andExtractPackages)) + + function andExtractPackages (er) { + if (er) return cb(er) + asyncMap(testtarballs, function (tgz, done) { + extract(tgz, wd, done) + }, andChdir) + } + function andChdir (er) { + if (er) return cb(er) + process.chdir(testcase_path) + andLoadNpm() + } + function andLoadNpm () { + var opts = { + cache: path.resolve(wd, 'cache') + } + npm.load(opts, cb) + } +} + +// there are two (sic) valid trees that can result we don't care which one we +// get in npm@2 +var oneTree = [ + 'npm-git-test@1.0.0', [ + ['dummy-npm-bar@4.0.0', [ + ['dummy-npm-foo@3.0.0', []] + ]], + ['dummy-npm-buzz@3.0.0', []], + ['dummy-npm-foo@4.0.0', [ + ['dummy-npm-buzz@2.0.0', []] + ]] + ] +] +var otherTree = [ + 'npm-git-test@1.0.0', [ + ['dummy-npm-bar@4.0.0', [ + ['dummy-npm-buzz@3.0.0', []], + ['dummy-npm-foo@3.0.0', []] + ]], + ['dummy-npm-buzz@3.0.0', []], + ['dummy-npm-foo@4.0.0', [ + ['dummy-npm-buzz@2.0.0', []] + ]] + ] +] + +function toSimple (tree) { + var deps = [] + Object.keys(tree.dependencies || {}).forEach(function (dep) { + deps.push(toSimple(tree.dependencies[dep])) + }) + return [ tree['name'] + '@' + tree['version'], deps ] +} + +test('setup', function (t) { + setup(function (er) { + t.ifError(er, 'setup ran OK') + t.end() + }) +}) + +test('correct versions are installed for git dependency', function (t) { + t.plan(3) + t.comment('test for https://github.com/npm/npm/issues/7202') + npm.commands.install([], function (er) { + t.ifError(er, 'installed OK') + npm.commands.ls([], true, function (er, result) { + t.ifError(er, 'ls OK') + var simplified = toSimple(result) + t.ok( + deepEqual(simplified, oneTree) || deepEqual(simplified, otherTree), + 'install tree is correct' + ) + }) + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/github-shortcut-package.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/github-shortcut-package.js new file mode 100644 index 00000000..13c6806b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/github-shortcut-package.js @@ -0,0 +1,84 @@ +'use strict' +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var requireInject = require('require-inject') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var pkg = path.resolve(__dirname, 'github-shortcut-package') + +var json = { + name: 'github-shortcut-package', + version: '0.0.0', + dependencies: { + 'private': 'foo/private' + } +} + +test('setup', function (t) { + setup() + t.end() +}) + +test('github-shortcut-package', function (t) { + var cloneUrls = [ + ['git://github.com/foo/private.git', 'GitHub shortcuts try git URLs first'], + ['https://github.com/foo/private.git', 'GitHub shortcuts try HTTPS URLs second'], + ['git@github.com:foo/private.git', 'GitHub shortcuts try SSH third'] + ] + var npm = requireInject.installGlobally('../../lib/npm.js', { + 'child_process': { + 'execFile': function (cmd, args, options, cb) { + process.nextTick(function () { + if (args[0] !== 'clone') return cb(null, '', '') + var cloneUrl = cloneUrls.shift() + if (cloneUrl) { + t.is(args[3], cloneUrl[0], cloneUrl[1]) + } else { + t.fail('too many attempts to clone') + } + cb(new Error()) + }) + } + } + }) + + var opts = { + cache: path.resolve(pkg, 'cache'), + prefix: pkg, + registry: common.registry, + loglevel: 'silent' + } + npm.load(opts, function (er) { + t.ifError(er, 'npm loaded without error') + npm.commands.install([], function (er, result) { + t.ok(er, 'mocked install failed as expected') + t.end() + }) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function setup () { + cleanup() + mkdirp.sync(pkg) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + process.chdir(pkg) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/github-shortcut.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/github-shortcut.js new file mode 100644 index 00000000..598aa686 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/github-shortcut.js @@ -0,0 +1,81 @@ +'use strict' +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var requireInject = require('require-inject') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var pkg = path.resolve(__dirname, 'github-shortcut') + +var json = { + name: 'github-shortcut', + version: '0.0.0' +} + +test('setup', function (t) { + setup() + t.end() +}) + +test('github-shortcut', function (t) { + var cloneUrls = [ + ['git://github.com/foo/private.git', 'GitHub shortcuts try git URLs first'], + ['https://github.com/foo/private.git', 'GitHub shortcuts try HTTPS URLs third'], + ['git@github.com:foo/private.git', 'GitHub shortcuts try SSH second'] + ] + var npm = requireInject.installGlobally('../../lib/npm.js', { + 'child_process': { + 'execFile': function (cmd, args, options, cb) { + process.nextTick(function () { + if (args[0] !== 'clone') return cb(null, '', '') + var cloneUrl = cloneUrls.shift() + if (cloneUrl) { + t.is(args[3], cloneUrl[0], cloneUrl[1]) + } else { + t.fail('too many attempts to clone') + } + cb(new Error()) + }) + } + } + }) + + var opts = { + cache: path.resolve(pkg, 'cache'), + prefix: pkg, + registry: common.registry, + loglevel: 'silent' + } + npm.load(opts, function (er) { + t.ifError(er, 'npm loaded without error') + npm.commands.install(['foo/private'], function (er, result) { + t.ok(er, 'mocked install failed as expected') + t.end() + }) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function setup () { + cleanup() + mkdirp.sync(pkg) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + process.chdir(pkg) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/gitlab-shortcut-package.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/gitlab-shortcut-package.js new file mode 100644 index 00000000..65780844 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/gitlab-shortcut-package.js @@ -0,0 +1,83 @@ +'use strict' +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var requireInject = require('require-inject') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var pkg = path.resolve(__dirname, 'gitlab-shortcut-package') + +var json = { + name: 'gitlab-shortcut-package', + version: '0.0.0', + dependencies: { + 'private': 'gitlab:foo/private' + } +} + +test('setup', function (t) { + setup() + t.end() +}) + +test('gitlab-shortcut-package', function (t) { + var cloneUrls = [ + ['git@gitlab.com:foo/private.git', 'GitLab shortcuts try SSH first'], + ['https://gitlab.com/foo/private.git', 'GitLab shortcuts try HTTPS URLs second'] + ] + var npm = requireInject.installGlobally('../../lib/npm.js', { + 'child_process': { + 'execFile': function (cmd, args, options, cb) { + process.nextTick(function () { + if (args[0] !== 'clone') return cb(null, '', '') + var cloneUrl = cloneUrls.shift() + if (cloneUrl) { + t.is(args[3], cloneUrl[0], cloneUrl[1]) + } else { + t.fail('too many attempts to clone') + } + cb(new Error()) + }) + } + } + }) + + var opts = { + cache: path.resolve(pkg, 'cache'), + prefix: pkg, + registry: common.registry, + loglevel: 'silent' + } + npm.load(opts, function (er) { + t.ifError(er, 'npm loaded without error') + npm.commands.install([], function (er, result) { + t.ok(er, 'mocked install failed as expected') + t.end() + }) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function setup () { + cleanup() + mkdirp.sync(pkg) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + process.chdir(pkg) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/gitlab-shortcut.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/gitlab-shortcut.js new file mode 100644 index 00000000..4a1e2b0b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/gitlab-shortcut.js @@ -0,0 +1,80 @@ +'use strict' +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var requireInject = require('require-inject') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var pkg = path.resolve(__dirname, 'gitlab-shortcut') + +var json = { + name: 'gitlab-shortcut', + version: '0.0.0' +} + +test('setup', function (t) { + setup() + t.end() +}) + +test('gitlab-shortcut', function (t) { + var cloneUrls = [ + ['git@gitlab.com:foo/private.git', 'GitLab shortcuts try SSH first'], + ['https://gitlab.com/foo/private.git', 'GitLab shortcuts try HTTPS URLs second'] + ] + var npm = requireInject.installGlobally('../../lib/npm.js', { + 'child_process': { + 'execFile': function (cmd, args, options, cb) { + process.nextTick(function () { + if (args[0] !== 'clone') return cb(null, '', '') + var cloneUrl = cloneUrls.shift() + if (cloneUrl) { + t.is(args[3], cloneUrl[0], cloneUrl[1]) + } else { + t.fail('too many attempts to clone') + } + cb(new Error()) + }) + } + } + }) + + var opts = { + cache: path.resolve(pkg, 'cache'), + prefix: pkg, + registry: common.registry, + loglevel: 'silent' + } + npm.load(opts, function (er) { + t.ifError(er, 'npm loaded without error') + npm.commands.install(['gitlab:foo/private'], function (er, result) { + t.ok(er, 'mocked install failed as expected') + t.end() + }) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function setup () { + cleanup() + mkdirp.sync(pkg) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + process.chdir(pkg) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/global-prefix-set-in-userconfig.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/global-prefix-set-in-userconfig.js new file mode 100644 index 00000000..f820a277 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/global-prefix-set-in-userconfig.js @@ -0,0 +1,36 @@ +var common = require("../common-tap.js") +var test = require("tap").test +var rimraf = require("rimraf") +var prefix = __filename.replace(/\.js$/, "") +var rcfile = __filename.replace(/\.js$/, ".npmrc") +var fs = require("fs") +var conf = "prefix = " + prefix + "\n" + +test("setup", function (t) { + rimraf.sync(prefix) + fs.writeFileSync(rcfile, conf) + t.pass("ready") + t.end() +}) + +test("run command", function (t) { + var args = ["prefix", "-g", "--userconfig=" + rcfile] + common.npm(args, {env: {}}, function (er, code, so) { + if (er) throw er + t.notOk(code, "npm prefix exited with code 0") + t.equal(so.trim(), prefix) + t.end() + }) +}) + +test("made dir", function (t) { + t.ok(fs.statSync(prefix).isDirectory()) + t.end() +}) + +test("cleanup", function (t) { + rimraf.sync(prefix) + rimraf.sync(rcfile) + t.pass("clean") + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/graceful-restart.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/graceful-restart.js new file mode 100644 index 00000000..53264748 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/graceful-restart.js @@ -0,0 +1,118 @@ +var fs = require('fs') +var resolve = require('path').resolve + +var osenv = require('osenv') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var pkg = resolve(__dirname, 'graceful-restart') + +var outGraceless = [ + 'prerestart', + 'prestop', + 'stop', + 'poststop', + 'prestart', + 'start', + 'poststart', + 'postrestart', + '' +].join('\n') + +var outGraceful = [ + 'prerestart', + 'restart', + 'postrestart', + '' +].join('\n') + +var pjGraceless = JSON.stringify({ + name: 'graceless', + version: '1.2.3', + scripts: { + 'prestop': 'echo prestop', + 'stop': 'echo stop', + 'poststop': 'echo poststop', + 'prerestart': 'echo prerestart', + 'postrestart': 'echo postrestart', + 'prestart': 'echo prestart', + 'start': 'echo start', + 'poststart': 'echo poststart' + } +}, null, 2) + '\n' + +var pjGraceful = JSON.stringify({ + name: 'graceful', + version: '1.2.3', + scripts: { + 'prestop': 'echo prestop', + 'stop': 'echo stop', + 'poststop': 'echo poststop', + 'prerestart': 'echo prerestart', + 'restart': 'echo restart', + 'postrestart': 'echo postrestart', + 'prestart': 'echo prestart', + 'start': 'echo start', + 'poststart': 'echo poststart' + } +}, null, 2) + '\n' + +test('setup', function (t) { + bootstrap() + t.end() +}) + +test('graceless restart', function (t) { + fs.writeFileSync(resolve(pkg, 'package.json'), pjGraceless) + createChild(['run-script', 'restart'], function (err, code, out) { + t.ifError(err, 'restart finished successfully') + t.equal(code, 0, 'npm run-script exited with code') + t.equal(out, outGraceless, 'expected all scripts to run') + t.end() + }) +}) + +test('graceful restart', function (t) { + fs.writeFileSync(resolve(pkg, 'package.json'), pjGraceful) + createChild(['run-script', 'restart'], function (err, code, out) { + t.ifError(err, 'restart finished successfully') + t.equal(code, 0, 'npm run-script exited with code') + t.equal(out, outGraceful, 'expected only *restart scripts to run') + t.end() + }) +}) + +test('clean', function (t) { + cleanup() + t.end() +}) + +function bootstrap () { + mkdirp.sync(pkg) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} + +function createChild (args, cb) { + var env = { + HOME: process.env.HOME, + Path: process.env.PATH, + PATH: process.env.PATH, + 'npm_config_loglevel': 'silent' + } + + if (process.platform === 'win32') + env.npm_config_cache = '%APPDATA%\\npm-cache' + + return common.npm(args, { + cwd: pkg, + stdio: ['ignore', 'pipe', 'ignore'], + env: env + }, cb) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/ignore-install-link.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/ignore-install-link.js new file mode 100644 index 00000000..45db51d3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/ignore-install-link.js @@ -0,0 +1,69 @@ +if (process.platform === "win32") { + console.log("ok - symlinks are weird on windows, skip this test") + return +} +var common = require("../common-tap.js") +var test = require("tap").test +var path = require("path") +var fs = require("fs") +var rimraf = require("rimraf") +var mkdirp = require("mkdirp") + +var root = path.resolve(__dirname, "ignore-install-link") +var pkg = path.resolve(root, "pkg") +var dep = path.resolve(root, "dep") +var target = path.resolve(pkg, "node_modules", "dep") +var cache = path.resolve(root, "cache") +var globalPath = path.resolve(root, "global") + +var pkgj = { "name":"pkg", "version": "1.2.3" + , "dependencies": { "dep": "1.2.3" } } +var depj = { "name": "dep", "version": "1.2.3" } + +var myreg = require("http").createServer(function (q, s) { + s.statusCode = 403 + s.end(JSON.stringify({"error":"forbidden"}) + "\n") +}).listen(common.port) + +test("setup", function (t) { + rimraf.sync(root) + mkdirp.sync(root) + mkdirp.sync(path.resolve(pkg, "node_modules")) + mkdirp.sync(dep) + mkdirp.sync(cache) + mkdirp.sync(globalPath) + fs.writeFileSync(path.resolve(pkg, "package.json"), JSON.stringify(pkgj)) + fs.writeFileSync(path.resolve(dep, "package.json"), JSON.stringify(depj)) + fs.symlinkSync(dep, target, "dir") + t.end() +}) + +test("ignore install if package is linked", function (t) { + common.npm(["install"], { + cwd: pkg, + env: { + PATH: process.env.PATH || process.env.Path, + HOME: process.env.HOME, + "npm_config_prefix": globalPath, + "npm_config_cache": cache, + "npm_config_registry": common.registry, + "npm_config_loglevel": "silent" + }, + stdio: "inherit" + }, function (er, code) { + if (er) throw er + t.equal(code, 0, "npm install exited with code") + t.end() + }) +}) + +test("still a symlink", function (t) { + t.equal(true, fs.lstatSync(target).isSymbolicLink()) + t.end() +}) + +test("cleanup", function (t) { + rimraf.sync(root) + myreg.close() + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/ignore-scripts.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/ignore-scripts.js new file mode 100644 index 00000000..8c0d3501 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/ignore-scripts.js @@ -0,0 +1,124 @@ +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap') + +// ignore-scripts/package.json has scripts that always exit with non-zero error +// codes. +var pkg = path.resolve(__dirname, 'ignore-scripts') + +var gypfile = 'bad_binding_file\n' +var json = { + author: 'Milton the Aussie', + name: 'ignore-scripts', + version: '0.0.0', + scripts: { + prepublish: 'exit 123', + publish: 'exit 123', + postpublish: 'exit 123', + preinstall: 'exit 123', + install: 'exit 123', + postinstall: 'exit 123', + preuninstall: 'exit 123', + uninstall: 'exit 123', + postuninstall: 'exit 123', + pretest: 'exit 123', + test: 'exit 123', + posttest: 'exit 123', + prestop: 'exit 123', + stop: 'exit 123', + poststop: 'exit 123', + prestart: 'exit 123', + start: 'exit 123', + poststart: 'exit 123', + prerestart: 'exit 123', + restart: 'exit 123', + postrestart: 'exit 123', + preversion: 'exit 123', + version: 'exit 123', + postversion: 'exit 123' + } +} + +test('setup', function (t) { + setup() + t.end() +}) + +test('ignore-scripts: install using the option', function (t) { + createChild(['install', '--ignore-scripts'], function (err, code) { + t.ifError(err, 'install with scripts ignored finished successfully') + t.equal(code, 0, 'npm install exited with code') + t.end() + }) +}) + +test('ignore-scripts: install NOT using the option', function (t) { + createChild(['install'], function (err, code) { + t.ifError(err, 'install with scripts successful') + t.notEqual(code, 0, 'npm install exited with code') + t.end() + }) +}) + +var scripts = [ + 'prepublish', 'publish', 'postpublish', + 'preinstall', 'install', 'postinstall', + 'preuninstall', 'uninstall', 'postuninstall', + 'pretest', 'test', 'posttest', + 'prestop', 'stop', 'poststop', + 'prestart', 'start', 'poststart', + 'prerestart', 'restart', 'postrestart', + 'preversion', 'version', 'postversion' +] + +scripts.forEach(function (script) { + test('ignore-scripts: run-script ' + script + ' using the option', function (t) { + createChild(['--ignore-scripts', 'run-script', script], function (err, code, stdout, stderr) { + t.ifError(err, 'run-script ' + script + ' with ignore-scripts successful') + t.equal(code, 0, 'npm run-script exited with code') + t.end() + }) + }) +}) + +scripts.forEach(function (script) { + test('ignore-scripts: run-script ' + script + ' NOT using the option', function (t) { + createChild(['run-script', script], function (err, code) { + t.ifError(err, 'run-script ' + script + ' finished successfully') + t.notEqual(code, 0, 'npm run-script exited with code') + t.end() + }) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + rimraf.sync(pkg) +} + +function setup () { + cleanup() + mkdirp.sync(pkg) + fs.writeFileSync(path.join(pkg, 'binding.gyp'), gypfile) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) +} + +function createChild (args, cb) { + return common.npm( + args.concat(['--loglevel', 'silent']), + { cwd: pkg }, + cb + ) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/ignore-shrinkwrap.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/ignore-shrinkwrap.js new file mode 100644 index 00000000..9468162e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/ignore-shrinkwrap.js @@ -0,0 +1,135 @@ +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var pkg = require('path').join(__dirname, 'ignore-shrinkwrap') + +var EXEC_OPTS = { cwd: pkg } + +var customMocks = { + 'get': { + '/package.js': [200, { ente: true }], + '/shrinkwrap.js': [200, { ente: true }] + } +} + +var json = { + author: 'Rocko Artischocko', + name: 'ignore-shrinkwrap', + version: '0.0.0', + dependencies: { + 'npm-test-ignore-shrinkwrap-file': 'http://localhost:1337/package.js' + } +} + +var shrinkwrap = { + name: 'ignore-shrinkwrap', + version: '0.0.0', + dependencies: { + 'npm-test-ignore-shrinkwrap-file': { + version: '1.2.3', + from: 'http://localhost:1337/shrinkwrap.js', + resolved: 'http://localhost:1337/shrinkwrap.js', + dependencies: { + opener: { + version: '1.3.0', + from: 'opener@1.3.0' + } + } + } + } +} + +test('setup', function (t) { + setup() + t.end() +}) + +test('npm install --no-shrinkwrap', function (t) { + mr({ port: common.port, mocks: customMocks }, function (err, s) { + t.ifError(err, 'mock registry bootstrapped without issue') + s._server.on('request', function (req) { + switch (req.url) { + case '/shrinkwrap.js': + t.fail('npm-shrinkwrap.json used instead of package.json') + break + case '/package.js': + t.pass('package.json used') + } + }) + + common.npm( + [ + '--registry', common.registry, + '--loglevel', 'silent', + 'install', '--no-shrinkwrap' + ], + EXEC_OPTS, + function (err, code) { + t.ifError(err, 'npm ran without issue') + t.ok(code, "install isn't going to succeed") + s.close() + t.end() + } + ) + }) +}) + +test('npm install (with shrinkwrap)', function (t) { + mr({ port: common.port, mocks: customMocks }, function (err, s) { + t.ifError(err, 'mock registry bootstrapped without issue') + s._server.on('request', function (req) { + switch (req.url) { + case '/shrinkwrap.js': + t.pass('shrinkwrap used') + break + case '/package.js': + t.fail('shrinkwrap ignored') + } + }) + + common.npm( + [ + '--registry', common.registry, + '--loglevel', 'silent', + 'install' + ], + EXEC_OPTS, + function (err, code) { + t.ifError(err, 'npm ran without issue') + t.ok(code, "install isn't going to succeed") + s.close() + t.end() + } + ) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + rimraf.sync(pkg) +} + +function setup () { + cleanup() + mkdirp.sync(pkg) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + fs.writeFileSync( + path.join(pkg, 'npm-shrinkwrap.json'), + JSON.stringify(shrinkwrap, null, 2) + ) + process.chdir(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/init-interrupt.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/init-interrupt.js new file mode 100644 index 00000000..962ab724 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/init-interrupt.js @@ -0,0 +1,58 @@ +// if "npm init" is interrupted with ^C, don't report +// "init written successfully" +var test = require("tap").test +var path = require("path") +var osenv = require("osenv") +var rimraf = require("rimraf") +var npmlog = require("npmlog") +var requireInject = require("require-inject") + +var npm = require("../../lib/npm.js") + +var PKG_DIR = path.resolve(__dirname, "init-interrupt") + +test("setup", function (t) { + cleanup() + + t.end() +}) + +test("issue #6684 remove confusing message", function (t) { + + var initJsonMock = function (dir, input, config, cb) { + process.nextTick(function () { + cb({message : "canceled"}) + }) + } + initJsonMock.yes = function () { return true } + + npm.load({loglevel : "silent"}, function () { + var log = "" + var init = requireInject("../../lib/init", { + "init-package-json": initJsonMock + }) + + // capture log messages + npmlog.on("log", function (chunk) { log += chunk.message + "\n" } ) + + init([], function (err, code) { + t.ifError(err, "init ran successfully") + t.notOk(code, "exited without issue") + t.notSimilar(log, /written successfully/, "no success message written") + t.similar(log, /canceled/, "alerted that init was canceled") + + t.end() + }) + }) +}) + +test("cleanup", function (t) { + cleanup() + + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(PKG_DIR) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-at-locally.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-at-locally.js new file mode 100644 index 00000000..9c5d8598 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-at-locally.js @@ -0,0 +1,69 @@ +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var pkg = path.join(__dirname, 'install-at-locally') + +var EXEC_OPTS = { cwd: pkg } + +var json = { + name: 'install-at-locally', + version: '0.0.0' +} + +test('setup', function (t) { + cleanup() + t.end() +}) + +test('\'npm install ./package@1.2.3\' should install local pkg', function (t) { + var target = './package@1.2.3' + setup(target) + common.npm(['install', target], EXEC_OPTS, function (err, code) { + var p = path.resolve(pkg, 'node_modules/install-at-locally/package.json') + t.ifError(err, 'install local package successful') + t.equal(code, 0, 'npm install exited with code') + t.ok(JSON.parse(fs.readFileSync(p, 'utf8'))) + t.end() + }) +}) + +test('\'npm install install/at/locally@./package@1.2.3\' should install local pkg', function (t) { + var target = 'install/at/locally@./package@1.2.3' + setup(target) + common.npm(['install', target], EXEC_OPTS, function (err, code) { + var p = path.resolve(pkg, 'node_modules/install-at-locally/package.json') + t.ifError(err, 'install local package in explicit directory successful') + t.equal(code, 0, 'npm install exited with code') + t.ok(JSON.parse(fs.readFileSync(p, 'utf8'))) + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} + +function setup (target) { + cleanup() + var root = path.resolve(pkg, target) + mkdirp.sync(root) + fs.writeFileSync( + path.join(root, 'package.json'), + JSON.stringify(json, null, 2) + ) + mkdirp.sync(path.resolve(pkg, 'node_modules')) + process.chdir(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-bad-man.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-bad-man.js new file mode 100644 index 00000000..9ec8a847 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-bad-man.js @@ -0,0 +1,80 @@ +var fs = require("fs") +var resolve = require("path").resolve + +var osenv = require("osenv") +var mkdirp = require("mkdirp") +var rimraf = require("rimraf") +var test = require("tap").test + +var common = require("../common-tap.js") + +var pkg = resolve(__dirname, "install-bad-man") +var target = resolve(__dirname, "install-bad-man-target") + +var EXEC_OPTS = { + cwd: target +} + +var json = { + name : "install-bad-man", + version : "1.2.3", + man : [ "./install-bad-man.1.lol" ] +} + + +test("setup", function (t) { + setup() + t.pass("setup ran") + t.end() +}) + +test("install from repo on 'OS X'", function (t) { + common.npm( + [ + "install", + "--prefix", target, + "--global", + pkg + ], + EXEC_OPTS, + function (err, code, stdout, stderr) { + t.ifError(err, "npm command ran from test") + t.equals(code, 1, "install exited with failure (1)") + t.notOk(stdout, "no output indicating success") + t.notOk( + stderr.match(/Cannot read property '1' of null/), + "no longer has cryptic error output" + ) + t.ok( + stderr.match(/install-bad-man\.1\.lol is not a valid name/), + "got expected error output" + ) + + t.end() + } + ) +}) + +test("clean", function (t) { + cleanup() + t.pass("cleaned up") + t.end() +}) + +function setup () { + cleanup() + mkdirp.sync(pkg) + // make sure it installs locally + mkdirp.sync(resolve(target, "node_modules")) + fs.writeFileSync( + resolve(pkg, "package.json"), + JSON.stringify(json, null, 2)+"\n" + ) + fs.writeFileSync(resolve(pkg, "install-bad-man.1.lol"), "lol\n") +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) + rimraf.sync(target) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-cli-production.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-cli-production.js new file mode 100644 index 00000000..fbaf23af --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-cli-production.js @@ -0,0 +1,88 @@ +var fs = require('graceful-fs') +var path = require('path') +var existsSync = fs.existsSync || path.existsSync + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var pkg = path.join(__dirname, 'install-cli-production') + +var EXEC_OPTS = { cwd: pkg } + +var json = { + name: 'install-cli-production', + description: 'fixture', + version: '0.0.0', + scripts: { + prepublish: 'exit 123' + }, + dependencies: { + dependency: 'file:./dependency' + }, + devDependencies: { + 'dev-dependency': 'file:./dev-dependency' + } +} + +var dependency = { + name: 'dependency', + description: 'fixture', + version: '0.0.0' +} + +var devDependency = { + name: 'dev-dependency', + description: 'fixture', + version: '0.0.0' +} + +test('setup', function (t) { + mkdirp.sync(path.join(pkg, 'dependency')) + fs.writeFileSync( + path.join(pkg, 'dependency', 'package.json'), + JSON.stringify(dependency, null, 2) + ) + + mkdirp.sync(path.join(pkg, 'devDependency')) + fs.writeFileSync( + path.join(pkg, 'devDependency', 'package.json'), + JSON.stringify(devDependency, null, 2) + ) + + mkdirp.sync(path.join(pkg, 'node_modules')) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + + process.chdir(pkg) + t.end() +}) + +test('\'npm install --production\' should only install dependencies', function (t) { + common.npm(['install', '--production'], EXEC_OPTS, function (err, code) { + t.ifError(err, 'install production successful') + t.equal(code, 0, 'npm install did not raise error code') + t.ok( + JSON.parse(fs.readFileSync( + path.resolve(pkg, 'node_modules/dependency/package.json'), 'utf8') + ), + 'dependency was installed' + ) + t.notOk( + existsSync(path.resolve(pkg, 'node_modules/dev-dependency/package.json')), + 'devDependency was NOT installed' + ) + t.end() + }) +}) + +test('cleanup', function (t) { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-cli-unicode.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-cli-unicode.js new file mode 100644 index 00000000..01a5f4a4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-cli-unicode.js @@ -0,0 +1,71 @@ +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') +var server + +var pkg = path.resolve(__dirname, 'install-cli-unicode') + +function hasOnlyAscii (s) { + return /^[\000-\177]*$/.test(s) +} + +var EXEC_OPTS = { cwd: pkg } + +var json = { + name: 'install-cli', + description: 'fixture', + version: '0.0.1', + dependencies: { + read: '1.0.5' + } +} + +test('setup', function (t) { + rimraf.sync(pkg) + mkdirp.sync(pkg) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + + mr({ port: common.port }, function (er, s) { + server = s + t.end() + }) +}) + +test('does not use unicode with --unicode false', function (t) { + common.npm( + [ + '--unicode', 'false', + '--registry', common.registry, + '--loglevel', 'silent', + 'install', 'optimist' + ], + EXEC_OPTS, + function (err, code, stdout) { + t.ifError(err, 'install package read without unicode success') + t.notOk(code, 'npm install exited with code 0') + t.ifError(err, 'npm install ran without issue') + t.ok(stdout, 'got some output') + t.ok(hasOnlyAscii(stdout), 'only ASCII in install output') + + t.end() + } + ) +}) + +test('cleanup', function (t) { + server.close() + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) + + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-from-local.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-from-local.js new file mode 100644 index 00000000..3cac382a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-from-local.js @@ -0,0 +1,98 @@ +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap') + +var root = path.join(__dirname, 'install-from-local') +var pkg = path.join(root, 'package-with-local-paths') + +var EXEC_OPTS = { cwd: pkg } + +var localPaths = { + name: 'package-with-local-paths', + version: '0.0.0', + dependencies: { + 'package-local-dependency': 'file:../package-local-dependency' + }, + devDependencies: { + 'package-local-dev-dependency': 'file:../package-local-dev-dependency' + } +} + +var localDependency = { + name: 'package-local-dependency', + version: '0.0.0', + description: 'Test for local installs' +} + +var localDevDependency = { + name: 'package-local-dev-dependency', + version: '0.0.0', + description: 'Test for local installs' +} + +test('setup', function (t) { + rimraf.sync(pkg) + mkdirp.sync(pkg) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(localPaths, null, 2) + ) + + mkdirp.sync(path.join(root, 'package-local-dependency')) + fs.writeFileSync( + path.join(root, 'package-local-dependency', 'package.json'), + JSON.stringify(localDependency, null, 2) + ) + + mkdirp.sync(path.join(root, 'package-local-dev-dependency')) + fs.writeFileSync( + path.join(root, 'package-local-dev-dependency', 'package.json'), + JSON.stringify(localDevDependency, null, 2) + ) + + process.chdir(pkg) + t.end() +}) + +test('\'npm install\' should install local packages', function (t) { + common.npm( + [ + 'install', '.' + ], + EXEC_OPTS, + function (err, code) { + t.ifError(err, 'error should not exist') + t.notOk(code, 'npm install exited with code 0') + var dependencyPackageJson = path.resolve( + pkg, + 'node_modules/package-local-dependency/package.json' + ) + t.ok( + JSON.parse(fs.readFileSync(dependencyPackageJson, 'utf8')), + 'package with local dependency installed' + ) + + var devDependencyPackageJson = path.resolve( + pkg, 'node_modules/package-local-dev-dependency/package.json' + ) + t.ok( + JSON.parse(fs.readFileSync(devDependencyPackageJson, 'utf8')), + 'package with local dev dependency installed' + ) + + t.end() + } + ) +}) + +test('cleanup', function (t) { + process.chdir(osenv.tmpdir()) + rimraf.sync(root) + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-link-scripts.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-link-scripts.js new file mode 100644 index 00000000..5ad2feaf --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-link-scripts.js @@ -0,0 +1,132 @@ +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var pkg = path.join(__dirname, 'install-link-scripts') +var tmp = path.join(pkg, 'tmp') +var dep = path.join(pkg, 'dep') + +var json = { + name: 'install-link-scripts', + version: '1.0.0', + description: 'a test', + repository: 'git://github.com/npm/npm.git', + license: 'ISC' +} + +var dependency = { + name: 'dep', + version: '1.0.0', + scripts: { + install: './bin/foo' + } +} + +var foo = function () {/* +#!/usr/bin/env node + +console.log('hey sup') +*/}.toString().split('\n').slice(1, -1).join('\n') + +process.env.npm_config_prefix = tmp + +test('plain install', function (t) { + setup() + + common.npm( + [ + 'install', dep, + '--tmp', tmp + ], + { cwd: pkg }, + function (err, code, stdout, stderr) { + t.ifErr(err, 'npm install ' + dep + ' finished without error') + t.equal(code, 0, 'exited ok') + t.notOk(stderr, 'no output stderr') + t.match(stdout, /hey sup/, 'postinstall script for dep ran') + t.end() + } + ) +}) + +test('link', function (t) { + setup() + + common.npm( + [ + 'link', + '--tmp', tmp + ], + { cwd: dep }, + function (err, code, stdout, stderr) { + t.ifErr(err, 'npm link finished without error') + t.equal(code, 0, 'exited ok') + t.notOk(stderr, 'no output stderr') + t.match(stdout, /hey sup/, 'script ran') + t.end() + } + ) +}) + +test('install --link', function (t) { + setup() + + common.npm( + [ + 'link', + '--tmp', tmp + ], + { cwd: dep }, + function (err, code, stdout, stderr) { + t.ifErr(err, 'npm link finished without error') + + common.npm( + [ + 'install', '--link', dependency.name, + '--tmp', tmp + ], + { cwd: pkg }, + function (err, code, stdout, stderr) { + t.ifErr(err, 'npm install --link finished without error') + t.equal(code, 0, 'exited ok') + t.notOk(stderr, 'no output stderr') + t.notMatch(stdout, /hey sup/, "script didn't run") + t.end() + } + ) + } + ) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function setup () { + cleanup() + mkdirp.sync(tmp) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + + mkdirp.sync(path.join(dep, 'bin')) + fs.writeFileSync( + path.join(dep, 'package.json'), + JSON.stringify(dependency, null, 2) + ) + fs.writeFileSync(path.join(dep, 'bin', 'foo'), foo) + fs.chmod(path.join(dep, 'bin', 'foo'), '0755') +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-man.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-man.js new file mode 100644 index 00000000..ebba5d87 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-man.js @@ -0,0 +1,75 @@ +var fs = require("fs") +var resolve = require("path").resolve + +var osenv = require("osenv") +var mkdirp = require("mkdirp") +var rimraf = require("rimraf") +var test = require("tap").test + +var common = require("../common-tap.js") + +var pkg = resolve(__dirname, "install-man") +var target = resolve(__dirname, "install-man-target") + +var EXEC_OPTS = { + cwd: target +} + +var json = { + name : "install-man", + version : "1.2.3", + man : [ "./install-man.1" ] +} + +test("setup", function (t) { + setup() + t.pass("setup ran") + t.end() +}) + +test("install man page", function (t) { + common.npm( + [ + "install", + "--prefix", target, + "--global", + pkg + ], + EXEC_OPTS, + function (err, code, stdout, stderr) { + t.ifError(err, "npm command ran from test") + t.equals(code, 0, "install exited with success (0)") + t.ok(stdout, "output indicating success") + t.ok( + fs.existsSync(resolve(target, "share", "man", "man1", "install-man.1")), + "man page link was created" + ) + + t.end() + } + ) +}) + +test("clean", function (t) { + cleanup() + t.pass("cleaned up") + t.end() +}) + +function setup () { + cleanup() + mkdirp.sync(pkg) + // make sure it installs locally + mkdirp.sync(resolve(target, "node_modules")) + fs.writeFileSync( + resolve(pkg, "package.json"), + JSON.stringify(json, null, 2)+"\n" + ) + fs.writeFileSync(resolve(pkg, "install-man.1"), "THIS IS A MANPAGE\n") +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) + rimraf.sync(target) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-noargs-dev.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-noargs-dev.js new file mode 100644 index 00000000..f16a7498 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-noargs-dev.js @@ -0,0 +1,109 @@ +var fs = require('fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') +var server + +var pkg = path.join(__dirname, 'install-noargs-dev') + +var EXEC_OPTS = { cwd: pkg } + +var PACKAGE_JSON1 = { + name: 'install-noargs-dev', + version: '0.0.1', + devDependencies: { + 'underscore': '1.3.1' + } +} + +var PACKAGE_JSON2 = { + name: 'install-noargs-dev', + version: '0.0.2', + devDependencies: { + 'underscore': '1.5.1' + } +} + +test('setup', function (t) { + setup() + mr({ port: common.port }, function (er, s) { + t.ifError(er, 'started mock registry') + server = s + t.end() + }) +}) + +test('install noargs installs devDependencies', function (t) { + common.npm( + [ + '--registry', common.registry, + '--loglevel', 'silent', + 'install' + ], + EXEC_OPTS, + function (err, code) { + t.ifError(err, 'npm install ran without issue') + t.notOk(code, 'npm install exited with code 0') + + var p = path.join(pkg, 'node_modules', 'underscore', 'package.json') + var pkgJson = JSON.parse(fs.readFileSync(p)) + + t.equal(pkgJson.version, '1.3.1') + t.end() + } + ) +}) + +test('install noargs installs updated devDependencies', function (t) { + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(PACKAGE_JSON2, null, 2) + ) + + common.npm( + [ + '--registry', common.registry, + '--loglevel', 'silent', + 'install' + ], + EXEC_OPTS, + function (err, code) { + t.ifError(err, 'npm install ran without issue') + t.notOk(code, 'npm install exited with code 0') + + var p = path.join(pkg, 'node_modules', 'underscore', 'package.json') + var pkgJson = JSON.parse(fs.readFileSync(p)) + + t.equal(pkgJson.version, '1.5.1') + t.end() + } + ) +}) + +test('cleanup', function (t) { + server.close() + cleanup() + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} + +function setup () { + cleanup() + mkdirp.sync(path.resolve(pkg, 'node_modules')) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(PACKAGE_JSON1, null, 2) + ) + + process.chdir(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-preferglobal-warnings.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-preferglobal-warnings.js new file mode 100644 index 00000000..9cd2644c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-preferglobal-warnings.js @@ -0,0 +1,131 @@ +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var preferGlobalJson = { + name: 'npm-test-preferglobal-dep', + version: '0.0.0', + preferGlobal: true +} + +var dependenciesJson = { + name: 'npm-test-preferglobal-dependency-check', + version: '0.0.0', + dependencies: { + 'npm-test-preferglobal-dep': 'file:../' + preferGlobalJson.name + } +} + +var devDependenciesJson = { + name: 'npm-test-preferglobal-devDependency-check', + version: '0.0.0', + devDependencies: { + 'npm-test-preferglobal-dep': 'file:../' + preferGlobalJson.name + } +} + +var emptyPackage = { + name: 'npm-test-preferglobal-empty-package', + version: '0.0.0' +} + +test('install a preferGlobal dependency without warning', function (t) { + setup(dependenciesJson) + common.npm([ + 'install', + '--loglevel=warn' + ], {}, function (err, code, stdout, stderr) { + t.ifError(err, 'packages were installed') + t.notMatch( + stderr, + /WARN.*prefer global/, + 'install should not warn when dependency is preferGlobal') + t.end() + }) +}) + +test('install a preferGlobal dependency without warning', function (t) { + setup(devDependenciesJson) + common.npm([ + 'install', + '--loglevel=warn' + ], {}, function (err, code, stdout, stderr) { + t.ifError(err, 'packages were installed') + t.notMatch( + stderr, + /WARN.*prefer global/, + 'install should not warn when devDependency is preferGlobal') + t.end() + }) +}) + +test('warn if a preferGlobal package is being installed direct', function (t) { + setup(emptyPackage) + common.npm([ + 'install', + 'file:../' + preferGlobalJson.name, + '--loglevel=warn' + ], {}, function (err, code, stdout, stderr) { + t.ifError(err, 'packages were installed') + t.match( + stderr, + /WARN.*prefer global/, + 'install should warn when new package is preferGlobal') + t.end() + }) +}) + +test('warn if a preferGlobal package is being saved', function (t) { + setup(emptyPackage) + common.npm([ + 'install', + 'file:../' + preferGlobalJson.name, + '--save', + '--loglevel=warn' + ], {}, function (err, code, stdout, stderr) { + t.ifError(err, 'packages were installed') + t.match( + stderr, + /WARN.*prefer global/, + 'install should warn when new package is preferGlobal') + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function setup (json) { + cleanup() + mkPkg(preferGlobalJson) + process.chdir(mkPkg(json)) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + var pkgs = [preferGlobalJson, + dependenciesJson, + devDependenciesJson, + emptyPackage] + pkgs.forEach(function (json) { + rimraf.sync(path.resolve(__dirname, json.name)) + }) +} + +function mkPkg (json) { + var pkgPath = path.resolve(__dirname, json.name) + mkdirp.sync(pkgPath) + fs.writeFileSync( + path.join(pkgPath, 'package.json'), + JSON.stringify(json, null, 2) + ) + return pkgPath +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-save-exact.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-save-exact.js new file mode 100644 index 00000000..14e32f0f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-save-exact.js @@ -0,0 +1,114 @@ +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') +var server + +var pkg = path.join(__dirname, 'install-save-exact') + +var EXEC_OPTS = { cwd: pkg } + +var json = { + name: 'install-save-exact', + version: '0.0.1', + description: 'fixture' +} + +test('setup', function (t) { + setup() + mr({ port: common.port }, function (er, s) { + server = s + t.end() + }) +}) + +test('\'npm install --save --save-exact\' should install local pkg', function (t) { + common.npm( + [ + '--loglevel', 'silent', + '--registry', common.registry, + '--save', + '--save-exact', + 'install', 'underscore@1.3.1' + ], + EXEC_OPTS, + function (err, code) { + t.ifError(err, 'npm ran without issue') + t.notOk(code, 'npm install exited without raising an error code') + + var p = path.resolve(pkg, 'node_modules/underscore/package.json') + t.ok(JSON.parse(fs.readFileSync(p))) + + p = path.resolve(pkg, 'package.json') + var pkgJson = JSON.parse(fs.readFileSync(p, 'utf8')) + + t.same( + pkgJson.dependencies, + { 'underscore': '1.3.1' }, + 'underscore dependency should specify exactly 1.3.1' + ) + + t.end() + } + ) +}) + +test('\'npm install --save-dev --save-exact\' should install local pkg', function (t) { + setup() + + common.npm( + [ + '--loglevel', 'silent', + '--registry', common.registry, + '--save-dev', + '--save-exact', + 'install', 'underscore@1.3.1' + ], + EXEC_OPTS, + function (err, code) { + t.ifError(err, 'npm ran without issue') + t.notOk(code, 'npm install exited without raising an error code') + + var p = path.resolve(pkg, 'node_modules/underscore/package.json') + t.ok(JSON.parse(fs.readFileSync(p))) + + p = path.resolve(pkg, 'package.json') + var pkgJson = JSON.parse(fs.readFileSync(p, 'utf8')) + + t.same( + pkgJson.devDependencies, + { 'underscore': '1.3.1' }, + 'underscore dependency should specify exactly 1.3.1' + ) + + t.end() + } + ) +}) + +test('cleanup', function (t) { + server.close() + cleanup() + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} + +function setup () { + cleanup() + mkdirp.sync(path.resolve(pkg, 'node_modules')) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + process.chdir(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-save-local.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-save-local.js new file mode 100644 index 00000000..33a1c613 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-save-local.js @@ -0,0 +1,126 @@ +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var root = path.join(__dirname, 'install-save-local') +var pkg = path.join(root, 'package') + +var EXEC_OPTS = { cwd: pkg } + +var json = { + name: 'install-save-local', + version: '0.0.0' +} + +var localDependency = { + name: 'package-local-dependency', + version: '0.0.0' +} + +var localDevDependency = { + name: 'package-local-dev-dependency', + version: '0.0.0' +} + +test('setup', function (t) { + setup() + t.end() +}) + +test('\'npm install --save ../local/path\' should save to package.json', function (t) { + common.npm( + [ + '--loglevel', 'silent', + '--save', + 'install', '../package-local-dependency' + ], + EXEC_OPTS, + function (err, code) { + t.ifError(err, 'npm install ran without issue') + t.notOk(code, 'npm install exited with code 0') + + var dependencyPackageJson = path.join( + pkg, 'node_modules', 'package-local-dependency', 'package.json' + ) + t.ok(JSON.parse(fs.readFileSync(dependencyPackageJson, 'utf8'))) + + var pkgJson = JSON.parse(fs.readFileSync(pkg + '/package.json', 'utf8')) + t.deepEqual( + pkgJson.dependencies, + { 'package-local-dependency': 'file:../package-local-dependency' }, + 'local package saved correctly' + ) + t.end() + } + ) +}) + +test('\'npm install --save-dev ../local/path\' should save to package.json', function (t) { + setup() + common.npm( + [ + '--loglevel', 'silent', + '--save-dev', + 'install', '../package-local-dev-dependency' + ], + EXEC_OPTS, + function (err, code) { + t.ifError(err, 'npm install ran without issue') + t.notOk(code, 'npm install exited with code 0') + + var dependencyPackageJson = path.resolve( + pkg, 'node_modules', 'package-local-dev-dependency', 'package.json' + ) + t.ok(JSON.parse(fs.readFileSync(dependencyPackageJson, 'utf8'))) + + var pkgJson = JSON.parse(fs.readFileSync(pkg + '/package.json', 'utf8')) + t.deepEqual( + pkgJson.devDependencies, + { 'package-local-dev-dependency': 'file:../package-local-dev-dependency' }, + 'local package saved correctly' + ) + + t.end() + } + ) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + process.chdir(__dirname) + rimraf.sync(root) +} + +function setup () { + cleanup() + mkdirp.sync(pkg) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + + mkdirp.sync(path.join(root, 'package-local-dependency')) + fs.writeFileSync( + path.join(root, 'package-local-dependency', 'package.json'), + JSON.stringify(localDependency, null, 2) + ) + + mkdirp.sync(path.join(root, 'package-local-dev-dependency')) + fs.writeFileSync( + path.join(root, 'package-local-dev-dependency', 'package.json'), + JSON.stringify(localDevDependency, null, 2) + ) + + process.chdir(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-save-prefix.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-save-prefix.js new file mode 100644 index 00000000..b669c5fb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-save-prefix.js @@ -0,0 +1,178 @@ +var fs = require('fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') +var server + +var pkg = path.join(__dirname, 'install-save-prefix') + +var EXEC_OPTS = { cwd: pkg } + +var json = { + name: 'install-save-prefix', + version: '0.0.1' +} + +test('setup', function (t) { + setup() + mr({ port: common.port }, function (er, s) { + t.ifError(er, 'started mock registry') + server = s + t.end() + }) +}) + +test('install --save with \'^\' save prefix should accept minor updates', function (t) { + common.npm( + [ + '--registry', common.registry, + '--loglevel', 'silent', + '--save-prefix', '^', + '--save', + 'install', 'underscore@latest' + ], + EXEC_OPTS, + function (err, code) { + t.ifError(err, 'npm install ran without issue') + t.notOk(code, 'npm install exited with code 0') + + var p = path.join(pkg, 'node_modules', 'underscore', 'package.json') + t.ok(JSON.parse(fs.readFileSync(p))) + + var pkgJson = JSON.parse(fs.readFileSync( + path.join(pkg, 'package.json'), + 'utf8' + )) + t.deepEqual( + pkgJson.dependencies, + { 'underscore': '^1.5.1' }, + 'got expected save prefix and version of 1.5.1' + ) + t.end() + } + ) +}) + +test('install --save-dev with \'^\' save prefix should accept minor dev updates', function (t) { + setup() + common.npm( + [ + '--registry', common.registry, + '--loglevel', 'silent', + '--save-prefix', '^', + '--save-dev', + 'install', 'underscore@1.3.1' + ], + EXEC_OPTS, + function (err, code) { + t.ifError(err, 'npm install ran without issue') + t.notOk(code, 'npm install exited with code 0') + + var p = path.join(pkg, 'node_modules', 'underscore', 'package.json') + t.ok(JSON.parse(fs.readFileSync(p))) + + var pkgJson = JSON.parse(fs.readFileSync( + path.join(pkg, 'package.json'), + 'utf8' + )) + t.deepEqual( + pkgJson.devDependencies, + { 'underscore': '^1.3.1' }, + 'got expected save prefix and version of 1.3.1' + ) + t.end() + } + ) +}) + +test('install --save with \'~\' save prefix should accept patch updates', function (t) { + setup() + common.npm( + [ + '--registry', common.registry, + '--loglevel', 'silent', + '--save-prefix', '~', + '--save', + 'install', 'underscore@1.3.1' + ], + EXEC_OPTS, + function (err, code) { + t.ifError(err, 'npm install ran without issue') + t.notOk(code, 'npm install exited with code 0') + + var p = path.join(pkg, 'node_modules', 'underscore', 'package.json') + t.ok(JSON.parse(fs.readFileSync(p))) + + var pkgJson = JSON.parse(fs.readFileSync( + path.join(pkg, 'package.json'), + 'utf8' + )) + t.deepEqual( + pkgJson.dependencies, + { 'underscore': '~1.3.1' }, + 'got expected save prefix and version of 1.3.1' + ) + t.end() + } + ) +}) + +test('install --save-dev with \'~\' save prefix should accept patch updates', function (t) { + setup() + common.npm( + [ + '--registry', common.registry, + '--loglevel', 'silent', + '--save-prefix', '~', + '--save-dev', + 'install', 'underscore@1.3.1' + ], + EXEC_OPTS, + function (err, code) { + t.ifError(err, 'npm install ran without issue') + t.notOk(code, 'npm install exited with code 0') + + var p = path.join(pkg, 'node_modules', 'underscore', 'package.json') + t.ok(JSON.parse(fs.readFileSync(p))) + + var pkgJson = JSON.parse(fs.readFileSync( + path.join(pkg, 'package.json'), + 'utf8' + )) + t.deepEqual( + pkgJson.devDependencies, + { 'underscore': '~1.3.1' }, + 'got expected save prefix and version of 1.3.1' + ) + t.end() + } + ) +}) + +test('cleanup', function (t) { + server.close() + cleanup() + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} + +function setup () { + cleanup() + mkdirp.sync(path.resolve(pkg, 'node_modules')) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + + process.chdir(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-scoped-already-installed.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-scoped-already-installed.js new file mode 100644 index 00000000..1446897d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-scoped-already-installed.js @@ -0,0 +1,137 @@ +var fs = require('graceful-fs') +var path = require('path') +var existsSync = fs.existsSync || path.existsSync + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap') + +var root = path.join(__dirname, 'install-scoped-already-installed') +var pkg = path.join(root, 'package-with-scoped-paths') +var modules = path.join(pkg, 'node_modules') + +var EXEC_OPTS = { cwd: pkg } + +var scopedPaths = { + name: 'package-with-scoped-paths', + version: '0.0.0', + dependencies: { + 'package-local-dependency': 'file:../package-local-dependency', + '@scoped/package-scoped-dependency': 'file:../package-scoped-dependency' + } +} + +var localDependency = { + name: 'package-local-dependency', + version: '0.0.0', + description: 'Test for local installs' +} + +var scopedDependency = { + name: '@scoped/package', + version: '0.0.0', + description: 'Test for local installs' +} + +test('setup', function (t) { + rimraf.sync(root) + mkdirp.sync(pkg) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(scopedPaths, null, 2) + ) + + mkdirp.sync(path.join(root, 'package-local-dependency')) + fs.writeFileSync( + path.join(root, 'package-local-dependency', 'package.json'), + JSON.stringify(localDependency, null, 2) + ) + + mkdirp.sync(path.join(root, 'package-scoped-dependency')) + fs.writeFileSync( + path.join(root, 'package-scoped-dependency', 'package.json'), + JSON.stringify(scopedDependency, null, 2) + ) + + process.chdir(pkg) + t.end() +}) + +test('installing already installed local scoped package', function (t) { + common.npm( + [ + '--loglevel', 'silent', + 'install' + ], + EXEC_OPTS, + function (err, code, stdout) { + var installed = parseNpmInstallOutput(stdout) + t.ifError(err, 'install ran to completion without error') + t.notOk(code, 'npm install exited with code 0') + + t.ok( + existsSync(path.join(modules, '@scoped', 'package', 'package.json')), + 'package installed' + ) + t.ok( + contains(installed, 'node_modules/@scoped/package'), + 'installed @scoped/package' + ) + t.ok( + contains(installed, 'node_modules/package-local-dependency'), + 'installed package-local-dependency' + ) + + common.npm( + [ + '--loglevel', 'silent', + 'install' + ], + EXEC_OPTS, + function (err, code, stdout) { + t.ifError(err, 'install ran to completion without error') + t.notOk(code, 'npm install raised no error code') + + installed = parseNpmInstallOutput(stdout) + + t.ok( + existsSync(path.join(modules, '@scoped', 'package', 'package.json')), + 'package installed' + ) + + t.notOk( + contains(installed, 'node_modules/@scoped/package'), + 'did not reinstall @scoped/package' + ) + t.notOk( + contains(installed, 'node_modules/package-local-dependency'), + 'did not reinstall package-local-dependency' + ) + t.end() + } + ) + } + ) +}) + +test('cleanup', function (t) { + process.chdir(osenv.tmpdir()) + rimraf.sync(root) + t.end() +}) + +function contains (list, element) { + for (var i = 0; i < list.length; ++i) { + if (list[i] === element) { + return true + } + } + return false +} + +function parseNpmInstallOutput (stdout) { + return stdout.trim().split(/\n\n|\s+/) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-scoped-link.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-scoped-link.js new file mode 100644 index 00000000..029acb38 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-scoped-link.js @@ -0,0 +1,84 @@ +var exec = require('child_process').exec +var fs = require('graceful-fs') +var path = require('path') +var existsSync = fs.existsSync || path.existsSync + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var pkg = path.join(__dirname, 'install-scoped-link') +var work = path.join(__dirname, 'install-scoped-link-TEST') +var modules = path.join(work, 'node_modules') + +var EXEC_OPTS = { cwd: work } + +var world = 'console.log("hello blrbld")\n' + +var json = { + name: '@scoped/package', + version: '0.0.0', + bin: { + hello: './world.js' + } +} + +test('setup', function (t) { + cleanup() + mkdirp.sync(pkg) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + fs.writeFileSync(path.join(pkg, 'world.js'), world) + + mkdirp.sync(modules) + process.chdir(work) + + t.end() +}) + +test('installing package with links', function (t) { + common.npm( + [ + '--loglevel', 'silent', + 'install', pkg + ], + EXEC_OPTS, + function (err, code) { + t.ifError(err, 'install ran to completion without error') + t.notOk(code, 'npm install exited with code 0') + + t.ok( + existsSync(path.join(modules, '@scoped', 'package', 'package.json')), + 'package installed' + ) + t.ok(existsSync(path.join(modules, '.bin')), 'binary link directory exists') + + var hello = path.join(modules, '.bin', 'hello') + t.ok(existsSync(hello), 'binary link exists') + + exec('node ' + hello, function (err, stdout, stderr) { + t.ifError(err, 'command ran fine') + t.notOk(stderr, 'got no error output back') + t.equal(stdout, 'hello blrbld\n', 'output was as expected') + + t.end() + }) + } + ) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(work) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-scoped-with-peer-dependency.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-scoped-with-peer-dependency.js new file mode 100644 index 00000000..3a54b9a1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-scoped-with-peer-dependency.js @@ -0,0 +1,60 @@ +var fs = require('fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') +var pkg = path.join(__dirname, 'install-scoped-with-peer-dependency') +var local = path.join(pkg, 'package') + +var EXEC_OPTS = { } + +var json = { + name: '@scope/package', + version: '0.0.0', + peerDependencies: { + underscore: '*' + } +} + +test('setup', function (t) { + setup() + + t.end() +}) + +test('it should install peerDependencies in same tree level as the parent package', function (t) { + common.npm(['install', './package'], EXEC_OPTS, function (err, code, stdout, stderr) { + t.ifError(err, 'install local package successful') + t.equal(code, 0, 'npm install exited with code') + t.notOk(stderr, 'npm install exited without any error output') + + var p = path.resolve(pkg, 'node_modules/underscore/package.json') + t.ok(JSON.parse(fs.readFileSync(p, 'utf8'))) + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function setup () { + cleanup() + mkdirp.sync(local) + mkdirp.sync(path.resolve(pkg, 'node_modules')) + fs.writeFileSync( + path.join(local, 'package.json'), + JSON.stringify(json, null, 2) + ) + process.chdir(pkg) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-shrinkwrap-equals-ls.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-shrinkwrap-equals-ls.js new file mode 100644 index 00000000..1c324e56 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-shrinkwrap-equals-ls.js @@ -0,0 +1,288 @@ +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var pkg = path.join(__dirname, 'install-shrinkwrap-equals-ls') + +var EXEC_OPTS = {cwd: pkg} + +var json = { + "name": "install-shrinkwrap-equals-ls", + "version": "1.0.0", + "dependencies": { + "react": "^0.14.0", + "react-bootstrap": "^0.28.1", + "react-dom": "^0.14.0" + } +} + +var shrinkwrap = { + "name": "install-shrinkwrap-equals-ls", + "version": "1.0.0", + "dependencies": { + "react": { + "version": "0.14.8", + "from": "react@>=0.14.0 <0.15.0", + "resolved": "https://registry.npmjs.org/react/-/react-0.14.8.tgz", + "dependencies": { + "envify": { + "version": "3.4.0", + "from": "envify@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/envify/-/envify-3.4.0.tgz", + "dependencies": { + "through": { + "version": "2.3.8", + "from": "through@>=2.3.4 <2.4.0", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz" + }, + "jstransform": { + "version": "10.1.0", + "from": "jstransform@>=10.0.1 <11.0.0", + "resolved": "https://registry.npmjs.org/jstransform/-/jstransform-10.1.0.tgz", + "dependencies": { + "base62": { + "version": "0.1.1", + "from": "base62@0.1.1", + "resolved": "https://registry.npmjs.org/base62/-/base62-0.1.1.tgz" + }, + "esprima-fb": { + "version": "13001.1001.0-dev-harmony-fb", + "from": "esprima-fb@13001.1001.0-dev-harmony-fb", + "resolved": "https://registry.npmjs.org/esprima-fb/-/esprima-fb-13001.1001.0-dev-harmony-fb.tgz" + }, + "source-map": { + "version": "0.1.31", + "from": "source-map@0.1.31", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.31.tgz", + "dependencies": { + "amdefine": { + "version": "1.0.0", + "from": "amdefine@>=0.0.4", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.0.tgz" + } + } + } + } + } + } + }, + "fbjs": { + "version": "0.6.1", + "from": "fbjs@>=0.6.1 <0.7.0", + "resolved": "https://registry.npmjs.org/fbjs/-/fbjs-0.6.1.tgz", + "dependencies": { + "core-js": { + "version": "1.2.6", + "from": "core-js@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-1.2.6.tgz" + }, + "loose-envify": { + "version": "1.1.0", + "from": "loose-envify@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.1.0.tgz", + "dependencies": { + "js-tokens": { + "version": "1.0.3", + "from": "js-tokens@>=1.0.1 <2.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-1.0.3.tgz" + } + } + }, + "promise": { + "version": "7.1.1", + "from": "promise@>=7.0.3 <8.0.0", + "resolved": "https://registry.npmjs.org/promise/-/promise-7.1.1.tgz", + "dependencies": { + "asap": { + "version": "2.0.3", + "from": "asap@>=2.0.3 <2.1.0", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.3.tgz" + } + } + }, + "ua-parser-js": { + "version": "0.7.10", + "from": "ua-parser-js@>=0.7.9 <0.8.0", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.10.tgz" + }, + "whatwg-fetch": { + "version": "0.9.0", + "from": "whatwg-fetch@>=0.9.0 <0.10.0", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-0.9.0.tgz" + } + } + } + } + }, + "react-bootstrap": { + "version": "0.28.5", + "from": "react-bootstrap@>=0.28.1 <0.29.0", + "resolved": "https://registry.npmjs.org/react-bootstrap/-/react-bootstrap-0.28.5.tgz", + "dependencies": { + "babel-runtime": { + "version": "5.8.38", + "from": "babel-runtime@>=5.8.25 <6.0.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-5.8.38.tgz", + "dependencies": { + "core-js": { + "version": "1.2.6", + "from": "core-js@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-1.2.6.tgz" + } + } + }, + "classnames": { + "version": "2.2.3", + "from": "classnames@>=2.1.5 <3.0.0", + "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.2.3.tgz" + }, + "dom-helpers": { + "version": "2.4.0", + "from": "dom-helpers@>=2.4.0 <3.0.0", + "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-2.4.0.tgz" + }, + "invariant": { + "version": "2.2.1", + "from": "invariant@>=2.1.2 <3.0.0", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.1.tgz", + "dependencies": { + "loose-envify": { + "version": "1.1.0", + "from": "loose-envify@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.1.0.tgz", + "dependencies": { + "js-tokens": { + "version": "1.0.3", + "from": "js-tokens@>=1.0.1 <2.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-1.0.3.tgz" + } + } + } + } + }, + "keycode": { + "version": "2.1.1", + "from": "keycode@>=2.1.0 <3.0.0", + "resolved": "https://registry.npmjs.org/keycode/-/keycode-2.1.1.tgz" + }, + "lodash-compat": { + "version": "3.10.2", + "from": "lodash-compat@>=3.10.1 <4.0.0", + "resolved": "https://registry.npmjs.org/lodash-compat/-/lodash-compat-3.10.2.tgz" + }, + "react-overlays": { + "version": "0.6.3", + "from": "react-overlays@>=0.6.0 <0.7.0", + "resolved": "https://registry.npmjs.org/react-overlays/-/react-overlays-0.6.3.tgz", + "dependencies": { + "react-prop-types": { + "version": "0.2.2", + "from": "react-prop-types@>=0.2.1 <0.3.0", + "resolved": "https://registry.npmjs.org/react-prop-types/-/react-prop-types-0.2.2.tgz" + } + } + }, + "react-prop-types": { + "version": "0.3.0", + "from": "react-prop-types@>=0.3.0 <0.4.0", + "resolved": "https://registry.npmjs.org/react-prop-types/-/react-prop-types-0.3.0.tgz" + }, + "uncontrollable": { + "version": "3.2.3", + "from": "uncontrollable@>=3.1.3 <4.0.0", + "resolved": "https://registry.npmjs.org/uncontrollable/-/uncontrollable-3.2.3.tgz" + }, + "warning": { + "version": "2.1.0", + "from": "warning@>=2.1.0 <3.0.0", + "resolved": "https://registry.npmjs.org/warning/-/warning-2.1.0.tgz", + "dependencies": { + "loose-envify": { + "version": "1.1.0", + "from": "loose-envify@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.1.0.tgz", + "dependencies": { + "js-tokens": { + "version": "1.0.3", + "from": "js-tokens@>=1.0.1 <2.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-1.0.3.tgz" + } + } + } + } + } + } + }, + "react-dom": { + "version": "0.14.8", + "from": "react-dom@>=0.14.0 <0.15.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-0.14.8.tgz" + } + } +} + + +test('setup', function (t) { + setup() + t.end() +}) + +test('An npm install with shrinkwrap equals npm ls --json', function (t) { + common.npm( + [ + '--loglevel', 'silent', + 'install' + ], + EXEC_OPTS, + function (err, code) { + t.ifError(err, 'npm install ran without issue') + t.notOk(code, 'npm install exited with code 0') + common.npm( + [ + '--loglevel', 'silent', + 'ls', '--json' + ], + EXEC_OPTS, + function (err, code, out) { + t.ifError(err, 'npm ls --json ran without issue') + t.notOk(code, 'npm ls --json exited with code 0') + var actual = common.rmFromInShrinkwrap(JSON.parse(out)) + var expected = common.rmFromInShrinkwrap( + JSON.parse(JSON.stringify(shrinkwrap)) + ) + t.deepEqual(actual, expected) + t.end() + }) + } + ) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + process.chdir(__dirname) + rimraf.sync(pkg) +} + +function setup () { + cleanup() + mkdirp.sync(pkg) + process.chdir(pkg) + fs.writeFileSync( + 'package.json', + JSON.stringify(json, null, 2) + ) + fs.writeFileSync( + 'npm-shrinkwrap.json', + JSON.stringify(shrinkwrap, null, 2) + ) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-with-dev-dep-duplicate.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-with-dev-dep-duplicate.js new file mode 100644 index 00000000..19ad0c2b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/install-with-dev-dep-duplicate.js @@ -0,0 +1,85 @@ +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') +var npm = npm = require('../../') + +var pkg = path.resolve(__dirname, 'dev-dep-duplicate') + +var json = { + author: 'Anders Janmyr', + name: 'dev-dep-duplicate', + version: '0.0.0', + dependencies: { + underscore: '1.5.1' + }, + devDependencies: { + underscore: '1.3.1' + } +} + +var expected = { + name: 'dev-dep-duplicate', + version: '0.0.0', + dependencies: { + underscore: { + version: '1.5.1', + from: 'underscore@1.5.1', + resolved: common.registry + '/underscore/-/underscore-1.5.1.tgz' + } + } +} + +test('prefers version from dependencies over devDependencies', function (t) { + t.plan(1) + + mr({ port: common.port }, function (er, s) { + setup(function (err) { + if (err) return t.fail(err) + + npm.install('.', function (err) { + if (err) return t.fail(err) + + npm.commands.ls([], true, function (err, _, results) { + if (err) return t.fail(err) + + t.deepEqual(results, expected) + s.close() + t.end() + }) + }) + }) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function setup (cb) { + cleanup() + mkdirp.sync(pkg) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + process.chdir(pkg) + + var opts = { + cache: path.resolve(pkg, 'cache'), + registry: common.registry + } + npm.load(opts, cb) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/invalid-cmd-exit-code.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/invalid-cmd-exit-code.js new file mode 100644 index 00000000..c9918e5a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/invalid-cmd-exit-code.js @@ -0,0 +1,28 @@ +var test = require("tap").test +var common = require("../common-tap.js") + +var opts = { cwd: process.cwd() } + +test("npm asdf should return exit code 1", function (t) { + common.npm(["asdf"], opts, function (er, c) { + if (er) throw er + t.ok(c, "exit code should not be zero") + t.end() + }) +}) + +test("npm help should return exit code 0", function (t) { + common.npm(["help"], opts, function (er, c) { + if (er) throw er + t.equal(c, 0, "exit code should be 0") + t.end() + }) +}) + +test("npm help fadf should return exit code 0", function (t) { + common.npm(["help", "fadf"], opts, function (er, c) { + if (er) throw er + t.equal(c, 0, "exit code should be 0") + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/legacy-array-bin.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/legacy-array-bin.js new file mode 100644 index 00000000..3e421ee2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/legacy-array-bin.js @@ -0,0 +1,80 @@ +'use strict' +var test = require('tap').test +var common = require('../common-tap.js') +var path = require('path') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var basepath = path.resolve(__dirname, path.basename(__filename, '.js')) +var fixturepath = path.resolve(basepath, 'npm-test-array-bin') +var modulepath = path.resolve(basepath, 'node_modules') +var installedpath = path.resolve(modulepath, 'npm-test-array-bin') +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir +var fixture = new Tacks( + Dir({ + bin: Dir({ + 'array-bin': File( + '#!/usr/bin/env node\n' + + "console.log('test ran ok')\n" + ) + }), + 'package.json': File({ + name: 'npm-test-array-bin', + version: '1.2.5', + bin: [ + 'bin/array-bin' + ], + scripts: { + test: 'node test.js' + } + }), + 'test.js': File( + "require('child_process').exec('array-bin', { env: process.env },\n" + + ' function (err, stdout, stderr) {\n' + + " if (err && err.code) throw new Error('exited badly with code = ' + err.code)\n" + + ' console.log(stdout)\n' + + ' console.error(stderr)\n' + + ' }\n' + + ')\n' + ) + }) +) +test('setup', function (t) { + setup() + t.done() +}) +test('array-bin', function (t) { + common.npm(['install', fixturepath], {cwd: basepath}, installCheckAndTest) + function installCheckAndTest (err, code, stdout, stderr) { + if (err) throw err + t.is(code, 0, 'install went ok') + t.equal(stderr, '', 'no error output') + common.npm(['test'], {cwd: installedpath}, testCheckAndRemove) + } + function testCheckAndRemove (err, code, stdout, stderr) { + t.ifError(err, 'npm test on array bin') + t.equal(code, 0, 'exited OK') + t.equal(stderr.trim(), '', 'no error output') + t.match(stdout, /test ran ok/, 'child script ran properly') + common.npm(['rm', fixturepath], {cwd: basepath}, removeCheckAndDone) + } + function removeCheckAndDone (err, code, stdout, stderr) { + if (err) throw err + t.is(code, 0, 'remove went ok') + t.done() + } +}) +test('cleanup', function (t) { + cleanup() + t.done() +}) +function setup () { + cleanup() + fixture.create(fixturepath) + mkdirp.sync(modulepath) +} +function cleanup () { + fixture.remove(fixturepath) + rimraf.sync(basepath) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/legacy-bundled-git.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/legacy-bundled-git.js new file mode 100644 index 00000000..355f9467 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/legacy-bundled-git.js @@ -0,0 +1,103 @@ +'use strict' +var test = require('tap').test +var common = require('../common-tap.js') +var path = require('path') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var basepath = path.resolve(__dirname, path.basename(__filename, '.js')) +var fixturepath = path.resolve(basepath, 'npm-test-bundled-git') +var modulepath = path.resolve(basepath, 'node_modules') +var installedpath = path.resolve(modulepath, 'npm-test-bundled-git') +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir + +var minimatchExpected = { + name: 'minimatch', + description: 'a glob matcher in javascript', + version: '0.2.1', + repository: { + type: 'git', + url: 'git://github.com/isaacs/minimatch.git' + }, + main: 'minimatch.js', + scripts: { + test: 'tap test' + }, + engines: { + node: '*' + }, + dependencies: { + 'lru-cache': '~1.0.5' + }, + devDependencies: { + tap: '~0.1.3' + }, + licenses: [ + { + type: 'MIT', + url: 'http://github.com/isaacs/minimatch/raw/master/LICENSE' + } + ] +} + +var fixture = new Tacks( + Dir({ + README: File( + 'just an npm test\n' + ), + 'package.json': File({ + name: 'npm-test-bundled-git', + scripts: { + test: 'node test.js' + }, + version: '1.2.5', + dependencies: { + glob: 'git://github.com/isaacs/node-glob.git#npm-test' + }, + bundledDependencies: [ + 'glob' + ] + }) + }) +) +test('setup', function (t) { + setup() + t.done() +}) +test('bundled-git', function (t) { + common.npm(['install', '--global-style', fixturepath], {cwd: basepath}, installCheckAndTest) + function installCheckAndTest (err, code, stdout, stderr) { + if (err) throw err + console.error(stderr) + console.log(stdout) + t.is(code, 0, 'install went ok') + + var actual = require(path.resolve(installedpath, 'node_modules/glob/node_modules/minimatch/package.json')) + Object.keys(minimatchExpected).forEach(function (key) { + t.isDeeply(actual[key], minimatchExpected[key], key + ' set to the right value') + }) + + common.npm(['rm', fixturepath], {cwd: basepath}, removeCheckAndDone) + } + function removeCheckAndDone (err, code, stdout, stderr) { + if (err) throw err + console.error(stderr) + console.log(stdout) + t.is(code, 0, 'remove went ok') + t.done() + } +}) +test('cleanup', function (t) { + cleanup() + t.done() +}) +function setup () { + cleanup() + fixture.create(fixturepath) + mkdirp.sync(modulepath) +} +function cleanup () { + fixture.remove(fixturepath) + rimraf.sync(basepath) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/legacy-dir-bin.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/legacy-dir-bin.js new file mode 100644 index 00000000..e9e6bdfe --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/legacy-dir-bin.js @@ -0,0 +1,79 @@ +'use strict' +var test = require('tap').test +var common = require('../common-tap.js') +var path = require('path') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var basepath = path.resolve(__dirname, path.basename(__filename, '.js')) +var fixturepath = path.resolve(basepath, 'npm-test-dir-bin') +var modulepath = path.resolve(basepath, 'node_modules') +var installedpath = path.resolve(modulepath, 'npm-test-dir-bin') +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir +var fixture = new Tacks( + Dir({ + bin: Dir({ + 'dir-bin': File( + '#!/usr/bin/env node\n' + + "console.log('test ran ok')\n" + ) + }), + 'package.json': File({ + name: 'npm-test-dir-bin', + version: '1.2.5', + directories: { + bin: './bin' + }, + scripts: { + test: 'node test.js' + } + }), + 'test.js': File( + "require('child_process').exec('dir-bin', { env: process.env },\n" + + ' function (err, stdout, stderr) {\n' + + " if (err && err.code) throw new Error('exited badly with code = ' + err.code)\n" + + ' console.log(stdout)\n' + + ' console.error(stderr)\n' + + ' }\n' + + ')\n' + ) + }) +) +test('setup', function (t) { + setup() + t.done() +}) +test('dir-bin', function (t) { + common.npm(['install', fixturepath], {cwd: basepath}, installCheckAndTest) + function installCheckAndTest (err, code, stdout, stderr) { + if (err) throw err + t.is(code, 0, 'install went ok') + common.npm(['test'], {cwd: installedpath}, testCheckAndRemove) + } + function testCheckAndRemove (err, code, stdout, stderr) { + t.ifError(err, 'npm test on array bin') + t.equal(code, 0, 'exited OK') + t.equal(stderr.trim(), '', 'no error output') + t.match(stdout, /test ran ok/, 'child script ran properly') + common.npm(['rm', fixturepath], {cwd: basepath}, removeCheckAndDone) + } + function removeCheckAndDone (err, code, stdout, stderr) { + if (err) throw err + t.is(code, 0, 'remove went ok') + t.done() + } +}) +test('cleanup', function (t) { + cleanup() + t.done() +}) +function setup () { + cleanup() + fixture.create(fixturepath) + mkdirp.sync(modulepath) +} +function cleanup () { + fixture.remove(fixturepath) + rimraf.sync(basepath) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/legacy-ignore-nested-nm.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/legacy-ignore-nested-nm.js new file mode 100644 index 00000000..095c41ef --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/legacy-ignore-nested-nm.js @@ -0,0 +1,64 @@ +'use strict' +var test = require('tap').test +var common = require('../common-tap.js') +var path = require('path') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var basepath = path.resolve(__dirname, path.basename(__filename, '.js')) +var fixturepath = path.resolve(basepath, 'npm-test-ignore-nested-nm') +var modulepath = path.resolve(basepath, 'node_modules') +var installedpath = path.resolve(modulepath, 'npm-test-ignore-nested-nm') +var fs = require('graceful-fs') +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir + +var fileData = 'I WILL NOT BE IGNORED!\n' +var fixture = new Tacks( + Dir({ + lib: Dir({ + node_modules: Dir({ + foo: File(fileData) + }) + }), + 'package.json': File({ + name: 'npm-test-ignore-nested-nm', + version: '1.2.5' + }) + }) +) +test('setup', function (t) { + setup() + t.done() +}) +test('ignore-nested-nm', function (t) { + common.npm(['install', fixturepath], {cwd: basepath}, installCheckAndTest) + function installCheckAndTest (err, code, stdout, stderr) { + if (err) throw err + t.is(code, 0, 'install went ok') + var foopath = path.resolve(installedpath, 'lib/node_modules/foo') + fs.readFile(foopath, function (err, data) { + t.ifError(err, 'file read successfully') + t.equal(data.toString(), fileData) + common.npm(['rm', fixturepath], {cwd: basepath}, removeCheckAndDone) + }) + } + function removeCheckAndDone (err, code, stdout, stderr) { + if (err) throw err + t.is(code, 0, 'remove went ok') + t.done() + } +}) +test('cleanup', function (t) { + cleanup() + t.done() +}) +function setup () { + cleanup() + fixture.create(fixturepath) + mkdirp.sync(modulepath) +} +function cleanup () { + fixture.remove(fixturepath) + rimraf.sync(basepath) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/legacy-missing-bindir.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/legacy-missing-bindir.js new file mode 100644 index 00000000..a55703be --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/legacy-missing-bindir.js @@ -0,0 +1,82 @@ +'use strict' +var path = require('path') +var fs = require('fs') +var test = require('tap').test +var common = require('../common-tap.js') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var basepath = path.resolve(__dirname, path.basename(__filename, '.js')) +var fixturepath = path.resolve(basepath, 'npm-test-missing-bindir') +var modulepath = path.resolve(basepath, 'node_modules') +var installedpath = path.resolve(modulepath, 'npm-test-missing-bindir') +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir + +var fixture = new Tacks( + Dir({ + README: File( + 'just an npm test\n' + ), + 'package.json': File({ + name: 'npm-test-missing-bindir', + version: '0.0.0', + directories: { + bin: './not-found' + } + }) + }) +) + +test('setup', function (t) { + setup() + t.done() +}) + +function installedExists (filename) { + try { + fs.statSync(path.resolve(installedpath, filename)) + return true + } catch (ex) { + console.log(ex) + return false + } +} + +test('missing-bindir', function (t) { + common.npm(['install', fixturepath], {cwd: basepath}, installCheckAndTest) + + function installCheckAndTest (err, code, stdout, stderr) { + if (err) throw err + if (stderr) console.error(stderr) + console.log(stdout) + t.is(code, 0, 'install went ok') + t.is(installedExists('README'), true, 'README') + t.is(installedExists('package.json'), true, 'package.json') + common.npm(['rm', fixturepath], {cwd: basepath}, removeCheckAndDone) + } + + function removeCheckAndDone (err, code, stdout, stderr) { + if (err) throw err + console.error(stderr) + console.log(stdout) + t.is(code, 0, 'remove went ok') + t.done() + } +}) + +test('cleanup', function (t) { + cleanup() + t.done() +}) + +function setup () { + cleanup() + fixture.create(fixturepath) + mkdirp.sync(modulepath) +} + +function cleanup () { + fixture.remove(fixturepath) + rimraf.sync(basepath) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/legacy-no-auth-leak.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/legacy-no-auth-leak.js new file mode 100644 index 00000000..f8372392 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/legacy-no-auth-leak.js @@ -0,0 +1,75 @@ +'use strict' +var test = require('tap').test +var common = require('../common-tap.js') +var path = require('path') +var basepath = path.resolve(__dirname, path.basename(__filename, '.js')) +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir + +var fixture = new Tacks( + Dir({ + README: File( + 'just an npm test\n' + ), + 'package.json': File({ + name: 'npm-test-no-auth-leak', + version: '0.0.0', + scripts: { + test: 'node test.js' + } + }), + '.npmrc': File( + 'auth=abc', + 'authCrypt=def', + 'password=xyz', + '//registry.npmjs.org/:_authToken=nopenope' + ), + 'test.js': File( + 'var authTokenKeys = Object.keys(process.env)\n' + + ' .filter(function (key) { return /authToken/.test(key) })\n' + + 'console.log(JSON.stringify({\n' + + ' password: process.env.npm_config__password || null,\n' + + ' auth: process.env.npm_config__auth || null,\n' + + ' authCrypt: process.env.npm_config__authCrypt || null ,\n' + + ' authToken: authTokenKeys && process.env[authTokenKeys[0]] || null\n' + + '}))' + ) + }) +) + +test('setup', function (t) { + setup() + t.done() +}) + +test('no-auth-leak', function (t) { + common.npm(['test'], {cwd: basepath}, function (err, code, stdout, stderr) { + if (err) throw err + t.is(code, 0, 'test ran ok') + if (stderr) console.log(stderr) + var matchResult = /^[^{]*(\{(?:.|\n)*\})[^}]*$/ + t.like(stdout, matchResult, 'got results with a JSON chunk in them') + var stripped = stdout.replace(matchResult, '$1') + var result = JSON.parse(stripped) + t.is(result.password, null, 'password') + t.is(result.auth, null, 'auth') + t.is(result.authCrypt, null, 'authCrypt') + t.is(result.authToken, null, 'authToken') + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.done() +}) + +function setup () { + cleanup() + fixture.create(basepath) +} + +function cleanup () { + fixture.remove(basepath) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/legacy-npm-self-install.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/legacy-npm-self-install.js new file mode 100644 index 00000000..313c0594 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/legacy-npm-self-install.js @@ -0,0 +1,107 @@ +'use strict' +var test = require('tap').test +var fs = require('graceful-fs') +var common = require('../common-tap.js') +var path = require('path') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var npmpath = path.resolve(__dirname, '../..') +var basepath = path.resolve(osenv.tmpdir(), path.basename(__filename, '.js')) +var globalpath = path.resolve(basepath, 'global') +var extend = Object.assign || require('util')._extend +var isWin32 = process.platform === 'win32' + +test('setup', function (t) { + setup() + t.done() +}) + +var tarball + +test('build-tarball', function (t) { + common.npm(['pack'], {cwd: npmpath, stdio: ['ignore', 'pipe', process.stderr]}, function (err, code, stdout) { + if (err) throw err + t.is(code, 0, 'pack went ok') + tarball = path.resolve(npmpath, stdout.trim().replace(/^(?:.|\n)*(?:^|\n)(.*?[.]tgz)$/, '$1')) + t.match(tarball, /[.]tgz$/, 'got a tarball') + t.done() + }) +}) + +function exists () { + try { + fs.statSync(path.resolve.apply(null, arguments)) + return true + } catch (ex) { + return false + } +} + +test('npm-self-install', function (t) { + if (!tarball) return t.done() + + var env = extend({}, process.env) + var pathsep = isWin32 ? ';' : ':' + env.npm_config_prefix = globalpath + env.npm_config_global = 'true' + env.npm_config_npat = 'false' + env.NODE_PATH = null + env.npm_config_user_agent = null + env.npm_config_color = 'always' + env.npm_config_progress = 'always' + var PATH = env.PATH.split(pathsep) + var binpath = isWin32 ? globalpath : path.join(globalpath, 'bin') + var cmdname = isWin32 ? 'npm.cmd' : 'npm' + PATH.unshift(binpath) + env.PATH = PATH.join(pathsep) + + var opts = {cwd: basepath, env: env, stdio: ['ignore', 'ignore', process.stderr]} + + common.npm(['install', '--ignore-scripts', tarball], opts, installCheckAndTest) + function installCheckAndTest (err, code) { + if (err) throw err + t.is(code, 0, 'install went ok') + t.is(exists(binpath, cmdname), true, 'binary was installed') + t.is(exists(globalpath, 'lib', 'node_modules', 'npm'), true, 'module path exists') + common.npm(['ls', '--json', '--depth=0'], {cwd: basepath, env: env}, lsCheckAndRemove) + } + function lsCheckAndRemove (err, code, stdout, stderr) { + t.ifError(err, 'npm test on array bin') + t.equal(code, 0, 'exited OK') + t.equal(stderr.trim(), '', 'no error output') + var installed = JSON.parse(stdout.trim()) + t.is(Object.keys(installed.dependencies).length, 1, 'one thing installed') + t.is(path.resolve(globalpath, installed.dependencies.npm.from), tarball, 'and it was our npm tarball') + common.npm(['rm', 'npm'], {cwd: basepath, env: env, stdio: 'inherit'}, removeCheck) + } + function removeCheck (err, code) { + if (err) throw err + t.is(code, 0, 'remove went ok') + common.npm(['ls', '--json', '--depth=0'], {cwd: basepath, env: env}, andDone) + } + function andDone (err, code, stdout, stderr) { + if (err) throw err + t.is(code, 0, 'remove went ok') + t.equal(stderr.trim(), '', 'no error output') + var installed = JSON.parse(stdout.trim()) + t.ok(!installed.dependencies || installed.dependencies.length === 0, 'nothing left') + t.is(exists(binpath, cmdname), false, 'binary was removed') + t.is(exists(globalpath, 'lib', 'node_modules', 'npm'), false, 'module was entirely removed') + t.done() + } +}) + +test('cleanup', function (t) { + cleanup() + t.done() +}) + +function setup () { + cleanup() + mkdirp.sync(globalpath) +} + +function cleanup () { + rimraf.sync(basepath) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/legacy-optional-deps.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/legacy-optional-deps.js new file mode 100644 index 00000000..54d0c75a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/legacy-optional-deps.js @@ -0,0 +1,80 @@ +'use strict' +var path = require('path') +var fs = require('fs') +var test = require('tap').test +var common = require('../common-tap.js') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var basepath = path.resolve(__dirname, path.basename(__filename, '.js')) +var fixturepath = path.resolve(basepath, 'npm-test-optional-deps') +var modulepath = path.resolve(basepath, 'node_modules') +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir + +var fixture = new Tacks( + Dir({ + README: File( + 'just an npm test\n' + ), + 'package.json': File({ + name: 'npm-test-optional-deps', + version: '1.2.5', + optionalDependencies: { + 'npm-test-foobarzaaakakaka': 'http://example.com/', + async: '10.999.14234', + mkdirp: '0.3.5', + optimist: 'some invalid version 99 #! $$ x y z', + 'npm-test-failer': '*' + } + }) + }) +) + +var server + +test('setup', function (t) { + setup() + mr({port: common.port}, function (err, s) { + if (err) throw err + server = s + t.done() + }) +}) + +test('optional-deps', function (t) { + server.get('/npm-test-failer').reply(404, {error: 'nope'}) + + var opts = ['--registry=' + common.registry, '--timeout=100'] + common.npm(opts.concat(['install', fixturepath]), {cwd: basepath}, installCheckAndTest) + + function installCheckAndTest (err, code, stdout, stderr) { + if (err) throw err + if (stderr) console.error(stderr) + server.done() + t.is(code, 0, 'install went ok') + var subpath = modulepath + '/npm-test-optional-deps/node_modules/' + var dir = fs.readdirSync(subpath) + t.isDeeply(dir, ['mkdirp'], 'only one optional dep should be there') + t.is(require(path.resolve(subpath, 'mkdirp', 'package.json')).version, '0.3.5', 'mkdirp version right') + t.done() + } +}) + +test('cleanup', function (t) { + cleanup() + server.close() + t.done() +}) + +function setup () { + cleanup() + fixture.create(fixturepath) + mkdirp.sync(modulepath) +} + +function cleanup () { + fixture.remove(fixturepath) + rimraf.sync(basepath) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/legacy-platform-all.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/legacy-platform-all.js new file mode 100644 index 00000000..2bfb19a4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/legacy-platform-all.js @@ -0,0 +1,73 @@ +'use strict' +var test = require('tap').test +var common = require('../common-tap.js') +var path = require('path') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var basepath = path.resolve(__dirname, path.basename(__filename, '.js')) +var fixturepath = path.resolve(basepath, 'npm-test-platform-all') +var modulepath = path.resolve(basepath, 'node_modules') +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir + +var fixture = new Tacks( + Dir({ + README: File( + 'just an npm test\n' + ), + 'package.json': File({ + name: 'npm-test-platform-all', + version: '9.9.9-9', + homepage: 'http://www.zombo.com/', + os: [ + 'darwin', + 'linux', + 'win32', + 'solaris', + 'haiku', + 'sunos', + 'freebsd', + 'openbsd', + 'netbsd' + ], + cpu: [ + 'arm', + 'mips', + 'ia32', + 'x64', + 'sparc' + ] + }) + }) +) + +test('setup', function (t) { + setup() + t.done() +}) + +test('platform-all', function (t) { + common.npm(['install', fixturepath], {cwd: basepath}, installCheckAndTest) + function installCheckAndTest (err, code, stdout, stderr) { + if (err) throw err + t.is(stderr, '', 'no error messages') + t.is(code, 0, 'install went ok') + t.done() + } +}) + +test('cleanup', function (t) { + cleanup() + t.done() +}) + +function setup () { + cleanup() + fixture.create(fixturepath) + mkdirp.sync(modulepath) +} +function cleanup () { + fixture.remove(fixturepath) + rimraf.sync(basepath) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/legacy-platform.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/legacy-platform.js new file mode 100644 index 00000000..4e94148b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/legacy-platform.js @@ -0,0 +1,64 @@ +'use strict' +var test = require('tap').test +var common = require('../common-tap.js') +var path = require('path') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var basepath = path.resolve(__dirname, path.basename(__filename, '.js')) +var fixturepath = path.resolve(basepath, 'npm-test-platform') +var modulepath = path.resolve(basepath, 'node_modules') +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir + +var fixture = new Tacks( + Dir({ + README: File( + 'just an npm test\n' + ), + 'package.json': File({ + name: 'npm-test-platform', + version: '9.9.9-9', + homepage: 'http://www.youtube.com/watch?v=dQw4w9WgXcQ', + os: [ + '!this_is_not_a_real_os', + '!neither_is_this' + ], + cpu: [ + '!this_is_not_a_real_cpu', + '!this_isnt_either' + ] + }) + }) +) + +test('setup', function (t) { + setup() + t.done() +}) + +test('platform', function (t) { + common.npm(['install', fixturepath], {cwd: basepath}, installCheckAndTest) + function installCheckAndTest (err, code, stdout, stderr) { + if (err) throw err + console.error(stderr) + t.is(code, 0, 'install went ok') + t.done() + } +}) + +test('cleanup', function (t) { + cleanup() + t.done() +}) + +function setup () { + cleanup() + fixture.create(fixturepath) + mkdirp.sync(modulepath) +} + +function cleanup () { + fixture.remove(fixturepath) + rimraf.sync(basepath) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/legacy-private.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/legacy-private.js new file mode 100644 index 00000000..5e7817bf --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/legacy-private.js @@ -0,0 +1,58 @@ +'use strict' +var test = require('tap').test +var common = require('../common-tap.js') +var path = require('path') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var basepath = path.resolve(__dirname, path.basename(__filename, '.js')) +var fixturepath = path.resolve(basepath, 'npm-test-private') +var modulepath = path.resolve(basepath, 'node_modules') +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir + +var fixture = new Tacks( + Dir({ + README: File( + 'just an npm test\n' + ), + 'package.json': File({ + name: 'npm-test-private', + version: '9.9.9-9', + homepage: 'http://www.youtube.com/watch?v=1MLry6Cn_D4', + private: 'true' + }) + }) +) + +test('setup', function (t) { + setup() + t.done() +}) + +test('private', function (t) { + common.npm(['install', fixturepath], {cwd: basepath}, installCheckAndTest) + function installCheckAndTest (err, code, stdout, stderr) { + if (err) throw err + console.error(stderr) + console.log(stdout) + t.is(code, 0, 'install went ok') + t.done() + } +}) + +test('cleanup', function (t) { + cleanup() + t.done() +}) + +function setup () { + cleanup() + fixture.create(fixturepath) + mkdirp.sync(modulepath) +} + +function cleanup () { + fixture.remove(fixturepath) + rimraf.sync(basepath) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/legacy-shrinkwrap.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/legacy-shrinkwrap.js new file mode 100644 index 00000000..2c51bf1e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/legacy-shrinkwrap.js @@ -0,0 +1,123 @@ +'use strict' +var test = require('tap').test +var common = require('../common-tap.js') +var path = require('path') +var basepath = path.resolve(__dirname, path.basename(__filename, '.js')) +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir + +var fixture = new Tacks( + Dir({ + README: File( + 'just an npm test\n' + ), + 'npm-shrinkwrap.json': File({ + name: 'npm-test-shrinkwrap', + version: '0.0.0', + dependencies: { + glob: { + version: '3.1.5', + from: 'git://github.com/isaacs/node-glob.git#npm-test', + resolved: 'git://github.com/isaacs/node-glob.git#67bda227fd7a559cca5620307c7d30a6732a792f', + dependencies: { + 'graceful-fs': { + version: '1.1.5', + resolved: 'https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.1.5.tgz', + dependencies: { + 'fast-list': { + version: '1.0.2', + resolved: 'https://registry.npmjs.org/fast-list/-/fast-list-1.0.2.tgz' + } + } + }, + inherits: { + version: '1.0.0', + resolved: 'https://registry.npmjs.org/inherits/-/inherits-1.0.0.tgz' + }, + minimatch: { + version: '0.2.1', + dependencies: { + 'lru-cache': { + version: '1.0.5' + } + } + } + } + }, + minimatch: { + version: '0.1.5', + resolved: 'https://registry.npmjs.org/minimatch/-/minimatch-0.1.5.tgz', + dependencies: { + 'lru-cache': { + version: '1.0.5', + resolved: 'https://registry.npmjs.org/lru-cache/-/lru-cache-1.0.5.tgz' + } + } + }, + 'npm-test-single-file': { + version: '1.2.3', + resolved: 'https://gist.github.com/isaacs/1837112/raw/9ef57a59fc22aeb1d1ca346b68826dcb638b8416/index.js' + } + } + }), + 'package.json': File({ + author: 'Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)', + name: 'npm-test-shrinkwrap', + version: '0.0.0', + dependencies: { + 'npm-test-single-file': 'https://gist.github.com/isaacs/1837112/raw/9ef57a59fc22aeb1d1ca346b68826dcb638b8416/index.js', + glob: 'git://github.com/isaacs/node-glob.git#npm-test', + minimatch: '~0.1.0' + }, + scripts: { + test: 'node test.js' + } + }) + }) +) + +test('setup', function (t) { + setup() + t.done() +}) + +test('shrinkwrap', function (t) { + common.npm(['install'], {cwd: basepath}, installCheckAndTest) + + function installCheckAndTest (err, code, stdout, stderr) { + if (err) throw err + console.error(stderr) + t.is(code, 0, 'install went ok') + + common.npm(['ls', '--json'], {cwd: basepath}, verifyLsMatchesShrinkwrap) + } + + function verifyLsMatchesShrinkwrap (err, code, stdout, stderr) { + if (err) throw err + console.error(stderr) + t.is(code, 0, 'ls went ok') + var actual = JSON.parse(stdout) + var expected = require(path.resolve(basepath, 'npm-shrinkwrap.json')) + // from is expected to vary + t.isDeeply( + common.rmFromInShrinkwrap(actual), + common.rmFromInShrinkwrap(expected) + ) + t.done() + } +}) + +test('cleanup', function (t) { + cleanup() + t.done() +}) + +function setup () { + cleanup() + fixture.create(basepath) +} + +function cleanup () { + fixture.remove(basepath) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/legacy-test-package.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/legacy-test-package.js new file mode 100644 index 00000000..b0cbaa01 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/legacy-test-package.js @@ -0,0 +1,76 @@ +'use strict' +var test = require('tap').test +var common = require('../common-tap.js') +var path = require('path') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var basepath = path.resolve(__dirname, path.basename(__filename, '.js')) +var fixturepath = path.resolve(basepath, 'npm-test-test-package') +var modulepath = path.resolve(basepath, 'node_modules') +var installedpath = path.resolve(modulepath, 'npm-test-test-package') +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir + +var fixture = new Tacks( + Dir({ + README: File( + 'just an npm test\n' + ), + 'package.json': File({ + name: 'npm-test-test-package', + author: 'Testy McMock', + version: '1.2.3-99-b', + description: "This is a test package used for debugging. It has some random data and that's all." + }) + }) +) + +test('setup', function (t) { + setup() + t.done() +}) + +test('test-package', function (t) { + common.npm(['install', fixturepath], {cwd: basepath}, installCheckAndTest) + + function installCheckAndTest (err, code, stdout, stderr) { + if (err) throw err + console.error(stderr) + console.log(stdout) + t.is(code, 0, 'install went ok') + common.npm(['test'], {cwd: installedpath}, testCheckAndRemove) + } + + function testCheckAndRemove (err, code, stdout, stderr) { + if (err) throw err + console.error(stderr) + console.log(stdout) + t.is(code, 0, 'npm test w/o test is ok') + common.npm(['rm', fixturepath], {cwd: basepath}, removeCheckAndDone) + } + + function removeCheckAndDone (err, code, stdout, stderr) { + if (err) throw err + console.error(stderr) + console.log(stdout) + t.is(code, 0, 'remove went ok') + t.done() + } +}) + +test('cleanup', function (t) { + cleanup() + t.done() +}) + +function setup () { + cleanup() + fixture.create(fixturepath) + mkdirp.sync(modulepath) +} + +function cleanup () { + fixture.remove(fixturepath) + rimraf.sync(basepath) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/legacy-url-dep.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/legacy-url-dep.js new file mode 100644 index 00000000..9807d691 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/legacy-url-dep.js @@ -0,0 +1,61 @@ +'use strict' +var test = require('tap').test +var common = require('../common-tap.js') +var path = require('path') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var basepath = path.resolve(__dirname, path.basename(__filename, '.js')) +var fixturepath = path.resolve(basepath, 'npm-test-url-dep') +var modulepath = path.resolve(basepath, 'node_modules') +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir + +var fixture = new Tacks( + Dir({ + README: File( + 'just an npm test\n' + ), + 'package.json': File({ + name: 'npm-test-url-dep', + version: '1.2.3', + dependencies: { + jsonify: 'https://github.com/substack/jsonify/tarball/master', + sax: 'isaacs/sax-js', + 'canonical-host': 'git://github.com/isaacs/canonical-host' + } + }) + }) +) + +test('setup', function (t) { + setup() + t.done() +}) + +test('url-dep', function (t) { + common.npm(['install', fixturepath], {cwd: basepath}, installCheckAndTest) + function installCheckAndTest (err, code, stdout, stderr) { + if (err) throw err + console.error(stderr) + console.log(stdout) + t.is(code, 0, 'install went ok') + t.done() + } +}) + +test('cleanup', function (t) { + cleanup() + t.done() +}) + +function setup () { + cleanup() + fixture.create(fixturepath) + mkdirp.sync(modulepath) +} + +function cleanup () { + fixture.remove(fixturepath) + rimraf.sync(basepath) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/lifecycle-path.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/lifecycle-path.js new file mode 100644 index 00000000..39761b48 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/lifecycle-path.js @@ -0,0 +1,88 @@ +var fs = require('fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var pkg = path.resolve(__dirname, 'lifecycle-path') +var link = path.resolve(pkg, 'node-bin') + +var PATH +if (process.platform === 'win32') { + // On Windows the 'comspec' environment variable is used, + // so cmd.exe does not need to be on the path. + PATH = 'C:\\foo\\bar' +} else { + // On non-Windows, without the path to the shell, nothing usually works. + PATH = '/bin:/usr/bin' +} + +var printPath = 'console.log(process.env.PATH)\n' + +var json = { + name: 'glorb', + version: '1.2.3', + scripts: { + path: './node-bin/node print-path.js' + } +} + +test('setup', function (t) { + cleanup() + mkdirp.sync(pkg) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + fs.writeFileSync(path.join(pkg, 'print-path.js'), printPath) + fs.symlinkSync(path.dirname(process.execPath), link, 'dir') + t.end() +}) + +test('make sure the path is correct', function (t) { + common.npm(['run-script', 'path'], { + cwd: pkg, + env: { + PATH: PATH, + stdio: [ 0, 'pipe', 2 ] + } + }, function (er, code, stdout) { + if (er) throw er + t.equal(code, 0, 'exit code') + // remove the banner, we just care about the last line + stdout = stdout.trim().split(/\r|\n/).pop() + var pathSplit = process.platform === 'win32' ? ';' : ':' + var root = path.resolve(__dirname, '../..') + var actual = stdout.split(pathSplit).map(function (p) { + if (p.indexOf(root) === 0) { + p = '{{ROOT}}' + p.substr(root.length) + } + return p.replace(/\\/g, '/') + }) + + // get the ones we tacked on, then the system-specific requirements + var expect = [ + '{{ROOT}}/bin/node-gyp-bin', + '{{ROOT}}/test/tap/lifecycle-path/node_modules/.bin', + path.dirname(process.execPath) + ].concat(PATH.split(pathSplit).map(function (p) { + return p.replace(/\\/g, '/') + })) + t.same(actual, expect) + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/lifecycle-signal.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/lifecycle-signal.js new file mode 100644 index 00000000..e28caf72 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/lifecycle-signal.js @@ -0,0 +1,57 @@ +var fs = require('graceful-fs') +var path = require('path') +var spawn = require('child_process').spawn + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var node = process.execPath +var npm = require.resolve('../../bin/npm-cli.js') + +var pkg = path.resolve(__dirname, 'lifecycle-signal') + +var json = { + name: 'lifecycle-signal', + version: '1.2.5', + scripts: { + preinstall: 'node -e "process.kill(process.pid,\'SIGSEGV\')"' + } +} + +test('setup', function (t) { + cleanup() + mkdirp.sync(pkg) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + + process.chdir(pkg) + t.end() +}) + +test('lifecycle signal abort', function (t) { + // windows does not use lifecycle signals, abort + if (process.platform === 'win32' || process.env.TRAVIS) return t.end() + + var child = spawn(node, [npm, 'install'], { + cwd: pkg + }) + child.on('close', function (code, signal) { + t.equal(code, null) + t.equal(signal, 'SIGSEGV') + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/lifecycle.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/lifecycle.js new file mode 100644 index 00000000..aa0efc52 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/lifecycle.js @@ -0,0 +1,12 @@ +var test = require("tap").test +var npm = require("../../") +var lifecycle = require("../../lib/utils/lifecycle") + +test("lifecycle: make env correctly", function (t) { + npm.load({enteente: Infinity}, function () { + var env = lifecycle.makeEnv({}, null, process.env) + + t.equal("Infinity", env.npm_config_enteente) + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/link.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/link.js new file mode 100644 index 00000000..ea47e829 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/link.js @@ -0,0 +1,120 @@ +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var path = require('path') +var rimraf = require('rimraf') +var test = require('tap').test +var writeFileSync = require('fs').writeFileSync + +var common = require('../common-tap.js') + +var link = path.join(__dirname, 'link') +var linkInstall = path.join(__dirname, 'link-install') +var linkRoot = path.join(__dirname, 'link-root') + +var config = 'prefix = ' + linkRoot +var configPath = path.join(link, '_npmrc') + +var OPTS = { + env: { + 'npm_config_userconfig': configPath + } +} + +var readJSON = { + name: 'foo', + version: '1.0.0', + description: '', + main: 'index.js', + scripts: { + test: 'echo \"Error: no test specified\" && exit 1' + }, + author: '', + license: 'ISC' +} + +var installJSON = { + name: 'bar', + version: '1.0.0', + description: '', + main: 'index.js', + scripts: { + test: 'echo \"Error: no test specified\" && exit 1' + }, + author: '', + license: 'ISC' +} + + +test('setup', function (t) { + setup() + common.npm(['ls', '-g', '--depth=0'], OPTS, function (err, c, out) { + t.ifError(err) + t.equal(c, 0, 'set up ok') + t.notOk(out.match(/UNMET DEPENDENCY foo@/), "foo isn't in global") + t.end() + }) +}) + +test('creates global link', function (t) { + process.chdir(link) + common.npm(['link'], OPTS, function (err, c, out) { + t.ifError(err, 'link has no error') + common.npm(['ls', '-g'], OPTS, function (err, c, out, stderr) { + t.ifError(err) + t.equal(c, 0) + t.equal(stderr, '', 'got expected stderr') + t.has(out, /foo@1.0.0/, 'creates global link ok') + t.end() + }) + }) +}) + +test('link-install the package', function (t) { + process.chdir(linkInstall) + common.npm(['link', 'foo'], OPTS, function (err) { + t.ifError(err, 'link-install has no error') + common.npm(['ls'], OPTS, function (err, c, out) { + t.ifError(err) + t.equal(c, 1) + t.has(out, /foo@1.0.0/, 'link-install ok') + t.end() + }) + }) +}) + +test('cleanup', function (t) { + process.chdir(osenv.tmpdir()) + common.npm(['rm', 'foo'], OPTS, function (err, code) { + t.ifError(err, 'npm removed the linked package without error') + t.equal(code, 0, 'cleanup foo in local ok') + common.npm(['rm', '-g', 'foo'], OPTS, function (err, code) { + t.ifError(err, 'npm removed the global package without error') + t.equal(code, 0, 'cleanup foo in global ok') + + cleanup() + t.end() + }) + }) +}) + +function cleanup () { + rimraf.sync(linkRoot) + rimraf.sync(link) + rimraf.sync(linkInstall) +} + +function setup () { + cleanup() + mkdirp.sync(linkRoot) + mkdirp.sync(link) + writeFileSync( + path.join(link, 'package.json'), + JSON.stringify(readJSON, null, 2) + ) + mkdirp.sync(linkInstall) + writeFileSync( + path.join(linkInstall, 'package.json'), + JSON.stringify(installJSON, null, 2) + ) + writeFileSync(configPath, config) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/locker.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/locker.js new file mode 100644 index 00000000..bc43c30e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/locker.js @@ -0,0 +1,89 @@ +var test = require("tap").test + , path = require("path") + , fs = require("graceful-fs") + , crypto = require("crypto") + , rimraf = require("rimraf") + , osenv = require("osenv") + , mkdirp = require("mkdirp") + , npm = require("../../") + , locker = require("../../lib/utils/locker.js") + , lock = locker.lock + , unlock = locker.unlock + +var pkg = path.join(__dirname, "/locker") + , cache = path.join(pkg, "/cache") + , tmp = path.join(pkg, "/tmp") + , nm = path.join(pkg, "/node_modules") + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} + +test("setup", function (t) { + cleanup() + mkdirp.sync(cache) + mkdirp.sync(tmp) + t.end() +}) + +test("locking file puts lock in correct place", function (t) { + npm.load({cache: cache, tmpdir: tmp}, function (er) { + t.ifError(er, "npm bootstrapped OK") + + var n = "correct" + , c = n.replace(/[^a-zA-Z0-9]+/g, "-").replace(/^-+|-+$/g, "") + , p = path.resolve(nm, n) + , h = crypto.createHash("sha1").update(p).digest("hex") + , l = c.substr(0, 24)+"-"+h.substr(0, 16)+".lock" + , v = path.join(cache, "_locks", l) + + lock(nm, n, function (er) { + t.ifError(er, "locked path") + + fs.exists(v, function (found) { + t.ok(found, "lock found OK") + + unlock(nm, n, function (er) { + t.ifError(er, "unlocked path") + + fs.exists(v, function (found) { + t.notOk(found, "lock deleted OK") + t.end() + }) + }) + }) + }) + }) +}) + +test("unlocking out of order errors out", function (t) { + npm.load({cache: cache, tmpdir: tmp}, function (er) { + t.ifError(er, "npm bootstrapped OK") + + var n = "busted" + , c = n.replace(/[^a-zA-Z0-9]+/g, "-").replace(/^-+|-+$/g, "") + , p = path.resolve(nm, n) + , h = crypto.createHash("sha1").update(p).digest("hex") + , l = c.substr(0, 24)+"-"+h.substr(0, 16)+".lock" + , v = path.join(cache, "_locks", l) + + fs.exists(v, function (found) { + t.notOk(found, "no lock to unlock") + + t.throws(function () { + unlock(nm, n, function () { + t.fail("shouldn't get here") + t.end() + }) + }, "blew up as expected") + + t.end() + }) + }) +}) + +test("cleanup", function (t) { + cleanup() + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/logout.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/logout.js new file mode 100644 index 00000000..1d9392ad --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/logout.js @@ -0,0 +1,67 @@ +var fs = require("fs") +var path = require("path") + +var mkdirp = require("mkdirp") +var mr = require("npm-registry-mock") +var rimraf = require("rimraf") +var test = require("tap").test + +var common = require("../common-tap.js") + +var pkg = path.resolve(__dirname, "logout") +var outfile = path.join(pkg, "_npmrc") +var opts = { cwd: pkg } + +var contents = function () {/* +foo=boo +//localhost:1337/:_authToken=glarb +*/}.toString().split("\n").slice(1, -1).join("\n") + +function mocks (server) { + server.delete("/-/user/token/glarb") + .reply(200, {}) +} + +test("setup", function (t) { + cleanup() + setup() + t.end() +}) + +test("npm logout", function (t) { + mr({ port: common.port, plugin: mocks }, function (err, s) { + if (err) throw err + + common.npm( + [ + "logout", + "--registry", common.registry, + "--loglevel", "silent", + "--userconfig", outfile + ], + opts, + function (err, code) { + t.ifError(err, "no error output") + t.notOk(code, "exited OK") + + var config = fs.readFileSync(outfile, "utf8") + t.equal(config, "foo=boo\n", "creds gone") + s.close() + t.end() + }) + }) +}) + +test("cleanup", function (t) { + cleanup() + t.end() +}) + +function setup () { + mkdirp.sync(pkg) + fs.writeFileSync(outfile, contents) +} + +function cleanup () { + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/ls-depth-cli.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/ls-depth-cli.js new file mode 100644 index 00000000..76068142 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/ls-depth-cli.js @@ -0,0 +1,170 @@ +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap') + +var pkg = path.resolve(__dirname, 'ls-depth-cli') + +var EXEC_OPTS = { cwd: pkg } + +var json = { + name: 'ls-depth-cli', + version: '0.0.0', + dependencies: { + 'test-package-with-one-dep': '0.0.0' + } +} + +test('setup', function (t) { + cleanup() + mkdirp.sync(pkg) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + mr({ port: common.port }, function (er, s) { + common.npm( + [ + '--registry', common.registry, + 'install' + ], + EXEC_OPTS, + function (er, c) { + t.ifError(er, 'setup installation ran without issue') + t.equal(c, 0) + s.close() + t.end() + } + ) + }) +}) + +test('npm ls --depth=0', function (t) { + common.npm( + ['ls', '--depth=0'], + EXEC_OPTS, + function (er, c, out) { + t.ifError(er, 'npm ls ran without issue') + t.equal(c, 0, 'ls ran without raising error code') + t.has( + out, + /test-package-with-one-dep@0\.0\.0/, + 'output contains test-package-with-one-dep@0.0.0' + ) + t.doesNotHave( + out, + /test-package@0\.0\.0/, + 'output not contains test-package@0.0.0' + ) + t.end() + } + ) +}) + +test('npm ls --depth=1', function (t) { + common.npm( + ['ls', '--depth=1'], + EXEC_OPTS, + function (er, c, out) { + t.ifError(er, 'npm ls ran without issue') + t.equal(c, 0, 'ls ran without raising error code') + t.has( + out, + /test-package-with-one-dep@0\.0\.0/, + 'output contains test-package-with-one-dep@0.0.0' + ) + t.has( + out, + /test-package@0\.0\.0/, + 'output contains test-package@0.0.0' + ) + t.end() + } + ) +}) + +test('npm ls --depth=Infinity', function (t) { + // travis has a preconfigured depth=0, in general we can not depend + // on the default value in all environments, so explictly set it here + common.npm( + ['ls', '--depth=Infinity'], + EXEC_OPTS, + function (er, c, out) { + t.ifError(er, 'npm ls ran without issue') + t.equal(c, 0, 'ls ran without raising error code') + t.has( + out, + /test-package-with-one-dep@0\.0\.0/, + 'output contains test-package-with-one-dep@0.0.0' + ) + t.has( + out, + /test-package@0\.0\.0/, + 'output contains test-package@0.0.0' + ) + t.end() + } + ) +}) + +test('npm ls --depth=0 --json', function (t) { + common.npm( + ['ls', '--depth=0', '--json'], + EXEC_OPTS, + function (er, c, out) { + t.ifError(er, 'npm ls ran without issue') + t.equal(c, 0, 'ls ran without raising error code') + t.has( + out, + /test-package-with-one-dep@0\.0\.0/, + 'output contains test-package-with-one-dep@0.0.0' + ) + t.doesNotHave( + out, + /test-package@0\.0\.0/, + 'output not contains test-package@0.0.0' + ) + t.end() + } + ) +}) + +test('npm ls --depth=Infinity --json', function (t) { + // travis has a preconfigured depth=0, in general we can not depend + // on the default value in all environments, so explictly set it here + common.npm( + ['ls', '--depth=Infinity', '--json'], + EXEC_OPTS, + function (er, c, out) { + t.ifError(er, 'npm ls ran without issue') + t.equal(c, 0, 'ls ran without raising error code') + t.has( + out, + /test-package-with-one-dep@0\.0\.0/, + 'output contains test-package-with-one-dep@0.0.0' + ) + t.has( + out, + /test-package@0\.0\.0/, + 'output contains test-package@0.0.0' + ) + t.end() + } + ) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/ls-depth-unmet.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/ls-depth-unmet.js new file mode 100644 index 00000000..6511cdb3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/ls-depth-unmet.js @@ -0,0 +1,172 @@ +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap') + +var pkg = path.resolve(__dirname, 'ls-depth-unmet') + +var EXEC_OPTS = { cwd: pkg } + +var json = { + name: 'ls-depth-umnet', + author: 'Evan You', + version: '0.0.0', + dependencies: { + 'test-package-with-one-dep': '0.0.0', + underscore: '1.5.1', + optimist: '0.6.0' + } +} + +test('setup', function (t) { + cleanup() + mkdirp.sync(pkg) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + mr({ port: common.port }, function (er, s) { + common.npm( + [ + '--registry', common.registry, + 'install', 'underscore@1.3.1', 'mkdirp', 'test-package-with-one-dep' + ], + EXEC_OPTS, + function (er, c) { + t.ifError(er, 'setup installation ran without issue') + t.equal(c, 0) + s.close() + t.end() + } + ) + }) +}) + +test('npm ls --depth=0', function (t) { + common.npm( + ['ls', '--depth=0'], + EXEC_OPTS, + function (er, c, out) { + t.ifError(er, 'setup installation ran without issue') + t.equal(c, 1, 'ls barfed') + t.has( + out, + /UNMET DEPENDENCY optimist@0\.6\.0/, + 'output contains optimist@0.6.0 and labeled as unmet dependency' + ) + t.has( + out, + /mkdirp@0\.3\.5 extraneous/, + 'output contains mkdirp@0.3.5 and labeled as extraneous' + ) + t.has( + out, + /underscore@1\.3\.1 invalid/, + 'output contains underscore@1.3.1 and labeled as invalid' + ) + t.has( + out, + /test-package-with-one-dep@0\.0\.0\n/, + 'output contains test-package-with-one-dep@0.0.0 and has no labels' + ) + t.doesNotHave( + out, + /test-package@0\.0\.0/, + 'output does not contain test-package@0.0.0 which is at depth=1' + ) + t.end() + } + ) +}) + +test('npm ls --depth=1', function (t) { + common.npm( + ['ls', '--depth=1'], + EXEC_OPTS, + function (er, c, out) { + t.ifError(er, 'setup installation ran without issue') + t.equal(c, 1, 'ls barfed') + t.has( + out, + /UNMET DEPENDENCY optimist@0\.6\.0/, + 'output contains optimist@0.6.0 and labeled as unmet dependency' + ) + t.has( + out, + /mkdirp@0\.3\.5 extraneous/, + 'output contains mkdirp@0.3.5 and labeled as extraneous' + ) + t.has( + out, + /underscore@1\.3\.1 invalid/, + 'output contains underscore@1.3.1 and labeled as invalid' + ) + t.has( + out, + /test-package-with-one-dep@0\.0\.0\n/, + 'output contains test-package-with-one-dep@0.0.0 and has no labels' + ) + t.has( + out, + /test-package@0\.0\.0/, + 'output contains test-package@0.0.0 which is at depth=1' + ) + t.end() + } + ) +}) + +test('npm ls --depth=Infinity', function (t) { + // travis has a preconfigured depth=0, in general we can not depend + // on the default value in all environments, so explictly set it here + common.npm( + ['ls', '--depth=Infinity'], + EXEC_OPTS, + function (er, c, out) { + t.ifError(er, 'setup installation ran without issue') + t.equal(c, 1, 'ls barfed') + t.has( + out, + /UNMET DEPENDENCY optimist@0\.6\.0/, + 'output contains optimist@0.6.0 and labeled as unmet dependency' + ) + t.has( + out, + /mkdirp@0\.3\.5 extraneous/, + 'output contains mkdirp@0.3.5 and labeled as extraneous' + ) + t.has( + out, + /underscore@1\.3\.1 invalid/, + 'output contains underscore@1.3.1 and labeled as invalid' + ) + t.has( + out, + /test-package-with-one-dep@0\.0\.0\n/, + 'output contains test-package-with-one-dep@0.0.0 and has no labels' + ) + t.has( + out, + /test-package@0\.0\.0/, + 'output contains test-package@0.0.0 which is at depth=1' + ) + t.end() + } + ) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/ls-env.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/ls-env.js new file mode 100644 index 00000000..30039b5b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/ls-env.js @@ -0,0 +1,91 @@ +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap') + +var pkg = path.resolve(__dirname, 'ls-depth') + +var EXEC_OPTS = { cwd: pkg } + +var json = { + name: 'ls-env', + version: '0.0.0', + dependencies: { + 'test-package-with-one-dep': '0.0.0' + } +} + +test('setup', function (t) { + cleanup() + mkdirp.sync(pkg) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + mr({port: common.port}, function (er, s) { + common.npm( + [ + '--registry', common.registry, + 'install' + ], + EXEC_OPTS, + function (er, c) { + t.ifError(er, 'install ran without issue') + t.equal(c, 0) + s.close() + t.end() + } + ) + }) +}) + +test('npm ls --dev', function (t) { + common.npm(['ls', '--dev'], EXEC_OPTS, function (er, code, stdout) { + t.ifError(er, 'ls --dev ran without issue') + t.equal(code, 0) + t.has(stdout, /(empty)/, 'output contains (empty)') + t.end() + }) +}) + +test('npm ls --production', function (t) { + common.npm(['ls', '--production'], EXEC_OPTS, function (er, code, stdout) { + t.ifError(er, 'ls --production ran without issue') + t.notOk(code, 'npm exited ok') + t.has( + stdout, + /test-package-with-one-dep@0\.0\.0/, + 'output contains test-package-with-one-dep@0.0.0' + ) + t.end() + }) +}) + +test('npm ls --prod', function (t) { + common.npm(['ls', '--prod'], EXEC_OPTS, function (er, code, stdout) { + t.ifError(er, 'ls --prod ran without issue') + t.notOk(code, 'npm exited ok') + t.has( + stdout, + /test-package-with-one-dep@0\.0\.0/, + 'output contains test-package-with-one-dep@0.0.0' + ) + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/ls-l-depth-0.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/ls-l-depth-0.js new file mode 100644 index 00000000..3b5ae4d2 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/ls-l-depth-0.js @@ -0,0 +1,112 @@ +var cat = require('graceful-fs').writeFileSync +var resolve = require('path').resolve + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var rimraf = require('rimraf') +var test = require('tap').test +var tmpdir = require('osenv').tmpdir + +var common = require('../common-tap.js') + +var pkg = resolve(__dirname, 'ls-l-depth-0') +var dep = resolve(pkg, 'deps', 'glock') +var modules = resolve(pkg, 'node_modules') + +var expected = + '\n' + + '│ ' + pkg + '\n' + + '│ \n' + + '└── glock@1.8.7\n' + + ' an inexplicably hostile sample package\n' + + ' git+https://github.com/npm/glo.ck.git\n' + + ' https://glo.ck\n' + + '\n' + +var server + +var EXEC_OPTS = { cwd: pkg } + +var fixture = { + 'name': 'glock', + 'version': '1.8.7', + 'private': true, + 'description': 'an inexplicably hostile sample package', + 'homepage': 'https://glo.ck', + 'repository': 'https://github.com/npm/glo.ck', + 'dependencies': { + 'underscore': '1.5.1' + } +} + +test('setup', function (t) { + setup() + mr({ port: common.port }, function (er, s) { + server = s + + t.end() + }) +}) + +test('#6311: npm ll --depth=0 duplicates listing', function (t) { + common.npm( + [ + '--loglevel', 'silent', + '--registry', common.registry, + 'install', dep + ], + EXEC_OPTS, + function (err, code, stdout, stderr) { + t.ifError(err, 'npm install ran without error') + t.notOk(code, 'npm install exited cleanly') + t.notOk(stderr, 'npm install ran silently') + t.equal( + stdout.trim(), + 'glock@1.8.7 node_modules/glock\n└── underscore@1.5.1', + 'got expected install output' + ) + + common.npm( + [ + '--loglevel', 'silent', + 'ls', '--long', + '--depth', '0' + ], + EXEC_OPTS, + function (err, code, stdout, stderr) { + t.ifError(err, 'npm ll ran without error') + t.notOk(code, 'npm ll exited cleanly') + t.notOk(stderr, 'npm ll ran silently') + t.equal( + stdout, + expected, + 'got expected package name' + ) + + t.end() + } + ) + } + ) +}) + +test('cleanup', function (t) { + cleanup() + server.close() + + t.end() +}) + +function cleanup () { + process.chdir(tmpdir()) + rimraf.sync(pkg) +} + +function setup () { + cleanup() + + mkdirp.sync(modules) + mkdirp.sync(dep) + + cat(resolve(dep, 'package.json'), JSON.stringify(fixture)) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/ls-no-results.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/ls-no-results.js new file mode 100644 index 00000000..10f3ce00 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/ls-no-results.js @@ -0,0 +1,12 @@ +var test = require("tap").test +var spawn = require("child_process").spawn +var node = process.execPath +var npm = require.resolve("../../") +var args = [ npm, "ls", "ceci n’est pas une package" ] +test("ls exits non-zero when nothing found", function (t) { + var child = spawn(node, args) + child.on("exit", function (code) { + t.notEqual(code, 0) + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/map-to-registry.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/map-to-registry.js new file mode 100644 index 00000000..d9677bd7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/map-to-registry.js @@ -0,0 +1,166 @@ +var test = require('tap').test +var npm = require('../../') + +var common = require('../common-tap.js') +var mapRegistry = require('../../lib/utils/map-to-registry.js') + +var creds = { + '//registry.npmjs.org/:username': 'u', + '//registry.npmjs.org/:_password': new Buffer('p').toString('base64'), + '//registry.npmjs.org/:email': 'e', + cache: common.npm_config_cache +} +test('setup', function (t) { + npm.load(creds, function (err) { + t.ifError(err) + t.end() + }) +}) + +test('mapRegistryToURI', function (t) { + t.plan(16) + + mapRegistry('basic', npm.config, function (er, uri, auth, registry) { + t.ifError(er, 'mapRegistryToURI worked') + t.equal(uri, 'https://registry.npmjs.org/basic') + t.deepEqual(auth, { + scope: '//registry.npmjs.org/', + token: undefined, + username: 'u', + password: 'p', + email: 'e', + auth: 'dTpw', + alwaysAuth: false + }) + t.equal(registry, 'https://registry.npmjs.org/') + }) + + npm.config.set('scope', 'test') + npm.config.set('@test:registry', 'http://reg.npm/design/-/rewrite/') + npm.config.set('//reg.npm/design/-/rewrite/:_authToken', 'a-token') + mapRegistry('simple', npm.config, function (er, uri, auth, registry) { + t.ifError(er, 'mapRegistryToURI worked') + t.equal(uri, 'http://reg.npm/design/-/rewrite/simple') + t.deepEqual(auth, { + scope: '//reg.npm/design/-/rewrite/', + token: 'a-token', + username: undefined, + password: undefined, + email: undefined, + auth: undefined, + alwaysAuth: false + }) + t.equal(registry, 'http://reg.npm/design/-/rewrite/') + }) + + npm.config.set('scope', '') + npm.config.set('@test2:registry', 'http://reg.npm/-/rewrite/') + npm.config.set('//reg.npm/-/rewrite/:_authToken', 'b-token') + mapRegistry('@test2/easy', npm.config, function (er, uri, auth, registry) { + t.ifError(er, 'mapRegistryToURI worked') + t.equal(uri, 'http://reg.npm/-/rewrite/@test2%2feasy') + t.deepEqual(auth, { + scope: '//reg.npm/-/rewrite/', + token: 'b-token', + username: undefined, + password: undefined, + email: undefined, + auth: undefined, + alwaysAuth: false + }) + t.equal(registry, 'http://reg.npm/-/rewrite/') + }) + + npm.config.set('scope', 'test') + npm.config.set('@test3:registry', 'http://reg.npm/design/-/rewrite/relative') + npm.config.set('//reg.npm/design/-/rewrite/:_authToken', 'c-token') + mapRegistry('@test3/basic', npm.config, function (er, uri, auth, registry) { + t.ifError(er, 'mapRegistryToURI worked') + t.equal(uri, 'http://reg.npm/design/-/rewrite/relative/@test3%2fbasic') + t.deepEqual(auth, { + scope: '//reg.npm/design/-/rewrite/', + token: 'c-token', + username: undefined, + password: undefined, + email: undefined, + auth: undefined, + alwaysAuth: false + }) + t.equal(registry, 'http://reg.npm/design/-/rewrite/relative/') + }) +}) + +test('mapToRegistry token scoping', function (t) { + npm.config.set('scope', '') + npm.config.set('registry', 'https://reg.npm/') + npm.config.set('//reg.npm/:_authToken', 'r-token') + + t.test('pass token to registry host', function (t) { + mapRegistry( + 'https://reg.npm/packages/e/easy-1.0.0.tgz', + npm.config, + function (er, uri, auth, registry) { + t.ifError(er, 'mapRegistryToURI worked') + t.equal(uri, 'https://reg.npm/packages/e/easy-1.0.0.tgz') + t.deepEqual(auth, { + scope: '//reg.npm/', + token: 'r-token', + username: undefined, + password: undefined, + email: undefined, + auth: undefined, + alwaysAuth: false + }) + t.equal(registry, 'https://reg.npm/') + } + ) + t.end() + }) + + t.test("don't pass token to non-registry host", function (t) { + mapRegistry( + 'https://butts.lol/packages/e/easy-1.0.0.tgz', + npm.config, + function (er, uri, auth, registry) { + t.ifError(er, 'mapRegistryToURI worked') + t.equal(uri, 'https://butts.lol/packages/e/easy-1.0.0.tgz') + t.deepEqual(auth, { + scope: '//reg.npm/', + token: undefined, + username: undefined, + password: undefined, + email: undefined, + auth: undefined, + alwaysAuth: false + }) + t.equal(registry, 'https://reg.npm/') + } + ) + t.end() + }) + + t.test('pass token to non-registry host with always-auth', function (t) { + npm.config.set('always-auth', true) + mapRegistry( + 'https://butts.lol/packages/e/easy-1.0.0.tgz', + npm.config, + function (er, uri, auth, registry) { + t.ifError(er, 'mapRegistryToURI worked') + t.equal(uri, 'https://butts.lol/packages/e/easy-1.0.0.tgz') + t.deepEqual(auth, { + scope: '//reg.npm/', + token: 'r-token', + username: undefined, + password: undefined, + email: undefined, + auth: undefined, + alwaysAuth: true + }) + t.equal(registry, 'https://reg.npm/') + } + ) + t.end() + }) + + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/nerf-dart.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/nerf-dart.js new file mode 100644 index 00000000..157f6c7d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/nerf-dart.js @@ -0,0 +1,32 @@ +// taken from https://raw.githubusercontent.com/indexzero/npm/bd3cad01fbd3ab481d2f5da441b9eead16029123/test/tap/config-nerf-dart.js +// originally written by Charlie Robbins, https://github.com/indexzero +var test = require("tap").test +var toNerfDart = require("../../lib/config/nerf-dart.js") + +function validNerfDart (uri, valid) { + if (!valid) valid = "//registry.npmjs.org/" + test(uri, function (t) { + t.equal(toNerfDart(uri), valid) + t.end() + }) +} + +validNerfDart("http://registry.npmjs.org") +validNerfDart("http://registry.npmjs.org/some-package") +validNerfDart("http://registry.npmjs.org/some-package?write=true") +validNerfDart("http://user:pass@registry.npmjs.org/some-package?write=true") +validNerfDart("http://registry.npmjs.org/#random-hash") +validNerfDart("http://registry.npmjs.org/some-package#random-hash") + +validNerfDart( + "http://relative.couchapp.npm/design/-/rewrite/", + "//relative.couchapp.npm/design/-/rewrite/" +) +validNerfDart( + "http://relative.couchapp.npm:8080/design/-/rewrite/", + "//relative.couchapp.npm:8080/design/-/rewrite/" +) +validNerfDart( + "http://relative.couchapp.npm:8080/design/-/rewrite/some-package", + "//relative.couchapp.npm:8080/design/-/rewrite/" +) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/nested-extraneous.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/nested-extraneous.js new file mode 100644 index 00000000..fcba0418 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/nested-extraneous.js @@ -0,0 +1,53 @@ +var common = require("../common-tap.js") +var test = require("tap").test +var mkdirp = require("mkdirp") +var fs = require("fs") +var rimraf = require("rimraf") +var path = require("path") + +var pkg = path.resolve(__dirname, "nested-extraneous") +var pj = { + name: "nested-extraneous", + version: "1.2.3" +} + +var dep = path.resolve(pkg, "node_modules", "dep") +var deppj = { + name: "nested-extraneous-dep", + version: "1.2.3", + dependencies: { + "nested-extra-depdep": "*" + } +} + +var depdep = path.resolve(dep, "node_modules", "depdep") +var depdeppj = { + name: "nested-extra-depdep", + version: "1.2.3" +} + +test("setup", function (t) { + rimraf.sync(pkg) + mkdirp.sync(depdep) + fs.writeFileSync(path.resolve(pkg, "package.json"), JSON.stringify(pj)) + fs.writeFileSync(path.resolve(dep, "package.json"), JSON.stringify(deppj)) + fs.writeFileSync(path.resolve(depdep, "package.json"), JSON.stringify(depdeppj)) + t.end() +}) + +test("test", function (t) { + common.npm(["ls"], { + cwd: pkg + }, function (er, code, sto, ste) { + if (er) throw er + t.notEqual(code, 0) + t.notSimilar(ste, /depdep/) + t.notSimilar(sto, /depdep/) + t.end() + }) +}) + +test("clean", function (t) { + rimraf.sync(pkg) + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/noargs-install-config-save.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/noargs-install-config-save.js new file mode 100644 index 00000000..28aa8f2f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/noargs-install-config-save.js @@ -0,0 +1,78 @@ +var common = require('../common-tap.js') +var test = require('tap').test +var path = require('path') +var fs = require('fs') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') + +var mr = require("npm-registry-mock") + +var pkg = path.resolve(process.env.npm_config_tmp || '/tmp', + 'noargs-install-config-save') + +function writePackageJson() { + rimraf.sync(pkg) + mkdirp.sync(pkg) + mkdirp.sync(pkg + "/cache") + + fs.writeFileSync(pkg + "/package.json", JSON.stringify({ + "author": "Rocko Artischocko", + "name": "noargs", + "version": "0.0.0", + "devDependencies": { + "underscore": "1.3.1" + } + }), "utf8") +} + +var env = { + 'npm_config_save': true, + 'npm_config_registry': common.registry, + 'npm_config_cache': pkg + '/cache', + HOME: process.env.HOME, + Path: process.env.PATH, + PATH: process.env.PATH +} +var OPTS = { + cwd: pkg, + env: env +} + +test("does not update the package.json with empty arguments", function (t) { + writePackageJson() + t.plan(2) + + mr({ port: common.port }, function (er, s) { + common.npm('install', OPTS, function (er, code, stdout, stderr) { + if (er) throw er + t.is(code, 0) + if (code !== 0) { + console.error('#', stdout) + console.error('#', stderr) + } + var text = JSON.stringify(fs.readFileSync(pkg + '/package.json', 'utf8')) + s.close() + t.ok(text.indexOf("\"dependencies") === -1) + }) + }) +}) + +test("updates the package.json (adds dependencies) with an argument", function (t) { + writePackageJson() + t.plan(2) + + mr({ port: common.port }, function (er, s) { + common.npm(['install', 'underscore'], OPTS, function (er, code, stdout, stderr) { + if (er) throw er + t.is(code, 0) + s.close() + var text = JSON.stringify(fs.readFileSync(pkg + "/package.json", "utf8")) + t.ok(text.indexOf("\"dependencies") !== -1) + }) + }) +}) + +test("cleanup", function (t) { + rimraf.sync(pkg + "/cache") + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/npm-api-not-loaded-error.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/npm-api-not-loaded-error.js new file mode 100644 index 00000000..afedfbcd --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/npm-api-not-loaded-error.js @@ -0,0 +1,47 @@ +var test = require("tap").test +var npm = require("../..") +var path = require("path") +var rimraf = require("rimraf") +var npmrc = path.join(__dirname, "npmrc") +var fs = require("fs") + +test("setup", function (t) { + fs.writeFileSync(npmrc, "foo = bar\n", "ascii") + t.end() +}) + +test("calling set/get on config pre-load should throw", function (t) { + var threw = true + try { + npm.config.get("foo") + threw = false + } catch (er) { + t.equal(er.message, "npm.load() required") + } finally { + t.ok(threw, "get before load should throw") + } + + threw = true + try { + npm.config.set("foo", "bar") + threw = false + } catch (er) { + t.equal(er.message, "npm.load() required") + } finally { + t.ok(threw, "set before load should throw") + } + + npm.load({ userconfig: npmrc }, function (er) { + if (er) + throw er + t.equal(npm.config.get("foo"), "bar") + npm.config.set("foo", "baz") + t.equal(npm.config.get("foo"), "baz") + t.end() + }) +}) + +test("cleanup", function (t) { + rimraf.sync(npmrc) + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/onload.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/onload.js new file mode 100644 index 00000000..8d2b6c74 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/onload.js @@ -0,0 +1,39 @@ +var path = require('path') +var test = require('tap').test +var rimraf = require('rimraf') +var common = require('../common-tap.js') +var opts = { cwd: __dirname } +var binDir = '../../node_modules/.bin' +var fixture = path.resolve(__dirname, binDir) +var onload = path.resolve(__dirname, '../fixtures/onload.js') + +test('setup', function (t) { + rimraf.sync(path.join(__dirname, 'node_modules')) + t.end() +}) + +test('npm bin with valid onload script', function (t) { + var args = ['--onload', onload, 'bin'] + common.npm(args, opts, function (err, code, stdout, stderr) { + t.ifError(err, 'bin ran without issue') + t.equal(stderr.trim(), 'called onload') + t.equal(code, 0, 'exit ok') + t.equal(stdout, fixture + '\n') + t.end() + }) +}) + +test('npm bin with invalid onload script', function (t) { + var onloadScript = onload + 'jsfd' + var args = ['--onload', onloadScript, '--loglevel=warn', 'bin'] + common.npm(args, opts, function (err, code, stdout, stderr) { + t.ifError(err, 'bin ran without issue') + t.match(stderr, /npm WARN onload-script failed to require onload script/) + t.match(stderr, /MODULE_NOT_FOUND/) + t.notEqual(stderr.indexOf(onloadScript), -1) + t.equal(code, 0, 'exit ok') + var res = path.resolve(stdout) + t.equal(res, fixture + '\n') + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/optional-metadep-rollback-collision.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/optional-metadep-rollback-collision.js new file mode 100644 index 00000000..4b21f965 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/optional-metadep-rollback-collision.js @@ -0,0 +1,237 @@ +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var pkg = path.resolve(__dirname, 'optional-metadep-rollback-collision') +var deps = path.resolve(pkg, 'deps') +var nm = path.resolve(pkg, 'node_modules') +var cache = path.resolve(pkg, 'cache') +var pidfile = path.resolve(pkg, 'child.pid') + +var json = { + name: 'optional-metadep-rollback-collision', + version: '1.0.0', + description: 'let\'s just see about that race condition', + optionalDependencies: { + opdep: 'file:./deps/opdep' + } +} + +var d1 = { + name: 'd1', + version: '1.0.0', + description: 'I FAIL CONSTANTLY', + scripts: { + preinstall: 'sleep 1' + }, + dependencies: { + foo: 'http://localhost:8080/' + } +} + +var d2 = { + name: 'd2', + version: '1.0.0', + description: 'how do you *really* know you exist?', + scripts: { + postinstall: 'node blart.js' + }, + dependencies: { + 'graceful-fs': '^3.0.2', + mkdirp: '^0.5.0', + rimraf: '^2.2.8' + } +} + +var opdep = { + name: 'opdep', + version: '1.0.0', + description: 'To explode, of course!', + main: 'index.js', + scripts: { + preinstall: 'node bad-server.js' + }, + dependencies: { + d1: 'file:../d1', + d2: 'file:../d2' + } +} + + +var badServer = function () {/* +var createServer = require('http').createServer +var spawn = require('child_process').spawn +var fs = require('fs') +var path = require('path') +var pidfile = path.resolve(__dirname, '..', '..', 'child.pid') + +if (process.argv[2]) { + console.log('ok') + createServer(function (req, res) { + setTimeout(function () { + res.writeHead(404) + res.end() + }, 1000) + this.close() + }).listen(8080) +} else { + var child = spawn( + process.execPath, + [__filename, 'whatever'], + { + stdio: [0, 1, 2], + detached: true + } + ) + child.unref() + + // kill any prior children, if existing. + try { + var pid = +fs.readFileSync(pidfile) + process.kill(pid, 'SIGKILL') + } catch (er) {} + + fs.writeFileSync(pidfile, child.pid + '\n') +} +*/}.toString().split('\n').slice(1, -1).join('\n') + +var blart = function () {/* +var rando = require('crypto').randomBytes +var resolve = require('path').resolve + +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var writeFile = require('graceful-fs').writeFile + +var BASEDIR = resolve(__dirname, 'arena') + +var keepItGoingLouder = {} +var writers = 0 +var errors = 0 + +function gensym () { return rando(16).toString('hex') } + +function writeAlmostForever (filename) { + if (!keepItGoingLouder[filename]) { + writers-- + if (writers < 1) return done() + } else { + writeFile(filename, keepItGoingLouder[filename], function (err) { + if (err) errors++ + + writeAlmostForever(filename) + }) + } +} + +function done () { + rimraf(BASEDIR, function () { + if (errors > 0) console.log('not ok - %d errors', errors) + else console.log('ok') + }) +} + +mkdirp(BASEDIR, function go () { + for (var i = 0; i < 16; i++) { + var filename = resolve(BASEDIR, gensym() + '.txt') + + keepItGoingLouder[filename] = '' + for (var j = 0; j < 512; j++) keepItGoingLouder[filename] += filename + + writers++ + writeAlmostForever(filename) + } + + setTimeout(function viktor () { + // kill all the writers + keepItGoingLouder = {} + }, 3 * 1000) +}) +*/}.toString().split('\n').slice(1, -1).join('\n') +test('setup', function (t) { + cleanup() + + mkdirp.sync(pkg) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + + mkdirp.sync(path.join(deps, 'd1')) + fs.writeFileSync( + path.join(deps, 'd1', 'package.json'), + JSON.stringify(d1, null, 2) + ) + + mkdirp.sync(path.join(deps, 'd2')) + fs.writeFileSync( + path.join(deps, 'd2', 'package.json'), + JSON.stringify(d2, null, 2) + ) + fs.writeFileSync(path.join(deps, 'd2', 'blart.js'), blart) + + mkdirp.sync(path.join(deps, 'opdep')) + fs.writeFileSync( + path.join(deps, 'opdep', 'package.json'), + JSON.stringify(opdep, null, 2) + ) + fs.writeFileSync(path.join(deps, 'opdep', 'bad-server.js'), badServer) + + t.end() +}) + +test('go go test racer', function (t) { + common.npm( + [ + '--prefix', pkg, + '--fetch-retries', '0', + '--loglevel', 'silent', + '--cache', cache, + 'install' + ], + { + cwd: pkg, + env: { + PATH: process.env.PATH, + Path: process.env.Path + }, + stdio: [0, 'pipe', 2] + }, + function (er, code, stdout, stderr) { + t.ifError(er, 'install ran to completion without error') + t.notOk(code, 'npm install exited with code 0') + + t.equal(stdout, 'ok\nok\n') + t.notOk(/not ok/.test(stdout), 'should not contain the string \'not ok\'') + t.end() + } + ) +}) + +test('verify results', function (t) { + t.throws(function () { + fs.statSync(nm) + }) + t.end() +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + try { + var pid = +fs.readFileSync(pidfile) + process.kill(pid, 'SIGKILL') + } catch (er) {} + + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated-color.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated-color.js new file mode 100644 index 00000000..b35070c4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated-color.js @@ -0,0 +1,75 @@ +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var pkg = path.resolve(__dirname, 'outdated-color') + +var EXEC_OPTS = { cwd: pkg } + +function hasControlCodes (str) { + return str.length !== ansiTrim(str).length +} + +function ansiTrim (str) { + var r = new RegExp('\x1b(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|' + + '\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)', 'g') + return str.replace(r, '') +} + +var json = { + name: 'outdated-color', + description: 'fixture', + version: '0.0.1', + dependencies: { + underscore: '1.3.1' + } +} + +test('setup', function (t) { + cleanup() + mkdirp.sync(pkg) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + + process.chdir(pkg) + t.end() +}) + +// note hard to automate tests for color = true +// as npm kills the color config when it detects +// it's not running in a tty +test('does not use ansi styling', function (t) { + t.plan(4) + mr({ port: common.port }, function (er, s) { // create mock registry. + common.npm( + [ + '--registry', common.registry, + 'outdated', 'underscore' + ], + EXEC_OPTS, + function (err, code, stdout) { + t.ifError(err) + t.notOk(code, 'npm outdated exited with code 0') + t.ok(stdout, stdout.length) + t.ok(!hasControlCodes(stdout)) + s.close() + }) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated-depth-deep.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated-depth-deep.js new file mode 100644 index 00000000..c208669b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated-depth-deep.js @@ -0,0 +1,78 @@ +var common = require("../common-tap") + , path = require("path") + , test = require("tap").test + , rimraf = require("rimraf") + , npm = require("../../") + , mr = require("npm-registry-mock") + , pkg = path.resolve(__dirname, "outdated-depth-deep") + , cache = path.resolve(pkg, "cache") + +var osenv = require("osenv") +var mkdirp = require("mkdirp") +var fs = require("fs") + +var pj = JSON.stringify({ + "name": "whatever", + "description": "yeah idk", + "version": "1.2.3", + "main": "index.js", + "dependencies": { + "underscore": "1.3.1", + "npm-test-peer-deps": "0.0.0" + }, + "repository": "git://github.com/luk-/whatever" +}, null, 2) + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} + +function setup () { + mkdirp.sync(pkg) + process.chdir(pkg) + fs.writeFileSync(path.resolve(pkg, "package.json"), pj) +} + +test("setup", function (t) { + cleanup() + setup() + t.end() +}) + +test("outdated depth deep (9999)", function (t) { + var underscoreOutdated = ["underscore", "1.3.1", "1.3.1", "1.5.1", "1.3.1"] + var childPkg = path.resolve(pkg, "node_modules", "npm-test-peer-deps") + + var expected = [ [pkg].concat(underscoreOutdated), + [childPkg].concat(underscoreOutdated) ] + + process.chdir(pkg) + + mr({port : common.port}, function (er, s) { + npm.load({ + cache: cache + , loglevel: "silent" + , registry: common.registry + , depth: 9999 + } + , function () { + npm.install(".", function (er) { + if (er) throw new Error(er) + npm.outdated(function (err, d) { + if (err) throw new Error(err) + t.deepEqual(d, expected) + s.close() + t.end() + }) + }) + } + ) + }) +}) + + +test("cleanup", function (t) { + cleanup() + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated-depth-integer.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated-depth-integer.js new file mode 100644 index 00000000..485e84e3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated-depth-integer.js @@ -0,0 +1,77 @@ +var common = require('../common-tap') + , test = require('tap').test + , rimraf = require('rimraf') + , npm = require('../../') + , mr = require('npm-registry-mock') + , pkg = __dirname + '/outdated-depth-integer' + +var osenv = require("osenv") +var mkdirp = require("mkdirp") +var fs = require("fs") + +var pj = JSON.stringify({ + "name": "whatever", + "description": "yeah idk", + "version": "1.2.3", + "main": "index.js", + "dependencies": { + "underscore": "1.3.1" + }, + "repository": "git://github.com/luk-/whatever" +}, null, 2); + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} + +function setup () { + mkdirp.sync(pkg) + process.chdir(pkg) + fs.writeFileSync("package.json", pj) +} + +test("setup", function (t) { + cleanup() + setup() + t.end() +}) + +test('outdated depth integer', function (t) { + // todo: update with test-package-with-one-dep once the new + // npm-registry-mock is published + var expected = [[ + pkg, + 'underscore', + undefined, // no version installed + '1.3.1', // wanted + '1.5.1', // latest + '1.3.1' + ]] + + mr({port : common.port}, function (er, s) { + npm.load({ + cache: pkg + '/cache' + , loglevel: 'silent' + , registry: common.registry + , depth: 5 + } + , function () { + npm.install('request@0.9.0', function (er) { + if (er) throw new Error(er) + npm.outdated(function (err, d) { + if (err) throw new Error(err) + t.deepEqual(d, expected) + s.close() + t.end() + }) + }) + } + ) + }) +}) + +test("cleanup", function (t) { + cleanup() + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated-depth.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated-depth.js new file mode 100644 index 00000000..2f061279 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated-depth.js @@ -0,0 +1,75 @@ +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var npm = require('../../') +var common = require('../common-tap') + +var pkg = path.resolve(__dirname, 'outdated-depth') + +var json = { + name: 'outdated-depth', + version: '1.2.3', + dependencies: { + underscore: '1.3.1', + 'npm-test-peer-deps': '0.0.0' + } +} + +test('setup', function (t) { + cleanup() + mkdirp.sync(pkg) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + process.chdir(pkg) + + t.end() +}) + +test('outdated depth zero', function (t) { + var expected = [ + pkg, + 'underscore', + '1.3.1', + '1.3.1', + '1.5.1', + '1.3.1' + ] + + mr({ port: common.port }, function (er, s) { + npm.load( + { + loglevel: 'silent', + registry: common.registry + }, + function () { + npm.install('.', function (er) { + if (er) throw new Error(er) + npm.outdated(function (err, d) { + if (err) throw new Error(err) + t.deepEqual(d[0], expected) + s.close() + t.end() + }) + }) + } + ) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated-git.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated-git.js new file mode 100644 index 00000000..2162c743 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated-git.js @@ -0,0 +1,58 @@ +var path = require('path') + +var test = require('tap').test +var mkdirp = require('mkdirp') +var fs = require("graceful-fs") +var rimraf = require('rimraf') + +var common = require('../common-tap.js') +var npm = require('../../') + +// config +var pkg = path.resolve(__dirname, 'outdated-git') +var cache = path.resolve(pkg, 'cache') +var json = { + name: 'outdated-git', + author: 'Rocko Artischocko', + description: 'fixture', + version: '0.0.1', + main: 'index.js', + dependencies: { + 'foo-github': 'robertkowalski/foo', + 'foo-private': 'git://github.com/robertkowalski/foo-private.git', + 'foo-private-credentials': 'git://user:pass@github.com/robertkowalski/foo-private.git' + } +} + +test('setup', function (t) { + setup() + t.end() +}) + +test('discovers new versions in outdated', function (t) { + process.chdir(pkg) + t.plan(5) + npm.load({cache: cache, registry: common.registry, loglevel: 'silent'}, function () { + npm.commands.outdated([], function (er, d) { + t.equal(d[0][3], 'git') + t.equal(d[0][4], 'git') + t.equal(d[0][5], 'github:robertkowalski/foo') + t.equal(d[1][5], 'git://github.com/robertkowalski/foo-private.git') + t.equal(d[2][5], 'git://user:pass@github.com/robertkowalski/foo-private.git') + }) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function setup () { + mkdirp.sync(cache) + fs.writeFileSync(path.join(pkg, 'package.json'), JSON.stringify(json, null, 2), 'utf8') +} + +function cleanup () { + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated-include-devdependencies.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated-include-devdependencies.js new file mode 100644 index 00000000..7ab00884 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated-include-devdependencies.js @@ -0,0 +1,55 @@ +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var rimraf = require('rimraf') +var test = require('tap').test + +var npm = require('../../') +var common = require('../common-tap.js') + +// config +var pkg = path.resolve(__dirname, 'outdated-include-devdependencies') +var cache = path.resolve(pkg, 'cache') + +var json = { + author: 'Rocko Artischocko', + name: 'ignore-shrinkwrap', + version: '0.0.0', + devDependencies: { + underscore: '>=1.3.1' + } +} + +test('setup', function (t) { + cleanup() + mkdirp.sync(cache) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + t.end() +}) + +test('includes devDependencies in outdated', function (t) { + process.chdir(pkg) + mr({ port: common.port }, function (er, s) { + npm.load({ cache: cache, registry: common.registry }, function () { + npm.outdated(function (er, d) { + t.equal('1.5.1', d[0][3]) + s.close() + t.end() + }) + }) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated-json.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated-json.js new file mode 100644 index 00000000..2dd6867e --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated-json.js @@ -0,0 +1,105 @@ +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') +var server + +var pkg = path.resolve(__dirname, 'outdated-json') + +var EXEC_OPTS = { cwd: pkg } + +var json = { + name: 'outdated-json', + author: 'Rockbert', + version: '0.0.0', + dependencies: { + underscore: '~1.3.1' + }, + devDependencies: { + request: '~0.9.0' + } +} + +var expected = { + underscore: { + current: '1.3.3', + wanted: '1.3.3', + latest: '1.5.1', + location: 'node_modules' + path.sep + 'underscore' + }, + request: { + current: '0.9.5', + wanted: '0.9.5', + latest: '2.27.0', + location: 'node_modules' + path.sep + 'request' + } +} + +test('setup', function (t) { + cleanup() + mkdirp.sync(pkg) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + process.chdir(pkg) + mr({ port: common.port }, function (er, s) { + t.ifError(er, 'mock registry should never fail to start') + server = s + common.npm( + [ + '--registry', common.registry, + '--silent', + 'install' + ], + EXEC_OPTS, + function (err, code) { + t.ifError(err, 'npm install ran without issue') + t.notOk(code, 'npm install ran without raising error code') + + t.end() + } + ) + }) +}) + +test('it should log json data', function (t) { + common.npm( + [ + '--registry', common.registry, + '--silent', + '--json', + 'outdated' + ], + EXEC_OPTS, + function (err, code, stdout) { + t.ifError(err, 'npm outdated ran without issue') + t.notOk(code, 'npm outdated ran without raising error code') + var out + t.doesNotThrow(function () { + out = JSON.parse(stdout) + }, 'output correctly parsed as JSON') + t.deepEqual(out, expected) + + t.end() + } + ) +}) + +test('cleanup', function (t) { + server.close() + cleanup() + t.end() +}) + +function cleanup () { + // windows fix for locked files + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated-local.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated-local.js new file mode 100644 index 00000000..f9b8af44 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated-local.js @@ -0,0 +1,194 @@ +var common = require('../common-tap.js') +var test = require('tap').test +var npm = require('../../') +var rimraf = require('rimraf') +var path = require('path') +var mr = require('npm-registry-mock') +var osenv = require('osenv') +var mkdirp = require('mkdirp') +var fs = require('graceful-fs') + +var pkg = path.resolve(__dirname, 'outdated-local') +var pkgLocal = path.resolve(pkg, 'local-module') +var pkgScopedLocal = path.resolve(pkg, 'another-local-module') +var pkgLocalUnderscore = path.resolve(pkg, 'underscore') +var pkgLocalOptimist = path.resolve(pkg, 'optimist') + +var pjParent = JSON.stringify({ + name: 'outdated-local', + version: '1.0.0', + dependencies: { + 'local-module': 'file:local-module', // updated locally, not on repo + '@scoped/another-local-module': 'file:another-local-module', // updated locally, scoped, not on repo + 'underscore': 'file:underscore', // updated locally, updated but lesser version on repo + 'optimist': 'file:optimist' // updated locally, updated and greater version on repo + } +}, null, 2) + '\n' + +var pjLocal = JSON.stringify({ + name: 'local-module', + version: '1.0.0' +}, null, 2) + '\n' + +var pjLocalBumped = JSON.stringify({ + name: 'local-module', + version: '1.1.0' +}, null, 2) + '\n' + +var pjScopedLocal = JSON.stringify({ + name: '@scoped/another-local-module', + version: '1.0.0' +}, null, 2) + '\n' + +var pjScopedLocalBumped = JSON.stringify({ + name: '@scoped/another-local-module', + version: '1.2.0' +}, null, 2) + '\n' + +var pjLocalUnderscore = JSON.stringify({ + name: 'underscore', + version: '1.3.1' +}, null, 2) + '\n' + +var pjLocalUnderscoreBumped = JSON.stringify({ + name: 'underscore', + version: '1.6.1' +}, null, 2) + '\n' + +var pjLocalOptimist = JSON.stringify({ + name: 'optimist', + version: '0.4.0' +}, null, 2) + '\n' + +var pjLocalOptimistBumped = JSON.stringify({ + name: 'optimist', + version: '0.5.0' +}, null, 2) + '\n' + + +function mocks (server) { + server.get('/local-module') + .reply(404) + server.get('/@scoped%2fanother-local-module') + .reply(404) +} + +test('setup', function (t) { + bootstrap() + t.end() +}) + +test('outdated support local modules', function (t) { + t.plan(4) + process.chdir(pkg) + mr({ port: common.port, plugin: mocks }, function (err, s) { + t.ifError(err, 'mock registry started without problems') + + function verify (actual, expected) { + for (var i = 0; i < expected.length; i++) { + var current = expected[i] + + var found = false + for (var j = 0; j < actual.length; j++) { + var target = actual[j] + + var k + for (k = 0; k < current.length; k++) { + if (current[k] !== target[k]) break + } + if (k === current.length) found = true + } + + if (!found) return false + } + + return true + } + + npm.load( + { + loglevel: 'silent', + parseable: true, + registry: common.registry + }, + function () { + npm.install('.', function (err) { + t.ifError(err, 'install success') + bumpLocalModules() + npm.outdated(function (er, d) { + t.ifError(er, 'outdated success') + t.ok(verify(d, [ + [ + path.resolve(__dirname, 'outdated-local'), + 'local-module', + '1.0.0', + '1.1.0', + '1.1.0', + 'file:local-module' + ], + [ + path.resolve(__dirname, 'outdated-local'), + '@scoped/another-local-module', + '1.0.0', + '1.2.0', + '1.2.0', + 'file:another-local-module' + ], + [ + path.resolve(__dirname, 'outdated-local'), + 'underscore', + '1.3.1', + '1.6.1', + '1.5.1', + 'file:underscore' + ], + [ + path.resolve(__dirname, 'outdated-local'), + 'optimist', + '0.4.0', + '0.6.0', + '0.6.0', + 'optimist@0.6.0' + ] + ]), 'got expected outdated output') + s.close() + }) + }) + } + ) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function bootstrap () { + mkdirp.sync(pkg) + fs.writeFileSync(path.resolve(pkg, 'package.json'), pjParent) + + mkdirp.sync(pkgLocal) + fs.writeFileSync(path.resolve(pkgLocal, 'package.json'), pjLocal) + + mkdirp.sync(pkgScopedLocal) + fs.writeFileSync(path.resolve(pkgScopedLocal, 'package.json'), pjScopedLocal) + + mkdirp.sync(pkgLocalUnderscore) + fs.writeFileSync(path.resolve(pkgLocalUnderscore, 'package.json'), pjLocalUnderscore) + + mkdirp.sync(pkgLocalOptimist) + fs.writeFileSync(path.resolve(pkgLocalOptimist, 'package.json'), pjLocalOptimist) +} + +function bumpLocalModules () { + fs.writeFileSync(path.resolve(pkgLocal, 'package.json'), pjLocalBumped) + fs.writeFileSync(path.resolve(pkgScopedLocal, 'package.json'), pjScopedLocalBumped) + fs.writeFileSync(path.resolve(pkgLocalUnderscore, 'package.json'), pjLocalUnderscoreBumped) + fs.writeFileSync(path.resolve(pkgLocalOptimist, 'package.json'), pjLocalOptimistBumped) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated-long.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated-long.js new file mode 100644 index 00000000..87e1f23b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated-long.js @@ -0,0 +1,101 @@ +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') +var npm = require('../../') + +// config +var pkg = path.resolve(__dirname, 'outdated-long') +var cache = path.resolve(pkg, 'cache') + +var json = { + name: 'outdated-long', + description: 'fixture', + version: '0.0.1', + dependencies: { + underscore: '1.3.1' + } +} + +test('setup', function (t) { + cleanup() + mkdirp.sync(cache) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + + process.chdir(pkg) + t.end() +}) + +test('it should not throw', function (t) { + var originalLog = console.log + + var output = [] + var expOut = [ + path.resolve(pkg, 'node_modules', 'underscore'), + path.resolve(pkg, 'node_modules', 'underscore') + + ':underscore@1.3.1' + + ':underscore@1.3.1' + + ':underscore@1.5.1' + + ':dependencies' + ] + + var expData = [ + [ + pkg, + 'underscore', + '1.3.1', + '1.3.1', + '1.5.1', + '1.3.1', + 'dependencies' + ] + ] + + console.log = function () { + output.push.apply(output, arguments) + } + mr({ port: common.port }, function (er, s) { + npm.load( + { + cache: 'cache', + loglevel: 'silent', + parseable: true, + registry: common.registry + }, + function () { + npm.install('.', function (err) { + t.ifError(err, 'install success') + npm.config.set('long', true) + npm.outdated(function (er, d) { + t.ifError(er, 'outdated success') + + console.log = originalLog + + t.same(output, expOut) + t.same(d, expData) + + s.close() + t.end() + }) + }) + } + ) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated-new-versions.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated-new-versions.js new file mode 100644 index 00000000..c6fbd426 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated-new-versions.js @@ -0,0 +1,62 @@ +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') +var npm = require('../../') + +var pkg = path.resolve(__dirname, 'outdated-new-versions') +var cache = path.resolve(pkg, 'cache') + +var json = { + name: 'new-versions-with-outdated', + author: 'Rockbert', + version: '0.0.0', + dependencies: { + underscore: '~1.3.1' + }, + devDependencies: { + request: '~0.9.0' + } +} + +test('setup', function (t) { + cleanup() + mkdirp.sync(cache) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + t.end() +}) + +test('dicovers new versions in outdated', function (t) { + process.chdir(pkg) + t.plan(2) + + mr({ port: common.port }, function (er, s) { + npm.load({ cache: cache, registry: common.registry }, function () { + npm.outdated(function (er, d) { + for (var i = 0; i < d.length; i++) { + if (d[i][1] === 'underscore') t.equal('1.5.1', d[i][4]) + if (d[i][1] === 'request') t.equal('2.27.0', d[i][4]) + } + s.close() + t.end() + }) + }) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated-notarget.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated-notarget.js new file mode 100644 index 00000000..6058ddee --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated-notarget.js @@ -0,0 +1,47 @@ +// Fixes Issue #1770 +var common = require("../common-tap.js") +var test = require("tap").test +var npm = require("../../") +var osenv = require("osenv") +var path = require("path") +var fs = require("fs") +var rimraf = require("rimraf") +var mkdirp = require("mkdirp") +var pkg = path.resolve(__dirname, "outdated-notarget") +var cache = path.resolve(pkg, "cache") +var mr = require("npm-registry-mock") + +test("outdated-target: if no viable version is found, show error", function (t) { + t.plan(1) + setup() + mr({port : common.port}, function (er, s) { + npm.load({ cache: cache, registry: common.registry}, function () { + npm.commands.update(function (er) { + t.equal(er.code, "ETARGET") + s.close() + t.end() + }) + }) + }) +}) + +test("cleanup", function (t) { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) + t.end() +}) + +function setup() { + mkdirp.sync(pkg) + mkdirp.sync(cache) + fs.writeFileSync(path.resolve(pkg, "package.json"), JSON.stringify({ + author: "Evan Lucas", + name: "outdated-notarget", + version: "0.0.0", + description: "Test for outdated-target", + dependencies: { + underscore: "~199.7.1" + } + }), "utf8") + process.chdir(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated-private.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated-private.js new file mode 100644 index 00000000..882d7d94 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated-private.js @@ -0,0 +1,112 @@ +var common = require("../common-tap.js") +var test = require("tap").test +var npm = require("../../") +var rimraf = require("rimraf") +var path = require("path") +var mr = require("npm-registry-mock") +var osenv = require("osenv") +var mkdirp = require("mkdirp") +var fs = require("graceful-fs") + +var pkg = path.resolve(__dirname, "outdated-private") +var pkgLocalPrivate = path.resolve(pkg, "local-private") +var pkgScopedLocalPrivate = path.resolve(pkg, "another-local-private") +var pkgLocalUnderscore = path.resolve(pkg, "underscore") + +var pjParent = JSON.stringify({ + name : "outdated-private", + version : "1.0.0", + dependencies : { + "local-private" : "file:local-private", + "@scoped/another-local-private" : "file:another-local-private", + "underscore" : "file:underscore" + } +}, null, 2) + "\n" + +var pjLocalPrivate = JSON.stringify({ + name : "local-private", + version : "1.0.0", + private : true +}, null, 2) + "\n" + +var pjLocalPrivateBumped = JSON.stringify({ + name : "local-private", + version : "1.1.0", + private : true +}, null, 2) + "\n" + +var pjScopedLocalPrivate = JSON.stringify({ + name : "@scoped/another-local-private", + version : "1.0.0", + private : true +}, null, 2) + "\n" + +var pjLocalUnderscore = JSON.stringify({ + name : "underscore", + version : "1.3.1" +}, null, 2) + "\n" + +test("setup", function (t) { + bootstrap() + t.end() +}) + +test("outdated ignores private modules", function (t) { + t.plan(3) + process.chdir(pkg) + mr({ port : common.port }, function (err, s) { + npm.load( + { + loglevel : "silent", + parseable : true, + registry : common.registry + }, + function () { + npm.install(".", function (err) { + t.ifError(err, "install success") + bumpLocalPrivate() + npm.outdated(function (er, d) { + t.ifError(er, "outdated success") + t.deepEqual(d, [[ + path.resolve(__dirname, "outdated-private"), + "underscore", + "1.3.1", + "1.5.1", + "1.5.1", + "underscore@1.5.1" + ]]) + s.close() + }) + }) + } + ) + }) +}) + +test("cleanup", function (t) { + cleanup() + t.end() +}) + +function bootstrap () { + mkdirp.sync(pkg) + fs.writeFileSync(path.resolve(pkg, "package.json"), pjParent) + + mkdirp.sync(pkgLocalPrivate) + fs.writeFileSync(path.resolve(pkgLocalPrivate, "package.json"), pjLocalPrivate) + + mkdirp.sync(pkgScopedLocalPrivate) + fs.writeFileSync(path.resolve(pkgScopedLocalPrivate, "package.json"), pjScopedLocalPrivate) + + mkdirp.sync(pkgLocalUnderscore) + fs.writeFileSync(path.resolve(pkgLocalUnderscore, "package.json"), pjLocalUnderscore) +} + +function bumpLocalPrivate () { + fs.writeFileSync(path.resolve(pkgLocalPrivate, "package.json"), pjLocalPrivateBumped) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated-symlink.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated-symlink.js new file mode 100644 index 00000000..828ab213 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated-symlink.js @@ -0,0 +1,96 @@ +var fs = require('graceful-fs') +var path = require('path') +var osenv = require('osenv') +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var pkg = path.resolve(__dirname, 'outdated-symlink') +var cache = path.resolve(pkg, 'cache') +var originalLog + +var fakeRoot = path.join(__dirname, 'fakeRoot') +var OPTS = { + env: { + 'npm_config_prefix': fakeRoot + } +} + +var json = { + name: 'my-local-package', + description: 'fixture', + version: '1.0.0' +} + +test('setup', function (t) { + cleanup() + originalLog = console.log + mkdirp.sync(cache) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + process.chdir(pkg) + common.npm(['install', '-g', 'async@0.2.9', 'underscore@1.3.1'], OPTS, function (err, c, out) { + t.ifError(err, 'global install did not error') + common.npm(['link'], OPTS, function (err, c, out) { + t.ifError(err, 'link did not error') + common.npm(['ls', '-g'], OPTS, function (err, c, out, stderr) { + t.ifError(err) + t.equal(c, 0) + t.equal(stderr, '', 'got expected stderr') + t.has(out, /my-local-package@1.0.0/, 'creates global link ok') + t.end() + }) + }) + }) +}) + +test('when outdated is called linked packages should be displayed as such', function (t) { + var regOutLinked = /my-local-package\s*1.0.0\s*linked\s*linked/ + var regOutInstallOne = /async\s*0.2.9\s*0.2.10\s*0.2.10/ + var regOutInstallTwo = /underscore\s*1.3.1\s*1.5.1\s*1.5.1/ + + console.log = function () {} + mr({ port: common.port }, function (er, s) { + common.npm( + [ + '--registry', common.registry, + 'outdated', '-g' + ], + OPTS, + function (err, c, out, stderr) { + t.ifError(err) + t.match(out, regOutLinked, 'Global Link format as expected') + t.match(out, regOutInstallOne, 'Global Install format as expected') + t.match(out, regOutInstallTwo, 'Global Install format as expected') + s.close() + t.end() + } + ) + }) +}) + +test('cleanup', function (t) { + process.chdir(osenv.tmpdir()) + common.npm(['rm', 'outdated'], OPTS, function (err, code) { + t.ifError(err, 'npm removed the linked package without error') + t.equal(code, 0, 'cleanup outdated in local ok') + common.npm(['rm', '-g', 'outdated', 'async', 'underscore'], OPTS, function (err, code) { + t.ifError(err, 'npm removed the global package without error') + t.equal(code, 0, 'cleanup outdated in global ok') + + console.log = originalLog + cleanup() + t.end() + }) + }) +}) + +function cleanup () { + rimraf.sync(pkg) + rimraf.sync(fakeRoot) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated.js new file mode 100644 index 00000000..146c2007 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/outdated.js @@ -0,0 +1,127 @@ +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var rimraf = require('rimraf') +var test = require('tap').test + +var npm = require('../../') +var common = require('../common-tap.js') + +// config +var pkg = path.resolve(__dirname, 'outdated') +var cache = path.resolve(pkg, 'cache') +var originalLog + +var json = { + name: 'outdated', + description: 'fixture', + version: '0.0.1', + dependencies: { + underscore: '1.3.1', + async: '0.2.9', + checker: '0.5.1' + } +} + +test('setup', function (t) { + cleanup() + originalLog = console.log + mkdirp.sync(cache) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + + process.chdir(pkg) + t.end() +}) + +test('it should not throw', function (t) { + var output = [] + var expOut = [ + path.resolve(pkg, 'node_modules', 'async') + + ':async@0.2.9' + + ':async@0.2.9' + + ':async@0.2.10' + + '\n' + + path.resolve(pkg, 'node_modules', 'checker') + + ':checker@0.5.1' + + ':checker@0.5.1' + + ':checker@0.5.2' + + '\n' + + path.resolve(pkg, 'node_modules', 'underscore') + + ':underscore@1.3.1' + + ':underscore@1.3.1' + + ':underscore@1.5.1' + ] + + var expData = [ + [ + pkg, + 'async', + '0.2.9', + '0.2.9', + '0.2.10', + '0.2.9' + ], + [ + pkg, + 'checker', + '0.5.1', + '0.5.1', + '0.5.2', + '0.5.1' + ], + [ + pkg, + 'underscore', + '1.3.1', + '1.3.1', + '1.5.1', + '1.3.1' + ] + ] + + console.log = function () {} + mr({ port: common.port }, function (er, s) { + npm.load( + { + cache: 'cache', + loglevel: 'silent', + parseable: true, + registry: common.registry + }, + function () { + npm.install('.', function (err) { + t.ifError(err, 'install success') + console.log = function () { + output.push.apply(output, arguments) + } + npm.outdated(function (er, d) { + t.ifError(er, 'outdated success') + + console.log = originalLog + + t.same(output, expOut) + t.same(d, expData) + + s.close() + t.end() + }) + }) + } + ) + }) +}) + +test('cleanup', function (t) { + cleanup() + console.log = originalLog + t.end() +}) + +function cleanup () { + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/owner.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/owner.js new file mode 100644 index 00000000..938c2166 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/owner.js @@ -0,0 +1,163 @@ +var mr = require("npm-registry-mock") +var test = require("tap").test + +var common = require("../common-tap.js") + +var server + +var EXEC_OPTS = {} + +var jashkenas = { + name : "jashkenas", + email : "jashkenas@gmail.com" +} + +var othiym23 = { + name : "othiym23", + email : "forrest@npmjs.com" +} + +var bcoe = { + name : "bcoe", + email : "ben@npmjs.com" +} + +function shrt (user) { + return user.name+" <"+user.email+">\n" +} + +function mocks (server) { + server.get("/-/user/org.couchdb.user:othiym23") + .many().reply(200, othiym23) + + // test 1 + server.get("/underscore") + .reply(200, {_id:"underscore",_rev:1,maintainers:[jashkenas]}) + server.put( + "/underscore/-rev/1", + {_id:"underscore",_rev:1,maintainers:[jashkenas,othiym23]}, + {} + ).reply(200, {_id:"underscore",_rev:2,maintainers:[jashkenas,othiym23]}) + + // test 2 + server.get("/@xxx%2fscoped") + .reply(200, {_id:"@xxx/scoped",_rev:1,maintainers:[bcoe]}) + server.put( + "/@xxx%2fscoped/-rev/1", + {_id:"@xxx/scoped",_rev:1,maintainers:[bcoe,othiym23]}, + {} + ).reply(200, {_id:"@xxx/scoped",_rev:2,maintainers:[bcoe,othiym23]}) + + // test 3 + server.get("/underscore") + .reply(200, {_id:"underscore",_rev:2,maintainers:[jashkenas,othiym23]}) + + // test 4 + server.get("/underscore") + .reply(200, {_id:"underscore",_rev:2,maintainers:[jashkenas,othiym23]}) + server.put( + "/underscore/-rev/2", + {_id:"underscore",_rev:2,maintainers:[jashkenas]}, + {} + ).reply(200, {_id:"underscore",_rev:3,maintainers:[jashkenas]}) +} + +test("setup", function (t) { + common.npm( + [ + "--loglevel", "silent", + "cache", "clean" + ], + EXEC_OPTS, + function (err, code) { + t.ifError(err, "npm cache clean ran without error") + t.notOk(code, "npm cache clean exited cleanly") + + mr({ port : common.port, plugin : mocks }, function (err, s) { + server = s + t.end() + }) + } + ) +}) + +test("npm owner add", function (t) { + common.npm( + [ + "--loglevel", "silent", + "--registry", common.registry, + "owner", "add", "othiym23", "underscore" + ], + EXEC_OPTS, + function (err, code, stdout, stderr) { + t.ifError(err, "npm owner add ran without error") + t.notOk(code, "npm owner add exited cleanly") + t.notOk(stderr, "npm owner add ran silently") + t.equal(stdout, "+ othiym23 (underscore)\n", "got expected add output") + + t.end() + } + ) +}) + +test("npm owner add (scoped)", function (t) { + common.npm( + [ + "--loglevel", "silent", + "--registry", common.registry, + "owner", "add", "othiym23", "@xxx/scoped" + ], + EXEC_OPTS, + function (err, code, stdout, stderr) { + t.ifError(err, "npm owner add (scoped) ran without error") + t.notOk(code, "npm owner add (scoped) exited cleanly") + t.notOk(stderr, "npm owner add (scoped) ran silently") + t.equal(stdout, "+ othiym23 (@xxx/scoped)\n", "got expected scoped add output") + + t.end() + } + ) +}) + +test("npm owner ls", function (t) { + common.npm( + [ + "--loglevel", "silent", + "--registry", common.registry, + "owner", "ls", "underscore" + ], + EXEC_OPTS, + function (err, code, stdout, stderr) { + t.ifError(err, "npm owner ls ran without error") + t.notOk(code, "npm owner ls exited cleanly") + t.notOk(stderr, "npm owner ls ran silently") + t.equal(stdout, shrt(jashkenas)+shrt(othiym23), "got expected ls output") + + t.end() + } + ) +}) + +test("npm owner rm", function (t) { + common.npm( + [ + "--loglevel", "silent", + "--registry", common.registry, + "owner", "rm", "othiym23", "underscore" + ], + EXEC_OPTS, + function (err, code, stdout, stderr) { + t.ifError(err, "npm owner rm ran without error") + t.notOk(code, "npm owner rm exited cleanly") + t.notOk(stderr, "npm owner rm ran silently") + t.equal(stdout, "- othiym23 (underscore)\n", "got expected rm output") + + t.end() + } + ) +}) + +test("cleanup", function (t) { + server.close() + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/pack-scoped.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/pack-scoped.js new file mode 100644 index 00000000..5c351339 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/pack-scoped.js @@ -0,0 +1,81 @@ +// verify that prepublish runs on pack and publish +var test = require("tap").test +var common = require("../common-tap") +var fs = require("graceful-fs") +var join = require("path").join +var mkdirp = require("mkdirp") +var rimraf = require("rimraf") + +var pkg = join(__dirname, "scoped_package") +var manifest = join(pkg, "package.json") +var tmp = join(pkg, "tmp") +var cache = join(pkg, "cache") + +var data = { + name : "@scope/generic-package", + version : "90000.100001.5" +} + +test("setup", function (t) { + var n = 0 + + rimraf.sync(pkg) + + mkdirp(pkg, then()) + mkdirp(cache, then()) + mkdirp(tmp, then()) + + function then () { + n++ + return function (er) { + t.ifError(er) + if (--n === 0) next() + } + } + + function next () { + fs.writeFile(manifest, JSON.stringify(data), "ascii", done) + } + + function done (er) { + t.ifError(er) + + t.pass("setup done") + t.end() + } +}) + +test("test", function (t) { + var env = { + "npm_config_cache" : cache, + "npm_config_tmp" : tmp, + "npm_config_prefix" : pkg, + "npm_config_global" : "false" + } + + for (var i in process.env) { + if (!/^npm_config_/.test(i)) env[i] = process.env[i] + } + + common.npm([ + "pack", + "--loglevel", "warn" + ], { + cwd: pkg, + env: env + }, function(err, code, stdout, stderr) { + t.ifErr(err, "npm pack finished without error") + t.equal(code, 0, "npm pack exited ok") + t.notOk(stderr, "got stderr data: " + JSON.stringify("" + stderr)) + stdout = stdout.trim() + var regex = new RegExp("scope-generic-package-90000.100001.5.tgz", "ig") + t.ok(stdout.match(regex), "found package") + t.end() + }) +}) + +test("cleanup", function (t) { + rimraf.sync(pkg) + t.pass("cleaned up") + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/peer-deps-invalid.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/peer-deps-invalid.js new file mode 100644 index 00000000..3f51dbfc --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/peer-deps-invalid.js @@ -0,0 +1,94 @@ +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test +var Tacks = require('tacks') +var Dir = Tacks.Dir +var File = Tacks.File + +var npm = require('../../') +var common = require('../common-tap') + +var testdir = path.resolve(__dirname, path.basename(__filename, '.js')) +var cachedir = path.resolve(testdir, 'cache') + +var fixtures = new Tacks(Dir({ + cache: Dir({}), + 'package.json': File({ + author: 'Domenic Denicola <domenic@domenicdenicola.com> (http://domenicdenicola.com/)', + name: 'peer-deps-invalid', + version: '0.0.0', + dependencies: { + 'npm-test-peer-deps-file': 'file-ok/', + 'npm-test-peer-deps-file-invalid': 'file-fail/' + } + }), + 'file-ok': Dir({ + 'package.json': File({ + name: 'npm-test-peer-deps-file', + main: 'index.js', + version: '1.2.3', + description:'This one should conflict with the other one', + peerDependencies: { underscore: '1.3.1' }, + dependencies: { mkdirp: '0.3.5' } + }), + 'index.js': File( + "module.exports = 'I\'m just a lonely index, naked as the day I was born.'" + ), + }), + 'file-fail': Dir({ + 'package.json': File({ + name: 'npm-test-peer-deps-file-invalid', + main: 'index.js', + version: '1.2.3', + description:'This one should conflict with the other one', + peerDependencies: { underscore: '1.3.3' } + }), + 'index.js': File( + "module.exports = 'I\'m just a lonely index, naked as the day I was born.'" + ), + }), +})) + +test('setup', function (t) { + cleanup() + fixtures.create(testdir) + process.chdir(testdir) + t.end() +}) + +test('installing dependencies that have conflicting peerDependencies', function (t) { + mr({port: common.port}, function (err, s) { // create mock registry. + t.ifError(err, 'mock registry started') + npm.load({ + cache: cachedir, + registry: common.registry + }, function () { + npm.commands.install([], function (err) { + if (!err) { + t.fail("No error!") + } else { + t.equal(err.code, "EPEERINVALID") + t.equal(err.packageName, "underscore") + t.match(err.packageVersion, /^1\.3\.[13]$/) + t.match(err.message, /^The package underscore@1\.3\.[13] does not satisfy its siblings' peerDependencies requirements!$/) + } + s.close() // shutdown mock registry. + t.end() + }) + }) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + fixtures.remove(testdir) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/peer-deps-toplevel.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/peer-deps-toplevel.js new file mode 100644 index 00000000..5b5e29b0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/peer-deps-toplevel.js @@ -0,0 +1,97 @@ +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') +var npm = npm = require('../../') + +var pkg = path.resolve(__dirname, 'peer-deps-toplevel') + +var expected = { + name: 'npm-test-peer-deps-toplevel', + version: '0.0.0', + dependencies: { + 'npm-test-peer-deps': { + version: '0.0.0', + from: 'npm-test-peer-deps@*', + resolved: common.registry + '/npm-test-peer-deps/-/npm-test-peer-deps-0.0.0.tgz', + dependencies: { + underscore: { + version: '1.3.1', + from: 'underscore@1.3.1', + resolved: common.registry + '/underscore/-/underscore-1.3.1.tgz' + } + } + }, + mkdirp: { + version: '0.3.5', + from: 'mkdirp@*', + resolved: common.registry + '/mkdirp/-/mkdirp-0.3.5.tgz' + }, + request: { + version: '0.9.5', + from: 'request@>=0.9.0 <0.10.0', + resolved: common.registry + '/request/-/request-0.9.5.tgz' + } + } +} + +var json = { + author: 'Domenic Denicola', + name: 'npm-test-peer-deps-toplevel', + version: '0.0.0', + dependencies: { + 'npm-test-peer-deps': '*' + }, + peerDependencies: { + mkdirp: '*' + } +} + +test('installs the peer dependency directory structure', function (t) { + mr({ port: common.port }, function (er, s) { + setup(function (err) { + t.ifError(err, 'setup ran successfully') + + npm.install('.', function (err) { + t.ifError(err, 'packages were installed') + + npm.commands.ls([], true, function (err, _, results) { + t.ifError(err, 'listed tree without problems') + + t.deepEqual(results, expected, 'got expected output from ls') + s.close() + t.end() + }) + }) + }) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function setup (cb) { + cleanup() + mkdirp.sync(pkg) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + process.chdir(pkg) + + var opts = { cache: path.resolve(pkg, 'cache'), registry: common.registry} + npm.load(opts, cb) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/peer-deps-without-package-json.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/peer-deps-without-package-json.js new file mode 100644 index 00000000..08322eef --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/peer-deps-without-package-json.js @@ -0,0 +1,81 @@ +var fs = require('fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var npm = require('../../') +var common = require('../common-tap.js') + +var pkg = path.resolve(__dirname, 'peer-deps-without-package-json') +var cache = path.resolve(pkg, 'cache') +var nodeModules = path.resolve(pkg, 'node_modules') + +var fileJS = function () { +/**package +* { "name": "npm-test-peer-deps-file" +* , "main": "index.js" +* , "version": "1.2.3" +* , "description":"No package.json in sight!" +* , "peerDependencies": { "underscore": "1.3.1" } +* , "dependencies": { "mkdirp": "0.3.5" } +* } +**/ + + module.exports = 'I\'m just a lonely index, naked as the day I was born.' +}.toString().split('\n').slice(1, -1).join('\n') + +test('setup', function (t) { + t.comment('test for https://github.com/npm/npm/issues/3049') + cleanup() + mkdirp.sync(cache) + mkdirp.sync(nodeModules) + fs.writeFileSync(path.join(pkg, 'file-js.js'), fileJS) + process.chdir(pkg) + + t.end() +}) + +test('installing a peerDeps-using package without package.json', function (t) { + var customMocks = { + 'get': { + '/ok.js': [200, path.join(pkg, 'file-js.js')] + } + } + mr({port: common.port, mocks: customMocks}, function (err, s) { + t.ifError(err, 'mock registry booted') + npm.load({ + registry: common.registry, + cache: cache + }, function () { + npm.install(common.registry + '/ok.js', function (err) { + t.ifError(err, 'installed ok.js') + + t.ok( + fs.existsSync(path.join(nodeModules, 'npm-test-peer-deps-file')), + 'passive peer dep installed' + ) + t.ok( + fs.existsSync(path.join(nodeModules, 'underscore')), + 'underscore installed' + ) + + t.end() + s.close() // shutdown mock registry. + }) + }) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/peer-deps.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/peer-deps.js new file mode 100644 index 00000000..48023d7a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/peer-deps.js @@ -0,0 +1,89 @@ +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') +var npm = npm = require('../../') + +var pkg = path.resolve(__dirname, 'peer-deps') + +var expected = { + name: 'npm-test-peer-deps-installer', + version: '0.0.0', + dependencies: { + 'npm-test-peer-deps': { + version: '0.0.0', + from: 'npm-test-peer-deps@*', + resolved: common.registry + '/npm-test-peer-deps/-/npm-test-peer-deps-0.0.0.tgz', + dependencies: { + underscore: { + version: '1.3.1', + from: 'underscore@1.3.1', + resolved: common.registry + '/underscore/-/underscore-1.3.1.tgz' + } + } + }, + request: { + version: '0.9.5', + from: 'request@>=0.9.0 <0.10.0', + resolved: common.registry + '/request/-/request-0.9.5.tgz' + } + } +} + +var json = { + author: 'Domenic Denicola', + name: 'npm-test-peer-deps-installer', + version: '0.0.0', + dependencies: { + 'npm-test-peer-deps': '*' + } +} + +test('installs the peer dependency directory structure', function (t) { + mr({ port: common.port }, function (er, s) { + setup(function (err) { + if (err) return t.fail(err) + + npm.install('.', function (err) { + if (err) return t.fail(err) + + npm.commands.ls([], true, function (err, _, results) { + if (err) return t.fail(err) + + t.deepEqual(results, expected) + s.close() + t.end() + }) + }) + }) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function setup (cb) { + cleanup() + mkdirp.sync(pkg) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + process.chdir(pkg) + + var opts = { cache: path.resolve(pkg, 'cache'), registry: common.registry} + npm.load(opts, cb) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/ping.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/ping.js new file mode 100644 index 00000000..13fc4bec --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/ping.js @@ -0,0 +1,68 @@ +var fs = require('fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var pkg = path.resolve(__dirname, 'ping') +var opts = { cwd: pkg } + +var outfile = path.join(pkg, '_npmrc') + +var contents = function () { +}.toString().split('\n').slice(1, -1).join('\n') + +var pingResponse = { + host: 'registry.npmjs.org', + ok: true, + username: null, + peer: 'example.com' +} + +function mocks (server) { + server.get('/-/ping?write=true').reply(200, JSON.stringify(pingResponse)) +} + +test('setup', function (t) { + cleanup() + setup() + t.end() +}) + +test('npm ping', function (t) { + mr({ port: common.port, plugin: mocks }, function (err, s) { + if (err) throw err + + common.npm([ + 'ping', + '--registry', common.registry, + '--loglevel', 'silent', + '--userconfig', outfile + ], opts, function (err, code, stdout) { + s.close() + t.ifError(err, 'no error output') + t.notOk(code, 'exited OK') + + t.same(JSON.parse(stdout), pingResponse) + t.end() + }) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function setup () { + mkdirp.sync(pkg) + fs.writeFileSync(outfile, contents) +} + +function cleanup () { + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/prepublish.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/prepublish.js new file mode 100644 index 00000000..36391bee --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/prepublish.js @@ -0,0 +1,82 @@ +// verify that prepublish runs on pack and publish +var common = require("../common-tap") +var test = require("tap").test +var fs = require("graceful-fs") +var join = require("path").join +var mkdirp = require("mkdirp") +var rimraf = require("rimraf") + +var pkg = join(__dirname, "prepublish_package") +var tmp = join(pkg, "tmp") +var cache = join(pkg, "cache") + +test("setup", function (t) { + var n = 0 + cleanup() + mkdirp(pkg, then()) + mkdirp(cache, then()) + mkdirp(tmp, then()) + function then () { + n++ + return function (er) { + if (er) throw er + if (--n === 0) next() + } + } + + function next () { + fs.writeFile(join(pkg, "package.json"), JSON.stringify({ + name: "npm-test-prepublish", + version: "1.2.5", + scripts: { prepublish: "echo ok" } + }), "ascii", function (er) { + if (er) throw er + + t.pass("setup done") + t.end() + }) + } +}) + +test("test", function (t) { + var env = { + "npm_config_cache" : cache, + "npm_config_tmp" : tmp, + "npm_config_prefix" : pkg, + "npm_config_global" : "false" + } + for (var i in process.env) { + if (!/^npm_config_/.test(i)) + env[i] = process.env[i] + } + + common.npm([ + "pack", + "--loglevel", "warn" + ], { cwd: pkg, env: env }, function(err, code, stdout, stderr) { + t.equal(code, 0, "pack finished successfully") + t.ifErr(err, "pack finished successfully") + + t.notOk(stderr, "got stderr data:" + JSON.stringify("" + stderr)) + var c = stdout.trim() + var regex = new RegExp("" + + "> npm-test-prepublish@1.2.5 prepublish [^\\r\\n]+\\r?\\n" + + "> echo ok\\r?\\n" + + "\\r?\\n" + + "ok\\r?\\n" + + "npm-test-prepublish-1.2.5.tgz", "ig") + + t.ok(c.match(regex)) + t.end() + }) +}) + +test("cleanup", function (t) { + cleanup() + t.pass("cleaned up") + t.end() +}) + +function cleanup() { + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/prune.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/prune.js new file mode 100644 index 00000000..23c8548d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/prune.js @@ -0,0 +1,131 @@ +var fs = require('fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap') +var server + +var pkg = path.resolve(__dirname, 'prune') +var cache = path.resolve(pkg, 'cache') + +var json = { + name: 'prune', + description: 'fixture', + version: '0.0.1', + main: 'index.js', + dependencies: { + underscore: '1.3.1' + }, + devDependencies: { + mkdirp: '*' + } +} + +var EXEC_OPTS = { + cwd: pkg, + npm_config_depth: 'Infinity' +} + +test('setup', function (t) { + cleanup() + mkdirp.sync(cache) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + mr({ port: common.port }, function (er, s) { + server = s + t.end() + }) +}) + +test('npm install', function (t) { + common.npm([ + 'install', + '--cache', cache, + '--registry', common.registry, + '--loglevel', 'silent', + '--production', 'false' + ], EXEC_OPTS, function (err, code, stdout, stderr) { + t.ifErr(err, 'install finished successfully') + t.notOk(code, 'exit ok') + t.notOk(stderr, 'Should not get data on stderr: ' + stderr) + t.end() + }) +}) + +test('npm install test-package', function (t) { + common.npm([ + 'install', 'test-package', + '--cache', cache, + '--registry', common.registry, + '--loglevel', 'silent', + '--production', 'false' + ], EXEC_OPTS, function (err, code, stdout, stderr) { + t.ifErr(err, 'install finished successfully') + t.notOk(code, 'exit ok') + t.notOk(stderr, 'Should not get data on stderr: ' + stderr) + t.end() + }) +}) + +test('verify installs', function (t) { + var dirs = fs.readdirSync(pkg + '/node_modules').sort() + t.same(dirs, [ 'test-package', 'mkdirp', 'underscore' ].sort()) + t.end() +}) + +test('npm prune', function (t) { + common.npm([ + 'prune', + '--loglevel', 'silent', + '--production', 'false' + ], EXEC_OPTS, function (err, code, stdout, stderr) { + t.ifErr(err, 'prune finished successfully') + t.notOk(code, 'exit ok') + t.notOk(stderr, 'Should not get data on stderr: ' + stderr) + t.end() + }) +}) + +test('verify installs', function (t) { + var dirs = fs.readdirSync(pkg + '/node_modules').sort() + t.same(dirs, [ 'mkdirp', 'underscore' ]) + t.end() +}) + +test('npm prune', function (t) { + common.npm([ + 'prune', + '--loglevel', 'silent', + '--production' + ], EXEC_OPTS, function (err, code, stderr) { + t.ifErr(err, 'prune finished successfully') + t.notOk(code, 'exit ok') + t.equal(stderr, 'unbuild mkdirp@0.3.5\n') + t.end() + }) +}) + +test('verify installs', function (t) { + var dirs = fs.readdirSync(pkg + '/node_modules').sort() + t.same(dirs, [ 'underscore' ]) + t.end() +}) + +test('cleanup', function (t) { + server.close() + cleanup() + t.pass('cleaned up') + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/publish-access-scoped.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/publish-access-scoped.js new file mode 100644 index 00000000..5d2b4e30 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/publish-access-scoped.js @@ -0,0 +1,73 @@ +var fs = require("fs") +var path = require("path") + +var test = require('tap').test +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var mr = require('npm-registry-mock') +var common = require('../common-tap') +var server + +var pkg = path.join(__dirname, "publish-access") + +test('setup', function (t) { + mr({port: common.port, throwOnUnmatched: true}, function (err, s) { + t.ifError(err, 'registry mocked successfully') + t.pass('setup done') + server = s + t.end() + }) +}) + +test('scoped packages pass public access if set', function (t) { + server.filteringRequestBody(function (body) { + t.doesNotThrow(function () { + var parsed = JSON.parse(body) + t.equal(parsed.access, 'public', 'access level is correct') + }, 'converted body back into object') + return true + }).put('/@bigco%2fpublish-access', true).reply(201, {ok: true}) + + mkdirp(path.join(pkg, 'cache'), function () { + fs.writeFile( + path.join(pkg, "package.json"), + JSON.stringify({ + name: '@bigco/publish-access', + version: '1.2.5', + public: true + }), + "ascii", + function (er) { + t.ifError(er, 'package file written') + common.npm( + [ + 'publish', + '--access', 'public', + '--cache', path.join(pkg, 'cache'), + '--loglevel', 'silly', + '--registry', common.registry + ], + { + cwd: pkg + }, + function (er) { + t.ifError(er, 'published without error') + + server.done() + t.end() + } + ) + } + ) + }) +}) + +test("cleanup", function (t) { + process.chdir(__dirname) + server.close() + rimraf(pkg, function (er) { + t.ifError(er) + + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/publish-access-unscoped-restricted-fails.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/publish-access-unscoped-restricted-fails.js new file mode 100644 index 00000000..4d39b00b --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/publish-access-unscoped-restricted-fails.js @@ -0,0 +1,70 @@ +var fs = require("fs") +var path = require("path") + +var test = require("tap").test +var mkdirp = require("mkdirp") +var rimraf = require("rimraf") + +var npm = require("../../") +var common = require("../common-tap.js") + +var pkg = path.join(__dirname, "publish-access-unscoped") + +// TODO: nock uses setImmediate, breaks 0.8: replace with mockRegistry +if (!global.setImmediate) { + global.setImmediate = function () { + var args = [arguments[0], 0].concat([].slice.call(arguments, 1)) + setTimeout.apply(this, args) + } +} + +test("setup", function (t) { + mkdirp(path.join(pkg, "cache"), function () { + var configuration = { + cache : path.join(pkg, "cache"), + loglevel : "silent", + registry : common.registry + } + + npm.load(configuration, next) + }) + + function next (er) { + t.ifError(er, "npm loaded successfully") + + process.chdir(pkg) + fs.writeFile( + path.join(pkg, "package.json"), + JSON.stringify({ + name: "publish-access", + version: "1.2.5" + }), + "ascii", + function (er) { + t.ifError(er) + + t.pass("setup done") + t.end() + } + ) + } +}) + +test("unscoped packages cannot be restricted", function (t) { + npm.config.set("access", "restricted") + npm.commands.publish([], false, function (er) { + t.ok(er, "got an error back") + t.equal(er.message, "Can't restrict access to unscoped packages.") + + t.end() + }) +}) + +test("cleanup", function (t) { + process.chdir(__dirname) + rimraf(pkg, function (er) { + t.ifError(er) + + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/publish-access-unscoped.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/publish-access-unscoped.js new file mode 100644 index 00000000..4d193cff --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/publish-access-unscoped.js @@ -0,0 +1,73 @@ +var fs = require("fs") +var path = require("path") + +var test = require('tap').test +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var mr = require('npm-registry-mock') +var common = require('../common-tap') +var server + +var pkg = path.join(__dirname, "publish-access-unscoped") + +test('setup', function (t) { + mr({port: common.port, throwOnUnmatched: true}, function (err, s) { + t.ifError(err, 'registry mocked successfully') + t.pass('setup done') + server = s + t.end() + }) +}) + +test('unscoped packages can be explicitly set as public', function (t) { + server.filteringRequestBody(function (body) { + t.doesNotThrow(function () { + var parsed = JSON.parse(body) + t.equal(parsed.access, 'public', 'access level is correct') + }, 'converted body back into object') + return true + }).put('/publish-access', true).reply(201, {ok: true}) + + mkdirp(path.join(pkg, 'cache'), function () { + fs.writeFile( + path.join(pkg, "package.json"), + JSON.stringify({ + name: 'publish-access', + version: '1.2.5', + public: true + }), + "ascii", + function (er) { + t.ifError(er, 'package file written') + common.npm( + [ + 'publish', + '--access', 'public', + '--cache', path.join(pkg, 'cache'), + '--loglevel', 'silly', + '--registry', common.registry + ], + { + cwd: pkg + }, + function (er) { + t.ifError(er, 'published without error') + + server.done() + t.end() + } + ) + } + ) + }) +}) + +test("cleanup", function (t) { + process.chdir(__dirname) + server.close() + rimraf(pkg, function (er) { + t.ifError(er) + + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/publish-config.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/publish-config.js new file mode 100644 index 00000000..1d063535 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/publish-config.js @@ -0,0 +1,59 @@ +var common = require("../common-tap.js") +var test = require("tap").test +var fs = require("fs") +var osenv = require("osenv") +var pkg = process.env.npm_config_tmp || "/tmp" +pkg += "/npm-test-publish-config" + +require("mkdirp").sync(pkg) + +fs.writeFileSync(pkg + "/package.json", JSON.stringify({ + name: "npm-test-publish-config", + version: "1.2.3", + publishConfig: { registry: common.registry } +}), "utf8") + +fs.writeFileSync(pkg + "/fixture_npmrc", + "//localhost:1337/:email = fancy@feast.net\n" + + "//localhost:1337/:username = fancy\n" + + "//localhost:1337/:_password = " + new Buffer("feast").toString("base64") + "\n" + + "registry = http://localhost:1337/") + +test(function (t) { + var child + t.plan(4) + require("http").createServer(function (req, res) { + t.pass("got request on the fakey fake registry") + this.close() + res.statusCode = 500 + res.end(JSON.stringify({ + error: "sshhh. naptime nao. \\^O^/ <(YAWWWWN!)" + })) + child.kill('SIGHUP') + }).listen(common.port, function () { + t.pass("server is listening") + + // don't much care about listening to the child's results + // just wanna make sure it hits the server we just set up. + // + // there are plenty of other tests to verify that publish + // itself functions normally. + // + // Make sure that we don't sit around waiting for lock files + child = common.npm(["publish", "--userconfig=" + pkg + "/fixture_npmrc"], { + cwd: pkg, + stdio: "inherit", + env: { + "npm_config_cache_lock_stale": 1000, + "npm_config_cache_lock_wait": 1000, + HOME: process.env.HOME, + Path: process.env.PATH, + PATH: process.env.PATH, + USERPROFILE: osenv.home() + } + }, function (err, code) { + t.ifError(err, "publish command finished successfully") + t.notOk(code, "npm install exited with code 0") + }) + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/publish-invalid-semver-tag.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/publish-invalid-semver-tag.js new file mode 100644 index 00000000..1a741d34 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/publish-invalid-semver-tag.js @@ -0,0 +1,79 @@ +var common = require('../common-tap.js') +var test = require('tap').test +var npm = require('../../lib/npm.js') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var path = require('path') +var fs = require('fs') +var mr = require('npm-registry-mock') + +var osenv = require('osenv') + +var PKG_DIR = path.resolve(__dirname, 'publish-invalid-semver-tag') +var CACHE_DIR = path.resolve(PKG_DIR, 'cache') + +var DEFAULT_PKG = { + 'name': 'examples', + 'version': '1.2.3' +} + +var mockServer + +function resetPackage (options) { + rimraf.sync(CACHE_DIR) + mkdirp.sync(CACHE_DIR) + + fs.writeFileSync(path.resolve(PKG_DIR, 'package.json'), DEFAULT_PKG) +} + +test('setup', function (t) { + process.chdir(osenv.tmpdir()) + mkdirp.sync(PKG_DIR) + process.chdir(PKG_DIR) + + resetPackage({}) + + mr({ port: common.port }, function (er, server) { + npm.load({ + cache: CACHE_DIR, + registry: common.registry, + cwd: PKG_DIR + }, function (err) { + t.ifError(err, 'started server') + mockServer = server + + t.end() + }) + }) +}) + +test('attempt publish with semver-like version', function (t) { + resetPackage({}) + + npm.config.set('tag', 'v1.x') + npm.commands.publish([], function (err) { + t.notEqual(err, null) + t.same(err.message, 'Tag name must not be a valid SemVer range: v1.x') + t.end() + }) +}) + +test('attempt publish with semver-like version', function (t) { + resetPackage({}) + + npm.config.set('tag', '1.2.3') + npm.commands.publish([], function (err) { + t.notEqual(err, null) + t.same(err.message, 'Tag name must not be a valid SemVer range: 1.2.3') + t.end() + }) +}) + +test('cleanup', function (t) { + mockServer.close() + + process.chdir(osenv.tmpdir()) + rimraf.sync(PKG_DIR) + + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/publish-scoped.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/publish-scoped.js new file mode 100644 index 00000000..cf0daed4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/publish-scoped.js @@ -0,0 +1,91 @@ +var fs = require("fs") +var path = require("path") + +var test = require('tap').test +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var common = require('../common-tap') +var mr = require('npm-registry-mock') + +var pkg = path.join(__dirname, "prepublish_package") + +var server + +function setup () { + cleanup() + mkdirp.sync(path.join(pkg, 'cache')) + + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify({ + name: '@bigco/publish-organized', + version: '1.2.5' + }, null, 2), + 'ascii') +} + +test('setup', function (t) { + setup() + mr({port: common.port, throwOnUnmatched: true}, function (err, s) { + t.ifError(err, 'registry mocked successfully') + server = s + t.end() + }) +}) + +test('npm publish should honor scoping', function (t) { + server.filteringRequestBody(verify) + .put('/@bigco%2fpublish-organized', true) + .reply(201, {ok: true}) + + var configuration = [ + 'progress=false', + 'cache=' + path.join(pkg, 'cache'), + 'registry=http://nonexistent.lvh.me', + '//localhost:1337/:username=username', + '//localhost:1337/:_password=' + new Buffer('password').toString('base64'), + '//localhost:1337/:email=' + 'ogd@aoaioxxysz.net', + '@bigco:registry=' + common.registry + ] + var configFile = path.join(pkg, '.npmrc') + + fs.writeFileSync(configFile, configuration.join('\n') + '\n') + + common.npm(['publish'], {'cwd': pkg}, function (err, code, stdout, stderr) { + if (err) throw err + t.is(code, 0, 'published without error') + server.done() + t.end() + }) + + function verify (body) { + t.doesNotThrow(function () { + var parsed = JSON.parse(body) + var current = parsed.versions["1.2.5"] + t.equal( + current._npmVersion, + require(path.resolve(__dirname, "../../package.json")).version, + "npm version is correct" + ) + + t.equal( + current._nodeVersion, + process.versions.node, + "node version is correct" + ) + }, "converted body back into object") + + return true + } +}) + +test('cleanup', function (t) { + server.close() + t.end() + cleanup() +}) + +function cleanup () { + process.chdir(__dirname) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/pwd-prefix.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/pwd-prefix.js new file mode 100644 index 00000000..237096e0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/pwd-prefix.js @@ -0,0 +1,35 @@ +// This test ensures that a few commands do the same +// thing when the cwd is where package.json is, and when +// the package.json is one level up. + +var test = require("tap").test +var common = require("../common-tap.js") +var path = require("path") +var root = path.resolve(__dirname, "../..") +var lib = path.resolve(root, "lib") +var commands = ["run", "version"] + +commands.forEach(function (cmd) { + // Should get the same stdout and stderr each time + var stdout, stderr + + test(cmd + " in root", function (t) { + common.npm([cmd], {cwd: root}, function (er, code, so, se) { + if (er) throw er + t.notOk(code, "npm " + cmd + " exited with code 0") + stdout = so + stderr = se + t.end() + }) + }) + + test(cmd + " in lib", function (t) { + common.npm([cmd], {cwd: lib}, function (er, code, so, se) { + if (er) throw er + t.notOk(code, "npm " + cmd + " exited with code 0") + t.equal(so, stdout) + t.equal(se, stderr) + t.end() + }) + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/referer.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/referer.js new file mode 100644 index 00000000..c1b173d9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/referer.js @@ -0,0 +1,23 @@ +var common = require("../common-tap.js") +var test = require("tap").test +var http = require("http") + +test("should send referer http header", function (t) { + http.createServer(function (q, s) { + t.equal(q.headers.referer, "install foo") + s.statusCode = 404 + s.end(JSON.stringify({error: "whatever"})) + this.close() + }).listen(common.port, function () { + var reg = "http://localhost:" + common.port + var args = [ "install", "foo", "--registry", reg ] + common.npm(args, {}, function (er, code) { + if (er) { + throw er + } + // should not have ended nicely, since we returned an error + t.ok(code) + t.end() + }) + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/registry.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/registry.js new file mode 100644 index 00000000..fef099f0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/registry.js @@ -0,0 +1,86 @@ +// Run all the tests in the `npm-registry-couchapp` suite +// This verifies that the server-side stuff still works. + +var common = require("../common-tap") +var test = require("tap").test + +var npmExec = require.resolve("../../bin/npm-cli.js") +var path = require("path") +var ca = path.resolve(__dirname, "../../node_modules/npm-registry-couchapp") + +var which = require("which") + +var v = process.versions.node.split(".").map(function (n) { return parseInt(n, 10) }) +if (v[0] === 0 && v[1] < 10) { + console.error( + "WARNING: need a recent Node for npm-registry-couchapp tests to run, have", + process.versions.node + ) +} +else { + which("couchdb", function (er) { + if (er) { + console.error("WARNING: need couch to run test: " + er.message) + } + else { + runTests() + } + }) +} + + +function runTests () { + var env = { TAP: 1 } + for (var i in process.env) env[i] = process.env[i] + env.npm = npmExec + + var opts = { + cwd: ca, + stdio: "inherit" + } + common.npm(["install"], opts, function (err, code, stdout, stderr) { + if (err) { throw err } + if (code) { + return test("need install to work", function (t) { + t.fail( + "install failed with: " + code + + '\nstdout: ' + stdout + + '\nstderr: ' + stderr) + t.end() + }) + + } else { + opts = { + cwd: ca, + env: env, + stdio: "inherit" + } + common.npm( + [ + "test", "--", "-Rtap" + ], + opts, + function (err, code, stdout, stderr) { + if (err) { throw err } + if (code) { + return test("need test to work", function (t) { + t.fail( + "test failed with: " + code + + '\nstdout: ' + stdout + + '\nstderr: ' + stderr) + t.end() + }) + } + opts = { + cwd: ca, + env: env, + stdio: "inherit" + } + common.npm(["prune", "--production"], opts, function (err, code) { + if (err) { throw err } + process.exit(code || 0) + }) + }) + } + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/repo.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/repo.js new file mode 100644 index 00000000..565842b9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/repo.js @@ -0,0 +1,139 @@ +if (process.platform === "win32") { + console.error("skipping test, because windows and shebangs") + return +} + +var common = require("../common-tap.js") +var mr = require("npm-registry-mock") + +var test = require("tap").test +var npm = require.resolve("../../bin/npm-cli.js") +var node = process.execPath +var rimraf = require("rimraf") +var spawn = require("child_process").spawn +var fs = require("fs") +var path = require('path') +var outFile = path.join(__dirname, '/_output') + +var opts = { cwd: __dirname } + +test("setup", function (t) { + var s = "#!/usr/bin/env bash\n" + + "echo \"$@\" > " + JSON.stringify(__dirname) + "/_output\n" + fs.writeFileSync(__dirname + "/_script.sh", s, "ascii") + fs.chmodSync(__dirname + "/_script.sh", "0755") + t.pass("made script") + t.end() +}) + +test("npm repo underscore", function (t) { + mr({port : common.port}, function (er, s) { + common.npm([ + 'repo', 'underscore', + '--registry=' + common.registry, + '--loglevel=silent', + '--browser=' + __dirname + '/_script.sh' + ], opts, function (err, code, stdout, stderr) { + t.equal(code, 0, 'exit ok') + var res = fs.readFileSync(outFile, 'ascii') + s.close() + t.equal(res, "https://github.com/jashkenas/underscore\n") + rimraf.sync(outFile) + t.end() + }) + }) +}) + + +test('npm repo optimist - github (https://)', function (t) { + mr({port : common.port}, function (er, s) { + common.npm([ + 'repo', 'optimist', + '--registry=' + common.registry, + '--loglevel=silent', + '--browser=' + __dirname + '/_script.sh' + ], opts, function (err, code, stdout, stderr) { + t.equal(code, 0, 'exit ok') + var res = fs.readFileSync(outFile, 'ascii') + s.close() + t.equal(res, "https://github.com/substack/node-optimist\n") + rimraf.sync(outFile) + t.end() + }) + }) +}) + +test("npm repo npm-test-peer-deps - no repo", function (t) { + mr({port : common.port}, function (er, s) { + common.npm([ + 'repo', 'npm-test-peer-deps', + '--registry=' + common.registry, + '--loglevel=silent', + '--browser=' + __dirname + '/_script.sh' + ], opts, function (err, code, stdout, stderr) { + t.equal(code, 1, 'exit not ok') + s.close() + t.end() + }) + }) +}) + +test("npm repo test-repo-url-http - non-github (http://)", function (t) { + mr({port : common.port}, function (er, s) { + common.npm([ + 'repo', 'test-repo-url-http', + '--registry=' + common.registry, + '--loglevel=silent', + '--browser=' + __dirname + '/_script.sh' + ], opts, function (err, code, stdout, stderr) { + t.equal(code, 0, 'exit ok') + var res = fs.readFileSync(outFile, 'ascii') + s.close() + t.equal(res, "http://gitlab.com/evanlucas/test-repo-url-http\n") + rimraf.sync(outFile) + t.end() + }) + }) +}) + +test("npm repo test-repo-url-https - non-github (https://)", function (t) { + mr({port : common.port}, function (er, s) { + common.npm([ + 'repo', 'test-repo-url-https', + '--registry=' + common.registry, + '--loglevel=silent', + '--browser=' + __dirname + '/_script.sh' + ], opts, function (err, code, stdout, stderr) { + t.equal(code, 0, 'exit ok') + var res = fs.readFileSync(outFile, 'ascii') + s.close() + t.equal(res, "https://gitlab.com/evanlucas/test-repo-url-https\n") + rimraf.sync(outFile) + t.end() + }) + }) +}) + +test("npm repo test-repo-url-ssh - non-github (ssh://)", function (t) { + mr({port : common.port}, function (er, s) { + common.npm([ + 'repo', 'test-repo-url-ssh', + '--registry=' + common.registry, + '--loglevel=silent', + '--browser=' + __dirname + '/_script.sh' + ], opts, function (err, code, stdout, stderr) { + t.equal(code, 0, 'exit ok') + var res = fs.readFileSync(outFile, 'ascii') + s.close() + t.equal(res, "http://gitlab.com/evanlucas/test-repo-url-ssh\n") + rimraf.sync(outFile) + t.end() + }) + }) +}) + +test("cleanup", function (t) { + fs.unlinkSync(__dirname + "/_script.sh") + t.pass("cleaned up") + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/run-script-filter-private.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/run-script-filter-private.js new file mode 100644 index 00000000..631759c1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/run-script-filter-private.js @@ -0,0 +1,52 @@ +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap') + +var pkg = path.resolve(__dirname, 'run-script-filter-private') + +var opts = { cwd: pkg } + +var json = { + name: 'run-script-filter-private', + version: '1.2.3' +} + +var npmrc = '//blah.com:_harsh=realms\n' + +test('setup', function (t) { + cleanup() + mkdirp.sync(pkg) + fs.writeFileSync( + path.resolve(pkg, 'package.json'), + JSON.stringify(json, null, 2) + '\n' + ) + fs.writeFileSync( + path.resolve(pkg, '.npmrc'), + npmrc + ) + t.end() +}) + +test('npm run-script env', function (t) { + common.npm(['run-script', 'env'], opts, function (er, code, stdout, stderr) { + t.ifError(er, 'using default env script') + t.notOk(stderr, 'should not generate errors') + t.ok(stdout.indexOf('npm_config_init_version') > 0, 'expected values in var list') + t.notMatch(stdout, /harsh/, 'unexpected config not there') + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/run-script.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/run-script.js new file mode 100644 index 00000000..f95f7028 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/run-script.js @@ -0,0 +1,330 @@ +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var test = require('tap').test +var rimraf = require('rimraf') + +var common = require('../common-tap') + +var pkg = path.resolve(__dirname, 'run-script') +var cache = path.resolve(pkg, 'cache') +var tmp = path.resolve(pkg, 'tmp') + +var opts = { cwd: pkg } + +var fullyPopulated = { + 'name': 'runscript', + 'version': '1.2.3', + 'scripts': { + 'start': 'node -e "console.log(process.argv[1] || \'start\')"', + 'prewith-pre': 'node -e "console.log(process.argv[1] || \'pre\')"', + 'with-pre': 'node -e "console.log(process.argv[1] || \'main\')"', + 'with-post': 'node -e "console.log(process.argv[1] || \'main\')"', + 'postwith-post': 'node -e "console.log(process.argv[1] || \'post\')"', + 'prewith-both': 'node -e "console.log(process.argv[1] || \'pre\')"', + 'with-both': 'node -e "console.log(process.argv[1] || \'main\')"', + 'postwith-both': 'node -e "console.log(process.argv[1] || \'post\')"', + 'stop': 'node -e "console.log(process.argv[1] || \'stop\')"', + 'env-vars': 'node -e "console.log(process.env.run_script_foo_var)"', + 'npm-env-vars': 'node -e "console.log(process.env.npm_run_script_foo_var)"', + 'package-env-vars': 'node -e "console.log(process.env.run_script_foo_var)"', + 'prefixed-package-env-vars': 'node -e "console.log(process.env.npm_package_run_script_foo_var)"' + }, + 'run_script_foo_var': 'run_script_test_foo_val' +} + +var lifecycleOnly = { + name: 'scripted', + version: '1.2.3', + scripts: { + 'prestart': 'echo prestart' + } +} + +var directOnly = { + name: 'scripted', + version: '1.2.3', + scripts: { + 'whoa': 'echo whoa' + } +} + +var both = { + name: 'scripted', + version: '1.2.3', + scripts: { + 'prestart': 'echo prestart', + 'whoa': 'echo whoa' + } +} + +var preversionOnly = { + name: 'scripted', + version: '1.2.3', + scripts: { + 'preversion': 'echo preversion' + } +} + + +function testOutput (t, command, er, code, stdout, stderr) { + var lines + + if (er) + throw er + + if (stderr) + throw new Error('npm ' + command + ' stderr: ' + stderr.toString()) + + lines = stdout.trim().split('\n') + stdout = lines.filter(function (line) { + return line.trim() !== '' && line[0] !== '>' + }).join(';') + + t.equal(stdout, command) + t.end() +} + +function writeMetadata (object) { + fs.writeFileSync( + path.resolve(pkg, 'package.json'), + JSON.stringify(object, null, 2) + '\n' + ) +} + +function cleanup () { + rimraf.sync(pkg) +} + +test('setup', function (t) { + cleanup() + mkdirp.sync(cache) + mkdirp.sync(tmp) + writeMetadata(fullyPopulated) + t.end() +}) + +test('npm run-script start', function (t) { + common.npm(['run-script', 'start'], opts, testOutput.bind(null, t, 'start')) +}) + +test('npm run-script with args', function (t) { + common.npm(['run-script', 'start', '--', 'stop'], opts, testOutput.bind(null, t, 'stop')) +}) + +test('npm run-script with args that contain spaces', function (t) { + common.npm(['run-script', 'start', '--', 'hello world'], opts, testOutput.bind(null, t, 'hello world')) +}) + +test('npm run-script with args that contain single quotes', function (t) { + common.npm(['run-script', 'start', '--', 'they"re awesome'], opts, testOutput.bind(null, t, 'they"re awesome')) +}) + +test('npm run-script with args that contain double quotes', function (t) { + common.npm(['run-script', 'start', '--', 'what"s "up"?'], opts, testOutput.bind(null, t, 'what"s "up"?')) +}) + +test('npm run-script with args that contain ticks', function (t) { + common.npm(['run-script', 'start', '--', 'what\'s \'up\'?'], opts, testOutput.bind(null, t, 'what\'s \'up\'?')) +}) + +test('npm run-script with pre script', function (t) { + common.npm(['run-script', 'with-post'], opts, testOutput.bind(null, t, 'main;post')) +}) + +test('npm run-script with post script', function (t) { + common.npm(['run-script', 'with-pre'], opts, testOutput.bind(null, t, 'pre;main')) +}) + +test('npm run-script with both pre and post script', function (t) { + common.npm(['run-script', 'with-both'], opts, testOutput.bind(null, t, 'pre;main;post')) +}) + +test('npm run-script with both pre and post script and with args', function (t) { + common.npm(['run-script', 'with-both', '--', 'an arg'], opts, testOutput.bind(null, t, 'pre;an arg;post')) +}) + +test('npm run-script explicitly call pre script with arg', function (t) { + common.npm(['run-script', 'prewith-pre', '--', 'an arg'], opts, testOutput.bind(null, t, 'an arg')) +}) + +test('npm run-script test', function (t) { + common.npm(['run-script', 'test'], opts, function (er, code, stdout, stderr) { + t.ifError(er, 'npm run-script test ran without issue') + t.notOk(stderr, 'should not generate errors') + t.end() + }) +}) + +test('npm run-script env', function (t) { + common.npm(['run-script', 'env'], opts, function (er, code, stdout, stderr) { + t.ifError(er, 'using default env script') + t.notOk(stderr, 'should not generate errors') + t.ok(stdout.indexOf('npm_config_init_version') > 0, 'expected values in var list') + t.end() + }) +}) + +test('npm run-script nonexistent-script', function (t) { + common.npm(['run-script', 'nonexistent-script'], opts, function (er, code, stdout, stderr) { + t.ifError(er, 'npm run-script nonexistent-script did not cause npm to explode') + t.ok(stderr, 'should generate errors') + t.end() + }) +}) + +test('npm run-script restart when there isn\'t restart', function (t) { + common.npm(['run-script', 'restart'], opts, testOutput.bind(null, t, 'stop;start')) +}) + +test('npm run-script nonexistent-script with --if-present flag', function (t) { + common.npm(['run-script', '--if-present', 'nonexistent-script'], opts, function (er, code, stdout, stderr) { + t.ifError(er, 'npm run-script --if-present non-existent-script ran without issue') + t.notOk(stderr, 'should not generate errors') + t.end() + }) +}) + +test('npm run-script env vars accessible', function (t) { + process.env.run_script_foo_var = 'run_script_test_foo_val' + common.npm(['run-script', 'env-vars'], { + cwd: pkg + }, function (err, code, stdout, stderr) { + t.ifError(err, 'ran run-script without crashing') + t.equal(code, 0, 'exited normally') + t.equal(stderr, '', 'no error output') + t.match(stdout, + new RegExp(process.env.run_script_foo_var), + 'script had env access') + t.end() + }) +}) + +test('npm run-script package.json vars injected', function (t) { + common.npm(['run-script', 'package-env-vars'], { + cwd: pkg + }, function (err, code, stdout, stderr) { + t.ifError(err, 'ran run-script without crashing') + t.equal(code, 0, 'exited normally') + t.equal(stderr, '', 'no error output') + t.match(stdout, + new RegExp(fullyPopulated.run_script_foo_var), + 'script injected package.json value') + t.end() + }) +}) + +test('npm run-script package.json vars injected with prefix', function (t) { + common.npm(['run-script', 'prefixed-package-env-vars'], { + cwd: pkg + }, function (err, code, stdout, stderr) { + t.ifError(err, 'ran run-script without crashing') + t.equal(code, 0, 'exited normally') + t.equal(stderr, '', 'no error output') + t.match(stdout, + new RegExp(fullyPopulated.run_script_foo_var), + 'script injected npm_package-prefixed package.json value') + t.end() + }) +}) + +test('npm run-script env vars stripped npm-prefixed', function (t) { + process.env.npm_run_script_foo_var = 'run_script_test_foo_val' + common.npm(['run-script', 'npm-env-vars'], { + cwd: pkg + }, function (err, code, stdout, stderr) { + t.ifError(err, 'ran run-script without crashing') + t.equal(code, 0, 'exited normally') + t.equal(stderr, '', 'no error output') + t.notMatch(stdout, + new RegExp(process.env.npm_run_script_foo_var), + 'script stripped npm-prefixed env var') + t.end() + }) +}) + +test('npm run-script no-params (lifecycle only)', function (t) { + var expected = [ + 'Lifecycle scripts included in scripted:', + ' prestart', + ' echo prestart', + '' + ].join('\n') + + writeMetadata(lifecycleOnly) + + common.npm(['run-script'], opts, function (err, code, stdout, stderr) { + t.ifError(err, 'ran run-script without parameters without crashing') + t.notOk(code, 'npm exited without error code') + t.notOk(stderr, 'npm printed nothing to stderr') + t.equal(stdout, expected, 'got expected output') + t.end() + }) +}) + +test('npm run-script no-params (preversion only)', function (t) { + var expected = [ + 'Lifecycle scripts included in scripted:', + ' preversion', + ' echo preversion', + '' + ].join('\n') + + writeMetadata(preversionOnly) + + common.npm(['run-script'], opts, function (err, code, stdout, stderr) { + t.ifError(err, 'ran run-script without parameters without crashing') + t.notOk(code, 'npm exited without error code') + t.notOk(stderr, 'npm printed nothing to stderr') + t.equal(stdout, expected, 'got expected output') + t.end() + }) +}) + +test('npm run-script no-params (direct only)', function (t) { + var expected = [ + 'Scripts available in scripted via `npm run-script`:', + ' whoa', + ' echo whoa', + '' + ].join('\n') + + writeMetadata(directOnly) + + common.npm(['run-script'], opts, function (err, code, stdout, stderr) { + t.ifError(err, 'ran run-script without parameters without crashing') + t.notOk(code, 'npm exited without error code') + t.notOk(stderr, 'npm printed nothing to stderr') + t.equal(stdout, expected, 'got expected output') + t.end() + }) +}) + +test('npm run-script no-params (direct only)', function (t) { + var expected = [ + 'Lifecycle scripts included in scripted:', + ' prestart', + ' echo prestart', + '', + 'available via `npm run-script`:', + ' whoa', + ' echo whoa', + '' + ].join('\n') + + writeMetadata(both) + + common.npm(['run-script'], opts, function (err, code, stdout, stderr) { + t.ifError(err, 'ran run-script without parameters without crashing') + t.notOk(code, 'npm exited without error code') + t.notOk(stderr, 'npm printed nothing to stderr') + t.equal(stdout, expected, 'got expected output') + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/scripts-whitespace-windows.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/scripts-whitespace-windows.js new file mode 100644 index 00000000..f23f0625 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/scripts-whitespace-windows.js @@ -0,0 +1,102 @@ +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap') + +var pkg = path.resolve(__dirname, 'scripts-whitespace-windows') +var tmp = path.resolve(pkg, 'tmp') +var cache = path.resolve(pkg, 'cache') +var dep = path.resolve(pkg, 'dep') + +var EXEC_OPTS = { cwd: pkg } + +var json = { + name: 'scripts-whitespace-windows', + version: '1.0.0', + description: 'a test', + repository: 'git://github.com/robertkowalski/bogus', + scripts: { + foo: 'foo --title \"Analysis of\" --recurse -d report src' + }, + dependencies: { + 'scripts-whitespace-windows-dep': '0.0.1' + }, + license: 'WTFPL' +} + +var dependency = { + name: 'scripts-whitespace-windows-dep', + version: '0.0.1', + bin: [ 'bin/foo' ] +} + +var foo = function () {/* +#!/usr/bin/env node + +if (process.argv.length === 8) + console.log('npm-test-fine') +*/}.toString().split('\n').slice(1, -1).join('\n') + +test('setup', function (t) { + cleanup() + mkdirp.sync(tmp) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + fs.writeFileSync( + path.join(pkg, 'README.md'), + "### THAT'S RIGHT\n" + ) + + mkdirp.sync(path.join(dep, 'bin')) + fs.writeFileSync( + path.join(dep, 'package.json'), + JSON.stringify(dependency, null, 2) + ) + fs.writeFileSync(path.join(dep, 'bin', 'foo'), foo) + + common.npm(['i', dep], { + cwd: pkg, + env: { + npm_config_cache: cache, + npm_config_tmp: tmp, + npm_config_prefix: pkg, + npm_config_global: 'false' + } + }, function (err, code, stdout, stderr) { + t.ifErr(err, 'npm i ' + dep + ' finished without error') + t.equal(code, 0, 'npm i ' + dep + ' exited ok') + t.notOk(stderr, 'no output stderr') + t.end() + }) +}) + +test('test', function (t) { + common.npm(['run', 'foo'], EXEC_OPTS, function (err, code, stdout, stderr) { + stderr = stderr.trim() + if (stderr) console.error(stderr) + t.ifErr(err, 'npm run finished without error') + t.equal(code, 0, 'npm run exited ok') + t.notOk(stderr, 'no output stderr: ' + stderr) + stdout = stdout.trim() + t.ok(/npm-test-fine/.test(stdout)) + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} + diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/search.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/search.js new file mode 100644 index 00000000..0412e175 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/search.js @@ -0,0 +1,276 @@ +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var pkg = path.resolve(__dirname, 'search') +var cache = path.resolve(pkg, 'cache') +var registryCache = path.resolve(cache, 'localhost_1337', '-', 'all') +var cacheJsonFile = path.resolve(registryCache, '.cache.json') + +var timeMock = { + epoch: 1411727900, + future: 1411727900 + 100, + all: 1411727900 + 25, + since: 0 // filled by since server callback +} + +var EXEC_OPTS = {} + +var mocks = { + /* Since request, always response with an _update time > the time requested */ + sinceFuture: function (server) { + server.filteringPathRegEx(/startkey=[^&]*/g, function (s) { + var _allMock = JSON.parse(JSON.stringify(allMock)) + timeMock.since = _allMock._updated = s.replace('startkey=', '') + server.get('/-/all/since?stale=update_after&' + s) + .reply(200, _allMock) + return s + }) + }, + allFutureUpdatedOnly: function (server) { + server.get('/-/all') + .reply(200, stringifyUpdated(timeMock.future)) + }, + all: function (server) { + server.get('/-/all') + .reply(200, allMock) + } +} + +test('No previous cache, init cache triggered by first search', function (t) { + cleanup() + + mr({ port: common.port, plugin: mocks.allFutureUpdatedOnly }, function (err, s) { + t.ifError(err, 'mock registry started') + common.npm([ + 'search', 'do not do extra search work on my behalf', + '--registry', common.registry, + '--cache', cache, + '--loglevel', 'silent', + '--color', 'always' + ], + EXEC_OPTS, + function (err, code) { + s.close() + t.equal(code, 0, 'search finished successfully') + t.ifErr(err, 'search finished successfully') + + t.ok( + fs.existsSync(cacheJsonFile), + cacheJsonFile + ' expected to have been created' + ) + + var cacheData = JSON.parse(fs.readFileSync(cacheJsonFile, 'utf8')) + t.equal(cacheData._updated, String(timeMock.future)) + t.end() + }) + }) +}) + +test('previous cache, _updated set, should trigger since request', function (t) { + setupCache() + + function m (server) { + [ mocks.all, mocks.sinceFuture ].forEach(function (m) { + m(server) + }) + } + mr({ port: common.port, plugin: m }, function (err, s) { + t.ifError(err, 'mock registry started') + common.npm([ + 'search', 'do not do extra search work on my behalf', + '--registry', common.registry, + '--cache', cache, + '--loglevel', 'silly', + '--color', 'always' + ], + EXEC_OPTS, + function (err, code) { + s.close() + t.equal(code, 0, 'search finished successfully') + t.ifErr(err, 'search finished successfully') + + var cacheData = JSON.parse(fs.readFileSync(cacheJsonFile, 'utf8')) + t.equal( + cacheData._updated, + timeMock.since, + 'cache update time gotten from since response' + ) + t.end() + }) + }) +}) + +var searches = [ + { + term: 'f36b6a6123da50959741e2ce4d634f96ec668c56', + description: 'non-regex', + location: 241 + }, + { + term: '/f36b6a6123da50959741e2ce4d634f96ec668c56/', + description: 'regex', + location: 241 + } +] + +searches.forEach(function (search) { + test(search.description + ' search in color', function (t) { + cleanup() + mr({ port: common.port, plugin: mocks.all }, function (er, s) { + common.npm([ + 'search', search.term, + '--registry', common.registry, + '--cache', cache, + '--loglevel', 'silent', + '--color', 'always' + ], + EXEC_OPTS, + function (err, code, stdout) { + s.close() + t.equal(code, 0, 'search finished successfully') + t.ifErr(err, 'search finished successfully') + // \033 == \u001B + var markStart = '\u001B\\[[0-9][0-9]m' + var markEnd = '\u001B\\[0m' + + var re = new RegExp(markStart + '.*?' + markEnd) + + var cnt = stdout.search(re) + t.equal( + cnt, + search.location, + search.description + ' search for ' + search.term + ) + t.end() + }) + }) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} + +function setupCache () { + cleanup() + mkdirp.sync(cache) + mkdirp.sync(registryCache) + var res = fs.writeFileSync(cacheJsonFile, stringifyUpdated(timeMock.epoch)) + if (res) throw new Error('Creating cache file failed') +} + +function stringifyUpdated (time) { + return JSON.stringify({ _updated: String(time) }) +} + +var allMock = { + '_updated': timeMock.all, + 'generator-frontcow': { + 'name': 'generator-frontcow', + 'description': 'f36b6a6123da50959741e2ce4d634f96ec668c56 This is a fake description to ensure we do not accidentally search the real npm registry or use some kind of cache', + 'dist-tags': { + 'latest': '0.1.19' + }, + 'maintainers': [ + { + 'name': 'bcabanes', + 'email': 'contact@benjamincabanes.com' + } + ], + 'homepage': 'https://github.com/bcabanes/generator-frontcow', + 'keywords': [ + 'sass', + 'frontend', + 'yeoman-generator', + 'atomic', + 'design', + 'sass', + 'foundation', + 'foundation5', + 'atomic design', + 'bourbon', + 'polyfill', + 'font awesome' + ], + 'repository': { + 'type': 'git', + 'url': 'https://github.com/bcabanes/generator-frontcow' + }, + 'author': { + 'name': 'ben', + 'email': 'contact@benjamincabanes.com', + 'url': 'https://github.com/bcabanes' + }, + 'bugs': { + 'url': 'https://github.com/bcabanes/generator-frontcow/issues' + }, + 'license': 'MIT', + 'readmeFilename': 'README.md', + 'time': { + 'modified': '2014-10-03T02:26:18.406Z' + }, + 'versions': { + '0.1.19': 'latest' + } + }, + 'marko': { + 'name': 'marko', + 'description': 'Marko is an extensible, streaming, asynchronous, high performance, HTML-based templating language that can be used in Node.js or in the browser.', + 'dist-tags': { + 'latest': '1.2.16' + }, + 'maintainers': [ + { + 'name': 'pnidem', + 'email': 'pnidem@gmail.com' + }, + { + 'name': 'philidem', + 'email': 'phillip.idem@gmail.com' + } + ], + 'homepage': 'https://github.com/raptorjs/marko', + 'keywords': [ + 'templating', + 'template', + 'async', + 'streaming' + ], + 'repository': { + 'type': 'git', + 'url': 'https://github.com/raptorjs/marko.git' + }, + 'author': { + 'name': 'Patrick Steele-Idem', + 'email': 'pnidem@gmail.com' + }, + 'bugs': { + 'url': 'https://github.com/raptorjs/marko/issues' + }, + 'license': 'Apache License v2.0', + 'readmeFilename': 'README.md', + 'users': { + 'pnidem': true + }, + 'time': { + 'modified': '2014-10-03T02:27:31.775Z' + }, + 'versions': { + '1.2.16': 'latest' + } + } +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/semver-doc.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/semver-doc.js new file mode 100644 index 00000000..963cace1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/semver-doc.js @@ -0,0 +1,12 @@ +var test = require("tap").test + +test("semver doc is up to date", function (t) { + var path = require("path") + var moddoc = path.join(__dirname, "../../node_modules/semver/README.md") + var mydoc = path.join(__dirname, "../../doc/misc/semver.md") + var fs = require("fs") + var mod = fs.readFileSync(moddoc, "utf8").replace(/semver\(1\)/, "semver(7)") + var my = fs.readFileSync(mydoc, "utf8") + t.equal(my, mod) + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/semver-tag.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/semver-tag.js new file mode 100644 index 00000000..03dcdf85 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/semver-tag.js @@ -0,0 +1,15 @@ +// should not allow tagging with a valid semver range +var common = require("../common-tap.js") +var test = require("tap").test + +test("try to tag with semver range as tag name", function (t) { + var cmd = ["tag", "zzzz@1.2.3", "v2.x", "--registry=http://localhost"] + common.npm(cmd, { + stdio: "pipe" + }, function (er, code, so, se) { + if (er) throw er + t.similar(se, /Tag name must not be a valid SemVer range: v2.x\n/) + t.equal(code, 1) + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/shrinkwrap-dev-dependency.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/shrinkwrap-dev-dependency.js new file mode 100644 index 00000000..a124c2b7 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/shrinkwrap-dev-dependency.js @@ -0,0 +1,90 @@ +var fs = require('fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') +var npm = npm = require('../../') + +var pkg = path.resolve(__dirname, 'shrinkwrap-dev-dependency') + +test("shrinkwrap doesn't strip out the dependency", function (t) { + t.plan(1) + + mr({port: common.port}, function (er, s) { + setup(function (err) { + if (err) return t.fail(err) + + npm.install('.', function (err) { + if (err) return t.fail(err) + + npm.commands.shrinkwrap([], true, function (err, results) { + if (err) return t.fail(err) + + t.deepEqual(results, desired) + s.close() + t.end() + }) + }) + }) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +var desired = { + name: 'npm-test-shrinkwrap-dev-dependency', + version: '0.0.0', + dependencies: { + request: { + version: '0.9.0', + from: 'request@0.9.0', + resolved: common.registry + '/request/-/request-0.9.0.tgz' + }, + underscore: { + version: '1.3.1', + from: 'underscore@1.3.1', + resolved: common.registry + '/underscore/-/underscore-1.3.1.tgz' + } + } +} + +var json = { + author: 'Domenic Denicola', + name: 'npm-test-shrinkwrap-dev-dependency', + version: '0.0.0', + dependencies: { + request: '0.9.0', + underscore: '1.3.1' + }, + devDependencies: { + underscore: '1.5.1' + } +} + +function setup (cb) { + cleanup() + mkdirp.sync(pkg) + fs.writeFileSync(path.join(pkg, 'package.json'), JSON.stringify(json, null, 2)) + process.chdir(pkg) + + var opts = { + cache: path.resolve(pkg, 'cache'), + registry: common.registry, + // important to make sure devDependencies don't get stripped + dev: true + } + npm.load(opts, cb) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/shrinkwrap-empty-deps.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/shrinkwrap-empty-deps.js new file mode 100644 index 00000000..32cbd5eb --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/shrinkwrap-empty-deps.js @@ -0,0 +1,78 @@ +var fs = require('fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var pkg = path.resolve(__dirname, 'shrinkwrap-empty-deps') + +var EXEC_OPTS = { cwd: pkg } + +var json = { + author: 'Rockbert', + name: 'shrinkwrap-empty-deps', + version: '0.0.0', + dependencies: {}, + devDependencies: {} +} + +test('setup', function (t) { + cleanup() + mkdirp.sync(pkg) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + + process.chdir(pkg) + t.end() +}) + +test('returns a list of removed items', function (t) { + mr({ port: common.port }, function (er, s) { + common.npm( + [ + '--registry', common.registry, + '--loglevel', 'silent', + 'shrinkwrap' + ], + EXEC_OPTS, + function (err, code, stdout, stderr) { + t.ifError(err, 'shrinkwrap ran without issue') + t.notOk(code, 'shrinkwrap ran without raising error code') + + fs.readFile(path.resolve(pkg, 'npm-shrinkwrap.json'), function (err, desired) { + t.ifError(err, 'read npm-shrinkwrap.json without issue') + t.same( + { + 'name': 'shrinkwrap-empty-deps', + 'version': '0.0.0', + 'dependencies': {} + }, + JSON.parse(desired), + 'shrinkwrap handled empty deps without exploding' + ) + + s.close() + t.end() + }) + } + ) + }) +}) + +test('cleanup', function (t) { + cleanup() + + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/shrinkwrap-local-dependency.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/shrinkwrap-local-dependency.js new file mode 100644 index 00000000..ffbde657 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/shrinkwrap-local-dependency.js @@ -0,0 +1,122 @@ +var test = require("tap").test +var path = require("path") +var fs = require("fs") +var osenv = require("osenv") +var rimraf = require("rimraf") +var mkdirp = require("mkdirp") +var common = require("../common-tap.js") + +var PKG_DIR = path.resolve(__dirname, "shrinkwrap-local-dependency") +var CACHE_DIR = path.resolve(PKG_DIR, "cache") +var DEP_DIR = path.resolve(PKG_DIR, "dep") + +var desired = { + "name": "npm-test-shrinkwrap-local-dependency", + "version": "0.0.0", + "dependencies": { + "npm-test-shrinkwrap-local-dependency-dep": { + "version": "0.0.0", + "from": "dep", + "resolved": "file:dep" + } + } +} + +var root = { + "author": "Thomas Torp", + "name": "npm-test-shrinkwrap-local-dependency", + "version": "0.0.0", + "dependencies": { + "npm-test-shrinkwrap-local-dependency-dep": "file:./dep" + } +} + +var dependency = { + "author": "Thomas Torp", + "name": "npm-test-shrinkwrap-local-dependency-dep", + "version": "0.0.0" +} + + +test("shrinkwrap uses resolved with file: on local deps", function(t) { + setup() + + common.npm( + ["--cache="+CACHE_DIR, "--loglevel=silent", "install", "."], + {}, + function (err, code) { + t.ifError(err, "npm install worked") + t.equal(code, 0, "npm exited normally") + + common.npm( + ["--cache="+CACHE_DIR, "--loglevel=silent", "shrinkwrap"], + {}, + function (err, code) { + t.ifError(err, "npm shrinkwrap worked") + t.equal(code, 0, "npm exited normally") + + fs.readFile("npm-shrinkwrap.json", { encoding : "utf8" }, function (err, data) { + t.ifError(err, "read file correctly") + t.deepEqual(JSON.parse(data), desired, "shrinkwrap looks correct") + + t.end() + }) + } + ) + } + ) +}) + +test('"npm install" should install local packages from shrinkwrap', function (t) { + cleanNodeModules() + + common.npm( + ["--cache="+CACHE_DIR, "--loglevel=silent", "install", "."], + {}, + function (err, code) { + t.ifError(err, "install ran correctly") + t.notOk(code, "npm install exited with code 0") + var dependencyPackageJson = path.resolve( + PKG_DIR, + "node_modules/npm-test-shrinkwrap-local-dependency-dep/package.json" + ) + t.ok( + JSON.parse(fs.readFileSync(dependencyPackageJson, "utf8")), + "package with local dependency installed from shrinkwrap" + ) + + t.end() + } + ) +}) + +test("cleanup", function(t) { + cleanup() + t.end() +}) + +function setup() { + cleanup() + mkdirp.sync(PKG_DIR) + mkdirp.sync(CACHE_DIR) + mkdirp.sync(DEP_DIR) + fs.writeFileSync( + path.resolve(PKG_DIR, "package.json"), + JSON.stringify(root, null, 2) + ) + fs.writeFileSync( + path.resolve(DEP_DIR, "package.json"), + JSON.stringify(dependency, null, 2) + ) + process.chdir(PKG_DIR) +} + +function cleanNodeModules() { + rimraf.sync(path.resolve(PKG_DIR, "node_modules")) +} + +function cleanup() { + process.chdir(osenv.tmpdir()) + cleanNodeModules() + rimraf.sync(PKG_DIR) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/shrinkwrap-prod-dependency.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/shrinkwrap-prod-dependency.js new file mode 100644 index 00000000..5bc83437 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/shrinkwrap-prod-dependency.js @@ -0,0 +1,93 @@ +var fs = require('fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var npm = npm = require('../../') + +var common = require('../common-tap.js') +var pkg = path.resolve(__dirname, 'shrinkwrap-prod-dependency') + +test("shrinkwrap --dev doesn't strip out prod dependencies", function (t) { + t.plan(1) + + mr({port: common.port}, function (er, s) { + setup({}, function (err) { + if (err) return t.fail(err) + + npm.install('.', function (err) { + if (err) return t.fail(err) + + npm.config.set('dev', true) + npm.commands.shrinkwrap([], true, function (err, results) { + if (err) return t.fail(err) + + t.deepEqual(results, desired) + s.close() + t.end() + }) + }) + }) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +var desired = { + name: 'npm-test-shrinkwrap-prod-dependency', + version: '0.0.0', + dependencies: { + request: { + version: '0.9.0', + from: 'request@0.9.0', + resolved: common.registry + '/request/-/request-0.9.0.tgz' + }, + underscore: { + version: '1.5.1', + from: 'underscore@1.5.1', + resolved: common.registry + '/underscore/-/underscore-1.5.1.tgz' + } + } +} + +var json = { + author: 'Domenic Denicola', + name: 'npm-test-shrinkwrap-prod-dependency', + version: '0.0.0', + dependencies: { + request: '0.9.0' + }, + devDependencies: { + underscore: '1.5.1' + } +} + +function setup (opts, cb) { + cleanup() + mkdirp.sync(pkg) + fs.writeFileSync(path.join(pkg, 'package.json'), JSON.stringify(json, null, 2)) + process.chdir(pkg) + + var allOpts = { + cache: path.resolve(pkg, 'cache'), + registry: common.registry + } + + for (var key in opts) { + allOpts[key] = opts[key] + } + + npm.load(allOpts, cb) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/shrinkwrap-scoped-auth.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/shrinkwrap-scoped-auth.js new file mode 100644 index 00000000..79414ccd --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/shrinkwrap-scoped-auth.js @@ -0,0 +1,108 @@ +var resolve = require("path").resolve +var writeFileSync = require("graceful-fs").writeFileSync + +var mkdirp = require("mkdirp") +var mr = require("npm-registry-mock") +var osenv = require("osenv") +var rimraf = require("rimraf") +var test = require("tap").test + +var common = require("../common-tap.js") +var toNerfDart = require("../../lib/config/nerf-dart.js") + +var pkg = resolve(__dirname, "shrinkwrap-scoped-auth") +var outfile = resolve(pkg, "_npmrc") +var modules = resolve(pkg, "node_modules") +var tarballPath = "/scoped-underscore/-/scoped-underscore-1.3.1.tgz" +var tarballURL = common.registry + tarballPath +var tarball = resolve(__dirname, "../fixtures/scoped-underscore-1.3.1.tgz") + +var server + +var EXEC_OPTS = { + cwd : pkg +} + +function mocks (server) { + var auth = "Bearer 0xabad1dea" + server.get(tarballPath, { authorization : auth }).replyWithFile(200, tarball) + server.get(tarballPath).reply(401, { + error : "unauthorized", + reason : "You are not authorized to access this db." + }) +} + +test("setup", function (t) { + mr({ port : common.port, plugin : mocks }, function (err, s) { + server = s + t.ok(s, "set up mock registry") + setup() + t.end() + }) +}) + +test("authed npm install with shrinkwrapped scoped package", function (t) { + common.npm( + [ + "install", + "--loglevel", "silent", + "--fetch-retries", 0, + "--userconfig", outfile + ], + EXEC_OPTS, + function (err, code, stdout, stderr) { + t.ifError(err, "test runner executed without error") + t.equal(code, 0, "npm install exited OK") + t.notOk(stderr, "no output on stderr") + t.equal( + stdout, + "@scoped/underscore@1.3.1 node_modules/@scoped/underscore\n", + "module installed where expected" + ) + + t.end() + } + ) +}) + +test("cleanup", function (t) { + server.close() + cleanup() + t.end() +}) + +var contents = "@scoped:registry="+common.registry+"\n" + + toNerfDart(common.registry)+":_authToken=0xabad1dea\n" + +var json = { + name : "test-package-install", + version : "1.0.0" +} + +var shrinkwrap = { + name : "test-package-install", + version : "1.0.0", + dependencies : { + "@scoped/underscore" : { + resolved : tarballURL, + from : ">=1.3.1 <2", + version : "1.3.1" + } + } +} + +function setup () { + cleanup() + mkdirp.sync(modules) + writeFileSync(resolve(pkg, "package.json"), JSON.stringify(json, null, 2)+"\n") + writeFileSync(outfile, contents) + writeFileSync( + resolve(pkg, "npm-shrinkwrap.json"), + JSON.stringify(shrinkwrap, null, 2)+"\n" + ) +} + +function cleanup() { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/shrinkwrap-shared-dev-dependency.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/shrinkwrap-shared-dev-dependency.js new file mode 100644 index 00000000..a6cddae3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/shrinkwrap-shared-dev-dependency.js @@ -0,0 +1,90 @@ +var fs = require('fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') +var npm = npm = require('../../') + +var pkg = path.resolve(__dirname, 'shrinkwrap-shared-dev-dependency') + +test("shrinkwrap doesn't strip out the shared dependency", function (t) { + t.plan(1) + + mr({ port: common.port }, function (er, s) { + setup(function (err) { + if (err) return t.fail(err) + + npm.install('.', function (err) { + if (err) return t.fail(err) + + npm.commands.shrinkwrap([], true, function (err, results) { + if (err) return t.fail(err) + + t.deepEqual(results, desired) + s.close() + t.end() + }) + }) + }) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +var desired = { + name: 'npm-test-shrinkwrap-shared-dev-dependency', + version: '0.0.0', + dependencies: { + 'test-package-with-one-dep': { + version: '0.0.0', + from: 'test-package-with-one-dep@0.0.0', + resolved: common.registry + + '/test-package-with-one-dep/-/test-package-with-one-dep-0.0.0.tgz' + }, + 'test-package': { + version: '0.0.0', + from: 'test-package@0.0.0', + resolved: common.registry + '/test-package/-/test-package-0.0.0.tgz' + } + } +} + +var json = { + author: 'Domenic Denicola', + name: 'npm-test-shrinkwrap-shared-dev-dependency', + version: '0.0.0', + dependencies: { + 'test-package-with-one-dep': '0.0.0' + }, + devDependencies: { + 'test-package': '0.0.0' + } +} + +function setup (cb) { + cleanup() + mkdirp.sync(pkg) + fs.writeFileSync(path.join(pkg, 'package.json'), JSON.stringify(json, null, 2)) + process.chdir(pkg) + + var opts = { + cache: path.resolve(pkg, 'cache'), + registry: common.registry, + // important to make sure devDependencies don't get stripped + dev: true + } + npm.load(opts, cb) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/sorted-package-json.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/sorted-package-json.js new file mode 100644 index 00000000..726b56f4 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/sorted-package-json.js @@ -0,0 +1,95 @@ +var test = require("tap").test + , path = require("path") + , rimraf = require("rimraf") + , mkdirp = require("mkdirp") + , spawn = require("child_process").spawn + , npm = require.resolve("../../bin/npm-cli.js") + , node = process.execPath + , pkg = path.resolve(__dirname, "sorted-package-json") + , tmp = path.join(pkg, "tmp") + , cache = path.join(pkg, "cache") + , fs = require("fs") + , common = require("../common-tap.js") + , mr = require("npm-registry-mock") + , osenv = require("osenv") + + +test("sorting dependencies", function (t) { + var packageJson = path.resolve(pkg, "package.json") + + cleanup() + mkdirp.sync(cache) + mkdirp.sync(tmp) + setup() + + var before = JSON.parse(fs.readFileSync(packageJson).toString()) + + mr({port : common.port}, function (er, s) { + // underscore is already in the package.json, + // but --save will trigger a rewrite with sort + var child = spawn(node, [npm, "install", "--save", "underscore@1.3.3", "--no-progress", "--loglevel=error"], { + cwd: pkg, + env: { + "npm_config_registry": common.registry, + "npm_config_cache": cache, + "npm_config_tmp": tmp, + "npm_config_prefix": pkg, + "npm_config_global": "false", + HOME: process.env.HOME, + Path: process.env.PATH, + PATH: process.env.PATH + }, + stdio: ['ignore', 'ignore', process.stderr] + }) + + child.on("close", function (code) { + t.equal(code, 0, "npm install exited with code") + var result = fs.readFileSync(packageJson).toString() + , resultAsJson = JSON.parse(result) + + s.close() + + t.same(Object.keys(resultAsJson.dependencies), + Object.keys(before.dependencies).sort()) + + t.notSame(Object.keys(resultAsJson.dependencies), + Object.keys(before.dependencies)) + + t.ok(resultAsJson.dependencies.underscore) + t.ok(resultAsJson.dependencies.request) + t.end() + }) + }) +}) + +test("cleanup", function (t) { + cleanup() + t.pass("cleaned up") + t.end() +}) + +function setup() { + mkdirp.sync(pkg) + + fs.writeFileSync(path.resolve(pkg, "package.json"), JSON.stringify({ + "name": "sorted-package-json", + "version": "0.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "Rocko Artischocko", + "license": "ISC", + "dependencies": { + "underscore": "^1.3.3", + "request": "^0.9.0" + } + }, null, 2), "utf8") +} + +function cleanup() { + process.chdir(osenv.tmpdir()) + rimraf.sync(cache) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/spawn-enoent-help.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/spawn-enoent-help.js new file mode 100644 index 00000000..70fb078f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/spawn-enoent-help.js @@ -0,0 +1,34 @@ +var path = require("path") +var test = require("tap").test +var rimraf = require("rimraf") +var mkdirp = require("mkdirp") +var common = require("../common-tap.js") + +var pkg = path.resolve(__dirname, "spawn-enoent-help") + +test("setup", function (t) { + rimraf.sync(pkg) + mkdirp.sync(pkg) + t.end() +}) + +test("enoent help", function (t) { + common.npm(["help", "config"], { + cwd: pkg, + env: { + PATH: "", + Path: "", + "npm_config_loglevel": "warn", + "npm_config_viewer": "woman" + } + }, function (er, code, sout, serr) { + t.similar(serr, /Check if the file 'emacsclient' is present./) + t.equal(global.cooked, undefined, "Don't leak into global scope") + t.end() + }) +}) + +test("clean", function (t) { + rimraf.sync(pkg) + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/spawn-enoent.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/spawn-enoent.js new file mode 100644 index 00000000..29b70f6f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/spawn-enoent.js @@ -0,0 +1,40 @@ +var path = require("path") +var test = require("tap").test +var fs = require("fs") +var rimraf = require("rimraf") +var mkdirp = require("mkdirp") +var common = require("../common-tap.js") + +var pkg = path.resolve(__dirname, "spawn-enoent") +var pj = JSON.stringify({ + name:"x", + version: "1.2.3", + scripts: { start: "wharble-garble-blorst" } +}, null, 2) + "\n" + + +test("setup", function (t) { + rimraf.sync(pkg) + mkdirp.sync(pkg) + fs.writeFileSync(pkg + "/package.json", pj) + t.end() +}) + +test("enoent script", function (t) { + common.npm(["start"], { + cwd: pkg, + env: { + PATH: process.env.PATH, + Path: process.env.Path, + "npm_config_loglevel": "warn" + } + }, function (er, code, sout, serr) { + t.similar(serr, /npm ERR! Failed at the x@1\.2\.3 start script 'wharble-garble-blorst'\./) + t.end() + }) +}) + +test("clean", function (t) { + rimraf.sync(pkg) + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/splat-with-only-prerelease-to-latest.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/splat-with-only-prerelease-to-latest.js new file mode 100644 index 00000000..b212b86a --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/splat-with-only-prerelease-to-latest.js @@ -0,0 +1,80 @@ +'use strict' +var test = require('tap').test +var npm = require('../../lib/npm') +var stream = require('readable-stream') + +// set up environment +require('../common-tap.js') + +var moduleName = 'xyzzy-wibble' +var testModule = { + name: moduleName, + 'dist-tags': { + latest: '1.3.0-a' + }, + versions: { + '1.0.0-a': { + name: moduleName, + version: '1.0.0-a', + dist: { + shasum: 'da39a3ee5e6b4b0d3255bfef95601890afd80709', + tarball: 'http://registry.npmjs.org/aproba/-/xyzzy-wibble-1.0.0-a.tgz' + } + }, + '1.1.0-a': { + name: moduleName, + version: '1.1.0-a', + dist: { + shasum: 'da39a3ee5e6b4b0d3255bfef95601890afd80709', + tarball: 'http://registry.npmjs.org/aproba/-/xyzzy-wibble-1.1.0-a.tgz' + } + }, + '1.2.0-a': { + name: moduleName, + version: '1.2.0-a', + dist: { + shasum: 'da39a3ee5e6b4b0d3255bfef95601890afd80709', + tarball: 'http://registry.npmjs.org/aproba/-/xyzzy-wibble-1.2.0-a.tgz' + } + }, + '1.3.0-a': { + name: moduleName, + version: '1.3.0-a', + dist: { + shasum: 'da39a3ee5e6b4b0d3255bfef95601890afd80709', + tarball: 'http://registry.npmjs.org/aproba/-/xyzzy-wibble-1.3.0-a.tgz' + } + } + } +} + +test('setup', function (t) { + npm.load(function () { + npm.config.set('loglevel', 'silly') + npm.registry = { + get: function (uri, opts, cb) { + setImmediate(function () { + cb(null, testModule, null, {statusCode: 200}) + }) + }, + fetch: function (u, opts, cb) { + setImmediate(function () { + var empty = new stream.Readable() + empty.push(null) + cb(null, empty) + }) + } + } + t.end() + }) +}) + +test('splat', function (t) { + t.plan(3) + var addNamed = require('../../lib/cache/add-named.js') + addNamed('xyzzy-wibble', '*', testModule, function (err, pkg) { + t.error(err, 'Succesfully resolved a splat package') + t.is(pkg.name, moduleName) + t.is(pkg.version, testModule['dist-tags'].latest) + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/startstop.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/startstop.js new file mode 100644 index 00000000..b17a303c --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/startstop.js @@ -0,0 +1,74 @@ +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap') + +var pkg = path.resolve(__dirname, 'startstop') + +var EXEC_OPTS = { cwd: pkg } + +var json = { + name: 'startstop', + version: '1.2.3', + scripts: { + start: 'node -e \"console.log(\'start\')\"', + stop: 'node -e \"console.log(\'stop\')\"' + } +} + +function testOutput (t, command, er, code, stdout, stderr) { + t.notOk(code, 'npm ' + command + ' exited with code 0') + + if (stderr) throw new Error('npm ' + command + ' stderr: ' + stderr.toString()) + + stdout = stdout.trim().split(/\n|\r/) + stdout = stdout[stdout.length - 1] + t.equal(stdout, command) + t.end() +} + +test('setup', function (t) { + cleanup() + mkdirp.sync(pkg) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + t.end() +}) + +test('npm start', function (t) { + common.npm(['start'], EXEC_OPTS, testOutput.bind(null, t, 'start')) +}) + +test('npm stop', function (t) { + common.npm(['stop'], EXEC_OPTS, testOutput.bind(null, t, 'stop')) +}) + +test('npm restart', function (t) { + common.npm(['restart'], EXEC_OPTS, function (er, c, stdout) { + if (er) throw er + + var output = stdout.split('\n').filter(function (val) { + return val.match(/^s/) + }) + + t.same(output.sort(), ['start', 'stop'].sort()) + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/tag-version-prefix.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/tag-version-prefix.js new file mode 100644 index 00000000..f4ba32b1 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/tag-version-prefix.js @@ -0,0 +1,93 @@ +var common = require('../common-tap.js') +var fs = require('fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var npm = require('../../lib/npm.js') + +var pkg = path.resolve(__dirname, 'version-message-config') +var cache = path.resolve(pkg, 'cache') +var npmrc = path.resolve(pkg, '.npmrc') +var packagePath = path.resolve(pkg, 'package.json') + +var json = { name: 'blah', version: '0.1.2' } + +var configContents = 'sign-git-tag=false\nmessage=":bookmark: %s"\n' + +test('npm version <semver> with message config', function (t) { + setup() + + npm.load({ prefix: pkg, userconfig: npmrc }, function () { + var git = require('../../lib/utils/git.js') + + common.makeGitRepo({ path: pkg }, function (er) { + t.ifErr(er, 'git bootstrap ran without error') + + common.npm( + [ + '--userconfig', npmrc, + 'config', + 'set', + 'tag-version-prefix', + 'q' + ], + { cwd: pkg, env: { PATH: process.env.PATH } }, + function (err, code, stdout, stderr) { + t.ifError(err, 'npm config ran without issue') + t.notOk(code, 'exited with a non-error code') + t.notOk(stderr, 'no error output') + + common.npm( + [ + 'version', + 'patch', + '--loglevel', 'silent' + // package config is picked up from env + ], + { cwd: pkg, env: { PATH: process.env.PATH } }, + function (err, code, stdout, stderr) { + t.ifError(err, 'npm version ran without issue') + t.notOk(code, 'exited with a non-error code') + t.notOk(stderr, 'no error output') + + git.whichAndExec( + ['tag'], + { cwd: pkg, env: process.env }, + function (er, tags, stderr) { + t.ok(tags.match(/q0\.1\.3/g), 'tag was created by version' + tags) + t.end() + } + ) + } + ) + } + ) + } + ) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + // windows fix for locked files + process.chdir(osenv.tmpdir()) + + rimraf.sync(pkg) +} + +function setup () { + cleanup() + mkdirp.sync(cache) + process.chdir(pkg) + + fs.writeFileSync(packagePath, JSON.stringify(json), 'utf8') + fs.writeFileSync(npmrc, configContents, 'ascii') +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/team.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/team.js new file mode 100644 index 00000000..4bfcbadd --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/team.js @@ -0,0 +1,136 @@ +var fs = require('fs') +var path = require('path') +var rimraf = require('rimraf') +var mr = require('npm-registry-mock') + +var test = require('tap').test +var common = require('../common-tap.js') + +var server + +test('setup', function (t) { + mr({port: common.port}, function (err, s) { + t.ifError(err, 'registry mocked successfully') + server = s + t.end() + }) +}) + +test('team create basic', function (t) { + var teamData = { + name: 'test', + scope_id: 1234, + created: '2015-07-23T18:07:49.959Z', + updated: '2015-07-23T18:07:49.959Z', + deleted: null + } + server.put('/-/org/myorg/team', JSON.stringify({ + name: teamData.name + })).reply(200, teamData) + common.npm([ + 'team', 'create', 'myorg:' + teamData.name, + '--registry', common.registry, + '--loglevel', 'silent' + ], {}, function (err, code, stdout, stderr) { + t.ifError(err, 'npm team') + t.equal(code, 0, 'exited OK') + t.equal(stderr, '', 'no error output') + t.same(JSON.parse(stdout), teamData) + t.end() + }) +}) + +test('team destroy', function (t) { + var teamData = { + name: 'myteam', + scope_id: 1234, + created: '2015-07-23T18:07:49.959Z', + updated: '2015-07-23T18:07:49.959Z', + deleted: '2015-07-23T18:27:27.178Z' + } + server.delete('/-/team/myorg/' + teamData.name).reply(200, teamData) + common.npm([ + 'team', 'destroy', 'myorg:' + teamData.name, + '--registry', common.registry, + '--loglevel', 'silent' + ], {}, function (err, code, stdout, stderr) { + t.ifError(err, 'npm team') + t.equal(code, 0, 'exited OK') + t.equal(stderr, '', 'no error output') + t.same(JSON.parse(stdout), teamData) + t.end() + }) +}) + +test('team add', function (t) { + var user = 'zkat' + server.put('/-/team/myorg/myteam/user', JSON.stringify({ + user: user + })).reply(200) + common.npm([ + 'team', 'add', 'myorg:myteam', user, + '--registry', common.registry, + '--loglevel', 'silent' + ], {}, function (err, code, stdout, stderr) { + t.ifError(err, 'npm team') + t.equal(code, 0, 'exited OK') + t.equal(stderr, '', 'no error output') + t.end() + }) +}) + +test('team rm', function (t) { + var user = 'zkat' + server.delete('/-/team/myorg/myteam/user', JSON.stringify({ + user: user + })).reply(200) + common.npm([ + 'team', 'rm', 'myorg:myteam', user, + '--registry', common.registry, + '--loglevel', 'silent' + ], {}, function (err, code, stdout, stderr) { + t.ifError(err, 'npm team') + t.equal(code, 0, 'exited OK') + t.equal(stderr, '', 'no error output') + t.end() + }) +}) + +test('team ls (on org)', function (t) { + var teams = ['myorg:team1', 'myorg:team2', 'myorg:team3'] + server.get('/-/org/myorg/team?format=cli').reply(200, teams) + common.npm([ + 'team', 'ls', 'myorg', + '--registry', common.registry, + '--loglevel', 'silent' + ], {}, function (err, code, stdout, stderr) { + t.ifError(err, 'npm team') + t.equal(code, 0, 'exited OK') + t.equal(stderr, '', 'no error output') + t.same(JSON.parse(stdout), teams) + t.end() + }) +}) + +test('team ls (on team)', function (t) { + var users = ['zkat', 'bcoe'] + server.get('/-/team/myorg/myteam/user?format=cli').reply(200, users) + common.npm([ + 'team', 'ls', 'myorg:myteam', + '--registry', common.registry, + '--loglevel', 'silent' + ], {}, function (err, code, stdout, stderr) { + t.ifError(err, 'npm team') + t.equal(code, 0, 'exited OK') + t.equal(stderr, '', 'no error output') + t.same(JSON.parse(stdout), users) + t.end() + }) +}) + +test('cleanup', function (t) { + t.pass('cleaned up') + server.done() + server.close() + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/test-run-ls.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/test-run-ls.js new file mode 100644 index 00000000..252c6e8f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/test-run-ls.js @@ -0,0 +1,33 @@ +var common = require("../common-tap.js") +var test = require("tap").test +var path = require("path") +var cwd = path.resolve(__dirname, "..", "..") +var testscript = require("../../package.json").scripts.test +var tsregexp = testscript.replace(/([\[\.\*\]])/g, "\\$1") + +test("default", function (t) { + common.npm(["run"], { cwd: cwd }, function (er, code, so) { + if (er) throw er + t.notOk(code) + t.similar(so, new RegExp("\\n test\\n " + tsregexp + "\\n")) + t.end() + }) +}) + +test("parseable", function (t) { + common.npm(["run", "-p"], { cwd: cwd }, function (er, code, so) { + if (er) throw er + t.notOk(code) + t.similar(so, new RegExp("\\ntest:" + tsregexp + "\\n")) + t.end() + }) +}) + +test("parseable", function (t) { + common.npm(["run", "--json"], { cwd: cwd }, function (er, code, so) { + if (er) throw er + t.notOk(code) + t.equal(JSON.parse(so).test, testscript) + t.end() + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/umask-lifecycle.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/umask-lifecycle.js new file mode 100644 index 00000000..aa07084f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/umask-lifecycle.js @@ -0,0 +1,55 @@ +var fs = require('fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var test = require('tap').test +var sprintf = require('sprintf-js').sprintf + +var common = require('../common-tap.js') +var pkg = path.resolve(__dirname, 'umask-lifecycle') + +var pj = JSON.stringify({ + name: 'x', + version: '1.2.3', + scripts: { umask: '$npm_execpath config get umask && echo "$npm_config_umask" && node -pe "process.umask()"' } +}, null, 2) + '\n' + +var umask = process.umask() +var expected = [ + '', + '> x@1.2.3 umask ' + path.join(__dirname, 'umask-lifecycle'), + '> $npm_execpath config get umask && echo "$npm_config_umask" && node -pe "process.umask()"', + '', + sprintf('%04o', umask), + sprintf('%04o', umask), + sprintf('%d', umask), + '' +].join('\n') + +test('setup', function (t) { + rimraf.sync(pkg) + mkdirp.sync(pkg) + fs.writeFileSync(pkg + '/package.json', pj) + t.end() +}) + +test('umask script', function (t) { + common.npm(['run', 'umask'], { + cwd: pkg, + env: { + PATH: process.env.PATH, + Path: process.env.Path, + 'npm_config_loglevel': 'warn' + } + }, function (er, code, sout, serr) { + t.equal(sout, expected) + t.equal(serr, '') + t.end() + }) +}) + +test('clean', function (t) { + rimraf.sync(pkg) + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/uninstall-package.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/uninstall-package.js new file mode 100644 index 00000000..6e86df53 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/uninstall-package.js @@ -0,0 +1,79 @@ +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var pkg = path.join(__dirname, 'uninstall-package') + +var EXEC_OPTS = { cwd: pkg } + +var json = { + name: 'uninstall-package', + version: '0.0.0', + dependencies: { + underscore: '~1.3.1', + request: '~0.9.0' + } +} + +test('setup', function (t) { + cleanup() + mkdirp.sync(pkg) + process.chdir(pkg) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + + t.end() +}) + +test('returns a list of removed items', function (t) { + mr({ port: common.port }, function (er, s) { + common.npm( + [ + '--registry', common.registry, + '--loglevel', 'silent', + 'install', '.' + ], + EXEC_OPTS, + function (err, code, stdout, stderr) { + t.ifError(err, 'install ran without issue') + t.notOk(code, 'install ran without raising error code') + common.npm( + [ + '--registry', common.registry, + '--loglevel', 'silent', + 'uninstall', 'underscore', 'request', 'lala' + ], + EXEC_OPTS, + function (err, code, stdout, stderr) { + t.ifError(err, 'uninstall ran without issue') + t.notOk(code, 'uninstall ran without raising error code') + t.has(stdout, /unbuild underscore@1.3.3/, 'underscore uninstalled') + t.has(stdout, /unbuild request@0.9.5/, 'request uninstalled') + + s.close() + t.end() + } + ) + } + ) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/unpack-foreign-tarball.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/unpack-foreign-tarball.js new file mode 100644 index 00000000..56d707c3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/unpack-foreign-tarball.js @@ -0,0 +1,88 @@ +var fs = require('graceful-fs') +var path = require('path') + +var test = require('tap').test +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') + +var common = require('../common-tap.js') + +var fixtures = path.resolve(__dirname, '..', 'fixtures') + +var pkg = path.resolve(__dirname, 'unpack-foreign-tarball') +var nm = path.resolve(pkg, 'node_modules') +var target = path.resolve(nm, 'npm-test-gitignore') +var cache = path.resolve(pkg, 'cache') +var tmp = path.resolve(pkg, 'tmp') + +var EXEC_OPTS = { + env: { + 'npm_config_cache': cache, + 'npm_config_tmp': tmp + }, + cwd: pkg, + stdio: [ 'pipe', 'pipe', 2 ] +} + +function verify (t, files, err, code) { + if (code) { + t.fail('exited with failure: ' + code) + return t.end() + } + var actual = fs.readdirSync(target).sort() + var expect = files.concat(['.npmignore', 'package.json']).sort() + t.same(actual, expect) + t.end() +} + +test('setup', function (t) { + setup() + t.comment('test for https://github.com/npm/npm/issues/5658') + t.end() +}) + +test('npmignore only', function (t) { + var file = path.resolve(fixtures, 'npmignore.tgz') + common.npm(['install', file], EXEC_OPTS, verify.bind(null, t, ['foo'])) +}) + +test('gitignore only', function (t) { + setup() + var file = path.resolve(fixtures, 'gitignore.tgz') + common.npm(['install', file], EXEC_OPTS, verify.bind(null, t, ['foo'])) +}) + +test('gitignore and npmignore', function (t) { + setup() + var file = path.resolve(fixtures, 'gitignore-and-npmignore.tgz') + common.npm(['install', file], EXEC_OPTS, verify.bind(null, t, ['foo', 'bar'])) +}) + +test('gitignore and npmignore, not gzipped 1/2', function (t) { + setup() + var file = path.resolve(fixtures, 'gitignore-and-npmignore.tar') + common.npm(['install', file], EXEC_OPTS, verify.bind(null, t, ['foo', 'bar'])) +}) + +test('gitignore and npmignore, not gzipped 2/2', function (t) { + setup() + var file = path.resolve(fixtures, 'gitignore-and-npmignore-2.tar') + common.npm(['install', file], EXEC_OPTS, verify.bind(null, t, ['foo', 'bar'])) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function setup () { + cleanup() + mkdirp.sync(nm) + mkdirp.sync(tmp) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/unpublish-config.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/unpublish-config.js new file mode 100644 index 00000000..d6e18eb0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/unpublish-config.js @@ -0,0 +1,82 @@ +var fs = require('graceful-fs') +var http = require('http') +var path = require('path') + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var pkg = path.join(__dirname, 'npm-test-unpublish-config') +var fixturePath = path.join(pkg, 'fixture_npmrc') + +var common = require('../common-tap.js') + +var json = { + name: 'npm-test-unpublish-config', + version: '1.2.3', + publishConfig: { registry: common.registry } +} + +test('setup', function (t) { + mkdirp.sync(pkg) + + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json), 'utf8' + ) + fs.writeFileSync( + fixturePath, + '//localhost:1337/:_authToken = beeeeeeeeeeeeef\n' + + 'registry = http://lvh.me:4321/registry/path\n' + ) + + t.end() +}) + +test('cursory test of unpublishing with config', function (t) { + var child + t.plan(4) + http.createServer(function (req, res) { + t.pass('got request on the fakey fake registry') + this.close() + res.statusCode = 500 + res.end(JSON.stringify({ + error: 'shh no tears, only dreams now' + })) + child.kill('SIGHUP') + }).listen(common.port, function () { + t.pass('server is listening') + + child = common.npm( + [ + '--userconfig', fixturePath, + '--loglevel', 'silent', + '--force', + 'unpublish' + ], + { + cwd: pkg, + stdio: 'inherit', + env: { + 'npm_config_cache_lock_stale': 1000, + 'npm_config_cache_lock_wait': 1000, + HOME: process.env.HOME, + Path: process.env.PATH, + PATH: process.env.PATH, + USERPROFILE: osenv.home() + } + }, + function (err, code) { + t.ifError(err, 'publish command finished successfully') + t.notOk(code, 'npm install exited with code 0') + } + ) + }) +}) + +test('cleanup', function (t) { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/update-examples.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/update-examples.js new file mode 100644 index 00000000..44b615b9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/update-examples.js @@ -0,0 +1,201 @@ +var common = require('../common-tap.js') +var test = require('tap').test +var npm = require('../../lib/npm.js') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var path = require('path') +var mr = require('npm-registry-mock') + +var osenv = require('osenv') + +var requireInject = require('require-inject') + +var PKG_DIR = path.resolve(__dirname, 'update-examples') +var CACHE_DIR = path.resolve(PKG_DIR, 'cache') + +// ** constant templates for mocks ** +var DEFAULT_PKG = { + 'name': 'update-examples', + 'version': '1.2.3', + 'dependencies': { + 'dep1': '*' + } +} + +var DEP_PKG = { + name: 'dep1', + version: '1.1.1', + _from: '^1.1.1' +} + +var INSTALLED = { + dependencies: { + 'dep1': { + version: '1.1.1', + link: false + } + } +} + +var DEP1_REGISTRY = { name: 'dep1', + 'dist-tags': { latest: '1.2.2' }, + versions: { + '1.2.2': { version: '1.2.2' }, + '1.2.1': { version: '1.2.1' }, + '1.2.0': { version: '1.2.0' }, + '1.1.2': { version: '1.1.2' }, + '1.1.1': { version: '1.1.1' }, + '1.0.0': { version: '1.0.0' }, + '0.4.1': { version: '0.4.1' }, + '0.4.0': { version: '0.4.0' }, + '0.2.0': { version: '0.2.0' } + } +} + +var registryMocks = { + 'get': { + '/dep1': [200, DEP1_REGISTRY] + } +} + +// ** dynamic mocks, cloned from templates and modified ** +var mockServer +var mockDepJson = clone(DEP_PKG) +var mockInstalled = clone(INSTALLED) +var mockParentJson = clone(DEFAULT_PKG) + +// target +var installAskedFor + +function clone (a) { + return extend({}, a) +} + +function extend (a, b) { + for (var key in b) { + a[key] = b[key] + } + return a +} + +function resetPackage (options) { + rimraf.sync(CACHE_DIR) + mkdirp.sync(CACHE_DIR) + + installAskedFor = undefined + + mockParentJson = clone(DEFAULT_PKG) + mockInstalled = clone(INSTALLED) + mockDepJson = clone(DEP_PKG) + + if (options.wanted) { + mockParentJson.dependencies.dep1 = options.wanted + mockDepJson._from = options.wanted + } + + if (options.installed) { + mockInstalled.dependencies.dep1.version = options.installed + mockDepJson.version = options.installed + } +} + +function mockReadInstalled (dir, opts, cb) { + cb(null, mockInstalled) +} + +function mockReadJson (file, cb) { + cb(null, file.match(/dep1/) ? mockDepJson : mockParentJson) +} + +function mockCommand (npm, name, fn) { + delete npm.commands[name] + npm.commands[name] = fn +} + +test('setup', function (t) { + process.chdir(osenv.tmpdir()) + mkdirp.sync(PKG_DIR) + process.chdir(PKG_DIR) + + resetPackage({}) + + mr({ port: common.port, mocks: registryMocks }, function (er, server) { + npm.load({ cache: CACHE_DIR, + registry: common.registry, + cwd: PKG_DIR }, function (err) { + t.ifError(err, 'started server') + mockServer = server + + mockCommand(npm, 'install', function mockInstall (where, what, cb) { + installAskedFor = what + cb(null) + }) + + mockCommand(npm, 'outdated', requireInject('../../lib/outdated', { + 'read-installed': mockReadInstalled, + 'read-package-json': mockReadJson + })) + + t.end() + }) + }) +}) + +test('update caret dependency to latest', function (t) { + resetPackage({ wanted: '^1.1.1' }) + + npm.commands.update([], function (err) { + t.ifError(err) + t.equal('dep1@1.2.2', installAskedFor, 'should want to install dep@1.2.2') + t.end() + }) +}) + +test('update tilde dependency to latest', function (t) { + resetPackage({ wanted: '~1.1.1' }) + + npm.commands.update([], function (err) { + t.ifError(err) + t.equal('dep1@1.1.2', installAskedFor, 'should want to install dep@1.1.2') + t.end() + }) +}) + +test('hold tilde dependency at wanted (#6441)', function (t) { + resetPackage({ wanted: '~1.1.2', installed: '1.1.2' }) + + npm.commands.update([], function (err) { + t.ifError(err) + t.notOk(installAskedFor, 'should not want to install anything') + t.end() + }) +}) + +test('update old caret dependency with no newer', function (t) { + resetPackage({ wanted: '^0.2.0', installed: '^0.2.0' }) + + npm.commands.update([], function (err) { + t.ifError(err) + t.equal('dep1@0.2.0', installAskedFor, 'should want to install dep@0.2.0') + t.end() + }) +}) + +test('update old caret dependency with newer', function (t) { + resetPackage({ wanted: '^0.4.0', installed: '^0.4.0' }) + + npm.commands.update([], function (err) { + t.ifError(err) + t.equal('dep1@0.4.1', installAskedFor, 'should want to install dep@0.4.1') + t.end() + }) +}) + +test('cleanup', function (t) { + mockServer.close() + + process.chdir(osenv.tmpdir()) + rimraf.sync(PKG_DIR) + + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/update-index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/update-index.js new file mode 100644 index 00000000..fe4244c3 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/update-index.js @@ -0,0 +1,195 @@ +var common = require('../common-tap.js') +var test = require('tap').test +var npm = require('../../') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var path = require('path') +var mr = require('npm-registry-mock') + +var updateIndex = require('../../lib/cache/update-index.js') + +var PKG_DIR = path.resolve(__dirname, 'get-basic') +var CACHE_DIR = path.resolve(PKG_DIR, 'cache') + +var server + +var mocks = { + basic: function (mock) { + mock.get('/-/all').reply(200, allMock) + }, + auth: function (mock) { + var littleBobbyTablesAuth = new Buffer('bobby:tables').toString('base64') + var auth = 'Basic ' + littleBobbyTablesAuth + mock.get('/-/all', { authorization: auth }).reply(200, allMock) + mock.get('/-/all').reply(401, { + error: 'unauthorized', + reason: 'You are not authorized to access this db.' + }) + } +} + +var allMock = { + '_updated': 1411727900 + 25, + 'generator-frontcow': { + 'name': 'generator-frontcow', + 'description': 'f36b6a6123da50959741e2ce4d634f96ec668c56 This is a fake description to ensure we do not accidentally search the real npm registry or use some kind of cache', + 'dist-tags': { + 'latest': '0.1.19' + }, + 'maintainers': [ + { + 'name': 'bcabanes', + 'email': 'contact@benjamincabanes.com' + } + ], + 'homepage': 'https://github.com/bcabanes/generator-frontcow', + 'keywords': [ + 'sass', + 'frontend', + 'yeoman-generator', + 'atomic', + 'design', + 'sass', + 'foundation', + 'foundation5', + 'atomic design', + 'bourbon', + 'polyfill', + 'font awesome' + ], + 'repository': { + 'type': 'git', + 'url': 'https://github.com/bcabanes/generator-frontcow' + }, + 'author': { + 'name': 'ben', + 'email': 'contact@benjamincabanes.com', + 'url': 'https://github.com/bcabanes' + }, + 'bugs': { + 'url': 'https://github.com/bcabanes/generator-frontcow/issues' + }, + 'license': 'MIT', + 'readmeFilename': 'README.md', + 'time': { + 'modified': '2014-10-03T02:26:18.406Z' + }, + 'versions': { + '0.1.19': 'latest' + } + }, + 'marko': { + 'name': 'marko', + 'description': 'Marko is an extensible, streaming, asynchronous, high performance, HTML-based templating language that can be used in Node.js or in the browser.', + 'dist-tags': { + 'latest': '1.2.16' + }, + 'maintainers': [ + { + 'name': 'pnidem', + 'email': 'pnidem@gmail.com' + }, + { + 'name': 'philidem', + 'email': 'phillip.idem@gmail.com' + } + ], + 'homepage': 'https://github.com/raptorjs/marko', + 'keywords': [ + 'templating', + 'template', + 'async', + 'streaming' + ], + 'repository': { + 'type': 'git', + 'url': 'https://github.com/raptorjs/marko.git' + }, + 'author': { + 'name': 'Patrick Steele-Idem', + 'email': 'pnidem@gmail.com' + }, + 'bugs': { + 'url': 'https://github.com/raptorjs/marko/issues' + }, + 'license': 'Apache License v2.0', + 'readmeFilename': 'README.md', + 'users': { + 'pnidem': true + }, + 'time': { + 'modified': '2014-10-03T02:27:31.775Z' + }, + 'versions': { + '1.2.16': 'latest' + } + } +} + +function setup (t, mock, extra) { + mkdirp.sync(CACHE_DIR) + mr({ port: common.port, plugin: mock }, function (er, s) { + npm.load({ cache: CACHE_DIR, registry: common.registry }, function (err) { + if (extra) { + Object.keys(extra).forEach(function (k) { + npm.config.set(k, extra[k], 'user') + }) + } + t.ifError(err, 'no error') + server = s + t.end() + }) + }) +} + +function cleanup (t) { + server.close(function () { + rimraf.sync(PKG_DIR) + + t.end() + }) +} + +test('setup basic', function (t) { + setup(t, mocks.basic) +}) + +test('request basic', function (t) { + updateIndex(0, function (er) { + t.ifError(er, 'no error') + t.end() + }) +}) + +test('cleanup basic', cleanup) + +test('setup auth', function (t) { + setup(t, mocks.auth) +}) + +test('request auth failure', function (t) { + updateIndex(0, function (er) { + t.equals(er.code, 'E401', 'gotta get that auth') + t.ok(/^unauthorized/.test(er.message), 'unauthorized message') + t.end() + }) +}) + +test('cleanup auth failure', cleanup) + +test('setup auth', function (t) { + // mimic as if alwaysAuth had been set + setup(t, mocks.auth, { + _auth: new Buffer('bobby:tables').toString('base64'), + 'always-auth': true + }) +}) + +test('request auth success', function (t) { + updateIndex(0, function (er) { + t.ifError(er, 'no error') + t.end() + }) +}) + +test('cleanup auth', cleanup) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/update-save.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/update-save.js new file mode 100644 index 00000000..f01fa0f5 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/update-save.js @@ -0,0 +1,219 @@ +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') +var server + +var pkg = path.resolve(__dirname, 'update-save') +var cache = path.resolve(pkg, 'cache') + +var EXEC_OPTS = { + cwd: pkg, + stdio: 'ignore', + env: { + npm_config_registry: common.registry, + npm_config_loglevel: 'verbose', + npm_config_save_prefix: '^' + } +} + +var json = { + name: 'update-save-example', + version: '1.2.3', + dependencies: { + mkdirp: '~0.3.0' + }, + devDependencies: { + underscore: '~1.3.1' + } +} + +function clone (a) { + return extend({}, a) +} + +function extend (a, b) { + for (var key in b) { a[key] = b[key] } + return a +} + +test('setup', function (t) { + setup() + + mr({ port: common.port }, function (er, s) { + t.ifError(er) + server = s + t.end() + }) +}) + +test('update regular dependencies only', function (t) { + setup() + + common.npm(['update', '--save'], EXEC_OPTS, function (err, code) { + t.ifError(err) + t.notOk(code, 'npm update exited with code 0') + + var pkgdata = JSON.parse(fs.readFileSync(path.join(pkg, 'package.json'), 'utf8')) + t.deepEqual( + pkgdata.dependencies, + { mkdirp: '^0.3.5' }, + 'only dependencies updated' + ) + t.deepEqual( + pkgdata.devDependencies, + json.devDependencies, + 'dev dependencies should be untouched' + ) + t.deepEqual( + pkgdata.optionalDependencies, + json.optionalDependencies, + 'optional dependencies should be untouched' + ) + + t.end() + }) +}) + +test('update devDependencies only', function (t) { + setup() + + common.npm(['update', '--save-dev'], EXEC_OPTS, function (err, code) { + t.ifError(err) + t.notOk(code, 'npm update exited with code 0') + + var pkgdata = JSON.parse(fs.readFileSync(path.join(pkg, 'package.json'), 'utf8')) + t.deepEqual( + pkgdata.dependencies, + json.dependencies, + 'dependencies should be untouched' + ) + t.deepEqual( + pkgdata.devDependencies, + { underscore: '^1.3.3' }, + 'dev dependencies should be updated' + ) + t.deepEqual( + pkgdata.optionalDependencies, + json.optionalDependencies, + 'optional dependencies should be untouched' + ) + + t.end() + }) +}) + +test('update optionalDependencies only', function (t) { + setup({ optionalDependencies: { underscore: '~1.3.1' } }) + + common.npm(['update', '--save-optional'], EXEC_OPTS, function (err, code) { + t.ifError(err) + t.notOk(code, 'npm update exited with code 0') + + var pkgdata = JSON.parse(fs.readFileSync(path.join(pkg, 'package.json'), 'utf8')) + t.deepEqual( + pkgdata.dependencies, + json.dependencies, + 'dependencies should be untouched' + ) + t.deepEqual( + pkgdata.devDependencies, + json.devDependencies, + 'dev dependencies should be untouched' + ) + t.deepEqual( + pkgdata.optionalDependencies, + { underscore: '^1.3.3' }, + 'optional dependencies should be updated' + ) + + t.end() + }) +}) + +test('optionalDependencies are merged into dependencies during --save', function (t) { + var cloned = setup({ optionalDependencies: { underscore: '~1.3.1' } }) + + common.npm(['update', '--save'], EXEC_OPTS, function (err, code) { + t.ifError(err) + t.notOk(code, 'npm update exited with code 0') + + var pkgdata = JSON.parse(fs.readFileSync(path.join(pkg, 'package.json'), 'utf8')) + t.deepEqual( + pkgdata.dependencies, + { mkdirp: '^0.3.5' }, + 'dependencies should not include optional dependencies' + ) + t.deepEqual( + pkgdata.devDependencies, + cloned.devDependencies, + 'dev dependencies should be untouched' + ) + t.deepEqual( + pkgdata.optionalDependencies, + cloned.optionalDependencies, + 'optional dependencies should be untouched' + ) + + t.end() + }) +}) + +test('semver prefix is replaced with configured save-prefix', function (t) { + setup() + + common.npm(['update', '--save', '--save-prefix', '~'], EXEC_OPTS, function (err, code) { + t.ifError(err) + t.notOk(code, 'npm update exited with code 0') + + var pkgdata = JSON.parse(fs.readFileSync(path.join(pkg, 'package.json'), 'utf8')) + t.deepEqual( + pkgdata.dependencies, + { mkdirp: '~0.3.5' }, + 'dependencies should be updated' + ) + t.deepEqual( + pkgdata.devDependencies, + json.devDependencies, + 'dev dependencies should be untouched' + ) + t.deepEqual( + pkgdata.optionalDependencies, + json.optionalDependencies, + 'optional dependencies should be updated' + ) + + t.end() + }) +}) + +test('cleanup', function (t) { + server.close() + cleanup() + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} + +function setup (extendWith) { + cleanup() + mkdirp.sync(cache) + process.chdir(pkg) + + var template = clone(json) + extend(template, extendWith) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(template, null, 2) + ) + return template +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/url-dependencies.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/url-dependencies.js new file mode 100644 index 00000000..bc54da71 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/url-dependencies.js @@ -0,0 +1,113 @@ +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap') +var server + +var pkg = path.resolve(__dirname, 'url-dependencies') + +var json = { + author: 'Steve Mason', + name: 'url-dependencies', + version: '0.0.0', + dependencies: { + underscore: common.registry + '/underscore/-/underscore-1.3.1.tgz' + } +} + +var mockRoutes = { + 'get': { + '/underscore/-/underscore-1.3.1.tgz': [200] + } +} + +test('setup', function (t) { + mr({ port: common.port, mocks: mockRoutes }, function (er, s) { + server = s + t.end() + }) +}) + +test('url-dependencies: download first time', function (t) { + setup() + + performInstall(t, function (output) { + if (!tarballWasFetched(output)) { + t.fail('Tarball was not fetched') + } else { + t.pass('Tarball was fetched') + } + t.end() + }) +}) + +test('url-dependencies: do not download subsequent times', function (t) { + setup() + + performInstall(t, function () { + performInstall(t, function (output) { + if (tarballWasFetched(output)) { + t.fail('Tarball was fetched second time around') + } else { + t.pass('Tarball was not fetched') + } + t.end() + }) + }) +}) + +test('cleanup', function (t) { + server.close() + cleanup() + t.end() +}) + +function cleanup () { + // windows fix for locked files + process.chdir(osenv.tmpdir()) + rimraf.sync(path.resolve(pkg)) +} + +function setup () { + cleanup() + mkdirp.sync(pkg) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) +} + +function tarballWasFetched (output) { + return output.indexOf( + 'http fetch GET ' + + common.registry + + '/underscore/-/underscore-1.3.1.tgz' + ) > -1 +} + +function performInstall (t, cb) { + var opts = { + cwd: pkg, + env: { + npm_config_registry: common.registry, + npm_config_cache_lock_stale: 1000, + npm_config_cache_lock_wait: 1000, + npm_config_loglevel: 'http', + HOME: process.env.HOME, + Path: process.env.PATH, + PATH: process.env.PATH + } + } + common.npm(['install'], opts, function (err, code, stdout, stderr) { + t.ifError(err, 'install success') + t.notOk(code, 'npm install exited with code 0') + + cb(stderr) + }) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/version-git-not-clean.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/version-git-not-clean.js new file mode 100644 index 00000000..22ffb7c9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/version-git-not-clean.js @@ -0,0 +1,96 @@ +var common = require('../common-tap.js') +var test = require('tap').test +var npm = require('../../') +var osenv = require('osenv') +var path = require('path') +var fs = require('fs') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var which = require('which') +var spawn = require('child_process').spawn + +var pkg = path.resolve(__dirname, 'version-git-not-clean') +var cache = path.resolve(pkg, 'cache') + +test('npm version <semver> with working directory not clean', function (t) { + setup() + npm.load({ cache: cache, registry: common.registry, prefix: pkg }, function () { + which('git', function (err, git) { + t.ifError(err, 'git found') + + function addPackageJSON (_cb) { + var data = JSON.stringify({ name: 'blah', version: '0.1.2' }) + fs.writeFile('package.json', data, function () { + var child = spawn(git, ['add', 'package.json']) + child.on('exit', function () { + var child2 = spawn(git, ['commit', 'package.json', '-m', 'init']) + var out = '' + child2.stdout.on('data', function (d) { + out += d.toString() + }) + child2.on('exit', function () { + return _cb(out) + }) + }) + }) + } + + common.makeGitRepo({path: pkg}, function () { + addPackageJSON(function () { + var data = JSON.stringify({ name: 'blah', version: '0.1.3' }) + fs.writeFile('package.json', data, function () { + npm.commands.version(['patch'], function (err) { + if (!err) { + t.fail('should fail on non-clean working directory') + } else { + t.ok(err.message.match(/Git working directory not clean./)) + t.ok(err.message.match(/M package.json/)) + } + t.end() + }) + }) + }) + }) + }) + }) +}) + +test('npm version <semver> --force with working directory not clean', function (t) { + common.npm( + [ + '--force', + '--no-sign-git-tag', + '--registry', common.registry, + '--prefix', pkg, + 'version', + 'patch' + ], + { cwd: pkg, env: {PATH: process.env.PATH} }, + function (err, code, stdout, stderr) { + t.ifError(err, 'npm version ran without issue') + t.notOk(code, 'exited with a non-error code') + var errorLines = stderr.trim().split('\n') + .map(function (line) { + return line.trim() + }) + .filter(function (line) { + return !line.indexOf('using --force') + }) + t.notOk(errorLines.length, 'no error output') + t.end() + }) +}) + +test('cleanup', function (t) { + // windows fix for locked files + process.chdir(osenv.tmpdir()) + + rimraf.sync(pkg) + t.end() +}) + +function setup () { + mkdirp.sync(pkg) + mkdirp.sync(cache) + process.chdir(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/version-lifecycle.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/version-lifecycle.js new file mode 100644 index 00000000..5d78b71d --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/version-lifecycle.js @@ -0,0 +1,174 @@ +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') +var npm = require('../../') +var pkg = path.resolve(__dirname, 'version-lifecycle') +var cache = path.resolve(pkg, 'cache') +var npmrc = path.resolve(pkg, './.npmrc') +var configContents = 'sign-git-tag=false\n' + +test('npm version <semver> with failing preversion lifecycle script', function (t) { + setup() + fs.writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify({ + author: 'Alex Wolfe', + name: 'version-lifecycle', + version: '0.0.0', + description: 'Test for npm version if preversion script fails', + scripts: { + preversion: './fail.sh' + } + }), 'utf8') + fs.writeFileSync(path.resolve(pkg, 'fail.sh'), 'exit 50', 'utf8') + fs.chmodSync(path.resolve(pkg, 'fail.sh'), 448) + npm.load({cache: cache, 'sign-git-tag': false, registry: common.registry}, function () { + var version = require('../../lib/version') + version(['patch'], function (err) { + t.ok(err) + t.ok(err.message.match(/Exit status 50/)) + t.end() + }) + }) +}) + +test('npm version <semver> with failing version lifecycle script', function (t) { + setup() + fs.writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify({ + author: 'Alex Wolfe', + name: 'version-lifecycle', + version: '0.0.0', + description: 'Test for npm version if postversion script fails', + scripts: { + version: './fail.sh' + } + }), 'utf8') + fs.writeFileSync(path.resolve(pkg, 'fail.sh'), 'exit 50', 'utf8') + fs.chmodSync(path.resolve(pkg, 'fail.sh'), 448) + npm.load({cache: cache, 'sign-git-tag': false, registry: common.registry}, function () { + var version = require('../../lib/version') + version(['patch'], function (err) { + t.ok(err) + t.ok(err.message.match(/Exit status 50/)) + t.end() + }) + }) +}) + +test('npm version <semver> with failing postversion lifecycle script', function (t) { + setup() + fs.writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify({ + author: 'Alex Wolfe', + name: 'version-lifecycle', + version: '0.0.0', + description: 'Test for npm version if postversion script fails', + scripts: { + postversion: './fail.sh' + } + }), 'utf8') + fs.writeFileSync(path.resolve(pkg, 'fail.sh'), 'exit 50', 'utf8') + fs.chmodSync(path.resolve(pkg, 'fail.sh'), 448) + npm.load({cache: cache, 'sign-git-tag': false, registry: common.registry}, function () { + var version = require('../../lib/version') + version(['patch'], function (err) { + t.ok(err) + t.ok(err.message.match(/Exit status 50/)) + t.end() + }) + }) +}) + +test('npm version <semver> execution order', function (t) { + setup() + fs.writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify({ + author: 'Alex Wolfe', + name: 'version-lifecycle', + version: '0.0.0', + description: 'Test for npm version if postversion script fails', + scripts: { + preversion: './preversion.sh', + version: './version.sh', + postversion: './postversion.sh' + } + }), 'utf8') + makeScript('preversion') + makeScript('version') + makeScript('postversion') + npm.load({cache: cache, 'sign-git-tag': false, registry: common.registry}, function () { + common.makeGitRepo({path: pkg}, function (err, git) { + t.ifError(err, 'git bootstrap ran without error') + + var version = require('../../lib/version') + version(['patch'], function (err) { + t.ifError(err, 'version command complete') + + t.equal('0.0.0', readPackage('preversion').version, 'preversion') + t.deepEqual(readStatus('preversion', t), { + 'preversion-package.json': 'A' + }) + + t.equal('0.0.1', readPackage('version').version, 'version') + t.deepEqual(readStatus('version', t), { + 'package.json': 'M', + 'preversion-package.json': 'A', + 'version-package.json': 'A' + }) + + t.equal('0.0.1', readPackage('postversion').version, 'postversion') + t.deepEqual(readStatus('postversion', t), { + 'postversion-package.json': 'A' + }) + t.end() + }) + }) + }) +}) + +test('cleanup', function (t) { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) + t.end() +}) + +function setup () { + mkdirp.sync(pkg) + mkdirp.sync(path.join(pkg, 'node_modules')) + mkdirp.sync(cache) + fs.writeFileSync(npmrc, configContents, 'ascii') + process.chdir(pkg) +} + +function makeScript (lifecycle) { + var contents = [ + 'cp package.json ' + lifecycle + '-package.json', + 'git add ' + lifecycle + '-package.json', + 'git status --porcelain > ' + lifecycle + '-git.txt' + ].join('\n') + var scriptPath = path.join(pkg, lifecycle + '.sh') + fs.writeFileSync(scriptPath, contents, 'utf-8') + fs.chmodSync(scriptPath, 448) +} + +function readPackage (lifecycle) { + return JSON.parse(fs.readFileSync(path.join(pkg, lifecycle + '-package.json'), 'utf-8')) +} + +function readStatus (lifecycle, t) { + var status = {} + fs.readFileSync(path.join(pkg, lifecycle + '-git.txt'), 'utf-8') + .trim() + .split('\n') + .forEach(function (line) { + line = line.trim() + if (line && !line.match(/^\?\? /)) { + var parts = line.split(/\s+/) + t.equal(parts.length, 2, lifecycle + ' : git status has too many words : ' + line) + status[parts[1].trim()] = parts[0].trim() + } + }) + return status +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/version-message-config.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/version-message-config.js new file mode 100644 index 00000000..fca0d5d9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/version-message-config.js @@ -0,0 +1,76 @@ +var common = require('../common-tap.js') +var fs = require('fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var npm = require('../../lib/npm.js') + +var pkg = path.resolve(__dirname, 'version-message-config') +var cache = path.resolve(pkg, 'cache') +var npmrc = path.resolve(pkg, '.npmrc') +var packagePath = path.resolve(pkg, 'package.json') + +var json = { name: 'blah', version: '0.1.2' } + +var configContents = 'sign-git-tag=false\nmessage=":bookmark: %s"\n' + +test('npm version <semver> with message config', function (t) { + setup() + + npm.load({ prefix: pkg, userconfig: npmrc }, function () { + var git = require('../../lib/utils/git.js') + + common.makeGitRepo({ path: pkg }, function (er) { + t.ifErr(er, 'git bootstrap ran without error') + + common.npm( + [ + 'version', + 'patch', + '--loglevel', 'silent' + // package config is picked up from env + ], + { cwd: pkg, env: { PATH: process.env.PATH } }, + function (err, code, stdout, stderr) { + t.ifError(err, 'npm version ran without issue') + t.notOk(code, 'exited with a non-error code') + t.notOk(stderr, 'no error output') + + git.whichAndExec( + ['log'], + { cwd: pkg, env: process.env }, + function (er, log, stderr) { + t.ok(log.match(/:bookmark: 0\.1\.3/g), 'config was picked up by version') + t.end() + } + ) + } + ) + }) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + // windows fix for locked files + process.chdir(osenv.tmpdir()) + + rimraf.sync(pkg) +} + +function setup () { + cleanup() + mkdirp.sync(cache) + process.chdir(pkg) + + fs.writeFileSync(packagePath, JSON.stringify(json), 'utf8') + fs.writeFileSync(npmrc, configContents, 'ascii') +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/version-no-git.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/version-no-git.js new file mode 100644 index 00000000..0acd0ab6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/version-no-git.js @@ -0,0 +1,54 @@ +var common = require("../common-tap.js") +var test = require("tap").test +var npm = require("../../") +var osenv = require("osenv") +var path = require("path") +var fs = require("fs") +var mkdirp = require("mkdirp") +var rimraf = require("rimraf") +var requireInject = require("require-inject") + +var pkg = path.resolve(__dirname, "version-no-git") +var cache = path.resolve(pkg, "cache") +var gitDir = path.resolve(pkg, ".git") + +test("npm version <semver> in a git repo without the git binary", function(t) { + setup() + npm.load({cache: cache, registry: common.registry}, function() { + var version = requireInject("../../lib/version", { + which: function(cmd, cb) { + process.nextTick(function() { + cb(new Error('ENOGIT!')) + }) + } + }) + + version(["patch"], function(err) { + if (! t.error(err)) return t.end() + var p = path.resolve(pkg, "package") + var testPkg = require(p) + t.equal("0.0.1", testPkg.version, "\"" + testPkg.version+"\" === \"0.0.1\"") + t.end() + }) + }) +}) + +test("cleanup", function(t) { + process.chdir(osenv.tmpdir()) + + rimraf.sync(pkg) + t.end() +}) + +function setup() { + mkdirp.sync(pkg) + mkdirp.sync(cache) + mkdirp.sync(gitDir) + fs.writeFileSync(path.resolve(pkg, "package.json"), JSON.stringify({ + author: "Terin Stock", + name: "version-no-git-test", + version: "0.0.0", + description: "Test for npm version if git binary doesn't exist" + }), "utf8") + process.chdir(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/version-no-package.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/version-no-package.js new file mode 100644 index 00000000..678ce177 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/version-no-package.js @@ -0,0 +1,45 @@ +var common = require("../common-tap.js") +var test = require("tap").test +var osenv = require("osenv") +var path = require("path") +var mkdirp = require("mkdirp") +var rimraf = require("rimraf") + +var pkg = path.resolve(__dirname, "version-no-package") + +test("setup", function (t) { + setup() + t.end() +}) + +test("npm version in a prefix with no package.json", function(t) { + setup() + common.npm( + ["version", "--json", "--prefix", pkg], + { cwd : pkg }, + function (er, code, stdout, stderr) { + t.ifError(er, "npm version doesn't care that there's no package.json") + t.notOk(code, "npm version ran without barfing") + t.ok(stdout, "got version output") + t.notOk(stderr, "no error output") + t.doesNotThrow(function () { + var metadata = JSON.parse(stdout) + t.equal(metadata.node, process.versions.node, "node versions match") + + }, "able to reconstitute version object from stdout") + t.end() + } + ) +}) + +test("cleanup", function(t) { + process.chdir(osenv.tmpdir()) + + rimraf.sync(pkg) + t.end() +}) + +function setup() { + mkdirp.sync(pkg) + process.chdir(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/version-no-tags.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/version-no-tags.js new file mode 100644 index 00000000..cb6f195f --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/version-no-tags.js @@ -0,0 +1,71 @@ +var common = require("../common-tap.js") +var test = require("tap").test +var npm = require("../../") +var osenv = require("osenv") +var path = require("path") +var fs = require("fs") +var rimraf = require("rimraf") +var mkdirp = require("mkdirp") +var which = require("which") +var spawn = require("child_process").spawn + +var pkg = path.resolve(__dirname, "version-no-tags") +var cache = path.resolve(pkg, "cache") + +test("npm version <semver> without git tag", function (t) { + setup() + npm.load({ cache: cache, registry: common.registry}, function () { + which("git", function (err, git) { + t.ifError(err, "git found on system") + function tagExists(tag, _cb) { + var child1 = spawn(git, ["tag", "-l", tag]) + var out = "" + child1.stdout.on("data", function (d) { + out += d.toString() + }) + child1.on("exit", function () { + return _cb(null, Boolean(~out.indexOf(tag))) + }) + } + + var child2 = spawn(git, ["init"]) + child2.stdout.pipe(process.stdout) + child2.on("exit", function () { + npm.config.set("git-tag-version", false) + npm.commands.version(["patch"], function (err) { + if (err) return t.fail("Error perform version patch") + var p = path.resolve(pkg, "package") + var testPkg = require(p) + if (testPkg.version !== "0.0.1") t.fail(testPkg.version+" !== \"0.0.1\"") + t.equal("0.0.1", testPkg.version) + tagExists("v0.0.1", function (err, exists) { + t.ifError(err, "tag found to exist") + t.equal(exists, false, "git tag DOES exist") + t.pass("git tag does not exist") + t.end() + }) + }) + }) + }) + }) +}) + +test("cleanup", function (t) { + // windows fix for locked files + process.chdir(osenv.tmpdir()) + + rimraf.sync(pkg) + t.end() +}) + +function setup() { + mkdirp.sync(pkg) + mkdirp.sync(cache) + fs.writeFileSync(path.resolve(pkg, "package.json"), JSON.stringify({ + author: "Evan Lucas", + name: "version-no-tags-test", + version: "0.0.0", + description: "Test for git-tag-version flag" + }), "utf8") + process.chdir(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/version-sub-directory.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/version-sub-directory.js new file mode 100644 index 00000000..52074a18 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/version-sub-directory.js @@ -0,0 +1,74 @@ +var common = require('../common-tap.js') +var fs = require('fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var npm = require('../../lib/npm.js') + +var pkg = path.resolve(__dirname, 'version-sub-directory') +var subDirectory = path.resolve(pkg, 'sub-directory') +var packagePath = path.resolve(pkg, 'package.json') +var cache = path.resolve(pkg, 'cache') + +var json = { name: 'cat', version: '0.1.2' } + +test('npm version <semver> from a subdirectory', function (t) { + setup() + npmLoad() + + function npmLoad () { + npm.load({ cache: cache }, function () { + common.makeGitRepo({ + path: pkg, + added: ['package.json'] + }, version) + }) + } + + function version (er, stdout, stderr) { + t.ifError(er, 'git repo initialized without issue') + t.notOk(stderr, 'no error output') + npm.config.set('sign-git-tag', false) + npm.commands.version(['patch'], checkVersion) + } + + function checkVersion (er) { + var git = require('../../lib/utils/git.js') + t.ifError(er, 'version command ran without error') + git.whichAndExec( + ['log'], + { cwd: pkg, env: process.env }, + checkCommit + ) + } + + function checkCommit (er, log, stderr) { + t.ifError(er, 'git log ran without issue') + t.notOk(stderr, 'no error output') + t.ok(log.match(/0\.1\.3/g), 'commited from subdirectory') + t.end() + } +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + // windows fix for locked files + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} + +function setup () { + cleanup() + mkdirp.sync(cache) + mkdirp.sync(subDirectory) + process.chdir(subDirectory) + fs.writeFileSync(packagePath, JSON.stringify(json), 'utf8') +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/version-update-shrinkwrap.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/version-update-shrinkwrap.js new file mode 100644 index 00000000..acf6cca8 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/version-update-shrinkwrap.js @@ -0,0 +1,134 @@ +var fs = require('fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var npm = require('../../') +var common = require('../common-tap.js') + +var pkg = path.resolve(__dirname, 'version-shrinkwrap') +var cache = path.resolve(pkg, 'cache') + +test('npm version <semver> updates shrinkwrap - no git', function (t) { + setup() + npm.load({ cache: pkg + '/cache', registry: common.registry }, function () { + npm.commands.version(['patch'], function (err) { + if (err) return t.fail('Error perform version patch') + var shrinkwrap = require(path.resolve(pkg, 'npm-shrinkwrap.json')) + t.equal(shrinkwrap.version, '0.0.1', 'got expected version') + t.end() + }) + }) +}) + +test('npm version <semver> updates git works with no shrinkwrap', function (t) { + setup() + rimraf.sync(path.resolve(pkg, 'npm-shrinkwrap.json')) + + npm.config.set('sign-git-tag', false) + + common.makeGitRepo({ + path: pkg, + added: ['package.json'] + }, version) + + function version (er, stdout, stderr) { + t.ifError(er, 'git repo initialized without issue') + t.notOk(stderr, 'no error output') + + npm.commands.version(['patch'], checkCommit) + } + + function checkCommit (er) { + t.ifError(er, 'version command ran without error') + + var shrinkwrap = require(path.resolve(pkg, 'npm-shrinkwrap.json')) + t.equal(shrinkwrap.version, '0.0.1', 'got expected version') + + var opts = { cwd: pkg, env: { PATH: process.env.PATH }} + var git = require('../../lib/utils/git.js') + git.whichAndExec( + ['show', 'HEAD', '--name-only'], + opts, + function (er, stdout, stderr) { + t.ifError(er, 'git show ran without issues') + t.notOk(stderr, 'no error output') + + var lines = stdout.split('\n') + t.notEqual(lines.indexOf('package.json'), -1, 'package.json commited') + t.equal(lines.indexOf('npm-shrinkwrap.json'), -1, 'npm-shrinkwrap.json not present') + + t.end() + } + ) + } +}) + +test('npm version <semver> updates shrinkwrap and updates git', function (t) { + setup() + + npm.config.set('sign-git-tag', false) + + common.makeGitRepo({ + path: pkg, + added: ['package.json', 'npm-shrinkwrap.json'] + }, version) + + function version (er, stdout, stderr) { + t.ifError(er, 'git repo initialized without issue') + t.notOk(stderr, 'no error output') + + npm.commands.version(['patch'], checkCommit) + } + + function checkCommit (er) { + t.ifError(er, 'version command ran without error') + + var shrinkwrap = require(path.resolve(pkg, 'npm-shrinkwrap.json')) + t.equal(shrinkwrap.version, '0.0.1', 'got expected version') + + var git = require('../../lib/utils/git.js') + var opts = { cwd: pkg, env: { PATH: process.env.PATH }} + git.whichAndExec( + ['show', 'HEAD', '--name-only'], + opts, + function (er, stdout, stderr) { + t.ifError(er, 'git show ran without issues') + t.notOk(stderr, 'no error output') + + var lines = stdout.split('\n') + t.notEqual(lines.indexOf('package.json'), -1, 'package.json commited') + t.notEqual(lines.indexOf('npm-shrinkwrap.json'), -1, 'npm-shrinkwrap.json commited') + + t.end() + } + ) + } +}) + +test('cleanup', function (t) { + // windows fix for locked files + process.chdir(osenv.tmpdir()) + + rimraf.sync(pkg) + t.end() +}) + +function setup () { + rimraf.sync(pkg) + mkdirp.sync(pkg) + mkdirp.sync(cache) + var contents = { + author: 'Nathan Bowser && Faiq Raza', + name: 'version-with-shrinkwrap-test', + version: '0.0.0', + description: 'Test for version with shrinkwrap update' + } + + fs.writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify(contents), 'utf8') + fs.writeFileSync(path.resolve(pkg, 'npm-shrinkwrap.json'), JSON.stringify(contents), 'utf8') + process.chdir(pkg) +} diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/view.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/view.js new file mode 100644 index 00000000..dcfd2810 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/view.js @@ -0,0 +1,317 @@ +var common = require("../common-tap.js") +var test = require("tap").test +var osenv = require("osenv") +var path = require("path") +var fs = require("fs") +var rimraf = require("rimraf") +var mkdirp = require("mkdirp") +var tmp = osenv.tmpdir() +var t1dir = path.resolve(tmp, "view-local-no-pkg") +var t2dir = path.resolve(tmp, "view-local-notmine") +var t3dir = path.resolve(tmp, "view-local-mine") +var mr = require("npm-registry-mock") + +test("setup", function (t) { + mkdirp.sync(t1dir) + mkdirp.sync(t2dir) + mkdirp.sync(t3dir) + + fs.writeFileSync(t2dir + "/package.json", JSON.stringify({ + author: "Evan Lucas" + , name: "test-repo-url-https" + , version: "0.0.1" + }), "utf8") + + fs.writeFileSync(t3dir + "/package.json", JSON.stringify({ + author: "Evan Lucas" + , name: "biscuits" + , version: "0.0.1" + }), "utf8") + + t.pass("created fixtures") + t.end() +}) + +function plugin (server) { + server + .get("/biscuits") + .many() + .reply(404, {"error": "version not found"}) +} + +test("npm view . in global mode", function (t) { + process.chdir(t1dir) + common.npm([ + "view" + , "." + , "--registry=" + common.registry + , "--global" + ], { cwd: t1dir }, function (err, code, stdout, stderr) { + t.ifError(err, "view command finished successfully") + t.equal(code, 1, "exit not ok") + t.similar(stderr, /Cannot use view command in global mode./m) + t.end() + }) +}) + +test("npm view --global", function(t) { + process.chdir(t1dir) + common.npm([ + "view" + , "--registry=" + common.registry + , "--global" + ], { cwd: t1dir }, function(err, code, stdout, stderr) { + t.ifError(err, "view command finished successfully") + t.equal(code, 1, "exit not ok") + t.similar(stderr, /Cannot use view command in global mode./m) + t.end() + }) +}) + +test("npm view . with no package.json", function(t) { + process.chdir(t1dir) + common.npm([ + "view" + , "." + , "--registry=" + common.registry + ], { cwd: t1dir }, function (err, code, stdout, stderr) { + t.ifError(err, "view command finished successfully") + t.equal(code, 1, "exit not ok") + t.similar(stderr, /Invalid package.json/m) + t.end() + }) +}) + +test("npm view . with no published package", function (t) { + process.chdir(t3dir) + mr({port : common.port, plugin : plugin}, function (er, s) { + common.npm([ + "view" + , "." + , "--registry=" + common.registry + ], { cwd: t3dir }, function (err, code, stdout, stderr) { + t.ifError(err, "view command finished successfully") + t.equal(code, 1, "exit not ok") + t.similar(stderr, /version not found/m) + s.close() + t.end() + }) + }) +}) + +test("npm view .", function (t) { + process.chdir(t2dir) + mr({port : common.port, plugin : plugin}, function (er, s) { + common.npm([ + "view" + , "." + , "--registry=" + common.registry + ], { cwd: t2dir }, function (err, code, stdout) { + t.ifError(err, "view command finished successfully") + t.equal(code, 0, "exit ok") + var re = new RegExp("name: 'test-repo-url-https'") + t.similar(stdout, re) + s.close() + t.end() + }) + }) +}) + +test("npm view . select fields", function (t) { + process.chdir(t2dir) + mr({port : common.port, plugin : plugin}, function (er, s) { + common.npm([ + "view" + , "." + , "main" + , "--registry=" + common.registry + ], { cwd: t2dir }, function (err, code, stdout) { + t.ifError(err, "view command finished successfully") + t.equal(code, 0, "exit ok") + t.equal(stdout.trim(), "index.js", "should print `index.js`") + s.close() + t.end() + }) + }) +}) + +test("npm view .@<version>", function (t) { + process.chdir(t2dir) + mr({port : common.port, plugin : plugin}, function (er, s) { + common.npm([ + "view" + , ".@0.0.0" + , "version" + , "--registry=" + common.registry + ], { cwd: t2dir }, function (err, code, stdout) { + t.ifError(err, "view command finished successfully") + t.equal(code, 0, "exit ok") + t.equal(stdout.trim(), "0.0.0", "should print `0.0.0`") + s.close() + t.end() + }) + }) +}) + +test("npm view .@<version> --json", function (t) { + process.chdir(t2dir) + mr({port : common.port, plugin : plugin}, function (er, s) { + common.npm([ + "view" + , ".@0.0.0" + , "version" + , "--json" + , "--registry=" + common.registry + ], { cwd: t2dir }, function (err, code, stdout) { + t.ifError(err, "view command finished successfully") + t.equal(code, 0, "exit ok") + t.equal(stdout.trim(), "\"0.0.0\"", "should print `\"0.0.0\"`") + s.close() + t.end() + }) + }) +}) + +test("npm view <package name>", function (t) { + mr({port : common.port, plugin : plugin}, function (er, s) { + common.npm([ + "view" + , "underscore" + , "--registry=" + common.registry + ], { cwd: t2dir }, function (err, code, stdout) { + t.ifError(err, "view command finished successfully") + t.equal(code, 0, "exit ok") + var re = new RegExp("name: 'underscore'") + t.similar(stdout, re, "should have name `underscore`") + s.close() + t.end() + }) + }) +}) + +test("npm view <package name> --global", function(t) { + mr({port : common.port, plugin : plugin}, function (er, s) { + common.npm([ + "view" + , "underscore" + , "--global" + , "--registry=" + common.registry + ], { cwd: t2dir }, function(err, code, stdout) { + t.ifError(err, "view command finished successfully") + t.equal(code, 0, "exit ok") + var re = new RegExp("name: 'underscore'") + t.similar(stdout, re, "should have name `underscore`") + s.close() + t.end() + }) + }) +}) + +test("npm view <package name> --json", function(t) { + t.plan(3) + mr({port : common.port, plugin : plugin}, function (er, s) { + common.npm([ + "view" + , "underscore" + , "--json" + , "--registry=" + common.registry + ], { cwd: t2dir }, function (err, code, stdout) { + t.ifError(err, "view command finished successfully") + t.equal(code, 0, "exit ok") + s.close() + try { + var out = JSON.parse(stdout.trim()) + t.similar(out, { + maintainers: "jashkenas <jashkenas@gmail.com>" + }, "should have the same maintainer") + } + catch (er) { + t.fail("Unable to parse JSON") + } + }) + }) +}) + +test("npm view <package name> <field>", function (t) { + mr({port : common.port, plugin : plugin}, function (er, s) { + common.npm([ + "view" + , "underscore" + , "homepage" + , "--registry=" + common.registry + ], { cwd: t2dir }, function (err, code, stdout) { + t.ifError(err, "view command finished successfully") + t.equal(code, 0, "exit ok") + t.equal(stdout.trim(), "http://underscorejs.org", + "homepage should equal `http://underscorejs.org`") + s.close() + t.end() + }) + }) +}) + +test("npm view with invalid package name", function (t) { + var invalidName = "InvalidPackage" + obj = {} + obj["/" + invalidName] = [404, {"error": "not found"}] + + mr({port : common.port, mocks: {"get": obj}}, function (er, s) { + common.npm([ + "view" + , invalidName + , "--registry=" + common.registry + ], {}, function (err, code, stdout, stderr) { + t.ifError(err, "view command finished successfully") + t.equal(code, 1, "exit not ok") + + t.similar(stderr, new RegExp("is not in the npm registry"), + "Package should NOT be found") + + t.dissimilar(stderr, new RegExp("use the name yourself!"), + "Suggestion should not be there") + + t.similar(stderr, new RegExp("name can no longer contain capital letters"), + "Suggestion about Capital letter should be there") + + s.close() + t.end() + }) + }) +}) + + +test("npm view with valid but non existent package name", function (t) { + mr({port : common.port, mocks: { + "get": { + "/valid-but-non-existent-package" : [404, {"error": "not found"}] + } + }}, function (er, s) { + common.npm([ + "view" + , "valid-but-non-existent-package" + , "--registry=" + common.registry + ], {}, function (err, code, stdout, stderr) { + t.ifError(err, "view command finished successfully") + t.equal(code, 1, "exit not ok") + + t.similar(stderr, + new RegExp("'valid-but-non-existent-package' is not in the npm registry\."), + "Package should NOT be found") + + t.similar(stderr, new RegExp("use the name yourself!"), + "Suggestion should be there") + + s.close() + t.end() + }) + }) +}) + +test("cleanup", function (t) { + process.chdir(osenv.tmpdir()) + rimraf.sync(t1dir) + rimraf.sync(t2dir) + rimraf.sync(t3dir) + t.pass("cleaned up") + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/whoami.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/whoami.js new file mode 100644 index 00000000..558d0db9 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/whoami.js @@ -0,0 +1,77 @@ +var common = require("../common-tap.js") + +var fs = require("fs") +var path = require("path") +var createServer = require("http").createServer + +var test = require("tap").test +var rimraf = require("rimraf") + +var opts = { cwd: __dirname } + +var FIXTURE_PATH = path.resolve(__dirname, "fixture_npmrc") + +test("npm whoami with basic auth", function (t) { + var s = "//registry.lvh.me/:username = wombat\n" + + "//registry.lvh.me/:_password = YmFkIHBhc3N3b3Jk\n" + + "//registry.lvh.me/:email = lindsay@wdu.org.au\n" + fs.writeFileSync(FIXTURE_PATH, s, "ascii") + fs.chmodSync(FIXTURE_PATH, "0444") + + common.npm( + [ + "whoami", + "--userconfig=" + FIXTURE_PATH, + "--registry=http://registry.lvh.me/" + ], + opts, + function (err, code, stdout, stderr) { + t.ifError(err) + + t.equal(stderr, "", "got nothing on stderr") + t.equal(code, 0, "exit ok") + t.equal(stdout, "wombat\n", "got username") + rimraf.sync(FIXTURE_PATH) + t.end() + } + ) +}) + +test("npm whoami with bearer auth", {timeout : 2 * 1000}, function (t) { + var s = "//localhost:" + common.port + + "/:_authToken = wombat-developers-union\n" + fs.writeFileSync(FIXTURE_PATH, s, "ascii") + fs.chmodSync(FIXTURE_PATH, "0444") + + function verify(req, res) { + t.equal(req.method, "GET") + t.equal(req.url, "/-/whoami") + + res.setHeader("content-type", "application/json") + res.writeHeader(200) + res.end(JSON.stringify({username : "wombat"}), "utf8") + } + + var server = createServer(verify) + + server.listen(common.port, function () { + common.npm( + [ + "whoami", + "--userconfig=" + FIXTURE_PATH, + "--registry=http://localhost:" + common.port + "/" + ], + opts, + function (err, code, stdout, stderr) { + t.ifError(err) + + t.equal(stderr, "", "got nothing on stderr") + t.equal(code, 0, "exit ok") + t.equal(stdout, "wombat\n", "got username") + rimraf.sync(FIXTURE_PATH) + server.close() + t.end() + } + ) + }) +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/zz-cleanup.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/zz-cleanup.js new file mode 100644 index 00000000..c491cbf0 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/test/tap/zz-cleanup.js @@ -0,0 +1,8 @@ +var common = require("../common-tap") +var test = require("tap").test +var rimraf = require("rimraf") + +test("cleanup", function (t) { + rimraf.sync(common.npm_config_cache) + t.end() +}) diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/wercker.yml b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/wercker.yml new file mode 100644 index 00000000..f944a955 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/wercker.yml @@ -0,0 +1,22 @@ +box: wercker/nodejs +# Build definition +build: + # The steps that will be executed on build + steps: + # A step that executes `npm install` command + - npm-install + # A step that executes `npm test` command + - npm-test + + # A custom script step, name value is used in the UI + # and the code value contains the command that get executed + - script: + name: echo nodejs information + code: | + echo "node version $(node -v) running" + echo "npm version $(npm -v) running" + after-steps: + - sherzberg/slack-notify: + subdomain: npm-inc + token: $SLACK_TOKEN + channel: github-commits diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_perfctr_provider.man b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_perfctr_provider.man new file mode 100644 index 00000000..2f77e332 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_perfctr_provider.man @@ -0,0 +1,107 @@ +<instrumentationManifest + xmlns="http://schemas.microsoft.com/win/2004/08/events" + xmlns:win="http://manifests.microsoft.com/win/2004/08/windows/events" + xmlns:xs="http://www.w3.org/2001/XMLSchema"> + <instrumentation> + <counters xmlns="http://schemas.microsoft.com/win/2005/12/counters" + schemaVersion="1.1"> + <provider symbol="NodeCounterProvider" + applicationIdentity="node.exe" + providerType="userMode" + providerGuid="{793C9B44-3D6B-4F57-B5D7-4FF80ADCF9A2}"> + <counterSet symbol="NodeCounterSet" + guid="{3A22A8EC-297C-48AC-AB15-33EC93033FD8}" + uri="Microsoft.Windows.System.PerfCounters.NodeCounterSet" + name="Node.js" + description="Node.js performance counters" + instances="multipleAggregate"> + + <counter id="1" + uri="Microsoft.Windows.System.PerfCounters.NodeCounterSet.httpsrvreq" + name="HTTP server requests" + description="Number of HTTP server requests" + type="perf_counter_counter" + detailLevel="standard" + aggregate="sum" /> + + <counter id="2" + uri="Microsoft.Windows.System.PerfCounters.NodeCounterSet.httpsrvrsp" + name="HTTP server responses" + description="Number of HTTP server responses" + type="perf_counter_counter" + detailLevel="standard" + aggregate="sum" /> + + <counter id="3" + uri="Microsoft.Windows.System.PerfCounters.NodeCounterSet.httpclireq" + name="HTTP client requests" + description="Number of HTTP client requests" + type="perf_counter_counter" + detailLevel="standard" + aggregate="sum" /> + + <counter id="4" + uri="Microsoft.Windows.System.PerfCounters.NodeCounterSet.httpclirsp" + name="HTTP client responses" + description="Number of HTTP client responses" + type="perf_counter_counter" + detailLevel="standard" + aggregate="sum" /> + + <counter id="5" + uri="Microsoft.Windows.System.PerfCounters.NodeCounterSet.netsrvconn" + name="Active server connections" + description="Number of server connections" + type="perf_counter_rawcount" + detailLevel="standard" + aggregate="sum" /> + + <counter id="6" + uri="Microsoft.Windows.System.PerfCounters.NodeCounterSet.netbytesent" + name="Network bytes sent" + description="Number of bytes sent using TCP" + type="perf_counter_bulk_count" + detailLevel="standard" + defaultScale="-3" + aggregate="sum" /> + + <counter id="7" + uri="Microsoft.Windows.System.PerfCounters.NodeCounterSet.netbyterecv" + name="Network bytes received" + description="Number of bytes received using TCP" + type="perf_counter_bulk_count" + detailLevel="standard" + defaultScale="-3" + aggregate="sum" /> + + <counter id="8" + uri="Microsoft.Windows.System.PerfCounters.NodeCounterSet.gctime" + name="%Time in GC" + description="Percent of time for last GC" + type="perf_counter_rawcount" + detailLevel="standard" + aggregate="avg" /> + + <counter id="9" + uri="Microsoft.Windows.System.PerfCounters.NodeCounterSet.pipebytesent" + name="Pipe bytes sent" + description="Number of bytes sent using pipe" + type="perf_counter_bulk_count" + detailLevel="standard" + defaultScale="-3" + aggregate="sum" /> + + <counter id="10" + uri="Microsoft.Windows.System.PerfCounters.NodeCounterSet.pipebyterecv" + name="Pipe bytes received" + description="Number of bytes received using pipe" + type="perf_counter_bulk_count" + detailLevel="standard" + defaultScale="-3" + aggregate="sum" /> + + </counterSet> + </provider> + </counters> + </instrumentation> +</instrumentationManifest> diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/nodevars.bat b/org.simantics.maps.server/node/node-v4.8.0-win-x64/nodevars.bat new file mode 100644 index 00000000..c94c4460 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/nodevars.bat @@ -0,0 +1,24 @@ +@echo off + +rem Ensure this Node.js and npm are first in the PATH +set "PATH=%APPDATA%\npm;%~dp0;%PATH%" + +setlocal enabledelayedexpansion +pushd "%~dp0" + +rem Figure out the Node.js version. +set print_version=.\node.exe -p -e "process.versions.node + ' (' + process.arch + ')'" +for /F "usebackq delims=" %%v in (`%print_version%`) do set version=%%v + +rem Print message. +if exist npm.cmd ( + echo Your environment has been set up for using Node.js !version! and npm. +) else ( + echo Your environment has been set up for using Node.js !version!. +) + +popd +endlocal + +rem If we're in the Node.js directory, change to the user's home dir. +if "%CD%\"=="%~dp0" cd /d "%HOMEDRIVE%%HOMEPATH%" diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/npm b/org.simantics.maps.server/node/node-v4.8.0-win-x64/npm new file mode 100644 index 00000000..5acd6fb6 --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/npm @@ -0,0 +1,34 @@ +#!/bin/sh +(set -o igncr) 2>/dev/null && set -o igncr; # cygwin encoding fix + +basedir=`dirname "$0"` + +case `uname` in + *CYGWIN*) basedir=`cygpath -w "$basedir"`;; +esac + +NODE_EXE="$basedir/node.exe" +if ! [ -x "$NODE_EXE" ]; then + NODE_EXE=node +fi + +NPM_CLI_JS="$basedir/node_modules/npm/bin/npm-cli.js" + +case `uname` in + *MINGW*) + NPM_PREFIX=`"$NODE_EXE" "$NPM_CLI_JS" prefix -g` + NPM_PREFIX_NPM_CLI_JS="$NPM_PREFIX/node_modules/npm/bin/npm-cli.js" + if [ -f "$NPM_PREFIX_NPM_CLI_JS" ]; then + NPM_CLI_JS="$NPM_PREFIX_NPM_CLI_JS" + fi + ;; + *CYGWIN*) + NPM_PREFIX=`"$NODE_EXE" "$NPM_CLI_JS" prefix -g` + NPM_PREFIX_NPM_CLI_JS="$NPM_PREFIX/node_modules/npm/bin/npm-cli.js" + if [ -f "$NPM_PREFIX_NPM_CLI_JS" ]; then + NPM_CLI_JS="$NPM_PREFIX_NPM_CLI_JS" + fi + ;; +esac + +"$NODE_EXE" "$NPM_CLI_JS" "$@" diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/npm.cmd b/org.simantics.maps.server/node/node-v4.8.0-win-x64/npm.cmd new file mode 100644 index 00000000..880554dc --- /dev/null +++ b/org.simantics.maps.server/node/node-v4.8.0-win-x64/npm.cmd @@ -0,0 +1,19 @@ +:: Created by npm, please don't edit manually. +@ECHO OFF + +SETLOCAL + +SET "NODE_EXE=%~dp0\node.exe" +IF NOT EXIST "%NODE_EXE%" ( + SET "NODE_EXE=node" +) + +SET "NPM_CLI_JS=%~dp0\node_modules\npm\bin\npm-cli.js" +FOR /F "delims=" %%F IN ('CALL "%NODE_EXE%" "%NPM_CLI_JS%" prefix -g') DO ( + SET "NPM_PREFIX_NPM_CLI_JS=%%F\node_modules\npm\bin\npm-cli.js" +) +IF EXIST "%NPM_PREFIX_NPM_CLI_JS%" ( + SET "NPM_CLI_JS=%NPM_PREFIX_NPM_CLI_JS%" +) + +"%NODE_EXE%" "%NPM_CLI_JS%" %* diff --git a/org.simantics.maps.server/server/config.json b/org.simantics.maps.server/server/config.json new file mode 100644 index 00000000..5470a961 --- /dev/null +++ b/org.simantics.maps.server/server/config.json @@ -0,0 +1,8 @@ +{ + "/mapbox-studio-light.tm2" : { + "source" : "tmstyle://../tm2\\mapbox-studio-light.tm2" + }, + "/mapbox-studio-osm-bright.tm2" : { + "source" : "tmstyle://../tm2\\mapbox-studio-osm-bright.tm2" + } +} \ No newline at end of file diff --git a/org.simantics.maps.server/server/data/helsinki_finland.mbtiles b/org.simantics.maps.server/server/data/helsinki_finland.mbtiles new file mode 100644 index 00000000..cd79328d Binary files /dev/null and b/org.simantics.maps.server/server/data/helsinki_finland.mbtiles differ diff --git a/org.simantics.maps.server/server/fonts/Arial-Bold.ttf b/org.simantics.maps.server/server/fonts/Arial-Bold.ttf new file mode 100644 index 00000000..940e255d Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Arial-Bold.ttf differ diff --git a/org.simantics.maps.server/server/fonts/Arial-Regular.ttf b/org.simantics.maps.server/server/fonts/Arial-Regular.ttf new file mode 100644 index 00000000..ab68fb19 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Arial-Regular.ttf differ diff --git a/org.simantics.maps.server/server/fonts/Arial-Unicode-Bold-Italic.ttf b/org.simantics.maps.server/server/fonts/Arial-Unicode-Bold-Italic.ttf new file mode 100644 index 00000000..6a25d041 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Arial-Unicode-Bold-Italic.ttf differ diff --git a/org.simantics.maps.server/server/fonts/Arial-Unicode-Bold.ttf b/org.simantics.maps.server/server/fonts/Arial-Unicode-Bold.ttf new file mode 100644 index 00000000..5bae5504 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Arial-Unicode-Bold.ttf differ diff --git a/org.simantics.maps.server/server/fonts/Arial-Unicode-Italic.ttf b/org.simantics.maps.server/server/fonts/Arial-Unicode-Italic.ttf new file mode 100644 index 00000000..aca6aab8 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Arial-Unicode-Italic.ttf differ diff --git a/org.simantics.maps.server/server/fonts/Arial-Unicode-Regular.ttf b/org.simantics.maps.server/server/fonts/Arial-Unicode-Regular.ttf new file mode 100644 index 00000000..79b31cdd Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Arial-Unicode-Regular.ttf differ diff --git a/org.simantics.maps.server/server/fonts/Crimson-Bold.otf b/org.simantics.maps.server/server/fonts/Crimson-Bold.otf new file mode 100644 index 00000000..4f2551ef Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Crimson-Bold.otf differ diff --git a/org.simantics.maps.server/server/fonts/Crimson-BoldItalic.otf b/org.simantics.maps.server/server/fonts/Crimson-BoldItalic.otf new file mode 100644 index 00000000..0a489738 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Crimson-BoldItalic.otf differ diff --git a/org.simantics.maps.server/server/fonts/Crimson-Italic.otf b/org.simantics.maps.server/server/fonts/Crimson-Italic.otf new file mode 100644 index 00000000..59ed485e Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Crimson-Italic.otf differ diff --git a/org.simantics.maps.server/server/fonts/Crimson-Roman.otf b/org.simantics.maps.server/server/fonts/Crimson-Roman.otf new file mode 100644 index 00000000..5c01eacb Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Crimson-Roman.otf differ diff --git a/org.simantics.maps.server/server/fonts/Crimson-Semibold.otf b/org.simantics.maps.server/server/fonts/Crimson-Semibold.otf new file mode 100644 index 00000000..f2d7b249 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Crimson-Semibold.otf differ diff --git a/org.simantics.maps.server/server/fonts/Crimson-SemiboldItalic.otf b/org.simantics.maps.server/server/fonts/Crimson-SemiboldItalic.otf new file mode 100644 index 00000000..36fe38b0 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Crimson-SemiboldItalic.otf differ diff --git a/org.simantics.maps.server/server/fonts/DroidSerif-Bold.ttf b/org.simantics.maps.server/server/fonts/DroidSerif-Bold.ttf new file mode 100644 index 00000000..b6add0e4 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/DroidSerif-Bold.ttf differ diff --git a/org.simantics.maps.server/server/fonts/DroidSerif-BoldItalic.ttf b/org.simantics.maps.server/server/fonts/DroidSerif-BoldItalic.ttf new file mode 100644 index 00000000..921434f5 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/DroidSerif-BoldItalic.ttf differ diff --git a/org.simantics.maps.server/server/fonts/DroidSerif-Italic.ttf b/org.simantics.maps.server/server/fonts/DroidSerif-Italic.ttf new file mode 100644 index 00000000..1ef1f75e Binary files /dev/null and b/org.simantics.maps.server/server/fonts/DroidSerif-Italic.ttf differ diff --git a/org.simantics.maps.server/server/fonts/DroidSerif-Regular.ttf b/org.simantics.maps.server/server/fonts/DroidSerif-Regular.ttf new file mode 100644 index 00000000..239ba382 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/DroidSerif-Regular.ttf differ diff --git a/org.simantics.maps.server/server/fonts/KomikaHand-Italic.ttf b/org.simantics.maps.server/server/fonts/KomikaHand-Italic.ttf new file mode 100644 index 00000000..5299ef38 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/KomikaHand-Italic.ttf differ diff --git a/org.simantics.maps.server/server/fonts/KomikaTitle-Axis.ttf b/org.simantics.maps.server/server/fonts/KomikaTitle-Axis.ttf new file mode 100644 index 00000000..f667726c Binary files /dev/null and b/org.simantics.maps.server/server/fonts/KomikaTitle-Axis.ttf differ diff --git a/org.simantics.maps.server/server/fonts/KomikaTitle-Kaps.ttf b/org.simantics.maps.server/server/fonts/KomikaTitle-Kaps.ttf new file mode 100644 index 00000000..3761e467 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/KomikaTitle-Kaps.ttf differ diff --git a/org.simantics.maps.server/server/fonts/KomikaTitle-Paint.ttf b/org.simantics.maps.server/server/fonts/KomikaTitle-Paint.ttf new file mode 100644 index 00000000..933a1c87 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/KomikaTitle-Paint.ttf differ diff --git a/org.simantics.maps.server/server/fonts/KomikaTitle-Wide.ttf b/org.simantics.maps.server/server/fonts/KomikaTitle-Wide.ttf new file mode 100644 index 00000000..75e8df5f Binary files /dev/null and b/org.simantics.maps.server/server/fonts/KomikaTitle-Wide.ttf differ diff --git a/org.simantics.maps.server/server/fonts/KomikaTitle.ttf b/org.simantics.maps.server/server/fonts/KomikaTitle.ttf new file mode 100644 index 00000000..cd2a88b1 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/KomikaTitle.ttf differ diff --git a/org.simantics.maps.server/server/fonts/Komika_Hand.ttf b/org.simantics.maps.server/server/fonts/Komika_Hand.ttf new file mode 100644 index 00000000..bc49c946 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Komika_Hand.ttf differ diff --git a/org.simantics.maps.server/server/fonts/Komika_Hand_Bold.ttf b/org.simantics.maps.server/server/fonts/Komika_Hand_Bold.ttf new file mode 100644 index 00000000..21c67b2f Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Komika_Hand_Bold.ttf differ diff --git a/org.simantics.maps.server/server/fonts/Komika_Hand_Bold_Italic.ttf b/org.simantics.maps.server/server/fonts/Komika_Hand_Bold_Italic.ttf new file mode 100644 index 00000000..0d61ffe3 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Komika_Hand_Bold_Italic.ttf differ diff --git a/org.simantics.maps.server/server/fonts/Komika_Hand_Italic.ttf b/org.simantics.maps.server/server/fonts/Komika_Hand_Italic.ttf new file mode 100644 index 00000000..7bcaa31a Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Komika_Hand_Italic.ttf differ diff --git a/org.simantics.maps.server/server/fonts/Komika_Parch.ttf b/org.simantics.maps.server/server/fonts/Komika_Parch.ttf new file mode 100644 index 00000000..01317e19 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Komika_Parch.ttf differ diff --git a/org.simantics.maps.server/server/fonts/Lato-Bla.ttf b/org.simantics.maps.server/server/fonts/Lato-Bla.ttf new file mode 100644 index 00000000..6848db0d Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Lato-Bla.ttf differ diff --git a/org.simantics.maps.server/server/fonts/Lato-BlaIta.ttf b/org.simantics.maps.server/server/fonts/Lato-BlaIta.ttf new file mode 100644 index 00000000..5decf129 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Lato-BlaIta.ttf differ diff --git a/org.simantics.maps.server/server/fonts/Lato-Bol.ttf b/org.simantics.maps.server/server/fonts/Lato-Bol.ttf new file mode 100644 index 00000000..74343694 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Lato-Bol.ttf differ diff --git a/org.simantics.maps.server/server/fonts/Lato-BolIta.ttf b/org.simantics.maps.server/server/fonts/Lato-BolIta.ttf new file mode 100644 index 00000000..684aacf5 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Lato-BolIta.ttf differ diff --git a/org.simantics.maps.server/server/fonts/Lato-Hai.ttf b/org.simantics.maps.server/server/fonts/Lato-Hai.ttf new file mode 100644 index 00000000..288be295 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Lato-Hai.ttf differ diff --git a/org.simantics.maps.server/server/fonts/Lato-HaiIta.ttf b/org.simantics.maps.server/server/fonts/Lato-HaiIta.ttf new file mode 100644 index 00000000..c2bfd335 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Lato-HaiIta.ttf differ diff --git a/org.simantics.maps.server/server/fonts/Lato-Lig.ttf b/org.simantics.maps.server/server/fonts/Lato-Lig.ttf new file mode 100644 index 00000000..a958067a Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Lato-Lig.ttf differ diff --git a/org.simantics.maps.server/server/fonts/Lato-LigIta.ttf b/org.simantics.maps.server/server/fonts/Lato-LigIta.ttf new file mode 100644 index 00000000..5e45ad9a Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Lato-LigIta.ttf differ diff --git a/org.simantics.maps.server/server/fonts/Lato-Reg.ttf b/org.simantics.maps.server/server/fonts/Lato-Reg.ttf new file mode 100644 index 00000000..04ea8efb Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Lato-Reg.ttf differ diff --git a/org.simantics.maps.server/server/fonts/Lato-RegIta.ttf b/org.simantics.maps.server/server/fonts/Lato-RegIta.ttf new file mode 100644 index 00000000..3d3b7a29 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Lato-RegIta.ttf differ diff --git a/org.simantics.maps.server/server/fonts/LeagueGothic-CondensedItalic.otf b/org.simantics.maps.server/server/fonts/LeagueGothic-CondensedItalic.otf new file mode 100644 index 00000000..28d71852 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/LeagueGothic-CondensedItalic.otf differ diff --git a/org.simantics.maps.server/server/fonts/LeagueGothic-CondensedRegular.otf b/org.simantics.maps.server/server/fonts/LeagueGothic-CondensedRegular.otf new file mode 100644 index 00000000..b1e70bd0 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/LeagueGothic-CondensedRegular.otf differ diff --git a/org.simantics.maps.server/server/fonts/LeagueGothic-Italic.otf b/org.simantics.maps.server/server/fonts/LeagueGothic-Italic.otf new file mode 100644 index 00000000..ce19c0a4 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/LeagueGothic-Italic.otf differ diff --git a/org.simantics.maps.server/server/fonts/LeagueGothic-Regular.otf b/org.simantics.maps.server/server/fonts/LeagueGothic-Regular.otf new file mode 100644 index 00000000..6cd753fa Binary files /dev/null and b/org.simantics.maps.server/server/fonts/LeagueGothic-Regular.otf differ diff --git a/org.simantics.maps.server/server/fonts/Merriweather-Black.otf b/org.simantics.maps.server/server/fonts/Merriweather-Black.otf new file mode 100644 index 00000000..07c0a802 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Merriweather-Black.otf differ diff --git a/org.simantics.maps.server/server/fonts/Merriweather-Bold.otf b/org.simantics.maps.server/server/fonts/Merriweather-Bold.otf new file mode 100644 index 00000000..be7f7eb6 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Merriweather-Bold.otf differ diff --git a/org.simantics.maps.server/server/fonts/Merriweather-Italic.otf b/org.simantics.maps.server/server/fonts/Merriweather-Italic.otf new file mode 100644 index 00000000..f3e1661c Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Merriweather-Italic.otf differ diff --git a/org.simantics.maps.server/server/fonts/Merriweather-Light.otf b/org.simantics.maps.server/server/fonts/Merriweather-Light.otf new file mode 100644 index 00000000..553bc9df Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Merriweather-Light.otf differ diff --git a/org.simantics.maps.server/server/fonts/Merriweather-Regular.otf b/org.simantics.maps.server/server/fonts/Merriweather-Regular.otf new file mode 100644 index 00000000..3ab1d7ab Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Merriweather-Regular.otf differ diff --git a/org.simantics.maps.server/server/fonts/Mutlu__Ornamental.ttf b/org.simantics.maps.server/server/fonts/Mutlu__Ornamental.ttf new file mode 100644 index 00000000..73bf9dda Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Mutlu__Ornamental.ttf differ diff --git a/org.simantics.maps.server/server/fonts/OpenSans-Bold.ttf b/org.simantics.maps.server/server/fonts/OpenSans-Bold.ttf new file mode 100644 index 00000000..fd79d43b Binary files /dev/null and b/org.simantics.maps.server/server/fonts/OpenSans-Bold.ttf differ diff --git a/org.simantics.maps.server/server/fonts/OpenSans-BoldItalic.ttf b/org.simantics.maps.server/server/fonts/OpenSans-BoldItalic.ttf new file mode 100644 index 00000000..9bc80095 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/OpenSans-BoldItalic.ttf differ diff --git a/org.simantics.maps.server/server/fonts/OpenSans-CondBold.ttf b/org.simantics.maps.server/server/fonts/OpenSans-CondBold.ttf new file mode 100644 index 00000000..83966f21 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/OpenSans-CondBold.ttf differ diff --git a/org.simantics.maps.server/server/fonts/OpenSans-CondLight.ttf b/org.simantics.maps.server/server/fonts/OpenSans-CondLight.ttf new file mode 100644 index 00000000..97c355b9 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/OpenSans-CondLight.ttf differ diff --git a/org.simantics.maps.server/server/fonts/OpenSans-CondLightItalic.ttf b/org.simantics.maps.server/server/fonts/OpenSans-CondLightItalic.ttf new file mode 100644 index 00000000..0b45898d Binary files /dev/null and b/org.simantics.maps.server/server/fonts/OpenSans-CondLightItalic.ttf differ diff --git a/org.simantics.maps.server/server/fonts/OpenSans-ExtraBold.ttf b/org.simantics.maps.server/server/fonts/OpenSans-ExtraBold.ttf new file mode 100644 index 00000000..21f6f84a Binary files /dev/null and b/org.simantics.maps.server/server/fonts/OpenSans-ExtraBold.ttf differ diff --git a/org.simantics.maps.server/server/fonts/OpenSans-ExtraBoldItalic.ttf b/org.simantics.maps.server/server/fonts/OpenSans-ExtraBoldItalic.ttf new file mode 100644 index 00000000..31cb6883 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/OpenSans-ExtraBoldItalic.ttf differ diff --git a/org.simantics.maps.server/server/fonts/OpenSans-Italic.ttf b/org.simantics.maps.server/server/fonts/OpenSans-Italic.ttf new file mode 100644 index 00000000..c90da48f Binary files /dev/null and b/org.simantics.maps.server/server/fonts/OpenSans-Italic.ttf differ diff --git a/org.simantics.maps.server/server/fonts/OpenSans-Light.ttf b/org.simantics.maps.server/server/fonts/OpenSans-Light.ttf new file mode 100644 index 00000000..0d381897 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/OpenSans-Light.ttf differ diff --git a/org.simantics.maps.server/server/fonts/OpenSans-LightItalic.ttf b/org.simantics.maps.server/server/fonts/OpenSans-LightItalic.ttf new file mode 100644 index 00000000..68299c4b Binary files /dev/null and b/org.simantics.maps.server/server/fonts/OpenSans-LightItalic.ttf differ diff --git a/org.simantics.maps.server/server/fonts/OpenSans-Regular.ttf b/org.simantics.maps.server/server/fonts/OpenSans-Regular.ttf new file mode 100644 index 00000000..db433349 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/OpenSans-Regular.ttf differ diff --git a/org.simantics.maps.server/server/fonts/OpenSans-Semibold.ttf b/org.simantics.maps.server/server/fonts/OpenSans-Semibold.ttf new file mode 100644 index 00000000..1a7679e3 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/OpenSans-Semibold.ttf differ diff --git a/org.simantics.maps.server/server/fonts/OpenSans-SemiboldItalic.ttf b/org.simantics.maps.server/server/fonts/OpenSans-SemiboldItalic.ttf new file mode 100644 index 00000000..59b6d16b Binary files /dev/null and b/org.simantics.maps.server/server/fonts/OpenSans-SemiboldItalic.ttf differ diff --git a/org.simantics.maps.server/server/fonts/PTC55F.ttf b/org.simantics.maps.server/server/fonts/PTC55F.ttf new file mode 100644 index 00000000..dbfc2cd6 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/PTC55F.ttf differ diff --git a/org.simantics.maps.server/server/fonts/PTC75F.ttf b/org.simantics.maps.server/server/fonts/PTC75F.ttf new file mode 100644 index 00000000..1e249eb6 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/PTC75F.ttf differ diff --git a/org.simantics.maps.server/server/fonts/PTN57F.ttf b/org.simantics.maps.server/server/fonts/PTN57F.ttf new file mode 100644 index 00000000..0becd108 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/PTN57F.ttf differ diff --git a/org.simantics.maps.server/server/fonts/PTN77F.ttf b/org.simantics.maps.server/server/fonts/PTN77F.ttf new file mode 100644 index 00000000..fab582b3 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/PTN77F.ttf differ diff --git a/org.simantics.maps.server/server/fonts/PTS55F.ttf b/org.simantics.maps.server/server/fonts/PTS55F.ttf new file mode 100644 index 00000000..942d1f7d Binary files /dev/null and b/org.simantics.maps.server/server/fonts/PTS55F.ttf differ diff --git a/org.simantics.maps.server/server/fonts/PTS56F.ttf b/org.simantics.maps.server/server/fonts/PTS56F.ttf new file mode 100644 index 00000000..992f9964 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/PTS56F.ttf differ diff --git a/org.simantics.maps.server/server/fonts/PTS75F.ttf b/org.simantics.maps.server/server/fonts/PTS75F.ttf new file mode 100644 index 00000000..dbf45b59 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/PTS75F.ttf differ diff --git a/org.simantics.maps.server/server/fonts/PTS76F.ttf b/org.simantics.maps.server/server/fonts/PTS76F.ttf new file mode 100644 index 00000000..72902efc Binary files /dev/null and b/org.simantics.maps.server/server/fonts/PTS76F.ttf differ diff --git a/org.simantics.maps.server/server/fonts/Quintessential-Regular.ttf b/org.simantics.maps.server/server/fonts/Quintessential-Regular.ttf new file mode 100644 index 00000000..a534ef9e Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Quintessential-Regular.ttf differ diff --git a/org.simantics.maps.server/server/fonts/Roboto-Black.ttf b/org.simantics.maps.server/server/fonts/Roboto-Black.ttf new file mode 100644 index 00000000..86ec2b29 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Roboto-Black.ttf differ diff --git a/org.simantics.maps.server/server/fonts/Roboto-BlackItalic.ttf b/org.simantics.maps.server/server/fonts/Roboto-BlackItalic.ttf new file mode 100644 index 00000000..1904c99b Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Roboto-BlackItalic.ttf differ diff --git a/org.simantics.maps.server/server/fonts/Roboto-Bold.ttf b/org.simantics.maps.server/server/fonts/Roboto-Bold.ttf new file mode 100644 index 00000000..91ec2122 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Roboto-Bold.ttf differ diff --git a/org.simantics.maps.server/server/fonts/Roboto-BoldCondensed.ttf b/org.simantics.maps.server/server/fonts/Roboto-BoldCondensed.ttf new file mode 100644 index 00000000..d7ea8833 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Roboto-BoldCondensed.ttf differ diff --git a/org.simantics.maps.server/server/fonts/Roboto-BoldCondensedItalic.ttf b/org.simantics.maps.server/server/fonts/Roboto-BoldCondensedItalic.ttf new file mode 100644 index 00000000..3c9635a9 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Roboto-BoldCondensedItalic.ttf differ diff --git a/org.simantics.maps.server/server/fonts/Roboto-BoldItalic.ttf b/org.simantics.maps.server/server/fonts/Roboto-BoldItalic.ttf new file mode 100644 index 00000000..4013bf88 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Roboto-BoldItalic.ttf differ diff --git a/org.simantics.maps.server/server/fonts/Roboto-Condensed.ttf b/org.simantics.maps.server/server/fonts/Roboto-Condensed.ttf new file mode 100644 index 00000000..6e7575a1 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Roboto-Condensed.ttf differ diff --git a/org.simantics.maps.server/server/fonts/Roboto-CondensedItalic.ttf b/org.simantics.maps.server/server/fonts/Roboto-CondensedItalic.ttf new file mode 100644 index 00000000..5ed712c9 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Roboto-CondensedItalic.ttf differ diff --git a/org.simantics.maps.server/server/fonts/Roboto-Italic.ttf b/org.simantics.maps.server/server/fonts/Roboto-Italic.ttf new file mode 100644 index 00000000..9f49ffd8 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Roboto-Italic.ttf differ diff --git a/org.simantics.maps.server/server/fonts/Roboto-Light.ttf b/org.simantics.maps.server/server/fonts/Roboto-Light.ttf new file mode 100644 index 00000000..d43e9433 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Roboto-Light.ttf differ diff --git a/org.simantics.maps.server/server/fonts/Roboto-LightItalic.ttf b/org.simantics.maps.server/server/fonts/Roboto-LightItalic.ttf new file mode 100644 index 00000000..c11442ce Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Roboto-LightItalic.ttf differ diff --git a/org.simantics.maps.server/server/fonts/Roboto-Medium.ttf b/org.simantics.maps.server/server/fonts/Roboto-Medium.ttf new file mode 100644 index 00000000..87983419 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Roboto-Medium.ttf differ diff --git a/org.simantics.maps.server/server/fonts/Roboto-MediumItalic.ttf b/org.simantics.maps.server/server/fonts/Roboto-MediumItalic.ttf new file mode 100644 index 00000000..5e866375 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Roboto-MediumItalic.ttf differ diff --git a/org.simantics.maps.server/server/fonts/Roboto-Regular.ttf b/org.simantics.maps.server/server/fonts/Roboto-Regular.ttf new file mode 100644 index 00000000..7d9a6c4c Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Roboto-Regular.ttf differ diff --git a/org.simantics.maps.server/server/fonts/Roboto-Thin.ttf b/org.simantics.maps.server/server/fonts/Roboto-Thin.ttf new file mode 100644 index 00000000..861d63ad Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Roboto-Thin.ttf differ diff --git a/org.simantics.maps.server/server/fonts/Roboto-ThinItalic.ttf b/org.simantics.maps.server/server/fonts/Roboto-ThinItalic.ttf new file mode 100644 index 00000000..e65145f3 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/Roboto-ThinItalic.ttf differ diff --git a/org.simantics.maps.server/server/fonts/SourceSansPro-Black.ttf b/org.simantics.maps.server/server/fonts/SourceSansPro-Black.ttf new file mode 100644 index 00000000..cb89a2d1 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/SourceSansPro-Black.ttf differ diff --git a/org.simantics.maps.server/server/fonts/SourceSansPro-BlackIt.ttf b/org.simantics.maps.server/server/fonts/SourceSansPro-BlackIt.ttf new file mode 100644 index 00000000..c719243c Binary files /dev/null and b/org.simantics.maps.server/server/fonts/SourceSansPro-BlackIt.ttf differ diff --git a/org.simantics.maps.server/server/fonts/SourceSansPro-Bold.ttf b/org.simantics.maps.server/server/fonts/SourceSansPro-Bold.ttf new file mode 100644 index 00000000..50d81bda Binary files /dev/null and b/org.simantics.maps.server/server/fonts/SourceSansPro-Bold.ttf differ diff --git a/org.simantics.maps.server/server/fonts/SourceSansPro-BoldIt.ttf b/org.simantics.maps.server/server/fonts/SourceSansPro-BoldIt.ttf new file mode 100644 index 00000000..d20dd0c5 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/SourceSansPro-BoldIt.ttf differ diff --git a/org.simantics.maps.server/server/fonts/SourceSansPro-ExtraLight.ttf b/org.simantics.maps.server/server/fonts/SourceSansPro-ExtraLight.ttf new file mode 100644 index 00000000..bb4176c6 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/SourceSansPro-ExtraLight.ttf differ diff --git a/org.simantics.maps.server/server/fonts/SourceSansPro-ExtraLightIt.ttf b/org.simantics.maps.server/server/fonts/SourceSansPro-ExtraLightIt.ttf new file mode 100644 index 00000000..2c34f3b8 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/SourceSansPro-ExtraLightIt.ttf differ diff --git a/org.simantics.maps.server/server/fonts/SourceSansPro-It.ttf b/org.simantics.maps.server/server/fonts/SourceSansPro-It.ttf new file mode 100644 index 00000000..e5a1a86e Binary files /dev/null and b/org.simantics.maps.server/server/fonts/SourceSansPro-It.ttf differ diff --git a/org.simantics.maps.server/server/fonts/SourceSansPro-Light.ttf b/org.simantics.maps.server/server/fonts/SourceSansPro-Light.ttf new file mode 100644 index 00000000..5f64679f Binary files /dev/null and b/org.simantics.maps.server/server/fonts/SourceSansPro-Light.ttf differ diff --git a/org.simantics.maps.server/server/fonts/SourceSansPro-LightIt.ttf b/org.simantics.maps.server/server/fonts/SourceSansPro-LightIt.ttf new file mode 100644 index 00000000..88a6778d Binary files /dev/null and b/org.simantics.maps.server/server/fonts/SourceSansPro-LightIt.ttf differ diff --git a/org.simantics.maps.server/server/fonts/SourceSansPro-Regular.ttf b/org.simantics.maps.server/server/fonts/SourceSansPro-Regular.ttf new file mode 100644 index 00000000..91e9ea57 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/SourceSansPro-Regular.ttf differ diff --git a/org.simantics.maps.server/server/fonts/SourceSansPro-Semibold.ttf b/org.simantics.maps.server/server/fonts/SourceSansPro-Semibold.ttf new file mode 100644 index 00000000..50205948 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/SourceSansPro-Semibold.ttf differ diff --git a/org.simantics.maps.server/server/fonts/SourceSansPro-SemiboldIt.ttf b/org.simantics.maps.server/server/fonts/SourceSansPro-SemiboldIt.ttf new file mode 100644 index 00000000..2c5ad300 Binary files /dev/null and b/org.simantics.maps.server/server/fonts/SourceSansPro-SemiboldIt.ttf differ diff --git a/org.simantics.maps.server/server/fonts/gothic_ultra_ot.otf b/org.simantics.maps.server/server/fonts/gothic_ultra_ot.otf new file mode 100644 index 00000000..1786f68a Binary files /dev/null and b/org.simantics.maps.server/server/fonts/gothic_ultra_ot.otf differ diff --git a/org.simantics.maps.server/server/tileserver-mapnik/.dockerignore b/org.simantics.maps.server/server/tileserver-mapnik/.dockerignore new file mode 100644 index 00000000..f8413820 --- /dev/null +++ b/org.simantics.maps.server/server/tileserver-mapnik/.dockerignore @@ -0,0 +1,6 @@ +.git +node_modules +bower_components +test_data +data +export diff --git a/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/HEAD b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/HEAD new file mode 100644 index 00000000..cb089cd8 --- /dev/null +++ b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/HEAD @@ -0,0 +1 @@ +ref: refs/heads/master diff --git a/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/config b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/config new file mode 100644 index 00000000..5a8efeab --- /dev/null +++ b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/config @@ -0,0 +1,13 @@ +[core] + repositoryformatversion = 0 + filemode = false + bare = false + logallrefupdates = true + symlinks = false + ignorecase = true +[remote "origin"] + url = https://github.com/klokantech/tileserver-mapnik.git + fetch = +refs/heads/*:refs/remotes/origin/* +[branch "master"] + remote = origin + merge = refs/heads/master diff --git a/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/description b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/description new file mode 100644 index 00000000..498b267a --- /dev/null +++ b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/description @@ -0,0 +1 @@ +Unnamed repository; edit this file 'description' to name the repository. diff --git a/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/hooks/applypatch-msg.sample b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/hooks/applypatch-msg.sample new file mode 100644 index 00000000..a5d7b84a --- /dev/null +++ b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/hooks/applypatch-msg.sample @@ -0,0 +1,15 @@ +#!/bin/sh +# +# An example hook script to check the commit log message taken by +# applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. The hook is +# allowed to edit the commit message file. +# +# To enable this hook, rename this file to "applypatch-msg". + +. git-sh-setup +commitmsg="$(git rev-parse --git-path hooks/commit-msg)" +test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} +: diff --git a/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/hooks/commit-msg.sample b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/hooks/commit-msg.sample new file mode 100644 index 00000000..b58d1184 --- /dev/null +++ b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/hooks/commit-msg.sample @@ -0,0 +1,24 @@ +#!/bin/sh +# +# An example hook script to check the commit log message. +# Called by "git commit" with one argument, the name of the file +# that has the commit message. The hook should exit with non-zero +# status after issuing an appropriate message if it wants to stop the +# commit. The hook is allowed to edit the commit message file. +# +# To enable this hook, rename this file to "commit-msg". + +# Uncomment the below to add a Signed-off-by line to the message. +# Doing this in a hook is a bad idea in general, but the prepare-commit-msg +# hook is more suited to it. +# +# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" + +# This example catches duplicate Signed-off-by lines. + +test "" = "$(grep '^Signed-off-by: ' "$1" | + sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { + echo >&2 Duplicate Signed-off-by lines. + exit 1 +} diff --git a/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/hooks/post-update.sample b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/hooks/post-update.sample new file mode 100644 index 00000000..ec17ec19 --- /dev/null +++ b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/hooks/post-update.sample @@ -0,0 +1,8 @@ +#!/bin/sh +# +# An example hook script to prepare a packed repository for use over +# dumb transports. +# +# To enable this hook, rename this file to "post-update". + +exec git update-server-info diff --git a/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/hooks/pre-applypatch.sample b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/hooks/pre-applypatch.sample new file mode 100644 index 00000000..4142082b --- /dev/null +++ b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/hooks/pre-applypatch.sample @@ -0,0 +1,14 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed +# by applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-applypatch". + +. git-sh-setup +precommit="$(git rev-parse --git-path hooks/pre-commit)" +test -x "$precommit" && exec "$precommit" ${1+"$@"} +: diff --git a/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/hooks/pre-commit.sample b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/hooks/pre-commit.sample new file mode 100644 index 00000000..68d62d54 --- /dev/null +++ b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/hooks/pre-commit.sample @@ -0,0 +1,49 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed. +# Called by "git commit" with no arguments. The hook should +# exit with non-zero status after issuing an appropriate message if +# it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-commit". + +if git rev-parse --verify HEAD >/dev/null 2>&1 +then + against=HEAD +else + # Initial commit: diff against an empty tree object + against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 +fi + +# If you want to allow non-ASCII filenames set this variable to true. +allownonascii=$(git config --bool hooks.allownonascii) + +# Redirect output to stderr. +exec 1>&2 + +# Cross platform projects tend to avoid non-ASCII filenames; prevent +# them from being added to the repository. We exploit the fact that the +# printable range starts at the space character and ends with tilde. +if [ "$allownonascii" != "true" ] && + # Note that the use of brackets around a tr range is ok here, (it's + # even required, for portability to Solaris 10's /usr/bin/tr), since + # the square bracket bytes happen to fall in the designated range. + test $(git diff --cached --name-only --diff-filter=A -z $against | + LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 +then + cat <<\EOF +Error: Attempt to add a non-ASCII file name. + +This can cause problems if you want to work with people on other platforms. + +To be portable it is advisable to rename the file. + +If you know what you are doing you can disable this check using: + + git config hooks.allownonascii true +EOF + exit 1 +fi + +# If there are whitespace errors, print the offending file names and fail. +exec git diff-index --check --cached $against -- diff --git a/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/hooks/pre-push.sample b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/hooks/pre-push.sample new file mode 100644 index 00000000..6187dbf4 --- /dev/null +++ b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/hooks/pre-push.sample @@ -0,0 +1,53 @@ +#!/bin/sh + +# An example hook script to verify what is about to be pushed. Called by "git +# push" after it has checked the remote status, but before anything has been +# pushed. If this script exits with a non-zero status nothing will be pushed. +# +# This hook is called with the following parameters: +# +# $1 -- Name of the remote to which the push is being done +# $2 -- URL to which the push is being done +# +# If pushing without using a named remote those arguments will be equal. +# +# Information about the commits which are being pushed is supplied as lines to +# the standard input in the form: +# +# <local ref> <local sha1> <remote ref> <remote sha1> +# +# This sample shows how to prevent push of commits where the log message starts +# with "WIP" (work in progress). + +remote="$1" +url="$2" + +z40=0000000000000000000000000000000000000000 + +while read local_ref local_sha remote_ref remote_sha +do + if [ "$local_sha" = $z40 ] + then + # Handle delete + : + else + if [ "$remote_sha" = $z40 ] + then + # New branch, examine all commits + range="$local_sha" + else + # Update to existing branch, examine new commits + range="$remote_sha..$local_sha" + fi + + # Check for WIP commit + commit=`git rev-list -n 1 --grep '^WIP' "$range"` + if [ -n "$commit" ] + then + echo >&2 "Found WIP commit in $local_ref, not pushing" + exit 1 + fi + fi +done + +exit 0 diff --git a/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/hooks/pre-rebase.sample b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/hooks/pre-rebase.sample new file mode 100644 index 00000000..9773ed4c --- /dev/null +++ b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/hooks/pre-rebase.sample @@ -0,0 +1,169 @@ +#!/bin/sh +# +# Copyright (c) 2006, 2008 Junio C Hamano +# +# The "pre-rebase" hook is run just before "git rebase" starts doing +# its job, and can prevent the command from running by exiting with +# non-zero status. +# +# The hook is called with the following parameters: +# +# $1 -- the upstream the series was forked from. +# $2 -- the branch being rebased (or empty when rebasing the current branch). +# +# This sample shows how to prevent topic branches that are already +# merged to 'next' branch from getting rebased, because allowing it +# would result in rebasing already published history. + +publish=next +basebranch="$1" +if test "$#" = 2 +then + topic="refs/heads/$2" +else + topic=`git symbolic-ref HEAD` || + exit 0 ;# we do not interrupt rebasing detached HEAD +fi + +case "$topic" in +refs/heads/??/*) + ;; +*) + exit 0 ;# we do not interrupt others. + ;; +esac + +# Now we are dealing with a topic branch being rebased +# on top of master. Is it OK to rebase it? + +# Does the topic really exist? +git show-ref -q "$topic" || { + echo >&2 "No such branch $topic" + exit 1 +} + +# Is topic fully merged to master? +not_in_master=`git rev-list --pretty=oneline ^master "$topic"` +if test -z "$not_in_master" +then + echo >&2 "$topic is fully merged to master; better remove it." + exit 1 ;# we could allow it, but there is no point. +fi + +# Is topic ever merged to next? If so you should not be rebasing it. +only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` +only_next_2=`git rev-list ^master ${publish} | sort` +if test "$only_next_1" = "$only_next_2" +then + not_in_topic=`git rev-list "^$topic" master` + if test -z "$not_in_topic" + then + echo >&2 "$topic is already up-to-date with master" + exit 1 ;# we could allow it, but there is no point. + else + exit 0 + fi +else + not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` + /usr/bin/perl -e ' + my $topic = $ARGV[0]; + my $msg = "* $topic has commits already merged to public branch:\n"; + my (%not_in_next) = map { + /^([0-9a-f]+) /; + ($1 => 1); + } split(/\n/, $ARGV[1]); + for my $elem (map { + /^([0-9a-f]+) (.*)$/; + [$1 => $2]; + } split(/\n/, $ARGV[2])) { + if (!exists $not_in_next{$elem->[0]}) { + if ($msg) { + print STDERR $msg; + undef $msg; + } + print STDERR " $elem->[1]\n"; + } + } + ' "$topic" "$not_in_next" "$not_in_master" + exit 1 +fi + +exit 0 + +################################################################ + +This sample hook safeguards topic branches that have been +published from being rewound. + +The workflow assumed here is: + + * Once a topic branch forks from "master", "master" is never + merged into it again (either directly or indirectly). + + * Once a topic branch is fully cooked and merged into "master", + it is deleted. If you need to build on top of it to correct + earlier mistakes, a new topic branch is created by forking at + the tip of the "master". This is not strictly necessary, but + it makes it easier to keep your history simple. + + * Whenever you need to test or publish your changes to topic + branches, merge them into "next" branch. + +The script, being an example, hardcodes the publish branch name +to be "next", but it is trivial to make it configurable via +$GIT_DIR/config mechanism. + +With this workflow, you would want to know: + +(1) ... if a topic branch has ever been merged to "next". Young + topic branches can have stupid mistakes you would rather + clean up before publishing, and things that have not been + merged into other branches can be easily rebased without + affecting other people. But once it is published, you would + not want to rewind it. + +(2) ... if a topic branch has been fully merged to "master". + Then you can delete it. More importantly, you should not + build on top of it -- other people may already want to + change things related to the topic as patches against your + "master", so if you need further changes, it is better to + fork the topic (perhaps with the same name) afresh from the + tip of "master". + +Let's look at this example: + + o---o---o---o---o---o---o---o---o---o "next" + / / / / + / a---a---b A / / + / / / / + / / c---c---c---c B / + / / / \ / + / / / b---b C \ / + / / / / \ / + ---o---o---o---o---o---o---o---o---o---o---o "master" + + +A, B and C are topic branches. + + * A has one fix since it was merged up to "next". + + * B has finished. It has been fully merged up to "master" and "next", + and is ready to be deleted. + + * C has not merged to "next" at all. + +We would want to allow C to be rebased, refuse A, and encourage +B to be deleted. + +To compute (1): + + git rev-list ^master ^topic next + git rev-list ^master next + + if these match, topic has not merged in next at all. + +To compute (2): + + git rev-list master..topic + + if this is empty, it is fully merged to "master". diff --git a/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/hooks/pre-receive.sample b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/hooks/pre-receive.sample new file mode 100644 index 00000000..a1fd29ec --- /dev/null +++ b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/hooks/pre-receive.sample @@ -0,0 +1,24 @@ +#!/bin/sh +# +# An example hook script to make use of push options. +# The example simply echoes all push options that start with 'echoback=' +# and rejects all pushes when the "reject" push option is used. +# +# To enable this hook, rename this file to "pre-receive". + +if test -n "$GIT_PUSH_OPTION_COUNT" +then + i=0 + while test "$i" -lt "$GIT_PUSH_OPTION_COUNT" + do + eval "value=\$GIT_PUSH_OPTION_$i" + case "$value" in + echoback=*) + echo "echo from the pre-receive-hook: ${value#*=}" >&2 + ;; + reject) + exit 1 + esac + i=$((i + 1)) + done +fi diff --git a/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/hooks/prepare-commit-msg.sample b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/hooks/prepare-commit-msg.sample new file mode 100644 index 00000000..f093a02e --- /dev/null +++ b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/hooks/prepare-commit-msg.sample @@ -0,0 +1,36 @@ +#!/bin/sh +# +# An example hook script to prepare the commit log message. +# Called by "git commit" with the name of the file that has the +# commit message, followed by the description of the commit +# message's source. The hook's purpose is to edit the commit +# message file. If the hook fails with a non-zero status, +# the commit is aborted. +# +# To enable this hook, rename this file to "prepare-commit-msg". + +# This hook includes three examples. The first comments out the +# "Conflicts:" part of a merge commit. +# +# The second includes the output of "git diff --name-status -r" +# into the message, just before the "git status" output. It is +# commented because it doesn't cope with --amend or with squashed +# commits. +# +# The third example adds a Signed-off-by line to the message, that can +# still be edited. This is rarely a good idea. + +case "$2,$3" in + merge,) + /usr/bin/perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;; + +# ,|template,) +# /usr/bin/perl -i.bak -pe ' +# print "\n" . `git diff --cached --name-status -r` +# if /^#/ && $first++ == 0' "$1" ;; + + *) ;; +esac + +# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" diff --git a/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/hooks/update.sample b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/hooks/update.sample new file mode 100644 index 00000000..80ba9413 --- /dev/null +++ b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/hooks/update.sample @@ -0,0 +1,128 @@ +#!/bin/sh +# +# An example hook script to block unannotated tags from entering. +# Called by "git receive-pack" with arguments: refname sha1-old sha1-new +# +# To enable this hook, rename this file to "update". +# +# Config +# ------ +# hooks.allowunannotated +# This boolean sets whether unannotated tags will be allowed into the +# repository. By default they won't be. +# hooks.allowdeletetag +# This boolean sets whether deleting tags will be allowed in the +# repository. By default they won't be. +# hooks.allowmodifytag +# This boolean sets whether a tag may be modified after creation. By default +# it won't be. +# hooks.allowdeletebranch +# This boolean sets whether deleting branches will be allowed in the +# repository. By default they won't be. +# hooks.denycreatebranch +# This boolean sets whether remotely creating branches will be denied +# in the repository. By default this is allowed. +# + +# --- Command line +refname="$1" +oldrev="$2" +newrev="$3" + +# --- Safety check +if [ -z "$GIT_DIR" ]; then + echo "Don't run this script from the command line." >&2 + echo " (if you want, you could supply GIT_DIR then run" >&2 + echo " $0 <ref> <oldrev> <newrev>)" >&2 + exit 1 +fi + +if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then + echo "usage: $0 <ref> <oldrev> <newrev>" >&2 + exit 1 +fi + +# --- Config +allowunannotated=$(git config --bool hooks.allowunannotated) +allowdeletebranch=$(git config --bool hooks.allowdeletebranch) +denycreatebranch=$(git config --bool hooks.denycreatebranch) +allowdeletetag=$(git config --bool hooks.allowdeletetag) +allowmodifytag=$(git config --bool hooks.allowmodifytag) + +# check for no description +projectdesc=$(sed -e '1q' "$GIT_DIR/description") +case "$projectdesc" in +"Unnamed repository"* | "") + echo "*** Project description file hasn't been set" >&2 + exit 1 + ;; +esac + +# --- Check types +# if $newrev is 0000...0000, it's a commit to delete a ref. +zero="0000000000000000000000000000000000000000" +if [ "$newrev" = "$zero" ]; then + newrev_type=delete +else + newrev_type=$(git cat-file -t $newrev) +fi + +case "$refname","$newrev_type" in + refs/tags/*,commit) + # un-annotated tag + short_refname=${refname##refs/tags/} + if [ "$allowunannotated" != "true" ]; then + echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2 + echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 + exit 1 + fi + ;; + refs/tags/*,delete) + # delete tag + if [ "$allowdeletetag" != "true" ]; then + echo "*** Deleting a tag is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/tags/*,tag) + # annotated tag + if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 + then + echo "*** Tag '$refname' already exists." >&2 + echo "*** Modifying a tag is not allowed in this repository." >&2 + exit 1 + fi + ;; + refs/heads/*,commit) + # branch + if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then + echo "*** Creating a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/heads/*,delete) + # delete branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/remotes/*,commit) + # tracking branch + ;; + refs/remotes/*,delete) + # delete tracking branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a tracking branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + *) + # Anything else (is there anything else?) + echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 + exit 1 + ;; +esac + +# --- Finished +exit 0 diff --git a/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/index b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/index new file mode 100644 index 00000000..080936b9 Binary files /dev/null and b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/index differ diff --git a/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/info/exclude b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/info/exclude new file mode 100644 index 00000000..a5196d1b --- /dev/null +++ b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/info/exclude @@ -0,0 +1,6 @@ +# git ls-files --others --exclude-from=.git/info/exclude +# Lines that start with '#' are comments. +# For a project mostly in C, the following would be a good set of +# exclude patterns (uncomment them if you want to use them): +# *.[oa] +# *~ diff --git a/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/logs/HEAD b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/logs/HEAD new file mode 100644 index 00000000..b6064806 --- /dev/null +++ b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/logs/HEAD @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 b5882cef07dac05ac19ae7a44f4274b0280b4dad jsimomaa <jani.simomaa@gmail.com> 1485437658 +0200 clone: from https://github.com/klokantech/tileserver-mapnik.git diff --git a/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/logs/refs/heads/master b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/logs/refs/heads/master new file mode 100644 index 00000000..b6064806 --- /dev/null +++ b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/logs/refs/heads/master @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 b5882cef07dac05ac19ae7a44f4274b0280b4dad jsimomaa <jani.simomaa@gmail.com> 1485437658 +0200 clone: from https://github.com/klokantech/tileserver-mapnik.git diff --git a/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/logs/refs/remotes/origin/HEAD b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/logs/refs/remotes/origin/HEAD new file mode 100644 index 00000000..b6064806 --- /dev/null +++ b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/logs/refs/remotes/origin/HEAD @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 b5882cef07dac05ac19ae7a44f4274b0280b4dad jsimomaa <jani.simomaa@gmail.com> 1485437658 +0200 clone: from https://github.com/klokantech/tileserver-mapnik.git diff --git a/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/objects/pack/pack-39194da4352dcb63bcb2e91b0bae2033ee0dc63e.idx b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/objects/pack/pack-39194da4352dcb63bcb2e91b0bae2033ee0dc63e.idx new file mode 100644 index 00000000..f89c847e Binary files /dev/null and b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/objects/pack/pack-39194da4352dcb63bcb2e91b0bae2033ee0dc63e.idx differ diff --git a/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/objects/pack/pack-39194da4352dcb63bcb2e91b0bae2033ee0dc63e.pack b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/objects/pack/pack-39194da4352dcb63bcb2e91b0bae2033ee0dc63e.pack new file mode 100644 index 00000000..806337e1 Binary files /dev/null and b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/objects/pack/pack-39194da4352dcb63bcb2e91b0bae2033ee0dc63e.pack differ diff --git a/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/packed-refs b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/packed-refs new file mode 100644 index 00000000..1ad95a8b --- /dev/null +++ b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/packed-refs @@ -0,0 +1,4 @@ +# pack-refs with: peeled fully-peeled +b5882cef07dac05ac19ae7a44f4274b0280b4dad refs/remotes/origin/master +c4aca78d8f21454dcc940ceb1673116972fd1c3b refs/remotes/origin/revert-6-master +69f73830deb52dc81638f61917d809b671eab565 refs/tags/v2.0 diff --git a/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/refs/heads/master b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/refs/heads/master new file mode 100644 index 00000000..ee7dcb0e --- /dev/null +++ b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/refs/heads/master @@ -0,0 +1 @@ +b5882cef07dac05ac19ae7a44f4274b0280b4dad diff --git a/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/refs/remotes/origin/HEAD b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/refs/remotes/origin/HEAD new file mode 100644 index 00000000..6efe28ff --- /dev/null +++ b/org.simantics.maps.server/server/tileserver-mapnik/.git.bak/refs/remotes/origin/HEAD @@ -0,0 +1 @@ +ref: refs/remotes/origin/master diff --git a/org.simantics.maps.server/server/tileserver-mapnik/.gitignore b/org.simantics.maps.server/server/tileserver-mapnik/.gitignore new file mode 100644 index 00000000..68b9e277 --- /dev/null +++ b/org.simantics.maps.server/server/tileserver-mapnik/.gitignore @@ -0,0 +1,2 @@ +node_modules/ +bower_components/ diff --git a/org.simantics.maps.server/server/tileserver-mapnik/.npmignore b/org.simantics.maps.server/server/tileserver-mapnik/.npmignore new file mode 100644 index 00000000..7fb8998d --- /dev/null +++ b/org.simantics.maps.server/server/tileserver-mapnik/.npmignore @@ -0,0 +1,8 @@ +* + +!lib/** +!bin/** +!public/** +!bower_components/** +!index.js +!server.js diff --git a/org.simantics.maps.server/server/tileserver-mapnik/CHANGELOG.md b/org.simantics.maps.server/server/tileserver-mapnik/CHANGELOG.md new file mode 100644 index 00000000..1379602f --- /dev/null +++ b/org.simantics.maps.server/server/tileserver-mapnik/CHANGELOG.md @@ -0,0 +1,119 @@ +# Changes + +## v0.8.0 - 2/16/16 + +* Use shared loader from `tilelive-modules` +* Upgrade to `tilelive-cache@0.6.1` w/ improved source closing +* Upgrade to `handlebars@^4.0.5` + +## v0.7.1 - 2/5/16 + +* Add missing `LICENSE` +* Re-publish (`server.js` was missing in v0.7.0) + +## v0.7.0 - 2/3/16 + +* `conf.d` style configuration when `--config` points to a directory + +## v0.6.1 - 2/3/16 + +* Don't return upstream headers with 404s + +## v0.6.0 - 12/9/15 + +* Support for @3x tiles +* Don't treat `getInfo` errors as fatal on startup +* Upgrade dependencies +* Disable `tilelive-mapnik`'s internal cache +* Static map endpoint + +## v0.5.3 - 5/4/15 + +* Resolved missing `debug` dependency + +## v0.5.2 - 5/4/15 + +* PBF sources that don't provide headers default to reporting `gzip` encoding + to match current `tilelive-bridge`, etc. behavior +* Relax expectations for empty tiles +* Improve error logging when loading tilelive modules +* Use `debug` for warning messages about invalid requests + +## v0.5.1 - 11/23/14 + +* Update dependencies +* Drop `bower` as a runtime dependency +* Use `cachecache` to avoid requiring unnecessary rendering / fetching +* Update `tilelive-cache` with support for cache-skipping and fixes to + `tilelive-mapnik` drain errors +* `options` is now optional in `modules.js` +* Remove verification of `Content-MD5` headers--that responsibility falls to + individual providers. + +## v0.5.0 - unpublished + +## v0.4.4 - 7/16/14 + +* Run bower non-interactively + +## v0.4.3 - 7/11/14 + +* Don't coerce non-string tilelive URIs to strings, as `url.format` is lossy + +## v0.4.2 - 7/11/14 + +* Don't assume that tilelive URIs will always be strings +* Add `--source-cache-size` option + +## v0.4.1 - 7/10/14 + +* Fix relative links for nested files +* Use `?retina=true` in the preview to force retina tiles + +## v0.4.0 - 7/7/14 + +* Use Nominatim for geocoding +* Use bower for client deps vs. bundling them +* Verify and return `Content-MD5` headers +* Pass `tileSize` query option for sources like `tilelive-mapnik` +* Optional dependencies dropped in favor of detecting / explicitly requiring + installed modules. To add auto-detected modules, check out + [tilelive-modules](https://github.com/mojodna/tilelive-modules). +* Added support for the `TESSERA_OPTS` environment variable +* Added (repeatable) `--require` option + +## v0.3.0 - 5/27/14 + +* Use the xray view by default for PBF sources specified on the command line +* Updated `tilelive-tmstyle` to 0.1.2 with scale-dependent output +* Misc. dependency updates +* Updated `tilelive-cache` to 0.1.1 + +## v0.2.1 - 5/15/14 + +* Updated dependencies to help with installation problems + +## v0.2.0 - 4/28/14 + +* Added support for configuration files +* Added command-line options +* Default headers are provided for PBFs (@hallahan) +* Simplify format handling: `<tile>.vector.pbf` is now `<tile>.pbf` +* Upgraded Express to 4.0 +* Export `lib/app.js` as `require("tessera")` +* Support Carto (TileMill 1) styles via + [tilelive-carto](https://github.com/mojodna/tilelive-carto) + +## v0.1.2 - 4/1/14 + +* Add minimal-ui for Mobile Safari + +## v0.1.1 - 4/1/14 + +* Retina tile content matches non-retina tiles +* Match tilelive expectations for missing tiles (real errors will now be treated as + 500s, not 404s) + +## v0.1.0 - 3/13/14 + +* Initial public version diff --git a/org.simantics.maps.server/server/tileserver-mapnik/Dockerfile b/org.simantics.maps.server/server/tileserver-mapnik/Dockerfile new file mode 100644 index 00000000..e8110709 --- /dev/null +++ b/org.simantics.maps.server/server/tileserver-mapnik/Dockerfile @@ -0,0 +1,44 @@ +FROM node:0.10 +MAINTAINER Petr Sloup <petr.sloup@klokantech.com> +# Based on work by Lukas Martinelli + +# make sure the mapbox fonts are available on the system +RUN mkdir -p /tmp/mapbox-studio-default-fonts && \ + mkdir -p /fonts && \ + git clone https://github.com/mapbox/mapbox-studio-default-fonts.git /tmp/mapbox-studio-default-fonts && \ + cp /tmp/mapbox-studio-default-fonts/**/*.otf /fonts && \ + cp /tmp/mapbox-studio-default-fonts/**/*.ttf /fonts && \ + rm -rf /tmp/mapbox-studio-default-fonts + +# download fonts required for osm bright +RUN wget -q -P /fonts https://github.com/aaronlidman/Toner-for-Tilemill/raw/master/toner4tilemill/fonts/Arial-Bold.ttf && \ + wget -q -P /fonts https://github.com/aaronlidman/Toner-for-Tilemill/raw/master/toner4tilemill/fonts/Arial-Regular.ttf && \ + wget -q -P /fonts https://github.com/aaronlidman/Toner-for-Tilemill/raw/master/toner4tilemill/fonts/Arial-Unicode-Bold-Italic.ttf && \ + wget -q -P /fonts https://github.com/aaronlidman/Toner-for-Tilemill/raw/master/toner4tilemill/fonts/Arial-Unicode-Bold.ttf && \ + wget -q -P /fonts https://github.com/aaronlidman/Toner-for-Tilemill/raw/master/toner4tilemill/fonts/Arial-Unicode-Italic.ttf && \ + wget -q -P /fonts https://github.com/aaronlidman/Toner-for-Tilemill/raw/master/toner4tilemill/fonts/Arial-Unicode-Regular.ttf + +ENV MAPNIK_FONT_PATH=/fonts + +RUN mkdir -p /usr/src/app && mkdir -p /project +WORKDIR /usr/src/app +# only install minimal amount of tessera packages +# be careful as some tessera packages collide with itself +RUN npm install \ + mbtiles@0.8.2 \ + tilelive-tmstyle@0.4.2 \ + tilelive-xray@0.2.0 \ + tilelive-http@0.8.0 + +COPY / /usr/src/app +RUN npm install + +VOLUME /data +ENV SOURCE_DATA_DIR=/data \ + DEST_DATA_DIR=/project \ + PORT=80 \ + MAPNIK_FONT_PATH=/fonts \ + DOMAINS= + +EXPOSE 80 +CMD ["/usr/src/app/run.sh"] diff --git a/org.simantics.maps.server/server/tileserver-mapnik/LICENSE b/org.simantics.maps.server/server/tileserver-mapnik/LICENSE new file mode 100644 index 00000000..e41b9f6a --- /dev/null +++ b/org.simantics.maps.server/server/tileserver-mapnik/LICENSE @@ -0,0 +1,40 @@ +Copyright (c) 2015, Klokan Technologies GmbH +All rights reserved. + +Please study license of used `dependencies` listed in package.json file. +https://github.com/klokantech/tileserver-mapnik/blob/master/package.json#L16 + +Some of the deps (search https://www.npmjs.com/ for name of package): +- tessera: BSD-2 Clause - Copyright (c) 2015, Seth Fitzsimmons @mojodna / Stamen +- tilelive-modules: ISC license - Copyright (c) 2015, Seth Fitzsimmons @mojodna / Stamen +- tilelive: BSD license - Copyright (c), Mapbox +- tilelive-mapnik: BSD license - Copyright (c), Development Seed +- node-mapnik: BSD license - Copyright (c) 2010-2012, Dane Springmeyer +- mapnik: LGPL license - Copyright (c) Free Software Foundation, Inc. +- mapnik-vector-tile - Copyright (c) MapBox +- async: MIT license - Copyright (c) 2010-2016 Caolan McMahon +- node-tilejson: Copyright (c) 2011, Development Seed +etc. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright notice, this + list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. +- Neither the name "Klokan Technologies GmbH" nor the names of its contributors may be + used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/org.simantics.maps.server/server/tileserver-mapnik/README.md b/org.simantics.maps.server/server/tileserver-mapnik/README.md new file mode 100644 index 00000000..7d1daa2f --- /dev/null +++ b/org.simantics.maps.server/server/tileserver-mapnik/README.md @@ -0,0 +1,52 @@ +# tileserver-mapnik + +Mapnik-based tile server generating raster tiles from tilelive-js sources (MapBox Studio project + custom vector tiles for example). +It supports also static maps API. + +## How to use + +### Docker + +The easiest way to run tileserver-mapnik is using the precompiled docker container (https://hub.docker.com/r/klokantech/tileserver-mapnik/). + +Detailed instructions how to use the tileserver-mapnik with docker: http://osm2vectortiles.org/docs/serve-raster-tiles-docker + +### Without docker + +Follow the commands in `Dockerfile` to install the necessary packages, download common fonts and prepare the environment. + +Usage: `node bin/tessera.js [options]` + +Options: + - `-c CONFIG` - Configuration file + - `-p PORT` - HTTP port [8080] + - `-C SIZE` - Cache size in MB [10] + - `-S SIZE` - Source cache size (in # of sources) [10] + +#### Example configuration file + +```javascript +{ + "/style1": { + "source": "tmstyle://./style1.tm2" + }, + "/style2": { + "source": "tmstyle:///home/user/style2.tm2" + }, + "/vector": { + "source": "mbtiles:///home/user/data.mbtiles" + } +} +``` + +**Note**: For tm2 styles, you need to make sure the content of style's `project.yml` (its `source` property) points to a valid mbtiles file (e.g. `source: "mbtiles://./data.mbtiles"`). + +## Available URLs + +- If you visit the server on the configured port (default 8080) you should see your maps appearing in the browser. +- The tiles itself are served at `/{basename}/{z}/{x}/{y}[@2x].{format}` + - The optional `@2x` part can be used to render HiDPI (retina) tiles +- Static images are rendered at: + - `/{basename}/static/{lon},{lat},{zoom}/{width}x{height}[@2x].{format}` (center-based) + - `/{basename}/static/{minx},{miny},{maxx},{maxy}/{zoom}[@2x].{format}` (area-based) +- TileJSON at `/{basename}/index.json` diff --git a/org.simantics.maps.server/server/tileserver-mapnik/lib/app.js b/org.simantics.maps.server/server/tileserver-mapnik/lib/app.js new file mode 100644 index 00000000..f9a3bbed --- /dev/null +++ b/org.simantics.maps.server/server/tileserver-mapnik/lib/app.js @@ -0,0 +1,346 @@ +"use strict"; + +var crypto = require("crypto"), + path = require("path"), + url = require("url"), + util = require("util"); + +var abaculus = require("abaculus"), + cachecache = require("cachecache"), + clone = require("clone"), + debug = require("debug"), + express = require("express"), + handlebars = require("handlebars"), + mercator = new (require("sphericalmercator"))(); + +var tessera = require("./index"); + +debug = debug("tessera"); + +var FLOAT_PATTERN = "[+-]?(?:\\d+|\\d+\.?\\d+)"; +var SCALE_PATTERN = "@[23]x"; + +// TODO a more complete implementation of this exists...somewhere +var getExtension = function(format) { + // trim PNG variant info + switch ((format || "").replace(/^(png).*/, "$1")) { + case "png": + return "png"; + + default: + return format; + } +}; + +var getScale = function(scale) { + return (scale || "@1x").slice(1, 2) | 0; +}; + +var getTileUrls = function(domains, host, path, tilePath, format, key, protocol) { + domains = domains && domains.length > 0 ? domains : [host]; + var query = (key && key.length > 0) ? ("?key=" + key) : ""; + if (path == "/") { + path = ""; + } + + if (protocol != "https") { + protocol = "http"; + } + + var uris = []; + domains.forEach(function(domain) { + uris.push(protocol + "://" + domain + path + + tilePath.replace("{format}", getExtension(format)).replace(/\/+/g, "/") + + query); + }); + + return uris; +}; + +var normalizeHeaders = function(headers) { + var _headers = {}; + + Object.keys(headers).forEach(function(x) { + _headers[x.toLowerCase()] = headers[x]; + }); + + return _headers; +}; + +var md5sum = function(data) { + var hash = crypto.createHash("md5"); + hash.update(data); + return hash.digest(); +}; + +module.exports = function(tilelive, options) { + var app = express().disable("x-powered-by"), + templates = {}, + uri = options, + domains = [], + tilePath = "/{z}/{x}/{y}.{format}", + tilePattern; + + app.use(cachecache()); + + if (typeof options === "object") { + uri = options.source; + tilePath = options.tilePath || tilePath; + + if (options.domains && options.domains.length > 0) { + domains = options.domains.split(','); + } + + Object.keys(options.headers || {}).forEach(function(name) { + templates[name] = handlebars.compile(options.headers[name]); + + // attempt to parse so we can fail fast + try { + templates[name](); + } catch (e) { + console.error("'%s' header is invalid:", name); + console.error(e.message); + process.exit(1); + } + }); + } + + if (typeof uri === "string") { + uri = url.parse(uri, true); + } else { + uri = clone(uri); + } + + tilePattern = tilePath + .replace(/\.(?!.*\.)/, ":scale(" + SCALE_PATTERN + ")?.") + .replace(/\./g, "\.") + .replace("{z}", ":z(\\d+)") + .replace("{x}", ":x(\\d+)") + .replace("{y}", ":y(\\d+)") + .replace("{format}", ":format([\\w\\.]+)"); + + var populateHeaders = function(headers, params, extras) { + Object.keys(extras || {}).forEach(function(k) { + params[k] = extras[k]; + }); + + Object.keys(templates).forEach(function(name) { + var val = templates[name](params); + + if (val) { + headers[name.toLowerCase()] = val; + } + }); + + return headers; + }; + + // warm the cache + tilelive.load(uri); + + var sourceURIs = { + 1: uri + }; + + [2, 3].forEach(function(scale) { + var retinaURI = clone(uri); + + retinaURI.query.scale = scale; + // explicitly tell tilelive-mapnik to use larger tiles + retinaURI.query.tileSize = scale * 256; + + sourceURIs[scale] = retinaURI; + }); + + var getTile = function(z, x, y, scale, format, callback) { + var sourceURI = sourceURIs[scale], + params = { + tile: { + zoom: z, + x: x, + y: y, + format: format, + retina: scale > 1, + scale: scale + } + }; + + return tilelive.load(sourceURI, function(err, source) { + if (err) { + return callback(err); + } + + return tessera.getInfo(source, function(err, info) { + if (err) { + return callback(err); + } + + // validate format / extension + var ext = getExtension(info.format); + + if (ext !== format) { + debug("Invalid format '%s', expected '%s'", format, ext); + return callback(null, null, populateHeaders({}, params, { 404: true, invalidFormat: true })); + } + + // validate zoom + if (z < info.minzoom || z > info.maxzoom) { + debug("Invalid zoom:", z); + return callback(null, null, populateHeaders({}, params, { 404: true, invalidZoom: true })); + } + + // validate coords against bounds + var xyz = mercator.xyz(info.bounds, z); + + if (x < xyz.minX || + x > xyz.maxX || + y < xyz.minY || + y > xyz.maxY) { + debug("Invalid coordinates: %d,%d relative to bounds:", x, y, xyz); + return callback(null, null, populateHeaders({}, params, { 404: true, invalidCoordinates: true })); + } + + return source.getTile(z, x, y, function(err, data, headers) { + headers = normalizeHeaders(headers || {}); + + if (err) { + if (err.message.match(/Tile|Grid does not exist/)) { + return callback(null, null, populateHeaders(headers, params, { 404: true })); + } + + return callback(err); + } + + if (data === null || data === undefined) { + return callback(null, null, populateHeaders(headers, params, { 404: true })); + } + + if (!headers["content-md5"]) { + headers["content-md5"] = md5sum(data).toString("base64"); + } + + // work-around for PBF MBTiles that don't contain appropriate headers + if (ext === "pbf") { + headers["content-type"] = headers["content-type"] || "application/x-protobuf"; + headers["content-encoding"] = headers["content-encoding"] || "gzip"; + } + + return callback(null, data, populateHeaders(headers, params, { 200: true })); + }); + }); + }); + }; + + app.get(tilePattern, function(req, res, next) { + var z = req.params.z | 0, + x = req.params.x | 0, + y = req.params.y | 0, + scale = getScale(req.params.scale), + format = req.params.format; + return getTile(z, x, y, scale, format, function(err, data, headers) { + if (err) { + return next(err); + } + if (data == null) { + return res.status(404).send('Not found'); + } else { + res.set(headers); + return res.status(200).send(data); + } + }, res, next); + }); + + var processStaticMap = function(areaParams, req, res, next) { + var scale = getScale(req.params.scale), + format = req.params.format, + params = { + zoom: req.params.z | 0, + scale: scale, + bbox: areaParams.bbox, + center: areaParams.center, + format: format, + getTile: function(z, x, y, callback) { + return getTile(z, x, y, scale, format, function(err, data, headers) { + if (!err && data == null) { + err = new Error('Not found'); + err.status = 404; + } + callback(err, data, headers); + }); + } + }; + return abaculus(params, function(err, data, headers) { + if (err && !err.status) { + return next(err); + } + res.set(headers); + res.status((err && err.status) || 200); + return res.send((err && err.message) || data); + }); + }; + + var staticPattern = "/static/%s:scale(" + SCALE_PATTERN + ")?\.:format([\\w\\.]+)"; + + var centerPattern = util.format(':lon(%s),:lat(%s),:z(\\d+)/:width(\\d+)x:height(\\d+)', + FLOAT_PATTERN, FLOAT_PATTERN); + + app.get(util.format(staticPattern, centerPattern), function(req, res, next) { + return processStaticMap({ + center: { + x: +req.params.lon, + y: +req.params.lat, + w: req.params.width | 0, + h: req.params.height | 0 + } + }, req, res, next); + }); + + var boundsPattern = util.format(':minx(%s),:miny(%s),:maxx(%s),:maxy(%s)/:z(\\d+)', + FLOAT_PATTERN, FLOAT_PATTERN, FLOAT_PATTERN, FLOAT_PATTERN); + + app.get(util.format(staticPattern, boundsPattern), function(req, res, next) { + return processStaticMap({ + bbox: [ + +req.params.minx, + +req.params.miny, + +req.params.maxx, + +req.params.maxy + ] + }, req, res, next); + }); + + app.get("/index.json", function(req, res, next) { + var params = { + tileJSON: true + }; + + return tilelive.load(uri, function(err, source) { + if (err) { + return next(err); + } + + return tessera.getInfo(source, function(err, info) { + if (err) { + return next(err); + } + + var prefix = path.dirname(req.originalUrl); + if (prefix.length > 1) { + info.basename = prefix.substr(1); + } + + info.tiles = getTileUrls(domains, req.headers.host, prefix, + tilePath, info.format, + req.query.key, req.protocol); + info.tilejson = "2.0.0"; + + res.set(populateHeaders({}, params, { 200: true })); + return res.send(info); + }); + }); + }); + + return app; +}; + +module.exports.getTileUrls = getTileUrls; diff --git a/org.simantics.maps.server/server/tileserver-mapnik/lib/index.js b/org.simantics.maps.server/server/tileserver-mapnik/lib/index.js new file mode 100644 index 00000000..40a02f1e --- /dev/null +++ b/org.simantics.maps.server/server/tileserver-mapnik/lib/index.js @@ -0,0 +1,33 @@ +"use strict"; + +module.exports.getInfo = function(source, callback) { + return source.getInfo(function(err, _info) { + if (err) { + return callback(err); + } + + var info = {}; + + Object.keys(_info).forEach(function(key) { + info[key] = _info[key]; + }); + + if (info.vector_layers) { + info.format = "pbf"; + info.scheme = undefined; + } else { + info.autoscale = true; + } + + info.name = info.name || "Untitled"; + info.center = info.center || [-122.4440, 37.7908, 12]; + info.bounds = info.bounds || [-180, -85.0511, 180, 85.0511]; + info.format = info.format || "png"; + info.minzoom = Math.max(0, info.minzoom | 0); + info.maxzoom = info.maxzoom || Infinity; + + info.type = "baselayer"; + + return callback(null, info); + }); +}; diff --git a/org.simantics.maps.server/server/tileserver-mapnik/package.json b/org.simantics.maps.server/server/tileserver-mapnik/package.json new file mode 100644 index 00000000..f9f8665f --- /dev/null +++ b/org.simantics.maps.server/server/tileserver-mapnik/package.json @@ -0,0 +1,36 @@ +{ + "name": "tileserver-tessera", + "version": "0.8.0", + "description": "A tilelive-based tile server", + "main": "lib/app.js", + "bin": "bin/tessera.js", + "authors": [ + "Seth Fitzsimmons <seth@mojodna.net>", + "Petr Sloup <petr.sloup@klokantech.com>" + ], + "license": "BSD-2-Clause", + "repository": { + "type": "git", + "url": "https://github.com/klokantech/tileserver-tessera.git" + }, + "dependencies": { + "abaculus": "^1.2.1", + "async": "^1.5.0", + "cachecache": "^1.0.1", + "clone": "^1.0.2", + "cors": "^2.5.2", + "debug": "^2.1.3", + "express": "^4.10.3", + "handlebars": "^4.0.5", + "morgan": "^1.5.0", + "nomnom": "^1.8.1", + "response-time": "^2.2.0", + "sphericalmercator": "^1.0.2", + "mbtiles": "^0.9.0", + "tilelive": "^5.3.3", + "tilelive-cache": "^0.6.1", + "tilelive-modules": "^0.2.0", + "tilelive-tmstyle": "^0.6.0", + "tilelive-vector": "^3.9.4" + } +} diff --git a/org.simantics.maps.server/server/tileserver-mapnik/public/index.html b/org.simantics.maps.server/server/tileserver-mapnik/public/index.html new file mode 100644 index 00000000..1b25fd46 --- /dev/null +++ b/org.simantics.maps.server/server/tileserver-mapnik/public/index.html @@ -0,0 +1,30 @@ +<!DOCTYPE html> +<html> +<head> + <meta charset="UTF-8"> + <link rel="stylesheet" type="text/css" href="//cdn.klokantech.com/tileviewer/v1/index.css" /> + <link href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACF0Z8AhdGfBIXRnwaF0Z8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACF0Z8AhdGfCIXRn3GF0Z+QhdGfFYXRnwCF0Z8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACF0Z8AhdGfDIXRn4mF0Z/3hdGf/oXRn7CF0Z8ghdGfAIXRnwAAAAAAAAAAAAAAAAAAAAAAAAAAAIXRnwCF0Z8AhdGfDoXRn5GF0Z/7hdGf/4XRn/+F0Z//hdGfvoXRnyaF0Z8AhdGfAAAAAAAAAAAAAAAAAIXRnwCF0Z8AhdGfBYXRn3+F0Z/7hdGf/4XRn/+F0Z//hdGf/4XRn/+F0Z+1hdGfFYXRnwCF0Z8AAAAAAAAAAACF0Z8AhdGfEoXRn42F0Z+jhdGft4XRn/CF0Z//hdGf/4XRn/qF0Z/GhdGfnIXRn46F0Z8ahdGfAIXRnwCF0Z8AhdGfCoXRn5KF0Z/9hdGf+YXRn8qF0Z+dhdGfx4XRn+OF0Z+mhdGfqIXRn+yF0Z//hdGfq4XRnxaF0Z8AhdGfBIXRn3iF0Z/5hdGf/4XRn/+F0Z//hdGf4IXRn2mF0Z9chdGfroXRn/2F0Z//hdGf/4XRn/6F0Z+bhdGfDoXRn2OF0Z/vhdGf/4XRn/+F0Z/+hdGf0IXRn4qF0Z+2hdGf24XRn5mF0Z+vhdGf9YXRn/+F0Z//hdGf9oXRn3aF0Z9DhdGfgIXRn7KF0Z/bhdGfpoXRn4OF0Z/fhdGf/4XRn/+F0Z/5hdGfuoXRn5SF0Z/JhdGfqoXRn2mF0Z8shdGfAIXRnwCF0Z8EhdGfKoXRn5KF0Z/xhdGf/4XRn/+F0Z//hdGf/4XRn/+F0Z/ZhdGfYoXRnwaF0Z8AAAAAAAAAAACF0Z8AhdGfEYXRn5uF0Z/8hdGf/4XRn/+F0Z//hdGf/4XRn/+F0Z//hdGf/4XRn+uF0Z9hhdGfAoXRnwAAAAAAhdGfAIXRnxeF0Z9YhdGfcYXRn5KF0Z+1hdGf14XRn9+F0Z+6hdGfmYXRn32F0Z9lhdGfQYXRnwWF0Z8AAAAAAAAAAAAAAAAAAAAAAIXRnwCF0Z8AhdGfBoXRnxiF0Z8fhdGfCIXRnwCF0Z8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/n8AAPw/AAD4HwAA8A8AAOAHAADAAwAAgAEAAAAAAAAAAAAAAAAAAMADAADAAQAAwAEAAPgfAAD//wAA//8AAA==" rel="icon" type="image/x-icon" /> + <title>TileServer - Maps rendered from vector tiles + + + + + + diff --git a/org.simantics.maps.server/server/tileserver-mapnik/run.sh b/org.simantics.maps.server/server/tileserver-mapnik/run.sh new file mode 100644 index 00000000..77e57203 --- /dev/null +++ b/org.simantics.maps.server/server/tileserver-mapnik/run.sh @@ -0,0 +1,120 @@ +#!/bin/bash +set -o errexit +set -o pipefail +set -o nounset + +readonly DOMAINS=${DOMAINS} +readonly SOURCE_DATA_DIR=${SOURCE_DATA_DIR:-/data} +readonly DEST_DATA_DIR=${DEST_DATA_DIR:-/project} +readonly TESSERA_CONFIG="$DEST_DATA_DIR/config.json" + +readonly PORT=${PORT:-80} +readonly CACHE_SIZE=${CACHE_SIZE:-10} +readonly SOURCE_CACHE_SIZE=${SOURCE_CACHE_SIZE:-10} + +function serve_xray() { + local mbtiles_file=$1 + exec bin/tessera.js "xray+mbtiles://$mbtiles_file" \ + --PORT $PORT \ + --cache-size $CACHE_SIZE \ + --source-cache-size $SOURCE_CACHE_SIZE +} + +function find_first_mbtiles() { + for mbtiles_file in "$SOURCE_DATA_DIR"/*.mbtiles; do + echo "${mbtiles_file}" + break + done +} + +function find_first_tm2() { + for tm2project in "$SOURCE_DATA_DIR"/*.tm2/; do + echo "${tm2project}" + break + done +} + +function tessera_config_entry() { + local tm2project=$1 + local serve_dir=${tm2project%.tm2} + local serve_path=${serve_dir##*/} + + echo "\"/${serve_path}\": {\"source\":\"tmstyle://${tm2project}\", \"domains\": \"${DOMAINS}\"}," >> "$TESSERA_CONFIG" + echo "Serving ${tm2project##*/} at $serve_path" +} + +function create_tessera_config() { + local mbtiles_file=$1 + rm -f "$TESSERA_CONFIG" + echo '{' >> "$TESSERA_CONFIG" + for tm2project in "$DEST_DATA_DIR"/*.tm2; do + tessera_config_entry "${tm2project}" + done + + ## Remove trailing comma unless adding vector tile source (below) + #truncate --size=-2 "$TESSERA_CONFIG" + # Always serve the vector tile source + echo "\"/$(basename ${mbtiles_file%.*})\": {\"source\":\"mbtiles://${mbtiles_file}\", \"domains\": \"${DOMAINS}\"}" >> "$TESSERA_CONFIG" + + echo '}' >> "$TESSERA_CONFIG" +} + +function replace_sources() { + mbtiles_file=$1 + local vectortiles_name=${mbtiles_file%.mbtiles} + + for project_dir in "$SOURCE_DATA_DIR"/*.tm2; do + local project_name="${project_dir##*/}" + local project_config_file="${project_dir%%/}/project.yml" + + if [ "${vectortiles_name##*/}" = "${project_name%.*}" ]; then + echo "Name collision. The mbtiles and tm2 project can not have the same name." + exit 403 + fi + + # project config will be copied to new folder because we + # modify the source configuration of the style and don't want + # that to effect the original file + dest_project_dir="${DEST_DATA_DIR%%/}/$project_name" + local dest_project_config_file="${dest_project_dir%%/}/project.yml" + cp -rf "$project_dir" "$dest_project_dir" + + # replace external vector tile sources with mbtiles source + # this allows developing rapidyl with an external source and then use the + # mbtiles for dependency free deployment + echo "Associating $vectortiles_name with $project_name" + replace_expr="s|source: \".*\"|source: \"mbtiles://$mbtiles_file\"|g" + sed -e "$replace_expr" $project_config_file > $dest_project_config_file + done +} + +function serve_config() { + exec bin/tessera.js -c "$TESSERA_CONFIG" \ + --PORT "$PORT" \ + --cache-size "$CACHE_SIZE" \ + --source-cache-size "$SOURCE_CACHE_SIZE" +} + +function serve() { + local mbtiles_file=$(find_first_mbtiles) + local tm2project=$(find_first_tm2) + echo "------- Find additional information on how to use this container under the following link: http://osm2vectortiles.org/docs/start" + if [ -f "$mbtiles_file" ]; then + echo "Using $mbtiles_file as vector tile source" + if [ -d "$tm2project" ]; then + replace_sources "$mbtiles_file" + create_tessera_config "$mbtiles_file" + serve_config + else + echo "The mbtiles file is now served with X-Ray styles" + serve_xray "$mbtiles_file" + fi + else + # Serve empty config + rm -f "$TESSERA_CONFIG" + echo '{}' >> "$TESSERA_CONFIG" + serve_config + fi +} + +serve diff --git a/org.simantics.maps.server/server/tileserver-mapnik/server.js b/org.simantics.maps.server/server/tileserver-mapnik/server.js new file mode 100644 index 00000000..4013c6d7 --- /dev/null +++ b/org.simantics.maps.server/server/tileserver-mapnik/server.js @@ -0,0 +1,157 @@ +#!/usr/bin/env node +"use strict"; + +// increase the libuv threadpool size to 1.5x the number of logical CPUs. +process.env.UV_THREADPOOL_SIZE = process.env.UV_THREADPOOL_SIZE || Math.ceil(Math.max(4, require('os').cpus().length * 1.5)); + +var fs = require("fs"), + path = require("path"); + +var async = require("async"), + cors = require("cors"), + debug = require("debug"), + express = require("express"), + morgan = require("morgan"), + responseTime = require("response-time"); + +var serve = require("./lib/app"), + tessera = require("./lib/index"); + +debug = debug("tessera"); + +module.exports = function(opts, callback) { + var app = express().disable("x-powered-by"), + tilelive = require("tilelive-cache")(require("tilelive"), { + size: process.env.CACHE_SIZE || opts.cacheSize, + sources: process.env.SOURCE_CACHE_SIZE || opts.sourceCacheSize + }); + + app.enable('trust proxy'); + + callback = callback || function() {}; + + // load and register tilelive modules + require("tilelive-modules/loader")(tilelive, opts); + + if (process.env.NODE_ENV !== "production") { + // TODO configurable logging per-style + app.use(morgan("dev")); + } + + if (opts.uri) { + app.use(responseTime()); + app.use(cors()); + app.use(express.static(path.join(__dirname, "public"))); + app.use(express.static(path.join(__dirname, "bower_components"))); + app.use(serve(tilelive, opts.uri)); + + tilelive.load(opts.uri, function(err, src) { + if (err) { + throw err; + } + + return tessera.getInfo(src, function(err, info) { + if (err) { + debug(err.stack); + return; + } + + if (info.format === "pbf") { + app.use("/_", serve(tilelive, "xray+" + opts.uri)); + app.use("/_", express.static(path.join(__dirname, "public"))); + app.use("/_", express.static(path.join(__dirname, "bower_components"))); + } + }); + }); + } + + if (opts.config) { + var configPath = path.resolve(opts.config), + stats = fs.statSync(configPath), + config = {}; + + if (stats.isFile()) { + config = require(configPath); + } else if (stats.isDirectory()) { + config = fs.readdirSync(configPath) + .filter(function(filename) { + return path.extname(filename) === ".json"; + }) + .reduce(function(config, filename) { + var localConfig = require(path.join(configPath, filename)); + + return Object.keys(localConfig).reduce(function(config, k) { + config[k] = localConfig[k]; + + return config; + }, config); + }, config); + } + + Object.keys(config).forEach(function(prefix) { + if (config[prefix].timing !== false) { + app.use(prefix, responseTime()); + } + + if (config[prefix].cors !== false) { + app.use(prefix, cors()); + } + + //app.use(prefix, express.static(path.join(__dirname, "public"))); + //app.use(prefix, express.static(path.join(__dirname, "bower_components"))); + app.use(prefix, serve(tilelive, config[prefix])); + }); + + // serve index.html even on the root + app.use("/", express.static(path.join(__dirname, "public"))); + app.use("/", express.static(path.join(__dirname, "bower_components"))); + + // aggregate index.json on root for multiple sources + app.get("/index.json", function(req, res, next) { + var queue = []; + Object.keys(config).forEach(function(prefix) { + queue.push(function(callback) { + var url = config[prefix].source || config[prefix]; + tilelive.load(url, function(err, source) { + if (err) { + throw err; + } + + tessera.getInfo(source, function(err, info) { + if (err) { + throw err; + } + + var domains = [], + tilePath = config[prefix].tilePath || "/{z}/{x}/{y}.{format}"; + + if (config[prefix].domains && config[prefix].domains.length > 0) { + domains = config[prefix].domains.split(','); + } + + if (prefix.length > 1) { + info.basename = prefix.substr(1); + } + + info.tiles = serve.getTileUrls(domains, req.headers.host, prefix, + tilePath, info.format, + req.query.key, req.protocol); + info.tilejson = "2.0.0"; + + callback(null, info); + }); + }); + }); + }); + return async.parallel(queue, function(err, results) { + return res.send(results); + }); + }); + } + + app.listen(process.env.PORT || opts.port, function() { + console.log("Listening at http://%s:%d/", this.address().address, this.address().port); + + return callback(); + }); +}; diff --git a/org.simantics.maps.server/server/tileserver.bat b/org.simantics.maps.server/server/tileserver.bat new file mode 100644 index 00000000..c23a1b88 --- /dev/null +++ b/org.simantics.maps.server/server/tileserver.bat @@ -0,0 +1 @@ +set MAPNIK_FONT_PATH=%~dp0fonts&&set ICU_DATA=%~dp0node_modules\abaculus\node_modules\mapnik\lib\binding\node-v46-win32-x64\share\icu&&node.exe bin\tessera.js -c config.json \ No newline at end of file diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/HEAD b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/HEAD new file mode 100644 index 00000000..cb089cd8 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/HEAD @@ -0,0 +1 @@ +ref: refs/heads/master diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/config b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/config new file mode 100644 index 00000000..7fc4f734 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/config @@ -0,0 +1,13 @@ +[core] + repositoryformatversion = 0 + filemode = false + bare = false + logallrefupdates = true + symlinks = false + ignorecase = true +[remote "origin"] + url = https://github.com/openmaptiles/mapbox-studio-light.tm2.git + fetch = +refs/heads/*:refs/remotes/origin/* +[branch "master"] + remote = origin + merge = refs/heads/master diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/description b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/description new file mode 100644 index 00000000..498b267a --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/description @@ -0,0 +1 @@ +Unnamed repository; edit this file 'description' to name the repository. diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/hooks/applypatch-msg.sample b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/hooks/applypatch-msg.sample new file mode 100644 index 00000000..a5d7b84a --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/hooks/applypatch-msg.sample @@ -0,0 +1,15 @@ +#!/bin/sh +# +# An example hook script to check the commit log message taken by +# applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. The hook is +# allowed to edit the commit message file. +# +# To enable this hook, rename this file to "applypatch-msg". + +. git-sh-setup +commitmsg="$(git rev-parse --git-path hooks/commit-msg)" +test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} +: diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/hooks/commit-msg.sample b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/hooks/commit-msg.sample new file mode 100644 index 00000000..b58d1184 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/hooks/commit-msg.sample @@ -0,0 +1,24 @@ +#!/bin/sh +# +# An example hook script to check the commit log message. +# Called by "git commit" with one argument, the name of the file +# that has the commit message. The hook should exit with non-zero +# status after issuing an appropriate message if it wants to stop the +# commit. The hook is allowed to edit the commit message file. +# +# To enable this hook, rename this file to "commit-msg". + +# Uncomment the below to add a Signed-off-by line to the message. +# Doing this in a hook is a bad idea in general, but the prepare-commit-msg +# hook is more suited to it. +# +# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" + +# This example catches duplicate Signed-off-by lines. + +test "" = "$(grep '^Signed-off-by: ' "$1" | + sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { + echo >&2 Duplicate Signed-off-by lines. + exit 1 +} diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/hooks/post-update.sample b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/hooks/post-update.sample new file mode 100644 index 00000000..ec17ec19 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/hooks/post-update.sample @@ -0,0 +1,8 @@ +#!/bin/sh +# +# An example hook script to prepare a packed repository for use over +# dumb transports. +# +# To enable this hook, rename this file to "post-update". + +exec git update-server-info diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/hooks/pre-applypatch.sample b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/hooks/pre-applypatch.sample new file mode 100644 index 00000000..4142082b --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/hooks/pre-applypatch.sample @@ -0,0 +1,14 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed +# by applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-applypatch". + +. git-sh-setup +precommit="$(git rev-parse --git-path hooks/pre-commit)" +test -x "$precommit" && exec "$precommit" ${1+"$@"} +: diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/hooks/pre-commit.sample b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/hooks/pre-commit.sample new file mode 100644 index 00000000..68d62d54 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/hooks/pre-commit.sample @@ -0,0 +1,49 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed. +# Called by "git commit" with no arguments. The hook should +# exit with non-zero status after issuing an appropriate message if +# it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-commit". + +if git rev-parse --verify HEAD >/dev/null 2>&1 +then + against=HEAD +else + # Initial commit: diff against an empty tree object + against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 +fi + +# If you want to allow non-ASCII filenames set this variable to true. +allownonascii=$(git config --bool hooks.allownonascii) + +# Redirect output to stderr. +exec 1>&2 + +# Cross platform projects tend to avoid non-ASCII filenames; prevent +# them from being added to the repository. We exploit the fact that the +# printable range starts at the space character and ends with tilde. +if [ "$allownonascii" != "true" ] && + # Note that the use of brackets around a tr range is ok here, (it's + # even required, for portability to Solaris 10's /usr/bin/tr), since + # the square bracket bytes happen to fall in the designated range. + test $(git diff --cached --name-only --diff-filter=A -z $against | + LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 +then + cat <<\EOF +Error: Attempt to add a non-ASCII file name. + +This can cause problems if you want to work with people on other platforms. + +To be portable it is advisable to rename the file. + +If you know what you are doing you can disable this check using: + + git config hooks.allownonascii true +EOF + exit 1 +fi + +# If there are whitespace errors, print the offending file names and fail. +exec git diff-index --check --cached $against -- diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/hooks/pre-push.sample b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/hooks/pre-push.sample new file mode 100644 index 00000000..6187dbf4 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/hooks/pre-push.sample @@ -0,0 +1,53 @@ +#!/bin/sh + +# An example hook script to verify what is about to be pushed. Called by "git +# push" after it has checked the remote status, but before anything has been +# pushed. If this script exits with a non-zero status nothing will be pushed. +# +# This hook is called with the following parameters: +# +# $1 -- Name of the remote to which the push is being done +# $2 -- URL to which the push is being done +# +# If pushing without using a named remote those arguments will be equal. +# +# Information about the commits which are being pushed is supplied as lines to +# the standard input in the form: +# +# +# +# This sample shows how to prevent push of commits where the log message starts +# with "WIP" (work in progress). + +remote="$1" +url="$2" + +z40=0000000000000000000000000000000000000000 + +while read local_ref local_sha remote_ref remote_sha +do + if [ "$local_sha" = $z40 ] + then + # Handle delete + : + else + if [ "$remote_sha" = $z40 ] + then + # New branch, examine all commits + range="$local_sha" + else + # Update to existing branch, examine new commits + range="$remote_sha..$local_sha" + fi + + # Check for WIP commit + commit=`git rev-list -n 1 --grep '^WIP' "$range"` + if [ -n "$commit" ] + then + echo >&2 "Found WIP commit in $local_ref, not pushing" + exit 1 + fi + fi +done + +exit 0 diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/hooks/pre-rebase.sample b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/hooks/pre-rebase.sample new file mode 100644 index 00000000..9773ed4c --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/hooks/pre-rebase.sample @@ -0,0 +1,169 @@ +#!/bin/sh +# +# Copyright (c) 2006, 2008 Junio C Hamano +# +# The "pre-rebase" hook is run just before "git rebase" starts doing +# its job, and can prevent the command from running by exiting with +# non-zero status. +# +# The hook is called with the following parameters: +# +# $1 -- the upstream the series was forked from. +# $2 -- the branch being rebased (or empty when rebasing the current branch). +# +# This sample shows how to prevent topic branches that are already +# merged to 'next' branch from getting rebased, because allowing it +# would result in rebasing already published history. + +publish=next +basebranch="$1" +if test "$#" = 2 +then + topic="refs/heads/$2" +else + topic=`git symbolic-ref HEAD` || + exit 0 ;# we do not interrupt rebasing detached HEAD +fi + +case "$topic" in +refs/heads/??/*) + ;; +*) + exit 0 ;# we do not interrupt others. + ;; +esac + +# Now we are dealing with a topic branch being rebased +# on top of master. Is it OK to rebase it? + +# Does the topic really exist? +git show-ref -q "$topic" || { + echo >&2 "No such branch $topic" + exit 1 +} + +# Is topic fully merged to master? +not_in_master=`git rev-list --pretty=oneline ^master "$topic"` +if test -z "$not_in_master" +then + echo >&2 "$topic is fully merged to master; better remove it." + exit 1 ;# we could allow it, but there is no point. +fi + +# Is topic ever merged to next? If so you should not be rebasing it. +only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` +only_next_2=`git rev-list ^master ${publish} | sort` +if test "$only_next_1" = "$only_next_2" +then + not_in_topic=`git rev-list "^$topic" master` + if test -z "$not_in_topic" + then + echo >&2 "$topic is already up-to-date with master" + exit 1 ;# we could allow it, but there is no point. + else + exit 0 + fi +else + not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` + /usr/bin/perl -e ' + my $topic = $ARGV[0]; + my $msg = "* $topic has commits already merged to public branch:\n"; + my (%not_in_next) = map { + /^([0-9a-f]+) /; + ($1 => 1); + } split(/\n/, $ARGV[1]); + for my $elem (map { + /^([0-9a-f]+) (.*)$/; + [$1 => $2]; + } split(/\n/, $ARGV[2])) { + if (!exists $not_in_next{$elem->[0]}) { + if ($msg) { + print STDERR $msg; + undef $msg; + } + print STDERR " $elem->[1]\n"; + } + } + ' "$topic" "$not_in_next" "$not_in_master" + exit 1 +fi + +exit 0 + +################################################################ + +This sample hook safeguards topic branches that have been +published from being rewound. + +The workflow assumed here is: + + * Once a topic branch forks from "master", "master" is never + merged into it again (either directly or indirectly). + + * Once a topic branch is fully cooked and merged into "master", + it is deleted. If you need to build on top of it to correct + earlier mistakes, a new topic branch is created by forking at + the tip of the "master". This is not strictly necessary, but + it makes it easier to keep your history simple. + + * Whenever you need to test or publish your changes to topic + branches, merge them into "next" branch. + +The script, being an example, hardcodes the publish branch name +to be "next", but it is trivial to make it configurable via +$GIT_DIR/config mechanism. + +With this workflow, you would want to know: + +(1) ... if a topic branch has ever been merged to "next". Young + topic branches can have stupid mistakes you would rather + clean up before publishing, and things that have not been + merged into other branches can be easily rebased without + affecting other people. But once it is published, you would + not want to rewind it. + +(2) ... if a topic branch has been fully merged to "master". + Then you can delete it. More importantly, you should not + build on top of it -- other people may already want to + change things related to the topic as patches against your + "master", so if you need further changes, it is better to + fork the topic (perhaps with the same name) afresh from the + tip of "master". + +Let's look at this example: + + o---o---o---o---o---o---o---o---o---o "next" + / / / / + / a---a---b A / / + / / / / + / / c---c---c---c B / + / / / \ / + / / / b---b C \ / + / / / / \ / + ---o---o---o---o---o---o---o---o---o---o---o "master" + + +A, B and C are topic branches. + + * A has one fix since it was merged up to "next". + + * B has finished. It has been fully merged up to "master" and "next", + and is ready to be deleted. + + * C has not merged to "next" at all. + +We would want to allow C to be rebased, refuse A, and encourage +B to be deleted. + +To compute (1): + + git rev-list ^master ^topic next + git rev-list ^master next + + if these match, topic has not merged in next at all. + +To compute (2): + + git rev-list master..topic + + if this is empty, it is fully merged to "master". diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/hooks/pre-receive.sample b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/hooks/pre-receive.sample new file mode 100644 index 00000000..a1fd29ec --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/hooks/pre-receive.sample @@ -0,0 +1,24 @@ +#!/bin/sh +# +# An example hook script to make use of push options. +# The example simply echoes all push options that start with 'echoback=' +# and rejects all pushes when the "reject" push option is used. +# +# To enable this hook, rename this file to "pre-receive". + +if test -n "$GIT_PUSH_OPTION_COUNT" +then + i=0 + while test "$i" -lt "$GIT_PUSH_OPTION_COUNT" + do + eval "value=\$GIT_PUSH_OPTION_$i" + case "$value" in + echoback=*) + echo "echo from the pre-receive-hook: ${value#*=}" >&2 + ;; + reject) + exit 1 + esac + i=$((i + 1)) + done +fi diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/hooks/prepare-commit-msg.sample b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/hooks/prepare-commit-msg.sample new file mode 100644 index 00000000..f093a02e --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/hooks/prepare-commit-msg.sample @@ -0,0 +1,36 @@ +#!/bin/sh +# +# An example hook script to prepare the commit log message. +# Called by "git commit" with the name of the file that has the +# commit message, followed by the description of the commit +# message's source. The hook's purpose is to edit the commit +# message file. If the hook fails with a non-zero status, +# the commit is aborted. +# +# To enable this hook, rename this file to "prepare-commit-msg". + +# This hook includes three examples. The first comments out the +# "Conflicts:" part of a merge commit. +# +# The second includes the output of "git diff --name-status -r" +# into the message, just before the "git status" output. It is +# commented because it doesn't cope with --amend or with squashed +# commits. +# +# The third example adds a Signed-off-by line to the message, that can +# still be edited. This is rarely a good idea. + +case "$2,$3" in + merge,) + /usr/bin/perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;; + +# ,|template,) +# /usr/bin/perl -i.bak -pe ' +# print "\n" . `git diff --cached --name-status -r` +# if /^#/ && $first++ == 0' "$1" ;; + + *) ;; +esac + +# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/hooks/update.sample b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/hooks/update.sample new file mode 100644 index 00000000..80ba9413 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/hooks/update.sample @@ -0,0 +1,128 @@ +#!/bin/sh +# +# An example hook script to block unannotated tags from entering. +# Called by "git receive-pack" with arguments: refname sha1-old sha1-new +# +# To enable this hook, rename this file to "update". +# +# Config +# ------ +# hooks.allowunannotated +# This boolean sets whether unannotated tags will be allowed into the +# repository. By default they won't be. +# hooks.allowdeletetag +# This boolean sets whether deleting tags will be allowed in the +# repository. By default they won't be. +# hooks.allowmodifytag +# This boolean sets whether a tag may be modified after creation. By default +# it won't be. +# hooks.allowdeletebranch +# This boolean sets whether deleting branches will be allowed in the +# repository. By default they won't be. +# hooks.denycreatebranch +# This boolean sets whether remotely creating branches will be denied +# in the repository. By default this is allowed. +# + +# --- Command line +refname="$1" +oldrev="$2" +newrev="$3" + +# --- Safety check +if [ -z "$GIT_DIR" ]; then + echo "Don't run this script from the command line." >&2 + echo " (if you want, you could supply GIT_DIR then run" >&2 + echo " $0 )" >&2 + exit 1 +fi + +if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then + echo "usage: $0 " >&2 + exit 1 +fi + +# --- Config +allowunannotated=$(git config --bool hooks.allowunannotated) +allowdeletebranch=$(git config --bool hooks.allowdeletebranch) +denycreatebranch=$(git config --bool hooks.denycreatebranch) +allowdeletetag=$(git config --bool hooks.allowdeletetag) +allowmodifytag=$(git config --bool hooks.allowmodifytag) + +# check for no description +projectdesc=$(sed -e '1q' "$GIT_DIR/description") +case "$projectdesc" in +"Unnamed repository"* | "") + echo "*** Project description file hasn't been set" >&2 + exit 1 + ;; +esac + +# --- Check types +# if $newrev is 0000...0000, it's a commit to delete a ref. +zero="0000000000000000000000000000000000000000" +if [ "$newrev" = "$zero" ]; then + newrev_type=delete +else + newrev_type=$(git cat-file -t $newrev) +fi + +case "$refname","$newrev_type" in + refs/tags/*,commit) + # un-annotated tag + short_refname=${refname##refs/tags/} + if [ "$allowunannotated" != "true" ]; then + echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2 + echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 + exit 1 + fi + ;; + refs/tags/*,delete) + # delete tag + if [ "$allowdeletetag" != "true" ]; then + echo "*** Deleting a tag is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/tags/*,tag) + # annotated tag + if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 + then + echo "*** Tag '$refname' already exists." >&2 + echo "*** Modifying a tag is not allowed in this repository." >&2 + exit 1 + fi + ;; + refs/heads/*,commit) + # branch + if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then + echo "*** Creating a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/heads/*,delete) + # delete branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/remotes/*,commit) + # tracking branch + ;; + refs/remotes/*,delete) + # delete tracking branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a tracking branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + *) + # Anything else (is there anything else?) + echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 + exit 1 + ;; +esac + +# --- Finished +exit 0 diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/index b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/index new file mode 100644 index 00000000..3968956d Binary files /dev/null and b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/index differ diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/info/exclude b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/info/exclude new file mode 100644 index 00000000..a5196d1b --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/info/exclude @@ -0,0 +1,6 @@ +# git ls-files --others --exclude-from=.git/info/exclude +# Lines that start with '#' are comments. +# For a project mostly in C, the following would be a good set of +# exclude patterns (uncomment them if you want to use them): +# *.[oa] +# *~ diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/logs/HEAD b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/logs/HEAD new file mode 100644 index 00000000..c2715368 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/logs/HEAD @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 c945fa2cdf525d4db1aa663892f9ba5110b855b0 jsimomaa 1485497520 +0200 clone: from https://github.com/openmaptiles/mapbox-studio-light.tm2.git diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/logs/refs/heads/master b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/logs/refs/heads/master new file mode 100644 index 00000000..c2715368 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/logs/refs/heads/master @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 c945fa2cdf525d4db1aa663892f9ba5110b855b0 jsimomaa 1485497520 +0200 clone: from https://github.com/openmaptiles/mapbox-studio-light.tm2.git diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/logs/refs/remotes/origin/HEAD b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/logs/refs/remotes/origin/HEAD new file mode 100644 index 00000000..c2715368 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/logs/refs/remotes/origin/HEAD @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 c945fa2cdf525d4db1aa663892f9ba5110b855b0 jsimomaa 1485497520 +0200 clone: from https://github.com/openmaptiles/mapbox-studio-light.tm2.git diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/objects/pack/pack-1be695309e6718c886dc8c2ece952cac03ffebcf.idx b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/objects/pack/pack-1be695309e6718c886dc8c2ece952cac03ffebcf.idx new file mode 100644 index 00000000..186cfa68 Binary files /dev/null and b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/objects/pack/pack-1be695309e6718c886dc8c2ece952cac03ffebcf.idx differ diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/objects/pack/pack-1be695309e6718c886dc8c2ece952cac03ffebcf.pack b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/objects/pack/pack-1be695309e6718c886dc8c2ece952cac03ffebcf.pack new file mode 100644 index 00000000..d166b2cb Binary files /dev/null and b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/objects/pack/pack-1be695309e6718c886dc8c2ece952cac03ffebcf.pack differ diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/packed-refs b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/packed-refs new file mode 100644 index 00000000..ae1060ab --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/packed-refs @@ -0,0 +1,9 @@ +# pack-refs with: peeled fully-peeled +f05d6218e8a85ab56a2f8a5a166e7414ac68d236 refs/remotes/origin/add-mapbox-namespace +c945fa2cdf525d4db1aa663892f9ba5110b855b0 refs/remotes/origin/master +685aaf8f7cdb92be1f6d150844ef99191968a205 refs/remotes/origin/version2 +e87a4e4b0d3af0bd9ea0e8437fca9d96332ec82a refs/tags/v1.0 +7939f6e3efd5515d110d240ccb03b7a95b6e0836 refs/tags/v1.1.0 +56c41fc6b7a1a1799cb63994f8c1a7c4e391b203 refs/tags/v2.0.0 +34b78853a13252f7851e6d0120ea494710bf34bb refs/tags/v2.1.0 +24841be8b339ae8b6e54dcfc93c3e649305a9a41 refs/tags/v2.1.1 diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/refs/heads/master b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/refs/heads/master new file mode 100644 index 00000000..6a820794 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/refs/heads/master @@ -0,0 +1 @@ +c945fa2cdf525d4db1aa663892f9ba5110b855b0 diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/refs/remotes/origin/HEAD b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/refs/remotes/origin/HEAD new file mode 100644 index 00000000..6efe28ff --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.git.bak/refs/remotes/origin/HEAD @@ -0,0 +1 @@ +ref: refs/remotes/origin/master diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.thumb.png b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.thumb.png new file mode 100644 index 00000000..e412c368 Binary files /dev/null and b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/.thumb.png differ diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/LICENSE.txt b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/LICENSE.txt new file mode 100644 index 00000000..ca8338be --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/LICENSE.txt @@ -0,0 +1,30 @@ +Copyright (c) 2014, Mapbox +Modifications copyright (c) 2016, KlokanTech.com & OpenMapTiles contributors. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of the Mapbox, Inc. nor the names of + its contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/README.md b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/README.md new file mode 100644 index 00000000..3895b712 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/README.md @@ -0,0 +1,3 @@ +Mapbox light +=========================== +Light basemap style for [Mapbox Studio](https://github.com/mapbox/mapbox-studio). diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/dot.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/dot.svg new file mode 100644 index 00000000..cd3d5acc --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/dot.svg @@ -0,0 +1,84 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/labels.mss b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/labels.mss new file mode 100644 index 00000000..44bbd9ec --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/labels.mss @@ -0,0 +1,240 @@ +// Country labels // +#place[class='country'][zoom>=2][zoom<=10] { + text-name: '[name_en]'; + text-face-name: @sans_bold; + text-placement: point; + text-size: 10; + text-fill: @text; + text-halo-fill: @land; + text-halo-radius: 1; + text-halo-rasterizer: fast; + text-wrap-width: 20; + text-wrap-before: true; + text-line-spacing: -3; + [rank=1] { + [zoom=3] { text-size: 12; text-wrap-width: 60; } + [zoom=4] { text-size: 14; text-wrap-width: 90; } + [zoom=5] { text-size: 20; text-wrap-width: 120; } + [zoom>=6] { text-size: 20; text-wrap-width: 120; } + } + [rank=2] { + [zoom=2] { text-name: [code]; } + [zoom=3] { text-size: 11; } + [zoom=4] { text-size: 13; } + [zoom=5] { text-size: 17; } + [zoom>=6] { text-size: 20; } + } + [rank=3] { + [zoom=3] { text-name: [code]; } + [zoom=4] { text-size: 11; } + [zoom=5] { text-size: 15; } + [zoom=6] { text-size: 17; } + [zoom=7] { text-size: 18; text-wrap-width: 60; } + [zoom>=8] { text-size: 20; text-wrap-width: 120; } + } + [rank=4] { + [zoom=5] { text-size: 13; } + [zoom=6] { text-size: 15; text-wrap-width: 60 } + [zoom=7] { text-size: 16; text-wrap-width: 90; } + [zoom=8] { text-size: 18; text-wrap-width: 120; } + [zoom>=9] { text-size: 20; text-wrap-width: 120; } + } + [rank=5] { + [zoom=5] { text-size: 11; } + [zoom=6] { text-size: 13; } + [zoom=7] { text-size: 14; text-wrap-width: 60; } + [zoom=8] { text-size: 16; text-wrap-width: 90; } + [zoom>=9] { text-size: 18; text-wrap-width: 120; } + } + [rank>=6] { + [zoom=7] { text-size: 12; } + [zoom=8] { text-size: 14; } + [zoom>=9] { text-size: 16; } + } +} + +// State labels // +#place[class='state'][zoom>=4][zoom<=10] { + text-name: [name_en]; + text-face-name: @sans; + text-placement: point; + text-fill: @fill2; + text-halo-fill: @land; + text-halo-radius: 1; + text-halo-rasterizer: fast; + text-size: 10; + + [zoom>=5][zoom<=6] { + [area>10000] { text-size: 12; } + [area>50000] { text-size: 14; } + text-wrap-width: 40; + } + [zoom>=7][zoom<=8] { + text-size: 14; + [area>50000] { text-size: 16; text-character-spacing: 1; } + [area>100000] { text-size: 18; text-character-spacing: 3; } + text-wrap-width: 60; + } + [zoom>=9][zoom<=10] { + text-halo-radius: 2; + text-size: 16; + text-character-spacing: 2; + [area>50000] { text-size: 18; text-character-spacing: 2; } + text-wrap-width: 100; + } +} + +// Display capital cities alongside stars. +#place::capitals[class='city'][capital=2][zoom<9] { + shield-file: url("star.svg"); + shield-name: '[name_en]'; + shield-face-name: @sans; + shield-size: 12; + shield-fill: @text; + shield-halo-fill: @land; + shield-halo-radius: 1; + shield-unlock-image: true; + shield-wrap-width: 80; + shield-line-spacing: -2; + + [zoom>=6] { shield-size: 16; } +} + +// Display low zoom cities alongside points. +#place[class='city'][rank<=4][zoom>=4][zoom<9] { + shield-name: '[name_en]'; + shield-face-name: @sans; + shield-size: 12; + shield-fill: @text; + shield-halo-fill: @land; + shield-halo-radius: 1; + shield-unlock-image: true; + shield-file: url("dot.svg"); + shield-wrap-width: 80; + shield-line-spacing: -2; + + [zoom>=6] { shield-size: 14; } + + // Emphasize major cities. + [rank<=6] { shield-size: 14; } + [zoom>=6][rank<=6] { shield-size: 16; } +} + +// Gradually replace shields with regular text labels. +#place[class='city'][rank<=4][zoom>=9] { + text-name: '[name_en]'; + text-face-name: @sans; + text-size: 14; + text-fill: @text; + text-halo-fill: @land; + text-halo-radius: 1; + text-min-distance: 4; + text-wrap-width: 80; + [rank<=3] { + text-fill: @text; + text-size: 20; + } +} + +// Mid priority place labels // +#place[class='town'][rank<=15][zoom>=10], +#place[class='village'][rank<=15][zoom>=12], +#place[class='hamlet'][rank<=15][zoom>=13], +#place[class='town'][rank<=15][zoom>=14], +#place[class='village'][rank<=15][zoom>=14], +#place[class='hamlet'][rank<=15][zoom>=14] { + text-name: '[name_en]'; + text-face-name: @sans; + text-size: 13; + text-fill: @text; + text-halo-fill: @land; + text-halo-radius: 2; + text-min-distance: 4; + text-wrap-width: 80; + [zoom>=12] { + text-size: 16; + text-fill: @text; + } +} + +// Low priority place labels // +#place[class='suburb'][rank<=15][zoom>=12], +#place[class='neighbourhood'][rank<=15][zoom>=13], +#place[class='suburb'][rank<=15][zoom>=14], +#place[class='neighbourhood'][rank<=15][zoom>=15] { + text-name: @name; + text-face-name: @sans; + text-size: 14; + text-fill: @text; + text-halo-fill: @land; + text-halo-radius: 2; + text-min-distance: 4; + text-wrap-width: 60; +} + +// Road labels +#road_label[len>2000][zoom>=12], +#road_label[len>1000][zoom>=15] { + text-placement: line; + text-transform: uppercase; + text-face-name: @sans; + text-name: @name; + text-size: 9; + text-min-distance: 100; + text-halo-fill: @land; + text-halo-radius: 1; + text-fill: @text; + [zoom>=17] { text-size: 11;} +} + + +#water_label { + [zoom<=13], + [zoom>=14][area>500000], + [zoom>=16][area>10000], + [zoom>=17] { + text-name: @name; + text-face-name: @sans_bold; + text-fill: @text; + text-size: 12; + text-halo-fill: @water; + text-halo-radius: 1; + text-wrap-width: 60; + text-wrap-before: true; + text-avoid-edges: true; + } +} + +#waterway[class='river'][name!=null][zoom>=13], +#waterway[class='canal'][name!=null][zoom>=14], +#waterway[class='stream'][name!=null][zoom>=15] { + text-name: @name; + text-face-name: @sans_bold; + text-fill: @text; + text-min-distance: 60; + text-size: 10; + text-halo-fill: @water; + text-halo-radius: 1; + text-wrap-before: true; + text-avoid-edges: true; + text-placement: line; +} + +// Place labels +#poi[class='park'][rank<=2], +#poi[class='airport'][rank<=2], +#poi[class='airfield'][rank<=2], +#poi[class='rail'][rank<=2], +#poi[class='school'][rank<=2], +#poi[class='hospital'][rank<=2] { + text-face-name: @sans_bold; + text-allow-overlap: false; + text-name: @name; + text-size: 9; + text-line-spacing: -2; + text-min-distance: 50; + text-wrap-width: 60; + text-halo-fill: @land; + text-halo-radius: 1; + text-fill: @text; +} diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/package.json b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/package.json new file mode 100644 index 00000000..6d4049f7 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/package.json @@ -0,0 +1,10 @@ +{ + "name": "@mapbox/mapbox-studio-light", + "version": "2.1.1", + "description": "Default style project for Mapbox Studio.", + "main": "./package.json", + "repository": { + "type": "git", + "url": "https://github.com/mapbox/mapbox-studio-light.tm2.git" + } +} \ No newline at end of file diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/project.xml b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/project.xml new file mode 100644 index 00000000..905e4d5e --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/project.xml @@ -0,0 +1,1372 @@ + + + + + + © Mapbox © OpenStreetMap Improve this map]]> + -180,-85.0511,180,85.0511 + 15.293,50.8476,4 + + png8:m=h + 22 + 0 + + + + + + + + + water-shadow + water-fill + + + + waterway + + + + landcover + + + + landuse + + + + park + + + + boundary + + + + aeroway + + + + + + transportation-case + transportation-fill + transportation + + + + building + + + + + + + + + + + place + place-capitals + + + + + + + poi + + \ No newline at end of file diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/project.yml b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/project.yml new file mode 100644 index 00000000..f554b9b7 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/project.yml @@ -0,0 +1,19 @@ +_prefs: {saveCenter: false} +_properties: + bridge: {group-by: layer} +attribution: © Mapbox + © OpenStreetMap + Improve + this map +bounds: [-180, -85.0511, 180, 85.0511] +center: [15.293, 50.8476, 4] +description: A monotone basemap that's easy to recolor. +format: png8:m=h +interactivity_layer: '' +layers: null +maxzoom: 22 +minzoom: 0 +name: Mapbox Light +source: mbtiles://../data\helsinki_finland.mbtiles +styles: [style.mss, labels.mss, roads.mss] +template: '' diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/roads.mss b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/roads.mss new file mode 100644 index 00000000..ca85be07 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/roads.mss @@ -0,0 +1,80 @@ +// dummy styles to set ordering (case below fill) +#transportation { + ::case { opacity: 1; } + ::fill { opacity: 1; } +} + +// consistent case size +@case: 2; + +// Road & Railway Fills // +#transportation[brunnel='tunnel'] { opacity: 0.5; } + +#transportation[zoom<11] { + line-color: @road; + line-width: 0.5; + [class='motorway'] { line-width: 1;} +} + +#transportation::fill[zoom>=11] { + ['mapnik::geometry_type'=2] { + line-color: @road; + line-width: 0.5; + [zoom>=15] { line-width: 1; } + [class='path'] { line-dasharray: 2,2;} + [class='major_rail'], + [class='minor_rail'] { line-dasharray: 3,3; } + [class='motorway'] { + [zoom>=11] { line-width: 2; } + [zoom>=12] { line-width: 3; } + [zoom>=14] { line-width: 4; } + [zoom>=16] { line-width: 7; } + [zoom>=18] { line-width: 10; } + } + [class='motorway'][ramp=1], + [class='trunk'], [class='primary'], [class='secondary'], [class='tertiary'] { + [zoom>=11] { line-width: 1; } + [zoom>=12] { line-width: 2; } + [zoom>=14] { line-width: 3; } + [zoom>=16] { line-width: 5; } + [zoom>=18] { line-width: 7; } + } + [class='minor'], + [class='service'] { + [zoom>=14] { line-width: 1; } + [zoom>=16] { line-width: 2; } + [zoom>=18] { line-width: 4; } + } + [class='service'] { line-dasharray: 4,2; } + } +} + +// Casing for high-zoom roads // +#transportation::case[zoom>=11] { + ['mapnik::geometry_type'=2] { + line-color: @land; + line-width: 1; + [class='motorway'] { + [zoom>=11] { line-width: 2 + @case; } + [zoom>=12] { line-width: 3 + @case; } + [zoom>=14] { line-width: 4 + @case; } + [zoom>=16] { line-width: 7 + @case; } + [zoom>=18] { line-width: 10 + @case; } + } + [class='motorway'][ramp=1], + [class='trunk'], [class='primary'], [class='secondary'], [class='tertiary'] { + [zoom>=11] { line-width: 1 + @case; } + [zoom>=12] { line-width: 2 + @case; } + [zoom>=14] { line-width: 3 + @case; } + [zoom>=16] { line-width: 5 + @case; } + [zoom>=18] { line-width: 7 + @case; } + } + [class='minor'], + [class='service'] { + [zoom>=14] { line-width: 1 + @case; } + [zoom>=16] { line-width: 2 + @case; } + [zoom>=18] { line-width: 4 + @case; } + } + [class='service'] { line-dasharray: 4,2; } + } +} diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/star.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/star.svg new file mode 100644 index 00000000..8f505aa9 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/star.svg @@ -0,0 +1,85 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/style.mss b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/style.mss new file mode 100644 index 00000000..80bd0a11 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-light.tm2/style.mss @@ -0,0 +1,126 @@ +// Languages: name (local), name_en, name_fr, name_es, name_de +@name: '[name]'; + +// Fonts // +@sans: 'Arial Unicode MS Regular'; +@sans_bold: 'Arial Unicode MS Bold'; + +/* +This style is designed to be easily recolored by adjusting the color +variables below. For predicatable feature relationships, +maintain or invert existing value (light to dark) scale. +*/ + +// Color palette // +@road: #fff; +@land: #eee; + +@fill1: #fff; +@fill2: #bbb; +@fill3: #777; +@fill4: #000; + +@text: #777; + +Map { background-color: @land; } + +// Political boundaries // +#boundary[admin_level=2] { + line-join: round; + line-color: mix(@fill3,@fill2,50); + line-width: 1; + [zoom>=5] { line-width: 1.4; } + [zoom>=6] { line-width: 1.8; } + [zoom>=8] { line-width: 2; } + [zoom>=10] { line-width: 3; } + [disputed=1] { line-dasharray: 4,4; } +} + +#boundary[admin_level>2][admin_level<=4] { + line-join: round; + line-color: @fill2; + line-width: 1; + line-dasharray: 3,2; + [zoom>=6] { line-width: 1.5; } + [zoom>=8] { line-width: 1.8; } +} + +// Land Features // +#landuse[class='cemetery'], +#park, +#landcover[class='wood'], +#landcover[class='wetland'] { + polygon-fill: darken(@land,3); + [zoom>=15] { polygon-fill:mix(@land,@fill4,95); } +} + +#landuse[class='pitch'], +#landcover[class='sand'] { + polygon-fill: mix(@land,@fill4,90); +} + +#landuse[class='hospital'], +#landuse[class='industrial'], +#landuse[class='school'] { + polygon-fill: mix(@land,@fill1,95); +} + +#building { + polygon-fill: mix(@fill2,@land,25); + [zoom>=16]{ polygon-fill: mix(@fill2,@land,50);} +} + +#aeroway { + ['mapnik::geometry_type'=3][class!='apron'] { + polygon-fill: mix(@fill2,@land,25); + [zoom>=16]{ polygon-fill: mix(@fill2,@land,50);} + } + ['mapnik::geometry_type'=2] { + line-color: mix(@fill2,@land,25); + line-width: 1; + [zoom>=13][class='runway'] { line-width: 4; } + [zoom>=16] { + [class='runway'] { line-width: 6; } + line-width: 3; + line-color: mix(@fill2,@land,50); + } + } +} + +// Water Features // +#water { + ::shadow { + polygon-fill: mix(@land,@fill4,75); + } + ::fill { + // a fill and overlay comp-op lighten the polygon- + // fill from ::shadow. + polygon-fill: @land; + comp-op: soft-light; + // blurring reveals the polygon fill from ::shadow around + // the edges of the water + image-filters: agg-stack-blur(10,10); + } +} + +// Water color is calculated by sampling the resulting color from +// the soft-light comp-op in the #water layer style above. +@water: #d1d1d1; + +#waterway { + [class='river'], + [class='canal'] { + line-color: @water; + line-width: 0.5; + [zoom>=12] { line-width: 1; } + [zoom>=14] { line-width: 2; } + [zoom>=16] { line-width: 3; } + } + [class='stream'] { + line-color: @water; + line-width: 0.5; + [zoom>=14] { line-width: 1; } + [zoom>=16] { line-width: 2; } + [zoom>=18] { line-width: 3; } + } +} diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/HEAD b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/HEAD new file mode 100644 index 00000000..cb089cd8 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/HEAD @@ -0,0 +1 @@ +ref: refs/heads/master diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/config b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/config new file mode 100644 index 00000000..fb1f1360 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/config @@ -0,0 +1,13 @@ +[core] + repositoryformatversion = 0 + filemode = false + bare = false + logallrefupdates = true + symlinks = false + ignorecase = true +[remote "origin"] + url = https://github.com/openmaptiles/mapbox-studio-osm-bright.tm2.git + fetch = +refs/heads/*:refs/remotes/origin/* +[branch "master"] + remote = origin + merge = refs/heads/master diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/description b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/description new file mode 100644 index 00000000..498b267a --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/description @@ -0,0 +1 @@ +Unnamed repository; edit this file 'description' to name the repository. diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/hooks/applypatch-msg.sample b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/hooks/applypatch-msg.sample new file mode 100644 index 00000000..a5d7b84a --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/hooks/applypatch-msg.sample @@ -0,0 +1,15 @@ +#!/bin/sh +# +# An example hook script to check the commit log message taken by +# applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. The hook is +# allowed to edit the commit message file. +# +# To enable this hook, rename this file to "applypatch-msg". + +. git-sh-setup +commitmsg="$(git rev-parse --git-path hooks/commit-msg)" +test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} +: diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/hooks/commit-msg.sample b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/hooks/commit-msg.sample new file mode 100644 index 00000000..b58d1184 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/hooks/commit-msg.sample @@ -0,0 +1,24 @@ +#!/bin/sh +# +# An example hook script to check the commit log message. +# Called by "git commit" with one argument, the name of the file +# that has the commit message. The hook should exit with non-zero +# status after issuing an appropriate message if it wants to stop the +# commit. The hook is allowed to edit the commit message file. +# +# To enable this hook, rename this file to "commit-msg". + +# Uncomment the below to add a Signed-off-by line to the message. +# Doing this in a hook is a bad idea in general, but the prepare-commit-msg +# hook is more suited to it. +# +# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" + +# This example catches duplicate Signed-off-by lines. + +test "" = "$(grep '^Signed-off-by: ' "$1" | + sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { + echo >&2 Duplicate Signed-off-by lines. + exit 1 +} diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/hooks/post-update.sample b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/hooks/post-update.sample new file mode 100644 index 00000000..ec17ec19 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/hooks/post-update.sample @@ -0,0 +1,8 @@ +#!/bin/sh +# +# An example hook script to prepare a packed repository for use over +# dumb transports. +# +# To enable this hook, rename this file to "post-update". + +exec git update-server-info diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/hooks/pre-applypatch.sample b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/hooks/pre-applypatch.sample new file mode 100644 index 00000000..4142082b --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/hooks/pre-applypatch.sample @@ -0,0 +1,14 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed +# by applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-applypatch". + +. git-sh-setup +precommit="$(git rev-parse --git-path hooks/pre-commit)" +test -x "$precommit" && exec "$precommit" ${1+"$@"} +: diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/hooks/pre-commit.sample b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/hooks/pre-commit.sample new file mode 100644 index 00000000..68d62d54 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/hooks/pre-commit.sample @@ -0,0 +1,49 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed. +# Called by "git commit" with no arguments. The hook should +# exit with non-zero status after issuing an appropriate message if +# it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-commit". + +if git rev-parse --verify HEAD >/dev/null 2>&1 +then + against=HEAD +else + # Initial commit: diff against an empty tree object + against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 +fi + +# If you want to allow non-ASCII filenames set this variable to true. +allownonascii=$(git config --bool hooks.allownonascii) + +# Redirect output to stderr. +exec 1>&2 + +# Cross platform projects tend to avoid non-ASCII filenames; prevent +# them from being added to the repository. We exploit the fact that the +# printable range starts at the space character and ends with tilde. +if [ "$allownonascii" != "true" ] && + # Note that the use of brackets around a tr range is ok here, (it's + # even required, for portability to Solaris 10's /usr/bin/tr), since + # the square bracket bytes happen to fall in the designated range. + test $(git diff --cached --name-only --diff-filter=A -z $against | + LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 +then + cat <<\EOF +Error: Attempt to add a non-ASCII file name. + +This can cause problems if you want to work with people on other platforms. + +To be portable it is advisable to rename the file. + +If you know what you are doing you can disable this check using: + + git config hooks.allownonascii true +EOF + exit 1 +fi + +# If there are whitespace errors, print the offending file names and fail. +exec git diff-index --check --cached $against -- diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/hooks/pre-push.sample b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/hooks/pre-push.sample new file mode 100644 index 00000000..6187dbf4 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/hooks/pre-push.sample @@ -0,0 +1,53 @@ +#!/bin/sh + +# An example hook script to verify what is about to be pushed. Called by "git +# push" after it has checked the remote status, but before anything has been +# pushed. If this script exits with a non-zero status nothing will be pushed. +# +# This hook is called with the following parameters: +# +# $1 -- Name of the remote to which the push is being done +# $2 -- URL to which the push is being done +# +# If pushing without using a named remote those arguments will be equal. +# +# Information about the commits which are being pushed is supplied as lines to +# the standard input in the form: +# +# +# +# This sample shows how to prevent push of commits where the log message starts +# with "WIP" (work in progress). + +remote="$1" +url="$2" + +z40=0000000000000000000000000000000000000000 + +while read local_ref local_sha remote_ref remote_sha +do + if [ "$local_sha" = $z40 ] + then + # Handle delete + : + else + if [ "$remote_sha" = $z40 ] + then + # New branch, examine all commits + range="$local_sha" + else + # Update to existing branch, examine new commits + range="$remote_sha..$local_sha" + fi + + # Check for WIP commit + commit=`git rev-list -n 1 --grep '^WIP' "$range"` + if [ -n "$commit" ] + then + echo >&2 "Found WIP commit in $local_ref, not pushing" + exit 1 + fi + fi +done + +exit 0 diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/hooks/pre-rebase.sample b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/hooks/pre-rebase.sample new file mode 100644 index 00000000..9773ed4c --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/hooks/pre-rebase.sample @@ -0,0 +1,169 @@ +#!/bin/sh +# +# Copyright (c) 2006, 2008 Junio C Hamano +# +# The "pre-rebase" hook is run just before "git rebase" starts doing +# its job, and can prevent the command from running by exiting with +# non-zero status. +# +# The hook is called with the following parameters: +# +# $1 -- the upstream the series was forked from. +# $2 -- the branch being rebased (or empty when rebasing the current branch). +# +# This sample shows how to prevent topic branches that are already +# merged to 'next' branch from getting rebased, because allowing it +# would result in rebasing already published history. + +publish=next +basebranch="$1" +if test "$#" = 2 +then + topic="refs/heads/$2" +else + topic=`git symbolic-ref HEAD` || + exit 0 ;# we do not interrupt rebasing detached HEAD +fi + +case "$topic" in +refs/heads/??/*) + ;; +*) + exit 0 ;# we do not interrupt others. + ;; +esac + +# Now we are dealing with a topic branch being rebased +# on top of master. Is it OK to rebase it? + +# Does the topic really exist? +git show-ref -q "$topic" || { + echo >&2 "No such branch $topic" + exit 1 +} + +# Is topic fully merged to master? +not_in_master=`git rev-list --pretty=oneline ^master "$topic"` +if test -z "$not_in_master" +then + echo >&2 "$topic is fully merged to master; better remove it." + exit 1 ;# we could allow it, but there is no point. +fi + +# Is topic ever merged to next? If so you should not be rebasing it. +only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` +only_next_2=`git rev-list ^master ${publish} | sort` +if test "$only_next_1" = "$only_next_2" +then + not_in_topic=`git rev-list "^$topic" master` + if test -z "$not_in_topic" + then + echo >&2 "$topic is already up-to-date with master" + exit 1 ;# we could allow it, but there is no point. + else + exit 0 + fi +else + not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` + /usr/bin/perl -e ' + my $topic = $ARGV[0]; + my $msg = "* $topic has commits already merged to public branch:\n"; + my (%not_in_next) = map { + /^([0-9a-f]+) /; + ($1 => 1); + } split(/\n/, $ARGV[1]); + for my $elem (map { + /^([0-9a-f]+) (.*)$/; + [$1 => $2]; + } split(/\n/, $ARGV[2])) { + if (!exists $not_in_next{$elem->[0]}) { + if ($msg) { + print STDERR $msg; + undef $msg; + } + print STDERR " $elem->[1]\n"; + } + } + ' "$topic" "$not_in_next" "$not_in_master" + exit 1 +fi + +exit 0 + +################################################################ + +This sample hook safeguards topic branches that have been +published from being rewound. + +The workflow assumed here is: + + * Once a topic branch forks from "master", "master" is never + merged into it again (either directly or indirectly). + + * Once a topic branch is fully cooked and merged into "master", + it is deleted. If you need to build on top of it to correct + earlier mistakes, a new topic branch is created by forking at + the tip of the "master". This is not strictly necessary, but + it makes it easier to keep your history simple. + + * Whenever you need to test or publish your changes to topic + branches, merge them into "next" branch. + +The script, being an example, hardcodes the publish branch name +to be "next", but it is trivial to make it configurable via +$GIT_DIR/config mechanism. + +With this workflow, you would want to know: + +(1) ... if a topic branch has ever been merged to "next". Young + topic branches can have stupid mistakes you would rather + clean up before publishing, and things that have not been + merged into other branches can be easily rebased without + affecting other people. But once it is published, you would + not want to rewind it. + +(2) ... if a topic branch has been fully merged to "master". + Then you can delete it. More importantly, you should not + build on top of it -- other people may already want to + change things related to the topic as patches against your + "master", so if you need further changes, it is better to + fork the topic (perhaps with the same name) afresh from the + tip of "master". + +Let's look at this example: + + o---o---o---o---o---o---o---o---o---o "next" + / / / / + / a---a---b A / / + / / / / + / / c---c---c---c B / + / / / \ / + / / / b---b C \ / + / / / / \ / + ---o---o---o---o---o---o---o---o---o---o---o "master" + + +A, B and C are topic branches. + + * A has one fix since it was merged up to "next". + + * B has finished. It has been fully merged up to "master" and "next", + and is ready to be deleted. + + * C has not merged to "next" at all. + +We would want to allow C to be rebased, refuse A, and encourage +B to be deleted. + +To compute (1): + + git rev-list ^master ^topic next + git rev-list ^master next + + if these match, topic has not merged in next at all. + +To compute (2): + + git rev-list master..topic + + if this is empty, it is fully merged to "master". diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/hooks/pre-receive.sample b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/hooks/pre-receive.sample new file mode 100644 index 00000000..a1fd29ec --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/hooks/pre-receive.sample @@ -0,0 +1,24 @@ +#!/bin/sh +# +# An example hook script to make use of push options. +# The example simply echoes all push options that start with 'echoback=' +# and rejects all pushes when the "reject" push option is used. +# +# To enable this hook, rename this file to "pre-receive". + +if test -n "$GIT_PUSH_OPTION_COUNT" +then + i=0 + while test "$i" -lt "$GIT_PUSH_OPTION_COUNT" + do + eval "value=\$GIT_PUSH_OPTION_$i" + case "$value" in + echoback=*) + echo "echo from the pre-receive-hook: ${value#*=}" >&2 + ;; + reject) + exit 1 + esac + i=$((i + 1)) + done +fi diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/hooks/prepare-commit-msg.sample b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/hooks/prepare-commit-msg.sample new file mode 100644 index 00000000..f093a02e --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/hooks/prepare-commit-msg.sample @@ -0,0 +1,36 @@ +#!/bin/sh +# +# An example hook script to prepare the commit log message. +# Called by "git commit" with the name of the file that has the +# commit message, followed by the description of the commit +# message's source. The hook's purpose is to edit the commit +# message file. If the hook fails with a non-zero status, +# the commit is aborted. +# +# To enable this hook, rename this file to "prepare-commit-msg". + +# This hook includes three examples. The first comments out the +# "Conflicts:" part of a merge commit. +# +# The second includes the output of "git diff --name-status -r" +# into the message, just before the "git status" output. It is +# commented because it doesn't cope with --amend or with squashed +# commits. +# +# The third example adds a Signed-off-by line to the message, that can +# still be edited. This is rarely a good idea. + +case "$2,$3" in + merge,) + /usr/bin/perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;; + +# ,|template,) +# /usr/bin/perl -i.bak -pe ' +# print "\n" . `git diff --cached --name-status -r` +# if /^#/ && $first++ == 0' "$1" ;; + + *) ;; +esac + +# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/hooks/update.sample b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/hooks/update.sample new file mode 100644 index 00000000..80ba9413 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/hooks/update.sample @@ -0,0 +1,128 @@ +#!/bin/sh +# +# An example hook script to block unannotated tags from entering. +# Called by "git receive-pack" with arguments: refname sha1-old sha1-new +# +# To enable this hook, rename this file to "update". +# +# Config +# ------ +# hooks.allowunannotated +# This boolean sets whether unannotated tags will be allowed into the +# repository. By default they won't be. +# hooks.allowdeletetag +# This boolean sets whether deleting tags will be allowed in the +# repository. By default they won't be. +# hooks.allowmodifytag +# This boolean sets whether a tag may be modified after creation. By default +# it won't be. +# hooks.allowdeletebranch +# This boolean sets whether deleting branches will be allowed in the +# repository. By default they won't be. +# hooks.denycreatebranch +# This boolean sets whether remotely creating branches will be denied +# in the repository. By default this is allowed. +# + +# --- Command line +refname="$1" +oldrev="$2" +newrev="$3" + +# --- Safety check +if [ -z "$GIT_DIR" ]; then + echo "Don't run this script from the command line." >&2 + echo " (if you want, you could supply GIT_DIR then run" >&2 + echo " $0 )" >&2 + exit 1 +fi + +if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then + echo "usage: $0 " >&2 + exit 1 +fi + +# --- Config +allowunannotated=$(git config --bool hooks.allowunannotated) +allowdeletebranch=$(git config --bool hooks.allowdeletebranch) +denycreatebranch=$(git config --bool hooks.denycreatebranch) +allowdeletetag=$(git config --bool hooks.allowdeletetag) +allowmodifytag=$(git config --bool hooks.allowmodifytag) + +# check for no description +projectdesc=$(sed -e '1q' "$GIT_DIR/description") +case "$projectdesc" in +"Unnamed repository"* | "") + echo "*** Project description file hasn't been set" >&2 + exit 1 + ;; +esac + +# --- Check types +# if $newrev is 0000...0000, it's a commit to delete a ref. +zero="0000000000000000000000000000000000000000" +if [ "$newrev" = "$zero" ]; then + newrev_type=delete +else + newrev_type=$(git cat-file -t $newrev) +fi + +case "$refname","$newrev_type" in + refs/tags/*,commit) + # un-annotated tag + short_refname=${refname##refs/tags/} + if [ "$allowunannotated" != "true" ]; then + echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2 + echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 + exit 1 + fi + ;; + refs/tags/*,delete) + # delete tag + if [ "$allowdeletetag" != "true" ]; then + echo "*** Deleting a tag is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/tags/*,tag) + # annotated tag + if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 + then + echo "*** Tag '$refname' already exists." >&2 + echo "*** Modifying a tag is not allowed in this repository." >&2 + exit 1 + fi + ;; + refs/heads/*,commit) + # branch + if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then + echo "*** Creating a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/heads/*,delete) + # delete branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/remotes/*,commit) + # tracking branch + ;; + refs/remotes/*,delete) + # delete tracking branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a tracking branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + *) + # Anything else (is there anything else?) + echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 + exit 1 + ;; +esac + +# --- Finished +exit 0 diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/index b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/index new file mode 100644 index 00000000..7a635a35 Binary files /dev/null and b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/index differ diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/info/exclude b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/info/exclude new file mode 100644 index 00000000..a5196d1b --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/info/exclude @@ -0,0 +1,6 @@ +# git ls-files --others --exclude-from=.git/info/exclude +# Lines that start with '#' are comments. +# For a project mostly in C, the following would be a good set of +# exclude patterns (uncomment them if you want to use them): +# *.[oa] +# *~ diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/logs/HEAD b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/logs/HEAD new file mode 100644 index 00000000..dc338597 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/logs/HEAD @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 329b2b7cb843c03905a388efdfd53e2f512446c6 jsimomaa 1485497008 +0200 clone: from https://github.com/openmaptiles/mapbox-studio-osm-bright.tm2.git diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/logs/refs/heads/master b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/logs/refs/heads/master new file mode 100644 index 00000000..dc338597 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/logs/refs/heads/master @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 329b2b7cb843c03905a388efdfd53e2f512446c6 jsimomaa 1485497008 +0200 clone: from https://github.com/openmaptiles/mapbox-studio-osm-bright.tm2.git diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/logs/refs/remotes/origin/HEAD b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/logs/refs/remotes/origin/HEAD new file mode 100644 index 00000000..dc338597 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/logs/refs/remotes/origin/HEAD @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 329b2b7cb843c03905a388efdfd53e2f512446c6 jsimomaa 1485497008 +0200 clone: from https://github.com/openmaptiles/mapbox-studio-osm-bright.tm2.git diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/objects/pack/pack-429b808e2e7547e6f27a329e85a0c7fdc87da763.idx b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/objects/pack/pack-429b808e2e7547e6f27a329e85a0c7fdc87da763.idx new file mode 100644 index 00000000..a52c1a52 Binary files /dev/null and b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/objects/pack/pack-429b808e2e7547e6f27a329e85a0c7fdc87da763.idx differ diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/objects/pack/pack-429b808e2e7547e6f27a329e85a0c7fdc87da763.pack b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/objects/pack/pack-429b808e2e7547e6f27a329e85a0c7fdc87da763.pack new file mode 100644 index 00000000..49c6b73c Binary files /dev/null and b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/objects/pack/pack-429b808e2e7547e6f27a329e85a0c7fdc87da763.pack differ diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/packed-refs b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/packed-refs new file mode 100644 index 00000000..7e9260cd --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/packed-refs @@ -0,0 +1,11 @@ +# pack-refs with: peeled fully-peeled +34ad081b8dc402b41ca9ad2e9691baccbc22ca5b refs/remotes/origin/add-mapbox-namespace +329b2b7cb843c03905a388efdfd53e2f512446c6 refs/remotes/origin/master +0ebb8a5a1d784ae826ded2e0d0cd8359e473d487 refs/tags/v1.0.0 +^7e5ab53ba453c8ac64ffc7704524248624231d9e +7181f9d2ead9b95e91fc92150ccd06b92afc63e3 refs/tags/v1.0.1 +05485156365ae883ce26eaf0f646b46754bb7773 refs/tags/v1.0.2 +a121aa20ddcd138bd4d8ed8e51d920811260a4e8 refs/tags/v1.0.3 +a0e285303bc31b65cf587c04b1bc6702d2a33321 refs/tags/v2.0.0 +ee17f7c9b6018b7be9c2e92229573a8b729a3f2c refs/tags/v2.0.1 +191d18519f49f77851e02886b70d94e521ad45eb refs/tags/v2.0.2 diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/refs/heads/master b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/refs/heads/master new file mode 100644 index 00000000..8c3d2aff --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/refs/heads/master @@ -0,0 +1 @@ +329b2b7cb843c03905a388efdfd53e2f512446c6 diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/refs/remotes/origin/HEAD b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/refs/remotes/origin/HEAD new file mode 100644 index 00000000..6efe28ff --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.git.bak/refs/remotes/origin/HEAD @@ -0,0 +1 @@ +ref: refs/remotes/origin/master diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.gitignore b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.gitignore new file mode 100644 index 00000000..e43b0f98 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.gitignore @@ -0,0 +1 @@ +.DS_Store diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.thumb.png b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.thumb.png new file mode 100644 index 00000000..2a5af1ae Binary files /dev/null and b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/.thumb.png differ diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/LICENSE.md b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/LICENSE.md new file mode 100644 index 00000000..173efade --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/LICENSE.md @@ -0,0 +1,34 @@ +Copyright (c) 2013, Mapbox +Modifications copyright (c) 2016, KlokanTech.com & OpenMapTiles contributors. +All rights reserved. + +This document sets forth the licenses under which the design and code in this repository (collectively, the "Style") are made available. + +# Code License + +The CartoCSS files in this repository and the code therein are licensed under the BSD license: + +> Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +> * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +* Neither the name of Mapbox nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# Design License + +The visual design features of the Style (also known as the "look and feel") is licensed under the Creative Commons Attribution 3.0 license. To view a copy of the license, visit http://creativecommons.org/licenses/by/3.0/. Attribution need not be provided on map images, but should be reasonably accessable from maps based on on the Style (for example, in a webpage linked from a copyright notice on the map). + +Copyright, database rights, and any other intellectual property or proprietary rights in vector tiles, satellite or aerial imagery, and any other map data offered by Mapbox for use with the Style are expressly excluded from this license. + +The attribution requirements for the used OpenMapTiles vector tile schema are defined in: https://github.com/openmaptiles/openmaptiles/blob/master/LICENSE.md + +# Icons + +Mapbox waives all copyright in the SVG icons in this repository, under the terms of the CC0 v 1.0 Public Domain Dedication. You may obtain a copy of the dedication at http://creativecommons.org/publicdomain/zero/1.0/. + +THE STYLE IS PROVIDED "AS IS" AND WE HEREBY DISCLAIM ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL WE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +This document is effective for all files in the repository as of June 1, 2016 (excluding prior history maintained in the repository). diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/README.md b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/README.md new file mode 100644 index 00000000..5854e7e8 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/README.md @@ -0,0 +1,3 @@ +# OSM Bright for Mapbox Studio + +A full-featured template / example project for Mapbox Studio using Mapbox Streets vector tiles. diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/_src/make_shields.sh b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/_src/make_shields.sh new file mode 100644 index 00000000..6f3ca93e --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/_src/make_shields.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +motorway='#FFFFFF' + +for reflen in {1..6}; do + sm_width=$(($reflen*5+10)) + sm_height=13 + lg_width=$(($reflen*5+12)) + lg_height=16 + convert -type TrueColorMatte -size ${sm_width}x$sm_height xc:none \ + -fill $motorway -stroke '#888888' \ + -draw "roundRectangle 0,0 $(($sm_width-1)),$(($sm_height-1)), 3,3" \ + ../shield/motorway_sm_$reflen.png + convert -type TrueColorMatte -size ${lg_width}x$lg_height xc:none \ + -fill $motorway -stroke '#888888' \ + -draw "roundRectangle 0,0 $(($lg_width-1)),$(($lg_height-1)), 4,4" \ + ../shield/motorway_lg_$reflen.png +done diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/_src/wave.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/_src/wave.svg new file mode 100644 index 00000000..c9fb2c41 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/_src/wave.svg @@ -0,0 +1,80 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/airfield-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/airfield-12.svg new file mode 100644 index 00000000..74c726a0 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/airfield-12.svg @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/airport-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/airport-12.svg new file mode 100644 index 00000000..cc42dfe8 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/airport-12.svg @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/alcohol-shop-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/alcohol-shop-12.svg new file mode 100644 index 00000000..476eed0d --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/alcohol-shop-12.svg @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/art-gallery-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/art-gallery-12.svg new file mode 100644 index 00000000..7badfa2f --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/art-gallery-12.svg @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/bakery-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/bakery-12.svg new file mode 100644 index 00000000..595198b1 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/bakery-12.svg @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/bank-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/bank-12.svg new file mode 100644 index 00000000..9d64d258 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/bank-12.svg @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/bar-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/bar-12.svg new file mode 100644 index 00000000..caed956a --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/bar-12.svg @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/beer-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/beer-12.svg new file mode 100644 index 00000000..4d1aa203 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/beer-12.svg @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/bicycle-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/bicycle-12.svg new file mode 100644 index 00000000..8b2b3923 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/bicycle-12.svg @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/bus-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/bus-12.svg new file mode 100644 index 00000000..43173094 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/bus-12.svg @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/cafe-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/cafe-12.svg new file mode 100644 index 00000000..fb850c73 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/cafe-12.svg @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/camera-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/camera-12.svg new file mode 100644 index 00000000..e22fad39 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/camera-12.svg @@ -0,0 +1,125 @@ + + + +image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/campsite-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/campsite-12.svg new file mode 100644 index 00000000..c1d35500 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/campsite-12.svg @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/car-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/car-12.svg new file mode 100644 index 00000000..b4d0b08f --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/car-12.svg @@ -0,0 +1,112 @@ + + + +image/svg+xml + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/cemetery-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/cemetery-12.svg new file mode 100644 index 00000000..ab9c3438 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/cemetery-12.svg @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/cinema-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/cinema-12.svg new file mode 100644 index 00000000..a64bc2fe --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/cinema-12.svg @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/clothing-store-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/clothing-store-12.svg new file mode 100644 index 00000000..521b9e51 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/clothing-store-12.svg @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/college-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/college-12.svg new file mode 100644 index 00000000..4e9c14da --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/college-12.svg @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/dog-park-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/dog-park-12.svg new file mode 100644 index 00000000..4468742e --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/dog-park-12.svg @@ -0,0 +1,57 @@ + + + + + + image/svg+xml + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/embassy-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/embassy-12.svg new file mode 100644 index 00000000..3e8dbdee --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/embassy-12.svg @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/entrance-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/entrance-12.svg new file mode 100644 index 00000000..62a1c84b --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/entrance-12.svg @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/fast-food-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/fast-food-12.svg new file mode 100644 index 00000000..a3c2f962 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/fast-food-12.svg @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/ferry-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/ferry-12.svg new file mode 100644 index 00000000..94bcf569 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/ferry-12.svg @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/fire-station-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/fire-station-12.svg new file mode 100644 index 00000000..c2f98260 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/fire-station-12.svg @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/fuel-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/fuel-12.svg new file mode 100644 index 00000000..453213ff --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/fuel-12.svg @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/garden-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/garden-12.svg new file mode 100644 index 00000000..dd0a4ba8 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/garden-12.svg @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/golf-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/golf-12.svg new file mode 100644 index 00000000..ff351b09 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/golf-12.svg @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/grocery-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/grocery-12.svg new file mode 100644 index 00000000..73d172a0 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/grocery-12.svg @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/harbor-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/harbor-12.svg new file mode 100644 index 00000000..97565a6f --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/harbor-12.svg @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/heliport-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/heliport-12.svg new file mode 100644 index 00000000..9c7247eb --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/heliport-12.svg @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/hospital-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/hospital-12.svg new file mode 100644 index 00000000..6dd81510 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/hospital-12.svg @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/laundry-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/laundry-12.svg new file mode 100644 index 00000000..68fc339f --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/laundry-12.svg @@ -0,0 +1,91 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/library-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/library-12.svg new file mode 100644 index 00000000..645ad0be --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/library-12.svg @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/lodging-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/lodging-12.svg new file mode 100644 index 00000000..c67ff60e --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/lodging-12.svg @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/monument-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/monument-12.svg new file mode 100644 index 00000000..95bd4160 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/monument-12.svg @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/museum-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/museum-12.svg new file mode 100644 index 00000000..f73db7cd --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/museum-12.svg @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/music-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/music-12.svg new file mode 100644 index 00000000..97062e25 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/music-12.svg @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/park-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/park-12.svg new file mode 100644 index 00000000..50e8930c --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/park-12.svg @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/pharmacy-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/pharmacy-12.svg new file mode 100644 index 00000000..5441552a --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/pharmacy-12.svg @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/place-of-worship-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/place-of-worship-12.svg new file mode 100644 index 00000000..d6644bd5 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/place-of-worship-12.svg @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/police-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/police-12.svg new file mode 100644 index 00000000..29ea4476 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/police-12.svg @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/post-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/post-12.svg new file mode 100644 index 00000000..1949387e --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/post-12.svg @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/prison-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/prison-12.svg new file mode 100644 index 00000000..d998cd31 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/prison-12.svg @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/rail-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/rail-12.svg new file mode 100644 index 00000000..82701632 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/rail-12.svg @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/rail-light-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/rail-light-12.svg new file mode 100644 index 00000000..c106d2ee --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/rail-light-12.svg @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/rail-metro-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/rail-metro-12.svg new file mode 100644 index 00000000..300961b9 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/rail-metro-12.svg @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/religious-christian-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/religious-christian-12.svg new file mode 100644 index 00000000..da531aa4 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/religious-christian-12.svg @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/religious-jewish-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/religious-jewish-12.svg new file mode 100644 index 00000000..2dc0f145 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/religious-jewish-12.svg @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/religious-muslim-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/religious-muslim-12.svg new file mode 100644 index 00000000..97e919ef --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/religious-muslim-12.svg @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/restaurant-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/restaurant-12.svg new file mode 100644 index 00000000..4f916129 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/restaurant-12.svg @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/school-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/school-12.svg new file mode 100644 index 00000000..0f858fa0 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/school-12.svg @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/shop-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/shop-12.svg new file mode 100644 index 00000000..ccbd3c85 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/shop-12.svg @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/suitcase-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/suitcase-12.svg new file mode 100644 index 00000000..0095f496 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/suitcase-12.svg @@ -0,0 +1,121 @@ + + + +image/svg+xml + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/swimming-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/swimming-12.svg new file mode 100644 index 00000000..f731fac8 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/swimming-12.svg @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/theatre-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/theatre-12.svg new file mode 100644 index 00000000..3facf703 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/theatre-12.svg @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/town-hall-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/town-hall-12.svg new file mode 100644 index 00000000..f90ba4c6 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/town-hall-12.svg @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/zoo-12.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/zoo-12.svg new file mode 100644 index 00000000..380ba2e1 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/icon/zoo-12.svg @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/labels.mss b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/labels.mss new file mode 100644 index 00000000..3a33a2db --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/labels.mss @@ -0,0 +1,283 @@ +// ===================================================================== +// LABELS + +// General notes: +// - `text-halo-rasterizer: fast;` gives a noticeable performance +// boost to render times and is recommended for *all* halos. + +// --------------------------------------------------------------------- +// Languages + +// There are 5 language options in the MapBox Streets vector tiles: +// - Local/default: '[name]' +// - English: '[name_en]' +// - French: '[name_fr]' +// - Spanish: '[name_es]' +// - German: '[name_de]' +@name: '[name_en]'; + + +// --------------------------------------------------------------------- +// Fonts + +// All fontsets should have a good fallback that covers as many glyphs +// as possible. +@fallback: 'Arial Unicode MS Regular'; +@sans: 'Open Sans Regular', @fallback; +@sans_md: 'Open Sans Semibold', @fallback; +@sans_bd: 'Open Sans Bold', 'Arial Unicode MS Bold', @fallback; +@sans_it: 'Open Sans Italic', @fallback; +@sans_lt_italic: 'Open Sans Light Italic', @fallback; +@sans_lt: 'Open Sans Light', @fallback; + +@place_halo: #fff; +@country_text: @land * 0.2; +@country_halo: @place_halo; + + +// --------------------------------------------------------------------- +// Countries + +// The country labels in MapBox Streets vector tiles are placed by hand, +// optimizing the arrangement to fit as many as possible in densely- +// labeled areas. +#place[class='country'][zoom>=2][zoom<=10] { + text-name: @name; + text-face-name: @sans_bd; + [zoom=2] { text-face-name: @sans; } + text-placement: point; + text-size: 9; + text-fill: @country_text; + text-halo-fill: @country_halo; + text-halo-radius: 1; + text-halo-rasterizer: fast; + text-wrap-width: 20; + text-wrap-before: true; + text-line-spacing: -3; + [rank=1] { + [zoom=3] { text-size: 12; text-wrap-width: 60; } + [zoom=4] { text-size: 14; text-wrap-width: 90; } + [zoom=5] { text-size: 20; text-wrap-width: 120; } + [zoom>=6] { text-size: 20; text-wrap-width: 120; } + } + [rank=2] { + [zoom=2] { text-name: [code]; } + [zoom=3] { text-size: 11; } + [zoom=4] { text-size: 13; } + [zoom=5] { text-size: 17; } + [zoom>=6] { text-size: 20; } + } + [rank=3] { + [zoom=3] { text-name: [code]; } + [zoom=4] { text-size: 11; } + [zoom=5] { text-size: 15; } + [zoom=6] { text-size: 17; } + [zoom=7] { text-size: 18; text-wrap-width: 60; } + [zoom>=8] { text-size: 20; text-wrap-width: 120; } + } + [rank=4] { + [zoom=5] { text-size: 13; } + [zoom=6] { text-size: 15; text-wrap-width: 60 } + [zoom=7] { text-size: 16; text-wrap-width: 90; } + [zoom=8] { text-size: 18; text-wrap-width: 120; } + [zoom>=9] { text-size: 20; text-wrap-width: 120; } + } + [rank=5] { + [zoom=5] { text-size: 11; } + [zoom=6] { text-size: 13; } + [zoom=7] { text-size: 14; text-wrap-width: 60; } + [zoom=8] { text-size: 16; text-wrap-width: 90; } + [zoom>=9] { text-size: 18; text-wrap-width: 120; } + } + [rank>=6] { + [zoom=7] { text-size: 12; } + [zoom=8] { text-size: 14; } + [zoom>=9] { text-size: 16; } + } +} + + +// --------------------------------------------------------------------- +// Cities, towns, villages, etc + +// City labels with dots for low zoom levels. +// The separate attachment keeps the size of the XML down. +#place::citydots[class='city'][zoom>=4][zoom<=7] { + // explicitly defining all the `ldir` values wer'e going + // to use shaves a bit off the final project.xml size + shield-file: url("shield/dot.svg"); + shield-unlock-image: true; + shield-name: @name; + shield-size: 12; + [zoom=7] { shield-size: 14; } + shield-face-name: @sans; + shield-placement: point; + shield-fill: #333; + shield-halo-fill: fadeout(#fff, 50%); + shield-halo-radius: 1; + shield-halo-rasterizer: fast; +} + +#place[zoom>=8] { + text-name: @name; + text-face-name: @sans; + text-wrap-width: 120; + text-wrap-before: true; + text-fill: #333; + text-halo-fill: fadeout(#fff, 50%); + text-halo-radius: 1; + text-halo-rasterizer: fast; + text-size: 10; + [class='city'] { + text-face-name: @sans_md; + text-size: 16; + [zoom>=10] { + text-size: 18; + text-wrap-width: 140; + } + [zoom>=12] { + text-size: 24; + text-wrap-width: 180; + } + // Hide at largest scales: + [zoom>=16] { text-name: "''"; } + } + [class='town'] { + text-size: 14; + [zoom>=12] { text-size: 16; } + [zoom>=14] { text-size: 20; } + [zoom>=16] { text-size: 24; } + // Hide at largest scales: + [zoom>=18] { text-name: "''"; } + } + [class='village'] { + text-size: 12; + [zoom>=12] { text-size: 14; } + [zoom>=14] { text-size: 18; } + [zoom>=16] { text-size: 22; } + } + [class='hamlet'], + [class='suburb'], + [class='neighbourhood'] { + text-fill: #633; + text-face-name: @sans_bd; + text-transform: uppercase; + text-character-spacing: 0.5; + [zoom>=14] { text-size: 11; } + [zoom>=15] { text-size: 12; text-character-spacing: 1; } + [zoom>=16] { text-size: 14; text-character-spacing: 2; } + } +} + + +// --------------------------------------------------------------------- +// Points of interest + +#poi[zoom=14][rank<=1], +#poi[zoom=15][rank<=2], +#poi[zoom=16][rank<=3], +#poi[zoom=17][rank<=4], +#poi[zoom>=18] { + // Separate icon and label attachments are created to ensure that + // all icon placement happens first, then labels are placed only + // if there is still room. + ::icon[class!=null] { + // The [maki] field values match a subset of Maki icon names, so we + // can use that in our url expression. + // Not all POIs have a Maki icon assigned, so we limit this section + // to those that do. See also + marker-fill:#666; + marker-file:url('icon/[class]-12.svg'); + } + ::label { + text-name: '[name]'; + text-face-name: @sans_md; + text-size: 12; + text-fill: #666; + text-halo-fill: fadeout(#fff, 50%); + text-halo-radius: 1; + text-halo-rasterizer: fast; + text-wrap-width: 70; + text-line-spacing: -1; + //text-transform: uppercase; + //text-character-spacing: 0.25; + // POI labels with an icon need to be offset: + [class!=null] { text-dy: 8; } + } +} + + +// --------------------------------------------------------------------- +// Roads + +#transportation_name::shield-pt[class='motorway'][zoom>=7][zoom<=10][ref_length<=6], +#transportation_name::shield-pt[class='motorway'][zoom>=9][zoom<=10][ref_length<=6], +#transportation_name::shield-ln[zoom>=11][reflen<=6] { + shield-name: "[ref].replace('·', '\n')"; + shield-size: 9; + shield-line-spacing: -4; + shield-file: url('shield/default-[reflen].svg'); + shield-face-name: @sans; + shield-fill: #333; + [zoom>=14] { + shield-transform: scale(1.25,1.25); + shield-size: 11; + } +} +#transportation_name::shield-pt[class='motorway'][zoom>=7][zoom<=10][ref_length<=6], +#transportation_name::shield-pt[class='motorway'][zoom>=9][zoom<=10][ref_length<=6] { + shield-placement: point; + shield-avoid-edges: false; +} +#transportation_name::shield-ln[zoom>=11][reflen<=6] { + shield-placement: line; + shield-spacing: 400; + shield-min-distance: 100; + shield-avoid-edges: true; +} + +#transportation_name { + text-name: '[name]'; + text-placement: line; // text follows line path + text-face-name: @sans; + text-fill: #765; + text-halo-fill: fadeout(#fff, 50%); + text-halo-radius: 1; + text-halo-rasterizer: fast; + text-size: 12; + text-avoid-edges: true; // prevents clipped labels at tile edges + [zoom>=15] { text-size: 13; } +} + + +// --------------------------------------------------------------------- +// Water + +#water_name { + [zoom<=13], // automatic area filtering @ low zooms + [zoom>=14][area>500000], + [zoom>=16][area>10000], + [zoom>=17] { + text-name: @name; + text-face-name: @sans_it; + text-fill: darken(@water, 15); + text-size: 12; + text-wrap-width: 100; + text-wrap-before: true; + text-halo-fill: fadeout(#fff, 75%); + text-halo-radius: 1.5; + } +} + + +// --------------------------------------------------------------------- +// House numbers + +#housenumber[zoom>=18] { + text-name: [housenumber]; + text-face-name: @sans_it; + text-fill: #cba; + text-size: 8; + [zoom=19] { text-size: 10; } + [zoom>=20] { text-size: 12; } +} diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/package.json b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/package.json new file mode 100644 index 00000000..38ec5a74 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/package.json @@ -0,0 +1,10 @@ +{ + "name": "@mapbox/mapbox-studio-osm-bright", + "version": "2.0.2", + "description": "A full-featured template / example project for Mapbox Studio using Mapbox Streets vector tiles.", + "main": "./package.json", + "repository": { + "type": "git", + "url": "https://github.com/mapbox/mapbox-studio-osm-bright.tm2.git" + } +} \ No newline at end of file diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/pattern/wave.png b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/pattern/wave.png new file mode 100644 index 00000000..41f39ed2 Binary files /dev/null and b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/pattern/wave.png differ diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/project.xml b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/project.xml new file mode 100644 index 00000000..9709c4c3 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/project.xml @@ -0,0 +1,2375 @@ + + + + + + © Mapbox © OpenStreetMap Improve this map]]> + -180,-85.0511,180,85.0511 + 8.5027,47.4522,11 + png8:m=h + 22 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + water + water-blur + + + + waterway + + + + + landcover + landcover-overlay + + + + landuse + + + + + + + boundary + + + + aeroway + + + + + transportation-case + transportation-fill + + + + + + building + building-wall + building-roof + + + + water_name + + + + + + transportation_name-shield-ln + transportation_name-shield-pt + transportation_name + + + + + place + place-citydots + + + + housenumber + + + + + poi-icon + poi-label + + \ No newline at end of file diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/project.yml b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/project.yml new file mode 100644 index 00000000..0816f843 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/project.yml @@ -0,0 +1,19 @@ +_prefs: {saveCenter: true} +_properties: + bridge: {group-by: layer} +attribution: © Mapbox + © OpenStreetMap + Improve + this map +bounds: [-180, -85.0511, 180, 85.0511] +center: [8.5027, 47.4522, 11] +description: '' +format: png8:m=h +interactivity_layer: '' +layers: null +maxzoom: 22 +minzoom: 0 +name: OSM Bright 2 +source: mbtiles://../data\helsinki_finland.mbtiles +styles: [style.mss, road.mss, labels.mss] +template: '' diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/road.mss b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/road.mss new file mode 100644 index 00000000..a540b297 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/road.mss @@ -0,0 +1,143 @@ +// Basic color palette, from which variations will be derived. +@motorway: #fc8; +@main: #fea; +@street: #fff; +@street_limited: #f3f3f3; + +// --------------------------------------------------------------------- + +// Roads are split across 3 layers: #road, #bridge, and #tunnel. Each +// road segment will only exist in one of the three layers. The +// #bridge layer makes use of Mapnik's group-by rendering mode; +// attachments in this layer will be grouped by layer for appropriate +// rendering of multi-level overpasses. + +// The main road style is for all 3 road layers and divided into 2 main +// attachments. The 'case' attachment is + +#transportation { + // casing/outlines & single lines + ::case[zoom>=6]['mapnik::geometry_type'=2] { + [class='motorway'] { + line-join:round; + line-color: mix(@motorway, #800, 75); + #road { line-cap: round; } + #tunnel { line-dasharray:3,2; } + [zoom>=6] { line-width:0.4; } + [zoom>=7] { line-width:0.6; } + [zoom>=8] { line-width:1.5; } + [zoom>=10] { line-width:3; } + [zoom>=13] { line-width:3.5; } + [zoom>=14] { line-width:5; } + [zoom>=15] { line-width:7; } + [zoom>=16] { line-width:9; } + } + [class='motorway'][ramp=1][zoom>=13] { + line-join:round; + line-color: mix(@motorway, #800, 75); + #road { line-cap: round; } + #tunnel { line-dasharray:3,2; } + [zoom>=13] { line-width:1; } + [zoom>=14] { line-width:3; } + [zoom>=15] { line-width:5; } + [zoom>=16] { line-width:6.5; } + } + [class='primary'],[class='secondary'],[class='tertiary'],[class='trunk'] { + line-join:round; + line-cap: round; + line-color: mix(@main, #800, 75); + [brunnel='tunnel'] { line-dasharray:3,2; } + [zoom>=6] { line-width:0.2; } + [zoom>=7] { line-width:0.4; } + [zoom>=8] { line-width:1.5; } + [zoom>=10] { line-width:2.4; } + [zoom>=13] { line-width:2.5; } + [zoom>=14] { line-width:4; } + [zoom>=15] { line-width:5; } + [zoom>=16] { line-width:8; } + } + [class='minor'][zoom>=12] { + line-join:round; + line-cap: round; + [brunnel='tunnel'] { line-dasharray:3,2; } + line-color: @land * 0.8; + [zoom>=12] { line-width:0.5; } + [zoom>=14] { line-width:1; } + [zoom>=15] { line-width:4; } + [zoom>=16] { line-width:6.5; } + } + [class='service'][zoom>=15] { + line-join:round; + line-cap: round; + [brunnel='tunnel'] { line-dasharray:3,2; } + line-color: @land * 0.9; + [zoom>=15] { line-width:1; } + [zoom>=16] { line-width:4; } + } + [class='path'][zoom>=15] { + line-color: #cba; + line-dasharray: 2,1; + [zoom>=16] { line-width: 1.2; } + [zoom>=17] { line-width: 1.5; } + } + } + + // fill/inlines + ::fill[zoom>=6]['mapnik::geometry_type'=2] { + [class='motorway'][zoom>=8] { + line-join:round; + line-cap:round; + line-color:@motorway; + [brunnel='tunnel'] { line-color:lighten(@motorway,4); } + [zoom>=8] { line-width:0.5; } + [zoom>=10] { line-width:1; } + [zoom>=13] { line-width:2; } + [zoom>=14] { line-width:3.5; } + [zoom>=15] { line-width:5; } + [zoom>=16] { line-width:7; } + } + [class='motorway'][ramp=1][zoom>=14] { + line-join:round; + line-cap: round; + line-color:@motorway; + [brunnel='tunnel'] { line-color:lighten(@motorway,4); } + [zoom>=14] { line-width:1.5; } + [zoom>=15] { line-width:3; } + [zoom>=16] { line-width:4.5; } + } + [class=~'primary|secondary|tertiary|trunk'][zoom>=8] { + line-join:round; + #road, #bridge { line-cap: round; } + line-color:@main; + [brunnel='tunnel'] { line-color:lighten(@main,4); } + [zoom>=8] { line-width:0.5; } + [zoom>=10] { line-width:1; } + [zoom>=13] { line-width:1.5; } + [zoom>=14] { line-width:2.5; } + [zoom>=15] { line-width:3.5; } + [zoom>=16] { line-width:6; } + } + [class='minor'][zoom>=15], { + line-join:round; + line-cap: round; + [zoom>=15] { line-width:2.5; line-color:#fff; } + [zoom>=16] { line-width:4; } + } + [class='service'][zoom>=16], { + line-join:round; + line-cap: round; + [zoom>=16] { line-width:2; line-color:#fff; } + } + [class='major_rail'] { + line-width: 0.4; + line-color: #bbb; + [zoom>=16] { + line-width: 0.75; + // Hatching + h/line-width: 3; + h/line-color: #bbb; + h/line-dasharray: 1,31; + } + } + } +} diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/default-1.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/default-1.svg new file mode 100644 index 00000000..84623936 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/default-1.svg @@ -0,0 +1,96 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/default-2.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/default-2.svg new file mode 100644 index 00000000..639fc0ae --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/default-2.svg @@ -0,0 +1,96 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/default-3.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/default-3.svg new file mode 100644 index 00000000..1b2c373b --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/default-3.svg @@ -0,0 +1,96 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/default-4.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/default-4.svg new file mode 100644 index 00000000..33cf1416 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/default-4.svg @@ -0,0 +1,96 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/default-5.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/default-5.svg new file mode 100644 index 00000000..49c55e8a --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/default-5.svg @@ -0,0 +1,96 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/default-6.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/default-6.svg new file mode 100644 index 00000000..36bc5089 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/default-6.svg @@ -0,0 +1,96 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/dot.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/dot.svg new file mode 100644 index 00000000..88030946 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/dot.svg @@ -0,0 +1,71 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/mx-federal-1.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/mx-federal-1.svg new file mode 100644 index 00000000..d0982342 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/mx-federal-1.svg @@ -0,0 +1,95 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/mx-federal-2.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/mx-federal-2.svg new file mode 100644 index 00000000..d0982342 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/mx-federal-2.svg @@ -0,0 +1,95 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/mx-federal-3.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/mx-federal-3.svg new file mode 100644 index 00000000..a57afae4 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/mx-federal-3.svg @@ -0,0 +1,95 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/mx-state-1.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/mx-state-1.svg new file mode 100644 index 00000000..b6a6f7bd --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/mx-state-1.svg @@ -0,0 +1,94 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/mx-state-2.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/mx-state-2.svg new file mode 100644 index 00000000..b6a6f7bd --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/mx-state-2.svg @@ -0,0 +1,94 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/mx-state-3.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/mx-state-3.svg new file mode 100644 index 00000000..5ba803aa --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/mx-state-3.svg @@ -0,0 +1,94 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-1.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-1.svg new file mode 100644 index 00000000..78de5ebc --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-1.svg @@ -0,0 +1,87 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-2.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-2.svg new file mode 100644 index 00000000..78de5ebc --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-2.svg @@ -0,0 +1,87 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-3.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-3.svg new file mode 100644 index 00000000..17395f85 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-3.svg @@ -0,0 +1,89 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-alternate-1.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-alternate-1.svg new file mode 100644 index 00000000..558fc431 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-alternate-1.svg @@ -0,0 +1,124 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-alternate-2.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-alternate-2.svg new file mode 100644 index 00000000..558fc431 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-alternate-2.svg @@ -0,0 +1,124 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-alternate-3.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-alternate-3.svg new file mode 100644 index 00000000..aef80843 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-alternate-3.svg @@ -0,0 +1,128 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-business-1.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-business-1.svg new file mode 100644 index 00000000..cd2a76e1 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-business-1.svg @@ -0,0 +1,122 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-business-2.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-business-2.svg new file mode 100644 index 00000000..cd2a76e1 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-business-2.svg @@ -0,0 +1,122 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-business-3.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-business-3.svg new file mode 100644 index 00000000..72946316 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-business-3.svg @@ -0,0 +1,127 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-duplex-3.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-duplex-3.svg new file mode 100644 index 00000000..77681945 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-duplex-3.svg @@ -0,0 +1,89 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-duplex-4.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-duplex-4.svg new file mode 100644 index 00000000..77681945 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-duplex-4.svg @@ -0,0 +1,89 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-duplex-5.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-duplex-5.svg new file mode 100644 index 00000000..77681945 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-duplex-5.svg @@ -0,0 +1,89 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-truck-1.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-truck-1.svg new file mode 100644 index 00000000..6627300f --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-truck-1.svg @@ -0,0 +1,126 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-truck-2.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-truck-2.svg new file mode 100644 index 00000000..6627300f --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-truck-2.svg @@ -0,0 +1,126 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-truck-3.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-truck-3.svg new file mode 100644 index 00000000..5a689307 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-highway-truck-3.svg @@ -0,0 +1,132 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-interstate-1.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-interstate-1.svg new file mode 100644 index 00000000..75edf476 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-interstate-1.svg @@ -0,0 +1,90 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-interstate-2.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-interstate-2.svg new file mode 100644 index 00000000..75edf476 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-interstate-2.svg @@ -0,0 +1,90 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-interstate-3.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-interstate-3.svg new file mode 100644 index 00000000..9a550eb0 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-interstate-3.svg @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-interstate-business-1.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-interstate-business-1.svg new file mode 100644 index 00000000..f40d1418 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-interstate-business-1.svg @@ -0,0 +1,90 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-interstate-business-2.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-interstate-business-2.svg new file mode 100644 index 00000000..f40d1418 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-interstate-business-2.svg @@ -0,0 +1,90 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-interstate-business-3.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-interstate-business-3.svg new file mode 100644 index 00000000..3441b630 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-interstate-business-3.svg @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-interstate-duplex-3.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-interstate-duplex-3.svg new file mode 100644 index 00000000..03e3c44a --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-interstate-duplex-3.svg @@ -0,0 +1,90 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-interstate-duplex-4.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-interstate-duplex-4.svg new file mode 100644 index 00000000..03e3c44a --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-interstate-duplex-4.svg @@ -0,0 +1,90 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-interstate-duplex-5.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-interstate-duplex-5.svg new file mode 100644 index 00000000..03e3c44a --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-interstate-duplex-5.svg @@ -0,0 +1,90 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-state-1.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-state-1.svg new file mode 100644 index 00000000..2e41cce8 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-state-1.svg @@ -0,0 +1,85 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-state-2.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-state-2.svg new file mode 100644 index 00000000..73f3d032 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-state-2.svg @@ -0,0 +1,85 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-state-3.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-state-3.svg new file mode 100644 index 00000000..5fa49573 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-state-3.svg @@ -0,0 +1,85 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-state-4.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-state-4.svg new file mode 100644 index 00000000..d9cd6c16 --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-state-4.svg @@ -0,0 +1,96 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-state-5.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-state-5.svg new file mode 100644 index 00000000..9ec55dab --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-state-5.svg @@ -0,0 +1,96 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-state-6.svg b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-state-6.svg new file mode 100644 index 00000000..aac9a8ec --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/shield/us-state-6.svg @@ -0,0 +1,96 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/style.mss b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/style.mss new file mode 100644 index 00000000..463ab9fb --- /dev/null +++ b/org.simantics.maps.server/server/tm2/mapbox-studio-osm-bright.tm2/style.mss @@ -0,0 +1,174 @@ +// --------------------------------------------------------------------- +// Common Colors + +// You don't need to set up @variables for every color, but it's a good +// idea for colors you might be using in multiple places or as a base +// color for a variety of tints. +// Eg. @water is used in the #water and #waterway layers directly, but +// also in the #water_label and #waterway_label layers inside a color +// manipulation function to get a darker shade of the same hue. +@land: #f8f4f0; +@water: #a0c8f0; + +@state_text: #765; +@state_halo: @place_halo; + +Map { + background-color:@land; +} + +// --------------------------------------------------------------------- +// Political boundaries + +#boundary { + opacity: 0.5; + line-join: round; + line-color: #446; + // Countries + [admin_level=2] { + line-width: 0.8; + line-cap: round; + [zoom>=4] { line-width: 1.2; } + [zoom>=6] { line-width: 2; } + [zoom>=8] { line-width: 4; } + [disputed=1] { line-dasharray: 4,4; } + } +} + // States / Provices / Subregions +#place[class='state'][zoom>=4][zoom<=10] { + text-name: @name; + text-face-name: @sans_lt; + text-placement: point; + text-fill: @state_text; + text-halo-fill: fadeout(lighten(@land,5%),50%); + text-halo-radius: 1; + text-halo-rasterizer: fast; + text-size: 9; + [zoom>=5][zoom<=6] { + text-size: 12; + text-wrap-width: 40; + } + [zoom>=7][zoom<=8] { + text-size: 14; + text-wrap-width: 60; + } + [zoom>=9][zoom<=10] { + text-halo-radius: 2; + text-size: 16; + text-character-spacing: 2; + text-wrap-width: 100; + } +} + +// --------------------------------------------------------------------- +// Water Features + +#water { + polygon-fill: @water - #111; + // Map tiles are 256 pixels by 256 pixels wide, so the height + // and width of tiling pattern images must be factors of 256. + polygon-pattern-file: url(pattern/wave.png); + [zoom<=5] { + // Below zoom level 5 we use Natural Earth data for water, + // which has more obvious seams that need to be hidden. + polygon-gamma: 0.4; + } + ::blur { + // This attachment creates a shadow effect by creating a + // light overlay that is offset slightly south. It also + // create a slight highlight of the land along the + // southern edge of any water body. + polygon-fill: #f0f0ff; + comp-op: soft-light; + image-filters: agg-stack-blur(1,1); + image-filters-inflate: true; + polygon-geometry-transform: translate(0,1); + polygon-clip: false; + } +} + +#waterway { + line-color: @water * 0.9; + line-cap: round; + line-width: 0.5; + [class='river'] { + [zoom>=12] { line-width: 1; } + [zoom>=14] { line-width: 2; } + [zoom>=16] { line-width: 3; } + } + [class='stream'], + [class='stream_intermittent'], + [class='canal'] { + [zoom>=14] { line-width: 1; } + [zoom>=16] { line-width: 2; } + [zoom>=18] { line-width: 3; } + } + [class='stream_intermittent'] { line-dasharray: 6,2,2,2; } +} + +// --------------------------------------------------------------------- +// Landuse areas + +#landcover { + [class='grass'] { polygon-fill: #d8e8c8; } + ::overlay { + // Landuse classes look better as a transparent overlay. + opacity: 0.1; + [class='wood'] { polygon-fill: #6a4; polygon-gamma: 0.5; } + } +} + +#landuse { + // Land-use and land-cover are not well-separated concepts in + // OpenStreetMap, so this layer includes both. The 'class' field + // is a highly opinionated simplification of the myriad LULC + // tag combinations into a limited set of general classes. + [class='cemetery'] { polygon-fill: mix(#d8e8c8, #ddd, 25%); } + [class='hospital'] { polygon-fill: #fde; } + [class='school'] { polygon-fill: #f0e8f8; } +} + +// --------------------------------------------------------------------- +// Buildings + +#building [zoom<=17]{ + // At zoom level 13, only large buildings are included in the + // vector tiles. At zoom level 14+, all buildings are included. + polygon-fill: darken(@land, 50%); + opacity: 0.1; +} +// Seperate attachments are used to draw buildings with depth +// to make them more prominent at high zoom levels +#building [zoom>=18]{ +::wall { polygon-fill:mix(@land, #000, 85); } +::roof { + polygon-fill: darken(@land, 5%); + polygon-geometry-transform:translate(-1,-1.5); + polygon-clip:false; + line-width: 0.5; + line-color: mix(@land, #000, 85); + line-geometry-transform:translate(-1,-1.5); + line-clip:false; + } +} + +// --------------------------------------------------------------------- +// Aeroways + +#aeroway [zoom>=12] { + ['mapnik::geometry_type'=2] { + line-color: @land * 0.96; + [class='runway'] { line-width: 5; } + [class='taxiway'] { + line-width: 1; + [zoom>=15] { line-width: 2; } + } + } + ['mapnik::geometry_type'=3] { + polygon-fill: @land * 0.96; + [class='apron'] { + polygon-fill: @land * 0.98; + } + } +} + diff --git a/org.simantics.maps.server/src/org/simantics/district/maps/server/Activator.java b/org.simantics.maps.server/src/org/simantics/district/maps/server/Activator.java new file mode 100644 index 00000000..eaeda86a --- /dev/null +++ b/org.simantics.maps.server/src/org/simantics/district/maps/server/Activator.java @@ -0,0 +1,54 @@ +package org.simantics.district.maps.server; + +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; +import java.nio.file.Path; +import java.nio.file.Paths; + +import org.eclipse.core.runtime.FileLocator; +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; + +public class Activator implements BundleActivator { + + public static final String PLUGIN_ID = "org.simantics.maps.server"; + private static BundleContext context; + + static BundleContext getContext() { + return context; + } + + /* + * (non-Javadoc) + * + * @see org.osgi.framework.BundleActivator#start(org.osgi.framework. + * BundleContext) + */ + public void start(BundleContext bundleContext) throws Exception { + Activator.context = bundleContext; + } + + /* + * (non-Javadoc) + * + * @see + * org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext bundleContext) throws Exception { + Activator.context = null; + } + + public static Path getNodeJSRoot() throws IOException, URISyntaxException { + URL nodeURL = getContext().getBundle().getEntry("/node"); + URL nodeFileURL = FileLocator.toFileURL(nodeURL); + return Paths.get(nodeFileURL.toURI()); + } + + public static Path getTileserverMapnikRoot() throws IOException, URISyntaxException { + URL serverURL = getContext().getBundle().getEntry("/server"); + URL serverFileURL = FileLocator.toFileURL(serverURL); + return Paths.get(serverFileURL.toURI()); + } + +} diff --git a/org.simantics.maps.server/src/org/simantics/district/maps/server/NodeJS.java b/org.simantics.maps.server/src/org/simantics/district/maps/server/NodeJS.java new file mode 100644 index 00000000..5bbb5ec7 --- /dev/null +++ b/org.simantics.maps.server/src/org/simantics/district/maps/server/NodeJS.java @@ -0,0 +1,66 @@ +package org.simantics.district.maps.server; + +import java.io.IOException; +import java.io.OutputStream; +import java.net.URISyntaxException; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.TimeoutException; + +import org.simantics.district.maps.server.utils.EnvUtil; +import org.zeroturnaround.exec.InvalidExitValueException; +import org.zeroturnaround.exec.ProcessExecutor; +import org.zeroturnaround.exec.stream.slf4j.Slf4jStream; + +public class NodeJS { + + public static final String NODEJS_VERSION = "v4.8.0"; + + private static final String NODE = "node"; + + private static Path nodeJSFolder() throws IOException, URISyntaxException { + StringBuilder sb = new StringBuilder(); + sb.append(NODE).append("-").append(NODEJS_VERSION).append("-").append(getOs()).append("-").append(getArch()); + return Activator.getNodeJSRoot().resolve(sb.toString()); + } + + public static Path executable() throws IOException, URISyntaxException { + String nodeJSexecutable = NODE; + if (EnvUtil.calculateOS() == "win") + nodeJSexecutable = nodeJSexecutable + ".exe"; + return nodeJSFolder().resolve(nodeJSexecutable).toAbsolutePath().normalize(); + } + + private static Path npmExecutable() throws IOException, URISyntaxException { + String npmExecutable = "npm"; + if (EnvUtil.calculateOS() == "win") + npmExecutable = npmExecutable + ".cmd"; + return nodeJSFolder().resolve(npmExecutable).toAbsolutePath().normalize(); + } + + private static String getArch() { + return EnvUtil.calculateArch(); + } + + private static String getOs() { + return EnvUtil.calculateOS(); + } + + public static int npm(OutputStream output, String... args) throws InvalidExitValueException, IOException, InterruptedException, TimeoutException, URISyntaxException { + List actualArgs = new ArrayList<>(); + actualArgs.add(npmExecutable().toString()); + actualArgs.addAll(Arrays.asList(args)); + ProcessExecutor exec = new ProcessExecutor().command(actualArgs).redirectOutput(Slf4jStream.ofCaller().asInfo()).destroyOnExit(); + if (output != null) + exec.redirectOutputAlsoTo(output); + return exec.execute().getExitValue(); + } + + + public static void main(String[] args) throws Exception { + TileserverMapnik server = TileserverMapnikInstance.get(); + server.start(); + } +} diff --git a/org.simantics.maps.server/src/org/simantics/district/maps/server/TileserverMapnik.java b/org.simantics.maps.server/src/org/simantics/district/maps/server/TileserverMapnik.java new file mode 100644 index 00000000..8f3135dc --- /dev/null +++ b/org.simantics.maps.server/src/org/simantics/district/maps/server/TileserverMapnik.java @@ -0,0 +1,258 @@ +package org.simantics.district.maps.server; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.StandardCharsets; +import java.nio.file.DirectoryStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardOpenOption; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.stream.Stream; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.yaml.snakeyaml.Yaml; +import org.zeroturnaround.exec.ProcessExecutor; +import org.zeroturnaround.exec.StartedProcess; +import org.zeroturnaround.exec.stream.slf4j.Slf4jStream; +import org.zeroturnaround.process.PidProcess; +import org.zeroturnaround.process.PidUtil; +import org.zeroturnaround.process.Processes; +import org.zeroturnaround.process.SystemProcess; + +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class TileserverMapnik { + + private static final Logger LOGGER = LoggerFactory.getLogger(TileserverMapnik.class); + private static final String[] ADDITIONAL_DEPENDENCIES = new String[] { "tilelive-vector@3.9.4", "tilelive-tmstyle@0.6.0" }; + + private SystemProcess process; + private Path serverRoot; + private int port; + + private AtomicBoolean running = new AtomicBoolean(false); + + TileserverMapnik(Path serverRoot, int port) { + this.serverRoot = serverRoot.normalize(); + this.port = port; + } + + public void setPort(int port) { + this.port = port; + } + + public boolean isRunning() throws IOException, InterruptedException { + return process == null ? false : process.isAlive() && isReady(); + } + + public boolean isReady() { + return running.get(); + } + + public void start() throws Exception { + // check if existing server is left hanging + if (Files.exists(getPid())) { + String pid = new String(Files.readAllBytes(getPid())); + PidProcess pr = Processes.newPidProcess(Integer.parseInt(pid)); + pr.destroyForcefully(); + } + + // check that npm dependencies are satisfied + if (checkAndInstall(null)) { + checkAndInstall(ADDITIONAL_DEPENDENCIES[0]); + checkAndInstall(ADDITIONAL_DEPENDENCIES[1]); + } + + checkConfigJson(); + checkTm2Styles(); + + if (process != null && process.isAlive()) + return; + + StartedProcess startedProcess = new ProcessExecutor().directory(serverRoot.resolve("tileserver-mapnik").toFile()).destroyOnExit().environment(getEnv()) + .command(NodeJS.executable().toString(), getTessera().toString(), "-c", getConfigJson().toString()) + .redirectOutput(Slf4jStream.ofCaller().asDebug()).start(); + + Process nativeProcess = startedProcess.getProcess(); + process = Processes.newStandardProcess(nativeProcess); + int pid = PidUtil.getPid(nativeProcess); + Files.write(getPid(), (pid + "").getBytes(), StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING); + running.set(true); + } + + private Map getEnv() { + Map env = new HashMap<>(); + env.put("MAPNIK_FONT_PATH", getFonts().toString()); + env.put("ICU_DATA", getICU().toString()); + return env; + } + + public void stop() throws IOException, InterruptedException { + if (process != null && process.isAlive()) { + // gracefully not supported on windows + process.destroyForcefully(); + if (!process.waitFor(2000, TimeUnit.MILLISECONDS)) { + process.destroyForcefully(); + if (process.isAlive()) + LOGGER.error("Could not shutdown TileserverMapnik!"); + } + process = null; + Files.delete(getPid()); + running.set(false); + } + } + + private Path getPid() { + return serverRoot.resolve("pid"); + } + + public void restart() throws Exception { + stop(); + start(); + } + + private boolean checkIfInstalled(String module) throws Exception { + String tileserverMapnik = tileserverMapnikRoot().toString(); + int retVal; + try (ByteArrayOutputStream output = new ByteArrayOutputStream()) { + if (module == null) { + retVal = NodeJS.npm(output, "--prefix", tileserverMapnik, "list"); + } else { + retVal = NodeJS.npm(output, "--prefix", tileserverMapnik, "list", module); + } + String outputString = new String(output.toByteArray(), StandardCharsets.UTF_8); + } + return retVal == 0; + } + + private boolean install(String module) throws Exception { + String tileserverMapnik = tileserverMapnikRoot().toString(); + int retVal; + if (module == null) + retVal = NodeJS.npm(null, "--prefix", tileserverMapnik, "install", "--save"); + else + retVal = NodeJS.npm(null, "--prefix", tileserverMapnik, "install", module, "--save"); + if (retVal != 0) + LOGGER.warn("Could not install module " + module == null ? "package.json" : module + "! " + retVal); + return retVal == 0; + } + + private boolean checkAndInstall(String module) throws Exception { + boolean installed = checkIfInstalled(module); + if (!installed) + install(module); + return !installed; + } + + + private Path tileserverMapnikRoot() { + return serverRoot.resolve("tileserver-mapnik").toAbsolutePath(); + } + + private Path getFonts() { + return serverRoot.resolve("fonts").toAbsolutePath(); + } + + private Path getICU() { + return serverRoot.resolve("tileserver-mapnik/node_modules/tilelive-vector/node_modules/mapnik/lib/binding/node-v46-win32-x64/share/icu").toAbsolutePath(); + } + + private Path getTessera() { + return serverRoot.resolve("tileserver-mapnik/bin/tessera.js").toAbsolutePath(); + } + + private Path getConfigJson() { + return serverRoot.resolve("config.json").toAbsolutePath(); + } + + public List availableMBTiles() throws IOException { + Path data = serverRoot.resolve("data").toAbsolutePath(); + List result = new ArrayList<>(); + try (Stream paths = Files.walk(data)) { + paths.forEach(p -> { + if (!p.equals(data)) { + String tiles = p.getFileName().toString(); + result.add(tiles); + } + }); + } + return result; + } + + private void checkConfigJson() throws JsonParseException, JsonMappingException, IOException { + Path configJson = getConfigJson(); + Map config = new HashMap<>(); + Path tm2 = serverRoot.resolve("tm2").toAbsolutePath(); + try (DirectoryStream stream = Files.newDirectoryStream(tm2)) { + stream.forEach(p -> { + Path projectYaml = p.resolve("project.yml"); + if (Files.exists(projectYaml)) { + // Good + + Map source = new HashMap<>(); + + Path tm2style = serverRoot.relativize(projectYaml.getParent()); + + String prefix = "tmstyle://../"; + String tmStyle = prefix + tm2style.toString(); + source.put("source", tmStyle); + config.put("/" + projectYaml.getParent().getFileName().toString(), source); + } + }); + } + ObjectMapper mapper = new ObjectMapper(); + mapper.writerWithDefaultPrettyPrinter().writeValue(Files.newOutputStream(configJson, StandardOpenOption.TRUNCATE_EXISTING), config); + } + + public void checkTm2Styles() { + Path tm2 = serverRoot.resolve("tm2").toAbsolutePath(); + try (DirectoryStream stream = Files.newDirectoryStream(tm2)) { + stream.forEach(p -> { + Path projectYaml = p.resolve("project.yml"); + Yaml yaml = new Yaml(); + Map data = null; + try (InputStream input = Files.newInputStream(projectYaml, StandardOpenOption.READ)) { + data = yaml.loadAs(input, Map.class); + + Path tiles = serverRoot.relativize(serverRoot.resolve("data").resolve("helsinki_finland.mbtiles"));//.toAbsolutePath().toString().replace("\\", "/"); + + + String tmStyle = "mbtiles://../" + tiles.toString(); + data.put("source", tmStyle); + + } catch (IOException e) { + LOGGER.error("Could not read yaml", e); + } + try { + Files.write(projectYaml, yaml.dump(data).getBytes(), StandardOpenOption.TRUNCATE_EXISTING); + } catch (IOException e) { + LOGGER.error("Could not write yaml", e); + } + }); + } catch (IOException e) { + LOGGER.error("Could not browse tm2 styles", e); + } + } + + public List listStyles() throws IOException { + List results = new ArrayList<>(); + Path tm2 = serverRoot.resolve("tm2").toAbsolutePath(); + try (DirectoryStream stream = Files.newDirectoryStream(tm2)) { + stream.forEach(p -> { + results.add(p.getFileName().toString()); + }); + } + return results; + } + +} diff --git a/org.simantics.maps.server/src/org/simantics/district/maps/server/TileserverMapnikInstance.java b/org.simantics.maps.server/src/org/simantics/district/maps/server/TileserverMapnikInstance.java new file mode 100644 index 00000000..192a0ea6 --- /dev/null +++ b/org.simantics.maps.server/src/org/simantics/district/maps/server/TileserverMapnikInstance.java @@ -0,0 +1,17 @@ +package org.simantics.district.maps.server; + +import java.io.IOException; +import java.net.URISyntaxException; + +import org.simantics.district.maps.server.prefs.MapsServerPreferences; + +public class TileserverMapnikInstance { + + private static TileserverMapnik INSTANCE; + + public static synchronized TileserverMapnik get() throws IOException, URISyntaxException { + if (INSTANCE == null) + INSTANCE = new TileserverMapnik(Activator.getTileserverMapnikRoot(), MapsServerPreferences.defaultPort()); + return INSTANCE; + } +} diff --git a/org.simantics.maps.server/src/org/simantics/district/maps/server/prefs/MapsServerInitializer.java b/org.simantics.maps.server/src/org/simantics/district/maps/server/prefs/MapsServerInitializer.java new file mode 100644 index 00000000..7fa25dd8 --- /dev/null +++ b/org.simantics.maps.server/src/org/simantics/district/maps/server/prefs/MapsServerInitializer.java @@ -0,0 +1,16 @@ +package org.simantics.district.maps.server.prefs; + +import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; +import org.osgi.service.prefs.Preferences; + +public class MapsServerInitializer extends AbstractPreferenceInitializer { + + @Override + public void initializeDefaultPreferences() { + Preferences node = MapsServerPreferences.getPreferences(); + + node.putBoolean(MapsServerPreferences.P_START_AUTOMATICALLY, true); + node.putInt(MapsServerPreferences.P_DEFAULT_PORT, 8080); + } + +} diff --git a/org.simantics.maps.server/src/org/simantics/district/maps/server/prefs/MapsServerPreferences.java b/org.simantics.maps.server/src/org/simantics/district/maps/server/prefs/MapsServerPreferences.java new file mode 100644 index 00000000..b9a5845e --- /dev/null +++ b/org.simantics.maps.server/src/org/simantics/district/maps/server/prefs/MapsServerPreferences.java @@ -0,0 +1,28 @@ +package org.simantics.district.maps.server.prefs; + +import org.eclipse.core.runtime.preferences.DefaultScope; +import org.osgi.service.prefs.Preferences; +//import org.simantics.maps.server.ui.Activator; +import org.simantics.district.maps.server.Activator; + +public class MapsServerPreferences { + + public static final String P_NODE = Activator.PLUGIN_ID; + + public static final String P_START_AUTOMATICALLY = "org.simantics.maps.server.startAutomatically"; + + public static final String P_DEFAULT_PORT = "org.simantics.maps.server.defaultPort"; + + public static Preferences getPreferences() { + return DefaultScope.INSTANCE.getNode(MapsServerPreferences.P_NODE); + } + + public static boolean startAutomatically() { + return getPreferences().getBoolean(P_START_AUTOMATICALLY, true); + } + + public static int defaultPort() { + return getPreferences().getInt(P_DEFAULT_PORT, 8080); + } + +} diff --git a/org.simantics.maps.server/src/org/simantics/district/maps/server/utils/EnvUtil.java b/org.simantics.maps.server/src/org/simantics/district/maps/server/utils/EnvUtil.java new file mode 100644 index 00000000..c1f3f704 --- /dev/null +++ b/org.simantics.maps.server/src/org/simantics/district/maps/server/utils/EnvUtil.java @@ -0,0 +1,22 @@ +package org.simantics.district.maps.server.utils; + +public class EnvUtil { + + public static String calculateArch() { + String osArch = System.getProperty("os.arch", ""); + osArch = osArch.toLowerCase(); + if (osArch.equals("i386") || osArch.equals("i586") || osArch.equals("i686") || osArch.equals("x86")) + return "x86"; + if (osArch.startsWith("amd64") || osArch.startsWith("x86_64")) + return "x64"; + throw new UnsupportedOperationException("Architecture " + osArch + " is not supported!"); + } + + public static String calculateOS() { + String osName = System.getProperty("os.name", ""); + osName = osName.toLowerCase(); + if (osName.startsWith("windows")) + return "win"; + throw new UnsupportedOperationException("Operating system " + osName + " is not supported!"); + } +}